diff --git a/MRM-541/LICENSE b/MRM-541/LICENSE new file mode 100644 index 000000000..774a48b13 --- /dev/null +++ b/MRM-541/LICENSE @@ -0,0 +1,261 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed 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. + + + +For the Java Service Wrapper (v3.2.3): + +Copyright (c) 1999, 2006 Tanuki Software, Inc. + +Permission is hereby granted, free of charge, to any person +obtaining a copy of the Java Service Wrapper and associated +documentation files (the "Software"), to deal in the Software +without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sub-license, +and/or sell copies of the Software, and to permit persons to +whom the Software is furnished to do so, subject to the +following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + + +Portions of the Software have been derived from source code +developed by Silver Egg Technology under the following license: + +BEGIN Silver Egg Techology License ----------------------------------- + + Copyright (c) 2001 Silver Egg Technology + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the "Software"), to deal in the Software without + restriction, including without limitation the rights to use, + copy, modify, merge, publish, distribute, sub-license, and/or + sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following + conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + +END Silver Egg Techology License ------------------------------------- + diff --git a/MRM-541/archiva-cli/pom.xml b/MRM-541/archiva-cli/pom.xml new file mode 100644 index 000000000..70f20a3ce --- /dev/null +++ b/MRM-541/archiva-cli/pom.xml @@ -0,0 +1,116 @@ + + + + + + org.apache.archiva + archiva + 1.2-SNAPSHOT + + 4.0.0 + archiva-cli + Archiva Command Line Client + + + org.apache.archiva + archiva-repository-layer + + + org.apache.archiva + archiva-dependency-tree-consumer + 1.2-SNAPSHOT + runtime + + + org.apache.archiva + archiva-xml-tools + + + org.apache.archiva + archiva-converter + + + org.apache.maven.wagon + wagon-file + + + com.google.code.cli-parser + cli + 7 + + + org.slf4j + slf4j-log4j12 + runtime + + + org.codehaus.plexus + plexus-spring + + + org.slf4j + jcl104-over-slf4j + + + + + + org.apache.maven.plugins + maven-shade-plugin + 1.0.1 + + + package + + shade + + + apache-archiva-cli-${project.version} + + + + + + xerces:xercesImpl + xml-apis:xml-apis + xalan:xalan + commons-beanutils:commons-beanutils + commons-io:commons-io + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.1 + + + + org.apache.maven.archiva.cli.ArchivaCli + + + + + + + diff --git a/MRM-541/archiva-cli/src/main/assembly/archiva-cli-assembly.xml b/MRM-541/archiva-cli/src/main/assembly/archiva-cli-assembly.xml new file mode 100644 index 000000000..7b81464b4 --- /dev/null +++ b/MRM-541/archiva-cli/src/main/assembly/archiva-cli-assembly.xml @@ -0,0 +1,47 @@ + + + + cli + false + + jar + + + + target/classes + / + + + src/main/resources + / + + + + + / + true + runtime + + xml-apis:xml-apis + xalan:xalan + + + + diff --git a/MRM-541/archiva-cli/src/main/java/org/apache/maven/archiva/cli/AbstractProgressConsumer.java b/MRM-541/archiva-cli/src/main/java/org/apache/maven/archiva/cli/AbstractProgressConsumer.java new file mode 100644 index 000000000..9082418c2 --- /dev/null +++ b/MRM-541/archiva-cli/src/main/java/org/apache/maven/archiva/cli/AbstractProgressConsumer.java @@ -0,0 +1,63 @@ +package org.apache.maven.archiva.cli; + +/* + * 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.Date; + +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer; +import org.apache.maven.archiva.consumers.ConsumerException; +import org.apache.maven.archiva.consumers.RepositoryContentConsumer; + +/** + * AbstractProgressConsumer + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public abstract class AbstractProgressConsumer + extends AbstractMonitoredConsumer + implements RepositoryContentConsumer +{ + private int count = 0; + + public void beginScan( ManagedRepositoryConfiguration repository, Date whenGathered ) + throws ConsumerException + { + this.count = 0; + } + + public void processFile( String path ) + throws ConsumerException + { + count++; + if ( ( count % 1000 ) == 0 ) + { + System.out.println( "Files Processed: " + count ); + } + + } + + public void completeScan() + { + System.out.println( "Final Count of Artifacts processed by " + getId() + ": " + count ); + } + +} diff --git a/MRM-541/archiva-cli/src/main/java/org/apache/maven/archiva/cli/ArchivaCli.java b/MRM-541/archiva-cli/src/main/java/org/apache/maven/archiva/cli/ArchivaCli.java new file mode 100644 index 000000000..4462dbcb2 --- /dev/null +++ b/MRM-541/archiva-cli/src/main/java/org/apache/maven/archiva/cli/ArchivaCli.java @@ -0,0 +1,285 @@ +package org.apache.maven.archiva.cli; + +/* + * 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; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.net.MalformedURLException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Properties; + +import org.apache.commons.lang.StringUtils; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.consumers.ConsumerException; +import org.apache.maven.archiva.consumers.InvalidRepositoryContentConsumer; +import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer; +import org.apache.maven.archiva.consumers.RepositoryContentConsumer; +import org.apache.maven.archiva.converter.RepositoryConversionException; +import org.apache.maven.archiva.converter.legacy.LegacyRepositoryConverter; +import org.apache.maven.archiva.repository.RepositoryException; +import org.apache.maven.archiva.repository.scanner.RepositoryScanStatistics; +import org.apache.maven.archiva.repository.scanner.RepositoryScanner; +import org.apache.maven.artifact.manager.WagonManager; +import org.codehaus.plexus.spring.PlexusClassPathXmlApplicationContext; +import org.codehaus.plexus.spring.PlexusToSpringUtils; + +import com.sampullara.cli.Args; +import com.sampullara.cli.Argument; + +/** + * ArchivaCli + * + * @todo add back reading of archiva.xml from a given location + * @author Jason van Zyl + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ArchivaCli +{ + // ---------------------------------------------------------------------------- + // Properties controlling Repository conversion + // ---------------------------------------------------------------------------- + + public static final String SOURCE_REPO_PATH = "sourceRepositoryPath"; + + public static final String TARGET_REPO_PATH = "targetRepositoryPath"; + + public static final String BLACKLISTED_PATTERNS = "blacklistPatterns"; + + private static String getVersion() + throws IOException + { + Properties properties = new Properties(); + properties.load( ArchivaCli.class.getResourceAsStream( "/META-INF/maven/org.apache.archiva/archiva-cli/pom.properties" ) ); + return properties.getProperty( "version" ); + } + + private PlexusClassPathXmlApplicationContext applicationContext; + + public ArchivaCli() + { + applicationContext = + new PlexusClassPathXmlApplicationContext( new String[] { "classpath*:/META-INF/spring-context.xml", + "classpath*:/META-INF/plexus/components.xml" } ); + } + + public static void main( String[] args ) + throws Exception + { + Commands command = new Commands(); + + try + { + Args.parse( command, args ); + } + catch ( IllegalArgumentException e ) + { + System.err.println( e.getMessage() ); + Args.usage( command ); + return; + } + + new ArchivaCli().execute( command ); + } + + private void execute( Commands command ) + throws Exception + { + if ( command.help ) + { + Args.usage( command ); + } + else if ( command.version ) + { + System.out.print( "Version: " + getVersion() ); + } + else if ( command.convert ) + { + doConversion( command.properties ); + } + else if ( command.scan ) + { + if ( command.repository == null ) + { + System.err.println( "The repository must be specified." ); + Args.usage( command ); + return; + } + + doScan( command.repository, command.consumers.split( "," ) ); + } + else if ( command.listConsumers ) + { + dumpAvailableConsumers(); + } + else + { + Args.usage( command ); + } + } + + private void doScan( String path, String[] consumers ) + throws ConsumerException, MalformedURLException + { + // hack around poorly configurable project builder by pointing all repositories back at this location to be self + // contained + WagonManager wagonManager = + (WagonManager) applicationContext.getBean( PlexusToSpringUtils.buildSpringId( WagonManager.class.getName() ) ); + wagonManager.addMirror( "internal", "*", new File( path ).toURL().toExternalForm() ); + + ManagedRepositoryConfiguration repo = new ManagedRepositoryConfiguration(); + repo.setId( "cliRepo" ); + repo.setName( "Archiva CLI Provided Repo" ); + repo.setLocation( path ); + + List knownConsumerList = new ArrayList(); + + knownConsumerList.addAll( getConsumerList( consumers ) ); + + List invalidConsumerList = Collections.emptyList(); + + List ignoredContent = new ArrayList(); + ignoredContent.addAll( Arrays.asList( RepositoryScanner.IGNORABLE_CONTENT ) ); + + RepositoryScanner scanner = (RepositoryScanner) lookup( RepositoryScanner.class ); + + try + { + RepositoryScanStatistics stats = + scanner.scan( repo, knownConsumerList, invalidConsumerList, ignoredContent, + RepositoryScanner.FRESH_SCAN ); + + System.out.println( "\n" + stats.toDump( repo ) ); + } + catch ( RepositoryException e ) + { + e.printStackTrace( System.err ); + } + } + + private Object lookup( Class clazz ) + { + return applicationContext.getBean( PlexusToSpringUtils.buildSpringId( clazz.getName(), null ) ); + } + + private List getConsumerList( String[] consumers ) + throws ConsumerException + { + List consumerList = new ArrayList(); + + Map availableConsumers = getConsumers(); + + for ( String specifiedConsumer : consumers ) + { + if ( !availableConsumers.containsKey( specifiedConsumer ) ) + { + System.err.println( "Specified consumer [" + specifiedConsumer + "] not found." ); + dumpAvailableConsumers(); + System.exit( 1 ); + } + + consumerList.add( availableConsumers.get( specifiedConsumer ) ); + } + + return consumerList; + } + + private void dumpAvailableConsumers() + { + Map availableConsumers = getConsumers(); + + System.out.println( ".\\ Available Consumer List \\.______________________________" ); + + for ( Map.Entry entry : availableConsumers.entrySet() ) + { + String consumerHint = (String) entry.getKey(); + RepositoryContentConsumer consumer = (RepositoryContentConsumer) entry.getValue(); + System.out.println( " " + consumerHint + ": " + consumer.getDescription() + " (" + + consumer.getClass().getName() + ")" ); + } + } + + @SuppressWarnings( "unchecked" ) + private Map getConsumers() + { + return PlexusToSpringUtils.lookupMap( "knownRepositoryContentConsumer", applicationContext ); + } + + private void doConversion( String properties ) + throws FileNotFoundException, IOException, RepositoryConversionException + { + LegacyRepositoryConverter legacyRepositoryConverter = + (LegacyRepositoryConverter) lookup( LegacyRepositoryConverter.class ); + + Properties p = new Properties(); + + p.load( new FileInputStream( properties ) ); + + File oldRepositoryPath = new File( p.getProperty( SOURCE_REPO_PATH ) ); + + File newRepositoryPath = new File( p.getProperty( TARGET_REPO_PATH ) ); + + System.out.println( "Converting " + oldRepositoryPath + " to " + newRepositoryPath ); + + List fileExclusionPatterns = null; + + String s = p.getProperty( BLACKLISTED_PATTERNS ); + + if ( s != null ) + { + fileExclusionPatterns = Arrays.asList( StringUtils.split( s, "," ) ); + } + + legacyRepositoryConverter.convertLegacyRepository( oldRepositoryPath, newRepositoryPath, fileExclusionPatterns ); + } + + private static class Commands + { + @Argument( description = "Display help information", value = "help", alias = "h" ) + private boolean help; + + @Argument( description = "Display version information", value = "version", alias = "v" ) + private boolean version; + + @Argument( description = "List available consumers", value = "listconsumers", alias = "l" ) + private boolean listConsumers; + + @Argument( description = "The consumers to use (comma delimited)", value = "consumers", alias = "u" ) + private String consumers = "count-artifacts"; + + @Argument( description = "Scan the specified repository", value = "scan", alias = "s" ) + private boolean scan; + + @Argument( description = "Convert a legacy Maven 1.x repository to a Maven 2.x repository using a properties file to describe the conversion", value = "convert", alias = "c" ) + private boolean convert; + + @Argument( description = "The properties file for the converstion", value = "properties" ) + private String properties = "conversion.properties"; + + @Argument( description = "The repository to scan", value = "repository" ) + private String repository; + } +} diff --git a/MRM-541/archiva-cli/src/main/java/org/apache/maven/archiva/cli/ArtifactCountConsumer.java b/MRM-541/archiva-cli/src/main/java/org/apache/maven/archiva/cli/ArtifactCountConsumer.java new file mode 100644 index 000000000..37fc78020 --- /dev/null +++ b/MRM-541/archiva-cli/src/main/java/org/apache/maven/archiva/cli/ArtifactCountConsumer.java @@ -0,0 +1,96 @@ +package org.apache.maven.archiva.cli; + +/* + * 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.List; + +import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer; + +/** + * ArtifactCountConsumer + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component role="org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer" + * role-hint="count-artifacts" + * instantiation-strategy="per-lookup" + */ +public class ArtifactCountConsumer + extends AbstractProgressConsumer + implements KnownRepositoryContentConsumer +{ + /** + * @plexus.configuration default-value="count-artifacts" + */ + private String id; + + /** + * @plexus.configuration default-value="Count Artifacts" + */ + private String description; + + private List includes; + + public ArtifactCountConsumer() + { + // TODO: shouldn't this use filetypes? + includes = new ArrayList(); + includes.add( "**/*.pom" ); + includes.add( "**/*.jar" ); + includes.add( "**/*.war" ); + includes.add( "**/*.ear" ); + includes.add( "**/*.sar" ); + includes.add( "**/*.car" ); + includes.add( "**/*.mar" ); + includes.add( "**/*.dtd" ); + includes.add( "**/*.tld" ); + includes.add( "**/*.gz" ); + includes.add( "**/*.bz2" ); + includes.add( "**/*.zip" ); + } + + public String getDescription() + { + return description; + } + + public String getId() + { + return id; + } + + public boolean isPermanent() + { + return false; + } + + public List getExcludes() + { + return null; + } + + public List getIncludes() + { + return includes; + } + +} diff --git a/MRM-541/archiva-cli/src/main/java/org/apache/maven/archiva/cli/ProjectReaderConsumer.java b/MRM-541/archiva-cli/src/main/java/org/apache/maven/archiva/cli/ProjectReaderConsumer.java new file mode 100644 index 000000000..2986574c7 --- /dev/null +++ b/MRM-541/archiva-cli/src/main/java/org/apache/maven/archiva/cli/ProjectReaderConsumer.java @@ -0,0 +1,125 @@ +package org.apache.maven.archiva.cli; + +/* + * 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; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.consumers.ConsumerException; +import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer; +import org.apache.maven.archiva.model.ArchivaProjectModel; +import org.apache.maven.archiva.repository.project.ProjectModelException; +import org.apache.maven.archiva.repository.project.ProjectModelReader; +import org.apache.maven.archiva.repository.project.readers.ProjectModel400Reader; + +/** + * ProjectReaderConsumer + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component role="org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer" + * role-hint="read-poms" + * instantiation-strategy="per-lookup" + */ +public class ProjectReaderConsumer + extends AbstractProgressConsumer + implements KnownRepositoryContentConsumer +{ + /** + * @plexus.configuration default-value="read-poms" + */ + private String id; + + /** + * @plexus.configuration default-value="Read POMs and report anomolies." + */ + private String description; + + private ProjectModelReader reader; + + private ManagedRepositoryConfiguration repo; + + private List includes; + + public ProjectReaderConsumer() + { + reader = new ProjectModel400Reader(); + + includes = new ArrayList(); + includes.add( "**/*.pom" ); + } + + public String getDescription() + { + return description; + } + + public String getId() + { + return id; + } + + public boolean isPermanent() + { + return false; + } + + public List getExcludes() + { + return null; + } + + public List getIncludes() + { + return includes; + } + + public void beginScan( ManagedRepositoryConfiguration repository, Date whenGathered ) + throws ConsumerException + { + super.beginScan( repository, whenGathered ); + this.repo = repository; + } + + public void processFile( String path ) + throws ConsumerException + { + super.processFile( path ); + + File pomFile = new File( repo.getLocation(), path ); + try + { + ArchivaProjectModel model = reader.read( pomFile ); + if ( model == null ) + { + System.err.println( "Got null model on " + pomFile ); + } + } + catch ( ProjectModelException e ) + { + System.err.println( "Unable to process: " + pomFile ); + e.printStackTrace( System.out ); + } + } +} diff --git a/MRM-541/archiva-cli/src/main/resources/log4j.properties b/MRM-541/archiva-cli/src/main/resources/log4j.properties new file mode 100644 index 000000000..ff5b14c77 --- /dev/null +++ b/MRM-541/archiva-cli/src/main/resources/log4j.properties @@ -0,0 +1,10 @@ +# Set root logger level to DEBUG and its only appender to A1. +log4j.rootLogger=ERROR, A1 + +# A1 is set to be a ConsoleAppender. +log4j.appender.A1=org.apache.log4j.ConsoleAppender + +# A1 uses PatternLayout. +log4j.appender.A1.layout=org.apache.log4j.PatternLayout +log4j.appender.A1.layout.ConversionPattern=[%t] %-5p %c %x - %m%n + diff --git a/MRM-541/archiva-docs/pom.xml b/MRM-541/archiva-docs/pom.xml new file mode 100644 index 000000000..bd38f139e --- /dev/null +++ b/MRM-541/archiva-docs/pom.xml @@ -0,0 +1,114 @@ + + + + + org.apache.archiva + archiva + 1.2-SNAPSHOT + + 4.0.0 + archiva-docs + pom + Archiva Documentation + http://archiva.apache.org/docs/${project.version}/ + + + + + maven-site-plugin + + + site + package + + site + + + + + + maven-assembly-plugin + 2.1 + + src/site/assembly/docs.xml + + + + package + + single + + + + + + apache-archiva-${project.version} + + + + true + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 2.0.1 + + + + license + project-team + + + + + + + + + + apache.website + ${siteBaseDeployment}/docs/${project.version} + + + + + + release + + + + + maven-site-plugin + + + deploy + deploy + + deploy + + + + + + + + + + diff --git a/MRM-541/archiva-docs/src/site/apt/adminguide/configuration-files.apt b/MRM-541/archiva-docs/src/site/apt/adminguide/configuration-files.apt new file mode 100644 index 000000000..a26775cb4 --- /dev/null +++ b/MRM-541/archiva-docs/src/site/apt/adminguide/configuration-files.apt @@ -0,0 +1,68 @@ + ------ + Configuration Files of Apache Archiva + ------ + +Configuration Files of Apache Archiva + + While Archiva is primarily configured via the graphical administration interface, it stores all configuration in XML configuration + files that can be hand edited and used for backup and migration. + + The following files compose the configuration for Archiva: + + * <<>> - this is the primary Archiva configuration file + + * <<>> - this configures the security as described in the {{{security.html} security configuration documentation}} + + * <<>> - only applies when running the standalone Archiva instance, as described in the {{{standalone.html} installing Archiva standalone documentation}} + + This section will focus on the <<>> file. + +* The Archiva configuration file + + The Archiva configuration file is stored in one of two locations: + + * The application server configuration directory (see {{{standalone.html} installing Archiva standalone}} for more information) + + * The user home directory (<<<~/.m2/archiva.xml>>>). + + [] + + When modified in the GUI, the file is written back to the location it was initially read from, with the home directory taking priority if both exist. When using a + standalone installation, it is highly recommended that a configuration file is only maintained in one of the locations. + + The following shows a basic configuration file: + +---- + + 2 + + + ${appserver.base}/repositories/internal + 30 + internal + Archiva Managed Internal Repository + + + + + http://repo1.maven.org/maven2 + central + Central Repository + + + + + internal + central + + always + fix + never + no + + + + +---- + + ~~TODO: need a full reference diff --git a/MRM-541/archiva-docs/src/site/apt/adminguide/configuration.apt b/MRM-541/archiva-docs/src/site/apt/adminguide/configuration.apt new file mode 100644 index 000000000..346f7f206 --- /dev/null +++ b/MRM-541/archiva-docs/src/site/apt/adminguide/configuration.apt @@ -0,0 +1,22 @@ + ------ + Runtime Configuration of Apache Archiva + ------ + +Runtime Configuration of Apache Archiva + + Archiva is primarily configured via the graphical administration interface. + + The following describe the various sections of the administration menu: + + * {{{repositories.html} Configuring repositories}} + + * {{{proxy-connectors.html} Configuring proxy connectors}} + + * {{{network-proxies.html} Configuring network proxies}} + + * {{{legacy.html} Configuring legacy (maven 1) support}} + + * {{{consumers.html} Configuring repository scanning and consumers}} + + [] + diff --git a/MRM-541/archiva-docs/src/site/apt/adminguide/consumers.apt b/MRM-541/archiva-docs/src/site/apt/adminguide/consumers.apt new file mode 100644 index 000000000..e7f6ee7ef --- /dev/null +++ b/MRM-541/archiva-docs/src/site/apt/adminguide/consumers.apt @@ -0,0 +1,91 @@ + ------ + Understanding Consumers in Apache Archiva + ------ + Maria Odea Ching + ------ + 21 Nov 2007 + ------ + +~~ 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. + +~~ NOTE: For help with the syntax of this file, see: +~~ http://maven.apache.org/guides/mini/guide-apt-format.html + +Understanding Consumers in Apache Archiva + + Archiva makes use of the concept of consumers. Consumers are components which consumes or processes an artifact. There are 2 types + of consumers in Archiva: repository content consumers and database consumers. + +* Repository Content Consumers + + The repository content consumers consume or process artifacts during repository scanning. For every artifact found in the repository, + each consumer processes them. There are 8 available repository content consumers which can be configured in the Repository Scanning + page. These are: + + * - Removes files in the repository being scanned if the file type matches any of the configured file types to be removed. + + * - Automatically renames common artifact mistakes. + + * - Creates the md5 and sha1 checksum files of the artifact if there are none available in the repository. + + * - Adds the content of the artifact (specifically the pom) to the index, allowing the artifact to be searched in Archiva. + + * - Updates artifact metadata files depending on the content of the repository. + + * - Removes old snapshots from the repository either by the number of days old or by the retention count. + + * - Adds the artifact (in the form of ArchivaArtifact) to the database. + + * - Validates the checksum files of the artifact. + +* Database Consumers + + The database consumers, on the other hand, consume or process artifacts during database scanning. The database consumers are split up + into two types: the unprocessed artifacts consumers and the artifact cleanup consumers. + + [[1]] Unprocessed Artifacts Consumers + + These are consumers for those artifacts already in the index that haven't been processed yet, meaning the details about the artifact + are not yet processed and stored in the database. There are 6 unprocessed artifact consumers which can be configured in the + Database page: + + * - Verifies repository metadata files against database. + + * - Indexes the archiva table of contents for full text search. + + * - Indexes the artifact for the 'Find Artifact' functionality. + + * - Gets the details of the artifact from the pom and saves it into the database (as a project model) + + * - Indexes the java public methods for full text search. + + * - Updates database with java bytecode stats. + + [] + [] + [[2]] Artifact Cleanup Consumers + + These are the consumers for cleaning up the database. There are 3 which can be configured in the Database page, and these are: + + * - Removes the artifact from the database if the artifact no longer exists in the file system. + + * - Removes the artifact from the index if the artifact no longer exists in the file system. + + * - Removes the project model of the artifact from the database if the artifact itself no longer exists in the file system. + + \ No newline at end of file diff --git a/MRM-541/archiva-docs/src/site/apt/adminguide/customising-security.apt b/MRM-541/archiva-docs/src/site/apt/adminguide/customising-security.apt new file mode 100644 index 000000000..ffc7ed41e --- /dev/null +++ b/MRM-541/archiva-docs/src/site/apt/adminguide/customising-security.apt @@ -0,0 +1,50 @@ + ----- + Archiva Security Configuration + ----- + +Archiva Security Configuration + + Security properties and password rules can be configured in the + <<>> file, which by default is searched for in: + + * <<<~/.m2/security.properties>>> + + * <<>> in the Archiva installation + + [] + + (In the above list, <<<~>>> is the home directory of the user who is running + Archiva.) + +~~TODO: Link to plexus-redback documentation when available + + Following are some of the properties you can modify. For a complete list, + consult the default properties file in Redback's svn repo: + {{{http://svn.codehaus.org/redback/redback/trunk/redback-configuration/src/main/resources/org/codehaus/plexus/redback/config-defaults.properties} + config-defaults.properties}} + ++-----+ +# Security Policies +#security.policy.password.encoder= +security.policy.password.previous.count=6 +security.policy.password.expiration.days=90 +security.policy.allowed.login.attempt=3 + +# Password Rules +security.policy.password.rule.alphanumeric.enabled=false +security.policy.password.rule.alphacount.enabled=true +security.policy.password.rule.alphacount.minimum=1 +security.policy.password.rule.characterlength.enabled=true +security.policy.password.rule.characterlength.minimum=1 +security.policy.password.rule.characterlength.maximum=8 +security.policy.password.rule.musthave.enabled=true +security.policy.password.rule.numericalcount.enabled=true +security.policy.password.rule.numericalcount.minimum=1 +security.policy.password.rule.reuse.enabled=true +security.policy.password.rule.nowhitespace.enabled=true ++-----+ + + <> If installed standalone, Archiva's list of configuration files is configurable, and + can be found in: + <<>> + diff --git a/MRM-541/archiva-docs/src/site/apt/adminguide/databases.apt b/MRM-541/archiva-docs/src/site/apt/adminguide/databases.apt new file mode 100644 index 000000000..cd56a98fd --- /dev/null +++ b/MRM-541/archiva-docs/src/site/apt/adminguide/databases.apt @@ -0,0 +1,93 @@ + ------ + Apache Archiva Databases + ------ + +Apache Archiva Databases + + Archiva uses an external database for two purposes: + + * Storing artifact information + + * As a default user store for security + + [] + + Generally, it is unnecessary to configure anything - the built in embedded database is suitable for the artifact management, and if + an external authentication mechanism is not needed, the user database. + + However, it is possible to configure an external database as needed. + +* Configuring an external database + + Archiva uses JNDI data sources to locate the databases to use: + + * <<>> - the repository database + + * <<>> - the user store + + Configuring an external database for either or both of these sources depends is configured in <<>> if you are using the + {{{standalone.html} standalone installation}}, or in the application server configuration if you are using the {{{webapp.html} web application + installation}}. + + By default the archiva and users databases are stored in the <<>> directory where Archiva is installed. To change the + path, just edit all instances of the "DatabaseName" property in <<>> (see below). + ++------+ +... + + jdbc/archiva + + + /path/to/database/directory/archiva + sa + create + + + + + + jdbc/archivaShutdown + + + /path/to/database/directory/archiva + sa + shutdown + + + + + + jdbc/users + + + /path/to/database/directory/users + sa + create + + + + + + jdbc/usersShutdown + + + /path/to/database/directory/users + sa + shutdown + + + +... ++------+ + +* Backing up the database + + While it is a good idea to back up both databases, it is not strictly necessary to back up the repository database on a regular basis. Should any + data loss be suffered, this database can be regenerated by deleting it's contents and re-scanning the repositories. + + If you are using the default user security mechanism, it is important to back up the users database on a regular basis to ensure that the user + passwords and information are not lost in the event of corruption. With the default embedded storage this is simply a matter of making a copy of + the database directory on the filesystem. If you have configured an external database as the source for user information, please refer to your + database documentation for backup instructions. + +~~TODO: link to wiki location that does others diff --git a/MRM-541/archiva-docs/src/site/apt/adminguide/index.apt b/MRM-541/archiva-docs/src/site/apt/adminguide/index.apt new file mode 100644 index 000000000..771f900cb --- /dev/null +++ b/MRM-541/archiva-docs/src/site/apt/adminguide/index.apt @@ -0,0 +1,26 @@ + ------ + System Administrators Guide to Apache Archiva + ------ + +System Administrators Guide to Apache Archiva + + Archiva is designed to be simple to install and maintain - including both manual configuration files and a comprehensive + graphical administration interface. + + The following sections describe the process for configuring Archiva for use: + + * {{{installing.html} Installing Archiva}} + + * {{{databases.html} Configuring databases for Archiva}} + + * {{{security.html} Configuring security for Archiva}} + + * {{{configuration.html} Using the graphical administration interface}} + + * {{{configuration-files.html} The configuration files available for Archiva}} + + * {{{reports.html} Repository health reports}} + + [] + + diff --git a/MRM-541/archiva-docs/src/site/apt/adminguide/installing.apt b/MRM-541/archiva-docs/src/site/apt/adminguide/installing.apt new file mode 100644 index 000000000..1aba9bd96 --- /dev/null +++ b/MRM-541/archiva-docs/src/site/apt/adminguide/installing.apt @@ -0,0 +1,15 @@ + ------ + Installing Apache Archiva + ------ + +Installing Apache Archiva + + Whether you choose to install Archiva as a standalone application or as a web application in your preferred Java EE + application server, only a minimal amount of configuration is necessary. + + The following documents cover the different installation alternatives: + + * {{{standalone.html} Installing standalone}} + + * {{{webapp.html} Installing as a web application}} + diff --git a/MRM-541/archiva-docs/src/site/apt/adminguide/legacy.apt b/MRM-541/archiva-docs/src/site/apt/adminguide/legacy.apt new file mode 100644 index 000000000..238429d38 --- /dev/null +++ b/MRM-541/archiva-docs/src/site/apt/adminguide/legacy.apt @@ -0,0 +1,44 @@ + ------ + Apache Archiva legacy repository support configuration + ------ + +Apache Archiva legacy repository support configuration + + Archiva supports both Maven 1 and Maven 2 clients transparently when used as a proxy. The + underlying managed repository can use either the default or legacy layout, and Archiva will + convert the requested path to the expected internal format. + + However, due to the lack of structure in maven 1 "legacy" artifact request format, + Archiva must split the request path to discover artifactId, version and + classifier - and this is not always deterministic. + The strategy used by Archiva has been tested on many existing artifacts in the public central + repository, but users may require support for private artifacts or for + artifacts with classifiers. + + Since version 1.0.1, Archiva provides a legacy support configuration to the administrator. It + is possible to register some custom legacy path and the expected artifact + reference. Archiva will check that the entered artifact reference matches + the legacy path, to avoid corrupted data in repository. + + For example: + + * Path: <<>> + + * Group ID: <<>> + + * Artifact ID: <<>> + + * Version: <<<1.0-FCS>>> + + * Classifier: <<>> + + * Type: <<>> + + This prevents the artifact incorrectly getting translated to a version of <<<1.0>>> and a classifier of <<>>. + + Those custom legacy path are stored in the archiva.xml configuration file. + By default, <<>> is registered, as it is used by some core + Maven 1 plugins (however this is not the case if you upgraded from a previous + version and retained your configuration file). + + diff --git a/MRM-541/archiva-docs/src/site/apt/adminguide/network-proxies.apt b/MRM-541/archiva-docs/src/site/apt/adminguide/network-proxies.apt new file mode 100644 index 000000000..320cac109 --- /dev/null +++ b/MRM-541/archiva-docs/src/site/apt/adminguide/network-proxies.apt @@ -0,0 +1,21 @@ + ------ + Understanding Network Proxy Configuration of Apache Archiva + ------ + +Understanding Network Proxy Configuration of Apache Archiva + + Archiva uses the terminology "proxy" for two different concepts: + + * The remote repository proxying cache, as configured through {{{proxy-connectors.html} proxy connectors}} between repositories + + * Network proxies, which are traditional protocol based proxies (primarily for HTTP access to remote repositories over a firewall) + + [] + + Network proxies are configured using standard HTTP proxy settings as provided by your network administrator. + + Once configured, the network proxy can be attached to operations that access remote resources. At present, this is configured on the + remote repository proxy connectors that need to access the remote repository over the HTTP protocol. + + ~~TODO: walkthrough configuration + diff --git a/MRM-541/archiva-docs/src/site/apt/adminguide/proxy-connectors.apt b/MRM-541/archiva-docs/src/site/apt/adminguide/proxy-connectors.apt new file mode 100644 index 000000000..5737091be --- /dev/null +++ b/MRM-541/archiva-docs/src/site/apt/adminguide/proxy-connectors.apt @@ -0,0 +1,68 @@ + ------ + Understanding Proxy Connector Configuration of Apache Archiva + ------ + +Understanding Proxy Connector Configuration of Apache Archiva + + Archiva uses the terminology "proxy" for two different concepts: + + * The remote repository proxying cache, as configured through proxy connectors between repositories + + * {{{network-proxies.html} Network proxies}}, which are traditional protocol based proxies (primarily for HTTP access to remote repositories over a firewall) + + [] + + A proxy connector is used to link a managed repository (stored on the Archiva machine) to a remote repository (accessed via a URL). This will mean that when a request + is received by the managed repository, the connector is consulted to decide whether it should request the resource from the remote repository (and potentially cache + the result locally for future requests). + + Each managed repository can proxy multiple remote repositories to allow grouping of repositories through a single interface inside the Archiva instance. For instance, + it is common to proxy all remote releases through a single repository for Archiva, as well as a single snapshot repository for all remote snapshot repositories. + + A basic proxy connector configuration simply links the remote repository to the managed repository (with an optional network proxy for access through a firewall). + However, the behaviour of different types of artifacts and paths can be specifically managed by the proxy connectors to make access to remote repositories more flexibly controlled. + +* Configuring policies + + When an artifact is requested from the managed repository and a proxy connector is configured, the policies for the connector are first consulted to decide whether + to retrieve and cache the remote artifact or not. Which policies are applied depends on the type of artifact. + + By default, Archiva comes with the following policies: + + * <<>> - how to behave for released artifact metadata (those not carrying a <<>> version). This can be set to <<>> (default), <<>>, <<>>, <<>> and <<>>. + + * <<>> - how to behave for snapshot artifact metadata (those carrying a <<>> version). This can be set to <<>> (default), <<>>, <<>>, <<>> and <<>>. + + * <<>> - how to handle incorrect checksums when downloading an artifact from the remote repository (ie, the checksum of the artifact does not match the corresponding detached checksum file). + The options are to fail the request for the remote artifact, fix the checksum on the fly (default), or simply ignore the incorrect checksum + + * <<>> - whether failures retrieving the remote artifact should be cached (to save network bandwidth for missing or bad artifacts), or uncached (default). + + * <<>> - if a remote proxy causes an error, this option determines whether an existing artifact should be returned (error when <<>>), or the error passed on regardless (<<>>). + + * <<>> - if a remote error is encountered, <<>> causes the error to be returned immediately, <<>> will return all errors after checking for other successful remote repositories first, and <<>> will disregard ay errors. + + [] + +* Configuring whitelists and blacklists + + By default, all artifact requests to the managed repository are proxied to the remote repository via the proxy connector if the policies pass. However, it can be more efficient to + configure whitelists and blacklists for a given remote repository that match the expected artifacts to be retrieved. + + If only a whitelist is configured, all requests not matching one of the whitelisted elements will be rejected. Conversely, if only a blacklist is configured, all requests not matching one of + the blacklisted elements will be accepted (while those matching will be rejected). If both a whitelist and blacklist are defined, a path must be listed in the whitelist and not in the blacklist + to be accepted - all other requests are rejected. + + The path in the whitelist or blacklist is a repository path, and not an artifact path, and matches the request and format of the remote repository. The characters <<<*>>> and <<<**>>> are wildcards, + with <<<*>>> matching anything in the current path, while <<<**>>> matches anything in the current path and deeper in the directory hierarchy. + + For instance, to only retrieve artifacts in the Apache group ID from a repository, but no artifacts from the Maven group ID, you would configure the following: + + * White list: <<>> + + * Black list: <<>> + + [] + + ~~TODO: walkthrough configuration + diff --git a/MRM-541/archiva-docs/src/site/apt/adminguide/reports.apt b/MRM-541/archiva-docs/src/site/apt/adminguide/reports.apt new file mode 100644 index 000000000..eb95a950b --- /dev/null +++ b/MRM-541/archiva-docs/src/site/apt/adminguide/reports.apt @@ -0,0 +1,66 @@ + ------ + Making the most of Reporting in Apache Archiva + ------ + Maria Odea Ching + ------ + 12 Nov 2007 + ------ + +~~ 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. + +~~ NOTE: For help with the syntax of this file, see: +~~ http://maven.apache.org/guides/mini/guide-apt-format.html + +Making the most of Reporting in Apache Archiva + + Reporting in Archiva is currently limited to a detailed listing of the problematic artifacts in the different + repositories. Problematic artifacts are those artifacts that were detected by Archiva to have defects (ex. + the versions in the pom and in the artifact itself do not match). + +* Configuring a Report + + There are 3 fields which can be configured when viewing the reports. These are: the number of rows per page, + the group id and the repository. + + 1. Setting the row count. This field is for configuring the number of rows or artifacts to be displayed per page + of the report. By default, this is set to 100. The minimum number of rows per page is 10 and the maximum number + of rows is 1000. + + 2. Setting the group id. The group id pertains to the group id of the artifact (ex. org.apache.maven.plugins). + This field has a blank default value -- meaning, show defective artifacts which has any group id. + + 3. Setting the repository. You can view the defective artifacts found on specific repositories by setting the + repository field. By default, it is set to All Repositories. Please note that the repository field options list + only contains the repositories which have one or more defective artifacts in it. So not all the repositories + you have configured in the Repositories section will show up in this list, unless of course they all contain + defective artifacts. + +* Contents of a Report + + The Show Report button will display a detailed list of problematic artifacts filtered according to the + configuration you've set. Below is a sample Archiva report: + + +[../images/archiva-report.jpg] Archiva Report + + You can see in the sample report that there are links to the groupId and artifactId directories + of each artifact. Clicking on any of these links will bring you to the appropriate navigation page in the + Repository Browse. Going back to the report, shown below the links is the specific problem or defect of the + artifact. These are usually detected during repository or database scanning. The page number is also displayed on + the lower left-hand part of the report. + diff --git a/MRM-541/archiva-docs/src/site/apt/adminguide/repositories.apt b/MRM-541/archiva-docs/src/site/apt/adminguide/repositories.apt new file mode 100644 index 000000000..e7d97bc74 --- /dev/null +++ b/MRM-541/archiva-docs/src/site/apt/adminguide/repositories.apt @@ -0,0 +1,180 @@ + ------ + Understanding Repository Configuration of Apache Archiva + ------ + Maria Odea Ching + ------ + 13 Nov 2007 + ------ + +~~ 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. + +~~ NOTE: For help with the syntax of this file, see: +~~ http://maven.apache.org/guides/mini/guide-apt-format.html + +Understanding Repository Configuration of Apache Archiva + +~~TODO: revise more as suggested by Jeff in the dev list + + Archiva has two types of repository configuration: managed repository and remote repository. + +* Managed Repository + + A managed repository is a repository which resides locally to the server where Archiva is running. It could serve as a + proxy repository, an internal deployment repository or a local mirror repository. + + Managed repository fields: + + * - the id of the repository. This must be unique. + + * - the name of the repository. + + * - the location of the repository. If the path specified does not exist, Archiva will create the missing + directories. + + * - the repository layout (maven 2 or maven 1) + + * - the {{{http://quartz.sourceforge.net/javadoc/org/quartz/CronTrigger.html}cron schedule}} when repository scanning will be executed. + + * - the first option for repository purge. Archiva will check how old the artifact is + and if it is older than the set number of days in this field, then the artifact will be deleted respecting the retention + count (see #7) of course. In order to disable the purge by number of days old and set Archiva to purge by retention count, just set the + repository purge field to 0. The maximum number of days which can be set here is 1000. See the Repository Purge section + below for more details. + + * - the second option for repository purge. When running the repository purge, Archiva + will retain only the number of artifacts set for this field for a specific snapshot version. See the Repository Purge section + below for more details. + + * - specifies whether there are released artifacts in the repository. + + * - specifies whether there are snapshot artifacts in the repository. + + * - specifies whether the repository can be scanned, meaning it is a local repository which can be indexed, browsed, + purged, etc. + + * - specifies whether to remove those snapshot artifacts which already has release versions + of it in the repository during repository purge. + + [] + + Each repository has its own Webdav url. This allows the user to browse and access the repository via webdav. The url has the + following format: + ++----+ +http://[URL TO ARCHIVA]/repository/[REPOSITORY ID] (e.g. http://localhost:8080/archiva/repository/releases). ++----+ + + A pom snippet is also available for each repository. The \ section can be copied and pasted into a + project's pom to specify that the project will be deployed in that managed repository. The \ section on the + other hand, can be copied and pasted to a project's pom.xml or to Maven's settings.xml to tell Maven to get artifacts + from the managed repository when building the project. + +* Remote Repository + + A remote repository is a repository which resides remotely. These repositories are usually the proxied repositories. See + Proxy Connectors on how to proxy a repository. + + Remote repository fields: + + * - the id of the remote repository. + + * - the name of the remote repository. + + * - the url of the remote repository. It is also possible to use a 'file://' url to proxy a local repository. Be careful that if this local repository is a managed repository of archiva which has some proxies connectors, those ones won't be triggered. + + * - the username (if authentication is needed) to be used to access the repository. + + * - the password (if authentication is needed) to be used to access the repository. + + * - the layout (maven 2 or maven 1) of the remote repository. + +* Scanning a Repository + + Repository scan can be executed on schedule or it can be explicitly executed by clicking the 'Scan Repository Now' button in + the repositories page. For every artifact found by the repository scanner, processing is done on this artifact by different + consumers. Examples of the processing done are: indexing, repository purge and database update. Details about consumers are + available in the {{{consumers.html} Consumers}} page. + +* Repository Purge + + Repository purge is the process of cleaning up the repository of old snapshots. When deploying a snapshot to a repository, + Maven deploys the project/artifact with a timestamped version. Doing daily/nightly builds of the project then tends to bloat + the repository. What if the artifact is large? Then disk space will definitely be a problem. That's where Archiva's repository + purge feature comes in. Given a criteria to use -- by the number of days old and by retention count, it would clean up the + repository by removing old snapshots. + + Please take note that the by number of days old criteria is activated by default (set to 100 days). In order to de-activate it and + use the by retention count criteria, you must set the Repository Purge By Days Older field to 0. Another thing to note here is that + if the by number of days old criteria is activated, the retention count would still be respected (See the Repository Purge By Days Older + section below for more details) but not the other way around. + + Let's take a look at different behaviours for repository purge using the following scenario: + ++----+ +Artifacts in the repository: + +../artifact-x/2.0-SNAPSHOT/artifact-x-20061118.060401-2.jar +../artifact-x/2.0-SNAPSHOT/artifact-x-20061118.060401-2.pom +../artifact-x/2.0-SNAPSHOT/artifact-x-20070113.034619-3.jar +../artifact-x/2.0-SNAPSHOT/artifact-x-20070113.034619-3.pom +../artifact-x/2.0-SNAPSHOT/artifact-x-20070203.028902-4.jar +../artifact-x/2.0-SNAPSHOT/artifact-x-20070203.028902-4.pom ++----+ + + [[1]] Repository Purge By Days Older + + Using this criteria for the purge, Archiva will check how old an artifact is and if it is older than the set value in the + repository purge by days older field, then the artifact will be deleted respecting the retention count of course. + + If repository purge by days older is set to 100 days (with repository purge by retention count field set to 1), + and the current date is let's say 03-01-2007, given the scenario above.. the following artifacts will be retained: + artifact-x-20070113.034619-3.jar, artifact-x-20070113.034619-3.pom, artifact-x-20070203.028902-4.jar and + artifact-x-20070203.028902-4.pom. It is clear in the version timestamps that these 4 artifacts are not more than + 100 days old from the current date (which is 03-01-2007 in our example) so they are all retained. In this case + the retention count doesn't have any effect since the priority is the age of the artifact. + + Now, if the repository purge by days older is set to 30 days (with repository purge by retention count field still + set to 1) and the current date is still 03-01-2007, then given the same scenario above.. only the following artifacts + will be retained: artifact-x-20070203.028902-4.jar and artifact-x-20070203.028902-4.pom. In this case, we can see + that the retained artifacts are still not older by the number of days set in the repository purge by days older field + and the retention count is still met. + + Now, let's set the repository purge by days older to 10 days (with repository purge by retention count field still + set to 1) and the current date is still 03-01-2007, then still given the same repository contents above.. the + following artifacts will still be retained: artifact-x-20070203.028902-4.jar and artifact-x-20070203.028902-4.pom. + It is clear from the version timestamps that the artifacts ARE MORE THAN the repository purge by days older value, + which is 10 days. Why is it still retained? Recall the value of the repository purge by retention count -- 1 :) + This ensures that there is ALWAYS 1 artifact timestamped version retained for every unique version snapshot directory + of an artifact. + + [[2]] Repository Purge By Retention Count + + If the repository purge by retention count field is set to 2, then only the artifacts artifact-x-20070113.034619-3.jar, + artifact-x-20070113.034619-3.pom, artifact-x-20070203.028902-4.jar and artifact-x-20070203.028902-4.pom will be retained + in the repository. The oldest snapshots will be deleted maintaining only a number of snapshots equivalent to the set + retention count (regardless of how old or new the artifact is). + +* Scanning a Database + + Another scanning process also occurs in Archiva, the database scanning. Same as with repository scanning, + it can also be executed on schedule or explicitly. This can be configured in the 'Database' page, via the 'Database - + Unprocessed Artifacts Scanning' section. + + It is essential that the database scan occur after the repo scan as this is where the pom information of the artifacts in + the database will be processed by the consumers and in turn, added to the database (as ArchivaProjectModel objects). For + more details about the different database consumers, please see the {{{consumers.html} Consumers}} page. \ No newline at end of file diff --git a/MRM-541/archiva-docs/src/site/apt/adminguide/roles.apt b/MRM-541/archiva-docs/src/site/apt/adminguide/roles.apt new file mode 100644 index 000000000..c819ebc34 --- /dev/null +++ b/MRM-541/archiva-docs/src/site/apt/adminguide/roles.apt @@ -0,0 +1,44 @@ + ------ + Understanding Apache Archiva Security Roles + ------ + +Understanding Apache Archiva Security Roles + + Archiva uses the {{{http://redback.codehaus.org/} Redback}} security framework for managing repository security. When the server is first started, + you will be prompted to create an administration user. This user will be given permission to administer all aspects of the system (as well as + access to all of the repositories). This user can then be used to grant permissions to other users. + + A guest user is also created by default, and given read access to the default repositories (<<>> and <<>>). Repositories with + guest user access can be accessed without the use of a username and password (or without being logged in to the web interface). + + However, when new repositories are created, by default no permissions are assigned and only the administrators will have access until it is + explicitly granted. + + Note that Redback has the concept of inferred roles, so the assignment of some roles will imply other roles (which will be displayed in the web interface). + +* Repository Roles + + Archiva contains the following roles for repository access: + + * : users with this role can read from the given repository that the role is for (including access through the browse and search features of the + web interface) + + * : users with this role can write to and administer the given repository that the role is for + + * : users with this role can read from any repository (including access through the browse and search features of the + web interface) + + * : users with this role can write to and administer any repository in the instance + +* General Roles + + Archiva also contains the following general roles for security of the instance: + + * : full access to all functionality in the system + + * : ability to create, edit, and grant roles to other users in the system + + The guest and registered user roles do not affect repository access. + +~~TODO: walkthrough screens + diff --git a/MRM-541/archiva-docs/src/site/apt/adminguide/security.apt b/MRM-541/archiva-docs/src/site/apt/adminguide/security.apt new file mode 100644 index 000000000..043a22239 --- /dev/null +++ b/MRM-541/archiva-docs/src/site/apt/adminguide/security.apt @@ -0,0 +1,16 @@ + ------ + Understanding Apache Archiva Security + ------ + +Understanding Apache Archiva Security + + Archiva's security is managed by {{{http://redback.codehaus.org/} Redback}}. The following document describes how to configure your + repository security: + + * {{{roles.html} Roles in Archiva}} + + * {{{customising-security.html} Customising Security}} + + [] + + ~~TODO: LDAP diff --git a/MRM-541/archiva-docs/src/site/apt/adminguide/standalone.apt b/MRM-541/archiva-docs/src/site/apt/adminguide/standalone.apt new file mode 100644 index 000000000..abe065762 --- /dev/null +++ b/MRM-541/archiva-docs/src/site/apt/adminguide/standalone.apt @@ -0,0 +1,169 @@ + ------ + Installing Standalone Distribution of Apache Archiva + ------ + +Installing Standalone Distribution of Apache Archiva + + Installing the standalone distribution of Archiva is quite simple - for an example, see the {{{../quick-start.html} Quick Start}} guide. + + However, the best way to use this installation technique is to separate the configuration from the installation to make it easy to + upgrade to newer versions in the future. + +* Running Archiva + + Archiva can be run by executing: + + * <<>>, or <<>> for windows (select the one for your environment). The argument can be <<>> to run + interactively, or <<>> to run in the background (in this case, run the script with <<>> to later stop the server). The logs + are available in the <<>> directory where Archiva is installed. + + [] + +* Installing as a Service on Windows + + On Windows, to use the <<>> and <<>> commands you must first install it as a service. This is done by running: + +---- +.\bin\archiva install +---- + + You can then use the <<>> and <<>> commands as well as the traditional Windows service management console to manage the Archiva + service. + + This procedure installs the service to run as the local system user. You must ensure that it has access to read the installation, and to write + to the logs and data directories. + + You can later remove the service with: + +---- +.\bin\archiva remove +---- + +* Separating the base from the installation + + The standalone instance of Archiva uses the Plexus application server, which is capable of separating it's configuration from installation, + in much the same way Tomcat does for example. + + This is achieved by the following steps: + + [[1]] Creating the base location. For example, you might install Archiva in <<>> and the data in <<>>. Create the directories <<>>, <<>> and <<>>. + + [[2]] Copy the configuration files from the Archiva installation (eg <<>> to the new location (eg. <<>>). If you've previously run Archiva, you may need to edit <<>> to change the location of the repositories + + [[3]] Set the environment variable <<>> to the data location (eg. <<>>). In bash, be sure to export the variable. + + [[4]] Start Archiva standalone as described above from the installation location + +* Configuring Archiva + + Archiva's configuration is loaded from the following files, in order of most precedent: + + * <<<~/.m2/archiva.xml>>> + + * <<<$ARCHIVA_BASE/conf/archiva.xml>>> + + * <<>> in the Archiva installation + + When Archiva saves it's configuration, all configuration is stored to a single file. The file chosen is by the following rules: + + * If <<<~/.m2/archiva.xml>>> exists, it is saved there + + * Otherwise, it is saved to <<<$ARCHIVA_BASE/conf/archiva.xml>>>, regardless of whether it previously existed. + + The configuration will never be saved in the Archiva installation directory if you are using a separate base directory. + + Note that the configuration can be edited, but only when Archiva is not running as it will not reload a changed configuration file, and will save over it + if something is changed in the web interface. + +* Database + + By default, Archiva uses embedded {{{http://db.apache.org/derby}Apache Derby}} + to store the user information. It can be configured to use an external database + by providing a JDBC driver and editing the <<>> file. + + [[1]] Place the jar containing the JDBC driver in the <<>> directory of the Archiva installation. + + [[2]] Edit <<>>, providing the JDBC driver class + name, database url, username, and password. + + [] + + The example below uses Mysql for the database server. You can take a look at + {{{http://cwiki.apache.org/confluence/display/ARCHIVA/Archiva+with+MySQL}Archiva with MySQL}} + for more details. + ++------+ + ... + + + + jdbc/archiva + + + localhost + archiva + archiva + sa + + + + + + jdbc/archivaShutdown + + + localhost + archiva + archiva + sa + + + + + + + + jdbc/users + + + localhost + redback + archiva + sa + + + + + + jdbc/usersShutdown + + + jdbc:mysql://localhost/redback + archiva + sa + + + + ... ++------+ + + More information about using Derby Network Server as an external user database + for Archiva can be found on the wiki: + {{{http://cwiki.apache.org/confluence/display/ARCHIVA/Archiva+User+DB+on+Derby+Network+Server} + Archiva User DB on Derby Network Server}} + + +{Upgrading Archiva} + + Upgrading Archiva is straightforward if the directions for separating the base from the installation above are followed. Simply retain the <<>> and <<>> directories, + and the configuration files (in the conf directory, or the other locations specified above) and use a new extracted installation of Archiva. + + Note that the <<>> database must always be retained as it contains the permissions and user information across versions. However, + in order to take advantage of the improvements in search in Archiva 1.1 (and higher versions), s.a. search by java class/package/method, the archiva database must + be re-created. So you need to delete the <<>> directory, delete the <<<.index>>> directories of your respective repositories, and execute the repository and database scanners after + starting Archiva. + + The repository data is portable across versions, and multiple versions can be configured to look at the same repositories (though not run simultaneously). + + + diff --git a/MRM-541/archiva-docs/src/site/apt/adminguide/webapp.apt b/MRM-541/archiva-docs/src/site/apt/adminguide/webapp.apt new file mode 100644 index 000000000..d2242c537 --- /dev/null +++ b/MRM-541/archiva-docs/src/site/apt/adminguide/webapp.apt @@ -0,0 +1,84 @@ + ------ + Installing Apache Archiva as a Web Application + ------ + +Installing Apache Archiva as a Web Application + +~~TODO: link to wiki location for other application servers + + Archiva can be deployed as a web application into any Java EE application server. This document will show an + example of doing so with Tomcat 5.5 and Tomcat 6.0.x. + + <>: When you first start Archiva, you will see an Exception that schema SA does not exist - however it doesn't + cause a problem. If you use a username other than 'sa', such as 'archiva', then you seem to get the same error but + Tomcat fails to start the context and you have to shutdown and restart again. + + +To deploy Archiva on Tomcat 5.5 and Tomcat 6.0 + + * Create a directory in tomcat called archiva, at the same level as bin, conf, logs and the others. + + * Copy the war file into the new directory + + * Create a <<<\/conf/Catalina/localhost/archiva.xml>>> file with the following data (replace the database paths with a suitable location): + ++-------------------------------------------------------------------------+ + + + + + + + + + ++-------------------------------------------------------------------------+ + + * Install <<>> (or later), <<>> and <<>> into the Tomcat 5.5 <<>> or Tomcat 6.0 <<>> directory. + This is required since the data sources are instantiated before the web application. + + <>: Tomcat 5.5.20 and 5.5.23 are missing MailSessionFactory and a + few other classes. JNDI mail sessions will work. Use Tomcat 5.5.25 + instead, or see {{{http://issues.apache.org/bugzilla/show_bug.cgi?id=40668} + Bug 40668}} for a workaround. + + * The ${appserver.base} java property is used by the Archiva internal logging configuration to determine where to output its logs to. + It is important to define this property either in the $CATALINA_OPTS system environment variable (if Tomcat is being launched via the + command line) or the service properties (if being launched as a service or daemon). The format typically expected is + -Dappserver.base=. In this example, we'll put the logs in Tomcat's <<>> directory so we need to set appserver.base + property to where Tomcat is installed: + ++-----------+ +export CATALINA_OPTS="-Dappserver.home=$CATALINA_HOME -Dappserver.base=$CATALINA_HOME" ++-----------+ + + For more information, see {{{http://cwiki.apache.org/confluence/display/ARCHIVA/Archiva+on+Tomcat} Archiva on Tomcat}} in the wiki. + +Archiva Configuration + + Archiva is configured using the <<<~/.m2/archiva.xml>>> configuration file by default when using a Java EE application server. + +~~TODO: how to configure the other file + +Upgrading Archiva + + To upgrade the Archiva web application, simply replace the web application with an alternative. Since the database and configuration files are stored + externally to the application, no further maintainance is needed. + + For general information about upgrading Archiva, see the relevant section in the {{{standalone.html#Upgrading%20Archiva} Installing standalone}} guide. + +Configuring and Running Archiva + + Once Archiva is running, it is configured in the same way as the standalone instance. See the {{{../quick-start.html#Setting%20up%20your%20Archiva%20instance} quick start}} guide for more information. + diff --git a/MRM-541/archiva-docs/src/site/apt/customising/writing-consumer.apt b/MRM-541/archiva-docs/src/site/apt/customising/writing-consumer.apt new file mode 100644 index 000000000..5f70365b3 --- /dev/null +++ b/MRM-541/archiva-docs/src/site/apt/customising/writing-consumer.apt @@ -0,0 +1,87 @@ + ------ + Writing a Consumer Plugin + ------ + Maria Odea Ching + ------ + 23 Nov 2007 + ------ + +~~ 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. + +~~ NOTE: For help with the syntax of this file, see: +~~ http://maven.apache.org/guides/mini/guide-apt-format.html + +Writing a Consumer Plugin + + For a sample custom consumer, you can checkout the archiva-consumer-plugin at the archiva sandbox in the SVN repository: + ++----+ +http://svn.apache.org/repos/asf/archiva/sandbox/archiva-consumer-plugin ++----+ + + Below are the steps on how to create a custom repository consumer and plug it in Archiva: + + [[1]] Create a project for your component. + + [[2]] Declare your class or in this case, consumer as a component as shown in the example below. This + should be put at the class level. + ++----+ +Ex. +@plexus.component role="org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer" + role-hint="discover-new-artifact" + instantiation-strategy="per-lookup" + +where, + role: the interface that your class implements + role-hint: the lookup name of the component (your class/consumer) + instantiation-strategy: how your class will be instantiated ++----+ + + [[3]] Make sure to add the snippet below in the section of the project's pom. This is needed to + generate the components.xml. + ++----+ + + org.codehaus.plexus + plexus-maven-plugin + 1.3.5 + + + generate + + descriptor + + + + ++----+ + + [[4]] Package your project by executing 'mvn clean package' + + [[5]] Let's say you are using the apache-archiva-1.0-bin.tar.gz to run Archiva. Unpack + the binaries then go to bin/linux-x86-32/ (assuming you are running on Linux), then execute + './run.sh console'. Then stop or shutdown Archiva after it started. (This is necessary to unpack + the war file.) + + [[6]] Copy the jar file you created in step 4 in apache-archiva-1.0/apps/archiva/webapp/lib/ + + [[7]] Add the necessary configurations in archiva.xml (in this case, add 'discover-new-artifact' as a + ) + + [[8]] Start up Archiva again. diff --git a/MRM-541/archiva-docs/src/site/apt/index.apt b/MRM-541/archiva-docs/src/site/apt/index.apt new file mode 100644 index 000000000..f89a0beef --- /dev/null +++ b/MRM-541/archiva-docs/src/site/apt/index.apt @@ -0,0 +1,23 @@ + ----- + Welcome to Archiva + ----- + ----- + ----- + + Archiva is a build artifact repository manager for use with + build tools such as {{{http://maven.apache.org} Maven}}, {{{http://continuum.apache.org} Continuum}}, and {{{http://ant.apache.org/} ANT}}. + + With Archiva, you can share artifacts with other developers and manage the associated + security required, aggregate (proxy) content from remote artifact repositories, visualise + your artifact utilisation with search, browse and reporting, and perform routine + maintenance on your repositories. + + To get started with Archiva, you can read the following documentation: + + * {{{quick-start.html} A Quick Getting Started Guide}} + + * {{{userguide/index.html} Users Guide}} + + * {{{adminguide/index.html} Administrators Guide}} + + [] diff --git a/MRM-541/archiva-docs/src/site/apt/quick-start.apt b/MRM-541/archiva-docs/src/site/apt/quick-start.apt new file mode 100644 index 000000000..3ac0c76eb --- /dev/null +++ b/MRM-541/archiva-docs/src/site/apt/quick-start.apt @@ -0,0 +1,73 @@ + ----- + Quick Start + ----- + Henri Yandell + ----- + 1 October 2006 + ----- + +~~ 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. + +~~ NOTE: For help with the syntax of this file, see: +~~ http://maven.apache.org/guides/mini/guide-apt-format.html + +Installing Archiva + + The quickest way to install Archiva is to use the standalone distribution. This includes a bundled Jetty server which can be easily started. + For more information on advanced configuration of this instance, refer to the {{{adminguide/standalone.html} Administration Guide}}. + + To get started right away, you can run the following after unpacking: + +---- +./bin/archiva console (Linux, Mac, Solaris) +.\bin\archiva console (Windows) +---- + + You will need to choose a different start command based on your platform. The <<>> argument + starts the server with the logs going to standard output, and waits for Ctrl+C to stop the server. + + <> A Derby exception "Schema 'SA' does not exist" occurs, but is not of concern. + + Archiva is now running on <<>> + +{Setting up your Archiva instance} + + You can now browse the web administration of Archiva. There will be a few basic setup tasks to get started. + + The first step is to setup your administration user. The password requires a numerical character and must not be + longer than 8 chars. You'll then need to log in. Use 'admin' as the username and the password you've entered. + + At this point, Archiva is fully functional - you can use it with the default repositories and guest user. You might like + to explore the user and administrator guides to find other functionality. + + The default configuration for Archiva configures two repositories: + + * <<>> - a repository for containing released artifacts. This is connected by proxy to the central repository, so requests here will + automatically retrieve the remote artifacts. + + * <<>> - a repository for storing deployed snapshots. This is not proxied to any remote repositories by default. + + In addition, the guest user has read access to these repositories, so you can make anonymous requests to either. To try this out, point a web browser at the following URL: + {{http://localhost:8080/archiva/repository/internal/junit/junit/3.8.1/junit-3.8.1.jar}}. Though the artifact is not present locally, you will see in the Archiva logs that it is + downloaded from the central repository, and then handed back to the browser and downloaded from Archiva. Future requests for the artifact will be much faster as they need not be + downloaded from the central repository. + + Once this artifact is downloaded, Archiva automatically indexes it, so you can access it's information at the following URL: {{http://localhost:8080/archiva/browse/junit/junit/3.8.1/}}. + It will also be available from the search interface. + + diff --git a/MRM-541/archiva-docs/src/site/apt/release-notes.apt b/MRM-541/archiva-docs/src/site/apt/release-notes.apt new file mode 100644 index 000000000..5431145a2 --- /dev/null +++ b/MRM-541/archiva-docs/src/site/apt/release-notes.apt @@ -0,0 +1,403 @@ + ----- + Release Notes for Archiva 1.1.1 + ----- + +Release Notes for Archiva 1.1.1 + + The Apache Archiva team would like to announce the release of Archiva 1.1.1. + + Archiva 1.1.1 is {{{http://archiva.apache.org/download.html} available for download from the web site}}. + + Archiva is an application for managing one or more remote repositories, including administration, artifact handling, browsing and searching. + + If you have any questions, please consult: + + * the web site: {{http://archiva.apache.org/}} + + * the archiva-user mailing list: {{http://archiva.apache.org/mail-lists.html}} + +* New in Archiva 1.1 + +** Artifact Uploads + + To simplify adding artifacts to a repository, an upload form has been put in place that allows you to put an artifact and POM into + the repository without the need for the Maven <<>> command. + +** RSS + + RSS is now available for getting a feed of new artifacts being added to a given repository. Two types of feeds are generated by Archiva: + new artifacts in a repository and new versions of a specific artifact. Details are available in {{{userguide/rss.html}Rss Feeds}}. + +** Virtual Repositories + + Virtual repositories or repository groups allows downloading from a group of repositories via one url. For more details of this feature, + see {{{userguide/virtual-repositories.html}Virtual Repositories}}. + +** Timeouts + + Connections to remote repositories can now have a configurable timeout value + +** New Runtime Bundle + + The application is now distributed using Jetty 6.1 and it's documented configuration, rather than the previous + Plexus application server bundle. It continues to use the Java Service Wrapper (v3.2.3) for application monitoring, + though the configuration has been improved, particularly with regard to separating the application configuration from the installation. + +** Using Spring + + Archiva now uses the Spring Framework as it's underlying container instead of Plexus. This results in a boost in performance and + stability for the web application in particular. + +** Using Apache Jackrabbit WebDAV Servlet + + Archiva now uses Apache Jackrabbit's WebDAV servlet for serving repository content instead of plexus-webdav. The change results in reduced + codebase complexity, increased standards compliance, better webdav client support and a small peformance boost. + +* Release Notes + + The Archiva 1.1 feature set can be seen in the {{{tour/index.html} feature tour}}. + +* Changes in Archiva 1.1.1 + +** Bug + + * [MRM-584] - Newly created user cannot login + + * [MRM-631] - network proxy is always used when defined + + * [MRM-814] - Invalid cron expressions are accepted in Database Scanning + + * [MRM-873] - repository groups - move up/down should not show when it's not possible + + * [MRM-883] - RSS syndication java.lang.ArrayIndexOutOfBoundsException + + * [MRM-884] - network proxy fails after upgrading to archiva 1.1 + + * [MRM-888] - add notes on reindexing to the upgrade docs + + * [MRM-891] - Unable to use archiva as http source with maven-stage-plugin + + * [MRM-892] - Search for java classes and package names is broken + + * [MRM-895] - Archiva version doesn't appear on the footer when it is installed on Tomcat + + * [MRM-896] - classifier is appended to pom filename after artifact upload + +** Improvement + + * [MRM-817] - Artifact information screen should indicate the name of repository in which the artifact resides + + The full list of changes can be found {{{http://jira.codehaus.org/secure/ReleaseNote.jspa?version=14461&styleName=Text&projectId=10980} in JIRA}}. + +* Changes in Archiva 1.1 + +** Sub-task + + * [MRM-801] - Create documentation for virtual repositories + + * [MRM-861] - Paginate Search Results page + +** Bug + + * [MRM-234] - Moving files between repos through webdav doesn't work + + * [MRM-312] - ConcurrentModificationException + + * [MRM-523] - Appearance Actions do not work when ${user.home} is invalid. + + * [MRM-538] - Browse > Info not synchronised with updated POM contents + + * [MRM-550] - proxy connectors - move up/down should not show when it's not possible + + * [MRM-584] - Newly created user cannot login + + * [MRM-597] - Cannot run Archiva as another user because su is run with option "-" (--login) + + * [MRM-602] - add "maintainance" to the feature tour + + * [MRM-605] - unit tests fail on archiva 1.0 source distribution + + * [MRM-610] - a number of unit tests fail on windows + + * [MRM-614] - User validation message has incorrect URL + + * [MRM-624] - Failed to install Archiva as windows service + + * [MRM-629] - NullPointer when setting corporate POM on a fresh archvia install + + * [MRM-638] - some developer reports are appearing in the archiva-docs module and need to be disabled + + * [MRM-650] - Deleted metadata files still appear in search results + + * [MRM-652] - Invalid html links in "webdav" directory browsing + + * [MRM-653] - WebDAV deploy fails with error + + * [MRM-658] - org.apache.maven.archiva.repository.content.FilenameParser is unable to determine unique snapshot versions with specific version names + + * [MRM-682] - Archiva runs out of heap memory + + * [MRM-692] - Repository problem is kept in database even though its related artifact has been already removed + + * [MRM-702] - in the standalone bundle, the pid file is written into the installation directory alongside the wrapper, but should be in a temporary location + + * [MRM-711] - Security using ldap throws NullPointerException + + * [MRM-733] - Error ending component lifecycle + + * [MRM-753] - Error while deploying an artifact to archiva + + * [MRM-767] - generated LICENSE and NOTICE files need improvement + + * [MRM-768] - Cannot proxy maven2 plugin (jaxb) from a maven1 repository (http://download.java.net/maven/1) + + * [MRM-769] - CLONE - 507 Insufficient Storage when deploying artifact with webdav + + * [MRM-777] - assignments.jsp: missing group under "Resource Roles": + + * [MRM-778] - DefaultDavServerManager.createServer doesn't create server + + * [MRM-780] - Access to indexes files with a browser is not possible + + * [MRM-784] - mailing-info on the website points to 'old' maven.apache.org addresses + + * [MRM-785] - No message is displayed after a successful artifact upload + + * [MRM-789] - Archiva may delete you app server installation + + * [MRM-790] - [regression] proxying metadata causes an IO exception in new checksum code + + * [MRM-792] - remove references to maven in code + + * [MRM-796] - releases always activated in repositories + + * [MRM-797] - Delete Released Snapshots doesn't work + + * [MRM-800] - Admin user account user lockout via Webdav only? + + * [MRM-810] - Uploads done through the Web UI are not reported in the audit log + + * [MRM-818] - [Repository Group] Page will be broken if entered identifier is too long + + * [MRM-819] - ERROR 404 page when clicking the URL of Repository Group with identifier i.e. "test/test" + + * [MRM-820] - 404 when the dav url of an Archiva default repository (internal or snapshots) is accessed + + * [MRM-823] - Deleted repository still shows up in the repo group + + * [MRM-824] - dependency cleanup + + * [MRM-835] - Checksum search appears broken + + * [MRM-840] - Wagon HTTP deadlocks under high load + + * [MRM-845] - Continuous Loop when you click a repository group link + + * [MRM-846] - "Repository Purge By Retention Count" option not working + + * [MRM-847] - DependencyTreeGeneratorConsumerTest fails under windows due to line ending + + * [MRM-851] - wrong taglib short-name causes deployment error on Geronimo + + * [MRM-853] - HTTP Error 500 when uploading artifact with Windows OS + + * [MRM-855] - java.lang.NoClassDefFoundError: org/apache/xml/serialize/OutputFormat + + * [MRM-856] - Artifact Upload replaces all instances of the name "jar" with "pom" when trying to change the file extension + + * [MRM-858] - last-modified header is missing + + * [MRM-865] - Upload snapshot should work like a deploy + + * [MRM-867] - 500 on HEAD method + + * [MRM-869] - many empty folders created in managed repos with proxy connectors when used in a group + + * [MRM-870] - addRepositoryToGroup.action => AbstractMethodError on DeferredDocumentImpl.getXmlStandalone() + + * [MRM-871] - jetty.host and jetty.port properties are set by default in jetty.xml preventing user from using other hostname if user is not aware of these properties + + * [MRM-872] - empty metadatas frmo a repository group + +** Improvement + + * [MRM-591] - Reports should show from which repository the defective artifact was found. + + * [MRM-651] - Updated consumer plugin to build against the 1.1 apis + + * [MRM-654] - Archetype for generation of Consumer plugins + + * [MRM-667] - Timeout implementation for Archiva + + * [MRM-678] - 404 errors on proxies should be cached + + * [MRM-737] - Don't list metadata files in the search results + + * [MRM-752] - Trim URL in Remote Repositories + + * [MRM-760] - set JSW to auto-restart if it crashes or hangs + + * [MRM-773] - Improve RSS feed generation + + * [MRM-781] - Removal of Archiva-Webdav implementation in favor of Jackrabbit-webdav + + * [MRM-802] - Display the url for the repository group + + * [MRM-804] - When uploading artifacts to the repo, they should be added to the index instantly + + * [MRM-822] - add org/jvnet/**, com/sun/** to the whitelist for the default java.net repository + + * [MRM-829] - Replace Company POM feature with simple Appearence customisation + + * [MRM-831] - When deploying artifacts to the repo, they should be added to the index instantly + + * [MRM-857] - set a user agent for proxy HTTP requests + + * [MRM-859] - Use File.createTempFile() when downloading files from a remote repository + +** New Feature + + * [MRM-123] - add RSS view to repository manager + + * [MRM-216] - Upload (deploy) artifacts to a repository - via a web form (not using wagon) + + * [MRM-694] - Virtual repositories or repository grouping + + * [MRM-730] - Index/Search by class, method or package name + + * [MRM-751] - Support database connection pooling + + * [MRM-774] - Support inclusion of pom file when deploying an artifact via the web upload form + + * [MRM-864] - Searching within search results + +** Task + + * [MRM-677] - Upgrade archiva to the latest redback (1.0.1) + + * [MRM-688] - Replace plexus-runtime with standalone jetty bundle + + * [MRM-708] - Migrate from Plexus Logging to Slf4J + + * [MRM-754] - Update the screenshots in the docs + + The full list of changes can be found {{{http://jira.codehaus.org/secure/ReleaseNote.jspa?version=13861&styleName=Text&projectId=10980} in JIRA}}. + +* Changes in Archiva 1.0.2 + +** Bug + + * [MRM-159] - should not respond with a 404 if proxying a file results in a remote error + + * [MRM-532] - Unable to specify the location of the index files through the web ui + + * [MRM-598] - Validation error on new repository creation and other fields under certain conditions + + * [MRM-608] - Unable to find project model for [...] if the initial import of the POM failed + + * [MRM-617] - Reporting does not work due to bug in client-side JavaScript validation + + * [MRM-618] - PLEXUS_BASE does not work for local databases + + * [MRM-622] - database not being updated with project model information + + * [MRM-626] - ClassCastException when saving proxy connector with property defined + + * [MRM-627] - Archiva doesn't download SNAPSHOTs for proxied repositories. + + * [MRM-631] - network proxy is always used when defined + + * [MRM-642] - archiva-common tests rely on relative paths + + * [MRM-655] - The logs are duplicated in the archiva.log and wrapper.log file. + + * [MRM-659] - archiva cannot serve ejb artifacts from a maven1 repository + + * [MRM-661] - remote repository removals are not saved after restart + + * [MRM-664] - Cannot download a strut-module artifact in a Legacy repository + + * [MRM-674] - LayoutException when downloading SNAPSHOT test-sources + + * [MRM-683] - Archiva version missing from pages and logs + + * [MRM-687] - Project model cannot be added to database if it inherits groupId and/or version from parent POM + + * [MRM-689] - Incorrect war name in example for tomcat + + * [MRM-690] - using undefined appserver.base + + * [MRM-691] - Can't get any of the consumers to work without through a NPE + + * [MRM-701] - Buggy documentation on "separating the base from the installation" + + * [MRM-703] - Artifacts with extensions longer than fours characters breaks repository scanning. + + * [MRM-713] - extensionPattern in FilenameParser is incorrect + + * [MRM-715] - error adding artifacts to Lucene under some circumstances + + * [MRM-719] - NPE during repository scan + + * [MRM-725] - /archiva/browse URL does not work on WebSphere + + * [MRM-727] - Archiva does not download plugin artifacts in Geronimo + + * [MRM-734] - Unable to update metadata - No versions found for reference + + * [MRM-746] - unable to include *.xml in artifacts list as it picks up maven-metadata.xml + + * [MRM-750] - Adding a network proxy doesn't require an identifier + + * [MRM-755] - No content type for .pom files denoted in file "archiva-mime-types.txt" - workaround included + + * [MRM-758] - unable to schedule cron expressions that contain a comma + + * [MRM-761] - Exception when trying to retrieve a Maven 1 artifact of type zip + + * [MRM-762] - Footer doesn't stretch across repositoryScanning and database pages + + * [MRM-763] - Default cron expression for database update is invalid + + * [MRM-764] - default policies are not selected in the add proxy connector page + +** Improvement + + * [MRM-504] - Find Artifact page needs more onscreen information/instructions + + * [MRM-656] - Admin guide for installing WAR needs updating + + * [MRM-666] - Edit Managed Repository page should indicate the repo id being edited + + * [MRM-700] - Review the documentation on deploying to Archiva for inconsistent repository ids + + * [MRM-720] - Upgrade Lucene from 2.0 to 2.3.1 + +* Changes in Archiva 1.0.1 + +** Bug + + * [MRM-623] - find artifact self signed certificate will expire soon + + * [MRM-628] - In the audit.log file the userid for each action is guest, even though the deploy was performed by admin + + * [MRM-630] - http 502 proxy error with browse button after 2 days running + + * [MRM-633] - Logging is too verbose + + * [MRM-646] - Documentation for configuring for Tomcat is invalid + + * [MRM-662] - Repo purge is not deleting artifacts in correct order + + * [MRM-668] - Repo browse and search isn't working in trunk and in archiva 1.0.1 release candidate + + * [MRM-670] - legacy artifact mapping form needs better validation + +** Improvement + + * [MRM-594] - add some minimal hook in LegacyPathParser to allow exception management in artifact resolution + +** Task + + * [MRM-619] - Update docs/site for some corrections + diff --git a/MRM-541/archiva-docs/src/site/apt/userguide/browsing.apt b/MRM-541/archiva-docs/src/site/apt/userguide/browsing.apt new file mode 100644 index 000000000..e73c11d6d --- /dev/null +++ b/MRM-541/archiva-docs/src/site/apt/userguide/browsing.apt @@ -0,0 +1,70 @@ + ------ + Browsing + ------ + Maria Odea Ching + ------ + 9 November 2007 + ------ + +~~ 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. + +~~ NOTE: For help with the syntax of this file, see: +~~ http://maven.apache.org/guides/mini/guide-apt-format.html + + +Browsing + +* Permissions + + The user can only browse those repositories where the user is an observer or a manager. If the user does not + have permission to access any repository, a message saying "You have access to no repositories. Ask your + system administrator for access" will be displayed. + +* Repository Browse Layout + + The current layout of the repositories in Repository Browse uses the Maven 2 layout, which is the groupId, + artifactId and version. When the version is clicked, the Artifact Info page (see the next section) will be + displayed. There is currently an issue with regard to Maven 1 artifacts, see {{{http://jira.codehaus.org/browse/MRM-585} http://jira.codehaus.org/browse/MRM-585}}. + +* Artifact Info + + The Artifact Info page is divided into 5 views: + + 1. Info. Basic information about the artifact is displayed here. These are the groupId, artifactId, version and + packaging. A dependency pom snippet is also available, which a user can just copy and paste in a pom file + to declare the artifact as a dependency of the project. + + 2. Dependencies. The dependencies of the artifact will be listed here. The user can easily navigate to a specific + dependency by clicking on the groupId, artifactId or version link. The scope of the dependency is also shown. + + 3. Dependency Tree. The dependencies of the artifact are displayed in a tree-like view, which can also be + navigated. + + 4. Used By. Lists all the artifacts in the repository which use this artifact. + + 5. Mailing Lists. The project mailing lists available in the artifact's pom are displayed here. + +* Downloading Artifacts + + Artifacts can be downloaded from the artifact info page. All files, except for the metadata.xml files, that are + associated with the artifact are available in the download box. The size of the files in bytes are displayed + at the right section of the download box. + + + + \ No newline at end of file diff --git a/MRM-541/archiva-docs/src/site/apt/userguide/deploy.apt b/MRM-541/archiva-docs/src/site/apt/userguide/deploy.apt new file mode 100644 index 000000000..006513eda --- /dev/null +++ b/MRM-541/archiva-docs/src/site/apt/userguide/deploy.apt @@ -0,0 +1,206 @@ + ------ + Deploying to Repository + ------ + +Deploying to Repository + + There are different ways on how you can deploy artifacts in an Archiva repository. + + * {{{#Maven} Configuring Maven to deploy to an Archiva repository}} + + * {{{#Web UI} Deploying via the Web UI Form}} + +* Configuring {Maven} to deploy to an Archiva repository + + [[1]] Create a user in Archiva to use for deployment (or use guest if you wish to deploy without a username and password) + + [[2]] The deployment user needs the Role 'Repository Manager' for each repository that you want to deploy to + + [[3]] Define the server for deployment inside your 'settings.xml', use the newly created user for authentication + ++-------------------------------------------------------------------------+ + + ... + + + archiva.internal + {archiva-deployment-user} + {archiva-deployment-pwd} + + + archiva.snapshots + {archiva-deployment-user} + {archiva-deployment-pwd} + + ... + + ... + ++-------------------------------------------------------------------------+ + +** Deploying to Archiva using HTTP + + Configure the <<>> part of your <<>> (customising the URLs as needed). + The <<>> of the repository in <<>> <> match the <<>> of the <<>> + element in <<>>. + ++-------------------------------------------------------------------------+ + + ... + + + archiva.internal + Internal Release Repository + http://reposerver.mycompany.com:8080/archiva/repository/internal/ + + + archiva.snapshots + Internal Snapshot Repository + http://reposerver.mycompany.com:8080/archiva/repository/snapshots/ + + + ... + ++-------------------------------------------------------------------------+ + +** Deploying to Archiva using WebDAV + + In some cases, you may want to use WebDAV to deploy instead of HTTP. If you find this is necessary, follow the same + process as for HTTP, with these additional steps: + + [[1]] Add <<>> to the front of the deployment URLs: + ++-------------------------------------------------------------------------+ + + ... + + + archiva.internal + Internal Release Repository + dav:http://reposerver.mycompany.com:8080/archiva/repository/internal/ + + + archiva.snapshots + Internal Snapshot Repository + dav:http://reposerver.mycompany.com:8080/archiva/repository/snapshots/ + + + ... + ++-------------------------------------------------------------------------+ + + [[2]] Add a build extension to your <<>> (not required in Maven 2.0.9 and above) + ++-------------------------------------------------------------------------+ + + ... + + + + org.apache.maven.wagon + wagon-webdav + 1.0-beta-2 + + + + ... + ++-------------------------------------------------------------------------+ + +** Deploying using other protocols + + You can also deploy to the Archiva server using traditional means such as SCP, FTP, etc. For more information on these deployment + techniques, refer to the Maven documentation. + + Note that once the files are deployed into the location of the Archiva managed repository, they will not be detected by Archiva until the + next scan takes place, so the interval should be configured to a reasonably frequent setting. + +** Deploying Third-Party Artifacts to Archiva using Maven + + You can use <<>> to deploy single artifacts to Archiva. Once you have the settings file in place as + described above, you can deploy the artifact using this type of command: + ++------+ +mvn deploy:deploy-file -Dfile=filename.jar -DpomFile=filename.pom + -DrepositoryId=archiva.internal + -Durl=http://repo.mycompany.com:8080/repository/internal/ ++------+ + + For more information, consult the {{{http://maven.apache.org/plugins/maven-deploy-plugin/deploy-file-mojo.html} documentation for the + <<>> goal}} + + If you wish to use WebDAV to deploy the file, add <<>> to the start of the URL as in the previous instructions. + + However, on versions of Maven prior to 2.0.9, you will also need to create a file called <<>> + in the directory from which you intend to execute "<<>>": + ++-------+ + + 4.0.0 + com.example + webdav-deploy + pom + 1 + Webdav Deployment POM + + + + + org.apache.maven.wagon + wagon-webdav + 1.0-beta-2 + + + + ++-------+ + + This pom will not be deployed with the artifact, it simply serves to make the + WebDAV protocol available to the build process. + + Alternately, you can save this file somewhere else, and use "<<>>" to force the use of an alternate POM file. + +* Deploying via the {Web UI} Form + + The easiest way to deploy in the repository is via the Web UI form, which can be accessed in the 'Upload Artifact' section. + Just follow these steps: + + [[1]] Fill up the following required fields: + + * Group Id - the groupId of the artifact to be deployed. + + * Artifact Id - the artifactId of the artifact to be deployed. + + * Version - the version of the artifact to be deployed. + + * Packaging - the packaging of the artifact to be deployed. (ex. jar, war, ear, etc.) + + * Artifact File - the actual artifact to be deployed. + + [] + + [[2]] Select the repository you want to deploy to. Please note that if you do not have write permission to the repository, + you will not be allowed to deploy in it. + + [[3]] Now, if you want Archiva to generate a pom for the artifact, check the Generate Maven 2 POM field. + (Right now, only Maven 2 poms can be generated.) Alternately, supply a POM file to be deployed alongside the artifact. + + [[4]] Click Submit and a message will be displayed notifying you if the upload/deployment was successful or not. + + [] + + These are the files that will be in your repository after deployment: + + * artifact + + * POM file (if you supplied one or checked Generate Maven 2 POM) + + * maven-metadata.xml (this will be created if none exists in the artifact level yet, otherwise it will just be updated) + + * maven-metadata.xml.sha1 and maven-metadata.xml.md5 (these will be generated for newly created maven-metadata.xml files, otherwise + they will just be updated) + +~~TODO: information for Maven 1, ant tasks, ivy, etc. + diff --git a/MRM-541/archiva-docs/src/site/apt/userguide/find-artifact.apt b/MRM-541/archiva-docs/src/site/apt/userguide/find-artifact.apt new file mode 100644 index 000000000..8bdfb5aba --- /dev/null +++ b/MRM-541/archiva-docs/src/site/apt/userguide/find-artifact.apt @@ -0,0 +1,36 @@ + ------ + Identifying an Artifact + ------ + +Identifying an Artifact + + Archiva indexes all of the artifacts that it discovers during the repository scanning process, storing information about their contents. + This includes the checksum of the artifact, which can help to uniquely identify it within the repository. + + Archiva includes a feature that allows you to check for the existence of a given artifact in the repository by checksum. This is useful in + identifying a JAR or other artifact located from an external source that does not contain any Maven or version information. + + To use this functionality, click the "Find Artifact" link in the left navigation. + + When the screen first loads, a Java applet that will allow you to create a local checksum of a given artifact is loaded. Since it is reading the + content of the artifact from the filesystem, it will present a security dialog similar to the following: + +[../images/find-artifact-security.png] Java Applet + + By trusting the applet, you can checksum files of any size locally and just upload the small checksum to the server. If you opt not to trust the + applet, you must enter the checksum into the web form by hand. + + Once you have loaded the page, you have the choice of browsing for a local file to identify, or entering the checksum directly. + +[../images/find-artifact.png] Find Artifact + + Once you submit the form Archiva will look to match the checksum: + + * If more than one artifact matches, a list of results are returned + + * If a unique match is found, the individual artifact information page is returned + + * If no match is found, a "no results" page is returned + + + diff --git a/MRM-541/archiva-docs/src/site/apt/userguide/index.apt b/MRM-541/archiva-docs/src/site/apt/userguide/index.apt new file mode 100644 index 000000000..d79e6eb3d --- /dev/null +++ b/MRM-541/archiva-docs/src/site/apt/userguide/index.apt @@ -0,0 +1,27 @@ + ------ + Users Guide + ------ + +Users Guide + + Welcome to the Archiva user's guide. Getting to know and use Archiva is very simple - please select one of the following documents to learn how to use + Archiva quickly. + + * {{{browsing.html} Browsing Archiva repositories}} + + * {{{searching.html} Searching Archiva repositories}} + + * {{{find-artifact.html} Identifying an unknown artifact by comparing the repository checksum database}} + + * {{{using-repository.html} Using Archiva as a repository for Maven, Ivy, etc.}} + + * {{{deploy.html} Deploying artifacts to the repository}} + + * {{{virtual-repositories.html} Configuring Virtual Repositories}} + + * {{{rss.html}RSS Feeds in Archiva}} + + [] + + + diff --git a/MRM-541/archiva-docs/src/site/apt/userguide/rss.apt b/MRM-541/archiva-docs/src/site/apt/userguide/rss.apt new file mode 100644 index 000000000..7b7224717 --- /dev/null +++ b/MRM-541/archiva-docs/src/site/apt/userguide/rss.apt @@ -0,0 +1,61 @@ + ------ + RSS Feeds + ------ + Maria Odea Ching + ------ + 7 May 2008 + ------ + +~~ 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. + +~~ NOTE: For help with the syntax of this file, see: +~~ http://maven.apache.org/guides/mini/guide-apt-format.html + + +RSS Feeds + + There are two types of rss feeds in Archiva: new artifacts in repo feed and new versions of artifact feed. + +* New Artifacts In Repository + + The default url for this feed is: <<>> + + There are two ways to subscribe to this feed: + + 1. By copying the default url specified above and adding this to your feed reader. Just make sure to replace the <<>>, + <<>> and <<>>. The <<>> is the id of the Archiva repo which you want to monitor. + + 2. Via the feed icon in the Repositories page. Right click on the feed icon in the upper right hand corner of the repository + configuration and copy the link. Then add this link to your feed reader. + +* New Versions of an Artifact + + The default url for this feed is: <<>> + + You could subscribe to the feed the same way as specified in the New Artifacts In Repository section except that in #1, you + need to specify the <<>> and <<>> instead of the <<>>. And in #2, you need to go to the + Browse section. The rss feed icon is located in the artifactId level. + +* Authentication + + The authentication method used for the rss feeds is Http Basic Authentication. If your reader supports this, you would be + prompted for a username and password when you subscribe to the feed. Supply your Archiva account credentials for this. Take + note that only users with an Observer role for the specific repository would be able to subscribe to this feed. + + If the 'guest' account is enabled for the repository, you would no longer be asked for the username and password when you + subscribe to the feed. \ No newline at end of file diff --git a/MRM-541/archiva-docs/src/site/apt/userguide/searching.apt b/MRM-541/archiva-docs/src/site/apt/userguide/searching.apt new file mode 100644 index 000000000..817bd55e8 --- /dev/null +++ b/MRM-541/archiva-docs/src/site/apt/userguide/searching.apt @@ -0,0 +1,69 @@ + ------ + Searching + ------ + Maria Odea Ching + ------ + 23 Nov 2007 + ------ + +~~ 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. + +~~ NOTE: For help with the syntax of this file, see: +~~ http://maven.apache.org/guides/mini/guide-apt-format.html + + +Searching + + The Search functionality of Archiva allows a user to search for specific artifact references in the repository. + +* What Can Be Searched? + + The repository files that are indexed during repository scan can be configured in the Repository Scanning page, in the + Repository Scanning - File Types section (indexable-content). By default, the indexable-content file types are: + ++-----+ +**/*.txt +**/*.TXT +**/*.block +**/*.config +**/*.pom +**/*.xml +**/*.xsd +**/*.dtd +**/*.tld ++-----+ + + The contents of all the files in the repository that matches the above configuration will be indexed during repository + scan. So when you type a word in the search box, Archiva will search the index for that query string and return all the + search hits in the form of a list of artifacts. For example you typed in 'classworlds', the search result would contain + the list of artifacts that use or reference 'classworlds'. + + Below is a sample screenshot of the search results: + +[../images/search-results.jpg] Search Results + + When the user clicks a specific artifact in the search results list, Archiva will direct the user in the Artifact Info + page (the same page from the Repository Browse). Otherwise if it is not a pom file (ex. metadata.xml), the file will + appear as a file to be downloaded from the browser. + +* Security + + The Search functionality respects the repository permissions. If the user is not logged in to Archiva and does a search, + only those repositories with guest permissions will be searched for the query string. And if the user is logged in to + Archiva and does a search, only those repositories in which that user has permission to access will be searched for the + query string. diff --git a/MRM-541/archiva-docs/src/site/apt/userguide/using-repository.apt b/MRM-541/archiva-docs/src/site/apt/userguide/using-repository.apt new file mode 100644 index 000000000..bc05ce4f1 --- /dev/null +++ b/MRM-541/archiva-docs/src/site/apt/userguide/using-repository.apt @@ -0,0 +1,124 @@ + ------ + Using as a Repository + ------ + +Configuring Maven 2 to use an Archiva repository + + To get your local Maven 2 installation to use an Archiva proxy you need to add the repositories you require to your 'settings.xml'. This file is usually found in ${user.dir}/.m2/settings.xml (see the {{{http://maven.apache.org/settings.html}Settings Reference}}). + + How you configure the settings depends on how you would like to utilise the repository. You can add the Archiva repository as an additional repository to others already declared by the project, or lock down the + environment to only use the Archiva repositories (possibly proxying content from a remote repository). + +* Locking down to only use Archiva + + If you would like Archiva to serve as the only repository used by your Maven installation, you can use the Maven mirror settings to force this behaviour. + + First, you need to select the default repository to use when none is configured by adding the following to the <<>> file: + ++-------------------------------------------------------------------------+ + + ... + + + archiva.default + http://repo.mycompany.com:8080/archiva/repository/internal/ + * + + + ... + ++-------------------------------------------------------------------------+ + + With this in place, all repository requests will be sent to the internal repository (which by default is configured to proxy the central repository). + + If you have separate Archiva repositories that you wish to use, you can add an extra mirror declaration as needed: + ++-------------------------------------------------------------------------+ + ... + + archiva.apache.snapshots + http://repo.mycompany.com:8080/archiva/repository/snapshots/ + apache.snapshots + + ... ++-------------------------------------------------------------------------+ + + <> Maven, as of version 2.0.8, does not properly report the correct URL in errors when a mirror is used - so although the Archiva instance is being consulted any error messages will still reflect + the original URL described in the POM. + +* Using Archiva as an additional repository + + You will need to add one entry for each repository that is setup in Archiva. If your repository contains plugins; remember to also include a \ setting. + + [[1]] Create a new profile to setup your repositories + ++-------------------------------------------------------------------------+ + + ... + + + Repository Proxy + + true + + + + + + + ... + + ... + + + + + + + ... + + ... + + + ... + + ... + ++-------------------------------------------------------------------------+ + + [[2]] Add your repository configuration to the profile + + You can copy the repository configuration from the POM Snippet on the Archiva Administration Page for a normal repository. It should look much like: + ++-------------------------------------------------------------------------+ + + repository-1 + http://repo.mycompany.com:8080/archiva/repository/internal/ + + true + + + false + + ++-------------------------------------------------------------------------+ + + [[3]] Add the necessary security configuration + + This is only necessary if the guest account does not have read access to the given repository. + ++-------------------------------------------------------------------------+ + + ... + + + repository-1 + {archiva-user} + {archiva-pwd} + + ... + + ... + ++-------------------------------------------------------------------------+ + diff --git a/MRM-541/archiva-docs/src/site/apt/userguide/virtual-repositories.apt b/MRM-541/archiva-docs/src/site/apt/userguide/virtual-repositories.apt new file mode 100644 index 000000000..d465e9d08 --- /dev/null +++ b/MRM-541/archiva-docs/src/site/apt/userguide/virtual-repositories.apt @@ -0,0 +1,117 @@ + ------ + Virtual Repositories + ------ + +Virtual Repositories + + This is a new feature for Archiva 1.1. The main advantage of virtual repositories (or repository groups) is that you + only need to specify one URL instead of multiple repository URLs if you are using more than 1 proxy repository. + + For example, you have the following configuration in your <<>>: + ++-------------------------------------------------------------------------+ + + ... + + + Repository Proxy + + true + + + + internal.releases + http://localhost:8080/archiva/repository/internal.releases/ + + true + + + false + + + + third.party.repo + http://localhost:8080/archiva/repository/third.party.repo/ + + true + + + false + + + + snapshots + http://localhost:8080/archiva/repository/snapshots/ + + false + + + true + + + + + ... + + ... + ++-------------------------------------------------------------------------+ + + If you have a virtual repository configured in Archiva, you only need to configure this in your <<>>: + ++-------------------------------------------------------------------------+ + + ... + + + Repository Proxy + + true + + + + internal.releases + http://localhost:8080/archiva/repository/[repository_group_id]/ + + + + ... + + ... + ++-------------------------------------------------------------------------+ + + And you'll still be able to get all the artifacts that you need. See Configuring Virtual Repositories section for the + steps on how to setup a virtual repo in Archiva. + +* How It Works + + When Archiva receives a request with a virtual repo (or repo group) URL, Archiva would look for the requested artifact + from the repositories under that group. It would only check the repositories the user has permission to access (meaning + only those repositories which the user has an Obeserver role for). The first resource found for the requested artifact + would be returned. + +* Configuring Virtual Repositories + + Below are the steps for setting up the virtual repositories: + + [[1]] In the webapp, go to the <<>> page. To create a virtual repository or repository group, + fill in the <<>> field and click Add Group. + + [[2]] To add a repository under this group, choose from the drop-down menu on the lower right hand side of the + repository group box and click Add Repository. + + [[3]] Now add the virtual repository URL <<>> + into your settings.xml the same way you configure regular repositories -- as a or as an additional . + + [[4]] If the repositories under the group are secured, you must set your Archiva login credentials in your settings.xml as + well. Please take note that the id should match the repository group identifier. + +* Webdav Browse + + Webdav Browse for a virtual repository is a read-only view. It displays the merged contents of all the repositories + under that repository group. Just type the url of the virtual repository in your browser in order to view its contents. + User will be asked to authenticate if the 'guest' account is not enabled for the repositories. Only those repositories + which the user has permission to access will be shown. + + diff --git a/MRM-541/archiva-docs/src/site/assembly/docs.xml b/MRM-541/archiva-docs/src/site/assembly/docs.xml new file mode 100644 index 000000000..e19dfb70a --- /dev/null +++ b/MRM-541/archiva-docs/src/site/assembly/docs.xml @@ -0,0 +1,33 @@ + + + + docs + + zip + + false + + + target/site + /docs/ + + + + diff --git a/MRM-541/archiva-docs/src/site/resources/css/site.css b/MRM-541/archiva-docs/src/site/resources/css/site.css new file mode 100755 index 000000000..3a03fe931 --- /dev/null +++ b/MRM-541/archiva-docs/src/site/resources/css/site.css @@ -0,0 +1,71 @@ +a.externalLink, a.externalLink:link, a.externalLink:visited, a.externalLink:active, a.externalLink:hover { + background: none; + padding-right: 0; +} + +body ul { + list-style-type: square; +} + +#downloadbox { + float: right; + margin-left: 2em; + padding-left: 1em; + padding-right: 1em; + padding-bottom: 1em; + border: 1px solid #999; + background-color: #eee; + width: 17.5em; +} + +#downloadbox h5 { + color: #000; + margin: 0; + border-bottom: 1px solid #aaaaaa; + font-size: smaller; + padding: 0; + margin-top: 1em; +} + +#downloadbox p { + margin-top: 1em; + margin-bottom: 0; +} + +#downloadbox li { + text-indent: inherit; +} + +div.p { + margin-top: 5px; + margin-bottom: 10px; +} + +pre.commandline { + border: 1px solid #bbb; + background-color: white; + margin-top: 5px; + margin-bottom: 5px; + font-size: 10pt; + padding: 15px; + color: gray; +} + +pre.commandline .input { + color: #55f; +} + +pre.commandline .command { + color: black; + font-weight: bold; +} + +#banner { + background: none; +} + +#banner img { + margin: 10px; +} + + diff --git a/MRM-541/archiva-docs/src/site/resources/images/archiva-report.jpg b/MRM-541/archiva-docs/src/site/resources/images/archiva-report.jpg new file mode 100644 index 000000000..65b7a49a8 Binary files /dev/null and b/MRM-541/archiva-docs/src/site/resources/images/archiva-report.jpg differ diff --git a/MRM-541/archiva-docs/src/site/resources/images/find-artifact-security.png b/MRM-541/archiva-docs/src/site/resources/images/find-artifact-security.png new file mode 100644 index 000000000..bbc468223 Binary files /dev/null and b/MRM-541/archiva-docs/src/site/resources/images/find-artifact-security.png differ diff --git a/MRM-541/archiva-docs/src/site/resources/images/find-artifact.png b/MRM-541/archiva-docs/src/site/resources/images/find-artifact.png new file mode 100644 index 000000000..d50083ad2 Binary files /dev/null and b/MRM-541/archiva-docs/src/site/resources/images/find-artifact.png differ diff --git a/MRM-541/archiva-docs/src/site/resources/images/search-results.jpg b/MRM-541/archiva-docs/src/site/resources/images/search-results.jpg new file mode 100644 index 000000000..709b9a202 Binary files /dev/null and b/MRM-541/archiva-docs/src/site/resources/images/search-results.jpg differ diff --git a/MRM-541/archiva-docs/src/site/resources/images/tour/admin.png b/MRM-541/archiva-docs/src/site/resources/images/tour/admin.png new file mode 100644 index 000000000..2bed2ff08 Binary files /dev/null and b/MRM-541/archiva-docs/src/site/resources/images/tour/admin.png differ diff --git a/MRM-541/archiva-docs/src/site/resources/images/tour/maintenance.png b/MRM-541/archiva-docs/src/site/resources/images/tour/maintenance.png new file mode 100644 index 000000000..e1a9318af Binary files /dev/null and b/MRM-541/archiva-docs/src/site/resources/images/tour/maintenance.png differ diff --git a/MRM-541/archiva-docs/src/site/resources/images/tour/project.png b/MRM-541/archiva-docs/src/site/resources/images/tour/project.png new file mode 100644 index 000000000..54bf4ef02 Binary files /dev/null and b/MRM-541/archiva-docs/src/site/resources/images/tour/project.png differ diff --git a/MRM-541/archiva-docs/src/site/resources/images/tour/proxy.png b/MRM-541/archiva-docs/src/site/resources/images/tour/proxy.png new file mode 100644 index 000000000..26af3bdf2 Binary files /dev/null and b/MRM-541/archiva-docs/src/site/resources/images/tour/proxy.png differ diff --git a/MRM-541/archiva-docs/src/site/resources/images/tour/reports.png b/MRM-541/archiva-docs/src/site/resources/images/tour/reports.png new file mode 100644 index 000000000..4f7c1edb3 Binary files /dev/null and b/MRM-541/archiva-docs/src/site/resources/images/tour/reports.png differ diff --git a/MRM-541/archiva-docs/src/site/resources/images/tour/rss.png b/MRM-541/archiva-docs/src/site/resources/images/tour/rss.png new file mode 100644 index 000000000..62efd7e9a Binary files /dev/null and b/MRM-541/archiva-docs/src/site/resources/images/tour/rss.png differ diff --git a/MRM-541/archiva-docs/src/site/resources/images/tour/search.png b/MRM-541/archiva-docs/src/site/resources/images/tour/search.png new file mode 100644 index 000000000..1d7e40b17 Binary files /dev/null and b/MRM-541/archiva-docs/src/site/resources/images/tour/search.png differ diff --git a/MRM-541/archiva-docs/src/site/resources/images/tour/security.png b/MRM-541/archiva-docs/src/site/resources/images/tour/security.png new file mode 100644 index 000000000..90320c53f Binary files /dev/null and b/MRM-541/archiva-docs/src/site/resources/images/tour/security.png differ diff --git a/MRM-541/archiva-docs/src/site/resources/images/tour/upload.png b/MRM-541/archiva-docs/src/site/resources/images/tour/upload.png new file mode 100644 index 000000000..8f3a1ea79 Binary files /dev/null and b/MRM-541/archiva-docs/src/site/resources/images/tour/upload.png differ diff --git a/MRM-541/archiva-docs/src/site/resources/images/tour/virtual-repos.png b/MRM-541/archiva-docs/src/site/resources/images/tour/virtual-repos.png new file mode 100644 index 000000000..12b02eb99 Binary files /dev/null and b/MRM-541/archiva-docs/src/site/resources/images/tour/virtual-repos.png differ diff --git a/MRM-541/archiva-docs/src/site/site.xml b/MRM-541/archiva-docs/src/site/site.xml new file mode 100644 index 000000000..08c18d35c --- /dev/null +++ b/MRM-541/archiva-docs/src/site/site.xml @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MRM-541/archiva-docs/src/site/xdoc/tour/admin.xml b/MRM-541/archiva-docs/src/site/xdoc/tour/admin.xml new file mode 100644 index 000000000..bcea540f4 --- /dev/null +++ b/MRM-541/archiva-docs/src/site/xdoc/tour/admin.xml @@ -0,0 +1,26 @@ + + + + Graphical Administration + Brett Porter + + + + +
+
+ +

+ Archiva has a comprehensive web-based administration interface for configuring repositories, + remote proxies, scheduled jobs and more. The configuration is kept in sync with the XML + configuration files so that they can also be hand-edited if necessary. +

+

+ Previous: Artifact Upload | + Graphical Administration | + Next: Virtual Repositories +

+
+
+ +
diff --git a/MRM-541/archiva-docs/src/site/xdoc/tour/index.xml b/MRM-541/archiva-docs/src/site/xdoc/tour/index.xml new file mode 100644 index 000000000..66a19f102 --- /dev/null +++ b/MRM-541/archiva-docs/src/site/xdoc/tour/index.xml @@ -0,0 +1,104 @@ + + + + Feature Tour + Brett Porter + + + + + +
+ +

+ Archiva is a feature rich repository manager. Below is a short tour of some of the features that are available. +

+ + + + + + + + + + + + + + + + + + +
+ +
+ 1. Project Information +
+
+ +
+ 2. Artifact Search +
+
+ +
+ 3. Remote Proxying Cache +
+
+ +
+ 4. Artifact Upload +
+
+ +
+ 5. Graphical Administration +
+
+ +
+ 6. Virtual Repositories +
+
+ +
+ 7. RSS Feeds +
+
+ +
+ 8. Role-based Security +
+
+ +
+ 9. Integrity Reports +
+
+ +
+ 10. Maintenance +
+
+
+ +
diff --git a/MRM-541/archiva-docs/src/site/xdoc/tour/maintenance.xml b/MRM-541/archiva-docs/src/site/xdoc/tour/maintenance.xml new file mode 100644 index 000000000..a45603889 --- /dev/null +++ b/MRM-541/archiva-docs/src/site/xdoc/tour/maintenance.xml @@ -0,0 +1,28 @@ + + + + Maintenance + Maria Odea Ching + + + + +
+
+ +

+ Archiva has utilities called consumers that can be used for maintaining the + Archiva repositories. These can be configured or activated in the Repository + Scanning section of the webapp. The configuration are stored in Archiva's + xml configuration files, meaning you can also hand-edit these config files to + enable or disable these consumers. +

+

+ Previous: Integrity Reports | + Maintenance | + Next: Feature Tour +

+
+
+ +
diff --git a/MRM-541/archiva-docs/src/site/xdoc/tour/project.xml b/MRM-541/archiva-docs/src/site/xdoc/tour/project.xml new file mode 100644 index 000000000..00300b489 --- /dev/null +++ b/MRM-541/archiva-docs/src/site/xdoc/tour/project.xml @@ -0,0 +1,26 @@ + + + + Project Information + Brett Porter + + + + +
+
+ +

+ Archiva provides an informative display for projects and artifacts stored in the repository. + This includes a user-friendly display of the Maven project information, as well as the relationships + between projects. +

+

+ Previous: Feature Tour | + Project Information | + Next: Artifact Search +

+
+
+ +
diff --git a/MRM-541/archiva-docs/src/site/xdoc/tour/proxy.xml b/MRM-541/archiva-docs/src/site/xdoc/tour/proxy.xml new file mode 100644 index 000000000..e67b7742d --- /dev/null +++ b/MRM-541/archiva-docs/src/site/xdoc/tour/proxy.xml @@ -0,0 +1,26 @@ + + + + Remote Proxying Cache + Brett Porter + + + + +
+
+ +

+ Archiva can operate as a proxy for remote repositories, allowing you to improve build + performance by caching artifacts in a closer network location, and control artifact + usage through the use of white and black lists on proxy connectors. +

+

+ Previous: Artifact Search | + Remote Proxying Cache | + Next: Artifact Upload +

+
+
+ +
diff --git a/MRM-541/archiva-docs/src/site/xdoc/tour/reports.xml b/MRM-541/archiva-docs/src/site/xdoc/tour/reports.xml new file mode 100644 index 000000000..d48a0cddf --- /dev/null +++ b/MRM-541/archiva-docs/src/site/xdoc/tour/reports.xml @@ -0,0 +1,26 @@ + + + + Integrity Reports + Brett Porter + + + + +
+
+ +

+ Archiva monitors the state of the managed repositories and keeps track of + potential problems to allow improvement of metadata and to assist in + troubleshooting problems. +

+

+ Previous: Role-based Security | + Integrity Reports | + Next: Maintenance +

+
+
+ +
diff --git a/MRM-541/archiva-docs/src/site/xdoc/tour/rss.xml b/MRM-541/archiva-docs/src/site/xdoc/tour/rss.xml new file mode 100644 index 000000000..7421c7621 --- /dev/null +++ b/MRM-541/archiva-docs/src/site/xdoc/tour/rss.xml @@ -0,0 +1,25 @@ + + + + RSS Feeds + Maria Odea Ching + + + + +
+
+ +

+ Archiva provides RSS feeds for new artifacts in the repositories and new versions + of a specific artifact. +

+

+ Previous: Virtual Repositories | + RSS Feeds | + Next: Role-based Security +

+
+
+ +
diff --git a/MRM-541/archiva-docs/src/site/xdoc/tour/search.xml b/MRM-541/archiva-docs/src/site/xdoc/tour/search.xml new file mode 100644 index 000000000..e144873e9 --- /dev/null +++ b/MRM-541/archiva-docs/src/site/xdoc/tour/search.xml @@ -0,0 +1,26 @@ + + + + Artifact Search + Brett Porter + + + + +
+
+ +

+ Archiva has both a user-friendly browsing interface, and powerful search functionalities. The contents of all artifacts are indexed, + including Maven project information and Java class information to facilitate locating code within any repository. + By using the "Find Artifact" feature, you can identify unknown artifacts based on the database of known checksums for known artifacts. +

+

+ Previous: Project Information | + Artifact Search | + Next: Remote Proxying Cache +

+
+
+ +
diff --git a/MRM-541/archiva-docs/src/site/xdoc/tour/security.xml b/MRM-541/archiva-docs/src/site/xdoc/tour/security.xml new file mode 100644 index 000000000..f489318bd --- /dev/null +++ b/MRM-541/archiva-docs/src/site/xdoc/tour/security.xml @@ -0,0 +1,26 @@ + + + + Role-based Security + Brett Porter + + + + +
+
+ +

+ Archiva uses the Redback security framework to provide flexible role-based security controls for repositories. + You can use the graphical interface to maintain user accounts, as well as secure repositories for read and/or write + access for individuals, or given roles. +

+

+ Previous: RSS Feeds | + Role-based Security | + Next: Integrity Reports +

+
+
+ +
diff --git a/MRM-541/archiva-docs/src/site/xdoc/tour/upload.xml b/MRM-541/archiva-docs/src/site/xdoc/tour/upload.xml new file mode 100644 index 000000000..1365dbf38 --- /dev/null +++ b/MRM-541/archiva-docs/src/site/xdoc/tour/upload.xml @@ -0,0 +1,25 @@ + + + + Artifact Upload + Maria Odea Ching + + + + +
+
+ +

+ Archiva now supports artifact uploads via UI. A pom file can also be included + in the upload or Archiva can generate one during the upload. +

+

+ Previous: Remote Proxying Cache | + Artifact Upload | + Next: Graphical Administration +

+
+
+ +
diff --git a/MRM-541/archiva-docs/src/site/xdoc/tour/virtual-repos.xml b/MRM-541/archiva-docs/src/site/xdoc/tour/virtual-repos.xml new file mode 100644 index 000000000..a3284f5cb --- /dev/null +++ b/MRM-541/archiva-docs/src/site/xdoc/tour/virtual-repos.xml @@ -0,0 +1,26 @@ + + + + Virtual Repositories + Maria Odea Ching + + + + +
+
+ +

+ Archiva implements the concept of virtual repositories, wherein a set of + Archiva repositories can be grouped together under one URL and that one URL + can be used by clients (s.a. Maven) to download from these repositories. +

+

+ Previous: Graphical Administration | + Virtual Repositories | + Next: RSS Feeds +

+
+
+ +
diff --git a/MRM-541/archiva-jetty/pom.xml b/MRM-541/archiva-jetty/pom.xml new file mode 100644 index 000000000..a06152b3d --- /dev/null +++ b/MRM-541/archiva-jetty/pom.xml @@ -0,0 +1,293 @@ + + 4.0.0 + + org.apache.archiva + archiva + 1.2-SNAPSHOT + + archiva-jetty + pom + + Apache Archiva + + + org.mortbay.jetty + jetty + + + org.mortbay.jetty + start + ${jetty.version} + + + org.apache.archiva + archiva-webapp + war + + + org.apache.archiva + archiva-docs + zip + docs + + + + org.mortbay.jetty + jetty-naming + ${jetty.version} + runtime + + + org.mortbay.jetty + servlet-api-2.5 + ${jetty.version} + runtime + + + org.mortbay.jetty + jsp-api-2.0 + ${jetty.version} + runtime + + + org.mortbay.jetty + jetty-plus + ${jetty.version} + runtime + + + org.apache.derby + derby + 10.1.3.1 + runtime + + + javax.mail + mail + 1.4 + runtime + + + ant + ant + 1.6.5 + runtime + + + commons-el + commons-el + 1.0 + runtime + + + commons-logging + commons-logging + + + + + tomcat + jasper-compiler + 5.5.15 + runtime + + + javax.servlet + jsp-api + + + + + tomcat + jasper-runtime + 5.5.15 + runtime + + + javax.servlet + servlet-api + + + + + org.slf4j + jcl104-over-slf4j + runtime + + + org.slf4j + slf4j-simple + runtime + + + tomcat + jasper-compiler-jdt + 5.5.15 + runtime + + + org.eclipse.jdt + core + + + + + commons-dbcp + commons-dbcp + 1.2.1 + + + + + + org.codehaus.mojo + appassembler-maven-plugin + 1.0-SNAPSHOT + + + + archiva + org.mortbay.start.Main + + conf/jetty.xml + conf/jetty-logging.xml + + + jsw + + + + jsw + + + wrapper.console.loglevel + INFO + + + wrapper.java.additional.1.stripquotes + TRUE + + + set.default.REPO_DIR + lib + + + wrapper.logfile + %ARCHIVA_BASE%/logs/wrapper.log + + + wrapper.app.parameter.2 + %ARCHIVA_BASE%/conf/jetty.xml + + + wrapper.app.parameter.3 + %ARCHIVA_BASE%/conf/jetty-logging.xml + + + app.base.envvar + ARCHIVA_BASE + + + wrapper.on_exit.default + RESTART + + + wrapper.on_exit.0 + SHUTDOWN + + + wrapper.restart.delay + 30 + + + + linux-x86-32 + linux-x86-64 + macosx-x86-universal-32 + solaris-x86-32 + solaris-sparc-32 + solaris-sparc-64 + windows-x86-32 + + + + + + appserver.home=. + appserver.base=%ARCHIVA_BASE% + + jetty.logs=%ARCHIVA_BASE%/logs + + + + + lib + flat + target/generated-resources/appassembler/jsw/archiva + + + + + generate-daemons + create-repository + + + + + + org.apache.maven.plugins + maven-assembly-plugin + 2.1 + + + package + + single + + + + + src/main/assembly/bin.xml + apache-archiva-${version} + + + + maven-antrun-plugin + 1.1 + + + config + process-resources + + + + + + + + + + run + + + + + + maven-remote-resources-plugin + + + notice-supplements.xml + + + + + + + + codehaus.snapshots + http://snapshots.repository.codehaus.org/ + + + diff --git a/MRM-541/archiva-jetty/src/main/appended-resources/notice-supplements.xml b/MRM-541/archiva-jetty/src/main/appended-resources/notice-supplements.xml new file mode 100644 index 000000000..61d380fb7 --- /dev/null +++ b/MRM-541/archiva-jetty/src/main/appended-resources/notice-supplements.xml @@ -0,0 +1,141 @@ + + + + ant + ant + Ant + http://ant.apache.org/ + + The Apache Software Foundation + http://www.apache.org/ + + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + + + + + + + geronimo-spec + geronimo-spec-jta + Geronimo :: Java Transaction API Specification + http://geronimo.apache.org/ + + The Apache Software Foundation + http://www.apache.org/ + + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + + + + + + + javax.activation + activation + JavaBeans Activation Framework (JAF) + + Sun Microsystems + http://www.sun.com/ + + + + Common Development and Distribution License (CDDL) v1.0 + https://glassfish.dev.java.net/public/CDDLv1.0.html + + + + + + + javax.mail + mail + JavaMail API + + Sun Microsystems + http://www.sun.com/ + + + + Common Development and Distribution License (CDDL) v1.0 + https://glassfish.dev.java.net/public/CDDLv1.0.html + + + + + + + xerces + xercesImpl + Xerces + http://xerces.apache.org/ + + The Apache Software Foundation + http://www.apache.org/ + + + + The Apache Software License, Version 1.1 + http://www.apache.org/licenses/LICENSE + + + + + + + tomcat + jasper-compiler + Tomcat Jasper Compiler + + The Apache Software Foundation + http://www.apache.org/ + + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + + + + + + + tomcat + jasper-compiler-jdt + Tomcat Jasper Compiler JDT + + The Apache Software Foundation + http://www.apache.org/ + + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + + + + + + + tomcat + jasper-runtime + Tomcat Jasper Runtime + + The Apache Software Foundation + http://www.apache.org/ + + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + + + + + \ No newline at end of file diff --git a/MRM-541/archiva-jetty/src/main/assembly/bin.xml b/MRM-541/archiva-jetty/src/main/assembly/bin.xml new file mode 100644 index 000000000..0e3206dfa --- /dev/null +++ b/MRM-541/archiva-jetty/src/main/assembly/bin.xml @@ -0,0 +1,119 @@ + + + + bin + + tar.gz + zip + + + + target/generated-resources/appassembler/jsw/archiva/apps + apps + + + target/generated-resources/appassembler/jsw/archiva/conf + conf + + + target/generated-resources/appassembler/jsw/archiva/lib + lib + + + archiva-* + maven-metadata-appassembler.xml + + 0755 + + + target/generated-resources/appassembler/jsw/archiva/logs + logs + + + target/generated-resources/appassembler/jsw/archiva/bin + bin + + archiva + + 0755 + unix + + + target/generated-resources/appassembler/jsw/archiva/bin + bin + + wrapper-linux-x86-32 + wrapper-linux-x86-64 + wrapper-macosx-universal-32 + wrapper-solaris-x86-32 + wrapper-solaris-sparc-32 + wrapper-solaris-sparc-64 + + 0755 + + + target/generated-resources/appassembler/jsw/archiva/bin + bin + + archiva.bat + + 0755 + dos + + + target/generated-resources/appassembler/jsw/archiva/bin + bin + + wrapper-windows-x86-32.exe + + 0755 + + + target/maven-shared-archive-resources/META-INF/ + / + + NOTICE + + + + src/main/resources/ + / + + LICENSE + + + + + + true + apps/archiva + + org.apache.archiva:archiva-webapp + + + + true + + org.apache.archiva:archiva-docs:zip:docs + + + + + diff --git a/MRM-541/archiva-jetty/src/main/conf/archiva.xml b/MRM-541/archiva-jetty/src/main/conf/archiva.xml new file mode 100644 index 000000000..9afb83352 --- /dev/null +++ b/MRM-541/archiva-jetty/src/main/conf/archiva.xml @@ -0,0 +1 @@ + diff --git a/MRM-541/archiva-jetty/src/main/conf/jetty-logging.xml b/MRM-541/archiva-jetty/src/main/conf/jetty-logging.xml new file mode 100644 index 000000000..3eedcd6bd --- /dev/null +++ b/MRM-541/archiva-jetty/src/main/conf/jetty-logging.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + /yyyy_mm_dd.stderrout.log + false + 90 + GMT + + + + + + Redirecting stderr/stdout to + + + + + + + diff --git a/MRM-541/archiva-jetty/src/main/conf/jetty.xml b/MRM-541/archiva-jetty/src/main/conf/jetty.xml new file mode 100644 index 000000000..53a600fd8 --- /dev/null +++ b/MRM-541/archiva-jetty/src/main/conf/jetty.xml @@ -0,0 +1,341 @@ + + + + + + + + + + + + + + + + + + + + + + 10 + 250 + 25 + + + + + + + + + + + + + + + + + + 30000 + 2 + false + 8443 + 5000 + 5000 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + /contexts + 1 + + + + + + + + + + + + + + + + + + + + + + /apps + false + true + false + + + + + + + + + + + + + + + /yyyy_mm_dd.request.log + yyyy_MM_dd + 90 + true + true + false + GMT + + + + + + + + true + true + true + 1000 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + org.mortbay.jetty.webapp.WebInfConfiguration + org.mortbay.jetty.plus.webapp.EnvConfiguration + org.mortbay.jetty.plus.webapp.Configuration + org.mortbay.jetty.webapp.JettyWebXmlConfiguration + org.mortbay.jetty.webapp.TagLibConfiguration + + + + + + + + ./apps + org/mortbay/jetty/webapp/webdefault.xml + + True + False + + + + + + mail/Session + + + + + + + localhost + + + + + + + + + jdbc/archiva + + + org.apache.derby.jdbc.EmbeddedDataSource + jdbc:derby:/data/databases/archiva + sa + + create + true + + + + + + + jdbc/archivaShutdown + + + org.apache.derby.jdbc.EmbeddedDataSource + jdbc:derby:/data/databases/archiva + sa + + shutdown + true + + + + + + + + + jdbc/users + + + /data/databases/users + sa + create + + + + + + jdbc/usersShutdown + + + /data/databases/users + sa + shutdown + + + + diff --git a/MRM-541/archiva-jetty/src/main/conf/shared.xml b/MRM-541/archiva-jetty/src/main/conf/shared.xml new file mode 100644 index 000000000..9afb83352 --- /dev/null +++ b/MRM-541/archiva-jetty/src/main/conf/shared.xml @@ -0,0 +1 @@ + diff --git a/MRM-541/archiva-jetty/src/main/resources/LICENSE b/MRM-541/archiva-jetty/src/main/resources/LICENSE new file mode 100644 index 000000000..774a48b13 --- /dev/null +++ b/MRM-541/archiva-jetty/src/main/resources/LICENSE @@ -0,0 +1,261 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed 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. + + + +For the Java Service Wrapper (v3.2.3): + +Copyright (c) 1999, 2006 Tanuki Software, Inc. + +Permission is hereby granted, free of charge, to any person +obtaining a copy of the Java Service Wrapper and associated +documentation files (the "Software"), to deal in the Software +without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sub-license, +and/or sell copies of the Software, and to permit persons to +whom the Software is furnished to do so, subject to the +following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + + +Portions of the Software have been derived from source code +developed by Silver Egg Technology under the following license: + +BEGIN Silver Egg Techology License ----------------------------------- + + Copyright (c) 2001 Silver Egg Technology + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the "Software"), to deal in the Software without + restriction, including without limitation the rights to use, + copy, modify, merge, publish, distribute, sub-license, and/or + sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following + conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + +END Silver Egg Techology License ------------------------------------- + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/pom.xml b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/pom.xml new file mode 100644 index 000000000..f23ee3a20 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/pom.xml @@ -0,0 +1,72 @@ + + + + 4.0.0 + + org.apache.archiva + archiva-base + 1.2-SNAPSHOT + + archiva-artifact-converter + Archiva Artifact Converter + Converts between Legacy and Modern Layout Artifacts. + + + org.apache.maven + maven-repository-metadata + + + org.codehaus.plexus + plexus-spring + test + + + commons-io + commons-io + + + org.apache.maven + maven-artifact-manager + + + org.apache.archiva + archiva-transaction + + + org.apache.maven.shared + maven-model-converter + + + + + + org.codehaus.plexus + plexus-maven-plugin + + + + descriptor + + + + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/main/java/org/apache/maven/archiva/converter/artifact/ArtifactConversionException.java b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/main/java/org/apache/maven/archiva/converter/artifact/ArtifactConversionException.java new file mode 100644 index 000000000..b2d52338a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/main/java/org/apache/maven/archiva/converter/artifact/ArtifactConversionException.java @@ -0,0 +1,50 @@ +package org.apache.maven.archiva.converter.artifact; + +/* + * 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. + */ + +/** + * ArtifactConversionException + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ArtifactConversionException + extends Exception +{ + + public ArtifactConversionException() + { + } + + public ArtifactConversionException( String message ) + { + super( message ); + } + + public ArtifactConversionException( Throwable cause ) + { + super( cause ); + } + + public ArtifactConversionException( String message, Throwable cause ) + { + super( message, cause ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/main/java/org/apache/maven/archiva/converter/artifact/ArtifactConverter.java b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/main/java/org/apache/maven/archiva/converter/artifact/ArtifactConverter.java new file mode 100644 index 000000000..d01211b97 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/main/java/org/apache/maven/archiva/converter/artifact/ArtifactConverter.java @@ -0,0 +1,58 @@ +package org.apache.maven.archiva.converter.artifact; + +/* + * 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.repository.ArtifactRepository; + +import java.util.Map; + +/** + * ArtifactConverter + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public interface ArtifactConverter +{ + public static final String ROLE = ArtifactConverter.class.getName(); + + /** + * Convert an provided artifact, and place it into the destination repository. + * + * @param artifact the artifact to convert. + * @param destinationRepository the respository to send the artifact to. + * @throws ArtifactConversionException + */ + void convert( Artifact artifact, ArtifactRepository destinationRepository ) + throws ArtifactConversionException; + + /** + * Get the map of accumulated warnings for the conversion. + * + * @return the {@link Map}<{@link Artifact}, {@link String}> warning messages. + */ + Map getWarnings(); + + /** + * Clear the list of warning messages. + */ + void clearWarnings(); +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/main/java/org/apache/maven/archiva/converter/artifact/LegacyToDefaultConverter.java b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/main/java/org/apache/maven/archiva/converter/artifact/LegacyToDefaultConverter.java new file mode 100644 index 000000000..876e91edb --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/main/java/org/apache/maven/archiva/converter/artifact/LegacyToDefaultConverter.java @@ -0,0 +1,690 @@ +package org.apache.maven.archiva.converter.artifact; + +/* + * 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.io.FileUtils; +import org.apache.commons.io.IOUtils; +import org.apache.maven.archiva.transaction.FileTransaction; +import org.apache.maven.archiva.transaction.TransactionException; +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.factory.ArtifactFactory; +import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager; +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.artifact.repository.metadata.ArtifactRepositoryMetadata; +import org.apache.maven.artifact.repository.metadata.Metadata; +import org.apache.maven.artifact.repository.metadata.RepositoryMetadata; +import org.apache.maven.artifact.repository.metadata.Snapshot; +import org.apache.maven.artifact.repository.metadata.SnapshotArtifactRepositoryMetadata; +import org.apache.maven.artifact.repository.metadata.Versioning; +import org.apache.maven.artifact.repository.metadata.io.xpp3.MetadataXpp3Reader; +import org.apache.maven.artifact.repository.metadata.io.xpp3.MetadataXpp3Writer; +import org.apache.maven.model.DistributionManagement; +import org.apache.maven.model.Model; +import org.apache.maven.model.Relocation; +import org.apache.maven.model.converter.ModelConverter; +import org.apache.maven.model.converter.PomTranslationException; +import org.apache.maven.model.io.xpp3.MavenXpp3Writer; +import org.codehaus.plexus.digest.Digester; +import org.codehaus.plexus.digest.DigesterException; +import org.codehaus.plexus.util.xml.pull.XmlPullParserException; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.IOException; +import java.io.StringReader; +import java.io.StringWriter; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.regex.Matcher; + +/** + * LegacyToDefaultConverter + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component role="org.apache.maven.archiva.converter.artifact.ArtifactConverter" + * role-hint="legacy-to-default" + */ +public class LegacyToDefaultConverter + implements ArtifactConverter +{ + /** + * {@link List}<{@link Digester}> + * + * @plexus.requirement role="org.codehaus.plexus.digest.Digester" + */ + private List digesters; + + /** + * @plexus.requirement + */ + private ModelConverter translator; + + /** + * @plexus.requirement + */ + private ArtifactFactory artifactFactory; + + /** + * @plexus.requirement + */ + private ArtifactHandlerManager artifactHandlerManager; + + /** + * @plexus.configuration default-value="false" + */ + private boolean force; + + /** + * @plexus.configuration default-value="false" + */ + private boolean dryrun; + + private Map warnings = new HashMap(); + + public void convert( Artifact artifact, ArtifactRepository targetRepository ) + throws ArtifactConversionException + { + if ( artifact.getRepository().getUrl().equals( targetRepository.getUrl() ) ) + { + throw new ArtifactConversionException( Messages.getString( "exception.repositories.match" ) ); //$NON-NLS-1$ + } + + if ( !validateMetadata( artifact ) ) + { + addWarning( artifact, Messages.getString( "unable.to.validate.metadata" ) ); //$NON-NLS-1$ + return; + } + + FileTransaction transaction = new FileTransaction(); + + if ( !copyPom( artifact, targetRepository, transaction ) ) + { + addWarning( artifact, Messages.getString( "unable.to.copy.pom" ) ); //$NON-NLS-1$ + return; + } + + if ( !copyArtifact( artifact, targetRepository, transaction ) ) + { + addWarning( artifact, Messages.getString( "unable.to.copy.artifact" ) ); //$NON-NLS-1$ + return; + } + + Metadata metadata = createBaseMetadata( artifact ); + Versioning versioning = new Versioning(); + versioning.addVersion( artifact.getBaseVersion() ); + metadata.setVersioning( versioning ); + updateMetadata( new ArtifactRepositoryMetadata( artifact ), targetRepository, metadata, transaction ); + + metadata = createBaseMetadata( artifact ); + metadata.setVersion( artifact.getBaseVersion() ); + versioning = new Versioning(); + + Matcher matcher = Artifact.VERSION_FILE_PATTERN.matcher( artifact.getVersion() ); + if ( matcher.matches() ) + { + Snapshot snapshot = new Snapshot(); + snapshot.setBuildNumber( Integer.valueOf( matcher.group( 3 ) ).intValue() ); + snapshot.setTimestamp( matcher.group( 2 ) ); + versioning.setSnapshot( snapshot ); + } + + // TODO: merge latest/release/snapshot from source instead + metadata.setVersioning( versioning ); + updateMetadata( new SnapshotArtifactRepositoryMetadata( artifact ), targetRepository, metadata, transaction ); + + if ( !dryrun ) + { + try + { + transaction.commit(); + } + catch ( TransactionException e ) + { + throw new ArtifactConversionException( Messages.getString( "transaction.failure", e.getMessage() ), e ); //$NON-NLS-1$ + } + } + } + + private boolean copyPom( Artifact artifact, ArtifactRepository targetRepository, FileTransaction transaction ) + throws ArtifactConversionException + { + Artifact pom = artifactFactory.createProjectArtifact( artifact.getGroupId(), artifact.getArtifactId(), artifact + .getVersion() ); + pom.setBaseVersion( artifact.getBaseVersion() ); + ArtifactRepository repository = artifact.getRepository(); + File file = new File( repository.getBasedir(), repository.pathOf( pom ) ); + + boolean result = true; + if ( file.exists() ) + { + File targetFile = new File( targetRepository.getBasedir(), targetRepository.pathOf( pom ) ); + + String contents = null; + boolean checksumsValid = false; + try + { + if ( testChecksums( artifact, file ) ) + { + checksumsValid = true; + } + + // Even if the checksums for the POM are invalid we should still convert the POM + contents = FileUtils.readFileToString( file, null ); + } + catch ( IOException e ) + { + throw new ArtifactConversionException( + Messages.getString( "unable.to.read.source.pom", e.getMessage() ), e ); //$NON-NLS-1$ + } + + if ( checksumsValid && contents.indexOf( "modelVersion" ) >= 0 ) //$NON-NLS-1$ + { + // v4 POM + try + { + boolean matching = false; + if ( !force && targetFile.exists() ) + { + String targetContents = FileUtils.readFileToString( targetFile, null ); + matching = targetContents.equals( contents ); + } + if ( force || !matching ) + { + transaction.createFile( contents, targetFile, digesters ); + } + } + catch ( IOException e ) + { + throw new ArtifactConversionException( Messages + .getString( "unable.to.write.target.pom", e.getMessage() ), e ); //$NON-NLS-1$ + } + } + else + { + // v3 POM + StringReader stringReader = new StringReader( contents ); + StringWriter writer = null; + try + { + org.apache.maven.model.v3_0_0.io.xpp3.MavenXpp3Reader v3Reader = new org.apache.maven.model.v3_0_0.io.xpp3.MavenXpp3Reader(); + org.apache.maven.model.v3_0_0.Model v3Model = v3Reader.read( stringReader ); + + if ( doRelocation( artifact, v3Model, targetRepository, transaction ) ) + { + Artifact relocatedPom = artifactFactory.createProjectArtifact( artifact.getGroupId(), artifact + .getArtifactId(), artifact.getVersion() ); + targetFile = new File( targetRepository.getBasedir(), targetRepository.pathOf( relocatedPom ) ); + } + + Model v4Model = translator.translate( v3Model ); + + translator.validateV4Basics( v4Model, v3Model.getGroupId(), v3Model.getArtifactId(), v3Model + .getVersion(), v3Model.getPackage() ); + + writer = new StringWriter(); + MavenXpp3Writer Xpp3Writer = new MavenXpp3Writer(); + Xpp3Writer.write( writer, v4Model ); + + transaction.createFile( writer.toString(), targetFile, digesters ); + + List warnings = translator.getWarnings(); + + for ( Iterator i = warnings.iterator(); i.hasNext(); ) + { + String message = (String) i.next(); + addWarning( artifact, message ); + } + } + catch ( XmlPullParserException e ) + { + addWarning( artifact, Messages.getString( "invalid.source.pom", e.getMessage() ) ); //$NON-NLS-1$ + result = false; + } + catch ( IOException e ) + { + throw new ArtifactConversionException( Messages.getString( "unable.to.write.converted.pom" ), e ); //$NON-NLS-1$ + } + catch ( PomTranslationException e ) + { + addWarning( artifact, Messages.getString( "invalid.source.pom", e.getMessage() ) ); //$NON-NLS-1$ + result = false; + } + finally + { + IOUtils.closeQuietly( writer ); + } + } + } + else + { + addWarning( artifact, Messages.getString( "warning.missing.pom" ) ); //$NON-NLS-1$ + } + return result; + } + + private boolean testChecksums( Artifact artifact, File file ) + throws IOException + { + boolean result = true; + Iterator it = digesters.iterator(); + while ( it.hasNext() ) + { + Digester digester = (Digester) it.next(); + result &= verifyChecksum( file, file.getName() + "." + getDigesterFileExtension( digester ), digester, //$NON-NLS-1$ + artifact, "failure.incorrect." + getDigesterFileExtension( digester ) ); //$NON-NLS-1$ + } + return result; + } + + private boolean verifyChecksum( File file, String fileName, Digester digester, Artifact artifact, String key ) + throws IOException + { + boolean result = true; + + File checksumFile = new File( file.getParentFile(), fileName ); + if ( checksumFile.exists() ) + { + String checksum = FileUtils.readFileToString( checksumFile, null ); + try + { + digester.verify( file, checksum ); + } + catch ( DigesterException e ) + { + addWarning( artifact, Messages.getString( key ) ); + result = false; + } + } + return result; + } + + /** + * File extension for checksums + * TODO should be moved to plexus-digester ? + */ + private String getDigesterFileExtension( Digester digester ) + { + return digester.getAlgorithm().toLowerCase().replaceAll( "-", "" ); //$NON-NLS-1$ //$NON-NLS-2$ + } + + private boolean copyArtifact( Artifact artifact, ArtifactRepository targetRepository, FileTransaction transaction ) + throws ArtifactConversionException + { + File sourceFile = artifact.getFile(); + + if ( sourceFile.getAbsolutePath().indexOf( "/plugins/" ) > -1 ) //$NON-NLS-1$ + { + artifact.setArtifactHandler( artifactHandlerManager.getArtifactHandler( "maven-plugin" ) ); //$NON-NLS-1$ + } + + File targetFile = new File( targetRepository.getBasedir(), targetRepository.pathOf( artifact ) ); + + boolean result = true; + try + { + boolean matching = false; + if ( !force && targetFile.exists() ) + { + matching = FileUtils.contentEquals( sourceFile, targetFile ); + if ( !matching ) + { + addWarning( artifact, Messages.getString( "failure.target.already.exists" ) ); //$NON-NLS-1$ + result = false; + } + } + if ( result ) + { + if ( force || !matching ) + { + if ( testChecksums( artifact, sourceFile ) ) + { + transaction.copyFile( sourceFile, targetFile, digesters ); + } + else + { + result = false; + } + } + } + } + catch ( IOException e ) + { + throw new ArtifactConversionException( Messages.getString( "error.copying.artifact" ), e ); //$NON-NLS-1$ + } + return result; + } + + private Metadata createBaseMetadata( Artifact artifact ) + { + Metadata metadata = new Metadata(); + metadata.setArtifactId( artifact.getArtifactId() ); + metadata.setGroupId( artifact.getGroupId() ); + return metadata; + } + + private Metadata readMetadata( File file ) + throws ArtifactConversionException + { + Metadata metadata; + MetadataXpp3Reader reader = new MetadataXpp3Reader(); + FileReader fileReader = null; + try + { + fileReader = new FileReader( file ); + metadata = reader.read( fileReader ); + } + catch ( FileNotFoundException e ) + { + throw new ArtifactConversionException( Messages.getString( "error.reading.target.metadata" ), e ); //$NON-NLS-1$ + } + catch ( IOException e ) + { + throw new ArtifactConversionException( Messages.getString( "error.reading.target.metadata" ), e ); //$NON-NLS-1$ + } + catch ( XmlPullParserException e ) + { + throw new ArtifactConversionException( Messages.getString( "error.reading.target.metadata" ), e ); //$NON-NLS-1$ + } + finally + { + IOUtils.closeQuietly( fileReader ); + } + return metadata; + } + + private boolean validateMetadata( Artifact artifact ) + throws ArtifactConversionException + { + ArtifactRepository repository = artifact.getRepository(); + + boolean result = true; + + RepositoryMetadata repositoryMetadata = new ArtifactRepositoryMetadata( artifact ); + File file = new File( repository.getBasedir(), repository.pathOfRemoteRepositoryMetadata( repositoryMetadata ) ); + if ( file.exists() ) + { + Metadata metadata = readMetadata( file ); + result = validateMetadata( metadata, repositoryMetadata, artifact ); + } + + repositoryMetadata = new SnapshotArtifactRepositoryMetadata( artifact ); + file = new File( repository.getBasedir(), repository.pathOfRemoteRepositoryMetadata( repositoryMetadata ) ); + if ( file.exists() ) + { + Metadata metadata = readMetadata( file ); + result = result && validateMetadata( metadata, repositoryMetadata, artifact ); + } + + return result; + } + + private boolean validateMetadata( Metadata metadata, RepositoryMetadata repositoryMetadata, Artifact artifact ) + { + String groupIdKey; + String artifactIdKey = null; + String snapshotKey = null; + String versionKey = null; + String versionsKey = null; + + if ( repositoryMetadata.storedInGroupDirectory() ) + { + groupIdKey = "failure.incorrect.groupMetadata.groupId"; //$NON-NLS-1$ + } + else if ( repositoryMetadata.storedInArtifactVersionDirectory() ) + { + groupIdKey = "failure.incorrect.snapshotMetadata.groupId"; //$NON-NLS-1$ + artifactIdKey = "failure.incorrect.snapshotMetadata.artifactId"; //$NON-NLS-1$ + versionKey = "failure.incorrect.snapshotMetadata.version"; //$NON-NLS-1$ + snapshotKey = "failure.incorrect.snapshotMetadata.snapshot"; //$NON-NLS-1$ + } + else + { + groupIdKey = "failure.incorrect.artifactMetadata.groupId"; //$NON-NLS-1$ + artifactIdKey = "failure.incorrect.artifactMetadata.artifactId"; //$NON-NLS-1$ + versionsKey = "failure.incorrect.artifactMetadata.versions"; //$NON-NLS-1$ + } + + boolean result = true; + + if ( metadata.getGroupId() == null || !metadata.getGroupId().equals( artifact.getGroupId() ) ) + { + addWarning( artifact, Messages.getString( groupIdKey ) ); + result = false; + } + if ( !repositoryMetadata.storedInGroupDirectory() ) + { + if ( metadata.getGroupId() == null || !metadata.getArtifactId().equals( artifact.getArtifactId() ) ) + { + addWarning( artifact, Messages.getString( artifactIdKey ) ); + result = false; + } + if ( !repositoryMetadata.storedInArtifactVersionDirectory() ) + { + // artifact metadata + + boolean foundVersion = false; + if ( metadata.getVersioning() != null ) + { + for ( Iterator i = metadata.getVersioning().getVersions().iterator(); i.hasNext() && !foundVersion; ) + { + String version = (String) i.next(); + if ( version.equals( artifact.getBaseVersion() ) ) + { + foundVersion = true; + } + } + } + + if ( !foundVersion ) + { + addWarning( artifact, Messages.getString( versionsKey ) ); + result = false; + } + } + else + { + // snapshot metadata + if ( !artifact.getBaseVersion().equals( metadata.getVersion() ) ) + { + addWarning( artifact, Messages.getString( versionKey ) ); + result = false; + } + + if ( artifact.isSnapshot() ) + { + Matcher matcher = Artifact.VERSION_FILE_PATTERN.matcher( artifact.getVersion() ); + if ( matcher.matches() ) + { + boolean correct = false; + if ( metadata.getVersioning() != null && metadata.getVersioning().getSnapshot() != null ) + { + Snapshot snapshot = metadata.getVersioning().getSnapshot(); + int build = Integer.valueOf( matcher.group( 3 ) ).intValue(); + String ts = matcher.group( 2 ); + if ( build == snapshot.getBuildNumber() && ts.equals( snapshot.getTimestamp() ) ) + { + correct = true; + } + } + + if ( !correct ) + { + addWarning( artifact, Messages.getString( snapshotKey ) ); + result = false; + } + } + } + } + } + return result; + } + + private void updateMetadata( RepositoryMetadata artifactMetadata, ArtifactRepository targetRepository, + Metadata newMetadata, FileTransaction transaction ) + throws ArtifactConversionException + { + File file = new File( targetRepository.getBasedir(), targetRepository + .pathOfRemoteRepositoryMetadata( artifactMetadata ) ); + + Metadata metadata; + boolean changed; + + if ( file.exists() ) + { + metadata = readMetadata( file ); + changed = metadata.merge( newMetadata ); + } + else + { + changed = true; + metadata = newMetadata; + } + + if ( changed ) + { + StringWriter writer = null; + try + { + writer = new StringWriter(); + + MetadataXpp3Writer mappingWriter = new MetadataXpp3Writer(); + + mappingWriter.write( writer, metadata ); + + transaction.createFile( writer.toString(), file, digesters ); + } + catch ( IOException e ) + { + throw new ArtifactConversionException( Messages.getString( "error.writing.target.metadata" ), e ); //$NON-NLS-1$ + } + finally + { + IOUtils.closeQuietly( writer ); + } + } + } + + private boolean doRelocation( Artifact artifact, org.apache.maven.model.v3_0_0.Model v3Model, + ArtifactRepository repository, FileTransaction transaction ) + throws IOException + { + Properties properties = v3Model.getProperties(); + if ( properties.containsKey( "relocated.groupId" ) || properties.containsKey( "relocated.artifactId" ) //$NON-NLS-1$ //$NON-NLS-2$ + || properties.containsKey( "relocated.version" ) ) //$NON-NLS-1$ + { + String newGroupId = properties.getProperty( "relocated.groupId", v3Model.getGroupId() ); //$NON-NLS-1$ + properties.remove( "relocated.groupId" ); //$NON-NLS-1$ + + String newArtifactId = properties.getProperty( "relocated.artifactId", v3Model.getArtifactId() ); //$NON-NLS-1$ + properties.remove( "relocated.artifactId" ); //$NON-NLS-1$ + + String newVersion = properties.getProperty( "relocated.version", v3Model.getVersion() ); //$NON-NLS-1$ + properties.remove( "relocated.version" ); //$NON-NLS-1$ + + String message = properties.getProperty( "relocated.message", "" ); //$NON-NLS-1$ //$NON-NLS-2$ + properties.remove( "relocated.message" ); //$NON-NLS-1$ + + if ( properties.isEmpty() ) + { + v3Model.setProperties( null ); + } + + writeRelocationPom( v3Model.getGroupId(), v3Model.getArtifactId(), v3Model.getVersion(), newGroupId, + newArtifactId, newVersion, message, repository, transaction ); + + v3Model.setGroupId( newGroupId ); + v3Model.setArtifactId( newArtifactId ); + v3Model.setVersion( newVersion ); + + artifact.setGroupId( newGroupId ); + artifact.setArtifactId( newArtifactId ); + artifact.setVersion( newVersion ); + + return true; + } + else + { + return false; + } + } + + private void writeRelocationPom( String groupId, String artifactId, String version, String newGroupId, + String newArtifactId, String newVersion, String message, + ArtifactRepository repository, FileTransaction transaction ) + throws IOException + { + Model pom = new Model(); + pom.setGroupId( groupId ); + pom.setArtifactId( artifactId ); + pom.setVersion( version ); + + DistributionManagement dMngt = new DistributionManagement(); + + Relocation relocation = new Relocation(); + relocation.setGroupId( newGroupId ); + relocation.setArtifactId( newArtifactId ); + relocation.setVersion( newVersion ); + if ( message != null && message.length() > 0 ) + { + relocation.setMessage( message ); + } + + dMngt.setRelocation( relocation ); + + pom.setDistributionManagement( dMngt ); + + Artifact artifact = artifactFactory.createBuildArtifact( groupId, artifactId, version, "pom" ); //$NON-NLS-1$ + File pomFile = new File( repository.getBasedir(), repository.pathOf( artifact ) ); + + StringWriter strWriter = new StringWriter(); + MavenXpp3Writer pomWriter = new MavenXpp3Writer(); + pomWriter.write( strWriter, pom ); + + transaction.createFile( strWriter.toString(), pomFile, digesters ); + } + + private void addWarning( Artifact artifact, String message ) + { + List messages = (List) warnings.get( artifact ); + if ( messages == null ) + { + messages = new ArrayList(); + } + messages.add( message ); + warnings.put( artifact, messages ); + } + + public void clearWarnings() + { + warnings.clear(); + } + + public Map getWarnings() + { + return warnings; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/main/java/org/apache/maven/archiva/converter/artifact/Messages.java b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/main/java/org/apache/maven/archiva/converter/artifact/Messages.java new file mode 100644 index 000000000..f426e6482 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/main/java/org/apache/maven/archiva/converter/artifact/Messages.java @@ -0,0 +1,71 @@ +package org.apache.maven.archiva.converter.artifact; + +/* + * 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.text.MessageFormat; +import java.util.MissingResourceException; +import java.util.ResourceBundle; + +/** + * Messages + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class Messages +{ + private static final String BUNDLE_NAME = "org.apache.maven.archiva.converter.artifact.messages"; //$NON-NLS-1$ + + private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle( BUNDLE_NAME ); + + private Messages() + { + } + + public static String getString( String key ) + { + try + { + return RESOURCE_BUNDLE.getString( key ); + } + catch ( MissingResourceException e ) + { + return '!' + key + '!'; + } + } + + public static String getString( String key, Object argument ) + { + return getString( key, new Object[] { argument } ); + } + + public static String getString( String key, Object arguments[] ) + { + try + { + String pattern = RESOURCE_BUNDLE.getString( key ); + return MessageFormat.format( pattern, arguments ); + } + catch ( MissingResourceException e ) + { + return '!' + key + '!'; + } + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/main/resources/org/apache/maven/archiva/converter/artifact/messages.properties b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/main/resources/org/apache/maven/archiva/converter/artifact/messages.properties new file mode 100644 index 000000000..5e5bc6dd3 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/main/resources/org/apache/maven/archiva/converter/artifact/messages.properties @@ -0,0 +1,51 @@ +# +# 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. +# + +unable.to.validate.metadata=Unable to validate metadata +unable.to.copy.pom=Unable to copy pom. +unable.to.copy.artifact=Unable to copy artifact +unable.to.read.source.pom=Unable to read source POM: {0} +unable.to.write.target.pom=Unable to write target POM: {0} +unable.to.write.converted.pom=Unable to write converted POM + + +exception.repositories.match=Source repository of artifact, and target repository are the same. No conversion needed. +transaction.failure=Transaction failure: {0} +invalid.source.pom=Invalid source pom: {0} + +warning.missing.pom=The artifact had no POM in the source repository. + +error.copying.artifact=Error copying artifact +error.reading.target.metadata=Error reading target metadata +error.writing.target.metadata=Error writing target metadata + +failure.target.already.exists=The artifact could not be converted because it already exists. +failure.incorrect.groupMetadata.groupId=The group ID in the source group metadata is incorrect. + +failure.incorrect.artifactMetadata.artifactId=The artifact ID in the source artifact metadata is incorrect. +failure.incorrect.artifactMetadata.groupId=The group ID in the source artifact metadata is incorrect. +failure.incorrect.artifactMetadata.versions=The version list in the source artifact metadata is incorrect. + +failure.incorrect.snapshotMetadata.artifactId=The artifact ID in the source artifact version metadata is incorrect. +failure.incorrect.snapshotMetadata.groupId=The group ID in the source artifact version metadata is incorrect. +failure.incorrect.snapshotMetadata.version=The version in the source artifact version metadata is incorrect. +failure.incorrect.snapshotMetadata.snapshot=The snapshot information in the source artifact version metadata is incorrect. + +failure.incorrect.md5=The MD5 checksum value was incorrect. +failure.incorrect.sha1=The SHA1 checksum value was incorrect. diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/converted-artifact-one.pom b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/converted-artifact-one.pom new file mode 100644 index 000000000..cd3862d35 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/converted-artifact-one.pom @@ -0,0 +1,6 @@ + + 4.0.0 + test + artifact-one + 1.0.0 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/converted-artifact-three.pom b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/converted-artifact-three.pom new file mode 100644 index 000000000..343291037 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/converted-artifact-three.pom @@ -0,0 +1,6 @@ + + 4.0.0 + test + artifact-three + 1.0.0 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/converted-artifact-two.pom b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/converted-artifact-two.pom new file mode 100644 index 000000000..227470167 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/converted-artifact-two.pom @@ -0,0 +1,6 @@ + + 4.0.0 + test + artifact-two + 1.0.0 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/converted-v3-snapshot.pom b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/converted-v3-snapshot.pom new file mode 100644 index 000000000..1615b6663 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/converted-v3-snapshot.pom @@ -0,0 +1,28 @@ + + 4.0.0 + test + v3artifact + 1.0.0-SNAPSHOT + + scm:cvs:ext:${maven.username}@localhost:/home/cvs + + + + groupId + artifactId + version + + + groupId + test-artifactId + version + test + + + junit + junit + 3.8.2 + test + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/converted-v3-timestamped-snapshot.pom b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/converted-v3-timestamped-snapshot.pom new file mode 100644 index 000000000..94307d863 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/converted-v3-timestamped-snapshot.pom @@ -0,0 +1,28 @@ + + 4.0.0 + test + v3artifact + 1.0.0-20060105.130101-3 + + scm:cvs:ext:${maven.username}@localhost:/home/cvs + + + + groupId + artifactId + version + + + groupId + test-artifactId + version + test + + + junit + junit + 3.8.2 + test + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/converted-v3-warnings.pom b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/converted-v3-warnings.pom new file mode 100644 index 000000000..25f4e76d0 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/converted-v3-warnings.pom @@ -0,0 +1,28 @@ + + 4.0.0 + test + v3-warnings-artifact + 1.0.0 + + scm:cvs:ext:${maven.username}@localhost:/home/cvs + + + + groupId + artifactId + version + + + groupId + test-artifactId + version + test + + + junit + junit + 3.8.2 + test + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/converted-v3.pom b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/converted-v3.pom new file mode 100644 index 000000000..9f8b63e16 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/converted-v3.pom @@ -0,0 +1,28 @@ + + 4.0.0 + test + v3artifact + 1.0.0 + + scm:cvs:ext:${maven.username}@localhost:/home/cvs + + + + groupId + artifactId + version + + + groupId + test-artifactId + version + test + + + junit + junit + 3.8.2 + test + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/maven-foo-plugin-1.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/maven-foo-plugin-1.0.pom new file mode 100644 index 000000000..17095cc57 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/maven-foo-plugin-1.0.pom @@ -0,0 +1,7 @@ + + 4.0.0 + org.apache.maven.plugins + maven-foo-plugin + 1.0.0 + maven-plugin + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/newversion-artifact-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/newversion-artifact-metadata.xml new file mode 100644 index 000000000..ecc7f09a0 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/newversion-artifact-metadata.xml @@ -0,0 +1,10 @@ + + test + newversion-artifact + + + 1.0.0 + 1.0.1 + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/relocated-test/relocated-v3artifact/1.0.0/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/relocated-test/relocated-v3artifact/1.0.0/maven-metadata.xml new file mode 100644 index 000000000..ebd9be970 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/relocated-test/relocated-v3artifact/1.0.0/maven-metadata.xml @@ -0,0 +1,6 @@ + + relocated-test + relocated-v3artifact + 1.0.0 + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/relocated-test/relocated-v3artifact/1.0.0/relocated-v3artifact-1.0.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/relocated-test/relocated-v3artifact/1.0.0/relocated-v3artifact-1.0.0.jar new file mode 100644 index 000000000..29ef827e8 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/relocated-test/relocated-v3artifact/1.0.0/relocated-v3artifact-1.0.0.jar @@ -0,0 +1 @@ +v3 diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/relocated-test/relocated-v3artifact/1.0.0/relocated-v3artifact-1.0.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/relocated-test/relocated-v3artifact/1.0.0/relocated-v3artifact-1.0.0.pom new file mode 100644 index 000000000..0180549f0 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/relocated-test/relocated-v3artifact/1.0.0/relocated-v3artifact-1.0.0.pom @@ -0,0 +1,28 @@ + + 4.0.0 + relocated-test + relocated-v3artifact + 1.0.0 + + scm:cvs:ext:${maven.username}@localhost:/home/cvs + + + + groupId + artifactId + version + + + groupId + test-artifactId + version + test + + + junit + junit + 3.8.2 + test + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/relocated-test/relocated-v3artifact/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/relocated-test/relocated-v3artifact/maven-metadata.xml new file mode 100644 index 000000000..b4b1a864a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/relocated-test/relocated-v3artifact/maven-metadata.xml @@ -0,0 +1,9 @@ + + relocated-test + relocated-v3artifact + + + 1.0.0 + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/test/relocated-v3artifact/1.0.0/relocated-v3artifact-1.0.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/test/relocated-v3artifact/1.0.0/relocated-v3artifact-1.0.0.pom new file mode 100644 index 000000000..b20f62f9e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/test/relocated-v3artifact/1.0.0/relocated-v3artifact-1.0.0.pom @@ -0,0 +1,12 @@ + + test + relocated-v3artifact + 1.0.0 + + + relocated-test + relocated-v3artifact + 1.0.0 + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/v3-artifact-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/v3-artifact-metadata.xml new file mode 100644 index 000000000..a8a7f3748 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/v3-artifact-metadata.xml @@ -0,0 +1,9 @@ + + test + v3artifact + + + 1.0.0 + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/v3-snapshot-artifact-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/v3-snapshot-artifact-metadata.xml new file mode 100644 index 000000000..24d25a0e0 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/v3-snapshot-artifact-metadata.xml @@ -0,0 +1,9 @@ + + test + v3artifact + + + 1.0.0-SNAPSHOT + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/v3-snapshot-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/v3-snapshot-metadata.xml new file mode 100644 index 000000000..b19c537b5 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/v3-snapshot-metadata.xml @@ -0,0 +1,6 @@ + + test + v3artifact + 1.0.0-SNAPSHOT + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/v3-timestamped-snapshot-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/v3-timestamped-snapshot-metadata.xml new file mode 100644 index 000000000..602c38ec8 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/v3-timestamped-snapshot-metadata.xml @@ -0,0 +1,11 @@ + + test + v3artifact + 1.0.0-SNAPSHOT + + + 20060105.130101 + 3 + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/v3-version-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/v3-version-metadata.xml new file mode 100644 index 000000000..3c8938984 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/v3-version-metadata.xml @@ -0,0 +1,6 @@ + + test + v3artifact + 1.0.0 + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/v4-artifact-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/v4-artifact-metadata.xml new file mode 100644 index 000000000..c0cdbfdb4 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/v4-artifact-metadata.xml @@ -0,0 +1,9 @@ + + test + v4artifact + + + 1.0.0 + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/v4-snapshot-artifact-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/v4-snapshot-artifact-metadata.xml new file mode 100644 index 000000000..f8072b0df --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/v4-snapshot-artifact-metadata.xml @@ -0,0 +1,9 @@ + + test + v4artifact + + + 1.0.0-SNAPSHOT + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/v4-snapshot-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/v4-snapshot-metadata.xml new file mode 100644 index 000000000..d5ecb7d47 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/v4-snapshot-metadata.xml @@ -0,0 +1,6 @@ + + test + v4artifact + 1.0.0-SNAPSHOT + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/v4-timestamped-snapshot-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/v4-timestamped-snapshot-metadata.xml new file mode 100644 index 000000000..060a79cdd --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/v4-timestamped-snapshot-metadata.xml @@ -0,0 +1,11 @@ + + test + v4artifact + 1.0.0-SNAPSHOT + + + 20060111.120115 + 1 + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/v4-version-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/v4-version-metadata.xml new file mode 100644 index 000000000..7cbd8ad3d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/expected-files/v4-version-metadata.xml @@ -0,0 +1,6 @@ + + test + v4artifact + 1.0.0 + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/java/org/apache/maven/archiva/converter/artifact/LegacyToDefaultConverterTest.java b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/java/org/apache/maven/archiva/converter/artifact/LegacyToDefaultConverterTest.java new file mode 100644 index 000000000..cbbf6289c --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/java/org/apache/maven/archiva/converter/artifact/LegacyToDefaultConverterTest.java @@ -0,0 +1,1010 @@ +package org.apache.maven.archiva.converter.artifact; + +/* + * 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.io.FileUtils; +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.factory.ArtifactFactory; +import org.apache.maven.artifact.metadata.ArtifactMetadata; +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.artifact.repository.ArtifactRepositoryFactory; +import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout; +import org.apache.maven.artifact.repository.metadata.ArtifactRepositoryMetadata; +import org.apache.maven.artifact.repository.metadata.SnapshotArtifactRepositoryMetadata; +import org.codehaus.plexus.spring.PlexusInSpringTestCase; + +import java.io.File; +import java.io.IOException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Map.Entry; +import java.util.regex.Matcher; + +/** + * LegacyToDefaultConverterTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class LegacyToDefaultConverterTest + extends PlexusInSpringTestCase +{ + private ArtifactRepository sourceRepository; + + private ArtifactRepository targetRepository; + + private ArtifactConverter artifactConverter; + + private ArtifactFactory artifactFactory; + + private static final int SLEEP_MILLIS = 100; + + protected void setUp() + throws Exception + { + super.setUp(); + + ArtifactRepositoryFactory factory = (ArtifactRepositoryFactory) lookup( ArtifactRepositoryFactory.ROLE ); + + ArtifactRepositoryLayout layout = (ArtifactRepositoryLayout) lookup( ArtifactRepositoryLayout.ROLE, "legacy" ); + + File sourceBase = getTestFile( "src/test/source-repository" ); + sourceRepository = factory.createArtifactRepository( "source", sourceBase.toURL().toString(), layout, null, + null ); + + layout = (ArtifactRepositoryLayout) lookup( ArtifactRepositoryLayout.ROLE, "default" ); + + File targetBase = getTestFile( "target/test-target-repository" ); + copyDirectoryStructure( getTestFile( "src/test/target-repository" ), targetBase ); + + targetRepository = factory.createArtifactRepository( "target", targetBase.toURL().toString(), layout, null, + null ); + + artifactConverter = (ArtifactConverter) lookup( ArtifactConverter.ROLE, "legacy-to-default" ); + + artifactFactory = (ArtifactFactory) lookup( ArtifactFactory.ROLE ); + } + + protected void tearDown() + throws Exception + { + super.tearDown(); + } + + private void copyDirectoryStructure( File sourceDirectory, File destinationDirectory ) + throws IOException + { + if ( !sourceDirectory.exists() ) + { + throw new IOException( "Source directory doesn't exists (" + sourceDirectory.getAbsolutePath() + ")." ); + } + + File[] files = sourceDirectory.listFiles(); + + String sourcePath = sourceDirectory.getAbsolutePath(); + + for ( int i = 0; i < files.length; i++ ) + { + File file = files[i]; + + String dest = file.getAbsolutePath(); + + dest = dest.substring( sourcePath.length() + 1 ); + + File destination = new File( destinationDirectory, dest ); + + if ( file.isFile() ) + { + destination = destination.getParentFile(); + + FileUtils.copyFileToDirectory( file, destination ); + } + else if ( file.isDirectory() ) + { + if ( !".svn".equals( file.getName() ) ) + { + if ( !destination.exists() && !destination.mkdirs() ) + { + throw new IOException( "Could not create destination directory '" + + destination.getAbsolutePath() + "'." ); + } + copyDirectoryStructure( file, destination ); + } + } + else + { + throw new IOException( "Unknown file type: " + file.getAbsolutePath() ); + } + } + } + + public void testV4PomConvert() + throws Exception + { + // test that it is copied as is + + Artifact artifact = createArtifact( "test", "v4artifact", "1.0.0" ); + ArtifactMetadata artifactMetadata = new ArtifactRepositoryMetadata( artifact ); + File artifactMetadataFile = new File( targetRepository.getBasedir(), targetRepository + .pathOfRemoteRepositoryMetadata( artifactMetadata ) ); + artifactMetadataFile.delete(); + + ArtifactMetadata versionMetadata = new SnapshotArtifactRepositoryMetadata( artifact ); + File versionMetadataFile = new File( targetRepository.getBasedir(), targetRepository + .pathOfRemoteRepositoryMetadata( versionMetadata ) ); + versionMetadataFile.delete(); + + File artifactFile = new File( targetRepository.getBasedir(), targetRepository.pathOf( artifact ) ); + artifactFile.delete(); + + artifactConverter.convert( artifact, targetRepository ); + checkSuccess( artifactConverter ); + + assertTrue( "Check artifact created", artifactFile.exists() ); + assertTrue( "Check artifact matches", FileUtils.contentEquals( artifactFile, artifact.getFile() ) ); + + artifact = createPomArtifact( artifact ); + File pomFile = new File( targetRepository.getBasedir(), targetRepository.pathOf( artifact ) ); + File sourcePomFile = new File( sourceRepository.getBasedir(), sourceRepository.pathOf( artifact ) ); + assertTrue( "Check POM created", pomFile.exists() ); + + compareFiles( sourcePomFile, pomFile ); + + assertTrue( "Check artifact metadata created", artifactMetadataFile.exists() ); + + File expectedMetadataFile = getTestFile( "src/test/expected-files/v4-artifact-metadata.xml" ); + + compareFiles( expectedMetadataFile, artifactMetadataFile ); + + assertTrue( "Check snapshot metadata created", versionMetadataFile.exists() ); + + expectedMetadataFile = getTestFile( "src/test/expected-files/v4-version-metadata.xml" ); + + compareFiles( expectedMetadataFile, versionMetadataFile ); + } + + public void testV3PomConvert() + throws Exception + { + // test that the pom is coverted + + Artifact artifact = createArtifact( "test", "v3artifact", "1.0.0" ); + ArtifactMetadata artifactMetadata = new ArtifactRepositoryMetadata( artifact ); + File artifactMetadataFile = new File( targetRepository.getBasedir(), targetRepository + .pathOfRemoteRepositoryMetadata( artifactMetadata ) ); + artifactMetadataFile.delete(); + + ArtifactMetadata versionMetadata = new SnapshotArtifactRepositoryMetadata( artifact ); + File versionMetadataFile = new File( targetRepository.getBasedir(), targetRepository + .pathOfRemoteRepositoryMetadata( versionMetadata ) ); + versionMetadataFile.delete(); + + artifactConverter.convert( artifact, targetRepository ); + checkSuccess( artifactConverter ); + + File artifactFile = new File( targetRepository.getBasedir(), targetRepository.pathOf( artifact ) ); + assertTrue( "Check artifact created", artifactFile.exists() ); + assertTrue( "Check artifact matches", FileUtils.contentEquals( artifactFile, artifact.getFile() ) ); + + artifact = createPomArtifact( artifact ); + File pomFile = new File( targetRepository.getBasedir(), targetRepository.pathOf( artifact ) ); + File expectedPomFile = getTestFile( "src/test/expected-files/converted-v3.pom" ); + assertTrue( "Check POM created", pomFile.exists() ); + + compareFiles( expectedPomFile, pomFile ); + + assertTrue( "Check artifact metadata created", artifactMetadataFile.exists() ); + + File expectedMetadataFile = getTestFile( "src/test/expected-files/v3-artifact-metadata.xml" ); + + compareFiles( expectedMetadataFile, artifactMetadataFile ); + + assertTrue( "Check snapshot metadata created", versionMetadataFile.exists() ); + + expectedMetadataFile = getTestFile( "src/test/expected-files/v3-version-metadata.xml" ); + + compareFiles( expectedMetadataFile, versionMetadataFile ); + } + + public void testV3PomConvertWithRelocation() + throws Exception + { + Artifact artifact = createArtifact( "test", "relocated-v3artifact", "1.0.0" ); + ArtifactMetadata artifactMetadata = new ArtifactRepositoryMetadata( artifact ); + File artifactMetadataFile = new File( targetRepository.getBasedir(), targetRepository + .pathOfRemoteRepositoryMetadata( artifactMetadata ) ); + artifactMetadataFile.delete(); + + ArtifactMetadata versionMetadata = new SnapshotArtifactRepositoryMetadata( artifact ); + File versionMetadataFile = new File( targetRepository.getBasedir(), targetRepository + .pathOfRemoteRepositoryMetadata( versionMetadata ) ); + versionMetadataFile.delete(); + + artifactConverter.convert( artifact, targetRepository ); + //checkSuccess(); --> commented until MNG-2100 is fixed + + File artifactFile = new File( targetRepository.getBasedir(), targetRepository.pathOf( artifact ) ); + assertTrue( "Check if relocated artifact created", artifactFile.exists() ); + assertTrue( "Check if relocated artifact matches", FileUtils.contentEquals( artifactFile, artifact.getFile() ) ); + Artifact pomArtifact = createArtifact( "relocated-test", "relocated-v3artifact", "1.0.0", "1.0.0", "pom" ); + File pomFile = getTestFile( "src/test/expected-files/" + targetRepository.pathOf( pomArtifact ) ); + File testFile = getTestFile( "target/test-target-repository/" + targetRepository.pathOf( pomArtifact ) ); + compareFiles( pomFile, testFile ); + + Artifact orig = createArtifact( "test", "relocated-v3artifact", "1.0.0", "1.0.0", "pom" ); + artifactFile = new File( targetRepository.getBasedir(), targetRepository.pathOf( orig ) ); + assertTrue( "Check if relocation artifact pom is created", artifactFile.exists() ); + testFile = getTestFile( "src/test/expected-files/" + targetRepository.pathOf( orig ) ); + compareFiles( artifactFile, testFile ); + } + + public void testV3PomWarningsOnConvert() + throws Exception + { + // test that the pom is converted but that warnings are reported + + Artifact artifact = createArtifact( "test", "v3-warnings-artifact", "1.0.0" ); + ArtifactMetadata artifactMetadata = new ArtifactRepositoryMetadata( artifact ); + File artifactMetadataFile = new File( targetRepository.getBasedir(), targetRepository + .pathOfRemoteRepositoryMetadata( artifactMetadata ) ); + artifactMetadataFile.delete(); + + ArtifactMetadata versionMetadata = new SnapshotArtifactRepositoryMetadata( artifact ); + File versionMetadataFile = new File( targetRepository.getBasedir(), targetRepository + .pathOfRemoteRepositoryMetadata( versionMetadata ) ); + versionMetadataFile.delete(); + + artifactConverter.convert( artifact, targetRepository ); + checkWarnings( artifactConverter, 2 ); + + File artifactFile = new File( targetRepository.getBasedir(), targetRepository.pathOf( artifact ) ); + assertTrue( "Check artifact created", artifactFile.exists() ); + assertTrue( "Check artifact matches", FileUtils.contentEquals( artifactFile, artifact.getFile() ) ); + + artifact = createPomArtifact( artifact ); + File pomFile = new File( targetRepository.getBasedir(), targetRepository.pathOf( artifact ) ); + File expectedPomFile = getTestFile( "src/test/expected-files/converted-v3-warnings.pom" ); + assertTrue( "Check POM created", pomFile.exists() ); + + compareFiles( expectedPomFile, pomFile ); + + // TODO: check 2 warnings (extend and versions) matched on i18n key + } + + private void doTestV4SnapshotPomConvert( String version, String expectedMetadataFileName ) + throws Exception + { + // test that it is copied as is + + Artifact artifact = createArtifact( "test", "v4artifact", version ); + ArtifactMetadata artifactMetadata = new ArtifactRepositoryMetadata( artifact ); + File artifactMetadataFile = new File( targetRepository.getBasedir(), targetRepository + .pathOfRemoteRepositoryMetadata( artifactMetadata ) ); + artifactMetadataFile.delete(); + + ArtifactMetadata snapshotMetadata = new SnapshotArtifactRepositoryMetadata( artifact ); + File snapshotMetadataFile = new File( targetRepository.getBasedir(), targetRepository + .pathOfRemoteRepositoryMetadata( snapshotMetadata ) ); + snapshotMetadataFile.delete(); + + artifactConverter.convert( artifact, targetRepository ); + checkSuccess( artifactConverter ); + + File artifactFile = new File( targetRepository.getBasedir(), targetRepository.pathOf( artifact ) ); + assertTrue( "Check artifact created", artifactFile.exists() ); + assertTrue( "Check artifact matches", FileUtils.contentEquals( artifactFile, artifact.getFile() ) ); + + artifact = createPomArtifact( artifact ); + File pomFile = new File( targetRepository.getBasedir(), targetRepository.pathOf( artifact ) ); + File sourcePomFile = new File( sourceRepository.getBasedir(), sourceRepository.pathOf( artifact ) ); + assertTrue( "Check POM created", pomFile.exists() ); + + compareFiles( sourcePomFile, pomFile ); + + assertTrue( "Check artifact metadata created", artifactMetadataFile.exists() ); + + File expectedMetadataFile = getTestFile( "src/test/expected-files/v4-snapshot-artifact-metadata.xml" ); + + compareFiles( expectedMetadataFile, artifactMetadataFile ); + + assertTrue( "Check snapshot metadata created", snapshotMetadataFile.exists() ); + + expectedMetadataFile = getTestFile( expectedMetadataFileName ); + + compareFiles( expectedMetadataFile, snapshotMetadataFile ); + } + + public void testV3SnapshotPomConvert() + throws Exception + { + // test that the pom is coverted + + Artifact artifact = createArtifact( "test", "v3artifact", "1.0.0-SNAPSHOT" ); + ArtifactMetadata artifactMetadata = new ArtifactRepositoryMetadata( artifact ); + File artifactMetadataFile = new File( targetRepository.getBasedir(), targetRepository + .pathOfRemoteRepositoryMetadata( artifactMetadata ) ); + artifactMetadataFile.delete(); + + ArtifactMetadata snapshotMetadata = new SnapshotArtifactRepositoryMetadata( artifact ); + File snapshotMetadataFile = new File( targetRepository.getBasedir(), targetRepository + .pathOfRemoteRepositoryMetadata( snapshotMetadata ) ); + snapshotMetadataFile.delete(); + + artifactConverter.convert( artifact, targetRepository ); + checkSuccess( artifactConverter ); + + File artifactFile = new File( targetRepository.getBasedir(), targetRepository.pathOf( artifact ) ); + assertTrue( "Check artifact created", artifactFile.exists() ); + assertTrue( "Check artifact matches", FileUtils.contentEquals( artifactFile, artifact.getFile() ) ); + + artifact = createPomArtifact( artifact ); + File pomFile = new File( targetRepository.getBasedir(), targetRepository.pathOf( artifact ) ); + File expectedPomFile = getTestFile( "src/test/expected-files/converted-v3-snapshot.pom" ); + assertTrue( "Check POM created", pomFile.exists() ); + + compareFiles( expectedPomFile, pomFile ); + + assertTrue( "Check artifact metadata created", artifactMetadataFile.exists() ); + + File expectedMetadataFile = getTestFile( "src/test/expected-files/v3-snapshot-artifact-metadata.xml" ); + + compareFiles( expectedMetadataFile, artifactMetadataFile ); + + assertTrue( "Check snapshot metadata created", snapshotMetadataFile.exists() ); + + expectedMetadataFile = getTestFile( "src/test/expected-files/v3-snapshot-metadata.xml" ); + + compareFiles( expectedMetadataFile, snapshotMetadataFile ); + } + + public void testV4SnapshotPomConvert() + throws Exception + { + doTestV4SnapshotPomConvert( "1.0.0-SNAPSHOT", "src/test/expected-files/v4-snapshot-metadata.xml" ); + + assertTrue( true ); + } + + public void testV4TimestampedSnapshotPomConvert() + throws Exception + { + doTestV4SnapshotPomConvert( "1.0.0-20060111.120115-1", + "src/test/expected-files/v4-timestamped-snapshot-metadata.xml" ); + + assertTrue( true ); + } + + public void testMavenOnePluginConversion() + throws Exception + { + Artifact artifact = createArtifact( "org.apache.maven.plugins", "maven-foo-plugin", "1.0", "1.0", + "maven-plugin" ); + artifact.setFile( new File( getBasedir(), "src/test/source-repository/test/plugins/maven-foo-plugin-1.0.jar" ) ); + artifactConverter.convert( artifact, targetRepository ); + // There is a warning but I can't figure out how to look at it. Eyeballing the results it appears + // the plugin is being coverted correctly. + //checkSuccess(); + + File artifactFile = new File( targetRepository.getBasedir(), targetRepository.pathOf( artifact ) ); + assertTrue( "Check artifact created", artifactFile.exists() ); + assertTrue( "Check artifact matches", FileUtils.contentEquals( artifactFile, artifact.getFile() ) ); + + /* + The POM isn't needed for Maven 1.x plugins but the raw conversion for + + artifact = createPomArtifact( artifact ); + File pomFile = new File( targetRepository.getBasedir(), targetRepository.pathOf( artifact ) ); + File expectedPomFile = getTestFile( "src/test/expected-files/maven-foo-plugin-1.0.pom" ); + assertTrue( "Check POM created", pomFile.exists() ); + compareFiles( expectedPomFile, pomFile ); + */ + } + + public void testV3TimestampedSnapshotPomConvert() + throws Exception + { + // test that the pom is coverted + + Artifact artifact = createArtifact( "test", "v3artifact", "1.0.0-20060105.130101-3" ); + ArtifactMetadata artifactMetadata = new ArtifactRepositoryMetadata( artifact ); + File artifactMetadataFile = new File( targetRepository.getBasedir(), targetRepository + .pathOfRemoteRepositoryMetadata( artifactMetadata ) ); + artifactMetadataFile.delete(); + + ArtifactMetadata snapshotMetadata = new SnapshotArtifactRepositoryMetadata( artifact ); + File snapshotMetadataFile = new File( targetRepository.getBasedir(), targetRepository + .pathOfRemoteRepositoryMetadata( snapshotMetadata ) ); + snapshotMetadataFile.delete(); + + artifactConverter.convert( artifact, targetRepository ); + checkSuccess( artifactConverter ); + + File artifactFile = new File( targetRepository.getBasedir(), targetRepository.pathOf( artifact ) ); + assertTrue( "Check artifact created", artifactFile.exists() ); + assertTrue( "Check artifact matches", FileUtils.contentEquals( artifactFile, artifact.getFile() ) ); + + artifact = createPomArtifact( artifact ); + File pomFile = new File( targetRepository.getBasedir(), targetRepository.pathOf( artifact ) ); + File expectedPomFile = getTestFile( "src/test/expected-files/converted-v3-timestamped-snapshot.pom" ); + assertTrue( "Check POM created", pomFile.exists() ); + + compareFiles( expectedPomFile, pomFile ); + + assertTrue( "Check artifact snapshotMetadata created", artifactMetadataFile.exists() ); + + File expectedMetadataFile = getTestFile( "src/test/expected-files/v3-snapshot-artifact-metadata.xml" ); + + compareFiles( expectedMetadataFile, artifactMetadataFile ); + + assertTrue( "Check snapshot snapshotMetadata created", snapshotMetadataFile.exists() ); + + expectedMetadataFile = getTestFile( "src/test/expected-files/v3-timestamped-snapshot-metadata.xml" ); + + compareFiles( expectedMetadataFile, snapshotMetadataFile ); + } + + public void testNoPomConvert() + throws Exception + { + // test that a POM is not created when there was none at the source + + Artifact artifact = createArtifact( "test", "noPomArtifact", "1.0.0" ); + artifactConverter.convert( artifact, targetRepository ); + checkWarnings( artifactConverter, 1 ); + + assertHasWarningReason( artifactConverter, Messages.getString( "warning.missing.pom" ) ); + + File artifactFile = new File( targetRepository.getBasedir(), targetRepository.pathOf( artifact ) ); + assertTrue( "Check artifact created", artifactFile.exists() ); + assertTrue( "Check artifact matches", FileUtils.contentEquals( artifactFile, artifact.getFile() ) ); + + artifact = createPomArtifact( artifact ); + File pomFile = new File( targetRepository.getBasedir(), targetRepository.pathOf( artifact ) ); + File sourcePomFile = new File( sourceRepository.getBasedir(), sourceRepository.pathOf( artifact ) ); + + assertFalse( "Check no POM created", pomFile.exists() ); + assertFalse( "No source POM", sourcePomFile.exists() ); + } + + public void testIncorrectSourceChecksumMd5() + throws Exception + { + // test that it fails when the source md5 is wrong + + Artifact artifact = createArtifact( "test", "incorrectMd5Artifact", "1.0.0" ); + File file = new File( targetRepository.getBasedir(), targetRepository.pathOf( artifact ) ); + file.delete(); + + artifactConverter.convert( artifact, targetRepository ); + checkWarnings( artifactConverter, 2 ); + + assertHasWarningReason( artifactConverter, Messages.getString( "failure.incorrect.md5" ) ); + + assertFalse( "Check artifact not created", file.exists() ); + + ArtifactRepositoryMetadata metadata = new ArtifactRepositoryMetadata( artifact ); + File metadataFile = new File( targetRepository.getBasedir(), targetRepository + .pathOfRemoteRepositoryMetadata( metadata ) ); + assertFalse( "Check metadata not created", metadataFile.exists() ); + } + + public void testIncorrectSourceChecksumSha1() + throws Exception + { + // test that it fails when the source sha1 is wrong + + Artifact artifact = createArtifact( "test", "incorrectSha1Artifact", "1.0.0" ); + File file = new File( targetRepository.getBasedir(), targetRepository.pathOf( artifact ) ); + file.delete(); + + artifactConverter.convert( artifact, targetRepository ); + checkWarnings( artifactConverter, 2 ); + + assertHasWarningReason( artifactConverter, Messages.getString( "failure.incorrect.sha1" ) ); + + assertFalse( "Check artifact not created", file.exists() ); + + ArtifactRepositoryMetadata metadata = new ArtifactRepositoryMetadata( artifact ); + File metadataFile = new File( targetRepository.getBasedir(), targetRepository + .pathOfRemoteRepositoryMetadata( metadata ) ); + assertFalse( "Check metadata not created", metadataFile.exists() ); + } + + public void testUnmodifiedArtifact() + throws Exception, InterruptedException + { + // test the unmodified artifact is untouched + + Artifact artifact = createArtifact( "test", "unmodified-artifact", "1.0.0" ); + Artifact pomArtifact = createPomArtifact( artifact ); + + File sourceFile = new File( sourceRepository.getBasedir(), sourceRepository.pathOf( artifact ) ); + File sourcePomFile = new File( sourceRepository.getBasedir(), sourceRepository.pathOf( pomArtifact ) ); + File targetFile = new File( targetRepository.getBasedir(), targetRepository.pathOf( artifact ) ); + File targetPomFile = new File( targetRepository.getBasedir(), targetRepository.pathOf( pomArtifact ) ); + + assertTrue( "Check target file exists", targetFile.exists() ); + assertTrue( "Check target POM exists", targetPomFile.exists() ); + + sourceFile.setLastModified( System.currentTimeMillis() ); + sourcePomFile.setLastModified( System.currentTimeMillis() ); + + long origTime = targetFile.lastModified(); + long origPomTime = targetPomFile.lastModified(); + + // Need to guarantee last modified is not equal + Thread.sleep( SLEEP_MILLIS ); + + artifactConverter.convert( artifact, targetRepository ); + checkSuccess( artifactConverter ); + + compareFiles( sourceFile, targetFile ); + compareFiles( sourcePomFile, targetPomFile ); + + assertEquals( "Check artifact unmodified", origTime, targetFile.lastModified() ); + assertEquals( "Check POM unmodified", origPomTime, targetPomFile.lastModified() ); + } + + public void testModifedArtifactFails() + throws Exception + { + // test that it fails when the source artifact has changed and is different to the existing artifact in the + // target repository + + Artifact artifact = createArtifact( "test", "modified-artifact", "1.0.0" ); + Artifact pomArtifact = createPomArtifact( artifact ); + + File sourceFile = new File( sourceRepository.getBasedir(), sourceRepository.pathOf( artifact ) ); + File sourcePomFile = new File( sourceRepository.getBasedir(), sourceRepository.pathOf( pomArtifact ) ); + File targetFile = new File( targetRepository.getBasedir(), targetRepository.pathOf( artifact ) ); + File targetPomFile = new File( targetRepository.getBasedir(), targetRepository.pathOf( pomArtifact ) ); + + assertTrue( "Check target file exists", targetFile.exists() ); + assertTrue( "Check target POM exists", targetPomFile.exists() ); + + sourceFile.setLastModified( System.currentTimeMillis() ); + sourcePomFile.setLastModified( System.currentTimeMillis() ); + + long origTime = targetFile.lastModified(); + long origPomTime = targetPomFile.lastModified(); + + // Need to guarantee last modified is not equal + Thread.sleep( SLEEP_MILLIS ); + + artifactConverter.convert( artifact, targetRepository ); + checkWarnings( artifactConverter, 2 ); + + assertHasWarningReason( artifactConverter, Messages.getString( "failure.target.already.exists" ) ); + + assertEquals( "Check unmodified", origTime, targetFile.lastModified() ); + assertEquals( "Check unmodified", origPomTime, targetPomFile.lastModified() ); + + ArtifactRepositoryMetadata metadata = new ArtifactRepositoryMetadata( artifact ); + File metadataFile = new File( targetRepository.getBasedir(), targetRepository + .pathOfRemoteRepositoryMetadata( metadata ) ); + assertFalse( "Check metadata not created", metadataFile.exists() ); + } + + public void testForcedUnmodifiedArtifact() + throws Exception + { + // test unmodified artifact is still converted when set to force + + artifactConverter = (ArtifactConverter) lookup( ArtifactConverter.ROLE, "force-repository-converter" ); + + Artifact artifact = createArtifact( "test", "unmodified-artifact", "1.0.0" ); + Artifact pomArtifact = createPomArtifact( artifact ); + + File sourceFile = new File( sourceRepository.getBasedir(), sourceRepository.pathOf( artifact ) ); + File sourcePomFile = new File( sourceRepository.getBasedir(), sourceRepository.pathOf( pomArtifact ) ); + File targetFile = new File( targetRepository.getBasedir(), targetRepository.pathOf( artifact ) ); + File targetPomFile = new File( targetRepository.getBasedir(), targetRepository.pathOf( pomArtifact ) ); + + SimpleDateFormat dateFormat = new SimpleDateFormat( "yyyy-MM-dd", Locale.getDefault() ); + long origTime = dateFormat.parse( "2006-03-03" ).getTime(); + targetFile.setLastModified( origTime ); + targetPomFile.setLastModified( origTime ); + + sourceFile.setLastModified( dateFormat.parse( "2006-01-01" ).getTime() ); + sourcePomFile.setLastModified( dateFormat.parse( "2006-02-02" ).getTime() ); + + artifactConverter.convert( artifact, targetRepository ); + checkSuccess( artifactConverter ); + + compareFiles( sourceFile, targetFile ); + compareFiles( sourcePomFile, targetPomFile ); + + assertFalse( "Check modified", origTime == targetFile.lastModified() ); + assertFalse( "Check modified", origTime == targetPomFile.lastModified() ); + + ArtifactRepositoryMetadata metadata = new ArtifactRepositoryMetadata( artifact ); + File metadataFile = new File( targetRepository.getBasedir(), targetRepository + .pathOfRemoteRepositoryMetadata( metadata ) ); + assertTrue( "Check metadata created", metadataFile.exists() ); + } + + public void testDryRunSuccess() + throws Exception + { + // test dry run does nothing on a run that will be successful, and returns success + + artifactConverter = (ArtifactConverter) lookup( ArtifactConverter.ROLE, "dryrun-repository-converter" ); + + Artifact artifact = createArtifact( "test", "dryrun-artifact", "1.0.0" ); + Artifact pomArtifact = createPomArtifact( artifact ); + + File sourceFile = new File( sourceRepository.getBasedir(), sourceRepository.pathOf( artifact ) ); + File sourcePomFile = new File( sourceRepository.getBasedir(), sourceRepository.pathOf( pomArtifact ) ); + File targetFile = new File( targetRepository.getBasedir(), targetRepository.pathOf( artifact ) ); + File targetPomFile = new File( targetRepository.getBasedir(), targetRepository.pathOf( pomArtifact ) ); + + artifactConverter.convert( artifact, targetRepository ); + checkSuccess( artifactConverter ); + + assertTrue( "Check source file exists", sourceFile.exists() ); + assertTrue( "Check source POM exists", sourcePomFile.exists() ); + + assertFalse( "Check target file doesn't exist", targetFile.exists() ); + assertFalse( "Check target POM doesn't exist", targetPomFile.exists() ); + + ArtifactRepositoryMetadata metadata = new ArtifactRepositoryMetadata( artifact ); + File metadataFile = new File( targetRepository.getBasedir(), targetRepository + .pathOfRemoteRepositoryMetadata( metadata ) ); + assertFalse( "Check metadata not created", metadataFile.exists() ); + } + + public void testDryRunFailure() + throws Exception + { + // test dry run does nothing on a run that will fail, and returns failure + + artifactConverter = (ArtifactConverter) lookup( ArtifactConverter.ROLE, "dryrun-repository-converter" ); + + Artifact artifact = createArtifact( "test", "modified-artifact", "1.0.0" ); + Artifact pomArtifact = createPomArtifact( artifact ); + + File sourceFile = new File( sourceRepository.getBasedir(), sourceRepository.pathOf( artifact ) ); + File sourcePomFile = new File( sourceRepository.getBasedir(), sourceRepository.pathOf( pomArtifact ) ); + File targetFile = new File( targetRepository.getBasedir(), targetRepository.pathOf( artifact ) ); + File targetPomFile = new File( targetRepository.getBasedir(), targetRepository.pathOf( pomArtifact ) ); + + assertTrue( "Check target file exists", targetFile.exists() ); + assertTrue( "Check target POM exists", targetPomFile.exists() ); + + sourceFile.setLastModified( System.currentTimeMillis() ); + sourcePomFile.setLastModified( System.currentTimeMillis() ); + + long origTime = targetFile.lastModified(); + long origPomTime = targetPomFile.lastModified(); + + // Need to guarantee last modified is not equal + Thread.sleep( SLEEP_MILLIS ); + + artifactConverter.convert( artifact, targetRepository ); + checkWarnings( artifactConverter, 2 ); + + assertHasWarningReason( artifactConverter, Messages.getString( "failure.target.already.exists" ) ); + + assertEquals( "Check unmodified", origTime, targetFile.lastModified() ); + assertEquals( "Check unmodified", origPomTime, targetPomFile.lastModified() ); + + ArtifactRepositoryMetadata metadata = new ArtifactRepositoryMetadata( artifact ); + File metadataFile = new File( targetRepository.getBasedir(), targetRepository + .pathOfRemoteRepositoryMetadata( metadata ) ); + assertFalse( "Check metadata not created", metadataFile.exists() ); + } + + public void testRollbackArtifactCreated() + throws Exception + { + // test rollback can remove a created artifact, including checksums + + Artifact artifact = createArtifact( "test", "rollback-created-artifact", "1.0.0" ); + ArtifactMetadata artifactMetadata = new ArtifactRepositoryMetadata( artifact ); + File artifactMetadataFile = new File( targetRepository.getBasedir(), targetRepository + .pathOfRemoteRepositoryMetadata( artifactMetadata ) ); + FileUtils.deleteDirectory( artifactMetadataFile.getParentFile() ); + + ArtifactMetadata versionMetadata = new SnapshotArtifactRepositoryMetadata( artifact ); + File versionMetadataFile = new File( targetRepository.getBasedir(), targetRepository + .pathOfRemoteRepositoryMetadata( versionMetadata ) ); + + File artifactFile = new File( targetRepository.getBasedir(), targetRepository.pathOf( artifact ) ); + + artifactConverter.convert( artifact, targetRepository ); + checkWarnings( artifactConverter, 2 ); + + boolean found = false; + String pattern = "^" + Messages.getString( "invalid.source.pom" ).replaceFirst( "\\{0\\}", ".*" ) + "$"; + for ( Iterator it = artifactConverter.getWarnings().values().iterator(); it.hasNext() && !found; ) + { + List messages = (List) it.next(); + + for ( Iterator itmsgs = messages.iterator(); itmsgs.hasNext(); ) + { + String message = (String) itmsgs.next(); + if ( message.matches( pattern ) ) + { + found = true; + break; + } + } + } + + assertTrue( "Check failure message.", found ); + + assertFalse( "check artifact rolled back", artifactFile.exists() ); + assertFalse( "check metadata rolled back", artifactMetadataFile.exists() ); + assertFalse( "check metadata rolled back", versionMetadataFile.exists() ); + } + + public void testMultipleArtifacts() + throws Exception + { + // test multiple artifacts are converted + + List artifacts = new ArrayList(); + artifacts.add( createArtifact( "test", "artifact-one", "1.0.0" ) ); + artifacts.add( createArtifact( "test", "artifact-two", "1.0.0" ) ); + artifacts.add( createArtifact( "test", "artifact-three", "1.0.0" ) ); + + for ( Iterator it = artifacts.iterator(); it.hasNext(); ) + { + Artifact arti = (Artifact) it.next(); + artifactConverter.convert( arti, targetRepository ); + checkSuccess( artifactConverter ); + } + + for ( Iterator i = artifacts.iterator(); i.hasNext(); ) + { + Artifact artifact = (Artifact) i.next(); + + File artifactFile = new File( targetRepository.getBasedir(), targetRepository.pathOf( artifact ) ); + assertTrue( "Check artifact created", artifactFile.exists() ); + assertTrue( "Check artifact matches", FileUtils.contentEquals( artifactFile, artifact.getFile() ) ); + + artifact = createPomArtifact( artifact ); + File pomFile = new File( targetRepository.getBasedir(), targetRepository.pathOf( artifact ) ); + File expectedPomFile = getTestFile( "src/test/expected-files/converted-" + artifact.getArtifactId() + + ".pom" ); + assertTrue( "Check POM created", pomFile.exists() ); + + compareFiles( expectedPomFile, pomFile ); + } + } + + public void testInvalidSourceArtifactMetadata() + throws Exception + { + // test artifact is not converted when source metadata is invalid, and returns failure + + createModernSourceRepository(); + + Artifact artifact = createArtifact( "test", "incorrectArtifactMetadata", "1.0.0" ); + File file = new File( targetRepository.getBasedir(), targetRepository.pathOf( artifact ) ); + file.delete(); + + artifactConverter.convert( artifact, targetRepository ); + checkWarnings( artifactConverter, 2 ); + + assertHasWarningReason( artifactConverter, Messages.getString( "failure.incorrect.artifactMetadata.versions" ) ); + + assertFalse( "Check artifact not created", file.exists() ); + + ArtifactRepositoryMetadata metadata = new ArtifactRepositoryMetadata( artifact ); + File metadataFile = new File( targetRepository.getBasedir(), targetRepository + .pathOfRemoteRepositoryMetadata( metadata ) ); + assertFalse( "Check metadata not created", metadataFile.exists() ); + } + + public void testInvalidSourceSnapshotMetadata() + throws Exception + { + // test artifact is not converted when source snapshot metadata is invalid and returns failure + + createModernSourceRepository(); + + Artifact artifact = createArtifact( "test", "incorrectSnapshotMetadata", "1.0.0-20060102.030405-6" ); + File file = new File( targetRepository.getBasedir(), targetRepository.pathOf( artifact ) ); + file.delete(); + + artifactConverter.convert( artifact, targetRepository ); + checkWarnings( artifactConverter, 2 ); + + assertHasWarningReason( artifactConverter, Messages.getString( "failure.incorrect.snapshotMetadata.snapshot" ) ); + + assertFalse( "Check artifact not created", file.exists() ); + + ArtifactRepositoryMetadata metadata = new ArtifactRepositoryMetadata( artifact ); + File metadataFile = new File( targetRepository.getBasedir(), targetRepository + .pathOfRemoteRepositoryMetadata( metadata ) ); + assertFalse( "Check metadata not created", metadataFile.exists() ); + } + + public void testMergeArtifactMetadata() + throws Exception + { + // test artifact level metadata is merged when it already exists on successful conversion + + Artifact artifact = createArtifact( "test", "newversion-artifact", "1.0.1" ); + artifactConverter.convert( artifact, targetRepository ); + checkSuccess( artifactConverter ); + + File artifactFile = new File( targetRepository.getBasedir(), targetRepository.pathOf( artifact ) ); + assertTrue( "Check artifact created", artifactFile.exists() ); + assertTrue( "Check artifact matches", FileUtils.contentEquals( artifactFile, artifact.getFile() ) ); + + artifact = createPomArtifact( artifact ); + File pomFile = new File( targetRepository.getBasedir(), targetRepository.pathOf( artifact ) ); + File sourcePomFile = new File( sourceRepository.getBasedir(), sourceRepository.pathOf( artifact ) ); + assertTrue( "Check POM created", pomFile.exists() ); + + compareFiles( sourcePomFile, pomFile ); + + ArtifactMetadata artifactMetadata = new ArtifactRepositoryMetadata( artifact ); + File artifactMetadataFile = new File( targetRepository.getBasedir(), targetRepository + .pathOfRemoteRepositoryMetadata( artifactMetadata ) ); + assertTrue( "Check artifact metadata created", artifactMetadataFile.exists() ); + + File expectedMetadataFile = getTestFile( "src/test/expected-files/newversion-artifact-metadata.xml" ); + + compareFiles( expectedMetadataFile, artifactMetadataFile ); + } + + public void testSourceAndTargetRepositoriesMatch() + throws Exception + { + // test that it fails if the same + + ArtifactRepositoryFactory factory = (ArtifactRepositoryFactory) lookup( ArtifactRepositoryFactory.ROLE ); + + sourceRepository = factory.createArtifactRepository( "source", targetRepository.getUrl(), targetRepository + .getLayout(), null, null ); + + Artifact artifact = createArtifact( "test", "repository-artifact", "1.0" ); + + try + { + artifactConverter.convert( artifact, targetRepository ); + fail( "Should have failed trying to convert within the same repository" ); + } + catch ( ArtifactConversionException e ) + { + // expected + assertEquals( "check message", Messages.getString( "exception.repositories.match" ), e.getMessage() ); + assertNull( "Check no additional cause", e.getCause() ); + } + } + + private Artifact createArtifact( String groupId, String artifactId, String version ) + { + Matcher matcher = Artifact.VERSION_FILE_PATTERN.matcher( version ); + String baseVersion; + if ( matcher.matches() ) + { + baseVersion = matcher.group( 1 ) + "-SNAPSHOT"; + } + else + { + baseVersion = version; + } + return createArtifact( groupId, artifactId, baseVersion, version, "jar" ); + } + + private Artifact createArtifact( String groupId, String artifactId, String baseVersion, String version, String type ) + { + Artifact artifact = artifactFactory.createArtifact( groupId, artifactId, version, null, type ); + artifact.setBaseVersion( baseVersion ); + artifact.setRepository( sourceRepository ); + artifact.setFile( new File( sourceRepository.getBasedir(), sourceRepository.pathOf( artifact ) ) ); + return artifact; + } + + private Artifact createPomArtifact( Artifact artifact ) + { + return createArtifact( artifact.getGroupId(), artifact.getArtifactId(), artifact.getBaseVersion(), artifact + .getVersion(), "pom" ); + } + + private static void compareFiles( File expectedPomFile, File pomFile ) + throws IOException + { + String expectedContent = normalizeString( org.apache.commons.io.FileUtils.readFileToString( expectedPomFile, null ) ); + String targetContent = normalizeString( org.apache.commons.io.FileUtils.readFileToString( pomFile, null ) ); + assertEquals( "Check file match between " + expectedPomFile + " and " + pomFile, expectedContent, targetContent ); + } + + private static String normalizeString( String path ) + { + return path.trim().replaceAll( "\r\n", "\n" ).replace( '\r', '\n' ).replaceAll( "<\\?xml .+\\?>", "" ); + } + + private void checkSuccess( ArtifactConverter converter ) + { + assertNotNull( "Warnings should never be null.", converter.getWarnings() ); + assertEquals( "Should have no warnings.", 0, countWarningMessages( converter ) ); + } + + private void checkWarnings( ArtifactConverter converter, int count ) + { + assertNotNull( "Warnings should never be null.", converter.getWarnings() ); + assertEquals( "Should have some warnings.", count, countWarningMessages( converter ) ); + } + + private int countWarningMessages( ArtifactConverter converter ) + { + int count = 0; + for ( Iterator it = converter.getWarnings().values().iterator(); it.hasNext(); ) + { + List values = (List) it.next(); + count += values.size(); + } + return count; + } + + private void assertHasWarningReason( ArtifactConverter converter, String reason ) + { + assertNotNull( "Warnings should never be null.", converter.getWarnings() ); + assertTrue( "Expecting 1 or more Warnings", countWarningMessages( converter ) > 0 ); + + for ( Iterator it = converter.getWarnings().values().iterator(); it.hasNext(); ) + { + List messages = (List) it.next(); + if ( messages.contains( reason ) ) + { + /* No need to check any furthor */ + return; + } + } + + /* didn't find it. */ + + for ( Iterator it = converter.getWarnings().entrySet().iterator(); it.hasNext(); ) + { + Map.Entry entry = (Entry) it.next(); + Artifact artifact = (Artifact) entry.getKey(); + System.out.println( "-Artifact: " + artifact.getGroupId() + ":" + artifact.getArtifactId() + ":" + + artifact.getVersion() ); + List messages = (List) entry.getValue(); + for ( Iterator itmsgs = messages.iterator(); itmsgs.hasNext(); ) + { + String message = (String) itmsgs.next(); + System.out.println( " " + message ); + } + } + fail( "Unable to find message <" + reason + "> in warnings." ); + } + + private void createModernSourceRepository() + throws Exception + { + ArtifactRepositoryFactory factory = (ArtifactRepositoryFactory) lookup( ArtifactRepositoryFactory.ROLE ); + + ArtifactRepositoryLayout layout = (ArtifactRepositoryLayout) lookup( ArtifactRepositoryLayout.ROLE, "default" ); + + File sourceBase = getTestFile( "src/test/source-modern-repository" ); + sourceRepository = factory.createArtifactRepository( "source", sourceBase.toURL().toString(), layout, null, + null ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/resources/org/apache/maven/archiva/converter/artifact/LegacyToDefaultConverterTest.xml b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/resources/org/apache/maven/archiva/converter/artifact/LegacyToDefaultConverterTest.xml new file mode 100644 index 000000000..1a3d5913e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/resources/org/apache/maven/archiva/converter/artifact/LegacyToDefaultConverterTest.xml @@ -0,0 +1,85 @@ + + + + + + + + org.apache.maven.archiva.converter.artifact.ArtifactConverter + force-repository-converter + org.apache.maven.archiva.converter.artifact.LegacyToDefaultConverter + LegacyToDefaultConverter + + + org.codehaus.plexus.digest.Digester + digesters + + + org.apache.maven.model.converter.ModelConverter + translator + + + org.apache.maven.artifact.factory.ArtifactFactory + artifactFactory + + + org.apache.maven.artifact.handler.manager.ArtifactHandlerManager + artifactHandlerManager + + + + true + false + + + + + org.apache.maven.archiva.converter.artifact.ArtifactConverter + dryrun-repository-converter + org.apache.maven.archiva.converter.artifact.LegacyToDefaultConverter + LegacyToDefaultConverter + + + org.codehaus.plexus.digest.Digester + digesters + + + org.apache.maven.model.converter.ModelConverter + translator + + + org.apache.maven.artifact.factory.ArtifactFactory + artifactFactory + + + org.apache.maven.artifact.handler.manager.ArtifactHandlerManager + artifactHandlerManager + + + + false + true + + + + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-modern-repository/test/incorrectArtifactMetadata/1.0.0/incorrectArtifactMetadata-1.0.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-modern-repository/test/incorrectArtifactMetadata/1.0.0/incorrectArtifactMetadata-1.0.0.jar new file mode 100644 index 000000000..72af4bc10 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-modern-repository/test/incorrectArtifactMetadata/1.0.0/incorrectArtifactMetadata-1.0.0.jar @@ -0,0 +1 @@ +incorrectMd5 diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-modern-repository/test/incorrectArtifactMetadata/1.0.0/incorrectArtifactMetadata-1.0.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-modern-repository/test/incorrectArtifactMetadata/1.0.0/incorrectArtifactMetadata-1.0.0.pom new file mode 100644 index 000000000..b64e1d0f0 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-modern-repository/test/incorrectArtifactMetadata/1.0.0/incorrectArtifactMetadata-1.0.0.pom @@ -0,0 +1,25 @@ + + + + 3 + incorrectArtifactMetadata + test + 1.0.0 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-modern-repository/test/incorrectArtifactMetadata/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-modern-repository/test/incorrectArtifactMetadata/maven-metadata.xml new file mode 100644 index 000000000..b393bcd3d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-modern-repository/test/incorrectArtifactMetadata/maven-metadata.xml @@ -0,0 +1,29 @@ + + + + + test + incorrectArtifactMetadata + + + 0.9 + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-modern-repository/test/incorrectSnapshotMetadata/1.0.0-SNAPSHOT/incorrectSnapshotMetadata-1.0.0-20060102.030405-6.jar b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-modern-repository/test/incorrectSnapshotMetadata/1.0.0-SNAPSHOT/incorrectSnapshotMetadata-1.0.0-20060102.030405-6.jar new file mode 100644 index 000000000..72af4bc10 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-modern-repository/test/incorrectSnapshotMetadata/1.0.0-SNAPSHOT/incorrectSnapshotMetadata-1.0.0-20060102.030405-6.jar @@ -0,0 +1 @@ +incorrectMd5 diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-modern-repository/test/incorrectSnapshotMetadata/1.0.0-SNAPSHOT/incorrectSnapshotMetadata-1.0.0-20060102.030405-6.pom b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-modern-repository/test/incorrectSnapshotMetadata/1.0.0-SNAPSHOT/incorrectSnapshotMetadata-1.0.0-20060102.030405-6.pom new file mode 100644 index 000000000..929190af2 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-modern-repository/test/incorrectSnapshotMetadata/1.0.0-SNAPSHOT/incorrectSnapshotMetadata-1.0.0-20060102.030405-6.pom @@ -0,0 +1,25 @@ + + + + 3 + incorrectSnapshotMetadata + test + 1.0.0-20060102.030405-6 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-modern-repository/test/incorrectSnapshotMetadata/1.0.0-SNAPSHOT/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-modern-repository/test/incorrectSnapshotMetadata/1.0.0-SNAPSHOT/maven-metadata.xml new file mode 100644 index 000000000..5980278b3 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-modern-repository/test/incorrectSnapshotMetadata/1.0.0-SNAPSHOT/maven-metadata.xml @@ -0,0 +1,31 @@ + + + + + test + incorrectSnapshotMetadata + 1.0.0-SNAPSHOT + + + 10 + 20060102.040506 + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-modern-repository/test/incorrectSnapshotMetadata/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-modern-repository/test/incorrectSnapshotMetadata/maven-metadata.xml new file mode 100644 index 000000000..3f9a0cef2 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-modern-repository/test/incorrectSnapshotMetadata/maven-metadata.xml @@ -0,0 +1,29 @@ + + + + + test + incorrectSnapshotMetadata + + + 1.0.0-SNAPSHOT + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/artifact-one-1.0.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/artifact-one-1.0.0.jar new file mode 100644 index 000000000..5626abf0f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/artifact-one-1.0.0.jar @@ -0,0 +1 @@ +one diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/artifact-three-1.0.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/artifact-three-1.0.0.jar new file mode 100644 index 000000000..2bdf67abb --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/artifact-three-1.0.0.jar @@ -0,0 +1 @@ +three diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/artifact-two-1.0.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/artifact-two-1.0.0.jar new file mode 100644 index 000000000..f719efd43 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/artifact-two-1.0.0.jar @@ -0,0 +1 @@ +two diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/dryrun-artifact-1.0.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/dryrun-artifact-1.0.0.jar new file mode 100644 index 000000000..cbaf024e5 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/dryrun-artifact-1.0.0.jar @@ -0,0 +1 @@ +existing diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/existing-artifact-1.0.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/existing-artifact-1.0.0.jar new file mode 100644 index 000000000..cbaf024e5 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/existing-artifact-1.0.0.jar @@ -0,0 +1 @@ +existing diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/incorrectMd5Artifact-1.0.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/incorrectMd5Artifact-1.0.0.jar new file mode 100644 index 000000000..72af4bc10 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/incorrectMd5Artifact-1.0.0.jar @@ -0,0 +1 @@ +incorrectMd5 diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/incorrectMd5Artifact-1.0.0.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/incorrectMd5Artifact-1.0.0.jar.md5 new file mode 100644 index 000000000..316d9a4eb --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/incorrectMd5Artifact-1.0.0.jar.md5 @@ -0,0 +1 @@ +379dcfcd1e6312cc859111f696047eb4 diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/incorrectSha1Artifact-1.0.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/incorrectSha1Artifact-1.0.0.jar new file mode 100644 index 000000000..f5812f3e5 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/incorrectSha1Artifact-1.0.0.jar @@ -0,0 +1 @@ +incorrectSha1 diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/incorrectSha1Artifact-1.0.0.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/incorrectSha1Artifact-1.0.0.jar.sha1 new file mode 100644 index 000000000..cce322eb2 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/incorrectSha1Artifact-1.0.0.jar.sha1 @@ -0,0 +1 @@ +52e07b82d944741f66bba5896d4cd74e9879e289 diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/modified-artifact-1.0.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/modified-artifact-1.0.0.jar new file mode 100644 index 000000000..2e0996000 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/modified-artifact-1.0.0.jar @@ -0,0 +1 @@ +modified diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/newversion-artifact-1.0.1.jar b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/newversion-artifact-1.0.1.jar new file mode 100644 index 000000000..c694117fd --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/newversion-artifact-1.0.1.jar @@ -0,0 +1 @@ +v4 diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/noPomArtifact-1.0.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/noPomArtifact-1.0.0.jar new file mode 100644 index 000000000..3d27acdcc --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/noPomArtifact-1.0.0.jar @@ -0,0 +1 @@ +noPom diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/relocated-v3artifact-1.0.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/relocated-v3artifact-1.0.0.jar new file mode 100644 index 000000000..29ef827e8 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/relocated-v3artifact-1.0.0.jar @@ -0,0 +1 @@ +v3 diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/rollback-created-artifact-1.0.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/rollback-created-artifact-1.0.0.jar new file mode 100644 index 000000000..29ef827e8 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/rollback-created-artifact-1.0.0.jar @@ -0,0 +1 @@ +v3 diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/unmodified-artifact-1.0.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/unmodified-artifact-1.0.0.jar new file mode 100644 index 000000000..27597bc21 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/unmodified-artifact-1.0.0.jar @@ -0,0 +1 @@ +unmodified diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/v3-warnings-artifact-1.0.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/v3-warnings-artifact-1.0.0.jar new file mode 100644 index 000000000..29ef827e8 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/v3-warnings-artifact-1.0.0.jar @@ -0,0 +1 @@ +v3 diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/v3artifact-1.0.0-20060105.130101-3.jar b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/v3artifact-1.0.0-20060105.130101-3.jar new file mode 100644 index 000000000..29ef827e8 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/v3artifact-1.0.0-20060105.130101-3.jar @@ -0,0 +1 @@ +v3 diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/v3artifact-1.0.0-SNAPSHOT.jar b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/v3artifact-1.0.0-SNAPSHOT.jar new file mode 100644 index 000000000..29ef827e8 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/v3artifact-1.0.0-SNAPSHOT.jar @@ -0,0 +1 @@ +v3 diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/v3artifact-1.0.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/v3artifact-1.0.0.jar new file mode 100644 index 000000000..29ef827e8 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/v3artifact-1.0.0.jar @@ -0,0 +1 @@ +v3 diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/v4artifact-1.0.0-20060111.120115-1.jar b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/v4artifact-1.0.0-20060111.120115-1.jar new file mode 100644 index 000000000..29ef827e8 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/v4artifact-1.0.0-20060111.120115-1.jar @@ -0,0 +1 @@ +v3 diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/v4artifact-1.0.0-SNAPSHOT.jar b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/v4artifact-1.0.0-SNAPSHOT.jar new file mode 100644 index 000000000..29ef827e8 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/v4artifact-1.0.0-SNAPSHOT.jar @@ -0,0 +1 @@ +v3 diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/v4artifact-1.0.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/v4artifact-1.0.0.jar new file mode 100644 index 000000000..c694117fd --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/v4artifact-1.0.0.jar @@ -0,0 +1 @@ +v4 diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/v4artifact-1.0.0.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/v4artifact-1.0.0.jar.md5 new file mode 100644 index 000000000..1930bc6d3 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/v4artifact-1.0.0.jar.md5 @@ -0,0 +1 @@ +4289bbdd6fba75013b317b2f9a540736 *v4artifact-1.0.0.jar diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/v4artifact-1.0.0.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/v4artifact-1.0.0.jar.sha1 new file mode 100644 index 000000000..466f209a7 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/jars/v4artifact-1.0.0.jar.sha1 @@ -0,0 +1 @@ +e3e4159da65a4257f0bffb7cac8e3e78241a4dca *v4artifact-1.0.0.jar diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/plugins/maven-foo-plugin-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/plugins/maven-foo-plugin-1.0.jar new file mode 100644 index 000000000..5626abf0f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/plugins/maven-foo-plugin-1.0.jar @@ -0,0 +1 @@ +one diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/artifact-one-1.0.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/artifact-one-1.0.0.pom new file mode 100644 index 000000000..cd3862d35 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/artifact-one-1.0.0.pom @@ -0,0 +1,6 @@ + + 4.0.0 + test + artifact-one + 1.0.0 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/artifact-three-1.0.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/artifact-three-1.0.0.pom new file mode 100644 index 000000000..343291037 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/artifact-three-1.0.0.pom @@ -0,0 +1,6 @@ + + 4.0.0 + test + artifact-three + 1.0.0 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/artifact-two-1.0.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/artifact-two-1.0.0.pom new file mode 100644 index 000000000..227470167 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/artifact-two-1.0.0.pom @@ -0,0 +1,6 @@ + + 4.0.0 + test + artifact-two + 1.0.0 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/dryrun-artifact-1.0.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/dryrun-artifact-1.0.0.pom new file mode 100644 index 000000000..1953c5523 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/dryrun-artifact-1.0.0.pom @@ -0,0 +1,22 @@ + + + + 4.0.0 + dryrun-artifact + test + 1.0.0 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/incorrectMd5Artifact-1.0.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/incorrectMd5Artifact-1.0.0.pom new file mode 100644 index 000000000..74d5e12b4 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/incorrectMd5Artifact-1.0.0.pom @@ -0,0 +1,6 @@ + + 3 + incorrectMd5Artifact + test + 1.0.0 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/incorrectSha1Artifact-1.0.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/incorrectSha1Artifact-1.0.0.pom new file mode 100644 index 000000000..fe3c7fd91 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/incorrectSha1Artifact-1.0.0.pom @@ -0,0 +1,6 @@ + + 3 + incorrectSha1Artifact + test + 1.0.0 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/maven-foo-plugin-1.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/maven-foo-plugin-1.0.pom new file mode 100644 index 000000000..a5a02c42d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/maven-foo-plugin-1.0.pom @@ -0,0 +1,6 @@ + + 3 + maven-foo-plugin + org.apache.maven.plugins + 1.0 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/modified-artifact-1.0.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/modified-artifact-1.0.0.pom new file mode 100644 index 000000000..fcfdaacb4 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/modified-artifact-1.0.0.pom @@ -0,0 +1,22 @@ + + + + 4.0.0 + modified-artifact + test + 1.0.0 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/newversion-artifact-1.0.1.pom b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/newversion-artifact-1.0.1.pom new file mode 100644 index 000000000..f441c9a46 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/newversion-artifact-1.0.1.pom @@ -0,0 +1,22 @@ + + + + 4.0.0 + test + newversoin-artifact + 1.0.1 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/relocated-v3artifact-1.0.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/relocated-v3artifact-1.0.0.pom new file mode 100644 index 000000000..ab112a296 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/relocated-v3artifact-1.0.0.pom @@ -0,0 +1,27 @@ + + 3 + relocated-v3artifact + test + 1.0.0 + + + groupId + artifactId + version + + + groupId + test-artifactId + version + + test + + + + + scm:cvs:ext:${maven.username}@localhost:/home/cvs + + + relocated-test + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/rollback-created-artifact-1.0.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/rollback-created-artifact-1.0.0.pom new file mode 100644 index 000000000..00692be72 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/rollback-created-artifact-1.0.0.pom @@ -0,0 +1,39 @@ + + + + 3 + v3artifact + test + 1.0.0 + + + groupId + artifactId + version + + + groupId + test-artifactId + version + + test + + + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/unmodified-artifact-1.0.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/unmodified-artifact-1.0.0.pom new file mode 100644 index 000000000..a8428a8a4 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/unmodified-artifact-1.0.0.pom @@ -0,0 +1,25 @@ + + + + 4.0.0 + unmodified-artifact + test + 1.0.0 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/v3-warnings-artifact-1.0.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/v3-warnings-artifact-1.0.0.pom new file mode 100644 index 000000000..5f347f371 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/v3-warnings-artifact-1.0.0.pom @@ -0,0 +1,48 @@ + + + + 3 + ../project.xml + v3-warnings-artifact + test + 1.0.0 + + + 1.0 + 1.0 + 1_0 + + + + + groupId + artifactId + version + + + groupId + test-artifactId + version + + test + + + + + scm:cvs:ext:${maven.username}@localhost:/home/cvs + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/v3artifact-1.0.0-20060105.130101-3.pom b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/v3artifact-1.0.0-20060105.130101-3.pom new file mode 100644 index 000000000..d7ae8953b --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/v3artifact-1.0.0-20060105.130101-3.pom @@ -0,0 +1,40 @@ + + + + 3 + v3artifact + test + 1.0.0-20060105.130101-3 + + + groupId + artifactId + version + + + groupId + test-artifactId + version + + test + + + + + scm:cvs:ext:${maven.username}@localhost:/home/cvs + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/v3artifact-1.0.0-SNAPSHOT.pom b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/v3artifact-1.0.0-SNAPSHOT.pom new file mode 100644 index 000000000..3958a3358 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/v3artifact-1.0.0-SNAPSHOT.pom @@ -0,0 +1,40 @@ + + + + 3 + v3artifact + test + 1.0.0-SNAPSHOT + + + groupId + artifactId + version + + + groupId + test-artifactId + version + + test + + + + + scm:cvs:ext:${maven.username}@localhost:/home/cvs + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/v3artifact-1.0.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/v3artifact-1.0.0.pom new file mode 100644 index 000000000..5aed3437a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/v3artifact-1.0.0.pom @@ -0,0 +1,24 @@ + + 3 + v3artifact + test + 1.0.0 + + + groupId + artifactId + version + + + groupId + test-artifactId + version + + test + + + + + scm:cvs:ext:${maven.username}@localhost:/home/cvs + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/v4artifact-1.0.0-20060111.120115-1.pom b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/v4artifact-1.0.0-20060111.120115-1.pom new file mode 100644 index 000000000..e4f36566a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/v4artifact-1.0.0-20060111.120115-1.pom @@ -0,0 +1,22 @@ + + + + 4.0.0 + test + v4artifact + 1.0.0-20060111.120115-1 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/v4artifact-1.0.0-SNAPSHOT.pom b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/v4artifact-1.0.0-SNAPSHOT.pom new file mode 100644 index 000000000..be5b8b7e2 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/v4artifact-1.0.0-SNAPSHOT.pom @@ -0,0 +1,22 @@ + + + + 4.0.0 + test + v4artifact + 1.0.0-SNAPSHOT + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/v4artifact-1.0.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/v4artifact-1.0.0.pom new file mode 100644 index 000000000..fa6e82b1e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/source-repository/test/poms/v4artifact-1.0.0.pom @@ -0,0 +1,6 @@ + + 4.0.0 + test + v4artifact + 1.0.0 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/target-repository/test/modified-artifact/1.0.0/modified-artifact-1.0.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/target-repository/test/modified-artifact/1.0.0/modified-artifact-1.0.0.jar new file mode 100644 index 000000000..27597bc21 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/target-repository/test/modified-artifact/1.0.0/modified-artifact-1.0.0.jar @@ -0,0 +1 @@ +unmodified diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/target-repository/test/modified-artifact/1.0.0/modified-artifact-1.0.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/target-repository/test/modified-artifact/1.0.0/modified-artifact-1.0.0.pom new file mode 100644 index 000000000..d23afd027 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/target-repository/test/modified-artifact/1.0.0/modified-artifact-1.0.0.pom @@ -0,0 +1,25 @@ + + + + 4.0.0 + modified-artifact + test + 1.0.0 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/target-repository/test/newversion-artifact/1.0.0/newversion-artifact-1.0.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/target-repository/test/newversion-artifact/1.0.0/newversion-artifact-1.0.0.jar new file mode 100644 index 000000000..27597bc21 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/target-repository/test/newversion-artifact/1.0.0/newversion-artifact-1.0.0.jar @@ -0,0 +1 @@ +unmodified diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/target-repository/test/newversion-artifact/1.0.0/newversion-artifact-1.0.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/target-repository/test/newversion-artifact/1.0.0/newversion-artifact-1.0.0.pom new file mode 100644 index 000000000..e21492ebf --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/target-repository/test/newversion-artifact/1.0.0/newversion-artifact-1.0.0.pom @@ -0,0 +1,25 @@ + + + + 4.0.0 + newversion-artifact + test + 1.0.0 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/target-repository/test/newversion-artifact/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/target-repository/test/newversion-artifact/maven-metadata.xml new file mode 100644 index 000000000..42537e4c5 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/target-repository/test/newversion-artifact/maven-metadata.xml @@ -0,0 +1,29 @@ + + + + + test + newversion-artifact + + + 1.0.0 + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/target-repository/test/unmodified-artifact/1.0.0/unmodified-artifact-1.0.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/target-repository/test/unmodified-artifact/1.0.0/unmodified-artifact-1.0.0.jar new file mode 100644 index 000000000..27597bc21 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/target-repository/test/unmodified-artifact/1.0.0/unmodified-artifact-1.0.0.jar @@ -0,0 +1 @@ +unmodified diff --git a/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/target-repository/test/unmodified-artifact/1.0.0/unmodified-artifact-1.0.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/target-repository/test/unmodified-artifact/1.0.0/unmodified-artifact-1.0.0.pom new file mode 100644 index 000000000..a8428a8a4 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-artifact-converter/src/test/target-repository/test/unmodified-artifact/1.0.0/unmodified-artifact-1.0.0.pom @@ -0,0 +1,25 @@ + + + + 4.0.0 + unmodified-artifact + test + 1.0.0 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-checksum/pom.xml b/MRM-541/archiva-modules/archiva-base/archiva-checksum/pom.xml new file mode 100644 index 000000000..0764fcc12 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-checksum/pom.xml @@ -0,0 +1,56 @@ + + + + 4.0.0 + + org.apache.archiva + archiva-base + 1.2-SNAPSHOT + + archiva-checksum + Archiva Checksum + + jar + + + + + maven-compiler-plugin + + 1.5 + 1.5 + + + + + + + + org.slf4j + slf4j-api + + + commons-lang + commons-lang + + + commons-io + commons-io + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-checksum/src/main/java/org/apache/archiva/checksum/Checksum.java b/MRM-541/archiva-modules/archiva-base/archiva-checksum/src/main/java/org/apache/archiva/checksum/Checksum.java new file mode 100644 index 000000000..fd6943260 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-checksum/src/main/java/org/apache/archiva/checksum/Checksum.java @@ -0,0 +1,105 @@ +package org.apache.archiva.checksum; + +/* + * 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.IOException; +import java.io.InputStream; +import java.security.DigestInputStream; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.List; + +import org.apache.commons.io.IOUtils; +import org.apache.commons.io.output.NullOutputStream; + +/** + * Checksum - simple checksum hashing routines. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class Checksum +{ + private static final int BUFFER_SIZE = 32768; + + public static void update( List checksums, InputStream stream ) + throws IOException + { + byte[] buffer = new byte[BUFFER_SIZE]; + int size = stream.read( buffer, 0, BUFFER_SIZE ); + while ( size >= 0 ) + { + for ( Checksum checksum : checksums ) + { + checksum.update( buffer, 0, size ); + } + size = stream.read( buffer, 0, BUFFER_SIZE ); + } + } + + protected final MessageDigest md; + + private ChecksumAlgorithm checksumAlgorithm; + + public Checksum( ChecksumAlgorithm checksumAlgorithm ) + { + this.checksumAlgorithm = checksumAlgorithm; + try + { + md = MessageDigest.getInstance( checksumAlgorithm.getAlgorithm() ); + } + catch ( NoSuchAlgorithmException e ) + { + // Not really possible, but here none-the-less + throw new IllegalStateException( "Unable to initialize MessageDigest algorithm " + checksumAlgorithm.getAlgorithm() + + " : " + e.getMessage(), e ); + } + } + + public String getChecksum() + { + return Hex.encode( md.digest() ); + } + + public ChecksumAlgorithm getAlgorithm() + { + return this.checksumAlgorithm; + } + + public void reset() + { + md.reset(); + } + + public Checksum update( byte[] buffer, int offset, int size ) + { + md.update( buffer, 0, size ); + return this; + } + + public Checksum update( InputStream stream ) + throws IOException + { + DigestInputStream dig = new DigestInputStream( stream, md ); + IOUtils.copy( dig, new NullOutputStream() ); + + return this; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-checksum/src/main/java/org/apache/archiva/checksum/ChecksumAlgorithm.java b/MRM-541/archiva-modules/archiva-base/archiva-checksum/src/main/java/org/apache/archiva/checksum/ChecksumAlgorithm.java new file mode 100644 index 000000000..69be9df06 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-checksum/src/main/java/org/apache/archiva/checksum/ChecksumAlgorithm.java @@ -0,0 +1,96 @@ +package org.apache.archiva.checksum; + +/* + * 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; + +import org.apache.commons.io.FilenameUtils; + +/** + * Enumeration of available ChecksumAlgorithm techniques. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public enum ChecksumAlgorithm { + SHA1("SHA-1", "sha1", "SHA1"), + MD5("MD5", "md5", "MD5"); + + public static ChecksumAlgorithm getByExtension( File file ) + { + String ext = FilenameUtils.getExtension( file.getName() ).toLowerCase(); + if ( ChecksumAlgorithm.SHA1.getExt().equals( ext ) ) + { + return ChecksumAlgorithm.SHA1; + } + else if ( ChecksumAlgorithm.MD5.getExt().equals( ext ) ) + { + return ChecksumAlgorithm.MD5; + } + + throw new IllegalArgumentException( "Filename " + file.getName() + " has no associated extension." ); + } + + /** + * The MessageDigest algorithm for this hash. + */ + private String algorithm; + + /** + * The file extension for this ChecksumAlgorithm. + */ + private String ext; + + /** + * The checksum type, the key that you see in checksum files. + */ + private String type; + + /** + * Construct a ChecksumAlgorithm + * + * @param algorithm the MessageDigest algorithm + * @param ext the file extension. + * @param type the checksum type. + */ + private ChecksumAlgorithm( String algorithm, String ext, String type ) + { + this.algorithm = algorithm; + this.ext = ext; + this.type = type; + } + + public String getAlgorithm() + { + return algorithm; + } + + public String getExt() + { + return ext; + } + + public String getType() + { + return type; + } + + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-checksum/src/main/java/org/apache/archiva/checksum/ChecksummedFile.java b/MRM-541/archiva-modules/archiva-base/archiva-checksum/src/main/java/org/apache/archiva/checksum/ChecksummedFile.java new file mode 100644 index 000000000..6b5657121 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-checksum/src/main/java/org/apache/archiva/checksum/ChecksummedFile.java @@ -0,0 +1,354 @@ +package org.apache.archiva.checksum; + +/* + * 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; +import java.io.FileInputStream; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.apache.commons.io.FileUtils; +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * ChecksummedFile + * + *
+ * Terminology: + *
Checksum File
+ *
The file that contains the previously calculated checksum value for the reference file. + * This is a text file with the extension ".sha1" or ".md5", and contains a single entry + * consisting of an optional reference filename, and a checksum string. + *
+ *
Reference File
+ *
The file that is being referenced in the checksum file.
+ *
+ * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ChecksummedFile +{ + private Logger log = LoggerFactory.getLogger( ChecksummedFile.class ); + + private final File referenceFile; + + /** + * Construct a ChecksummedFile object. + * + * @param referenceFile + */ + public ChecksummedFile( final File referenceFile ) + { + this.referenceFile = referenceFile; + } + + /** + * Calculate the checksum based on a given checksum. + * + * @param checksumAlgorithm the algorithm to use. + * @return the checksum string for the file. + * @throws IOException if unable to calculate the checksum. + */ + public String calculateChecksum( ChecksumAlgorithm checksumAlgorithm ) + throws IOException + { + FileInputStream fis = null; + try + { + Checksum checksum = new Checksum( checksumAlgorithm ); + fis = new FileInputStream( referenceFile ); + checksum.update( fis ); + return checksum.getChecksum(); + } + finally + { + IOUtils.closeQuietly( fis ); + } + } + + /** + * Creates a checksum file of the provided referenceFile. + * @param checksumAlgorithm the hash to use. + * + * @return the checksum File that was created. + * @throws IOException if there was a problem either reading the referenceFile, or writing the checksum file. + */ + public File createChecksum( ChecksumAlgorithm checksumAlgorithm ) + throws IOException + { + File checksumFile = new File( referenceFile.getAbsolutePath() + "." + checksumAlgorithm.getExt() ); + String checksum = calculateChecksum( checksumAlgorithm ); + FileUtils.writeStringToFile( checksumFile, checksum + " " + referenceFile.getName() ); + return checksumFile; + } + + /** + * Get the checksum file for the reference file and hash. + * + * @param checksumAlgorithm the hash that we are interested in. + * @return the checksum file to return + */ + public File getChecksumFile( ChecksumAlgorithm checksumAlgorithm ) + { + return new File( referenceFile.getAbsolutePath() + "." + checksumAlgorithm.getExt() ); + } + + /** + *

+ * Given a checksum file, check to see if the file it represents is valid according to the checksum. + *

+ * + *

+ * NOTE: Only supports single file checksums of type MD5 or SHA1. + *

+ * + * @param checksumFile the algorithms to check for. + * @return true if the checksum is valid for the file it represents. or if the checksum file does not exist. + * @throws IOException if the reading of the checksumFile or the file it refers to fails. + */ + public boolean isValidChecksum( ChecksumAlgorithm algorithm ) + throws IOException + { + return isValidChecksums( new ChecksumAlgorithm[] { algorithm } ); + } + + /** + * Of any checksum files present, validate that the reference file conforms + * the to the checksum. + * + * @param algorithms the algorithms to check for. + * @return true if the checksums report that the the reference file is valid, false if invalid. + */ + public boolean isValidChecksums( ChecksumAlgorithm algorithms[] ) + { + FileInputStream fis = null; + try + { + List checksums = new ArrayList(); + // Create checksum object for each algorithm. + for ( ChecksumAlgorithm checksumAlgorithm : algorithms ) + { + File checksumFile = getChecksumFile( checksumAlgorithm ); + + // Only add algorithm if checksum file exists. + if ( checksumFile.exists() ) + { + checksums.add( new Checksum( checksumAlgorithm ) ); + } + } + + // Any checksums? + if ( checksums.isEmpty() ) + { + // No checksum objects, no checksum files, default to is invalid. + return false; + } + + // Parse file once, for all checksums. + try + { + fis = new FileInputStream( referenceFile ); + Checksum.update( checksums, fis ); + } + catch ( IOException e ) + { + log.warn( "Unable to update checksum:" + e.getMessage() ); + return false; + } + + boolean valid = true; + + // check the checksum files + try + { + for ( Checksum checksum : checksums ) + { + ChecksumAlgorithm checksumAlgorithm = checksum.getAlgorithm(); + File checksumFile = getChecksumFile( checksumAlgorithm ); + + String rawChecksum = FileUtils.readFileToString( checksumFile ); + String expectedChecksum = parseChecksum( rawChecksum, checksumAlgorithm, referenceFile.getName() ); + + if ( StringUtils.equalsIgnoreCase( expectedChecksum, checksum.getChecksum() ) == false ) + { + valid = false; + } + } + } + catch ( IOException e ) + { + log.warn( "Unable to read / parse checksum: " + e.getMessage() ); + return false; + } + + return valid; + } + finally + { + IOUtils.closeQuietly( fis ); + } + } + + /** + * Fix or create checksum files for the reference file. + * + * @param algorithms the hashes to check for. + * @return true if checksums were created successfully. + */ + public boolean fixChecksums( ChecksumAlgorithm algorithms[] ) + { + List checksums = new ArrayList(); + // Create checksum object for each algorithm. + for ( ChecksumAlgorithm checksumAlgorithm : algorithms ) + { + checksums.add( new Checksum( checksumAlgorithm ) ); + } + + // Any checksums? + if ( checksums.isEmpty() ) + { + // No checksum objects, no checksum files, default to is valid. + return true; + } + + FileInputStream fis = null; + try + { + // Parse file once, for all checksums. + fis = new FileInputStream( referenceFile ); + Checksum.update( checksums, fis ); + } + catch ( IOException e ) + { + log.warn( e.getMessage(), e ); + return false; + } + finally + { + IOUtils.closeQuietly( fis ); + } + + boolean valid = true; + + // check the hash files + for ( Checksum checksum : checksums ) + { + ChecksumAlgorithm checksumAlgorithm = checksum.getAlgorithm(); + try + { + File checksumFile = getChecksumFile( checksumAlgorithm ); + String actualChecksum = checksum.getChecksum(); + + if ( checksumFile.exists() ) + { + String rawChecksum = FileUtils.readFileToString( checksumFile ); + String expectedChecksum = parseChecksum( rawChecksum, checksumAlgorithm, referenceFile.getName() ); + + if ( StringUtils.equalsIgnoreCase( expectedChecksum, actualChecksum ) == false ) + { + // create checksum (again) + FileUtils.writeStringToFile( checksumFile, actualChecksum + " " + referenceFile.getName() ); + } + } + else + { + FileUtils.writeStringToFile( checksumFile, actualChecksum + " " + referenceFile.getName() ); + } + } + catch ( IOException e ) + { + log.warn( e.getMessage(), e ); + valid = false; + } + } + + return valid; + + } + + private boolean isValidChecksumPattern( String filename, String path ) + { + // check if it is a remote metadata file + Pattern pattern = Pattern.compile( "maven-metadata-\\S*.xml" ); + Matcher m = pattern.matcher( path ); + if( m.matches() ) + { + return filename.endsWith( path ) || ( "-".equals( filename ) ) + || filename.endsWith( "maven-metadata.xml" ); + } + + return filename.endsWith( path ) || ( "-".equals( filename ) ); + } + + /** + * Parse a checksum string. + * + * Validate the expected path, and expected checksum algorithm, then return + * the trimmed checksum hex string. + * + * @param rawChecksumString + * @param expectedHash + * @param expectedPath + * @return + * @throws IOException + */ + public String parseChecksum( String rawChecksumString, ChecksumAlgorithm expectedHash, String expectedPath ) + throws IOException + { + String trimmedChecksum = rawChecksumString.replace( '\n', ' ' ).trim(); + + // Free-BSD / openssl + String regex = expectedHash.getType() + "\\s*\\(([^)]*)\\)\\s*=\\s*([a-fA-F0-9]+)"; + Matcher m = Pattern.compile( regex ).matcher( trimmedChecksum ); + if ( m.matches() ) + { + String filename = m.group( 1 ); + if ( !isValidChecksumPattern( filename, expectedPath ) ) + { + throw new IOException( "Supplied checksum file '" + filename + "' does not match expected file: '" + + expectedPath + "'" ); + } + trimmedChecksum = m.group( 2 ); + } + else + { + // GNU tools + m = Pattern.compile( "([a-fA-F0-9]+)\\s+\\*?(.+)" ).matcher( trimmedChecksum ); + if ( m.matches() ) + { + String filename = m.group( 2 ); + if ( !isValidChecksumPattern( filename, expectedPath ) ) + { + throw new IOException( "Supplied checksum file '" + filename + "' does not match expected file: '" + + expectedPath + "'" ); + } + trimmedChecksum = m.group( 1 ); + } + } + return trimmedChecksum; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-checksum/src/main/java/org/apache/archiva/checksum/Hex.java b/MRM-541/archiva-modules/archiva-base/archiva-checksum/src/main/java/org/apache/archiva/checksum/Hex.java new file mode 100644 index 000000000..03f65290e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-checksum/src/main/java/org/apache/archiva/checksum/Hex.java @@ -0,0 +1,32 @@ +package org.apache.archiva.checksum; + +/** + * Hex - simple hex conversions. + * + * @version $Id$ + */ +public class Hex +{ + private static final byte[] DIGITS = "0123456789abcdef".getBytes(); + + public static String encode( byte[] data ) + { + int l = data.length; + + byte[] raw = new byte[l * 2]; + + for ( int i = 0, j = 0; i < l; i++ ) + { + raw[j++] = DIGITS[( 0xF0 & data[i] ) >>> 4]; + raw[j++] = DIGITS[0x0F & data[i]]; + } + + return new String( raw ); + } + + public static String encode( String raw ) + { + return encode( raw.getBytes() ); + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-checksum/src/test/java/org/apache/archiva/checksum/AbstractChecksumTestCase.java b/MRM-541/archiva-modules/archiva-base/archiva-checksum/src/test/java/org/apache/archiva/checksum/AbstractChecksumTestCase.java new file mode 100644 index 000000000..73f163672 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-checksum/src/test/java/org/apache/archiva/checksum/AbstractChecksumTestCase.java @@ -0,0 +1,77 @@ +package org.apache.archiva.checksum; + +/* + * 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; + +import junit.framework.TestCase; + +/** + * AbstractChecksumTestCase + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public abstract class AbstractChecksumTestCase + extends TestCase +{ + private File basedir; + + public File getBasedir() + { + if ( basedir == null ) + { + String sysprop = System.getProperty( "basedir" ); + if ( sysprop != null ) + { + basedir = new File( sysprop ); + } + else + { + basedir = new File( System.getProperty( "user.dir" ) ); + } + } + return basedir; + } + + public File getTestOutputDir() + { + File dir = new File( getBasedir(), "target/test-output/" + getName() ); + if ( dir.exists() == false ) + { + if ( dir.mkdirs() == false ) + { + fail( "Unable to create test output directory: " + dir.getAbsolutePath() ); + } + } + return dir; + } + + public File getTestResource( String filename ) + { + File dir = new File( getBasedir(), "src/test/resources" ); + File file = new File( dir, filename ); + if ( file.exists() == false ) + { + fail( "Test Resource does not exist: " + file.getAbsolutePath() ); + } + return file; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-checksum/src/test/java/org/apache/archiva/checksum/ChecksumAlgorithmTest.java b/MRM-541/archiva-modules/archiva-base/archiva-checksum/src/test/java/org/apache/archiva/checksum/ChecksumAlgorithmTest.java new file mode 100644 index 000000000..f6b91ac97 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-checksum/src/test/java/org/apache/archiva/checksum/ChecksumAlgorithmTest.java @@ -0,0 +1,59 @@ +package org.apache.archiva.checksum; + +/* + * 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; + +import junit.framework.TestCase; + +/** + * ChecksumAlgorithmTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ChecksumAlgorithmTest + extends TestCase +{ + public void testGetHashByExtensionSha1() + { + assertEquals( ChecksumAlgorithm.SHA1, ChecksumAlgorithm.getByExtension( new File( "something.jar.sha1" ) ) ); + assertEquals( ChecksumAlgorithm.SHA1, ChecksumAlgorithm.getByExtension( new File( "OTHER.JAR.SHA1" ) ) ); + } + + public void testGetHashByExtensionMd5() + { + assertEquals( ChecksumAlgorithm.MD5, ChecksumAlgorithm.getByExtension( new File( "something.jar.md5" ) ) ); + assertEquals( ChecksumAlgorithm.MD5, ChecksumAlgorithm.getByExtension( new File( "OTHER.JAR.MD5" ) ) ); + } + + public void testGetHashByExtensionInvalid() + { + try + { + ChecksumAlgorithm.getByExtension( new File( "something.jar" ) ); + fail( "Expected " + IllegalArgumentException.class.getName() ); + } + catch ( IllegalArgumentException e ) + { + /* expected path */ + } + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-checksum/src/test/java/org/apache/archiva/checksum/ChecksumTest.java b/MRM-541/archiva-modules/archiva-base/archiva-checksum/src/test/java/org/apache/archiva/checksum/ChecksumTest.java new file mode 100644 index 000000000..f8889e70a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-checksum/src/test/java/org/apache/archiva/checksum/ChecksumTest.java @@ -0,0 +1,103 @@ +package org.apache.archiva.checksum; + +/* + * 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.ByteArrayInputStream; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * ChecksumTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ChecksumTest + extends AbstractChecksumTestCase +{ + private static final String UNSET_SHA1 = "da39a3ee5e6b4b0d3255bfef95601890afd80709"; + + public void testConstructSha1() + { + Checksum checksum = new Checksum( ChecksumAlgorithm.SHA1 ); + assertEquals( "Checksum.algorithm", checksum.getAlgorithm().getAlgorithm(), ChecksumAlgorithm.SHA1 + .getAlgorithm() ); + } + + public void testConstructMd5() + { + Checksum checksum = new Checksum( ChecksumAlgorithm.MD5 ); + assertEquals( "Checksum.algorithm", checksum.getAlgorithm().getAlgorithm(), ChecksumAlgorithm.MD5 + .getAlgorithm() ); + } + + public void testUpdate() + { + Checksum checksum = new Checksum( ChecksumAlgorithm.SHA1 ); + byte buf[] = ( "You know, I'm sick of following my dreams, man. " + + "I'm just going to ask where they're going and hook up with 'em later. - Mitch Hedberg" ).getBytes(); + checksum.update( buf, 0, buf.length ); + assertEquals( "Checksum", "e396119ae0542e85a74759602fd2f81e5d36d762", checksum.getChecksum() ); + } + + public void testUpdateMany() + throws IOException + { + Checksum checksumSha1 = new Checksum( ChecksumAlgorithm.SHA1 ); + Checksum checksumMd5 = new Checksum( ChecksumAlgorithm.MD5 ); + List checksums = new ArrayList(); + checksums.add( checksumSha1 ); + checksums.add( checksumMd5 ); + + byte buf[] = ( "You know, I'm sick of following my dreams, man. " + + "I'm just going to ask where they're going and hook up with 'em later. - Mitch Hedberg" ).getBytes(); + + ByteArrayInputStream stream = new ByteArrayInputStream( buf ); + Checksum.update( checksums, stream ); + + assertEquals( "Checksum SHA1", "e396119ae0542e85a74759602fd2f81e5d36d762", checksumSha1.getChecksum() ); + assertEquals( "Checksum MD5", "21c2c5ca87ec018adacb2e2fb3432219", checksumMd5.getChecksum() ); + } + + public void testUpdateWholeUpdatePartial() + { + Checksum checksum = new Checksum( ChecksumAlgorithm.SHA1 ); + assertEquals( "Checksum unset", UNSET_SHA1, checksum.getChecksum() ); + + String expected = "066c2cbbc8cdaecb8ff97dcb84502462d6f575f3"; + byte reesepieces[] = "eatagramovabits".getBytes(); + checksum.update( reesepieces, 0, reesepieces.length ); + String actual = checksum.getChecksum(); + + assertEquals( "Expected", expected, actual ); + + // Reset the checksum. + checksum.reset(); + assertEquals( "Checksum unset", UNSET_SHA1, checksum.getChecksum() ); + + // Now parse it again in 3 pieces. + checksum.update( reesepieces, 0, 5 ); + checksum.update( reesepieces, 5, 5 ); + checksum.update( reesepieces, 10, reesepieces.length - 10 ); + + assertEquals( "Expected", expected, actual ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-checksum/src/test/java/org/apache/archiva/checksum/ChecksummedFileTest.java b/MRM-541/archiva-modules/archiva-base/archiva-checksum/src/test/java/org/apache/archiva/checksum/ChecksummedFileTest.java new file mode 100644 index 000000000..16377079b --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-checksum/src/test/java/org/apache/archiva/checksum/ChecksummedFileTest.java @@ -0,0 +1,269 @@ +package org.apache.archiva.checksum; + +/* + * 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; +import java.io.IOException; + +import org.apache.commons.io.FileUtils; +import org.apache.commons.lang.StringUtils; + +/** + * ChecksummedFileTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ChecksummedFileTest + extends AbstractChecksumTestCase +{ + /** SHA1 checksum from www.ibiblio.org/maven2, incuding file path */ + private static final String SERVLETAPI_SHA1 = "bcc82975c0f9c681fcb01cc38504c992553e93ba"; + + private static final String REMOTE_METADATA_SHA1 = "da39a3ee5e6b4b0d3255bfef95601890afd80709"; + + private static final String REMOTE_METADATA_MD5 = "d41d8cd98f00b204e9800998ecf8427e"; + + private File createTestableJar( String filename ) + throws IOException + { + File srcFile = getTestResource( filename ); + File destFile = new File( getTestOutputDir(), srcFile.getName() ); + FileUtils.copyFile( srcFile, destFile ); + return destFile; + } + + private File createTestableJar( String filename, boolean copySha1, boolean copyMd5 ) + throws IOException + { + File srcFile = getTestResource( filename ); + File jarFile = new File( getTestOutputDir(), srcFile.getName() ); + FileUtils.copyFile( srcFile, jarFile ); + + if ( copySha1 ) + { + File srcSha1 = new File( srcFile.getAbsolutePath() + ".sha1" ); + File sha1File = new File( jarFile.getAbsolutePath() + ".sha1" ); + + FileUtils.copyFile( srcSha1, sha1File ); + } + + if ( copyMd5 ) + { + File srcMd5 = new File( srcFile.getAbsolutePath() + ".md5" ); + File md5File = new File( jarFile.getAbsolutePath() + ".md5" ); + + FileUtils.copyFile( srcMd5, md5File ); + } + + return jarFile; + } + + public void testCalculateChecksumMd5() + throws IOException + { + File testfile = getTestResource( "examples/redback-authz-open.jar" ); + ChecksummedFile checksummedFile = new ChecksummedFile( testfile ); + String expectedChecksum = "f42047fe2e177ac04d0df7aa44d408be"; + String actualChecksum = checksummedFile.calculateChecksum( ChecksumAlgorithm.MD5 ); + assertEquals( expectedChecksum, actualChecksum ); + } + + public void testCalculateChecksumSha1() + throws IOException + { + File testfile = getTestResource( "examples/redback-authz-open.jar" ); + ChecksummedFile checksummedFile = new ChecksummedFile( testfile ); + String expectedChecksum = "2bb14b388973351b0a4dfe11d171965f59cc61a1"; + String actualChecksum = checksummedFile.calculateChecksum( ChecksumAlgorithm.SHA1 ); + assertEquals( expectedChecksum, actualChecksum ); + } + + public void testCreateChecksum() + throws IOException + { + File testableJar = createTestableJar( "examples/redback-authz-open.jar" ); + ChecksummedFile checksummedFile = new ChecksummedFile( testableJar ); + checksummedFile.createChecksum( ChecksumAlgorithm.SHA1 ); + File hashFile = checksummedFile.getChecksumFile( ChecksumAlgorithm.SHA1 ); + assertTrue( "ChecksumAlgorithm file should exist.", hashFile.exists() ); + String hashContents = FileUtils.readFileToString( hashFile ); + hashContents = StringUtils.trim( hashContents ); + assertEquals( "2bb14b388973351b0a4dfe11d171965f59cc61a1 redback-authz-open.jar", hashContents ); + } + + public void testFixChecksum() + throws IOException + { + File jarFile = createTestableJar( "examples/redback-authz-open.jar" ); + File sha1File = new File( jarFile.getAbsolutePath() + ".sha1" ); + + // A typical scenario seen in the wild. + FileUtils.writeStringToFile( sha1File, "sha1sum: redback-authz-open.jar: No such file or directory" ); + + ChecksummedFile checksummedFile = new ChecksummedFile( jarFile ); + assertFalse( "ChecksummedFile.isValid(SHA1) == false", checksummedFile.isValidChecksum( ChecksumAlgorithm.SHA1 ) ); + + boolean fixed = checksummedFile.fixChecksums( new ChecksumAlgorithm[] { ChecksumAlgorithm.SHA1 } ); + assertTrue( "ChecksummedFile.fixChecksums() == true", fixed ); + + assertTrue( "ChecksummedFile.isValid(SHA1) == true", checksummedFile.isValidChecksum( ChecksumAlgorithm.SHA1 ) ); + } + + public void testGetChecksumFile() + { + ChecksummedFile checksummedFile = new ChecksummedFile( new File( "test.jar" ) ); + assertEquals( "test.jar.sha1", checksummedFile.getChecksumFile( ChecksumAlgorithm.SHA1 ).getName() ); + } + + public void testIsValidChecksum() + throws IOException + { + File jarFile = createTestableJar( "examples/redback-authz-open.jar", true, false ); + + ChecksummedFile checksummedFile = new ChecksummedFile( jarFile ); + assertTrue( "ChecksummedFile.isValid(SHA1)", checksummedFile.isValidChecksum( ChecksumAlgorithm.SHA1 ) ); + } + + public void testIsValidChecksumInvalidSha1Format() + throws IOException + { + File jarFile = createTestableJar( "examples/redback-authz-open.jar" ); + File sha1File = new File( jarFile.getAbsolutePath() + ".sha1" ); + + // A typical scenario seen in the wild. + FileUtils.writeStringToFile( sha1File, "sha1sum: redback-authz-open.jar: No such file or directory" ); + + ChecksummedFile checksummedFile = new ChecksummedFile( jarFile ); + assertFalse( "ChecksummedFile.isValid(SHA1)", checksummedFile.isValidChecksum( ChecksumAlgorithm.SHA1 ) ); + + } + + public void testIsValidChecksumNoChecksumFiles() + throws IOException + { + File jarFile = createTestableJar( "examples/redback-authz-open.jar", false, false ); + + ChecksummedFile checksummedFile = new ChecksummedFile( jarFile ); + assertFalse( "ChecksummedFile.isValid(SHA1,MD5)", checksummedFile.isValidChecksums( new ChecksumAlgorithm[] { + ChecksumAlgorithm.SHA1, + ChecksumAlgorithm.MD5 } ) ); + + } + + public void testIsValidChecksumSha1AndMd5() + throws IOException + { + File jarFile = createTestableJar( "examples/redback-authz-open.jar", true, true ); + + ChecksummedFile checksummedFile = new ChecksummedFile( jarFile ); + assertTrue( "ChecksummedFile.isValid(SHA1,MD5)", checksummedFile.isValidChecksums( new ChecksumAlgorithm[] { + ChecksumAlgorithm.SHA1, + ChecksumAlgorithm.MD5 } ) ); + } + + public void testIsValidChecksumSha1NoMd5() + throws IOException + { + File jarFile = createTestableJar( "examples/redback-authz-open.jar", true, false ); + + ChecksummedFile checksummedFile = new ChecksummedFile( jarFile ); + assertTrue( "ChecksummedFile.isValid(SHA1)", checksummedFile.isValidChecksums( new ChecksumAlgorithm[] { + ChecksumAlgorithm.SHA1, + ChecksumAlgorithm.MD5 } ) ); + + } + + public void testParseChecksum() + throws IOException + { + String expected = SERVLETAPI_SHA1 + + " /home/projects/maven/repository-staging/to-ibiblio/maven2/servletapi/servletapi/2.4/servletapi-2.4.pom"; + + File testfile = getTestResource( "examples/redback-authz-open.jar" ); + ChecksummedFile checksummedFile = new ChecksummedFile( testfile ); + String s = checksummedFile.parseChecksum( expected, ChecksumAlgorithm.SHA1, + "servletapi/servletapi/2.4/servletapi-2.4.pom" ); + assertEquals( "Checksum doesn't match", SERVLETAPI_SHA1, s ); + + } + + public void testParseChecksumAltDash1() + throws IOException + { + String expected = SERVLETAPI_SHA1 + " -"; + File testfile = getTestResource( "examples/redback-authz-open.jar" ); + ChecksummedFile checksummedFile = new ChecksummedFile( testfile ); + String s = checksummedFile.parseChecksum( expected, ChecksumAlgorithm.SHA1, + "servletapi/servletapi/2.4/servletapi-2.4.pom" ); + assertEquals( "Checksum doesn't match", SERVLETAPI_SHA1, s ); + } + + public void testParseChecksumAltDash2() + throws IOException + { + String expected = "SHA1(-)=" + SERVLETAPI_SHA1; + File testfile = getTestResource( "examples/redback-authz-open.jar" ); + ChecksummedFile checksummedFile = new ChecksummedFile( testfile ); + String s = checksummedFile.parseChecksum( expected, ChecksumAlgorithm.SHA1, + "servletapi/servletapi/2.4/servletapi-2.4.pom" ); + assertEquals( "Checksum doesn't match", SERVLETAPI_SHA1, s ); + } + + public void testRemoteMetadataChecksumFilePathSha1() + throws IOException + { + String expected = REMOTE_METADATA_SHA1 + " /home/test/repository/examples/metadata/maven-metadata.xml"; + File testfile = getTestResource( "examples/metadata/maven-metadata-remote.xml" ); + ChecksummedFile checksummedFile = new ChecksummedFile( testfile ); + + try + { + String s = checksummedFile.parseChecksum( expected, ChecksumAlgorithm.SHA1, + "maven-metadata-remote.xml" ); + assertEquals( "Checksum doesn't match", REMOTE_METADATA_SHA1, s ); + } + catch ( IOException e ) + { + e.printStackTrace(); + fail( "IOException should not occur." ); + } + } + + public void testRemoteMetadataChecksumFilePathMd5() + throws IOException + { + String expected = REMOTE_METADATA_MD5 + " ./examples/metadata/maven-metadata.xml"; + File testfile = getTestResource( "examples/metadata/maven-metadata-remote.xml" ); + ChecksummedFile checksummedFile = new ChecksummedFile( testfile ); + + try + { + String s = checksummedFile.parseChecksum( expected, ChecksumAlgorithm.MD5, + "maven-metadata-remote.xml" ); + assertEquals( "Checksum doesn't match", REMOTE_METADATA_MD5, s ); + } + catch ( IOException e ) + { + e.printStackTrace(); + fail( "IOException should not occur." ); + } + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-checksum/src/test/resources/examples/metadata/maven-metadata-remote.xml b/MRM-541/archiva-modules/archiva-base/archiva-checksum/src/test/resources/examples/metadata/maven-metadata-remote.xml new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-checksum/src/test/resources/examples/metadata/maven-metadata-remote.xml.md5 b/MRM-541/archiva-modules/archiva-base/archiva-checksum/src/test/resources/examples/metadata/maven-metadata-remote.xml.md5 new file mode 100644 index 000000000..8f9a626ff --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-checksum/src/test/resources/examples/metadata/maven-metadata-remote.xml.md5 @@ -0,0 +1 @@ +d41d8cd98f00b204e9800998ecf8427e ./examples/metadata/maven-metadata.xml \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-checksum/src/test/resources/examples/metadata/maven-metadata-remote.xml.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-checksum/src/test/resources/examples/metadata/maven-metadata-remote.xml.sha1 new file mode 100644 index 000000000..e87d16529 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-checksum/src/test/resources/examples/metadata/maven-metadata-remote.xml.sha1 @@ -0,0 +1 @@ +da39a3ee5e6b4b0d3255bfef95601890afd80709 /home/test/repository/examples/metadata/maven-metadata.xml \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-checksum/src/test/resources/examples/redback-authz-open.jar b/MRM-541/archiva-modules/archiva-base/archiva-checksum/src/test/resources/examples/redback-authz-open.jar new file mode 100644 index 000000000..fada8a200 Binary files /dev/null and b/MRM-541/archiva-modules/archiva-base/archiva-checksum/src/test/resources/examples/redback-authz-open.jar differ diff --git a/MRM-541/archiva-modules/archiva-base/archiva-checksum/src/test/resources/examples/redback-authz-open.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-checksum/src/test/resources/examples/redback-authz-open.jar.md5 new file mode 100644 index 000000000..51fd87406 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-checksum/src/test/resources/examples/redback-authz-open.jar.md5 @@ -0,0 +1 @@ +f42047fe2e177ac04d0df7aa44d408be redback-authz-open.jar diff --git a/MRM-541/archiva-modules/archiva-base/archiva-checksum/src/test/resources/examples/redback-authz-open.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-checksum/src/test/resources/examples/redback-authz-open.jar.sha1 new file mode 100644 index 000000000..3381c3c4a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-checksum/src/test/resources/examples/redback-authz-open.jar.sha1 @@ -0,0 +1 @@ +2bb14b388973351b0a4dfe11d171965f59cc61a1 redback-authz-open.jar diff --git a/MRM-541/archiva-modules/archiva-base/archiva-checksum/src/test/resources/examples/redback-keys-api.jar b/MRM-541/archiva-modules/archiva-base/archiva-checksum/src/test/resources/examples/redback-keys-api.jar new file mode 100644 index 000000000..a7db699d1 Binary files /dev/null and b/MRM-541/archiva-modules/archiva-base/archiva-checksum/src/test/resources/examples/redback-keys-api.jar differ diff --git a/MRM-541/archiva-modules/archiva-base/archiva-checksum/src/test/resources/examples/redback-keys-api.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-checksum/src/test/resources/examples/redback-keys-api.jar.md5 new file mode 100644 index 000000000..e5e4348c6 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-checksum/src/test/resources/examples/redback-keys-api.jar.md5 @@ -0,0 +1 @@ +MD5 ("redback-keys-api.jar") = 5628d13ea40c238a049d8f104811485c diff --git a/MRM-541/archiva-modules/archiva-base/archiva-checksum/src/test/resources/examples/redback-keys-api.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-checksum/src/test/resources/examples/redback-keys-api.jar.sha1 new file mode 100644 index 000000000..d9395602d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-checksum/src/test/resources/examples/redback-keys-api.jar.sha1 @@ -0,0 +1 @@ +SHA1 ("redback-keys-api.jar") = 266548fcba2c32b3999291e8303d58813c3794e3 diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/pom.xml b/MRM-541/archiva-modules/archiva-base/archiva-common/pom.xml new file mode 100644 index 000000000..2be615090 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-common/pom.xml @@ -0,0 +1,78 @@ + + + + + + org.apache.archiva + archiva-base + 1.2-SNAPSHOT + + 4.0.0 + archiva-common + Archiva Base :: Common + + + + commons-lang + commons-lang + + + commons-io + commons-io + + + org.slf4j + slf4j-api + + + org.codehaus.plexus + plexus-component-api + + + org.codehaus.plexus + plexus-spring + test + + + xalan + xalan + 2.7.0 + + + dom4j + dom4j + 1.6.1 + test + + + + + + org.codehaus.plexus + plexus-maven-plugin + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/maven/archiva/common/ArchivaException.java b/MRM-541/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/maven/archiva/common/ArchivaException.java new file mode 100644 index 000000000..84837d7b8 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/maven/archiva/common/ArchivaException.java @@ -0,0 +1,40 @@ +package org.apache.maven.archiva.common; + +/* + * 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. + */ + +/** + * ArchivaException + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ArchivaException + extends Exception +{ + public ArchivaException( String message, Throwable cause ) + { + super( message, cause ); + } + + public ArchivaException( String message ) + { + super( message ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/maven/archiva/common/utils/BaseFile.java b/MRM-541/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/maven/archiva/common/utils/BaseFile.java new file mode 100644 index 000000000..0baf09d6a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/maven/archiva/common/utils/BaseFile.java @@ -0,0 +1,105 @@ +package org.apache.maven.archiva.common.utils; + +/* + * 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; +import java.net.URI; + +/** + * BaseFile - convenient File object that tracks the Base Directory and can provide relative path values + * for the file object based on that Base Directory value. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class BaseFile + extends File +{ + private File baseDir; + + public BaseFile( File pathFile ) + { + this( pathFile.getAbsolutePath() ); + } + + public BaseFile( File repoDir, File pathFile ) + { + this( repoDir, PathUtil.getRelative( repoDir.getAbsolutePath(), pathFile ) ); + } + + public BaseFile( File parent, String child ) + { + super( parent, child ); + this.baseDir = parent; + } + + public BaseFile( String pathname ) + { + super( pathname ); + + // Calculate the top level directory. + + File parent = this; + while ( parent.getParentFile() != null ) + { + parent = parent.getParentFile(); + } + + this.baseDir = parent; + } + + public BaseFile( String repoDir, File pathFile ) + { + this( new File( repoDir ), pathFile ); + } + + public BaseFile( String parent, String child ) + { + super( parent, child ); + this.baseDir = new File( parent ); + } + + public BaseFile( URI uri ) + { + super( uri ); // only to satisfy java compiler. + throw new IllegalStateException( "The " + BaseFile.class.getName() + + " object does not support URI construction." ); + } + + public File getBaseDir() + { + return baseDir; + } + + public String getRelativePath() + { + return PathUtil.getRelative( this.baseDir.getAbsolutePath(), this ); + } + + public void setBaseDir( File baseDir ) + { + this.baseDir = baseDir; + } + + public void setBaseDir( String repoDir ) + { + setBaseDir( new File( repoDir ) ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/maven/archiva/common/utils/DateUtil.java b/MRM-541/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/maven/archiva/common/utils/DateUtil.java new file mode 100644 index 000000000..dd980b396 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/maven/archiva/common/utils/DateUtil.java @@ -0,0 +1,130 @@ +package org.apache.maven.archiva.common.utils; + +/* + * 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.Calendar; +import java.util.Date; +import java.util.GregorianCalendar; + +/** + * DateUtil - some (not-so) common date utility methods. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class DateUtil +{ + public static String getDuration( long duration ) + { + return getDuration( new Date( 0 ), new Date( duration ) ); + } + + public static String getDuration( long ms1, long ms2 ) + { + return getDuration( new Date( ms1 ), new Date( ms2 ) ); + } + + public static String getDuration( Date d1, Date d2 ) + { + Calendar cal1 = new GregorianCalendar(); + cal1.setTime( d1 ); + + Calendar cal2 = new GregorianCalendar(); + cal2.setTime( d2 ); + + return getDuration( cal1, cal2 ); + } + + public static String getDuration( Calendar cal1, Calendar cal2 ) + { + int year1 = cal1.get( Calendar.YEAR ); + int day1 = cal1.get( Calendar.DAY_OF_YEAR ); + int hour1 = cal1.get( Calendar.HOUR_OF_DAY ); + int min1 = cal1.get( Calendar.MINUTE ); + int sec1 = cal1.get( Calendar.SECOND ); + int ms1 = cal1.get( Calendar.MILLISECOND ); + + int year2 = cal2.get( Calendar.YEAR ); + int day2 = cal2.get( Calendar.DAY_OF_YEAR ); + int hour2 = cal2.get( Calendar.HOUR_OF_DAY ); + int min2 = cal2.get( Calendar.MINUTE ); + int sec2 = cal2.get( Calendar.SECOND ); + int ms2 = cal2.get( Calendar.MILLISECOND ); + + int leftDays = ( day1 - day2 ) + ( year1 - year2 ) * 365; + int leftHours = hour2 - hour1; + int leftMins = min2 - min1; + int leftSeconds = sec2 - sec1; + int leftMilliSeconds = ms2 - ms1; + + if ( leftMilliSeconds < 0 ) + { + leftMilliSeconds += 1000; + --leftSeconds; + } + + if ( leftSeconds < 0 ) + { + leftSeconds += 60; + --leftMins; + } + + if ( leftMins < 0 ) + { + leftMins += 60; + --leftHours; + } + + if ( leftHours < 0 ) + { + leftHours += 24; + --leftDays; + } + + StringBuffer interval = new StringBuffer(); + + appendInterval( interval, leftDays, "Day" ); + appendInterval( interval, leftHours, "Hour" ); + appendInterval( interval, leftMins, "Minute" ); + appendInterval( interval, leftSeconds, "Second" ); + appendInterval( interval, leftMilliSeconds, "Millisecond" ); + + return interval.toString(); + } + + private static void appendInterval( StringBuffer interval, int count, String type ) + { + if ( count > 0 ) + { + if ( interval.length() > 0 ) + { + interval.append( " " ); + } + + interval.append( count ); + interval.append( " " ).append( type ); + if ( count > 1 ) + { + interval.append( "s" ); + } + } + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/maven/archiva/common/utils/PathUtil.java b/MRM-541/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/maven/archiva/common/utils/PathUtil.java new file mode 100644 index 000000000..836838e41 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/maven/archiva/common/utils/PathUtil.java @@ -0,0 +1,107 @@ +package org.apache.maven.archiva.common.utils; + +/* + * 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 java.io.File; +import java.net.MalformedURLException; + +/** + * PathUtil - simple utility methods for path manipulation. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class PathUtil +{ + public static String toUrl( String path ) + { + // Is our work already done for us? + if ( path.startsWith( "file:/" ) ) + { + return path; + } + + return toUrl( new File( path ) ); + } + + public static String toUrl( File file ) + { + try + { + return file.toURL().toExternalForm(); + } + catch ( MalformedURLException e ) + { + String pathCorrected = StringUtils.replaceChars( file.getAbsolutePath(), '\\', '/' ); + if ( pathCorrected.startsWith( "file:/" ) ) + { + return pathCorrected; + } + + return "file://" + pathCorrected; + } + } + + /** + * Given a basedir and a child file, return the relative path to the child. + * + * @param basedir the basedir. + * @param file the file to get the relative path for. + * @return the relative path to the child. (NOTE: this path will NOT start with a {@link File#separator} character) + */ + public static String getRelative( String basedir, File file ) + { + return getRelative( basedir, file.getAbsolutePath() ); + } + + /** + * Given a basedir and a child file, return the relative path to the child. + * + * @param basedir the basedir. + * @param child the child path (can be a full path) + * @return the relative path to the child. (NOTE: this path will NOT start with a {@link File#separator} character) + */ + public static String getRelative( String basedir, String child ) + { + if ( basedir.endsWith( "/" ) || basedir.endsWith( "\\" ) ) + { + basedir = basedir.substring( 0, basedir.length() - 1 ); + } + + if ( child.startsWith( basedir ) ) + { + // simple solution. + return child.substring( basedir.length() + 1 ); + } + + String absoluteBasedir = new File( basedir ).getAbsolutePath(); + if ( child.startsWith( absoluteBasedir ) ) + { + // resolved basedir solution. + return child.substring( absoluteBasedir.length() + 1 ); + } + + // File is not within basedir. + throw new IllegalStateException( "Unable to obtain relative path of file " + child + + ", it is not within basedir " + basedir + "." ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/maven/archiva/common/utils/Slf4JPlexusLogger.java b/MRM-541/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/maven/archiva/common/utils/Slf4JPlexusLogger.java new file mode 100644 index 000000000..e186d2c45 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/maven/archiva/common/utils/Slf4JPlexusLogger.java @@ -0,0 +1,130 @@ +package org.apache.maven.archiva.common.utils; + +/* + * 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.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Slf4JPlexusLogger - temporary logger to provide an Slf4j Logger to those components + * outside of the archiva codebase that require a plexus logger. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class Slf4JPlexusLogger implements org.codehaus.plexus.logging.Logger { + private Logger log; + + public Slf4JPlexusLogger(Class clazz) { + log = LoggerFactory.getLogger(clazz); + } + + public Slf4JPlexusLogger(String name) { + log = LoggerFactory.getLogger(name); + } + + public void debug(String message) { + log.debug(message); + } + + public void debug(String message, Throwable throwable) { + log.debug(message, throwable); + } + + public void error(String message) { + log.error(message); + } + + public void error(String message, Throwable throwable) { + log.error(message, throwable); + } + + public void fatalError(String message) { + log.error(message); + } + + public void fatalError(String message, Throwable throwable) { + log.error(message, throwable); + } + + public org.codehaus.plexus.logging.Logger getChildLogger(String name) { + return new Slf4JPlexusLogger(log.getName() + "." + name); + } + + public String getName() { + return log.getName(); + } + + public int getThreshold() { + if (log.isTraceEnabled()) { + return org.codehaus.plexus.logging.Logger.LEVEL_DEBUG; + } else if (log.isDebugEnabled()) { + return org.codehaus.plexus.logging.Logger.LEVEL_DEBUG; + } else if (log.isInfoEnabled()) { + return org.codehaus.plexus.logging.Logger.LEVEL_INFO; + } else if (log.isWarnEnabled()) { + return org.codehaus.plexus.logging.Logger.LEVEL_WARN; + } else if (log.isErrorEnabled()) { + return org.codehaus.plexus.logging.Logger.LEVEL_ERROR; + } + + return org.codehaus.plexus.logging.Logger.LEVEL_DISABLED; + } + + public void info(String message) { + log.info(message); + } + + public void info(String message, Throwable throwable) { + log.info(message, throwable); + } + + public boolean isDebugEnabled() { + return log.isDebugEnabled(); + } + + public boolean isErrorEnabled() { + return log.isErrorEnabled(); + } + + public boolean isFatalErrorEnabled() { + return log.isErrorEnabled(); + } + + public boolean isInfoEnabled() { + return log.isInfoEnabled(); + } + + public boolean isWarnEnabled() { + return log.isWarnEnabled(); + } + + public void setThreshold(int threshold) { + /* do nothing */ + } + + public void warn(String message) { + log.warn(message); + } + + public void warn(String message, Throwable throwable) { + log.warn(message, throwable); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/maven/archiva/common/utils/VersionComparator.java b/MRM-541/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/maven/archiva/common/utils/VersionComparator.java new file mode 100644 index 000000000..9acd26869 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/maven/archiva/common/utils/VersionComparator.java @@ -0,0 +1,260 @@ +package org.apache.maven.archiva.common.utils; + +/* + * 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.ArrayUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang.math.NumberUtils; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; + +/** + * VersionComparator - compare the parts of two version strings. + *

+ * Technique. + *

+ * * Split the version strings into parts by splitting on "-._" first, then breaking apart words from numbers. + *

+ * + * "1.0" = "1", "0" + * "1.0-alpha-1" = "1", "0", "alpha", "1" + * "2.0-rc2" = "2", "0", "rc", "2" + * "1.3-m2" = "1", "3", "m", "3" + * + *

+ * compare each part individually, and when they do not match, perform the following test. + *

+ * Numbers are calculated per normal comparison rules. + * Words that are part of the "special word list" will be treated as their index within that heirarchy. + * Words that cannot be identified as special, are treated using normal case-insensitive comparison rules. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class VersionComparator + implements Comparator +{ + private static Comparator INSTANCE = new VersionComparator(); + + private List specialWords; + + public VersionComparator() + { + specialWords = new ArrayList(); + + // ids that refer to LATEST + specialWords.add( "final" ); + specialWords.add( "release" ); + specialWords.add( "current" ); + specialWords.add( "latest" ); + specialWords.add( "g" ); + specialWords.add( "gold" ); + specialWords.add( "fcs" ); + + // ids that are for a release cycle. + specialWords.add( "a" ); + specialWords.add( "alpha" ); + specialWords.add( "b" ); + specialWords.add( "beta" ); + specialWords.add( "pre" ); + specialWords.add( "rc" ); + specialWords.add( "m" ); + specialWords.add( "milestone" ); + + // ids that are for dev / debug cycles. + specialWords.add( "dev" ); + specialWords.add( "test" ); + specialWords.add( "debug" ); + specialWords.add( "unofficial" ); + specialWords.add( "nightly" ); + specialWords.add( "incubating" ); + specialWords.add( "incubator" ); + specialWords.add( "snapshot" ); + } + + public static Comparator getInstance() + { + return INSTANCE; + } + + public int compare( String o1, String o2 ) + { + if ( o1 == null && o2 == null ) + { + return 0; + } + + if ( o1 == null ) + { + return 1; + } + + if ( o2 == null ) + { + return -1; + } + + String[] parts1 = toParts( o1 ); + String[] parts2 = toParts( o2 ); + + int diff; + int partLen = Math.max( parts1.length, parts2.length ); + for ( int i = 0; i < partLen; i++ ) + { + diff = comparePart( safePart( parts1, i ), safePart( parts2, i ) ); + if ( diff != 0 ) + { + return diff; + } + } + + diff = parts2.length - parts1.length; + + if ( diff != 0 ) + { + return diff; + } + + return o1.compareToIgnoreCase( o2 ); + } + + private String safePart( String[] parts, int idx ) + { + if ( idx < parts.length ) + { + return parts[idx]; + } + + return "0"; + } + + private int comparePart( String s1, String s2 ) + { + boolean is1Num = NumberUtils.isNumber( s1 ); + boolean is2Num = NumberUtils.isNumber( s2 ); + + // (Special Case) Test for numbers both first. + if ( is1Num && is2Num ) + { + int i1 = NumberUtils.toInt( s1 ); + int i2 = NumberUtils.toInt( s2 ); + + return i1 - i2; + } + + // Test for text both next. + if ( !is1Num && !is2Num ) + { + int idx1 = specialWords.indexOf( s1.toLowerCase() ); + int idx2 = specialWords.indexOf( s2.toLowerCase() ); + + // Only operate perform index based operation, if both strings + // are found in the specialWords index. + if ( idx1 >= 0 && idx2 >= 0 ) + { + return idx1 - idx2; + } + } + + // Comparing text to num + if ( !is1Num && is2Num ) + { + return -1; + } + + // Comparing num to text + if ( is1Num && !is2Num ) + { + return 1; + } + + // Return comparison of strings themselves. + return s1.compareToIgnoreCase( s2 ); + } + + public static String[] toParts( String version ) + { + if ( StringUtils.isBlank( version ) ) + { + return ArrayUtils.EMPTY_STRING_ARRAY; + } + + int modeOther = 0; + int modeDigit = 1; + int modeText = 2; + + List parts = new ArrayList(); + int len = version.length(); + int i = 0; + int start = 0; + int mode = modeOther; + + while ( i < len ) + { + char c = version.charAt( i ); + + if ( Character.isDigit( c ) ) + { + if ( mode != modeDigit ) + { + if ( mode != modeOther ) + { + parts.add( version.substring( start, i ) ); + } + mode = modeDigit; + start = i; + } + } + else if ( Character.isLetter( c ) ) + { + if ( mode != modeText ) + { + if ( mode != modeOther ) + { + parts.add( version.substring( start, i ) ); + } + mode = modeText; + start = i; + } + } + else + { + // Other. + if ( mode != modeOther ) + { + parts.add( version.substring( start, i ) ); + mode = modeOther; + } + } + + i++; + } + + // Add remainder + if ( mode != modeOther ) + { + parts.add( version.substring( start, i ) ); + } + + return parts.toArray( new String[parts.size()] ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/maven/archiva/common/utils/VersionUtil.java b/MRM-541/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/maven/archiva/common/utils/VersionUtil.java new file mode 100644 index 000000000..2e3831d4a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-common/src/main/java/org/apache/maven/archiva/common/utils/VersionUtil.java @@ -0,0 +1,204 @@ +package org.apache.maven.archiva.common.utils; + +/* + * 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 java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * Version utility methods. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class VersionUtil +{ + /** + * These are the version patterns found in the filenames of the various artifact's versions IDs. + * These patterns are all tackling lowercase version IDs. + */ + private static final String versionPatterns[] = new String[] { + "([0-9][_.0-9a-z]*)", + "(snapshot)", + "(g?[_.0-9ab]*(pre|rc|g|m)[_.0-9]*)", + "(dev[_.0-9]*)", + "(alpha[_.0-9]*)", + "(beta[_.0-9]*)", + "(rc[_.0-9]*)", +// "(test[_.0-9]*)", -- omitted for MRM-681, can be reinstated as part of MRM-712 + "(debug[_.0-9]*)", + "(unofficial[_.0-9]*)", + "(current)", + "(latest)", + "(fcs)", + "(release[_.0-9]*)", + "(nightly)", + "(final)", + "(incubating)", + "(incubator)", + "([ab][_.0-9]+)" }; + + public static final String SNAPSHOT = "SNAPSHOT"; + + public static final Pattern UNIQUE_SNAPSHOT_PATTERN = Pattern.compile( "^(.*)-([0-9]{8}\\.[0-9]{6})-([0-9]+)$" ); + + public static final Pattern TIMESTAMP_PATTERN = Pattern.compile( "^([0-9]{8})\\.([0-9]{6})$" ); + + public static final Pattern GENERIC_SNAPSHOT_PATTERN = Pattern.compile( "^(.*)-" + SNAPSHOT ); + + private static final Pattern VERSION_MEGA_PATTERN = Pattern.compile( StringUtils.join( versionPatterns, '|' ), Pattern.CASE_INSENSITIVE ); + + /** + *

+ * Tests if the unknown string contains elements that identify it as a version string (or not). + *

+ * + *

+ * The algorithm tests each part of the string that is delimited by a '-' (dash) character. + * If 75% or more of the sections are identified as 'version' strings, the result is + * determined to be of a high probability to be version identifier string. + *

+ * + * @param unknown the unknown string to test. + * @return true if the unknown string is likely a version string. + */ + public static boolean isVersion( String unknown ) + { + String versionParts[] = StringUtils.split( unknown, '-' ); + + Matcher mat; + + int countValidParts = 0; + + for ( int i = 0; i < versionParts.length; i++ ) + { + String part = versionParts[i]; + mat = VERSION_MEGA_PATTERN.matcher( part ); + + if ( mat.matches() ) + { + countValidParts++; + } + } + + /* Calculate version probability as true if 3/4's of the input string has pieces of + * of known version identifier strings. + */ + int threshold = (int) Math.floor( Math.max( (double) 1.0, (double) ( versionParts.length * 0.75 ) ) ); + + return ( countValidParts >= threshold ); + } + + /** + *

+ * Tests if the identifier is a known simple version keyword. + *

+ * + *

+ * This method is different from {@link #isVersion(String)} in that it tests the whole input string in + * one go as a simple identifier. (eg "alpha", "1.0", "beta", "debug", "latest", "rc#", etc...) + *

+ * + * @param identifier the identifier to test. + * @return true if the unknown string is likely a version string. + */ + public static boolean isSimpleVersionKeyword( String identifier ) + { + Matcher mat = VERSION_MEGA_PATTERN.matcher( identifier ); + + return mat.matches(); + } + + public static boolean isSnapshot( String version ) + { + Matcher m = UNIQUE_SNAPSHOT_PATTERN.matcher( version ); + if ( m.matches() ) + { + return true; + } + else + { + return version.endsWith( SNAPSHOT ); + } + } + + public static String getBaseVersion( String version ) + { + Matcher m = UNIQUE_SNAPSHOT_PATTERN.matcher( version ); + if ( m.matches() ) + { + return m.group( 1 ) + "-" + SNAPSHOT; + } + else + { + return version; + } + } + + /** + *

+ * Get the release version of the snapshot version. + *

+ * + *

+ * If snapshot version is 1.0-SNAPSHOT, then release version would be 1.0 + * And if snapshot version is 1.0-20070113.163208-1.jar, then release version would still be 1.0 + *

+ * + * @param snapshotVersion + * @return + */ + public static String getReleaseVersion( String snapshotVersion ) + { + Matcher m = UNIQUE_SNAPSHOT_PATTERN.matcher( snapshotVersion ); + + if( isGenericSnapshot( snapshotVersion ) ) + { + m = GENERIC_SNAPSHOT_PATTERN.matcher( snapshotVersion ); + } + + if ( m.matches() ) + { + return m.group( 1 ); + } + else + { + return snapshotVersion; + } + } + + public static boolean isUniqueSnapshot( String version ) + { + Matcher m = UNIQUE_SNAPSHOT_PATTERN.matcher( version ); + if( m.matches() ) + { + return true; + } + + return false; + } + + public static boolean isGenericSnapshot( String version ) + { + return version.endsWith( SNAPSHOT ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/java/org/apache/maven/archiva/common/utils/BaseFileTest.java b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/java/org/apache/maven/archiva/common/utils/BaseFileTest.java new file mode 100644 index 000000000..4de78842b --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/java/org/apache/maven/archiva/common/utils/BaseFileTest.java @@ -0,0 +1,132 @@ +package org.apache.maven.archiva.common.utils; + +/* + * 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 junit.framework.TestCase; + +import java.io.File; + +/** + * BaseFileTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class BaseFileTest + extends TestCase +{ + public void testFileString() + { + File repoDir = new File( "/home/user/foo/repository" ); + String pathFile = "path/to/resource.xml"; + BaseFile file = new BaseFile( repoDir, pathFile ); + + assertAbsolutePath( "/home/user/foo/repository/path/to/resource.xml", file ); + assertRelativePath( "path/to/resource.xml", file ); + assertBasedir( "/home/user/foo/repository", file ); + } + + public void testFileFile() + { + File repoDir = new File( "/home/user/foo/repository" ); + File pathFile = new File( "/home/user/foo/repository/path/to/resource.xml" ); + BaseFile file = new BaseFile( repoDir, pathFile ); + + assertAbsolutePath( "/home/user/foo/repository/path/to/resource.xml", file ); + assertRelativePath( "path/to/resource.xml", file ); + assertBasedir( "/home/user/foo/repository", file ); + } + + public void testStringFile() + { + String repoDir = "/home/user/foo/repository"; + File pathFile = new File( "/home/user/foo/repository/path/to/resource.xml" ); + BaseFile file = new BaseFile( repoDir, pathFile ); + + assertAbsolutePath( "/home/user/foo/repository/path/to/resource.xml", file ); + assertRelativePath( "path/to/resource.xml", file ); + assertBasedir( "/home/user/foo/repository", file ); + } + + public void testFileThenSetBaseString() + { + String repoDir = "/home/user/foo/repository"; + File pathFile = new File( "/home/user/foo/repository/path/to/resource.xml" ); + BaseFile file = new BaseFile( pathFile ); + file.setBaseDir( repoDir ); + + assertAbsolutePath( "/home/user/foo/repository/path/to/resource.xml", file ); + assertRelativePath( "path/to/resource.xml", file ); + assertBasedir( "/home/user/foo/repository", file ); + } + + public void testFileThenSetBaseFile() + { + File repoDir = new File( "/home/user/foo/repository" ); + File pathFile = new File( "/home/user/foo/repository/path/to/resource.xml" ); + BaseFile file = new BaseFile( pathFile ); + file.setBaseDir( repoDir ); + + assertAbsolutePath( "/home/user/foo/repository/path/to/resource.xml", file ); + assertRelativePath( "path/to/resource.xml", file ); + assertBasedir( "/home/user/foo/repository", file ); + } + + public void testStringThenSetBaseString() + { + String repoDir = "/home/user/foo/repository"; + String pathFile = "/home/user/foo/repository/path/to/resource.xml"; + BaseFile file = new BaseFile( pathFile ); + file.setBaseDir( repoDir ); + + assertAbsolutePath( "/home/user/foo/repository/path/to/resource.xml", file ); + assertRelativePath( "path/to/resource.xml", file ); + assertBasedir( "/home/user/foo/repository", file ); + } + + public void testStringThenSetBaseFile() + { + File repoDir = new File( "/home/user/foo/repository" ); + String pathFile = "/home/user/foo/repository/path/to/resource.xml"; + BaseFile file = new BaseFile( pathFile ); + file.setBaseDir( repoDir ); + + assertAbsolutePath( "/home/user/foo/repository/path/to/resource.xml", file ); + assertRelativePath( "path/to/resource.xml", file ); + assertBasedir( "/home/user/foo/repository", file ); + } + + private void assertAbsolutePath( String expectedPath, BaseFile actualFile ) + { + assertEquals( new File( expectedPath ).getAbsolutePath(), actualFile.getAbsolutePath() ); + } + + private void assertRelativePath( String expectedPath, BaseFile actualFile ) + { + assertEquals( expectedPath, StringUtils.replace( actualFile.getRelativePath(), "\\", "/" ) ); + } + + private void assertBasedir( String expectedPath, BaseFile actualFile ) + { + assertEquals( new File( expectedPath ), actualFile.getBaseDir() ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/java/org/apache/maven/archiva/common/utils/DateUtilTest.java b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/java/org/apache/maven/archiva/common/utils/DateUtilTest.java new file mode 100644 index 000000000..b080227fe --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/java/org/apache/maven/archiva/common/utils/DateUtilTest.java @@ -0,0 +1,69 @@ +package org.apache.maven.archiva.common.utils; + +/* + * 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.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; + +import junit.framework.TestCase; + +/** + * DateUtilTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class DateUtilTest extends TestCase +{ + private void assertDuration( String expectedDuration, String startTimestamp, String endTimestamp ) + throws ParseException + { + SimpleDateFormat sdf = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss SSS" ); + Date startDate = sdf.parse( startTimestamp ); + Date endDate = sdf.parse( endTimestamp ); + +// System.out.println( "Date: " + endTimestamp + " - " + startTimestamp + " = " +// + ( endDate.getTime() - startDate.getTime() ) + " ms" ); + + assertEquals( expectedDuration, DateUtil.getDuration( startDate, endDate ) ); + } + + public void testGetDurationDifference() throws ParseException + { + assertDuration( "2 Seconds", "2006-08-22 13:00:02 0000", + "2006-08-22 13:00:04 0000" ); + + assertDuration( "12 Minutes 12 Seconds 234 Milliseconds", "2006-08-22 13:12:02 0000", + "2006-08-22 13:24:14 0234" ); + + assertDuration( "12 Minutes 501 Milliseconds", "2006-08-22 13:12:01 0500", + "2006-08-22 13:24:02 0001" ); + } + + public void testGetDurationDirect() throws ParseException + { + assertEquals( "2 Seconds", DateUtil.getDuration( 2000 ) ); + + assertEquals( "12 Minutes 12 Seconds 234 Milliseconds", DateUtil.getDuration( 732234 ) ); + + assertEquals( "12 Minutes 501 Milliseconds", DateUtil.getDuration( 720501 ) ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/java/org/apache/maven/archiva/common/utils/PathUtilTest.java b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/java/org/apache/maven/archiva/common/utils/PathUtilTest.java new file mode 100644 index 000000000..a318e57f4 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/java/org/apache/maven/archiva/common/utils/PathUtilTest.java @@ -0,0 +1,94 @@ +package org.apache.maven.archiva.common.utils; + +/* + * 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 java.io.File; + +import junit.framework.TestCase; + +/** + * PathUtilTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class PathUtilTest + extends TestCase +{ + public void testToRelativeWithoutSlash() + { + assertEquals( "path/to/resource.xml", PathUtil.getRelative( "/home/user/foo/repository", + "/home/user/foo/repository/path/to/resource.xml" ) ); + } + + public void testToRelativeWithSlash() + { + assertEquals( "path/to/resource.xml", PathUtil.getRelative( "/home/user/foo/repository/", + "/home/user/foo/repository/path/to/resource.xml" ) ); + } + + public void testToUrlRelativePath() + { + File workingDir = new File( "." ); + + String workingDirname = StringUtils.replaceChars( workingDir.getAbsolutePath(), '\\', '/' ); + + // Some JVM's retain the "." at the end of the path. Drop it. + if ( workingDirname.endsWith( "/." ) ) + { + workingDirname = workingDirname.substring( 0, workingDirname.length() - 2 ); + } + + if ( !workingDirname.startsWith( "/" ) ) + { + workingDirname = "/" + workingDirname; + } + + String path = "path/to/resource.xml"; + String expectedPath = "file:" + workingDirname + "/" + path; + + assertEquals( expectedPath, PathUtil.toUrl( path ) ); + } + + public void testToUrlUsingFileUrl() + { + File workingDir = new File( "." ); + + String workingDirname = StringUtils.replaceChars( workingDir.getAbsolutePath(), '\\', '/' ); + + // Some JVM's retain the "." at the end of the path. Drop it. + if ( workingDirname.endsWith( "/." ) ) + { + workingDirname = workingDirname.substring( 0, workingDirname.length() - 2 ); + } + + if ( !workingDirname.startsWith( "/" ) ) + { + workingDirname = "/" + workingDirname; + } + + String path = "path/to/resource.xml"; + String expectedPath = "file:" + workingDirname + "/" + path; + + assertEquals( expectedPath, PathUtil.toUrl( expectedPath ) ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/java/org/apache/maven/archiva/common/utils/ResourceUtils.java b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/java/org/apache/maven/archiva/common/utils/ResourceUtils.java new file mode 100644 index 000000000..db2a0dc27 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/java/org/apache/maven/archiva/common/utils/ResourceUtils.java @@ -0,0 +1,90 @@ +package org.apache.maven.archiva.common.utils; + +/* + * 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 java.io.File; +import java.io.IOException; +import java.net.URL; + +/** + * ResourceUtils + */ +public class ResourceUtils +{ + /** + * Lookup resource at the given path relative to the root of the classpath and if it exists return a file object + * that can be used to access it. + *

+ * At test time the contents of both the src/resources and test/resources dirs are available at the root of the + * classpath. + *

+ * To retrieve the file src/test/resources/sometest/test.properties use getResource("/sometest/test.properties"). + * + * @param resourcePath the path to the resource relative to the root of the classpath + * @return File a file object pointing to the resource on the classpath or null if the resource cannot be found + */ + public static File getResource( String resourcePath ) + throws IOException + { + return getResource( resourcePath, null ); + } + + /** + * Lookup resource at the given path relative to the root of the classpath and if it exists return a file object + * that can be used to access it. + *

+ * At test time the contents of both the src/resources and test/resources dirs are available at the root of the + * classpath. + *

+ * To retrieve the file src/test/resources/sometest/test.properties use getResource("/sometest/test.properties"). + * + * @param resourcePath the path to the resource relative to the root of the classpath + * @param classloader the classloader who's classpath should be searched for the resource + * @return File a file object pointing to the resource on the classpath or null if the resource cannot be found + */ + public static File getResource( String resourcePath, ClassLoader classloader ) + throws IOException + { + File testResource = null; + + if ( StringUtils.isNotBlank( resourcePath ) ) + { + // make sure the retrieval is relative to the root of the classpath + resourcePath = resourcePath.startsWith( "/" ) ? resourcePath : "/" + resourcePath; + + URL resourceUrl = getResourceUrl( resourcePath, classloader ); + if ( resourceUrl == null ) + { + throw new IOException( "Could not find test resource at path '" + resourcePath + "'" ); + } + testResource = new File( resourceUrl.getFile() ); + } + + return testResource; + } + + private static URL getResourceUrl( String resourcePath, ClassLoader classloader ) + { + return classloader != null ? classloader.getResource( resourcePath ) + : ResourceUtils.class.getResource( resourcePath ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/java/org/apache/maven/archiva/common/utils/VersionComparatorTest.java b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/java/org/apache/maven/archiva/common/utils/VersionComparatorTest.java new file mode 100644 index 000000000..4bfef29fb --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/java/org/apache/maven/archiva/common/utils/VersionComparatorTest.java @@ -0,0 +1,131 @@ +package org.apache.maven.archiva.common.utils; + +/* + * 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.Arrays; +import java.util.Collections; +import java.util.List; + +import junit.framework.TestCase; + +/** + * VersionComparatorTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class VersionComparatorTest + extends TestCase +{ + public void testComparator() + { + /* Sort order is oldest to newest */ + + assertSort( new String[] { "1.0", "3.0", "2.0" }, new String[] { "1.0", "2.0", "3.0" } ); + assertSort( new String[] { "1.5", "1.2", "1.0" }, new String[] { "1.0", "1.2", "1.5" } ); + + assertSort( new String[] { "1.5-SNAPSHOT", "1.2", "1.20" }, new String[] { "1.2", "1.5-SNAPSHOT", "1.20" } ); + + assertSort( new String[] { "1.1", "1.0-SNAPSHOT", "1.1-m6", "1.1-rc1" }, new String[] { + "1.0-SNAPSHOT", + "1.1-rc1", + "1.1-m6", + "1.1" } ); + + assertSort( new String[] { "1.1-m6", "1.0-SNAPSHOT", "1.1-rc1", "1.1" }, new String[] { + "1.0-SNAPSHOT", + "1.1-rc1", + "1.1-m6", + "1.1" } ); + + assertSort( new String[] { "2.0.5", "2.0.4-SNAPSHOT", "2.0", "2.0-rc1" }, new String[] { + "2.0-rc1", + "2.0", + "2.0.4-SNAPSHOT", + "2.0.5" } ); + + assertSort( new String[] { "1.0-alpha-1", "1.0-alpha-22", "1.0-alpha-10", "1.0-alpha-9" }, new String[] { + "1.0-alpha-1", + "1.0-alpha-9", + "1.0-alpha-10", + "1.0-alpha-22" } ); + + assertSort( new String[] { "1.0-alpha1", "1.0-alpha22", "1.0-alpha10", "1.0-alpha9" }, new String[] { + "1.0-alpha1", + "1.0-alpha9", + "1.0-alpha10", + "1.0-alpha22" } ); + + assertSort( new String[] { "1.0-1", "1.0-22", "1.0-10", "1.0-9" }, new String[] { + "1.0-1", + "1.0-9", + "1.0-10", + "1.0-22" } ); + + assertSort( new String[] { "alpha-1", "alpha-22", "alpha-10", "alpha-9" }, new String[] { + "alpha-1", + "alpha-9", + "alpha-10", + "alpha-22" } ); + + assertSort( new String[] { "1.0.1", "1.0.22", "1.0.10", "1.0.9" }, new String[] { + "1.0.1", + "1.0.9", + "1.0.10", + "1.0.22" } ); + + + // TODO: write more unit tests. + } + + private void assertSort( String[] rawVersions, String[] expectedSort ) + { + List versions = new ArrayList(); + versions.addAll( Arrays.asList( rawVersions ) ); + + Collections.sort( versions, VersionComparator.getInstance() ); + + assertEquals( "Versions.size()", expectedSort.length, versions.size() ); + for ( int i = 0; i < expectedSort.length; i++ ) + { + assertEquals( "Sorted Versions[" + i + "]", expectedSort[i], (String) versions.get( i ) ); + } + } + + public void testToParts() + { + assertParts( "1.0", new String[] { "1", "0" } ); + assertParts( "1.0-alpha-1", new String[] { "1", "0", "alpha", "1" } ); + assertParts( "2.0-rc2", new String[] { "2", "0", "rc", "2" } ); + assertParts( "1.3-m6", new String[] { "1", "3", "m", "6" } ); + } + + private void assertParts( String version, String[] expectedParts ) + { + String actualParts[] = VersionComparator.toParts( version ); + assertEquals( "Parts.length", expectedParts.length, actualParts.length ); + + for ( int i = 0; i < expectedParts.length; i++ ) + { + assertEquals( "parts[" + i + "]", expectedParts[i], actualParts[i] ); + } + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/legacy-repository/CVS/Root b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/legacy-repository/CVS/Root new file mode 100644 index 000000000..2e65f24a6 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/legacy-repository/CVS/Root @@ -0,0 +1 @@ +not a real CVS root - for testing exclusions diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/legacy-repository/KEYS b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/legacy-repository/KEYS new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/legacy-repository/invalid/foo/invalid-1.0.foo b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/legacy-repository/invalid/foo/invalid-1.0.foo new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/legacy-repository/invalid/invalid-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/legacy-repository/invalid/invalid-1.0.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/legacy-repository/invalid/jars/1.0/invalid-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/legacy-repository/invalid/jars/1.0/invalid-1.0.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/legacy-repository/invalid/jars/invalid-1.0.rar b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/legacy-repository/invalid/jars/invalid-1.0.rar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/legacy-repository/invalid/jars/invalid.jar b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/legacy-repository/invalid/jars/invalid.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/legacy-repository/invalid/jars/no-extension b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/legacy-repository/invalid/jars/no-extension new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/legacy-repository/javax.sql/jars/jdbc-2.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/legacy-repository/javax.sql/jars/jdbc-2.0.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/legacy-repository/org.apache.maven.update/jars/test-not-updated-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/legacy-repository/org.apache.maven.update/jars/test-not-updated-1.0.jar new file mode 100644 index 000000000..54d190b23 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/legacy-repository/org.apache.maven.update/jars/test-not-updated-1.0.jar @@ -0,0 +1 @@ +dummy content. sample file only. diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/legacy-repository/org.apache.maven.update/jars/test-updated-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/legacy-repository/org.apache.maven.update/jars/test-updated-1.0.jar new file mode 100644 index 000000000..54d190b23 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/legacy-repository/org.apache.maven.update/jars/test-updated-1.0.jar @@ -0,0 +1 @@ +dummy content. sample file only. diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/legacy-repository/org.apache.maven/jars/some-ejb-1.0-client.jar b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/legacy-repository/org.apache.maven/jars/some-ejb-1.0-client.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/legacy-repository/org.apache.maven/jars/testing-1.0-20050611.112233-1.jar b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/legacy-repository/org.apache.maven/jars/testing-1.0-20050611.112233-1.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/legacy-repository/org.apache.maven/jars/testing-1.0-sources.jar b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/legacy-repository/org.apache.maven/jars/testing-1.0-sources.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/legacy-repository/org.apache.maven/jars/testing-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/legacy-repository/org.apache.maven/jars/testing-1.0.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/legacy-repository/org.apache.maven/jars/testing-1.0.tar.gz b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/legacy-repository/org.apache.maven/jars/testing-1.0.tar.gz new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/legacy-repository/org.apache.maven/jars/testing-1.0.zip b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/legacy-repository/org.apache.maven/jars/testing-1.0.zip new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/legacy-repository/org.apache.maven/jars/testing-UNKNOWN.jar b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/legacy-repository/org.apache.maven/jars/testing-UNKNOWN.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/CVS/Root b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/CVS/Root new file mode 100644 index 000000000..2e65f24a6 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/CVS/Root @@ -0,0 +1 @@ +not a real CVS root - for testing exclusions diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/KEYS b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/KEYS new file mode 100644 index 000000000..d3b34d5ad --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/KEYS @@ -0,0 +1 @@ +test KEYS file \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/invalid/invalid-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/invalid/invalid-1.0.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/invalid/invalid/1.0-20050611.123456-1/invalid-1.0-20050611.123456-1.jar b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/invalid/invalid/1.0-20050611.123456-1/invalid-1.0-20050611.123456-1.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/invalid/invalid/1.0-SNAPSHOT/invalid-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/invalid/invalid/1.0-SNAPSHOT/invalid-1.0.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/invalid/invalid/1.0/invalid-1.0b.jar b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/invalid/invalid/1.0/invalid-1.0b.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/invalid/invalid/1.0/invalid-2.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/invalid/invalid/1.0/invalid-2.0.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/invalid/invalid/1/invalid-1 b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/invalid/invalid/1/invalid-1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/javax/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/javax/maven-metadata.xml new file mode 100644 index 000000000..b3baf545d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/javax/maven-metadata.xml @@ -0,0 +1,26 @@ + + + + + + javax.sql + jdbc + 2.0 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/javax/sql/jdbc/2.0/jdbc-2.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/javax/sql/jdbc/2.0/jdbc-2.0.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/javax/sql/jdbc/2.0/maven-metadata-repository.xml b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/javax/sql/jdbc/2.0/maven-metadata-repository.xml new file mode 100644 index 000000000..caf5b6697 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/javax/sql/jdbc/2.0/maven-metadata-repository.xml @@ -0,0 +1,25 @@ + + + + + javax.sql + jdbc + 2.0 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/javax/sql/jdbc/maven-metadata-repository.xml b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/javax/sql/jdbc/maven-metadata-repository.xml new file mode 100644 index 000000000..bb7570891 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/javax/sql/jdbc/maven-metadata-repository.xml @@ -0,0 +1,30 @@ + + + + + javax.sql + jdbc + 2.0 + + + 2.0 + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/javax/sql/maven-metadata-repository.xml b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/javax/sql/maven-metadata-repository.xml new file mode 100644 index 000000000..caf5b6697 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/javax/sql/maven-metadata-repository.xml @@ -0,0 +1,25 @@ + + + + + javax.sql + jdbc + 2.0 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/A/1.0/A-1.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/A/1.0/A-1.0.pom new file mode 100644 index 000000000..202a0a448 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/A/1.0/A-1.0.pom @@ -0,0 +1,28 @@ + + + + 4.0.0 + org.apache.maven + A + 1.0 + Maven Test Repository Artifact Discovery + war + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/A/1.0/A-1.0.war b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/A/1.0/A-1.0.war new file mode 100644 index 000000000..54d190b23 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/A/1.0/A-1.0.war @@ -0,0 +1 @@ +dummy content. sample file only. diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/B/1.0/B-1.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/B/1.0/B-1.0.pom new file mode 100644 index 000000000..fa5f8f6c8 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/B/1.0/B-1.0.pom @@ -0,0 +1,28 @@ + + + + 4.0.0 + org.apache.maven + B + 1.0 + Maven Test Repository Artifact Discovery + pom + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/B/2.0/B-2.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/B/2.0/B-2.0.pom new file mode 100644 index 000000000..c3034e820 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/B/2.0/B-2.0.pom @@ -0,0 +1,28 @@ + + + + 4.0.0 + org.apache.maven + B + 2.0 + Maven Test Repository Artifact Discovery + pom + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/C/1.0/C-1.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/C/1.0/C-1.0.pom new file mode 100644 index 000000000..ae14cd7eb --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/C/1.0/C-1.0.pom @@ -0,0 +1,28 @@ + + + + 4.0.0 + org.apache.maven + C + 1.0 + Maven Test Repository Artifact Discovery + war + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/C/1.0/C-1.0.war b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/C/1.0/C-1.0.war new file mode 100644 index 000000000..54d190b23 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/C/1.0/C-1.0.war @@ -0,0 +1 @@ +dummy content. sample file only. diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/discovery/1.0/discovery-1.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/discovery/1.0/discovery-1.0.pom new file mode 100644 index 000000000..5a29f6117 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/discovery/1.0/discovery-1.0.pom @@ -0,0 +1,28 @@ + + + + 4.0.0 + org.apache.maven + discovery + 1.0 + Maven Test Repository Artifact Discovery + pom + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/maven-metadata.xml new file mode 100644 index 000000000..8ce7fc7bb --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/maven-metadata.xml @@ -0,0 +1,23 @@ + + + + + org.apache.maven + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/samplejar/1.0/samplejar-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/samplejar/1.0/samplejar-1.0.jar new file mode 100644 index 000000000..54d190b23 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/samplejar/1.0/samplejar-1.0.jar @@ -0,0 +1 @@ +dummy content. sample file only. diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/samplejar/1.0/samplejar-1.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/samplejar/1.0/samplejar-1.0.pom new file mode 100644 index 000000000..6ab57d162 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/samplejar/1.0/samplejar-1.0.pom @@ -0,0 +1,29 @@ + + + + 4.0.0 + org.apache.maven + C + 1.0 + Maven Test Repository Artifact Discovery + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/samplejar/2.0/samplejar-2.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/samplejar/2.0/samplejar-2.0.jar new file mode 100644 index 000000000..54d190b23 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/samplejar/2.0/samplejar-2.0.jar @@ -0,0 +1 @@ +dummy content. sample file only. diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/samplejar/2.0/samplejar-2.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/samplejar/2.0/samplejar-2.0.pom new file mode 100644 index 000000000..a959980df --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/samplejar/2.0/samplejar-2.0.pom @@ -0,0 +1,29 @@ + + + + 4.0.0 + org.apache.maven + C + 1.0 + Maven Test Repository Artifact Discovery + + jar + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/some-ejb/1.0/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/some-ejb/1.0/maven-metadata.xml new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/some-ejb/1.0/some-ejb-1.0-client.jar b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/some-ejb/1.0/some-ejb-1.0-client.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/test/1.0-SNAPSHOT/test-1.0-20050611.112233-1-javadoc.jar b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/test/1.0-SNAPSHOT/test-1.0-20050611.112233-1-javadoc.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/test/1.0-SNAPSHOT/test-1.0-20050611.112233-1.jar b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/test/1.0-SNAPSHOT/test-1.0-20050611.112233-1.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/test/1.0-SNAPSHOT/wrong-artifactId-1.0-20050611.112233-1.jar b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/test/1.0-SNAPSHOT/wrong-artifactId-1.0-20050611.112233-1.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/testing/1.0/testing-1.0-sources.jar b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/testing/1.0/testing-1.0-sources.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/testing/1.0/testing-1.0-test-sources.jar b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/testing/1.0/testing-1.0-test-sources.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/testing/1.0/testing-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/testing/1.0/testing-1.0.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/testing/1.0/testing-1.0.tar.gz b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/testing/1.0/testing-1.0.tar.gz new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/testing/1.0/testing-1.0.zip b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/testing/1.0/testing-1.0.zip new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/update/test-not-updated/1.0/test-not-updated-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/update/test-not-updated/1.0/test-not-updated-1.0.jar new file mode 100644 index 000000000..54d190b23 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/update/test-not-updated/1.0/test-not-updated-1.0.jar @@ -0,0 +1 @@ +dummy content. sample file only. diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/update/test-not-updated/1.0/test-not-updated-1.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/update/test-not-updated/1.0/test-not-updated-1.0.pom new file mode 100644 index 000000000..452727f28 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/update/test-not-updated/1.0/test-not-updated-1.0.pom @@ -0,0 +1,29 @@ + + + + 4.0.0 + org.apache.maven.update + test-not-updated + 1.0 + Maven Test Repository Artifact Discovery + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/update/test-not-updated/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/update/test-not-updated/maven-metadata.xml new file mode 100644 index 000000000..bd56a21c1 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/update/test-not-updated/maven-metadata.xml @@ -0,0 +1,24 @@ + + + + + org.apache.maven.update + test-not-updated + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/update/test-updated/1.0/test-updated-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/update/test-updated/1.0/test-updated-1.0.jar new file mode 100644 index 000000000..54d190b23 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/update/test-updated/1.0/test-updated-1.0.jar @@ -0,0 +1 @@ +dummy content. sample file only. diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/update/test-updated/1.0/test-updated-1.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/update/test-updated/1.0/test-updated-1.0.pom new file mode 100644 index 000000000..edd7b6479 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/update/test-updated/1.0/test-updated-1.0.pom @@ -0,0 +1,29 @@ + + + + 4.0.0 + org.apache.maven.update + test-updated + 1.0 + Maven Test Repository Artifact Discovery + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/update/test-updated/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/update/test-updated/maven-metadata.xml new file mode 100644 index 000000000..86e063ca8 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/maven/update/test-updated/maven-metadata.xml @@ -0,0 +1,24 @@ + + + + + org.apache.maven.update + test-updated + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/testgroup/discovery/1.0/discovery-1.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/testgroup/discovery/1.0/discovery-1.0.pom new file mode 100644 index 000000000..12538e81a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/testgroup/discovery/1.0/discovery-1.0.pom @@ -0,0 +1,28 @@ + + + + 4.0.0 + org.apache.testgroup + discovery + 1.0 + Maven Test Repository Artifact Discovery + pom + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/testgroup/discovery/1.0/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/testgroup/discovery/1.0/maven-metadata.xml new file mode 100644 index 000000000..8ee18048c --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/testgroup/discovery/1.0/maven-metadata.xml @@ -0,0 +1,25 @@ + + + + + org.apache.testgroup + discovery + 1.0 + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/testgroup/discovery/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/testgroup/discovery/maven-metadata.xml new file mode 100644 index 000000000..b024ef7ef --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/repository/org/apache/testgroup/discovery/maven-metadata.xml @@ -0,0 +1,24 @@ + + + + + org.apache.testgroup + discovery + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/resources/checksums/artifact.jar b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/resources/checksums/artifact.jar new file mode 100644 index 000000000..d1b610e5e Binary files /dev/null and b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/resources/checksums/artifact.jar differ diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/resources/checksums/artifact.jar.md5-bad b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/resources/checksums/artifact.jar.md5-bad new file mode 100644 index 000000000..aafbb1c77 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/resources/checksums/artifact.jar.md5-bad @@ -0,0 +1 @@ +444ccc111aaa222999888eee222fff00 artifact.jar diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/resources/checksums/artifact.jar.md5-good b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/resources/checksums/artifact.jar.md5-good new file mode 100644 index 000000000..1c8465238 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/resources/checksums/artifact.jar.md5-good @@ -0,0 +1 @@ +360ccd01d8a0a2d94b86f9802c2fc548 artifact.jar diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/resources/checksums/artifact.jar.sha1-bad b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/resources/checksums/artifact.jar.sha1-bad new file mode 100644 index 000000000..2d809c29b --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/resources/checksums/artifact.jar.sha1-bad @@ -0,0 +1 @@ +ddd888999000444888bbbaaa555333999777eee0 artifact.jar diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/resources/checksums/artifact.jar.sha1-good b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/resources/checksums/artifact.jar.sha1-good new file mode 100644 index 000000000..0f10d257e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/resources/checksums/artifact.jar.sha1-good @@ -0,0 +1 @@ +7dd8929150664f182db60ad15f20359d875f059f artifact.jar diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/resources/org/apache/maven/archiva/common/consumers/GenericArtifactConsumerTest.xml b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/resources/org/apache/maven/archiva/common/consumers/GenericArtifactConsumerTest.xml new file mode 100644 index 000000000..5760e8918 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/resources/org/apache/maven/archiva/common/consumers/GenericArtifactConsumerTest.xml @@ -0,0 +1,34 @@ + + + + + + + org.apache.maven.archiva.common.consumers.Consumer + mock-artifact + org.apache.maven.archiva.common.consumers.MockArtifactConsumer + + + org.apache.maven.artifact.factory.ArtifactFactory + + + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/resources/org/apache/maven/archiva/common/consumers/GenericModelConsumerTest.xml b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/resources/org/apache/maven/archiva/common/consumers/GenericModelConsumerTest.xml new file mode 100644 index 000000000..2ded1b62d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/resources/org/apache/maven/archiva/common/consumers/GenericModelConsumerTest.xml @@ -0,0 +1,34 @@ + + + + + + + org.apache.maven.archiva.discoverer.DiscovererConsumer + mock-model + org.apache.maven.archiva.discoverer.consumers.MockModelConsumer + + + org.apache.maven.artifact.factory.ArtifactFactory + + + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/resources/org/apache/maven/archiva/common/consumers/GenericRepositoryMetadataConsumerTest.xml b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/resources/org/apache/maven/archiva/common/consumers/GenericRepositoryMetadataConsumerTest.xml new file mode 100644 index 000000000..da9864d00 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-common/src/test/resources/org/apache/maven/archiva/common/consumers/GenericRepositoryMetadataConsumerTest.xml @@ -0,0 +1,34 @@ + + + + + + + org.apache.maven.archiva.discoverer.DiscovererConsumer + mock-metadata + org.apache.maven.archiva.discoverer.consumers.MockRepositoryMetadataConsumer + + + org.apache.maven.artifact.factory.ArtifactFactory + + + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-configuration/pom.xml b/MRM-541/archiva-modules/archiva-base/archiva-configuration/pom.xml new file mode 100644 index 000000000..2999766b9 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-configuration/pom.xml @@ -0,0 +1,99 @@ + + + + + + org.apache.archiva + archiva-base + 1.2-SNAPSHOT + + 4.0.0 + archiva-configuration + Archiva Base :: Configuration + + + org.codehaus.plexus + plexus-spring + test + + + org.codehaus.plexus.registry + plexus-registry-api + + + org.codehaus.plexus.registry + plexus-registry-commons + + + org.codehaus.plexus + plexus-expression-evaluator + + + commons-io + commons-io + + + org.apache.archiva + archiva-policies + + + xmlunit + xmlunit + test + + + + + + org.codehaus.modello + modello-maven-plugin + 1.0-alpha-15 + + + + java + registry-reader + registry-writer + + + + + 1.2.0 + src/main/mdo/configuration.mdo + + + + org.codehaus.mojo + cobertura-maven-plugin + + + + + org/apache/maven/archiva/configuration/io/** + org/apache/maven/archiva/configuration/*RepositoryConfiguration.* + org/apache/maven/archiva/configuration/Configuration.* + org/apache/maven/archiva/configuration/Proxy.* + + + + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/ArchivaConfiguration.java b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/ArchivaConfiguration.java new file mode 100644 index 000000000..0705fd654 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/ArchivaConfiguration.java @@ -0,0 +1,82 @@ +package org.apache.maven.archiva.configuration; + +/* + * 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.codehaus.plexus.registry.RegistryException; +import org.codehaus.plexus.registry.RegistryListener; + +/** + * Configuration holder for the model read from the registry. + */ +public interface ArchivaConfiguration +{ + String ROLE = ArchivaConfiguration.class.getName(); + + /** + * Get the configuration. + * + * @return the configuration + */ + Configuration getConfiguration(); + + /** + * Save any updated configuration. + * + * @param configuration the configuration to save + * @throws org.codehaus.plexus.registry.RegistryException + * if there is a problem saving the registry data + * @throws IndeterminateConfigurationException + * if the configuration cannot be saved because it was read from two sources + */ + void save( Configuration configuration ) + throws RegistryException, IndeterminateConfigurationException; + + /** + * Determines if the configuration in use was as a result of a defaulted configuration. + * + * @return true if the configuration was created from the default-archiva.xml as opposed + * to being loaded from the usual locations of ${user.home}/.m2/archiva.xml or + * ${appserver.base}/conf/archiva.xml + */ + boolean isDefaulted(); + + /** + * Add a configuration listener to notify of changes to the configuration. + * + * @param listener the listener + */ + void addListener( ConfigurationListener listener ); + + /** + * Remove a configuration listener to stop notifications of changes to the configuration. + * + * @param listener the listener + */ + void removeListener( ConfigurationListener listener ); + + /** + * Add a registry listener to notify of events in plexus-registry. + * + * @param listener the listener + * TODO: Remove in future. + */ + void addChangeListener( RegistryListener listener ); +} + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/ConfigurationEvent.java b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/ConfigurationEvent.java new file mode 100644 index 000000000..3105ee96e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/ConfigurationEvent.java @@ -0,0 +1,77 @@ +package org.apache.maven.archiva.configuration; + +/* + * 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. + */ + +/** + * ConfigurationEvent + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ConfigurationEvent +{ + public static final int SAVED = 1; + + public static final int CHANGED = 2; + + private int type; + + public ConfigurationEvent( int type ) + { + this.type = type; + } + + public int getType() + { + return type; + } + + @Override + public int hashCode() + { + final int prime = 31; + int result = 1; + result = prime * result + type; + 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 ConfigurationEvent other = (ConfigurationEvent) obj; + if ( type != other.type ) + { + return false; + } + return true; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/ConfigurationListener.java b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/ConfigurationListener.java new file mode 100644 index 000000000..f02637c83 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/ConfigurationListener.java @@ -0,0 +1,34 @@ +package org.apache.maven.archiva.configuration; + +/* + * 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. + */ + +/** + * ConfigurationListener + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public interface ConfigurationListener +{ + /** + * Generic event point to notify components that something has happend in the configuration. + */ + public void configurationEvent(ConfigurationEvent event); +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/ConfigurationNames.java b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/ConfigurationNames.java new file mode 100644 index 000000000..e1daac902 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/ConfigurationNames.java @@ -0,0 +1,69 @@ +package org.apache.maven.archiva.configuration; + +/* + * 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. + */ + +/** + * Utility methods for testing the configuration property name. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ConfigurationNames +{ + public static boolean isNetworkProxy( String propertyName ) + { + return startsWith( "networkProxies.", propertyName ); + } + + public static boolean isRepositoryScanning( String propertyName ) + { + return startsWith( "repositoryScanning.", propertyName ); + } + + public static boolean isManagedRepositories( String propertyName ) + { + return startsWith( "managedRepositories.", propertyName ); + } + + public static boolean isRemoteRepositories( String propertyName ) + { + return startsWith( "remoteRepositories.", propertyName ); + } + + public static boolean isProxyConnector( String propertyName ) + { + return startsWith( "proxyConnectors.", propertyName ); + } + + private static boolean startsWith( String prefix, String name ) + { + if ( name == null ) + { + return false; + } + + if ( name.length() <= 0 ) + { + return false; + } + + return name.startsWith( prefix ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/ConfigurationRuntimeException.java b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/ConfigurationRuntimeException.java new file mode 100644 index 000000000..5fc44f80d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/ConfigurationRuntimeException.java @@ -0,0 +1,32 @@ +package org.apache.maven.archiva.configuration; + +/* + * 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. + */ + +/** + * Unrecoverable exception in the configuration mechanism that is the result of a programming error. + */ +public class ConfigurationRuntimeException + extends RuntimeException +{ + public ConfigurationRuntimeException( String msg, Throwable cause ) + { + super( msg, cause ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/DefaultArchivaConfiguration.java b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/DefaultArchivaConfiguration.java new file mode 100644 index 000000000..af3180d13 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/DefaultArchivaConfiguration.java @@ -0,0 +1,736 @@ +package org.apache.maven.archiva.configuration; + +/* + * 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.collections.CollectionUtils; +import org.apache.commons.collections.MapUtils; +import org.apache.commons.io.FileUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.maven.archiva.configuration.functors.ProxyConnectorConfigurationOrderComparator; +import org.apache.maven.archiva.configuration.io.registry.ConfigurationRegistryReader; +import org.apache.maven.archiva.configuration.io.registry.ConfigurationRegistryWriter; +import org.apache.maven.archiva.policies.AbstractUpdatePolicy; +import org.apache.maven.archiva.policies.CachedFailuresPolicy; +import org.apache.maven.archiva.policies.ChecksumPolicy; +import org.apache.maven.archiva.policies.Policy; +import org.apache.maven.archiva.policies.PostDownloadPolicy; +import org.apache.maven.archiva.policies.PreDownloadPolicy; +import org.codehaus.plexus.evaluator.DefaultExpressionEvaluator; +import org.codehaus.plexus.evaluator.EvaluatorException; +import org.codehaus.plexus.evaluator.ExpressionEvaluator; +import org.codehaus.plexus.evaluator.sources.SystemPropertyExpressionSource; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException; +import org.codehaus.plexus.registry.Registry; +import org.codehaus.plexus.registry.RegistryException; +import org.codehaus.plexus.registry.RegistryListener; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + *

+ * Implementation of configuration holder that retrieves it from the registry. + *

+ *

+ * The registry layers and merges the 2 configuration files: user, and application server. + *

+ *

+ * Instead of relying on the model defaults, if the registry is empty a default configuration file is loaded and + * applied from a resource. The defaults are not loaded into the registry as the lists (eg repositories) could no longer + * be removed if that was the case. + *

+ *

+ * When saving the configuration, it is saved to the location it was read from. If it was read from the defaults, it + * will be saved to the user location. + * However, if the configuration contains information from both sources, an exception is raised as this is currently + * unsupported. The reason for this is that it is not possible to identify where to re-save elements, and can result + * in list configurations (eg repositories) becoming inconsistent. + *

+ *

+ * If the configuration is outdated, it will be upgraded when it is loaded. This is done by checking the version flag + * before reading it from the registry. + *

+ * + * @plexus.component role="org.apache.maven.archiva.configuration.ArchivaConfiguration" + */ +public class DefaultArchivaConfiguration + implements ArchivaConfiguration, RegistryListener, Initializable +{ + private Logger log = LoggerFactory.getLogger( DefaultArchivaConfiguration.class ); + + /** + * Plexus registry to read the configuration from. + * + * @plexus.requirement role-hint="commons-configuration" + */ + private Registry registry; + + /** + * The configuration that has been converted. + */ + private Configuration configuration; + + /** + * @plexus.requirement role="org.apache.maven.archiva.policies.PreDownloadPolicy" + * @todo these don't strictly belong in here + */ + private Map prePolicies; + + /** + * @plexus.requirement role="org.apache.maven.archiva.policies.PostDownloadPolicy" + * @todo these don't strictly belong in here + */ + private Map postPolicies; + + /** + * @plexus.configuration default-value="${user.home}/.m2/archiva.xml" + */ + private String userConfigFilename; + + /** + * @plexus.configuration default-value="${appserver.base}/conf/archiva.xml" + */ + private String altConfigFilename; + + /** + * Configuration Listeners we've registered. + */ + private Set listeners = new HashSet(); + + /** + * Registry Listeners we've registered. + */ + private Set registryListeners = new HashSet(); + + /** + * Boolean to help determine if the configuration exists as a result of pulling in + * the default-archiva.xml + */ + private boolean isConfigurationDefaulted = false; + + private static final String KEY = "org.apache.maven.archiva"; + + public synchronized Configuration getConfiguration() + { + if ( configuration == null ) + { + configuration = load(); + configuration = unescapeExpressions( configuration ); + if( isConfigurationDefaulted ) + { + configuration = checkRepositoryLocations( configuration ); + } + } + + return configuration; + } + + private Configuration load() + { + // TODO: should this be the same as section? make sure unnamed sections still work (eg, sys properties) + Registry subset = registry.getSubset( KEY ); + if ( subset.getString( "version" ) == null ) + { + // a little autodetection of v1, even if version is omitted (this was previously allowed) + if ( subset.getSubset( "repositoryScanning" ).isEmpty() ) + { + // only for empty, or v < 1 + subset = readDefaultConfiguration(); + } + } + + Configuration config = new ConfigurationRegistryReader().read( subset ); + + if ( !config.getRepositories().isEmpty() ) + { + for ( Iterator i = config.getRepositories().iterator(); i.hasNext(); ) + { + V1RepositoryConfiguration r = i.next(); + r.setScanned( r.isIndexed() ); + + if ( r.getUrl().startsWith( "file://" ) ) + { + r.setLocation( r.getUrl().substring( 7 ) ); + config.addManagedRepository( r ); + } + else if ( r.getUrl().startsWith( "file:" ) ) + { + r.setLocation( r.getUrl().substring( 5 ) ); + config.addManagedRepository( r ); + } + else + { + RemoteRepositoryConfiguration repo = new RemoteRepositoryConfiguration(); + repo.setId( r.getId() ); + repo.setLayout( r.getLayout() ); + repo.setName( r.getName() ); + repo.setUrl( r.getUrl() ); + config.addRemoteRepository( repo ); + } + } + + // Prevent duplicate repositories from showing up. + config.getRepositories().clear(); + + registry.removeSubset( KEY + ".repositories" ); + } + + if ( !CollectionUtils.isEmpty( config.getRemoteRepositories() ) ) + { + List remoteRepos = config.getRemoteRepositories(); + for ( RemoteRepositoryConfiguration repo : remoteRepos ) + { + // [MRM-582] Remote Repositories with empty and fields shouldn't be created in configuration. + if ( StringUtils.isBlank( repo.getUsername() ) ) + { + repo.setUsername( null ); + } + + if ( StringUtils.isBlank( repo.getPassword() ) ) + { + repo.setPassword( null ); + } + } + } + + if ( !config.getProxyConnectors().isEmpty() ) + { + // Fix Proxy Connector Settings. + + List proxyConnectorList = new ArrayList(); + // Create a copy of the list to read from (to prevent concurrent modification exceptions) + proxyConnectorList.addAll( config.getProxyConnectors() ); + // Remove the old connector list. + config.getProxyConnectors().clear(); + + for ( ProxyConnectorConfiguration connector : proxyConnectorList ) + { + // Fix policies + boolean connectorValid = true; + + Map policies = new HashMap(); + // Make copy of policies + policies.putAll( connector.getPolicies() ); + // Clear out policies + connector.getPolicies().clear(); + + // Work thru policies. cleaning them up. + for ( Entry entry : policies.entrySet() ) + { + String policyId = entry.getKey(); + String setting = entry.getValue(); + + // Upgrade old policy settings. + if ( "releases".equals( policyId ) || "snapshots".equals( policyId ) ) + { + if ( "ignored".equals( setting ) ) + { + setting = AbstractUpdatePolicy.ALWAYS; + } + else if ( "disabled".equals( setting ) ) + { + setting = AbstractUpdatePolicy.NEVER; + } + } + else if ( "cache-failures".equals( policyId ) ) + { + if ( "ignored".equals( setting ) ) + { + setting = CachedFailuresPolicy.NO; + } + else if ( "cached".equals( setting ) ) + { + setting = CachedFailuresPolicy.YES; + } + } + else if ( "checksum".equals( policyId ) ) + { + if ( "ignored".equals( setting ) ) + { + setting = ChecksumPolicy.IGNORE; + } + } + + // Validate existance of policy key. + if ( policyExists( policyId ) ) + { + Policy policy = findPolicy( policyId ); + // Does option exist? + if ( !policy.getOptions().contains( setting ) ) + { + setting = policy.getDefaultOption(); + } + connector.addPolicy( policyId, setting ); + } + else + { + // Policy key doesn't exist. Don't add it to golden version. + log.warn( "Policy [" + policyId + "] does not exist." ); + } + } + + if ( connectorValid ) + { + config.addProxyConnector( connector ); + } + } + + // Normalize the order fields in the proxy connectors. + Map> proxyConnectorMap = config + .getProxyConnectorAsMap(); + + for ( String key : proxyConnectorMap.keySet() ) + { + List connectors = proxyConnectorMap.get( key ); + // Sort connectors by order field. + Collections.sort( connectors, ProxyConnectorConfigurationOrderComparator.getInstance() ); + + // Normalize the order field values. + int order = 1; + for ( ProxyConnectorConfiguration connector : connectors ) + { + connector.setOrder( order++ ); + } + } + } + + return config; + } + + private Policy findPolicy( String policyId ) + { + if ( MapUtils.isEmpty( prePolicies ) ) + { + log.error( "No PreDownloadPolicies found!" ); + return null; + } + + if ( MapUtils.isEmpty( postPolicies ) ) + { + log.error( "No PostDownloadPolicies found!" ); + return null; + } + + Policy policy; + + policy = prePolicies.get( policyId ); + if ( policy != null ) + { + return policy; + } + + policy = postPolicies.get( policyId ); + if ( policy != null ) + { + return policy; + } + + return null; + } + + private boolean policyExists( String policyId ) + { + if ( MapUtils.isEmpty( prePolicies ) ) + { + log.error( "No PreDownloadPolicies found!" ); + return false; + } + + if ( MapUtils.isEmpty( postPolicies ) ) + { + log.error( "No PostDownloadPolicies found!" ); + return false; + } + + return ( prePolicies.containsKey( policyId ) || postPolicies.containsKey( policyId ) ); + } + + private Registry readDefaultConfiguration() + { + // if it contains some old configuration, remove it (Archiva 0.9) + registry.removeSubset( KEY ); + + try + { + registry.addConfigurationFromResource( "org/apache/maven/archiva/configuration/default-archiva.xml", KEY ); + this.isConfigurationDefaulted = true; + } + catch ( RegistryException e ) + { + throw new ConfigurationRuntimeException( + "Fatal error: Unable to find the built-in default configuration and load it into the registry", + e ); + } + return registry.getSubset( KEY ); + } + + public synchronized void save( Configuration configuration ) + throws RegistryException, IndeterminateConfigurationException + { + Registry section = registry.getSection( KEY + ".user" ); + Registry baseSection = registry.getSection( KEY + ".base" ); + if ( section == null ) + { + section = baseSection; + if ( section == null ) + { + section = createDefaultConfigurationFile(); + } + } + else if ( baseSection != null ) + { + Collection keys = baseSection.getKeys(); + boolean foundList = false; + for ( Iterator i = keys.iterator(); i.hasNext() && !foundList; ) + { + String key = i.next(); + + // a little aggressive with the repositoryScanning and databaseScanning - should be no need to split + // that configuration + if ( key.startsWith( "repositories" ) || key.startsWith( "proxyConnectors" ) + || key.startsWith( "networkProxies" ) || key.startsWith( "repositoryScanning" ) + || key.startsWith( "databaseScanning" ) || key.startsWith( "remoteRepositories" ) + || key.startsWith( "managedRepositories" ) || key.startsWith( "repositoryGroups" ) ) + { + foundList = true; + } + } + + if ( foundList ) + { + this.configuration = null; + + throw new IndeterminateConfigurationException( + "Configuration can not be saved when it is loaded from two sources" ); + } + } + + // escape all cron expressions to handle ',' + escapeCronExpressions( configuration ); + + // [MRM-661] Due to a bug in the modello registry writer, we need to take these out by hand. They'll be put back by the writer. + if ( configuration.getManagedRepositories().isEmpty() ) + { + section.removeSubset( "managedRepositories" ); + } + if ( configuration.getRemoteRepositories().isEmpty() ) + { + section.removeSubset( "remoteRepositories" ); + } + if ( configuration.getProxyConnectors().isEmpty() ) + { + section.removeSubset( "proxyConnectors" ); + } + if ( configuration.getNetworkProxies().isEmpty() ) + { + section.removeSubset( "networkProxies" ); + } + if ( configuration.getLegacyArtifactPaths().isEmpty() ) + { + section.removeSubset( "legacyArtifactPaths" ); + } + if ( configuration.getRepositoryGroups().isEmpty() ) + { + section.removeSubset( "repositoryGroups" ); + } + if ( configuration.getRepositoryScanning() != null ) + { + if ( configuration.getRepositoryScanning().getKnownContentConsumers().isEmpty() ) + { + section.removeSubset( "repositoryScanning.knownContentConsumers" ); + } + if ( configuration.getRepositoryScanning().getInvalidContentConsumers().isEmpty() ) + { + section.removeSubset( "repositoryScanning.invalidContentConsumers" ); + } + } + if ( configuration.getDatabaseScanning() != null ) + { + if ( configuration.getDatabaseScanning().getCleanupConsumers().isEmpty() ) + { + section.removeSubset( "databaseScanning.cleanupConsumers" ); + } + if ( configuration.getDatabaseScanning().getUnprocessedConsumers().isEmpty() ) + { + section.removeSubset( "databaseScanning.unprocessedConsumers" ); + } + } + + new ConfigurationRegistryWriter().write( configuration, section ); + section.save(); + + this.configuration = unescapeExpressions( configuration ); + + triggerEvent( ConfigurationEvent.SAVED ); + } + + private void escapeCronExpressions( Configuration configuration ) + { + for ( ManagedRepositoryConfiguration c : (List) configuration.getManagedRepositories() ) + { + c.setRefreshCronExpression( escapeCronExpression( c.getRefreshCronExpression() ) ); + } + + DatabaseScanningConfiguration scanning = configuration.getDatabaseScanning(); + if ( scanning != null ) + { + scanning.setCronExpression( escapeCronExpression( scanning.getCronExpression() ) ); + } + } + + private Registry createDefaultConfigurationFile() + throws RegistryException + { + // TODO: may not be needed under commons-configuration 1.4 - check + // UPDATE: Upgrading to commons-configuration 1.4 breaks half the unit tests. 2007-10-11 (joakime) + + String contents = ""; + if ( !writeFile( "user configuration", userConfigFilename, contents ) ) + { + if ( !writeFile( "alternative configuration", altConfigFilename, contents ) ) + { + throw new RegistryException( "Unable to create configuration file in either user [" + + userConfigFilename + "] or alternative [" + altConfigFilename + + "] locations on disk, usually happens when not allowed to write to those locations." ); + } + } + + try + { + ( (Initializable) registry ).initialize(); + + for ( RegistryListener regListener : registryListeners ) + { + addRegistryChangeListener( regListener ); + } + } + catch ( InitializationException e ) + { + throw new RegistryException( "Unable to reinitialize configuration: " + e.getMessage(), e ); + } + + triggerEvent( ConfigurationEvent.SAVED ); + + return registry.getSection( KEY + ".user" ); + } + + /** + * Attempts to write the contents to a file, if an IOException occurs, return false. + * + * The file will be created if the directory to the file exists, otherwise this will return false. + * + * @param filetype the filetype (freeform text) to use in logging messages when failure to write. + * @param path the path to write to. + * @param contents the contents to write. + * @return true if write successful. + */ + private boolean writeFile( String filetype, String path, String contents ) + { + File file = new File( path ); + + try + { + // Check parent directory (if it is declared) + if ( file.getParentFile() != null ) + { + // Check that directory exists + if ( ( file.getParentFile().exists() == false ) || ( file.getParentFile().isDirectory() == false ) ) + { + // Directory to file must exist for file to be created + return false; + } + } + + FileUtils.writeStringToFile( file, contents, "UTF-8" ); + return true; + } + catch ( IOException e ) + { + log.error( "Unable to create " + filetype + " file: " + e.getMessage(), e ); + return false; + } + } + + private void triggerEvent( int type ) + { + ConfigurationEvent evt = new ConfigurationEvent( type ); + for ( ConfigurationListener listener : listeners ) + { + listener.configurationEvent( evt ); + } + } + + public void addListener( ConfigurationListener listener ) + { + if ( listener == null ) + { + return; + } + + listeners.add( listener ); + } + + public void removeListener( ConfigurationListener listener ) + { + if ( listener == null ) + { + return; + } + + listeners.remove( listener ); + } + + public void addChangeListener( RegistryListener listener ) + { + addRegistryChangeListener( listener ); + + // keep track for later + registryListeners.add( listener ); + } + + private void addRegistryChangeListener( RegistryListener listener ) + { + Registry section = registry.getSection( KEY + ".user" ); + if ( section != null ) + { + section.addChangeListener( listener ); + } + section = registry.getSection( KEY + ".base" ); + if ( section != null ) + { + section.addChangeListener( listener ); + } + } + + public void initialize() + throws InitializationException + { + // Resolve expressions in the userConfigFilename and altConfigFilename + try + { + ExpressionEvaluator expressionEvaluator = new DefaultExpressionEvaluator(); + expressionEvaluator.addExpressionSource( new SystemPropertyExpressionSource() ); + userConfigFilename = expressionEvaluator.expand( userConfigFilename ); + altConfigFilename = expressionEvaluator.expand( altConfigFilename ); + } + catch ( EvaluatorException e ) + { + throw new InitializationException( "Unable to evaluate expressions found in " + + "userConfigFilename or altConfigFilename." ); + } + + registry.addChangeListener( this ); + } + + public void beforeConfigurationChange( Registry registry, String propertyName, Object propertyValue ) + { + // nothing to do here + } + + public synchronized void afterConfigurationChange( Registry registry, String propertyName, Object propertyValue ) + { + configuration = null; + } + + private String removeExpressions( String directory ) + { + String value = StringUtils.replace( directory, "${appserver.base}", registry.getString( "appserver.base", + "${appserver.base}" ) ); + value = StringUtils.replace( value, "${appserver.home}", registry.getString( "appserver.home", + "${appserver.home}" ) ); + return value; + } + + private String unescapeCronExpression( String cronExpression ) + { + return StringUtils.replace( cronExpression, "\\,", "," ); + } + + private String escapeCronExpression( String cronExpression ) + { + return StringUtils.replace( cronExpression, ",", "\\," ); + } + + private Configuration unescapeExpressions( Configuration config ) + { + // TODO: for commons-configuration 1.3 only + for ( Iterator i = config.getManagedRepositories().iterator(); i.hasNext(); ) + { + ManagedRepositoryConfiguration c = i.next(); + c.setLocation( removeExpressions( c.getLocation() ) ); + c.setRefreshCronExpression( unescapeCronExpression( c.getRefreshCronExpression() ) ); + } + + DatabaseScanningConfiguration databaseScanning = config.getDatabaseScanning(); + if ( databaseScanning != null ) + { + String cron = databaseScanning.getCronExpression(); + databaseScanning.setCronExpression( unescapeCronExpression( cron ) ); + } + + return config; + } + + private Configuration checkRepositoryLocations( Configuration config ) + { + // additional check for [MRM-789], ensure that the location of the default repositories + // are not installed in the server installation + for( ManagedRepositoryConfiguration repo : (List) config.getManagedRepositories() ) + { + String repoPath = repo.getLocation(); + File repoLocation = new File( repoPath ); + + if( repoLocation.exists() && repoLocation.isDirectory() && !repoPath.endsWith( "data/repositories/" + repo.getId() ) ) + { + repo.setLocation( repoPath + "/data/repositories/" + repo.getId() ); + } + } + + return config; + } + + public String getUserConfigFilename() + { + return userConfigFilename; + } + + public String getAltConfigFilename() + { + return altConfigFilename; + } + + public boolean isDefaulted() + { + return this.isConfigurationDefaulted; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/FileTypes.java b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/FileTypes.java new file mode 100644 index 000000000..66be709b6 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/FileTypes.java @@ -0,0 +1,252 @@ +package org.apache.maven.archiva.configuration; + +/* + * 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.lang.reflect.Field; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections.Predicate; +import org.apache.commons.configuration.CombinedConfiguration; +import org.apache.maven.archiva.common.utils.Slf4JPlexusLogger; +import org.apache.maven.archiva.configuration.functors.FiletypeSelectionPredicate; +import org.apache.maven.archiva.configuration.io.registry.ConfigurationRegistryReader; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException; +import org.codehaus.plexus.registry.Registry; +import org.codehaus.plexus.registry.RegistryException; +import org.codehaus.plexus.registry.RegistryListener; +import org.codehaus.plexus.registry.commons.CommonsConfigurationRegistry; +import org.codehaus.plexus.util.SelectorUtils; + +/** + * FileTypes + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component role="org.apache.maven.archiva.configuration.FileTypes" + */ +public class FileTypes + implements Initializable, RegistryListener +{ + public static final String ARTIFACTS = "artifacts"; + + public static final String AUTO_REMOVE = "auto-remove"; + + public static final String INDEXABLE_CONTENT = "indexable-content"; + + public static final String IGNORED = "ignored"; + + /** + * @plexus.requirement + */ + private ArchivaConfiguration archivaConfiguration; + + /** + * Map of default values for the file types. + */ + private Map> defaultTypeMap = new HashMap>(); + + private List artifactPatterns; + + /** + * Default exclusions from artifact consumers that are using the file types. Note that this is simplistic in the + * case of the support files (based on extension) as it is elsewhere - it may be better to match these to actual + * artifacts and exclude later during scanning. + */ + public static final List DEFAULT_EXCLUSIONS = Arrays.asList( "**/maven-metadata.xml", + "**/maven-metadata-*.xml", "**/*.sha1", + "**/*.asc", "**/*.md5", "**/*.pgp" ); + + public void setArchivaConfiguration( ArchivaConfiguration archivaConfiguration ) + { + this.archivaConfiguration = archivaConfiguration; + } + + /** + *

+ * Get the list of patterns for a specified filetype. + *

+ * + *

+ * You will always get a list. In this order. + *

    + *
  • The Configured List
  • + *
  • The Default List
  • + *
  • A single item list of "**/*"
  • + *
+ *

+ * + * @param id the id to lookup. + * @return the list of patterns. + */ + public List getFileTypePatterns( String id ) + { + Configuration config = archivaConfiguration.getConfiguration(); + Predicate selectedFiletype = new FiletypeSelectionPredicate( id ); + FileType filetype = (FileType) CollectionUtils.find( config.getRepositoryScanning().getFileTypes(), + selectedFiletype ); + + if ( ( filetype != null ) && CollectionUtils.isNotEmpty( filetype.getPatterns() ) ) + { + return filetype.getPatterns(); + } + + List defaultPatterns = defaultTypeMap.get( id ); + + if ( CollectionUtils.isEmpty( defaultPatterns ) ) + { + return Collections.singletonList( "**/*" ); + } + + return defaultPatterns; + } + + public synchronized boolean matchesArtifactPattern( String relativePath ) + { + // Correct the slash pattern. + relativePath = relativePath.replace( '\\', '/' ); + + if ( artifactPatterns == null ) + { + artifactPatterns = getFileTypePatterns( ARTIFACTS ); + } + + for ( String pattern : artifactPatterns ) + { + if ( SelectorUtils.matchPath( pattern, relativePath, false ) ) + { + // Found match + return true; + } + } + + // No match. + return false; + } + + public boolean matchesDefaultExclusions( String relativePath ) + { + // Correct the slash pattern. + relativePath = relativePath.replace( '\\', '/' ); + + for ( String pattern : DEFAULT_EXCLUSIONS ) + { + if ( SelectorUtils.matchPath( pattern, relativePath, false ) ) + { + // Found match + return true; + } + } + + // No match. + return false; + } + + public void initialize() + throws InitializationException + { + // TODO: why is this done by hand? + + // TODO: ideally, this would be instantiated by configuration instead, and not need to be a component + + String errMsg = "Unable to load default archiva configuration for FileTypes: "; + + try + { + CommonsConfigurationRegistry commonsRegistry = new CommonsConfigurationRegistry(); + + // Configure commonsRegistry + Field fld = commonsRegistry.getClass().getDeclaredField( "configuration" ); + fld.setAccessible( true ); + fld.set( commonsRegistry, new CombinedConfiguration() ); + commonsRegistry.enableLogging( new Slf4JPlexusLogger( FileTypes.class ) ); + commonsRegistry.addConfigurationFromResource( "org/apache/maven/archiva/configuration/default-archiva.xml" ); + + // Read configuration as it was intended. + ConfigurationRegistryReader configReader = new ConfigurationRegistryReader(); + Configuration defaultConfig = configReader.read( commonsRegistry ); + + initialiseTypeMap( defaultConfig ); + } + catch ( RegistryException e ) + { + throw new InitializationException( errMsg + e.getMessage(), e ); + } + catch ( SecurityException e ) + { + throw new InitializationException( errMsg + e.getMessage(), e ); + } + catch ( NoSuchFieldException e ) + { + throw new InitializationException( errMsg + e.getMessage(), e ); + } + catch ( IllegalArgumentException e ) + { + throw new InitializationException( errMsg + e.getMessage(), e ); + } + catch ( IllegalAccessException e ) + { + throw new InitializationException( errMsg + e.getMessage(), e ); + } + + this.archivaConfiguration.addChangeListener( this ); + } + + private void initialiseTypeMap( Configuration configuration ) + { + defaultTypeMap.clear(); + + // Store the default file type declaration. + List filetypes = configuration.getRepositoryScanning().getFileTypes(); + for ( FileType filetype : filetypes ) + { + List patterns = defaultTypeMap.get( filetype.getId() ); + if ( patterns == null ) + { + patterns = new ArrayList(); + } + patterns.addAll( filetype.getPatterns() ); + + defaultTypeMap.put( filetype.getId(), patterns ); + } + } + + public void afterConfigurationChange( Registry registry, String propertyName, Object propertyValue ) + { + if ( propertyName.contains( "fileType" ) ) + { + artifactPatterns = null; + + initialiseTypeMap( archivaConfiguration.getConfiguration() ); + } + } + + public void beforeConfigurationChange( Registry registry, String propertyName, Object propertyValue ) + { + /* nothing to do */ + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/IndeterminateConfigurationException.java b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/IndeterminateConfigurationException.java new file mode 100644 index 000000000..97d5fbdf2 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/IndeterminateConfigurationException.java @@ -0,0 +1,32 @@ +package org.apache.maven.archiva.configuration; + +/* + * 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. + */ + +/** + * Occurs when the configuration is stored in two locations and the save location can not be determined. + */ +public class IndeterminateConfigurationException + extends Exception +{ + public IndeterminateConfigurationException( String message ) + { + super( message ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/InvalidConfigurationException.java b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/InvalidConfigurationException.java new file mode 100644 index 000000000..0efcde250 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/InvalidConfigurationException.java @@ -0,0 +1,49 @@ +package org.apache.maven.archiva.configuration; + +/* + * 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. + */ + +/** + * An error in the configuration. + * + * @author Brett Porter + */ +public class InvalidConfigurationException + extends Exception +{ + private final String name; + + public InvalidConfigurationException( String name, String message ) + { + super( message ); + this.name = name; + } + + public InvalidConfigurationException( String name, String message, Throwable cause ) + { + super( message, cause ); + + this.name = name; + } + + public String getName() + { + return name; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/MavenProxyPropertyLoader.java b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/MavenProxyPropertyLoader.java new file mode 100644 index 000000000..e48b2d39a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/MavenProxyPropertyLoader.java @@ -0,0 +1,154 @@ +package org.apache.maven.archiva.configuration; + +/* + * 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.maven.archiva.policies.ReleasesPolicy; +import org.apache.maven.archiva.policies.SnapshotsPolicy; + +import java.io.IOException; +import java.io.InputStream; +import java.util.Enumeration; +import java.util.Properties; +import java.util.StringTokenizer; + +/** + * @author Ben Walding + * @author Brett Porter + */ +public class MavenProxyPropertyLoader +{ + private static final String REPO_LOCAL_STORE = "repo.local.store"; + + private static final String PROXY_LIST = "proxy.list"; + + private static final String REPO_LIST = "repo.list"; + + public void load( Properties props, Configuration configuration ) + throws InvalidConfigurationException + { + // set up the managed repository + String localCachePath = getMandatoryProperty( props, REPO_LOCAL_STORE ); + + ManagedRepositoryConfiguration config = new ManagedRepositoryConfiguration(); + config.setLocation( localCachePath ); + config.setName( "Imported Maven-Proxy Cache" ); + config.setId( "maven-proxy" ); + config.setScanned( false ); + config.setReleases( true ); + config.setSnapshots( false ); + configuration.addManagedRepository( config ); + + // Add the network proxies. + String propertyList = props.getProperty( PROXY_LIST ); + if ( propertyList != null ) + { + StringTokenizer tok = new StringTokenizer( propertyList, "," ); + while ( tok.hasMoreTokens() ) + { + String key = tok.nextToken(); + if ( StringUtils.isNotEmpty( key ) ) + { + NetworkProxyConfiguration proxy = new NetworkProxyConfiguration(); + proxy.setHost( getMandatoryProperty( props, "proxy." + key + ".host" ) ); + proxy.setPort( Integer.parseInt( getMandatoryProperty( props, "proxy." + key + ".port" ) ) ); + + // the username and password isn't required + proxy.setUsername( props.getProperty( "proxy." + key + ".username" ) ); + proxy.setPassword( props.getProperty( "proxy." + key + ".password" ) ); + + configuration.addNetworkProxy( proxy ); + } + } + } + + // Add the remote repository list + String repoList = getMandatoryProperty( props, REPO_LIST ); + + StringTokenizer tok = new StringTokenizer( repoList, "," ); + while ( tok.hasMoreTokens() ) + { + String key = tok.nextToken(); + + Properties repoProps = getSubset( props, "repo." + key + "." ); + String url = getMandatoryProperty( props, "repo." + key + ".url" ); + String proxyKey = repoProps.getProperty( "proxy" ); + + int cachePeriod = Integer.parseInt( repoProps.getProperty( "cache.period", "60" ) ); + + RemoteRepositoryConfiguration repository = new RemoteRepositoryConfiguration(); + repository.setId( key ); + repository.setName( "Imported Maven-Proxy Remote Proxy" ); + repository.setUrl( url ); + repository.setLayout( "legacy" ); + + configuration.addRemoteRepository( repository ); + + ProxyConnectorConfiguration proxyConnector = new ProxyConnectorConfiguration(); + proxyConnector.setSourceRepoId( "maven-proxy" ); + proxyConnector.setTargetRepoId( key ); + proxyConnector.setProxyId( proxyKey ); + // TODO: convert cachePeriod to closest "daily" or "hourly" + proxyConnector.addPolicy( ProxyConnectorConfiguration.POLICY_SNAPSHOTS, SnapshotsPolicy.DAILY ); + proxyConnector.addPolicy( ProxyConnectorConfiguration.POLICY_RELEASES, ReleasesPolicy.ALWAYS ); + + configuration.addProxyConnector( proxyConnector ); + } + } + + @SuppressWarnings("unchecked") + private Properties getSubset( Properties props, String prefix ) + { + Enumeration keys = props.keys(); + Properties result = new Properties(); + while ( keys.hasMoreElements() ) + { + String key = (String) keys.nextElement(); + String value = props.getProperty( key ); + if ( key.startsWith( prefix ) ) + { + String newKey = key.substring( prefix.length() ); + result.setProperty( newKey, value ); + } + } + return result; + } + + public void load( InputStream is, Configuration configuration ) + throws IOException, InvalidConfigurationException + { + Properties props = new Properties(); + props.load( is ); + load( props, configuration ); + } + + private String getMandatoryProperty( Properties props, String key ) + throws InvalidConfigurationException + { + String value = props.getProperty( key ); + + if ( value == null ) + { + throw new InvalidConfigurationException( key, "Missing required field: " + key ); + } + + return value; + } +} \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/functors/FiletypeSelectionPredicate.java b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/functors/FiletypeSelectionPredicate.java new file mode 100644 index 000000000..cfbe58fbe --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/functors/FiletypeSelectionPredicate.java @@ -0,0 +1,55 @@ +package org.apache.maven.archiva.configuration.functors; + +/* + * 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.collections.Predicate; +import org.apache.commons.lang.StringUtils; +import org.apache.maven.archiva.configuration.FileType; + +/** + * FiletypeSelectionPredicate + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class FiletypeSelectionPredicate + implements Predicate +{ + private String filetypeId; + + public FiletypeSelectionPredicate( String id ) + { + this.filetypeId = id; + } + + public boolean evaluate( Object object ) + { + boolean satisfies = false; + + if ( object instanceof FileType ) + { + FileType filetype = (FileType) object; + return ( StringUtils.equals( filetypeId, filetype.getId() ) ); + } + + return satisfies; + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/functors/FiletypeToMapClosure.java b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/functors/FiletypeToMapClosure.java new file mode 100644 index 000000000..96f15ab2a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/functors/FiletypeToMapClosure.java @@ -0,0 +1,52 @@ +package org.apache.maven.archiva.configuration.functors; + +/* + * 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.collections.Closure; +import org.apache.maven.archiva.configuration.FileType; + +import java.util.HashMap; +import java.util.Map; + +/** + * FiletypeToMapClosure + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class FiletypeToMapClosure + implements Closure +{ + private Map map = new HashMap(); + + public void execute( Object input ) + { + if ( input instanceof FileType ) + { + FileType filetype = (FileType) input; + map.put( filetype.getId(), filetype ); + } + } + + public Map getMap() + { + return map; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/functors/NetworkProxyComparator.java b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/functors/NetworkProxyComparator.java new file mode 100644 index 000000000..aebc924ba --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/functors/NetworkProxyComparator.java @@ -0,0 +1,56 @@ +package org.apache.maven.archiva.configuration.functors; + +/* + * 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.archiva.configuration.NetworkProxyConfiguration; + +import java.util.Comparator; + +/** + * NetworkProxyComparator + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class NetworkProxyComparator + implements Comparator +{ + public int compare( NetworkProxyConfiguration o1, NetworkProxyConfiguration o2 ) + { + if ( o1 == null && o2 == null ) + { + return 0; + } + + if ( o1 == null && o2 != null ) + { + return 1; + } + + if ( o1 != null && o2 == null ) + { + return -1; + } + + String id1 = o1.getId(); + String id2 = o2.getId(); + return id1.compareToIgnoreCase( id2 ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/functors/NetworkProxySelectionPredicate.java b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/functors/NetworkProxySelectionPredicate.java new file mode 100644 index 000000000..b89828307 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/functors/NetworkProxySelectionPredicate.java @@ -0,0 +1,54 @@ +package org.apache.maven.archiva.configuration.functors; + +/* + * 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.collections.Predicate; +import org.apache.commons.lang.StringUtils; +import org.apache.maven.archiva.configuration.NetworkProxyConfiguration; + +/** + * NetworkProxySelectionPredicate + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class NetworkProxySelectionPredicate + implements Predicate +{ + private String proxyId; + + public NetworkProxySelectionPredicate( String id ) + { + this.proxyId = id; + } + + public boolean evaluate( Object object ) + { + boolean satisfies = false; + + if ( object instanceof NetworkProxyConfiguration ) + { + NetworkProxyConfiguration proxy = (NetworkProxyConfiguration) object; + return ( StringUtils.equals( proxyId, proxy.getId() ) ); + } + + return satisfies; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/functors/ProxyConnectorConfigurationOrderComparator.java b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/functors/ProxyConnectorConfigurationOrderComparator.java new file mode 100644 index 000000000..6c6cffe6f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/functors/ProxyConnectorConfigurationOrderComparator.java @@ -0,0 +1,73 @@ +package org.apache.maven.archiva.configuration.functors; + +/* + * 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.archiva.configuration.ProxyConnectorConfiguration; + +import java.util.Comparator; + +/** + * ProxyConnectorConfigurationOrderComparator + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ProxyConnectorConfigurationOrderComparator + implements Comparator +{ + private static ProxyConnectorConfigurationOrderComparator INSTANCE = new ProxyConnectorConfigurationOrderComparator(); + + public int compare( ProxyConnectorConfiguration o1, ProxyConnectorConfiguration o2 ) + { + if ( o1 == null && o2 == null ) + { + return 0; + } + + // Ensure null goes to end of list. + if ( o1 == null && o2 != null ) + { + return 1; + } + + if ( o1 != null && o2 == null ) + { + return -1; + } + + // Ensure 0 (unordered) goes to end of list. + if ( o1.getOrder() == 0 && o2.getOrder() != 0 ) + { + return 1; + } + + if ( o1.getOrder() != 0 && o2.getOrder() == 0 ) + { + return -1; + } + + return o1.getOrder() - o2.getOrder(); + } + + public static ProxyConnectorConfigurationOrderComparator getInstance() + { + return INSTANCE; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/functors/ProxyConnectorSelectionPredicate.java b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/functors/ProxyConnectorSelectionPredicate.java new file mode 100644 index 000000000..af18c6c5f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/functors/ProxyConnectorSelectionPredicate.java @@ -0,0 +1,59 @@ +package org.apache.maven.archiva.configuration.functors; + +/* + * 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.collections.Predicate; +import org.apache.commons.lang.StringUtils; +import org.apache.maven.archiva.configuration.ProxyConnectorConfiguration; + +/** + * ProxyConnectorPredicate + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ProxyConnectorSelectionPredicate + implements Predicate +{ + private String sourceId; + + private String targetId; + + public ProxyConnectorSelectionPredicate( String sourceId, String targetId ) + { + this.sourceId = sourceId; + this.targetId = targetId; + } + + public boolean evaluate( Object object ) + { + boolean satisfies = false; + + if ( object instanceof ProxyConnectorConfiguration ) + { + ProxyConnectorConfiguration connector = (ProxyConnectorConfiguration) object; + return ( StringUtils.equals( sourceId, connector.getSourceRepoId() ) && StringUtils + .equals( targetId, connector.getTargetRepoId() ) ); + } + + return satisfies; + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/functors/RepositoryConfigurationComparator.java b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/functors/RepositoryConfigurationComparator.java new file mode 100644 index 000000000..caf99d343 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/functors/RepositoryConfigurationComparator.java @@ -0,0 +1,54 @@ +package org.apache.maven.archiva.configuration.functors; + +/* + * 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.archiva.configuration.AbstractRepositoryConfiguration; + +import java.util.Comparator; + +/** + * RepositoryConfigurationComparator + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class RepositoryConfigurationComparator + implements Comparator +{ + public int compare( AbstractRepositoryConfiguration o1, AbstractRepositoryConfiguration o2 ) + { + if ( o1 == null && o2 == null ) + { + return 0; + } + + if ( o1 == null ) + { + return -1; + } + + if ( o2 == null ) + { + return 1; + } + + return o1.getId().compareToIgnoreCase( o2.getId() ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo new file mode 100644 index 000000000..b7523ef13 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo @@ -0,0 +1,1127 @@ + + + + + configuration + Configuration + + Configuration for the Maven Repository Manager. + + + + package + org.apache.maven.archiva.configuration + + + + + Configuration + 1.0.0+ + + + version + 1.0.0+ + String + true + This is the version of the configuration format. + + + + @deprecated use managedRepositories or remoteRepositories instead. + + repositories + 1.0.0+ + + V1RepositoryConfiguration + * + + + + repositoryGroups + 1.2.0+ + + RepositoryGroupConfiguration + * + + The list of repository groups. + + + managedRepositories + 1.0.0+ + + ManagedRepositoryConfiguration + * + + The list of repositories that this archiva instance uses. + + + remoteRepositories + 1.0.0+ + + RemoteRepositoryConfiguration + * + + The list of repositories that this archiva can retrieve from or publish to. + + + proxyConnectors + 1.0.0+ + + ProxyConnectorConfiguration + * + + The list of proxy connectors for this archiva instance. + + + + networkProxies + 1.0.0+ + + NetworkProxyConfiguration + * + + + The list of network proxies to use for outgoing requests. + + + + legacyArtifactPaths + 1.1.0+ + + LegacyArtifactPath + * + + + The list of custom legacy path to artifact. + + + + repositoryScanning + 1.0.0+ + + RepositoryScanningConfiguration + 1 + + + The repository scanning configuration. + + + + databaseScanning + 1.0.0+ + + DatabaseScanningConfiguration + 1 + + + The database scanning configuration. + + + + webapp + 1.0.0+ + + WebappConfiguration + 1 + + + The webapp configuration. + + + + organisationInfo + 1.1.0+ + + OrganisationInformation + 1 + + + The organisation info. + + + + + + 1.2.0+ + > repositoryToGroupMap; + + public java.util.Map> getRepositoryToGroupMap() + { + if ( repositoryGroups != null ) + { + java.util.Map> map = new java.util.HashMap>(); + + for ( RepositoryGroupConfiguration group : (java.util.List) repositoryGroups ) + { + for ( String repositoryId : (java.util.List) group.getRepositories() ) + { + java.util.List groups = map.get( repositoryId ); + if ( groups == null ) + { + groups = new java.util.ArrayList(); + map.put( repositoryId, groups ); + } + groups.add( group.getId() ); + } + } + + repositoryToGroupMap = map; + } + return repositoryToGroupMap; + } + + public java.util.Map getRepositoryGroupsAsMap() + { + java.util.Map map = new java.util.HashMap(); + if ( repositoryGroups != null ) + { + for ( RepositoryGroupConfiguration group : (java.util.List) repositoryGroups ) + { + map.put( group.getId(), group ); + } + } + return map; + } + + public RepositoryGroupConfiguration findRepositoryGroupById( String id ) + { + if ( repositoryGroups != null ) + { + for ( RepositoryGroupConfiguration group : (java.util.List) repositoryGroups ) + { + if ( group.getId().equals( id ) ) + { + return group; + } + } + } + return null; + } + + private java.util.Map> groupToRepositoryMap; + + public java.util.Map> getGroupToRepositoryMap() + { + if ( repositoryGroups != null && managedRepositories != null ) + { + java.util.Map> map = new java.util.HashMap>(); + + for ( ManagedRepositoryConfiguration repo : (java.util.List) managedRepositories ) + { + for ( RepositoryGroupConfiguration group : (java.util.List) repositoryGroups ) + { + if ( !group.getRepositories().contains( repo.getId() ) ) + { + String groupId = group.getId(); + java.util.List repos = map.get( groupId ); + if ( repos == null ) + { + repos = new java.util.ArrayList(); + map.put( groupId, repos ); + } + repos.add( repo.getId() ); + } + } + } + groupToRepositoryMap = map; + } + return groupToRepositoryMap; + } + ]]> + + + 1.0.0+ + getNetworkProxiesAsMap() + { + java.util.Map map = new java.util.HashMap(); + if ( networkProxies != null ) + { + for ( java.util.Iterator i = networkProxies.iterator(); i.hasNext(); ) + { + NetworkProxyConfiguration proxy = i.next(); + map.put( proxy.getId(), proxy ); + } + } + return map; + } + + public java.util.Map> getProxyConnectorAsMap() + { + java.util.Map> proxyConnectorMap = + new java.util.HashMap>(); + + java.util.Iterator it = proxyConnectors.iterator(); + while ( it.hasNext() ) + { + ProxyConnectorConfiguration proxyConfig = it.next(); + String key = proxyConfig.getSourceRepoId(); + + java.util.List connectors = proxyConnectorMap.get( key ); + if ( connectors == null ) + { + connectors = new java.util.ArrayList(); + proxyConnectorMap.put( key, connectors ); + } + + connectors.add( proxyConfig ); + java.util.Collections.sort( connectors, + org.apache.maven.archiva.configuration.functors.ProxyConnectorConfigurationOrderComparator.getInstance() ); + } + + return proxyConnectorMap; + } + + public java.util.Map getRemoteRepositoriesAsMap() + { + java.util.Map map = new java.util.HashMap(); + if ( remoteRepositories != null ) + { + for ( java.util.Iterator i = remoteRepositories.iterator(); i.hasNext(); ) + { + RemoteRepositoryConfiguration repo = i.next(); + map.put( repo.getId(), repo ); + } + } + return map; + } + + public RemoteRepositoryConfiguration findRemoteRepositoryById( String id ) + { + if ( remoteRepositories != null ) + { + for ( java.util.Iterator i = remoteRepositories.iterator(); i.hasNext(); ) + { + RemoteRepositoryConfiguration repo = i.next(); + if ( repo.getId().equals( id ) ) + { + return repo; + } + } + } + return null; + } + + public java.util.Map getManagedRepositoriesAsMap() + { + java.util.Map map = new java.util.HashMap(); + if ( managedRepositories != null ) + { + for ( java.util.Iterator i = managedRepositories.iterator(); i.hasNext(); ) + { + ManagedRepositoryConfiguration repo = i.next(); + map.put( repo.getId(), repo ); + } + } + return map; + } + + public ManagedRepositoryConfiguration findManagedRepositoryById( String id ) + { + if ( managedRepositories != null ) + { + for ( java.util.Iterator i = managedRepositories.iterator(); i.hasNext(); ) + { + ManagedRepositoryConfiguration repo = i.next(); + if ( repo.getId().equals( id ) ) + { + return repo; + } + } + } + return null; + } + ]]> + + + + + + + + AbstractRepositoryConfiguration + 1.0.0+ + true + + + id + 1.0.0+ + String + true + + The repository identifier. + + + + name + 1.0.0+ + String + true + + The descriptive name of the repository. + + + + layout + 1.0.0+ + String + true + + The layout of the repository. Valid values are "default" and "legacy". + + + default + + + + + RemoteRepositoryConfiguration + 1.0.0+ + AbstractRepositoryConfiguration + + + url + 1.0.0+ + String + true + + The URL for this repository. + + + + username + 1.0.0+ + String + + The Username for this repository. + + + + password + 1.0.0+ + String + + The Password for this repository. + + + + timeout + 1.0.1+ + int + + Timeout in seconds for connections to this repository + + 60 + + + + + ManagedRepositoryConfiguration + 1.0.0+ + AbstractRepositoryConfiguration + + + location + 1.0.0+ + String + true + + The file system location for this repository. + + + + releases + 1.0.0+ + boolean + True if this repository contains release versioned artifacts. + true + + + snapshots + 1.0.0+ + boolean + True if this repository contains snapshot versioned artifacts. + false + + + scanned + 1.0.0+ + boolean + True if this repository should be scanned and processed. + true + + + indexDir + 1.0.0+ + String + + The directory for the indexes of this repository. + + + + refreshCronExpression + 1.0.0+ + String + + When to run the refresh task. + Default is every hour + + 0 0 * * * ? + + + retentionCount + 1.0.0+ + int + + The total count of the artifact to be retained for each snapshot. + + 2 + + + daysOlder + 1.0.0+ + int + + The number of days old which will be the basis for removing a snapshot. + + 100 + + + deleteReleasedSnapshots + 1.0.0+ + boolean + + True if the released snapshots are to be removed from the repo during repository purge. + + false + + + + + V1RepositoryConfiguration + 1.0.0+ + ManagedRepositoryConfiguration + + + url + 1.0.0+ + String + true + + The URL for this repository. + + + + indexed + 1.0.0+ + boolean + true + + + + + + LegacyArtifactPath + 1.1.0+ + + + path + 1.1.0+ + String + true + + The legacy path. + + + + artifact + 1.1.0+ + String + true + + The artifact reference, as " [groupId] : [artifactId] : [version] : [classifier] : [type] ". + + + + + + 1.0.0+ + 0 ? classifier : null; + } + + public String getType() + { + return artifact.split( ":" )[4]; + } + ]]> + + + + + RepositoryGroupConfiguration + 1.2.0+ + + + id + 1.2.0+ + String + true + The id of the repository group. + + + repositories + 1.2.0+ + + String + * + + The list of repository ids under the group. + + + + + + + + AbstractRepositoryConnectorConfiguration + true + 1.0.0+ + + + sourceRepoId + 1.0.0+ + String + true + + The Repository Source for this connector. + + + + targetRepoId + 1.0.0+ + String + true + + The Repository Target for this connector. + + + + proxyId + 1.0.0+ + String + + The network proxy ID to use for this connector. + + + + blackListPatterns + 1.0.0+ + + String + * + + + The list of blacklisted patterns for this connector. + + + + whiteListPatterns + 1.0.0+ + + String + * + + + The list of whitelisted patterns for this connector. + + + + policies + 1.0.0+ + Map + Policy configuration for the connector. + + String + * + + + + properties + 1.0.0+ + Map + Configuration for the connector. + + String + * + + + + + + 1.0.0+ + + + + + + + AbstractRepositoryConnectorConfiguration + ProxyConnectorConfiguration + 1.0.0+ + + + order + 1.0.0+ + + The order of the proxy connectors. (0 means no order specified) + + int + 0 + + + + + 1.0.0+ + + + + + + + AbstractRepositoryConnectorConfiguration + SyncConnectorConfiguration + true + 1.0.0+ + + + cronExpression + 1.0.0+ + String + When to run the sync mechanism. Default is every hour on the hour. + 0 0 * * * ? + + + method + 1.0.0+ + String + The type of synchronization to use. + rsync + + + + + + + + NetworkProxyConfiguration + 1.0.0+ + + + id + 1.0.0+ + String + + The ID for this proxy. + + + + protocol + 1.0.0+ + + The network protocol to use with this proxy: "http", "socks-4" + + String + true + http + + + host + 1.0.0+ + + The proxy host. + + String + true + + + port + 1.0.0+ + + The proxy port. + + int + 8080 + + + username + 1.0.0+ + + The proxy user. + + String + + + password + 1.0.0+ + + The proxy password. + + String + + + + + + + RepositoryScanningConfiguration + 1.0.0+ + + + fileTypes + 1.0.0+ + true + + FileType + * + + + The FileTypes for the repository scanning configuration. + + + + knownContentConsumers + 1.0.0+ + true + + String + * + + + The list of active consumers IDs for known content. + + + + invalidContentConsumers + 1.0.0+ + true + + String + * + + + The list of active consumer IDs for invalid content. + + + + + + FileType + 1.0.0+ + The FileType object + + + id + 1.0.0+ + true + String + + + patterns + 1.0.0+ + true + + String + * + + + + + + DatabaseScanningConfiguration + 1.0.0+ + + The scanning configuration for unprocessed ArchivaArtifact database objects. + + + + cronExpression + 1.0.0+ + String + When to run the database scanning mechanism. Default is every two hours on the hour. + + 0 0 0/2 * * ? + + + unprocessedConsumers + 1.0.0+ + true + + String + * + + + The list of consumers for the unprocessed ArchivaArtifact database objects. + + + + cleanupConsumers + 1.0.0+ + true + + String + * + + + The list of consumers for previously processed ArchivaArtifact database + objects that no longer exist on the filesystem, and might need to + undergo a cleanup. + + + + + + + + + OrganisationInformation + 1.1.0+ + + The organisation information settings. + + + + name + name of the organisation + 1.1.0+ + + String + + + + url + name of the organisation + 1.1.0+ + + String + + + + logoLocation + name of the organisation + 1.1.0+ + + String + + + + + + + WebappConfiguration + 1.0.0+ + + The webapp configuration settings. + + + + ui + options for altering the ui presentation + 1.0.0+ + + UserInterfaceOptions + + + + + + + UserInterfaceOptions + 1.0.0+ + + The user interface configuration settings. + + + + showFindArtifacts + true if find artifacts should be enabled + 1.0.0+ + boolean + true + + + appletFindEnabled + true if applet behavior for find artifacts should be enabled + 1.0.0+ + boolean + true + + + + + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/resources/org/apache/maven/archiva/configuration/SyncedRepositoryConfiguration-conversion.properties b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/resources/org/apache/maven/archiva/configuration/SyncedRepositoryConfiguration-conversion.properties new file mode 100644 index 000000000..2beeea469 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/resources/org/apache/maven/archiva/configuration/SyncedRepositoryConfiguration-conversion.properties @@ -0,0 +1,21 @@ +# +# 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. +# + +Key_properties=java.lang.String +Element_properties=java.lang.String diff --git a/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/resources/org/apache/maven/archiva/configuration/default-archiva.xml b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/resources/org/apache/maven/archiva/configuration/default-archiva.xml new file mode 100644 index 000000000..12473f3f1 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/main/resources/org/apache/maven/archiva/configuration/default-archiva.xml @@ -0,0 +1,178 @@ + + + 2 + + + internal + Archiva Managed Internal Repository + ${appserver.base}/data/repositories/internal + default + true + false + true + 0 0 * * * ? + 30 + + + snapshots + Archiva Managed Snapshot Repository + ${appserver.base}/data/repositories/snapshots + default + false + true + true + 0 0\,30 * * * ? + 30 + + + + + central + Central Repository + http://repo1.maven.org/maven2 + default + + + maven2-repository.dev.java.net + Java.net Repository for Maven 2 + http://download.java.net/maven/2/ + default + + + + + + internal + central + + + disabled + once + fix + cached + + + **/* + + + + internal + maven2-repository.dev.java.net + + + disabled + once + fix + cached + + + javax/** + org/jvnet/** + com/sun/** + + + + + + + jaxen/jars/jaxen-1.0-FCS-full.jar + jaxen:jaxen:1.0-FCS:full:jar + + + + + + + artifacts + + **/*.pom + **/*.jar + **/*.ear + **/*.war + **/*.car + **/*.sar + **/*.mar + **/*.rar + **/*.dtd + **/*.tld + **/*.tar.gz + **/*.tar.bz2 + **/*.zip + + + + indexable-content + + **/*.txt + **/*.TXT + **/*.block + **/*.config + **/*.pom + **/*.xml + **/*.xsd + **/*.dtd + **/*.tld + + + + auto-remove + + **/*.bak + **/*~ + **/*- + + + + ignored + + **/.htaccess + **/KEYS + **/*.rb + **/*.sh + **/.svn/** + **/.DAV/** + + + + + update-db-artifact + create-missing-checksums + update-db-repository-metadata + validate-checksum + validate-signature + index-content + auto-remove + auto-rename + metadata-updater + + + + update-db-bad-content + + + + + 0 0 * * * ? + + index-artifact + update-db-project + validate-repository-metadata + index-archive-toc + update-db-bytecode-stats + index-public-methods + + + not-present-remove-db-artifact + not-present-remove-db-project + not-present-remove-indexed + + + + + + true + true + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/conf/archiva-0.9.xml b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/conf/archiva-0.9.xml new file mode 100644 index 000000000..c8032436a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/conf/archiva-0.9.xml @@ -0,0 +1,44 @@ + + + + + + + managed-repository + local + local + + + + + http://www.ibiblio.org/maven2/ + local + true + ibiblio + Ibiblio + + + http://repository.codehaus.org/ + local + codehaus + Codehaus + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/conf/archiva-v1.xml b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/conf/archiva-v1.xml new file mode 100644 index 000000000..2b05c9251 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/conf/archiva-v1.xml @@ -0,0 +1,191 @@ + + + + + + + internal + Archiva Managed Internal Repository + file://${appserver.base}/repositories/internal + default + true + false + true + 0 0 * * * ? + + + snapshots + Archiva Managed Snapshot Repository + file://${appserver.base}/repositories/snapshots + default + false + true + false + 0 0,30 * * * ? + + + central + Central Repository + http://repo1.maven.org/maven2 + default + true + false + false + + + maven2-repository.dev.java.net + Java.net Repository for Maven 2 + https://maven2-repository.dev.java.net/nonav/repository + default + true + false + false + + + + + + internal + central + + disabled + never + not-found + + + internal + maven2-repository.dev.java.net + + disabled + never + not-found + + javax/** + + + + + + + example + http + proxy.mycompany.com + 8080 + myself + mypass + + + + + + + artifacts + + **/*.pom + **/*.jar + **/*.ear + **/*.war + **/*.car + **/*.sar + **/*.mar + **/*.rar + **/*.dtd + **/*.tld + **/*.tar.gz + **/*.tar.bz2 + **/*.zip + + + + indexable-content + + **/*.txt + **/*.TXT + **/*.block + **/*.config + **/*.pom + **/*.xml + **/*.xsd + **/*.dtd + **/*.tld + + + + auto-remove + + **/*.bak + **/*~ + **/*- + + + + ignored + + **/.htaccess + **/KEYS + **/*.rb + **/*.sh + **/.svn/** + **/.DAV/** + + + + + update-db-artifact + create-missing-checksums + update-db-repository-metadata + validate-checksum + validate-signature + index-content + auto-remove + auto-rename + metadata-updater + + + + update-db-bad-content + + + + + 0 0 * * * ? + + index-artifact + update-db-project + validate-repository-metadata + index-archive-toc + update-db-bytecode-stats + index-public-methods + + + not-present-remove-db-artifact + not-present-remove-db-project + not-present-remove-indexed + + + + + + true + true + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/conf/autodetect-v1.xml b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/conf/autodetect-v1.xml new file mode 100644 index 000000000..29f3775bb --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/conf/autodetect-v1.xml @@ -0,0 +1,190 @@ + + + + + + + internal + Archiva Managed Internal Repository + file://${appserver.base}/repositories/internal + default + true + false + true + 0 0 * * * ? + + + snapshots + Archiva Managed Snapshot Repository + file:${appserver.base}/repositories/snapshots + default + false + true + true + 0 0,30 * * * ? + + + central + Central Repository + http://repo1.maven.org/maven2 + default + true + false + false + + + maven2-repository.dev.java.net + Java.net Repository for Maven 2 + https://maven2-repository.dev.java.net/nonav/repository + default + true + false + false + + + + + + internal + central + + disabled + never + not-found + + + internal + maven2-repository.dev.java.net + + disabled + never + not-found + + javax/** + + + + + + + example + http + proxy.mycompany.com + 8080 + myself + mypass + + + + + + + artifacts + + **/*.pom + **/*.jar + **/*.ear + **/*.war + **/*.car + **/*.sar + **/*.mar + **/*.rar + **/*.dtd + **/*.tld + **/*.tar.gz + **/*.tar.bz2 + **/*.zip + + + + indexable-content + + **/*.txt + **/*.TXT + **/*.block + **/*.config + **/*.pom + **/*.xml + **/*.xsd + **/*.dtd + **/*.tld + + + + auto-remove + + **/*.bak + **/*~ + **/*- + + + + ignored + + **/.htaccess + **/KEYS + **/*.rb + **/*.sh + **/.svn/** + **/.DAV/** + + + + + update-db-artifact + create-missing-checksums + update-db-repository-metadata + validate-checksum + validate-signature + index-content + auto-remove + auto-rename + metadata-updater + + + update-db-bad-content + + + + + 0 0 * * * ? + + index-artifact + update-db-project + validate-repository-metadata + index-archive-toc + update-db-bytecode-stats + index-public-methods + + + not-present-remove-db-artifact + not-present-remove-db-project + not-present-remove-indexed + + + + + + true + true + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/conf/conf-base.xml b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/conf/conf-base.xml new file mode 100644 index 000000000..84ab085d0 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/conf/conf-base.xml @@ -0,0 +1,65 @@ + + + + + 2 + + + internal + Archiva Managed Internal Repository + ${appserver.base}/repositories/internal + default + true + false + true + 0 0 * * * ? + + + snapshots + Archiva Managed Snapshot Repository + ${appserver.base}/repositories/snapshots + default + false + true + true + 0 0,30 * * * ? + + + + + central + Central Repository + http://repo1.maven.org/maven2 + default + + + maven2-repository.dev.java.net + Java.net Repository for Maven 2 + https://maven2-repository.dev.java.net/nonav/repository + default + + + + + + false + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/conf/conf-single-list-elements.xml b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/conf/conf-single-list-elements.xml new file mode 100644 index 000000000..3e3d4dc97 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/conf/conf-single-list-elements.xml @@ -0,0 +1,97 @@ + + + + + 2 + + + default + + snapshots + + + + + + snapshots + Archiva Managed Snapshot Repository + ${appserver.base}/repositories/snapshots + default + false + true + true + 0 0,30 * * * ? + + + + + central + Central Repository + http://repo1.maven.org/maven2 + default + + + + + 2 + internal + maven2-repository.dev.java.net + + + javax/** + + + once + fix + never + yes + + + + + + proxy + proxy + 8080 + + + + + jaxen/jars/jaxen-1.0-FCS-full.jar + jaxen:jaxen:1.0-FCS:full:jar + + + + + auto-remove + + + update-db-bad-content + + + + + update-db-bytecode-stats + + + not-present-remove-db-project + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/conf/conf-user.xml b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/conf/conf-user.xml new file mode 100644 index 000000000..61c4dadc2 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/conf/conf-user.xml @@ -0,0 +1,49 @@ + + + + 2 + + + internal + central + + disabled + never + not-found + + + internal + maven2-repository.dev.java.net + + disabled + never + not-found + + javax/** + + + + + + + false + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/conf/corrupt.xml b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/conf/corrupt.xml new file mode 100644 index 000000000..b4469289a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/conf/corrupt.xml @@ -0,0 +1,20 @@ + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/conf/escape-cron-expressions.xml b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/conf/escape-cron-expressions.xml new file mode 100644 index 000000000..547e8c0b5 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/conf/escape-cron-expressions.xml @@ -0,0 +1,54 @@ + + + + 2 + + + snapshots + Archiva Managed Snapshot Repository + file://${appserver.base}/repositories/internal + false + true + 0 0\,30 * * * ? + + + + 0 0 0 * * ? + + index-artifact + update-db-project + validate-repository-metadata + index-archive-toc + update-db-bytecode-stats + index-public-methods + + + not-present-remove-db-artifact + not-present-remove-db-project + not-present-remove-indexed + + + + + + false + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/conf/maven-proxy-complete.conf b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/conf/maven-proxy-complete.conf new file mode 100644 index 000000000..7908a9ad9 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/conf/maven-proxy-complete.conf @@ -0,0 +1,144 @@ +################ GLOBAL SETTINGS +# This is where maven-proxy stores files it has downloaded +repo.local.store=target + +#The port to listen on - not used if loaded as a webapp +port=9999 + +#This is the base area that all files are loaded from. While it is possible to leave this blank, this behaviour +#is deprecated and will be disabled in version 2.0. There are too many namespace conflicts caused by not using +#a prefix. +#The repository will be shown at http://localhost:9999/repository/ +#for the .war loaded into a webapp server, the default prefix is "repository" (edit the web.xml to change) +# As maven doesn't like a trailing slash, this address shouldn't have one either. +prefix=repository + +#This is the simple date format used to display the last modified date while browsing the repository. +lastModifiedDateFormat=yyyy/MM/dd HH:mm:ss + +################ SNAPSHOT HANDLING +#If you want the proxy to look for newer snapshots, set to true +snapshot.update=true + +################ M2 METADATA HANDLING +#If you want the proxy to prevent looking for newer metadata, set to false (default is true) +#metadata.update=false + +################ M2 POM HANDLING +#If you want the proxy to look for newer POMs, set to true (default is false) +pom.update=true + +################ PROMOTION HANDLING +# ***** NOT CURRENTLY IMPLEMENTED ***** +#Promotion describes the process by which new artifacts are loaded to global maven-proxy repository. It +# is designed to be used by "higher security installations" that do not want to acquire artifacts from +# remote repositories without approval. +# +#If promotion handling is enabled, then the proxy will not download remote artifacts without permission +# (local repositories with copy=false are considered to be local) +# +#Permission to download is granted via the Promotion menu which will be enabled +# when promotion handling is enabled. +# +#If promotion is false, artifacts are sourced from any repository as per normal. +# +#Promotion and snapshots: If promotion is enabled, snapshots are not downloadable. The concept of using +# a snapshot in a production build (which is primarily what promotion is for) is counterintuitive. +## +promotion=false + +################ WEB INTERFACE +# This defines the absolute URL the server should use to identify itself. +# This can often be determined automatically, but we recommend you specify +# it explicitly to prevent problems during startup. +# The prefix will be added to this for the actual repository +# i.e. proxy available at http://localhost:9999/, repository at http://localhost:9999/repository +serverName=http://localhost:9999 + +#If true, the repository can be browsed +browsable=true + +#If true, the repository can be searched +searchable=true + +#Not currently implemented. Will allow webdav access to the repository at some point. +webdav=true + +#Stylesheet - if configured, will override the default stylesheet shipped with maven-proxy - absolute URLs only +#eg. /maven-proxy/style.css, http://www.example.com/style.css +stylesheet=/maven-proxy/style.css + +#bgColor / bgColorHighlight are replaced in the built in stylesheet to produce a simple color scheme. +#If a stylesheet is set, these are not used. +bgColor=#14B +bgColorHighlight=#94B + +#rowColor / rowColorHighlight are replaced in the built in stylesheet to produce a simple color scheme. +#If a stylesheet is set, these are not used. +rowColor=#CCF +rowColorHighlight=#DDF + + +################ PROXIES +#This is just a hack, it should auto discover them +proxy.list=one,two,three + +#Unauthenticated proxy +proxy.one.host=proxy1.example.com +proxy.one.port=3128 + +#Authenticated proxy +proxy.two.host=proxy2.example.org +proxy.two.port=80 +proxy.two.username=username2 +proxy.two.password=password2 + +#Authenticated proxy +proxy.three.host=proxy3.example.net +proxy.three.port=3129 +proxy.three.username=username3 +proxy.three.password=password3 + + +################# REPOSITORIES +#This is not just a hack, it specifies the order repositories should be checked +#Note that the proxy adds a "/" which is why the urls aren't suffixed with a "/" +repo.list=local-repo,www-ibiblio-org,dist-codehaus-org,private-example-com + +#local-store +# The local store represents a location that local jars you host can be located. +# This could also be achieved by having a local http repository, but this is less cumbersome +repo.local-repo.url=file://target +repo.local-repo.description=Super Secret Custom Repository +#If copy is true, jars are copied from the store to the proxy-repo. Only configurable for file:/// repos +repo.local-repo.copy=false +#If hardfail is true, any unexpected errors from the repository will cause +#the client download to fail (typically with a 500 error) +repo.local-repo.hardfail=true +#Don't cache a file repository +repo.local-repo.cache.period=0 + + +#www.ibiblio.org +repo.www-ibiblio-org.url=http://www.ibiblio.org/maven2 +repo.www-ibiblio-org.description=www.ibiblio.org +repo.www-ibiblio-org.proxy=one +repo.www-ibiblio-org.hardfail=true +#Cache this repository for 1 hour +repo.www-ibiblio-org.cache.period=3600 +repo.www-ibiblio-org.cache.failures=true + +#dist.codehaus.org +repo.dist-codehaus-org.url=http://dist.codehaus.org +repo.dist-codehaus-org.proxy=two +repo.dist-codehaus-org.hardfail=false +repo.dist-codehaus-org.cache.period=3600 +repo.dist-codehaus-org.cache.failures=true + +#private.example.com +repo.private-example-com.url=http://private.example.com/internal +repo.private-example-com.description=Commercial In Confidence Repository +repo.private-example-com.username=username1 +repo.private-example-com.password=password1 +repo.private-example-com.proxy=three +repo.private-example-com.cache.period=3600 diff --git a/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/conf/repository-manager.xml b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/conf/repository-manager.xml new file mode 100644 index 000000000..8fabacf5b --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/conf/repository-manager.xml @@ -0,0 +1,193 @@ + + + + + 2 + + + internal + Archiva Managed Internal Repository + ${appserver.base}/repositories/internal + default + true + false + true + 0 0 * * * ? + + + snapshots + Archiva Managed Snapshot Repository + ${appserver.base}/repositories/internal + default + false + true + true + 0 0,30 * * * ? + + + + + central + Central Repository + http://repo1.maven.org/maven2 + default + + + maven2-repository.dev.java.net + Java.net Repository for Maven 2 + https://maven2-repository.dev.java.net/nonav/repository + default + + + + + + + + internal + central + + + ignored + disabled + cached + + + + internal + maven2-repository.dev.java.net + + + ignored + disabled + cached + + + javax/** + + + + + + + example + http + proxy.mycompany.com + 8080 + myself + mypass + + + + + + + artifacts + + **/*.pom + **/*.jar + **/*.ear + **/*.war + **/*.car + **/*.sar + **/*.mar + **/*.rar + **/*.dtd + **/*.tld + **/*.tar.gz + **/*.tar.bz2 + **/*.zip + + + + indexable-content + + **/*.txt + **/*.TXT + **/*.block + **/*.config + **/*.pom + **/*.xml + **/*.xsd + **/*.dtd + **/*.tld + + + + auto-remove + + **/*.bak + **/*~ + **/*- + + + + ignored + + **/.htaccess + **/KEYS + **/*.rb + **/*.sh + **/.svn/** + **/.DAV/** + + + + + update-db-artifact + create-missing-checksums + update-db-repository-metadata + validate-checksum + validate-signature + index-content + auto-remove + auto-rename + metadata-updater + + + update-db-bad-content + + + + + 0 0 * * * ? + + index-artifact + update-db-project + validate-repository-metadata + index-archive-toc + update-db-bytecode-stats + index-public-methods + + + not-present-remove-db-artifact + not-present-remove-db-project + not-present-remove-indexed + + + + + + true + true + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/maven/archiva/configuration/ArchivaConfigurationTest.java b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/maven/archiva/configuration/ArchivaConfigurationTest.java new file mode 100644 index 000000000..70c88d4d8 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/maven/archiva/configuration/ArchivaConfigurationTest.java @@ -0,0 +1,819 @@ +package org.apache.maven.archiva.configuration; + +/* + * 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; +import java.util.List; +import java.util.Map; + +import org.apache.commons.io.FileUtils; +import org.apache.commons.lang.StringUtils; +import org.codehaus.plexus.registry.RegistryException; +import org.codehaus.plexus.spring.PlexusInSpringTestCase; +import org.custommonkey.xmlunit.XMLAssert; +import org.easymock.MockControl; + +/** + * Test the configuration store. + * + * @author Brett Porter + */ +public class ArchivaConfigurationTest + extends PlexusInSpringTestCase +{ + /** + * {@inheritDoc} + * @see org.codehaus.plexus.spring.PlexusInSpringTestCase#getSpringConfigLocation() + */ + protected String getSpringConfigLocation() + { + return "org/apache/maven/archiva/configuration/spring-context.xml"; + } + + public void testGetConfigurationFromRegistryWithASingleNamedConfigurationResource() + throws Exception + { + ArchivaConfiguration archivaConfiguration = + (ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-configuration" ); + + Configuration configuration = archivaConfiguration.getConfiguration(); + assertConfiguration( configuration ); + assertEquals( "check network proxies", 1, configuration.getNetworkProxies().size() ); + + ManagedRepositoryConfiguration repository = + (ManagedRepositoryConfiguration) configuration.getManagedRepositories().get( 0 ); + + assertEquals( "check managed repositories", "${appserver.base}/repositories/internal", + repository.getLocation() ); + assertEquals( "check managed repositories", "Archiva Managed Internal Repository", repository.getName() ); + assertEquals( "check managed repositories", "internal", repository.getId() ); + assertEquals( "check managed repositories", "default", repository.getLayout() ); + assertTrue( "check managed repositories", repository.isScanned() ); + } + + public void testGetConfigurationFromDefaults() + throws Exception + { + ArchivaConfiguration archivaConfiguration = + (ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-defaults" ); + + Configuration configuration = archivaConfiguration.getConfiguration(); + assertConfiguration( configuration ); + assertEquals( "check network proxies", 0, configuration.getNetworkProxies().size() ); + + ManagedRepositoryConfiguration repository = + (ManagedRepositoryConfiguration) configuration.getManagedRepositories().get( 0 ); + + assertEquals( "check managed repositories", "${appserver.base}/data/repositories/internal", + repository.getLocation() ); + assertEquals( "check managed repositories", "Archiva Managed Internal Repository", repository.getName() ); + assertEquals( "check managed repositories", "internal", repository.getId() ); + assertEquals( "check managed repositories", "default", repository.getLayout() ); + assertTrue( "check managed repositories", repository.isScanned() ); + } + + // test for [MRM-789] + public void testGetConfigurationFromDefaultsWithDefaultRepoLocationAlreadyExisting() + throws Exception + { + File repo = new File( getBasedir(), "/target/test-classes/existing_snapshots" ); + repo.mkdirs(); + + repo = new File( getBasedir(), "/target/test-classes/existing_internal" ); + repo.mkdirs(); + + String existingTestDefaultArchivaConfigFile = + FileUtils.readFileToString( getTestFile( "target/test-classes/org/apache/maven/archiva/configuration/test-default-archiva.xml" ) ) ; + existingTestDefaultArchivaConfigFile = StringUtils.replace( existingTestDefaultArchivaConfigFile, "${appserver.base}", getBasedir() ); + + File generatedTestDefaultArchivaConfigFile = + new File( getBasedir(), "target/test-classes/org/apache/maven/archiva/configuration/default-archiva.xml" ); + + FileUtils.writeStringToFile( generatedTestDefaultArchivaConfigFile, existingTestDefaultArchivaConfigFile, null ); + + ArchivaConfiguration archivaConfiguration = + (ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), + "test-defaults-default-repo-location-exists" ); + + Configuration configuration = archivaConfiguration.getConfiguration(); + assertConfiguration( configuration ); + + ManagedRepositoryConfiguration repository = + (ManagedRepositoryConfiguration) configuration.getManagedRepositories().get( 0 ); + assertTrue( "check managed repositories", repository.getLocation().endsWith( "data/repositories/internal" ) ); + + generatedTestDefaultArchivaConfigFile.delete(); + assertFalse( generatedTestDefaultArchivaConfigFile.exists() ); + } + + /** + * Ensures that the provided configuration matches the details present in the archiva-default.xml file. + */ + private void assertConfiguration( Configuration configuration ) + throws Exception + { + FileTypes filetypes = (FileTypes) lookup( FileTypes.class.getName() ); + + assertEquals( "check repositories", 2, configuration.getManagedRepositories().size() ); + assertEquals( "check repositories", 2, configuration.getRemoteRepositories().size() ); + assertEquals( "check proxy connectors", 2, configuration.getProxyConnectors().size() ); + + RepositoryScanningConfiguration repoScanning = configuration.getRepositoryScanning(); + assertNotNull( "check repository scanning", repoScanning ); + assertEquals( "check file types", 4, repoScanning.getFileTypes().size() ); + assertEquals( "check known consumers", 9, repoScanning.getKnownContentConsumers().size() ); + assertEquals( "check invalid consumers", 1, repoScanning.getInvalidContentConsumers().size() ); + + List patterns = filetypes.getFileTypePatterns( "artifacts" ); + assertNotNull( "check 'artifacts' file type", patterns ); + assertEquals( "check 'artifacts' patterns", 13, patterns.size() ); + + DatabaseScanningConfiguration dbScanning = configuration.getDatabaseScanning(); + assertNotNull( "check database scanning", dbScanning ); + assertEquals( "check unprocessed consumers", 6, dbScanning.getUnprocessedConsumers().size() ); + assertEquals( "check cleanup consumers", 3, dbScanning.getCleanupConsumers().size() ); + + WebappConfiguration webapp = configuration.getWebapp(); + assertNotNull( "check webapp", webapp ); + + UserInterfaceOptions ui = webapp.getUi(); + assertNotNull( "check webapp ui", ui ); + assertTrue( "check showFindArtifacts", ui.isShowFindArtifacts() ); + assertTrue( "check appletFindEnabled", ui.isAppletFindEnabled() ); + } + + public void testGetConfigurationFromRegistryWithTwoConfigurationResources() + throws Exception + { + ArchivaConfiguration archivaConfiguration = + (ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-configuration-both" ); + + Configuration configuration = archivaConfiguration.getConfiguration(); + + // from base + assertEquals( "check repositories", 2, configuration.getManagedRepositories().size() ); + assertEquals( "check repositories", 2, configuration.getRemoteRepositories().size() ); + // from user + assertEquals( "check proxy connectors", 2, configuration.getProxyConnectors().size() ); + + WebappConfiguration webapp = configuration.getWebapp(); + assertNotNull( "check webapp", webapp ); + + UserInterfaceOptions ui = webapp.getUi(); + assertNotNull( "check webapp ui", ui ); + // from base + assertFalse( "check showFindArtifacts", ui.isShowFindArtifacts() ); + // from user + assertFalse( "check appletFindEnabled", ui.isAppletFindEnabled() ); + } + + public void testGetConfigurationSystemOverride() + throws Exception + { + ArchivaConfiguration archivaConfiguration = + (ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-configuration" ); + + System.setProperty( "org.apache.maven.archiva.webapp.ui.appletFindEnabled", "false" ); + + try + { + Configuration configuration = archivaConfiguration.getConfiguration(); + + assertFalse( "check boolean", configuration.getWebapp().getUi().isAppletFindEnabled() ); + } + finally + { + System.getProperties().remove( "org.apache.maven.archiva.webapp.ui.appletFindEnabled" ); + } + } + + public void testStoreConfiguration() + throws Exception + { + File file = getTestFile( "target/test/test-file.xml" ); + file.delete(); + assertFalse( file.exists() ); + + // TODO: remove with commons-configuration 1.4 + file.getParentFile().mkdirs(); + FileUtils.writeStringToFile( file, "", null ); + + DefaultArchivaConfiguration archivaConfiguration = + (DefaultArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-save" ); + + Configuration configuration = new Configuration(); + configuration.setVersion( "1" ); + configuration.setWebapp( new WebappConfiguration() ); + configuration.getWebapp().setUi( new UserInterfaceOptions() ); + configuration.getWebapp().getUi().setAppletFindEnabled( false ); + + // add a change listener + MockControl control = createConfigurationListenerMockControl(); + ConfigurationListener listener = (ConfigurationListener) control.getMock(); + archivaConfiguration.addListener( listener ); + + listener.configurationEvent( new ConfigurationEvent( ConfigurationEvent.SAVED ) ); + control.setVoidCallable(); + + control.replay(); + + archivaConfiguration.save( configuration ); + + control.verify(); + + assertTrue( "Check file exists", file.exists() ); + + // check it + configuration = archivaConfiguration.getConfiguration(); + assertFalse( "check value", configuration.getWebapp().getUi().isAppletFindEnabled() ); + + // read it back + archivaConfiguration = + (DefaultArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-read-saved" ); + configuration = archivaConfiguration.getConfiguration(); + assertFalse( "check value", configuration.getWebapp().getUi().isAppletFindEnabled() ); + } + + private static MockControl createConfigurationListenerMockControl() + { + return MockControl.createControl( ConfigurationListener.class ); + } + + public void testStoreConfigurationUser() + throws Exception + { + File baseFile = getTestFile( "target/test/test-file.xml" ); + baseFile.delete(); + assertFalse( baseFile.exists() ); + + File userFile = getTestFile( "target/test/test-file-user.xml" ); + userFile.delete(); + assertFalse( userFile.exists() ); + + userFile.getParentFile().mkdirs(); + FileUtils.writeStringToFile( userFile, "", null ); + + ArchivaConfiguration archivaConfiguration = + (ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-save-user" ); + + Configuration configuration = new Configuration(); + configuration.setWebapp( new WebappConfiguration() ); + configuration.getWebapp().setUi( new UserInterfaceOptions() ); + configuration.getWebapp().getUi().setAppletFindEnabled( false ); + + archivaConfiguration.save( configuration ); + + assertTrue( "Check file exists", userFile.exists() ); + assertFalse( "Check file not created", baseFile.exists() ); + + // check it + configuration = archivaConfiguration.getConfiguration(); + assertFalse( "check value", configuration.getWebapp().getUi().isAppletFindEnabled() ); + } + + public void testStoreConfigurationLoadedFromDefaults() + throws Exception + { + File baseFile = getTestFile( "target/test/test-file.xml" ); + baseFile.delete(); + assertFalse( baseFile.exists() ); + + File userFile = getTestFile( "target/test/test-file-user.xml" ); + userFile.delete(); + assertFalse( userFile.exists() ); + + ArchivaConfiguration archivaConfiguration = + (ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-save-user" ); + + Configuration configuration = new Configuration(); + configuration.setWebapp( new WebappConfiguration() ); + configuration.getWebapp().setUi( new UserInterfaceOptions() ); + configuration.getWebapp().getUi().setAppletFindEnabled( false ); + + // add a change listener + MockControl control = createConfigurationListenerMockControl(); + ConfigurationListener listener = (ConfigurationListener) control.getMock(); + archivaConfiguration.addListener( listener ); + + listener.configurationEvent( new ConfigurationEvent( ConfigurationEvent.SAVED ) ); + // once from default creation, and again from manual call to save + control.setVoidCallable( 2 ); + + control.replay(); + + archivaConfiguration.save( configuration ); + + control.verify(); + + assertTrue( "Check file exists", userFile.exists() ); + assertFalse( "Check file not created", baseFile.exists() ); + + // check it + configuration = archivaConfiguration.getConfiguration(); + assertFalse( "check value", configuration.getWebapp().getUi().isAppletFindEnabled() ); + } + + public void testDefaultUserConfigFilename() + throws Exception + { + DefaultArchivaConfiguration archivaConfiguration = + (DefaultArchivaConfiguration) lookup( ArchivaConfiguration.class.getName() ); + + assertEquals( System.getProperty( "user.home" ) + "/.m2/archiva.xml", + archivaConfiguration.getUserConfigFilename() ); + assertEquals( System.getProperty( "appserver.base", "${appserver.base}" ) + "/conf/archiva.xml", + archivaConfiguration.getAltConfigFilename() ); + } + + public void testStoreConfigurationFallback() + throws Exception + { + File baseFile = getTestFile( "target/test/test-file.xml" ); + baseFile.delete(); + assertFalse( baseFile.exists() ); + + File userFile = getTestFile( "target/test/test-file-user.xml" ); + userFile.delete(); + assertFalse( userFile.exists() ); + + baseFile.getParentFile().mkdirs(); + FileUtils.writeStringToFile( baseFile, "", null ); + + ArchivaConfiguration archivaConfiguration = + (ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-save-user" ); + + Configuration configuration = new Configuration(); + configuration.setWebapp( new WebappConfiguration() ); + configuration.getWebapp().setUi( new UserInterfaceOptions() ); + configuration.getWebapp().getUi().setAppletFindEnabled( false ); + + archivaConfiguration.save( configuration ); + + assertTrue( "Check file exists", baseFile.exists() ); + assertFalse( "Check file not created", userFile.exists() ); + + // check it + configuration = archivaConfiguration.getConfiguration(); + assertFalse( "check value", configuration.getWebapp().getUi().isAppletFindEnabled() ); + } + + public void testStoreConfigurationFailsWhenReadFromBothLocationsNoLists() + throws Exception + { + File baseFile = getTestFile( "target/test/test-file.xml" ); + baseFile.delete(); + assertFalse( baseFile.exists() ); + + File userFile = getTestFile( "target/test/test-file-user.xml" ); + userFile.delete(); + assertFalse( userFile.exists() ); + + baseFile.getParentFile().mkdirs(); + FileUtils.writeStringToFile( baseFile, "", null ); + + userFile.getParentFile().mkdirs(); + FileUtils.writeStringToFile( userFile, "", null ); + + ArchivaConfiguration archivaConfiguration = + (ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-save-user" ); + + Configuration configuration = archivaConfiguration.getConfiguration(); + assertTrue( "check value", configuration.getWebapp().getUi().isAppletFindEnabled() ); + + configuration.getWebapp().getUi().setAppletFindEnabled( false ); + + archivaConfiguration.save( configuration ); + + assertTrue( "Check file exists", baseFile.exists() ); + assertEquals( "Check base file is unchanged", "", + FileUtils.readFileToString( baseFile, null ) ); + assertTrue( "Check file exists", userFile.exists() ); + assertFalse( "Check base file is changed", + "".equals( FileUtils.readFileToString( userFile, null ) ) ); + + // check it + configuration = archivaConfiguration.getConfiguration(); + assertFalse( "check value", configuration.getWebapp().getUi().isAppletFindEnabled() ); + } + + public void testStoreConfigurationFailsWhenReadFromBothLocationsUserHasLists() + throws Exception + { + File baseFile = getTestFile( "target/test/test-file.xml" ); + baseFile.delete(); + assertFalse( baseFile.exists() ); + + File userFile = getTestFile( "target/test/test-file-user.xml" ); + userFile.delete(); + assertFalse( userFile.exists() ); + + userFile.getParentFile().mkdirs(); + FileUtils.copyFile( getTestFile( "src/test/conf/conf-user.xml" ), userFile ); + + baseFile.getParentFile().mkdirs(); + FileUtils.writeStringToFile( baseFile, "", null ); + + ArchivaConfiguration archivaConfiguration = + (ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-save-user" ); + + Configuration configuration = archivaConfiguration.getConfiguration(); + assertTrue( "check value", configuration.getWebapp().getUi().isShowFindArtifacts() ); + + configuration.getWebapp().getUi().setShowFindArtifacts( false ); + + archivaConfiguration.save( configuration ); + + assertTrue( "Check file exists", baseFile.exists() ); + assertEquals( "Check base file is unchanged", "", + FileUtils.readFileToString( baseFile, null ) ); + assertTrue( "Check file exists", userFile.exists() ); + assertFalse( "Check base file is changed", + "".equals( FileUtils.readFileToString( userFile, null ) ) ); + + // check it + configuration = archivaConfiguration.getConfiguration(); + assertFalse( "check value", configuration.getWebapp().getUi().isShowFindArtifacts() ); + } + + public void testStoreConfigurationFailsWhenReadFromBothLocationsAppserverHasLists() + throws Exception + { + File baseFile = getTestFile( "target/test/test-file.xml" ); + baseFile.delete(); + assertFalse( baseFile.exists() ); + + File userFile = getTestFile( "target/test/test-file-user.xml" ); + userFile.delete(); + assertFalse( userFile.exists() ); + + baseFile.getParentFile().mkdirs(); + FileUtils.copyFile( getTestFile( "src/test/conf/conf-base.xml" ), baseFile ); + + userFile.getParentFile().mkdirs(); + FileUtils.writeStringToFile( userFile, "", null ); + + ArchivaConfiguration archivaConfiguration = + (ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-save-user" ); + + Configuration configuration = archivaConfiguration.getConfiguration(); + assertTrue( "check value", configuration.getWebapp().getUi().isAppletFindEnabled() ); + + configuration.getWebapp().getUi().setAppletFindEnabled( false ); + + try + { + archivaConfiguration.save( configuration ); + fail( "Configuration saving should not succeed if it was loaded from two locations" ); + } + catch ( IndeterminateConfigurationException e ) + { + // check it was reverted + configuration = archivaConfiguration.getConfiguration(); + assertTrue( "check value", configuration.getWebapp().getUi().isAppletFindEnabled() ); + } + } + + public void testLoadConfigurationFromInvalidBothLocationsOnDisk() + throws Exception + { + ArchivaConfiguration archivaConfiguration = + (ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-not-allowed-to-write-to-both" ); + Configuration config = archivaConfiguration.getConfiguration(); + + try + { + archivaConfiguration.save( config ); + fail( "Should have thrown a RegistryException because the configuration can't be saved." ); + } + catch ( RegistryException e ) + { + /* expected exception */ + } + } + + public void testLoadConfigurationFromInvalidUserLocationOnDisk() + throws Exception + { + File testConfDir = getTestFile( "target/test-appserver-base/conf/" ); + testConfDir.mkdirs(); + + ArchivaConfiguration archivaConfiguration = + (ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-not-allowed-to-write-to-user" ); + Configuration config = archivaConfiguration.getConfiguration(); + archivaConfiguration.save( config ); + // No Exception == test passes. + // Expected Path is: Should not have thrown an exception. + } + + public void testConfigurationUpgradeFrom09() + throws Exception + { + ArchivaConfiguration archivaConfiguration = + (ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-upgrade-09" ); + + // we just use the defaults when upgrading from 0.9 at this point. + Configuration configuration = archivaConfiguration.getConfiguration(); + assertConfiguration( configuration ); + assertEquals( "check network proxies", 0, configuration.getNetworkProxies().size() ); + + ManagedRepositoryConfiguration repository = + (ManagedRepositoryConfiguration) configuration.getManagedRepositories().get( 0 ); + + assertEquals( "check managed repositories", "${appserver.base}/data/repositories/internal", + repository.getLocation() ); + assertEquals( "check managed repositories", "Archiva Managed Internal Repository", repository.getName() ); + assertEquals( "check managed repositories", "internal", repository.getId() ); + assertEquals( "check managed repositories", "default", repository.getLayout() ); + assertTrue( "check managed repositories", repository.isScanned() ); + } + + public void testAutoDetectV1() + throws Exception + { + // Setup the autodetect-v1.xml file in the target directory (so we can save/load it) + File userFile = getTestFile( "target/test-autodetect-v1/archiva-user.xml" ); + userFile.delete(); + assertFalse( userFile.exists() ); + + userFile.getParentFile().mkdirs(); + FileUtils.copyFile( getTestFile( "src/test/conf/autodetect-v1.xml" ), userFile ); + + // Load the original (unconverted) archiva.xml + ArchivaConfiguration archivaConfiguration = + (ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-autodetect-v1" ); + + Configuration configuration = archivaConfiguration.getConfiguration(); + assertConfiguration( configuration ); + assertEquals( "check network proxies", 1, configuration.getNetworkProxies().size() ); + + ManagedRepositoryConfiguration repository = + (ManagedRepositoryConfiguration) configuration.getManagedRepositories().get( 0 ); + + assertEquals( "check managed repositories", "${appserver.base}/repositories/internal", + repository.getLocation() ); + assertEquals( "check managed repositories", "Archiva Managed Internal Repository", repository.getName() ); + assertEquals( "check managed repositories", "internal", repository.getId() ); + assertEquals( "check managed repositories", "default", repository.getLayout() ); + assertTrue( "check managed repositories", repository.isScanned() ); + + // Test that only 1 set of repositories exist. + assertEquals( "check managed repositories size.", 2, configuration.getManagedRepositories().size() ); + assertEquals( "check remote repositories size.", 2, configuration.getRemoteRepositories().size() ); + assertEquals( "check v1 repositories size.", 0, configuration.getRepositories().size() ); + + // Save the file. + archivaConfiguration.save( configuration ); + + // Release existing +// FIXME spring equivalent ? release( archivaConfiguration ); + + // Reload. + archivaConfiguration = + (ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-autodetect-v1" ); + configuration = archivaConfiguration.getConfiguration(); + + // Test that only 1 set of repositories exist. + assertEquals( "check managed repositories size.", 2, configuration.getManagedRepositories().size() ); + assertEquals( "check managed repositories size.", 2, configuration.getManagedRepositoriesAsMap().size() ); + assertEquals( "check remote repositories size.", 2, configuration.getRemoteRepositories().size() ); + assertEquals( "check remote repositories size.", 2, configuration.getRemoteRepositoriesAsMap().size() ); + assertEquals( "check v1 repositories size.", 0, configuration.getRepositories().size() ); + + String actualXML = FileUtils.readFileToString( userFile, null ); + XMLAssert.assertXpathNotExists( "//configuration/repositories/repository", actualXML ); + XMLAssert.assertXpathNotExists( "//configuration/repositories", actualXML ); + } + + public void testArchivaV1() + throws Exception + { + ArchivaConfiguration archivaConfiguration = + (ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-archiva-v1" ); + + Configuration configuration = archivaConfiguration.getConfiguration(); + assertConfiguration( configuration ); + assertEquals( "check network proxies", 1, configuration.getNetworkProxies().size() ); + + assertEquals( "check managed repositories", 2, configuration.getManagedRepositories().size() ); + assertEquals( "check v1 repositories size.", 0, configuration.getRepositories().size() ); + + Map map = configuration.getManagedRepositoriesAsMap(); + + ManagedRepositoryConfiguration repository = map.get( "internal" ); + assertEquals( "check managed repositories", "${appserver.base}/repositories/internal", + repository.getLocation() ); + assertEquals( "check managed repositories", "Archiva Managed Internal Repository", repository.getName() ); + assertEquals( "check managed repositories", "internal", repository.getId() ); + assertEquals( "check managed repositories", "default", repository.getLayout() ); + assertTrue( "check managed repositories", repository.isScanned() ); + assertFalse( "check managed repositories", repository.isSnapshots() ); + + repository = map.get( "snapshots" ); + assertEquals( "check managed repositories", "${appserver.base}/repositories/snapshots", + repository.getLocation() ); + assertEquals( "check managed repositories", "Archiva Managed Snapshot Repository", repository.getName() ); + assertEquals( "check managed repositories", "snapshots", repository.getId() ); + assertEquals( "check managed repositories", "default", repository.getLayout() ); + assertFalse( "check managed repositories", repository.isScanned() ); + assertTrue( "check managed repositories", repository.isSnapshots() ); + } + + public void testCronExpressionsWithComma() + throws Exception + { + File baseFile = getTestFile( "target/test/test-file.xml" ); + baseFile.delete(); + assertFalse( baseFile.exists() ); + + File userFile = getTestFile( "target/test/test-file-user.xml" ); + userFile.delete(); + assertFalse( userFile.exists() ); + + baseFile.getParentFile().mkdirs(); + FileUtils.copyFile( getTestFile( "src/test/conf/escape-cron-expressions.xml" ), baseFile ); + + userFile.getParentFile().mkdirs(); + FileUtils.writeStringToFile( userFile, "", null ); + + final ArchivaConfiguration archivaConfiguration = + (ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-cron-expressions" ); + + Configuration configuration = archivaConfiguration.getConfiguration(); + + ManagedRepositoryConfiguration repository = + (ManagedRepositoryConfiguration) configuration.getManagedRepositories().get( 0 ); + + assertEquals( "check cron expression", "0 0,30 * * * ?", repository.getRefreshCronExpression().trim() ); + + configuration.getDatabaseScanning().setCronExpression( "0 0,15 0 * * ?" ); + + // add a test listener to confirm it doesn't see the escaped format. We don't need to test the number of calls, + // etc. as it's done in other tests + archivaConfiguration.addListener( new ConfigurationListener() + { + public void configurationEvent( ConfigurationEvent event ) + { + assertEquals( ConfigurationEvent.SAVED, event.getType() ); + + Configuration configuration = archivaConfiguration.getConfiguration(); + + ManagedRepositoryConfiguration repository = + (ManagedRepositoryConfiguration) configuration.getManagedRepositories().get( 0 ); + + assertEquals( "check cron expression", "0 0,15 0 * * ?", + configuration.getDatabaseScanning().getCronExpression() ); + } + } ); + + archivaConfiguration.save( configuration ); + + configuration = archivaConfiguration.getConfiguration(); + + assertEquals( "check cron expression", "0 0,15 0 * * ?", + configuration.getDatabaseScanning().getCronExpression() ); + + // test for the escape character '\' showing up on repositories.jsp + repository.setRefreshCronExpression( "0 0,20 0 * * ?" ); + + archivaConfiguration.save( configuration ); + + repository = archivaConfiguration.getConfiguration().findManagedRepositoryById( "snapshots" ); + + assertEquals( "check cron expression", "0 0,20 0 * * ?", repository.getRefreshCronExpression() ); + } + + public void testRemoveLastElements() + throws Exception + { + File baseFile = getTestFile( "target/test/test-file.xml" ); + baseFile.delete(); + assertFalse( baseFile.exists() ); + + File userFile = getTestFile( "target/test/test-file-user.xml" ); + userFile.delete(); + assertFalse( userFile.exists() ); + + baseFile.getParentFile().mkdirs(); + FileUtils.copyFile( getTestFile( "src/test/conf/conf-single-list-elements.xml" ), baseFile ); + + userFile.getParentFile().mkdirs(); + FileUtils.writeStringToFile( userFile, "", null ); + + ArchivaConfiguration archivaConfiguration = + (ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-remove-central" ); + + Configuration configuration = archivaConfiguration.getConfiguration(); + + RepositoryGroupConfiguration repositoryGroup = ( RepositoryGroupConfiguration ) configuration.getRepositoryGroups().get( 0 ); + assertNotNull( repositoryGroup ); + configuration.removeRepositoryGroup( repositoryGroup ); + assertTrue( configuration.getRepositoryGroups().isEmpty() ); + + RemoteRepositoryConfiguration repository = configuration.getRemoteRepositoriesAsMap().get( "central" ); + assertNotNull( repository ); + configuration.removeRemoteRepository( repository ); + assertTrue( configuration.getRemoteRepositories().isEmpty() ); + + ManagedRepositoryConfiguration managedRepository = + configuration.getManagedRepositoriesAsMap().get( "snapshots" ); + assertNotNull( managedRepository ); + configuration.removeManagedRepository( managedRepository ); + assertTrue( configuration.getManagedRepositories().isEmpty() ); + + ProxyConnectorConfiguration proxyConnector = + (ProxyConnectorConfiguration) configuration.getProxyConnectors().get( 0 ); + assertNotNull( proxyConnector ); + configuration.removeProxyConnector( proxyConnector ); + assertTrue( configuration.getProxyConnectors().isEmpty() ); + + NetworkProxyConfiguration networkProxy = configuration.getNetworkProxiesAsMap().get( "proxy" ); + assertNotNull( networkProxy ); + configuration.removeNetworkProxy( networkProxy ); + assertTrue( configuration.getNetworkProxies().isEmpty() ); + + LegacyArtifactPath path = (LegacyArtifactPath) configuration.getLegacyArtifactPaths().get( 0 ); + assertNotNull( path ); + configuration.removeLegacyArtifactPath( path ); + assertTrue( configuration.getLegacyArtifactPaths().isEmpty() ); + + RepositoryScanningConfiguration scanning = configuration.getRepositoryScanning(); + String consumer = (String) scanning.getKnownContentConsumers().get( 0 ); + assertNotNull( consumer ); + scanning.removeKnownContentConsumer( consumer ); + assertTrue( scanning.getKnownContentConsumers().isEmpty() ); + consumer = (String) scanning.getInvalidContentConsumers().get( 0 ); + assertNotNull( consumer ); + scanning.removeInvalidContentConsumer( consumer ); + assertTrue( scanning.getInvalidContentConsumers().isEmpty() ); + + DatabaseScanningConfiguration databaseScanning = configuration.getDatabaseScanning(); + consumer = (String) databaseScanning.getCleanupConsumers().get( 0 ); + assertNotNull( consumer ); + databaseScanning.removeCleanupConsumer( consumer ); + assertTrue( databaseScanning.getCleanupConsumers().isEmpty() ); + consumer = (String) databaseScanning.getUnprocessedConsumers().get( 0 ); + assertNotNull( consumer ); + databaseScanning.removeUnprocessedConsumer( consumer ); + assertTrue( databaseScanning.getUnprocessedConsumers().isEmpty() ); + + archivaConfiguration.save( configuration ); + + archivaConfiguration = + (ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "test-read-saved" ); + configuration = archivaConfiguration.getConfiguration(); + assertNull( configuration.getRemoteRepositoriesAsMap().get( "central" ) ); + assertTrue( configuration.getRepositoryGroups().isEmpty() ); + assertNull( configuration.getManagedRepositoriesAsMap().get( "snapshots" ) ); + assertTrue( configuration.getProxyConnectors().isEmpty() ); + assertNull( configuration.getNetworkProxiesAsMap().get( "proxy" ) ); + assertTrue( configuration.getLegacyArtifactPaths().isEmpty() ); + scanning = configuration.getRepositoryScanning(); + assertTrue( scanning.getKnownContentConsumers().isEmpty() ); + assertTrue( scanning.getInvalidContentConsumers().isEmpty() ); + databaseScanning = configuration.getDatabaseScanning(); + assertTrue( databaseScanning.getCleanupConsumers().isEmpty() ); + assertTrue( databaseScanning.getUnprocessedConsumers().isEmpty() ); + } + + /** + * [MRM-582] Remote Repositories with empty and fields shouldn't be created in configuration. + */ + public void testGetConfigurationFixEmptyRemoteRepoUsernamePassword() + throws Exception + { + ArchivaConfiguration archivaConfiguration = (ArchivaConfiguration) lookup( + ArchivaConfiguration.class.getName(), + "test-configuration" ); + + Configuration configuration = archivaConfiguration.getConfiguration(); + assertConfiguration( configuration ); + assertEquals( "check remote repositories", 2, configuration.getRemoteRepositories().size() ); + + RemoteRepositoryConfiguration repository = (RemoteRepositoryConfiguration) configuration + .getRemoteRepositoriesAsMap().get( "maven2-repository.dev.java.net" ); + + assertEquals( "remote repository.url", "https://maven2-repository.dev.java.net/nonav/repository", repository.getUrl() ); + assertEquals( "remote repository.name", "Java.net Repository for Maven 2", repository.getName() ); + assertEquals( "remote repository.id", "maven2-repository.dev.java.net", repository.getId() ); + assertEquals( "remote repository.layout", "default", repository.getLayout() ); + assertNull( "remote repository.username == null", repository.getUsername() ); + assertNull( "remote repository.password == null", repository.getPassword() ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/maven/archiva/configuration/ConfigurationTest.java b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/maven/archiva/configuration/ConfigurationTest.java new file mode 100644 index 000000000..fa6699766 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/maven/archiva/configuration/ConfigurationTest.java @@ -0,0 +1,144 @@ +package org.apache.maven.archiva.configuration; + +/* + * 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; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Map; + +/** + * Test the generated Configuration class from Modello. This is primarily to test the hand coded methods. + */ +public class ConfigurationTest + extends TestCase +{ + private Configuration configuration = new Configuration(); + + public void testNetworkProxyRetrieval() + { + NetworkProxyConfiguration proxy1 = createNetworkProxy( "id1", "host1", 8080 ); + configuration.addNetworkProxy( proxy1 ); + NetworkProxyConfiguration proxy2 = createNetworkProxy( "id2", "host2", 9090 ); + configuration.addNetworkProxy( proxy2 ); + + Map map = configuration.getNetworkProxiesAsMap(); + assertNotNull( map ); + assertEquals( 2, map.size() ); + assertEquals( new HashSet( Arrays.asList( "id1", "id2" ) ), map.keySet() ); + assertEquals( new HashSet( Arrays.asList( proxy1, proxy2 ) ), + new HashSet( map.values() ) ); + } + + private NetworkProxyConfiguration createNetworkProxy( String id, String host, int port ) + { + NetworkProxyConfiguration proxy = new NetworkProxyConfiguration(); + proxy.setId( id ); + proxy.setHost( host ); + proxy.setPort( port ); + proxy.setProtocol( "http" ); + return proxy; + } + + public void testRemoteRepositoryRetrieval() + { + RemoteRepositoryConfiguration repo1 = createRemoteRepository( "id1", "name 1", "url 1" ); + configuration.addRemoteRepository( repo1 ); + RemoteRepositoryConfiguration repo2 = createRemoteRepository( "id2", "name 2", "url 2" ); + configuration.addRemoteRepository( repo2 ); + + Map map = configuration.getRemoteRepositoriesAsMap(); + assertNotNull( map ); + assertEquals( 2, map.size() ); + assertEquals( new HashSet( Arrays.asList( "id1", "id2" ) ), map.keySet() ); + assertEquals( new HashSet( Arrays.asList( repo1, repo2 ) ), + new HashSet( map.values() ) ); + + assertEquals( repo1, configuration.findRemoteRepositoryById( "id1" ) ); + assertEquals( repo2, configuration.findRemoteRepositoryById( "id2" ) ); + assertNull( configuration.findRemoteRepositoryById( "id3" ) ); + } + + private RemoteRepositoryConfiguration createRemoteRepository( String id, String name, String url ) + { + RemoteRepositoryConfiguration repo = new RemoteRepositoryConfiguration(); + repo.setId( id ); + repo.setName( name ); + repo.setLayout( "default" ); + repo.setUrl( url ); + return repo; + } + + public void testManagedRepositoryRetrieval() + { + ManagedRepositoryConfiguration repo1 = createManagedRepository( "id1", "name 1", "path 1", false ); + configuration.addManagedRepository( repo1 ); + ManagedRepositoryConfiguration repo2 = createManagedRepository( "id2", "name 2", "path 2", true ); + configuration.addManagedRepository( repo2 ); + + Map map = configuration.getManagedRepositoriesAsMap(); + assertNotNull( map ); + assertEquals( 2, map.size() ); + assertEquals( new HashSet( Arrays.asList( "id1", "id2" ) ), map.keySet() ); + assertEquals( new HashSet( Arrays.asList( repo1, repo2 ) ), + new HashSet( map.values() ) ); + + assertEquals( repo1, configuration.findManagedRepositoryById( "id1" ) ); + assertEquals( repo2, configuration.findManagedRepositoryById( "id2" ) ); + assertNull( configuration.findManagedRepositoryById( "id3" ) ); + } + + private ManagedRepositoryConfiguration createManagedRepository( String id, String name, String location, + boolean scanned ) + { + ManagedRepositoryConfiguration repo = new ManagedRepositoryConfiguration(); + repo.setId( id ); + repo.setName( name ); + repo.setLocation( location ); + repo.setScanned( scanned ); + return repo; + } + + public void testNetworkProxyRetrievalWhenEmpty() + { + Map map = configuration.getNetworkProxiesAsMap(); + assertNotNull( map ); + assertTrue( map.isEmpty() ); + } + + public void testRemoteRepositoryRetrievalWhenEmpty() + { + Map map = configuration.getRemoteRepositoriesAsMap(); + assertNotNull( map ); + assertTrue( map.isEmpty() ); + + assertNull( configuration.findRemoteRepositoryById( "id" ) ); + } + + public void testManagedRepositoryRetrievalWhenEmpty() + { + Map map = configuration.getManagedRepositoriesAsMap(); + assertNotNull( map ); + assertTrue( map.isEmpty() ); + + assertNull( configuration.findManagedRepositoryById( "id" ) ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/maven/archiva/configuration/FileTypesTest.java b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/maven/archiva/configuration/FileTypesTest.java new file mode 100644 index 000000000..6c5df3bf8 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/maven/archiva/configuration/FileTypesTest.java @@ -0,0 +1,55 @@ +package org.apache.maven.archiva.configuration; + +/* + * 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.codehaus.plexus.spring.PlexusInSpringTestCase; + +public class FileTypesTest + extends PlexusInSpringTestCase +{ + private FileTypes filetypes; + + protected void setUp() + throws Exception + { + super.setUp(); + + filetypes = (FileTypes) lookup( FileTypes.class ); + } + + public void testIsArtifact() + { + assertTrue( filetypes.matchesArtifactPattern( "test.maven-arch/poms/test-arch-2.0.3-SNAPSHOT.pom" ) ); + assertTrue( filetypes.matchesArtifactPattern( + "test/maven-arch/test-arch/2.0.3-SNAPSHOT/test-arch-2.0.3-SNAPSHOT.jar" ) ); + assertTrue( filetypes.matchesArtifactPattern( "org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.tar.gz" ) ); + + assertFalse( + filetypes.matchesArtifactPattern( "org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.tar.gz.sha1" ) ); + assertFalse( + filetypes.matchesArtifactPattern( "org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.tar.gz.md5" ) ); + assertFalse( + filetypes.matchesArtifactPattern( "org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.tar.gz.asc" ) ); + assertFalse( + filetypes.matchesArtifactPattern( "org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.tar.gz.pgp" ) ); + assertFalse( filetypes.matchesArtifactPattern( "org/apache/derby/derby/10.2.2.0/maven-metadata.xml" ) ); + assertFalse( filetypes.matchesArtifactPattern( "org/apache/derby/derby/maven-metadata.xml" ) ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/maven/archiva/configuration/LegacyArtifactPathTest.java b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/maven/archiva/configuration/LegacyArtifactPathTest.java new file mode 100644 index 000000000..dfeba0527 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/maven/archiva/configuration/LegacyArtifactPathTest.java @@ -0,0 +1,56 @@ +package org.apache.maven.archiva.configuration; + +/* + * 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; + +/** + * Test the generated LegacyArtifactPath class from Modello. This is primarily to test the hand coded methods. + * @since 1.1 + */ +public class LegacyArtifactPathTest + extends TestCase +{ + + private LegacyArtifactPath legacyArtifactPath = new LegacyArtifactPath(); + + public void testLegacyArtifactPathWithClassifierResolution() + { + legacyArtifactPath.setArtifact( "groupId:artifactId:version:classifier:type" ); + + assertEquals( "groupId", legacyArtifactPath.getGroupId() ); + assertEquals( "artifactId", legacyArtifactPath.getArtifactId() ); + assertEquals( "version", legacyArtifactPath.getVersion() ); + assertEquals( "classifier", legacyArtifactPath.getClassifier() ); + assertEquals( "type", legacyArtifactPath.getType() ); + } + + + public void testLegacyArtifactPathWithoutClassifierResolution() + { + legacyArtifactPath.setArtifact( "groupId:artifactId:version::type" ); + + assertEquals( "groupId", legacyArtifactPath.getGroupId() ); + assertEquals( "artifactId", legacyArtifactPath.getArtifactId() ); + assertEquals( "version", legacyArtifactPath.getVersion() ); + assertNull( legacyArtifactPath.getClassifier() ); + assertEquals( "type", legacyArtifactPath.getType() ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/maven/archiva/configuration/MavenProxyPropertyLoaderTest.java b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/maven/archiva/configuration/MavenProxyPropertyLoaderTest.java new file mode 100644 index 000000000..f472b6564 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/maven/archiva/configuration/MavenProxyPropertyLoaderTest.java @@ -0,0 +1,108 @@ +package org.apache.maven.archiva.configuration; + +/* + * 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; +import java.io.FileInputStream; +import java.io.IOException; +import java.util.Map; +import java.util.Properties; + +import org.codehaus.plexus.spring.PlexusInSpringTestCase; + +/** + * @author Edwin Punzalan + */ +public class MavenProxyPropertyLoaderTest + extends PlexusInSpringTestCase +{ + private MavenProxyPropertyLoader loader; + + /** + * {@inheritDoc} + * @see org.codehaus.plexus.spring.PlexusInSpringTestCase#getSpringConfigLocation() + */ + protected String getSpringConfigLocation() + { + return "org/apache/maven/archiva/configuration/spring-context.xml"; + } + + public void testLoadValidMavenProxyConfiguration() + throws IOException, InvalidConfigurationException + { + File confFile = getTestFile( "src/test/conf/maven-proxy-complete.conf" ); + + Configuration configuration = new Configuration(); + NetworkProxyConfiguration proxy = new NetworkProxyConfiguration(); + proxy.setHost( "original-host" ); + configuration.addNetworkProxy( proxy ); // overwritten + + loader.load( new FileInputStream( confFile ), configuration ); + + Map repositoryIdMap = configuration.getManagedRepositoriesAsMap(); + assertEquals( "Count repositories", 1, repositoryIdMap.size() ); + assertRepositoryExists( "maven-proxy", "target", repositoryIdMap.get( "maven-proxy" ) ); + + Map remoteRepositoryMap = configuration.getRemoteRepositoriesAsMap(); + assertEquals( "Count repositories", 4, remoteRepositoryMap.size() ); + assertRepositoryExists( "local-repo", "file://target", remoteRepositoryMap.get( "local-repo" ) ); + assertRepositoryExists( "www-ibiblio-org", "http://www.ibiblio.org/maven2", + remoteRepositoryMap.get( "www-ibiblio-org" ) ); + assertRepositoryExists( "dist-codehaus-org", "http://dist.codehaus.org", + remoteRepositoryMap.get( "dist-codehaus-org" ) ); + assertRepositoryExists( "private-example-com", "http://private.example.com/internal", + remoteRepositoryMap.get( "private-example-com" ) ); + } + + private void assertRepositoryExists( String id, String expectedLocation, ManagedRepositoryConfiguration repo ) + { + assertNotNull( "Repository id [" + id + "] should not be null", repo ); + assertEquals( "Repository id", id, repo.getId() ); + assertEquals( "Repository url", expectedLocation, repo.getLocation() ); + } + + private void assertRepositoryExists( String id, String expectedUrl, RemoteRepositoryConfiguration repo ) + { + assertNotNull( "Repository id [" + id + "] should not be null", repo ); + assertEquals( "Repository id", id, repo.getId() ); + assertEquals( "Repository url", expectedUrl, repo.getUrl() ); + } + + public void testInvalidConfiguration() + { + Configuration configuration = new Configuration(); + try + { + loader.load( new Properties(), configuration ); + fail( "Incomplete config should have failed" ); + } + catch ( InvalidConfigurationException e ) + { + assertTrue( true ); + } + } + + protected void setUp() + throws Exception + { + super.setUp(); + loader = new MavenProxyPropertyLoader(); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/maven/archiva/configuration/functors/ProxyConnectorConfigurationOrderComparatorTest.java b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/maven/archiva/configuration/functors/ProxyConnectorConfigurationOrderComparatorTest.java new file mode 100644 index 000000000..9d1552b6a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/maven/archiva/configuration/functors/ProxyConnectorConfigurationOrderComparatorTest.java @@ -0,0 +1,131 @@ +package org.apache.maven.archiva.configuration.functors; + +/* + * 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.maven.archiva.configuration.ProxyConnectorConfiguration; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import junit.framework.TestCase; + +/** + * ProxyConnectorConfigurationOrderComparatorTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ProxyConnectorConfigurationOrderComparatorTest + extends TestCase +{ + public void testSortOfAllZeros() + { + List proxies = new ArrayList(); + + proxies.add( createConnector( "corporate", 0 ) ); + proxies.add( createConnector( "snapshots", 0 ) ); + proxies.add( createConnector( "3rdparty", 0 ) ); + proxies.add( createConnector( "sandbox", 0 ) ); + + Collections.sort( proxies, ProxyConnectorConfigurationOrderComparator.getInstance() ); + + assertProxyOrder( new String[] { "corporate", "snapshots", "3rdparty", "sandbox" }, proxies ); + } + + public void testSortNormal() + { + List proxies = new ArrayList(); + + proxies.add( createConnector( "corporate", 3 ) ); + proxies.add( createConnector( "snapshots", 1 ) ); + proxies.add( createConnector( "3rdparty", 2 ) ); + proxies.add( createConnector( "sandbox", 4 ) ); + + Collections.sort( proxies, new ProxyConnectorConfigurationOrderComparator() ); + + assertProxyOrder( new String[] { "snapshots", "3rdparty", "corporate", "sandbox" }, proxies ); + } + + public void testSortPartial() + { + List proxies = new ArrayList(); + + proxies.add( createConnector( "corporate", 3 ) ); + proxies.add( createConnector( "snapshots", 0 ) ); + proxies.add( createConnector( "3rdparty", 2 ) ); + proxies.add( createConnector( "sandbox", 0 ) ); + + Collections.sort( proxies, new ProxyConnectorConfigurationOrderComparator() ); + + assertProxyOrder( new String[] { "3rdparty", "corporate", "snapshots", "sandbox" }, proxies ); + } + + private void assertProxyOrder( String[] ids, List proxies ) + { + assertEquals( "Proxies.size() == ids.length", ids.length, proxies.size() ); + + int orderFailedAt = -1; + + for ( int i = 0; i < ids.length; i++ ) + { + if ( !StringUtils.equals( ids[i], proxies.get( i ).getProxyId() ) ) + { + orderFailedAt = i; + break; + } + } + + if ( orderFailedAt >= 0 ) + { + StringBuffer msg = new StringBuffer(); + + msg.append( "Failed expected order of the proxies <" ); + msg.append( StringUtils.join( ids, ", " ) ); + msg.append( ">, actual <" ); + + boolean needsComma = false; + for ( ProxyConnectorConfiguration proxy : proxies ) + { + if ( needsComma ) + { + msg.append( ", " ); + } + msg.append( proxy.getProxyId() ); + needsComma = true; + } + msg.append( "> failure at index <" ).append( orderFailedAt ).append( ">." ); + + fail( msg.toString() ); + } + } + + private ProxyConnectorConfiguration createConnector( String id, int order ) + { + ProxyConnectorConfiguration proxy = new ProxyConnectorConfiguration(); + proxy.setProxyId( id ); + proxy.setOrder( order ); + proxy.setSourceRepoId( id + "_m" ); + proxy.setTargetRepoId( id + "_r" ); + + return proxy; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/maven/archiva/configuration/functors/RepositoryConfigurationComparatorTest.java b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/maven/archiva/configuration/functors/RepositoryConfigurationComparatorTest.java new file mode 100644 index 000000000..3dd314842 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/maven/archiva/configuration/functors/RepositoryConfigurationComparatorTest.java @@ -0,0 +1,52 @@ +package org.apache.maven.archiva.configuration.functors; + +/* + * 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; +import org.apache.maven.archiva.configuration.AbstractRepositoryConfiguration; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; + +import java.util.Comparator; + +/** + * Test the repositry comparator. + */ +public class RepositoryConfigurationComparatorTest + extends TestCase +{ + public void testComparator() + { + Comparator comparator = new RepositoryConfigurationComparator(); + + assertEquals( 0, comparator.compare( null, null ) ); + assertEquals( 1, comparator.compare( createRepository( "id" ), null ) ); + assertEquals( -1, comparator.compare( null, createRepository( "id" ) ) ); + assertEquals( 0, comparator.compare( createRepository( "id1" ), createRepository( "id1" ) ) ); + assertEquals( -1, comparator.compare( createRepository( "id1" ), createRepository( "id2" ) ) ); + assertEquals( 1, comparator.compare( createRepository( "id2" ), createRepository( "id1" ) ) ); + } + + private ManagedRepositoryConfiguration createRepository( String id ) + { + ManagedRepositoryConfiguration repo = new ManagedRepositoryConfiguration(); + repo.setId( id ); + return repo; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/resources/log4j.properties b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/resources/log4j.properties new file mode 100644 index 000000000..6d107570b --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/resources/log4j.properties @@ -0,0 +1,10 @@ +# Set root logger level to DEBUG and its only appender to A1. +log4j.rootLogger=INFO, A1 + +# A1 is set to be a ConsoleAppender. +log4j.appender.A1=org.apache.log4j.ConsoleAppender + +# A1 uses PatternLayout. +log4j.appender.A1.layout=org.apache.log4j.PatternLayout +log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/resources/org/apache/maven/archiva/configuration/ArchivaConfigurationTest.xml b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/resources/org/apache/maven/archiva/configuration/ArchivaConfigurationTest.xml new file mode 100644 index 000000000..0e84402c7 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/resources/org/apache/maven/archiva/configuration/ArchivaConfigurationTest.xml @@ -0,0 +1,495 @@ + + + + + + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + test-defaults-default-repo-location-exists + org.apache.maven.archiva.configuration.DefaultArchivaConfiguration + + + org.codehaus.plexus.registry.Registry + empty + + + org.apache.maven.archiva.policies.PreDownloadPolicy + prePolicies + + + org.apache.maven.archiva.policies.PostDownloadPolicy + postPolicies + + + + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + test-defaults + org.apache.maven.archiva.configuration.DefaultArchivaConfiguration + + + org.codehaus.plexus.registry.Registry + empty + + + org.apache.maven.archiva.policies.PreDownloadPolicy + prePolicies + + + org.apache.maven.archiva.policies.PostDownloadPolicy + postPolicies + + + + + org.codehaus.plexus.registry.Registry + empty + org.codehaus.plexus.registry.commons.CommonsConfigurationRegistry + + + + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + test-upgrade-09 + org.apache.maven.archiva.configuration.DefaultArchivaConfiguration + + + org.codehaus.plexus.registry.Registry + upgrade-09 + + + org.apache.maven.archiva.policies.PreDownloadPolicy + prePolicies + + + org.apache.maven.archiva.policies.PostDownloadPolicy + postPolicies + + + + + org.codehaus.plexus.registry.Registry + upgrade-09 + org.codehaus.plexus.registry.commons.CommonsConfigurationRegistry + + + + + + + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + test-configuration + org.apache.maven.archiva.configuration.DefaultArchivaConfiguration + + + org.codehaus.plexus.registry.Registry + configured + + + org.apache.maven.archiva.policies.PreDownloadPolicy + prePolicies + + + org.apache.maven.archiva.policies.PostDownloadPolicy + postPolicies + + + + + org.codehaus.plexus.registry.Registry + configured + org.codehaus.plexus.registry.commons.CommonsConfigurationRegistry + + + + + + + + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + test-autodetect-v1 + org.apache.maven.archiva.configuration.DefaultArchivaConfiguration + + + org.codehaus.plexus.registry.Registry + autodetect-v1 + + + org.apache.maven.archiva.policies.PreDownloadPolicy + prePolicies + + + org.apache.maven.archiva.policies.PostDownloadPolicy + postPolicies + + + + + org.codehaus.plexus.registry.Registry + autodetect-v1 + org.codehaus.plexus.registry.commons.CommonsConfigurationRegistry + + + + + + + + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + test-archiva-v1 + org.apache.maven.archiva.configuration.DefaultArchivaConfiguration + + + org.codehaus.plexus.registry.Registry + archiva-v1 + + + org.apache.maven.archiva.policies.PreDownloadPolicy + prePolicies + + + org.apache.maven.archiva.policies.PostDownloadPolicy + postPolicies + + + + + org.codehaus.plexus.registry.Registry + archiva-v1 + org.codehaus.plexus.registry.commons.CommonsConfigurationRegistry + + + + + + + + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + test-save + org.apache.maven.archiva.configuration.DefaultArchivaConfiguration + + + org.codehaus.plexus.registry.Registry + save + + + org.apache.maven.archiva.policies.PreDownloadPolicy + prePolicies + + + org.apache.maven.archiva.policies.PostDownloadPolicy + postPolicies + + + + + org.codehaus.plexus.registry.Registry + save + org.codehaus.plexus.registry.commons.CommonsConfigurationRegistry + + + + + + + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + test-save-user + org.apache.maven.archiva.configuration.DefaultArchivaConfiguration + + + org.codehaus.plexus.registry.Registry + save-user + + + org.apache.maven.archiva.policies.PreDownloadPolicy + prePolicies + + + org.apache.maven.archiva.policies.PostDownloadPolicy + postPolicies + + + + ${basedir}/target/test/test-file-user.xml + + + + org.codehaus.plexus.registry.Registry + save-user + org.codehaus.plexus.registry.commons.CommonsConfigurationRegistry + + + + + + + + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + test-configuration-both + org.apache.maven.archiva.configuration.DefaultArchivaConfiguration + + + org.codehaus.plexus.registry.Registry + configuration-both + + + org.apache.maven.archiva.policies.PreDownloadPolicy + prePolicies + + + org.apache.maven.archiva.policies.PostDownloadPolicy + postPolicies + + + + + org.codehaus.plexus.registry.Registry + configuration-both + org.codehaus.plexus.registry.commons.CommonsConfigurationRegistry + + + + + + + + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + test-read-saved + org.apache.maven.archiva.configuration.DefaultArchivaConfiguration + + + org.codehaus.plexus.registry.Registry + read-saved + + + org.apache.maven.archiva.policies.PreDownloadPolicy + prePolicies + + + org.apache.maven.archiva.policies.PostDownloadPolicy + postPolicies + + + + ${basedir}/target/test/test-file.xml + + + + org.codehaus.plexus.registry.Registry + read-saved + org.codehaus.plexus.registry.commons.CommonsConfigurationRegistry + + + + + + + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + test-cron-expressions + org.apache.maven.archiva.configuration.DefaultArchivaConfiguration + + + org.codehaus.plexus.registry.Registry + cron-expressions + + + org.apache.maven.archiva.policies.PreDownloadPolicy + prePolicies + + + org.apache.maven.archiva.policies.PostDownloadPolicy + postPolicies + + + + ${basedir}/target/test/test-file.xml + + + + org.codehaus.plexus.registry.Registry + cron-expressions + org.codehaus.plexus.registry.commons.CommonsConfigurationRegistry + + + + + + + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + test-remove-central + org.apache.maven.archiva.configuration.DefaultArchivaConfiguration + + + org.codehaus.plexus.registry.Registry + remove-central + + + org.apache.maven.archiva.policies.PreDownloadPolicy + prePolicies + + + org.apache.maven.archiva.policies.PostDownloadPolicy + postPolicies + + + + ${basedir}/target/test/test-file.xml + + + + org.codehaus.plexus.registry.Registry + remove-central + org.codehaus.plexus.registry.commons.CommonsConfigurationRegistry + + + + + + + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + test-not-allowed-to-write-to-both + org.apache.maven.archiva.configuration.DefaultArchivaConfiguration + + + org.codehaus.plexus.registry.Registry + not-allowed-to-write-to-both + + + org.apache.maven.archiva.policies.PreDownloadPolicy + prePolicies + + + org.apache.maven.archiva.policies.PostDownloadPolicy + postPolicies + + + + ${basedir}/target/*intentionally:invalid*/.m2/archiva-user.xml + ${basedir}/target/*intentionally:invalid*/conf/archiva.xml + + + + org.codehaus.plexus.registry.Registry + not-allowed-to-write-to-both + org.codehaus.plexus.registry.commons.CommonsConfigurationRegistry + + + + + + + + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + test-not-allowed-to-write-to-user + org.apache.maven.archiva.configuration.DefaultArchivaConfiguration + + + org.codehaus.plexus.registry.Registry + not-allowed-to-write-to-user + + + org.apache.maven.archiva.policies.PreDownloadPolicy + prePolicies + + + org.apache.maven.archiva.policies.PostDownloadPolicy + postPolicies + + + + ${basedir}/target/*intentionally:invalid*/.m2/archiva-user.xml + ${basedir}/target/test-appserver-base/conf/archiva.xml + + + + org.codehaus.plexus.registry.Registry + not-allowed-to-write-to-user + org.codehaus.plexus.registry.commons.CommonsConfigurationRegistry + + + + + + + + + + org.codehaus.plexus.cache.Cache + url-failures-cache + org.codehaus.plexus.cache.ehcache.EhcacheCache + URL Failure Cache + + 600 + false + false + 1000 + LRU + cache + false + + 2700 + + 1800 + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/resources/org/apache/maven/archiva/configuration/test-default-archiva.xml b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/resources/org/apache/maven/archiva/configuration/test-default-archiva.xml new file mode 100644 index 000000000..6f44eb4af --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-configuration/src/test/resources/org/apache/maven/archiva/configuration/test-default-archiva.xml @@ -0,0 +1,176 @@ + + 2 + + + internal + Archiva Managed Internal Repository + ${appserver.base}/target/test-classes/existing_internal + default + true + false + true + 0 0 * * * ? + 30 + + + snapshots + Archiva Managed Snapshot Repository + ${appserver.base}/target/test-classes/existing_snapshots + default + false + true + true + 0 0\,30 * * * ? + 30 + + + + + central + Central Repository + http://repo1.maven.org/maven2 + default + + + maven2-repository.dev.java.net + Java.net Repository for Maven 2 + http://download.java.net/maven/2/ + default + + + + + + internal + central + + + disabled + once + fix + cached + + + **/* + + + + internal + maven2-repository.dev.java.net + + + disabled + once + fix + cached + + + javax/** + org/jvnet/** + com/sun/** + + + + + + + jaxen/jars/jaxen-1.0-FCS-full.jar + jaxen:jaxen:1.0-FCS:full:jar + + + + + + + artifacts + + **/*.pom + **/*.jar + **/*.ear + **/*.war + **/*.car + **/*.sar + **/*.mar + **/*.rar + **/*.dtd + **/*.tld + **/*.tar.gz + **/*.tar.bz2 + **/*.zip + + + + indexable-content + + **/*.txt + **/*.TXT + **/*.block + **/*.config + **/*.pom + **/*.xml + **/*.xsd + **/*.dtd + **/*.tld + + + + auto-remove + + **/*.bak + **/*~ + **/*- + + + + ignored + + **/.htaccess + **/KEYS + **/*.rb + **/*.sh + **/.svn/** + **/.DAV/** + + + + + update-db-artifact + create-missing-checksums + update-db-repository-metadata + validate-checksum + validate-signature + index-content + auto-remove + auto-rename + metadata-updater + + + + update-db-bad-content + + + + + 0 0 * * * ? + + index-artifact + update-db-project + validate-repository-metadata + index-archive-toc + update-db-bytecode-stats + index-public-methods + + + not-present-remove-db-artifact + not-present-remove-db-project + not-present-remove-indexed + + + + + + true + true + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/pom.xml b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/pom.xml new file mode 100644 index 000000000..c33620442 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/pom.xml @@ -0,0 +1,45 @@ + + + + + 4.0.0 + + org.apache.archiva + archiva-consumers + 1.2-SNAPSHOT + ../pom.xml + + + archiva-consumer-api + Archiva Consumer API + jar + + + + org.apache.archiva + archiva-configuration + + + org.apache.archiva + archiva-model + + + commons-collections + commons-collections + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/AbstractMonitoredConsumer.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/AbstractMonitoredConsumer.java new file mode 100644 index 000000000..7c306e1e0 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/AbstractMonitoredConsumer.java @@ -0,0 +1,109 @@ +package org.apache.maven.archiva.consumers; + +/* + * 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.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; + +import org.apache.maven.archiva.configuration.FileTypes; + +/** + * AbstractMonitoredConsumer + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public abstract class AbstractMonitoredConsumer + implements BaseConsumer +{ + private Set monitors = new HashSet(); + + public void addConsumerMonitor( ConsumerMonitor monitor ) + { + monitors.add( monitor ); + } + + public void removeConsumerMonitor( ConsumerMonitor monitor ) + { + monitors.remove( monitor ); + } + + protected void triggerConsumerError( String type, String message ) + { + for ( Iterator itmonitors = monitors.iterator(); itmonitors.hasNext(); ) + { + ConsumerMonitor monitor = itmonitors.next(); + try + { + monitor.consumerError( this, type, message ); + } + catch ( Throwable t ) + { + /* discard error */ + } + } + } + + protected void triggerConsumerWarning( String type, String message ) + { + for ( Iterator itmonitors = monitors.iterator(); itmonitors.hasNext(); ) + { + ConsumerMonitor monitor = itmonitors.next(); + try + { + monitor.consumerWarning( this, type, message ); + } + catch ( Throwable t ) + { + /* discard error */ + } + } + } + + protected void triggerConsumerInfo( String message ) + { + for ( Iterator itmonitors = monitors.iterator(); itmonitors.hasNext(); ) + { + ConsumerMonitor monitor = itmonitors.next(); + try + { + monitor.consumerInfo( this, message ); + } + catch ( Throwable t ) + { + /* discard error */ + } + } + } + + public boolean isProcessUnmodified() + { + return false; + } + + protected List getDefaultArtifactExclusions() + { + return FileTypes.DEFAULT_EXCLUSIONS; + } + + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/ArchivaArtifactConsumer.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/ArchivaArtifactConsumer.java new file mode 100644 index 000000000..209051742 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/ArchivaArtifactConsumer.java @@ -0,0 +1,81 @@ +package org.apache.maven.archiva.consumers; + +/* + * 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.archiva.model.ArchivaArtifact; + +import java.util.List; + +/** + * ArchivaArtifactConsumer - consumer for ArchivaArtifact objects. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public interface ArchivaArtifactConsumer extends BaseConsumer +{ + /** + * Get the list of included file patterns for this consumer. + * + * @return the list of ({@link String}) artifact types to process. + */ + public List getIncludedTypes(); + + /** + *

+ * Event that triggers at the beginning of a scan. + *

+ * + *

+ * NOTE: This would be a good place to initialize the consumer, to lock any resources, and to + * generally start tracking the scan as a whole. + *

+ */ + public void beginScan(); + + /** + *

+ * Event indicating an {@link ArchivaArtifact} is to be processed by this consumer. + *

+ * + *

+ * NOTE: The consumer does not need to process the artifact immediately, can can opt to queue and/or track + * the artifact to be processed in batch. Just be sure to complete the processing by the {@link #completeScan()} + * event. + *

+ * + * @param file the file to process. + * @throws ConsumerException if there was a problem processing this file. + */ + public void processArchivaArtifact( ArchivaArtifact artifact ) throws ConsumerException; + + /** + *

+ * Event that triggers on the completion of a scan. + *

+ * + *

+ * NOTE: If the consumer opted to batch up processing requests in the + * {@link #processArchivaArtifact(ArchivaArtifact)} event this would be the last opportunity to drain + * any processing queue's. + *

+ */ + public void completeScan(); +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/BaseConsumer.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/BaseConsumer.java new file mode 100644 index 000000000..2f32f1fec --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/BaseConsumer.java @@ -0,0 +1,64 @@ +package org.apache.maven.archiva.consumers; + +/* + * 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. + */ + +/** + * BaseConsumer - the base set of methods for a consumer. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public abstract interface BaseConsumer +{ + /** + * This is the id for the consumer. + * + * @return the consumer id. + */ + public String getId(); + + /** + * The human readable description for this consumer. + * + * @return the human readable description for this consumer. + */ + public String getDescription(); + + /** + * Flag indicating permanance of consumer. (if it can be disabled or not) + * + * @return true indicating that consumer is permanent and cannot be disabled. + */ + public boolean isPermanent(); + + /** + * Add a consumer monitor to the consumer. + * + * @param monitor the monitor to add. + */ + public void addConsumerMonitor( ConsumerMonitor monitor ); + + /** + * Remove a consumer monitor. + * + * @param monitor the monitor to remove. + */ + public void removeConsumerMonitor( ConsumerMonitor monitor ); +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/ConsumerException.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/ConsumerException.java new file mode 100644 index 000000000..3b91c5ba3 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/ConsumerException.java @@ -0,0 +1,42 @@ +package org.apache.maven.archiva.consumers; + +/* + * 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.archiva.common.ArchivaException; + +/** + * ConsumerException - details about the failure of a consumer. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ConsumerException + extends ArchivaException +{ + public ConsumerException( String message, Throwable cause ) + { + super( message, cause ); + } + + public ConsumerException( String message ) + { + super( message ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/ConsumerMonitor.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/ConsumerMonitor.java new file mode 100644 index 000000000..971414764 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/ConsumerMonitor.java @@ -0,0 +1,55 @@ +package org.apache.maven.archiva.consumers; + +/* + * 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. + */ + +/** + * ConsumerMonitor - a monitor for consumers. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public interface ConsumerMonitor +{ + /** + * A consumer error event. + * + * @param consumer the consumer that caused the error. + * @param type the type of error. + * @param message the message about the error. + */ + public void consumerError( BaseConsumer consumer, String type, String message ); + + /** + * A consumer warning event. + * + * @param consumer the consumer that caused the warning. + * @param type the type of warning. + * @param message the message about the warning. + */ + public void consumerWarning( BaseConsumer consumer, String type, String message ); + + /** + * A consumer informational event. + * + * @param consumer the consumer that caused the informational message. + * @param message the message. + */ + public void consumerInfo( BaseConsumer consumer, String message ); +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/DatabaseCleanupConsumer.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/DatabaseCleanupConsumer.java new file mode 100644 index 000000000..e9bbd0946 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/DatabaseCleanupConsumer.java @@ -0,0 +1,32 @@ +package org.apache.maven.archiva.consumers; + +/* + * 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. + */ + +/** + * DatabaseCleanupConsumer + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public interface DatabaseCleanupConsumer + extends ArchivaArtifactConsumer +{ + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/DatabaseUnprocessedArtifactConsumer.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/DatabaseUnprocessedArtifactConsumer.java new file mode 100644 index 000000000..b34d0dd7f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/DatabaseUnprocessedArtifactConsumer.java @@ -0,0 +1,32 @@ +package org.apache.maven.archiva.consumers; + +/* + * 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. + */ + +/** + * DatabaseUnprocessedArtifactConsumer + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public interface DatabaseUnprocessedArtifactConsumer + extends ArchivaArtifactConsumer +{ + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/InvalidRepositoryContentConsumer.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/InvalidRepositoryContentConsumer.java new file mode 100644 index 000000000..af31c545a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/InvalidRepositoryContentConsumer.java @@ -0,0 +1,32 @@ +package org.apache.maven.archiva.consumers; + +/* + * 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. + */ + +/** + * Consumer for Invalid Repository Content + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public interface InvalidRepositoryContentConsumer + extends RepositoryContentConsumer +{ + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/KnownRepositoryContentConsumer.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/KnownRepositoryContentConsumer.java new file mode 100644 index 000000000..884101143 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/KnownRepositoryContentConsumer.java @@ -0,0 +1,32 @@ +package org.apache.maven.archiva.consumers; + +/* + * 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. + */ + +/** + * Consumer for Known Repository Content. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public interface KnownRepositoryContentConsumer + extends RepositoryContentConsumer +{ + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/RepositoryContentConsumer.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/RepositoryContentConsumer.java new file mode 100644 index 000000000..9b23e1713 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/RepositoryContentConsumer.java @@ -0,0 +1,101 @@ +package org.apache.maven.archiva.consumers; + +/* + * 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.archiva.configuration.ManagedRepositoryConfiguration; + +import java.util.Date; +import java.util.List; + +/** + * A consumer of content (files) in the repository. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public interface RepositoryContentConsumer extends BaseConsumer +{ + /** + * Get the list of included file patterns for this consumer. + * + * @return the list of {@link String} patterns. (example: "**/*.pom") + */ + public List getIncludes(); + + /** + * Get the list of excluded file patterns for this consumer. + * + * @return the list of {@link String} patterns. (example: "**/*.pom") - (can be null for no exclusions) + */ + public List getExcludes(); + + /** + *

+ * Event that triggers at the beginning of a scan. + *

+ * + *

+ * NOTE: This would be a good place to initialize the consumer, to lock any resources, and to + * generally start tracking the scan as a whole. + *

+ * + * @param repository the repository that this consumer is being used for. + * @param whenGathered the start of the repository scan + * @throws ConsumerException if there was a problem with using the provided repository with the consumer. + */ + public void beginScan( ManagedRepositoryConfiguration repository, Date whenGathered ) throws ConsumerException; + + /** + *

+ * Event indicating a file is to be processed by this consumer. + *

+ * + *

+ * NOTE: The consumer does not need to process the file immediately, can can opt to queue and/or track + * the files to be processed in batch. Just be sure to complete the processing by the {@link #completeScan()} + * event. + *

+ * + * @param path the relative file path (in the repository) to process. + * @throws ConsumerException if there was a problem processing this file. + */ + public void processFile( String path ) throws ConsumerException; + + /** + *

+ * Event that triggers on the completion of a scan. + *

+ * + *

+ * NOTE: If the consumer opted to batch up processing requests in the {@link #processFile(String)} event + * this would be the last opportunity to drain any processing queue's. + *

+ * + * @todo! this is never called by the RepositoryScannerInstance + */ + public void completeScan(); + + /** + * Whether the consumer should process files that have not been modified since the time passed in to the scan + * method. + * @return whether to process the unmodified files + */ + boolean isProcessUnmodified(); +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/functors/PermanentConsumerPredicate.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/functors/PermanentConsumerPredicate.java new file mode 100644 index 000000000..92b9e3a55 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/functors/PermanentConsumerPredicate.java @@ -0,0 +1,48 @@ +package org.apache.maven.archiva.consumers.functors; + +/* + * 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.collections.Predicate; +import org.apache.maven.archiva.consumers.BaseConsumer; + +/** + * Selects Consumers that are flaged as 'permanent'. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class PermanentConsumerPredicate + implements Predicate +{ + + public boolean evaluate( Object object ) + { + boolean satisfies = false; + + if ( object instanceof BaseConsumer ) + { + BaseConsumer consumer = (BaseConsumer) object; + satisfies = consumer.isPermanent(); + } + + return satisfies; + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/pom.xml b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/pom.xml new file mode 100644 index 000000000..8b85df5a0 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/pom.xml @@ -0,0 +1,73 @@ + + + + + 4.0.0 + + org.apache.archiva + archiva-consumers + 1.2-SNAPSHOT + ../pom.xml + + + archiva-core-consumers + Archiva Consumers :: Core Consumers + + + + org.apache.archiva + archiva-database + + + org.apache.archiva + archiva-indexer + + + org.apache.archiva + archiva-configuration + + + org.apache.archiva + archiva-consumer-api + + + org.apache.archiva + archiva-repository-layer + + + org.codehaus.plexus + plexus-digest + + + org.codehaus.plexus + plexus-spring + test + + + + + hsqldb + hsqldb + test + + + xmlunit + xmlunit + test + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/ArtifactMissingChecksumsConsumer.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/ArtifactMissingChecksumsConsumer.java new file mode 100644 index 000000000..553289929 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/ArtifactMissingChecksumsConsumer.java @@ -0,0 +1,208 @@ +package org.apache.maven.archiva.consumers.core; + +/* + * 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.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.FileTypes; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer; +import org.apache.maven.archiva.consumers.ConsumerException; +import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer; +import org.codehaus.plexus.digest.ChecksumFile; +import org.codehaus.plexus.digest.Digester; +import org.codehaus.plexus.digest.DigesterException; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException; +import org.codehaus.plexus.registry.Registry; +import org.codehaus.plexus.registry.RegistryListener; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * ArtifactMissingChecksumsConsumer - Create missing checksums for the artifact. + * + * @author Joakim Erdfelt + * @version $Id$ + * @plexus.component role="org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer" + * role-hint="create-missing-checksums" + * instantiation-strategy="per-lookup" + */ +public class ArtifactMissingChecksumsConsumer + extends AbstractMonitoredConsumer + implements KnownRepositoryContentConsumer, RegistryListener, Initializable +{ + /** + * @plexus.configuration default-value="create-missing-checksums" + */ + private String id; + + /** + * @plexus.configuration default-value="Create Missing Checksums (.sha1 & .md5)" + */ + private String description; + + /** + * @plexus.requirement + */ + private ArchivaConfiguration configuration; + + /** + * @plexus.requirement + */ + private FileTypes filetypes; + + /** + * @plexus.requirement role-hint="sha1" + */ + private Digester digestSha1; + + /** + * @plexus.requirement role-hint="md5"; + */ + private Digester digestMd5; + + /** + * @plexus.requirement + */ + private ChecksumFile checksum; + + private static final String TYPE_CHECKSUM_NOT_FILE = "checksum-bad-not-file"; + + private static final String TYPE_CHECKSUM_CANNOT_CALC = "checksum-calc-failure"; + + private static final String TYPE_CHECKSUM_CANNOT_CREATE = "checksum-create-failure"; + + private File repositoryDir; + + private List propertyNameTriggers = new ArrayList(); + + private List includes = new ArrayList(); + + public String getId() + { + return this.id; + } + + public String getDescription() + { + return this.description; + } + + public boolean isPermanent() + { + return false; + } + + public void beginScan( ManagedRepositoryConfiguration repo, Date whenGathered ) + throws ConsumerException + { + this.repositoryDir = new File( repo.getLocation() ); + } + + public void completeScan() + { + /* do nothing */ + } + + public List getExcludes() + { + return getDefaultArtifactExclusions(); + } + + public List getIncludes() + { + return includes; + } + + public void processFile( String path ) + throws ConsumerException + { + createIfMissing( path, digestSha1 ); + createIfMissing( path, digestMd5 ); + } + + private void createIfMissing( String path, Digester digester ) + { + File checksumFile = new File( this.repositoryDir, path + digester.getFilenameExtension() ); + if ( !checksumFile.exists() ) + { + try + { + checksum.createChecksum( new File( this.repositoryDir, path ), digester ); + triggerConsumerInfo( "Created missing checksum file " + checksumFile.getAbsolutePath() ); + } + catch ( DigesterException e ) + { + triggerConsumerError( TYPE_CHECKSUM_CANNOT_CALC, + "Cannot calculate checksum for file " + checksumFile + ": " + e.getMessage() ); + } + catch ( IOException e ) + { + triggerConsumerError( TYPE_CHECKSUM_CANNOT_CREATE, + "Cannot create checksum for file " + checksumFile + ": " + e.getMessage() ); + } + } + else if ( !checksumFile.isFile() ) + { + triggerConsumerWarning( TYPE_CHECKSUM_NOT_FILE, + "Checksum file " + checksumFile.getAbsolutePath() + " is not a file." ); + } + + } + + public void afterConfigurationChange( Registry registry, String propertyName, Object propertyValue ) + { + if ( propertyNameTriggers.contains( propertyName ) ) + { + initIncludes(); + } + } + + public void beforeConfigurationChange( Registry registry, String propertyName, Object propertyValue ) + { + /* do nothing */ + } + + private void initIncludes() + { + includes.clear(); + + includes.addAll( filetypes.getFileTypePatterns( FileTypes.ARTIFACTS ) ); + } + + public void initialize() + throws InitializationException + { + propertyNameTriggers = new ArrayList(); + propertyNameTriggers.add( "repositoryScanning" ); + propertyNameTriggers.add( "fileTypes" ); + propertyNameTriggers.add( "fileType" ); + propertyNameTriggers.add( "patterns" ); + propertyNameTriggers.add( "pattern" ); + + configuration.addChangeListener( this ); + + initIncludes(); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/AutoRemoveConsumer.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/AutoRemoveConsumer.java new file mode 100644 index 000000000..618b91f21 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/AutoRemoveConsumer.java @@ -0,0 +1,158 @@ +package org.apache.maven.archiva.consumers.core; + +/* + * 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.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.FileTypes; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer; +import org.apache.maven.archiva.consumers.ConsumerException; +import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException; +import org.codehaus.plexus.registry.Registry; +import org.codehaus.plexus.registry.RegistryListener; + +import java.io.File; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * AutoRemoveConsumer + * + * @author Joakim Erdfelt + * @version $Id$ + * @plexus.component role="org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer" + * role-hint="auto-remove" + * instantiation-strategy="per-lookup" + */ +public class AutoRemoveConsumer + extends AbstractMonitoredConsumer + implements KnownRepositoryContentConsumer, RegistryListener, Initializable +{ + /** + * @plexus.configuration default-value="auto-remove" + */ + private String id; + + /** + * @plexus.configuration default-value="Automatically Remove File from Filesystem." + */ + private String description; + + /** + * @plexus.requirement + */ + private ArchivaConfiguration configuration; + + /** + * @plexus.requirement + */ + private FileTypes filetypes; + + private File repositoryDir; + + private List propertyNameTriggers = new ArrayList(); + + private List includes = new ArrayList(); + + public String getId() + { + return this.id; + } + + public String getDescription() + { + return this.description; + } + + public boolean isPermanent() + { + return false; + } + + public void beginScan( ManagedRepositoryConfiguration repository, Date whenGathered ) + throws ConsumerException + { + this.repositoryDir = new File( repository.getLocation() ); + } + + public void completeScan() + { + /* do nothing */ + } + + public List getExcludes() + { + return null; + } + + public List getIncludes() + { + return includes; + } + + public void processFile( String path ) + throws ConsumerException + { + File file = new File( this.repositoryDir, path ); + if ( file.exists() ) + { + triggerConsumerInfo( "(Auto) Removing File: " + file.getAbsolutePath() ); + file.delete(); + } + } + + public void afterConfigurationChange( Registry registry, String propertyName, Object propertyValue ) + { + if ( propertyNameTriggers.contains( propertyName ) ) + { + initIncludes(); + } + } + + public void beforeConfigurationChange( Registry registry, String propertyName, Object propertyValue ) + { + /* do nothing */ + } + + private void initIncludes() + { + includes.clear(); + + includes.addAll( filetypes.getFileTypePatterns( FileTypes.AUTO_REMOVE ) ); + } + + public void initialize() + throws InitializationException + { + propertyNameTriggers = new ArrayList(); + propertyNameTriggers.add( "repositoryScanning" ); + propertyNameTriggers.add( "fileTypes" ); + propertyNameTriggers.add( "fileType" ); + propertyNameTriggers.add( "patterns" ); + propertyNameTriggers.add( "pattern" ); + + configuration.addChangeListener( this ); + + initIncludes(); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/AutoRenameConsumer.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/AutoRenameConsumer.java new file mode 100644 index 000000000..4c694473e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/AutoRenameConsumer.java @@ -0,0 +1,147 @@ +package org.apache.maven.archiva.consumers.core; + +/* + * 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.io.FileUtils; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer; +import org.apache.maven.archiva.consumers.ConsumerException; +import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +/** + * AutoRenameConsumer + * + * @author Joakim Erdfelt + * @version $Id$ + * @plexus.component role="org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer" + * role-hint="auto-rename" + * instantiation-strategy="per-lookup" + */ +public class AutoRenameConsumer + extends AbstractMonitoredConsumer + implements KnownRepositoryContentConsumer +{ + /** + * @plexus.configuration default-value="auto-rename" + */ + private String id; + + /** + * @plexus.configuration default-value="Automatically rename common artifact mistakes." + */ + private String description; + + private static final String RENAME_FAILURE = "rename_failure"; + + private File repositoryDir; + + private List includes = new ArrayList(); + + private Map extensionRenameMap = new HashMap(); + + public AutoRenameConsumer() + { + includes.add( "**/*.distribution-tgz" ); + includes.add( "**/*.distribution-zip" ); + includes.add( "**/*.plugin" ); + + extensionRenameMap.put( ".distribution-tgz", ".tar.gz" ); + extensionRenameMap.put( ".distribution-zip", ".zip" ); + extensionRenameMap.put( ".plugin", ".jar" ); + } + + public String getId() + { + return this.id; + } + + public String getDescription() + { + return this.description; + } + + public boolean isPermanent() + { + return false; + } + + public void beginScan( ManagedRepositoryConfiguration repository, Date whenGathered ) + throws ConsumerException + { + this.repositoryDir = new File( repository.getLocation() ); + } + + public void completeScan() + { + /* do nothing */ + } + + public List getExcludes() + { + return null; + } + + public List getIncludes() + { + return includes; + } + + public void processFile( String path ) + throws ConsumerException + { + File file = new File( this.repositoryDir, path ); + if ( file.exists() ) + { + Iterator itExtensions = this.extensionRenameMap.keySet().iterator(); + while ( itExtensions.hasNext() ) + { + String extension = (String) itExtensions.next(); + if ( path.endsWith( extension ) ) + { + String fixedExtension = (String) this.extensionRenameMap.get( extension ); + String correctedPath = path.substring( 0, path.length() - extension.length() ) + fixedExtension; + File to = new File( this.repositoryDir, correctedPath ); + try + { + // Rename the file. + FileUtils.moveFile( file, to ); + } + catch ( IOException e ) + { + triggerConsumerWarning( RENAME_FAILURE, "Unable to rename " + path + " to " + correctedPath + + ": " + e.getMessage() ); + } + } + } + + triggerConsumerInfo( "(Auto) Removing File: " + file.getAbsolutePath() ); + file.delete(); + } + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/MetadataUpdaterConsumer.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/MetadataUpdaterConsumer.java new file mode 100644 index 000000000..5119b3267 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/MetadataUpdaterConsumer.java @@ -0,0 +1,299 @@ +package org.apache.maven.archiva.consumers.core; + +/* + * 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; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.ConfigurationNames; +import org.apache.maven.archiva.configuration.FileTypes; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer; +import org.apache.maven.archiva.consumers.ConsumerException; +import org.apache.maven.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.maven.archiva.repository.ContentNotFoundException; +import org.apache.maven.archiva.repository.ManagedRepositoryContent; +import org.apache.maven.archiva.repository.RepositoryContentFactory; +import org.apache.maven.archiva.repository.RepositoryException; +import org.apache.maven.archiva.repository.RepositoryNotFoundException; +import org.apache.maven.archiva.repository.layout.LayoutException; +import org.apache.maven.archiva.repository.metadata.MetadataTools; +import org.apache.maven.archiva.repository.metadata.RepositoryMetadataException; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException; +import org.codehaus.plexus.registry.Registry; +import org.codehaus.plexus.registry.RegistryListener; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * MetadataUpdaterConsumer will create and update the metadata present within the repository. + * + * @author Joakim Erdfelt + * @version $Id$ + * @plexus.component role="org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer" + * role-hint="metadata-updater" + * instantiation-strategy="per-lookup" + */ +public class MetadataUpdaterConsumer + extends AbstractMonitoredConsumer + implements KnownRepositoryContentConsumer, RegistryListener, Initializable +{ + private Logger log = LoggerFactory.getLogger( MetadataUpdaterConsumer.class ); + + /** + * @plexus.configuration default-value="metadata-updater" + */ + private String id; + + /** + * @plexus.configuration default-value="Update / Create maven-metadata.xml files" + */ + private String description; + + /** + * @plexus.requirement + */ + private RepositoryContentFactory repositoryFactory; + + /** + * @plexus.requirement + */ + private MetadataTools metadataTools; + + /** + * @plexus.requirement + */ + private ArchivaConfiguration configuration; + + /** + * @plexus.requirement + */ + private FileTypes filetypes; + + private static final String TYPE_METADATA_BAD_INTERNAL_REF = "metadata-bad-internal-ref"; + + private static final String TYPE_METADATA_WRITE_FAILURE = "metadata-write-failure"; + + private static final String TYPE_METADATA_IO = "metadata-io-warning"; + + private ManagedRepositoryContent repository; + + private File repositoryDir; + + private List includes = new ArrayList(); + + private long scanStartTimestamp = 0; + + public String getDescription() + { + return description; + } + + public String getId() + { + return id; + } + + public void setIncludes( List includes ) + { + this.includes = includes; + } + + public void beginScan( ManagedRepositoryConfiguration repoConfig, Date whenGathered ) + throws ConsumerException + { + try + { + this.repository = repositoryFactory.getManagedRepositoryContent( repoConfig.getId() ); + this.repositoryDir = new File( repository.getRepoRoot() ); + this.scanStartTimestamp = System.currentTimeMillis(); + } + catch ( RepositoryNotFoundException e ) + { + throw new ConsumerException( e.getMessage(), e ); + } + catch ( RepositoryException e ) + { + throw new ConsumerException( e.getMessage(), e ); + } + } + + public void completeScan() + { + /* do nothing here */ + } + + public List getExcludes() + { + return getDefaultArtifactExclusions(); + } + + public List getIncludes() + { + return this.includes; + } + + public void processFile( String path ) + throws ConsumerException + { + try + { + ArtifactReference artifact = repository.toArtifactReference( path ); + updateVersionMetadata( artifact, path ); + updateProjectMetadata( artifact, path ); + } + catch ( LayoutException e ) + { + throw new ConsumerException( "Unable to convert to artifact reference: " + path, e ); + } + } + + private void updateProjectMetadata( ArtifactReference artifact, String path ) + { + ProjectReference projectRef = new ProjectReference(); + projectRef.setGroupId( artifact.getGroupId() ); + projectRef.setArtifactId( artifact.getArtifactId() ); + + try + { + String metadataPath = this.metadataTools.toPath( projectRef ); + + File projectMetadata = new File( this.repositoryDir, metadataPath ); + + if ( projectMetadata.exists() && ( projectMetadata.lastModified() >= this.scanStartTimestamp ) ) + { + // This metadata is up to date. skip it. + log.debug( "Skipping uptodate metadata: " + this.metadataTools.toPath( projectRef ) ); + return; + } + + metadataTools.updateMetadata( this.repository, projectRef ); + log.debug( "Updated metadata: " + this.metadataTools.toPath( projectRef ) ); + } + catch ( LayoutException e ) + { + triggerConsumerWarning( TYPE_METADATA_BAD_INTERNAL_REF, "Unable to convert path [" + path + + "] to an internal project reference: " + e.getMessage() ); + } + catch ( RepositoryMetadataException e ) + { + triggerConsumerError( TYPE_METADATA_WRITE_FAILURE, "Unable to write project metadata for artifact [" + path + + "]: " + e.getMessage() ); + } + catch ( IOException e ) + { + triggerConsumerWarning( TYPE_METADATA_IO, "Project metadata not written due to IO warning: " + + e.getMessage() ); + } + catch ( ContentNotFoundException e ) + { + triggerConsumerWarning( TYPE_METADATA_IO, + "Project metadata not written because no versions were found to update: " + + e.getMessage() ); + } + } + + private void updateVersionMetadata( ArtifactReference artifact, String path ) + { + VersionedReference versionRef = new VersionedReference(); + versionRef.setGroupId( artifact.getGroupId() ); + versionRef.setArtifactId( artifact.getArtifactId() ); + versionRef.setVersion( artifact.getVersion() ); + + try + { + String metadataPath = this.metadataTools.toPath( versionRef ); + + File projectMetadata = new File( this.repositoryDir, metadataPath ); + + if ( projectMetadata.exists() && ( projectMetadata.lastModified() >= this.scanStartTimestamp ) ) + { + // This metadata is up to date. skip it. + log.debug( "Skipping uptodate metadata: " + this.metadataTools.toPath( versionRef ) ); + return; + } + + metadataTools.updateMetadata( this.repository, versionRef ); + log.debug( "Updated metadata: " + this.metadataTools.toPath( versionRef ) ); + } + catch ( LayoutException e ) + { + triggerConsumerWarning( TYPE_METADATA_BAD_INTERNAL_REF, "Unable to convert path [" + path + + "] to an internal version reference: " + e.getMessage() ); + } + catch ( RepositoryMetadataException e ) + { + triggerConsumerError( TYPE_METADATA_WRITE_FAILURE, "Unable to write version metadata for artifact [" + path + + "]: " + e.getMessage() ); + } + catch ( IOException e ) + { + triggerConsumerWarning( TYPE_METADATA_IO, "Version metadata not written due to IO warning: " + + e.getMessage() ); + } + catch ( ContentNotFoundException e ) + { + triggerConsumerWarning( TYPE_METADATA_IO, + "Version metadata not written because no versions were found to update: " + + e.getMessage() ); + } + } + + public boolean isPermanent() + { + return false; + } + + public void afterConfigurationChange( Registry registry, String propertyName, Object propertyValue ) + { + if ( ConfigurationNames.isRepositoryScanning( propertyName ) ) + { + initIncludes(); + } + } + + public void beforeConfigurationChange( Registry registry, String propertyName, Object propertyValue ) + { + /* do nothing here */ + } + + private void initIncludes() + { + includes.clear(); + + includes.addAll( filetypes.getFileTypePatterns( FileTypes.ARTIFACTS ) ); + } + + public void initialize() + throws InitializationException + { + configuration.addChangeListener( this ); + + initIncludes(); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/ValidateChecksumConsumer.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/ValidateChecksumConsumer.java new file mode 100644 index 000000000..66e0f24a6 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/ValidateChecksumConsumer.java @@ -0,0 +1,156 @@ +package org.apache.maven.archiva.consumers.core; + +/* + * 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.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer; +import org.apache.maven.archiva.consumers.ConsumerException; +import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer; +import org.codehaus.plexus.digest.ChecksumFile; +import org.codehaus.plexus.digest.Digester; +import org.codehaus.plexus.digest.DigesterException; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Date; +import java.util.Iterator; +import java.util.List; + +/** + * ValidateChecksumConsumer - validate the provided checksum against the file it represents. + * + * @author Joakim Erdfelt + * @version $Id$ + * @plexus.component role="org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer" + * role-hint="validate-checksum" + * instantiation-strategy="per-lookup" + */ +public class ValidateChecksumConsumer + extends AbstractMonitoredConsumer + implements KnownRepositoryContentConsumer, Initializable +{ + private static final String NOT_VALID_CHECKSUM = "checksum-not-valid"; + + private static final String CHECKSUM_NOT_FOUND = "checksum-not-found"; + + private static final String CHECKSUM_DIGESTER_FAILURE = "checksum-digester-failure"; + + private static final String CHECKSUM_IO_ERROR = "checksum-io-error"; + + /** + * @plexus.configuration default-value="validate-checksums" + */ + private String id; + + /** + * @plexus.configuration default-value="Validate checksums against file." + */ + private String description; + + /** + * @plexus.requirement + */ + private ChecksumFile checksum; + + /** + * @plexus.requirement role="org.codehaus.plexus.digest.Digester" + */ + private List digesterList; + + private File repositoryDir; + + private List includes = new ArrayList(); + + public String getId() + { + return this.id; + } + + public String getDescription() + { + return this.description; + } + + public boolean isPermanent() + { + return false; + } + + public void beginScan( ManagedRepositoryConfiguration repository, Date whenGathered ) + throws ConsumerException + { + this.repositoryDir = new File( repository.getLocation() ); + } + + public void completeScan() + { + /* nothing to do */ + } + + public List getExcludes() + { + return null; + } + + public List getIncludes() + { + return this.includes; + } + + public void processFile( String path ) + throws ConsumerException + { + File checksumFile = new File( this.repositoryDir, path ); + try + { + if ( !checksum.isValidChecksum( checksumFile ) ) + { + triggerConsumerWarning( NOT_VALID_CHECKSUM, "The checksum for " + checksumFile + " is invalid." ); + } + } + catch ( FileNotFoundException e ) + { + triggerConsumerError( CHECKSUM_NOT_FOUND, "File not found during checksum validation: " + e.getMessage() ); + } + catch ( DigesterException e ) + { + triggerConsumerError( CHECKSUM_DIGESTER_FAILURE, + "Digester failure during checksum validation on " + checksumFile ); + } + catch ( IOException e ) + { + triggerConsumerError( CHECKSUM_IO_ERROR, "Checksum I/O error during validation on " + checksumFile ); + } + } + + public void initialize() + throws InitializationException + { + for ( Iterator itDigesters = digesterList.iterator(); itDigesters.hasNext(); ) + { + Digester digester = itDigesters.next(); + includes.add( "**/*" + digester.getFilenameExtension() ); + } + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/AbstractRepositoryPurge.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/AbstractRepositoryPurge.java new file mode 100644 index 000000000..f5aaf21ad --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/AbstractRepositoryPurge.java @@ -0,0 +1,217 @@ +package org.apache.maven.archiva.consumers.core.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. + */ + +import org.apache.maven.archiva.database.ArchivaDatabaseException; +import org.apache.maven.archiva.database.ArtifactDAO; +import org.apache.maven.archiva.indexer.RepositoryContentIndex; +import org.apache.maven.archiva.indexer.RepositoryIndexException; +import org.apache.maven.archiva.indexer.bytecode.BytecodeRecord; +import org.apache.maven.archiva.indexer.filecontent.FileContentRecord; +import org.apache.maven.archiva.indexer.hashcodes.HashcodesRecord; +import org.apache.maven.archiva.indexer.lucene.LuceneRepositoryContentRecord; +import org.apache.maven.archiva.model.ArchivaArtifact; +import org.apache.maven.archiva.model.ArtifactReference; +import org.apache.maven.archiva.repository.ManagedRepositoryContent; +import org.apache.maven.archiva.repository.layout.LayoutException; + +import java.io.File; +import java.io.FilenameFilter; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * Base class for all repository purge tasks. + * + * @author Maria Odea Ching + */ +public abstract class AbstractRepositoryPurge + implements RepositoryPurge +{ + protected ManagedRepositoryContent repository; + + protected ArtifactDAO artifactDao; + + private Map indices; + + public AbstractRepositoryPurge( ManagedRepositoryContent repository, ArtifactDAO artifactDao, + Map indices ) + { + this.repository = repository; + this.artifactDao = artifactDao; + this.indices = indices; + } + + /** + * Get all files from the directory that matches the specified filename. + * + * @param dir the directory to be scanned + * @param filename the filename to be matched + * @return + */ + protected File[] getFiles( File dir, String filename ) + { + FilenameFilter filter = new ArtifactFilenameFilter( filename ); + + File[] files = dir.listFiles( filter ); + + return files; + } + + protected String toRelativePath( File artifactFile ) + { + String artifactPath = artifactFile.getAbsolutePath(); + if ( artifactPath.startsWith( repository.getRepoRoot() ) ) + { + artifactPath = artifactPath.substring( repository.getRepoRoot().length() ); + } + + return artifactPath; + } + + /** + * Purge the repo. Update db and index of removed artifacts. + * + * @param artifactFiles + * @throws RepositoryIndexException + */ + protected void purge( Set references ) + { + if( references != null && !references.isEmpty() ) + { + List fileContentRecords = new ArrayList(); + List hashcodeRecords = new ArrayList(); + List bytecodeRecords = new ArrayList(); + + for ( ArtifactReference reference : references ) + { + File artifactFile = repository.toFile( reference ); + + ArchivaArtifact artifact = + new ArchivaArtifact( reference.getGroupId(), reference.getArtifactId(), reference.getVersion(), + reference.getClassifier(), reference.getType() ); + + FileContentRecord fileContentRecord = new FileContentRecord(); + fileContentRecord.setFilename( repository.toPath( artifact ) ); + fileContentRecords.add( fileContentRecord ); + + HashcodesRecord hashcodesRecord = new HashcodesRecord(); + hashcodesRecord.setArtifact( artifact ); + hashcodeRecords.add( hashcodesRecord ); + + BytecodeRecord bytecodeRecord = new BytecodeRecord(); + bytecodeRecord.setArtifact( artifact ); + bytecodeRecords.add( bytecodeRecord ); + + // TODO: this needs to be logged + artifactFile.delete(); + purgeSupportFiles( artifactFile ); + + // intended to be swallowed + // continue updating the database for all artifacts + try + { + String artifactPath = toRelativePath( artifactFile ); + updateDatabase( artifactPath ); + } + catch ( ArchivaDatabaseException ae ) + { + // TODO: determine logging to be used + } + catch ( LayoutException le ) + { + // Ignore + } + } + + try + { + updateIndices( fileContentRecords, hashcodeRecords, bytecodeRecords ); + } + catch ( RepositoryIndexException e ) + { + // Ignore + } + } + } + + /** + *

+ * This find support files for the artifactFile and deletes them. + *

+ *

+ * Support Files are things like ".sha1", ".md5", ".asc", etc. + *

+ * + * @param artifactFile the file to base off of. + */ + private void purgeSupportFiles( File artifactFile ) + { + File parentDir = artifactFile.getParentFile(); + + if ( !parentDir.exists() ) + { + return; + } + + FilenameFilter filter = new ArtifactFilenameFilter( artifactFile.getName() ); + + File[] files = parentDir.listFiles( filter ); + + for ( File file : files ) + { + if ( file.exists() && file.isFile() ) + { + file.delete(); + // TODO: log that it was deleted + } + } + } + + private void updateDatabase( String path ) + throws ArchivaDatabaseException, LayoutException + { + ArtifactReference artifact = repository.toArtifactReference( path ); + ArchivaArtifact queriedArtifact = + artifactDao.getArtifact( artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), + artifact.getClassifier(), artifact.getType() ); + + artifactDao.deleteArtifact( queriedArtifact ); + + // TODO [MRM-37]: re-run the database consumers to clean up + } + + private void updateIndices( List fileContentRecords, + List hashcodeRecords, + List bytecodeRecords ) + throws RepositoryIndexException + { + RepositoryContentIndex index = indices.get( "filecontent" ); + index.deleteRecords( fileContentRecords ); + + index = indices.get( "hashcodes" ); + index.deleteRecords( hashcodeRecords ); + + index = indices.get( "bytecode" ); + index.deleteRecords( bytecodeRecords ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/ArtifactFilenameFilter.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/ArtifactFilenameFilter.java new file mode 100644 index 000000000..2162b9096 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/ArtifactFilenameFilter.java @@ -0,0 +1,49 @@ +package org.apache.maven.archiva.consumers.core.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. + */ + +import java.io.FilenameFilter; +import java.io.File; + +/** + * Filename filter for getting all the files related to a specific artifact. + * + * @author Maria Odea Ching + */ +public class ArtifactFilenameFilter + implements FilenameFilter +{ + private String filename; + + public ArtifactFilenameFilter() + { + + } + + public ArtifactFilenameFilter( String filename ) + { + this.filename = filename; + } + + public boolean accept( File dir, String name ) + { + return ( name.startsWith( filename ) ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurge.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurge.java new file mode 100644 index 000000000..b9c1795a7 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurge.java @@ -0,0 +1,245 @@ +package org.apache.maven.archiva.consumers.core.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. + */ + +import org.apache.maven.archiva.common.utils.VersionComparator; +import org.apache.maven.archiva.common.utils.VersionUtil; +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.database.ArtifactDAO; +import org.apache.maven.archiva.indexer.RepositoryContentIndex; +import org.apache.maven.archiva.model.ArtifactReference; +import org.apache.maven.archiva.model.ProjectReference; +import org.apache.maven.archiva.model.VersionedReference; +import org.apache.maven.archiva.repository.ContentNotFoundException; +import org.apache.maven.archiva.repository.ManagedRepositoryContent; +import org.apache.maven.archiva.repository.RepositoryContentFactory; +import org.apache.maven.archiva.repository.RepositoryException; +import org.apache.maven.archiva.repository.RepositoryNotFoundException; +import org.apache.maven.archiva.repository.layout.LayoutException; +import org.apache.maven.archiva.repository.metadata.MetadataTools; +import org.apache.maven.archiva.repository.metadata.RepositoryMetadataException; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +/** + *

+ * This will look in a single managed repository, and purge any snapshots that are present + * that have a corresponding released version on the same repository. + *

+ * + *

+ * So, if you have the following (presented in the m2/default layout form) ... + *

+ *   /com/foo/foo-tool/1.0-SNAPSHOT/foo-tool-1.0-SNAPSHOT.jar
+ *   /com/foo/foo-tool/1.1-SNAPSHOT/foo-tool-1.1-SNAPSHOT.jar
+ *   /com/foo/foo-tool/1.2.1-SNAPSHOT/foo-tool-1.2.1-SNAPSHOT.jar
+ *   /com/foo/foo-tool/1.2.1/foo-tool-1.2.1.jar
+ *   /com/foo/foo-tool/2.0-SNAPSHOT/foo-tool-2.0-SNAPSHOT.jar
+ *   /com/foo/foo-tool/2.0/foo-tool-2.0.jar
+ *   /com/foo/foo-tool/2.1-SNAPSHOT/foo-tool-2.1-SNAPSHOT.jar
+ * 
+ * then the current highest ranked released (non-snapshot) version is 2.0, which means + * the snapshots from 1.0-SNAPSHOT, 1.1-SNAPSHOT, 1.2.1-SNAPSHOT, and 2.0-SNAPSHOT can + * be purged. Leaving 2.1-SNAPSHOT in alone. + *

+ * + * @author Maria Odea Ching + * @version $Id$ + */ +public class CleanupReleasedSnapshotsRepositoryPurge + extends AbstractRepositoryPurge +{ + private MetadataTools metadataTools; + + private ArchivaConfiguration archivaConfig; + + private RepositoryContentFactory repoContentFactory; + + public CleanupReleasedSnapshotsRepositoryPurge( ManagedRepositoryContent repository, ArtifactDAO artifactDao, + MetadataTools metadataTools, Map indices, + ArchivaConfiguration archivaConfig, RepositoryContentFactory repoContentFactory ) + { + super( repository, artifactDao, indices ); + this.metadataTools = metadataTools; + this.archivaConfig = archivaConfig; + this.repoContentFactory = repoContentFactory; + } + + public void process( String path ) + throws RepositoryPurgeException + { + try + { + File artifactFile = new File( repository.getRepoRoot(), path ); + + if ( !artifactFile.exists() ) + { + // Nothing to do here, file doesn't exist, skip it. + return; + } + + ArtifactReference artifact = repository.toArtifactReference( path ); + + if ( !VersionUtil.isSnapshot( artifact.getVersion() ) ) + { + // Nothing to do here, not a snapshot, skip it. + return; + } + + ProjectReference reference = new ProjectReference(); + reference.setGroupId( artifact.getGroupId() ); + reference.setArtifactId( artifact.getArtifactId() ); + + // Gather up all of the versions. + List allVersions = new ArrayList( repository.getVersions( reference ) ); + + List repos = archivaConfig.getConfiguration().getManagedRepositories(); + for( ManagedRepositoryConfiguration repo : repos ) + { + if( repo.isReleases() && !repo.getId().equals( repository.getId() ) ) + { + try + { + ManagedRepositoryContent repoContent = repoContentFactory.getManagedRepositoryContent( repo.getId() ); + allVersions.addAll( repoContent.getVersions( reference ) ); + } + catch( RepositoryNotFoundException e ) + { + // swallow + } + catch( RepositoryException e ) + { + // swallow + } + } + } + + // Split the versions into released and snapshots. + List releasedVersions = new ArrayList(); + List snapshotVersions = new ArrayList(); + + for ( String version : allVersions ) + { + if ( VersionUtil.isSnapshot( version ) ) + { + snapshotVersions.add( version ); + } + else + { + releasedVersions.add( version ); + } + } + + Collections.sort( allVersions, VersionComparator.getInstance() ); + Collections.sort( releasedVersions, VersionComparator.getInstance() ); + Collections.sort( snapshotVersions, VersionComparator.getInstance() ); + + // Now clean out any version that is earlier than the highest released version. + boolean needsMetadataUpdate = false; + + VersionedReference versionRef = new VersionedReference(); + versionRef.setGroupId( artifact.getGroupId() ); + versionRef.setArtifactId( artifact.getArtifactId() ); + + for ( String version : snapshotVersions ) + { + if( releasedVersions.contains( VersionUtil.getReleaseVersion( version ) ) ) + { + versionRef.setVersion( version ); + repository.deleteVersion( versionRef ); + needsMetadataUpdate = true; + } + } + + if ( needsMetadataUpdate ) + { + updateMetadata( artifact ); + } + } + catch ( LayoutException e ) + { + throw new RepositoryPurgeException( e.getMessage(), e ); + } + catch ( ContentNotFoundException e ) + { + throw new RepositoryPurgeException( e.getMessage(), e ); + } + } + + private void updateMetadata( ArtifactReference artifact ) + { + VersionedReference versionRef = new VersionedReference(); + versionRef.setGroupId( artifact.getGroupId() ); + versionRef.setArtifactId( artifact.getArtifactId() ); + versionRef.setVersion( artifact.getVersion() ); + + ProjectReference projectRef = new ProjectReference(); + projectRef.setGroupId( artifact.getGroupId() ); + projectRef.setArtifactId( artifact.getArtifactId() ); + + try + { + metadataTools.updateMetadata( repository, versionRef ); + } + catch ( ContentNotFoundException e ) + { + // Ignore. (Just means we have no snapshot versions left to reference). + } + catch ( RepositoryMetadataException e ) + { + // Ignore. + } + catch ( IOException e ) + { + // Ignore. + } + catch ( LayoutException e ) + { + // Ignore. + } + + try + { + metadataTools.updateMetadata( repository, projectRef ); + } + catch ( ContentNotFoundException e ) + { + // Ignore. (Just means we have no snapshot versions left to reference). + } + catch ( RepositoryMetadataException e ) + { + // Ignore. + } + catch ( IOException e ) + { + // Ignore. + } + catch ( LayoutException e ) + { + // Ignore. + } + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/DaysOldRepositoryPurge.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/DaysOldRepositoryPurge.java new file mode 100644 index 000000000..a844128c3 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/DaysOldRepositoryPurge.java @@ -0,0 +1,198 @@ +package org.apache.maven.archiva.consumers.core.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. + */ + +import org.apache.commons.lang.time.DateUtils; +import org.apache.maven.archiva.common.utils.VersionComparator; +import org.apache.maven.archiva.common.utils.VersionUtil; +import org.apache.maven.archiva.database.ArtifactDAO; +import org.apache.maven.archiva.indexer.RepositoryContentIndex; +import org.apache.maven.archiva.model.ArtifactReference; +import org.apache.maven.archiva.model.VersionedReference; +import org.apache.maven.archiva.repository.ContentNotFoundException; +import org.apache.maven.archiva.repository.ManagedRepositoryContent; +import org.apache.maven.archiva.repository.layout.LayoutException; + +import java.io.File; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Collections; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.regex.Matcher; + +/** + * Purge from repository all snapshots older than the specified days in the repository configuration. + * + * @author Maria Odea Ching + */ +public class DaysOldRepositoryPurge + extends AbstractRepositoryPurge +{ + private SimpleDateFormat timestampParser; + + private int daysOlder; + + private int retentionCount; + + public DaysOldRepositoryPurge( ManagedRepositoryContent repository, ArtifactDAO artifactDao, int daysOlder, + int retentionCount, Map indices ) + { + super( repository, artifactDao, indices ); + this.daysOlder = daysOlder; + this.retentionCount = retentionCount; + timestampParser = new SimpleDateFormat( "yyyyMMdd.HHmmss" ); + timestampParser.setTimeZone( DateUtils.UTC_TIME_ZONE ); + } + + public void process( String path ) + throws RepositoryPurgeException + { + try + { + File artifactFile = new File( repository.getRepoRoot(), path ); + + if ( !artifactFile.exists() ) + { + return; + } + + ArtifactReference artifact = repository.toArtifactReference( path ); + + Calendar olderThanThisDate = Calendar.getInstance( DateUtils.UTC_TIME_ZONE ); + olderThanThisDate.add( Calendar.DATE, -daysOlder ); + + // respect retention count + VersionedReference reference = new VersionedReference(); + reference.setGroupId( artifact.getGroupId() ); + reference.setArtifactId( artifact.getArtifactId() ); + reference.setVersion( artifact.getVersion() ); + + List versions = new ArrayList( repository.getVersions( reference ) ); + + Collections.sort( versions, VersionComparator.getInstance() ); + + if ( retentionCount > versions.size() ) + { + // Done. nothing to do here. skip it. + return; + } + + int countToPurge = versions.size() - retentionCount; + + for ( String version : versions ) + { + if ( countToPurge-- <= 0 ) + { + break; + } + + ArtifactReference newArtifactReference = + repository.toArtifactReference( artifactFile.getAbsolutePath() ); + newArtifactReference.setVersion( version ); + + File newArtifactFile = repository.toFile( newArtifactReference ); + + // Is this a generic snapshot "1.0-SNAPSHOT" ? + if ( VersionUtil.isGenericSnapshot( newArtifactReference.getVersion() ) ) + { + if ( newArtifactFile.lastModified() < olderThanThisDate.getTimeInMillis() ) + { + doPurgeAllRelated( newArtifactReference ); + } + } + // Is this a timestamp snapshot "1.0-20070822.123456-42" ? + else if ( VersionUtil.isUniqueSnapshot( newArtifactReference.getVersion() ) ) + { + Calendar timestampCal = uniqueSnapshotToCalendar( newArtifactReference.getVersion() ); + + if ( timestampCal.getTimeInMillis() < olderThanThisDate.getTimeInMillis() ) + { + doPurgeAllRelated( newArtifactReference ); + } + else if ( newArtifactFile.lastModified() < olderThanThisDate.getTimeInMillis() ) + { + doPurgeAllRelated( newArtifactReference ); + } + } + } + } + catch ( LayoutException le ) + { + throw new RepositoryPurgeException( le.getMessage(), le ); + } + catch ( ContentNotFoundException e ) + { + throw new RepositoryPurgeException( e.getMessage(), e ); + } + } + + private Calendar uniqueSnapshotToCalendar( String version ) + { + // The latestVersion will contain the full version string "1.0-alpha-5-20070821.213044-8" + // This needs to be broken down into ${base}-${timestamp}-${build_number} + + Matcher m = VersionUtil.UNIQUE_SNAPSHOT_PATTERN.matcher( version ); + if ( m.matches() ) + { + Matcher mtimestamp = VersionUtil.TIMESTAMP_PATTERN.matcher( m.group( 2 ) ); + if ( mtimestamp.matches() ) + { + String tsDate = mtimestamp.group( 1 ); + String tsTime = mtimestamp.group( 2 ); + + Date versionDate; + try + { + versionDate = timestampParser.parse( tsDate + "." + tsTime ); + Calendar cal = Calendar.getInstance( DateUtils.UTC_TIME_ZONE ); + cal.setTime( versionDate ); + + return cal; + } + catch ( ParseException e ) + { + // Invalid Date/Time + return null; + } + } + } + return null; + } + + private void doPurgeAllRelated( ArtifactReference reference ) + throws LayoutException + { + try + { + Set related = repository.getRelatedArtifacts( reference ); + purge( related ); + } + catch ( ContentNotFoundException e ) + { + // Nothing to do here. + // TODO: Log this? + } + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/RepositoryPurge.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/RepositoryPurge.java new file mode 100644 index 000000000..17276dada --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/RepositoryPurge.java @@ -0,0 +1,36 @@ +package org.apache.maven.archiva.consumers.core.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. + */ + +/** + * @author Maria Odea Ching + * @version $Id$ + */ +public interface RepositoryPurge +{ + /** + * Perform checking on artifact for repository purge + * + * @param path path to the scanned artifact + */ + public void process( String path ) + throws RepositoryPurgeException; + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/RepositoryPurgeConsumer.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/RepositoryPurgeConsumer.java new file mode 100644 index 000000000..dacee4891 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/RepositoryPurgeConsumer.java @@ -0,0 +1,244 @@ +package org.apache.maven.archiva.consumers.core.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. + */ + +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.FileTypes; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer; +import org.apache.maven.archiva.consumers.ConsumerException; +import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer; +import org.apache.maven.archiva.database.ArchivaDAO; +import org.apache.maven.archiva.indexer.RepositoryContentIndex; +import org.apache.maven.archiva.indexer.RepositoryContentIndexFactory; +import org.apache.maven.archiva.repository.ManagedRepositoryContent; +import org.apache.maven.archiva.repository.RepositoryContentFactory; +import org.apache.maven.archiva.repository.RepositoryException; +import org.apache.maven.archiva.repository.RepositoryNotFoundException; +import org.apache.maven.archiva.repository.metadata.MetadataTools; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException; +import org.codehaus.plexus.registry.Registry; +import org.codehaus.plexus.registry.RegistryListener; + +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Consumer for removing old snapshots in the repository based on the criteria + * specified by the user. + * + * @author Maria Odea Ching + * + * @plexus.component + * role="org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer" + * role-hint="repository-purge" + * instantiation-strategy="per-lookup" + */ +public class RepositoryPurgeConsumer + extends AbstractMonitoredConsumer + implements KnownRepositoryContentConsumer, RegistryListener, Initializable +{ + /** + * @plexus.configuration default-value="repository-purge" + */ + private String id; + + /** + * @plexus.configuration default-value="Purge repository of old snapshots" + */ + private String description; + + /** + * @plexus.requirement + */ + private ArchivaConfiguration configuration; + + /** + * @plexus.requirement role-hint="jdo" + */ + private ArchivaDAO dao; + + /** + * @plexus.requirement + */ + private RepositoryContentFactory repositoryFactory; + + /** + * @plexus.requirement + */ + private MetadataTools metadataTools; + + /** + * @plexus.requirement + */ + private FileTypes filetypes; + + private List includes = new ArrayList(); + + private List propertyNameTriggers = new ArrayList(); + + private RepositoryPurge repoPurge; + + private RepositoryPurge cleanUp; + + private boolean deleteReleasedSnapshots; + + /** + * @plexus.requirement role-hint="lucene" + */ + private RepositoryContentIndexFactory indexFactory; + + public String getId() + { + return this.id; + } + + public String getDescription() + { + return this.description; + } + + public boolean isPermanent() + { + return false; + } + + public List getExcludes() + { + return getDefaultArtifactExclusions(); + } + + public List getIncludes() + { + return this.includes; + } + + public void beginScan( ManagedRepositoryConfiguration repository, Date whenGathered ) + throws ConsumerException + { + try + { + Map indices = new HashMap(); + indices.put( "bytecode", indexFactory.createBytecodeIndex( repository ) ); + indices.put( "hashcodes", indexFactory.createHashcodeIndex( repository ) ); + indices.put( "filecontent", indexFactory.createFileContentIndex( repository ) ); + + ManagedRepositoryContent repositoryContent = repositoryFactory.getManagedRepositoryContent( repository + .getId() ); + + if ( repository.getDaysOlder() != 0 ) + { + repoPurge = new DaysOldRepositoryPurge( repositoryContent, dao.getArtifactDAO(), repository + .getDaysOlder(), repository.getRetentionCount(), indices ); + } + else + { + repoPurge = new RetentionCountRepositoryPurge( repositoryContent, dao.getArtifactDAO(), repository + .getRetentionCount(), indices ); + } + + cleanUp = new CleanupReleasedSnapshotsRepositoryPurge( repositoryContent, dao.getArtifactDAO(), + metadataTools, indices, configuration, repositoryFactory ); + + deleteReleasedSnapshots = repository.isDeleteReleasedSnapshots(); + } + catch ( RepositoryNotFoundException e ) + { + throw new ConsumerException( "Can't run repository purge: " + e.getMessage(), e ); + } + catch ( RepositoryException e ) + { + throw new ConsumerException( "Can't run repository purge: " + e.getMessage(), e ); + } + } + + public void processFile( String path ) + throws ConsumerException + { + try + { + if ( deleteReleasedSnapshots ) + { + cleanUp.process( path ); + } + + repoPurge.process( path ); + } + catch ( RepositoryPurgeException rpe ) + { + throw new ConsumerException( rpe.getMessage(), rpe ); + } + } + + public void completeScan() + { + /* do nothing */ + } + + public void afterConfigurationChange( Registry registry, String propertyName, Object propertyValue ) + { + if ( propertyNameTriggers.contains( propertyName ) ) + { + initIncludes(); + } + } + + public void beforeConfigurationChange( Registry registry, String propertyName, Object propertyValue ) + { + /* do nothing */ + } + + private void initIncludes() + { + includes.clear(); + + includes.addAll( filetypes.getFileTypePatterns( FileTypes.ARTIFACTS ) ); + } + + public void initialize() + throws InitializationException + { + propertyNameTriggers = new ArrayList(); + propertyNameTriggers.add( "repositoryScanning" ); + propertyNameTriggers.add( "fileTypes" ); + propertyNameTriggers.add( "fileType" ); + propertyNameTriggers.add( "patterns" ); + propertyNameTriggers.add( "pattern" ); + + configuration.addChangeListener( this ); + + initIncludes(); + } + + public boolean isProcessUnmodified() + { + // we need to check all files for deletion, especially if not modified + return true; + } + + public void setRepositoryContentIndexFactory( RepositoryContentIndexFactory indexFactory ) + { + this.indexFactory = indexFactory; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/RepositoryPurgeException.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/RepositoryPurgeException.java new file mode 100644 index 000000000..d531629e6 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/RepositoryPurgeException.java @@ -0,0 +1,49 @@ +package org.apache.maven.archiva.consumers.core.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. + */ + +/** + * + * @author Maria Odea Ching + * @version $Id$ + */ +public class RepositoryPurgeException + extends Exception +{ + public RepositoryPurgeException() + { + super(); + } + + public RepositoryPurgeException( String message, Throwable cause ) + { + super( message, cause ); + } + + public RepositoryPurgeException( String message ) + { + super( message ); + } + + public RepositoryPurgeException( Throwable cause ) + { + super( cause ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/RetentionCountRepositoryPurge.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/RetentionCountRepositoryPurge.java new file mode 100644 index 000000000..20c728f00 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/RetentionCountRepositoryPurge.java @@ -0,0 +1,132 @@ +package org.apache.maven.archiva.consumers.core.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. + */ + +import org.apache.maven.archiva.common.utils.VersionComparator; +import org.apache.maven.archiva.common.utils.VersionUtil; +import org.apache.maven.archiva.database.ArtifactDAO; +import org.apache.maven.archiva.indexer.RepositoryContentIndex; +import org.apache.maven.archiva.model.ArtifactReference; +import org.apache.maven.archiva.model.VersionedReference; +import org.apache.maven.archiva.repository.ContentNotFoundException; +import org.apache.maven.archiva.repository.ManagedRepositoryContent; +import org.apache.maven.archiva.repository.layout.LayoutException; + +import java.io.File; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * Purge the repository by retention count. Retain only the specified number of snapshots. + * + * @author Maria Odea Ching + */ +public class RetentionCountRepositoryPurge + extends AbstractRepositoryPurge +{ + private int retentionCount; + + public RetentionCountRepositoryPurge( ManagedRepositoryContent repository, ArtifactDAO artifactDao, + int retentionCount, Map indices ) + { + super( repository, artifactDao, indices ); + this.retentionCount = retentionCount; + } + + public void process( String path ) + throws RepositoryPurgeException + { + try + { + File artifactFile = new File( repository.getRepoRoot(), path ); + + if ( !artifactFile.exists() ) + { + return; + } + + ArtifactReference artifact = repository.toArtifactReference( path ); + + if ( VersionUtil.isSnapshot( artifact.getVersion() ) ) + { + VersionedReference reference = new VersionedReference(); + reference.setGroupId( artifact.getGroupId() ); + reference.setArtifactId( artifact.getArtifactId() ); + reference.setVersion( artifact.getVersion() ); + + List versions = new ArrayList( repository.getVersions( reference ) ); + + Collections.sort( versions, VersionComparator.getInstance() ); + + if ( retentionCount > versions.size() ) + { + // Done. nothing to do here. skip it. + return; + } + + int countToPurge = versions.size() - retentionCount; + + for ( String version : versions ) + { + if ( countToPurge-- <= 0 ) + { + break; + } + + doPurgeAllRelated( artifact, version ); + } + } + } + catch ( LayoutException le ) + { + throw new RepositoryPurgeException( le.getMessage(), le ); + } + catch ( ContentNotFoundException e ) + { + // Nothing to do here. + // TODO: Log this condition? + } + } + + private void doPurgeAllRelated( ArtifactReference reference, String version ) + throws LayoutException + { + ArtifactReference artifact = new ArtifactReference(); + artifact.setGroupId( reference.getGroupId() ); + artifact.setArtifactId( reference.getArtifactId() ); + artifact.setVersion( version ); + artifact.setClassifier( reference.getClassifier() ); + artifact.setType( reference.getType() ); + + try + { + Set related = repository.getRelatedArtifacts( artifact ); + purge( related ); + } + catch ( ContentNotFoundException e ) + { + // Nothing to do here. + // TODO: Log this? + } + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/conf/repository-manager-daysOld.xml b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/conf/repository-manager-daysOld.xml new file mode 100644 index 000000000..bbbee3eb2 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/conf/repository-manager-daysOld.xml @@ -0,0 +1,203 @@ + + + + + 1 + + + internal + Archiva Managed Internal Repository + file://${appserver.base}/repositories/internal + default + true + false + true + 0 0 * * * ? + + + snapshots + Archiva Managed Snapshot Repository + file://${appserver.base}/repositories/snapshots + default + false + true + true + 0 0,30 * * * ? + + + central + Central Repository + http://repo1.maven.org/maven2 + default + true + false + false + + + maven2-repository.dev.java.net + Java.net Repository for Maven 2 + https://maven2-repository.dev.java.net/nonav/repository + default + true + false + false + + + test-repo + Test Repository + file://${appserver.base}/test-repo + default + true + true + true + 0 0 * * * ? + 100 + true + + + + + + internal + central + + disabled + never + not-found + + + internal + maven2-repository.dev.java.net + + disabled + never + not-found + + javax/** + + + + + + + example + http + proxy.mycompany.com + 8080 + myself + mypass + + + + + + + artifacts + + **/*.pom + **/*.jar + **/*.ear + **/*.war + **/*.car + **/*.sar + **/*.mar + **/*.rar + **/*.dtd + **/*.tld + **/*.tar.gz + **/*.tar.bz2 + **/*.zip + + + + indexable-content + + **/*.txt + **/*.TXT + **/*.block + **/*.config + **/*.pom + **/*.xml + **/*.xsd + **/*.dtd + **/*.tld + + + + auto-remove + + **/*.bak + **/*~ + **/*- + + + + ignored + + **/.htaccess + **/KEYS + **/*.rb + **/*.sh + **/.svn/** + **/.DAV/** + + + + + update-db-artifact + create-missing-checksums + update-db-repository-metadata + validate-checksum + validate-signature + index-content + auto-remove + auto-rename + repository-purge + + + update-db-bad-content + + + + + 0 0 * * * ? + + index-artifact + update-db-project + validate-repository-metadata + index-archive-toc + update-db-bytecode-stats + index-public-methods + + + not-present-remove-db-artifact + not-present-remove-db-project + not-present-remove-indexed + + + + + + true + true + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/conf/repository-manager.xml b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/conf/repository-manager.xml new file mode 100644 index 000000000..29cdebde4 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/conf/repository-manager.xml @@ -0,0 +1,203 @@ + + + + + 1 + + + internal + Archiva Managed Internal Repository + file://${appserver.base}/repositories/internal + default + true + false + true + 0 0 * * * ? + + + snapshots + Archiva Managed Snapshot Repository + file://${appserver.base}/repositories/snapshots + default + false + true + true + 0 0,30 * * * ? + + + central + Central Repository + http://repo1.maven.org/maven2 + default + true + false + false + + + maven2-repository.dev.java.net + Java.net Repository for Maven 2 + https://maven2-repository.dev.java.net/nonav/repository + default + true + false + false + + + test-repo + Test Repository + file://${appserver.base}/test-repo + default + true + true + true + 0 0 * * * ? + 0 + 2 + + + + + + internal + central + + disabled + never + not-found + + + internal + maven2-repository.dev.java.net + + disabled + never + not-found + + javax/** + + + + + + + example + http + proxy.mycompany.com + 8080 + myself + mypass + + + + + + + artifacts + + **/*.pom + **/*.jar + **/*.ear + **/*.war + **/*.car + **/*.sar + **/*.mar + **/*.rar + **/*.dtd + **/*.tld + **/*.tar.gz + **/*.tar.bz2 + **/*.zip + + + + indexable-content + + **/*.txt + **/*.TXT + **/*.block + **/*.config + **/*.pom + **/*.xml + **/*.xsd + **/*.dtd + **/*.tld + + + + auto-remove + + **/*.bak + **/*~ + **/*- + + + + ignored + + **/.htaccess + **/KEYS + **/*.rb + **/*.sh + **/.svn/** + **/.DAV/** + + + + + update-db-artifact + create-missing-checksums + update-db-repository-metadata + validate-checksum + validate-signature + index-content + auto-remove + auto-rename + repository-purge + + + update-db-bad-content + + + + + 0 0 * * * ? + + index-artifact + update-db-project + validate-repository-metadata + index-archive-toc + update-db-bytecode-stats + index-public-methods + + + not-present-remove-db-artifact + not-present-remove-db-project + not-present-remove-indexed + + + + + + true + true + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/AbstractArtifactConsumerTest.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/AbstractArtifactConsumerTest.java new file mode 100644 index 000000000..59cffadc0 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/AbstractArtifactConsumerTest.java @@ -0,0 +1,76 @@ +package org.apache.maven.archiva.consumers.core; + +/* + * 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.archiva.common.utils.BaseFile; +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.consumers.KnownRepositoryContentConsumer; +import org.apache.maven.archiva.repository.scanner.functors.ConsumerWantsFilePredicate; +import org.codehaus.plexus.spring.PlexusInSpringTestCase; + +import java.io.File; + +public abstract class AbstractArtifactConsumerTest + extends PlexusInSpringTestCase +{ + private File repoLocation; + + protected KnownRepositoryContentConsumer consumer; + + protected void setUp() + throws Exception + { + super.setUp(); + + ArchivaConfiguration archivaConfiguration = (ArchivaConfiguration) lookup( ArchivaConfiguration.ROLE ); + FileType fileType = + (FileType) archivaConfiguration.getConfiguration().getRepositoryScanning().getFileTypes().get( 0 ); + assertEquals( FileTypes.ARTIFACTS, fileType.getId() ); + fileType.addPattern( "**/*.xml" ); + + repoLocation = getTestFile( "target/test-" + getName() + "/test-repo" ); + } + + public void testConsumption() + { + File localFile = + new File( repoLocation, "org/apache/maven/plugins/maven-plugin-plugin/2.4.1/maven-metadata.xml" ); + + ConsumerWantsFilePredicate predicate = new ConsumerWantsFilePredicate(); + BaseFile baseFile = new BaseFile( repoLocation, localFile ); + predicate.setBasefile( baseFile ); + + assertFalse( predicate.evaluate( consumer ) ); + } + + public void testConsumptionOfOtherMetadata() + { + File localFile = + new File( repoLocation, "org/apache/maven/plugins/maven-plugin-plugin/2.4.1/maven-metadata-central.xml" ); + + ConsumerWantsFilePredicate predicate = new ConsumerWantsFilePredicate(); + BaseFile baseFile = new BaseFile( repoLocation, localFile ); + predicate.setBasefile( baseFile ); + + assertFalse( predicate.evaluate( consumer ) ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/ArtifactMissingChecksumsConsumerTest.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/ArtifactMissingChecksumsConsumerTest.java new file mode 100644 index 000000000..42f84d39e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/ArtifactMissingChecksumsConsumerTest.java @@ -0,0 +1,35 @@ +package org.apache.maven.archiva.consumers.core; + +/* + * 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.archiva.consumers.KnownRepositoryContentConsumer; + +public class ArtifactMissingChecksumsConsumerTest + extends AbstractArtifactConsumerTest +{ + protected void setUp() + throws Exception + { + super.setUp(); + + consumer = (ArtifactMissingChecksumsConsumer) lookup( KnownRepositoryContentConsumer.class.getName(), + "create-missing-checksums" ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/MetadataUpdateConsumerTest.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/MetadataUpdateConsumerTest.java new file mode 100644 index 000000000..b97025fba --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/MetadataUpdateConsumerTest.java @@ -0,0 +1,35 @@ +package org.apache.maven.archiva.consumers.core; + +/* + * 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.archiva.consumers.KnownRepositoryContentConsumer; + +public class MetadataUpdateConsumerTest + extends AbstractArtifactConsumerTest +{ + protected void setUp() + throws Exception + { + super.setUp(); + + consumer = (KnownRepositoryContentConsumer) lookup( KnownRepositoryContentConsumer.class.getName(), + "metadata-updater" ); + } +} \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/AbstractRepositoryPurgeTest.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/AbstractRepositoryPurgeTest.java new file mode 100644 index 000000000..5d0869942 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/AbstractRepositoryPurgeTest.java @@ -0,0 +1,244 @@ +package org.apache.maven.archiva.consumers.core.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. + */ + +import org.apache.commons.io.FileUtils; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.database.ArchivaDatabaseException; +import org.apache.maven.archiva.database.ArtifactDAO; +import org.apache.maven.archiva.model.ArchivaArtifact; +import org.apache.maven.archiva.repository.ManagedRepositoryContent; +import org.codehaus.plexus.jdo.DefaultConfigurableJdoFactory; +import org.codehaus.plexus.jdo.JdoFactory; +import org.codehaus.plexus.spring.PlexusInSpringTestCase; +import org.jpox.SchemaTool; + +import java.io.File; +import java.io.IOException; +import java.net.URL; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Properties; +import java.util.Map.Entry; + +import javax.jdo.PersistenceManager; +import javax.jdo.PersistenceManagerFactory; + +/** + * @author Maria Odea Ching + */ +public abstract class AbstractRepositoryPurgeTest + extends PlexusInSpringTestCase +{ + public static final String TEST_REPO_ID = "test-repo"; + + public static final String TEST_REPO_NAME = "Test Repository"; + + public static final int TEST_RETENTION_COUNT = 2; + + public static final int TEST_DAYS_OLDER = 30; + + public static final String PATH_TO_BY_DAYS_OLD_ARTIFACT = "org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-20061118.060401-2.jar"; + + public static final String PATH_TO_BY_DAYS_OLD_METADATA_DRIVEN_ARTIFACT = "org/codehaus/plexus/plexus-utils/1.4.3-SNAPSHOT/plexus-utils-1.4.3-20070113.163208-4.jar"; + + public static final String PATH_TO_BY_RETENTION_COUNT_ARTIFACT = "org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/jruby-rake-plugin-1.0RC1-20070504.153317-1.jar"; + + public static final String PATH_TO_BY_RETENTION_COUNT_POM = "org/codehaus/castor/castor-anttasks/1.1.2-SNAPSHOT/castor-anttasks-1.1.2-20070506.163513-2.pom"; + + public static final String PATH_TO_TEST_ORDER_OF_DELETION = "org/apache/maven/plugins/maven-assembly-plugin/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070615.105019-3.jar"; + + protected static final String RELEASES_TEST_REPO_ID = "releases-test-repo-one"; + + protected static final String RELEASES_TEST_REPO_NAME = "Releases Test Repo One"; + + private ManagedRepositoryConfiguration config; + + private ManagedRepositoryContent repo; + + protected ArtifactDAO dao; + + protected RepositoryPurge repoPurge; + + protected void setUp() + throws Exception + { + super.setUp(); + + DefaultConfigurableJdoFactory jdoFactory = (DefaultConfigurableJdoFactory) lookup( JdoFactory.ROLE, "archiva" ); + assertEquals( DefaultConfigurableJdoFactory.class.getName(), jdoFactory.getClass().getName() ); + + jdoFactory.setPersistenceManagerFactoryClass( "org.jpox.PersistenceManagerFactoryImpl" ); + + jdoFactory.setDriverName( System.getProperty( "jdo.test.driver", "org.hsqldb.jdbcDriver" ) ); + jdoFactory.setUrl( System.getProperty( "jdo.test.url", "jdbc:hsqldb:mem:testdb" ) ); + + jdoFactory.setUserName( System.getProperty( "jdo.test.user", "sa" ) ); + + jdoFactory.setPassword( System.getProperty( "jdo.test.pass", "" ) ); + + jdoFactory.setProperty( "org.jpox.transactionIsolation", "READ_COMMITTED" ); + + jdoFactory.setProperty( "org.jpox.poid.transactionIsolation", "READ_COMMITTED" ); + + jdoFactory.setProperty( "org.jpox.autoCreateSchema", "true" ); + + jdoFactory.setProperty( "javax.jdo.option.RetainValues", "true" ); + + jdoFactory.setProperty( "javax.jdo.option.RestoreValues", "true" ); + + // jdoFactory.setProperty( "org.jpox.autoCreateColumns", "true" ); + + jdoFactory.setProperty( "org.jpox.validateTables", "true" ); + + jdoFactory.setProperty( "org.jpox.validateColumns", "true" ); + + jdoFactory.setProperty( "org.jpox.validateConstraints", "true" ); + + Properties properties = jdoFactory.getProperties(); + + for ( Entry entry : properties.entrySet() ) + { + System.setProperty( (String) entry.getKey(), (String) entry.getValue() ); + } + + URL jdoFileUrls[] = new URL[] { getClass().getResource( "/org/apache/maven/archiva/model/package.jdo" ) }; + + if ( ( jdoFileUrls == null ) || ( jdoFileUrls[0] == null ) ) + { + fail( "Unable to process test " + getName() + " - missing package.jdo." ); + } + + File propsFile = null; // intentional + boolean verbose = true; + + SchemaTool.deleteSchemaTables( jdoFileUrls, new URL[] {}, propsFile, verbose ); + SchemaTool.createSchemaTables( jdoFileUrls, new URL[] {}, propsFile, verbose, null ); + + PersistenceManagerFactory pmf = jdoFactory.getPersistenceManagerFactory(); + + assertNotNull( pmf ); + + PersistenceManager pm = pmf.getPersistenceManager(); + + pm.close(); + + dao = (ArtifactDAO) lookup( ArtifactDAO.class.getName(), "jdo" ); + } + + @Override + protected void tearDown() + throws Exception + { + super.tearDown(); + config = null; + repo = null; + } + + public ManagedRepositoryConfiguration getRepoConfiguration( String repoId, String repoName ) + { + config = new ManagedRepositoryConfiguration(); + config.setId( repoId ); + config.setName( repoName ); + config.setDaysOlder( TEST_DAYS_OLDER ); + config.setLocation( getTestFile( "target/test-" + getName() + "/" + repoId ).getAbsolutePath() ); + config.setReleases( true ); + config.setSnapshots( true ); + config.setDeleteReleasedSnapshots( true ); + config.setRetentionCount( TEST_RETENTION_COUNT ); + + return config; + } + + public ManagedRepositoryContent getRepository() + throws Exception + { + if ( repo == null ) + { + repo = (ManagedRepositoryContent) lookup( ManagedRepositoryContent.class, "default" ); + repo.setRepository( getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME ) ); + } + + return repo; + } + + protected void populateDb( String groupId, String artifactId, List versions ) + throws ArchivaDatabaseException + { + for ( String version : versions ) + { + ArchivaArtifact artifact = dao.createArtifact( groupId, artifactId, version, "", "jar" ); + assertNotNull( artifact ); + artifact.getModel().setLastModified( new Date() ); + artifact.getModel().setOrigin( "test" ); + ArchivaArtifact savedArtifact = dao.saveArtifact( artifact ); + assertNotNull( savedArtifact ); + + //POM + artifact = dao.createArtifact( groupId, artifactId, version, "", "pom" ); + assertNotNull( artifact ); + artifact.getModel().setLastModified( new Date() ); + artifact.getModel().setOrigin( "test" ); + savedArtifact = dao.saveArtifact( artifact ); + assertNotNull( savedArtifact ); + } + } + + protected void assertDeleted( String path ) + { + assertFalse( "File should have been deleted: " + path, new File( path ).exists() ); + } + + protected void assertExists( String path ) + { + assertTrue( "File should exist: " + path, new File( path ).exists() ); + } + + protected File getTestRepoRoot() + { + return getTestFile( "target/test-" + getName() + "/" + TEST_REPO_ID ); + } + + protected String prepareTestRepos() + throws IOException + { + File testDir = getTestRepoRoot(); + FileUtils.deleteDirectory( testDir ); + FileUtils.copyDirectory( getTestFile( "target/test-classes/" + TEST_REPO_ID ), testDir ); + + File releasesTestDir = getTestFile( "target/test-" + getName() + "/" + RELEASES_TEST_REPO_ID ); + FileUtils.deleteDirectory( releasesTestDir ); + FileUtils.copyDirectory( getTestFile( "target/test-classes/" + RELEASES_TEST_REPO_ID ), releasesTestDir ); + + return testDir.getAbsolutePath(); + } + + protected void populateDbForTestOrderOfDeletion() + throws Exception + { + List versions = new ArrayList(); + versions.add( "1.1.2-20070427.065136-1" ); + versions.add( "1.1.2-20070506.163513-2" ); + versions.add( "1.1.2-20070615.105019-3" ); + + populateDb( "org.apache.maven.plugins", "maven-assembly-plugin", versions ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurgeTest.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurgeTest.java new file mode 100644 index 000000000..b133c54d3 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurgeTest.java @@ -0,0 +1,238 @@ +package org.apache.maven.archiva.consumers.core.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. + */ + +import org.apache.commons.io.FileUtils; +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.Configuration; +import org.apache.maven.archiva.consumers.core.repository.stubs.LuceneRepositoryContentIndexStub; +import org.apache.maven.archiva.database.ArchivaDatabaseException; +import org.apache.maven.archiva.indexer.RepositoryContentIndex; +import org.apache.maven.archiva.repository.RepositoryContentFactory; +import org.apache.maven.archiva.repository.metadata.MetadataTools; +import org.custommonkey.xmlunit.XMLAssert; + +import java.io.File; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author Maria Odea Ching + */ +public class CleanupReleasedSnapshotsRepositoryPurgeTest + extends AbstractRepositoryPurgeTest +{ + private ArchivaConfiguration archivaConfiguration; + + public static final String PATH_TO_RELEASED_SNAPSHOT_IN_DIFF_REPO = + "org/apache/archiva/released-artifact-in-diff-repo/1.0-SNAPSHOT/released-artifact-in-diff-repo-1.0-SNAPSHOT.jar"; + + public static final String PATH_TO_HIGHER_SNAPSHOT_EXISTS_IN_SAME_REPO = "org/apache/maven/plugins/maven-source-plugin/2.0.3-SNAPSHOT/maven-source-plugin-2.0.3-SNAPSHOT.jar"; + + public static final String PATH_TO_RELEASED_SNAPSHOT_IN_SAME_REPO = "org/apache/maven/plugins/maven-plugin-plugin/2.3-SNAPSHOT/maven-plugin-plugin-2.3-SNAPSHOT.jar"; + + protected void setUp() + throws Exception + { + super.setUp(); + + Map map = new HashMap(); + map.put( "filecontent", new LuceneRepositoryContentIndexStub() ); + map.put( "hashcodes", new LuceneRepositoryContentIndexStub() ); + map.put( "bytecode", new LuceneRepositoryContentIndexStub() ); + + MetadataTools metadataTools = (MetadataTools) lookup( MetadataTools.class ); + RepositoryContentFactory factory = (RepositoryContentFactory) lookup( RepositoryContentFactory.class, "cleanup-released-snapshots"); + + archivaConfiguration = + (ArchivaConfiguration) lookup( ArchivaConfiguration.class, "cleanup-released-snapshots" ); + + repoPurge = + new CleanupReleasedSnapshotsRepositoryPurge( getRepository(), dao, metadataTools, map, archivaConfiguration, factory ); + } + + public void testReleasedSnapshotsExistsInSameRepo() + throws Exception + { + + Configuration config = archivaConfiguration.getConfiguration(); + config.removeManagedRepository( config.findManagedRepositoryById( TEST_REPO_ID ) ); + config.addManagedRepository( getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME ) ); + + populateReleasedSnapshotsTest(); + + String repoRoot = prepareTestRepos(); + + repoPurge.process( CleanupReleasedSnapshotsRepositoryPurgeTest.PATH_TO_RELEASED_SNAPSHOT_IN_SAME_REPO ); + + String projectRoot = repoRoot + "/org/apache/maven/plugins/maven-plugin-plugin"; + + // check if the snapshot was removed + assertDeleted( projectRoot + "/2.3-SNAPSHOT" ); + assertDeleted( projectRoot + "/2.3-SNAPSHOT/maven-plugin-plugin-2.3-SNAPSHOT.jar" ); + assertDeleted( projectRoot + "/2.3-SNAPSHOT/maven-plugin-plugin-2.3-SNAPSHOT.jar.md5" ); + assertDeleted( projectRoot + "/2.3-SNAPSHOT/maven-plugin-plugin-2.3-SNAPSHOT.jar.sha1" ); + assertDeleted( projectRoot + "/2.3-SNAPSHOT/maven-plugin-plugin-2.3-SNAPSHOT.pom" ); + assertDeleted( projectRoot + "/2.3-SNAPSHOT/maven-plugin-plugin-2.3-SNAPSHOT.pom.md5" ); + assertDeleted( projectRoot + "/2.3-SNAPSHOT/maven-plugin-plugin-2.3-SNAPSHOT.pom.sha1" ); + + // check if the released version was not removed + assertExists( projectRoot + "/2.3" ); + assertExists( projectRoot + "/2.3/maven-plugin-plugin-2.3-sources.jar" ); + assertExists( projectRoot + "/2.3/maven-plugin-plugin-2.3-sources.jar.md5" ); + assertExists( projectRoot + "/2.3/maven-plugin-plugin-2.3-sources.jar.sha1" ); + assertExists( projectRoot + "/2.3/maven-plugin-plugin-2.3.jar" ); + assertExists( projectRoot + "/2.3/maven-plugin-plugin-2.3.jar.md5" ); + assertExists( projectRoot + "/2.3/maven-plugin-plugin-2.3.jar.sha1" ); + assertExists( projectRoot + "/2.3/maven-plugin-plugin-2.3.pom" ); + assertExists( projectRoot + "/2.3/maven-plugin-plugin-2.3.pom.md5" ); + assertExists( projectRoot + "/2.3/maven-plugin-plugin-2.3.pom.sha1" ); + + // check if metadata file was updated + File artifactMetadataFile = new File( projectRoot + "/maven-metadata.xml" ); + + String metadataXml = FileUtils.readFileToString( artifactMetadataFile, null ); + + String expectedVersions = "2.2" + + "2.3"; + + XMLAssert.assertXpathEvaluatesTo( "2.3", "//metadata/versioning/release", metadataXml ); + XMLAssert.assertXpathEvaluatesTo( "2.3", "//metadata/versioning/latest", metadataXml ); + XMLAssert.assertXpathsEqual( "//expected/versions/version", expectedVersions, + "//metadata/versioning/versions/version", metadataXml ); + XMLAssert.assertXpathEvaluatesTo( "20070315032817", "//metadata/versioning/lastUpdated", metadataXml ); + } + + public void testReleasedSnapshotsExistsInDifferentRepo() + throws Exception + { + Configuration config = archivaConfiguration.getConfiguration(); + config.removeManagedRepository( config.findManagedRepositoryById( TEST_REPO_ID ) ); + config.addManagedRepository( getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME ) ); + config.addManagedRepository( getRepoConfiguration( RELEASES_TEST_REPO_ID, RELEASES_TEST_REPO_NAME ) ); + + populateReleasedSnapshotsTestInDiffRepo(); + + String repoRoot = prepareTestRepos(); + + repoPurge.process( PATH_TO_RELEASED_SNAPSHOT_IN_DIFF_REPO ); + + String projectRoot = repoRoot + "/org/apache/archiva/released-artifact-in-diff-repo"; + + // check if the snapshot was removed + assertDeleted( projectRoot + "/1.0-SNAPSHOT" ); + assertDeleted( projectRoot + "/1.0-SNAPSHOT/released-artifact-in-diff-repo-1.0-SNAPSHOT.jar" ); + assertDeleted( projectRoot + "/1.0-SNAPSHOT/released-artifact-in-diff-repo-1.0-SNAPSHOT.jar.md5" ); + assertDeleted( projectRoot + "/1.0-SNAPSHOT/released-artifact-in-diff-repo-1.0-SNAPSHOT.jar.sha1" ); + assertDeleted( projectRoot + "/1.0-SNAPSHOT/released-artifact-in-diff-repo-1.0-SNAPSHOT.pom" ); + assertDeleted( projectRoot + "/1.0-SNAPSHOT/released-artifact-in-diff-repo-1.0-SNAPSHOT.pom.md5" ); + assertDeleted( projectRoot + "/1.0-SNAPSHOT/released-artifact-in-diff-repo-1.0-SNAPSHOT.pom.sha1" ); + + String releasesProjectRoot = + getTestFile( "target/test-" + getName() + "/releases-test-repo-one" ).getAbsolutePath() + + "/org/apache/archiva/released-artifact-in-diff-repo"; + + // check if the released version was not removed + assertExists( releasesProjectRoot + "/1.0" ); + assertExists( releasesProjectRoot + "/1.0/released-artifact-in-diff-repo-1.0.jar" ); + assertExists( releasesProjectRoot + "/1.0/released-artifact-in-diff-repo-1.0.jar.md5" ); + assertExists( releasesProjectRoot + "/1.0/released-artifact-in-diff-repo-1.0.jar.sha1" ); + assertExists( releasesProjectRoot + "/1.0/released-artifact-in-diff-repo-1.0.pom" ); + assertExists( releasesProjectRoot + "/1.0/released-artifact-in-diff-repo-1.0.pom.md5" ); + assertExists( releasesProjectRoot + "/1.0/released-artifact-in-diff-repo-1.0.pom.sha1" ); + } + + public void testHigherSnapshotExistsInSameRepo() + throws Exception + { + Configuration config = archivaConfiguration.getConfiguration(); + config.removeManagedRepository( config.findManagedRepositoryById( TEST_REPO_ID ) ); + config.addManagedRepository( getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME ) ); + + populateHigherSnapshotExistsTest(); + + String repoRoot = prepareTestRepos(); + + repoPurge.process( CleanupReleasedSnapshotsRepositoryPurgeTest.PATH_TO_HIGHER_SNAPSHOT_EXISTS_IN_SAME_REPO ); + + String projectRoot = repoRoot + "/org/apache/maven/plugins/maven-source-plugin"; + + // check if the snapshot was not removed + assertExists( projectRoot + "/2.0.3-SNAPSHOT" ); + assertExists( projectRoot + "/2.0.3-SNAPSHOT/maven-source-plugin-2.0.3-SNAPSHOT.jar" ); + assertExists( projectRoot + "/2.0.3-SNAPSHOT/maven-source-plugin-2.0.3-SNAPSHOT.jar.md5" ); + assertExists( projectRoot + "/2.0.3-SNAPSHOT/maven-source-plugin-2.0.3-SNAPSHOT.jar.sha1" ); + assertExists( projectRoot + "/2.0.3-SNAPSHOT/maven-source-plugin-2.0.3-SNAPSHOT.pom" ); + assertExists( projectRoot + "/2.0.3-SNAPSHOT/maven-source-plugin-2.0.3-SNAPSHOT.pom.md5" ); + assertExists( projectRoot + "/2.0.3-SNAPSHOT/maven-source-plugin-2.0.3-SNAPSHOT.pom.sha1" ); + + // check if the released version was not removed + assertExists( projectRoot + "/2.0.4-SNAPSHOT" ); + assertExists( projectRoot + "/2.0.4-SNAPSHOT/maven-source-plugin-2.0.4-SNAPSHOT.jar" ); + assertExists( projectRoot + "/2.0.4-SNAPSHOT/maven-source-plugin-2.0.4-SNAPSHOT.jar.md5" ); + assertExists( projectRoot + "/2.0.4-SNAPSHOT/maven-source-plugin-2.0.4-SNAPSHOT.jar.sha1" ); + assertExists( projectRoot + "/2.0.4-SNAPSHOT/maven-source-plugin-2.0.4-SNAPSHOT.pom" ); + assertExists( projectRoot + "/2.0.4-SNAPSHOT/maven-source-plugin-2.0.4-SNAPSHOT.pom.md5" ); + assertExists( projectRoot + "/2.0.4-SNAPSHOT/maven-source-plugin-2.0.4-SNAPSHOT.pom.sha1" ); + + // check if metadata file was not updated (because nothing was removed) + File artifactMetadataFile = new File( projectRoot + "/maven-metadata.xml" ); + + String metadataXml = FileUtils.readFileToString( artifactMetadataFile, null ); + + String expectedVersions = "2.0.3-SNAPSHOT" + + "2.0.4-SNAPSHOT"; + + XMLAssert.assertXpathEvaluatesTo( "2.0.4-SNAPSHOT", "//metadata/versioning/latest", metadataXml ); + XMLAssert.assertXpathsEqual( "//expected/versions/version", expectedVersions, + "//metadata/versioning/versions/version", metadataXml ); + XMLAssert.assertXpathEvaluatesTo( "20070427033345", "//metadata/versioning/lastUpdated", metadataXml ); + } + + private void populateReleasedSnapshotsTest() + throws ArchivaDatabaseException + { + List versions = new ArrayList(); + versions.add( "2.3-SNAPSHOT" ); + + populateDb( "org.apache.maven.plugins", "maven-plugin-plugin", versions ); + } + + private void populateHigherSnapshotExistsTest() + throws Exception + { + List versions = new ArrayList(); + versions.add( "2.0.3-SNAPSHOT" ); + + populateDb( "org.apache.maven.plugins", "maven-source-plugin", versions ); + } + + private void populateReleasedSnapshotsTestInDiffRepo() + throws ArchivaDatabaseException + { + List versions = new ArrayList(); + versions.add( "1.0-SNAPSHOT" ); + + populateDb( "org.apache.archiva", "released-artifact-in-diff-repo", versions ); + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/DaysOldRepositoryPurgeTest.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/DaysOldRepositoryPurgeTest.java new file mode 100644 index 000000000..5d51d71aa --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/DaysOldRepositoryPurgeTest.java @@ -0,0 +1,274 @@ +package org.apache.maven.archiva.consumers.core.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. + */ + +import org.apache.commons.lang.time.DateUtils; +import org.apache.maven.archiva.consumers.core.repository.stubs.LuceneRepositoryContentIndexStub; +import org.apache.maven.archiva.indexer.RepositoryContentIndex; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author Maria Odea Ching + */ +public class DaysOldRepositoryPurgeTest + extends AbstractRepositoryPurgeTest +{ + + private Map map; + + private static final String[] extensions = + new String[] { "-5.jar", "-5.pom", "-6.jar", "-6.pom", "-7.jar", "-7.pom" }; + + private String year; + + private String mon; + + private String day; + + private String hr; + + private String min; + + private String sec; + + protected void setUp() + throws Exception + { + super.setUp(); + } + + private void setLastModified( String dirPath, long lastModified ) + { + File dir = new File( dirPath ); + File[] contents = dir.listFiles(); + for ( int i = 0; i < contents.length; i++ ) + { + contents[i].setLastModified( lastModified ); + } + } + + public void testByLastModified() + throws Exception + { + map = new HashMap(); + map.put( "filecontent", new LuceneRepositoryContentIndexStub( 2 ) ); + map.put( "hashcodes", new LuceneRepositoryContentIndexStub( 2 ) ); + map.put( "bytecode", new LuceneRepositoryContentIndexStub( 2 ) ); + + repoPurge = + new DaysOldRepositoryPurge( getRepository(), dao, getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME ).getDaysOlder(), + getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME ).getRetentionCount(), map ); + + String repoRoot = prepareTestRepos(); + + String projectRoot = repoRoot + "/org/apache/maven/plugins/maven-install-plugin"; + + setLastModified( projectRoot + "/2.2-SNAPSHOT/", 1179382029 ); + + populateDbForTestByLastModified(); + + repoPurge.process( PATH_TO_BY_DAYS_OLD_ARTIFACT ); + + assertDeleted( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-SNAPSHOT.jar" ); + assertDeleted( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-SNAPSHOT.jar.md5" ); + assertDeleted( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-SNAPSHOT.jar.sha1" ); + assertDeleted( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-SNAPSHOT.pom" ); + assertDeleted( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-SNAPSHOT.pom.md5" ); + assertDeleted( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-SNAPSHOT.pom.sha1" ); + + // shouldn't be deleted because even if older than 30 days (because retention count = 2) + assertExists( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20070513.034619-5.jar" ); + assertExists( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20070513.034619-5.jar.md5" ); + assertExists( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20070513.034619-5.jar.sha1" ); + assertExists( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20070513.034619-5.pom" ); + assertExists( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20070513.034619-5.pom.md5" ); + assertExists( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20070513.034619-5.pom.sha1" ); + + assertExists( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20061118.060401-2.jar" ); + assertExists( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20061118.060401-2.jar.md5" ); + assertExists( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20061118.060401-2.jar.sha1" ); + assertExists( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20061118.060401-2.pom" ); + assertExists( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20061118.060401-2.pom.md5" ); + assertExists( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20061118.060401-2.pom.sha1" ); + } + + public void testOrderOfDeletion() + throws Exception + { + map = new HashMap(); + map.put( "filecontent", new LuceneRepositoryContentIndexStub( 2 ) ); + map.put( "hashcodes", new LuceneRepositoryContentIndexStub( 2 ) ); + map.put( "bytecode", new LuceneRepositoryContentIndexStub( 2 ) ); + + repoPurge = + new DaysOldRepositoryPurge( getRepository(), dao, getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME ).getDaysOlder(), + getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME ).getRetentionCount(), map ); + + String repoRoot = prepareTestRepos(); + + String projectRoot = repoRoot + "/org/apache/maven/plugins/maven-assembly-plugin"; + + setLastModified( projectRoot + "/1.1.2-SNAPSHOT/", 1179382029 ); + + populateDbForTestOrderOfDeletion(); + + repoPurge.process( PATH_TO_TEST_ORDER_OF_DELETION ); + + assertDeleted( projectRoot + "/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070427.065136-1.jar" ); + assertDeleted( projectRoot + "/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070427.065136-1.jar.sha1" ); + assertDeleted( projectRoot + "/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070427.065136-1.jar.md5" ); + assertDeleted( projectRoot + "/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070427.065136-1.pom" ); + assertDeleted( projectRoot + "/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070427.065136-1.pom.sha1" ); + assertDeleted( projectRoot + "/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070427.065136-1.pom.md5" ); + + // the following should not have been deleted + assertExists( projectRoot + "/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070506.163513-2.jar" ); + assertExists( projectRoot + "/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070506.163513-2.jar.sha1" ); + assertExists( projectRoot + "/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070506.163513-2.jar.md5" ); + assertExists( projectRoot + "/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070506.163513-2.pom" ); + assertExists( projectRoot + "/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070506.163513-2.pom.sha1" ); + assertExists( projectRoot + "/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070506.163513-2.pom.md5" ); + + assertExists( projectRoot + "/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070615.105019-3.jar" ); + assertExists( projectRoot + "/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070615.105019-3.jar.sha1" ); + assertExists( projectRoot + "/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070615.105019-3.jar.md5" ); + assertExists( projectRoot + "/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070615.105019-3.pom" ); + assertExists( projectRoot + "/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070615.105019-3.pom.sha1" ); + assertExists( projectRoot + "/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070615.105019-3.pom.md5" ); + } + + public void testMetadataDrivenSnapshots() + throws Exception + { + map = new HashMap(); + map.put( "filecontent", new LuceneRepositoryContentIndexStub( 2 ) ); + map.put( "hashcodes", new LuceneRepositoryContentIndexStub( 2 ) ); + map.put( "bytecode", new LuceneRepositoryContentIndexStub( 2 ) ); + + repoPurge = + new DaysOldRepositoryPurge( getRepository(), dao, getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME ).getDaysOlder(), + getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME ).getRetentionCount(), map ); + + String repoRoot = prepareTestRepos(); + + String versionRoot = repoRoot + "/org/codehaus/plexus/plexus-utils/1.4.3-SNAPSHOT"; + + Calendar currentDate = Calendar.getInstance( DateUtils.UTC_TIME_ZONE ); + setLastModified( versionRoot, currentDate.getTimeInMillis() ); + + year = String.valueOf( currentDate.get( Calendar.YEAR ) ); + mon = String.valueOf( currentDate.get( Calendar.MONTH ) + 1 ); + day = String.valueOf( currentDate.get( Calendar.DATE ) ); + hr = String.valueOf( currentDate.get( Calendar.HOUR ) ); + min = String.valueOf( currentDate.get( Calendar.MINUTE ) ); + sec = String.valueOf( currentDate.get( Calendar.SECOND ) ); + + if ( mon.length() == 1 ) + { + mon = "0" + mon; + } + + if ( day.length() == 1 ) + { + day = "0" + day; + } + + if ( hr.length() == 1 ) + { + hr = "0" + hr; + } + + if ( min.length() == 1 ) + { + min = "0" + min; + } + + if ( sec.length() == 1 ) + { + sec = "0" + sec; + } + + createFiles( versionRoot ); + + List versions = new ArrayList(); + versions.add( "1.4.3-20070113.163208-4" ); + versions.add( "1.4.3-" + year + mon + day + "." + hr + min + sec + "-5" ); + versions.add( "1.4.3-" + year + mon + day + "." + hr + min + sec + "-6" ); + versions.add( "1.4.3-" + year + mon + day + "." + hr + min + sec + "-7" ); + versions.add( "1.4.3-SNAPSHOT" ); + + populateDb( "org.codehaus.plexus", "plexus-utils", versions ); + + repoPurge.process( PATH_TO_BY_DAYS_OLD_METADATA_DRIVEN_ARTIFACT ); + + // this should be deleted since the filename version (timestamp) is older than + // 100 days even if the last modified date was <100 days ago + assertDeleted( versionRoot + "/plexus-utils-1.4.3-20070113.163208-4.jar" ); + assertDeleted( versionRoot + "/plexus-utils-1.4.3-20070113.163208-4.jar.sha1" ); + assertDeleted( versionRoot + "/plexus-utils-1.4.3-20070113.163208-4.pom" ); + assertDeleted( versionRoot + "/plexus-utils-1.4.3-20070113.163208-4.pom.sha1" ); + + // this should not be deleted because last modified date is <100 days ago + assertExists( versionRoot + "/plexus-utils-1.4.3-SNAPSHOT.jar" ); + assertExists( versionRoot + "/plexus-utils-1.4.3-SNAPSHOT.pom" ); + + for ( int i = 0; i < extensions.length; i++ ) + { + assertExists( versionRoot + "/plexus-utils-1.4.3-" + year + mon + day + "." + hr + min + sec + + extensions[i] ); + } + } + + private void createFiles( String versionRoot ) + throws IOException + { + for ( int i = 0; i < extensions.length; i++ ) + { + File file = + new File( versionRoot, "/plexus-utils-1.4.3-" + year + mon + day + "." + hr + min + sec + extensions[i] ); + file.createNewFile(); + } + } + + protected void tearDown() + throws Exception + { + super.tearDown(); + repoPurge = null; + } + + private void populateDbForTestByLastModified() + throws Exception + { + List versions = new ArrayList(); + versions.add( "2.2-20061118.060401-2" ); + versions.add( "2.2-20070513.034619-5" ); + versions.add( "2.2-SNAPSHOT" ); + + populateDb( "org.apache.maven.plugins", "maven-install-plugin", versions ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/RepositoryPurgeConsumerTest.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/RepositoryPurgeConsumerTest.java new file mode 100644 index 000000000..ca8b63f6c --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/RepositoryPurgeConsumerTest.java @@ -0,0 +1,334 @@ +package org.apache.maven.archiva.consumers.core.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. + */ + +import org.apache.commons.io.FileUtils; +import org.apache.maven.archiva.common.utils.BaseFile; +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.Configuration; +import org.apache.maven.archiva.configuration.FileType; +import org.apache.maven.archiva.configuration.FileTypes; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer; +import org.apache.maven.archiva.consumers.core.repository.stubs.LuceneRepositoryContentIndexFactoryStub; +import org.apache.maven.archiva.database.ArchivaDatabaseException; +import org.apache.maven.archiva.repository.scanner.functors.ConsumerWantsFilePredicate; +import org.custommonkey.xmlunit.XMLAssert; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; + +/** + * @author Maria Odea Ching + */ +public class RepositoryPurgeConsumerTest + extends AbstractRepositoryPurgeTest +{ + public void testConsumption() + throws Exception + { + assertNotConsumed( "org/apache/maven/plugins/maven-plugin-plugin/2.4.1/maven-metadata.xml" ); + } + + public void testConsumptionOfOtherMetadata() + throws Exception + { + assertNotConsumed( "org/apache/maven/plugins/maven-plugin-plugin/2.4.1/maven-metadata-central.xml" ); + } + + private void assertNotConsumed( String path ) + throws Exception + { + ArchivaConfiguration archivaConfiguration = (ArchivaConfiguration) lookup( ArchivaConfiguration.ROLE ); + FileType fileType = + (FileType) archivaConfiguration.getConfiguration().getRepositoryScanning().getFileTypes().get( 0 ); + assertEquals( FileTypes.ARTIFACTS, fileType.getId() ); + fileType.addPattern( "**/*.xml" ); + + // trigger reload + FileTypes fileTypes = (FileTypes) lookup( FileTypes.class ); + fileTypes.afterConfigurationChange( null, "repositoryScanning.fileTypes", null ); + + KnownRepositoryContentConsumer repoPurgeConsumer = + (KnownRepositoryContentConsumer) lookup( KnownRepositoryContentConsumer.class, "repository-purge" ); + + File repoLocation = getTestFile( "target/test-" + getName() + "/test-repo" ); + + File localFile = + new File( repoLocation, path ); + + ConsumerWantsFilePredicate predicate = new ConsumerWantsFilePredicate(); + BaseFile baseFile = new BaseFile( repoLocation, localFile ); + predicate.setBasefile( baseFile ); + + assertFalse( predicate.evaluate( repoPurgeConsumer ) ); + } + + private void setLastModified( String path ) + { + File dir = new File( path ); + File[] contents = dir.listFiles(); + for ( int i = 0; i < contents.length; i++ ) + { + contents[i].setLastModified( 1179382029 ); + } + } + + public void testConsumerByRetentionCount() + throws Exception + { + KnownRepositoryContentConsumer repoPurgeConsumer = + (KnownRepositoryContentConsumer) lookup( KnownRepositoryContentConsumer.class, + "repo-purge-consumer-by-retention-count" ); + + LuceneRepositoryContentIndexFactoryStub indexFactory = new LuceneRepositoryContentIndexFactoryStub(); + indexFactory.setExpectedRecordsSize( 2 ); + + ( (RepositoryPurgeConsumer) repoPurgeConsumer ).setRepositoryContentIndexFactory( indexFactory ); + + populateDbForRetentionCountTest(); + + ManagedRepositoryConfiguration repoConfiguration = getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME ); + repoConfiguration.setDaysOlder( 0 ); // force days older off to allow retention count purge to execute. + repoConfiguration.setRetentionCount( TEST_RETENTION_COUNT ); + addRepoToConfiguration( "retention-count", repoConfiguration ); + + repoPurgeConsumer.beginScan( repoConfiguration, null ); + + String repoRoot = prepareTestRepos(); + + repoPurgeConsumer.processFile( PATH_TO_BY_RETENTION_COUNT_ARTIFACT ); + + String versionRoot = repoRoot + "/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT"; + + // assert if removed from repo + assertDeleted( versionRoot + "/jruby-rake-plugin-1.0RC1-20070504.153317-1.jar" ); + assertDeleted( versionRoot + "/jruby-rake-plugin-1.0RC1-20070504.153317-1.jar.md5" ); + assertDeleted( versionRoot + "/jruby-rake-plugin-1.0RC1-20070504.153317-1.jar.sha1" ); + assertDeleted( versionRoot + "/jruby-rake-plugin-1.0RC1-20070504.153317-1.pom" ); + assertDeleted( versionRoot + "/jruby-rake-plugin-1.0RC1-20070504.153317-1.pom.md5" ); + assertDeleted( versionRoot + "/jruby-rake-plugin-1.0RC1-20070504.153317-1.pom.sha1" ); + + assertDeleted( versionRoot + "/jruby-rake-plugin-1.0RC1-20070504.160758-2.jar" ); + assertDeleted( versionRoot + "/jruby-rake-plugin-1.0RC1-20070504.160758-2.jar.md5" ); + assertDeleted( versionRoot + "/jruby-rake-plugin-1.0RC1-20070504.160758-2.jar.sha1" ); + assertDeleted( versionRoot + "/jruby-rake-plugin-1.0RC1-20070504.160758-2.pom" ); + assertDeleted( versionRoot + "/jruby-rake-plugin-1.0RC1-20070504.160758-2.pom.md5" ); + assertDeleted( versionRoot + "/jruby-rake-plugin-1.0RC1-20070504.160758-2.pom.sha1" ); + + // assert if not removed from repo + assertExists( versionRoot + "/jruby-rake-plugin-1.0RC1-20070505.090015-3.jar" ); + assertExists( versionRoot + "/jruby-rake-plugin-1.0RC1-20070505.090015-3.jar.md5" ); + assertExists( versionRoot + "/jruby-rake-plugin-1.0RC1-20070505.090015-3.jar.sha1" ); + assertExists( versionRoot + "/jruby-rake-plugin-1.0RC1-20070505.090015-3.pom" ); + assertExists( versionRoot + "/jruby-rake-plugin-1.0RC1-20070505.090015-3.pom.md5" ); + assertExists( versionRoot + "/jruby-rake-plugin-1.0RC1-20070505.090015-3.pom.sha1" ); + + assertExists( versionRoot + "/jruby-rake-plugin-1.0RC1-20070506.090132-4.jar" ); + assertExists( versionRoot + "/jruby-rake-plugin-1.0RC1-20070506.090132-4.jar.md5" ); + assertExists( versionRoot + "/jruby-rake-plugin-1.0RC1-20070506.090132-4.jar.sha1" ); + assertExists( versionRoot + "/jruby-rake-plugin-1.0RC1-20070506.090132-4.pom" ); + assertExists( versionRoot + "/jruby-rake-plugin-1.0RC1-20070506.090132-4.pom.md5" ); + assertExists( versionRoot + "/jruby-rake-plugin-1.0RC1-20070506.090132-4.pom.sha1" ); + } + + private void addRepoToConfiguration( String configHint, ManagedRepositoryConfiguration repoConfiguration ) + throws Exception + { + ArchivaConfiguration archivaConfiguration = + (ArchivaConfiguration) lookup( ArchivaConfiguration.class, configHint ); + Configuration configuration = archivaConfiguration.getConfiguration(); + configuration.removeManagedRepository( configuration.findManagedRepositoryById( repoConfiguration.getId() ) ); + configuration.addManagedRepository( repoConfiguration ); + } + + public void testConsumerByDaysOld() + throws Exception + { + populateDbForDaysOldTest(); + + KnownRepositoryContentConsumer repoPurgeConsumer = + (KnownRepositoryContentConsumer) lookup( KnownRepositoryContentConsumer.class, + "repo-purge-consumer-by-days-old" ); + + LuceneRepositoryContentIndexFactoryStub indexFactory = new LuceneRepositoryContentIndexFactoryStub(); + indexFactory.setExpectedRecordsSize( 2 ); + + ( (RepositoryPurgeConsumer) repoPurgeConsumer ).setRepositoryContentIndexFactory( indexFactory ); + + ManagedRepositoryConfiguration repoConfiguration = getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME ); + repoConfiguration.setDaysOlder( TEST_DAYS_OLDER ); + addRepoToConfiguration( "days-old", repoConfiguration ); + + repoPurgeConsumer.beginScan( repoConfiguration, null ); + + String repoRoot = prepareTestRepos(); + String projectRoot = repoRoot + "/org/apache/maven/plugins/maven-install-plugin"; + + setLastModified( projectRoot + "/2.2-SNAPSHOT" ); + + repoPurgeConsumer.processFile( PATH_TO_BY_DAYS_OLD_ARTIFACT ); + + assertDeleted( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-SNAPSHOT.jar" ); + assertDeleted( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-SNAPSHOT.jar.md5" ); + assertDeleted( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-SNAPSHOT.jar.sha1" ); + assertDeleted( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-SNAPSHOT.pom" ); + assertDeleted( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-SNAPSHOT.pom.md5" ); + assertDeleted( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-SNAPSHOT.pom.sha1" ); + + // shouldn't be deleted because even if older than 30 days (because retention count = 2) + assertExists( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20070513.034619-5.jar" ); + assertExists( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20070513.034619-5.jar.md5" ); + assertExists( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20070513.034619-5.jar.sha1" ); + assertExists( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20070513.034619-5.pom" ); + assertExists( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20070513.034619-5.pom.md5" ); + assertExists( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20070513.034619-5.pom.sha1" ); + + assertExists( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20061118.060401-2.jar" ); + assertExists( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20061118.060401-2.jar.md5" ); + assertExists( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20061118.060401-2.jar.sha1" ); + assertExists( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20061118.060401-2.pom" ); + assertExists( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20061118.060401-2.pom.md5" ); + assertExists( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-20061118.060401-2.pom.sha1" ); + } + + /** + * Test the snapshot clean consumer on a repository set to NOT clean/delete snapshots based on released versions. + * + * @throws Exception + */ + public void testReleasedSnapshotsWereNotCleaned() + throws Exception + { + KnownRepositoryContentConsumer repoPurgeConsumer = + (KnownRepositoryContentConsumer) lookup( KnownRepositoryContentConsumer.class, + "repo-purge-consumer-by-retention-count" ); + + populateDbForReleasedSnapshotsTest(); + + ManagedRepositoryConfiguration repoConfiguration = getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME ); + repoConfiguration.setDeleteReleasedSnapshots( false ); // Set to NOT delete released snapshots. + addRepoToConfiguration( "retention-count", repoConfiguration ); + + repoPurgeConsumer.beginScan( repoConfiguration, null ); + + String repoRoot = prepareTestRepos(); + + repoPurgeConsumer.processFile( CleanupReleasedSnapshotsRepositoryPurgeTest.PATH_TO_RELEASED_SNAPSHOT_IN_SAME_REPO ); + + // check if the snapshot wasn't removed + String projectRoot = repoRoot + "/org/apache/maven/plugins/maven-plugin-plugin"; + + assertExists( projectRoot + "/2.3-SNAPSHOT" ); + assertExists( projectRoot + "/2.3-SNAPSHOT/maven-plugin-plugin-2.3-SNAPSHOT.jar" ); + assertExists( projectRoot + "/2.3-SNAPSHOT/maven-plugin-plugin-2.3-SNAPSHOT.jar.md5" ); + assertExists( projectRoot + "/2.3-SNAPSHOT/maven-plugin-plugin-2.3-SNAPSHOT.jar.sha1" ); + assertExists( projectRoot + "/2.3-SNAPSHOT/maven-plugin-plugin-2.3-SNAPSHOT.pom" ); + assertExists( projectRoot + "/2.3-SNAPSHOT/maven-plugin-plugin-2.3-SNAPSHOT.pom.md5" ); + assertExists( projectRoot + "/2.3-SNAPSHOT/maven-plugin-plugin-2.3-SNAPSHOT.pom.sha1" ); + + // check if metadata file wasn't updated + File artifactMetadataFile = new File( projectRoot + "/maven-metadata.xml" ); + + String metadataXml = FileUtils.readFileToString( artifactMetadataFile, null ); + + String expectedVersions = "2.3-SNAPSHOT"; + + XMLAssert.assertXpathEvaluatesTo( "2.3-SNAPSHOT", "//metadata/versioning/latest", metadataXml ); + XMLAssert.assertXpathsEqual( "//expected/versions/version", expectedVersions, + "//metadata/versioning/versions/version", metadataXml ); + XMLAssert.assertXpathEvaluatesTo( "20070315032817", "//metadata/versioning/lastUpdated", metadataXml ); + } + + public void testReleasedSnapshotsWereCleaned() + throws Exception + { + KnownRepositoryContentConsumer repoPurgeConsumer = + (KnownRepositoryContentConsumer) lookup( KnownRepositoryContentConsumer.class, + "repo-purge-consumer-by-days-old" ); + + populateDbForReleasedSnapshotsTest(); + + ManagedRepositoryConfiguration repoConfiguration = getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME ); + repoConfiguration.setDeleteReleasedSnapshots( true ); + addRepoToConfiguration( "days-old", repoConfiguration ); + + repoPurgeConsumer.beginScan( repoConfiguration, null ); + + String repoRoot = prepareTestRepos(); + + repoPurgeConsumer.processFile( CleanupReleasedSnapshotsRepositoryPurgeTest.PATH_TO_RELEASED_SNAPSHOT_IN_SAME_REPO ); + + String projectRoot = repoRoot + "/org/apache/maven/plugins/maven-plugin-plugin"; + + // check if the snapshot was removed + assertDeleted( projectRoot + "/2.3-SNAPSHOT" ); + assertDeleted( projectRoot + "/2.3-SNAPSHOT/maven-plugin-plugin-2.3-SNAPSHOT.jar" ); + assertDeleted( projectRoot + "/2.3-SNAPSHOT/maven-plugin-plugin-2.3-SNAPSHOT.jar.md5" ); + assertDeleted( projectRoot + "/2.3-SNAPSHOT/maven-plugin-plugin-2.3-SNAPSHOT.jar.sha1" ); + assertDeleted( projectRoot + "/2.3-SNAPSHOT/maven-plugin-plugin-2.3-SNAPSHOT.pom" ); + assertDeleted( projectRoot + "/2.3-SNAPSHOT/maven-plugin-plugin-2.3-SNAPSHOT.pom.md5" ); + assertDeleted( projectRoot + "/2.3-SNAPSHOT/maven-plugin-plugin-2.3-SNAPSHOT.pom.sha1" ); + + // check if metadata file was updated + File artifactMetadataFile = new File( projectRoot + "/maven-metadata.xml" ); + + String metadataXml = FileUtils.readFileToString( artifactMetadataFile, null ); + + String expectedVersions = + "2.2" + "2.3"; + + XMLAssert.assertXpathEvaluatesTo( "2.3", "//metadata/versioning/latest", metadataXml ); + XMLAssert.assertXpathsEqual( "//expected/versions/version", expectedVersions, + "//metadata/versioning/versions/version", metadataXml ); + XMLAssert.assertXpathEvaluatesTo( "20070315032817", "//metadata/versioning/lastUpdated", metadataXml ); + } + + public void populateDbForRetentionCountTest() + throws ArchivaDatabaseException + { + List versions = new ArrayList(); + versions.add( "1.0RC1-20070504.153317-1" ); + versions.add( "1.0RC1-20070504.160758-2" ); + versions.add( "1.0RC1-20070505.090015-3" ); + versions.add( "1.0RC1-20070506.090132-4" ); + + populateDb( "org.jruby.plugins", "jruby-rake-plugin", versions ); + } + + private void populateDbForDaysOldTest() + throws ArchivaDatabaseException + { + List versions = new ArrayList(); + versions.add( "2.2-SNAPSHOT" ); + + populateDb( "org.apache.maven.plugins", "maven-install-plugin", versions ); + } + + public void populateDbForReleasedSnapshotsTest() + throws ArchivaDatabaseException + { + List versions = new ArrayList(); + versions.add( "2.3-SNAPSHOT" ); + + populateDb( "org.apache.maven.plugins", "maven-plugin-plugin", versions ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/RetentionCountRepositoryPurgeTest.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/RetentionCountRepositoryPurgeTest.java new file mode 100644 index 000000000..f67720ccf --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/RetentionCountRepositoryPurgeTest.java @@ -0,0 +1,203 @@ +package org.apache.maven.archiva.consumers.core.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. + */ + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.maven.archiva.consumers.core.repository.stubs.LuceneRepositoryContentIndexStub; +import org.apache.maven.archiva.indexer.RepositoryContentIndex; + +/** + * Test RetentionsCountRepositoryPurgeTest + * + * @author Maria Odea Ching + */ +public class RetentionCountRepositoryPurgeTest + extends AbstractRepositoryPurgeTest +{ + + protected void setUp() + throws Exception + { + super.setUp(); + + Map map = new HashMap(); + map.put( "filecontent", new LuceneRepositoryContentIndexStub( 2 ) ); + map.put( "hashcodes", new LuceneRepositoryContentIndexStub( 2 ) ); + map.put( "bytecode", new LuceneRepositoryContentIndexStub( 2 ) ); + + repoPurge = new RetentionCountRepositoryPurge( getRepository(), dao, + getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME ).getRetentionCount(), map ); + } + + /** + * Test if the artifact to be processed was a jar. + * + * @throws Exception + */ + public void testIfAJarWasFound() + throws Exception + { + populateIfJarWasFoundDb(); + + String repoRoot = prepareTestRepos(); + + repoPurge.process( PATH_TO_BY_RETENTION_COUNT_ARTIFACT ); + + String versionRoot = repoRoot + "/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT"; + + // assert if removed from repo + assertDeleted( versionRoot + "/jruby-rake-plugin-1.0RC1-20070504.153317-1.jar" ); + assertDeleted( versionRoot + "/jruby-rake-plugin-1.0RC1-20070504.153317-1.jar.md5" ); + assertDeleted( versionRoot + "/jruby-rake-plugin-1.0RC1-20070504.153317-1.jar.sha1" ); + assertDeleted( versionRoot + "/jruby-rake-plugin-1.0RC1-20070504.153317-1.pom" ); + assertDeleted( versionRoot + "/jruby-rake-plugin-1.0RC1-20070504.153317-1.pom.md5" ); + assertDeleted( versionRoot + "/jruby-rake-plugin-1.0RC1-20070504.153317-1.pom.sha1" ); + + assertDeleted( versionRoot + "/jruby-rake-plugin-1.0RC1-20070504.160758-2.jar" ); + assertDeleted( versionRoot + "/jruby-rake-plugin-1.0RC1-20070504.160758-2.jar.md5" ); + assertDeleted( versionRoot + "/jruby-rake-plugin-1.0RC1-20070504.160758-2.jar.sha1" ); + assertDeleted( versionRoot + "/jruby-rake-plugin-1.0RC1-20070504.160758-2.pom" ); + assertDeleted( versionRoot + "/jruby-rake-plugin-1.0RC1-20070504.160758-2.pom.md5" ); + assertDeleted( versionRoot + "/jruby-rake-plugin-1.0RC1-20070504.160758-2.pom.sha1" ); + + // assert if not removed from repo + assertExists( versionRoot + "/jruby-rake-plugin-1.0RC1-20070505.090015-3.jar" ); + assertExists( versionRoot + "/jruby-rake-plugin-1.0RC1-20070505.090015-3.jar.md5" ); + assertExists( versionRoot + "/jruby-rake-plugin-1.0RC1-20070505.090015-3.jar.sha1" ); + assertExists( versionRoot + "/jruby-rake-plugin-1.0RC1-20070505.090015-3.pom" ); + assertExists( versionRoot + "/jruby-rake-plugin-1.0RC1-20070505.090015-3.pom.md5" ); + assertExists( versionRoot + "/jruby-rake-plugin-1.0RC1-20070505.090015-3.pom.sha1" ); + + assertExists( versionRoot + "/jruby-rake-plugin-1.0RC1-20070506.090132-4.jar" ); + assertExists( versionRoot + "/jruby-rake-plugin-1.0RC1-20070506.090132-4.jar.md5" ); + assertExists( versionRoot + "/jruby-rake-plugin-1.0RC1-20070506.090132-4.jar.sha1" ); + assertExists( versionRoot + "/jruby-rake-plugin-1.0RC1-20070506.090132-4.pom" ); + assertExists( versionRoot + "/jruby-rake-plugin-1.0RC1-20070506.090132-4.pom.md5" ); + assertExists( versionRoot + "/jruby-rake-plugin-1.0RC1-20070506.090132-4.pom.sha1" ); + } + + /** + * Test if the artifact to be processed is a pom + * + * @throws Exception + */ + public void testIfAPomWasFound() + throws Exception + { + populateIfPomWasFoundDb(); + + String repoRoot = prepareTestRepos(); + + repoPurge.process( PATH_TO_BY_RETENTION_COUNT_POM ); + + String versionRoot = repoRoot + "/org/codehaus/castor/castor-anttasks/1.1.2-SNAPSHOT"; + + // assert if removed from repo + assertDeleted( versionRoot + "/castor-anttasks-1.1.2-20070427.065136-1.jar" ); + assertDeleted( versionRoot + "/castor-anttasks-1.1.2-20070427.065136-1.jar.md5" ); + assertDeleted( versionRoot + "/castor-anttasks-1.1.2-20070427.065136-1.jar.sha1" ); + assertDeleted( versionRoot + "/castor-anttasks-1.1.2-20070427.065136-1.pom" ); + assertDeleted( versionRoot + "/castor-anttasks-1.1.2-20070427.065136-1.pom.md5" ); + assertDeleted( versionRoot + "/castor-anttasks-1.1.2-20070427.065136-1.pom.sha1" ); + + // assert if not removed from repo + assertExists( versionRoot + "/castor-anttasks-1.1.2-20070615.105019-3.pom" ); + assertExists( versionRoot + "/castor-anttasks-1.1.2-20070615.105019-3.pom.md5" ); + assertExists( versionRoot + "/castor-anttasks-1.1.2-20070615.105019-3.pom.sha1" ); + assertExists( versionRoot + "/castor-anttasks-1.1.2-20070615.105019-3.jar" ); + assertExists( versionRoot + "/castor-anttasks-1.1.2-20070615.105019-3.jar.md5" ); + assertExists( versionRoot + "/castor-anttasks-1.1.2-20070615.105019-3.jar.sha1" ); + assertExists( versionRoot + "/castor-anttasks-1.1.2-20070615.105019-3-sources.jar" ); + assertExists( versionRoot + "/castor-anttasks-1.1.2-20070615.105019-3-sources.jar.md5" ); + assertExists( versionRoot + "/castor-anttasks-1.1.2-20070615.105019-3-sources.jar.sha1" ); + + assertExists( versionRoot + "/castor-anttasks-1.1.2-20070506.163513-2.pom" ); + assertExists( versionRoot + "/castor-anttasks-1.1.2-20070506.163513-2.pom.md5" ); + assertExists( versionRoot + "/castor-anttasks-1.1.2-20070506.163513-2.pom.sha1" ); + assertExists( versionRoot + "/castor-anttasks-1.1.2-20070506.163513-2.jar" ); + assertExists( versionRoot + "/castor-anttasks-1.1.2-20070506.163513-2.jar.md5" ); + assertExists( versionRoot + "/castor-anttasks-1.1.2-20070506.163513-2.jar.sha1" ); + assertExists( versionRoot + "/castor-anttasks-1.1.2-20070506.163513-2-sources.jar" ); + assertExists( versionRoot + "/castor-anttasks-1.1.2-20070506.163513-2-sources.jar.md5" ); + assertExists( versionRoot + "/castor-anttasks-1.1.2-20070506.163513-2-sources.jar.sha1" ); + } + + public void testOrderOfDeletion() + throws Exception + { + populateDbForTestOrderOfDeletion(); + + String repoRoot = prepareTestRepos(); + + repoPurge.process( PATH_TO_TEST_ORDER_OF_DELETION ); + + String versionRoot = repoRoot + + "/org/apache/maven/plugins/maven-assembly-plugin/1.1.2-SNAPSHOT"; + + assertDeleted( versionRoot + "/maven-assembly-plugin-1.1.2-20070427.065136-1.jar" ); + assertDeleted( versionRoot + "/maven-assembly-plugin-1.1.2-20070427.065136-1.jar.sha1" ); + assertDeleted( versionRoot + "/maven-assembly-plugin-1.1.2-20070427.065136-1.jar.md5" ); + assertDeleted( versionRoot + "/maven-assembly-plugin-1.1.2-20070427.065136-1.pom" ); + assertDeleted( versionRoot + "/maven-assembly-plugin-1.1.2-20070427.065136-1.pom.sha1" ); + assertDeleted( versionRoot + "/maven-assembly-plugin-1.1.2-20070427.065136-1.pom.md5" ); + + // the following should not have been deleted + assertExists( versionRoot + "/maven-assembly-plugin-1.1.2-20070506.163513-2.jar" ); + assertExists( versionRoot + "/maven-assembly-plugin-1.1.2-20070506.163513-2.jar.sha1" ); + assertExists( versionRoot + "/maven-assembly-plugin-1.1.2-20070506.163513-2.jar.md5" ); + assertExists( versionRoot + "/maven-assembly-plugin-1.1.2-20070506.163513-2.pom" ); + assertExists( versionRoot + "/maven-assembly-plugin-1.1.2-20070506.163513-2.pom.sha1" ); + assertExists( versionRoot + "/maven-assembly-plugin-1.1.2-20070506.163513-2.pom.md5" ); + + assertExists( versionRoot + "/maven-assembly-plugin-1.1.2-20070615.105019-3.jar" ); + assertExists( versionRoot + "/maven-assembly-plugin-1.1.2-20070615.105019-3.jar.sha1" ); + assertExists( versionRoot + "/maven-assembly-plugin-1.1.2-20070615.105019-3.jar.md5" ); + assertExists( versionRoot + "/maven-assembly-plugin-1.1.2-20070615.105019-3.pom" ); + assertExists( versionRoot + "/maven-assembly-plugin-1.1.2-20070615.105019-3.pom.sha1" ); + assertExists( versionRoot + "/maven-assembly-plugin-1.1.2-20070615.105019-3.pom.md5" ); + } + + public void populateIfJarWasFoundDb() + throws Exception + { + List versions = new ArrayList(); + versions.add( "1.0RC1-20070504.153317-1" ); + versions.add( "1.0RC1-20070504.160758-2" ); + versions.add( "1.0RC1-20070505.090015-3" ); + versions.add( "1.0RC1-20070506.090132-4" ); + + populateDb( "org.jruby.plugins", "jruby-rake-plugin", versions ); + } + + public void populateIfPomWasFoundDb() + throws Exception + { + List versions = new ArrayList(); + versions.add( "1.1.2-20070427.065136-1" ); + versions.add( "1.1.2-20070615.105019-3" ); + versions.add( "1.1.2-20070506.163513-2" ); + + populateDb( "org.codehaus.castor", "castor-anttasks", versions ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/stubs/LuceneRepositoryContentIndexFactoryStub.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/stubs/LuceneRepositoryContentIndexFactoryStub.java new file mode 100644 index 000000000..f1958abe9 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/stubs/LuceneRepositoryContentIndexFactoryStub.java @@ -0,0 +1,60 @@ +package org.apache.maven.archiva.consumers.core.repository.stubs; + +/* + * 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.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.indexer.RepositoryContentIndex; +import org.apache.maven.archiva.indexer.RepositoryContentIndexFactory; + +/** + * LuceneRepositoryContenIndexFactoryStub + * + * @author Maria Odea Ching + * @version + */ +public class LuceneRepositoryContentIndexFactoryStub + implements RepositoryContentIndexFactory +{ + + private int expectedRecordsSize = 0; + + public RepositoryContentIndex createBytecodeIndex( ManagedRepositoryConfiguration repository ) + { + // TODO Auto-generated method stub + return new LuceneRepositoryContentIndexStub( expectedRecordsSize ); + } + + public RepositoryContentIndex createFileContentIndex( ManagedRepositoryConfiguration repository ) + { + // TODO Auto-generated method stub + return new LuceneRepositoryContentIndexStub( expectedRecordsSize ); + } + + public RepositoryContentIndex createHashcodeIndex( ManagedRepositoryConfiguration repository ) + { + // TODO Auto-generated method stub + return new LuceneRepositoryContentIndexStub( expectedRecordsSize ); + } + + public void setExpectedRecordsSize( int size ) + { + expectedRecordsSize = size; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/stubs/LuceneRepositoryContentIndexStub.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/stubs/LuceneRepositoryContentIndexStub.java new file mode 100644 index 000000000..bd891e17b --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/stubs/LuceneRepositoryContentIndexStub.java @@ -0,0 +1,147 @@ +package org.apache.maven.archiva.consumers.core.repository.stubs; + +/* + * 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; +import java.util.Collection; + +import junit.framework.Assert; + +import org.apache.lucene.analysis.Analyzer; +import org.apache.lucene.queryParser.QueryParser; +import org.apache.lucene.search.Searchable; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.indexer.RepositoryContentIndex; +import org.apache.maven.archiva.indexer.RepositoryIndexException; +import org.apache.maven.archiva.indexer.RepositoryIndexSearchException; +import org.apache.maven.archiva.indexer.lucene.LuceneEntryConverter; +import org.apache.maven.archiva.indexer.lucene.LuceneRepositoryContentRecord; + +/** + * @author Maria Odea Ching + * @version + */ +public class LuceneRepositoryContentIndexStub + implements RepositoryContentIndex +{ + private int expectedRecordsSize; + + public LuceneRepositoryContentIndexStub() + { + + } + + public LuceneRepositoryContentIndexStub( int size ) + { + expectedRecordsSize = size; + } + + public void deleteRecords( Collection records ) + throws RepositoryIndexException + { + Assert.assertEquals( expectedRecordsSize, records.size() ); + } + + public boolean exists() + throws RepositoryIndexException + { + // TODO Auto-generated method stub + return false; + } + + public Collection getAllRecordKeys() + throws RepositoryIndexException + { + // TODO Auto-generated method stub + return null; + } + + public Analyzer getAnalyzer() + { + // TODO Auto-generated method stub + return null; + } + + public LuceneEntryConverter getEntryConverter() + { + // TODO Auto-generated method stub + return null; + } + + public String getId() + { + // TODO Auto-generated method stub + return null; + } + + public File getIndexDirectory() + { + // TODO Auto-generated method stub + return null; + } + + public QueryParser getQueryParser() + { + // TODO Auto-generated method stub + return null; + } + + public ManagedRepositoryConfiguration getRepository() + { + // TODO Auto-generated method stub + return null; + } + + public Searchable getSearchable() + throws RepositoryIndexSearchException + { + // TODO Auto-generated method stub + return null; + } + + public void indexRecords( Collection records ) + throws RepositoryIndexException + { + // TODO Auto-generated method stub + + } + + public void modifyRecord( LuceneRepositoryContentRecord record ) + throws RepositoryIndexException + { + // TODO Auto-generated method stub + + } + + public void modifyRecords( Collection records ) + throws RepositoryIndexException + { + // TODO Auto-generated method stub + + } + + public void deleteRecord( LuceneRepositoryContentRecord record ) + throws RepositoryIndexException + { + // TODO Auto-generated method stub + + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/org/apache/maven/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurgeTest.xml b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/org/apache/maven/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurgeTest.xml new file mode 100644 index 000000000..49f384e42 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/org/apache/maven/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurgeTest.xml @@ -0,0 +1,104 @@ + + + + + + + + + org.apache.maven.archiva.database.jdo.JdoAccess + archiva + org.apache.maven.archiva.database.jdo.JdoAccess + + + org.codehaus.plexus.jdo.JdoFactory + archiva + + + + + + + org.codehaus.plexus.jdo.JdoFactory + archiva + org.codehaus.plexus.jdo.DefaultConfigurableJdoFactory + + org.jpox.PersistenceManagerFactoryImpl + org.hsqldb.jdbcDriver + sa + + jdbc:hsqldb:mem:testdb + + + javax.jdo.PersistenceManagerFactoryClass + org.jpox.PersistenceManagerFactoryImpl + + + + + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + cleanup-released-snapshots + org.apache.maven.archiva.configuration.DefaultArchivaConfiguration + + + org.codehaus.plexus.registry.Registry + cleanup-released-snapshots + + + org.apache.maven.archiva.policies.PreDownloadPolicy + prePolicies + + + org.apache.maven.archiva.policies.PostDownloadPolicy + postPolicies + + + + + + org.codehaus.plexus.registry.Registry + cleanup-released-snapshots + org.codehaus.plexus.registry.commons.CommonsConfigurationRegistry + + + + + + + + + org.apache.maven.archiva.repository.RepositoryContentFactory + cleanup-released-snapshots + org.apache.maven.archiva.repository.RepositoryContentFactory + RepositoryContentRequest + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + cleanup-released-snapshots + archivaConfiguration + + + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/org/apache/maven/archiva/consumers/core/repository/DaysOldRepositoryPurgeTest.xml b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/org/apache/maven/archiva/consumers/core/repository/DaysOldRepositoryPurgeTest.xml new file mode 100644 index 000000000..36d669d55 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/org/apache/maven/archiva/consumers/core/repository/DaysOldRepositoryPurgeTest.xml @@ -0,0 +1,58 @@ + + + + + + + + + org.apache.maven.archiva.database.jdo.JdoAccess + archiva + org.apache.maven.archiva.database.jdo.JdoAccess + + + org.codehaus.plexus.jdo.JdoFactory + archiva + + + + + + + org.codehaus.plexus.jdo.JdoFactory + archiva + org.codehaus.plexus.jdo.DefaultConfigurableJdoFactory + + org.jpox.PersistenceManagerFactoryImpl + org.hsqldb.jdbcDriver + sa + + jdbc:hsqldb:mem:testdb + + + javax.jdo.PersistenceManagerFactoryClass + org.jpox.PersistenceManagerFactoryImpl + + + + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/org/apache/maven/archiva/consumers/core/repository/RepositoryPurgeConsumerTest.xml b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/org/apache/maven/archiva/consumers/core/repository/RepositoryPurgeConsumerTest.xml new file mode 100644 index 000000000..52e286e66 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/org/apache/maven/archiva/consumers/core/repository/RepositoryPurgeConsumerTest.xml @@ -0,0 +1,308 @@ + + + + + + + + + org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer + repo-purge-consumer-by-retention-count + org.apache.maven.archiva.consumers.core.repository.RepositoryPurgeConsumer + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + retention-count + + + org.apache.maven.archiva.database.ArchivaDAO + jdo + + + org.apache.maven.archiva.repository.RepositoryContentFactory + retention-count + + + org.apache.maven.archiva.repository.metadata.MetadataTools + + + org.apache.maven.archiva.configuration.FileTypes + retention-count + + + org.apache.maven.archiva.indexer.RepositoryContentIndexFactory + lucene + indexFactory + + + + repository-purge + Purge repository of old snapshots + + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + retention-count + org.apache.maven.archiva.configuration.DefaultArchivaConfiguration + + + org.codehaus.plexus.registry.Registry + retention-count + + + org.apache.maven.archiva.policies.PreDownloadPolicy + prePolicies + + + org.apache.maven.archiva.policies.PostDownloadPolicy + postPolicies + + + + + org.apache.maven.archiva.repository.RepositoryContentFactory + retention-count + org.apache.maven.archiva.repository.RepositoryContentFactory + RepositoryContentRequest + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + retention-count + archivaConfiguration + + + + + org.codehaus.plexus.registry.Registry + retention-count + org.codehaus.plexus.registry.commons.CommonsConfigurationRegistry + + + + + + + + org.apache.maven.archiva.configuration.FileTypes + retention-count + org.apache.maven.archiva.configuration.FileTypes + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + retention-count + + + + + + + + org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer + repo-purge-consumer-by-days-old + org.apache.maven.archiva.consumers.core.repository.RepositoryPurgeConsumer + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + days-old + + + org.apache.maven.archiva.database.ArchivaDAO + jdo + + + org.apache.maven.archiva.repository.RepositoryContentFactory + days-old + + + org.apache.maven.archiva.repository.metadata.MetadataTools + + + org.apache.maven.archiva.configuration.FileTypes + days-old + + + org.apache.maven.archiva.indexer.RepositoryContentIndexFactory + lucene + indexFactory + + + + repository-purge + Purge repository of old snapshots + + + + org.apache.maven.archiva.repository.RepositoryContentFactory + days-old + org.apache.maven.archiva.repository.RepositoryContentFactory + RepositoryContentRequest + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + days-old + archivaConfiguration + + + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + days-old + org.apache.maven.archiva.configuration.DefaultArchivaConfiguration + + + org.codehaus.plexus.registry.Registry + days-old + + + org.apache.maven.archiva.policies.PreDownloadPolicy + prePolicies + + + org.apache.maven.archiva.policies.PostDownloadPolicy + postPolicies + + + + + org.codehaus.plexus.registry.Registry + days-old + org.codehaus.plexus.registry.commons.CommonsConfigurationRegistry + + + + + + + + org.apache.maven.archiva.configuration.FileTypes + days-old + org.apache.maven.archiva.configuration.FileTypes + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + days-old + + + + + + + + org.apache.maven.archiva.database.ArchivaDAO + jdo + org.apache.maven.archiva.database.jdo.JdoArchivaDAO + + + org.apache.maven.archiva.database.jdo.JdoAccess + archiva + + + org.apache.maven.archiva.database.ArtifactDAO + jdo + + + org.apache.maven.archiva.database.ProjectModelDAO + jdo + + + org.apache.maven.archiva.database.RepositoryProblemDAO + jdo + + + + + org.apache.maven.archiva.database.ArtifactDAO + jdo + org.apache.maven.archiva.database.jdo.JdoArtifactDAO + + + org.apache.maven.archiva.database.jdo.JdoAccess + archiva + + + + + org.apache.maven.archiva.database.ProjectModelDAO + jdo + org.apache.maven.archiva.database.jdo.JdoProjectModelDAO + + + org.apache.maven.archiva.database.jdo.JdoAccess + archiva + + + + + org.apache.maven.archiva.database.RepositoryProblemDAO + jdo + org.apache.maven.archiva.database.jdo.JdoRepositoryProblemDAO + + + org.apache.maven.archiva.database.jdo.JdoAccess + archiva + + + + + + + + org.apache.maven.archiva.database.jdo.JdoAccess + archiva + org.apache.maven.archiva.database.jdo.JdoAccess + + + org.codehaus.plexus.jdo.JdoFactory + archiva + + + + + + + org.codehaus.plexus.jdo.JdoFactory + archiva + org.codehaus.plexus.jdo.DefaultConfigurableJdoFactory + + org.jpox.PersistenceManagerFactoryImpl + org.hsqldb.jdbcDriver + sa + + jdbc:hsqldb:mem:testdb + + + javax.jdo.PersistenceManagerFactoryClass + org.jpox.PersistenceManagerFactoryImpl + + + + + + + + org.apache.maven.archiva.indexer.RepositoryContentIndexFactory + lucene + org.apache.maven.archiva.consumers.core.repository.stubs.LuceneRepositoryContentIndexFactoryStub + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/org/apache/maven/archiva/consumers/core/repository/RetentionCountRepositoryPurgeTest.xml b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/org/apache/maven/archiva/consumers/core/repository/RetentionCountRepositoryPurgeTest.xml new file mode 100644 index 000000000..86639b525 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/org/apache/maven/archiva/consumers/core/repository/RetentionCountRepositoryPurgeTest.xml @@ -0,0 +1,58 @@ + + + + + + + + + org.apache.maven.archiva.database.jdo.JdoAccess + archiva + org.apache.maven.archiva.database.jdo.JdoAccess + + + org.codehaus.plexus.jdo.JdoFactory + archiva + + + + + + + org.codehaus.plexus.jdo.JdoFactory + archiva + org.codehaus.plexus.jdo.DefaultConfigurableJdoFactory + + org.jpox.PersistenceManagerFactoryImpl + org.hsqldb.jdbcDriver + sa + + jdbc:hsqldb:mem:testdb + + + javax.jdo.PersistenceManagerFactoryClass + org.jpox.PersistenceManagerFactoryImpl + + + + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/releases-test-repo-one/org/apache/archiva/released-artifact-in-diff-repo/1.0/released-artifact-in-diff-repo-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/releases-test-repo-one/org/apache/archiva/released-artifact-in-diff-repo/1.0/released-artifact-in-diff-repo-1.0.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/releases-test-repo-one/org/apache/archiva/released-artifact-in-diff-repo/1.0/released-artifact-in-diff-repo-1.0.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/releases-test-repo-one/org/apache/archiva/released-artifact-in-diff-repo/1.0/released-artifact-in-diff-repo-1.0.jar.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/releases-test-repo-one/org/apache/archiva/released-artifact-in-diff-repo/1.0/released-artifact-in-diff-repo-1.0.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/releases-test-repo-one/org/apache/archiva/released-artifact-in-diff-repo/1.0/released-artifact-in-diff-repo-1.0.jar.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/releases-test-repo-one/org/apache/archiva/released-artifact-in-diff-repo/1.0/released-artifact-in-diff-repo-1.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/releases-test-repo-one/org/apache/archiva/released-artifact-in-diff-repo/1.0/released-artifact-in-diff-repo-1.0.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/releases-test-repo-one/org/apache/archiva/released-artifact-in-diff-repo/1.0/released-artifact-in-diff-repo-1.0.pom.md5 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/releases-test-repo-one/org/apache/archiva/released-artifact-in-diff-repo/1.0/released-artifact-in-diff-repo-1.0.pom.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/releases-test-repo-one/org/apache/archiva/released-artifact-in-diff-repo/1.0/released-artifact-in-diff-repo-1.0.pom.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/releases-test-repo-one/org/apache/archiva/released-artifact-in-diff-repo/1.0/released-artifact-in-diff-repo-1.0.pom.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/archiva/released-artifact-in-diff-repo/1.0-SNAPSHOT/released-artifact-in-diff-repo-1.0-SNAPSHOT.jar b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/archiva/released-artifact-in-diff-repo/1.0-SNAPSHOT/released-artifact-in-diff-repo-1.0-SNAPSHOT.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/archiva/released-artifact-in-diff-repo/1.0-SNAPSHOT/released-artifact-in-diff-repo-1.0-SNAPSHOT.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/archiva/released-artifact-in-diff-repo/1.0-SNAPSHOT/released-artifact-in-diff-repo-1.0-SNAPSHOT.jar.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/archiva/released-artifact-in-diff-repo/1.0-SNAPSHOT/released-artifact-in-diff-repo-1.0-SNAPSHOT.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/archiva/released-artifact-in-diff-repo/1.0-SNAPSHOT/released-artifact-in-diff-repo-1.0-SNAPSHOT.jar.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/archiva/released-artifact-in-diff-repo/1.0-SNAPSHOT/released-artifact-in-diff-repo-1.0-SNAPSHOT.pom b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/archiva/released-artifact-in-diff-repo/1.0-SNAPSHOT/released-artifact-in-diff-repo-1.0-SNAPSHOT.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/archiva/released-artifact-in-diff-repo/1.0-SNAPSHOT/released-artifact-in-diff-repo-1.0-SNAPSHOT.pom.md5 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/archiva/released-artifact-in-diff-repo/1.0-SNAPSHOT/released-artifact-in-diff-repo-1.0-SNAPSHOT.pom.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/archiva/released-artifact-in-diff-repo/1.0-SNAPSHOT/released-artifact-in-diff-repo-1.0-SNAPSHOT.pom.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/archiva/released-artifact-in-diff-repo/1.0-SNAPSHOT/released-artifact-in-diff-repo-1.0-SNAPSHOT.pom.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-assembly-plugin/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070427.065136-1.jar b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-assembly-plugin/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070427.065136-1.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-assembly-plugin/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070427.065136-1.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-assembly-plugin/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070427.065136-1.jar.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-assembly-plugin/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070427.065136-1.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-assembly-plugin/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070427.065136-1.jar.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-assembly-plugin/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070427.065136-1.pom b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-assembly-plugin/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070427.065136-1.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-assembly-plugin/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070427.065136-1.pom.md5 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-assembly-plugin/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070427.065136-1.pom.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-assembly-plugin/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070427.065136-1.pom.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-assembly-plugin/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070427.065136-1.pom.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-assembly-plugin/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070506.163513-2.jar b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-assembly-plugin/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070506.163513-2.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-assembly-plugin/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070506.163513-2.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-assembly-plugin/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070506.163513-2.jar.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-assembly-plugin/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070506.163513-2.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-assembly-plugin/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070506.163513-2.jar.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-assembly-plugin/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070506.163513-2.pom b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-assembly-plugin/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070506.163513-2.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-assembly-plugin/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070506.163513-2.pom.md5 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-assembly-plugin/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070506.163513-2.pom.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-assembly-plugin/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070506.163513-2.pom.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-assembly-plugin/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070506.163513-2.pom.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-assembly-plugin/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070615.105019-3.jar b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-assembly-plugin/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070615.105019-3.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-assembly-plugin/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070615.105019-3.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-assembly-plugin/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070615.105019-3.jar.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-assembly-plugin/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070615.105019-3.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-assembly-plugin/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070615.105019-3.jar.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-assembly-plugin/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070615.105019-3.pom b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-assembly-plugin/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070615.105019-3.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-assembly-plugin/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070615.105019-3.pom.md5 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-assembly-plugin/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070615.105019-3.pom.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-assembly-plugin/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070615.105019-3.pom.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-assembly-plugin/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070615.105019-3.pom.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-20061118.060401-2.jar b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-20061118.060401-2.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-20061118.060401-2.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-20061118.060401-2.jar.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-20061118.060401-2.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-20061118.060401-2.jar.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-20061118.060401-2.pom b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-20061118.060401-2.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-20061118.060401-2.pom.md5 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-20061118.060401-2.pom.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-20061118.060401-2.pom.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-20061118.060401-2.pom.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-20070513.034619-5.jar b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-20070513.034619-5.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-20070513.034619-5.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-20070513.034619-5.jar.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-20070513.034619-5.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-20070513.034619-5.jar.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-20070513.034619-5.pom b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-20070513.034619-5.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-20070513.034619-5.pom.md5 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-20070513.034619-5.pom.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-20070513.034619-5.pom.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-20070513.034619-5.pom.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-SNAPSHOT.jar b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-SNAPSHOT.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-SNAPSHOT.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-SNAPSHOT.jar.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-SNAPSHOT.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-SNAPSHOT.jar.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-SNAPSHOT.pom b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-SNAPSHOT.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-SNAPSHOT.pom.md5 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-SNAPSHOT.pom.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-SNAPSHOT.pom.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-SNAPSHOT.pom.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-metadata.xml new file mode 100644 index 000000000..d13b14540 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-metadata.xml @@ -0,0 +1,9 @@ + + org.apache.maven.plugins + maven-install-plugin + 2.2-SNAPSHOT + + + 20070509114036 + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-plugin-plugin/2.2/maven-plugin-plugin-2.2.jar b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-plugin-plugin/2.2/maven-plugin-plugin-2.2.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-plugin-plugin/2.2/maven-plugin-plugin-2.2.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-plugin-plugin/2.2/maven-plugin-plugin-2.2.jar.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-plugin-plugin/2.2/maven-plugin-plugin-2.2.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-plugin-plugin/2.2/maven-plugin-plugin-2.2.jar.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-plugin-plugin/2.2/maven-plugin-plugin-2.2.pom b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-plugin-plugin/2.2/maven-plugin-plugin-2.2.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-plugin-plugin/2.2/maven-plugin-plugin-2.2.pom.md5 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-plugin-plugin/2.2/maven-plugin-plugin-2.2.pom.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-plugin-plugin/2.2/maven-plugin-plugin-2.2.pom.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-plugin-plugin/2.2/maven-plugin-plugin-2.2.pom.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-plugin-plugin/2.3-SNAPSHOT/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-plugin-plugin/2.3-SNAPSHOT/maven-metadata.xml new file mode 100644 index 000000000..4beeafc41 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-plugin-plugin/2.3-SNAPSHOT/maven-metadata.xml @@ -0,0 +1,11 @@ + + org.apache.maven.plugins + maven-plugin-plugin + 2.3-SNAPSHOT + + + true + + 20070315032817 + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-plugin-plugin/2.3-SNAPSHOT/maven-plugin-plugin-2.3-SNAPSHOT.jar b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-plugin-plugin/2.3-SNAPSHOT/maven-plugin-plugin-2.3-SNAPSHOT.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-plugin-plugin/2.3-SNAPSHOT/maven-plugin-plugin-2.3-SNAPSHOT.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-plugin-plugin/2.3-SNAPSHOT/maven-plugin-plugin-2.3-SNAPSHOT.jar.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-plugin-plugin/2.3-SNAPSHOT/maven-plugin-plugin-2.3-SNAPSHOT.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-plugin-plugin/2.3-SNAPSHOT/maven-plugin-plugin-2.3-SNAPSHOT.jar.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-plugin-plugin/2.3-SNAPSHOT/maven-plugin-plugin-2.3-SNAPSHOT.pom b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-plugin-plugin/2.3-SNAPSHOT/maven-plugin-plugin-2.3-SNAPSHOT.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-plugin-plugin/2.3-SNAPSHOT/maven-plugin-plugin-2.3-SNAPSHOT.pom.md5 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-plugin-plugin/2.3-SNAPSHOT/maven-plugin-plugin-2.3-SNAPSHOT.pom.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-plugin-plugin/2.3-SNAPSHOT/maven-plugin-plugin-2.3-SNAPSHOT.pom.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-plugin-plugin/2.3-SNAPSHOT/maven-plugin-plugin-2.3-SNAPSHOT.pom.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-plugin-plugin/2.3/maven-plugin-plugin-2.3-sources.jar b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-plugin-plugin/2.3/maven-plugin-plugin-2.3-sources.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-plugin-plugin/2.3/maven-plugin-plugin-2.3-sources.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-plugin-plugin/2.3/maven-plugin-plugin-2.3-sources.jar.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-plugin-plugin/2.3/maven-plugin-plugin-2.3-sources.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-plugin-plugin/2.3/maven-plugin-plugin-2.3-sources.jar.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-plugin-plugin/2.3/maven-plugin-plugin-2.3.jar b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-plugin-plugin/2.3/maven-plugin-plugin-2.3.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-plugin-plugin/2.3/maven-plugin-plugin-2.3.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-plugin-plugin/2.3/maven-plugin-plugin-2.3.jar.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-plugin-plugin/2.3/maven-plugin-plugin-2.3.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-plugin-plugin/2.3/maven-plugin-plugin-2.3.jar.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-plugin-plugin/2.3/maven-plugin-plugin-2.3.pom b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-plugin-plugin/2.3/maven-plugin-plugin-2.3.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-plugin-plugin/2.3/maven-plugin-plugin-2.3.pom.md5 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-plugin-plugin/2.3/maven-plugin-plugin-2.3.pom.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-plugin-plugin/2.3/maven-plugin-plugin-2.3.pom.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-plugin-plugin/2.3/maven-plugin-plugin-2.3.pom.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-plugin-plugin/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-plugin-plugin/maven-metadata.xml new file mode 100644 index 000000000..43865f33f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-plugin-plugin/maven-metadata.xml @@ -0,0 +1,13 @@ + + + org.apache.maven.plugins + maven-plugin-plugin + 2.3-SNAPSHOT + + 2.3-SNAPSHOT + + 2.3-SNAPSHOT + + 20070315032817 + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-source-plugin/2.0.2/maven-source-plugin-2.0.2-sources.jar b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-source-plugin/2.0.2/maven-source-plugin-2.0.2-sources.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-source-plugin/2.0.2/maven-source-plugin-2.0.2-sources.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-source-plugin/2.0.2/maven-source-plugin-2.0.2-sources.jar.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-source-plugin/2.0.2/maven-source-plugin-2.0.2-sources.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-source-plugin/2.0.2/maven-source-plugin-2.0.2-sources.jar.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-source-plugin/2.0.2/maven-source-plugin-2.0.2.jar b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-source-plugin/2.0.2/maven-source-plugin-2.0.2.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-source-plugin/2.0.2/maven-source-plugin-2.0.2.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-source-plugin/2.0.2/maven-source-plugin-2.0.2.jar.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-source-plugin/2.0.2/maven-source-plugin-2.0.2.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-source-plugin/2.0.2/maven-source-plugin-2.0.2.jar.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-source-plugin/2.0.2/maven-source-plugin-2.0.2.pom b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-source-plugin/2.0.2/maven-source-plugin-2.0.2.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-source-plugin/2.0.2/maven-source-plugin-2.0.2.pom.md5 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-source-plugin/2.0.2/maven-source-plugin-2.0.2.pom.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-source-plugin/2.0.2/maven-source-plugin-2.0.2.pom.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-source-plugin/2.0.2/maven-source-plugin-2.0.2.pom.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-source-plugin/2.0.3-SNAPSHOT/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-source-plugin/2.0.3-SNAPSHOT/maven-metadata.xml new file mode 100644 index 000000000..8d2da6664 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-source-plugin/2.0.3-SNAPSHOT/maven-metadata.xml @@ -0,0 +1,11 @@ + + org.apache.maven.plugins + maven-source-plugin + 2.0.3-SNAPSHOT + + + true + + 20070403120932 + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-source-plugin/2.0.3-SNAPSHOT/maven-source-plugin-2.0.3-SNAPSHOT.jar b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-source-plugin/2.0.3-SNAPSHOT/maven-source-plugin-2.0.3-SNAPSHOT.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-source-plugin/2.0.3-SNAPSHOT/maven-source-plugin-2.0.3-SNAPSHOT.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-source-plugin/2.0.3-SNAPSHOT/maven-source-plugin-2.0.3-SNAPSHOT.jar.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-source-plugin/2.0.3-SNAPSHOT/maven-source-plugin-2.0.3-SNAPSHOT.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-source-plugin/2.0.3-SNAPSHOT/maven-source-plugin-2.0.3-SNAPSHOT.jar.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-source-plugin/2.0.3-SNAPSHOT/maven-source-plugin-2.0.3-SNAPSHOT.pom b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-source-plugin/2.0.3-SNAPSHOT/maven-source-plugin-2.0.3-SNAPSHOT.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-source-plugin/2.0.3-SNAPSHOT/maven-source-plugin-2.0.3-SNAPSHOT.pom.md5 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-source-plugin/2.0.3-SNAPSHOT/maven-source-plugin-2.0.3-SNAPSHOT.pom.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-source-plugin/2.0.3-SNAPSHOT/maven-source-plugin-2.0.3-SNAPSHOT.pom.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-source-plugin/2.0.3-SNAPSHOT/maven-source-plugin-2.0.3-SNAPSHOT.pom.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-source-plugin/2.0.4-SNAPSHOT/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-source-plugin/2.0.4-SNAPSHOT/maven-metadata.xml new file mode 100644 index 000000000..390c0c1da --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-source-plugin/2.0.4-SNAPSHOT/maven-metadata.xml @@ -0,0 +1,11 @@ + + org.apache.maven.plugins + maven-source-plugin + 2.0.4-SNAPSHOT + + + true + + 20070427033345 + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-source-plugin/2.0.4-SNAPSHOT/maven-source-plugin-2.0.4-SNAPSHOT.jar b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-source-plugin/2.0.4-SNAPSHOT/maven-source-plugin-2.0.4-SNAPSHOT.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-source-plugin/2.0.4-SNAPSHOT/maven-source-plugin-2.0.4-SNAPSHOT.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-source-plugin/2.0.4-SNAPSHOT/maven-source-plugin-2.0.4-SNAPSHOT.jar.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-source-plugin/2.0.4-SNAPSHOT/maven-source-plugin-2.0.4-SNAPSHOT.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-source-plugin/2.0.4-SNAPSHOT/maven-source-plugin-2.0.4-SNAPSHOT.jar.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-source-plugin/2.0.4-SNAPSHOT/maven-source-plugin-2.0.4-SNAPSHOT.pom b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-source-plugin/2.0.4-SNAPSHOT/maven-source-plugin-2.0.4-SNAPSHOT.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-source-plugin/2.0.4-SNAPSHOT/maven-source-plugin-2.0.4-SNAPSHOT.pom.md5 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-source-plugin/2.0.4-SNAPSHOT/maven-source-plugin-2.0.4-SNAPSHOT.pom.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-source-plugin/2.0.4-SNAPSHOT/maven-source-plugin-2.0.4-SNAPSHOT.pom.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-source-plugin/2.0.4-SNAPSHOT/maven-source-plugin-2.0.4-SNAPSHOT.pom.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-source-plugin/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-source-plugin/maven-metadata.xml new file mode 100644 index 000000000..2e9429f60 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/apache/maven/plugins/maven-source-plugin/maven-metadata.xml @@ -0,0 +1,13 @@ + + org.apache.maven.plugins + maven-source-plugin + 2.0.3-SNAPSHOT + + 2.0.4-SNAPSHOT + + 2.0.3-SNAPSHOT + 2.0.4-SNAPSHOT + + 20070427033345 + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/castor/castor-anttasks/1.1.2-SNAPSHOT/castor-anttasks-1.1.2-20070427.065136-1.jar b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/castor/castor-anttasks/1.1.2-SNAPSHOT/castor-anttasks-1.1.2-20070427.065136-1.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/castor/castor-anttasks/1.1.2-SNAPSHOT/castor-anttasks-1.1.2-20070427.065136-1.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/castor/castor-anttasks/1.1.2-SNAPSHOT/castor-anttasks-1.1.2-20070427.065136-1.jar.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/castor/castor-anttasks/1.1.2-SNAPSHOT/castor-anttasks-1.1.2-20070427.065136-1.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/castor/castor-anttasks/1.1.2-SNAPSHOT/castor-anttasks-1.1.2-20070427.065136-1.jar.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/castor/castor-anttasks/1.1.2-SNAPSHOT/castor-anttasks-1.1.2-20070427.065136-1.pom b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/castor/castor-anttasks/1.1.2-SNAPSHOT/castor-anttasks-1.1.2-20070427.065136-1.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/castor/castor-anttasks/1.1.2-SNAPSHOT/castor-anttasks-1.1.2-20070427.065136-1.pom.md5 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/castor/castor-anttasks/1.1.2-SNAPSHOT/castor-anttasks-1.1.2-20070427.065136-1.pom.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/castor/castor-anttasks/1.1.2-SNAPSHOT/castor-anttasks-1.1.2-20070427.065136-1.pom.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/castor/castor-anttasks/1.1.2-SNAPSHOT/castor-anttasks-1.1.2-20070427.065136-1.pom.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/castor/castor-anttasks/1.1.2-SNAPSHOT/castor-anttasks-1.1.2-20070506.163513-2-sources.jar b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/castor/castor-anttasks/1.1.2-SNAPSHOT/castor-anttasks-1.1.2-20070506.163513-2-sources.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/castor/castor-anttasks/1.1.2-SNAPSHOT/castor-anttasks-1.1.2-20070506.163513-2-sources.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/castor/castor-anttasks/1.1.2-SNAPSHOT/castor-anttasks-1.1.2-20070506.163513-2-sources.jar.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/castor/castor-anttasks/1.1.2-SNAPSHOT/castor-anttasks-1.1.2-20070506.163513-2-sources.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/castor/castor-anttasks/1.1.2-SNAPSHOT/castor-anttasks-1.1.2-20070506.163513-2-sources.jar.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/castor/castor-anttasks/1.1.2-SNAPSHOT/castor-anttasks-1.1.2-20070506.163513-2.jar b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/castor/castor-anttasks/1.1.2-SNAPSHOT/castor-anttasks-1.1.2-20070506.163513-2.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/castor/castor-anttasks/1.1.2-SNAPSHOT/castor-anttasks-1.1.2-20070506.163513-2.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/castor/castor-anttasks/1.1.2-SNAPSHOT/castor-anttasks-1.1.2-20070506.163513-2.jar.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/castor/castor-anttasks/1.1.2-SNAPSHOT/castor-anttasks-1.1.2-20070506.163513-2.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/castor/castor-anttasks/1.1.2-SNAPSHOT/castor-anttasks-1.1.2-20070506.163513-2.jar.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/castor/castor-anttasks/1.1.2-SNAPSHOT/castor-anttasks-1.1.2-20070506.163513-2.pom b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/castor/castor-anttasks/1.1.2-SNAPSHOT/castor-anttasks-1.1.2-20070506.163513-2.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/castor/castor-anttasks/1.1.2-SNAPSHOT/castor-anttasks-1.1.2-20070506.163513-2.pom.md5 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/castor/castor-anttasks/1.1.2-SNAPSHOT/castor-anttasks-1.1.2-20070506.163513-2.pom.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/castor/castor-anttasks/1.1.2-SNAPSHOT/castor-anttasks-1.1.2-20070506.163513-2.pom.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/castor/castor-anttasks/1.1.2-SNAPSHOT/castor-anttasks-1.1.2-20070506.163513-2.pom.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/castor/castor-anttasks/1.1.2-SNAPSHOT/castor-anttasks-1.1.2-20070615.105019-3-sources.jar b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/castor/castor-anttasks/1.1.2-SNAPSHOT/castor-anttasks-1.1.2-20070615.105019-3-sources.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/castor/castor-anttasks/1.1.2-SNAPSHOT/castor-anttasks-1.1.2-20070615.105019-3-sources.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/castor/castor-anttasks/1.1.2-SNAPSHOT/castor-anttasks-1.1.2-20070615.105019-3-sources.jar.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/castor/castor-anttasks/1.1.2-SNAPSHOT/castor-anttasks-1.1.2-20070615.105019-3-sources.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/castor/castor-anttasks/1.1.2-SNAPSHOT/castor-anttasks-1.1.2-20070615.105019-3-sources.jar.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/castor/castor-anttasks/1.1.2-SNAPSHOT/castor-anttasks-1.1.2-20070615.105019-3.jar b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/castor/castor-anttasks/1.1.2-SNAPSHOT/castor-anttasks-1.1.2-20070615.105019-3.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/castor/castor-anttasks/1.1.2-SNAPSHOT/castor-anttasks-1.1.2-20070615.105019-3.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/castor/castor-anttasks/1.1.2-SNAPSHOT/castor-anttasks-1.1.2-20070615.105019-3.jar.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/castor/castor-anttasks/1.1.2-SNAPSHOT/castor-anttasks-1.1.2-20070615.105019-3.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/castor/castor-anttasks/1.1.2-SNAPSHOT/castor-anttasks-1.1.2-20070615.105019-3.jar.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/castor/castor-anttasks/1.1.2-SNAPSHOT/castor-anttasks-1.1.2-20070615.105019-3.pom b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/castor/castor-anttasks/1.1.2-SNAPSHOT/castor-anttasks-1.1.2-20070615.105019-3.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/castor/castor-anttasks/1.1.2-SNAPSHOT/castor-anttasks-1.1.2-20070615.105019-3.pom.md5 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/castor/castor-anttasks/1.1.2-SNAPSHOT/castor-anttasks-1.1.2-20070615.105019-3.pom.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/castor/castor-anttasks/1.1.2-SNAPSHOT/castor-anttasks-1.1.2-20070615.105019-3.pom.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/castor/castor-anttasks/1.1.2-SNAPSHOT/castor-anttasks-1.1.2-20070615.105019-3.pom.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/plexus/plexus-utils/1.4.3-SNAPSHOT/maven-metadata-codehaus-snapshots.xml b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/plexus/plexus-utils/1.4.3-SNAPSHOT/maven-metadata-codehaus-snapshots.xml new file mode 100644 index 000000000..10e90ce2c --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/plexus/plexus-utils/1.4.3-SNAPSHOT/maven-metadata-codehaus-snapshots.xml @@ -0,0 +1,12 @@ + + org.codehaus.plexus + plexus-utils + 1.4.3-SNAPSHOT + + + 20070707.122114 + 7 + + 20070707122118 + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/plexus/plexus-utils/1.4.3-SNAPSHOT/maven-metadata-codehaus-snapshots.xml.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/plexus/plexus-utils/1.4.3-SNAPSHOT/maven-metadata-codehaus-snapshots.xml.sha1 new file mode 100644 index 000000000..be15aa0f0 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/plexus/plexus-utils/1.4.3-SNAPSHOT/maven-metadata-codehaus-snapshots.xml.sha1 @@ -0,0 +1 @@ +9bf3732f0d4f32363e3331630def1832ab991007 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/plexus/plexus-utils/1.4.3-SNAPSHOT/plexus-utils-1.4.3-20070113.163208-4.jar b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/plexus/plexus-utils/1.4.3-SNAPSHOT/plexus-utils-1.4.3-20070113.163208-4.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/plexus/plexus-utils/1.4.3-SNAPSHOT/plexus-utils-1.4.3-20070113.163208-4.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/plexus/plexus-utils/1.4.3-SNAPSHOT/plexus-utils-1.4.3-20070113.163208-4.jar.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/plexus/plexus-utils/1.4.3-SNAPSHOT/plexus-utils-1.4.3-20070113.163208-4.pom b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/plexus/plexus-utils/1.4.3-SNAPSHOT/plexus-utils-1.4.3-20070113.163208-4.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/plexus/plexus-utils/1.4.3-SNAPSHOT/plexus-utils-1.4.3-20070113.163208-4.pom.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/plexus/plexus-utils/1.4.3-SNAPSHOT/plexus-utils-1.4.3-20070113.163208-4.pom.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/plexus/plexus-utils/1.4.3-SNAPSHOT/plexus-utils-1.4.3-SNAPSHOT.jar b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/plexus/plexus-utils/1.4.3-SNAPSHOT/plexus-utils-1.4.3-SNAPSHOT.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/plexus/plexus-utils/1.4.3-SNAPSHOT/plexus-utils-1.4.3-SNAPSHOT.pom b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/codehaus/plexus/plexus-utils/1.4.3-SNAPSHOT/plexus-utils-1.4.3-SNAPSHOT.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/jruby-rake-plugin-1.0RC1-20070504.153317-1.jar b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/jruby-rake-plugin-1.0RC1-20070504.153317-1.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/jruby-rake-plugin-1.0RC1-20070504.153317-1.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/jruby-rake-plugin-1.0RC1-20070504.153317-1.jar.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/jruby-rake-plugin-1.0RC1-20070504.153317-1.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/jruby-rake-plugin-1.0RC1-20070504.153317-1.jar.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/jruby-rake-plugin-1.0RC1-20070504.153317-1.pom b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/jruby-rake-plugin-1.0RC1-20070504.153317-1.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/jruby-rake-plugin-1.0RC1-20070504.153317-1.pom.md5 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/jruby-rake-plugin-1.0RC1-20070504.153317-1.pom.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/jruby-rake-plugin-1.0RC1-20070504.153317-1.pom.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/jruby-rake-plugin-1.0RC1-20070504.153317-1.pom.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/jruby-rake-plugin-1.0RC1-20070504.160758-2.jar b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/jruby-rake-plugin-1.0RC1-20070504.160758-2.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/jruby-rake-plugin-1.0RC1-20070504.160758-2.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/jruby-rake-plugin-1.0RC1-20070504.160758-2.jar.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/jruby-rake-plugin-1.0RC1-20070504.160758-2.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/jruby-rake-plugin-1.0RC1-20070504.160758-2.jar.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/jruby-rake-plugin-1.0RC1-20070504.160758-2.pom b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/jruby-rake-plugin-1.0RC1-20070504.160758-2.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/jruby-rake-plugin-1.0RC1-20070504.160758-2.pom.md5 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/jruby-rake-plugin-1.0RC1-20070504.160758-2.pom.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/jruby-rake-plugin-1.0RC1-20070504.160758-2.pom.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/jruby-rake-plugin-1.0RC1-20070504.160758-2.pom.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/jruby-rake-plugin-1.0RC1-20070505.090015-3.jar b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/jruby-rake-plugin-1.0RC1-20070505.090015-3.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/jruby-rake-plugin-1.0RC1-20070505.090015-3.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/jruby-rake-plugin-1.0RC1-20070505.090015-3.jar.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/jruby-rake-plugin-1.0RC1-20070505.090015-3.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/jruby-rake-plugin-1.0RC1-20070505.090015-3.jar.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/jruby-rake-plugin-1.0RC1-20070505.090015-3.pom b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/jruby-rake-plugin-1.0RC1-20070505.090015-3.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/jruby-rake-plugin-1.0RC1-20070505.090015-3.pom.md5 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/jruby-rake-plugin-1.0RC1-20070505.090015-3.pom.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/jruby-rake-plugin-1.0RC1-20070505.090015-3.pom.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/jruby-rake-plugin-1.0RC1-20070505.090015-3.pom.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/jruby-rake-plugin-1.0RC1-20070506.090132-4.jar b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/jruby-rake-plugin-1.0RC1-20070506.090132-4.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/jruby-rake-plugin-1.0RC1-20070506.090132-4.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/jruby-rake-plugin-1.0RC1-20070506.090132-4.jar.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/jruby-rake-plugin-1.0RC1-20070506.090132-4.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/jruby-rake-plugin-1.0RC1-20070506.090132-4.jar.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/jruby-rake-plugin-1.0RC1-20070506.090132-4.pom b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/jruby-rake-plugin-1.0RC1-20070506.090132-4.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/jruby-rake-plugin-1.0RC1-20070506.090132-4.pom.md5 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/jruby-rake-plugin-1.0RC1-20070506.090132-4.pom.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/jruby-rake-plugin-1.0RC1-20070506.090132-4.pom.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/jruby-rake-plugin-1.0RC1-20070506.090132-4.pom.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/maven-metadata.xml new file mode 100644 index 000000000..bc60af10a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/maven-metadata.xml @@ -0,0 +1,12 @@ + + org.jruby.plugins + jruby-rake-plugin + 1.0RC1-SNAPSHOT + + + 20070506.090132 + 4 + + 20070506092020 + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/maven-metadata.xml.md5 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/maven-metadata.xml.md5 new file mode 100644 index 000000000..57b0720bf --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/maven-metadata.xml.md5 @@ -0,0 +1 @@ +a21a4e14a264bc7e528d4d662b282c87 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/maven-metadata.xml.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/maven-metadata.xml.sha1 new file mode 100644 index 000000000..0562cf4cb --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/maven-metadata.xml.sha1 @@ -0,0 +1 @@ +377229810ed2580399cd339d5bb622f649dd4998 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/pom.xml b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/pom.xml new file mode 100644 index 000000000..798ee845a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/pom.xml @@ -0,0 +1,67 @@ + + + + + 4.0.0 + + org.apache.archiva + archiva-consumers + 1.2-SNAPSHOT + ../pom.xml + + + archiva-database-consumers + Archiva Consumers :: Database Consumers + jar + + + + org.apache.archiva + archiva-database + + + org.apache.archiva + archiva-artifact-reports + + + org.apache.archiva + archiva-configuration + + + org.apache.archiva + archiva-consumer-api + + + org.apache.archiva + archiva-repository-layer + + + org.codehaus.plexus + plexus-spring + test + + + org.codehaus.plexus + plexus-digest + + + hsqldb + hsqldb + test + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/main/java/org/apache/maven/archiva/consumers/database/ArtifactUpdateDatabaseConsumer.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/main/java/org/apache/maven/archiva/consumers/database/ArtifactUpdateDatabaseConsumer.java new file mode 100644 index 000000000..af1dd6a3c --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/main/java/org/apache/maven/archiva/consumers/database/ArtifactUpdateDatabaseConsumer.java @@ -0,0 +1,275 @@ +package org.apache.maven.archiva.consumers.database; + +/* + * 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.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.ConfigurationNames; +import org.apache.maven.archiva.configuration.FileTypes; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer; +import org.apache.maven.archiva.consumers.ConsumerException; +import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer; +import org.apache.maven.archiva.database.ArchivaDAO; +import org.apache.maven.archiva.database.ArchivaDatabaseException; +import org.apache.maven.archiva.model.ArchivaArtifact; +import org.apache.maven.archiva.model.ArtifactReference; +import org.apache.maven.archiva.repository.ManagedRepositoryContent; +import org.apache.maven.archiva.repository.RepositoryContentFactory; +import org.apache.maven.archiva.repository.RepositoryException; +import org.apache.maven.archiva.repository.layout.LayoutException; +import org.codehaus.plexus.digest.Digester; +import org.codehaus.plexus.digest.DigesterException; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException; +import org.codehaus.plexus.registry.Registry; +import org.codehaus.plexus.registry.RegistryListener; + +import java.io.File; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * ArtifactUpdateDatabaseConsumer - Take an artifact off of disk and put it into the repository. + * + * @author Joakim Erdfelt + * @version $Id$ + * @plexus.component role="org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer" + * role-hint="update-db-artifact" + * instantiation-strategy="per-lookup" + */ +public class ArtifactUpdateDatabaseConsumer + extends AbstractMonitoredConsumer + implements KnownRepositoryContentConsumer, RegistryListener, Initializable +{ + private static final String TYPE_NOT_ARTIFACT = "file-not-artifact"; + + private static final String DB_ERROR = "db-error"; + + private static final String CHECKSUM_CALCULATION = "checksum-calc"; + + /** + * @plexus.configuration default-value="update-db-artifact" + */ + private String id; + + /** + * @plexus.configuration default-value="Update the Artifact in the Database" + */ + private String description; + + /** + * @plexus.requirement role-hint="jdo" + */ + private ArchivaDAO dao; + + /** + * @plexus.requirement + */ + private ArchivaConfiguration configuration; + + /** + * @plexus.requirement + */ + private FileTypes filetypes; + + /** + * @plexus.requirement + */ + private RepositoryContentFactory repositoryFactory; + + /** + * @plexus.requirement role-hint="sha1" + */ + private Digester digestSha1; + + /** + * @plexus.requirement role-hint="md5"; + */ + private Digester digestMd5; + + private ManagedRepositoryContent repository; + + private File repositoryDir; + + private List includes = new ArrayList(); + + private Date whenGathered; + + public String getId() + { + return this.id; + } + + public String getDescription() + { + return this.description; + } + + public boolean isPermanent() + { + return true; + } + + public List getExcludes() + { + return getDefaultArtifactExclusions(); + } + + public List getIncludes() + { + return this.includes; + } + + public void beginScan( ManagedRepositoryConfiguration repo, Date whenGathered ) + throws ConsumerException + { + try + { + this.repository = repositoryFactory.getManagedRepositoryContent( repo.getId() ); + this.repositoryDir = new File( repository.getRepoRoot() ); + this.whenGathered = whenGathered; + } + catch(RepositoryException e) + { + throw new ConsumerException( "Unable to start ArtifactUpdateDatabaseConsumer: " + e.getMessage(), e ); + } + } + + public void processFile( String path ) + throws ConsumerException + { + ArchivaArtifact artifact = getLiveArtifact( path ); + + if ( artifact == null ) + { + return; + } + + try + { + artifact.getModel().setRepositoryId( this.repository.getId() ); + + // Calculate the hashcodes. + File artifactFile = new File( this.repositoryDir, path ); + try + { + artifact.getModel().setChecksumMD5( digestMd5.calc( artifactFile ) ); + } + catch ( DigesterException e ) + { + triggerConsumerWarning( CHECKSUM_CALCULATION, + "Unable to calculate the MD5 checksum: " + e.getMessage() ); + } + + try + { + artifact.getModel().setChecksumSHA1( digestSha1.calc( artifactFile ) ); + } + catch ( DigesterException e ) + { + triggerConsumerWarning( CHECKSUM_CALCULATION, + "Unable to calculate the SHA1 checksum: " + e.getMessage() ); + } + + artifact.getModel().setLastModified( new Date( artifactFile.lastModified() ) ); + artifact.getModel().setSize( artifactFile.length() ); + artifact.getModel().setOrigin( "FileSystem" ); + artifact.getModel().setWhenProcessed( null ); + + // set this to when the artifact was first discovered in the repo + if ( artifact.getModel().getWhenGathered() == null ) + { + artifact.getModel().setWhenGathered( whenGathered ); + } + + dao.getArtifactDAO().saveArtifact( artifact ); + } + catch ( ArchivaDatabaseException e ) + { + triggerConsumerError( DB_ERROR, "Unable to save artifact to database: " + e.getMessage() ); + } + } + + /** + * Get a Live Artifact from a Path. + *

+ * Will resolve the artifact details from the path, and then return a database live version + * of that artifact. Suitable for modification and saving (without the need to check for + * existance in database prior to save.) + * + * @param path the path to work from. + * @return the artifact that is suitable for database saving. + */ + public ArchivaArtifact getLiveArtifact( String path ) + { + try + { + ArtifactReference artifact = repository.toArtifactReference( path ); + + ArchivaArtifact liveArtifact = dao.getArtifactDAO().createArtifact( artifact.getGroupId(), + artifact.getArtifactId(), + artifact.getVersion(), + artifact.getClassifier(), + artifact.getType() ); + + return liveArtifact; + } + catch ( LayoutException e ) + { + triggerConsumerError( TYPE_NOT_ARTIFACT, + "Path " + path + " cannot be converted to artifact: " + e.getMessage() ); + return null; + } + } + + public void completeScan() + { + /* do nothing */ + } + + public void afterConfigurationChange( Registry registry, String propertyName, Object propertyValue ) + { + if ( ConfigurationNames.isRepositoryScanning( propertyName ) ) + { + initIncludes(); + } + } + + public void beforeConfigurationChange( Registry registry, String propertyName, Object propertyValue ) + { + /* do nothing */ + } + + private void initIncludes() + { + includes.clear(); + + includes.addAll( filetypes.getFileTypePatterns( FileTypes.ARTIFACTS ) ); + } + + public void initialize() + throws InitializationException + { + configuration.addChangeListener( this ); + + initIncludes(); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/main/java/org/apache/maven/archiva/consumers/database/BytecodeStatsToDatabaseConsumer.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/main/java/org/apache/maven/archiva/consumers/database/BytecodeStatsToDatabaseConsumer.java new file mode 100644 index 000000000..be46002f9 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/main/java/org/apache/maven/archiva/consumers/database/BytecodeStatsToDatabaseConsumer.java @@ -0,0 +1,93 @@ +package org.apache.maven.archiva.consumers.database; + +/* + * 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.archiva.consumers.AbstractMonitoredConsumer; +import org.apache.maven.archiva.consumers.ConsumerException; +import org.apache.maven.archiva.consumers.DatabaseUnprocessedArtifactConsumer; +import org.apache.maven.archiva.model.ArchivaArtifact; + +import java.util.List; + +/** + * BytecodeStatsToDatabaseConsumer + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component role="org.apache.maven.archiva.consumers.DatabaseUnprocessedArtifactConsumer" + * role-hint="update-db-bytecode-stats" + * instantiation-strategy="per-lookup" + */ +public class BytecodeStatsToDatabaseConsumer + extends AbstractMonitoredConsumer + implements DatabaseUnprocessedArtifactConsumer +{ + /** + * @plexus.configuration default-value="update-db-bytecode-stats" + */ + private String id; + + /** + * @plexus.configuration default-value="Update database with java bytecode stats." + */ + private String description; + + public void beginScan() + { + // TODO Auto-generated method stub + + } + + public void completeScan() + { + // TODO Auto-generated method stub + + } + + public List getIncludedTypes() + { + // TODO Auto-generated method stub + return null; + } + + public void processArchivaArtifact( ArchivaArtifact artifact ) + throws ConsumerException + { + // TODO Auto-generated method stub + + } + + public String getDescription() + { + return description; + } + + public String getId() + { + return id; + } + + public boolean isPermanent() + { + return false; + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/main/java/org/apache/maven/archiva/consumers/database/DatabaseCleanupRemoveArtifactConsumer.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/main/java/org/apache/maven/archiva/consumers/database/DatabaseCleanupRemoveArtifactConsumer.java new file mode 100644 index 000000000..5f7013b9e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/main/java/org/apache/maven/archiva/consumers/database/DatabaseCleanupRemoveArtifactConsumer.java @@ -0,0 +1,163 @@ +package org.apache.maven.archiva.consumers.database; + +/* + * 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.archiva.consumers.AbstractMonitoredConsumer; +import org.apache.maven.archiva.consumers.ConsumerException; +import org.apache.maven.archiva.consumers.DatabaseCleanupConsumer; +import org.apache.maven.archiva.database.Constraint; +import org.apache.maven.archiva.database.RepositoryProblemDAO; +import org.apache.maven.archiva.database.constraints.RepositoryProblemByArtifactConstraint; +import org.apache.maven.archiva.model.ArchivaArtifact; +import org.apache.maven.archiva.database.ArtifactDAO; +import org.apache.maven.archiva.database.ArchivaDatabaseException; +import org.apache.maven.archiva.model.RepositoryProblem; +import org.apache.maven.archiva.repository.ManagedRepositoryContent; +import org.apache.maven.archiva.repository.RepositoryContentFactory; +import org.apache.maven.archiva.repository.RepositoryException; + +import java.util.List; +import java.io.File; + +/** + * Consumer for cleaning up the database of artifacts that are no longer existing in the repository. + * + * @author Joakim Erdfelt + * Maria Odea Ching + * @version $Id$ + * + * @plexus.component role="org.apache.maven.archiva.consumers.DatabaseCleanupConsumer" + * role-hint="not-present-remove-db-artifact" + * instantiation-strategy="per-lookup" + */ +public class DatabaseCleanupRemoveArtifactConsumer + extends AbstractMonitoredConsumer + implements DatabaseCleanupConsumer +{ + /** + * @plexus.configuration default-value="not-present-remove-db-artifact" + */ + private String id; + + /** + * @plexus.configuration default-value="Remove artifact from database if not present on filesystem." + */ + private String description; + + /** + * @plexus.requirement role-hint="jdo" + */ + private ArtifactDAO artifactDAO; + + /** + * @plexus.requirement role-hint="jdo" + */ + private RepositoryProblemDAO repositoryProblemDAO; + + /** + * @plexus.requirement + */ + private RepositoryContentFactory repositoryFactory; + + public void beginScan() + { + // TODO Auto-generated method stub + + } + + public void completeScan() + { + // TODO Auto-generated method stub + } + + public List getIncludedTypes() + { + return null; + } + + public void processArchivaArtifact( ArchivaArtifact artifact ) + throws ConsumerException + { + try + { + ManagedRepositoryContent repositoryContent = + repositoryFactory.getManagedRepositoryContent( artifact.getModel().getRepositoryId() ); + + File file = new File( repositoryContent.getRepoRoot(), repositoryContent.toPath( artifact ) ); + + if( !file.exists() ) + { + artifactDAO.deleteArtifact( artifact ); + + // Remove all repository problems related to this artifact + Constraint artifactConstraint = new RepositoryProblemByArtifactConstraint( artifact ); + List repositoryProblems = + repositoryProblemDAO.queryRepositoryProblems( artifactConstraint ); + + if ( repositoryProblems != null ) + { + for ( RepositoryProblem repositoryProblem : repositoryProblems ) + { + repositoryProblemDAO.deleteRepositoryProblem( repositoryProblem ); + } + } + } + } + catch ( RepositoryException re ) + { + throw new ConsumerException( "Can't run database cleanup remove artifact consumer: " + + re.getMessage() ); + } + catch ( ArchivaDatabaseException e ) + { + throw new ConsumerException( e.getMessage() ); + } + } + + public String getDescription() + { + return description; + } + + public String getId() + { + return id; + } + + public boolean isPermanent() + { + return false; + } + + public void setArtifactDAO( ArtifactDAO artifactDAO) + { + this.artifactDAO = artifactDAO; + } + + public void setRepositoryProblemDAO( RepositoryProblemDAO repositoryProblemDAO ) + { + this.repositoryProblemDAO = repositoryProblemDAO; + } + + public void setRepositoryFactory( RepositoryContentFactory repositoryFactory ) + { + this.repositoryFactory = repositoryFactory; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/main/java/org/apache/maven/archiva/consumers/database/DatabaseCleanupRemoveProjectConsumer.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/main/java/org/apache/maven/archiva/consumers/database/DatabaseCleanupRemoveProjectConsumer.java new file mode 100644 index 000000000..dceb1a81d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/main/java/org/apache/maven/archiva/consumers/database/DatabaseCleanupRemoveProjectConsumer.java @@ -0,0 +1,180 @@ +package org.apache.maven.archiva.consumers.database; + +/* + * 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.maven.archiva.consumers.AbstractMonitoredConsumer; +import org.apache.maven.archiva.consumers.ConsumerException; +import org.apache.maven.archiva.consumers.DatabaseCleanupConsumer; +import org.apache.maven.archiva.model.ArchivaArtifact; +import org.apache.maven.archiva.model.ArchivaProjectModel; +import org.apache.maven.archiva.repository.ManagedRepositoryContent; +import org.apache.maven.archiva.repository.RepositoryContentFactory; +import org.apache.maven.archiva.repository.RepositoryException; +import org.apache.maven.archiva.database.ProjectModelDAO; +import org.apache.maven.archiva.database.ArchivaDatabaseException; +import org.codehaus.plexus.cache.Cache; + +import java.util.List; +import java.io.File; + +/** + * Consumer for removing or deleting from the database the project models fo artifacts that have been + * deleted/removed from the repository. + * + * @author Joakim Erdfelt + * Maria Odea Ching + * @version $Id$ + * + * @plexus.component role="org.apache.maven.archiva.consumers.DatabaseCleanupConsumer" + * role-hint="not-present-remove-db-project" + * instantiation-strategy="per-lookup" + */ +public class DatabaseCleanupRemoveProjectConsumer + extends AbstractMonitoredConsumer + implements DatabaseCleanupConsumer +{ + /** + * @plexus.configuration default-value="not-present-remove-db-project" + */ + private String id; + + /** + * @plexus.configuration default-value="Remove project from database if not present on filesystem." + */ + private String description; + + /** + * @plexus.requirement role-hint="jdo" + */ + private ProjectModelDAO projectModelDAO; + + /** + * @plexus.requirement + */ + private RepositoryContentFactory repositoryFactory; + + /** + * @plexus.requirement role-hint="effective-project-cache" + */ + private Cache effectiveProjectCache; + + public void beginScan() + { + // TODO Auto-generated method stub + } + + public void completeScan() + { + // TODO Auto-generated method stub + } + + public List getIncludedTypes() + { + return null; + } + + public void processArchivaArtifact( ArchivaArtifact artifact ) + throws ConsumerException + { + if ( !StringUtils.equals( "pom", artifact.getType() ) ) + { + // Not a pom. Skip it. + return; + } + + try + { + ManagedRepositoryContent repositoryContent = + repositoryFactory.getManagedRepositoryContent( artifact.getModel().getRepositoryId() ); + + File file = new File( repositoryContent.getRepoRoot(), repositoryContent.toPath( artifact ) ); + + if ( !file.exists() ) + { + ArchivaProjectModel projectModel = + projectModelDAO.getProjectModel( artifact.getGroupId(), artifact.getArtifactId(), + artifact.getVersion() ); + + projectModelDAO.deleteProjectModel( projectModel ); + + // Force removal of project model from effective cache + String projectKey = toProjectKey( projectModel ); + synchronized ( effectiveProjectCache ) + { + if ( effectiveProjectCache.hasKey( projectKey ) ) + { + effectiveProjectCache.remove( projectKey ); + } + } + } + } + catch ( RepositoryException re ) + { + throw new ConsumerException( "Can't run database cleanup remove artifact consumer: " + re.getMessage() ); + } + catch ( ArchivaDatabaseException e ) + { + throw new ConsumerException( e.getMessage() ); + } + + } + + public String getDescription() + { + return description; + } + + public String getId() + { + return id; + } + + public boolean isPermanent() + { + return false; + } + + public void setProjectModelDAO( ProjectModelDAO projectModelDAO ) + { + this.projectModelDAO = projectModelDAO; + } + + public void setRepositoryFactory( RepositoryContentFactory repositoryFactory ) + { + this.repositoryFactory = repositoryFactory; + } + + public void setEffectiveProjectCache( Cache effectiveProjectCache ) + { + this.effectiveProjectCache = effectiveProjectCache; + } + + private String toProjectKey( ArchivaProjectModel project ) + { + StringBuilder key = new StringBuilder(); + + key.append( project.getGroupId() ).append( ":" ); + key.append( project.getArtifactId() ).append( ":" ); + key.append( project.getVersion() ); + + return key.toString(); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/main/java/org/apache/maven/archiva/consumers/database/ProjectModelToDatabaseConsumer.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/main/java/org/apache/maven/archiva/consumers/database/ProjectModelToDatabaseConsumer.java new file mode 100644 index 000000000..58e1dd9cc --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/main/java/org/apache/maven/archiva/consumers/database/ProjectModelToDatabaseConsumer.java @@ -0,0 +1,360 @@ +package org.apache.maven.archiva.consumers.database; + +/* + * 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; +import java.util.ArrayList; +import java.util.List; + +import org.apache.commons.lang.StringUtils; +import org.apache.maven.archiva.common.utils.VersionUtil; +import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer; +import org.apache.maven.archiva.consumers.ConsumerException; +import org.apache.maven.archiva.consumers.DatabaseUnprocessedArtifactConsumer; +import org.apache.maven.archiva.database.ArchivaDAO; +import org.apache.maven.archiva.database.ArchivaDatabaseException; +import org.apache.maven.archiva.database.ObjectNotFoundException; +import org.apache.maven.archiva.model.ArchivaArtifact; +import org.apache.maven.archiva.model.ArchivaProjectModel; +import org.apache.maven.archiva.model.Keys; +import org.apache.maven.archiva.model.RepositoryProblem; +import org.apache.maven.archiva.reporting.artifact.CorruptArtifactReport; +import org.apache.maven.archiva.repository.ManagedRepositoryContent; +import org.apache.maven.archiva.repository.RepositoryContentFactory; +import org.apache.maven.archiva.repository.RepositoryException; +import org.apache.maven.archiva.repository.content.ManagedLegacyRepositoryContent; +import org.apache.maven.archiva.repository.project.ProjectModelException; +import org.apache.maven.archiva.repository.project.ProjectModelFilter; +import org.apache.maven.archiva.repository.project.ProjectModelReader; +import org.apache.maven.archiva.repository.project.filters.EffectiveProjectModelFilter; +import org.apache.maven.archiva.repository.project.readers.ProjectModel300Reader; +import org.apache.maven.archiva.repository.project.readers.ProjectModel400Reader; +import org.codehaus.plexus.cache.Cache; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * ProjectModelToDatabaseConsumer + * + * @author Joakim Erdfelt + * @version $Id$ + * @plexus.component role="org.apache.maven.archiva.consumers.DatabaseUnprocessedArtifactConsumer" + * role-hint="update-db-project" + * instantiation-strategy="per-lookup" + */ +public class ProjectModelToDatabaseConsumer + extends AbstractMonitoredConsumer + implements DatabaseUnprocessedArtifactConsumer +{ + private Logger log = LoggerFactory.getLogger( ProjectModelToDatabaseConsumer.class ); + + /** + * @plexus.configuration default-value="update-db-project" + */ + private String id; + + /** + * @plexus.configuration default-value="Update database with project model information." + */ + private String description; + + /** + * @plexus.requirement role-hint="jdo" + */ + private ArchivaDAO dao; + + /** + * @plexus.requirement + */ + private RepositoryContentFactory repositoryFactory; + + /** + * @plexus.requirement role-hint="expression" + */ + private ProjectModelFilter expressionModelFilter; + + /** + * @plexus.requirement role="org.apache.maven.archiva.repository.project.ProjectModelFilter" + * role-hint="effective" + */ + private EffectiveProjectModelFilter effectiveModelFilter; + + private List includes; + + /** + * @plexus.requirement role-hint="effective-project-cache" + */ + private Cache effectiveProjectCache; + + public ProjectModelToDatabaseConsumer() + { + includes = new ArrayList(); + includes.add( "pom" ); + } + + public void beginScan() + { + /* nothing to do here */ + } + + public void completeScan() + { + /* nothing to do here */ + } + + public List getIncludedTypes() + { + return includes; + } + + public void processArchivaArtifact( ArchivaArtifact artifact ) + throws ConsumerException + { + if ( !StringUtils.equals( "pom", artifact.getType() ) ) + { + // Not a pom. Skip it. + return; + } + + ArchivaProjectModel model = null; + + // remove old project model if it already exists in the database + if ( ( model = + getProjectModelFromDatabase( artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion() ) ) != null ) + { + removeOldProjectModel( model ); + model = null; + } + + ManagedRepositoryContent repo = getRepository( artifact ); + File artifactFile = repo.toFile( artifact ); + + ProjectModelReader reader; + if ( repo instanceof ManagedLegacyRepositoryContent ) + { + reader = new ProjectModel300Reader(); + } + else + { + reader = new ProjectModel400Reader(); + } + + try + { + model = reader.read( artifactFile ); + + model.setOrigin( "filesystem" ); + + // The version should be updated to the artifact/filename version if it is a unique snapshot + if ( VersionUtil.isUniqueSnapshot( artifact.getVersion() ) ) + { + model.setVersion( artifact.getVersion() ); + } + + // Filter the model + model = expressionModelFilter.filter( model ); + + // Resolve the project model + model = effectiveModelFilter.filter( model ); + + if ( isValidModel( model, repo, artifact ) ) + { + log.debug( "Adding project model to database - " + Keys.toKey( model ) ); + dao.getProjectModelDAO().saveProjectModel( model ); + } + else + { + log.warn( "Invalid or corrupt pom. Project model not added to database - " + Keys.toKey( model ) ); + } + + } + catch ( ProjectModelException e ) + { + log.warn( "Unable to read project model " + artifactFile + " : " + e.getMessage(), e ); + + addProblem( artifact, "Unable to read project model " + artifactFile + " : " + e.getMessage() ); + } + catch ( ArchivaDatabaseException e ) + { + log.warn( "Unable to save project model " + artifactFile + " to the database : " + e.getMessage(), e ); + } + catch ( Throwable t ) + { + // Catch the other errors in the process to allow the rest of the process to complete. + log.error( "Unable to process model " + artifactFile + " due to : " + t.getClass().getName() + " : " + + t.getMessage(), t ); + } + } + + private ArchivaProjectModel getProjectModelFromDatabase( String groupId, String artifactId, String version ) + { + try + { + ArchivaProjectModel model = dao.getProjectModelDAO().getProjectModel( groupId, artifactId, version ); + return model; + } + catch ( ObjectNotFoundException e ) + { + return null; + } + catch ( ArchivaDatabaseException e ) + { + return null; + } + } + + private ManagedRepositoryContent getRepository( ArchivaArtifact artifact ) + throws ConsumerException + { + String repoId = artifact.getModel().getRepositoryId(); + try + { + return repositoryFactory.getManagedRepositoryContent( repoId ); + } + catch ( RepositoryException e ) + { + throw new ConsumerException( "Unable to process project model: " + e.getMessage(), e ); + } + } + + public String getDescription() + { + return description; + } + + public String getId() + { + return id; + } + + public boolean isPermanent() + { + // Tells the configuration that this consumer cannot be disabled. + return true; + } + + private boolean isValidModel( ArchivaProjectModel model, ManagedRepositoryContent repo, ArchivaArtifact artifact ) + throws ConsumerException + { + File artifactFile = repo.toFile( artifact ); + + if ( !artifact.getArtifactId().equalsIgnoreCase( model.getArtifactId() ) ) + { + StringBuffer emsg = new StringBuffer(); + emsg.append( "File " ).append( artifactFile.getName() ); + emsg.append( " has an invalid project model [" ); + appendModel( emsg, model ); + emsg.append( "]: The model artifactId [" ).append( model.getArtifactId() ); + emsg.append( "] does not match the artifactId portion of the filename: " ).append( artifact.getArtifactId() ); + + log.warn( emsg.toString() ); + addProblem( artifact, emsg.toString() ); + + return false; + } + + if ( !artifact.getVersion().equalsIgnoreCase( model.getVersion() ) && + !VersionUtil.getBaseVersion( artifact.getVersion() ).equalsIgnoreCase( model.getVersion() ) ) + { + StringBuffer emsg = new StringBuffer(); + emsg.append( "File " ).append( artifactFile.getName() ); + emsg.append( " has an invalid project model [" ); + appendModel( emsg, model ); + emsg.append( "]; The model version [" ).append( model.getVersion() ); + emsg.append( "] does not match the version portion of the filename: " ).append( artifact.getVersion() ); + + log.warn( emsg.toString() ); + addProblem( artifact, emsg.toString() ); + + return false; + } + + return true; + } + + private void appendModel( StringBuffer buf, ArchivaProjectModel model ) + { + buf.append( "groupId:" ).append( model.getGroupId() ); + buf.append( "|artifactId:" ).append( model.getArtifactId() ); + buf.append( "|version:" ).append( model.getVersion() ); + buf.append( "|packaging:" ).append( model.getPackaging() ); + } + + private void addProblem( ArchivaArtifact artifact, String msg ) + throws ConsumerException + { + ManagedRepositoryContent repo = getRepository( artifact ); + + RepositoryProblem problem = new RepositoryProblem(); + problem.setRepositoryId( artifact.getModel().getRepositoryId() ); + problem.setPath( repo.toPath( artifact ) ); + problem.setGroupId( artifact.getGroupId() ); + problem.setArtifactId( artifact.getArtifactId() ); + problem.setVersion( artifact.getVersion() ); + problem.setType( CorruptArtifactReport.PROBLEM_TYPE_CORRUPT_ARTIFACT ); + problem.setOrigin( getId() ); + problem.setMessage( msg ); + + try + { + dao.getRepositoryProblemDAO().saveRepositoryProblem( problem ); + } + catch ( ArchivaDatabaseException e ) + { + String emsg = "Unable to save problem with artifact location to DB: " + e.getMessage(); + log.warn( emsg, e ); + throw new ConsumerException( emsg, e ); + } + } + + private String toProjectKey( ArchivaProjectModel project ) + { + StringBuilder key = new StringBuilder(); + + key.append( project.getGroupId() ).append( ":" ); + key.append( project.getArtifactId() ).append( ":" ); + key.append( project.getVersion() ); + + return key.toString(); + } + + private void removeOldProjectModel( ArchivaProjectModel model ) + { + try + { + dao.getProjectModelDAO().deleteProjectModel( model ); + } + catch ( ArchivaDatabaseException ae ) + { + log.error( "Unable to delete existing project model." ); + } + + // Force removal of project model from effective cache + String projectKey = toProjectKey( model ); + synchronized ( effectiveProjectCache ) + { + if ( effectiveProjectCache.hasKey( projectKey ) ) + { + effectiveProjectCache.remove( projectKey ); + } + } + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/main/java/org/apache/maven/archiva/consumers/database/VerifyMetadataAgainstDatabaseConsumer.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/main/java/org/apache/maven/archiva/consumers/database/VerifyMetadataAgainstDatabaseConsumer.java new file mode 100644 index 000000000..9b255540f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/main/java/org/apache/maven/archiva/consumers/database/VerifyMetadataAgainstDatabaseConsumer.java @@ -0,0 +1,93 @@ +package org.apache.maven.archiva.consumers.database; + +/* + * 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.archiva.consumers.AbstractMonitoredConsumer; +import org.apache.maven.archiva.consumers.ConsumerException; +import org.apache.maven.archiva.consumers.DatabaseUnprocessedArtifactConsumer; +import org.apache.maven.archiva.model.ArchivaArtifact; + +import java.util.List; + +/** + * VerifyMetadataAgainstDatabaseConsumer + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component role="org.apache.maven.archiva.consumers.DatabaseUnprocessedArtifactConsumer" + * role-hint="validate-repository-metadata" + * instantiation-strategy="per-lookup" + */ +public class VerifyMetadataAgainstDatabaseConsumer + extends AbstractMonitoredConsumer + implements DatabaseUnprocessedArtifactConsumer +{ + /** + * @plexus.configuration default-value="validate-repository-metadata" + */ + private String id; + + /** + * @plexus.configuration default-value="Verify repository metadata files against database." + */ + private String description; + + public void beginScan() + { + // TODO Auto-generated method stub + + } + + public void completeScan() + { + // TODO Auto-generated method stub + + } + + public List getIncludedTypes() + { + // TODO Auto-generated method stub + return null; + } + + public void processArchivaArtifact( ArchivaArtifact artifact ) + throws ConsumerException + { + // TODO Auto-generated method stub + + } + + public String getDescription() + { + return description; + } + + public String getId() + { + return id; + } + + public boolean isPermanent() + { + return false; + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/conf/repository-manager.xml b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/conf/repository-manager.xml new file mode 100644 index 000000000..e44390dd9 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/conf/repository-manager.xml @@ -0,0 +1,203 @@ + + + + + 1 + + + internal + Archiva Managed Internal Repository + file://${appserver.base}/repositories/internal + default + true + false + true + 0 0 * * * ? + + + snapshots + Archiva Managed Snapshot Repository + file://${appserver.base}/repositories/internal + default + false + true + true + 0 0,30 * * * ? + + + central + Central Repository + http://repo1.maven.org/maven2 + default + true + false + false + + + maven2-repository.dev.java.net + Java.net Repository for Maven 2 + https://maven2-repository.dev.java.net/nonav/repository + default + true + false + false + + + test-repo + Test Repository + file://${appserver.base}/repositories/test-repo + default + true + true + true + 0 0 * * * ? + 0 + 2 + + + + + + internal + central + + disabled + never + not-found + + + internal + maven2-repository.dev.java.net + + disabled + never + not-found + + javax/** + + + + + + + example + http + proxy.mycompany.com + 8080 + myself + mypass + + + + + + + artifacts + + **/*.pom + **/*.jar + **/*.ear + **/*.war + **/*.car + **/*.sar + **/*.mar + **/*.rar + **/*.dtd + **/*.tld + **/*.tar.gz + **/*.tar.bz2 + **/*.zip + + + + indexable-content + + **/*.txt + **/*.TXT + **/*.block + **/*.config + **/*.pom + **/*.xml + **/*.xsd + **/*.dtd + **/*.tld + + + + auto-remove + + **/*.bak + **/*~ + **/*- + + + + ignored + + **/.htaccess + **/KEYS + **/*.rb + **/*.sh + **/.svn/** + **/.DAV/** + + + + + update-db-artifact + create-missing-checksums + update-db-repository-metadata + validate-checksum + validate-signature + index-content + auto-remove + auto-rename + repository-purge + + + update-db-bad-content + + + + + 0 0 * * * ? + + index-artifact + update-db-project + validate-repository-metadata + index-archive-toc + update-db-bytecode-stats + index-public-methods + + + not-present-remove-db-artifact + not-present-remove-db-project + not-present-remove-indexed + + + + + + true + true + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/java/org/apache/maven/archiva/consumers/database/AbstractDatabaseCleanupTest.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/java/org/apache/maven/archiva/consumers/database/AbstractDatabaseCleanupTest.java new file mode 100644 index 000000000..51f9412bc --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/java/org/apache/maven/archiva/consumers/database/AbstractDatabaseCleanupTest.java @@ -0,0 +1,98 @@ +package org.apache.maven.archiva.consumers.database; + +/* + * 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.io.FileUtils; +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.ArchivaArtifact; +import org.apache.maven.archiva.model.ArchivaArtifactModel; +import org.apache.maven.archiva.model.ArchivaProjectModel; +import org.apache.maven.archiva.repository.RepositoryContentFactory; +import org.codehaus.plexus.spring.PlexusInSpringTestCase; + +import java.io.File; + +/** + * @author Maria Odea Ching + */ +public abstract class AbstractDatabaseCleanupTest + extends PlexusInSpringTestCase +{ + ArchivaConfiguration archivaConfig; + + RepositoryContentFactory repositoryFactory; + + public static final String TEST_GROUP_ID = "org.apache.maven.archiva"; + + public static final String TEST_ARTIFACT_ID = "cleanup-artifact-test"; + + public static final String TEST_VERSION = "1.0"; + + public static final String TEST_REPO_ID = "test-repo"; + + public void setUp() + throws Exception + { + super.setUp(); + + // archiva configuration (need to update the repository url) + File userFile = getTestFile( "target/test/repository-manager.xml" ); + userFile.delete(); + assertFalse( userFile.exists() ); + + userFile.getParentFile().mkdirs(); + FileUtils.copyFileToDirectory( getTestFile( "src/test/conf/repository-manager.xml" ), + userFile.getParentFile() ); + + archivaConfig = (ArchivaConfiguration) lookup( ArchivaConfiguration.class, "database-cleanup" ); + + Configuration configuration = archivaConfig.getConfiguration(); + ManagedRepositoryConfiguration repo = configuration.findManagedRepositoryById( TEST_REPO_ID ); + repo.setLocation( new File( getBasedir(), "src/test/resources/test-repo" ).toString() ); + + archivaConfig.save( configuration ); + + repositoryFactory = (RepositoryContentFactory) lookup( RepositoryContentFactory.class ); + } + + protected ArchivaArtifact createArtifact( String groupId, String artifactId, String version, String type ) + { + ArchivaArtifactModel model = new ArchivaArtifactModel(); + model.setGroupId( groupId ); + model.setArtifactId( artifactId ); + model.setVersion( version ); + model.setType( type ); + model.setRepositoryId( TEST_REPO_ID ); + + return new ArchivaArtifact( model ); + } + + protected ArchivaProjectModel createProjectModel( String groupId, String artifactId, String version ) + { + ArchivaProjectModel projectModel = new ArchivaProjectModel(); + projectModel.setGroupId( groupId ); + projectModel.setArtifactId( artifactId ); + projectModel.setVersion( version ); + + return projectModel; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/java/org/apache/maven/archiva/consumers/database/ArtifactUpdateDatabaseConsumerTest.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/java/org/apache/maven/archiva/consumers/database/ArtifactUpdateDatabaseConsumerTest.java new file mode 100644 index 000000000..19b07ac1e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/java/org/apache/maven/archiva/consumers/database/ArtifactUpdateDatabaseConsumerTest.java @@ -0,0 +1,79 @@ +package org.apache.maven.archiva.consumers.database; + +/* + * 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.archiva.common.utils.BaseFile; +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.consumers.KnownRepositoryContentConsumer; +import org.apache.maven.archiva.repository.scanner.functors.ConsumerWantsFilePredicate; +import org.codehaus.plexus.spring.PlexusInSpringTestCase; + +import java.io.File; + +public class ArtifactUpdateDatabaseConsumerTest + extends PlexusInSpringTestCase +{ + private File repoLocation; + + protected KnownRepositoryContentConsumer consumer; + + protected void setUp() + throws Exception + { + super.setUp(); + + ArchivaConfiguration archivaConfiguration = (ArchivaConfiguration) lookup( ArchivaConfiguration.ROLE ); + FileType fileType = + (FileType) archivaConfiguration.getConfiguration().getRepositoryScanning().getFileTypes().get( 0 ); + assertEquals( FileTypes.ARTIFACTS, fileType.getId() ); + fileType.addPattern( "**/*.xml" ); + + repoLocation = getTestFile( "target/test-" + getName() + "/test-repo" ); + + consumer = + (KnownRepositoryContentConsumer) lookup( KnownRepositoryContentConsumer.class, "update-db-artifact" ); + } + + public void testConsumption() + { + File localFile = + new File( repoLocation, "org/apache/maven/plugins/maven-plugin-plugin/2.4.1/maven-metadata.xml" ); + + ConsumerWantsFilePredicate predicate = new ConsumerWantsFilePredicate(); + BaseFile baseFile = new BaseFile( repoLocation, localFile ); + predicate.setBasefile( baseFile ); + + assertFalse( predicate.evaluate( consumer ) ); + } + + public void testConsumptionOfOtherMetadata() + { + File localFile = + new File( repoLocation, "org/apache/maven/plugins/maven-plugin-plugin/2.4.1/maven-metadata-central.xml" ); + + ConsumerWantsFilePredicate predicate = new ConsumerWantsFilePredicate(); + BaseFile baseFile = new BaseFile( repoLocation, localFile ); + predicate.setBasefile( baseFile ); + + assertFalse( predicate.evaluate( consumer ) ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/java/org/apache/maven/archiva/consumers/database/DatabaseCleanupRemoveArtifactConsumerTest.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/java/org/apache/maven/archiva/consumers/database/DatabaseCleanupRemoveArtifactConsumerTest.java new file mode 100644 index 000000000..3dda2ea61 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/java/org/apache/maven/archiva/consumers/database/DatabaseCleanupRemoveArtifactConsumerTest.java @@ -0,0 +1,97 @@ +package org.apache.maven.archiva.consumers.database; + +/* + * 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.easymock.MockControl; +import org.apache.maven.archiva.model.ArchivaArtifact; +import org.apache.maven.archiva.database.ArtifactDAO; +import org.apache.maven.archiva.database.RepositoryProblemDAO; + +/** + * Test for DatabaseCleanupRemoveArtifactConsumerTest + * + * @author Maria Odea Ching + */ +public class DatabaseCleanupRemoveArtifactConsumerTest + extends AbstractDatabaseCleanupTest +{ + private MockControl artifactDAOControl; + + private ArtifactDAO artifactDAOMock; + + private MockControl repositoryProblemDAOControl; + + private RepositoryProblemDAO repositoryProblemDAOMock; + + private DatabaseCleanupRemoveArtifactConsumer dbCleanupRemoveArtifactConsumer; + + public void setUp() + throws Exception + { + super.setUp(); + + dbCleanupRemoveArtifactConsumer = new DatabaseCleanupRemoveArtifactConsumer(); + + artifactDAOControl = MockControl.createControl( ArtifactDAO.class ); + + artifactDAOMock = (ArtifactDAO) artifactDAOControl.getMock(); + + repositoryProblemDAOControl = MockControl.createControl( RepositoryProblemDAO.class ); + + repositoryProblemDAOMock = (RepositoryProblemDAO) repositoryProblemDAOControl.getMock(); + + dbCleanupRemoveArtifactConsumer.setArtifactDAO( artifactDAOMock ); + + dbCleanupRemoveArtifactConsumer.setRepositoryProblemDAO( repositoryProblemDAOMock ); + + dbCleanupRemoveArtifactConsumer.setRepositoryFactory( repositoryFactory ); + } + + public void testIfArtifactWasNotDeleted() + throws Exception + { + ArchivaArtifact artifact = createArtifact( TEST_GROUP_ID, "do-not-cleanup-artifact-test", TEST_VERSION, "jar" ); + + artifactDAOControl.replay(); + + repositoryProblemDAOControl.replay(); + + dbCleanupRemoveArtifactConsumer.processArchivaArtifact( artifact ); + + artifactDAOControl.verify(); + + repositoryProblemDAOControl.verify(); + } + + public void testIfArtifactWasDeleted() + throws Exception + { + ArchivaArtifact artifact = createArtifact( TEST_GROUP_ID, TEST_ARTIFACT_ID, TEST_VERSION, "jar" ); + + artifactDAOMock.deleteArtifact( artifact ); + + artifactDAOControl.replay(); + + dbCleanupRemoveArtifactConsumer.processArchivaArtifact( artifact ); + + artifactDAOControl.verify(); + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/java/org/apache/maven/archiva/consumers/database/DatabaseCleanupRemoveProjectConsumerTest.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/java/org/apache/maven/archiva/consumers/database/DatabaseCleanupRemoveProjectConsumerTest.java new file mode 100644 index 000000000..8c5846224 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/java/org/apache/maven/archiva/consumers/database/DatabaseCleanupRemoveProjectConsumerTest.java @@ -0,0 +1,115 @@ +package org.apache.maven.archiva.consumers.database; + +/* + * 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.codehaus.plexus.cache.Cache; +import org.easymock.MockControl; +import org.apache.maven.archiva.database.ProjectModelDAO; +import org.apache.maven.archiva.model.ArchivaArtifact; +import org.apache.maven.archiva.model.ArchivaProjectModel; + +/** + * Test for DatabaseCleanupRemoveProjectConsumer + * + * @author Maria Odea Ching + */ +public class DatabaseCleanupRemoveProjectConsumerTest + extends AbstractDatabaseCleanupTest +{ + private MockControl projectModelDAOControl; + + private ProjectModelDAO projectModelDAOMock; + + private DatabaseCleanupRemoveProjectConsumer dbCleanupRemoveProjectConsumer; + + private Cache effectiveProjectCache; + + public void setUp() + throws Exception + { + super.setUp(); + + dbCleanupRemoveProjectConsumer = new DatabaseCleanupRemoveProjectConsumer(); + + projectModelDAOControl = MockControl.createControl( ProjectModelDAO.class ); + + projectModelDAOMock = (ProjectModelDAO) projectModelDAOControl.getMock(); + + effectiveProjectCache = (Cache) lookup( Cache.class, "effective-project-cache" ); + + dbCleanupRemoveProjectConsumer.setProjectModelDAO( projectModelDAOMock ); + + dbCleanupRemoveProjectConsumer.setRepositoryFactory( repositoryFactory ); + + dbCleanupRemoveProjectConsumer.setEffectiveProjectCache( effectiveProjectCache ); + } + + public void testIfArtifactWasNotDeleted() + throws Exception + { + ArchivaArtifact artifact = createArtifact( TEST_GROUP_ID, "do-not-cleanup-artifact-test", TEST_VERSION, "pom" ); + + projectModelDAOControl.replay(); + + dbCleanupRemoveProjectConsumer.processArchivaArtifact( artifact ); + + projectModelDAOControl.verify(); + } + + public void testIfArtifactWasDeleted() + throws Exception + { + ArchivaArtifact artifact = createArtifact( TEST_GROUP_ID, TEST_ARTIFACT_ID, TEST_VERSION, "pom" ); + + ArchivaProjectModel projectModel = createProjectModel( TEST_GROUP_ID, TEST_ARTIFACT_ID, TEST_VERSION ); + + //this should return a value + projectModelDAOControl.expectAndReturn( + projectModelDAOMock.getProjectModel( TEST_GROUP_ID, TEST_ARTIFACT_ID, TEST_VERSION ), + (ArchivaProjectModel) projectModel ); + + projectModelDAOMock.deleteProjectModel( projectModel ); + + projectModelDAOControl.replay(); + + dbCleanupRemoveProjectConsumer.processArchivaArtifact( artifact ); + + projectModelDAOControl.verify(); + } + + public void testIfArtifactWasNotAPom() + throws Exception + { + ArchivaArtifact artifact = createArtifact( TEST_GROUP_ID, "do-not-cleanup-artifact-test", TEST_VERSION, "jar" ); + + projectModelDAOControl.replay(); + + dbCleanupRemoveProjectConsumer.processArchivaArtifact( artifact ); + + projectModelDAOControl.verify(); + } + + public void tearDown() + throws Exception + { + super.tearDown(); + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/resources/org/apache/maven/archiva/consumers/database/ArtifactUpdateDatabaseConsumerTest.xml b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/resources/org/apache/maven/archiva/consumers/database/ArtifactUpdateDatabaseConsumerTest.xml new file mode 100644 index 000000000..801d957b8 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/resources/org/apache/maven/archiva/consumers/database/ArtifactUpdateDatabaseConsumerTest.xml @@ -0,0 +1,56 @@ + + + + + + + + org.apache.maven.archiva.database.jdo.JdoAccess + archiva + org.apache.maven.archiva.database.jdo.JdoAccess + + + org.codehaus.plexus.jdo.JdoFactory + archiva + + + + + + + org.codehaus.plexus.jdo.JdoFactory + archiva + org.codehaus.plexus.jdo.DefaultConfigurableJdoFactory + + org.jpox.PersistenceManagerFactoryImpl + org.hsqldb.jdbcDriver + sa + + jdbc:hsqldb:mem:testdb + + + javax.jdo.PersistenceManagerFactoryClass + org.jpox.PersistenceManagerFactoryImpl + + + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/resources/org/apache/maven/archiva/consumers/database/DatabaseCleanupRemoveArtifactConsumerTest.xml b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/resources/org/apache/maven/archiva/consumers/database/DatabaseCleanupRemoveArtifactConsumerTest.xml new file mode 100644 index 000000000..2c0dd53e1 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/resources/org/apache/maven/archiva/consumers/database/DatabaseCleanupRemoveArtifactConsumerTest.xml @@ -0,0 +1,65 @@ + + + + + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + database-cleanup + org.apache.maven.archiva.configuration.DefaultArchivaConfiguration + + + org.codehaus.plexus.registry.Registry + database-cleanup + + + org.apache.maven.archiva.policies.PreDownloadPolicy + prePolicies + + + org.apache.maven.archiva.policies.PostDownloadPolicy + postPolicies + + + + + org.codehaus.plexus.registry.Registry + database-cleanup + org.codehaus.plexus.registry.commons.CommonsConfigurationRegistry + + + + + + + + + org.apache.maven.archiva.repository.RepositoryContentFactory + org.apache.maven.archiva.repository.RepositoryContentFactory + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + database-cleanup + + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/resources/org/apache/maven/archiva/consumers/database/DatabaseCleanupRemoveProjectConsumerTest.xml b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/resources/org/apache/maven/archiva/consumers/database/DatabaseCleanupRemoveProjectConsumerTest.xml new file mode 100644 index 000000000..c34c60962 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/resources/org/apache/maven/archiva/consumers/database/DatabaseCleanupRemoveProjectConsumerTest.xml @@ -0,0 +1,87 @@ + + + + + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + database-cleanup + org.apache.maven.archiva.configuration.DefaultArchivaConfiguration + + + org.codehaus.plexus.registry.Registry + database-cleanup + + + org.apache.maven.archiva.policies.PreDownloadPolicy + prePolicies + + + org.apache.maven.archiva.policies.PostDownloadPolicy + postPolicies + + + + + org.codehaus.plexus.registry.Registry + database-cleanup + org.codehaus.plexus.registry.commons.CommonsConfigurationRegistry + + + + + + + + + org.apache.maven.archiva.repository.RepositoryContentFactory + org.apache.maven.archiva.repository.RepositoryContentFactory + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + database-cleanup + + + + + + + org.codehaus.plexus.cache.Cache + effective-project-cache + org.codehaus.plexus.cache.ehcache.EhcacheCache + Effective Project Cache + + 600 + true + ${java.io.tmpdir}/archiva/effectiveproject + true + 1000 + LRU + effective-project-cache + false + + + 2700 + + 1800 + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/resources/test-repo/org/apache/maven/archiva/do-not-cleanup-artifact-test/1.0/do-not-cleanup-artifact-test-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/resources/test-repo/org/apache/maven/archiva/do-not-cleanup-artifact-test/1.0/do-not-cleanup-artifact-test-1.0.jar new file mode 100644 index 000000000..4201a06cb Binary files /dev/null and b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/resources/test-repo/org/apache/maven/archiva/do-not-cleanup-artifact-test/1.0/do-not-cleanup-artifact-test-1.0.jar differ diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/resources/test-repo/org/apache/maven/archiva/do-not-cleanup-artifact-test/1.0/do-not-cleanup-artifact-test-1.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/resources/test-repo/org/apache/maven/archiva/do-not-cleanup-artifact-test/1.0/do-not-cleanup-artifact-test-1.0.pom new file mode 100644 index 000000000..94b5b2e98 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/resources/test-repo/org/apache/maven/archiva/do-not-cleanup-artifact-test/1.0/do-not-cleanup-artifact-test-1.0.pom @@ -0,0 +1,5 @@ + + org.apache.maven.archiva + do-not-cleanup-artifact-test + 1.0 + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/pom.xml b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/pom.xml new file mode 100644 index 000000000..c675a7c6a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/pom.xml @@ -0,0 +1,47 @@ + + 4.0.0 + + org.apache.archiva + archiva-consumers + 1.2-SNAPSHOT + + archiva-dependency-tree-consumer + Archiva Consumers :: Dependency Tree Consumer + + + org.apache.archiva + archiva-consumer-api + + + org.codehaus.plexus + plexus-spring + test + + + dom4j + dom4j + + + org.apache.maven.shared + maven-dependency-tree + 1.1 + + + org.codehaus.plexus + plexus-container-default + + + + + org.apache.maven.wagon + wagon-http-lightweight + ${wagon.version} + runtime + + + xmlunit + xmlunit + test + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/src/main/java/org/apache/archiva/consumers/dependencytree/DependencyTreeGeneratorConsumer.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/src/main/java/org/apache/archiva/consumers/dependencytree/DependencyTreeGeneratorConsumer.java new file mode 100644 index 000000000..b5aa3eb9d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/src/main/java/org/apache/archiva/consumers/dependencytree/DependencyTreeGeneratorConsumer.java @@ -0,0 +1,336 @@ +package org.apache.archiva.consumers.dependencytree; + +/* + * 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; +import java.io.FileWriter; +import java.io.IOException; +import java.lang.reflect.Field; +import java.net.MalformedURLException; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.List; + +import org.apache.commons.io.IOUtils; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer; +import org.apache.maven.archiva.consumers.ConsumerException; +import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer; +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.factory.ArtifactFactory; +import org.apache.maven.artifact.metadata.ArtifactMetadataSource; +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.artifact.repository.ArtifactRepositoryFactory; +import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout; +import org.apache.maven.artifact.resolver.ArtifactCollector; +import org.apache.maven.artifact.resolver.filter.ArtifactFilter; +import org.apache.maven.project.DefaultMavenProjectBuilder; +import org.apache.maven.project.MavenProject; +import org.apache.maven.project.MavenProjectBuilder; +import org.apache.maven.project.ProjectBuildingException; +import org.apache.maven.shared.dependency.tree.DependencyNode; +import org.apache.maven.shared.dependency.tree.DependencyTreeBuilder; +import org.apache.maven.shared.dependency.tree.DependencyTreeBuilderException; +import org.apache.maven.shared.dependency.tree.filter.AncestorOrSelfDependencyNodeFilter; +import org.apache.maven.shared.dependency.tree.filter.DependencyNodeFilter; +import org.apache.maven.shared.dependency.tree.filter.StateDependencyNodeFilter; +import org.apache.maven.shared.dependency.tree.traversal.BuildingDependencyNodeVisitor; +import org.apache.maven.shared.dependency.tree.traversal.CollectingDependencyNodeVisitor; +import org.apache.maven.shared.dependency.tree.traversal.DependencyNodeVisitor; +import org.apache.maven.shared.dependency.tree.traversal.FilteringDependencyNodeVisitor; +import org.dom4j.Document; +import org.dom4j.DocumentHelper; +import org.dom4j.Element; +import org.dom4j.io.OutputFormat; +import org.dom4j.io.XMLWriter; + +/** + * @plexus.component role="org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer" + * role-hint="dependency-tree-generator" instantiation-strategy="per-lookup" + */ +public class DependencyTreeGeneratorConsumer + extends AbstractMonitoredConsumer + implements KnownRepositoryContentConsumer +{ + /** @plexus.configuration */ + private File generatedRepositoryLocation; + + /** @plexus.configuration */ + private File localRepository; + + /** @plexus.requirement */ + private DependencyTreeBuilder dependencyTreeBuilder; + + /** @plexus.requirement */ + private ArtifactFactory artifactFactory; + + /** @plexus.requirement role-hint="maven" */ + private ArtifactMetadataSource artifactMetadataSource; + + /** @plexus.requirement */ + private ArtifactCollector artifactCollector; + + /** @plexus.requirement */ + private MavenProjectBuilder projectBuilder; + + /** @plexus.requirement */ + private ArtifactRepositoryFactory artifactRepositoryFactory; + + private String repositoryLocation; + + private final DefaultRepositoryLayout layout = new DefaultRepositoryLayout(); + + private ArtifactRepository localArtifactRepository; + + private Field rawProjectCacheField; + + private Field processedProjectCacheField; + + private List includes = Collections.singletonList( "**/*.pom" ); + + public String getDescription() + { + return "Generate dependency tree metadata for tracking changes across algorithms"; + } + + public String getId() + { + return "dependency-tree-generator"; + } + + public boolean isPermanent() + { + return false; + } + + public void setGeneratedRepositoryLocation( File generatedRepositoryLocation ) + { + this.generatedRepositoryLocation = generatedRepositoryLocation; + } + + public void beginScan( ManagedRepositoryConfiguration repository, Date whenGathered ) + throws ConsumerException + { + repositoryLocation = repository.getLocation(); + + if ( generatedRepositoryLocation == null ) + { + generatedRepositoryLocation = new File( repositoryLocation ); + } + + if ( localRepository == null ) + { + // This is a bit crappy, it would be better to operate entirely within + // the base repository, but would need to adjust maven-artifact + localRepository = new File( System.getProperty( "user.home" ), ".m2/repository" ); + try + { + localArtifactRepository = + artifactRepositoryFactory.createArtifactRepository( "local", + localRepository.toURL().toExternalForm(), + layout, null, null ); + } + catch ( MalformedURLException e ) + { + throw new ConsumerException( e.getMessage(), e ); + } + } + } + + public void completeScan() + { + } + + public List getExcludes() + { + return null; + } + + public List getIncludes() + { + return includes; + } + + public void processFile( String path ) + throws ConsumerException + { + MavenProject project; + try + { + project = projectBuilder.build( new File( repositoryLocation, path ), localArtifactRepository, null, false ); + + // manually flush out the cache for memory concerns and more accurate building + flushProjectCache( projectBuilder ); + } + catch ( ProjectBuildingException e ) + { + throw new ConsumerException( e.getMessage(), e ); + } + + DependencyNode rootNode; + try + { + // TODO: do this for different values of new ScopeArtifactFilter( scope ) + ArtifactFilter artifactFilter = null; + + rootNode = + dependencyTreeBuilder.buildDependencyTree( project, localArtifactRepository, artifactFactory, + artifactMetadataSource, artifactFilter, artifactCollector ); + } + catch ( DependencyTreeBuilderException e ) + { + throw new ConsumerException( e.getMessage(), e ); + } + + Document document = DocumentHelper.createDocument(); + DependencyNodeVisitor visitor = new XmlSerializingDependencyNodeVisitor( document ); + + // TODO: remove the need for this when the serializer can calculate last nodes from visitor calls only + visitor = new BuildingDependencyNodeVisitor( visitor ); + + CollectingDependencyNodeVisitor collectingVisitor = new CollectingDependencyNodeVisitor(); + DependencyNodeVisitor firstPassVisitor = + new FilteringDependencyNodeVisitor( collectingVisitor, StateDependencyNodeFilter.INCLUDED ); + rootNode.accept( firstPassVisitor ); + + DependencyNodeFilter secondPassFilter = new AncestorOrSelfDependencyNodeFilter( collectingVisitor.getNodes() ); + visitor = new FilteringDependencyNodeVisitor( visitor, secondPassFilter ); + + rootNode.accept( visitor ); + + FileWriter writer = null; + try + { + Artifact artifact = + artifactFactory.createProjectArtifact( project.getGroupId(), project.getArtifactId(), + project.getVersion() ); + + String p = layout.pathOf( artifact ); + if ( !p.equals( path ) ) + { + throw new ConsumerException( "Bad path: " + p + "; should be: " + path ); + } + + File generatedFile = new File( generatedRepositoryLocation, p + ".xml" ); + generatedFile.getParentFile().mkdirs(); + writer = new FileWriter( generatedFile ); + OutputFormat format = OutputFormat.createPrettyPrint(); + XMLWriter w = new XMLWriter( writer, format ); + w.write( document ); + } + catch ( IOException e ) + { + throw new ConsumerException( e.getMessage(), e ); + } + finally + { + IOUtils.closeQuietly( writer ); + } + } + + private void flushProjectCache( MavenProjectBuilder projectBuilder ) + { + try + { + if ( rawProjectCacheField == null ) + { + rawProjectCacheField = DefaultMavenProjectBuilder.class.getDeclaredField( "rawProjectCache" ); + rawProjectCacheField.setAccessible( true ); + } + + if ( processedProjectCacheField == null ) + { + processedProjectCacheField = + DefaultMavenProjectBuilder.class.getDeclaredField( "processedProjectCache" ); + processedProjectCacheField.setAccessible( true ); + } + + rawProjectCacheField.set( projectBuilder, new HashMap() ); + + processedProjectCacheField.set( projectBuilder, new HashMap() ); + } + catch ( Exception e ) + { + throw new RuntimeException( e ); + } + } + + private static class XmlSerializingDependencyNodeVisitor + implements DependencyNodeVisitor + { + private Element xmlNode; + + public XmlSerializingDependencyNodeVisitor( Document document ) + { + xmlNode = document.addElement( "tree" ); + } + + // DependencyNodeVisitor methods ------------------------------------------ + + /* + * @see org.apache.maven.shared.dependency.tree.traversal.DependencyNodeVisitor#visit(org.apache.maven.shared.dependency.tree.DependencyNode) + */ + public boolean visit( DependencyNode node ) + { + Element dependency = xmlNode.addElement( "dependency" ); + + Artifact artifact = node.getArtifact(); + dependency.addElement( "groupId" ).setText( artifact.getGroupId() ); + dependency.addElement( "artifactId" ).setText( artifact.getArtifactId() ); + dependency.addElement( "type" ).setText( artifact.getType() ); + dependency.addElement( "version" ).setText( artifact.getVersion() ); + if ( artifact.getScope() != null ) + { + dependency.addElement( "scope" ).setText( artifact.getScope() ); + } + if ( artifact.getClassifier() != null ) + { + dependency.addElement( "classifier" ).setText( artifact.getClassifier() ); + } + + xmlNode = dependency.addElement( "dependencies" ); + + return true; + } + + /* + * @see org.apache.maven.shared.dependency.tree.traversal.DependencyNodeVisitor#endVisit(org.apache.maven.shared.dependency.tree.DependencyNode) + */ + public boolean endVisit( DependencyNode node ) + { + Element e = xmlNode.getParent(); + + if ( !xmlNode.hasContent() ) + { + e.remove( xmlNode ); + } + + xmlNode = e.getParent(); + + return true; + } + } + + public void setIncludes( List includes ) + { + this.includes = includes; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/src/test/java/org/apache/archiva/consumers/dependencytree/DependencyTreeGeneratorConsumerTest.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/src/test/java/org/apache/archiva/consumers/dependencytree/DependencyTreeGeneratorConsumerTest.java new file mode 100644 index 000000000..07a9d7ab8 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/src/test/java/org/apache/archiva/consumers/dependencytree/DependencyTreeGeneratorConsumerTest.java @@ -0,0 +1,126 @@ +package org.apache.archiva.consumers.dependencytree; + +/* + * 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; +import java.io.IOException; + +import javax.xml.parsers.ParserConfigurationException; + +import org.apache.commons.io.FileUtils; +import org.apache.commons.io.IOUtils; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.consumers.ConsumerException; +import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer; +import org.apache.maven.profiles.DefaultProfileManager; +import org.codehaus.plexus.spring.PlexusContainerAdapter; +import org.codehaus.plexus.spring.PlexusInSpringTestCase; +import org.custommonkey.xmlunit.XMLAssert; +import org.xml.sax.SAXException; + +public class DependencyTreeGeneratorConsumerTest + extends PlexusInSpringTestCase +{ + private DependencyTreeGeneratorConsumer consumer; + + private ManagedRepositoryConfiguration repository; + + private File repositoryLocation; + + private File generatedRepositoryLocation; + + public void setUp() + throws Exception + { + super.setUp(); + + consumer = + (DependencyTreeGeneratorConsumer) lookup( KnownRepositoryContentConsumer.class, "dependency-tree-generator" ); + + repositoryLocation = getTestFile( "target/test-" + getName() + "/test-repo" ); + FileUtils.deleteDirectory( repositoryLocation ); + FileUtils.copyDirectory( getTestFile( "target/test-classes/test-repo" ), repositoryLocation ); + + generatedRepositoryLocation = getTestFile( "target/test-" + getName() + "/generated-test-repo" ); + FileUtils.deleteDirectory( generatedRepositoryLocation ); + + consumer.setGeneratedRepositoryLocation( generatedRepositoryLocation ); + + repository = new ManagedRepositoryConfiguration(); + repository.setId( "dependency-tree" ); + repository.setLocation( repositoryLocation.getAbsolutePath() ); + } + + public void testGenerateBasicTree() + throws IOException, ConsumerException, ParserConfigurationException, SAXException + { + consumer.beginScan( repository, null ); + + String path = "org/apache/maven/maven-core/2.0/maven-core-2.0.pom"; + consumer.processFile( path ); + + File generatedFile = new File( generatedRepositoryLocation, path + ".xml" ); + XMLAssert.assertXMLEqual( IOUtils.toString( getClass().getResourceAsStream( "/test-data/maven-core-2.0-tree.xml" ) ), + FileUtils.readFileToString( generatedFile ) ); + + consumer.completeScan(); + } + + public void testInvalidCoordinate() + throws IOException, ConsumerException + { + consumer.beginScan( repository, null ); + + String path = "openejb/jaxb-xjc/2.0EA3/jaxb-xjc-2.0EA3.pom"; + try + { + consumer.processFile( path ); + + fail( "Should not have successfully processed the file" ); + } + catch ( ConsumerException e ) + { + File generatedFile = new File( generatedRepositoryLocation, path + ".xml" ); + assertFalse( generatedFile.exists() ); + } + + consumer.completeScan(); + } + + public void testProfiles() + throws IOException, ConsumerException, ParserConfigurationException, SAXException + { + PlexusContainerAdapter container = new PlexusContainerAdapter(); + container.setApplicationContext( getApplicationContext() ); + + DefaultProfileManager m = new DefaultProfileManager( container ); + + consumer.beginScan( repository, null ); + + String path = "org/apache/maven/surefire/surefire-testng/2.0/surefire-testng-2.0.pom"; + consumer.processFile( path ); + + File generatedFile = new File( generatedRepositoryLocation, path + ".xml" ); + XMLAssert.assertXMLEqual( IOUtils.toString( getClass().getResourceAsStream( "/test-data/surefire-testng-2.0-tree.xml" ) ), + FileUtils.readFileToString( generatedFile ) ); + + consumer.completeScan(); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/src/test/resources/test-data/maven-core-2.0-tree.xml b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/src/test/resources/test-data/maven-core-2.0-tree.xml new file mode 100644 index 000000000..3c55b90d1 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/src/test/resources/test-data/maven-core-2.0-tree.xml @@ -0,0 +1,200 @@ + + + + + org.apache.maven + maven-core + jar + 2.0 + + + junit + junit + jar + 3.8.1 + test + + + org.apache.maven + maven-settings + jar + 2.0 + compile + + + org.apache.maven.wagon + wagon-file + jar + 1.0-alpha-5 + runtime + + + org.apache.maven + maven-plugin-parameter-documenter + jar + 2.0 + compile + + + org.apache.maven.wagon + wagon-http-lightweight + jar + 1.0-alpha-5 + runtime + + + org.apache.maven.reporting + maven-reporting-api + jar + 2.0 + compile + + + doxia + doxia-sink-api + jar + 1.0-alpha-4 + compile + + + + + org.apache.maven + maven-profile + jar + 2.0 + compile + + + org.apache.maven + maven-model + jar + 2.0 + compile + + + org.apache.maven + maven-artifact + jar + 2.0 + compile + + + org.apache.maven.wagon + wagon-provider-api + jar + 1.0-alpha-5 + compile + + + org.codehaus.plexus + plexus-container-default + jar + 1.0-alpha-8 + compile + + + classworlds + classworlds + jar + 1.1-alpha-2 + compile + + + + + org.apache.maven + maven-repository-metadata + jar + 2.0 + compile + + + org.apache.maven + maven-error-diagnostics + jar + 2.0 + compile + + + org.apache.maven + maven-project + jar + 2.0 + compile + + + org.apache.maven + maven-plugin-registry + jar + 2.0 + compile + + + commons-cli + commons-cli + jar + 1.0 + compile + + + org.apache.maven + maven-plugin-api + jar + 2.0 + compile + + + org.apache.maven + maven-plugin-descriptor + jar + 2.0 + compile + + + org.codehaus.plexus + plexus-interactivity-api + jar + 1.0-alpha-4 + compile + + + org.apache.maven + maven-artifact-manager + jar + 2.0 + compile + + + org.apache.maven + maven-monitor + jar + 2.0 + compile + + + org.apache.maven.wagon + wagon-ssh + jar + 1.0-alpha-5 + runtime + + + com.jcraft + jsch + jar + 0.1.23 + runtime + + + + + org.codehaus.plexus + plexus-utils + jar + 1.0.4 + compile + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/src/test/resources/test-data/surefire-testng-2.0-tree.xml b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/src/test/resources/test-data/surefire-testng-2.0-tree.xml new file mode 100644 index 000000000..287c45954 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/src/test/resources/test-data/surefire-testng-2.0-tree.xml @@ -0,0 +1,59 @@ + + + + + org.apache.maven.surefire + surefire-testng + jar + 2.0 + + + org.apache.maven.surefire + surefire-api + jar + 2.0 + compile + + + org.codehaus.plexus + plexus-utils + jar + 1.1 + compile + + + + + org.testng + testng + jar + 4.7 + compile + jdk15 + + + junit + junit + jar + 3.8.1 + runtime + + + qdox + qdox + jar + 1.5 + runtime + + + bsh + bsh + jar + 2.0b1 + runtime + + + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/src/test/resources/test-repo/openejb/jaxb-xjc/2.0EA3/jaxb-xjc-2.0EA3.pom b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/src/test/resources/test-repo/openejb/jaxb-xjc/2.0EA3/jaxb-xjc-2.0EA3.pom new file mode 100644 index 000000000..d56af580b --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/src/test/resources/test-repo/openejb/jaxb-xjc/2.0EA3/jaxb-xjc-2.0EA3.pom @@ -0,0 +1,6 @@ + + 4.0.0 + openejb + jaxb-api + 2.0EA3 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/src/test/resources/test-repo/org/apache/maven/maven-core/2.0/maven-core-2.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/src/test/resources/test-repo/org/apache/maven/maven-core/2.0/maven-core-2.0.pom new file mode 100644 index 000000000..a6e158dea --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/src/test/resources/test-repo/org/apache/maven/maven-core/2.0/maven-core-2.0.pom @@ -0,0 +1,186 @@ + + + maven + org.apache.maven + 2.0 + + 4.0.0 + org.apache.maven + maven-core + Maven + 2.0 + + + + maven-assembly-plugin + 2.0-beta-1 + + src/assemble/bin.xml + maven-${version} + + + + + + + org.apache.maven + maven-settings + 2.0 + + + org.apache.maven.wagon + wagon-file + runtime + + + org.apache.maven + maven-plugin-parameter-documenter + 2.0 + + + org.apache.maven.wagon + wagon-http-lightweight + runtime + + + org.apache.maven.reporting + maven-reporting-api + 2.0 + + + org.apache.maven + maven-profile + 2.0 + + + org.apache.maven + maven-model + 2.0 + + + org.apache.maven + maven-artifact + 2.0 + + + org.apache.maven.wagon + wagon-provider-api + + + org.codehaus.plexus + plexus-container-default + + + org.apache.maven + maven-repository-metadata + 2.0 + + + org.apache.maven + maven-error-diagnostics + 2.0 + + + org.apache.maven + maven-project + 2.0 + + + org.apache.maven + maven-plugin-registry + 2.0 + + + commons-cli + commons-cli + 1.0 + + + commons-lang + commons-lang + + + commons-logging + commons-logging + + + + + org.apache.maven + maven-plugin-api + 2.0 + + + org.apache.maven + maven-plugin-descriptor + 2.0 + + + org.codehaus.plexus + plexus-interactivity-api + 1.0-alpha-4 + + + plexus-utils + plexus + + + plexus-container-default + org.codehaus.plexus + + + + + org.apache.maven + maven-artifact-manager + 2.0 + + + org.apache.maven + maven-monitor + 2.0 + + + org.apache.maven.wagon + wagon-ssh + runtime + + + plexus-utils + plexus + + + plexus-container-default + org.codehaus.plexus + + + + + org.codehaus.plexus + plexus-utils + + + + + + maven-checkstyle-plugin + + + maven-clover-plugin + + + maven-pmd-plugin + + + maven-project-info-reports-plugin + + + + + + website + scp://minotaur.apache.org//www/maven.apache.org/m2 + + deployed + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/src/test/resources/test-repo/org/apache/maven/surefire/surefire-testng/2.0/surefire-testng-2.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/src/test/resources/test-repo/org/apache/maven/surefire/surefire-testng/2.0/surefire-testng-2.0.pom new file mode 100644 index 000000000..d8de3ad32 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-dependency-tree-consumer/src/test/resources/test-repo/org/apache/maven/surefire/surefire-testng/2.0/surefire-testng-2.0.pom @@ -0,0 +1,82 @@ + + + surefire-providers + org.apache.maven.surefire + 2.0 + + 4.0.0 + surefire-testng + SureFire TestNG Runner + 2.0 + + + + maven-compiler-plugin + + 1.4 + 1.4 + + + + maven-surefire-plugin + + false + + + + + + + jdk14 + + 1.4 + + + + org.testng + testng + 4.7 + jdk14 + + + + + jdk15 + + !1.4 + + + + org.testng + testng + 4.7 + jdk15 + + + + + jdk1.3 + + + + maven-compiler-plugin + + false + 1.4 + + + + maven-surefire-plugin + + once + ${JAVA_1_3_HOME}/bin/java + + + + + + + + deployed + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/pom.xml b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/pom.xml new file mode 100644 index 000000000..56e38b751 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/pom.xml @@ -0,0 +1,59 @@ + + + + + 4.0.0 + + org.apache.archiva + archiva-consumers + 1.2-SNAPSHOT + ../pom.xml + + + archiva-lucene-consumers + Archiva Consumers :: Lucene Consumers + jar + + + + org.apache.archiva + archiva-indexer + + + org.apache.archiva + archiva-configuration + + + org.apache.archiva + archiva-consumer-api + + + org.apache.archiva + archiva-repository-layer + + + org.codehaus.plexus + plexus-spring + test + + + org.apache.bcel + bcel + 5.2 + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/maven/archiva/consumers/lucene/IndexArchiveTableOfContentsConsumer.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/maven/archiva/consumers/lucene/IndexArchiveTableOfContentsConsumer.java new file mode 100644 index 000000000..9d819677e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/maven/archiva/consumers/lucene/IndexArchiveTableOfContentsConsumer.java @@ -0,0 +1,93 @@ +package org.apache.maven.archiva.consumers.lucene; + +/* + * 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.archiva.consumers.AbstractMonitoredConsumer; +import org.apache.maven.archiva.consumers.ConsumerException; +import org.apache.maven.archiva.consumers.DatabaseUnprocessedArtifactConsumer; +import org.apache.maven.archiva.model.ArchivaArtifact; + +import java.util.List; + +/** + * IndexArchiveTableOfContentsConsumer + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component role="org.apache.maven.archiva.consumers.DatabaseUnprocessedArtifactConsumer" + * role-hint="index-archive-toc" + * instantiation-strategy="per-lookup" + */ +public class IndexArchiveTableOfContentsConsumer + extends AbstractMonitoredConsumer + implements DatabaseUnprocessedArtifactConsumer +{ + /** + * @plexus.configuration default-value="index-archive-toc" + */ + private String id; + + /** + * @plexus.configuration default-value="Index the archive table of contents for Full Text Search." + */ + private String description; + + public void beginScan() + { + // TODO Auto-generated method stub + + } + + public void completeScan() + { + // TODO Auto-generated method stub + + } + + public List getIncludedTypes() + { + // TODO Auto-generated method stub + return null; + } + + public void processArchivaArtifact( ArchivaArtifact artifact ) + throws ConsumerException + { + // TODO Auto-generated method stub + + } + + public String getDescription() + { + return description; + } + + public String getId() + { + return id; + } + + public boolean isPermanent() + { + return false; + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/maven/archiva/consumers/lucene/IndexArtifactConsumer.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/maven/archiva/consumers/lucene/IndexArtifactConsumer.java new file mode 100644 index 000000000..eb6c71ce1 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/maven/archiva/consumers/lucene/IndexArtifactConsumer.java @@ -0,0 +1,217 @@ +package org.apache.maven.archiva.consumers.lucene; + +/* + * 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.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import org.apache.commons.lang.StringUtils; +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.ConfigurationNames; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer; +import org.apache.maven.archiva.consumers.ConsumerException; +import org.apache.maven.archiva.consumers.DatabaseUnprocessedArtifactConsumer; +import org.apache.maven.archiva.indexer.RepositoryContentIndex; +import org.apache.maven.archiva.indexer.RepositoryContentIndexFactory; +import org.apache.maven.archiva.indexer.RepositoryIndexException; +import org.apache.maven.archiva.indexer.hashcodes.HashcodesRecord; +import org.apache.maven.archiva.model.ArchivaArtifact; +import org.apache.maven.archiva.repository.ManagedRepositoryContent; +import org.apache.maven.archiva.repository.RepositoryContentFactory; +import org.apache.maven.archiva.repository.RepositoryException; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException; +import org.codehaus.plexus.registry.Registry; +import org.codehaus.plexus.registry.RegistryListener; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * IndexArtifactConsumer + * + * @author Joakim Erdfelt + * @version $Id$ + * @plexus.component role="org.apache.maven.archiva.consumers.DatabaseUnprocessedArtifactConsumer" + * role-hint="index-artifact" + * instantiation-strategy="per-lookup" + */ +public class IndexArtifactConsumer + extends AbstractMonitoredConsumer + implements DatabaseUnprocessedArtifactConsumer, RegistryListener, Initializable +{ + private Logger log = LoggerFactory.getLogger( IndexArtifactConsumer.class ); + + private static final String INDEX_ERROR = "indexing_error"; + + /** + * @plexus.configuration default-value="index-artifact" + */ + private String id; + + /** + * @plexus.configuration default-value="Index the artifact checksums for Find functionality." + */ + private String description; + + /** + * @plexus.requirement + */ + private ArchivaConfiguration configuration; + + /** + * @plexus.requirement + */ + private RepositoryContentFactory repositoryFactory; + + /** + * @plexus.requirement role-hint="lucene" + */ + private RepositoryContentIndexFactory indexFactory; + + private Map repositoryMap = new HashMap(); + + public void beginScan() + { + /* nothing to do here */ + } + + public void completeScan() + { + /* nothing to do here */ + } + + public List getIncludedTypes() + { + return null; // TODO: define these as a list of artifacts. + } + + public void processArchivaArtifact( ArchivaArtifact artifact ) + throws ConsumerException + { + HashcodesRecord record = new HashcodesRecord(); + record.setRepositoryId( artifact.getModel().getRepositoryId() ); + record.setArtifact( artifact ); + + IndexedRepositoryDetails pnl = getIndexedRepositoryDetails( artifact ); + + String artifactPath = pnl.repository.toPath( artifact ); + record.setFilename( artifactPath ); + + try + { + pnl.index.modifyRecord( record ); + } + catch ( RepositoryIndexException e ) + { + triggerConsumerError( INDEX_ERROR, "Unable to index hashcodes: " + e.getMessage() ); + } + } + + private IndexedRepositoryDetails getIndexedRepositoryDetails( ArchivaArtifact artifact ) + { + String repoId = artifact.getModel().getRepositoryId(); + if ( StringUtils.isBlank( repoId ) ) + { + throw new IllegalStateException( + "Unable to process artifact [" + artifact + "] as it has no repository id associated with it." ); + } + + return getIndexedRepositoryDetails( repoId ); + } + + private IndexedRepositoryDetails getIndexedRepositoryDetails( String id ) + { + return this.repositoryMap.get( id ); + } + + public String getDescription() + { + return description; + } + + public String getId() + { + return id; + } + + public boolean isPermanent() + { + return false; + } + + public void afterConfigurationChange( Registry registry, String propertyName, Object propertyValue ) + { + if ( ConfigurationNames.isManagedRepositories( propertyName ) ) + { + initRepositoryMap(); + } + } + + public void beforeConfigurationChange( Registry registry, String propertyName, Object propertyValue ) + { + /* do nothing */ + } + + public void initialize() + throws InitializationException + { + initRepositoryMap(); + configuration.addChangeListener( this ); + } + + private void initRepositoryMap() + { + synchronized ( this.repositoryMap ) + { + this.repositoryMap.clear(); + + Iterator it = configuration.getConfiguration().getManagedRepositories().iterator(); + while ( it.hasNext() ) + { + ManagedRepositoryConfiguration repository = it.next(); + + try + { + IndexedRepositoryDetails pnl = new IndexedRepositoryDetails(); + + pnl.repository = repositoryFactory.getManagedRepositoryContent( repository.getId() ); + + pnl.index = indexFactory.createHashcodeIndex( repository ); + + this.repositoryMap.put( repository.getId(), pnl ); + } + catch ( RepositoryException e ) + { + log.error( "Unable to load repository content object: " + e.getMessage(), e ); + } + } + } + } + + class IndexedRepositoryDetails + { + public ManagedRepositoryContent repository; + + public RepositoryContentIndex index; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/maven/archiva/consumers/lucene/IndexContentConsumer.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/maven/archiva/consumers/lucene/IndexContentConsumer.java new file mode 100644 index 000000000..3bb2b8677 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/maven/archiva/consumers/lucene/IndexContentConsumer.java @@ -0,0 +1,233 @@ +package org.apache.maven.archiva.consumers.lucene; + +/* + * 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.io.FileUtils; +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.FileTypes; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer; +import org.apache.maven.archiva.consumers.ConsumerException; +import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer; +import org.apache.maven.archiva.indexer.RepositoryContentIndex; +import org.apache.maven.archiva.indexer.RepositoryContentIndexFactory; +import org.apache.maven.archiva.indexer.RepositoryIndexException; +import org.apache.maven.archiva.indexer.filecontent.FileContentRecord; +import org.apache.maven.archiva.model.ArchivaArtifact; +import org.apache.maven.archiva.model.ArtifactReference; +import org.apache.maven.archiva.repository.ManagedRepositoryContent; +import org.apache.maven.archiva.repository.RepositoryContentFactory; +import org.apache.maven.archiva.repository.RepositoryException; +import org.apache.maven.archiva.repository.layout.LayoutException; +import org.apache.maven.archiva.repository.metadata.MetadataTools; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException; +import org.codehaus.plexus.registry.Registry; +import org.codehaus.plexus.registry.RegistryListener; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * IndexContentConsumer - generic full file content indexing consumer. + * + * @author Joakim Erdfelt + * @version $Id$ + * @plexus.component role="org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer" + * role-hint="index-content" + * instantiation-strategy="per-lookup" + */ +public class IndexContentConsumer + extends AbstractMonitoredConsumer + implements KnownRepositoryContentConsumer, RegistryListener, Initializable +{ + private Logger log = LoggerFactory.getLogger( IndexContentConsumer.class ); + + private static final String READ_CONTENT = "read_content"; + + private static final String INDEX_ERROR = "indexing_error"; + + /** + * @plexus.configuration default-value="index-content" + */ + private String id; + + /** + * @plexus.configuration default-value="Text and XML file contents indexing" + */ + private String description; + + /** + * @plexus.requirement + */ + private ArchivaConfiguration configuration; + + /** + * @plexus.requirement + */ + private FileTypes filetypes; + + /** + * @plexus.requirement + */ + private RepositoryContentFactory repositoryFactory; + + /** + * @plexus.requirement role-hint="lucene" + */ + private RepositoryContentIndexFactory indexFactory; + + private List propertyNameTriggers = new ArrayList(); + + private List includes = new ArrayList(); + + private RepositoryContentIndex index; + + private ManagedRepositoryContent repository; + + private File repositoryDir; + + public String getId() + { + return this.id; + } + + public String getDescription() + { + return this.description; + } + + public boolean isPermanent() + { + return false; + } + + public List getExcludes() + { + return null; + } + + public List getIncludes() + { + return this.includes; + } + + public void beginScan( ManagedRepositoryConfiguration repo, Date whenGathered ) + throws ConsumerException + { + try + { + this.repository = repositoryFactory.getManagedRepositoryContent( repo.getId() ); + this.repositoryDir = new File( repository.getRepoRoot() ); + this.index = indexFactory.createFileContentIndex( repository.getRepository() ); + } + catch ( RepositoryException e ) + { + throw new ConsumerException( "Unable to start IndexContentConsumer: " + e.getMessage(), e ); + } + } + + public void processFile( String path ) + throws ConsumerException + { + if ( path.endsWith( "/" + MetadataTools.MAVEN_METADATA ) ) + { + log.debug( "File is a metadata file. Not indexing." ); + return; + } + + FileContentRecord record = new FileContentRecord(); + try + { + File file = new File( repositoryDir, path ); + record.setRepositoryId( this.repository.getId() ); + record.setFilename( path ); + record.setContents( FileUtils.readFileToString( file, null ) ); + + // Test for possible artifact reference syntax. + try + { + ArtifactReference ref = repository.toArtifactReference( path ); + ArchivaArtifact artifact = new ArchivaArtifact( ref ); + artifact.getModel().setRepositoryId( repository.getId() ); + record.setArtifact( artifact ); + } + catch ( LayoutException e ) + { + // Not an artifact. + } + + index.modifyRecord( record ); + } + catch ( IOException e ) + { + triggerConsumerError( READ_CONTENT, "Unable to read file contents: " + e.getMessage() ); + } + catch ( RepositoryIndexException e ) + { + triggerConsumerError( INDEX_ERROR, "Unable to index file contents: " + e.getMessage() ); + } + } + + public void completeScan() + { + /* do nothing */ + } + + public void afterConfigurationChange( Registry registry, String propertyName, Object propertyValue ) + { + if ( propertyNameTriggers.contains( propertyName ) ) + { + initIncludes(); + } + } + + public void beforeConfigurationChange( Registry registry, String propertyName, Object propertyValue ) + { + /* do nothing */ + } + + private void initIncludes() + { + includes.clear(); + + includes.addAll( filetypes.getFileTypePatterns( FileTypes.INDEXABLE_CONTENT ) ); + } + + public void initialize() + throws InitializationException + { + propertyNameTriggers = new ArrayList(); + propertyNameTriggers.add( "repositoryScanning" ); + propertyNameTriggers.add( "fileTypes" ); + propertyNameTriggers.add( "fileType" ); + propertyNameTriggers.add( "patterns" ); + propertyNameTriggers.add( "pattern" ); + + configuration.addChangeListener( this ); + + initIncludes(); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/maven/archiva/consumers/lucene/IndexJavaPublicMethodsConsumer.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/maven/archiva/consumers/lucene/IndexJavaPublicMethodsConsumer.java new file mode 100644 index 000000000..dd0ded398 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/maven/archiva/consumers/lucene/IndexJavaPublicMethodsConsumer.java @@ -0,0 +1,269 @@ +package org.apache.maven.archiva.consumers.lucene; + +/* + * 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.archiva.consumers.AbstractMonitoredConsumer; +import org.apache.maven.archiva.consumers.ConsumerException; +import org.apache.maven.archiva.consumers.DatabaseUnprocessedArtifactConsumer; +import org.apache.maven.archiva.indexer.RepositoryContentIndex; +import org.apache.maven.archiva.indexer.RepositoryContentIndexFactory; +import org.apache.maven.archiva.indexer.RepositoryIndexException; +import org.apache.maven.archiva.indexer.bytecode.BytecodeRecord; +import org.apache.maven.archiva.model.ArchivaArtifact; +import org.apache.maven.archiva.repository.ManagedRepositoryContent; +import org.apache.maven.archiva.repository.RepositoryContentFactory; +import org.apache.maven.archiva.repository.RepositoryException; + +import com.sun.org.apache.bcel.internal.classfile.ClassParser; +import com.sun.org.apache.bcel.internal.classfile.JavaClass; +import com.sun.org.apache.bcel.internal.classfile.Method; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; + +/** + * IndexJavaPublicMethodsConsumer + * + * @author Joakim Erdfelt + * Maria Odea Ching + * @version $Id$ + * + * @plexus.component role="org.apache.maven.archiva.consumers.DatabaseUnprocessedArtifactConsumer" + * role-hint="index-public-methods" + * instantiation-strategy="per-lookup" + */ +public class IndexJavaPublicMethodsConsumer + extends AbstractMonitoredConsumer + implements DatabaseUnprocessedArtifactConsumer +{ + /** + * @plexus.configuration default-value="index-public-methods" + */ + private String id; + + /** + * @plexus.configuration default-value="Index the java public methods for Full Text Search." + */ + private String description; + + /** + * @plexus.requirement role-hint="lucene" + */ + private RepositoryContentIndexFactory repoIndexFactory; + + /** + * @plexus.requirement + */ + private RepositoryContentFactory repoFactory; + + private static final String CLASSES = "classes"; + + private static final String METHODS = "methods"; + + private List includes = new ArrayList(); + + public IndexJavaPublicMethodsConsumer() + { + includes.add( "jar" ); + includes.add( "war" ); + includes.add( "ear" ); + includes.add( "zip" ); + includes.add( "tar.gz" ); + includes.add( "tar.bz2" ); + includes.add( "car" ); + includes.add( "sar" ); + includes.add( "mar" ); + includes.add( "rar" ); + } + + public void beginScan() + { + // TODO Auto-generated method stubx + } + + public void completeScan() + { + // TODO Auto-generated method stub + + } + + public List getIncludedTypes() + { + return includes; + } + + public void processArchivaArtifact( ArchivaArtifact artifact ) + throws ConsumerException + { + try + { + ManagedRepositoryContent repoContent = + repoFactory.getManagedRepositoryContent( artifact.getModel().getRepositoryId() ); + File file = new File( repoContent.getRepoRoot(), repoContent.toPath( artifact ) ); + + if( file.getAbsolutePath().endsWith( ".jar" ) || file.getAbsolutePath().endsWith( ".war" ) || + file.getAbsolutePath().endsWith( ".ear" ) || file.getAbsolutePath().endsWith( ".zip" ) || + file.getAbsolutePath().endsWith( ".tar.gz" ) || file.getAbsolutePath().endsWith( ".tar.bz2" ) || + file.getAbsolutePath().endsWith( ".car" ) || file.getAbsolutePath().endsWith( ".sar" ) || + file.getAbsolutePath().endsWith( ".mar" ) || file.getAbsolutePath().endsWith( ".rar" ) ) + { + if( file.exists() ) + { + List files = readFilesInArchive( file ); + Map> mapOfClassesAndMethods = + getPublicClassesAndMethodsFromFiles( file.getAbsolutePath(), files ); + + // NOTE: what about public variables? should these be indexed too? + RepositoryContentIndex bytecodeIndex = repoIndexFactory.createBytecodeIndex( repoContent.getRepository() ); + + artifact.getModel().setRepositoryId( repoContent.getId() ); + + BytecodeRecord bytecodeRecord = new BytecodeRecord(); + bytecodeRecord.setFilename( file.getName() ); + bytecodeRecord.setClasses( mapOfClassesAndMethods.get( CLASSES ) ); + bytecodeRecord.setFiles( files ); + bytecodeRecord.setMethods( mapOfClassesAndMethods.get( METHODS ) ); + bytecodeRecord.setArtifact( artifact ); + bytecodeRecord.setRepositoryId( repoContent.getId() ); + bytecodeIndex.modifyRecord( bytecodeRecord ); + } + } + } + catch ( RepositoryException e ) + { + throw new ConsumerException( "Can't run index cleanup consumer: " + e.getMessage() ); + } + catch ( RepositoryIndexException e ) + { + throw new ConsumerException( "Error encountered while adding artifact to index: " + e.getMessage() ); + } + catch ( IOException e ) + { + throw new ConsumerException( "Error encountered while getting file contents: " + e.getMessage() ); + } + } + + public String getDescription() + { + return description; + } + + public String getId() + { + return id; + } + + public boolean isPermanent() + { + return false; + } + + private List readFilesInArchive( File file ) + throws IOException + { + ZipFile zipFile = new ZipFile( file ); + List files; + + try + { + files = new ArrayList( zipFile.size() ); + for ( Enumeration entries = zipFile.entries(); entries.hasMoreElements(); ) + { + ZipEntry entry = (ZipEntry) entries.nextElement(); + files.add( entry.getName() ); + } + } + finally + { + closeQuietly( zipFile ); + } + return files; + } + + private void closeQuietly( ZipFile zipFile ) + { + try + { + if ( zipFile != null ) + { + zipFile.close(); + } + } + catch ( IOException e ) + { + // ignored + } + } + + private static boolean isClass( String name ) + { + return name.endsWith( ".class" ) && name.lastIndexOf( "$" ) < 0; + } + + private Map> getPublicClassesAndMethodsFromFiles( String zipFile, List files ) + { + Map> map = new HashMap>(); + List methods = new ArrayList(); + List classes = new ArrayList(); + + for( String file : files ) + { + if( isClass( file ) ) + { + try + { + ClassParser parser = new ClassParser( zipFile, file ); + JavaClass javaClass = parser.parse(); + + if( javaClass.isPublic() ) + { + classes.add( javaClass.getClassName() ); + } + + Method[] methodsArr = javaClass.getMethods(); + for( Method method : methodsArr ) + { + if( method.isPublic() ) + { + methods.add( method.getName() ); + } + } + } + catch ( IOException e ) + { + // ignore + } + } + } + + map.put( CLASSES, classes ); + map.put( METHODS, methods ); + + return map; + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/maven/archiva/consumers/lucene/LuceneCleanupRemoveIndexedConsumer.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/maven/archiva/consumers/lucene/LuceneCleanupRemoveIndexedConsumer.java new file mode 100644 index 000000000..a6f729395 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/maven/archiva/consumers/lucene/LuceneCleanupRemoveIndexedConsumer.java @@ -0,0 +1,153 @@ +package org.apache.maven.archiva.consumers.lucene; + +/* + * 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.archiva.consumers.AbstractMonitoredConsumer; +import org.apache.maven.archiva.consumers.ConsumerException; +import org.apache.maven.archiva.consumers.DatabaseCleanupConsumer; +import org.apache.maven.archiva.indexer.RepositoryContentIndex; +import org.apache.maven.archiva.indexer.RepositoryContentIndexFactory; +import org.apache.maven.archiva.indexer.RepositoryIndexException; +import org.apache.maven.archiva.indexer.bytecode.BytecodeRecord; +import org.apache.maven.archiva.indexer.filecontent.FileContentRecord; +import org.apache.maven.archiva.indexer.hashcodes.HashcodesRecord; +import org.apache.maven.archiva.model.ArchivaArtifact; +import org.apache.maven.archiva.repository.ManagedRepositoryContent; +import org.apache.maven.archiva.repository.RepositoryContentFactory; +import org.apache.maven.archiva.repository.RepositoryException; + +import java.io.File; +import java.util.List; + +/** + * LuceneCleanupRemoveIndexedConsumer + * + * @author Joakim Erdfelt + * @version $Id$ + * @plexus.component role="org.apache.maven.archiva.consumers.DatabaseCleanupConsumer" + * role-hint="not-present-remove-indexed" instantiation-strategy="per-lookup" + */ +public class LuceneCleanupRemoveIndexedConsumer + extends AbstractMonitoredConsumer + implements DatabaseCleanupConsumer +{ + /** + * @plexus.configuration default-value="not-present-remove-indexed" + */ + private String id; + + /** + * @plexus.configuration default-value="Remove indexed content if not present on filesystem." + */ + private String description; + + /** + * @plexus.requirement role-hint="lucene" + */ + private RepositoryContentIndexFactory repoIndexFactory; + + /** + * @plexus.requirement + */ + private RepositoryContentFactory repoFactory; + + public void beginScan() + { + // TODO Auto-generated method stub + + } + + public void completeScan() + { + // TODO Auto-generated method stub + + } + + public List getIncludedTypes() + { + // TODO Auto-generated method stub + return null; + } + + public void processArchivaArtifact( ArchivaArtifact artifact ) + throws ConsumerException + { + try + { + ManagedRepositoryContent repoContent = + repoFactory.getManagedRepositoryContent( artifact.getModel().getRepositoryId() ); + + File file = new File( repoContent.getRepoRoot(), repoContent.toPath( artifact ) ); + + if( !file.exists() ) + { + RepositoryContentIndex bytecodeIndex = repoIndexFactory.createBytecodeIndex( repoContent.getRepository() ); + RepositoryContentIndex hashcodesIndex = repoIndexFactory.createHashcodeIndex( repoContent.getRepository() ); + RepositoryContentIndex fileContentIndex = + repoIndexFactory.createFileContentIndex( repoContent.getRepository() ); + + FileContentRecord fileContentRecord = new FileContentRecord(); + fileContentRecord.setFilename( repoContent.toPath( artifact ) ); + fileContentIndex.deleteRecord( fileContentRecord ); + + HashcodesRecord hashcodesRecord = new HashcodesRecord(); + hashcodesRecord.setArtifact( artifact ); + hashcodesIndex.deleteRecord( hashcodesRecord ); + + BytecodeRecord bytecodeRecord = new BytecodeRecord(); + bytecodeRecord.setArtifact( artifact ); + bytecodeIndex.deleteRecord( bytecodeRecord ); + } + } + catch ( RepositoryException e ) + { + throw new ConsumerException( "Can't run index cleanup consumer: " + e.getMessage() ); + } + catch ( RepositoryIndexException e ) + { + throw new ConsumerException( e.getMessage() ); + } + } + + public String getDescription() + { + return description; + } + + public String getId() + { + return id; + } + + public boolean isPermanent() + { + return false; + } + + public void setRepositoryIndexFactory( RepositoryContentIndexFactory repoIndexFactory ) + { + this.repoIndexFactory = repoIndexFactory; + } + + public void setRepositoryContentFactory( RepositoryContentFactory repoFactory ) + { + this.repoFactory = repoFactory; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/conf/repository-manager.xml b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/conf/repository-manager.xml new file mode 100644 index 000000000..19e1449cd --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/conf/repository-manager.xml @@ -0,0 +1,129 @@ + + + + + 1 + + + test-repo + Test Repository + file://src/test/resources/test-repo + default + true + true + true + 0 0 * * * ? + 0 + 2 + + + + + + + + example + http + proxy.mycompany.com + 8080 + myself + mypass + + + + + + + artifacts + + **/*.pom + **/*.jar + **/*.ear + **/*.war + + + + indexable-content + + **/*.txt + **/*.TXT + + + + auto-remove + + **/*.bak + **/*~ + **/*- + + + + ignored + + **/.htaccess + **/KEYS + **/*.rb + **/*.sh + **/.svn/** + **/.DAV/** + + + + + update-db-artifact + create-missing-checksums + update-db-repository-metadata + validate-checksum + validate-signature + index-content + auto-remove + auto-rename + repository-purge + + + update-db-bad-content + + + + + 0 0 * * * ? + + index-artifact + update-db-project + validate-repository-metadata + index-archive-toc + update-db-bytecode-stats + index-public-methods + + + not-present-remove-db-artifact + not-present-remove-db-project + not-present-remove-indexed + + + + + + true + true + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/java/org/apache/maven/archiva/consumers/lucene/IndexJavaPublicMethodsConsumerTest.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/java/org/apache/maven/archiva/consumers/lucene/IndexJavaPublicMethodsConsumerTest.java new file mode 100644 index 000000000..83ae9588b --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/java/org/apache/maven/archiva/consumers/lucene/IndexJavaPublicMethodsConsumerTest.java @@ -0,0 +1,124 @@ +package org.apache.maven.archiva.consumers.lucene; + +/* + * 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.List; + +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.consumers.DatabaseUnprocessedArtifactConsumer; +import org.apache.maven.archiva.indexer.RepositoryContentIndexFactory; +import org.apache.maven.archiva.indexer.search.SearchResultLimits; +import org.apache.maven.archiva.indexer.search.SearchResults; +import org.apache.maven.archiva.model.ArchivaArtifact; +import org.apache.maven.archiva.model.ArchivaArtifactModel; +import org.codehaus.plexus.spring.PlexusInSpringTestCase; + +/** + * + * @author Maria Odea Ching + * @version + * + */ +public class IndexJavaPublicMethodsConsumerTest + extends PlexusInSpringTestCase +{ + DatabaseUnprocessedArtifactConsumer indexMethodsConsumer; + + IndexJavaPublicMethodsCrossRepositorySearch searcher; + + private RepositoryContentIndexFactory indexFactory; + + public void setUp() + throws Exception + { + super.setUp(); + indexMethodsConsumer = + (DatabaseUnprocessedArtifactConsumer) lookup( DatabaseUnprocessedArtifactConsumer.class, + "index-public-methods" ); + + ManagedRepositoryConfiguration config = new ManagedRepositoryConfiguration(); + config.setId( "test-repo" ); + config.setLayout( "default" ); + config.setLocation( getBasedir() + "/target/test-classes/test-repo" ); + config.setName( "Test Repository" ); + + addRepoToConfiguration( "index-public-methods", config ); + + indexFactory = (RepositoryContentIndexFactory) lookup (RepositoryContentIndexFactory.class, "lucene" ); + searcher = new IndexJavaPublicMethodsCrossRepositorySearch( config, indexFactory ); + } + + private void addRepoToConfiguration( String configHint, ManagedRepositoryConfiguration repoConfiguration ) + throws Exception + { + ArchivaConfiguration archivaConfiguration = + (ArchivaConfiguration) lookup( ArchivaConfiguration.class, configHint ); + Configuration configuration = archivaConfiguration.getConfiguration(); + configuration.removeManagedRepository( configuration.findManagedRepositoryById( repoConfiguration.getId() ) ); + configuration.addManagedRepository( repoConfiguration ); + } + + public void testJarPublicMethods() + throws Exception + { + ArchivaArtifact artifact = + createArtifact( "org.apache.archiva", "archiva-index-methods-jar-test", "1.0", "jar" ); + indexMethodsConsumer.processArchivaArtifact( artifact ); + + List selectedRepos = new ArrayList(); + selectedRepos.add( "test-repo" ); + + // search for class names + SearchResults results = searcher.searchForBytecode( "", selectedRepos, "FirstPackageApp", new SearchResultLimits( 0 ) ); + assertEquals( 1, results.getTotalHits() ); + + results = searcher.searchForBytecode( "", selectedRepos, "SecondPackageApp", new SearchResultLimits( 0 ) ); + assertEquals( 1, results.getTotalHits() ); + + // search for public methods + results = searcher.searchForBytecode( "", selectedRepos, "appMethodOne", new SearchResultLimits( 0 ) ); + assertEquals( 1, results.getTotalHits() ); + + // should return only the overridding public method in SecondPackageApp + results = searcher.searchForBytecode( "", selectedRepos, "protectedMethod", new SearchResultLimits( 0 ) ); + assertEquals( 1, results.getTotalHits() ); + + // should not return any private methods + results = searcher.searchForBytecode( "", selectedRepos, "privMethod", new SearchResultLimits( 0 ) ); + assertEquals( 0, results.getTotalHits() ); + + // test for public variables? + } + + private ArchivaArtifact createArtifact( String groupId, String artifactId, String version, String type ) + { + ArchivaArtifactModel model = new ArchivaArtifactModel(); + model.setGroupId( groupId ); + model.setArtifactId( artifactId ); + model.setVersion( version ); + model.setType( type ); + model.setRepositoryId( "test-repo" ); + + return new ArchivaArtifact( model ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/java/org/apache/maven/archiva/consumers/lucene/IndexJavaPublicMethodsCrossRepositorySearch.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/java/org/apache/maven/archiva/consumers/lucene/IndexJavaPublicMethodsCrossRepositorySearch.java new file mode 100644 index 000000000..ea9f13311 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/java/org/apache/maven/archiva/consumers/lucene/IndexJavaPublicMethodsCrossRepositorySearch.java @@ -0,0 +1,191 @@ +package org.apache.maven.archiva.consumers.lucene; + +/* + * 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.IOException; +import java.util.ArrayList; +import java.util.List; + +import org.apache.lucene.document.Document; +import org.apache.lucene.queryParser.ParseException; +import org.apache.lucene.queryParser.QueryParser; +import org.apache.lucene.search.Hits; +import org.apache.lucene.search.MultiSearcher; +import org.apache.lucene.search.Searchable; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.indexer.RepositoryContentIndex; +import org.apache.maven.archiva.indexer.RepositoryContentIndexFactory; +import org.apache.maven.archiva.indexer.RepositoryIndexSearchException; +import org.apache.maven.archiva.indexer.bytecode.BytecodeHandlers; +import org.apache.maven.archiva.indexer.lucene.LuceneEntryConverter; +import org.apache.maven.archiva.indexer.lucene.LuceneQuery; +import org.apache.maven.archiva.indexer.lucene.LuceneRepositoryContentRecord; +import org.apache.maven.archiva.indexer.search.SearchResultLimits; +import org.apache.maven.archiva.indexer.search.SearchResults; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Searcher used for testing purposes only. + * + * @author Maria Odea Ching + * @version + */ +public class IndexJavaPublicMethodsCrossRepositorySearch +{ + private Logger log = LoggerFactory.getLogger( IndexJavaPublicMethodsCrossRepositorySearch.class ); + + private ManagedRepositoryConfiguration localIndexedRepo; + + private RepositoryContentIndexFactory indexFactory; + + public IndexJavaPublicMethodsCrossRepositorySearch( ManagedRepositoryConfiguration localIndexedRepo, RepositoryContentIndexFactory indexFactory ) + { + this.localIndexedRepo = localIndexedRepo; + this.indexFactory = indexFactory; + } + + public SearchResults searchForBytecode( String principal, List selectedRepos, String term, + SearchResultLimits limits ) throws ParseException + { + List indexes = new ArrayList(); + indexes.add( indexFactory.createBytecodeIndex( localIndexedRepo ) ); + + QueryParser parser = new BytecodeHandlers().getQueryParser(); + LuceneQuery query = new LuceneQuery( parser.parse( term ) ); + SearchResults results = searchAll( query, limits, indexes ); + results.getRepositories().add( localIndexedRepo ); + + return results; + } + + private SearchResults searchAll( LuceneQuery luceneQuery, SearchResultLimits limits, List indexes ) + { + org.apache.lucene.search.Query specificQuery = luceneQuery.getLuceneQuery(); + + SearchResults results = new SearchResults(); + + if ( indexes.isEmpty() ) + { + // No point going any further. + return results; + } + + // Setup the converter + LuceneEntryConverter converter = null; + RepositoryContentIndex index = indexes.get( 0 ); + converter = index.getEntryConverter(); + + // Process indexes into an array of Searchables. + List searchableList = toSearchables( indexes ); + + Searchable searchables[] = new Searchable[searchableList.size()]; + searchableList.toArray( searchables ); + + MultiSearcher searcher = null; + + try + { + // Create a multi-searcher for looking up the information. + searcher = new MultiSearcher( searchables ); + + // Perform the search. + Hits hits = searcher.search( specificQuery ); + + int hitCount = hits.length(); + + // Now process the limits. + results.setLimits( limits ); + results.setTotalHits( hitCount ); + + int fetchCount = limits.getPageSize(); + int offset = ( limits.getSelectedPage() * limits.getPageSize() ); + + if ( limits.getSelectedPage() == SearchResultLimits.ALL_PAGES ) + { + fetchCount = hitCount; + offset = 0; + } + + // Goto offset. + if ( offset < hitCount ) + { + // only process if the offset is within the hit count. + for ( int i = 0; i <= fetchCount; i++ ) + { + // Stop fetching if we are past the total # of available hits. + if ( offset + i >= hitCount ) + { + break; + } + + try + { + Document doc = hits.doc( offset + i ); + LuceneRepositoryContentRecord record = converter.convert( doc ); + results.addHit( record ); + } + catch ( java.text.ParseException e ) + { + log.error( e.getMessage() ); + } + } + } + + } + catch ( IOException e ) + { + log.error( e.getMessage() ); + } + finally + { + try + { + if ( searcher != null ) + { + searcher.close(); + } + } + catch ( IOException ie ) + { + log.error( ie.getMessage() ); + } + } + + return results; + } + + private List toSearchables( List indexes ) + { + List searchableList = new ArrayList(); + for ( RepositoryContentIndex contentIndex : indexes ) + { + try + { + searchableList.add( contentIndex.getSearchable() ); + } + catch ( RepositoryIndexSearchException e ) + { + log.error( e.getMessage() ); + } + } + return searchableList; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/java/org/apache/maven/archiva/consumers/lucene/LuceneCleanupRemoveIndexedConsumerTest.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/java/org/apache/maven/archiva/consumers/lucene/LuceneCleanupRemoveIndexedConsumerTest.java new file mode 100644 index 000000000..22070f151 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/java/org/apache/maven/archiva/consumers/lucene/LuceneCleanupRemoveIndexedConsumerTest.java @@ -0,0 +1,77 @@ +package org.apache.maven.archiva.consumers.lucene; + +/* + * 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.archiva.consumers.DatabaseCleanupConsumer; +import org.apache.maven.archiva.model.ArchivaArtifact; +import org.apache.maven.archiva.model.ArchivaArtifactModel; +import org.codehaus.plexus.spring.PlexusInSpringTestCase; + +/** + * LuceneCleanupRemoveIndexedConsumerTest + * + * @author Maria Odea Ching + * @version + */ +public class LuceneCleanupRemoveIndexedConsumerTest + extends PlexusInSpringTestCase +{ + private DatabaseCleanupConsumer luceneCleanupRemoveIndexConsumer; + + public void setUp() + throws Exception + { + super.setUp(); + + luceneCleanupRemoveIndexConsumer = (DatabaseCleanupConsumer) + lookup( DatabaseCleanupConsumer.class, "lucene-cleanup" ); + } + + public void testIfArtifactExists() + throws Exception + { + ArchivaArtifact artifact = createArtifact( + "org.apache.maven.archiva", "archiva-lucene-cleanup", "1.0", "jar" ); + + luceneCleanupRemoveIndexConsumer.processArchivaArtifact( artifact ); + } + + public void testIfArtifactDoesNotExist() + throws Exception + { + ArchivaArtifact artifact = createArtifact( + "org.apache.maven.archiva", "deleted-artifact", "1.0", "jar" ); + + luceneCleanupRemoveIndexConsumer.processArchivaArtifact( artifact ); + } + + private ArchivaArtifact createArtifact( String groupId, String artifactId, String version, String type ) + { + ArchivaArtifactModel model = new ArchivaArtifactModel(); + model.setGroupId( groupId ); + model.setArtifactId( artifactId ); + model.setVersion( version ); + model.setType( type ); + model.setRepositoryId( "test-repo" ); + + return new ArchivaArtifact( model ); + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/java/org/apache/maven/archiva/consumers/lucene/stubs/LuceneRepositoryContentIndexFactoryStub.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/java/org/apache/maven/archiva/consumers/lucene/stubs/LuceneRepositoryContentIndexFactoryStub.java new file mode 100644 index 000000000..4e31f4ba4 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/java/org/apache/maven/archiva/consumers/lucene/stubs/LuceneRepositoryContentIndexFactoryStub.java @@ -0,0 +1,54 @@ +package org.apache.maven.archiva.consumers.lucene.stubs; + +/* + * 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.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.indexer.RepositoryContentIndex; +import org.apache.maven.archiva.indexer.RepositoryContentIndexFactory; + +/** + * LuceneRepositoryContenIndexFactoryStub + * + * @author Maria Odea Ching + * @version + */ +public class LuceneRepositoryContentIndexFactoryStub + implements RepositoryContentIndexFactory +{ + + public RepositoryContentIndex createBytecodeIndex( ManagedRepositoryConfiguration repository ) + { + // TODO Auto-generated method stub + return new LuceneRepositoryContentIndexStub(); + } + + public RepositoryContentIndex createFileContentIndex( ManagedRepositoryConfiguration repository ) + { + // TODO Auto-generated method stub + return new LuceneRepositoryContentIndexStub(); + } + + public RepositoryContentIndex createHashcodeIndex( ManagedRepositoryConfiguration repository ) + { + // TODO Auto-generated method stub + return new LuceneRepositoryContentIndexStub(); + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/java/org/apache/maven/archiva/consumers/lucene/stubs/LuceneRepositoryContentIndexStub.java b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/java/org/apache/maven/archiva/consumers/lucene/stubs/LuceneRepositoryContentIndexStub.java new file mode 100644 index 000000000..a5b40c8d9 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/java/org/apache/maven/archiva/consumers/lucene/stubs/LuceneRepositoryContentIndexStub.java @@ -0,0 +1,145 @@ +package org.apache.maven.archiva.consumers.lucene.stubs; + +/* + * 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; +import java.util.Collection; + +import junit.framework.Assert; + +import org.apache.lucene.analysis.Analyzer; +import org.apache.lucene.queryParser.QueryParser; +import org.apache.lucene.search.Searchable; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.indexer.RepositoryContentIndex; +import org.apache.maven.archiva.indexer.RepositoryIndexException; +import org.apache.maven.archiva.indexer.RepositoryIndexSearchException; +import org.apache.maven.archiva.indexer.lucene.LuceneEntryConverter; +import org.apache.maven.archiva.indexer.lucene.LuceneRepositoryContentRecord; + +/** + * @author Maria Odea Ching + * @version + */ +public class LuceneRepositoryContentIndexStub + implements RepositoryContentIndex +{ + + public void deleteRecords( Collection records ) + throws RepositoryIndexException + { + // TODO Auto-generated method stub + Assert.assertEquals( 2, records.size() ); + } + + public boolean exists() + throws RepositoryIndexException + { + // TODO Auto-generated method stub + return false; + } + + public Collection getAllRecordKeys() + throws RepositoryIndexException + { + // TODO Auto-generated method stub + return null; + } + + public Analyzer getAnalyzer() + { + // TODO Auto-generated method stub + return null; + } + + public LuceneEntryConverter getEntryConverter() + { + // TODO Auto-generated method stub + return null; + } + + public String getId() + { + // TODO Auto-generated method stub + return null; + } + + public File getIndexDirectory() + { + // TODO Auto-generated method stub + return null; + } + + public QueryParser getQueryParser() + { + // TODO Auto-generated method stub + return null; + } + + public ManagedRepositoryConfiguration getRepository() + { + // TODO Auto-generated method stub + return null; + } + + public Searchable getSearchable() + throws RepositoryIndexSearchException + { + // TODO Auto-generated method stub + return null; + } + + public void indexRecords( Collection records ) + throws RepositoryIndexException + { + // TODO Auto-generated method stub + + } + + public void modifyRecord( LuceneRepositoryContentRecord record ) + throws RepositoryIndexException + { + // TODO Auto-generated method stub + + } + + public void modifyRecords( Collection records ) + throws RepositoryIndexException + { + // TODO Auto-generated method stub + + } + + public void deleteRecord( LuceneRepositoryContentRecord record ) + throws RepositoryIndexException + { + Assert.assertNotNull( record ); + + // fail since the record to be deleted should only be the deleted-artifact-1.0.jar + // according to the tests + if( record.getPrimaryKey().equals( + "org/apache/maven/archiva/archiva-lucene-cleanup/1.0/archiva-lucene-cleanup-1.0.jar" ) && + record.getPrimaryKey().equals( "org.apache.maven.archiva:archiva-lucene-cleanup:1.0:jar" ) ) + { + Assert.fail(); + } + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/resources/org/apache/maven/archiva/consumers/lucene/IndexJavaPublicMethodsConsumerTest.xml b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/resources/org/apache/maven/archiva/consumers/lucene/IndexJavaPublicMethodsConsumerTest.xml new file mode 100644 index 000000000..93f760b56 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/resources/org/apache/maven/archiva/consumers/lucene/IndexJavaPublicMethodsConsumerTest.xml @@ -0,0 +1,64 @@ + + + + + org.apache.maven.archiva.consumers.DatabaseUnprocessedArtifactConsumer + index-public-methods + org.apache.maven.archiva.consumers.lucene.IndexJavaPublicMethodsConsumer + + + org.apache.maven.archiva.repository.RepositoryContentFactory + index-public-methods + + + org.apache.maven.archiva.indexer.RepositoryContentIndexFactory + lucene + repoIndexFactory + + + + + org.apache.maven.archiva.repository.RepositoryContentFactory + index-public-methods + org.apache.maven.archiva.repository.RepositoryContentFactory + RepositoryContentRequest + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + index-public-methods + archivaConfiguration + + + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + index-public-methods + org.apache.maven.archiva.configuration.DefaultArchivaConfiguration + + + org.codehaus.plexus.registry.Registry + index-public-methods + + + org.apache.maven.archiva.policies.PreDownloadPolicy + prePolicies + + + org.apache.maven.archiva.policies.PostDownloadPolicy + postPolicies + + + + + org.codehaus.plexus.registry.Registry + index-public-methods + org.codehaus.plexus.registry.commons.CommonsConfigurationRegistry + + + + + + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/resources/org/apache/maven/archiva/consumers/lucene/LuceneCleanupRemoveIndexedConsumerTest.xml b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/resources/org/apache/maven/archiva/consumers/lucene/LuceneCleanupRemoveIndexedConsumerTest.xml new file mode 100644 index 000000000..0c096a7c0 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/resources/org/apache/maven/archiva/consumers/lucene/LuceneCleanupRemoveIndexedConsumerTest.xml @@ -0,0 +1,86 @@ + + + + + + + + org.apache.maven.archiva.consumers.DatabaseCleanupConsumer + lucene-cleanup + org.apache.maven.archiva.consumers.lucene.LuceneCleanupRemoveIndexedConsumer + + + org.apache.maven.archiva.indexer.RepositoryContentIndexFactory + lucene-cleanup + repoIndexFactory + + + org.apache.maven.archiva.repository.RepositoryContentFactory + + + + + org.apache.maven.archiva.repository.RepositoryContentFactory + org.apache.maven.archiva.repository.RepositoryContentFactory + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + lucene-cleanup + + + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + lucene-cleanup + org.apache.maven.archiva.configuration.DefaultArchivaConfiguration + + + org.codehaus.plexus.registry.Registry + lucene-cleanup + + + org.apache.maven.archiva.policies.PreDownloadPolicy + prePolicies + + + org.apache.maven.archiva.policies.PostDownloadPolicy + postPolicies + + + + + org.codehaus.plexus.registry.Registry + lucene-cleanup + org.codehaus.plexus.registry.commons.CommonsConfigurationRegistry + + + + + + + + org.apache.maven.archiva.indexer.RepositoryContentIndexFactory + org.apache.maven.archiva.consumers.lucene.stubs.LuceneRepositoryContentIndexFactoryStub + lucene-cleanup + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/resources/test-repo/org/apache/archiva/archiva-index-methods-jar-test/1.0/archiva-index-methods-jar-test-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/resources/test-repo/org/apache/archiva/archiva-index-methods-jar-test/1.0/archiva-index-methods-jar-test-1.0.jar new file mode 100644 index 000000000..cc03dacc1 Binary files /dev/null and b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/resources/test-repo/org/apache/archiva/archiva-index-methods-jar-test/1.0/archiva-index-methods-jar-test-1.0.jar differ diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/resources/test-repo/org/apache/archiva/archiva-index-methods-jar-test/1.0/pom.xml b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/resources/test-repo/org/apache/archiva/archiva-index-methods-jar-test/1.0/pom.xml new file mode 100644 index 000000000..e7bf54bda --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/resources/test-repo/org/apache/archiva/archiva-index-methods-jar-test/1.0/pom.xml @@ -0,0 +1,18 @@ + + 4.0.0 + org.apache.archiva + archiva-index-methods-jar-test + jar + 1.0 + archiva-index-methods-jar-test + http://maven.apache.org + + + junit + junit + 3.8.1 + test + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/resources/test-repo/org/apache/maven/archiva/archiva-lucene-cleanup/1.0/archiva-lucene-cleanup-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/resources/test-repo/org/apache/maven/archiva/archiva-lucene-cleanup/1.0/archiva-lucene-cleanup-1.0.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-signature-consumers/pom.xml b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-signature-consumers/pom.xml new file mode 100644 index 000000000..965fbea00 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/archiva-signature-consumers/pom.xml @@ -0,0 +1,29 @@ + + + + + 4.0.0 + + org.apache.archiva + archiva-consumers + 1.2-SNAPSHOT + ../pom.xml + + + archiva-signature-consumers + Archiva Consumers :: GPG Signature Consumers + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-consumers/pom.xml b/MRM-541/archiva-modules/archiva-base/archiva-consumers/pom.xml new file mode 100644 index 000000000..4d6752164 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-consumers/pom.xml @@ -0,0 +1,48 @@ + + + + + 4.0.0 + + org.apache.archiva + archiva-base + 1.2-SNAPSHOT + ../pom.xml + + + archiva-consumers + Archiva Consumers + pom + + + archiva-consumer-api + archiva-core-consumers + archiva-database-consumers + archiva-lucene-consumers + archiva-signature-consumers + archiva-dependency-tree-consumer + + + + + + org.codehaus.plexus + plexus-maven-plugin + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/pom.xml b/MRM-541/archiva-modules/archiva-base/archiva-converter/pom.xml new file mode 100644 index 000000000..2c0813c8f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/pom.xml @@ -0,0 +1,53 @@ + + + + + + org.apache.archiva + archiva-base + 1.2-SNAPSHOT + + 4.0.0 + archiva-converter + Archiva Base :: Repository Converter + + + org.apache.archiva + archiva-consumer-api + + + org.apache.archiva + archiva-artifact-converter + + + org.apache.archiva + archiva-repository-layer + + + org.codehaus.plexus + plexus-i18n + + + org.codehaus.plexus + plexus-spring + test + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/maven/archiva/converter/RepositoryConversionException.java b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/maven/archiva/converter/RepositoryConversionException.java new file mode 100644 index 000000000..cbc622d64 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/maven/archiva/converter/RepositoryConversionException.java @@ -0,0 +1,39 @@ +package org.apache.maven.archiva.converter; + +/* + * 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. + */ + +/** + * Exception occuring during repository conversion. + * + * @author Brett Porter + */ +public class RepositoryConversionException + extends Exception +{ + public RepositoryConversionException( String message ) + { + super( message ); + } + + public RepositoryConversionException( String message, Throwable cause ) + { + super( message, cause ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/maven/archiva/converter/legacy/DefaultLegacyRepositoryConverter.java b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/maven/archiva/converter/legacy/DefaultLegacyRepositoryConverter.java new file mode 100644 index 000000000..b2ab8e1fe --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/maven/archiva/converter/legacy/DefaultLegacyRepositoryConverter.java @@ -0,0 +1,104 @@ +package org.apache.maven.archiva.converter.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. + */ + +import org.apache.maven.archiva.common.utils.PathUtil; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.converter.RepositoryConversionException; +import org.apache.maven.archiva.repository.RepositoryException; +import org.apache.maven.archiva.repository.scanner.RepositoryScanner; +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.artifact.repository.ArtifactRepositoryFactory; +import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout; + +import java.io.File; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +/** + * DefaultLegacyRepositoryConverter + * + * @author Joakim Erdfelt + * @version $Id$ + * @plexus.component + */ +public class DefaultLegacyRepositoryConverter + implements LegacyRepositoryConverter +{ + /** + * @plexus.requirement + */ + private ArtifactRepositoryFactory artifactRepositoryFactory; + + /** + * @plexus.requirement role-hint="default" + */ + private ArtifactRepositoryLayout defaultLayout; + + /** + * @plexus.requirement role="org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer" + * role-hint="artifact-legacy-to-default-converter" + */ + private LegacyConverterArtifactConsumer legacyConverterConsumer; + + /** + * @plexus.requirement + */ + private RepositoryScanner repoScanner; + + public void convertLegacyRepository( File legacyRepositoryDirectory, File repositoryDirectory, + List fileExclusionPatterns ) + throws RepositoryConversionException + { + try + { + String defaultRepositoryUrl = PathUtil.toUrl( repositoryDirectory ); + + ManagedRepositoryConfiguration legacyRepository = new ManagedRepositoryConfiguration(); + legacyRepository.setId( "legacy"); + legacyRepository.setName( "Legacy Repository" ); + legacyRepository.setLocation( legacyRepositoryDirectory.getAbsolutePath() ); + legacyRepository.setLayout( "legacy" ); + + ArtifactRepository repository = artifactRepositoryFactory.createArtifactRepository( "default", + defaultRepositoryUrl, + defaultLayout, null, + null ); + legacyConverterConsumer.setExcludes( fileExclusionPatterns ); + legacyConverterConsumer.setDestinationRepository( repository ); + + List knownConsumers = new ArrayList(); + knownConsumers.add( legacyConverterConsumer ); + + List invalidConsumers = Collections.EMPTY_LIST; + List ignoredContent = new ArrayList(); + ignoredContent.addAll( Arrays.asList( RepositoryScanner.IGNORABLE_CONTENT ) ); + + repoScanner.scan( legacyRepository, knownConsumers, invalidConsumers, ignoredContent, + RepositoryScanner.FRESH_SCAN ); + } + catch ( RepositoryException e ) + { + throw new RepositoryConversionException( "Error convering legacy repository.", e ); + } + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/maven/archiva/converter/legacy/LegacyConverterArtifactConsumer.java b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/maven/archiva/converter/legacy/LegacyConverterArtifactConsumer.java new file mode 100644 index 000000000..f79c0cd87 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/maven/archiva/converter/legacy/LegacyConverterArtifactConsumer.java @@ -0,0 +1,162 @@ +package org.apache.maven.archiva.converter.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. + */ + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer; +import org.apache.maven.archiva.consumers.ConsumerException; +import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer; +import org.apache.maven.archiva.converter.artifact.ArtifactConversionException; +import org.apache.maven.archiva.converter.artifact.ArtifactConverter; +import org.apache.maven.archiva.model.ArtifactReference; +import org.apache.maven.archiva.repository.ManagedRepositoryContent; +import org.apache.maven.archiva.repository.content.ManagedDefaultRepositoryContent; +import org.apache.maven.archiva.repository.layout.LayoutException; +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.factory.ArtifactFactory; +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * LegacyConverterArtifactConsumer - convert artifacts as they are found + * into the destination repository. + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component role="org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer" + * role-hint="artifact-legacy-to-default-converter" + * instantiation-strategy="per-lookup" + */ +public class LegacyConverterArtifactConsumer + extends AbstractMonitoredConsumer + implements KnownRepositoryContentConsumer +{ + private Logger log = LoggerFactory.getLogger( LegacyConverterArtifactConsumer.class ); + + /** + * @plexus.requirement role-hint="legacy-to-default" + */ + private ArtifactConverter artifactConverter; + + /** + * @plexus.requirement + */ + private ArtifactFactory artifactFactory; + + private ManagedRepositoryContent managedRepository; + + private ArtifactRepository destinationRepository; + + private List includes; + + private List excludes; + + public LegacyConverterArtifactConsumer() + { + includes = new ArrayList(); + includes.add( "**/*.jar" ); + includes.add( "**/*.ear" ); + includes.add( "**/*.war" ); + } + + public void beginScan( ManagedRepositoryConfiguration repository, Date whenGathered ) + throws ConsumerException + { + this.managedRepository = new ManagedDefaultRepositoryContent(); + this.managedRepository.setRepository( repository ); + } + + public void completeScan() + { + + } + + public List getExcludes() + { + return excludes; + } + + public List getIncludes() + { + return includes; + } + + public void processFile( String path ) + throws ConsumerException + { + try + { + ArtifactReference reference = managedRepository.toArtifactReference( path ); + Artifact artifact = artifactFactory.createArtifact( reference.getGroupId(), reference.getArtifactId(), + reference.getVersion(), reference.getClassifier(), + reference.getType() ); + artifactConverter.convert( artifact, destinationRepository ); + } + catch ( LayoutException e ) + { + log.warn( "Unable to convert artifact: " + path + " : " + e.getMessage(), e ); + } + catch ( ArtifactConversionException e ) + { + log.warn( "Unable to convert artifact: " + path + " : " + e.getMessage(), e ); + } + } + + public String getDescription() + { + return "Legacy Artifact to Default Artifact Converter"; + } + + public String getId() + { + return "artifact-legacy-to-default-converter"; + } + + public boolean isPermanent() + { + return false; + } + + public void setExcludes( List excludes ) + { + this.excludes = excludes; + } + + public void setIncludes( List includes ) + { + this.includes = includes; + } + + public ArtifactRepository getDestinationRepository() + { + return destinationRepository; + } + + public void setDestinationRepository( ArtifactRepository destinationRepository ) + { + this.destinationRepository = destinationRepository; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/maven/archiva/converter/legacy/LegacyRepositoryConverter.java b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/maven/archiva/converter/legacy/LegacyRepositoryConverter.java new file mode 100644 index 000000000..9a2f88ae1 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/maven/archiva/converter/legacy/LegacyRepositoryConverter.java @@ -0,0 +1,48 @@ +package org.apache.maven.archiva.converter.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. + */ + +import org.apache.maven.archiva.converter.RepositoryConversionException; + +import java.io.File; +import java.util.List; + +/** + * Convert an entire repository. + * + * @author Jason van Zyl + */ +public interface LegacyRepositoryConverter +{ + String ROLE = LegacyRepositoryConverter.class.getName(); + + /** + * Convert a legacy repository to a modern repository. This means a Maven 1.x repository + * using v3 POMs to a Maven 2.x repository using v4.0.0 POMs. + * + * @param legacyRepositoryDirectory the directory of the legacy repository. + * @param destinationRepositoryDirectory the directory of the modern repository. + * @param fileExclusionPatterns the list of patterns to exclude from the conversion. + * @throws RepositoryConversionException + */ + void convertLegacyRepository( File legacyRepositoryDirectory, File destinationRepositoryDirectory, + List fileExclusionPatterns ) + throws RepositoryConversionException; +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/main/resources/org/apache/maven/archiva/converter/DefaultRepositoryConverter.properties b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/main/resources/org/apache/maven/archiva/converter/DefaultRepositoryConverter.properties new file mode 100644 index 000000000..8589df468 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/main/resources/org/apache/maven/archiva/converter/DefaultRepositoryConverter.properties @@ -0,0 +1,38 @@ +# +# 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. +# + +failure.incorrect.md5=The MD5 checksum value was incorrect. +failure.incorrect.sha1=The SHA1 checksum value was incorrect. +failure.target.already.exists=The artifact could not be converted because it already exists. +failure.invalid.source.pom=The source POM was invalid: {0}. + +warning.missing.pom=The artifact had no POM in the source repository. + +exception.repositories.match=Source and target repositories are identical. + +failure.incorrect.groupMetadata.groupId=The group ID in the source group metadata is incorrect. + +failure.incorrect.artifactMetadata.artifactId=The artifact ID in the source artifact metadata is incorrect. +failure.incorrect.artifactMetadata.groupId=The group ID in the source artifact metadata is incorrect. +failure.incorrect.artifactMetadata.versions=The version list in the source artifact metadata is incorrect. + +failure.incorrect.snapshotMetadata.artifactId=The artifact ID in the source artifact version metadata is incorrect. +failure.incorrect.snapshotMetadata.groupId=The group ID in the source artifact version metadata is incorrect. +failure.incorrect.snapshotMetadata.version=The version in the source artifact version metadata is incorrect. +failure.incorrect.snapshotMetadata.snapshot=The snapshot information in the source artifact version metadata is incorrect. diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/converted-artifact-one.pom b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/converted-artifact-one.pom new file mode 100644 index 000000000..cd3862d35 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/converted-artifact-one.pom @@ -0,0 +1,6 @@ + + 4.0.0 + test + artifact-one + 1.0.0 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/converted-artifact-three.pom b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/converted-artifact-three.pom new file mode 100644 index 000000000..343291037 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/converted-artifact-three.pom @@ -0,0 +1,6 @@ + + 4.0.0 + test + artifact-three + 1.0.0 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/converted-artifact-two.pom b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/converted-artifact-two.pom new file mode 100644 index 000000000..227470167 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/converted-artifact-two.pom @@ -0,0 +1,6 @@ + + 4.0.0 + test + artifact-two + 1.0.0 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/converted-v3-snapshot.pom b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/converted-v3-snapshot.pom new file mode 100644 index 000000000..1615b6663 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/converted-v3-snapshot.pom @@ -0,0 +1,28 @@ + + 4.0.0 + test + v3artifact + 1.0.0-SNAPSHOT + + scm:cvs:ext:${maven.username}@localhost:/home/cvs + + + + groupId + artifactId + version + + + groupId + test-artifactId + version + test + + + junit + junit + 3.8.2 + test + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/converted-v3-timestamped-snapshot.pom b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/converted-v3-timestamped-snapshot.pom new file mode 100644 index 000000000..94307d863 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/converted-v3-timestamped-snapshot.pom @@ -0,0 +1,28 @@ + + 4.0.0 + test + v3artifact + 1.0.0-20060105.130101-3 + + scm:cvs:ext:${maven.username}@localhost:/home/cvs + + + + groupId + artifactId + version + + + groupId + test-artifactId + version + test + + + junit + junit + 3.8.2 + test + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/converted-v3-warnings.pom b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/converted-v3-warnings.pom new file mode 100644 index 000000000..25f4e76d0 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/converted-v3-warnings.pom @@ -0,0 +1,28 @@ + + 4.0.0 + test + v3-warnings-artifact + 1.0.0 + + scm:cvs:ext:${maven.username}@localhost:/home/cvs + + + + groupId + artifactId + version + + + groupId + test-artifactId + version + test + + + junit + junit + 3.8.2 + test + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/converted-v3.pom b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/converted-v3.pom new file mode 100644 index 000000000..9f8b63e16 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/converted-v3.pom @@ -0,0 +1,28 @@ + + 4.0.0 + test + v3artifact + 1.0.0 + + scm:cvs:ext:${maven.username}@localhost:/home/cvs + + + + groupId + artifactId + version + + + groupId + test-artifactId + version + test + + + junit + junit + 3.8.2 + test + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/maven-foo-plugin-1.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/maven-foo-plugin-1.0.pom new file mode 100644 index 000000000..17095cc57 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/maven-foo-plugin-1.0.pom @@ -0,0 +1,7 @@ + + 4.0.0 + org.apache.maven.plugins + maven-foo-plugin + 1.0.0 + maven-plugin + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/newversion-artifact-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/newversion-artifact-metadata.xml new file mode 100644 index 000000000..ecc7f09a0 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/newversion-artifact-metadata.xml @@ -0,0 +1,10 @@ + + test + newversion-artifact + + + 1.0.0 + 1.0.1 + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/relocated-test/relocated-v3artifact/1.0.0/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/relocated-test/relocated-v3artifact/1.0.0/maven-metadata.xml new file mode 100644 index 000000000..ebd9be970 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/relocated-test/relocated-v3artifact/1.0.0/maven-metadata.xml @@ -0,0 +1,6 @@ + + relocated-test + relocated-v3artifact + 1.0.0 + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/relocated-test/relocated-v3artifact/1.0.0/relocated-v3artifact-1.0.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/relocated-test/relocated-v3artifact/1.0.0/relocated-v3artifact-1.0.0.jar new file mode 100644 index 000000000..29ef827e8 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/relocated-test/relocated-v3artifact/1.0.0/relocated-v3artifact-1.0.0.jar @@ -0,0 +1 @@ +v3 diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/relocated-test/relocated-v3artifact/1.0.0/relocated-v3artifact-1.0.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/relocated-test/relocated-v3artifact/1.0.0/relocated-v3artifact-1.0.0.pom new file mode 100644 index 000000000..0180549f0 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/relocated-test/relocated-v3artifact/1.0.0/relocated-v3artifact-1.0.0.pom @@ -0,0 +1,28 @@ + + 4.0.0 + relocated-test + relocated-v3artifact + 1.0.0 + + scm:cvs:ext:${maven.username}@localhost:/home/cvs + + + + groupId + artifactId + version + + + groupId + test-artifactId + version + test + + + junit + junit + 3.8.2 + test + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/relocated-test/relocated-v3artifact/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/relocated-test/relocated-v3artifact/maven-metadata.xml new file mode 100644 index 000000000..b4b1a864a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/relocated-test/relocated-v3artifact/maven-metadata.xml @@ -0,0 +1,9 @@ + + relocated-test + relocated-v3artifact + + + 1.0.0 + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/test/relocated-v3artifact/1.0.0/relocated-v3artifact-1.0.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/test/relocated-v3artifact/1.0.0/relocated-v3artifact-1.0.0.pom new file mode 100644 index 000000000..b20f62f9e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/test/relocated-v3artifact/1.0.0/relocated-v3artifact-1.0.0.pom @@ -0,0 +1,12 @@ + + test + relocated-v3artifact + 1.0.0 + + + relocated-test + relocated-v3artifact + 1.0.0 + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/v3-artifact-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/v3-artifact-metadata.xml new file mode 100644 index 000000000..a8a7f3748 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/v3-artifact-metadata.xml @@ -0,0 +1,9 @@ + + test + v3artifact + + + 1.0.0 + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/v3-snapshot-artifact-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/v3-snapshot-artifact-metadata.xml new file mode 100644 index 000000000..24d25a0e0 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/v3-snapshot-artifact-metadata.xml @@ -0,0 +1,9 @@ + + test + v3artifact + + + 1.0.0-SNAPSHOT + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/v3-snapshot-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/v3-snapshot-metadata.xml new file mode 100644 index 000000000..b19c537b5 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/v3-snapshot-metadata.xml @@ -0,0 +1,6 @@ + + test + v3artifact + 1.0.0-SNAPSHOT + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/v3-timestamped-snapshot-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/v3-timestamped-snapshot-metadata.xml new file mode 100644 index 000000000..602c38ec8 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/v3-timestamped-snapshot-metadata.xml @@ -0,0 +1,11 @@ + + test + v3artifact + 1.0.0-SNAPSHOT + + + 20060105.130101 + 3 + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/v3-version-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/v3-version-metadata.xml new file mode 100644 index 000000000..3c8938984 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/v3-version-metadata.xml @@ -0,0 +1,6 @@ + + test + v3artifact + 1.0.0 + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/v4-artifact-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/v4-artifact-metadata.xml new file mode 100644 index 000000000..c0cdbfdb4 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/v4-artifact-metadata.xml @@ -0,0 +1,9 @@ + + test + v4artifact + + + 1.0.0 + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/v4-snapshot-artifact-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/v4-snapshot-artifact-metadata.xml new file mode 100644 index 000000000..f8072b0df --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/v4-snapshot-artifact-metadata.xml @@ -0,0 +1,9 @@ + + test + v4artifact + + + 1.0.0-SNAPSHOT + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/v4-snapshot-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/v4-snapshot-metadata.xml new file mode 100644 index 000000000..d5ecb7d47 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/v4-snapshot-metadata.xml @@ -0,0 +1,6 @@ + + test + v4artifact + 1.0.0-SNAPSHOT + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/v4-timestamped-snapshot-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/v4-timestamped-snapshot-metadata.xml new file mode 100644 index 000000000..060a79cdd --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/v4-timestamped-snapshot-metadata.xml @@ -0,0 +1,11 @@ + + test + v4artifact + 1.0.0-SNAPSHOT + + + 20060111.120115 + 1 + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/v4-version-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/v4-version-metadata.xml new file mode 100644 index 000000000..7cbd8ad3d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/expected-files/v4-version-metadata.xml @@ -0,0 +1,6 @@ + + test + v4artifact + 1.0.0 + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/java/org/apache/maven/archiva/converter/RepositoryConverterTest.java b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/java/org/apache/maven/archiva/converter/RepositoryConverterTest.java new file mode 100644 index 000000000..4dbc2a434 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/java/org/apache/maven/archiva/converter/RepositoryConverterTest.java @@ -0,0 +1,153 @@ +package org.apache.maven.archiva.converter; + +/* + * 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.io.FileUtils; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.converter.legacy.LegacyRepositoryConverter; +import org.apache.maven.artifact.factory.ArtifactFactory; +import org.apache.maven.artifact.repository.ArtifactRepository; +import org.apache.maven.artifact.repository.ArtifactRepositoryFactory; +import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout; +import org.codehaus.plexus.i18n.I18N; +import org.codehaus.plexus.spring.PlexusInSpringTestCase; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * Test the repository converter. + * + * @author Brett Porter + * @todo what about deletions from the source repository? + * @todo use artifact-test instead + * @todo should reject if dependencies are missing - rely on reporting? + * @todo group metadata + */ +public class RepositoryConverterTest + extends PlexusInSpringTestCase +{ + private ArtifactRepository sourceRepository; + + private ManagedRepositoryConfiguration targetRepository; + + private LegacyRepositoryConverter repositoryConverter; + + private ArtifactFactory artifactFactory; + + private static final int SLEEP_MILLIS = 100; + + private I18N i18n; + + protected void setUp() + throws Exception + { + super.setUp(); + + ArtifactRepositoryFactory factory = (ArtifactRepositoryFactory) lookup( ArtifactRepositoryFactory.ROLE ); + + ArtifactRepositoryLayout layout = (ArtifactRepositoryLayout) lookup( ArtifactRepositoryLayout.ROLE, "legacy" ); + + File sourceBase = getTestFile( "src/test/source-repository" ); + sourceRepository = factory.createArtifactRepository( "source", sourceBase.toURL().toString(), layout, null, + null ); + + layout = (ArtifactRepositoryLayout) lookup( ArtifactRepositoryLayout.ROLE, "default" ); + + File targetBase = getTestFile( "target/test-target-repository" ); + copyDirectoryStructure( getTestFile( "src/test/target-repository" ), targetBase ); + + targetRepository = new ManagedRepositoryConfiguration(); + targetRepository.setId( "target" ); + targetRepository.setName( "Target Repo" ); + targetRepository.setLocation( targetBase.getAbsolutePath() ); + targetRepository.setLayout( "default" ); + + repositoryConverter = (LegacyRepositoryConverter) lookup( LegacyRepositoryConverter.ROLE, "default" ); + + artifactFactory = (ArtifactFactory) lookup( ArtifactFactory.ROLE ); + + i18n = (I18N) lookup( I18N.ROLE ); + } + + protected void tearDown() + throws Exception + { + super.tearDown(); + } + + private void copyDirectoryStructure( File sourceDirectory, File destinationDirectory ) + throws IOException + { + if ( !sourceDirectory.exists() ) + { + throw new IOException( "Source directory doesn't exists (" + sourceDirectory.getAbsolutePath() + ")." ); + } + + File[] files = sourceDirectory.listFiles(); + + String sourcePath = sourceDirectory.getAbsolutePath(); + + for ( int i = 0; i < files.length; i++ ) + { + File file = files[i]; + + String dest = file.getAbsolutePath(); + + dest = dest.substring( sourcePath.length() + 1 ); + + File destination = new File( destinationDirectory, dest ); + + if ( file.isFile() ) + { + destination = destination.getParentFile(); + + FileUtils.copyFileToDirectory( file, destination ); + } + else if ( file.isDirectory() ) + { + if ( !".svn".equals( file.getName() ) ) + { + if ( !destination.exists() && !destination.mkdirs() ) + { + throw new IOException( "Could not create destination directory '" + + destination.getAbsolutePath() + "'." ); + } + copyDirectoryStructure( file, destination ); + } + } + else + { + throw new IOException( "Unknown file type: " + file.getAbsolutePath() ); + } + } + } + + public void testLegacyConversion() + throws IOException, RepositoryConversionException + { + File legacyRepoDir = new File( sourceRepository.getBasedir() ); + File destRepoDir = new File( targetRepository.getLocation() ); + List excludes = new ArrayList(); + repositoryConverter.convertLegacyRepository( legacyRepoDir, destRepoDir, excludes ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/resources/log4j.properties b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/resources/log4j.properties new file mode 100644 index 000000000..9b2c26ade --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/resources/log4j.properties @@ -0,0 +1,10 @@ +# Set root logger level to DEBUG and its only appender to A1. +log4j.rootLogger=WARN, A1 + +# A1 is set to be a ConsoleAppender. +log4j.appender.A1=org.apache.log4j.ConsoleAppender + +# A1 uses PatternLayout. +log4j.appender.A1.layout=org.apache.log4j.PatternLayout +log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/resources/org/apache/maven/archiva/converter/RepositoryConverterTest.xml b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/resources/org/apache/maven/archiva/converter/RepositoryConverterTest.xml new file mode 100644 index 000000000..b1cf9640a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/resources/org/apache/maven/archiva/converter/RepositoryConverterTest.xml @@ -0,0 +1,125 @@ + + + + + + + + org.apache.maven.archiva.converter.RepositoryConverter + org.apache.maven.archiva.converter.DefaultRepositoryConverter + force-repository-converter + + true + + + + org.codehaus.plexus.digest.Digester + digesters + + + org.apache.maven.artifact.factory.ArtifactFactory + artifactFactory + + + org.codehaus.plexus.i18n.I18N + i18n + + + + + org.apache.maven.archiva.converter.RepositoryConverter + org.apache.maven.archiva.converter.DefaultRepositoryConverter + dryrun-repository-converter + + true + + + + org.codehaus.plexus.digest.Digester + digesters + + + org.apache.maven.artifact.factory.ArtifactFactory + artifactFactory + + + org.codehaus.plexus.i18n.I18N + i18n + + + + + + + org.codehaus.plexus.jdo.JdoFactory + archiva + org.codehaus.plexus.jdo.DefaultConfigurableJdoFactory + + + + org.hsqldb.jdbcDriver + jdbc:hsqldb:mem:TESTDB + sa + + + + org.jpox.PersistenceManagerFactoryImpl + + + javax.jdo.PersistenceManagerFactoryClass + org.jpox.PersistenceManagerFactoryImpl + + + org.jpox.autoCreateSchema + true + + + org.jpox.validateTables + false + + + org.jpox.validateConstraints + false + + + org.jpox.validateColumns + false + + + org.jpox.autoStartMechanism + None + + + org.jpox.transactionIsolation + READ_UNCOMMITTED + + + org.jpox.poid.transactionIsolation + READ_UNCOMMITTED + + + org.jpox.rdbms.dateTimezone + JDK_DEFAULT_TIMEZONE + + + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-modern-repository/test/incorrectArtifactMetadata/1.0.0/incorrectArtifactMetadata-1.0.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-modern-repository/test/incorrectArtifactMetadata/1.0.0/incorrectArtifactMetadata-1.0.0.jar new file mode 100644 index 000000000..72af4bc10 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-modern-repository/test/incorrectArtifactMetadata/1.0.0/incorrectArtifactMetadata-1.0.0.jar @@ -0,0 +1 @@ +incorrectMd5 diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-modern-repository/test/incorrectArtifactMetadata/1.0.0/incorrectArtifactMetadata-1.0.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-modern-repository/test/incorrectArtifactMetadata/1.0.0/incorrectArtifactMetadata-1.0.0.pom new file mode 100644 index 000000000..b64e1d0f0 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-modern-repository/test/incorrectArtifactMetadata/1.0.0/incorrectArtifactMetadata-1.0.0.pom @@ -0,0 +1,25 @@ + + + + 3 + incorrectArtifactMetadata + test + 1.0.0 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-modern-repository/test/incorrectArtifactMetadata/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-modern-repository/test/incorrectArtifactMetadata/maven-metadata.xml new file mode 100644 index 000000000..b393bcd3d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-modern-repository/test/incorrectArtifactMetadata/maven-metadata.xml @@ -0,0 +1,29 @@ + + + + + test + incorrectArtifactMetadata + + + 0.9 + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-modern-repository/test/incorrectSnapshotMetadata/1.0.0-SNAPSHOT/incorrectSnapshotMetadata-1.0.0-20060102.030405-6.jar b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-modern-repository/test/incorrectSnapshotMetadata/1.0.0-SNAPSHOT/incorrectSnapshotMetadata-1.0.0-20060102.030405-6.jar new file mode 100644 index 000000000..72af4bc10 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-modern-repository/test/incorrectSnapshotMetadata/1.0.0-SNAPSHOT/incorrectSnapshotMetadata-1.0.0-20060102.030405-6.jar @@ -0,0 +1 @@ +incorrectMd5 diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-modern-repository/test/incorrectSnapshotMetadata/1.0.0-SNAPSHOT/incorrectSnapshotMetadata-1.0.0-20060102.030405-6.pom b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-modern-repository/test/incorrectSnapshotMetadata/1.0.0-SNAPSHOT/incorrectSnapshotMetadata-1.0.0-20060102.030405-6.pom new file mode 100644 index 000000000..929190af2 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-modern-repository/test/incorrectSnapshotMetadata/1.0.0-SNAPSHOT/incorrectSnapshotMetadata-1.0.0-20060102.030405-6.pom @@ -0,0 +1,25 @@ + + + + 3 + incorrectSnapshotMetadata + test + 1.0.0-20060102.030405-6 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-modern-repository/test/incorrectSnapshotMetadata/1.0.0-SNAPSHOT/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-modern-repository/test/incorrectSnapshotMetadata/1.0.0-SNAPSHOT/maven-metadata.xml new file mode 100644 index 000000000..5980278b3 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-modern-repository/test/incorrectSnapshotMetadata/1.0.0-SNAPSHOT/maven-metadata.xml @@ -0,0 +1,31 @@ + + + + + test + incorrectSnapshotMetadata + 1.0.0-SNAPSHOT + + + 10 + 20060102.040506 + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-modern-repository/test/incorrectSnapshotMetadata/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-modern-repository/test/incorrectSnapshotMetadata/maven-metadata.xml new file mode 100644 index 000000000..3f9a0cef2 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-modern-repository/test/incorrectSnapshotMetadata/maven-metadata.xml @@ -0,0 +1,29 @@ + + + + + test + incorrectSnapshotMetadata + + + 1.0.0-SNAPSHOT + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/artifact-one-1.0.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/artifact-one-1.0.0.jar new file mode 100644 index 000000000..5626abf0f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/artifact-one-1.0.0.jar @@ -0,0 +1 @@ +one diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/artifact-three-1.0.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/artifact-three-1.0.0.jar new file mode 100644 index 000000000..2bdf67abb --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/artifact-three-1.0.0.jar @@ -0,0 +1 @@ +three diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/artifact-two-1.0.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/artifact-two-1.0.0.jar new file mode 100644 index 000000000..f719efd43 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/artifact-two-1.0.0.jar @@ -0,0 +1 @@ +two diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/dryrun-artifact-1.0.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/dryrun-artifact-1.0.0.jar new file mode 100644 index 000000000..cbaf024e5 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/dryrun-artifact-1.0.0.jar @@ -0,0 +1 @@ +existing diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/existing-artifact-1.0.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/existing-artifact-1.0.0.jar new file mode 100644 index 000000000..cbaf024e5 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/existing-artifact-1.0.0.jar @@ -0,0 +1 @@ +existing diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/incorrectMd5Artifact-1.0.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/incorrectMd5Artifact-1.0.0.jar new file mode 100644 index 000000000..72af4bc10 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/incorrectMd5Artifact-1.0.0.jar @@ -0,0 +1 @@ +incorrectMd5 diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/incorrectMd5Artifact-1.0.0.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/incorrectMd5Artifact-1.0.0.jar.md5 new file mode 100644 index 000000000..316d9a4eb --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/incorrectMd5Artifact-1.0.0.jar.md5 @@ -0,0 +1 @@ +379dcfcd1e6312cc859111f696047eb4 diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/incorrectSha1Artifact-1.0.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/incorrectSha1Artifact-1.0.0.jar new file mode 100644 index 000000000..f5812f3e5 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/incorrectSha1Artifact-1.0.0.jar @@ -0,0 +1 @@ +incorrectSha1 diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/incorrectSha1Artifact-1.0.0.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/incorrectSha1Artifact-1.0.0.jar.sha1 new file mode 100644 index 000000000..cce322eb2 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/incorrectSha1Artifact-1.0.0.jar.sha1 @@ -0,0 +1 @@ +52e07b82d944741f66bba5896d4cd74e9879e289 diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/modified-artifact-1.0.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/modified-artifact-1.0.0.jar new file mode 100644 index 000000000..2e0996000 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/modified-artifact-1.0.0.jar @@ -0,0 +1 @@ +modified diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/newversion-artifact-1.0.1.jar b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/newversion-artifact-1.0.1.jar new file mode 100644 index 000000000..c694117fd --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/newversion-artifact-1.0.1.jar @@ -0,0 +1 @@ +v4 diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/noPomArtifact-1.0.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/noPomArtifact-1.0.0.jar new file mode 100644 index 000000000..3d27acdcc --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/noPomArtifact-1.0.0.jar @@ -0,0 +1 @@ +noPom diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/relocated-v3artifact-1.0.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/relocated-v3artifact-1.0.0.jar new file mode 100644 index 000000000..29ef827e8 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/relocated-v3artifact-1.0.0.jar @@ -0,0 +1 @@ +v3 diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/rollback-created-artifact-1.0.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/rollback-created-artifact-1.0.0.jar new file mode 100644 index 000000000..29ef827e8 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/rollback-created-artifact-1.0.0.jar @@ -0,0 +1 @@ +v3 diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/unmodified-artifact-1.0.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/unmodified-artifact-1.0.0.jar new file mode 100644 index 000000000..27597bc21 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/unmodified-artifact-1.0.0.jar @@ -0,0 +1 @@ +unmodified diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/v3-warnings-artifact-1.0.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/v3-warnings-artifact-1.0.0.jar new file mode 100644 index 000000000..29ef827e8 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/v3-warnings-artifact-1.0.0.jar @@ -0,0 +1 @@ +v3 diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/v3artifact-1.0.0-20060105.130101-3.jar b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/v3artifact-1.0.0-20060105.130101-3.jar new file mode 100644 index 000000000..29ef827e8 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/v3artifact-1.0.0-20060105.130101-3.jar @@ -0,0 +1 @@ +v3 diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/v3artifact-1.0.0-SNAPSHOT.jar b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/v3artifact-1.0.0-SNAPSHOT.jar new file mode 100644 index 000000000..29ef827e8 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/v3artifact-1.0.0-SNAPSHOT.jar @@ -0,0 +1 @@ +v3 diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/v3artifact-1.0.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/v3artifact-1.0.0.jar new file mode 100644 index 000000000..29ef827e8 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/v3artifact-1.0.0.jar @@ -0,0 +1 @@ +v3 diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/v4artifact-1.0.0-20060111.120115-1.jar b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/v4artifact-1.0.0-20060111.120115-1.jar new file mode 100644 index 000000000..29ef827e8 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/v4artifact-1.0.0-20060111.120115-1.jar @@ -0,0 +1 @@ +v3 diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/v4artifact-1.0.0-SNAPSHOT.jar b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/v4artifact-1.0.0-SNAPSHOT.jar new file mode 100644 index 000000000..29ef827e8 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/v4artifact-1.0.0-SNAPSHOT.jar @@ -0,0 +1 @@ +v3 diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/v4artifact-1.0.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/v4artifact-1.0.0.jar new file mode 100644 index 000000000..c694117fd --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/v4artifact-1.0.0.jar @@ -0,0 +1 @@ +v4 diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/v4artifact-1.0.0.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/v4artifact-1.0.0.jar.md5 new file mode 100644 index 000000000..1930bc6d3 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/v4artifact-1.0.0.jar.md5 @@ -0,0 +1 @@ +4289bbdd6fba75013b317b2f9a540736 *v4artifact-1.0.0.jar diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/v4artifact-1.0.0.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/v4artifact-1.0.0.jar.sha1 new file mode 100644 index 000000000..466f209a7 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/jars/v4artifact-1.0.0.jar.sha1 @@ -0,0 +1 @@ +e3e4159da65a4257f0bffb7cac8e3e78241a4dca *v4artifact-1.0.0.jar diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/plugins/maven-foo-plugin-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/plugins/maven-foo-plugin-1.0.jar new file mode 100644 index 000000000..5626abf0f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/plugins/maven-foo-plugin-1.0.jar @@ -0,0 +1 @@ +one diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/artifact-one-1.0.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/artifact-one-1.0.0.pom new file mode 100644 index 000000000..cd3862d35 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/artifact-one-1.0.0.pom @@ -0,0 +1,6 @@ + + 4.0.0 + test + artifact-one + 1.0.0 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/artifact-three-1.0.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/artifact-three-1.0.0.pom new file mode 100644 index 000000000..343291037 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/artifact-three-1.0.0.pom @@ -0,0 +1,6 @@ + + 4.0.0 + test + artifact-three + 1.0.0 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/artifact-two-1.0.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/artifact-two-1.0.0.pom new file mode 100644 index 000000000..227470167 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/artifact-two-1.0.0.pom @@ -0,0 +1,6 @@ + + 4.0.0 + test + artifact-two + 1.0.0 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/dryrun-artifact-1.0.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/dryrun-artifact-1.0.0.pom new file mode 100644 index 000000000..1953c5523 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/dryrun-artifact-1.0.0.pom @@ -0,0 +1,22 @@ + + + + 4.0.0 + dryrun-artifact + test + 1.0.0 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/incorrectMd5Artifact-1.0.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/incorrectMd5Artifact-1.0.0.pom new file mode 100644 index 000000000..74d5e12b4 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/incorrectMd5Artifact-1.0.0.pom @@ -0,0 +1,6 @@ + + 3 + incorrectMd5Artifact + test + 1.0.0 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/incorrectSha1Artifact-1.0.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/incorrectSha1Artifact-1.0.0.pom new file mode 100644 index 000000000..fe3c7fd91 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/incorrectSha1Artifact-1.0.0.pom @@ -0,0 +1,6 @@ + + 3 + incorrectSha1Artifact + test + 1.0.0 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/maven-foo-plugin-1.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/maven-foo-plugin-1.0.pom new file mode 100644 index 000000000..a5a02c42d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/maven-foo-plugin-1.0.pom @@ -0,0 +1,6 @@ + + 3 + maven-foo-plugin + org.apache.maven.plugins + 1.0 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/modified-artifact-1.0.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/modified-artifact-1.0.0.pom new file mode 100644 index 000000000..fcfdaacb4 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/modified-artifact-1.0.0.pom @@ -0,0 +1,22 @@ + + + + 4.0.0 + modified-artifact + test + 1.0.0 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/newversion-artifact-1.0.1.pom b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/newversion-artifact-1.0.1.pom new file mode 100644 index 000000000..f441c9a46 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/newversion-artifact-1.0.1.pom @@ -0,0 +1,22 @@ + + + + 4.0.0 + test + newversoin-artifact + 1.0.1 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/relocated-v3artifact-1.0.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/relocated-v3artifact-1.0.0.pom new file mode 100644 index 000000000..ab112a296 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/relocated-v3artifact-1.0.0.pom @@ -0,0 +1,27 @@ + + 3 + relocated-v3artifact + test + 1.0.0 + + + groupId + artifactId + version + + + groupId + test-artifactId + version + + test + + + + + scm:cvs:ext:${maven.username}@localhost:/home/cvs + + + relocated-test + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/rollback-created-artifact-1.0.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/rollback-created-artifact-1.0.0.pom new file mode 100644 index 000000000..00692be72 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/rollback-created-artifact-1.0.0.pom @@ -0,0 +1,39 @@ + + + + 3 + v3artifact + test + 1.0.0 + + + groupId + artifactId + version + + + groupId + test-artifactId + version + + test + + + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/unmodified-artifact-1.0.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/unmodified-artifact-1.0.0.pom new file mode 100644 index 000000000..a8428a8a4 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/unmodified-artifact-1.0.0.pom @@ -0,0 +1,25 @@ + + + + 4.0.0 + unmodified-artifact + test + 1.0.0 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/v3-warnings-artifact-1.0.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/v3-warnings-artifact-1.0.0.pom new file mode 100644 index 000000000..5f347f371 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/v3-warnings-artifact-1.0.0.pom @@ -0,0 +1,48 @@ + + + + 3 + ../project.xml + v3-warnings-artifact + test + 1.0.0 + + + 1.0 + 1.0 + 1_0 + + + + + groupId + artifactId + version + + + groupId + test-artifactId + version + + test + + + + + scm:cvs:ext:${maven.username}@localhost:/home/cvs + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/v3artifact-1.0.0-20060105.130101-3.pom b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/v3artifact-1.0.0-20060105.130101-3.pom new file mode 100644 index 000000000..d7ae8953b --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/v3artifact-1.0.0-20060105.130101-3.pom @@ -0,0 +1,40 @@ + + + + 3 + v3artifact + test + 1.0.0-20060105.130101-3 + + + groupId + artifactId + version + + + groupId + test-artifactId + version + + test + + + + + scm:cvs:ext:${maven.username}@localhost:/home/cvs + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/v3artifact-1.0.0-SNAPSHOT.pom b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/v3artifact-1.0.0-SNAPSHOT.pom new file mode 100644 index 000000000..3958a3358 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/v3artifact-1.0.0-SNAPSHOT.pom @@ -0,0 +1,40 @@ + + + + 3 + v3artifact + test + 1.0.0-SNAPSHOT + + + groupId + artifactId + version + + + groupId + test-artifactId + version + + test + + + + + scm:cvs:ext:${maven.username}@localhost:/home/cvs + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/v3artifact-1.0.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/v3artifact-1.0.0.pom new file mode 100644 index 000000000..5aed3437a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/v3artifact-1.0.0.pom @@ -0,0 +1,24 @@ + + 3 + v3artifact + test + 1.0.0 + + + groupId + artifactId + version + + + groupId + test-artifactId + version + + test + + + + + scm:cvs:ext:${maven.username}@localhost:/home/cvs + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/v4artifact-1.0.0-20060111.120115-1.pom b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/v4artifact-1.0.0-20060111.120115-1.pom new file mode 100644 index 000000000..e4f36566a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/v4artifact-1.0.0-20060111.120115-1.pom @@ -0,0 +1,22 @@ + + + + 4.0.0 + test + v4artifact + 1.0.0-20060111.120115-1 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/v4artifact-1.0.0-SNAPSHOT.pom b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/v4artifact-1.0.0-SNAPSHOT.pom new file mode 100644 index 000000000..be5b8b7e2 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/v4artifact-1.0.0-SNAPSHOT.pom @@ -0,0 +1,22 @@ + + + + 4.0.0 + test + v4artifact + 1.0.0-SNAPSHOT + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/v4artifact-1.0.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/v4artifact-1.0.0.pom new file mode 100644 index 000000000..fa6e82b1e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/source-repository/test/poms/v4artifact-1.0.0.pom @@ -0,0 +1,6 @@ + + 4.0.0 + test + v4artifact + 1.0.0 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/target-repository/test/modified-artifact/1.0.0/modified-artifact-1.0.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/target-repository/test/modified-artifact/1.0.0/modified-artifact-1.0.0.jar new file mode 100644 index 000000000..27597bc21 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/target-repository/test/modified-artifact/1.0.0/modified-artifact-1.0.0.jar @@ -0,0 +1 @@ +unmodified diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/target-repository/test/modified-artifact/1.0.0/modified-artifact-1.0.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/target-repository/test/modified-artifact/1.0.0/modified-artifact-1.0.0.pom new file mode 100644 index 000000000..d23afd027 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/target-repository/test/modified-artifact/1.0.0/modified-artifact-1.0.0.pom @@ -0,0 +1,25 @@ + + + + 4.0.0 + modified-artifact + test + 1.0.0 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/target-repository/test/newversion-artifact/1.0.0/newversion-artifact-1.0.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/target-repository/test/newversion-artifact/1.0.0/newversion-artifact-1.0.0.jar new file mode 100644 index 000000000..27597bc21 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/target-repository/test/newversion-artifact/1.0.0/newversion-artifact-1.0.0.jar @@ -0,0 +1 @@ +unmodified diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/target-repository/test/newversion-artifact/1.0.0/newversion-artifact-1.0.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/target-repository/test/newversion-artifact/1.0.0/newversion-artifact-1.0.0.pom new file mode 100644 index 000000000..e21492ebf --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/target-repository/test/newversion-artifact/1.0.0/newversion-artifact-1.0.0.pom @@ -0,0 +1,25 @@ + + + + 4.0.0 + newversion-artifact + test + 1.0.0 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/target-repository/test/newversion-artifact/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/target-repository/test/newversion-artifact/maven-metadata.xml new file mode 100644 index 000000000..42537e4c5 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/target-repository/test/newversion-artifact/maven-metadata.xml @@ -0,0 +1,29 @@ + + + + + test + newversion-artifact + + + 1.0.0 + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/target-repository/test/unmodified-artifact/1.0.0/unmodified-artifact-1.0.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/target-repository/test/unmodified-artifact/1.0.0/unmodified-artifact-1.0.0.jar new file mode 100644 index 000000000..27597bc21 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/target-repository/test/unmodified-artifact/1.0.0/unmodified-artifact-1.0.0.jar @@ -0,0 +1 @@ +unmodified diff --git a/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/target-repository/test/unmodified-artifact/1.0.0/unmodified-artifact-1.0.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/target-repository/test/unmodified-artifact/1.0.0/unmodified-artifact-1.0.0.pom new file mode 100644 index 000000000..a8428a8a4 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-converter/src/test/target-repository/test/unmodified-artifact/1.0.0/unmodified-artifact-1.0.0.pom @@ -0,0 +1,25 @@ + + + + 4.0.0 + unmodified-artifact + test + 1.0.0 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/pom.xml b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/pom.xml new file mode 100644 index 000000000..9e629bd28 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/pom.xml @@ -0,0 +1,61 @@ + + + + + + org.apache.archiva + archiva-base + 1.2-SNAPSHOT + + 4.0.0 + archiva-dependency-graph + Archiva Base :: Dependency Graph + + + org.codehaus.plexus + plexus-spring + test + + + commons-collections + commons-collections + + + org.apache.archiva + archiva-model + + + + + + org.codehaus.plexus + plexus-maven-plugin + + + descriptor + + descriptor + + + + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/DependencyGraphFactory.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/DependencyGraphFactory.java new file mode 100644 index 000000000..3b20c858e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/DependencyGraphFactory.java @@ -0,0 +1,198 @@ +package org.apache.maven.archiva.dependency; + +/* + * 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.archiva.dependency.graph.DependencyGraph; +import org.apache.maven.archiva.dependency.graph.DependencyGraphBuilder; +import org.apache.maven.archiva.dependency.graph.GraphListener; +import org.apache.maven.archiva.dependency.graph.GraphPhaseEvent; +import org.apache.maven.archiva.dependency.graph.GraphTask; +import org.apache.maven.archiva.dependency.graph.GraphTaskException; +import org.apache.maven.archiva.dependency.graph.PotentialCyclicEdgeProducer; +import org.apache.maven.archiva.dependency.graph.tasks.FlagCyclicEdgesTask; +import org.apache.maven.archiva.dependency.graph.tasks.FlagExcludedEdgesTask; +import org.apache.maven.archiva.dependency.graph.tasks.PopulateGraphMasterTask; +import org.apache.maven.archiva.dependency.graph.tasks.ReduceEnabledEdgesTask; +import org.apache.maven.archiva.dependency.graph.tasks.ReduceScopeTask; +import org.apache.maven.archiva.dependency.graph.tasks.ReduceTransitiveEdgesTask; +import org.apache.maven.archiva.dependency.graph.tasks.RefineConflictsTask; +import org.apache.maven.archiva.dependency.graph.tasks.UpdateScopesTask; +import org.apache.maven.archiva.model.DependencyScope; +import org.apache.maven.archiva.model.VersionedReference; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +/** + * DependencyGraphFactory + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class DependencyGraphFactory +{ + private GraphTask taskFlagCyclicEdges; + + private PopulateGraphMasterTask taskPopulateGraph; + + private ReduceScopeTask taskReduceScope; + + private List listeners; + + private DependencyGraphBuilder graphBuilder; + + private List tasks; + + public DependencyGraphFactory() + { + listeners = new ArrayList(); + + taskFlagCyclicEdges = new FlagCyclicEdgesTask(); + taskPopulateGraph = new PopulateGraphMasterTask(); + taskReduceScope = new ReduceScopeTask( DependencyScope.TEST ); + + tasks = new ArrayList(); + + /* Take the basic graph, and expand the nodes fully, including depman. + */ + tasks.add( taskPopulateGraph ); + + /* Identify, flag, and disable excluded edges. + */ + tasks.add( new FlagExcludedEdgesTask() ); + + /* Reduce the edges of the graph to only those that are enabled. + */ + tasks.add( new ReduceEnabledEdgesTask() ); + + /* Identify dependencies that conflict, resolve to single node. + * + * This will ... + * 1) filter the distant conflicts away for the nearer ones. + * 2) same distance nodes will pick 'newest' version. + * + * This can cause a collapsing of node versions. + */ + tasks.add( new RefineConflictsTask() ); + + /* Reduce the scope of the graph to those visible by the 'test' scope. + */ + tasks.add( taskReduceScope ); + + /* Reduce the edges of the graph. Use the transitive reduction algorithm + * to remove redundant edges. + */ + tasks.add( new ReduceTransitiveEdgesTask() ); + + /* Update the scopes of the edges to conform to the parent setting. + */ + tasks.add( new UpdateScopesTask() ); + } + + public void addGraphListener( GraphListener listener ) + { + this.listeners.add( listener ); + } + + /** + * Get the Graph for a specific Versioned Project Reference. + * + * @param versionedProjectReference + * @return + */ + public DependencyGraph getGraph( VersionedReference versionedProjectReference ) + throws GraphTaskException + { + DependencyGraph graph = graphBuilder.createGraph( versionedProjectReference ); + + triggerGraphPhase( GraphPhaseEvent.GRAPH_NEW, null, graph ); + + Iterator it = this.tasks.iterator(); + while ( it.hasNext() ) + { + GraphTask task = (GraphTask) it.next(); + try + { + triggerGraphPhase( GraphPhaseEvent.GRAPH_TASK_PRE, task, graph ); + task.executeTask( graph ); + if ( task instanceof PotentialCyclicEdgeProducer ) + { + taskFlagCyclicEdges.executeTask( graph ); + } + triggerGraphPhase( GraphPhaseEvent.GRAPH_TASK_POST, task, graph ); + } + catch ( GraphTaskException e ) + { + triggerGraphError( e, graph ); + throw e; + } + catch ( Exception e ) + { + GraphTaskException gte = new GraphTaskException( e.getMessage(), e ); + triggerGraphError( gte, graph ); + throw gte; + } + } + + triggerGraphPhase( GraphPhaseEvent.GRAPH_DONE, null, graph ); + + return graph; + } + + public void removeGraphListener( GraphListener listener ) + { + this.listeners.remove( listener ); + } + + public void setDesiredScope( String scope ) + { + taskReduceScope.setScope( scope ); + } + + public void setGraphBuilder( DependencyGraphBuilder graphBuilder ) + { + this.graphBuilder = graphBuilder; + taskPopulateGraph.setBuilder( graphBuilder ); + } + + private void triggerGraphError( GraphTaskException e, DependencyGraph graph ) + { + Iterator it = listeners.iterator(); + while ( it.hasNext() ) + { + GraphListener listener = (GraphListener) it.next(); + listener.graphError( e, graph ); + } + } + + private void triggerGraphPhase( int type, GraphTask task, DependencyGraph graph ) + { + GraphPhaseEvent evt = new GraphPhaseEvent( type, task, graph ); + + Iterator it = listeners.iterator(); + while ( it.hasNext() ) + { + GraphListener listener = (GraphListener) it.next(); + listener.graphPhaseEvent( evt ); + } + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/DependencyGraph.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/DependencyGraph.java new file mode 100644 index 000000000..43a470cab --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/DependencyGraph.java @@ -0,0 +1,228 @@ +package org.apache.maven.archiva.dependency.graph; + +/* + * 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.collections.CollectionUtils; +import org.apache.commons.collections.map.ListOrderedMap; +import org.apache.maven.archiva.dependency.graph.functors.EdgeFromPredicate; +import org.apache.maven.archiva.dependency.graph.functors.EdgeToPredicate; +import org.apache.maven.archiva.model.ArtifactReference; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +/** + * DependencyGraph + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class DependencyGraph +{ + public static final int DISABLED_CYCLIC = 0; + + public static final int DISABLED_EXCLUDED = 1; + + public static final int DISABLED_OPTIONAL = 2; + + public static final int DISABLED_NEARER_DEP = 3; + + public static final int DISABLED_NEARER_EDGE = 4; + + private DependencyGraphNode rootNode; + + private Set edges = new HashSet(); + + private ListOrderedMap nodes = new ListOrderedMap(); + + public DependencyGraph( String groupId, String artifactId, String version ) + { + ArtifactReference rootRef = new ArtifactReference(); + rootRef.setGroupId( groupId ); + rootRef.setArtifactId( artifactId ); + rootRef.setVersion( version ); + rootRef.setClassifier( "" ); + rootRef.setType( "pom" ); + + this.rootNode = new DependencyGraphNode( rootRef ); + } + + public DependencyGraph( DependencyGraphNode root ) + { + this.rootNode = root; + } + + public Collection getEdges() + { + return edges; + } + + public Collection getNodes() + { + return nodes.values(); + } + + public DependencyGraphNode getRootNode() + { + return rootNode; + } + + public void setRootNode( DependencyGraphNode rootNode ) + { + this.rootNode = rootNode; + } + + /** + * Add the edge to the {@link DependencyGraph}. + * + * @param edge the edge to add. + */ + public void addEdge( final DependencyGraphEdge edge ) + { + if ( edge.getNodeFrom() == null ) + { + throw new IllegalArgumentException( "edge.nodeFrom cannot be null." ); + } + + if ( edge.getNodeTo() == null ) + { + throw new IllegalArgumentException( "edge.nodeTo cannot be null." ); + } + + this.edges.add( edge ); + } + + public DependencyGraphNode addNode( DependencyGraphNode node ) + { + if ( node == null ) + { + throw new IllegalArgumentException( "Unable to add a null node." ); + } + + if ( node.getArtifact() == null ) + { + throw new IllegalArgumentException( "Unable to add a node with a null artifact reference." ); + } + + int prevNodeIdx = this.nodes.indexOf( node ); + + // Found it in the node tree? + if ( prevNodeIdx >= 0 ) + { + // Merge new node into existing node. + DependencyGraphNode previousNode = (DependencyGraphNode) this.nodes.get( prevNodeIdx ); + + if ( CollectionUtils.isNotEmpty( node.getExcludes() ) ) + { + previousNode.getExcludes().addAll( node.getExcludes() ); + } + + if ( CollectionUtils.isNotEmpty( node.getDependencyManagement() ) ) + { + previousNode.getDependencyManagement().addAll( node.getDependencyManagement() ); + } + + if ( node.isFromParent() ) + { + previousNode.setFromParent( true ); + } + + // Return newly merged node (from existing node) + return previousNode; + } + + // This is a new node, didn't exist before, just save it. + this.nodes.put( node.getArtifact(), node ); + + return node; + } + + public boolean hasNode( DependencyGraphNode node ) + { + return this.nodes.containsKey( node.getArtifact() ); + } + + public boolean hasEdge( DependencyGraphEdge edge ) + { + return this.edges.contains( edge ); + } + + /** + * Get the list of edges from the provided node. + * + * @param node the node to use as the 'from' side of an edge. + * @return the edges from the provided node. + */ + public List getEdgesFrom( DependencyGraphNode node ) + { + List ret = new ArrayList(); + CollectionUtils.select( this.edges, new EdgeFromPredicate( node.getArtifact() ), ret ); + return ret; + } + + /** + * Get the list of edges to the provided node. + * + * @param node the node to use as the 'to' side of an edge. + * @return the edges to the provided node. + */ + public List getEdgesTo( DependencyGraphNode node ) + { + List ret = new ArrayList(); + CollectionUtils.select( this.edges, new EdgeToPredicate( node.getArtifact() ), ret ); + return ret; + } + + /** + * Get the node for the specified artifact reference. + * + * @param ref the artifact reference to use to find the node. + * @return the node that was found. (null if not found) + */ + public DependencyGraphNode getNode( ArtifactReference ref ) + { + return (DependencyGraphNode) this.nodes.get( ref ); + } + + public void removeEdge( DependencyGraphEdge edge ) + { + this.edges.remove( edge ); + } + + public void removeNode( DependencyGraphNode node ) + { + List edges = getEdgesFrom( node ); + if ( !edges.isEmpty() ) + { + System.out.println( "Removing node left <" + edges + "> hanging edges." ); + } + + edges = getEdgesTo( node ); + if ( !edges.isEmpty() ) + { + System.out.println( "Removing node left <" + edges + "> hanging edges." ); + } + + this.nodes.remove( node.getArtifact() ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/DependencyGraphBuilder.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/DependencyGraphBuilder.java new file mode 100644 index 000000000..b194a5798 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/DependencyGraphBuilder.java @@ -0,0 +1,51 @@ +package org.apache.maven.archiva.dependency.graph; + +/* + * 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.archiva.model.VersionedReference; + +/** + * DependencyGraphBuilder + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public interface DependencyGraphBuilder +{ + /** + * Given a node and a versioned project rexpandeference, resolve the details of the node, creating + * any dependencies and edges as needed. + * + * @param graph the graph to add nodes and edges to. + * @param node the node where the resolution should occur. + * @param versionedProjectReference the versioned project reference for the node + * that needs to be resolved. + */ + public void resolveNode( DependencyGraph graph, DependencyGraphNode node, + VersionedReference versionedProjectReference ); + + /** + * Create a new graph, with the root of the graph for the node specified. + * + * @param versionedProjectReference the root node for the graph. + * @return the new DependencyGraph, complete with root node and direct dependencies. + */ + public DependencyGraph createGraph( VersionedReference versionedProjectReference ); +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/DependencyGraphEdge.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/DependencyGraphEdge.java new file mode 100644 index 000000000..a0c98fbe5 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/DependencyGraphEdge.java @@ -0,0 +1,188 @@ +package org.apache.maven.archiva.dependency.graph; + +/* + * 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.archiva.model.ArtifactReference; +import org.apache.maven.archiva.model.DependencyScope; + +/** + * DependencyGraphEdge + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class DependencyGraphEdge +{ + private ArtifactReference nodeFrom; + + private ArtifactReference nodeTo; + + private String scope; + + private boolean disabled = false; + + private int disabledType; + + private String disabledReason; + + public DependencyGraphEdge( ArtifactReference fromNode, ArtifactReference toNode ) + { + super(); + this.nodeFrom = fromNode; + this.nodeTo = toNode; + this.scope = DependencyScope.COMPILE; + } + + public boolean equals( Object obj ) + { + if ( this == obj ) + { + return true; + } + if ( obj == null ) + { + return false; + } + if ( getClass() != obj.getClass() ) + { + return false; + } + final DependencyGraphEdge other = (DependencyGraphEdge) obj; + if ( nodeFrom == null ) + { + if ( other.nodeFrom != null ) + { + return false; + } + } + else if ( !nodeFrom.equals( other.nodeFrom ) ) + { + return false; + } + if ( nodeTo == null ) + { + if ( other.nodeTo != null ) + { + return false; + } + } + else if ( !nodeTo.equals( other.nodeTo ) ) + { + return false; + } + return true; + } + + public String getDisabledReason() + { + return disabledReason; + } + + public int getDisabledType() + { + return disabledType; + } + + public ArtifactReference getNodeFrom() + { + return nodeFrom; + } + + public ArtifactReference getNodeTo() + { + return nodeTo; + } + + public String getScope() + { + return scope; + } + + public int hashCode() + { + final int PRIME = 31; + int result = 1; + result = PRIME * result + ( ( nodeFrom == null ) ? 0 : nodeFrom.hashCode() ); + result = PRIME * result + ( ( nodeTo == null ) ? 0 : nodeTo.hashCode() ); + return result; + } + + public boolean isDisabled() + { + return disabled; + } + + public void setDisabled( boolean disabled ) + { + this.disabled = disabled; + if( this.disabled == false ) + { + this.disabledReason = null; + this.disabledType = -1; + } + } + + public void setDisabledReason( String disabledReason ) + { + this.disabledReason = disabledReason; + } + + public void setDisabledType( int disabledType ) + { + this.disabledType = disabledType; + } + + public void setNodeFrom( ArtifactReference ref ) + { + this.nodeFrom = ref; + } + + public void setNodeFrom( DependencyGraphNode node ) + { + this.nodeFrom = node.getArtifact(); + } + + public void setNodeTo( ArtifactReference ref ) + { + this.nodeTo = ref; + } + + public void setNodeTo( DependencyGraphNode node ) + { + this.nodeTo = node.getArtifact(); + } + + public void setScope( String scope ) + { + this.scope = scope; + } + + public String toString() + { + StringBuffer sb = new StringBuffer(); + + sb.append( "GraphEdge[" ); + sb.append( "from=" ).append( DependencyGraphKeys.toKey( nodeFrom ) ); + sb.append( ",to=" ).append( DependencyGraphKeys.toKey( nodeTo ) ); + sb.append( "]" ); + + return sb.toString(); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/DependencyGraphKeys.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/DependencyGraphKeys.java new file mode 100644 index 000000000..2087de5a5 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/DependencyGraphKeys.java @@ -0,0 +1,79 @@ +package org.apache.maven.archiva.dependency.graph; + +/* + * 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.maven.archiva.model.ArtifactReference; +import org.apache.maven.archiva.model.Dependency; +import org.apache.maven.archiva.model.Exclusion; + +/** + * Key generation for the various objects used within the DependencyGraph. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class DependencyGraphKeys +{ + public static String toManagementKey( DependencyGraphNode node ) + { + return toManagementKey( node.getArtifact() ); + } + + public static String toManagementKey( ArtifactReference ref ) + { + StringBuffer key = new StringBuffer(); + key.append( ref.getGroupId() ).append( ":" ); + key.append( ref.getArtifactId() ); + return key.toString(); + } + + public static String toManagementKey( Dependency ref ) + { + StringBuffer key = new StringBuffer(); + key.append( ref.getGroupId() ).append( ":" ); + key.append( ref.getArtifactId() ); + return key.toString(); + } + + public static String toManagementKey( Exclusion ref ) + { + StringBuffer key = new StringBuffer(); + key.append( ref.getGroupId() ).append( ":" ); + key.append( ref.getArtifactId() ); + return key.toString(); + } + + public static String toKey( DependencyGraphNode node ) + { + return toKey( node.getArtifact() ); + } + + public static String toKey( ArtifactReference ref ) + { + StringBuffer key = new StringBuffer(); + key.append( ref.getGroupId() ).append( ":" ); + key.append( ref.getArtifactId() ).append( ":" ); + key.append( ref.getVersion() ).append( ":" ); + key.append( StringUtils.defaultString( ref.getClassifier() ) ).append( ":" ); + key.append( ref.getType() ); + return key.toString(); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/DependencyGraphNode.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/DependencyGraphNode.java new file mode 100644 index 000000000..90ab4499e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/DependencyGraphNode.java @@ -0,0 +1,191 @@ +package org.apache.maven.archiva.dependency.graph; + +/* + * 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.archiva.model.ArtifactReference; +import org.apache.maven.archiva.model.Dependency; +import org.apache.maven.archiva.model.Exclusion; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +/** + * DependencyGraphNode + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class DependencyGraphNode +{ + /** + * The artifact reference for this node. + */ + private ArtifactReference artifact; + + /** + * The project level dependency management section for this artifact. + */ + private List dependencyManagement = new ArrayList(); + + /** + * The list of excluded groupId:artifactId for this node's sub-nodes. + */ + private Set excludes = new HashSet(); + + /** + * Flag indicating that this node has been resolved from disk. + * Initially this is set to false, when the node is added due to a dependency entry in the + * project's pom. + * When the resolver comes through and reads the model for this node, it sets this to true. + */ + private boolean resolved = false; + + /** + * Flag indicating that this dependency exists because of a parent dependency. + * TODO: move this to DependencyGraphEdge (where it really belongs) + */ + private boolean fromParent = false; + + /** + * Booleaning indicating that this node is in conflict with another node in the graph. + * If this is true, that means this node is flagged for removal. + */ + private boolean conflicted = false; + + public DependencyGraphNode( ArtifactReference artifact ) + { + super(); + this.artifact = artifact; + } + + public void addExclude( Exclusion exclusion ) + { + this.excludes.add( DependencyGraphKeys.toManagementKey( exclusion ) ); + } + + public boolean equals( Object obj ) + { + if ( this == obj ) + { + return true; + } + if ( obj == null ) + { + return false; + } + if ( getClass() != obj.getClass() ) + { + return false; + } + final DependencyGraphNode other = (DependencyGraphNode) obj; + if ( artifact == null ) + { + if ( other.artifact != null ) + { + return false; + } + } + else if ( !artifact.equals( other.artifact ) ) + { + return false; + } + return true; + } + + public ArtifactReference getArtifact() + { + return artifact; + } + + public List getDependencyManagement() + { + return dependencyManagement; + } + + public Set getExcludes() + { + return excludes; + } + + public int hashCode() + { + final int PRIME = 31; + int result = 1; + result = PRIME * result + ( ( artifact == null ) ? 0 : artifact.hashCode() ); + return result; + } + + public boolean isConflicted() + { + return conflicted; + } + + public boolean isResolved() + { + return resolved; + } + + public void addDependencyManagement( Dependency dep ) + { + this.dependencyManagement.add( dep ); + } + + public void setArtifact( ArtifactReference artifact ) + { + this.artifact = artifact; + } + + public void setConflicted( boolean conflicted ) + { + this.conflicted = conflicted; + } + + public void setDependencyManagement( List dependencyManagement ) + { + this.dependencyManagement = dependencyManagement; + } + + public void setExcludes( Set excludes ) + { + this.excludes = excludes; + } + + public void setResolved( boolean resolved ) + { + this.resolved = resolved; + } + + public String toString() + { + return DependencyGraphKeys.toKey( artifact ); + } + + public boolean isFromParent() + { + return fromParent; + } + + public void setFromParent( boolean fromParent ) + { + this.fromParent = fromParent; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/DependencyGraphUtils.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/DependencyGraphUtils.java new file mode 100644 index 000000000..e70d488ef --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/DependencyGraphUtils.java @@ -0,0 +1,289 @@ +package org.apache.maven.archiva.dependency.graph; + +/* + * 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.collections.CollectionUtils; +import org.apache.commons.collections.Predicate; +import org.apache.commons.collections.functors.AndPredicate; +import org.apache.commons.collections.functors.NotPredicate; +import org.apache.commons.lang.StringUtils; +import org.apache.maven.archiva.dependency.graph.functors.NodePredicate; +import org.apache.maven.archiva.dependency.graph.functors.OrphanedNodePredicate; +import org.apache.maven.archiva.model.ArchivaProjectModel; +import org.apache.maven.archiva.model.ArtifactReference; +import org.apache.maven.archiva.model.Dependency; +import org.apache.maven.archiva.model.DependencyScope; +import org.apache.maven.archiva.model.Exclusion; +import org.apache.maven.archiva.model.VersionedReference; + +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; + +/** + * Utilities for manipulating the DependencyGraph. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class DependencyGraphUtils +{ + /** + * Standard way to add a model to the graph. + * + * NOTE: Used by archiva-repository-layer runtime and archiva-dependency-graph tests. + * + * @param model the model to add + * @param graph the graph to add it to + * @param fromNode the node to add it from. + */ + public static void addNodeFromModel( ArchivaProjectModel model, DependencyGraph graph, DependencyGraphNode fromNode ) + { + if ( model == null ) + { + throw new IllegalStateException( "Unable to add null model for " + + DependencyGraphKeys.toKey( fromNode.getArtifact() ) ); + } + + if ( model.getRelocation() != null ) + { + // We need to CHANGE this node. + ArtifactReference refTO = new ArtifactReference(); + + refTO.setGroupId( fromNode.getArtifact().getGroupId() ); + refTO.setArtifactId( fromNode.getArtifact().getArtifactId() ); + refTO.setVersion( fromNode.getArtifact().getVersion() ); + refTO.setClassifier( fromNode.getArtifact().getClassifier() ); + refTO.setType( fromNode.getArtifact().getType() ); + + VersionedReference relocation = model.getRelocation(); + + if ( StringUtils.isNotBlank( relocation.getGroupId() ) ) + { + refTO.setGroupId( relocation.getGroupId() ); + } + + if ( StringUtils.isNotBlank( relocation.getArtifactId() ) ) + { + refTO.setArtifactId( relocation.getArtifactId() ); + } + + if ( StringUtils.isNotBlank( relocation.getVersion() ) ) + { + refTO.setVersion( relocation.getVersion() ); + } + + DependencyGraphNode nodeTO = new DependencyGraphNode( refTO ); + + graph.addNode( nodeTO ); + collapseNodes( graph, fromNode, nodeTO ); + return; + } + + boolean isRootNode = graph.getRootNode().equals( fromNode ); + + Iterator it; + + if ( CollectionUtils.isNotEmpty( model.getDependencyManagement() ) ) + { + it = model.getDependencyManagement().iterator(); + while ( it.hasNext() ) + { + Dependency dependency = (Dependency) it.next(); + fromNode.addDependencyManagement( dependency ); + } + } + + if ( CollectionUtils.isNotEmpty( model.getDependencies() ) ) + { + it = model.getDependencies().iterator(); + while ( it.hasNext() ) + { + Dependency dependency = (Dependency) it.next(); + + String scope = dependency.getScope(); + + // Test scopes *NOT* from root node can be skipped. + if ( DependencyScope.TEST.equals( scope ) && !isRootNode ) + { + // skip add of test scope + continue; + } + + ArtifactReference artifactRef = new ArtifactReference(); + artifactRef.setGroupId( dependency.getGroupId() ); + artifactRef.setArtifactId( dependency.getArtifactId() ); + artifactRef.setVersion( dependency.getVersion() ); + artifactRef.setClassifier( dependency.getClassifier() ); + artifactRef.setType( dependency.getType() ); + + DependencyGraphNode toNode = new DependencyGraphNode( artifactRef ); + + if ( CollectionUtils.isNotEmpty( dependency.getExclusions() ) ) + { + Iterator itexclusion = dependency.getExclusions().iterator(); + while ( itexclusion.hasNext() ) + { + Exclusion exclusion = (Exclusion) itexclusion.next(); + toNode.addExclude( exclusion ); + } + } + + if ( dependency.isFromParent() ) + { + toNode.setFromParent( true ); + } + + // Add node (to) + graph.addNode( toNode ); + + DependencyGraphEdge edge = new DependencyGraphEdge( fromNode.getArtifact(), toNode.getArtifact() ); + edge.setScope( StringUtils.defaultIfEmpty( dependency.getScope(), DependencyScope.COMPILE ) ); + + if ( dependency.isOptional() ) + { + edge.setDisabled( true ); + edge.setDisabledType( DependencyGraph.DISABLED_OPTIONAL ); + edge.setDisabledReason( "Optional Dependency" ); + } + + graph.addEdge( edge ); + } + } + + fromNode.setResolved( true ); + graph.addNode( fromNode ); + } + + /** + * Clean out any nodes that may have become orphaned in the graph. + * + * @param graph the graph to check. + */ + public static void cleanupOrphanedNodes( DependencyGraph graph ) + { + boolean done = false; + + Predicate orphanedNodePredicate = new OrphanedNodePredicate( graph ); + Predicate notRootNode = NotPredicate.getInstance( new NodePredicate( graph.getRootNode().getArtifact() ) ); + Predicate orphanedChildNodePredicate = AndPredicate.getInstance( notRootNode, orphanedNodePredicate ); + + while ( !done ) + { + // Find orphaned node. + DependencyGraphNode orphanedNode = (DependencyGraphNode) CollectionUtils.find( graph.getNodes(), + orphanedChildNodePredicate ); + + if ( orphanedNode == null ) + { + done = true; + break; + } + + // Remove edges FROM orphaned node. + List edgesFrom = graph.getEdgesFrom( orphanedNode ); + + Iterator it = edgesFrom.iterator(); + while ( it.hasNext() ) + { + DependencyGraphEdge edge = (DependencyGraphEdge) it.next(); + graph.removeEdge( edge ); + } + + // Remove orphaned node. + graph.removeNode( orphanedNode ); + } + } + + /** + * Functionaly similar to {@link #collapseVersions(DependencyGraph, ArtifactReference, String, String)}, but + * in a new, easier to use, format. + * + * 1) Removes the FROM edges connected to the FROM node + * 2) Moves the TO edges connected to the FROM node to the TO node. + * 3) Removes the FROM node (which is now orphaned) + * + * @param graph the graph to perform operation on + * @param nodeFrom the node to collapse from + * @param nodeTo the node to collapse to + */ + public static void collapseNodes( DependencyGraph graph, DependencyGraphNode nodeFROM, DependencyGraphNode nodeTO ) + { + Iterator it; + + Set edgesToRemove = new HashSet(); + + // 1) Remove all of the edge.from references from nodeFROM + List fromEdges = graph.getEdgesFrom( nodeFROM ); + if ( CollectionUtils.isNotEmpty( fromEdges ) ) + { + edgesToRemove.addAll( fromEdges ); + } + + // 2) Swing all of the edge.to references from nodeFROM to nodeTO. + // System.out.println( "Swinging incoming edges from " + nodeFROM ); + // System.out.println( " to " + nodeTO ); + List toEdges = graph.getEdgesTo( nodeFROM ); + it = toEdges.iterator(); + while ( it.hasNext() ) + { + DependencyGraphEdge edge = (DependencyGraphEdge) it.next(); + + // Identify old edge to remove. + edgesToRemove.add( edge ); + + // Clone edge, set edge.to and add to graph. + DependencyGraphEdge newedge = clone( edge ); + newedge.setNodeTo( nodeTO ); + // System.out.println( " edge from: " + edge ); + // System.out.println( " to: " + newedge ); + graph.addEdge( newedge ); + } + + // Actually remove the old edges. + it = edgesToRemove.iterator(); + while ( it.hasNext() ) + { + DependencyGraphEdge edge = (DependencyGraphEdge) it.next(); + graph.removeEdge( edge ); + } + + // 3) Remove the nodeFROM + graph.removeNode( nodeFROM ); + } + + /** + * Create a clone of an edge. + * + * @param edge the edge to clone. + * @return the cloned edge. + */ + public static DependencyGraphEdge clone( DependencyGraphEdge edge ) + { + DependencyGraphEdge cloned = new DependencyGraphEdge( edge.getNodeFrom(), edge.getNodeTo() ); + cloned.setDisabled( edge.isDisabled() ); + cloned.setDisabledReason( edge.getDisabledReason() ); + cloned.setDisabledType( edge.getDisabledType() ); + cloned.setScope( edge.getScope() ); + + return cloned; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/DependencyResolutionEvent.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/DependencyResolutionEvent.java new file mode 100644 index 000000000..c47c1d092 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/DependencyResolutionEvent.java @@ -0,0 +1,57 @@ +package org.apache.maven.archiva.dependency.graph; + +/* + * 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. + */ + +/** + * DependencyResolutionEvent + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class DependencyResolutionEvent +{ + public static final int ADDING_MODEL = 1; + + public static final int DEP_CONFLICT_OMIT_FOR_NEARER = 2; + + public static final int CYCLE_BROKEN = 3; + + public static final int APPLYING_DEPENDENCY_MANAGEMENT = 4; + + private int type; + + private DependencyGraph graph; + + public DependencyResolutionEvent( int type, DependencyGraph graph ) + { + this.type = type; + this.graph = graph; + } + + public DependencyGraph getGraph() + { + return graph; + } + + public int getType() + { + return type; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/GraphListener.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/GraphListener.java new file mode 100644 index 000000000..149ea1d4e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/GraphListener.java @@ -0,0 +1,35 @@ +package org.apache.maven.archiva.dependency.graph; + +/* + * 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. + */ + +/** + * GraphListener + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public interface GraphListener +{ + public void graphError( GraphTaskException e, DependencyGraph currentGraph ); + + public void graphPhaseEvent( GraphPhaseEvent event ); + + public void dependencyResolutionEvent( DependencyResolutionEvent event ); +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/GraphPhaseEvent.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/GraphPhaseEvent.java new file mode 100644 index 000000000..cd1a8ccd2 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/GraphPhaseEvent.java @@ -0,0 +1,79 @@ +package org.apache.maven.archiva.dependency.graph; + +/* + * 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. + */ + +/** + * GraphPhaseEvent + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class GraphPhaseEvent +{ + /** + * Graph Phase Event Type - New Graph has been created. No tasks have been run yet. + * NOTE: {{@link #getTask()} will be null for this type. + */ + public static final int GRAPH_NEW = 0; + + /** + * Graph Phase Event Type - Graph Task is about to run. + */ + public static final int GRAPH_TASK_PRE = 1; + + /** + * Graph Phase Event Type - Graph Task has finished. + */ + public static final int GRAPH_TASK_POST = 2; + + /** + * Graph Phase Event Type - All Graph Tasks are done. + * NOTE: {{@link #getTask()} will be null for this type. + */ + public static final int GRAPH_DONE = 10; + + private int type; + + private GraphTask task; + + private DependencyGraph graph; + + public GraphPhaseEvent( int type, GraphTask task, DependencyGraph graph ) + { + this.type = type; + this.task = task; + this.graph = graph; + } + + public DependencyGraph getGraph() + { + return graph; + } + + public GraphTask getTask() + { + return task; + } + + public int getType() + { + return type; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/GraphTask.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/GraphTask.java new file mode 100644 index 000000000..38ca1e356 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/GraphTask.java @@ -0,0 +1,44 @@ +package org.apache.maven.archiva.dependency.graph; + +/* + * 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 Graph Task. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public interface GraphTask +{ + /** + * Get the id for this task. + * + * @return the id for this task. (used in Exception messages and {@link GraphPhaseEvent}) + */ + public String getTaskId(); + + /** + * Execute the Graph Task. + * + * @param graph the graph to execute the task on. + */ + public void executeTask( DependencyGraph graph ) + throws GraphTaskException; +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/GraphTaskException.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/GraphTaskException.java new file mode 100644 index 000000000..75aceccf1 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/GraphTaskException.java @@ -0,0 +1,42 @@ +package org.apache.maven.archiva.dependency.graph; + +/* + * 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.archiva.common.ArchivaException; + +/** + * GraphTaskException + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class GraphTaskException + extends ArchivaException +{ + public GraphTaskException( String message, Throwable cause ) + { + super( message, cause ); + } + + public GraphTaskException( String message ) + { + super( message ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/PotentialCyclicEdgeProducer.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/PotentialCyclicEdgeProducer.java new file mode 100644 index 000000000..2cd744675 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/PotentialCyclicEdgeProducer.java @@ -0,0 +1,31 @@ +package org.apache.maven.archiva.dependency.graph; + +/* + * 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 a {@link GraphTask} that has the potential to produce a cyclic edge. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public interface PotentialCyclicEdgeProducer +{ + /* no interface, just a tag */ +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/functors/EdgeCyclicPredicate.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/functors/EdgeCyclicPredicate.java new file mode 100644 index 000000000..2dcd81d83 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/functors/EdgeCyclicPredicate.java @@ -0,0 +1,55 @@ +package org.apache.maven.archiva.dependency.graph.functors; + +/* + * 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.collections.Predicate; +import org.apache.maven.archiva.dependency.graph.DependencyGraph; +import org.apache.maven.archiva.dependency.graph.DependencyGraphEdge; + +/** + * EdgeCyclicPredicate + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class EdgeCyclicPredicate + implements Predicate +{ + private static Predicate INSTANCE = new EdgeCyclicPredicate(); + + public static Predicate getInstance() + { + return INSTANCE; + } + + public boolean evaluate( Object object ) + { + boolean satisfies = false; + + if ( object instanceof DependencyGraphEdge ) + { + DependencyGraphEdge edge = (DependencyGraphEdge) object; + satisfies = ( edge.isDisabled() && ( edge.getDisabledType() == DependencyGraph.DISABLED_CYCLIC ) ); + } + + return satisfies; + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/functors/EdgeDisabledPredicate.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/functors/EdgeDisabledPredicate.java new file mode 100644 index 000000000..05aeaac31 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/functors/EdgeDisabledPredicate.java @@ -0,0 +1,48 @@ +package org.apache.maven.archiva.dependency.graph.functors; + +/* + * 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.collections.Predicate; +import org.apache.maven.archiva.dependency.graph.DependencyGraphEdge; + +/** + * EdgeDisabledPredicate + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class EdgeDisabledPredicate + implements Predicate +{ + + public boolean evaluate( Object object ) + { + boolean satisfies = false; + + if ( object instanceof DependencyGraphEdge ) + { + DependencyGraphEdge edge = (DependencyGraphEdge) object; + satisfies = edge.isDisabled(); + } + + return satisfies; + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/functors/EdgeExactScopePredicate.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/functors/EdgeExactScopePredicate.java new file mode 100644 index 000000000..852f32253 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/functors/EdgeExactScopePredicate.java @@ -0,0 +1,71 @@ +package org.apache.maven.archiva.dependency.graph.functors; + +/* + * 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.collections.Predicate; +import org.apache.commons.lang.StringUtils; +import org.apache.maven.archiva.dependency.graph.DependencyGraphEdge; +import org.apache.maven.archiva.model.DependencyScope; + +/** + * EdgeExactScopePredicate + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class EdgeExactScopePredicate + implements Predicate +{ + private String scope; + + public EdgeExactScopePredicate( String scope ) + { + this.scope = scope; + } + + public EdgeExactScopePredicate() + { + // The universal default for scope. + this.scope = DependencyScope.COMPILE; + } + + public boolean evaluate( Object object ) + { + boolean satisfies = false; + + if ( object instanceof DependencyGraphEdge ) + { + DependencyGraphEdge edge = (DependencyGraphEdge) object; + satisfies = StringUtils.equals( edge.getScope(), scope ); + } + + return satisfies; + } + + public String getScope() + { + return scope; + } + + public void setScope( String scope ) + { + this.scope = scope; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/functors/EdgeExcludedPredicate.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/functors/EdgeExcludedPredicate.java new file mode 100644 index 000000000..951b1ba92 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/functors/EdgeExcludedPredicate.java @@ -0,0 +1,54 @@ +package org.apache.maven.archiva.dependency.graph.functors; + +/* + * 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.collections.Predicate; +import org.apache.maven.archiva.dependency.graph.DependencyGraph; +import org.apache.maven.archiva.dependency.graph.DependencyGraphEdge; + +/** + * EdgeExcludedPredicate + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class EdgeExcludedPredicate + implements Predicate +{ + private static Predicate INSTANCE = new EdgeExcludedPredicate(); + + public static Predicate getInstance() + { + return INSTANCE; + } + + public boolean evaluate( Object object ) + { + boolean satisfies = false; + + if ( object instanceof DependencyGraphEdge ) + { + DependencyGraphEdge edge = (DependencyGraphEdge) object; + satisfies = ( edge.isDisabled() && ( edge.getDisabledType() == DependencyGraph.DISABLED_EXCLUDED ) ); + } + + return satisfies; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/functors/EdgeFromPredicate.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/functors/EdgeFromPredicate.java new file mode 100644 index 000000000..f4a0bff17 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/functors/EdgeFromPredicate.java @@ -0,0 +1,62 @@ +package org.apache.maven.archiva.dependency.graph.functors; + +/* + * 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.collections.Predicate; +import org.apache.maven.archiva.dependency.graph.DependencyGraphEdge; +import org.apache.maven.archiva.dependency.graph.DependencyGraphNode; +import org.apache.maven.archiva.model.ArtifactReference; + +/** + * Predicate returns true on any DependencyGraphEdge which has a + * specific FROM node. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class EdgeFromPredicate + implements Predicate +{ + private ArtifactReference nodeRef; + + public EdgeFromPredicate( ArtifactReference ref ) + { + this.nodeRef = ref; + } + + public EdgeFromPredicate( DependencyGraphNode node ) + { + this( node.getArtifact() ); + } + + public boolean evaluate( Object object ) + { + boolean satisfies = false; + + if ( object instanceof DependencyGraphEdge ) + { + DependencyGraphEdge edge = (DependencyGraphEdge) object; + satisfies = edge.getNodeFrom().equals( nodeRef ); + } + + return satisfies; + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/functors/EdgeScopeClosure.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/functors/EdgeScopeClosure.java new file mode 100644 index 000000000..954acd164 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/functors/EdgeScopeClosure.java @@ -0,0 +1,49 @@ +package org.apache.maven.archiva.dependency.graph.functors; + +/* + * 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.collections.Closure; +import org.apache.maven.archiva.dependency.graph.DependencyGraphEdge; + +/** + * Closure to set the edge scope. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class EdgeScopeClosure + implements Closure +{ + private String scope; + + public EdgeScopeClosure( String scope ) + { + this.scope = scope; + } + + public void execute( Object input ) + { + if ( input instanceof DependencyGraphEdge ) + { + DependencyGraphEdge edge = (DependencyGraphEdge) input; + edge.setScope( scope ); + } + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/functors/EdgeToPredicate.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/functors/EdgeToPredicate.java new file mode 100644 index 000000000..e2882db31 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/functors/EdgeToPredicate.java @@ -0,0 +1,55 @@ +package org.apache.maven.archiva.dependency.graph.functors; + +/* + * 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.collections.Predicate; +import org.apache.maven.archiva.dependency.graph.DependencyGraphEdge; +import org.apache.maven.archiva.model.ArtifactReference; + +/** + * EdgeToPredicate + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class EdgeToPredicate + implements Predicate +{ + private ArtifactReference nodeRef; + + public EdgeToPredicate( ArtifactReference ref ) + { + this.nodeRef = ref; + } + + public boolean evaluate( Object object ) + { + boolean satisfies = false; + + if ( object instanceof DependencyGraphEdge ) + { + DependencyGraphEdge edge = (DependencyGraphEdge) object; + satisfies = edge.getNodeTo().equals( nodeRef ); + } + + return satisfies; + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/functors/EdgeWithinScopePredicate.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/functors/EdgeWithinScopePredicate.java new file mode 100644 index 000000000..9c2928e8e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/functors/EdgeWithinScopePredicate.java @@ -0,0 +1,54 @@ +package org.apache.maven.archiva.dependency.graph.functors; + +/* + * 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.collections.Predicate; +import org.apache.maven.archiva.dependency.graph.DependencyGraphEdge; +import org.apache.maven.archiva.model.DependencyScope; + +/** + * EdgeWithinScopePredicate + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class EdgeWithinScopePredicate + implements Predicate +{ + private String scope; + + public EdgeWithinScopePredicate( String scope ) + { + this.scope = scope; + } + + public boolean evaluate( Object object ) + { + boolean satisfies = false; + + if ( object instanceof DependencyGraphEdge ) + { + DependencyGraphEdge edge = (DependencyGraphEdge) object; + satisfies = DependencyScope.isWithinScope( edge.getScope(), scope ); + } + + return satisfies; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/functors/NodeFromParentPredicate.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/functors/NodeFromParentPredicate.java new file mode 100644 index 000000000..eac60d4a2 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/functors/NodeFromParentPredicate.java @@ -0,0 +1,46 @@ +package org.apache.maven.archiva.dependency.graph.functors; + +/* + * 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.collections.Predicate; +import org.apache.maven.archiva.dependency.graph.DependencyGraphNode; + +/** + * Predicate for nodes that are flagged as from parent pom reference. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class NodeFromParentPredicate + implements Predicate +{ + + public boolean evaluate( Object object ) + { + boolean satisfies = false; + if ( object instanceof DependencyGraphNode ) + { + DependencyGraphNode node = (DependencyGraphNode) object; + satisfies = node.isFromParent(); + } + return satisfies; + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/functors/NodeInEdgePredicate.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/functors/NodeInEdgePredicate.java new file mode 100644 index 000000000..a3eba0d80 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/functors/NodeInEdgePredicate.java @@ -0,0 +1,54 @@ +package org.apache.maven.archiva.dependency.graph.functors; + +/* + * 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.collections.Predicate; +import org.apache.maven.archiva.dependency.graph.DependencyGraphEdge; +import org.apache.maven.archiva.model.ArtifactReference; + +/** + * NodeInEdgePredicate + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class NodeInEdgePredicate + implements Predicate +{ + private ArtifactReference nodeRef; + + public NodeInEdgePredicate( ArtifactReference ref ) + { + this.nodeRef = ref; + } + + public boolean evaluate( Object object ) + { + boolean satisfies = false; + + if ( object instanceof DependencyGraphEdge ) + { + DependencyGraphEdge edge = (DependencyGraphEdge) object; + satisfies = ( edge.getNodeFrom().equals( nodeRef ) || edge.getNodeTo().equals( nodeRef ) ); + } + + return satisfies; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/functors/NodePredicate.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/functors/NodePredicate.java new file mode 100644 index 000000000..da0373679 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/functors/NodePredicate.java @@ -0,0 +1,59 @@ +package org.apache.maven.archiva.dependency.graph.functors; + +/* + * 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.collections.Predicate; +import org.apache.maven.archiva.dependency.graph.DependencyGraphNode; +import org.apache.maven.archiva.model.ArtifactReference; + +/** + * NodePredicate + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class NodePredicate + implements Predicate +{ + private ArtifactReference ref; + + public NodePredicate( ArtifactReference ref ) + { + this.ref = ref; + } + + public NodePredicate( DependencyGraphNode node ) + { + this( node.getArtifact() ); + } + + public boolean evaluate( Object object ) + { + boolean satisfies = false; + + if ( object instanceof DependencyGraphNode ) + { + DependencyGraphNode node = (DependencyGraphNode) object; + satisfies = ref.equals( node.getArtifact() ); + } + + return satisfies; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/functors/OrphanedNodePredicate.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/functors/OrphanedNodePredicate.java new file mode 100644 index 000000000..2abbd6d98 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/functors/OrphanedNodePredicate.java @@ -0,0 +1,56 @@ +package org.apache.maven.archiva.dependency.graph.functors; + +/* + * 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.collections.CollectionUtils; +import org.apache.commons.collections.Predicate; +import org.apache.maven.archiva.dependency.graph.DependencyGraph; +import org.apache.maven.archiva.dependency.graph.DependencyGraphNode; + +/** + * OrphanedNodePredicate + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class OrphanedNodePredicate + implements Predicate +{ + private DependencyGraph graph; + + public OrphanedNodePredicate( DependencyGraph graph ) + { + this.graph = graph; + } + + public boolean evaluate( Object object ) + { + boolean satisfies = false; + + if ( object instanceof DependencyGraphNode ) + { + DependencyGraphNode node = (DependencyGraphNode) object; + satisfies = CollectionUtils.isEmpty( graph.getEdgesTo( node ) ); + } + + return satisfies; + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/functors/ToArtifactReferenceTransformer.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/functors/ToArtifactReferenceTransformer.java new file mode 100644 index 000000000..bde317c52 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/functors/ToArtifactReferenceTransformer.java @@ -0,0 +1,43 @@ +package org.apache.maven.archiva.dependency.graph.functors; + +/* + * 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.collections.Transformer; +import org.apache.maven.archiva.dependency.graph.DependencyGraphNode; + +/** + * Transform some common dependency graph objects into their + * ArtifactReference form. + */ +public class ToArtifactReferenceTransformer + implements Transformer +{ + public Object transform( Object input ) + { + if ( input instanceof DependencyGraphNode ) + { + return ( (DependencyGraphNode) input ).getArtifact(); + } + + // TODO: Add more objects to transform here. + + return input; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/functors/UnresolvedGraphNodePredicate.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/functors/UnresolvedGraphNodePredicate.java new file mode 100644 index 000000000..e1bf0afcd --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/functors/UnresolvedGraphNodePredicate.java @@ -0,0 +1,53 @@ +package org.apache.maven.archiva.dependency.graph.functors; + +/* + * 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.collections.Predicate; +import org.apache.maven.archiva.dependency.graph.DependencyGraphNode; + +/** + * Predicate for unresolved {@link DependencyGraphNode} objects. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class UnresolvedGraphNodePredicate + implements Predicate +{ + private static UnresolvedGraphNodePredicate INSTANCE = new UnresolvedGraphNodePredicate(); + + public static Predicate getInstance() + { + return INSTANCE; + } + + public boolean evaluate( Object object ) + { + boolean satisfies = false; + + if ( object instanceof DependencyGraphNode ) + { + DependencyGraphNode node = (DependencyGraphNode) object; + satisfies = !( node.isResolved() ); + } + + return satisfies; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/AbstractReduceEdgeVisitor.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/AbstractReduceEdgeVisitor.java new file mode 100644 index 000000000..107a758fb --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/AbstractReduceEdgeVisitor.java @@ -0,0 +1,43 @@ +package org.apache.maven.archiva.dependency.graph.tasks; + +/* + * 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.archiva.dependency.graph.DependencyGraph; +import org.apache.maven.archiva.dependency.graph.DependencyGraphUtils; +import org.apache.maven.archiva.dependency.graph.walk.BaseVisitor; +import org.apache.maven.archiva.dependency.graph.walk.DependencyGraphVisitor; + +/** + * AbstractReduceEdgeVisitor + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public abstract class AbstractReduceEdgeVisitor + extends BaseVisitor + implements DependencyGraphVisitor +{ + public void finishGraph( DependencyGraph graph ) + { + super.finishGraph( graph ); + + DependencyGraphUtils.cleanupOrphanedNodes( graph ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/DependencyManagementApplier.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/DependencyManagementApplier.java new file mode 100644 index 000000000..b83f28fb5 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/DependencyManagementApplier.java @@ -0,0 +1,218 @@ +package org.apache.maven.archiva.dependency.graph.tasks; + +/* + * 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.maven.archiva.dependency.graph.DependencyGraph; +import org.apache.maven.archiva.dependency.graph.DependencyGraphBuilder; +import org.apache.maven.archiva.dependency.graph.DependencyGraphEdge; +import org.apache.maven.archiva.dependency.graph.DependencyGraphNode; +import org.apache.maven.archiva.dependency.graph.DependencyGraphUtils; +import org.apache.maven.archiva.dependency.graph.tasks.DependencyManagementStack.Rules; +import org.apache.maven.archiva.dependency.graph.walk.BaseVisitor; +import org.apache.maven.archiva.dependency.graph.walk.DependencyGraphVisitor; +import org.apache.maven.archiva.model.ArtifactReference; +import org.apache.maven.archiva.model.VersionedReference; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +/** + * Takes a stack of DependencyManagement objects and applies them to the node in question. + * This merely sets the version / scope / and exclusions on the nodes, as defined by DependencyManagement. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class DependencyManagementApplier + extends BaseVisitor + implements DependencyGraphVisitor +{ + private DependencyManagementStack depStack = new DependencyManagementStack(); + + private DependencyGraphBuilder builder; + + /** + * Map of changes to node versions (that will likely cause a reorganization of + * the graph), this is tracked until the walk is complete, at which point the + * changes are applied to the graph. + * + * Performing graph changes of this scope during a walk of graph is hazardous, + * as you will be moving nodes around, mergeing nodes, dropping edges, etc. + */ + private Map nodeVersionChanges = new HashMap(); + + private int nodesAdded = 0; + + public void discoverGraph( DependencyGraph graph ) + { + super.discoverGraph( graph ); + nodeVersionChanges.clear(); + depStack.reset(); + nodesAdded = 0; + } + + public void discoverNode( DependencyGraphNode node ) + { + super.discoverNode( node ); + + depStack.push( node ); + + List edgesFrom = graph.getEdgesFrom( node ); + Iterator it = edgesFrom.iterator(); + while ( it.hasNext() ) + { + DependencyGraphEdge edge = (DependencyGraphEdge) it.next(); + Rules rules = depStack.getRules( edge ); + + if ( rules == null ) + { + // No rules for edge, skip it. + continue; + } + + DependencyGraphNode subnode = graph.getNode( edge.getNodeTo() ); + + /* There are 3 steps to processing the DependencyManagement. */ + + /* 1) Add exclusions to node ________________________________________________ */ + node.getExcludes().addAll( rules.exclusions ); + + /* 2) Track version changes to node _________________________________________ */ + + // This is the version as specified by the rules. + String specifiedVersion = rules.artifact.getVersion(); + + // This is the version as being tracked by the nodeVersionChanges map. + String trackedVersion = (String) nodeVersionChanges.get( edge.getNodeTo() ); + + // This is the version of the subnode. + String nodeVersion = subnode.getArtifact().getVersion(); + + // This is the actual version as determined by tracked and subnode + String actualVersion = StringUtils.defaultString( trackedVersion, nodeVersion ); + + // If the specified version changes the actual version ... + if ( !StringUtils.equals( specifiedVersion, actualVersion ) ) + { + // ... save this new value to be track ( for processing in #finishedGraph ) + nodeVersionChanges.put( edge.getNodeTo(), specifiedVersion ); + } + + /* 3) Update scope to edge __________________________________________________ */ + + if ( StringUtils.isNotBlank( rules.scope ) ) + { + edge.setScope( rules.scope ); + } + } + } + + public void finishNode( DependencyGraphNode node ) + { + super.finishNode( node ); + + depStack.pop(); + } + + public void finishGraph( DependencyGraph graph ) + { + super.finishGraph( graph ); + + Iterator it = this.nodeVersionChanges.keySet().iterator(); + while ( it.hasNext() ) + { + ArtifactReference ref = (ArtifactReference) it.next(); + String toVersion = (String) this.nodeVersionChanges.get( ref ); + + collapseVersions( graph, ref, ref.getVersion(), toVersion ); + } + } + + /** + * Collapses Versions of nodes. + * + * Takes two nodes, with differing versions. + * + * 1) Removes the FROM edges connected to the FROM node + * 2) Moves the TO edges connected to the FROM node to the TO node. + * 3) Removes the FROM node (which is now orphaned) + * + * @param graph the graph to perform operation on + * @param fromRef the artifact reference of the FROM node. + * @param fromVersion the version of the FROM node + * @param toVersion the version of the TO node + */ + private void collapseVersions( DependencyGraph graph, ArtifactReference fromRef, String fromVersion, + String toVersion ) + { + if ( StringUtils.equals( fromVersion, toVersion ) ) + { + // No point in doing anything. nothing has changed. + return; + } + + ArtifactReference toRef = new ArtifactReference(); + toRef.setGroupId( fromRef.getGroupId() ); + toRef.setArtifactId( fromRef.getArtifactId() ); + toRef.setVersion( toVersion ); + toRef.setClassifier( fromRef.getClassifier() ); + toRef.setType( fromRef.getType() ); + + DependencyGraphNode nodeFROM = graph.getNode( fromRef ); + DependencyGraphNode nodeTO = graph.getNode( toRef ); + + if ( nodeTO == null ) + { + // new node doesn't exist in graph (yet) + nodeTO = new DependencyGraphNode( toRef ); + nodeTO.setResolved( false ); + + graph.addNode( nodeTO ); + + VersionedReference projectRef = new VersionedReference(); + projectRef.setGroupId( toRef.getGroupId() ); + projectRef.setArtifactId( toRef.getArtifactId() ); + projectRef.setVersion( toRef.getVersion() ); + + builder.resolveNode( graph, nodeTO, projectRef ); + nodesAdded++; + } + + DependencyGraphUtils.collapseNodes( graph, nodeFROM, nodeTO ); + } + + public DependencyGraphBuilder getBuilder() + { + return builder; + } + + public void setBuilder( DependencyGraphBuilder builder ) + { + this.builder = builder; + } + + public boolean hasCreatedNodes() + { + return ( nodesAdded > 0 ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/DependencyManagementStack.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/DependencyManagementStack.java new file mode 100644 index 000000000..0aa77a88b --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/DependencyManagementStack.java @@ -0,0 +1,152 @@ +package org.apache.maven.archiva.dependency.graph.tasks; + +/* + * 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.collections.iterators.ReverseListIterator; +import org.apache.commons.lang.StringUtils; +import org.apache.maven.archiva.dependency.graph.DependencyGraphEdge; +import org.apache.maven.archiva.dependency.graph.DependencyGraphKeys; +import org.apache.maven.archiva.dependency.graph.DependencyGraphNode; +import org.apache.maven.archiva.model.ArtifactReference; +import org.apache.maven.archiva.model.Dependency; +import org.apache.maven.archiva.model.Exclusion; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Stack; + +/** + * DependencyManagementStack + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class DependencyManagementStack +{ + public class Rules + { + public ArtifactReference artifact; + + public String scope; + + public Set exclusions = new HashSet(); + + public void addAllExclusions( List depExclusions ) + { + Iterator it = depExclusions.iterator(); + while ( it.hasNext() ) + { + Exclusion ref = (Exclusion) it.next(); + String key = DependencyGraphKeys.toManagementKey( ref ); + exclusions.add( key ); + } + } + } + + private Stack depmanStack = new Stack(); + + private Map depMap = new HashMap(); + + private void generateDepMap() + { + depMap.clear(); + + // Using a reverse iterator to ensure that we read the + // stack from last in to first in + ReverseListIterator it = new ReverseListIterator( depmanStack ); + while ( it.hasNext() ) + { + DependencyGraphNode node = (DependencyGraphNode) it.next(); + + addDependencies( node.getDependencyManagement() ); + } + } + + private void addDependencies( List dependencies ) + { + Iterator it = dependencies.iterator(); + while ( it.hasNext() ) + { + Dependency dep = (Dependency) it.next(); + String key = DependencyGraphKeys.toManagementKey( dep ); + + Rules merged = (Rules) depMap.get( key ); + if ( merged == null ) + { + // New map entry. + merged = new Rules(); + merged.artifact = new ArtifactReference(); + merged.artifact.setGroupId( dep.getGroupId() ); + merged.artifact.setArtifactId( dep.getArtifactId() ); + merged.artifact.setClassifier( dep.getClassifier() ); + merged.artifact.setType( dep.getType() ); + } + + merged.artifact.setVersion( dep.getVersion() ); + if ( StringUtils.isNotBlank( dep.getScope() ) ) + { + merged.scope = dep.getScope(); + } + + merged.addAllExclusions( dep.getExclusions() ); + + depMap.put( key, merged ); + } + } + + public Rules getRules( DependencyGraphEdge edge ) + { + return getRules( edge.getNodeTo() ); + } + + public Rules getRules( DependencyGraphNode node ) + { + return getRules( node.getArtifact() ); + } + + public Rules getRules( ArtifactReference ref ) + { + String key = DependencyGraphKeys.toManagementKey( ref ); + return (Rules) depMap.get( key ); + } + + public void push( DependencyGraphNode node ) + { + depmanStack.push( node ); + generateDepMap(); + } + + public DependencyGraphNode pop() + { + DependencyGraphNode node = (DependencyGraphNode) depmanStack.pop(); + generateDepMap(); + return node; + } + + public void reset() + { + depmanStack.clear(); + depMap.clear(); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/FlagCyclicEdgesTask.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/FlagCyclicEdgesTask.java new file mode 100644 index 000000000..bc54dffe3 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/FlagCyclicEdgesTask.java @@ -0,0 +1,48 @@ +package org.apache.maven.archiva.dependency.graph.tasks; + +/* + * 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.archiva.dependency.graph.DependencyGraph; +import org.apache.maven.archiva.dependency.graph.GraphTask; +import org.apache.maven.archiva.dependency.graph.walk.DependencyGraphWalker; +import org.apache.maven.archiva.dependency.graph.walk.WalkDepthFirstSearch; + +/** + * FlagCyclicEdgesTask + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class FlagCyclicEdgesTask + implements GraphTask +{ + + public void executeTask( DependencyGraph graph ) + { + DependencyGraphWalker walker = new WalkDepthFirstSearch(); + FlagExcludedEdgesVisitor excludedEdgeResolver = new FlagExcludedEdgesVisitor(); + walker.visit( graph, excludedEdgeResolver ); + } + + public String getTaskId() + { + return "flag-cyclic-edges"; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/FlagCyclicEdgesVisitor.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/FlagCyclicEdgesVisitor.java new file mode 100644 index 000000000..d881a48b5 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/FlagCyclicEdgesVisitor.java @@ -0,0 +1,70 @@ +package org.apache.maven.archiva.dependency.graph.tasks; + +/* + * 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.archiva.dependency.graph.DependencyGraph; +import org.apache.maven.archiva.dependency.graph.DependencyGraphEdge; +import org.apache.maven.archiva.dependency.graph.walk.BaseVisitor; +import org.apache.maven.archiva.dependency.graph.walk.DependencyGraphVisitor; +import org.apache.maven.archiva.dependency.graph.walk.DependencyGraphWalker; +import org.apache.maven.archiva.model.ArtifactReference; + +import java.util.HashSet; +import java.util.Set; + +/** + * FlagCyclicEdgesVisitor + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class FlagCyclicEdgesVisitor + extends BaseVisitor + implements DependencyGraphVisitor +{ + private DependencyGraphWalker walker; + + private Set cyclicEdges = new HashSet(); + + public FlagCyclicEdgesVisitor( DependencyGraphWalker walker ) + { + this.walker = walker; + } + + public void discoverEdge( DependencyGraphEdge edge ) + { + ArtifactReference artifact = edge.getNodeTo(); + + // Process for cyclic edges. + if ( walker.getNodeVisitState( artifact ) == DependencyGraphWalker.PROCESSING ) + { + edge.setDisabled( true ); + edge.setDisabledType( DependencyGraph.DISABLED_CYCLIC ); + edge.setDisabledReason( "Cycle detected" ); + // TODO: insert into reason the path for the cycle that was detected. + cyclicEdges.add( edge ); + } + } + + public Set getCyclicEdges() + { + return cyclicEdges; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/FlagExcludedEdgesTask.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/FlagExcludedEdgesTask.java new file mode 100644 index 000000000..34a64467a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/FlagExcludedEdgesTask.java @@ -0,0 +1,47 @@ +package org.apache.maven.archiva.dependency.graph.tasks; + +/* + * 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.archiva.dependency.graph.DependencyGraph; +import org.apache.maven.archiva.dependency.graph.GraphTask; +import org.apache.maven.archiva.dependency.graph.walk.DependencyGraphWalker; +import org.apache.maven.archiva.dependency.graph.walk.WalkDepthFirstSearch; + +/** + * FlagExcludedEdgesTask + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class FlagExcludedEdgesTask + implements GraphTask +{ + public void executeTask( DependencyGraph graph ) + { + DependencyGraphWalker walker = new WalkDepthFirstSearch(); + FlagExcludedEdgesVisitor excludedEdgeResolver = new FlagExcludedEdgesVisitor(); + walker.visit( graph, excludedEdgeResolver ); + } + + public String getTaskId() + { + return "flag-excluded-edges"; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/FlagExcludedEdgesVisitor.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/FlagExcludedEdgesVisitor.java new file mode 100644 index 000000000..01b594157 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/FlagExcludedEdgesVisitor.java @@ -0,0 +1,86 @@ +package org.apache.maven.archiva.dependency.graph.tasks; + +/* + * 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.archiva.dependency.graph.DependencyGraph; +import org.apache.maven.archiva.dependency.graph.DependencyGraphEdge; +import org.apache.maven.archiva.dependency.graph.DependencyGraphKeys; +import org.apache.maven.archiva.dependency.graph.DependencyGraphNode; +import org.apache.maven.archiva.dependency.graph.walk.BaseVisitor; +import org.apache.maven.archiva.dependency.graph.walk.DependencyGraphVisitor; +import org.apache.maven.archiva.model.ArtifactReference; + +import java.util.Iterator; +import java.util.Stack; + +/** + * FlagExcludedEdgesVisitor + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class FlagExcludedEdgesVisitor + extends BaseVisitor + implements DependencyGraphVisitor +{ + private Stack nodePath = new Stack(); + + public void discoverEdge( DependencyGraphEdge edge ) + { + ArtifactReference artifact = edge.getNodeTo(); + + // Process for excluded edges. + String toKey = DependencyGraphKeys.toManagementKey( artifact ); + Iterator it = this.nodePath.iterator(); + while ( it.hasNext() ) + { + DependencyGraphNode pathNode = (DependencyGraphNode) it.next(); + + // Process dependency declared exclusions. + if ( pathNode.getExcludes().contains( toKey ) ) + { + edge.setDisabled( true ); + edge.setDisabledType( DependencyGraph.DISABLED_EXCLUDED ); + String whoExcluded = DependencyGraphKeys.toKey( pathNode ); + edge.setDisabledReason( "Specifically Excluded by " + whoExcluded ); + break; + } + } + } + + public void discoverNode( DependencyGraphNode node ) + { + super.discoverNode( node ); + nodePath.push( node ); + } + + public void finishNode( DependencyGraphNode node ) + { + super.finishNode( node ); + DependencyGraphNode pathNode = (DependencyGraphNode) nodePath.pop(); + if ( !node.equals( pathNode ) ) + { + String pathNodeKey = ArtifactReference.toKey( pathNode.getArtifact() ); + String finishNodeKey = ArtifactReference.toKey( node.getArtifact() ); + throw new IllegalStateException( "Encountered bad visitor state. Expected finish on node " + pathNodeKey + + ", but instead got notified of node " + finishNodeKey ); + } + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/GraphCopier.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/GraphCopier.java new file mode 100644 index 000000000..574c6b875 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/GraphCopier.java @@ -0,0 +1,81 @@ +package org.apache.maven.archiva.dependency.graph.tasks; + +/* + * 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.archiva.dependency.graph.DependencyGraph; +import org.apache.maven.archiva.dependency.graph.DependencyGraphEdge; +import org.apache.maven.archiva.dependency.graph.DependencyGraphNode; +import org.apache.maven.archiva.dependency.graph.walk.BaseVisitor; +import org.apache.maven.archiva.dependency.graph.walk.DependencyGraphVisitor; + +/** + * GraphCopier + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class GraphCopier + extends BaseVisitor + implements DependencyGraphVisitor +{ + protected DependencyGraph copiedGraph; + + public DependencyGraph getGraph() + { + return copiedGraph; + } + + public void setGraph( DependencyGraph graph ) + { + this.copiedGraph = graph; + } + + public void discoverNode( DependencyGraphNode node ) + { + if ( copiedGraph == null ) + { + copiedGraph = new DependencyGraph( node ); + } + } + + /** + * Be sure to override and NOT call this method in your sub class, + * if you want to copy edges based on some kind of criteria. + */ + public void discoverEdge( DependencyGraphEdge edge ) + { + copyEdge( edge ); + } + + public void copyEdge( DependencyGraphEdge edge ) + { + DependencyGraphNode nodeFrom = graph.getNode( edge.getNodeFrom() ); + DependencyGraphNode nodeTo = graph.getNode( edge.getNodeTo() ); + + this.copiedGraph.addNode( nodeFrom ); + this.copiedGraph.addNode( nodeTo ); + this.copiedGraph.addEdge( edge ); + } + + public void reset() + { + this.copiedGraph = null; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/PopulateDependencyManagementTask.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/PopulateDependencyManagementTask.java new file mode 100644 index 000000000..33dc107b0 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/PopulateDependencyManagementTask.java @@ -0,0 +1,48 @@ +package org.apache.maven.archiva.dependency.graph.tasks; + +/* + * 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.archiva.dependency.graph.DependencyGraph; +import org.apache.maven.archiva.dependency.graph.GraphTask; +import org.apache.maven.archiva.dependency.graph.PotentialCyclicEdgeProducer; +import org.apache.maven.archiva.dependency.graph.walk.DependencyGraphWalker; +import org.apache.maven.archiva.dependency.graph.walk.WalkDepthFirstSearch; + +/** + * PopulateDependencyManagementTask + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class PopulateDependencyManagementTask + implements GraphTask, PotentialCyclicEdgeProducer +{ + public void executeTask( DependencyGraph graph ) + { + DependencyGraphWalker walker = new WalkDepthFirstSearch(); + DependencyManagementApplier depManApplier = new DependencyManagementApplier(); + walker.visit( graph, depManApplier ); + } + + public String getTaskId() + { + return "populate-dependency-management"; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/PopulateGraphMasterTask.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/PopulateGraphMasterTask.java new file mode 100644 index 000000000..300c74e4f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/PopulateGraphMasterTask.java @@ -0,0 +1,87 @@ +package org.apache.maven.archiva.dependency.graph.tasks; + +/* + * 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.archiva.dependency.graph.DependencyGraph; +import org.apache.maven.archiva.dependency.graph.DependencyGraphBuilder; +import org.apache.maven.archiva.dependency.graph.DependencyGraphUtils; +import org.apache.maven.archiva.dependency.graph.GraphTask; +import org.apache.maven.archiva.dependency.graph.GraphTaskException; +import org.apache.maven.archiva.dependency.graph.walk.DependencyGraphWalker; +import org.apache.maven.archiva.dependency.graph.walk.WalkDepthFirstSearch; + +/** + * PopulateGraphMasterTask - will perform a resolve / depman apply loop until the graph is fully populated. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class PopulateGraphMasterTask + implements GraphTask +{ + private DependencyGraphBuilder builder; + + private ResolveGraphTask resolveGraphTask = new ResolveGraphTask(); + + private DependencyManagementApplier depManApplier = new DependencyManagementApplier(); + + public void executeTask( DependencyGraph graph ) + throws GraphTaskException + { + DependencyGraphWalker walker = new WalkDepthFirstSearch(); + + boolean done = false; + int maxiters = 5; + + while ( !done ) + { + resolveGraphTask.executeTask( graph ); + walker.visit( graph, depManApplier ); + + if ( !depManApplier.hasCreatedNodes() || ( maxiters < 0 ) ) + { + done = true; + break; + } + + maxiters--; + } + + DependencyGraphUtils.cleanupOrphanedNodes( graph ); + } + + public String getTaskId() + { + return "populate-graph"; + } + + public DependencyGraphBuilder getBuilder() + { + return builder; + } + + public void setBuilder( DependencyGraphBuilder builder ) + { + this.builder = builder; + this.resolveGraphTask.setBuilder( builder ); + this.depManApplier.setBuilder( builder ); + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/ReduceEnabledEdgesTask.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/ReduceEnabledEdgesTask.java new file mode 100644 index 000000000..aca1504f9 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/ReduceEnabledEdgesTask.java @@ -0,0 +1,49 @@ +package org.apache.maven.archiva.dependency.graph.tasks; + +/* + * 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.collections.functors.TruePredicate; +import org.apache.maven.archiva.dependency.graph.DependencyGraph; +import org.apache.maven.archiva.dependency.graph.GraphTask; +import org.apache.maven.archiva.dependency.graph.walk.DependencyGraphWalker; +import org.apache.maven.archiva.dependency.graph.walk.WalkDepthFirstSearch; + +/** + * ReduceEnabledEdgesTask + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ReduceEnabledEdgesTask + implements GraphTask +{ + public void executeTask( DependencyGraph graph ) + { + DependencyGraphWalker walker = new WalkDepthFirstSearch(); + walker.setEdgePredicate( TruePredicate.getInstance() ); + ReduceEnabledEdgesVisitor reduceEnabledEdgesResolver = new ReduceEnabledEdgesVisitor(); + walker.visit( graph, reduceEnabledEdgesResolver ); + } + + public String getTaskId() + { + return "reduce-enabled-edges"; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/ReduceEnabledEdgesVisitor.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/ReduceEnabledEdgesVisitor.java new file mode 100644 index 000000000..3b34dd89a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/ReduceEnabledEdgesVisitor.java @@ -0,0 +1,42 @@ +package org.apache.maven.archiva.dependency.graph.tasks; + +/* + * 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.archiva.dependency.graph.DependencyGraphEdge; +import org.apache.maven.archiva.dependency.graph.walk.DependencyGraphVisitor; + +/** + * Removes all disabled edges from the graph. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ReduceEnabledEdgesVisitor + extends AbstractReduceEdgeVisitor + implements DependencyGraphVisitor +{ + public void discoverEdge( DependencyGraphEdge edge ) + { + if ( edge.isDisabled() ) + { + super.graph.removeEdge( edge ); + } + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/ReduceScopeTask.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/ReduceScopeTask.java new file mode 100644 index 000000000..5a35eafff --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/ReduceScopeTask.java @@ -0,0 +1,64 @@ +package org.apache.maven.archiva.dependency.graph.tasks; + +/* + * 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.archiva.dependency.graph.DependencyGraph; +import org.apache.maven.archiva.dependency.graph.GraphTask; +import org.apache.maven.archiva.dependency.graph.walk.DependencyGraphWalker; +import org.apache.maven.archiva.dependency.graph.walk.WalkDepthFirstSearch; + +/** + * ReduceScopeTask + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ReduceScopeTask + implements GraphTask +{ + private String scope; + + public ReduceScopeTask( String scope ) + { + this.scope = scope; + } + + public void executeTask( DependencyGraph graph ) + { + DependencyGraphWalker walker = new WalkDepthFirstSearch(); + ReduceScopeVisitor reduceScopeResolver = new ReduceScopeVisitor( this.scope ); + walker.visit( graph, reduceScopeResolver ); + } + + public String getScope() + { + return scope; + } + + public void setScope( String scope ) + { + this.scope = scope; + } + + public String getTaskId() + { + return "reduce-scope"; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/ReduceScopeVisitor.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/ReduceScopeVisitor.java new file mode 100644 index 000000000..05d86198f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/ReduceScopeVisitor.java @@ -0,0 +1,51 @@ +package org.apache.maven.archiva.dependency.graph.tasks; + +/* + * 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.collections.Predicate; +import org.apache.maven.archiva.dependency.graph.DependencyGraphEdge; +import org.apache.maven.archiva.dependency.graph.functors.EdgeWithinScopePredicate; +import org.apache.maven.archiva.dependency.graph.walk.DependencyGraphVisitor; + +/** + * ReduceScopeVisitor + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ReduceScopeVisitor + extends AbstractReduceEdgeVisitor + implements DependencyGraphVisitor +{ + private Predicate scopedPredicate; + + public ReduceScopeVisitor( String scope ) + { + scopedPredicate = new EdgeWithinScopePredicate( scope ); + } + + public void discoverEdge( DependencyGraphEdge edge ) + { + if ( !scopedPredicate.evaluate( edge ) ) + { + super.graph.removeEdge( edge ); + } + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/ReduceTransitiveEdgesTask.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/ReduceTransitiveEdgesTask.java new file mode 100644 index 000000000..061af5abd --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/ReduceTransitiveEdgesTask.java @@ -0,0 +1,48 @@ +package org.apache.maven.archiva.dependency.graph.tasks; + +/* + * 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.archiva.dependency.graph.DependencyGraph; +import org.apache.maven.archiva.dependency.graph.GraphTask; +import org.apache.maven.archiva.dependency.graph.walk.DependencyGraphWalker; +import org.apache.maven.archiva.dependency.graph.walk.WalkBreadthFirstSearch; + +/** + * ReduceTransitiveEdgesTask + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ReduceTransitiveEdgesTask + implements GraphTask +{ + + public void executeTask( DependencyGraph graph ) + { + DependencyGraphWalker walker = new WalkBreadthFirstSearch(); + ReduceTransitiveEdgesVisitor reduceTransitiveEdgesResolver = new ReduceTransitiveEdgesVisitor(); + walker.visit( graph, reduceTransitiveEdgesResolver ); + } + + public String getTaskId() + { + return "reduce-transitive-edges"; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/ReduceTransitiveEdgesVisitor.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/ReduceTransitiveEdgesVisitor.java new file mode 100644 index 000000000..0c84271d7 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/ReduceTransitiveEdgesVisitor.java @@ -0,0 +1,161 @@ +package org.apache.maven.archiva.dependency.graph.tasks; + +/* + * 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.archiva.dependency.graph.DependencyGraph; +import org.apache.maven.archiva.dependency.graph.DependencyGraphEdge; +import org.apache.maven.archiva.dependency.graph.DependencyGraphKeys; +import org.apache.maven.archiva.dependency.graph.DependencyGraphNode; +import org.apache.maven.archiva.dependency.graph.walk.DependencyGraphVisitor; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +/** + * Perform a transitive reduction of the graph. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ReduceTransitiveEdgesVisitor + extends AbstractReduceEdgeVisitor + implements DependencyGraphVisitor +{ + class EdgeInfo + { + public DependencyGraphEdge edge; + + public int depth = Integer.MAX_VALUE; + } + + class EdgeInfoDepthComparator + implements Comparator + { + public int compare( Object obj0, Object obj1 ) + { + EdgeInfo edgeInfo0 = (EdgeInfo) obj0; + EdgeInfo edgeInfo1 = (EdgeInfo) obj1; + + return edgeInfo0.depth - edgeInfo1.depth; + } + } + + /** + * A Map of <(Node To) ArtifactReference, Map of <(Node From) ArtifactReference, EdgeInfo>> + */ + private Map /*>*/nodeDistanceMap = new HashMap(); + + private int currentDepth; + + public void discoverGraph( DependencyGraph graph ) + { + super.discoverGraph( graph ); + nodeDistanceMap.clear(); + currentDepth = 0; + } + + public void discoverEdge( DependencyGraphEdge edge ) + { + /* WARNING: it is unwise to remove the edge at this point. + * as modifying the graph as it's being walked is dangerous. + * + * Just record the edge's current depth. + */ + + String nodeTo = DependencyGraphKeys.toKey( edge.getNodeTo() ); + String nodeFrom = DependencyGraphKeys.toKey( edge.getNodeFrom() ); + + // Get sub-map + Map edgeInfoMap = (Map) nodeDistanceMap.get( nodeTo ); + + // Create sub-map if not present (yet) + if ( edgeInfoMap == null ) + { + edgeInfoMap = new HashMap(); + nodeDistanceMap.put( nodeTo, edgeInfoMap ); + } + + // Get sub-map-value. + EdgeInfo edgeInfo = (EdgeInfo) edgeInfoMap.get( nodeFrom ); + + if ( edgeInfo == null ) + { + // Create a new edgeinfo. + edgeInfo = new EdgeInfo(); + edgeInfo.edge = edge; + edgeInfo.depth = currentDepth; + edgeInfoMap.put( nodeFrom, edgeInfo ); + } + // test the current depth, if it is less than previous depth, save it + else if ( currentDepth < edgeInfo.depth ) + { + edgeInfo.depth = currentDepth; + edgeInfoMap.put( nodeFrom, edgeInfo ); + } + + nodeDistanceMap.put( nodeTo, edgeInfoMap ); + } + + public void discoverNode( DependencyGraphNode node ) + { + super.discoverNode( node ); + currentDepth++; + + } + + public void finishNode( DependencyGraphNode node ) + { + super.finishNode( node ); + currentDepth--; + } + + public void finishGraph( DependencyGraph graph ) + { + super.finishGraph( graph ); + + // Now we prune/remove the edges that are transitive in nature. + + Comparator edgeInfoDepthComparator = new EdgeInfoDepthComparator(); + + Iterator it = nodeDistanceMap.values().iterator(); + while ( it.hasNext() ) + { + Map edgeInfoMap = (Map) it.next(); + + if ( edgeInfoMap.size() > 1 ) + { + List edgeInfos = new ArrayList(); + edgeInfos.addAll( edgeInfoMap.values() ); + Collections.sort( edgeInfos, edgeInfoDepthComparator ); + + for ( int i = 1; i < edgeInfos.size(); i++ ) + { + EdgeInfo edgeInfo = (EdgeInfo) edgeInfos.get( i ); + graph.removeEdge( edgeInfo.edge ); + } + } + } + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/RefineConflictsTask.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/RefineConflictsTask.java new file mode 100644 index 000000000..cc55539f9 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/RefineConflictsTask.java @@ -0,0 +1,93 @@ +package org.apache.maven.archiva.dependency.graph.tasks; + +/* + * 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.collections.CollectionUtils; +import org.apache.commons.collections.map.MultiValueMap; +import org.apache.maven.archiva.dependency.graph.DependencyGraph; +import org.apache.maven.archiva.dependency.graph.DependencyGraphKeys; +import org.apache.maven.archiva.dependency.graph.DependencyGraphNode; +import org.apache.maven.archiva.dependency.graph.GraphTask; +import org.apache.maven.archiva.dependency.graph.PotentialCyclicEdgeProducer; +import org.apache.maven.archiva.dependency.graph.functors.ToArtifactReferenceTransformer; +import org.apache.maven.archiva.dependency.graph.walk.DependencyGraphWalker; +import org.apache.maven.archiva.dependency.graph.walk.WalkDepthFirstSearch; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; + +/** + * RefineConflictsTask + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class RefineConflictsTask + implements GraphTask, PotentialCyclicEdgeProducer +{ + + public void executeTask( DependencyGraph graph ) + { + Iterator it; + DependencyGraphWalker walker = new WalkDepthFirstSearch(); + RefineConflictsVisitor refineConflictsVisitor = new RefineConflictsVisitor(); + + MultiValueMap depMap = new MultiValueMap(); + + // Identify deps that need to be resolved. + it = graph.getNodes().iterator(); + while ( it.hasNext() ) + { + DependencyGraphNode node = (DependencyGraphNode) it.next(); + String key = DependencyGraphKeys.toManagementKey( node.getArtifact() ); + // This will add this node to the specified key, not replace a previous one. + depMap.put( key, node ); + } + + // Process those depMap entries with more than 1 value. + ToArtifactReferenceTransformer nodeToArtifact = new ToArtifactReferenceTransformer(); + + it = depMap.entrySet().iterator(); + while ( it.hasNext() ) + { + Map.Entry entry = (Entry) it.next(); + Collection nodes = (Collection) entry.getValue(); + if ( nodes.size() > 1 ) + { + List conflictingArtifacts = new ArrayList(); + conflictingArtifacts.addAll( nodes ); + CollectionUtils.transform( conflictingArtifacts, nodeToArtifact ); + + refineConflictsVisitor.resetConflictingArtifacts(); + refineConflictsVisitor.addAllConflictingArtifacts( conflictingArtifacts ); + walker.visit( graph, refineConflictsVisitor ); + } + } + } + + public String getTaskId() + { + return "refine-conflicts"; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/RefineConflictsVisitor.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/RefineConflictsVisitor.java new file mode 100644 index 000000000..9d7852427 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/RefineConflictsVisitor.java @@ -0,0 +1,303 @@ +package org.apache.maven.archiva.dependency.graph.tasks; + +/* + * 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.collections.CollectionUtils; +import org.apache.commons.collections.MapUtils; +import org.apache.commons.collections.Predicate; +import org.apache.commons.collections.comparators.ReverseComparator; +import org.apache.commons.collections.functors.NotPredicate; +import org.apache.commons.collections.list.TypedList; +import org.apache.maven.archiva.common.utils.VersionComparator; +import org.apache.maven.archiva.dependency.graph.DependencyGraph; +import org.apache.maven.archiva.dependency.graph.DependencyGraphEdge; +import org.apache.maven.archiva.dependency.graph.DependencyGraphKeys; +import org.apache.maven.archiva.dependency.graph.DependencyGraphNode; +import org.apache.maven.archiva.dependency.graph.DependencyGraphUtils; +import org.apache.maven.archiva.dependency.graph.walk.BaseVisitor; +import org.apache.maven.archiva.dependency.graph.walk.DependencyGraphVisitor; +import org.apache.maven.archiva.model.ArtifactReference; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * RefineConflictsVisitor + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class RefineConflictsVisitor + extends BaseVisitor + implements DependencyGraphVisitor +{ + class DepthComparator + implements Comparator + { + public int compare( Object obj0, Object obj1 ) + { + NodeLocation nodeLoc0 = (NodeLocation) obj0; + NodeLocation nodeLoc1 = (NodeLocation) obj1; + + return nodeLoc0.depth - nodeLoc1.depth; + } + } + + class NodeLocation + { + public ArtifactReference artifact; + + public DependencyGraphEdge edge; + + public int depth; + + public NodeLocation( ArtifactReference artifact, DependencyGraphEdge edge, int depth ) + { + this.artifact = artifact; + this.edge = edge; + this.depth = depth; + } + } + + class NodeLocationPredicate + implements Predicate + { + private ArtifactReference artifact; + + public NodeLocationPredicate( ArtifactReference artifact ) + { + this.artifact = artifact; + } + + public NodeLocationPredicate( DependencyGraphNode node ) + { + this( node.getArtifact() ); + } + + public boolean evaluate( Object object ) + { + boolean satisfies = false; + + if ( object instanceof NodeLocation ) + { + NodeLocation nodeloc = (NodeLocation) object; + satisfies = nodeloc.artifact.equals( artifact ); + } + + return satisfies; + } + + } + + class NodeLocationVersionComparator + implements Comparator + { + public int compare( Object o1, Object o2 ) + { + if ( o1 == null && o2 == null ) + { + return 0; + } + + if ( o1 == null && o2 != null ) + { + return 1; + } + + if ( o1 != null && o2 == null ) + { + return -1; + } + + if ( ( o1 instanceof NodeLocation ) && ( o2 instanceof NodeLocation ) ) + { + String version1 = ( (NodeLocation) o1 ).artifact.getVersion(); + String version2 = ( (NodeLocation) o2 ).artifact.getVersion(); + + VersionComparator.getInstance().compare( version1, version2 ); + } + + return 0; + } + } + + class DistantNodeLocationPredicate + implements Predicate + { + private int cutoff; + + public DistantNodeLocationPredicate( int distantCutoff ) + { + this.cutoff = distantCutoff; + } + + public boolean evaluate( Object object ) + { + boolean satisfies = false; + + if ( object instanceof NodeLocation ) + { + NodeLocation nodeloc = (NodeLocation) object; + satisfies = ( nodeloc.depth >= this.cutoff ); + } + + return satisfies; + } + } + + private List conflictingArtifacts; + + private Map foundNodesMap = new HashMap(); + + private int currentDepth = 0; + + private DependencyGraph currentGraph; + + public RefineConflictsVisitor() + { + conflictingArtifacts = TypedList.decorate( new ArrayList(), ArtifactReference.class ); + } + + public void discoverGraph( DependencyGraph graph ) + { + super.discoverGraph( graph ); + this.currentGraph = graph; + this.foundNodesMap.clear(); + } + + public void discoverNode( DependencyGraphNode node ) + { + super.discoverNode( node ); + + currentDepth++; + + List edgesFrom = currentGraph.getEdgesFrom( node ); + Iterator it = edgesFrom.iterator(); + while ( it.hasNext() ) + { + DependencyGraphEdge edge = (DependencyGraphEdge) it.next(); + if ( this.conflictingArtifacts.contains( edge.getNodeTo() ) ) + { + String nodeKey = DependencyGraphKeys.toKey( edge.getNodeTo() ); + // Check for existing NodeLocation with same key + NodeLocation nodeloc = (NodeLocation) this.foundNodesMap.get( nodeKey ); + + if ( ( nodeloc == null ) || ( currentDepth < nodeloc.depth ) ) + { + nodeloc = new NodeLocation( edge.getNodeTo(), edge, currentDepth ); + this.foundNodesMap.put( nodeKey, nodeloc ); + } + } + } + } + + public void finishGraph( DependencyGraph graph ) + { + super.finishGraph( graph ); + + if ( MapUtils.isEmpty( this.foundNodesMap ) ) + { + return; + } + + // Find winning node. + ArtifactReference winningArtifact = findWinningArtifact( this.foundNodesMap.values() ); + DependencyGraphNode winningNode = graph.getNode( winningArtifact ); + + // Gather up Losing Nodes. + Set losingNodes = new HashSet(); + Predicate losersPredicate = NotPredicate.getInstance( new NodeLocationPredicate( winningArtifact ) ); + CollectionUtils.select( this.foundNodesMap.values(), losersPredicate, losingNodes ); + + // Swing losing nodes to winning node. + Iterator it = losingNodes.iterator(); + while ( it.hasNext() ) + { + NodeLocation losingNodeLoc = (NodeLocation) it.next(); + DependencyGraphNode losingNode = graph.getNode( losingNodeLoc.artifact ); + DependencyGraphUtils.collapseNodes( graph, losingNode, winningNode ); + } + } + + private ArtifactReference findWinningArtifact( Collection nodes ) + { + List remainingNodes = new ArrayList(); + remainingNodes.addAll( nodes ); + + /* .\ Filter by Depth \.____________________________________________________ */ + + // Sort by depth. + Collections.sort( remainingNodes, new DepthComparator() ); + + // Determine 'closest' node depth. + NodeLocation nearestNode = (NodeLocation) remainingNodes.get( 0 ); + int nearest = nearestNode.depth; + + // Filter out distant nodes. + Predicate distantLocations = new DistantNodeLocationPredicate( nearest ); + CollectionUtils.filter( remainingNodes, distantLocations ); + + // Do we have 1 node left? + if ( remainingNodes.size() == 1 ) + { + // A winner! + NodeLocation nodeloc = (NodeLocation) remainingNodes.get( 0 ); + return nodeloc.artifact; + } + + /* .\ Filter by Newest Version \.___________________________________________ */ + + // We have 2 or more nodes that are equal distance from the root. + // Determine which one is 'newest' based on version id. + Collections.sort( remainingNodes, new ReverseComparator( new NodeLocationVersionComparator() ) ); + + NodeLocation nodeloc = (NodeLocation) remainingNodes.get( 0 ); + return nodeloc.artifact; + } + + public void finishNode( DependencyGraphNode node ) + { + super.finishNode( node ); + currentDepth--; + } + + public List getConflictingArtifacts() + { + return conflictingArtifacts; + } + + public void addAllConflictingArtifacts( Collection nodes ) + { + this.conflictingArtifacts.addAll( nodes ); + } + + public void resetConflictingArtifacts() + { + this.conflictingArtifacts.clear(); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/ResolveGraphTask.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/ResolveGraphTask.java new file mode 100644 index 000000000..9888d00ba --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/ResolveGraphTask.java @@ -0,0 +1,109 @@ +package org.apache.maven.archiva.dependency.graph.tasks; + +/* + * 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.collections.CollectionUtils; +import org.apache.maven.archiva.dependency.graph.DependencyGraph; +import org.apache.maven.archiva.dependency.graph.DependencyGraphBuilder; +import org.apache.maven.archiva.dependency.graph.DependencyGraphNode; +import org.apache.maven.archiva.dependency.graph.GraphTask; +import org.apache.maven.archiva.dependency.graph.PotentialCyclicEdgeProducer; +import org.apache.maven.archiva.dependency.graph.functors.UnresolvedGraphNodePredicate; +import org.apache.maven.archiva.model.VersionedReference; + +/** + * Loop through the unresolved nodes and resolve them, until there + * are no more unresolved nodes. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ResolveGraphTask + implements GraphTask, PotentialCyclicEdgeProducer +{ + private DependencyGraphBuilder builder; + + private int resolvedCount = 0; + + private VersionedReference toVersionedReference( DependencyGraphNode node ) + { + VersionedReference ref = new VersionedReference(); + ref.setGroupId( node.getArtifact().getGroupId() ); + ref.setArtifactId( node.getArtifact().getArtifactId() ); + ref.setVersion( node.getArtifact().getVersion() ); + + return ref; + } + + public void executeTask( DependencyGraph graph ) + { + resolvedCount = 0; + VersionedReference rootRef = toVersionedReference( graph.getRootNode() ); + + if ( !graph.getRootNode().isResolved() ) + { + builder.resolveNode( graph, graph.getRootNode(), rootRef ); + resolvedCount++; + } + + boolean done = false; + + while ( !done ) + { + DependencyGraphNode node = findUnresolvedNode( graph ); + if ( node == null ) + { + done = true; + break; + } + + VersionedReference otherRef = toVersionedReference( node ); + + builder.resolveNode( graph, node, otherRef ); + resolvedCount++; + } + } + + private DependencyGraphNode findUnresolvedNode( DependencyGraph graph ) + { + return (DependencyGraphNode) CollectionUtils + .find( graph.getNodes(), UnresolvedGraphNodePredicate.getInstance() ); + } + + public DependencyGraphBuilder getBuilder() + { + return builder; + } + + public void setBuilder( DependencyGraphBuilder graphBuilder ) + { + this.builder = graphBuilder; + } + + public String getTaskId() + { + return "resolve-graph"; + } + + public int getResolvedCount() + { + return resolvedCount; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/UpdateScopesTask.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/UpdateScopesTask.java new file mode 100644 index 000000000..fc340ec62 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/UpdateScopesTask.java @@ -0,0 +1,49 @@ +package org.apache.maven.archiva.dependency.graph.tasks; + +/* + * 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.archiva.dependency.graph.DependencyGraph; +import org.apache.maven.archiva.dependency.graph.GraphTask; +import org.apache.maven.archiva.dependency.graph.GraphTaskException; +import org.apache.maven.archiva.dependency.graph.walk.DependencyGraphWalker; +import org.apache.maven.archiva.dependency.graph.walk.WalkDepthFirstSearch; + +/** + * Update the scopes of the edges to what their parent node says. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class UpdateScopesTask + implements GraphTask +{ + public void executeTask( DependencyGraph graph ) + throws GraphTaskException + { + DependencyGraphWalker walker = new WalkDepthFirstSearch(); + UpdateScopesVisitor updateScopes = new UpdateScopesVisitor(); + walker.visit( graph, updateScopes ); + } + + public String getTaskId() + { + return "update-scopes"; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/UpdateScopesVisitor.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/UpdateScopesVisitor.java new file mode 100644 index 000000000..3ce72a78a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/tasks/UpdateScopesVisitor.java @@ -0,0 +1,82 @@ +package org.apache.maven.archiva.dependency.graph.tasks; + +/* + * 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.collections.Predicate; +import org.apache.maven.archiva.dependency.graph.DependencyGraph; +import org.apache.maven.archiva.dependency.graph.DependencyGraphEdge; +import org.apache.maven.archiva.dependency.graph.functors.EdgeFromPredicate; +import org.apache.maven.archiva.dependency.graph.walk.BaseVisitor; +import org.apache.maven.archiva.dependency.graph.walk.DependencyGraphVisitor; +import org.apache.maven.archiva.model.DependencyScope; + +import java.util.Stack; + +/** + * UpdateScopesVisitor + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class UpdateScopesVisitor + extends BaseVisitor + implements DependencyGraphVisitor +{ + private Stack scopeStack; + + private Predicate rootEdgePredicate; + + public UpdateScopesVisitor() + { + scopeStack = new Stack(); + // Default setting. + scopeStack.add( DependencyScope.COMPILE ); + } + + public void discoverGraph( DependencyGraph graph ) + { + super.discoverGraph( graph ); + rootEdgePredicate = new EdgeFromPredicate( graph.getRootNode() ); + } + + public void discoverEdge( DependencyGraphEdge edge ) + { + super.discoverEdge( edge ); + + String scope = edge.getScope(); + + if ( !rootEdgePredicate.evaluate( edge ) ) + { + // Not a root edge. Set the scope. + scope = (String) scopeStack.peek(); + edge.setScope( scope ); + } + + // Push the scope used onto the stack. + scopeStack.push( scope ); + } + + public void finishEdge( DependencyGraphEdge edge ) + { + super.finishEdge( edge ); + + scopeStack.pop(); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/walk/BaseVisitor.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/walk/BaseVisitor.java new file mode 100644 index 000000000..d07cb01f5 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/walk/BaseVisitor.java @@ -0,0 +1,73 @@ +package org.apache.maven.archiva.dependency.graph.walk; + +/* + * 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.archiva.dependency.graph.DependencyGraph; +import org.apache.maven.archiva.dependency.graph.DependencyGraphEdge; +import org.apache.maven.archiva.dependency.graph.DependencyGraphNode; + +/** + * The Baseline Visitor. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class BaseVisitor + implements DependencyGraphVisitor +{ + private static DependencyGraphVisitor INSTANCE = new BaseVisitor(); + + protected DependencyGraph graph; + + public static DependencyGraphVisitor getInstance() + { + return INSTANCE; + } + + public void discoverEdge( DependencyGraphEdge edge ) + { + /* do nothing */ + } + + public void discoverGraph( DependencyGraph graph ) + { + this.graph = graph; + } + + public void discoverNode( DependencyGraphNode node ) + { + /* do nothing */ + } + + public void finishEdge( DependencyGraphEdge edge ) + { + /* do nothing */ + } + + public void finishGraph( DependencyGraph graph ) + { + /* do nothing */ + } + + public void finishNode( DependencyGraphNode node ) + { + /* do nothing */ + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/walk/DependencyGraphVisitor.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/walk/DependencyGraphVisitor.java new file mode 100644 index 000000000..21027ae36 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/walk/DependencyGraphVisitor.java @@ -0,0 +1,76 @@ +package org.apache.maven.archiva.dependency.graph.walk; + +/* + * 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.archiva.dependency.graph.DependencyGraph; +import org.apache.maven.archiva.dependency.graph.DependencyGraphEdge; +import org.apache.maven.archiva.dependency.graph.DependencyGraphNode; + +/** + * Interface for progress during search. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public interface DependencyGraphVisitor +{ + /** + * Called once, for when the graph itself is discovered. + * + * @param graph the graph that was discovered. + */ + public void discoverGraph( DependencyGraph graph ); + + /** + * Called for each node, when that node is visited. + * + * @param node the node that is being visited. + */ + public void discoverNode( DependencyGraphNode node ); + + /** + * Called for each edge, when that edge is visited. + * + * @param edge the edge that is being visited. + */ + public void discoverEdge( DependencyGraphEdge edge ); + + /** + * Called for each edge, when that edge has been fully visited. + * + * @param edge the edge that was finished being visited. + */ + public void finishEdge( DependencyGraphEdge edge ); + + /** + * Called for each node, when the node has been fully visited. + * + * @param node the node that was finished being visited. + */ + public void finishNode( DependencyGraphNode node ); + + /** + * Called once, for when the graph is finished being visited. + * + * @param graph the graph that finished being visited. + */ + public void finishGraph( DependencyGraph graph ); + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/walk/DependencyGraphWalker.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/walk/DependencyGraphWalker.java new file mode 100644 index 000000000..9d6a1ba59 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/walk/DependencyGraphWalker.java @@ -0,0 +1,89 @@ +package org.apache.maven.archiva.dependency.graph.walk; + +/* + * 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.collections.Predicate; +import org.apache.maven.archiva.dependency.graph.DependencyGraph; +import org.apache.maven.archiva.dependency.graph.DependencyGraphNode; +import org.apache.maven.archiva.model.ArtifactReference; + +/** + * Walk nodes of the {@link DependencyGraph}. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public interface DependencyGraphWalker +{ + /** + * A {@link #getNodeVisitState(ArtifactReference)} for a node not yet seen in the walker. + */ + public static final Integer UNSEEN = new Integer( 0 ); + + /** + * A {@link #getNodeVisitState(ArtifactReference)} for a node that is actively being processed, + * but not yet finished processing. + */ + public static final Integer PROCESSING = new Integer( 1 ); + + /** + * A {@link #getNodeVisitState(ArtifactReference)} for a node that has been seen, and fully processed. + */ + public static final Integer SEEN = new Integer( 2 ); + + /** + * For a provided node, get the current node visit state. + * + * @param node the node that you are interested in. + * @return the state of that node. (Can be {@link #UNSEEN}, {@link #PROCESSING}, or {@link #SEEN} ) + */ + public Integer getNodeVisitState( ArtifactReference artifact ); + + /** + * Get the predicate used to determine if the walker should traverse an edge (or not). + * + * @return the Predicate that returns true for edges that should be traversed. + */ + public Predicate getEdgePredicate(); + + /** + * Set the predicate used for edge traversal + * + * @param edgePredicate the Predicate that returns true for edges that should be traversed. + */ + public void setEdgePredicate( Predicate edgePredicate ); + + /** + * Visit every node and edge in the graph from the startNode. + * + * @param graph the graph to visit. + * @param startNode the node to start the visit on. + * @param visitor the visitor object to use during this visit. + */ + public void visit( DependencyGraph graph, DependencyGraphNode startNode, DependencyGraphVisitor visitor ); + + /** + * Visit every node and edge in the entire graph. + * + * @param graph the graph to visit. + * @param visitor the visitor object to use during this visit. + */ + public void visit( DependencyGraph graph, DependencyGraphVisitor visitor ); +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/walk/WalkBreadthFirstSearch.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/walk/WalkBreadthFirstSearch.java new file mode 100644 index 000000000..22db8b8fd --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/walk/WalkBreadthFirstSearch.java @@ -0,0 +1,157 @@ +package org.apache.maven.archiva.dependency.graph.walk; + +/* + * 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.collections.Predicate; +import org.apache.commons.collections.functors.NotPredicate; +import org.apache.maven.archiva.dependency.graph.DependencyGraph; +import org.apache.maven.archiva.dependency.graph.DependencyGraphEdge; +import org.apache.maven.archiva.dependency.graph.DependencyGraphNode; +import org.apache.maven.archiva.dependency.graph.functors.EdgeDisabledPredicate; +import org.apache.maven.archiva.model.ArtifactReference; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +/** + * WalkBreadthFirstSearch + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class WalkBreadthFirstSearch + implements DependencyGraphWalker +{ + private Map nodeVisitStates = new HashMap(); + + private Predicate edgePredicate; + + public WalkBreadthFirstSearch() + { + this.edgePredicate = NotPredicate.getInstance( new EdgeDisabledPredicate() ); + } + + public Predicate getEdgePredicate() + { + return this.edgePredicate; + } + + public void setEdgePredicate( Predicate edgePredicate ) + { + this.edgePredicate = edgePredicate; + } + + public Integer getNodeVisitState( DependencyGraphNode node ) + { + return (Integer) nodeVisitStates.get( node.getArtifact() ); + } + + public Integer getNodeVisitState( ArtifactReference artifact ) + { + return (Integer) nodeVisitStates.get( artifact ); + } + + public void setNodeVisitState( DependencyGraphNode node, Integer state ) + { + this.nodeVisitStates.put( node.getArtifact(), state ); + } + + public void setNodeVisitState( ArtifactReference artifact, Integer state ) + { + this.nodeVisitStates.put( artifact, state ); + } + + private void visitEdge( DependencyGraph graph, DependencyGraphEdge e, DependencyGraphVisitor visitor ) + { + visitor.discoverEdge( e ); + + DependencyGraphNode node = graph.getNode( e.getNodeTo() ); + + if ( getNodeVisitState( node ) == UNSEEN ) + { + setNodeVisitState( node, PROCESSING ); + } + + visitor.finishEdge( e ); + } + + private void visitNode( DependencyGraph graph, DependencyGraphNode node, DependencyGraphVisitor visitor ) + { + setNodeVisitState( node, PROCESSING ); + + visitor.discoverNode( node ); + + Iterator edges; + // First dive down edges. + edges = graph.getEdgesFrom( node ).iterator(); + while ( edges.hasNext() ) + { + DependencyGraphEdge e = (DependencyGraphEdge) edges.next(); + if ( this.edgePredicate.evaluate( e ) ) + { + visitEdge( graph, e, visitor ); + } + } + + // Next move down edges. + edges = graph.getEdgesFrom( node ).iterator(); + while ( edges.hasNext() ) + { + DependencyGraphEdge e = (DependencyGraphEdge) edges.next(); + + if ( this.edgePredicate.evaluate( e ) ) + { + DependencyGraphNode nodeTo = graph.getNode( e.getNodeTo() ); + Integer state = getNodeVisitState( nodeTo ); + if ( ( state == UNSEEN ) || ( state == PROCESSING ) ) + { + visitNode( graph, nodeTo, visitor ); + } + } + } + + visitor.finishNode( node ); + + setNodeVisitState( node, SEEN ); + } + + public void visit( DependencyGraph graph, DependencyGraphVisitor visitor ) + { + visit( graph, graph.getRootNode(), visitor ); + } + + public void visit( DependencyGraph graph, DependencyGraphNode startNode, DependencyGraphVisitor visitor ) + { + nodeVisitStates.clear(); + + Iterator nodes = graph.getNodes().iterator(); + while ( nodes.hasNext() ) + { + setNodeVisitState( (DependencyGraphNode) nodes.next(), UNSEEN ); + } + + visitor.discoverGraph( graph ); + + visitNode( graph, startNode, visitor ); + + visitor.finishGraph( graph ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/walk/WalkDepthFirstSearch.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/walk/WalkDepthFirstSearch.java new file mode 100644 index 000000000..baf2548e0 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/main/java/org/apache/maven/archiva/dependency/graph/walk/WalkDepthFirstSearch.java @@ -0,0 +1,145 @@ +package org.apache.maven.archiva.dependency.graph.walk; + +/* + * 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.collections.Predicate; +import org.apache.commons.collections.functors.NotPredicate; +import org.apache.maven.archiva.dependency.graph.DependencyGraph; +import org.apache.maven.archiva.dependency.graph.DependencyGraphEdge; +import org.apache.maven.archiva.dependency.graph.DependencyGraphNode; +import org.apache.maven.archiva.dependency.graph.functors.EdgeDisabledPredicate; +import org.apache.maven.archiva.model.ArtifactReference; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +/** + * Perform a walk of the graph using the DepthFirstSearch algorithm. + * + * NOTE: Default edgePredicate is to NOT traverse disabled edges. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class WalkDepthFirstSearch + implements DependencyGraphWalker +{ + private Map nodeVisitStates = new HashMap(); + + private Predicate edgePredicate; + + public WalkDepthFirstSearch() + { + this.edgePredicate = NotPredicate.getInstance( new EdgeDisabledPredicate() ); + } + + public Predicate getEdgePredicate() + { + return this.edgePredicate; + } + + public void setEdgePredicate( Predicate edgePredicate ) + { + this.edgePredicate = edgePredicate; + } + + public Integer getNodeVisitState( DependencyGraphNode node ) + { + if ( node == null ) + { + return SEEN; + } + + return (Integer) nodeVisitStates.get( node.getArtifact() ); + } + + public Integer getNodeVisitState( ArtifactReference artifact ) + { + return (Integer) nodeVisitStates.get( artifact ); + } + + public void setNodeVisitState( DependencyGraphNode node, Integer state ) + { + this.nodeVisitStates.put( node.getArtifact(), state ); + } + + public void setNodeVisitState( ArtifactReference artifact, Integer state ) + { + this.nodeVisitStates.put( artifact, state ); + } + + private void visitEdge( DependencyGraph graph, DependencyGraphEdge e, DependencyGraphVisitor visitor ) + { + visitor.discoverEdge( e ); + + DependencyGraphNode node = graph.getNode( e.getNodeTo() ); + + if ( getNodeVisitState( node ) == UNSEEN ) + { + visitNode( graph, node, visitor ); + } + + visitor.finishEdge( e ); + } + + private void visitNode( DependencyGraph graph, DependencyGraphNode node, DependencyGraphVisitor visitor ) + { + setNodeVisitState( node, PROCESSING ); + + visitor.discoverNode( node ); + + Iterator edges = graph.getEdgesFrom( node ).iterator(); + while ( edges.hasNext() ) + { + DependencyGraphEdge e = (DependencyGraphEdge) edges.next(); + if ( this.edgePredicate.evaluate( e ) ) + { + visitEdge( graph, e, visitor ); + } + } + + visitor.finishNode( node ); + + setNodeVisitState( node, SEEN ); + } + + public void visit( DependencyGraph graph, DependencyGraphVisitor visitor ) + { + visit( graph, graph.getRootNode(), visitor ); + } + + public void visit( DependencyGraph graph, DependencyGraphNode startNode, DependencyGraphVisitor visitor ) + { + nodeVisitStates.clear(); + + Iterator nodes = graph.getNodes().iterator(); + while ( nodes.hasNext() ) + { + setNodeVisitState( (DependencyGraphNode) nodes.next(), UNSEEN ); + } + + visitor.discoverGraph( graph ); + + visitNode( graph, startNode, visitor ); + + visitor.finishGraph( graph ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/AbstractDependencyGraphFactoryTestCase.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/AbstractDependencyGraphFactoryTestCase.java new file mode 100644 index 000000000..d35373495 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/AbstractDependencyGraphFactoryTestCase.java @@ -0,0 +1,392 @@ +package org.apache.maven.archiva.dependency.graph; + +/* + * 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.collections.CollectionUtils; +import org.apache.commons.collections.Predicate; +import org.apache.commons.collections.functors.AndPredicate; +import org.apache.commons.collections.functors.NotPredicate; +import org.apache.commons.lang.StringUtils; +import org.apache.maven.archiva.dependency.graph.functors.EdgeExactScopePredicate; +import org.apache.maven.archiva.dependency.graph.functors.EdgeFromPredicate; +import org.apache.maven.archiva.dependency.graph.functors.NodeFromParentPredicate; +import org.apache.maven.archiva.dependency.graph.functors.NodePredicate; +import org.apache.maven.archiva.dependency.graph.functors.ToKeyTransformer; +import org.apache.maven.archiva.model.ArchivaProjectModel; +import org.apache.maven.archiva.model.ArtifactReference; +import org.apache.maven.archiva.model.Dependency; +import org.apache.maven.archiva.model.VersionedReference; +import org.codehaus.plexus.spring.PlexusInSpringTestCase; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; + +/** + * AbstractDependencyGraphFactoryTestCase + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public abstract class AbstractDependencyGraphFactoryTestCase + extends PlexusInSpringTestCase +{ + public class ExpectedEdge + { + public String from; + + public String to; + + public ExpectedEdge( String from, String to ) + { + this.from = from; + this.to = to; + } + } + + public class GraphEdgePredicate + implements Predicate + { + private String edgeFrom; + + private String edgeTo; + + public GraphEdgePredicate( String edgeFrom, String edgeTo ) + { + this.edgeFrom = edgeFrom; + this.edgeTo = edgeTo; + } + + public boolean evaluate( Object object ) + { + boolean satisfies = false; + + if ( object instanceof DependencyGraphEdge ) + { + DependencyGraphEdge edge = (DependencyGraphEdge) object; + String actualFrom = ArtifactReference.toKey( edge.getNodeFrom() ); + String actualTo = ArtifactReference.toKey( edge.getNodeTo() ); + + satisfies = ( StringUtils.equals( edgeFrom, actualFrom ) && StringUtils.equals( edgeTo, actualTo ) ); + } + + return satisfies; + } + } + + protected void assertDirectNodes( DependencyGraph graph, List expectedNodes, String scope ) + { + Iterator it; + DependencyGraphNode rootNode = graph.getRootNode(); + List rootEdges = graph.getEdgesFrom( rootNode ); + List actualEdges = new ArrayList(); + + Predicate directDep = NotPredicate.getInstance( new NodeFromParentPredicate() ); + Predicate scopedDirectDeps = AndPredicate.getInstance( new EdgeExactScopePredicate( scope ), directDep ); + CollectionUtils.select( rootEdges, scopedDirectDeps, actualEdges ); + // CollectionUtils.select( rootEdges, new EdgeExactScopePredicate( scope ), actualEdges ); + + if ( expectedNodes.size() != actualEdges.size() ) + { + StringBuffer sb = new StringBuffer(); + + sb.append( "Direct node.count with <" ).append( scope ).append( "> edges from [" ); + sb.append( DependencyGraphKeys.toKey( rootNode.getArtifact() ) ).append( "]" ).append( " expected:<" ); + sb.append( expectedNodes.size() ).append( "> but was:<" ); + sb.append( actualEdges.size() ).append( ">" ); + + CollectionUtils.transform( actualEdges, new ToKeyTransformer() ); + + Collection missingActualKeys = CollectionUtils.subtract( actualEdges, expectedNodes ); + it = missingActualKeys.iterator(); + while ( it.hasNext() ) + { + sb.append( "\n (Extra Actual) " ).append( (String) it.next() ); + } + + Collection missingExpectedKeys = CollectionUtils.subtract( expectedNodes, actualEdges ); + it = missingExpectedKeys.iterator(); + while ( it.hasNext() ) + { + sb.append( "\n (Extra Expected) " ).append( (String) it.next() ); + } + + fail( sb.toString() ); + } + + it = actualEdges.iterator(); + while ( it.hasNext() ) + { + DependencyGraphEdge edge = (DependencyGraphEdge) it.next(); + String actualKey = DependencyGraphKeys.toKey( edge.getNodeTo() ); + assertTrue( "Direct <" + scope + "> node To [" + actualKey + "] exists in expectedNodes.", expectedNodes + .contains( actualKey ) ); + } + } + + protected void assertEdges( DependencyGraph graph, List expectedEdges ) + { + assertNotNull( "Graph.edges should never be null.", graph.getEdges() ); + assertEquals( "Graph.edges.size()", expectedEdges.size(), graph.getEdges().size() ); + + Iterator it = expectedEdges.iterator(); + while ( it.hasNext() ) + { + ExpectedEdge expectedEdge = (ExpectedEdge) it.next(); + Predicate edgePredicate = new GraphEdgePredicate( expectedEdge.from, expectedEdge.to ); + + DependencyGraphEdge edge = (DependencyGraphEdge) CollectionUtils.find( graph.getEdges(), edgePredicate ); + if ( edge == null ) + { + fail( "Unable to find expected edge from:<" + expectedEdge.from + "> to:<" + expectedEdge.to + ">" ); + } + } + } + + protected void assertGraph( DependencyGraph graph, String rootRefKey, List expectedNodeKeys ) + { + assertNotNull( "Graph.nodes should never be null.", graph.getNodes() ); + assertTrue( "Graph.nodes.size() should always be 1 or better.", graph.getNodes().size() >= 1 ); + + ArtifactReference rootRef = graph.getRootNode().getArtifact(); + StringBuffer actualRootRef = new StringBuffer(); + actualRootRef.append( rootRef.getGroupId() ).append( ":" ); + actualRootRef.append( rootRef.getArtifactId() ).append( ":" ); + actualRootRef.append( rootRef.getVersion() ); + + assertEquals( "Graph.root", rootRefKey, actualRootRef.toString() ); + + Iterator it; + List actualNodes = new ArrayList(); + + Predicate notRootNode = NotPredicate.getInstance( new NodePredicate( graph.getRootNode() ) ); + CollectionUtils.select( graph.getNodes(), notRootNode, actualNodes ); + + boolean fail = false; + StringBuffer sb = new StringBuffer(); + + if ( expectedNodeKeys.size() != actualNodes.size() ) + { + sb.append( "node.count expected:<" ); + sb.append( expectedNodeKeys.size() ).append( "> but was:<" ); + sb.append( actualNodes.size() ).append( ">" ); + fail = true; + } + + CollectionUtils.transform( actualNodes, new ToKeyTransformer() ); + + Collection missingActualKeys = CollectionUtils.subtract( actualNodes, expectedNodeKeys ); + it = missingActualKeys.iterator(); + while ( it.hasNext() ) + { + sb.append( "\n (Extra Actual) " ).append( (String) it.next() ); + fail = true; + } + + Collection missingExpectedKeys = CollectionUtils.subtract( expectedNodeKeys, actualNodes ); + it = missingExpectedKeys.iterator(); + while ( it.hasNext() ) + { + sb.append( "\n (Extra Expected) " ).append( (String) it.next() ); + fail = true; + } + + if( fail ) + { + fail( sb.toString() ); + } + + /* + it = actualNodes.iterator(); + while ( it.hasNext() ) + { + DependencyGraphNode node = (DependencyGraphNode) it.next(); + assertNotNull( "Artifact reference in node should not be null.", node.getArtifact() ); + String key = ArtifactReference.toKey( node.getArtifact() ); + assertTrue( "Artifact reference [" + key + "] should be in expectedNodeKeys.", expectedNodeKeys + .contains( key ) ); + } + */ + } + + protected void assertNodes( DependencyGraph graph, List expectedNodeKeys ) + { + assertNotNull( "Graph.nodes should never be null.", graph.getNodes() ); + assertTrue( "Graph.nodes.size() should always be 1 or better.", graph.getNodes().size() >= 1 ); + // assertEquals( "Graph.nodes.size()", expectedNodeKeys.size(), graph.getNodes().size() ); + + Iterator it; + List actualNodes = new ArrayList(); + actualNodes.addAll( graph.getNodes() ); + + if ( expectedNodeKeys.size() != actualNodes.size() ) + { + StringBuffer sb = new StringBuffer(); + + sb.append( "node.count expected:<" ); + sb.append( expectedNodeKeys.size() ).append( "> but was:<" ); + sb.append( actualNodes.size() ).append( ">" ); + + CollectionUtils.transform( actualNodes, new ToKeyTransformer() ); + + Collection missingActualKeys = CollectionUtils.subtract( actualNodes, expectedNodeKeys ); + it = missingActualKeys.iterator(); + while ( it.hasNext() ) + { + sb.append( "\n (Extra Actual) " ).append( (String) it.next() ); + } + + Collection missingExpectedKeys = CollectionUtils.subtract( expectedNodeKeys, actualNodes ); + it = missingExpectedKeys.iterator(); + while ( it.hasNext() ) + { + sb.append( "\n (Extra Expected) " ).append( (String) it.next() ); + } + + fail( sb.toString() ); + } + + it = graph.getNodes().iterator(); + while ( it.hasNext() ) + { + DependencyGraphNode node = (DependencyGraphNode) it.next(); + assertNotNull( "Artifact reference in node should not be null.", node.getArtifact() ); + String key = ArtifactReference.toKey( node.getArtifact() ); + assertTrue( "Artifact reference [" + key + "] should be in expectedNodeKeys.", expectedNodeKeys + .contains( key ) ); + } + } + + protected void assertRootNode( DependencyGraph graph, String expectedKey ) + { + DependencyGraphNode node = graph.getRootNode(); + + String actualKey = DependencyGraphKeys.toKey( node.getArtifact() ); + assertEquals( "Root Node", expectedKey, actualKey ); + } + + protected void assertTransientNodes( DependencyGraph graph, List expectedNodes, String scope ) + { + Iterator it; + + // Gather up the transient nodes from the DependencyGraph. + List actualEdges = new ArrayList(); + + DependencyGraphNode rootNode = graph.getRootNode(); + + Predicate transientDep = NotPredicate.getInstance( new EdgeFromPredicate( rootNode.getArtifact() ) ); + Predicate edgeByExactScope = new EdgeExactScopePredicate( scope ); + Predicate transitiveEdgesByScopePredicate = AndPredicate.getInstance( transientDep, edgeByExactScope ); + + CollectionUtils.select( graph.getEdges(), transitiveEdgesByScopePredicate, actualEdges ); + + if ( expectedNodes.size() != actualEdges.size() ) + { + StringBuffer sb = new StringBuffer(); + + sb.append( "Transient node.count with <" ).append( scope ).append( "> edges from [" ); + sb.append( DependencyGraphKeys.toKey( rootNode.getArtifact() ) ).append( "]" ).append( " expected:<" ); + sb.append( expectedNodes.size() ).append( "> but was:<" ); + sb.append( actualEdges.size() ).append( ">" ); + + CollectionUtils.transform( actualEdges, new ToKeyTransformer() ); + + Collection missingActualKeys = CollectionUtils.subtract( actualEdges, expectedNodes ); + it = missingActualKeys.iterator(); + while ( it.hasNext() ) + { + sb.append( "\n (Extra Actual) " ).append( (String) it.next() ); + } + + Collection missingExpectedKeys = CollectionUtils.subtract( expectedNodes, actualEdges ); + it = missingExpectedKeys.iterator(); + while ( it.hasNext() ) + { + sb.append( "\n (Extra Expected) " ).append( (String) it.next() ); + } + + fail( sb.toString() ); + } + + it = actualEdges.iterator(); + while ( it.hasNext() ) + { + DependencyGraphEdge edge = (DependencyGraphEdge) it.next(); + String actualKey = DependencyGraphKeys.toKey( edge.getNodeTo() ); + assertTrue( "Transient Node To [" + actualKey + "] exists in expectedNodes.", expectedNodes + .contains( actualKey ) ); + } + } + + protected Dependency toDependency( String key ) + { + String parts[] = StringUtils.splitPreserveAllTokens( key, ':' ); + + assertEquals( "Dependency key [" + key + "] should be 5 parts.", 5, parts.length ); + + Dependency dep = new Dependency(); + + dep.setGroupId( parts[0] ); + dep.setArtifactId( parts[1] ); + dep.setVersion( parts[2] ); + dep.setClassifier( parts[3] ); + dep.setType( parts[4] ); + + return dep; + } + + protected ArchivaProjectModel toModel( String key, Dependency deps[] ) + { + String parts[] = StringUtils.splitPreserveAllTokens( key, ':' ); + + assertEquals( "Dependency key [" + key + "] should be 3 parts.", 3, parts.length ); + + ArchivaProjectModel model = new ArchivaProjectModel(); + model.setGroupId( parts[0] ); + model.setArtifactId( parts[1] ); + model.setVersion( parts[2] ); + model.setOrigin( "testcase" ); + model.setPackaging( "jar" ); + + if ( deps != null ) + { + for ( int i = 0; i < deps.length; i++ ) + { + Dependency dep = deps[i]; + model.addDependency( dep ); + } + } + + return model; + } + + protected VersionedReference toVersionedReference( String key ) + { + String parts[] = StringUtils.splitPreserveAllTokens( key, ':' ); + assertEquals( "Versioned Reference [" + key + "] part count.", 3, parts.length ); + + VersionedReference ref = new VersionedReference(); + ref.setGroupId( parts[0] ); + ref.setArtifactId( parts[1] ); + ref.setVersion( parts[2] ); + return ref; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/AbstractMemoryRepository.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/AbstractMemoryRepository.java new file mode 100644 index 000000000..efb3277bb --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/AbstractMemoryRepository.java @@ -0,0 +1,176 @@ +package org.apache.maven.archiva.dependency.graph; + +/* + * 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.maven.archiva.model.ArchivaProjectModel; +import org.apache.maven.archiva.model.Dependency; +import org.apache.maven.archiva.model.Exclusion; +import org.apache.maven.archiva.model.Keys; +import org.apache.maven.archiva.model.VersionedReference; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +/** + * AbstractMemoryRepository + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public abstract class AbstractMemoryRepository + implements MemoryRepository +{ + private Map modelMap = new HashMap(); + + public AbstractMemoryRepository() + { + initialize(); + } + + public void addModel( ArchivaProjectModel model ) + { + String key = Keys.toKey( model ); + modelMap.put( key, model ); + } + + public ArchivaProjectModel getProjectModel( String groupId, String artifactId, String version ) + { + String key = Keys.toKey( groupId, artifactId, version ); + + return (ArchivaProjectModel) modelMap.get( key ); + } + + public abstract void initialize(); + + protected void addExclusion( Dependency dependency, String key ) + { + String parts[] = StringUtils.splitPreserveAllTokens( key, ':' ); + + if ( parts.length != 2 ) + { + throw new IllegalArgumentException( "Exclusion key [" + key + "] should be 2 parts. (detected " + + parts.length + " instead)" ); + } + + Exclusion exclusion = new Exclusion(); + exclusion.setGroupId( parts[0] ); + exclusion.setArtifactId( parts[1] ); + + dependency.addExclusion( exclusion ); + } + + protected Dependency toDependency( String key ) + { + String parts[] = StringUtils.splitPreserveAllTokens( key, ':' ); + + if ( parts.length != 5 ) + { + throw new IllegalArgumentException( "Dependency key [" + key + "] should be 5 parts. (detected " + + parts.length + " instead)" ); + } + + Dependency dep = new Dependency(); + + dep.setGroupId( parts[0] ); + dep.setArtifactId( parts[1] ); + dep.setVersion( parts[2] ); + dep.setClassifier( parts[3] ); + dep.setType( parts[4] ); + + return dep; + } + + protected Dependency toDependency( String key, String scope ) + { + Dependency dependency = toDependency( key ); + dependency.setScope( scope ); + + return dependency; + } + + protected ArchivaProjectModel toModel( String key ) + { + return toModel( key, Collections.EMPTY_LIST ); + } + + protected ArchivaProjectModel toModel( String key, Dependency deps[] ) + { + List depList = new ArrayList(); + + if ( deps != null ) + { + depList.addAll( Arrays.asList( deps ) ); + } + + return toModel( key, depList ); + } + + protected ArchivaProjectModel toModel( String key, List deps ) + { + String parts[] = StringUtils.splitPreserveAllTokens( key, ':' ); + + if ( parts.length != 3 ) + { + throw new IllegalArgumentException( "Project/Model key [" + key + "] should be 3 parts. (detected " + + parts.length + " instead)" ); + } + + ArchivaProjectModel model = new ArchivaProjectModel(); + model.setGroupId( parts[0] ); + model.setArtifactId( parts[1] ); + model.setVersion( parts[2] ); + model.setOrigin( "testcase" ); + model.setPackaging( "jar" ); + + Iterator it = deps.iterator(); + while ( it.hasNext() ) + { + Dependency dep = (Dependency) it.next(); + model.addDependency( dep ); + } + + return model; + } + + protected VersionedReference toParent( String key ) + { + String parts[] = StringUtils.splitPreserveAllTokens( key, ':' ); + + if ( parts.length != 3 ) + { + throw new IllegalArgumentException( "Parent key [" + key + "] should be 3 parts. (detected " + parts.length + + " instead)" ); + } + + VersionedReference ref = new VersionedReference(); + ref.setGroupId( parts[0] ); + ref.setArtifactId( parts[1] ); + ref.setVersion( parts[2] ); + + return ref; + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/AllTests.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/AllTests.java new file mode 100644 index 000000000..24f12c12b --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/AllTests.java @@ -0,0 +1,51 @@ +package org.apache.maven.archiva.dependency.graph; + +/* + * 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.Test; +import junit.framework.TestSuite; + +/** + * Utility class to aide IDE developers. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class AllTests +{ + + public static Test suite() + { + TestSuite suite = new TestSuite( "Test for org.apache.maven.archiva.repository.project.dependencies" ); + //$JUnit-BEGIN$ + suite.addTestSuite( ArchivaWebappDependencyGraphTest.class ); + suite.addTestSuite( GraphvizDotTool.class ); + suite.addTestSuite( DepManDeepVersionDependencyGraphTest.class ); + suite.addTestSuite( SimpleDependencyGraphTest.class ); +// suite.addTestSuite( MavenProjectInfoReportsPluginDependencyGraphTest.class ); + suite.addTestSuite( ArchivaCommonDependencyGraphTest.class ); + suite.addTestSuite( WagonManagerDependencyGraphTest.class ); + suite.addTestSuite( ContinuumStoreDependencyGraphTest.class ); + suite.addTestSuite( ArchivaXmlToolsDependencyGraphTest.class ); + //$JUnit-END$ + return suite; + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/ArchivaCommonDependencyGraphTest.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/ArchivaCommonDependencyGraphTest.java new file mode 100644 index 000000000..26a598127 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/ArchivaCommonDependencyGraphTest.java @@ -0,0 +1,77 @@ +package org.apache.maven.archiva.dependency.graph; + +/* + * 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.archiva.dependency.DependencyGraphFactory; +import org.apache.maven.archiva.model.DependencyScope; +import org.apache.maven.archiva.model.VersionedReference; + +import java.util.ArrayList; +import java.util.List; + +/** + * ArchivaCommonDependencyGraphTest + * + * DependencyGraphTest for testing org.apache.maven.archiva:archiva-common:1.0-alpha-2-SNAPSHOT + * + * Generated by archivadev:generate-dependency-tests plugin + * @version $Id$ + */ +public class ArchivaCommonDependencyGraphTest + extends AbstractDependencyGraphFactoryTestCase +{ + public void testResolvedDepsToNodes() + throws GraphTaskException + { + MemoryRepositoryDependencyGraphBuilder graphBuilder = + new MemoryRepositoryDependencyGraphBuilder(); + MemoryRepository repository = new ArchivaCommonMemoryRepository(); + graphBuilder.setMemoryRepository( repository ); + + // Create the factory, and add the test resolver. + DependencyGraphFactory factory = new DependencyGraphFactory(); + factory.setGraphBuilder( graphBuilder ); + factory.setDesiredScope( DependencyScope.TEST ); + + // Get the model to resolve from + VersionedReference rootRef = toVersionedReference( "org.apache.maven.archiva:archiva-common:1.0-alpha-2-SNAPSHOT"); + + // Perform the resolution. + DependencyGraph graph = factory.getGraph( rootRef ); + + // Test the results. + assertNotNull( "Graph shouldn't be null.", graph ); + + String expectedRootRef = "org.apache.maven.archiva:archiva-common:1.0-alpha-2-SNAPSHOT"; + List expectedNodes = new ArrayList(); + + // Check for all nodes, regardless of scope. + expectedNodes.clear(); + expectedNodes.add( "commons-lang:commons-lang:2.2::jar" ); + expectedNodes.add( "junit:junit:3.8.1::jar" ); + expectedNodes.add( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ); + expectedNodes.add( "org.codehaus.plexus:plexus-component-api:1.0-alpha-22::jar" ); + expectedNodes.add( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ); + expectedNodes.add( "org.codehaus.plexus:plexus-utils:1.4::jar" ); + + assertGraph( graph, expectedRootRef, expectedNodes ); + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/ArchivaCommonMemoryRepository.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/ArchivaCommonMemoryRepository.java new file mode 100644 index 000000000..c41474dfe --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/ArchivaCommonMemoryRepository.java @@ -0,0 +1,3469 @@ +package org.apache.maven.archiva.dependency.graph; + +/* + * 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.archiva.model.ArchivaProjectModel; +import org.apache.maven.archiva.model.Dependency; +import org.apache.maven.archiva.model.VersionedReference; + +/** + * ArchivaCommonMemoryRepository + * + * MemoryRepository for testing org.apache.maven.archiva:archiva-common:1.0-alpha-2-SNAPSHOT + * + * Generated by archivadev:generate-dependency-tests plugin + * @version $Id$ + */ +public class ArchivaCommonMemoryRepository + extends AbstractMemoryRepository +{ + public void initialize() + { + ArchivaProjectModel model; + Dependency dep; + + model = toModel( "org.apache.maven.archiva:archiva-common:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-base:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:2.2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + model.addDependencyManagement( toDependency( "javax.activation:activation:1.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-applet:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-artifact-converter:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-artifact-reports:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-common:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-configuration:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-consumer-api:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-converter:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-core:1.0-alpha-2-SNAPSHOT-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-core-consumers:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-database:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-database-consumers:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-indexer:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-lucene-consumers:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-model:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-plexus-application:1.0-alpha-2-SNAPSHOT::plexus-application" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-policies:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-proxy:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-report-manager:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-repository-layer:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-scheduled:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-security:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-signature-consumers:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-transaction:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-webapp:1.0-alpha-2-SNAPSHOT::war" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-xml-tools:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "commons-collections:commons-collections:3.2::jar" ) ); + model.addDependencyManagement( toDependency( "commons-io:commons-io:1.2::jar" ) ); + model.addDependencyManagement( toDependency( "commons-lang:commons-lang:2.2::jar" ) ); + model.addDependencyManagement( toDependency( "commons-logging:commons-logging:1.0.4::jar" ) ); + model.addDependencyManagement( toDependency( "commons-logging:commons-logging-api:1.0.4::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.derby:derby:10.1.3.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.derby:derbytools:10.1.3.1::jar" ) ); + model.addDependencyManagement( toDependency( "dom4j:dom4j:1.6.1::jar" ) ); + model.addDependencyManagement( toDependency( "easymock:easymock:1.2_Java1.3::jar" ) ); + model.addDependencyManagement( toDependency( "hsqldb:hsqldb:1.8.0.7::jar" ) ); + model.addDependencyManagement( toDependency( "jaxen:jaxen:1.1::jar" ) ); + model.addDependencyManagement( toDependency( "javax.jdo:jdo2-api:2.0::jar" ) ); + model.addDependencyManagement( toDependency( "jdom:jdom:1.0::jar" ) ); + model.addDependencyManagement( toDependency( "jpox:jpox:1.1.7::jar" ) ); + model.addDependencyManagement( toDependency( "javax.servlet:jsp-api:2.0::jar" ) ); + model.addDependencyManagement( toDependency( "javax.servlet:jstl:1.1.2::jar" ) ); + model.addDependencyManagement( toDependency( "log4j:log4j:1.2.8::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.lucene:lucene-core:2.0.0::jar" ) ); + model.addDependencyManagement( toDependency( "javax.mail:mail:1.4::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven:maven-artifact:2.0.5::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven:maven-artifact-manager:2.0.5::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven:maven-model:2.0.5::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven:maven-project:2.0.5::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven:maven-repository-metadata:2.0.5::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.shared:maven-app-configuration-model:1.0::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.shared:maven-app-configuration-web:1.0::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.shared:maven-model-converter:2.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-appserver-host:2.0-alpha-8::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-appserver-service-jetty:2.0-alpha-8::plexus-service" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-cli:1.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-command-line:1.0-alpha-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-22::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-digest:1.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-expression-evaluator:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-i18n:1.0-beta-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-jdo2:1.0-alpha-8::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-naming:1.0-alpha-3::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-quartz:1.0-alpha-3::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-slf4j-logging:1.1-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-taskqueue:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-xwork-integration:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.cache:plexus-cache-api:1.0-alpha-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.cache:plexus-cache-ehcache:1.0-alpha-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-rbac-memory:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-rbac-role-manager:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-taglib:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-xwork-content:1.0-alpha-1::war" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-xwork-integration:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.registry:plexus-registry-api:1.0-alpha-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.registry:plexus-registry-commons:1.0-alpha-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.webdav:plexus-webdav-simple:1.0-alpha-2::jar" ) ); + model.addDependencyManagement( toDependency( "javax.servlet:servlet-api:2.4::jar" ) ); + model.addDependencyManagement( toDependency( "opensymphony:sitemesh:2.2.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.slf4j:slf4j-log4j12:1.2::jar" ) ); + model.addDependencyManagement( toDependency( "taglibs:standard:1.1.2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-file:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-http-lightweight:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "opensymphony:webwork:2.2.4::jar" ) ); + model.addDependencyManagement( toDependency( "xmlunit:xmlunit:1.0::jar" ) ); + model.addProperty( "wagon.version", "1.0-beta-2" ); + model.addProperty( "redback.version", "1.0-alpha-1" ); + model.addProperty( "maven.version", "2.0.5" ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-base:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-parent:1.0-alpha-2-SNAPSHOT" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-parent:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven:maven-parent:5" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependencyManagement( toDependency( "javax.activation:activation:1.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-applet:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-artifact-converter:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-artifact-reports:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-common:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-configuration:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-consumer-api:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-converter:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-core:1.0-alpha-2-SNAPSHOT-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-core-consumers:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-database:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-database-consumers:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-indexer:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-lucene-consumers:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-model:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-plexus-application:1.0-alpha-2-SNAPSHOT::plexus-application" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-policies:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-proxy:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-report-manager:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-repository-layer:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-scheduled:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-security:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-signature-consumers:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-transaction:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-webapp:1.0-alpha-2-SNAPSHOT::war" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-xml-tools:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "commons-collections:commons-collections:3.2::jar" ) ); + model.addDependencyManagement( toDependency( "commons-io:commons-io:1.2::jar" ) ); + model.addDependencyManagement( toDependency( "commons-lang:commons-lang:2.2::jar" ) ); + model.addDependencyManagement( toDependency( "commons-logging:commons-logging:1.0.4::jar" ) ); + model.addDependencyManagement( toDependency( "commons-logging:commons-logging-api:1.0.4::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.derby:derby:10.1.3.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.derby:derbytools:10.1.3.1::jar" ) ); + model.addDependencyManagement( toDependency( "dom4j:dom4j:1.6.1::jar" ) ); + model.addDependencyManagement( toDependency( "easymock:easymock:1.2_Java1.3::jar" ) ); + model.addDependencyManagement( toDependency( "hsqldb:hsqldb:1.8.0.7::jar" ) ); + model.addDependencyManagement( toDependency( "jaxen:jaxen:1.1::jar" ) ); + model.addDependencyManagement( toDependency( "javax.jdo:jdo2-api:2.0::jar" ) ); + model.addDependencyManagement( toDependency( "jdom:jdom:1.0::jar" ) ); + model.addDependencyManagement( toDependency( "jpox:jpox:1.1.7::jar" ) ); + model.addDependencyManagement( toDependency( "javax.servlet:jsp-api:2.0::jar" ) ); + model.addDependencyManagement( toDependency( "javax.servlet:jstl:1.1.2::jar" ) ); + model.addDependencyManagement( toDependency( "log4j:log4j:1.2.8::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.lucene:lucene-core:2.0.0::jar" ) ); + model.addDependencyManagement( toDependency( "javax.mail:mail:1.4::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven:maven-artifact:2.0.5::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven:maven-artifact-manager:2.0.5::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven:maven-model:2.0.5::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven:maven-project:2.0.5::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven:maven-repository-metadata:2.0.5::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.shared:maven-app-configuration-model:1.0::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.shared:maven-app-configuration-web:1.0::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.shared:maven-model-converter:2.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-appserver-host:2.0-alpha-8::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-appserver-service-jetty:2.0-alpha-8::plexus-service" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-cli:1.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-command-line:1.0-alpha-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-22::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-digest:1.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-expression-evaluator:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-i18n:1.0-beta-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-jdo2:1.0-alpha-8::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-naming:1.0-alpha-3::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-quartz:1.0-alpha-3::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-slf4j-logging:1.1-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-taskqueue:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-xwork-integration:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.cache:plexus-cache-api:1.0-alpha-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.cache:plexus-cache-ehcache:1.0-alpha-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-rbac-memory:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-rbac-role-manager:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-taglib:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-xwork-content:1.0-alpha-1::war" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-xwork-integration:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.registry:plexus-registry-api:1.0-alpha-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.registry:plexus-registry-commons:1.0-alpha-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.webdav:plexus-webdav-simple:1.0-alpha-2::jar" ) ); + model.addDependencyManagement( toDependency( "javax.servlet:servlet-api:2.4::jar" ) ); + model.addDependencyManagement( toDependency( "opensymphony:sitemesh:2.2.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.slf4j:slf4j-log4j12:1.2::jar" ) ); + model.addDependencyManagement( toDependency( "taglibs:standard:1.1.2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-file:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-http-lightweight:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "opensymphony:webwork:2.2.4::jar" ) ); + model.addDependencyManagement( toDependency( "xmlunit:xmlunit:1.0::jar" ) ); + model.addProperty( "wagon.version", "1.0-beta-2" ); + model.addProperty( "maven.version", "2.0.5" ); + model.addProperty( "redback.version", "1.0-alpha-1" ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-parent:5" ); + model.setParentProject( toParent( "org.apache:apache:3" ) ); + addModel( model ); + + model = toModel( "org.apache:apache:3" ); + addModel( model ); + + model = toModel( "junit:junit:3.8.1" ); + addModel( model ); + + model = toModel( "javax.activation:activation:1.1" ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-applet:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-web:1.0-alpha-2-SNAPSHOT" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-web:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-parent:1.0-alpha-2-SNAPSHOT" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-artifact-converter:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-base:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-repository-metadata:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact-manager:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-transaction:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.shared:maven-model-converter:2.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-repository-metadata:2.0.5" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.5" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven:2.0.5" ); + model.setParentProject( toParent( "org.apache.maven:maven-parent:5" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh-external:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-file:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-http-lightweight:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "easymock:easymock:1.2_Java1.3::jar", "test" ) ); + model.addDependencyManagement( toDependency( "classworlds:classworlds:1.1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0.3" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + model.addDependency( toDependency( "classworlds:classworlds:1.1-alpha-2::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-containers:1.0.3" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.4" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus:1.0.4" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-utils:1.0.4" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "classworlds:classworlds:1.1-alpha-2" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-utils:1.1" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.4" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-provider-api:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon:1.0-beta-2" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven:maven-parent:4" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-provider-test:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh-common-test:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh-common:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "junit:junit:3.8.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-interactivity-api:1.0-alpha-4::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-parent:4" ); + model.setParentProject( toParent( "org.apache:apache:3" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-provider-test:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon:1.0-beta-2" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-beta-2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8" ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar", "compile" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependency( toDependency( "classworlds:classworlds:1.1-alpha-2::jar", "compile" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-ssh-common-test:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-beta-2" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-ssh-common:1.0-beta-2::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-providers:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon:1.0-beta-2" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-test:1.0-beta-2::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh-common:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh-common-test:1.0-beta-2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-ssh-common:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-beta-2" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-interactivity-api:1.0-alpha-4::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-interactivity-api:1.0-alpha-4" ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-7::jar", "compile" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "classworlds:classworlds:1.1-alpha-2::jar", "compile" ) ); + model.addDependency( toDependency( "plexus:plexus-utils:1.0.2::jar", "compile" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-container-default:1.0-alpha-7" ); + model.setParentProject( toParent( "plexus:plexus-containers:1.0.2" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependency( toDependency( "plexus:plexus-utils:1.0.2::jar" ) ); + model.addDependency( toDependency( "classworlds:classworlds:1.1-alpha-2::jar" ) ); + addModel( model ); + + model = toModel( "plexus:plexus-containers:1.0.2" ); + model.setParentProject( toParent( "plexus:plexus-root:1.0.3" ) ); + addModel( model ); + + model = toModel( "plexus:plexus-root:1.0.3" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "plexus:plexus-utils:1.0.2" ); + model.setParentProject( toParent( "plexus:plexus-root:1.0.3" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-ssh:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-beta-2" ) ); + model.addDependency( toDependency( "com.jcraft:jsch:0.1.27::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-interactivity-api:1.0-alpha-4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-ssh-common:1.0-beta-2::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-ssh-common-test:1.0-beta-2::jar", "test" ) ); + addModel( model ); + + model = toModel( "com.jcraft:jsch:0.1.27" ); + dep = toDependency( "com.jcraft:jzlib:1.0.7::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "com.jcraft:jzlib:1.0.7" ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-ssh-external:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-beta-2" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-ssh-common:1.0-beta-2::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-ssh-common-test:1.0-beta-2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-file:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-beta-2" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-http-lightweight:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-beta-2" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-http-shared:1.0-beta-2::jar" ) ); + model.addDependency( toDependency( "xml-apis:xml-apis:1.0.b2::jar" ) ); + dep = toDependency( "plexus:plexus-jetty-httpd:1.0-beta-1::jar", "test" ); + addExclusion( dep, "plexus:plexus-container-default" ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-http-shared:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-beta-2" ) ); + model.addDependency( toDependency( "jtidy:jtidy:4aug2000r7-dev::jar" ) ); + addModel( model ); + + model = toModel( "jtidy:jtidy:4aug2000r7-dev" ); + addModel( model ); + + model = toModel( "xml-apis:xml-apis:1.0.b2" ); + addModel( model ); + + model = toModel( "plexus:plexus-jetty-httpd:1.0-beta-1" ); + model.setParentProject( toParent( "plexus:plexus-components:1.0" ) ); + model.addDependency( toDependency( "jetty:jetty:4.2.10::jar" ) ); + model.addDependency( toDependency( "servletapi:servletapi:2.3::jar" ) ); + addModel( model ); + + model = toModel( "plexus:plexus-components:1.0" ); + model.setParentProject( toParent( "plexus:plexus-root:1.0" ) ); + model.addDependency( toDependency( "plexus:plexus-container-default:1.0-alpha-2::jar" ) ); + addModel( model ); + + model = toModel( "plexus:plexus-root:1.0" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "plexus:plexus-container-default:1.0-alpha-2" ); + addModel( model ); + + model = toModel( "jetty:jetty:4.2.10" ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.3::jar", "runtime" ) ); + addModel( model ); + + model = toModel( "javax.servlet:servlet-api:2.3" ); + addModel( model ); + + model = toModel( "servletapi:servletapi:2.3" ); + model.setRelocation( new VersionedReference() ); + model.getRelocation().setGroupId( "javax.servlet" ); + model.getRelocation().setArtifactId( "servlet-api" ); + model.getRelocation().setVersion( "2.3" ); + addModel( model ); + + model = toModel( "easymock:easymock:1.2_Java1.3" ); + addModel( model ); + + model = toModel( "classworlds:classworlds:1.1" ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-artifact-manager:2.0.5" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.5" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-repository-metadata:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-file:1.0-beta-2::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-beta-2::jar" ) ); + model.addDependency( toDependency( "easymock:easymock:1.2_Java1.3::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-artifact:2.0.5" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.5" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-transaction:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-base:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-digest:1.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-digest:1.1" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.12" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4.1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-components:1.1.12" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.10" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-20::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-20::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus:1.0.10" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-component-api:1.0-alpha-20" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0-alpha-20" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-containers:1.0-alpha-20" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.10" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-19::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.3::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.9" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus:1.0.9" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-component-api:1.0-alpha-19" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0-alpha-19" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-containers:1.0-alpha-19" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.10" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-19::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.3::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-utils:1.3" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.8" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus:1.0.8" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-container-default:1.0-alpha-20" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0-alpha-20" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-19::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.3::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + model.addDependency( toDependency( "jmock:jmock:1.0.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "jmock:jmock:1.0.1" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-utils:1.4.1" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.11" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus:1.0.11" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-utils:1.4" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.9" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0-alpha-22" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-19::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.3::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + model.addDependency( toDependency( "jmock:jmock:1.0.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-containers:1.0-alpha-22" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.10" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-19::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.3::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.shared:maven-model-converter:2.1" ); + model.setParentProject( toParent( "org.apache.maven.shared:maven-shared-components:7" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-model-v3:2.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-model:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + model.addDependency( toDependency( "dom4j:dom4j:1.4::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.shared:maven-shared-components:7" ); + model.setParentProject( toParent( "org.apache.maven:maven-parent:5" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-model-v3:2.0" ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-model:2.0.4" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.4" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven:2.0.4" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh:1.0-alpha-7::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh-external:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-file:1.0-alpha-7::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-http-lightweight:1.0-alpha-6::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-provider-api:1.0-alpha-6" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon:1.0-alpha-6" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon:1.0-alpha-6" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-provider-test:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "junit:junit:3.8.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-provider-test:1.0-alpha-6" ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-ssh:1.0-alpha-7" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-alpha-6" ) ); + model.addDependency( toDependency( "com.jcraft:jsch:0.1.24::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-interactivity-api:1.0-alpha-4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-providers:1.0-alpha-6" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon:1.0-alpha-6" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-test:1.0-alpha-6::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-alpha-6::jar" ) ); + addModel( model ); + + model = toModel( "com.jcraft:jsch:0.1.24" ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-ssh-external:1.0-alpha-6" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-alpha-6" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-file:1.0-alpha-7" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-alpha-6" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-http-lightweight:1.0-alpha-6" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-alpha-6" ) ); + dep = toDependency( "plexus:plexus-jetty-httpd:1.0-beta-1::jar", "test" ); + addExclusion( dep, "plexus:plexus-container-default" ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "dom4j:dom4j:1.4" ); + model.addDependency( toDependency( "xml-apis:xml-apis:1.0.b2::jar" ) ); + model.addDependency( toDependency( "jaxen:jaxen:1.0-FCS::jar" ) ); + model.addDependency( toDependency( "saxpath:saxpath:1.0-FCS::jar" ) ); + model.addDependency( toDependency( "msv:msv:20020414::jar" ) ); + model.addDependency( toDependency( "relaxngDatatype:relaxngDatatype:20020414::jar" ) ); + model.addDependency( toDependency( "isorelax:isorelax:20020414::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "junitperf:junitperf:1.8::jar", "test" ) ); + model.addDependency( toDependency( "xerces:xerces:2.0.2::jar", "test" ) ); + model.addDependency( toDependency( "xalan:xalan:2.3.1::jar", "test" ) ); + model.addDependency( toDependency( "jtidy:jtidy:4aug2000r7-dev::jar", "test" ) ); + model.addDependency( toDependency( "pull-parser:pull-parser:2::jar", "test" ) ); + addModel( model ); + + model = toModel( "jaxen:jaxen:1.0-FCS" ); + addModel( model ); + + model = toModel( "saxpath:saxpath:1.0-FCS" ); + addModel( model ); + + model = toModel( "msv:msv:20020414" ); + addModel( model ); + + model = toModel( "relaxngDatatype:relaxngDatatype:20020414" ); + addModel( model ); + + model = toModel( "isorelax:isorelax:20020414" ); + addModel( model ); + + model = toModel( "junitperf:junitperf:1.8" ); + addModel( model ); + + model = toModel( "xerces:xerces:2.0.2" ); + model.setRelocation( new VersionedReference() ); + model.getRelocation().setGroupId( "xerces" ); + model.getRelocation().setArtifactId( "xercesImpl" ); + addModel( model ); + + model = toModel( "xerces:xercesImpl:2.0.2" ); + addModel( model ); + + model = toModel( "xalan:xalan:2.3.1" ); + addModel( model ); + + model = toModel( "pull-parser:pull-parser:2" ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-artifact-reports:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-reporting:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-report-manager:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-database:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-repository-layer:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-commons:1.0-alpha-2::jar", "test" ) ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.8.0.7::jar", "test" ) ); + model.addDependency( toDependency( "easymock:easymock:1.2_Java1.3::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-slf4j-logging:1.1-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.slf4j:slf4j-log4j12:1.2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-reporting:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-parent:1.0-alpha-2-SNAPSHOT" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-report-manager:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-reporting:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-database:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-repository-layer:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:2.2::jar" ) ); + model.addDependency( toDependency( "commons-io:commons-io:1.2::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-database:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-parent:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-consumer-api:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-configuration:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-model:1.0-alpha-2-SNAPSHOT::jar" ) ); + dep = toDependency( "org.codehaus.plexus:plexus-jdo2:1.0-alpha-8::jar" ); + addExclusion( dep, "xerces:xercesImpl" ); + addExclusion( dep, "xerces:xmlParserAPIs" ); + model.addDependency( dep ); + dep = toDependency( "jpox:jpox:1.1.7::jar", "compile" ); + addExclusion( dep, "javax.sql:jdbc-stdext" ); + model.addDependency( dep ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:2.2::jar" ) ); + model.addDependency( toDependency( "commons-io:commons-io:1.2::jar" ) ); + dep = toDependency( "commons-logging:commons-logging:1.0.4::jar" ); + addExclusion( dep, "logkit:logkit" ); + model.addDependency( dep ); + model.addDependency( toDependency( "log4j:log4j:1.2.8::jar" ) ); + model.addDependency( toDependency( "org.apache.derby:derby:10.1.3.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-commons:1.0-alpha-2::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-repository-layer:1.0-alpha-2-SNAPSHOT::jar", "test" ) ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.8.0.7::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.derby:derbytools:10.1.3.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-consumer-api:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-consumers:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-model:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:3.2::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-consumers:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-base:1.0-alpha-2-SNAPSHOT" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-model:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-base:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-common:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependency( toDependency( "javax.jdo:jdo2-api:2.0::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:2.2::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:3.2::jar" ) ); + model.addDependency( toDependency( "commons-io:commons-io:1.2::jar" ) ); + addModel( model ); + + model = toModel( "javax.jdo:jdo2-api:2.0" ); + model.addDependency( toDependency( "geronimo-spec:geronimo-spec-jta:1.0.1B-rc2::jar" ) ); + dep = toDependency( "xerces:xerces:2.4.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "xml-apis:xml-apis:1.0.b2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "geronimo-spec:geronimo-spec-jta:1.0.1B-rc2" ); + addModel( model ); + + model = toModel( "xerces:xerces:2.4.0" ); + model.setRelocation( new VersionedReference() ); + model.getRelocation().setGroupId( "xerces" ); + model.getRelocation().setArtifactId( "xercesImpl" ); + addModel( model ); + + model = toModel( "xerces:xercesImpl:2.4.0" ); + addModel( model ); + + model = toModel( "commons-lang:commons-lang:2.2" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "commons-collections:commons-collections:3.2" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "commons-io:commons-io:1.2" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-configuration:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-base:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-common:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-xml-tools:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-policies:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:2.2::jar" ) ); + model.addDependency( toDependency( "commons-io:commons-io:1.2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-api:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-commons:1.0-alpha-2::jar", "test" ) ); + model.addDependency( toDependency( "easymock:easymock:1.2_Java1.3::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-xml-tools:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-base:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-common:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:3.2::jar" ) ); + dep = toDependency( "dom4j:dom4j:1.6.1::jar" ); + addExclusion( dep, "xom:xom" ); + model.addDependency( dep ); + dep = toDependency( "jaxen:jaxen:1.1::jar" ); + addExclusion( dep, "jdom:jdom" ); + addExclusion( dep, "xom:xom" ); + model.addDependency( dep ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependency( toDependency( "org.slf4j:slf4j-log4j12:1.2::jar" ) ); + addModel( model ); + + model = toModel( "dom4j:dom4j:1.6.1" ); + dep = toDependency( "jaxme:jaxme-api:0.3::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "jaxen:jaxen:1.1-beta-6::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "msv:xsdlib:20030807::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "msv:relaxngDatatype:20030807::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "pull-parser:pull-parser:2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "xpp3:xpp3:1.1.3.3::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "stax:stax-api:1.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "xml-apis:xml-apis:1.0.b2::jar" ) ); + model.addDependency( toDependency( "junitperf:junitperf:1.8::jar", "test" ) ); + model.addDependency( toDependency( "stax:stax-ri:1.0::jar", "test" ) ); + model.addDependency( toDependency( "xerces:xercesImpl:2.6.2::jar", "test" ) ); + model.addDependency( toDependency( "xalan:xalan:2.5.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "jaxme:jaxme-api:0.3" ); + addModel( model ); + + model = toModel( "jaxen:jaxen:1.1-beta-6" ); + addModel( model ); + + model = toModel( "msv:xsdlib:20030807" ); + addModel( model ); + + model = toModel( "msv:relaxngDatatype:20030807" ); + addModel( model ); + + model = toModel( "xpp3:xpp3:1.1.3.3" ); + addModel( model ); + + model = toModel( "stax:stax-api:1.0" ); + addModel( model ); + + model = toModel( "stax:stax-ri:1.0" ); + addModel( model ); + + model = toModel( "xerces:xercesImpl:2.6.2" ); + addModel( model ); + + model = toModel( "xalan:xalan:2.5.1" ); + addModel( model ); + + model = toModel( "jaxen:jaxen:1.1" ); + model.addDependency( toDependency( "dom4j:dom4j:1.6.1::jar" ) ); + model.addDependency( toDependency( "jdom:jdom:1.0::jar" ) ); + model.addDependency( toDependency( "xml-apis:xml-apis:1.3.02::jar" ) ); + model.addDependency( toDependency( "xerces:xercesImpl:2.6.2::jar" ) ); + model.addDependency( toDependency( "xom:xom:1.0::jar" ) ); + addModel( model ); + + model = toModel( "jdom:jdom:1.0" ); + dep = toDependency( "xerces:xercesImpl:2.6.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "xml-apis:xml-apis:1.0.b2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "jaxen:jaxen:1.0-FCS::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "saxpath:saxpath:1.0-FCS::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "xalan:xalan:2.5.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "xerces:xercesImpl:2.6.0" ); + addModel( model ); + + model = toModel( "xalan:xalan:2.5.0" ); + addModel( model ); + + model = toModel( "xml-apis:xml-apis:1.3.02" ); + addModel( model ); + + model = toModel( "xom:xom:1.0" ); + model.addDependency( toDependency( "xerces:xmlParserAPIs:2.6.2::jar" ) ); + model.addDependency( toDependency( "xerces:xercesImpl:2.6.2::jar" ) ); + model.addDependency( toDependency( "xalan:xalan:2.6.0::jar" ) ); + model.addDependency( toDependency( "com.ibm.icu:icu4j:2.6.1::jar" ) ); + addModel( model ); + + model = toModel( "xerces:xmlParserAPIs:2.6.2" ); + addModel( model ); + + model = toModel( "xalan:xalan:2.6.0" ); + model.addDependency( toDependency( "xml-apis:xml-apis:2.0.2::jar" ) ); + dep = toDependency( "xerces:xercesImpl:2.6.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "xml-apis:xml-apis:2.0.2" ); + model.setRelocation( new VersionedReference() ); + model.getRelocation().setGroupId( "xml-apis" ); + model.getRelocation().setArtifactId( "xml-apis" ); + model.getRelocation().setVersion( "1.0.b2" ); + addModel( model ); + + model = toModel( "com.ibm.icu:icu4j:2.6.1" ); + addModel( model ); + + model = toModel( "org.slf4j:slf4j-log4j12:1.2" ); + model.setParentProject( toParent( "org.slf4j:slf4j-parent:1.2" ) ); + model.addDependency( toDependency( "org.slf4j:slf4j-api:1.2::jar" ) ); + model.addDependency( toDependency( "log4j:log4j:1.2.13::jar" ) ); + addModel( model ); + + model = toModel( "org.slf4j:slf4j-parent:1.2" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.slf4j:slf4j-api:1.2" ); + model.setParentProject( toParent( "org.slf4j:slf4j-parent:1.2" ) ); + addModel( model ); + + model = toModel( "log4j:log4j:1.2.13" ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-policies:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-base:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-common:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:2.2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-digest:1.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.cache:plexus-cache-ehcache:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "easymock:easymock:1.2_Java1.3::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-slf4j-logging:1.1-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.slf4j:slf4j-log4j12:1.2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.cache:plexus-cache-ehcache:1.0-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus.cache:plexus-cache-providers-parent:1.0-alpha-2" ) ); + model.addDependency( toDependency( "net.sf.ehcache:ehcache:1.2.4::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:3.2::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.cache:plexus-cache-providers-parent:1.0-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus.cache:plexus-cache-parent:1.0-alpha-2" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.cache:plexus-cache-api:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.cache:plexus-cache-test:1.0-alpha-2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.cache:plexus-cache-parent:1.0-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.9" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-16::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-16::jar" ) ); + model.addDependencyManagement( toDependency( "commons-lang:commons-lang:2.1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-components:1.1.9" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.10" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-16::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-16::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-component-api:1.0-alpha-16" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0-alpha-16" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-containers:1.0-alpha-16" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.9" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-16::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.3::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-container-default:1.0-alpha-16" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0-alpha-16" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-16::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.3::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + model.addDependency( toDependency( "jmock:jmock:1.0.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "commons-lang:commons-lang:2.1" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.cache:plexus-cache-api:1.0-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus.cache:plexus-cache-parent:1.0-alpha-2" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-16::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-16::jar" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:2.1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.cache:plexus-cache-test:1.0-alpha-2" ); + addModel( model ); + + model = toModel( "net.sf.ehcache:ehcache:1.2.4" ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.4::jar", "compile" ) ); + dep = toDependency( "org.hibernate:hibernate:3.2.0.cr3::jar", "test" ); + addExclusion( dep, "javax.transaction:jta" ); + addExclusion( dep, "javax.security:jacc" ); + model.addDependency( dep ); + dep = toDependency( "net.sf.hibernate:hibernate:2.1.8::jar", "test" ); + addExclusion( dep, "javax.transaction:jta" ); + addExclusion( dep, "javax.security:jacc" ); + model.addDependency( dep ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar", "test" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "httpunit:httpunit:1.6::jar", "test" ) ); + model.addDependency( toDependency( "commons-httpclient:commons-httpclient:3.0.1::jar", "test" ) ); + model.addDependency( toDependency( "com.cenqua.clover:clover:1.3.13::jar", "test" ) ); + model.addDependency( toDependency( "checkstyle:checkstyle:4.1::jar", "test" ) ); + model.addDependency( toDependency( "checkstyle:checkstyle-optional:4.1::jar", "test" ) ); + model.addDependency( toDependency( "commons-httpclient:commons-httpclient:3.0.1::jar", "test" ) ); + model.addDependency( toDependency( "httpunit:httpunit:1.6.1::jar", "test" ) ); + model.addDependency( toDependency( "httpunit:httpunit:1.6.1::jar", "test" ) ); + model.addProperty( "licenseFile", "${basedir}/tools/clover.license" ); + addModel( model ); + + model = toModel( "commons-logging:commons-logging:1.0.4" ); + dep = toDependency( "log4j:log4j:1.2.6::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "logkit:logkit:1.0.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + dep = toDependency( "avalon-framework:avalon-framework:4.1.3::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "log4j:log4j:1.2.6" ); + addModel( model ); + + model = toModel( "logkit:logkit:1.0.1" ); + addModel( model ); + + model = toModel( "junit:junit:3.7" ); + addModel( model ); + + model = toModel( "avalon-framework:avalon-framework:4.1.3" ); + addModel( model ); + + model = toModel( "org.hibernate:hibernate:3.2.0.cr3" ); + addModel( model ); + + model = toModel( "net.sf.hibernate:hibernate:2.1.8" ); + addModel( model ); + + model = toModel( "javax.servlet:servlet-api:2.4" ); + addModel( model ); + + model = toModel( "httpunit:httpunit:1.6" ); + model.addDependency( toDependency( "xerces:xmlParserAPIs:2.2.1::jar" ) ); + model.addDependency( toDependency( "xerces:xercesImpl:2.6.2::jar" ) ); + model.addDependency( toDependency( "nekohtml:nekohtml:0.9.1::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar" ) ); + model.addDependency( toDependency( "rhino:js:1.5R4.1::jar" ) ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.3::jar" ) ); + model.addDependency( toDependency( "jtidy:jtidy:4aug2000r7-dev::jar" ) ); + model.addDependency( toDependency( "javax.activation:activation:1.0.2::jar", "test" ) ); + model.addDependency( toDependency( "javax.mail:mail:1.3.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "xerces:xmlParserAPIs:2.2.1" ); + addModel( model ); + + model = toModel( "nekohtml:nekohtml:0.9.1" ); + model.addDependency( toDependency( "xerces:xerces:2.4.0::jar" ) ); + addModel( model ); + + model = toModel( "rhino:js:1.5R4.1" ); + addModel( model ); + + model = toModel( "javax.activation:activation:1.0.2" ); + addModel( model ); + + model = toModel( "javax.mail:mail:1.3.1" ); + model.addDependency( toDependency( "javax.activation:activation:1.0.2::jar", "compile" ) ); + addModel( model ); + + model = toModel( "commons-httpclient:commons-httpclient:3.0.1" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.3::jar" ) ); + model.addDependency( toDependency( "commons-codec:commons-codec:1.2::jar" ) ); + addModel( model ); + + model = toModel( "commons-logging:commons-logging:1.0.3" ); + dep = toDependency( "log4j:log4j:1.2.6::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "logkit:logkit:1.0.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + addModel( model ); + + model = toModel( "commons-codec:commons-codec:1.2" ); + addModel( model ); + + model = toModel( "com.cenqua.clover:clover:1.3.13" ); + addModel( model ); + + model = toModel( "checkstyle:checkstyle:4.1" ); + model.addDependency( toDependency( "antlr:antlr:2.7.2::jar" ) ); + model.addDependency( toDependency( "commons-beanutils:commons-beanutils-core:1.7.0::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.1::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.3::jar" ) ); + addModel( model ); + + model = toModel( "antlr:antlr:2.7.2" ); + addModel( model ); + + model = toModel( "commons-beanutils:commons-beanutils-core:1.7.0" ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.0::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + addModel( model ); + + model = toModel( "commons-logging:commons-logging:1.0" ); + addModel( model ); + + model = toModel( "commons-collections:commons-collections:2.0" ); + addModel( model ); + + model = toModel( "commons-collections:commons-collections:2.1" ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + addModel( model ); + + model = toModel( "checkstyle:checkstyle-optional:4.1" ); + model.addDependency( toDependency( "checkstyle:checkstyle:4.1::jar" ) ); + addModel( model ); + + model = toModel( "httpunit:httpunit:1.6.1" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-slf4j-logging:1.1-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-logging:1.0.4" ) ); + model.addDependency( toDependency( "org.slf4j:slf4j-simple:1.2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-logging-provider-test:1.0.4::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-logging:1.0.4" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.11" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-logging-provider-test:1.0.4::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-22::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-logging-provider-test:1.0.4" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-component-api:1.0-alpha-22" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0-alpha-22" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + addModel( model ); + + model = toModel( "org.slf4j:slf4j-simple:1.2" ); + model.setParentProject( toParent( "org.slf4j:slf4j-parent:1.2" ) ); + model.addDependency( toDependency( "org.slf4j:slf4j-api:1.2::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.registry:plexus-registry-api:1.0-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus.registry:plexus-registry:1.0-alpha-2" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-17::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.registry:plexus-registry:1.0-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.12" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-17::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.registry:plexus-registry-api:1.0-alpha-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.registry:plexus-registry-test:1.0-alpha-2::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-container-default:1.0-alpha-17" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0-alpha-17" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-17::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.3::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + model.addDependency( toDependency( "jmock:jmock:1.0.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-containers:1.0-alpha-17" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.9" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-17::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.3::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-component-api:1.0-alpha-17" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0-alpha-17" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.registry:plexus-registry-test:1.0-alpha-2" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.registry:plexus-registry-commons:1.0-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus.registry:plexus-registry-providers:1.0-alpha-2" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-api:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-test:1.0-alpha-2::jar", "test" ) ); + dep = toDependency( "commons-configuration:commons-configuration:1.3::jar" ); + addExclusion( dep, "commons-beanutils:commons-beanutils-core" ); + addExclusion( dep, "xerces:xerces" ); + addExclusion( dep, "xerces:xercesImpl" ); + addExclusion( dep, "xalan:xalan" ); + addExclusion( dep, "xml-apis:xml-apis" ); + addExclusion( dep, "servletapi:servletapi" ); + model.addDependency( dep ); + model.addDependency( toDependency( "commons-beanutils:commons-beanutils:1.7.0::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.registry:plexus-registry-providers:1.0-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus.registry:plexus-registry:1.0-alpha-2" ) ); + addModel( model ); + + model = toModel( "commons-configuration:commons-configuration:1.3" ); + model.addDependency( toDependency( "commons-collections:commons-collections:3.1::jar" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:2.1::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging-api:1.0.4::jar" ) ); + model.addDependency( toDependency( "commons-digester:commons-digester:1.6::jar" ) ); + model.addDependency( toDependency( "commons-beanutils:commons-beanutils-core:1.7.0::jar" ) ); + model.addDependency( toDependency( "commons-codec:commons-codec:1.3::jar" ) ); + model.addDependency( toDependency( "commons-jxpath:commons-jxpath:1.2::jar" ) ); + model.addDependency( toDependency( "xerces:xerces:2.2.1::jar" ) ); + model.addDependency( toDependency( "xalan:xalan:2.7.0::jar" ) ); + model.addDependency( toDependency( "xml-apis:xml-apis:2.0.2::jar" ) ); + dep = toDependency( "servletapi:servletapi:2.4::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "spice:spice-jndikit:1.1::jar", "test" ) ); + model.addDependency( toDependency( "commons-dbcp:commons-dbcp:1.1::jar", "test" ) ); + model.addDependency( toDependency( "commons-pool:commons-pool:1.1::jar", "test" ) ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.7.2.2::jar", "test" ) ); + model.addDependency( toDependency( "dbunit:dbunit:2.1::jar", "test" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "junit-addons:junit-addons:1.4::jar", "test" ) ); + model.addDependency( toDependency( "mockobjects:mockobjects-core:0.09::jar", "test" ) ); + model.addDependency( toDependency( "mockobjects:mockobjects-jdk1.4-j2ee1.3:0.09::jar", "test" ) ); + addModel( model ); + + model = toModel( "commons-collections:commons-collections:3.1" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "commons-logging:commons-logging-api:1.0.4" ); + addModel( model ); + + model = toModel( "commons-digester:commons-digester:1.6" ); + model.addDependency( toDependency( "commons-beanutils:commons-beanutils:1.6::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.1::jar" ) ); + model.addDependency( toDependency( "xml-apis:xml-apis:1.0.b2::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "commons-beanutils:commons-beanutils:1.6" ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.0::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + addModel( model ); + + model = toModel( "commons-codec:commons-codec:1.3" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "commons-jxpath:commons-jxpath:1.2" ); + model.addDependency( toDependency( "xerces:xerces:1.2.3::jar" ) ); + model.addDependency( toDependency( "servletapi:servletapi:2.2::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.8::jar" ) ); + model.addDependency( toDependency( "ant:ant-optional:1.5.1::jar" ) ); + model.addDependency( toDependency( "xml-apis:xml-apis:2.0.2::jar" ) ); + model.addDependency( toDependency( "jdom:jdom:b9::jar" ) ); + model.addDependency( toDependency( "commons-beanutils:commons-beanutils:1.4::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.0::jar" ) ); + addModel( model ); + + model = toModel( "xerces:xerces:1.2.3" ); + addModel( model ); + + model = toModel( "servletapi:servletapi:2.2" ); + model.setRelocation( new VersionedReference() ); + model.getRelocation().setGroupId( "javax.servlet" ); + model.getRelocation().setArtifactId( "servlet-api" ); + model.getRelocation().setVersion( "2.2" ); + addModel( model ); + + model = toModel( "javax.servlet:servlet-api:2.2" ); + addModel( model ); + + model = toModel( "junit:junit:3.8" ); + addModel( model ); + + model = toModel( "ant:ant-optional:1.5.1" ); + addModel( model ); + + model = toModel( "jdom:jdom:b9" ); + addModel( model ); + + model = toModel( "commons-beanutils:commons-beanutils:1.4" ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.0::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + addModel( model ); + + model = toModel( "xerces:xerces:2.2.1" ); + addModel( model ); + + model = toModel( "xalan:xalan:2.7.0" ); + model.addDependency( toDependency( "xml-apis:xml-apis:2.0.2::jar" ) ); + dep = toDependency( "xerces:xercesImpl:2.6.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "servletapi:servletapi:2.4" ); + addModel( model ); + + model = toModel( "spice:spice-jndikit:1.1" ); + addModel( model ); + + model = toModel( "commons-dbcp:commons-dbcp:1.1" ); + addModel( model ); + + model = toModel( "commons-pool:commons-pool:1.1" ); + addModel( model ); + + model = toModel( "hsqldb:hsqldb:1.7.2.2" ); + addModel( model ); + + model = toModel( "dbunit:dbunit:2.1" ); + addModel( model ); + + model = toModel( "junit-addons:junit-addons:1.4" ); + addModel( model ); + + model = toModel( "mockobjects:mockobjects-core:0.09" ); + addModel( model ); + + model = toModel( "mockobjects:mockobjects-jdk1.4-j2ee1.3:0.09" ); + addModel( model ); + + model = toModel( "commons-beanutils:commons-beanutils:1.7.0" ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.3::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-jdo2:1.0-alpha-8" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.6" ) ); + model.addDependency( toDependency( "javax.jdo:jdo2-api:2.0::jar" ) ); + dep = toDependency( "jpox:jpox:1.1.1::jar", "test" ); + addExclusion( dep, "javax.sql:jdbc-stdext" ); + model.addDependency( dep ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.7.3.0::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-components:1.1.6" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.8" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + addModel( model ); + + model = toModel( "jpox:jpox:1.1.1" ); + model.setParentProject( toParent( "jpox:jpox-parent:1.1.1" ) ); + model.addDependency( toDependency( "log4j:log4j:1.2.8::jar" ) ); + model.addDependency( toDependency( "javax.jdo:jdo2-api:2.0::jar" ) ); + model.addDependency( toDependency( "javax.resource:connector:1.0::jar" ) ); + dep = toDependency( "javax.security:jaas:1.0.01::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "javax.sql:jdbc-stdext:2.0::jar" ) ); + dep = toDependency( "ant:ant:1.6::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "jpox:jpox-dbcp:1.1.1::jar", "test" ) ); + model.addDependency( toDependency( "commons-dbcp:commons-dbcp:1.2::jar", "test" ) ); + model.addDependency( toDependency( "commons-pool:commons-pool:1.2::jar", "test" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:3.1::jar", "test" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "jpox:jpox-parent:1.1.1" ); + addModel( model ); + + model = toModel( "log4j:log4j:1.2.8" ); + addModel( model ); + + model = toModel( "javax.resource:connector:1.0" ); + addModel( model ); + + model = toModel( "javax.security:jaas:1.0.01" ); + addModel( model ); + + model = toModel( "javax.sql:jdbc-stdext:2.0" ); + addModel( model ); + + model = toModel( "ant:ant:1.6" ); + addModel( model ); + + model = toModel( "jpox:jpox-dbcp:1.1.1" ); + addModel( model ); + + model = toModel( "commons-dbcp:commons-dbcp:1.2" ); + addModel( model ); + + model = toModel( "commons-pool:commons-pool:1.2" ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.1::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "xml-apis:xml-apis:2.0.2::jar" ) ); + model.addDependency( toDependency( "xerces:xerces:2.0.2::jar" ) ); + addModel( model ); + + model = toModel( "hsqldb:hsqldb:1.7.3.0" ); + addModel( model ); + + model = toModel( "jpox:jpox:1.1.7" ); + model.setParentProject( toParent( "jpox:jpox-parent:1.1.7" ) ); + model.addDependency( toDependency( "log4j:log4j:1.2.8::jar" ) ); + model.addDependency( toDependency( "javax.jdo:jdo2-api:2.0::jar" ) ); + model.addDependency( toDependency( "javax.resource:connector:1.0::jar" ) ); + model.addDependency( toDependency( "javax.transaction:jta:1.0.1B::jar" ) ); + dep = toDependency( "ant:ant:1.6::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "jpox:jpox-parent:1.1.7" ); + addModel( model ); + + model = toModel( "javax.transaction:jta:1.0.1B" ); + addModel( model ); + + model = toModel( "org.apache.derby:derby:10.1.3.1" ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-repository-layer:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-base:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-configuration:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-consumer-api:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-model:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-xml-tools:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-expression-evaluator:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "org.slf4j:slf4j-log4j12:1.2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.cache:plexus-cache-api:1.0-alpha-2::jar", "compile" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.cache:plexus-cache-ehcache:1.0-alpha-2::jar", "compile" ) ); + model.addDependency( toDependency( "xmlunit:xmlunit:1.0::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-commons:1.0-alpha-2::jar", "test" ) ); + model.addDependency( toDependency( "easymock:easymock:1.2_Java1.3::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-expression-evaluator:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.7" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-components:1.1.7" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.8" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + addModel( model ); + + model = toModel( "xmlunit:xmlunit:1.0" ); + addModel( model ); + + model = toModel( "hsqldb:hsqldb:1.8.0.7" ); + addModel( model ); + + model = toModel( "org.apache.derby:derbytools:10.1.3.1" ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-converter:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-base:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-consumer-api:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-repository-layer:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-artifact-converter:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.shared:maven-model-converter:2.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-digest:1.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-i18n:1.0-beta-6::jar" ) ); + model.addDependency( toDependency( "commons-io:commons-io:1.2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-commons:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.8.0.7::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-i18n:1.0-beta-6" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.4" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-components:1.1.4" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.4" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-core:1.0-alpha-2-SNAPSHOT-SNAPSHOT" ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-core-consumers:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-consumers:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-configuration:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-consumer-api:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-repository-layer:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-digest:1.1::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-database-consumers:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-consumers:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-database:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-artifact-reports:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-configuration:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-consumer-api:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-repository-layer:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-digest:1.1::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-indexer:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-base:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-repository-layer:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-model:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.lucene:lucene-core:2.0.0::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-digest:1.1::jar" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:2.2::jar" ) ); + model.addDependency( toDependency( "commons-io:commons-io:1.2::jar" ) ); + model.addDependency( toDependency( "easymock:easymock:1.2_Java1.3::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.lucene:lucene-core:2.0.0" ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-lucene-consumers:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-consumers:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-indexer:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-configuration:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-consumer-api:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-repository-layer:1.0-alpha-2-SNAPSHOT::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-plexus-application:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-web-standalone:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-webapp:1.0-alpha-2-SNAPSHOT::war" ) ); + model.addProperty( "archivaVersion", "1.0-alpha-2-SNAPSHOT" ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-web-standalone:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-web:1.0-alpha-2-SNAPSHOT" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-webapp:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-web:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-report-manager:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-scheduled:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-indexer:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-proxy:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-database:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-repository-layer:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-security:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-core-consumers:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-database-consumers:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-lucene-consumers:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-signature-consumers:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-applet:1.0-alpha-2-SNAPSHOT::jar", "provided" ) ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar", "provided" ) ); + model.addDependency( toDependency( "javax.servlet:jsp-api:2.0::jar", "provided" ) ); + model.addDependency( toDependency( "opensymphony:sitemesh:2.2.1::jar" ) ); + model.addDependency( toDependency( "taglibs:standard:1.1.2::jar" ) ); + model.addDependency( toDependency( "javax.servlet:jstl:1.1.2::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.shared:maven-app-configuration-model:1.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.shared:maven-app-configuration-web:1.0::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-slf4j-logging:1.1-alpha-1::jar", "runtime" ) ); + model.addDependency( toDependency( "org.slf4j:slf4j-log4j12:1.2::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.4::jar", "runtime" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:2.2::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-http-lightweight:1.0-beta-2::jar", "runtime" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-file:1.0-beta-2::jar", "runtime" ) ); + model.addDependency( toDependency( "opensymphony:webwork:2.2.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-api:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-commons:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.cache:plexus-cache-api:1.0-alpha-2::jar", "compile" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.cache:plexus-cache-ehcache:1.0-alpha-2::jar", "compile" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-xwork-content:1.0-alpha-1::war", "runtime" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-xwork-integration:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-taglib:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.webdav:plexus-webdav-simple:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-xwork-integration:1.0-alpha-6::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependency( toDependency( "org.apache.derby:derby:10.1.3.1::jar", "provided" ) ); + model.addDependency( toDependency( "javax.mail:mail:1.4::jar", "provided" ) ); + model.addDependency( toDependency( "javax.activation:activation:1.1::jar", "provided" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-scheduled:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-parent:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-configuration:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-database:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-repository-layer:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-taskqueue:1.0-alpha-6::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-quartz:1.0-alpha-3::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:2.2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-api:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-database-consumers:1.0-alpha-2-SNAPSHOT::jar", "test" ) ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.8.0.7::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-commons:1.0-alpha-2::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-slf4j-logging:1.1-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.slf4j:slf4j-log4j12:1.2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-taskqueue:1.0-alpha-6" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.7" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "backport-util-concurrent:backport-util-concurrent:3.0::jar" ) ); + addModel( model ); + + model = toModel( "backport-util-concurrent:backport-util-concurrent:3.0" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-quartz:1.0-alpha-3" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.6" ) ); + model.addDependency( toDependency( "quartz:quartz:1.4.5::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.2::jar" ) ); + addModel( model ); + + model = toModel( "quartz:quartz:1.4.5" ); + addModel( model ); + + model = toModel( "commons-logging:commons-logging:1.0.2" ); + dep = toDependency( "log4j:log4j:1.1.3::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "logkit:logkit:1.0.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + addModel( model ); + + model = toModel( "log4j:log4j:1.1.3" ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-proxy:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-base:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-configuration:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-repository-layer:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "commons-io:commons-io:1.2::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-file:1.0-beta-2::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-beta-2::jar" ) ); + dep = toDependency( "org.codehaus.plexus:plexus-digest:1.1::jar" ); + addExclusion( dep, "org.codehaus.plexus:plexus-container-default" ); + model.addDependency( dep ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-commons:1.0-alpha-2::jar", "test" ) ); + model.addDependency( toDependency( "easymock:easymock:1.2_Java1.3::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-slf4j-logging:1.1-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.slf4j:slf4j-log4j12:1.2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-security:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-web:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-role-manager:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-memory:1.0-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-xwork-integration:1.0-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.derby:derby:10.1.3.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-rbac-role-manager:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-rbac:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-model:1.0-alpha-1::jar" ) ); + dep = toDependency( "net.java.dev.stax-utils:stax-utils:20060502::jar" ); + addExclusion( dep, "com.bea.xml:jsr173-ri" ); + model.addDependency( dep ); + model.addDependency( toDependency( "stax:stax-api:1.0.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.woodstox:wstx-asl:3.2.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-memory:1.0-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-jdo:1.0-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-model:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-common-jdo:1.0-alpha-1::jar" ) ); + dep = toDependency( "net.java.dev.stax-utils:stax-utils:20060502::jar" ); + addExclusion( dep, "com.bea.xml:jsr173-ri" ); + model.addDependency( dep ); + model.addDependency( toDependency( "stax:stax-api:1.0.1::jar" ) ); + dep = toDependency( "stax:stax:1.1.1-dev::jar", "test" ); + addExclusion( dep, "xmlbeans:xmlbeans-jsr173-api" ); + model.addDependency( dep ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.8.0.4::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-rbac:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback:1.0-alpha-1" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.10" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-20::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-20::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-configuration:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-system:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-policy:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-common-jdo:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-authentication-api:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-keys-api:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-keys-tests:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-keys-cached:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-keys-memory:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-keys-jdo:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-authentication-users:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-authentication-=keys=:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-authentication-memory:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-authentication-keys:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-authorization-api:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-users-api:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-users-jdo:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-users-memory:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-users-cached:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-users-tests:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-authorization-rbac:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-rbac-model:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-rbac-tests:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-rbac-memory:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-rbac-cached:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-rbac-jdo:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-rbac-role-manager:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-xwork-integration:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-taglib:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-xwork-content:1.0-alpha-1::war" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-xwork-integration:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-20::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-20::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.2::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-ehcache:1.0-alpha-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-mail-sender-api:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-mail-sender-javamail:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-expression-evaluator:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-log4j-logging:1.1-alpha-2::jar", "test" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-xwork-integration:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "xalan:xalan:2.7.0::jar" ) ); + model.addDependencyManagement( toDependency( "xml-apis:xml-apis:1.3.03::jar" ) ); + model.addDependencyManagement( toDependency( "commons-lang:commons-lang:2.2::jar" ) ); + model.addDependencyManagement( toDependency( "commons-collections:commons-collections:3.2::jar" ) ); + model.addDependencyManagement( toDependency( "commons-logging:commons-logging:1.0.4::jar" ) ); + model.addDependencyManagement( toDependency( "hsqldb:hsqldb:1.8.0.4::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.derby:derby:10.1.3.1::jar" ) ); + model.addProperty( "security.version", "1.0-alpha-1" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-configuration:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-expression-evaluator:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-commons:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-log4j-logging:1.1-alpha-2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.registry:plexus-registry-commons:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.registry:plexus-registry-providers:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-test:1.0-alpha-1::jar" ) ); + dep = toDependency( "commons-configuration:commons-configuration:1.3::jar" ); + addExclusion( dep, "commons-beanutils:commons-beanutils-core" ); + addExclusion( dep, "xerces:xerces" ); + addExclusion( dep, "xerces:xercesImpl" ); + addExclusion( dep, "xalan:xalan" ); + addExclusion( dep, "xml-apis:xml-apis" ); + addExclusion( dep, "servletapi:servletapi" ); + model.addDependency( dep ); + model.addDependency( toDependency( "commons-beanutils:commons-beanutils:1.7.0::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.registry:plexus-registry-providers:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.registry:plexus-registry:1.0-alpha-1" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.registry:plexus-registry:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.9" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-17::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.registry:plexus-registry-api:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.registry:plexus-registry-test:1.0-alpha-1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.registry:plexus-registry-api:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.registry:plexus-registry:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-17::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.registry:plexus-registry-test:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.registry:plexus-registry:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-17::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-log4j-logging:1.1-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-logging:1.0.2" ) ); + model.addDependency( toDependency( "log4j:log4j:1.2.8::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-logging-provider-test:1.0-alpha-2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-logging:1.0.2" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.4" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-logging-provider-test:1.0-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-logging:1.0.2" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-system:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-configuration:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authentication-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authorization-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-cached:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-cached:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authentication-memory:1.0-alpha-1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authentication-api:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-authentication:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-policy:1.0-alpha-1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authentication:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-api:1.0-alpha-1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-users-api:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-users:1.0-alpha-1" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-users:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback:1.0-alpha-1" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-policy:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-configuration:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-api:1.0-alpha-1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authorization-api:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-authorization:1.0-alpha-1" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authorization:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-api:1.0-alpha-1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-users-cached:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-users-providers:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-policy:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-ehcache:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-jdo:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-tests:1.0-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-memory:1.0-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-log4j-logging:1.1-alpha-2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-users-providers:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-users:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-api:1.0-alpha-1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-ehcache:1.0-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.7" ) ); + model.addDependency( toDependency( "net.sf.ehcache:ehcache:1.2.4::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:3.2::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-users-jdo:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-users-providers:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-common-jdo:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-policy:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-tests:1.0-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.8.0.4::jar", "test" ) ); + dep = toDependency( "net.java.dev.stax-utils:stax-utils:20060502::jar" ); + addExclusion( dep, "com.bea.xml:jsr173-ri" ); + model.addDependency( dep ); + model.addDependency( toDependency( "stax:stax-api:1.0.1::jar" ) ); + model.addDependency( toDependency( "woodstox:wstx-asl:3.2.0::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-utils:1.2" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.5" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus:1.0.5" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-common-jdo:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-common:1.0-alpha-1" ) ); + dep = toDependency( "org.codehaus.plexus:plexus-jdo2:1.0-alpha-8::jar" ); + addExclusion( dep, "xerces:xercesImpl" ); + addExclusion( dep, "xerces:xmlParserAPIs" ); + model.addDependency( dep ); + dep = toDependency( "jpox:jpox:1.1.7::jar", "compile" ); + addExclusion( dep, "javax.sql:jdbc-stdext" ); + model.addDependency( dep ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.8.0.4::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-configuration:1.0-alpha-1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-common:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback:1.0-alpha-1" ) ); + addModel( model ); + + model = toModel( "hsqldb:hsqldb:1.8.0.4" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-users-tests:1.0-alpha-1" ); + addModel( model ); + + model = toModel( "net.java.dev.stax-utils:stax-utils:20060502" ); + model.addDependency( toDependency( "com.bea.xml:jsr173-ri:1.0::jar" ) ); + addModel( model ); + + model = toModel( "com.bea.xml:jsr173-ri:1.0" ); + model.addDependency( toDependency( "javax.xml:jsr173:1.0::jar" ) ); + addModel( model ); + + model = toModel( "javax.xml:jsr173:1.0" ); + addModel( model ); + + model = toModel( "stax:stax-api:1.0.1" ); + addModel( model ); + + model = toModel( "woodstox:wstx-asl:3.2.0" ); + model.setRelocation( new VersionedReference() ); + model.getRelocation().setGroupId( "org.codehaus.woodstox" ); + addModel( model ); + + model = toModel( "org.codehaus.woodstox:wstx-asl:3.2.0" ); + model.addDependency( toDependency( "stax:stax-api:1.0.1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-users-memory:1.0-alpha-1" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-keys-api:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-keys:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-digest:1.0::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-keys:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback:1.0-alpha-1" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-digest:1.0" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.7" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-keys-cached:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-keys-providers:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-ehcache:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-jdo:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-tests:1.0-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-memory:1.0-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-log4j-logging:1.1-alpha-2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-keys-providers:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-keys:1.0-alpha-1" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-keys-jdo:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-keys-providers:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-common-jdo:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-tests:1.0-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.8.0.4::jar", "test" ) ); + dep = toDependency( "net.java.dev.stax-utils:stax-utils:20060502::jar" ); + addExclusion( dep, "com.bea.xml:jsr173-ri" ); + model.addDependency( dep ); + model.addDependency( toDependency( "stax:stax-api:1.0.1::jar" ) ); + model.addDependency( toDependency( "woodstox:wstx-asl:3.2.0::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-keys-tests:1.0-alpha-1" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-keys-memory:1.0-alpha-1" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authentication-memory:1.0-alpha-1" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authentication-users:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-authentication-providers:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authentication-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-policy:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-cached:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-memory:1.0-alpha-1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authentication-providers:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-authentication:1.0-alpha-1" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authentication-=keys=:1.0-alpha-1" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authentication-keys:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-authentication-providers:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authentication-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-cached:1.0-alpha-1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authorization-rbac:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-authorization-providers:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authorization-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-cached:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-cached:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-model:1.0-alpha-1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authorization-providers:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-authorization:1.0-alpha-1" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-rbac-cached:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-rbac-providers:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-system:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authorization-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-model:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-ehcache:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-jdo:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-memory:1.0-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-tests:1.0-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-log4j-logging:1.1-alpha-2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-rbac-providers:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-rbac:1.0-alpha-1" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-rbac-model:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-rbac:1.0-alpha-1" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-rbac-jdo:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-rbac-providers:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-model:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-tests:1.0-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-common-jdo:1.0-alpha-1::jar" ) ); + dep = toDependency( "net.java.dev.stax-utils:stax-utils:20060502::jar" ); + addExclusion( dep, "com.bea.xml:jsr173-ri" ); + model.addDependency( dep ); + model.addDependency( toDependency( "stax:stax-api:1.0.1::jar" ) ); + dep = toDependency( "stax:stax:1.1.1-dev::jar", "test" ); + addExclusion( dep, "xmlbeans:xmlbeans-jsr173-api" ); + model.addDependency( dep ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.8.0.4::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-log4j-logging:1.1-alpha-2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-rbac-tests:1.0-alpha-1" ); + addModel( model ); + + model = toModel( "stax:stax:1.1.1-dev" ); + model.addDependency( toDependency( "xmlbeans:xmlbeans-jsr173-api:2.0-dev::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar" ) ); + addModel( model ); + + model = toModel( "xmlbeans:xmlbeans-jsr173-api:2.0-dev" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-rbac-memory:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-rbac-providers:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-system:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authorization-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-model:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-tests:1.0-alpha-1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-xwork-integration:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-xwork:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-configuration:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-system:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-policy:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authentication-users:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authentication-keys:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authorization-rbac:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-role-manager:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-xwork-integration:1.0-alpha-6::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-mail-sender-api:1.0-alpha-6::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-mail-sender-javamail:1.0-alpha-6::jar" ) ); + model.addDependency( toDependency( "org.extremecomponents:extremecomponents:1.0.1::jar" ) ); + model.addDependency( toDependency( "commons-beanutils:commons-beanutils-bean-collections:1.7.0::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.2::jar" ) ); + dep = toDependency( "org.codehaus.plexus:plexus-velocity:1.1.2::jar" ); + addExclusion( dep, "plexus:plexus-utils" ); + addExclusion( dep, "commons-logging:commons-logging-api" ); + model.addDependency( dep ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar", "provided" ) ); + model.addDependency( toDependency( "taglibs:standard:1.1.2::jar" ) ); + model.addDependency( toDependency( "javax.servlet:jstl:1.1.2::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:3.2::jar" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:2.2::jar" ) ); + model.addDependency( toDependency( "opensymphony:sitemesh:2.2.1::jar" ) ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.8.0.4::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-memory:1.0-alpha-1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-xwork:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-integrations:1.0-alpha-1" ) ); + model.addDependencyManagement( toDependency( "taglibs:standard:1.1.2::jar" ) ); + model.addDependencyManagement( toDependency( "javax.servlet:jstl:1.1.2::jar" ) ); + model.addDependencyManagement( toDependency( "javax.servlet:servlet-api:2.4::jar", "provided" ) ); + model.addDependencyManagement( toDependency( "javax.servlet:jsp-api:2.0::jar", "provided" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-integrations:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-system:1.0-alpha-1::jar" ) ); + addModel( model ); + + model = toModel( "taglibs:standard:1.1.2" ); + addModel( model ); + + model = toModel( "javax.servlet:jstl:1.1.2" ); + model.addDependency( toDependency( "javax.servlet:jsp-api:2.0::jar", "provided" ) ); + addModel( model ); + + model = toModel( "javax.servlet:jsp-api:2.0" ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar", "compile" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-xwork-integration:1.0-alpha-6" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.12" ) ); + model.addDependency( toDependency( "org.easymock:easymock:2.2::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-17::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-17::jar" ) ); + model.addDependency( toDependency( "opensymphony:xwork:1.2.1::jar" ) ); + model.addDependency( toDependency( "opensymphony:webwork:2.2.4::jar" ) ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar", "provided" ) ); + addModel( model ); + + model = toModel( "org.easymock:easymock:2.2" ); + addModel( model ); + + model = toModel( "opensymphony:xwork:1.2.1" ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.4::jar" ) ); + model.addDependency( toDependency( "org.rifers:rife-continuations:0.0.2::jar" ) ); + model.addDependency( toDependency( "opensymphony:oscore:2.2.4::jar" ) ); + model.addDependency( toDependency( "ognl:ognl:2.6.7::jar" ) ); + dep = toDependency( "org.springframework:spring-core:1.2.6::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "org.springframework:spring-aop:1.2.6::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "org.springframework:spring-beans:1.2.6::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "org.springframework:spring-context:1.2.6::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "org.springframework:spring-web:1.2.6::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "org.springframework:spring-mock:1.2.6::jar", "test" ) ); + dep = toDependency( "cglib:cglib:2.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependency( toDependency( "mockobjects:mockobjects-core:0.09::jar", "test" ) ); + model.addDependency( toDependency( "easymock:easymock:1.2_Java1.3::jar", "test" ) ); + model.addDependency( toDependency( "easymock:easymockclassextension:1.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.rifers:rife-continuations:0.0.2" ); + addModel( model ); + + model = toModel( "opensymphony:oscore:2.2.4" ); + addModel( model ); + + model = toModel( "ognl:ognl:2.6.7" ); + addModel( model ); + + model = toModel( "org.springframework:spring-core:1.2.6" ); + model.setParentProject( toParent( "org.springframework:spring-parent:1.2.6" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.4::jar" ) ); + dep = toDependency( "log4j:log4j:1.2.9::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "commons-collections:commons-collections:3.1::jar" ) ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar", "provided" ) ); + model.addDependency( toDependency( "xml-apis:xml-apis:1.0.b2::jar", "provided" ) ); + addModel( model ); + + model = toModel( "org.springframework:spring-parent:1.2.6" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependencyManagement( toDependency( "commons-logging:commons-logging:1.0.4::jar" ) ); + dep = toDependency( "log4j:log4j:1.2.9::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "cglib:cglib:2.1_3::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "commons-attributes:commons-attributes-compiler:2.1::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "org.hibernate:hibernate:3.0.5::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "org.hibernate:hibernate-annotations:3.0beta2::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "struts:struts:1.2.7::jar" ); + addExclusion( dep, "servletapi:servletapi" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "jasperreports:jasperreports:1.0.3::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "freemarker:freemarker:2.3.4::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + model.addDependencyManagement( toDependency( "javax.servlet:jsp-api:2.0::jar", "provided" ) ); + model.addDependencyManagement( toDependency( "javax.servlet:servlet-api:2.4::jar", "provided" ) ); + model.addDependencyManagement( toDependency( "aopalliance:aopalliance:1.0::jar" ) ); + model.addDependencyManagement( toDependency( "oro:oro:2.0.8::jar" ) ); + dep = toDependency( "commons-pool:commons-pool:1.2::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "com.jamonapi:jamon:1.0::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + model.addDependencyManagement( toDependency( "xdoclet:xjavadoc:1.1::jar" ) ); + model.addDependencyManagement( toDependency( "javax.mail:mail:1.3.2::jar" ) ); + dep = toDependency( "velocity:velocity:1.4::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + model.addDependencyManagement( toDependency( "commons-collections:commons-collections:3.1::jar" ) ); + model.addDependencyManagement( toDependency( "xml-apis:xml-apis:1.0.b2::jar", "provided" ) ); + model.addDependencyManagement( toDependency( "javax.transaction:jta:1.0.1B::jar" ) ); + dep = toDependency( "jotm:jotm:2.0.10::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "net.sf.hibernate:hibernate:2.1.8::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "c3p0:c3p0:0.9.0.2::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "commons-dbcp:commons-dbcp:1.2.1::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "com.experlog:xapool:1.5.0::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + model.addDependencyManagement( toDependency( "commons-lang:commons-lang:2.1::jar" ) ); + dep = toDependency( "com.oracle.toplink:toplink:10.1.3::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "ojb:db-ojb:1.0.3::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "javax.jdo:jdo:2.0-20050809.1515::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "com.ibatis:ibatis-sqlmap:1.3.1::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "com.ibatis:ibatis2-sqlmap:2.1.5.582::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "javax.jms:jms:1.1::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "javax.ejb:ejb:2.0::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "javax.xml:jaxrpc-api:1.1::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "commons-httpclient:commons-httpclient:3.0-rc4::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "com.caucho:burlap:2.1.12::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "com.caucho:hessian:2.1.12::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + model.addDependencyManagement( toDependency( "javax.resource:connector:1.0::jar" ) ); + model.addDependencyManagement( toDependency( "ehcache:ehcache:1.1::jar" ) ); + model.addDependencyManagement( toDependency( "quartz:quartz:1.5.1::jar" ) ); + model.addDependencyManagement( toDependency( "com.servlets:cos:05Nov2002::jar" ) ); + model.addDependencyManagement( toDependency( "easymock:easymock:1.2_RC2_Java1.3::jar", "test" ) ); + model.addDependencyManagement( toDependency( "javax.servlet:jstl:1.0::jar" ) ); + model.addDependencyManagement( toDependency( "taglibs:standard:1.0.6::jar" ) ); + dep = toDependency( "javax.faces:jsf-api:1.1::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "velocity-tools:velocity-tools-generic:1.1::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "velocity-tools:velocity-tools-view:1.1::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "poi:poi:2.5.1-final-20040804::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "itext:itext:1.3::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "net.sourceforge.jexcelapi:jxl:2.5.7::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + addModel( model ); + + model = toModel( "log4j:log4j:1.2.9" ); + addModel( model ); + + model = toModel( "cglib:cglib:2.1_3" ); + addModel( model ); + + model = toModel( "commons-attributes:commons-attributes-compiler:2.1" ); + model.addDependency( toDependency( "commons-attributes:commons-attributes-api:2.1::jar" ) ); + addModel( model ); + + model = toModel( "commons-attributes:commons-attributes-api:2.1" ); + model.addDependency( toDependency( "ant:ant:1.5::jar" ) ); + model.addDependency( toDependency( "qdox:qdox:1.5::jar" ) ); + addModel( model ); + + model = toModel( "ant:ant:1.5" ); + addModel( model ); + + model = toModel( "qdox:qdox:1.5" ); + addModel( model ); + + model = toModel( "org.hibernate:hibernate:3.0.5" ); + addModel( model ); + + model = toModel( "org.hibernate:hibernate-annotations:3.0beta2" ); + addModel( model ); + + model = toModel( "struts:struts:1.2.7" ); + addModel( model ); + + model = toModel( "jasperreports:jasperreports:1.0.3" ); + addModel( model ); + + model = toModel( "freemarker:freemarker:2.3.4" ); + addModel( model ); + + model = toModel( "aopalliance:aopalliance:1.0" ); + addModel( model ); + + model = toModel( "oro:oro:2.0.8" ); + addModel( model ); + + model = toModel( "com.jamonapi:jamon:1.0" ); + addModel( model ); + + model = toModel( "xdoclet:xjavadoc:1.1" ); + addModel( model ); + + model = toModel( "javax.mail:mail:1.3.2" ); + model.addDependency( toDependency( "javax.activation:activation:1.0.2::jar", "compile" ) ); + addModel( model ); + + model = toModel( "velocity:velocity:1.4" ); + model.addDependency( toDependency( "velocity:velocity-dep:1.4::jar", "runtime" ) ); + addModel( model ); + + model = toModel( "velocity:velocity-dep:1.4" ); + addModel( model ); + + model = toModel( "jotm:jotm:2.0.10" ); + addModel( model ); + + model = toModel( "c3p0:c3p0:0.9.0.2" ); + addModel( model ); + + model = toModel( "commons-dbcp:commons-dbcp:1.2.1" ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.1::jar" ) ); + model.addDependency( toDependency( "commons-pool:commons-pool:1.2::jar" ) ); + dep = toDependency( "javax.sql:jdbc-stdext:2.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "xml-apis:xml-apis:2.0.2::jar" ) ); + model.addDependency( toDependency( "xerces:xerces:2.0.2::jar" ) ); + addModel( model ); + + model = toModel( "com.experlog:xapool:1.5.0" ); + addModel( model ); + + model = toModel( "com.oracle.toplink:toplink:10.1.3" ); + addModel( model ); + + model = toModel( "ojb:db-ojb:1.0.3" ); + addModel( model ); + + model = toModel( "javax.jdo:jdo:2.0-20050809.1515" ); + addModel( model ); + + model = toModel( "com.ibatis:ibatis-sqlmap:1.3.1" ); + addModel( model ); + + model = toModel( "com.ibatis:ibatis2-sqlmap:2.1.5.582" ); + addModel( model ); + + model = toModel( "javax.jms:jms:1.1" ); + addModel( model ); + + model = toModel( "javax.ejb:ejb:2.0" ); + addModel( model ); + + model = toModel( "javax.xml:jaxrpc-api:1.1" ); + addModel( model ); + + model = toModel( "commons-httpclient:commons-httpclient:3.0-rc4" ); + addModel( model ); + + model = toModel( "com.caucho:burlap:2.1.12" ); + addModel( model ); + + model = toModel( "com.caucho:hessian:2.1.12" ); + addModel( model ); + + model = toModel( "ehcache:ehcache:1.1" ); + addModel( model ); + + model = toModel( "quartz:quartz:1.5.1" ); + addModel( model ); + + model = toModel( "com.servlets:cos:05Nov2002" ); + addModel( model ); + + model = toModel( "easymock:easymock:1.2_RC2_Java1.3" ); + addModel( model ); + + model = toModel( "javax.servlet:jstl:1.0" ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.3::jar", "provided" ) ); + addModel( model ); + + model = toModel( "taglibs:standard:1.0.6" ); + addModel( model ); + + model = toModel( "javax.faces:jsf-api:1.1" ); + addModel( model ); + + model = toModel( "velocity-tools:velocity-tools-generic:1.1" ); + addModel( model ); + + model = toModel( "velocity-tools:velocity-tools-view:1.1" ); + addModel( model ); + + model = toModel( "poi:poi:2.5.1-final-20040804" ); + addModel( model ); + + model = toModel( "itext:itext:1.3" ); + addModel( model ); + + model = toModel( "net.sourceforge.jexcelapi:jxl:2.5.7" ); + addModel( model ); + + model = toModel( "org.springframework:spring-aop:1.2.6" ); + model.setParentProject( toParent( "org.springframework:spring-parent:1.2.6" ) ); + model.addDependency( toDependency( "org.springframework:spring-beans:1.2.6::jar" ) ); + model.addDependency( toDependency( "aopalliance:aopalliance:1.0::jar" ) ); + model.addDependency( toDependency( "oro:oro:2.0.8::jar" ) ); + dep = toDependency( "commons-pool:commons-pool:1.2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "commons-attributes:commons-attributes-compiler:2.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "com.jamonapi:jamon:1.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "cglib:cglib:2.1_3::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "xdoclet:xjavadoc:1.1::jar", "test" ) ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar", "provided" ) ); + addModel( model ); + + model = toModel( "org.springframework:spring-beans:1.2.6" ); + model.setParentProject( toParent( "org.springframework:spring-parent:1.2.6" ) ); + model.addDependency( toDependency( "org.springframework:spring-core:1.2.6::jar" ) ); + dep = toDependency( "cglib:cglib:2.1_3::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar", "provided" ) ); + model.addDependency( toDependency( "javax.mail:mail:1.3.2::jar", "test" ) ); + model.addDependency( toDependency( "org.hibernate:hibernate:3.0.5::jar", "test" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.springframework:spring-context:1.2.6" ); + model.setParentProject( toParent( "org.springframework:spring-parent:1.2.6" ) ); + model.addDependency( toDependency( "org.springframework:spring-aop:1.2.6::jar" ) ); + dep = toDependency( "velocity:velocity:1.4::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "freemarker:freemarker:2.3.4::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "jasperreports:jasperreports:1.0.3::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "org.springframework:spring-web:1.2.6" ); + model.setParentProject( toParent( "org.springframework:spring-parent:1.2.6" ) ); + model.addDependency( toDependency( "javax.servlet:jsp-api:2.0::jar", "provided" ) ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar", "provided" ) ); + model.addDependency( toDependency( "javax.servlet:jstl:1.0::jar" ) ); + model.addDependency( toDependency( "org.springframework:spring-context:1.2.6::jar" ) ); + dep = toDependency( "log4j:log4j:1.2.9::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "struts:struts:1.2.7::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "com.servlets:cos:05Nov2002::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "taglibs:standard:1.0.6::jar" ) ); + dep = toDependency( "javax.faces:jsf-api:1.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "org.springframework:spring-mock:1.2.6" ); + model.setParentProject( toParent( "org.springframework:spring-parent:1.2.6" ) ); + dep = toDependency( "org.springframework:spring-jdbc:1.2.6::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "org.springframework:spring-web:1.2.6::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "javax.servlet:jsp-api:2.0::jar", "provided" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + addModel( model ); + + model = toModel( "org.springframework:spring-jdbc:1.2.6" ); + addModel( model ); + + model = toModel( "cglib:cglib:2.1" ); + model.addDependency( toDependency( "asm:asm:1.5.3::jar" ) ); + model.addDependency( toDependency( "asm:asm-util:1.3.4::jar" ) ); + model.addDependency( toDependency( "aspectwerkz:aspectwerkz-core:0.8.1::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + addModel( model ); + + model = toModel( "asm:asm:1.5.3" ); + addModel( model ); + + model = toModel( "asm:asm-util:1.3.4" ); + addModel( model ); + + model = toModel( "aspectwerkz:aspectwerkz-core:0.8.1" ); + addModel( model ); + + model = toModel( "easymock:easymockclassextension:1.1" ); + addModel( model ); + + model = toModel( "opensymphony:webwork:2.2.4" ); + model.addDependency( toDependency( "opensymphony:xwork:1.2.1::jar" ) ); + dep = toDependency( "opensymphony:xwork-tiger:1.2.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "freemarker:freemarker:2.3.4::jar" ) ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar", "provided" ) ); + model.addDependency( toDependency( "javax.servlet:jsp-api:2.0::jar", "provided" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.4::jar" ) ); + dep = toDependency( "commons-lang:commons-lang:2.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "dwr:dwr:1.1-beta-3::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "velocity:velocity:1.4::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "velocity-tools:velocity-tools:1.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "commons-fileupload:commons-fileupload:1.1.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "servlets.com:cos:05Nov2002::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "opensymphony:pell-multipart:2.1.5::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "opensymphony:sitemesh:2.2.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "jetty:org.mortbay.jetty:5.1.4::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "eclipse:jdtcore:3.1.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "jasperreports:jasperreports:1.1.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "jfree:jfreechart:1.0.0::jar" ); + addExclusion( dep, "gnujaxp:gnujaxp" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "org.apache.struts.tiles:tiles-core:0.2-SNAPSHOT::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "commons-digester:commons-digester:1.7::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "portlet-api:portlet-api:1.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "org.apache.pluto:pluto:1.0.1-rc4::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-10-SNAPSHOT::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "picocontainer:picocontainer:1.2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "picocontainer:picocontainer-gems:1.2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "nanocontainer:nanocontainer:1.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "nanocontainer:nanocontainer-nanowar:1.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "org.springframework:spring-beans:1.2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "org.springframework:spring-core:1.2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "org.springframework:spring-context:1.2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "org.springframework:spring-web:1.2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "org.springframework:spring-mock:1.2::jar", "compile" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "xpp3:xpp3:1.1.3.4-RC8::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "junit:junit:3.8.1::jar", "compile" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "jmock:jmock:1.0.1::jar", "test" ) ); + model.addDependency( toDependency( "easymock:easymock:1.2_Java1.3::jar", "test" ) ); + model.addDependency( toDependency( "easymock:easymockclassextension:1.1::jar", "test" ) ); + model.addDependency( toDependency( "jmock:jmock-cglib:1.0.1::jar", "test" ) ); + model.addDependency( toDependency( "mockobjects:mockobjects-core:0.09::jar", "test" ) ); + model.addDependency( toDependency( "mockobjects:mockobjects-jdk1.3:0.09::jar", "test" ) ); + model.addDependency( toDependency( "mockobjects:mockobjects-alt-jdk1.3:0.09::jar", "test" ) ); + model.addDependency( toDependency( "mockobjects:mockobjects-alt-jdk1.3-j2ee1.3:0.09::jar", "test" ) ); + model.addDependency( toDependency( "mockobjects:mockobjects-jdk1.3-j2ee1.3:0.09::jar", "test" ) ); + addModel( model ); + + model = toModel( "opensymphony:xwork-tiger:1.2.1" ); + addModel( model ); + + model = toModel( "commons-lang:commons-lang:2.0" ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + addModel( model ); + + model = toModel( "dwr:dwr:1.1-beta-3" ); + addModel( model ); + + model = toModel( "velocity-tools:velocity-tools:1.1" ); + addModel( model ); + + model = toModel( "commons-fileupload:commons-fileupload:1.1.1" ); + addModel( model ); + + model = toModel( "servlets.com:cos:05Nov2002" ); + addModel( model ); + + model = toModel( "opensymphony:pell-multipart:2.1.5" ); + addModel( model ); + + model = toModel( "opensymphony:sitemesh:2.2.1" ); + addModel( model ); + + model = toModel( "jetty:org.mortbay.jetty:5.1.4" ); + addModel( model ); + + model = toModel( "eclipse:jdtcore:3.1.0" ); + addModel( model ); + + model = toModel( "jasperreports:jasperreports:1.1.0" ); + addModel( model ); + + model = toModel( "jfree:jfreechart:1.0.0" ); + addModel( model ); + + model = toModel( "org.apache.struts.tiles:tiles-core:0.2-SNAPSHOT" ); + addModel( model ); + + model = toModel( "commons-digester:commons-digester:1.7" ); + model.addDependency( toDependency( "commons-beanutils:commons-beanutils:1.6::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.1::jar" ) ); + model.addDependency( toDependency( "xml-apis:xml-apis:1.0.b2::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "portlet-api:portlet-api:1.0" ); + addModel( model ); + + model = toModel( "org.apache.pluto:pluto:1.0.1-rc4" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-container-default:1.0-alpha-10-SNAPSHOT" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0.6-SNAPSHOT" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.2::jar" ) ); + model.addDependency( toDependency( "classworlds:classworlds:1.1::jar" ) ); + model.addDependency( toDependency( "jmock:jmock:1.0.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-containers:1.0.6-SNAPSHOT" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.8-SNAPSHOT" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus:1.0.8-SNAPSHOT" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "picocontainer:picocontainer:1.2" ); + addModel( model ); + + model = toModel( "picocontainer:picocontainer-gems:1.2" ); + addModel( model ); + + model = toModel( "nanocontainer:nanocontainer:1.0" ); + addModel( model ); + + model = toModel( "nanocontainer:nanocontainer-nanowar:1.0" ); + addModel( model ); + + model = toModel( "org.springframework:spring-beans:1.2" ); + addModel( model ); + + model = toModel( "org.springframework:spring-core:1.2" ); + addModel( model ); + + model = toModel( "org.springframework:spring-context:1.2" ); + addModel( model ); + + model = toModel( "org.springframework:spring-web:1.2" ); + addModel( model ); + + model = toModel( "org.springframework:spring-mock:1.2" ); + addModel( model ); + + model = toModel( "xpp3:xpp3:1.1.3.4-RC8" ); + addModel( model ); + + model = toModel( "jmock:jmock-cglib:1.0.1" ); + model.addDependency( toDependency( "jmock:jmock:1.0.1::jar" ) ); + model.addDependency( toDependency( "cglib:cglib-full:2.0::jar" ) ); + addModel( model ); + + model = toModel( "cglib:cglib-full:2.0" ); + addModel( model ); + + model = toModel( "mockobjects:mockobjects-jdk1.3:0.09" ); + addModel( model ); + + model = toModel( "mockobjects:mockobjects-alt-jdk1.3:0.09" ); + addModel( model ); + + model = toModel( "mockobjects:mockobjects-alt-jdk1.3-j2ee1.3:0.09" ); + addModel( model ); + + model = toModel( "mockobjects:mockobjects-jdk1.3-j2ee1.3:0.09" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-mail-sender-api:1.0-alpha-6" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-mail-sender:1.0-alpha-6" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-mail-sender:1.0-alpha-6" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.9" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-mail-sender-javamail:1.0-alpha-6" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-mail-senders:1.0-alpha-6" ) ); + model.addDependency( toDependency( "javax.mail:mail:1.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-mail-sender-test:1.0-alpha-6::jar", "test" ) ); + dep = toDependency( "org.codehaus.plexus:plexus-naming:1.0-alpha-1::jar", "test" ); + addExclusion( dep, "geronimo-spec:geronimo-spec-javamail" ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-mail-senders:1.0-alpha-6" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-mail-sender:1.0-alpha-6" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-mail-sender-api:1.0-alpha-6::jar" ) ); + addModel( model ); + + model = toModel( "javax.mail:mail:1.4" ); + model.addDependency( toDependency( "javax.activation:activation:1.1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-mail-sender-test:1.0-alpha-6" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-mail-senders:1.0-alpha-6" ) ); + model.addDependency( toDependency( "dumbster:dumbster:1.5::jar" ) ); + addModel( model ); + + model = toModel( "dumbster:dumbster:1.5" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-naming:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.6" ) ); + model.addDependency( toDependency( "directory-naming:naming-core:0.8::jar" ) ); + model.addDependency( toDependency( "directory-naming:naming-java:0.8::jar" ) ); + model.addDependency( toDependency( "directory-naming:naming-factory:0.8::jar" ) ); + model.addDependency( toDependency( "commons-dbcp:commons-dbcp:1.2.1::jar" ) ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.7.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "directory-naming:naming-core:0.8" ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.3::jar" ) ); + addModel( model ); + + model = toModel( "directory-naming:naming-java:0.8" ); + model.addDependency( toDependency( "directory-naming:naming-core:0.8::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.3::jar" ) ); + addModel( model ); + + model = toModel( "directory-naming:naming-factory:0.8" ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.3::jar" ) ); + model.addDependency( toDependency( "directory-naming:naming-core:0.8::jar" ) ); + model.addDependency( toDependency( "geronimo-spec:geronimo-spec-javamail:1.3.1-rc1::jar" ) ); + addModel( model ); + + model = toModel( "geronimo-spec:geronimo-spec-javamail:1.3.1-rc1" ); + addModel( model ); + + model = toModel( "hsqldb:hsqldb:1.7.1" ); + addModel( model ); + + model = toModel( "org.extremecomponents:extremecomponents:1.0.1" ); + dep = toDependency( "avalon-framework:avalon-framework:4.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "batik:batik:1.5-fop-0.20-5::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "commons-beanutils:commons-beanutils:1.7.0::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:3.0::jar" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:2.0::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.4::jar" ) ); + dep = toDependency( "fop:fop:0.20.5::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + dep = toDependency( "poi:poi:2.5.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "servletapi:servletapi:2.3::jar", "provided" ) ); + model.addDependency( toDependency( "taglibs:standard:1.0.2::jar" ) ); + dep = toDependency( "xalan:xalan:2.5.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "xerces:xercesImpl:2.6.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "xml-apis:xml-apis:2.0.2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "avalon-framework:avalon-framework:4.0" ); + addModel( model ); + + model = toModel( "batik:batik:1.5-fop-0.20-5" ); + addModel( model ); + + model = toModel( "commons-collections:commons-collections:3.0" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "fop:fop:0.20.5" ); + addModel( model ); + + model = toModel( "poi:poi:2.5.1" ); + model.setRelocation( new VersionedReference() ); + model.getRelocation().setGroupId( "poi" ); + model.getRelocation().setArtifactId( "poi" ); + model.getRelocation().setVersion( "2.5.1-final-20040804" ); + addModel( model ); + + model = toModel( "taglibs:standard:1.0.2" ); + addModel( model ); + + model = toModel( "xerces:xercesImpl:2.6.1" ); + addModel( model ); + + model = toModel( "commons-beanutils:commons-beanutils-bean-collections:1.7.0" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-velocity:1.1.2" ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-7::jar", "compile" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "classworlds:classworlds:1.1-alpha-2::jar", "compile" ) ); + model.addDependency( toDependency( "plexus:plexus-utils:1.0.2::jar", "compile" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.0::jar", "compile" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging-api:1.0.4::jar", "compile" ) ); + model.addDependency( toDependency( "velocity:velocity:1.4::jar", "compile" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-taglib:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-integrations:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-system:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-xwork-integration:1.0-alpha-6::jar" ) ); + model.addDependency( toDependency( "taglibs:standard:1.1.2::jar" ) ); + model.addDependency( toDependency( "javax.servlet:jstl:1.1.2::jar" ) ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar", "provided" ) ); + model.addDependency( toDependency( "javax.servlet:jsp-api:2.0::jar", "provided" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-xwork-content:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-xwork:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-xwork-integration:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-taglib:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "xml-apis:xml-apis:1.3.03" ); + model.setParentProject( toParent( "org.apache:apache:1" ) ); + addModel( model ); + + model = toModel( "org.apache:apache:1" ); + addModel( model ); + + model = toModel( "org.codehaus.woodstox:wstx-asl:3.2.1" ); + model.addDependency( toDependency( "stax:stax-api:1.0.1::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-signature-consumers:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-consumers:1.0-alpha-2-SNAPSHOT" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.shared:maven-app-configuration-model:1.0" ); + model.setParentProject( toParent( "org.apache.maven.shared:maven-app-configuration:1.0" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-api:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-20::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.shared:maven-app-configuration:1.0" ); + model.setParentProject( toParent( "org.apache.maven.shared:maven-shared-components:7" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.shared:maven-app-configuration-web:1.0" ); + model.setParentProject( toParent( "org.apache.maven.shared:maven-app-configuration:1.0" ) ); + model.addDependency( toDependency( "org.apache.maven.shared:maven-app-configuration-model:1.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-project:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-http-lightweight:1.0-beta-2::jar", "runtime" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-20::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-project:2.0.4" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.4" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-settings:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact-test:2.0.4::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-profile:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-model:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact-manager:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-settings:2.0.4" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.4" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-model:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-artifact-test:2.0.4" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.4" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-settings:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact-manager:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-artifact-manager:2.0.4" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.4" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-repository-metadata:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-file:1.0-alpha-7::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-alpha-6::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-repository-metadata:2.0.4" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.4" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-artifact:2.0.4" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.4" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-profile:2.0.4" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.4" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-model:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.webdav:plexus-webdav-simple:1.0-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus.webdav:plexus-webdav-providers-parent:1.0-alpha-2" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:2.1::jar" ) ); + model.addDependency( toDependency( "it.could:webdav:0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.webdav:plexus-webdav-providers-parent:1.0-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus.webdav:plexus-webdav-parent:1.0-alpha-2" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.webdav:plexus-webdav-api:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.webdav:plexus-webdav-test:1.0-alpha-2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.webdav:plexus-webdav-parent:1.0-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.12" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.webdav:plexus-webdav-api:1.0-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus.webdav:plexus-webdav-parent:1.0-alpha-2" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-20::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-20::jar" ) ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.3::jar" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:2.1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.webdav:plexus-webdav-test:1.0-alpha-2" ); + addModel( model ); + + model = toModel( "it.could:webdav:0.4" ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.3::jar", "runtime" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-model:2.0.5" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.5" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-project:2.0.5" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.5" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-settings:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact-test:2.0.5::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-profile:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-model:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact-manager:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-settings:2.0.5" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.5" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-model:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-artifact-test:2.0.5" ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-profile:2.0.5" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.5" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-model:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-appserver-host:2.0-alpha-8" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-appserver:2.0-alpha-8" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-20::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-20::jar" ) ); + model.addDependency( toDependency( "mx4j:mx4j:3.0.1::jar" ) ); + model.addDependency( toDependency( "mx4j:mx4j-remote:3.0.1::jar" ) ); + model.addDependency( toDependency( "org.livetribe:livetribe-slp:1.0.2::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-appserver:2.0-alpha-8" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.11" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-20::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-20::jar" ) ); + addModel( model ); + + model = toModel( "mx4j:mx4j:3.0.1" ); + addModel( model ); + + model = toModel( "mx4j:mx4j-remote:3.0.1" ); + addModel( model ); + + model = toModel( "org.livetribe:livetribe-slp:1.0.2" ); + model.setParentProject( toParent( "org.livetribe:livetribe:1.0" ) ); + model.addDependency( toDependency( "backport-util-concurrent:backport-util-concurrent:2.2::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.livetribe:livetribe:1.0" ); + addModel( model ); + + model = toModel( "backport-util-concurrent:backport-util-concurrent:2.2" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-appserver-service-jetty:2.0-alpha-8" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-appserver-services:2.0-alpha-8" ) ); + model.addDependency( toDependency( "ant:ant:1.6.2::jar" ) ); + model.addDependency( toDependency( "jetty:org.mortbay.jetty:5.1.10::jar" ) ); + model.addDependency( toDependency( "tomcat:jasper-compiler:5.5.15::jar" ) ); + model.addDependency( toDependency( "tomcat:jasper-runtime:5.5.15::jar" ) ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar" ) ); + model.addDependency( toDependency( "javax.servlet:jsp-api:2.0::jar" ) ); + dep = toDependency( "commons-el:commons-el:1.0::jar", "runtime" ); + addExclusion( dep, "log4j:log4j" ); + addExclusion( dep, "commons-logging:commons-logging" ); + addExclusion( dep, "logkit:logkit" ); + model.addDependency( dep ); + model.addDependency( toDependency( "jetty:org.mortbay.jetty.plus:5.1.10::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging-api:1.0.4::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.derby:derby:10.1.3.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-appserver-services:2.0-alpha-8" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-appserver:2.0-alpha-8" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-appserver-host:2.0-alpha-8::jar" ) ); + addModel( model ); + + model = toModel( "ant:ant:1.6.2" ); + dep = toDependency( "xerces:xerces-impl:2.6.2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "xml-apis:xml-apis:2.6.2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "xerces:xerces-impl:2.6.2" ); + addModel( model ); + + model = toModel( "xml-apis:xml-apis:2.6.2" ); + addModel( model ); + + model = toModel( "jetty:org.mortbay.jetty:5.1.10" ); + addModel( model ); + + model = toModel( "tomcat:jasper-compiler:5.5.15" ); + model.setParentProject( toParent( "tomcat:tomcat-parent:5.5.15" ) ); + model.addDependency( toDependency( "javax.servlet:jsp-api:2.0::jar" ) ); + model.addDependency( toDependency( "ant:ant:1.6.5::jar" ) ); + addModel( model ); + + model = toModel( "tomcat:tomcat-parent:5.5.15" ); + model.setParentProject( toParent( "org.apache:apache:3" ) ); + model.addDependencyManagement( toDependency( "commons-logging:commons-logging-api:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "ant:ant:1.6.5" ); + dep = toDependency( "xerces:xerces-impl:2.6.2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "xml-apis:xml-apis:2.6.2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "tomcat:jasper-runtime:5.5.15" ); + model.setParentProject( toParent( "tomcat:tomcat-parent:5.5.15" ) ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar" ) ); + model.addDependency( toDependency( "commons-el:commons-el:1.0::jar" ) ); + addModel( model ); + + model = toModel( "commons-el:commons-el:1.0" ); + model.addDependency( toDependency( "servletapi:servletapi:2.4-20040521::jar", "provided" ) ); + model.addDependency( toDependency( "jspapi:jsp-api:2.0-20040521::jar", "provided" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.3::jar" ) ); + addModel( model ); + + model = toModel( "servletapi:servletapi:2.4-20040521" ); + addModel( model ); + + model = toModel( "jspapi:jsp-api:2.0-20040521" ); + addModel( model ); + + model = toModel( "jetty:org.mortbay.jetty.plus:5.1.10" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-cli:1.1" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-tools:1.0.8" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-5::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-14::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + dep = toDependency( "commons-cli:commons-cli:1.0::jar" ); + addExclusion( dep, "commons-lang:commons-lang" ); + addExclusion( dep, "commons-logging:commons-logging" ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-tools:1.0.8" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.9" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-14::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-container-default:1.0-alpha-14" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0-alpha-14" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-13::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.3::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-5::jar" ) ); + model.addDependency( toDependency( "jmock:jmock:1.0.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-containers:1.0-alpha-14" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.9" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-5::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-13::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.3::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-5" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.9" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-component-api:1.0-alpha-13" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0.7-alpha-3" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-5::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-containers:1.0.7-alpha-3" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.9" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-5::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-13::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.3::jar" ) ); + addModel( model ); + + model = toModel( "commons-cli:commons-cli:1.0" ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0::jar" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:1.0::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + addModel( model ); + + model = toModel( "commons-lang:commons-lang:1.0" ); + model.addDependency( toDependency( "junit:junit:3.7::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-command-line:1.0-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.4" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-naming:1.0-alpha-3" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.9" ) ); + model.addDependency( toDependency( "directory-naming:naming-core:0.8::jar" ) ); + model.addDependency( toDependency( "directory-naming:naming-java:0.8::jar" ) ); + model.addDependency( toDependency( "directory-naming:naming-factory:0.8::jar" ) ); + model.addDependency( toDependency( "directory-naming:naming-config:0.8::jar" ) ); + model.addDependency( toDependency( "commons-dbcp:commons-dbcp:1.2.1::jar" ) ); + model.addDependency( toDependency( "commons-pool:commons-pool:1.2::jar" ) ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.7.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "directory-naming:naming-config:0.8" ); + model.addDependency( toDependency( "directory-naming:naming-core:0.8::jar" ) ); + model.addDependency( toDependency( "directory-naming:naming-factory:0.8::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.3::jar" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:1.0.1::jar" ) ); + model.addDependency( toDependency( "commons-digester:commons-digester:1.4.1::jar" ) ); + model.addDependency( toDependency( "directory-naming:naming-java:0.8::jar" ) ); + model.addDependency( toDependency( "commons-beanutils:commons-beanutils:1.6.1::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:3.1::jar" ) ); + model.addDependency( toDependency( "commons-dbcp:commons-dbcp:1.0::jar" ) ); + model.addDependency( toDependency( "commons-pool:commons-pool:1.0.1::jar" ) ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.7.1::jar" ) ); + addModel( model ); + + model = toModel( "commons-lang:commons-lang:1.0.1" ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + addModel( model ); + + model = toModel( "commons-digester:commons-digester:1.4.1" ); + model.addDependency( toDependency( "commons-beanutils:commons-beanutils:1.6::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.1::jar" ) ); + model.addDependency( toDependency( "xml-apis:xml-apis:2.0.2::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + addModel( model ); + + model = toModel( "commons-beanutils:commons-beanutils:1.6.1" ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.0::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + addModel( model ); + + model = toModel( "commons-dbcp:commons-dbcp:1.0" ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.0::jar" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:1.0-b1::jar" ) ); + model.addDependency( toDependency( "commons-pool:commons-pool:1.0::jar" ) ); + model.addDependency( toDependency( "jdbc:jdbc:2.0::jar" ) ); + model.addDependency( toDependency( "xml-apis:xml-apis:2.0.2::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.7::jar" ) ); + addModel( model ); + + model = toModel( "commons-lang:commons-lang:1.0-b1" ); + addModel( model ); + + model = toModel( "commons-pool:commons-pool:1.0" ); + addModel( model ); + + model = toModel( "jdbc:jdbc:2.0" ); + model.setRelocation( new VersionedReference() ); + model.getRelocation().setGroupId( "javax.sql" ); + model.getRelocation().setArtifactId( "jdbc-stdext" ); + model.getRelocation().setVersion( "2.0" ); + addModel( model ); + + model = toModel( "commons-pool:commons-pool:1.0.1" ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.0::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + addModel( model ); + + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/ArchivaWebappDependencyGraphTest.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/ArchivaWebappDependencyGraphTest.java new file mode 100644 index 000000000..b3bb2a1fa --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/ArchivaWebappDependencyGraphTest.java @@ -0,0 +1,200 @@ +package org.apache.maven.archiva.dependency.graph; + +/* + * 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.archiva.dependency.DependencyGraphFactory; +import org.apache.maven.archiva.model.DependencyScope; +import org.apache.maven.archiva.model.VersionedReference; + +import java.util.ArrayList; +import java.util.List; + +/** + * ArchivaWebappDependencyGraphTest + * + * DependencyGraphTest for testing org.apache.maven.archiva:archiva-webapp:1.0-alpha-2-SNAPSHOT + * + * Generated by archivadev:generate-dependency-tests plugin + * @version $Id$ + */ +public class ArchivaWebappDependencyGraphTest + extends AbstractDependencyGraphFactoryTestCase +{ + public void testResolvedDepsToNodes() + throws GraphTaskException + { + MemoryRepositoryDependencyGraphBuilder graphBuilder = + new MemoryRepositoryDependencyGraphBuilder(); + MemoryRepository repository = new ArchivaWebappMemoryRepository(); + graphBuilder.setMemoryRepository( repository ); + + // Create the factory, and add the test resolver. + DependencyGraphFactory factory = new DependencyGraphFactory(); + factory.setGraphBuilder( graphBuilder ); + factory.setDesiredScope( DependencyScope.TEST ); + + // Get the model to resolve from + VersionedReference rootRef = toVersionedReference( "org.apache.maven.archiva:archiva-webapp:1.0-alpha-2-SNAPSHOT"); + + // Perform the resolution. + DependencyGraph graph = factory.getGraph( rootRef ); + + // Test the results. + assertNotNull( "Graph shouldn't be null.", graph ); + + String expectedRootRef = "org.apache.maven.archiva:archiva-webapp:1.0-alpha-2-SNAPSHOT"; + List expectedNodes = new ArrayList(); + + // Check for all nodes, regardless of scope. + expectedNodes.clear(); + expectedNodes.add( "ant:ant-optional:1.5.1::jar" ); + expectedNodes.add( "backport-util-concurrent:backport-util-concurrent:3.0::jar" ); + expectedNodes.add( "classworlds:classworlds:1.1::jar" ); + expectedNodes.add( "commons-beanutils:commons-beanutils:1.7.0::jar" ); + expectedNodes.add( "commons-beanutils:commons-beanutils-bean-collections:1.7.0::jar" ); + expectedNodes.add( "commons-codec:commons-codec:1.3::jar" ); + expectedNodes.add( "commons-collections:commons-collections:3.2::jar" ); + expectedNodes.add( "commons-configuration:commons-configuration:1.3::jar" ); + expectedNodes.add( "commons-digester:commons-digester:1.6::jar" ); + expectedNodes.add( "commons-io:commons-io:1.2::jar" ); + expectedNodes.add( "commons-jxpath:commons-jxpath:1.2::jar" ); + expectedNodes.add( "commons-lang:commons-lang:2.2::jar" ); + expectedNodes.add( "commons-logging:commons-logging:1.0.4::jar" ); + expectedNodes.add( "commons-logging:commons-logging-api:1.0.4::jar" ); + expectedNodes.add( "dom4j:dom4j:1.6.1::jar" ); + expectedNodes.add( "freemarker:freemarker:2.3.4::jar" ); + expectedNodes.add( "geronimo-spec:geronimo-spec-jta:1.0.1B-rc2::jar" ); + expectedNodes.add( "it.could:webdav:0.4::jar" ); + expectedNodes.add( "javax.activation:activation:1.1::jar" ); + expectedNodes.add( "javax.jdo:jdo2-api:2.0::jar" ); + expectedNodes.add( "javax.mail:mail:1.4::jar" ); + expectedNodes.add( "javax.resource:connector:1.0::jar" ); + expectedNodes.add( "javax.servlet:jsp-api:2.0::jar" ); + expectedNodes.add( "javax.servlet:jstl:1.1.2::jar" ); + expectedNodes.add( "javax.servlet:servlet-api:2.4::jar" ); + expectedNodes.add( "javax.transaction:jta:1.0.1B::jar" ); + expectedNodes.add( "jaxen:jaxen:1.1::jar" ); + expectedNodes.add( "jdom:jdom:1.0::jar" ); + expectedNodes.add( "jpox:jpox:1.1.7::jar" ); + expectedNodes.add( "jtidy:jtidy:4aug2000r7-dev::jar" ); + expectedNodes.add( "junit:junit:3.8.1::jar" ); + expectedNodes.add( "log4j:log4j:1.2.8::jar" ); + expectedNodes.add( "net.java.dev.stax-utils:stax-utils:20060502::jar" ); + expectedNodes.add( "net.sf.ehcache:ehcache:1.2.4::jar" ); + expectedNodes.add( "ognl:ognl:2.6.7::jar" ); + expectedNodes.add( "opensymphony:oscore:2.2.4::jar" ); + expectedNodes.add( "opensymphony:sitemesh:2.2.1::jar" ); + expectedNodes.add( "opensymphony:webwork:2.2.4::jar" ); + expectedNodes.add( "opensymphony:xwork:1.2.1::jar" ); + expectedNodes.add( "org.apache.derby:derby:10.1.3.1::jar" ); + expectedNodes.add( "org.apache.lucene:lucene-core:2.0.0::jar" ); + expectedNodes.add( "org.apache.maven:maven-artifact:2.0.5::jar" ); + expectedNodes.add( "org.apache.maven:maven-artifact-manager:2.0.5::jar" ); + expectedNodes.add( "org.apache.maven:maven-model:2.0.5::jar" ); + expectedNodes.add( "org.apache.maven:maven-profile:2.0.5::jar" ); + expectedNodes.add( "org.apache.maven:maven-project:2.0.5::jar" ); + expectedNodes.add( "org.apache.maven:maven-repository-metadata:2.0.5::jar" ); + expectedNodes.add( "org.apache.maven:maven-settings:2.0.5::jar" ); + expectedNodes.add( "org.apache.maven.archiva:archiva-applet:1.0-alpha-2-SNAPSHOT::jar" ); + expectedNodes.add( "org.apache.maven.archiva:archiva-artifact-reports:1.0-alpha-2-SNAPSHOT::jar" ); + expectedNodes.add( "org.apache.maven.archiva:archiva-common:1.0-alpha-2-SNAPSHOT::jar" ); + expectedNodes.add( "org.apache.maven.archiva:archiva-configuration:1.0-alpha-2-SNAPSHOT::jar" ); + expectedNodes.add( "org.apache.maven.archiva:archiva-consumer-api:1.0-alpha-2-SNAPSHOT::jar" ); + expectedNodes.add( "org.apache.maven.archiva:archiva-core-consumers:1.0-alpha-2-SNAPSHOT::jar" ); + expectedNodes.add( "org.apache.maven.archiva:archiva-database:1.0-alpha-2-SNAPSHOT::jar" ); + expectedNodes.add( "org.apache.maven.archiva:archiva-database-consumers:1.0-alpha-2-SNAPSHOT::jar" ); + expectedNodes.add( "org.apache.maven.archiva:archiva-indexer:1.0-alpha-2-SNAPSHOT::jar" ); + expectedNodes.add( "org.apache.maven.archiva:archiva-lucene-consumers:1.0-alpha-2-SNAPSHOT::jar" ); + expectedNodes.add( "org.apache.maven.archiva:archiva-model:1.0-alpha-2-SNAPSHOT::jar" ); + expectedNodes.add( "org.apache.maven.archiva:archiva-policies:1.0-alpha-2-SNAPSHOT::jar" ); + expectedNodes.add( "org.apache.maven.archiva:archiva-proxy:1.0-alpha-2-SNAPSHOT::jar" ); + expectedNodes.add( "org.apache.maven.archiva:archiva-report-manager:1.0-alpha-2-SNAPSHOT::jar" ); + expectedNodes.add( "org.apache.maven.archiva:archiva-repository-layer:1.0-alpha-2-SNAPSHOT::jar" ); + expectedNodes.add( "org.apache.maven.archiva:archiva-scheduled:1.0-alpha-2-SNAPSHOT::jar" ); + expectedNodes.add( "org.apache.maven.archiva:archiva-security:1.0-alpha-2-SNAPSHOT::jar" ); + expectedNodes.add( "org.apache.maven.archiva:archiva-signature-consumers:1.0-alpha-2-SNAPSHOT::jar" ); + expectedNodes.add( "org.apache.maven.archiva:archiva-xml-tools:1.0-alpha-2-SNAPSHOT::jar" ); + expectedNodes.add( "org.apache.maven.shared:maven-app-configuration-model:1.0::jar" ); + expectedNodes.add( "org.apache.maven.shared:maven-app-configuration-web:1.0::jar" ); + expectedNodes.add( "org.apache.maven.wagon:wagon-file:1.0-beta-2::jar" ); + expectedNodes.add( "org.apache.maven.wagon:wagon-http-lightweight:1.0-beta-2::jar" ); + expectedNodes.add( "org.apache.maven.wagon:wagon-http-shared:1.0-beta-2::jar" ); + expectedNodes.add( "org.apache.maven.wagon:wagon-provider-api:1.0-beta-2::jar" ); + expectedNodes.add( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ); + expectedNodes.add( "org.codehaus.plexus:plexus-component-api:1.0-alpha-22::jar" ); + expectedNodes.add( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ); + expectedNodes.add( "org.codehaus.plexus:plexus-digest:1.1::jar" ); + expectedNodes.add( "org.codehaus.plexus:plexus-ehcache:1.0-alpha-2::jar" ); + expectedNodes.add( "org.codehaus.plexus:plexus-expression-evaluator:1.0-alpha-1::jar" ); + expectedNodes.add( "org.codehaus.plexus:plexus-jdo2:1.0-alpha-8::jar" ); + expectedNodes.add( "org.codehaus.plexus:plexus-mail-sender-api:1.0-alpha-6::jar" ); + expectedNodes.add( "org.codehaus.plexus:plexus-mail-sender-javamail:1.0-alpha-6::jar" ); + expectedNodes.add( "org.codehaus.plexus:plexus-quartz:1.0-alpha-3::jar" ); + expectedNodes.add( "org.codehaus.plexus:plexus-slf4j-logging:1.1-alpha-1::jar" ); + expectedNodes.add( "org.codehaus.plexus:plexus-taskqueue:1.0-alpha-6::jar" ); + expectedNodes.add( "org.codehaus.plexus:plexus-utils:1.4::jar" ); + expectedNodes.add( "org.codehaus.plexus:plexus-velocity:1.1.2::jar" ); + expectedNodes.add( "org.codehaus.plexus:plexus-xwork-integration:1.0-alpha-6::jar" ); + expectedNodes.add( "org.codehaus.plexus.cache:plexus-cache-api:1.0-alpha-2::jar" ); + expectedNodes.add( "org.codehaus.plexus.cache:plexus-cache-ehcache:1.0-alpha-2::jar" ); + expectedNodes.add( "org.codehaus.plexus.redback:redback-authentication-api:1.0-alpha-1::jar" ); + expectedNodes.add( "org.codehaus.plexus.redback:redback-authentication-keys:1.0-alpha-1::jar" ); + expectedNodes.add( "org.codehaus.plexus.redback:redback-authentication-users:1.0-alpha-1::jar" ); + expectedNodes.add( "org.codehaus.plexus.redback:redback-authorization-api:1.0-alpha-1::jar" ); + expectedNodes.add( "org.codehaus.plexus.redback:redback-authorization-rbac:1.0-alpha-1::jar" ); + expectedNodes.add( "org.codehaus.plexus.redback:redback-common-jdo:1.0-alpha-1::jar" ); + expectedNodes.add( "org.codehaus.plexus.redback:redback-configuration:1.0-alpha-1::jar" ); + expectedNodes.add( "org.codehaus.plexus.redback:redback-keys-api:1.0-alpha-1::jar" ); + expectedNodes.add( "org.codehaus.plexus.redback:redback-keys-cached:1.0-alpha-1::jar" ); + expectedNodes.add( "org.codehaus.plexus.redback:redback-keys-jdo:1.0-alpha-1::jar" ); + expectedNodes.add( "org.codehaus.plexus.redback:redback-policy:1.0-alpha-1::jar" ); + expectedNodes.add( "org.codehaus.plexus.redback:redback-rbac-cached:1.0-alpha-1::jar" ); + expectedNodes.add( "org.codehaus.plexus.redback:redback-rbac-jdo:1.0-alpha-1::jar" ); + expectedNodes.add( "org.codehaus.plexus.redback:redback-rbac-model:1.0-alpha-1::jar" ); + expectedNodes.add( "org.codehaus.plexus.redback:redback-rbac-role-manager:1.0-alpha-1::jar" ); + expectedNodes.add( "org.codehaus.plexus.redback:redback-system:1.0-alpha-1::jar" ); + expectedNodes.add( "org.codehaus.plexus.redback:redback-taglib:1.0-alpha-1::jar" ); + expectedNodes.add( "org.codehaus.plexus.redback:redback-users-api:1.0-alpha-1::jar" ); + expectedNodes.add( "org.codehaus.plexus.redback:redback-users-cached:1.0-alpha-1::jar" ); + expectedNodes.add( "org.codehaus.plexus.redback:redback-users-jdo:1.0-alpha-1::jar" ); + expectedNodes.add( "org.codehaus.plexus.redback:redback-xwork-content:1.0-alpha-1::war" ); + expectedNodes.add( "org.codehaus.plexus.redback:redback-xwork-integration:1.0-alpha-1::jar" ); + expectedNodes.add( "org.codehaus.plexus.registry:plexus-registry-api:1.0-alpha-2::jar" ); + expectedNodes.add( "org.codehaus.plexus.registry:plexus-registry-commons:1.0-alpha-2::jar" ); + expectedNodes.add( "org.codehaus.plexus.webdav:plexus-webdav-api:1.0-alpha-2::jar" ); + expectedNodes.add( "org.codehaus.plexus.webdav:plexus-webdav-simple:1.0-alpha-2::jar" ); + expectedNodes.add( "org.codehaus.woodstox:wstx-asl:3.2.1::jar" ); + expectedNodes.add( "org.extremecomponents:extremecomponents:1.0.1::jar" ); + expectedNodes.add( "org.rifers:rife-continuations:0.0.2::jar" ); + expectedNodes.add( "org.slf4j:slf4j-api:1.2::jar" ); + expectedNodes.add( "org.slf4j:slf4j-log4j12:1.2::jar" ); + expectedNodes.add( "org.slf4j:slf4j-simple:1.2::jar" ); + expectedNodes.add( "quartz:quartz:1.4.5::jar" ); + expectedNodes.add( "stax:stax-api:1.0.1::jar" ); + expectedNodes.add( "taglibs:standard:1.1.2::jar" ); + expectedNodes.add( "velocity:velocity:1.4::jar" ); + expectedNodes.add( "velocity:velocity-dep:1.4::jar" ); + expectedNodes.add( "xerces:xercesImpl:2.6.2::jar" ); + expectedNodes.add( "xml-apis:xml-apis:1.3.03::jar" ); + + assertGraph( graph, expectedRootRef, expectedNodes ); + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/ArchivaWebappMemoryRepository.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/ArchivaWebappMemoryRepository.java new file mode 100644 index 000000000..ab19663bb --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/ArchivaWebappMemoryRepository.java @@ -0,0 +1,3469 @@ +package org.apache.maven.archiva.dependency.graph; + +/* + * 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.archiva.model.ArchivaProjectModel; +import org.apache.maven.archiva.model.Dependency; +import org.apache.maven.archiva.model.VersionedReference; + +/** + * ArchivaWebappMemoryRepository + * + * MemoryRepository for testing org.apache.maven.archiva:archiva-webapp:1.0-alpha-2-SNAPSHOT + * + * Generated by archivadev:generate-dependency-tests plugin + * @version $Id$ + */ +public class ArchivaWebappMemoryRepository + extends AbstractMemoryRepository +{ + public void initialize() + { + ArchivaProjectModel model; + Dependency dep; + + model = toModel( "org.apache.maven.archiva:archiva-webapp:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-web:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-report-manager:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-scheduled:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-indexer:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-proxy:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-database:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-repository-layer:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-security:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-core-consumers:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-database-consumers:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-lucene-consumers:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-signature-consumers:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-applet:1.0-alpha-2-SNAPSHOT::jar", "provided" ) ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar", "provided" ) ); + model.addDependency( toDependency( "javax.servlet:jsp-api:2.0::jar", "provided" ) ); + model.addDependency( toDependency( "opensymphony:sitemesh:2.2.1::jar" ) ); + model.addDependency( toDependency( "taglibs:standard:1.1.2::jar" ) ); + model.addDependency( toDependency( "javax.servlet:jstl:1.1.2::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.shared:maven-app-configuration-model:1.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.shared:maven-app-configuration-web:1.0::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-slf4j-logging:1.1-alpha-1::jar", "runtime" ) ); + model.addDependency( toDependency( "org.slf4j:slf4j-log4j12:1.2::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.4::jar", "runtime" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:2.2::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-http-lightweight:1.0-beta-2::jar", "runtime" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-file:1.0-beta-2::jar", "runtime" ) ); + model.addDependency( toDependency( "opensymphony:webwork:2.2.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-api:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-commons:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.cache:plexus-cache-api:1.0-alpha-2::jar", "compile" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.cache:plexus-cache-ehcache:1.0-alpha-2::jar", "compile" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-xwork-content:1.0-alpha-1::war", "runtime" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-xwork-integration:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-taglib:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.webdav:plexus-webdav-simple:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-xwork-integration:1.0-alpha-6::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependency( toDependency( "org.apache.derby:derby:10.1.3.1::jar", "provided" ) ); + model.addDependency( toDependency( "javax.mail:mail:1.4::jar", "provided" ) ); + model.addDependency( toDependency( "javax.activation:activation:1.1::jar", "provided" ) ); + model.addDependencyManagement( toDependency( "javax.activation:activation:1.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-applet:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-artifact-converter:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-artifact-reports:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-common:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-configuration:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-consumer-api:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-converter:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-core:1.0-alpha-2-SNAPSHOT-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-core-consumers:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-database:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-database-consumers:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-indexer:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-lucene-consumers:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-model:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-plexus-application:1.0-alpha-2-SNAPSHOT::plexus-application" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-policies:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-proxy:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-report-manager:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-repository-layer:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-scheduled:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-security:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-signature-consumers:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-transaction:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-webapp:1.0-alpha-2-SNAPSHOT::war" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-xml-tools:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "commons-collections:commons-collections:3.2::jar" ) ); + model.addDependencyManagement( toDependency( "commons-io:commons-io:1.2::jar" ) ); + model.addDependencyManagement( toDependency( "commons-lang:commons-lang:2.2::jar" ) ); + model.addDependencyManagement( toDependency( "commons-logging:commons-logging:1.0.4::jar" ) ); + model.addDependencyManagement( toDependency( "commons-logging:commons-logging-api:1.0.4::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.derby:derby:10.1.3.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.derby:derbytools:10.1.3.1::jar" ) ); + model.addDependencyManagement( toDependency( "dom4j:dom4j:1.6.1::jar" ) ); + model.addDependencyManagement( toDependency( "easymock:easymock:1.2_Java1.3::jar" ) ); + model.addDependencyManagement( toDependency( "hsqldb:hsqldb:1.8.0.7::jar" ) ); + model.addDependencyManagement( toDependency( "jaxen:jaxen:1.1::jar" ) ); + model.addDependencyManagement( toDependency( "javax.jdo:jdo2-api:2.0::jar" ) ); + model.addDependencyManagement( toDependency( "jdom:jdom:1.0::jar" ) ); + model.addDependencyManagement( toDependency( "jpox:jpox:1.1.7::jar" ) ); + model.addDependencyManagement( toDependency( "javax.servlet:jsp-api:2.0::jar" ) ); + model.addDependencyManagement( toDependency( "javax.servlet:jstl:1.1.2::jar" ) ); + model.addDependencyManagement( toDependency( "log4j:log4j:1.2.8::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.lucene:lucene-core:2.0.0::jar" ) ); + model.addDependencyManagement( toDependency( "javax.mail:mail:1.4::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven:maven-artifact:2.0.5::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven:maven-artifact-manager:2.0.5::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven:maven-model:2.0.5::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven:maven-project:2.0.5::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven:maven-repository-metadata:2.0.5::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.shared:maven-app-configuration-model:1.0::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.shared:maven-app-configuration-web:1.0::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.shared:maven-model-converter:2.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-appserver-host:2.0-alpha-8::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-appserver-service-jetty:2.0-alpha-8::plexus-service" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-cli:1.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-command-line:1.0-alpha-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-22::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-digest:1.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-expression-evaluator:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-i18n:1.0-beta-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-jdo2:1.0-alpha-8::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-naming:1.0-alpha-3::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-quartz:1.0-alpha-3::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-slf4j-logging:1.1-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-taskqueue:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-xwork-integration:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.cache:plexus-cache-api:1.0-alpha-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.cache:plexus-cache-ehcache:1.0-alpha-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-rbac-memory:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-rbac-role-manager:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-taglib:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-xwork-content:1.0-alpha-1::war" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-xwork-integration:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.registry:plexus-registry-api:1.0-alpha-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.registry:plexus-registry-commons:1.0-alpha-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.webdav:plexus-webdav-simple:1.0-alpha-2::jar" ) ); + model.addDependencyManagement( toDependency( "javax.servlet:servlet-api:2.4::jar" ) ); + model.addDependencyManagement( toDependency( "opensymphony:sitemesh:2.2.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.slf4j:slf4j-log4j12:1.2::jar" ) ); + model.addDependencyManagement( toDependency( "taglibs:standard:1.1.2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-file:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-http-lightweight:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "opensymphony:webwork:2.2.4::jar" ) ); + model.addDependencyManagement( toDependency( "xmlunit:xmlunit:1.0::jar" ) ); + model.addProperty( "wagon.version", "1.0-beta-2" ); + model.addProperty( "redback.version", "1.0-alpha-1" ); + model.addProperty( "maven.version", "2.0.5" ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-web:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-parent:1.0-alpha-2-SNAPSHOT" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-parent:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven:maven-parent:5" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependencyManagement( toDependency( "javax.activation:activation:1.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-applet:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-artifact-converter:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-artifact-reports:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-common:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-configuration:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-consumer-api:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-converter:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-core:1.0-alpha-2-SNAPSHOT-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-core-consumers:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-database:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-database-consumers:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-indexer:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-lucene-consumers:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-model:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-plexus-application:1.0-alpha-2-SNAPSHOT::plexus-application" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-policies:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-proxy:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-report-manager:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-repository-layer:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-scheduled:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-security:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-signature-consumers:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-transaction:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-webapp:1.0-alpha-2-SNAPSHOT::war" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-xml-tools:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "commons-collections:commons-collections:3.2::jar" ) ); + model.addDependencyManagement( toDependency( "commons-io:commons-io:1.2::jar" ) ); + model.addDependencyManagement( toDependency( "commons-lang:commons-lang:2.2::jar" ) ); + model.addDependencyManagement( toDependency( "commons-logging:commons-logging:1.0.4::jar" ) ); + model.addDependencyManagement( toDependency( "commons-logging:commons-logging-api:1.0.4::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.derby:derby:10.1.3.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.derby:derbytools:10.1.3.1::jar" ) ); + model.addDependencyManagement( toDependency( "dom4j:dom4j:1.6.1::jar" ) ); + model.addDependencyManagement( toDependency( "easymock:easymock:1.2_Java1.3::jar" ) ); + model.addDependencyManagement( toDependency( "hsqldb:hsqldb:1.8.0.7::jar" ) ); + model.addDependencyManagement( toDependency( "jaxen:jaxen:1.1::jar" ) ); + model.addDependencyManagement( toDependency( "javax.jdo:jdo2-api:2.0::jar" ) ); + model.addDependencyManagement( toDependency( "jdom:jdom:1.0::jar" ) ); + model.addDependencyManagement( toDependency( "jpox:jpox:1.1.7::jar" ) ); + model.addDependencyManagement( toDependency( "javax.servlet:jsp-api:2.0::jar" ) ); + model.addDependencyManagement( toDependency( "javax.servlet:jstl:1.1.2::jar" ) ); + model.addDependencyManagement( toDependency( "log4j:log4j:1.2.8::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.lucene:lucene-core:2.0.0::jar" ) ); + model.addDependencyManagement( toDependency( "javax.mail:mail:1.4::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven:maven-artifact:2.0.5::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven:maven-artifact-manager:2.0.5::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven:maven-model:2.0.5::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven:maven-project:2.0.5::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven:maven-repository-metadata:2.0.5::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.shared:maven-app-configuration-model:1.0::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.shared:maven-app-configuration-web:1.0::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.shared:maven-model-converter:2.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-appserver-host:2.0-alpha-8::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-appserver-service-jetty:2.0-alpha-8::plexus-service" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-cli:1.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-command-line:1.0-alpha-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-22::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-digest:1.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-expression-evaluator:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-i18n:1.0-beta-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-jdo2:1.0-alpha-8::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-naming:1.0-alpha-3::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-quartz:1.0-alpha-3::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-slf4j-logging:1.1-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-taskqueue:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-xwork-integration:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.cache:plexus-cache-api:1.0-alpha-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.cache:plexus-cache-ehcache:1.0-alpha-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-rbac-memory:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-rbac-role-manager:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-taglib:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-xwork-content:1.0-alpha-1::war" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-xwork-integration:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.registry:plexus-registry-api:1.0-alpha-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.registry:plexus-registry-commons:1.0-alpha-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.webdav:plexus-webdav-simple:1.0-alpha-2::jar" ) ); + model.addDependencyManagement( toDependency( "javax.servlet:servlet-api:2.4::jar" ) ); + model.addDependencyManagement( toDependency( "opensymphony:sitemesh:2.2.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.slf4j:slf4j-log4j12:1.2::jar" ) ); + model.addDependencyManagement( toDependency( "taglibs:standard:1.1.2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-file:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-http-lightweight:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "opensymphony:webwork:2.2.4::jar" ) ); + model.addDependencyManagement( toDependency( "xmlunit:xmlunit:1.0::jar" ) ); + model.addProperty( "wagon.version", "1.0-beta-2" ); + model.addProperty( "maven.version", "2.0.5" ); + model.addProperty( "redback.version", "1.0-alpha-1" ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-parent:5" ); + model.setParentProject( toParent( "org.apache:apache:3" ) ); + addModel( model ); + + model = toModel( "org.apache:apache:3" ); + addModel( model ); + + model = toModel( "junit:junit:3.8.1" ); + addModel( model ); + + model = toModel( "javax.activation:activation:1.1" ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-applet:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-web:1.0-alpha-2-SNAPSHOT" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-artifact-converter:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-base:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-repository-metadata:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact-manager:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-transaction:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.shared:maven-model-converter:2.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-base:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-parent:1.0-alpha-2-SNAPSHOT" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-repository-metadata:2.0.5" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.5" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven:2.0.5" ); + model.setParentProject( toParent( "org.apache.maven:maven-parent:5" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh-external:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-file:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-http-lightweight:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "easymock:easymock:1.2_Java1.3::jar", "test" ) ); + model.addDependencyManagement( toDependency( "classworlds:classworlds:1.1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0.3" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + model.addDependency( toDependency( "classworlds:classworlds:1.1-alpha-2::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-containers:1.0.3" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.4" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus:1.0.4" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-utils:1.0.4" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "classworlds:classworlds:1.1-alpha-2" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-utils:1.1" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.4" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-provider-api:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon:1.0-beta-2" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven:maven-parent:4" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-provider-test:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh-common-test:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh-common:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "junit:junit:3.8.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-interactivity-api:1.0-alpha-4::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-parent:4" ); + model.setParentProject( toParent( "org.apache:apache:3" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-provider-test:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon:1.0-beta-2" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-beta-2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8" ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar", "compile" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependency( toDependency( "classworlds:classworlds:1.1-alpha-2::jar", "compile" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-ssh-common-test:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-beta-2" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-ssh-common:1.0-beta-2::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-providers:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon:1.0-beta-2" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-test:1.0-beta-2::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh-common:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh-common-test:1.0-beta-2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-ssh-common:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-beta-2" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-interactivity-api:1.0-alpha-4::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-interactivity-api:1.0-alpha-4" ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-7::jar", "compile" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "classworlds:classworlds:1.1-alpha-2::jar", "compile" ) ); + model.addDependency( toDependency( "plexus:plexus-utils:1.0.2::jar", "compile" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-container-default:1.0-alpha-7" ); + model.setParentProject( toParent( "plexus:plexus-containers:1.0.2" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependency( toDependency( "plexus:plexus-utils:1.0.2::jar" ) ); + model.addDependency( toDependency( "classworlds:classworlds:1.1-alpha-2::jar" ) ); + addModel( model ); + + model = toModel( "plexus:plexus-containers:1.0.2" ); + model.setParentProject( toParent( "plexus:plexus-root:1.0.3" ) ); + addModel( model ); + + model = toModel( "plexus:plexus-root:1.0.3" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "plexus:plexus-utils:1.0.2" ); + model.setParentProject( toParent( "plexus:plexus-root:1.0.3" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-ssh:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-beta-2" ) ); + model.addDependency( toDependency( "com.jcraft:jsch:0.1.27::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-interactivity-api:1.0-alpha-4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-ssh-common:1.0-beta-2::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-ssh-common-test:1.0-beta-2::jar", "test" ) ); + addModel( model ); + + model = toModel( "com.jcraft:jsch:0.1.27" ); + dep = toDependency( "com.jcraft:jzlib:1.0.7::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "com.jcraft:jzlib:1.0.7" ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-ssh-external:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-beta-2" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-ssh-common:1.0-beta-2::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-ssh-common-test:1.0-beta-2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-file:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-beta-2" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-http-lightweight:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-beta-2" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-http-shared:1.0-beta-2::jar" ) ); + model.addDependency( toDependency( "xml-apis:xml-apis:1.0.b2::jar" ) ); + dep = toDependency( "plexus:plexus-jetty-httpd:1.0-beta-1::jar", "test" ); + addExclusion( dep, "plexus:plexus-container-default" ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-http-shared:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-beta-2" ) ); + model.addDependency( toDependency( "jtidy:jtidy:4aug2000r7-dev::jar" ) ); + addModel( model ); + + model = toModel( "jtidy:jtidy:4aug2000r7-dev" ); + addModel( model ); + + model = toModel( "xml-apis:xml-apis:1.0.b2" ); + addModel( model ); + + model = toModel( "plexus:plexus-jetty-httpd:1.0-beta-1" ); + model.setParentProject( toParent( "plexus:plexus-components:1.0" ) ); + model.addDependency( toDependency( "jetty:jetty:4.2.10::jar" ) ); + model.addDependency( toDependency( "servletapi:servletapi:2.3::jar" ) ); + addModel( model ); + + model = toModel( "plexus:plexus-components:1.0" ); + model.setParentProject( toParent( "plexus:plexus-root:1.0" ) ); + model.addDependency( toDependency( "plexus:plexus-container-default:1.0-alpha-2::jar" ) ); + addModel( model ); + + model = toModel( "plexus:plexus-root:1.0" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "plexus:plexus-container-default:1.0-alpha-2" ); + addModel( model ); + + model = toModel( "jetty:jetty:4.2.10" ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.3::jar", "runtime" ) ); + addModel( model ); + + model = toModel( "javax.servlet:servlet-api:2.3" ); + addModel( model ); + + model = toModel( "servletapi:servletapi:2.3" ); + model.setRelocation( new VersionedReference() ); + model.getRelocation().setGroupId( "javax.servlet" ); + model.getRelocation().setArtifactId( "servlet-api" ); + model.getRelocation().setVersion( "2.3" ); + addModel( model ); + + model = toModel( "easymock:easymock:1.2_Java1.3" ); + addModel( model ); + + model = toModel( "classworlds:classworlds:1.1" ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-artifact-manager:2.0.5" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.5" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-repository-metadata:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-file:1.0-beta-2::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-beta-2::jar" ) ); + model.addDependency( toDependency( "easymock:easymock:1.2_Java1.3::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-artifact:2.0.5" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.5" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-transaction:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-base:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-digest:1.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-digest:1.1" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.12" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4.1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-components:1.1.12" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.10" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-20::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-20::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus:1.0.10" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-component-api:1.0-alpha-20" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0-alpha-20" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-containers:1.0-alpha-20" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.10" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-19::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.3::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.9" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus:1.0.9" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-component-api:1.0-alpha-19" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0-alpha-19" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-containers:1.0-alpha-19" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.10" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-19::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.3::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-utils:1.3" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.8" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus:1.0.8" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-container-default:1.0-alpha-20" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0-alpha-20" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-19::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.3::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + model.addDependency( toDependency( "jmock:jmock:1.0.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "jmock:jmock:1.0.1" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-utils:1.4.1" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.11" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus:1.0.11" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-utils:1.4" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.9" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0-alpha-22" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-19::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.3::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + model.addDependency( toDependency( "jmock:jmock:1.0.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-containers:1.0-alpha-22" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.10" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-19::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.3::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.shared:maven-model-converter:2.1" ); + model.setParentProject( toParent( "org.apache.maven.shared:maven-shared-components:7" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-model-v3:2.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-model:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + model.addDependency( toDependency( "dom4j:dom4j:1.4::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.shared:maven-shared-components:7" ); + model.setParentProject( toParent( "org.apache.maven:maven-parent:5" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-model-v3:2.0" ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-model:2.0.4" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.4" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven:2.0.4" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh:1.0-alpha-7::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh-external:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-file:1.0-alpha-7::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-http-lightweight:1.0-alpha-6::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-provider-api:1.0-alpha-6" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon:1.0-alpha-6" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon:1.0-alpha-6" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-provider-test:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "junit:junit:3.8.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-provider-test:1.0-alpha-6" ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-ssh:1.0-alpha-7" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-alpha-6" ) ); + model.addDependency( toDependency( "com.jcraft:jsch:0.1.24::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-interactivity-api:1.0-alpha-4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-providers:1.0-alpha-6" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon:1.0-alpha-6" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-test:1.0-alpha-6::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-alpha-6::jar" ) ); + addModel( model ); + + model = toModel( "com.jcraft:jsch:0.1.24" ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-ssh-external:1.0-alpha-6" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-alpha-6" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-file:1.0-alpha-7" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-alpha-6" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-http-lightweight:1.0-alpha-6" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-alpha-6" ) ); + dep = toDependency( "plexus:plexus-jetty-httpd:1.0-beta-1::jar", "test" ); + addExclusion( dep, "plexus:plexus-container-default" ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "dom4j:dom4j:1.4" ); + model.addDependency( toDependency( "xml-apis:xml-apis:1.0.b2::jar" ) ); + model.addDependency( toDependency( "jaxen:jaxen:1.0-FCS::jar" ) ); + model.addDependency( toDependency( "saxpath:saxpath:1.0-FCS::jar" ) ); + model.addDependency( toDependency( "msv:msv:20020414::jar" ) ); + model.addDependency( toDependency( "relaxngDatatype:relaxngDatatype:20020414::jar" ) ); + model.addDependency( toDependency( "isorelax:isorelax:20020414::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "junitperf:junitperf:1.8::jar", "test" ) ); + model.addDependency( toDependency( "xerces:xerces:2.0.2::jar", "test" ) ); + model.addDependency( toDependency( "xalan:xalan:2.3.1::jar", "test" ) ); + model.addDependency( toDependency( "jtidy:jtidy:4aug2000r7-dev::jar", "test" ) ); + model.addDependency( toDependency( "pull-parser:pull-parser:2::jar", "test" ) ); + addModel( model ); + + model = toModel( "jaxen:jaxen:1.0-FCS" ); + addModel( model ); + + model = toModel( "saxpath:saxpath:1.0-FCS" ); + addModel( model ); + + model = toModel( "msv:msv:20020414" ); + addModel( model ); + + model = toModel( "relaxngDatatype:relaxngDatatype:20020414" ); + addModel( model ); + + model = toModel( "isorelax:isorelax:20020414" ); + addModel( model ); + + model = toModel( "junitperf:junitperf:1.8" ); + addModel( model ); + + model = toModel( "xerces:xerces:2.0.2" ); + model.setRelocation( new VersionedReference() ); + model.getRelocation().setGroupId( "xerces" ); + model.getRelocation().setArtifactId( "xercesImpl" ); + addModel( model ); + + model = toModel( "xerces:xercesImpl:2.0.2" ); + addModel( model ); + + model = toModel( "xalan:xalan:2.3.1" ); + addModel( model ); + + model = toModel( "pull-parser:pull-parser:2" ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-artifact-reports:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-reporting:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-report-manager:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-database:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-repository-layer:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-commons:1.0-alpha-2::jar", "test" ) ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.8.0.7::jar", "test" ) ); + model.addDependency( toDependency( "easymock:easymock:1.2_Java1.3::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-slf4j-logging:1.1-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.slf4j:slf4j-log4j12:1.2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-reporting:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-parent:1.0-alpha-2-SNAPSHOT" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-report-manager:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-reporting:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-database:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-repository-layer:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:2.2::jar" ) ); + model.addDependency( toDependency( "commons-io:commons-io:1.2::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-database:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-parent:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-consumer-api:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-configuration:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-model:1.0-alpha-2-SNAPSHOT::jar" ) ); + dep = toDependency( "org.codehaus.plexus:plexus-jdo2:1.0-alpha-8::jar" ); + addExclusion( dep, "xerces:xercesImpl" ); + addExclusion( dep, "xerces:xmlParserAPIs" ); + model.addDependency( dep ); + dep = toDependency( "jpox:jpox:1.1.7::jar", "compile" ); + addExclusion( dep, "javax.sql:jdbc-stdext" ); + model.addDependency( dep ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:2.2::jar" ) ); + model.addDependency( toDependency( "commons-io:commons-io:1.2::jar" ) ); + dep = toDependency( "commons-logging:commons-logging:1.0.4::jar" ); + addExclusion( dep, "logkit:logkit" ); + model.addDependency( dep ); + model.addDependency( toDependency( "log4j:log4j:1.2.8::jar" ) ); + model.addDependency( toDependency( "org.apache.derby:derby:10.1.3.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-commons:1.0-alpha-2::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-repository-layer:1.0-alpha-2-SNAPSHOT::jar", "test" ) ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.8.0.7::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.derby:derbytools:10.1.3.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-consumer-api:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-consumers:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-model:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:3.2::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-consumers:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-base:1.0-alpha-2-SNAPSHOT" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-model:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-base:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-common:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependency( toDependency( "javax.jdo:jdo2-api:2.0::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:2.2::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:3.2::jar" ) ); + model.addDependency( toDependency( "commons-io:commons-io:1.2::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-common:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-base:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:2.2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + addModel( model ); + + model = toModel( "commons-lang:commons-lang:2.2" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-component-api:1.0-alpha-22" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0-alpha-22" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + addModel( model ); + + model = toModel( "javax.jdo:jdo2-api:2.0" ); + model.addDependency( toDependency( "geronimo-spec:geronimo-spec-jta:1.0.1B-rc2::jar" ) ); + dep = toDependency( "xerces:xerces:2.4.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "xml-apis:xml-apis:1.0.b2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "geronimo-spec:geronimo-spec-jta:1.0.1B-rc2" ); + addModel( model ); + + model = toModel( "xerces:xerces:2.4.0" ); + model.setRelocation( new VersionedReference() ); + model.getRelocation().setGroupId( "xerces" ); + model.getRelocation().setArtifactId( "xercesImpl" ); + addModel( model ); + + model = toModel( "xerces:xercesImpl:2.4.0" ); + addModel( model ); + + model = toModel( "commons-collections:commons-collections:3.2" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "commons-io:commons-io:1.2" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-configuration:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-base:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-common:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-xml-tools:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-policies:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:2.2::jar" ) ); + model.addDependency( toDependency( "commons-io:commons-io:1.2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-api:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-commons:1.0-alpha-2::jar", "test" ) ); + model.addDependency( toDependency( "easymock:easymock:1.2_Java1.3::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-xml-tools:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-base:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-common:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:3.2::jar" ) ); + dep = toDependency( "dom4j:dom4j:1.6.1::jar" ); + addExclusion( dep, "xom:xom" ); + model.addDependency( dep ); + dep = toDependency( "jaxen:jaxen:1.1::jar" ); + addExclusion( dep, "jdom:jdom" ); + addExclusion( dep, "xom:xom" ); + model.addDependency( dep ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependency( toDependency( "org.slf4j:slf4j-log4j12:1.2::jar" ) ); + addModel( model ); + + model = toModel( "dom4j:dom4j:1.6.1" ); + dep = toDependency( "jaxme:jaxme-api:0.3::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "jaxen:jaxen:1.1-beta-6::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "msv:xsdlib:20030807::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "msv:relaxngDatatype:20030807::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "pull-parser:pull-parser:2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "xpp3:xpp3:1.1.3.3::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "stax:stax-api:1.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "xml-apis:xml-apis:1.0.b2::jar" ) ); + model.addDependency( toDependency( "junitperf:junitperf:1.8::jar", "test" ) ); + model.addDependency( toDependency( "stax:stax-ri:1.0::jar", "test" ) ); + model.addDependency( toDependency( "xerces:xercesImpl:2.6.2::jar", "test" ) ); + model.addDependency( toDependency( "xalan:xalan:2.5.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "jaxme:jaxme-api:0.3" ); + addModel( model ); + + model = toModel( "jaxen:jaxen:1.1-beta-6" ); + addModel( model ); + + model = toModel( "msv:xsdlib:20030807" ); + addModel( model ); + + model = toModel( "msv:relaxngDatatype:20030807" ); + addModel( model ); + + model = toModel( "xpp3:xpp3:1.1.3.3" ); + addModel( model ); + + model = toModel( "stax:stax-api:1.0" ); + addModel( model ); + + model = toModel( "stax:stax-ri:1.0" ); + addModel( model ); + + model = toModel( "xerces:xercesImpl:2.6.2" ); + addModel( model ); + + model = toModel( "xalan:xalan:2.5.1" ); + addModel( model ); + + model = toModel( "jaxen:jaxen:1.1" ); + model.addDependency( toDependency( "dom4j:dom4j:1.6.1::jar" ) ); + model.addDependency( toDependency( "jdom:jdom:1.0::jar" ) ); + model.addDependency( toDependency( "xml-apis:xml-apis:1.3.02::jar" ) ); + model.addDependency( toDependency( "xerces:xercesImpl:2.6.2::jar" ) ); + model.addDependency( toDependency( "xom:xom:1.0::jar" ) ); + addModel( model ); + + model = toModel( "jdom:jdom:1.0" ); + dep = toDependency( "xerces:xercesImpl:2.6.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "xml-apis:xml-apis:1.0.b2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "jaxen:jaxen:1.0-FCS::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "saxpath:saxpath:1.0-FCS::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "xalan:xalan:2.5.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "xerces:xercesImpl:2.6.0" ); + addModel( model ); + + model = toModel( "xalan:xalan:2.5.0" ); + addModel( model ); + + model = toModel( "xml-apis:xml-apis:1.3.02" ); + addModel( model ); + + model = toModel( "xom:xom:1.0" ); + model.addDependency( toDependency( "xerces:xmlParserAPIs:2.6.2::jar" ) ); + model.addDependency( toDependency( "xerces:xercesImpl:2.6.2::jar" ) ); + model.addDependency( toDependency( "xalan:xalan:2.6.0::jar" ) ); + model.addDependency( toDependency( "com.ibm.icu:icu4j:2.6.1::jar" ) ); + addModel( model ); + + model = toModel( "xerces:xmlParserAPIs:2.6.2" ); + addModel( model ); + + model = toModel( "xalan:xalan:2.6.0" ); + model.addDependency( toDependency( "xml-apis:xml-apis:2.0.2::jar" ) ); + dep = toDependency( "xerces:xercesImpl:2.6.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "xml-apis:xml-apis:2.0.2" ); + model.setRelocation( new VersionedReference() ); + model.getRelocation().setGroupId( "xml-apis" ); + model.getRelocation().setArtifactId( "xml-apis" ); + model.getRelocation().setVersion( "1.0.b2" ); + addModel( model ); + + model = toModel( "com.ibm.icu:icu4j:2.6.1" ); + addModel( model ); + + model = toModel( "org.slf4j:slf4j-log4j12:1.2" ); + model.setParentProject( toParent( "org.slf4j:slf4j-parent:1.2" ) ); + model.addDependency( toDependency( "org.slf4j:slf4j-api:1.2::jar" ) ); + model.addDependency( toDependency( "log4j:log4j:1.2.13::jar" ) ); + addModel( model ); + + model = toModel( "org.slf4j:slf4j-parent:1.2" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.slf4j:slf4j-api:1.2" ); + model.setParentProject( toParent( "org.slf4j:slf4j-parent:1.2" ) ); + addModel( model ); + + model = toModel( "log4j:log4j:1.2.13" ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-policies:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-base:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-common:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:2.2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-digest:1.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.cache:plexus-cache-ehcache:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "easymock:easymock:1.2_Java1.3::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-slf4j-logging:1.1-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.slf4j:slf4j-log4j12:1.2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.cache:plexus-cache-ehcache:1.0-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus.cache:plexus-cache-providers-parent:1.0-alpha-2" ) ); + model.addDependency( toDependency( "net.sf.ehcache:ehcache:1.2.4::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:3.2::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.cache:plexus-cache-providers-parent:1.0-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus.cache:plexus-cache-parent:1.0-alpha-2" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.cache:plexus-cache-api:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.cache:plexus-cache-test:1.0-alpha-2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.cache:plexus-cache-parent:1.0-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.9" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-16::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-16::jar" ) ); + model.addDependencyManagement( toDependency( "commons-lang:commons-lang:2.1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-components:1.1.9" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.10" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-16::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-16::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-component-api:1.0-alpha-16" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0-alpha-16" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-containers:1.0-alpha-16" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.9" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-16::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.3::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-container-default:1.0-alpha-16" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0-alpha-16" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-16::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.3::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + model.addDependency( toDependency( "jmock:jmock:1.0.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "commons-lang:commons-lang:2.1" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.cache:plexus-cache-api:1.0-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus.cache:plexus-cache-parent:1.0-alpha-2" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-16::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-16::jar" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:2.1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.cache:plexus-cache-test:1.0-alpha-2" ); + addModel( model ); + + model = toModel( "net.sf.ehcache:ehcache:1.2.4" ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.4::jar", "compile" ) ); + dep = toDependency( "org.hibernate:hibernate:3.2.0.cr3::jar", "test" ); + addExclusion( dep, "javax.transaction:jta" ); + addExclusion( dep, "javax.security:jacc" ); + model.addDependency( dep ); + dep = toDependency( "net.sf.hibernate:hibernate:2.1.8::jar", "test" ); + addExclusion( dep, "javax.transaction:jta" ); + addExclusion( dep, "javax.security:jacc" ); + model.addDependency( dep ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar", "test" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "httpunit:httpunit:1.6::jar", "test" ) ); + model.addDependency( toDependency( "commons-httpclient:commons-httpclient:3.0.1::jar", "test" ) ); + model.addDependency( toDependency( "com.cenqua.clover:clover:1.3.13::jar", "test" ) ); + model.addDependency( toDependency( "checkstyle:checkstyle:4.1::jar", "test" ) ); + model.addDependency( toDependency( "checkstyle:checkstyle-optional:4.1::jar", "test" ) ); + model.addDependency( toDependency( "commons-httpclient:commons-httpclient:3.0.1::jar", "test" ) ); + model.addDependency( toDependency( "httpunit:httpunit:1.6.1::jar", "test" ) ); + model.addDependency( toDependency( "httpunit:httpunit:1.6.1::jar", "test" ) ); + model.addProperty( "licenseFile", "${basedir}/tools/clover.license" ); + addModel( model ); + + model = toModel( "commons-logging:commons-logging:1.0.4" ); + dep = toDependency( "log4j:log4j:1.2.6::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "logkit:logkit:1.0.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + dep = toDependency( "avalon-framework:avalon-framework:4.1.3::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "log4j:log4j:1.2.6" ); + addModel( model ); + + model = toModel( "logkit:logkit:1.0.1" ); + addModel( model ); + + model = toModel( "junit:junit:3.7" ); + addModel( model ); + + model = toModel( "avalon-framework:avalon-framework:4.1.3" ); + addModel( model ); + + model = toModel( "org.hibernate:hibernate:3.2.0.cr3" ); + addModel( model ); + + model = toModel( "net.sf.hibernate:hibernate:2.1.8" ); + addModel( model ); + + model = toModel( "javax.servlet:servlet-api:2.4" ); + addModel( model ); + + model = toModel( "httpunit:httpunit:1.6" ); + model.addDependency( toDependency( "xerces:xmlParserAPIs:2.2.1::jar" ) ); + model.addDependency( toDependency( "xerces:xercesImpl:2.6.2::jar" ) ); + model.addDependency( toDependency( "nekohtml:nekohtml:0.9.1::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar" ) ); + model.addDependency( toDependency( "rhino:js:1.5R4.1::jar" ) ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.3::jar" ) ); + model.addDependency( toDependency( "jtidy:jtidy:4aug2000r7-dev::jar" ) ); + model.addDependency( toDependency( "javax.activation:activation:1.0.2::jar", "test" ) ); + model.addDependency( toDependency( "javax.mail:mail:1.3.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "xerces:xmlParserAPIs:2.2.1" ); + addModel( model ); + + model = toModel( "nekohtml:nekohtml:0.9.1" ); + model.addDependency( toDependency( "xerces:xerces:2.4.0::jar" ) ); + addModel( model ); + + model = toModel( "rhino:js:1.5R4.1" ); + addModel( model ); + + model = toModel( "javax.activation:activation:1.0.2" ); + addModel( model ); + + model = toModel( "javax.mail:mail:1.3.1" ); + model.addDependency( toDependency( "javax.activation:activation:1.0.2::jar", "compile" ) ); + addModel( model ); + + model = toModel( "commons-httpclient:commons-httpclient:3.0.1" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.3::jar" ) ); + model.addDependency( toDependency( "commons-codec:commons-codec:1.2::jar" ) ); + addModel( model ); + + model = toModel( "commons-logging:commons-logging:1.0.3" ); + dep = toDependency( "log4j:log4j:1.2.6::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "logkit:logkit:1.0.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + addModel( model ); + + model = toModel( "commons-codec:commons-codec:1.2" ); + addModel( model ); + + model = toModel( "com.cenqua.clover:clover:1.3.13" ); + addModel( model ); + + model = toModel( "checkstyle:checkstyle:4.1" ); + model.addDependency( toDependency( "antlr:antlr:2.7.2::jar" ) ); + model.addDependency( toDependency( "commons-beanutils:commons-beanutils-core:1.7.0::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.1::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.3::jar" ) ); + addModel( model ); + + model = toModel( "antlr:antlr:2.7.2" ); + addModel( model ); + + model = toModel( "commons-beanutils:commons-beanutils-core:1.7.0" ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.0::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + addModel( model ); + + model = toModel( "commons-logging:commons-logging:1.0" ); + addModel( model ); + + model = toModel( "commons-collections:commons-collections:2.0" ); + addModel( model ); + + model = toModel( "commons-collections:commons-collections:2.1" ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + addModel( model ); + + model = toModel( "checkstyle:checkstyle-optional:4.1" ); + model.addDependency( toDependency( "checkstyle:checkstyle:4.1::jar" ) ); + addModel( model ); + + model = toModel( "httpunit:httpunit:1.6.1" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-slf4j-logging:1.1-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-logging:1.0.4" ) ); + model.addDependency( toDependency( "org.slf4j:slf4j-simple:1.2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-logging-provider-test:1.0.4::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-logging:1.0.4" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.11" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-logging-provider-test:1.0.4::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-22::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-logging-provider-test:1.0.4" ); + addModel( model ); + + model = toModel( "org.slf4j:slf4j-simple:1.2" ); + model.setParentProject( toParent( "org.slf4j:slf4j-parent:1.2" ) ); + model.addDependency( toDependency( "org.slf4j:slf4j-api:1.2::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.registry:plexus-registry-api:1.0-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus.registry:plexus-registry:1.0-alpha-2" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-17::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.registry:plexus-registry:1.0-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.12" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-17::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.registry:plexus-registry-api:1.0-alpha-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.registry:plexus-registry-test:1.0-alpha-2::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-container-default:1.0-alpha-17" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0-alpha-17" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-17::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.3::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + model.addDependency( toDependency( "jmock:jmock:1.0.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-containers:1.0-alpha-17" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.9" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-17::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.3::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-component-api:1.0-alpha-17" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0-alpha-17" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.registry:plexus-registry-test:1.0-alpha-2" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.registry:plexus-registry-commons:1.0-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus.registry:plexus-registry-providers:1.0-alpha-2" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-api:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-test:1.0-alpha-2::jar", "test" ) ); + dep = toDependency( "commons-configuration:commons-configuration:1.3::jar" ); + addExclusion( dep, "commons-beanutils:commons-beanutils-core" ); + addExclusion( dep, "xerces:xerces" ); + addExclusion( dep, "xerces:xercesImpl" ); + addExclusion( dep, "xalan:xalan" ); + addExclusion( dep, "xml-apis:xml-apis" ); + addExclusion( dep, "servletapi:servletapi" ); + model.addDependency( dep ); + model.addDependency( toDependency( "commons-beanutils:commons-beanutils:1.7.0::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.registry:plexus-registry-providers:1.0-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus.registry:plexus-registry:1.0-alpha-2" ) ); + addModel( model ); + + model = toModel( "commons-configuration:commons-configuration:1.3" ); + model.addDependency( toDependency( "commons-collections:commons-collections:3.1::jar" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:2.1::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging-api:1.0.4::jar" ) ); + model.addDependency( toDependency( "commons-digester:commons-digester:1.6::jar" ) ); + model.addDependency( toDependency( "commons-beanutils:commons-beanutils-core:1.7.0::jar" ) ); + model.addDependency( toDependency( "commons-codec:commons-codec:1.3::jar" ) ); + model.addDependency( toDependency( "commons-jxpath:commons-jxpath:1.2::jar" ) ); + model.addDependency( toDependency( "xerces:xerces:2.2.1::jar" ) ); + model.addDependency( toDependency( "xalan:xalan:2.7.0::jar" ) ); + model.addDependency( toDependency( "xml-apis:xml-apis:2.0.2::jar" ) ); + dep = toDependency( "servletapi:servletapi:2.4::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "spice:spice-jndikit:1.1::jar", "test" ) ); + model.addDependency( toDependency( "commons-dbcp:commons-dbcp:1.1::jar", "test" ) ); + model.addDependency( toDependency( "commons-pool:commons-pool:1.1::jar", "test" ) ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.7.2.2::jar", "test" ) ); + model.addDependency( toDependency( "dbunit:dbunit:2.1::jar", "test" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "junit-addons:junit-addons:1.4::jar", "test" ) ); + model.addDependency( toDependency( "mockobjects:mockobjects-core:0.09::jar", "test" ) ); + model.addDependency( toDependency( "mockobjects:mockobjects-jdk1.4-j2ee1.3:0.09::jar", "test" ) ); + addModel( model ); + + model = toModel( "commons-collections:commons-collections:3.1" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "commons-logging:commons-logging-api:1.0.4" ); + addModel( model ); + + model = toModel( "commons-digester:commons-digester:1.6" ); + model.addDependency( toDependency( "commons-beanutils:commons-beanutils:1.6::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.1::jar" ) ); + model.addDependency( toDependency( "xml-apis:xml-apis:1.0.b2::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "commons-beanutils:commons-beanutils:1.6" ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.0::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + addModel( model ); + + model = toModel( "commons-codec:commons-codec:1.3" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "commons-jxpath:commons-jxpath:1.2" ); + model.addDependency( toDependency( "xerces:xerces:1.2.3::jar" ) ); + model.addDependency( toDependency( "servletapi:servletapi:2.2::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.8::jar" ) ); + model.addDependency( toDependency( "ant:ant-optional:1.5.1::jar" ) ); + model.addDependency( toDependency( "xml-apis:xml-apis:2.0.2::jar" ) ); + model.addDependency( toDependency( "jdom:jdom:b9::jar" ) ); + model.addDependency( toDependency( "commons-beanutils:commons-beanutils:1.4::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.0::jar" ) ); + addModel( model ); + + model = toModel( "xerces:xerces:1.2.3" ); + addModel( model ); + + model = toModel( "servletapi:servletapi:2.2" ); + model.setRelocation( new VersionedReference() ); + model.getRelocation().setGroupId( "javax.servlet" ); + model.getRelocation().setArtifactId( "servlet-api" ); + model.getRelocation().setVersion( "2.2" ); + addModel( model ); + + model = toModel( "javax.servlet:servlet-api:2.2" ); + addModel( model ); + + model = toModel( "junit:junit:3.8" ); + addModel( model ); + + model = toModel( "ant:ant-optional:1.5.1" ); + addModel( model ); + + model = toModel( "jdom:jdom:b9" ); + addModel( model ); + + model = toModel( "commons-beanutils:commons-beanutils:1.4" ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.0::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + addModel( model ); + + model = toModel( "xerces:xerces:2.2.1" ); + addModel( model ); + + model = toModel( "xalan:xalan:2.7.0" ); + model.addDependency( toDependency( "xml-apis:xml-apis:2.0.2::jar" ) ); + dep = toDependency( "xerces:xercesImpl:2.6.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "servletapi:servletapi:2.4" ); + addModel( model ); + + model = toModel( "spice:spice-jndikit:1.1" ); + addModel( model ); + + model = toModel( "commons-dbcp:commons-dbcp:1.1" ); + addModel( model ); + + model = toModel( "commons-pool:commons-pool:1.1" ); + addModel( model ); + + model = toModel( "hsqldb:hsqldb:1.7.2.2" ); + addModel( model ); + + model = toModel( "dbunit:dbunit:2.1" ); + addModel( model ); + + model = toModel( "junit-addons:junit-addons:1.4" ); + addModel( model ); + + model = toModel( "mockobjects:mockobjects-core:0.09" ); + addModel( model ); + + model = toModel( "mockobjects:mockobjects-jdk1.4-j2ee1.3:0.09" ); + addModel( model ); + + model = toModel( "commons-beanutils:commons-beanutils:1.7.0" ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.3::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-jdo2:1.0-alpha-8" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.6" ) ); + model.addDependency( toDependency( "javax.jdo:jdo2-api:2.0::jar" ) ); + dep = toDependency( "jpox:jpox:1.1.1::jar", "test" ); + addExclusion( dep, "javax.sql:jdbc-stdext" ); + model.addDependency( dep ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.7.3.0::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-components:1.1.6" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.8" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + addModel( model ); + + model = toModel( "jpox:jpox:1.1.1" ); + model.setParentProject( toParent( "jpox:jpox-parent:1.1.1" ) ); + model.addDependency( toDependency( "log4j:log4j:1.2.8::jar" ) ); + model.addDependency( toDependency( "javax.jdo:jdo2-api:2.0::jar" ) ); + model.addDependency( toDependency( "javax.resource:connector:1.0::jar" ) ); + dep = toDependency( "javax.security:jaas:1.0.01::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "javax.sql:jdbc-stdext:2.0::jar" ) ); + dep = toDependency( "ant:ant:1.6::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "jpox:jpox-dbcp:1.1.1::jar", "test" ) ); + model.addDependency( toDependency( "commons-dbcp:commons-dbcp:1.2::jar", "test" ) ); + model.addDependency( toDependency( "commons-pool:commons-pool:1.2::jar", "test" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:3.1::jar", "test" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "jpox:jpox-parent:1.1.1" ); + addModel( model ); + + model = toModel( "log4j:log4j:1.2.8" ); + addModel( model ); + + model = toModel( "javax.resource:connector:1.0" ); + addModel( model ); + + model = toModel( "javax.security:jaas:1.0.01" ); + addModel( model ); + + model = toModel( "javax.sql:jdbc-stdext:2.0" ); + addModel( model ); + + model = toModel( "ant:ant:1.6" ); + addModel( model ); + + model = toModel( "jpox:jpox-dbcp:1.1.1" ); + addModel( model ); + + model = toModel( "commons-dbcp:commons-dbcp:1.2" ); + addModel( model ); + + model = toModel( "commons-pool:commons-pool:1.2" ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.1::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "xml-apis:xml-apis:2.0.2::jar" ) ); + model.addDependency( toDependency( "xerces:xerces:2.0.2::jar" ) ); + addModel( model ); + + model = toModel( "hsqldb:hsqldb:1.7.3.0" ); + addModel( model ); + + model = toModel( "jpox:jpox:1.1.7" ); + model.setParentProject( toParent( "jpox:jpox-parent:1.1.7" ) ); + model.addDependency( toDependency( "log4j:log4j:1.2.8::jar" ) ); + model.addDependency( toDependency( "javax.jdo:jdo2-api:2.0::jar" ) ); + model.addDependency( toDependency( "javax.resource:connector:1.0::jar" ) ); + model.addDependency( toDependency( "javax.transaction:jta:1.0.1B::jar" ) ); + dep = toDependency( "ant:ant:1.6::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "jpox:jpox-parent:1.1.7" ); + addModel( model ); + + model = toModel( "javax.transaction:jta:1.0.1B" ); + addModel( model ); + + model = toModel( "org.apache.derby:derby:10.1.3.1" ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-repository-layer:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-base:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-configuration:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-consumer-api:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-model:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-xml-tools:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-expression-evaluator:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "org.slf4j:slf4j-log4j12:1.2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.cache:plexus-cache-api:1.0-alpha-2::jar", "compile" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.cache:plexus-cache-ehcache:1.0-alpha-2::jar", "compile" ) ); + model.addDependency( toDependency( "xmlunit:xmlunit:1.0::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-commons:1.0-alpha-2::jar", "test" ) ); + model.addDependency( toDependency( "easymock:easymock:1.2_Java1.3::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-expression-evaluator:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.7" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-components:1.1.7" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.8" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + addModel( model ); + + model = toModel( "xmlunit:xmlunit:1.0" ); + addModel( model ); + + model = toModel( "hsqldb:hsqldb:1.8.0.7" ); + addModel( model ); + + model = toModel( "org.apache.derby:derbytools:10.1.3.1" ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-converter:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-base:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-consumer-api:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-repository-layer:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-artifact-converter:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.shared:maven-model-converter:2.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-digest:1.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-i18n:1.0-beta-6::jar" ) ); + model.addDependency( toDependency( "commons-io:commons-io:1.2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-commons:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.8.0.7::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-i18n:1.0-beta-6" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.4" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-components:1.1.4" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.4" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-core:1.0-alpha-2-SNAPSHOT-SNAPSHOT" ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-core-consumers:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-consumers:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-configuration:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-consumer-api:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-repository-layer:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-digest:1.1::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-database-consumers:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-consumers:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-database:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-artifact-reports:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-configuration:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-consumer-api:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-repository-layer:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-digest:1.1::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-indexer:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-base:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-repository-layer:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-model:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.lucene:lucene-core:2.0.0::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-digest:1.1::jar" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:2.2::jar" ) ); + model.addDependency( toDependency( "commons-io:commons-io:1.2::jar" ) ); + model.addDependency( toDependency( "easymock:easymock:1.2_Java1.3::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.lucene:lucene-core:2.0.0" ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-lucene-consumers:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-consumers:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-indexer:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-configuration:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-consumer-api:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-repository-layer:1.0-alpha-2-SNAPSHOT::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-plexus-application:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-web-standalone:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-webapp:1.0-alpha-2-SNAPSHOT::war" ) ); + model.addProperty( "archivaVersion", "1.0-alpha-2-SNAPSHOT" ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-web-standalone:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-web:1.0-alpha-2-SNAPSHOT" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-proxy:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-base:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-configuration:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-repository-layer:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "commons-io:commons-io:1.2::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-file:1.0-beta-2::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-beta-2::jar" ) ); + dep = toDependency( "org.codehaus.plexus:plexus-digest:1.1::jar" ); + addExclusion( dep, "org.codehaus.plexus:plexus-container-default" ); + model.addDependency( dep ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-commons:1.0-alpha-2::jar", "test" ) ); + model.addDependency( toDependency( "easymock:easymock:1.2_Java1.3::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-slf4j-logging:1.1-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.slf4j:slf4j-log4j12:1.2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-scheduled:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-parent:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-configuration:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-database:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-repository-layer:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-taskqueue:1.0-alpha-6::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-quartz:1.0-alpha-3::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:2.2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-api:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-database-consumers:1.0-alpha-2-SNAPSHOT::jar", "test" ) ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.8.0.7::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-commons:1.0-alpha-2::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-slf4j-logging:1.1-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.slf4j:slf4j-log4j12:1.2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-taskqueue:1.0-alpha-6" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.7" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "backport-util-concurrent:backport-util-concurrent:3.0::jar" ) ); + addModel( model ); + + model = toModel( "backport-util-concurrent:backport-util-concurrent:3.0" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-quartz:1.0-alpha-3" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.6" ) ); + model.addDependency( toDependency( "quartz:quartz:1.4.5::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.2::jar" ) ); + addModel( model ); + + model = toModel( "quartz:quartz:1.4.5" ); + addModel( model ); + + model = toModel( "commons-logging:commons-logging:1.0.2" ); + dep = toDependency( "log4j:log4j:1.1.3::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "logkit:logkit:1.0.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + addModel( model ); + + model = toModel( "log4j:log4j:1.1.3" ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-security:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-web:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-role-manager:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-memory:1.0-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-xwork-integration:1.0-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.derby:derby:10.1.3.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-rbac-role-manager:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-rbac:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-model:1.0-alpha-1::jar" ) ); + dep = toDependency( "net.java.dev.stax-utils:stax-utils:20060502::jar" ); + addExclusion( dep, "com.bea.xml:jsr173-ri" ); + model.addDependency( dep ); + model.addDependency( toDependency( "stax:stax-api:1.0.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.woodstox:wstx-asl:3.2.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-memory:1.0-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-jdo:1.0-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-model:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-common-jdo:1.0-alpha-1::jar" ) ); + dep = toDependency( "net.java.dev.stax-utils:stax-utils:20060502::jar" ); + addExclusion( dep, "com.bea.xml:jsr173-ri" ); + model.addDependency( dep ); + model.addDependency( toDependency( "stax:stax-api:1.0.1::jar" ) ); + dep = toDependency( "stax:stax:1.1.1-dev::jar", "test" ); + addExclusion( dep, "xmlbeans:xmlbeans-jsr173-api" ); + model.addDependency( dep ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.8.0.4::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-rbac:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback:1.0-alpha-1" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.10" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-20::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-20::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-configuration:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-system:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-policy:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-common-jdo:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-authentication-api:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-keys-api:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-keys-tests:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-keys-cached:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-keys-memory:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-keys-jdo:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-authentication-users:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-authentication-=keys=:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-authentication-memory:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-authentication-keys:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-authorization-api:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-users-api:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-users-jdo:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-users-memory:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-users-cached:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-users-tests:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-authorization-rbac:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-rbac-model:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-rbac-tests:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-rbac-memory:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-rbac-cached:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-rbac-jdo:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-rbac-role-manager:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-xwork-integration:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-taglib:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-xwork-content:1.0-alpha-1::war" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-xwork-integration:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-20::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-20::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.2::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-ehcache:1.0-alpha-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-mail-sender-api:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-mail-sender-javamail:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-expression-evaluator:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-log4j-logging:1.1-alpha-2::jar", "test" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-xwork-integration:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "xalan:xalan:2.7.0::jar" ) ); + model.addDependencyManagement( toDependency( "xml-apis:xml-apis:1.3.03::jar" ) ); + model.addDependencyManagement( toDependency( "commons-lang:commons-lang:2.2::jar" ) ); + model.addDependencyManagement( toDependency( "commons-collections:commons-collections:3.2::jar" ) ); + model.addDependencyManagement( toDependency( "commons-logging:commons-logging:1.0.4::jar" ) ); + model.addDependencyManagement( toDependency( "hsqldb:hsqldb:1.8.0.4::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.derby:derby:10.1.3.1::jar" ) ); + model.addProperty( "security.version", "1.0-alpha-1" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-configuration:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-expression-evaluator:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-commons:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-log4j-logging:1.1-alpha-2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.registry:plexus-registry-commons:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.registry:plexus-registry-providers:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-test:1.0-alpha-1::jar" ) ); + dep = toDependency( "commons-configuration:commons-configuration:1.3::jar" ); + addExclusion( dep, "commons-beanutils:commons-beanutils-core" ); + addExclusion( dep, "xerces:xerces" ); + addExclusion( dep, "xerces:xercesImpl" ); + addExclusion( dep, "xalan:xalan" ); + addExclusion( dep, "xml-apis:xml-apis" ); + addExclusion( dep, "servletapi:servletapi" ); + model.addDependency( dep ); + model.addDependency( toDependency( "commons-beanutils:commons-beanutils:1.7.0::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.registry:plexus-registry-providers:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.registry:plexus-registry:1.0-alpha-1" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.registry:plexus-registry:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.9" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-17::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.registry:plexus-registry-api:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.registry:plexus-registry-test:1.0-alpha-1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.registry:plexus-registry-api:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.registry:plexus-registry:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-17::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.registry:plexus-registry-test:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.registry:plexus-registry:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-17::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-log4j-logging:1.1-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-logging:1.0.2" ) ); + model.addDependency( toDependency( "log4j:log4j:1.2.8::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-logging-provider-test:1.0-alpha-2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-logging:1.0.2" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.4" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-logging-provider-test:1.0-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-logging:1.0.2" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-system:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-configuration:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authentication-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authorization-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-cached:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-cached:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authentication-memory:1.0-alpha-1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authentication-api:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-authentication:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-policy:1.0-alpha-1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authentication:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-api:1.0-alpha-1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-users-api:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-users:1.0-alpha-1" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-users:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback:1.0-alpha-1" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-policy:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-configuration:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-api:1.0-alpha-1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authorization-api:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-authorization:1.0-alpha-1" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authorization:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-api:1.0-alpha-1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-users-cached:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-users-providers:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-policy:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-ehcache:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-jdo:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-tests:1.0-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-memory:1.0-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-log4j-logging:1.1-alpha-2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-users-providers:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-users:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-api:1.0-alpha-1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-ehcache:1.0-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.7" ) ); + model.addDependency( toDependency( "net.sf.ehcache:ehcache:1.2.4::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:3.2::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-users-jdo:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-users-providers:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-common-jdo:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-policy:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-tests:1.0-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.8.0.4::jar", "test" ) ); + dep = toDependency( "net.java.dev.stax-utils:stax-utils:20060502::jar" ); + addExclusion( dep, "com.bea.xml:jsr173-ri" ); + model.addDependency( dep ); + model.addDependency( toDependency( "stax:stax-api:1.0.1::jar" ) ); + model.addDependency( toDependency( "woodstox:wstx-asl:3.2.0::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-utils:1.2" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.5" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus:1.0.5" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-common-jdo:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-common:1.0-alpha-1" ) ); + dep = toDependency( "org.codehaus.plexus:plexus-jdo2:1.0-alpha-8::jar" ); + addExclusion( dep, "xerces:xercesImpl" ); + addExclusion( dep, "xerces:xmlParserAPIs" ); + model.addDependency( dep ); + dep = toDependency( "jpox:jpox:1.1.7::jar", "compile" ); + addExclusion( dep, "javax.sql:jdbc-stdext" ); + model.addDependency( dep ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.8.0.4::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-configuration:1.0-alpha-1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-common:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback:1.0-alpha-1" ) ); + addModel( model ); + + model = toModel( "hsqldb:hsqldb:1.8.0.4" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-users-tests:1.0-alpha-1" ); + addModel( model ); + + model = toModel( "net.java.dev.stax-utils:stax-utils:20060502" ); + model.addDependency( toDependency( "com.bea.xml:jsr173-ri:1.0::jar" ) ); + addModel( model ); + + model = toModel( "com.bea.xml:jsr173-ri:1.0" ); + model.addDependency( toDependency( "javax.xml:jsr173:1.0::jar" ) ); + addModel( model ); + + model = toModel( "javax.xml:jsr173:1.0" ); + addModel( model ); + + model = toModel( "stax:stax-api:1.0.1" ); + addModel( model ); + + model = toModel( "woodstox:wstx-asl:3.2.0" ); + model.setRelocation( new VersionedReference() ); + model.getRelocation().setGroupId( "org.codehaus.woodstox" ); + addModel( model ); + + model = toModel( "org.codehaus.woodstox:wstx-asl:3.2.0" ); + model.addDependency( toDependency( "stax:stax-api:1.0.1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-users-memory:1.0-alpha-1" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-keys-api:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-keys:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-digest:1.0::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-keys:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback:1.0-alpha-1" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-digest:1.0" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.7" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-keys-cached:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-keys-providers:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-ehcache:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-jdo:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-tests:1.0-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-memory:1.0-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-log4j-logging:1.1-alpha-2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-keys-providers:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-keys:1.0-alpha-1" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-keys-jdo:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-keys-providers:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-common-jdo:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-tests:1.0-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.8.0.4::jar", "test" ) ); + dep = toDependency( "net.java.dev.stax-utils:stax-utils:20060502::jar" ); + addExclusion( dep, "com.bea.xml:jsr173-ri" ); + model.addDependency( dep ); + model.addDependency( toDependency( "stax:stax-api:1.0.1::jar" ) ); + model.addDependency( toDependency( "woodstox:wstx-asl:3.2.0::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-keys-tests:1.0-alpha-1" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-keys-memory:1.0-alpha-1" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authentication-memory:1.0-alpha-1" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authentication-users:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-authentication-providers:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authentication-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-policy:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-cached:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-memory:1.0-alpha-1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authentication-providers:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-authentication:1.0-alpha-1" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authentication-=keys=:1.0-alpha-1" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authentication-keys:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-authentication-providers:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authentication-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-cached:1.0-alpha-1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authorization-rbac:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-authorization-providers:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authorization-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-cached:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-cached:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-model:1.0-alpha-1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authorization-providers:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-authorization:1.0-alpha-1" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-rbac-cached:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-rbac-providers:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-system:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authorization-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-model:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-ehcache:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-jdo:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-memory:1.0-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-tests:1.0-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-log4j-logging:1.1-alpha-2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-rbac-providers:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-rbac:1.0-alpha-1" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-rbac-model:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-rbac:1.0-alpha-1" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-rbac-jdo:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-rbac-providers:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-model:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-tests:1.0-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-common-jdo:1.0-alpha-1::jar" ) ); + dep = toDependency( "net.java.dev.stax-utils:stax-utils:20060502::jar" ); + addExclusion( dep, "com.bea.xml:jsr173-ri" ); + model.addDependency( dep ); + model.addDependency( toDependency( "stax:stax-api:1.0.1::jar" ) ); + dep = toDependency( "stax:stax:1.1.1-dev::jar", "test" ); + addExclusion( dep, "xmlbeans:xmlbeans-jsr173-api" ); + model.addDependency( dep ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.8.0.4::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-log4j-logging:1.1-alpha-2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-rbac-tests:1.0-alpha-1" ); + addModel( model ); + + model = toModel( "stax:stax:1.1.1-dev" ); + model.addDependency( toDependency( "xmlbeans:xmlbeans-jsr173-api:2.0-dev::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar" ) ); + addModel( model ); + + model = toModel( "xmlbeans:xmlbeans-jsr173-api:2.0-dev" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-rbac-memory:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-rbac-providers:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-system:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authorization-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-model:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-tests:1.0-alpha-1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-xwork-integration:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-xwork:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-configuration:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-system:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-policy:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authentication-users:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authentication-keys:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authorization-rbac:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-role-manager:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-xwork-integration:1.0-alpha-6::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-mail-sender-api:1.0-alpha-6::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-mail-sender-javamail:1.0-alpha-6::jar" ) ); + model.addDependency( toDependency( "org.extremecomponents:extremecomponents:1.0.1::jar" ) ); + model.addDependency( toDependency( "commons-beanutils:commons-beanutils-bean-collections:1.7.0::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.2::jar" ) ); + dep = toDependency( "org.codehaus.plexus:plexus-velocity:1.1.2::jar" ); + addExclusion( dep, "plexus:plexus-utils" ); + addExclusion( dep, "commons-logging:commons-logging-api" ); + model.addDependency( dep ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar", "provided" ) ); + model.addDependency( toDependency( "taglibs:standard:1.1.2::jar" ) ); + model.addDependency( toDependency( "javax.servlet:jstl:1.1.2::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:3.2::jar" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:2.2::jar" ) ); + model.addDependency( toDependency( "opensymphony:sitemesh:2.2.1::jar" ) ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.8.0.4::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-memory:1.0-alpha-1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-xwork:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-integrations:1.0-alpha-1" ) ); + model.addDependencyManagement( toDependency( "taglibs:standard:1.1.2::jar" ) ); + model.addDependencyManagement( toDependency( "javax.servlet:jstl:1.1.2::jar" ) ); + model.addDependencyManagement( toDependency( "javax.servlet:servlet-api:2.4::jar", "provided" ) ); + model.addDependencyManagement( toDependency( "javax.servlet:jsp-api:2.0::jar", "provided" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-integrations:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-system:1.0-alpha-1::jar" ) ); + addModel( model ); + + model = toModel( "taglibs:standard:1.1.2" ); + addModel( model ); + + model = toModel( "javax.servlet:jstl:1.1.2" ); + model.addDependency( toDependency( "javax.servlet:jsp-api:2.0::jar", "provided" ) ); + addModel( model ); + + model = toModel( "javax.servlet:jsp-api:2.0" ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar", "compile" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-xwork-integration:1.0-alpha-6" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.12" ) ); + model.addDependency( toDependency( "org.easymock:easymock:2.2::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-17::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-17::jar" ) ); + model.addDependency( toDependency( "opensymphony:xwork:1.2.1::jar" ) ); + model.addDependency( toDependency( "opensymphony:webwork:2.2.4::jar" ) ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar", "provided" ) ); + addModel( model ); + + model = toModel( "org.easymock:easymock:2.2" ); + addModel( model ); + + model = toModel( "opensymphony:xwork:1.2.1" ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.4::jar" ) ); + model.addDependency( toDependency( "org.rifers:rife-continuations:0.0.2::jar" ) ); + model.addDependency( toDependency( "opensymphony:oscore:2.2.4::jar" ) ); + model.addDependency( toDependency( "ognl:ognl:2.6.7::jar" ) ); + dep = toDependency( "org.springframework:spring-core:1.2.6::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "org.springframework:spring-aop:1.2.6::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "org.springframework:spring-beans:1.2.6::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "org.springframework:spring-context:1.2.6::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "org.springframework:spring-web:1.2.6::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "org.springframework:spring-mock:1.2.6::jar", "test" ) ); + dep = toDependency( "cglib:cglib:2.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependency( toDependency( "mockobjects:mockobjects-core:0.09::jar", "test" ) ); + model.addDependency( toDependency( "easymock:easymock:1.2_Java1.3::jar", "test" ) ); + model.addDependency( toDependency( "easymock:easymockclassextension:1.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.rifers:rife-continuations:0.0.2" ); + addModel( model ); + + model = toModel( "opensymphony:oscore:2.2.4" ); + addModel( model ); + + model = toModel( "ognl:ognl:2.6.7" ); + addModel( model ); + + model = toModel( "org.springframework:spring-core:1.2.6" ); + model.setParentProject( toParent( "org.springframework:spring-parent:1.2.6" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.4::jar" ) ); + dep = toDependency( "log4j:log4j:1.2.9::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "commons-collections:commons-collections:3.1::jar" ) ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar", "provided" ) ); + model.addDependency( toDependency( "xml-apis:xml-apis:1.0.b2::jar", "provided" ) ); + addModel( model ); + + model = toModel( "org.springframework:spring-parent:1.2.6" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependencyManagement( toDependency( "commons-logging:commons-logging:1.0.4::jar" ) ); + dep = toDependency( "log4j:log4j:1.2.9::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "cglib:cglib:2.1_3::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "commons-attributes:commons-attributes-compiler:2.1::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "org.hibernate:hibernate:3.0.5::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "org.hibernate:hibernate-annotations:3.0beta2::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "struts:struts:1.2.7::jar" ); + addExclusion( dep, "servletapi:servletapi" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "jasperreports:jasperreports:1.0.3::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "freemarker:freemarker:2.3.4::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + model.addDependencyManagement( toDependency( "javax.servlet:jsp-api:2.0::jar", "provided" ) ); + model.addDependencyManagement( toDependency( "javax.servlet:servlet-api:2.4::jar", "provided" ) ); + model.addDependencyManagement( toDependency( "aopalliance:aopalliance:1.0::jar" ) ); + model.addDependencyManagement( toDependency( "oro:oro:2.0.8::jar" ) ); + dep = toDependency( "commons-pool:commons-pool:1.2::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "com.jamonapi:jamon:1.0::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + model.addDependencyManagement( toDependency( "xdoclet:xjavadoc:1.1::jar" ) ); + model.addDependencyManagement( toDependency( "javax.mail:mail:1.3.2::jar" ) ); + dep = toDependency( "velocity:velocity:1.4::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + model.addDependencyManagement( toDependency( "commons-collections:commons-collections:3.1::jar" ) ); + model.addDependencyManagement( toDependency( "xml-apis:xml-apis:1.0.b2::jar", "provided" ) ); + model.addDependencyManagement( toDependency( "javax.transaction:jta:1.0.1B::jar" ) ); + dep = toDependency( "jotm:jotm:2.0.10::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "net.sf.hibernate:hibernate:2.1.8::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "c3p0:c3p0:0.9.0.2::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "commons-dbcp:commons-dbcp:1.2.1::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "com.experlog:xapool:1.5.0::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + model.addDependencyManagement( toDependency( "commons-lang:commons-lang:2.1::jar" ) ); + dep = toDependency( "com.oracle.toplink:toplink:10.1.3::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "ojb:db-ojb:1.0.3::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "javax.jdo:jdo:2.0-20050809.1515::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "com.ibatis:ibatis-sqlmap:1.3.1::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "com.ibatis:ibatis2-sqlmap:2.1.5.582::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "javax.jms:jms:1.1::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "javax.ejb:ejb:2.0::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "javax.xml:jaxrpc-api:1.1::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "commons-httpclient:commons-httpclient:3.0-rc4::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "com.caucho:burlap:2.1.12::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "com.caucho:hessian:2.1.12::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + model.addDependencyManagement( toDependency( "javax.resource:connector:1.0::jar" ) ); + model.addDependencyManagement( toDependency( "ehcache:ehcache:1.1::jar" ) ); + model.addDependencyManagement( toDependency( "quartz:quartz:1.5.1::jar" ) ); + model.addDependencyManagement( toDependency( "com.servlets:cos:05Nov2002::jar" ) ); + model.addDependencyManagement( toDependency( "easymock:easymock:1.2_RC2_Java1.3::jar", "test" ) ); + model.addDependencyManagement( toDependency( "javax.servlet:jstl:1.0::jar" ) ); + model.addDependencyManagement( toDependency( "taglibs:standard:1.0.6::jar" ) ); + dep = toDependency( "javax.faces:jsf-api:1.1::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "velocity-tools:velocity-tools-generic:1.1::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "velocity-tools:velocity-tools-view:1.1::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "poi:poi:2.5.1-final-20040804::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "itext:itext:1.3::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "net.sourceforge.jexcelapi:jxl:2.5.7::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + addModel( model ); + + model = toModel( "log4j:log4j:1.2.9" ); + addModel( model ); + + model = toModel( "cglib:cglib:2.1_3" ); + addModel( model ); + + model = toModel( "commons-attributes:commons-attributes-compiler:2.1" ); + model.addDependency( toDependency( "commons-attributes:commons-attributes-api:2.1::jar" ) ); + addModel( model ); + + model = toModel( "commons-attributes:commons-attributes-api:2.1" ); + model.addDependency( toDependency( "ant:ant:1.5::jar" ) ); + model.addDependency( toDependency( "qdox:qdox:1.5::jar" ) ); + addModel( model ); + + model = toModel( "ant:ant:1.5" ); + addModel( model ); + + model = toModel( "qdox:qdox:1.5" ); + addModel( model ); + + model = toModel( "org.hibernate:hibernate:3.0.5" ); + addModel( model ); + + model = toModel( "org.hibernate:hibernate-annotations:3.0beta2" ); + addModel( model ); + + model = toModel( "struts:struts:1.2.7" ); + addModel( model ); + + model = toModel( "jasperreports:jasperreports:1.0.3" ); + addModel( model ); + + model = toModel( "freemarker:freemarker:2.3.4" ); + addModel( model ); + + model = toModel( "aopalliance:aopalliance:1.0" ); + addModel( model ); + + model = toModel( "oro:oro:2.0.8" ); + addModel( model ); + + model = toModel( "com.jamonapi:jamon:1.0" ); + addModel( model ); + + model = toModel( "xdoclet:xjavadoc:1.1" ); + addModel( model ); + + model = toModel( "javax.mail:mail:1.3.2" ); + model.addDependency( toDependency( "javax.activation:activation:1.0.2::jar", "compile" ) ); + addModel( model ); + + model = toModel( "velocity:velocity:1.4" ); + model.addDependency( toDependency( "velocity:velocity-dep:1.4::jar", "runtime" ) ); + addModel( model ); + + model = toModel( "velocity:velocity-dep:1.4" ); + addModel( model ); + + model = toModel( "jotm:jotm:2.0.10" ); + addModel( model ); + + model = toModel( "c3p0:c3p0:0.9.0.2" ); + addModel( model ); + + model = toModel( "commons-dbcp:commons-dbcp:1.2.1" ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.1::jar" ) ); + model.addDependency( toDependency( "commons-pool:commons-pool:1.2::jar" ) ); + dep = toDependency( "javax.sql:jdbc-stdext:2.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "xml-apis:xml-apis:2.0.2::jar" ) ); + model.addDependency( toDependency( "xerces:xerces:2.0.2::jar" ) ); + addModel( model ); + + model = toModel( "com.experlog:xapool:1.5.0" ); + addModel( model ); + + model = toModel( "com.oracle.toplink:toplink:10.1.3" ); + addModel( model ); + + model = toModel( "ojb:db-ojb:1.0.3" ); + addModel( model ); + + model = toModel( "javax.jdo:jdo:2.0-20050809.1515" ); + addModel( model ); + + model = toModel( "com.ibatis:ibatis-sqlmap:1.3.1" ); + addModel( model ); + + model = toModel( "com.ibatis:ibatis2-sqlmap:2.1.5.582" ); + addModel( model ); + + model = toModel( "javax.jms:jms:1.1" ); + addModel( model ); + + model = toModel( "javax.ejb:ejb:2.0" ); + addModel( model ); + + model = toModel( "javax.xml:jaxrpc-api:1.1" ); + addModel( model ); + + model = toModel( "commons-httpclient:commons-httpclient:3.0-rc4" ); + addModel( model ); + + model = toModel( "com.caucho:burlap:2.1.12" ); + addModel( model ); + + model = toModel( "com.caucho:hessian:2.1.12" ); + addModel( model ); + + model = toModel( "ehcache:ehcache:1.1" ); + addModel( model ); + + model = toModel( "quartz:quartz:1.5.1" ); + addModel( model ); + + model = toModel( "com.servlets:cos:05Nov2002" ); + addModel( model ); + + model = toModel( "easymock:easymock:1.2_RC2_Java1.3" ); + addModel( model ); + + model = toModel( "javax.servlet:jstl:1.0" ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.3::jar", "provided" ) ); + addModel( model ); + + model = toModel( "taglibs:standard:1.0.6" ); + addModel( model ); + + model = toModel( "javax.faces:jsf-api:1.1" ); + addModel( model ); + + model = toModel( "velocity-tools:velocity-tools-generic:1.1" ); + addModel( model ); + + model = toModel( "velocity-tools:velocity-tools-view:1.1" ); + addModel( model ); + + model = toModel( "poi:poi:2.5.1-final-20040804" ); + addModel( model ); + + model = toModel( "itext:itext:1.3" ); + addModel( model ); + + model = toModel( "net.sourceforge.jexcelapi:jxl:2.5.7" ); + addModel( model ); + + model = toModel( "org.springframework:spring-aop:1.2.6" ); + model.setParentProject( toParent( "org.springframework:spring-parent:1.2.6" ) ); + model.addDependency( toDependency( "org.springframework:spring-beans:1.2.6::jar" ) ); + model.addDependency( toDependency( "aopalliance:aopalliance:1.0::jar" ) ); + model.addDependency( toDependency( "oro:oro:2.0.8::jar" ) ); + dep = toDependency( "commons-pool:commons-pool:1.2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "commons-attributes:commons-attributes-compiler:2.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "com.jamonapi:jamon:1.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "cglib:cglib:2.1_3::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "xdoclet:xjavadoc:1.1::jar", "test" ) ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar", "provided" ) ); + addModel( model ); + + model = toModel( "org.springframework:spring-beans:1.2.6" ); + model.setParentProject( toParent( "org.springframework:spring-parent:1.2.6" ) ); + model.addDependency( toDependency( "org.springframework:spring-core:1.2.6::jar" ) ); + dep = toDependency( "cglib:cglib:2.1_3::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar", "provided" ) ); + model.addDependency( toDependency( "javax.mail:mail:1.3.2::jar", "test" ) ); + model.addDependency( toDependency( "org.hibernate:hibernate:3.0.5::jar", "test" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.springframework:spring-context:1.2.6" ); + model.setParentProject( toParent( "org.springframework:spring-parent:1.2.6" ) ); + model.addDependency( toDependency( "org.springframework:spring-aop:1.2.6::jar" ) ); + dep = toDependency( "velocity:velocity:1.4::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "freemarker:freemarker:2.3.4::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "jasperreports:jasperreports:1.0.3::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "org.springframework:spring-web:1.2.6" ); + model.setParentProject( toParent( "org.springframework:spring-parent:1.2.6" ) ); + model.addDependency( toDependency( "javax.servlet:jsp-api:2.0::jar", "provided" ) ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar", "provided" ) ); + model.addDependency( toDependency( "javax.servlet:jstl:1.0::jar" ) ); + model.addDependency( toDependency( "org.springframework:spring-context:1.2.6::jar" ) ); + dep = toDependency( "log4j:log4j:1.2.9::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "struts:struts:1.2.7::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "com.servlets:cos:05Nov2002::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "taglibs:standard:1.0.6::jar" ) ); + dep = toDependency( "javax.faces:jsf-api:1.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "org.springframework:spring-mock:1.2.6" ); + model.setParentProject( toParent( "org.springframework:spring-parent:1.2.6" ) ); + dep = toDependency( "org.springframework:spring-jdbc:1.2.6::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "org.springframework:spring-web:1.2.6::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "javax.servlet:jsp-api:2.0::jar", "provided" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + addModel( model ); + + model = toModel( "org.springframework:spring-jdbc:1.2.6" ); + addModel( model ); + + model = toModel( "cglib:cglib:2.1" ); + model.addDependency( toDependency( "asm:asm:1.5.3::jar" ) ); + model.addDependency( toDependency( "asm:asm-util:1.3.4::jar" ) ); + model.addDependency( toDependency( "aspectwerkz:aspectwerkz-core:0.8.1::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + addModel( model ); + + model = toModel( "asm:asm:1.5.3" ); + addModel( model ); + + model = toModel( "asm:asm-util:1.3.4" ); + addModel( model ); + + model = toModel( "aspectwerkz:aspectwerkz-core:0.8.1" ); + addModel( model ); + + model = toModel( "easymock:easymockclassextension:1.1" ); + addModel( model ); + + model = toModel( "opensymphony:webwork:2.2.4" ); + model.addDependency( toDependency( "opensymphony:xwork:1.2.1::jar" ) ); + dep = toDependency( "opensymphony:xwork-tiger:1.2.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "freemarker:freemarker:2.3.4::jar" ) ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar", "provided" ) ); + model.addDependency( toDependency( "javax.servlet:jsp-api:2.0::jar", "provided" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.4::jar" ) ); + dep = toDependency( "commons-lang:commons-lang:2.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "dwr:dwr:1.1-beta-3::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "velocity:velocity:1.4::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "velocity-tools:velocity-tools:1.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "commons-fileupload:commons-fileupload:1.1.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "servlets.com:cos:05Nov2002::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "opensymphony:pell-multipart:2.1.5::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "opensymphony:sitemesh:2.2.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "jetty:org.mortbay.jetty:5.1.4::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "eclipse:jdtcore:3.1.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "jasperreports:jasperreports:1.1.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "jfree:jfreechart:1.0.0::jar" ); + addExclusion( dep, "gnujaxp:gnujaxp" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "org.apache.struts.tiles:tiles-core:0.2-SNAPSHOT::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "commons-digester:commons-digester:1.7::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "portlet-api:portlet-api:1.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "org.apache.pluto:pluto:1.0.1-rc4::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-10-SNAPSHOT::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "picocontainer:picocontainer:1.2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "picocontainer:picocontainer-gems:1.2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "nanocontainer:nanocontainer:1.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "nanocontainer:nanocontainer-nanowar:1.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "org.springframework:spring-beans:1.2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "org.springframework:spring-core:1.2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "org.springframework:spring-context:1.2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "org.springframework:spring-web:1.2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "org.springframework:spring-mock:1.2::jar", "compile" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "xpp3:xpp3:1.1.3.4-RC8::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "junit:junit:3.8.1::jar", "compile" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "jmock:jmock:1.0.1::jar", "test" ) ); + model.addDependency( toDependency( "easymock:easymock:1.2_Java1.3::jar", "test" ) ); + model.addDependency( toDependency( "easymock:easymockclassextension:1.1::jar", "test" ) ); + model.addDependency( toDependency( "jmock:jmock-cglib:1.0.1::jar", "test" ) ); + model.addDependency( toDependency( "mockobjects:mockobjects-core:0.09::jar", "test" ) ); + model.addDependency( toDependency( "mockobjects:mockobjects-jdk1.3:0.09::jar", "test" ) ); + model.addDependency( toDependency( "mockobjects:mockobjects-alt-jdk1.3:0.09::jar", "test" ) ); + model.addDependency( toDependency( "mockobjects:mockobjects-alt-jdk1.3-j2ee1.3:0.09::jar", "test" ) ); + model.addDependency( toDependency( "mockobjects:mockobjects-jdk1.3-j2ee1.3:0.09::jar", "test" ) ); + addModel( model ); + + model = toModel( "opensymphony:xwork-tiger:1.2.1" ); + addModel( model ); + + model = toModel( "commons-lang:commons-lang:2.0" ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + addModel( model ); + + model = toModel( "dwr:dwr:1.1-beta-3" ); + addModel( model ); + + model = toModel( "velocity-tools:velocity-tools:1.1" ); + addModel( model ); + + model = toModel( "commons-fileupload:commons-fileupload:1.1.1" ); + addModel( model ); + + model = toModel( "servlets.com:cos:05Nov2002" ); + addModel( model ); + + model = toModel( "opensymphony:pell-multipart:2.1.5" ); + addModel( model ); + + model = toModel( "opensymphony:sitemesh:2.2.1" ); + addModel( model ); + + model = toModel( "jetty:org.mortbay.jetty:5.1.4" ); + addModel( model ); + + model = toModel( "eclipse:jdtcore:3.1.0" ); + addModel( model ); + + model = toModel( "jasperreports:jasperreports:1.1.0" ); + addModel( model ); + + model = toModel( "jfree:jfreechart:1.0.0" ); + addModel( model ); + + model = toModel( "org.apache.struts.tiles:tiles-core:0.2-SNAPSHOT" ); + addModel( model ); + + model = toModel( "commons-digester:commons-digester:1.7" ); + model.addDependency( toDependency( "commons-beanutils:commons-beanutils:1.6::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.1::jar" ) ); + model.addDependency( toDependency( "xml-apis:xml-apis:1.0.b2::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "portlet-api:portlet-api:1.0" ); + addModel( model ); + + model = toModel( "org.apache.pluto:pluto:1.0.1-rc4" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-container-default:1.0-alpha-10-SNAPSHOT" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0.6-SNAPSHOT" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.2::jar" ) ); + model.addDependency( toDependency( "classworlds:classworlds:1.1::jar" ) ); + model.addDependency( toDependency( "jmock:jmock:1.0.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-containers:1.0.6-SNAPSHOT" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.8-SNAPSHOT" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus:1.0.8-SNAPSHOT" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "picocontainer:picocontainer:1.2" ); + addModel( model ); + + model = toModel( "picocontainer:picocontainer-gems:1.2" ); + addModel( model ); + + model = toModel( "nanocontainer:nanocontainer:1.0" ); + addModel( model ); + + model = toModel( "nanocontainer:nanocontainer-nanowar:1.0" ); + addModel( model ); + + model = toModel( "org.springframework:spring-beans:1.2" ); + addModel( model ); + + model = toModel( "org.springframework:spring-core:1.2" ); + addModel( model ); + + model = toModel( "org.springframework:spring-context:1.2" ); + addModel( model ); + + model = toModel( "org.springframework:spring-web:1.2" ); + addModel( model ); + + model = toModel( "org.springframework:spring-mock:1.2" ); + addModel( model ); + + model = toModel( "xpp3:xpp3:1.1.3.4-RC8" ); + addModel( model ); + + model = toModel( "jmock:jmock-cglib:1.0.1" ); + model.addDependency( toDependency( "jmock:jmock:1.0.1::jar" ) ); + model.addDependency( toDependency( "cglib:cglib-full:2.0::jar" ) ); + addModel( model ); + + model = toModel( "cglib:cglib-full:2.0" ); + addModel( model ); + + model = toModel( "mockobjects:mockobjects-jdk1.3:0.09" ); + addModel( model ); + + model = toModel( "mockobjects:mockobjects-alt-jdk1.3:0.09" ); + addModel( model ); + + model = toModel( "mockobjects:mockobjects-alt-jdk1.3-j2ee1.3:0.09" ); + addModel( model ); + + model = toModel( "mockobjects:mockobjects-jdk1.3-j2ee1.3:0.09" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-mail-sender-api:1.0-alpha-6" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-mail-sender:1.0-alpha-6" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-mail-sender:1.0-alpha-6" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.9" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-mail-sender-javamail:1.0-alpha-6" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-mail-senders:1.0-alpha-6" ) ); + model.addDependency( toDependency( "javax.mail:mail:1.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-mail-sender-test:1.0-alpha-6::jar", "test" ) ); + dep = toDependency( "org.codehaus.plexus:plexus-naming:1.0-alpha-1::jar", "test" ); + addExclusion( dep, "geronimo-spec:geronimo-spec-javamail" ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-mail-senders:1.0-alpha-6" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-mail-sender:1.0-alpha-6" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-mail-sender-api:1.0-alpha-6::jar" ) ); + addModel( model ); + + model = toModel( "javax.mail:mail:1.4" ); + model.addDependency( toDependency( "javax.activation:activation:1.1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-mail-sender-test:1.0-alpha-6" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-mail-senders:1.0-alpha-6" ) ); + model.addDependency( toDependency( "dumbster:dumbster:1.5::jar" ) ); + addModel( model ); + + model = toModel( "dumbster:dumbster:1.5" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-naming:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.6" ) ); + model.addDependency( toDependency( "directory-naming:naming-core:0.8::jar" ) ); + model.addDependency( toDependency( "directory-naming:naming-java:0.8::jar" ) ); + model.addDependency( toDependency( "directory-naming:naming-factory:0.8::jar" ) ); + model.addDependency( toDependency( "commons-dbcp:commons-dbcp:1.2.1::jar" ) ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.7.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "directory-naming:naming-core:0.8" ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.3::jar" ) ); + addModel( model ); + + model = toModel( "directory-naming:naming-java:0.8" ); + model.addDependency( toDependency( "directory-naming:naming-core:0.8::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.3::jar" ) ); + addModel( model ); + + model = toModel( "directory-naming:naming-factory:0.8" ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.3::jar" ) ); + model.addDependency( toDependency( "directory-naming:naming-core:0.8::jar" ) ); + model.addDependency( toDependency( "geronimo-spec:geronimo-spec-javamail:1.3.1-rc1::jar" ) ); + addModel( model ); + + model = toModel( "geronimo-spec:geronimo-spec-javamail:1.3.1-rc1" ); + addModel( model ); + + model = toModel( "hsqldb:hsqldb:1.7.1" ); + addModel( model ); + + model = toModel( "org.extremecomponents:extremecomponents:1.0.1" ); + dep = toDependency( "avalon-framework:avalon-framework:4.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "batik:batik:1.5-fop-0.20-5::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "commons-beanutils:commons-beanutils:1.7.0::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:3.0::jar" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:2.0::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.4::jar" ) ); + dep = toDependency( "fop:fop:0.20.5::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + dep = toDependency( "poi:poi:2.5.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "servletapi:servletapi:2.3::jar", "provided" ) ); + model.addDependency( toDependency( "taglibs:standard:1.0.2::jar" ) ); + dep = toDependency( "xalan:xalan:2.5.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "xerces:xercesImpl:2.6.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "xml-apis:xml-apis:2.0.2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "avalon-framework:avalon-framework:4.0" ); + addModel( model ); + + model = toModel( "batik:batik:1.5-fop-0.20-5" ); + addModel( model ); + + model = toModel( "commons-collections:commons-collections:3.0" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "fop:fop:0.20.5" ); + addModel( model ); + + model = toModel( "poi:poi:2.5.1" ); + model.setRelocation( new VersionedReference() ); + model.getRelocation().setGroupId( "poi" ); + model.getRelocation().setArtifactId( "poi" ); + model.getRelocation().setVersion( "2.5.1-final-20040804" ); + addModel( model ); + + model = toModel( "taglibs:standard:1.0.2" ); + addModel( model ); + + model = toModel( "xerces:xercesImpl:2.6.1" ); + addModel( model ); + + model = toModel( "commons-beanutils:commons-beanutils-bean-collections:1.7.0" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-velocity:1.1.2" ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-7::jar", "compile" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "classworlds:classworlds:1.1-alpha-2::jar", "compile" ) ); + model.addDependency( toDependency( "plexus:plexus-utils:1.0.2::jar", "compile" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.0::jar", "compile" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging-api:1.0.4::jar", "compile" ) ); + model.addDependency( toDependency( "velocity:velocity:1.4::jar", "compile" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-taglib:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-integrations:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-system:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-xwork-integration:1.0-alpha-6::jar" ) ); + model.addDependency( toDependency( "taglibs:standard:1.1.2::jar" ) ); + model.addDependency( toDependency( "javax.servlet:jstl:1.1.2::jar" ) ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar", "provided" ) ); + model.addDependency( toDependency( "javax.servlet:jsp-api:2.0::jar", "provided" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-xwork-content:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-xwork:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-xwork-integration:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-taglib:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "xml-apis:xml-apis:1.3.03" ); + model.setParentProject( toParent( "org.apache:apache:1" ) ); + addModel( model ); + + model = toModel( "org.apache:apache:1" ); + addModel( model ); + + model = toModel( "org.codehaus.woodstox:wstx-asl:3.2.1" ); + model.addDependency( toDependency( "stax:stax-api:1.0.1::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-signature-consumers:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-consumers:1.0-alpha-2-SNAPSHOT" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-model:2.0.5" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.5" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-project:2.0.5" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.5" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-settings:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact-test:2.0.5::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-profile:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-model:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact-manager:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-settings:2.0.5" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.5" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-model:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-artifact-test:2.0.5" ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-profile:2.0.5" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.5" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-model:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.shared:maven-app-configuration-model:1.0" ); + model.setParentProject( toParent( "org.apache.maven.shared:maven-app-configuration:1.0" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-api:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-20::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.shared:maven-app-configuration:1.0" ); + model.setParentProject( toParent( "org.apache.maven.shared:maven-shared-components:7" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.shared:maven-app-configuration-web:1.0" ); + model.setParentProject( toParent( "org.apache.maven.shared:maven-app-configuration:1.0" ) ); + model.addDependency( toDependency( "org.apache.maven.shared:maven-app-configuration-model:1.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-project:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-http-lightweight:1.0-beta-2::jar", "runtime" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-20::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-project:2.0.4" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.4" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-settings:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact-test:2.0.4::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-profile:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-model:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact-manager:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-settings:2.0.4" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.4" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-model:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-artifact-test:2.0.4" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.4" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-settings:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact-manager:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-artifact-manager:2.0.4" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.4" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-repository-metadata:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-file:1.0-alpha-7::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-alpha-6::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-repository-metadata:2.0.4" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.4" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-artifact:2.0.4" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.4" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-profile:2.0.4" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.4" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-model:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-appserver-host:2.0-alpha-8" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-appserver:2.0-alpha-8" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-20::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-20::jar" ) ); + model.addDependency( toDependency( "mx4j:mx4j:3.0.1::jar" ) ); + model.addDependency( toDependency( "mx4j:mx4j-remote:3.0.1::jar" ) ); + model.addDependency( toDependency( "org.livetribe:livetribe-slp:1.0.2::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-appserver:2.0-alpha-8" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.11" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-20::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-20::jar" ) ); + addModel( model ); + + model = toModel( "mx4j:mx4j:3.0.1" ); + addModel( model ); + + model = toModel( "mx4j:mx4j-remote:3.0.1" ); + addModel( model ); + + model = toModel( "org.livetribe:livetribe-slp:1.0.2" ); + model.setParentProject( toParent( "org.livetribe:livetribe:1.0" ) ); + model.addDependency( toDependency( "backport-util-concurrent:backport-util-concurrent:2.2::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.livetribe:livetribe:1.0" ); + addModel( model ); + + model = toModel( "backport-util-concurrent:backport-util-concurrent:2.2" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-appserver-service-jetty:2.0-alpha-8" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-appserver-services:2.0-alpha-8" ) ); + model.addDependency( toDependency( "ant:ant:1.6.2::jar" ) ); + model.addDependency( toDependency( "jetty:org.mortbay.jetty:5.1.10::jar" ) ); + model.addDependency( toDependency( "tomcat:jasper-compiler:5.5.15::jar" ) ); + model.addDependency( toDependency( "tomcat:jasper-runtime:5.5.15::jar" ) ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar" ) ); + model.addDependency( toDependency( "javax.servlet:jsp-api:2.0::jar" ) ); + dep = toDependency( "commons-el:commons-el:1.0::jar", "runtime" ); + addExclusion( dep, "log4j:log4j" ); + addExclusion( dep, "commons-logging:commons-logging" ); + addExclusion( dep, "logkit:logkit" ); + model.addDependency( dep ); + model.addDependency( toDependency( "jetty:org.mortbay.jetty.plus:5.1.10::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging-api:1.0.4::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.derby:derby:10.1.3.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-appserver-services:2.0-alpha-8" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-appserver:2.0-alpha-8" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-appserver-host:2.0-alpha-8::jar" ) ); + addModel( model ); + + model = toModel( "ant:ant:1.6.2" ); + dep = toDependency( "xerces:xerces-impl:2.6.2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "xml-apis:xml-apis:2.6.2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "xerces:xerces-impl:2.6.2" ); + addModel( model ); + + model = toModel( "xml-apis:xml-apis:2.6.2" ); + addModel( model ); + + model = toModel( "jetty:org.mortbay.jetty:5.1.10" ); + addModel( model ); + + model = toModel( "tomcat:jasper-compiler:5.5.15" ); + model.setParentProject( toParent( "tomcat:tomcat-parent:5.5.15" ) ); + model.addDependency( toDependency( "javax.servlet:jsp-api:2.0::jar" ) ); + model.addDependency( toDependency( "ant:ant:1.6.5::jar" ) ); + addModel( model ); + + model = toModel( "tomcat:tomcat-parent:5.5.15" ); + model.setParentProject( toParent( "org.apache:apache:3" ) ); + model.addDependencyManagement( toDependency( "commons-logging:commons-logging-api:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "ant:ant:1.6.5" ); + dep = toDependency( "xerces:xerces-impl:2.6.2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "xml-apis:xml-apis:2.6.2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "tomcat:jasper-runtime:5.5.15" ); + model.setParentProject( toParent( "tomcat:tomcat-parent:5.5.15" ) ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar" ) ); + model.addDependency( toDependency( "commons-el:commons-el:1.0::jar" ) ); + addModel( model ); + + model = toModel( "commons-el:commons-el:1.0" ); + model.addDependency( toDependency( "servletapi:servletapi:2.4-20040521::jar", "provided" ) ); + model.addDependency( toDependency( "jspapi:jsp-api:2.0-20040521::jar", "provided" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.3::jar" ) ); + addModel( model ); + + model = toModel( "servletapi:servletapi:2.4-20040521" ); + addModel( model ); + + model = toModel( "jspapi:jsp-api:2.0-20040521" ); + addModel( model ); + + model = toModel( "jetty:org.mortbay.jetty.plus:5.1.10" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-cli:1.1" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-tools:1.0.8" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-5::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-14::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + dep = toDependency( "commons-cli:commons-cli:1.0::jar" ); + addExclusion( dep, "commons-lang:commons-lang" ); + addExclusion( dep, "commons-logging:commons-logging" ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-tools:1.0.8" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.9" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-14::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-container-default:1.0-alpha-14" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0-alpha-14" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-13::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.3::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-5::jar" ) ); + model.addDependency( toDependency( "jmock:jmock:1.0.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-containers:1.0-alpha-14" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.9" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-5::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-13::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.3::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-5" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.9" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-component-api:1.0-alpha-13" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0.7-alpha-3" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-5::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-containers:1.0.7-alpha-3" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.9" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-5::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-13::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.3::jar" ) ); + addModel( model ); + + model = toModel( "commons-cli:commons-cli:1.0" ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0::jar" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:1.0::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + addModel( model ); + + model = toModel( "commons-lang:commons-lang:1.0" ); + model.addDependency( toDependency( "junit:junit:3.7::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-command-line:1.0-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.4" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-naming:1.0-alpha-3" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.9" ) ); + model.addDependency( toDependency( "directory-naming:naming-core:0.8::jar" ) ); + model.addDependency( toDependency( "directory-naming:naming-java:0.8::jar" ) ); + model.addDependency( toDependency( "directory-naming:naming-factory:0.8::jar" ) ); + model.addDependency( toDependency( "directory-naming:naming-config:0.8::jar" ) ); + model.addDependency( toDependency( "commons-dbcp:commons-dbcp:1.2.1::jar" ) ); + model.addDependency( toDependency( "commons-pool:commons-pool:1.2::jar" ) ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.7.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "directory-naming:naming-config:0.8" ); + model.addDependency( toDependency( "directory-naming:naming-core:0.8::jar" ) ); + model.addDependency( toDependency( "directory-naming:naming-factory:0.8::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.3::jar" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:1.0.1::jar" ) ); + model.addDependency( toDependency( "commons-digester:commons-digester:1.4.1::jar" ) ); + model.addDependency( toDependency( "directory-naming:naming-java:0.8::jar" ) ); + model.addDependency( toDependency( "commons-beanutils:commons-beanutils:1.6.1::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:3.1::jar" ) ); + model.addDependency( toDependency( "commons-dbcp:commons-dbcp:1.0::jar" ) ); + model.addDependency( toDependency( "commons-pool:commons-pool:1.0.1::jar" ) ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.7.1::jar" ) ); + addModel( model ); + + model = toModel( "commons-lang:commons-lang:1.0.1" ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + addModel( model ); + + model = toModel( "commons-digester:commons-digester:1.4.1" ); + model.addDependency( toDependency( "commons-beanutils:commons-beanutils:1.6::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.1::jar" ) ); + model.addDependency( toDependency( "xml-apis:xml-apis:2.0.2::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + addModel( model ); + + model = toModel( "commons-beanutils:commons-beanutils:1.6.1" ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.0::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + addModel( model ); + + model = toModel( "commons-dbcp:commons-dbcp:1.0" ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.0::jar" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:1.0-b1::jar" ) ); + model.addDependency( toDependency( "commons-pool:commons-pool:1.0::jar" ) ); + model.addDependency( toDependency( "jdbc:jdbc:2.0::jar" ) ); + model.addDependency( toDependency( "xml-apis:xml-apis:2.0.2::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.7::jar" ) ); + addModel( model ); + + model = toModel( "commons-lang:commons-lang:1.0-b1" ); + addModel( model ); + + model = toModel( "commons-pool:commons-pool:1.0" ); + addModel( model ); + + model = toModel( "jdbc:jdbc:2.0" ); + model.setRelocation( new VersionedReference() ); + model.getRelocation().setGroupId( "javax.sql" ); + model.getRelocation().setArtifactId( "jdbc-stdext" ); + model.getRelocation().setVersion( "2.0" ); + addModel( model ); + + model = toModel( "commons-pool:commons-pool:1.0.1" ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.0::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.webdav:plexus-webdav-simple:1.0-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus.webdav:plexus-webdav-providers-parent:1.0-alpha-2" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:2.1::jar" ) ); + model.addDependency( toDependency( "it.could:webdav:0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.webdav:plexus-webdav-providers-parent:1.0-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus.webdav:plexus-webdav-parent:1.0-alpha-2" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.webdav:plexus-webdav-api:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.webdav:plexus-webdav-test:1.0-alpha-2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.webdav:plexus-webdav-parent:1.0-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.12" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.webdav:plexus-webdav-api:1.0-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus.webdav:plexus-webdav-parent:1.0-alpha-2" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-20::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-20::jar" ) ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.3::jar" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:2.1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.webdav:plexus-webdav-test:1.0-alpha-2" ); + addModel( model ); + + model = toModel( "it.could:webdav:0.4" ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.3::jar", "runtime" ) ); + addModel( model ); + + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/ArchivaXmlToolsDependencyGraphTest.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/ArchivaXmlToolsDependencyGraphTest.java new file mode 100644 index 000000000..6733b8900 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/ArchivaXmlToolsDependencyGraphTest.java @@ -0,0 +1,86 @@ +package org.apache.maven.archiva.dependency.graph; + +/* + * 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.archiva.dependency.DependencyGraphFactory; +import org.apache.maven.archiva.model.DependencyScope; +import org.apache.maven.archiva.model.VersionedReference; + +import java.util.ArrayList; +import java.util.List; + +/** + * ArchivaXmlToolsDependencyGraphTest + * + * DependencyGraphTest for testing org.apache.maven.archiva:archiva-xml-tools:1.0-alpha-2-SNAPSHOT + * + * Generated by archivadev:generate-dependency-tests plugin + * @version $Id$ + */ +public class ArchivaXmlToolsDependencyGraphTest + extends AbstractDependencyGraphFactoryTestCase +{ + public void testResolvedDepsToNodes() + throws GraphTaskException + { + MemoryRepositoryDependencyGraphBuilder graphBuilder = + new MemoryRepositoryDependencyGraphBuilder(); + MemoryRepository repository = new ArchivaXmlToolsMemoryRepository(); + graphBuilder.setMemoryRepository( repository ); + + // Create the factory, and add the test resolver. + DependencyGraphFactory factory = new DependencyGraphFactory(); + factory.setGraphBuilder( graphBuilder ); + factory.setDesiredScope( DependencyScope.TEST ); + + // Get the model to resolve from + VersionedReference rootRef = toVersionedReference( "org.apache.maven.archiva:archiva-xml-tools:1.0-alpha-2-SNAPSHOT"); + + // Perform the resolution. + DependencyGraph graph = factory.getGraph( rootRef ); + + // Test the results. + assertNotNull( "Graph shouldn't be null.", graph ); + + String expectedRootRef = "org.apache.maven.archiva:archiva-xml-tools:1.0-alpha-2-SNAPSHOT"; + List expectedNodes = new ArrayList(); + + // Check for all nodes, regardless of scope. + expectedNodes.clear(); + expectedNodes.add( "commons-collections:commons-collections:3.2::jar" ); + expectedNodes.add( "commons-lang:commons-lang:2.2::jar" ); + expectedNodes.add( "dom4j:dom4j:1.6.1::jar" ); + expectedNodes.add( "jaxen:jaxen:1.1::jar" ); + expectedNodes.add( "junit:junit:3.8.1::jar" ); + expectedNodes.add( "log4j:log4j:1.2.8::jar" ); + expectedNodes.add( "org.apache.maven.archiva:archiva-common:1.0-alpha-2-SNAPSHOT::jar" ); + expectedNodes.add( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ); + expectedNodes.add( "org.codehaus.plexus:plexus-component-api:1.0-alpha-22::jar" ); + expectedNodes.add( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ); + expectedNodes.add( "org.codehaus.plexus:plexus-utils:1.4::jar" ); + expectedNodes.add( "org.slf4j:slf4j-api:1.2::jar" ); + expectedNodes.add( "org.slf4j:slf4j-log4j12:1.2::jar" ); + expectedNodes.add( "xerces:xercesImpl:2.6.2::jar" ); + expectedNodes.add( "xml-apis:xml-apis:1.0.b2::jar" ); + + assertGraph( graph, expectedRootRef, expectedNodes ); + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/ArchivaXmlToolsMemoryRepository.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/ArchivaXmlToolsMemoryRepository.java new file mode 100644 index 000000000..3fd53ce76 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/ArchivaXmlToolsMemoryRepository.java @@ -0,0 +1,3469 @@ +package org.apache.maven.archiva.dependency.graph; + +/* + * 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.archiva.model.ArchivaProjectModel; +import org.apache.maven.archiva.model.Dependency; +import org.apache.maven.archiva.model.VersionedReference; + +/** + * ArchivaXmlToolsMemoryRepository + * + * MemoryRepository for testing org.apache.maven.archiva:archiva-xml-tools:1.0-alpha-2-SNAPSHOT + * + * Generated by archivadev:generate-dependency-tests plugin + * @version $Id$ + */ +public class ArchivaXmlToolsMemoryRepository + extends AbstractMemoryRepository +{ + public void initialize() + { + ArchivaProjectModel model; + Dependency dep; + + model = toModel( "org.apache.maven.archiva:archiva-xml-tools:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-base:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-common:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:3.2::jar" ) ); + dep = toDependency( "dom4j:dom4j:1.6.1::jar" ); + addExclusion( dep, "xom:xom" ); + model.addDependency( dep ); + dep = toDependency( "jaxen:jaxen:1.1::jar" ); + addExclusion( dep, "jdom:jdom" ); + addExclusion( dep, "xom:xom" ); + model.addDependency( dep ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependency( toDependency( "org.slf4j:slf4j-log4j12:1.2::jar" ) ); + model.addDependencyManagement( toDependency( "javax.activation:activation:1.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-applet:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-artifact-converter:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-artifact-reports:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-common:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-configuration:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-consumer-api:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-converter:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-core:1.0-alpha-2-SNAPSHOT-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-core-consumers:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-database:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-database-consumers:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-indexer:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-lucene-consumers:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-model:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-plexus-application:1.0-alpha-2-SNAPSHOT::plexus-application" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-policies:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-proxy:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-report-manager:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-repository-layer:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-scheduled:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-security:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-signature-consumers:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-transaction:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-webapp:1.0-alpha-2-SNAPSHOT::war" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-xml-tools:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "commons-collections:commons-collections:3.2::jar" ) ); + model.addDependencyManagement( toDependency( "commons-io:commons-io:1.2::jar" ) ); + model.addDependencyManagement( toDependency( "commons-lang:commons-lang:2.2::jar" ) ); + model.addDependencyManagement( toDependency( "commons-logging:commons-logging:1.0.4::jar" ) ); + model.addDependencyManagement( toDependency( "commons-logging:commons-logging-api:1.0.4::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.derby:derby:10.1.3.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.derby:derbytools:10.1.3.1::jar" ) ); + model.addDependencyManagement( toDependency( "dom4j:dom4j:1.6.1::jar" ) ); + model.addDependencyManagement( toDependency( "easymock:easymock:1.2_Java1.3::jar" ) ); + model.addDependencyManagement( toDependency( "hsqldb:hsqldb:1.8.0.7::jar" ) ); + model.addDependencyManagement( toDependency( "jaxen:jaxen:1.1::jar" ) ); + model.addDependencyManagement( toDependency( "javax.jdo:jdo2-api:2.0::jar" ) ); + model.addDependencyManagement( toDependency( "jdom:jdom:1.0::jar" ) ); + model.addDependencyManagement( toDependency( "jpox:jpox:1.1.7::jar" ) ); + model.addDependencyManagement( toDependency( "javax.servlet:jsp-api:2.0::jar" ) ); + model.addDependencyManagement( toDependency( "javax.servlet:jstl:1.1.2::jar" ) ); + model.addDependencyManagement( toDependency( "log4j:log4j:1.2.8::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.lucene:lucene-core:2.0.0::jar" ) ); + model.addDependencyManagement( toDependency( "javax.mail:mail:1.4::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven:maven-artifact:2.0.5::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven:maven-artifact-manager:2.0.5::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven:maven-model:2.0.5::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven:maven-project:2.0.5::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven:maven-repository-metadata:2.0.5::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.shared:maven-app-configuration-model:1.0::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.shared:maven-app-configuration-web:1.0::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.shared:maven-model-converter:2.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-appserver-host:2.0-alpha-8::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-appserver-service-jetty:2.0-alpha-8::plexus-service" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-cli:1.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-command-line:1.0-alpha-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-22::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-digest:1.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-expression-evaluator:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-i18n:1.0-beta-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-jdo2:1.0-alpha-8::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-naming:1.0-alpha-3::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-quartz:1.0-alpha-3::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-slf4j-logging:1.1-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-taskqueue:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-xwork-integration:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.cache:plexus-cache-api:1.0-alpha-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.cache:plexus-cache-ehcache:1.0-alpha-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-rbac-memory:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-rbac-role-manager:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-taglib:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-xwork-content:1.0-alpha-1::war" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-xwork-integration:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.registry:plexus-registry-api:1.0-alpha-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.registry:plexus-registry-commons:1.0-alpha-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.webdav:plexus-webdav-simple:1.0-alpha-2::jar" ) ); + model.addDependencyManagement( toDependency( "javax.servlet:servlet-api:2.4::jar" ) ); + model.addDependencyManagement( toDependency( "opensymphony:sitemesh:2.2.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.slf4j:slf4j-log4j12:1.2::jar" ) ); + model.addDependencyManagement( toDependency( "taglibs:standard:1.1.2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-file:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-http-lightweight:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "opensymphony:webwork:2.2.4::jar" ) ); + model.addDependencyManagement( toDependency( "xmlunit:xmlunit:1.0::jar" ) ); + model.addProperty( "wagon.version", "1.0-beta-2" ); + model.addProperty( "redback.version", "1.0-alpha-1" ); + model.addProperty( "maven.version", "2.0.5" ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-base:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-parent:1.0-alpha-2-SNAPSHOT" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-parent:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven:maven-parent:5" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependencyManagement( toDependency( "javax.activation:activation:1.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-applet:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-artifact-converter:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-artifact-reports:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-common:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-configuration:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-consumer-api:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-converter:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-core:1.0-alpha-2-SNAPSHOT-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-core-consumers:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-database:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-database-consumers:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-indexer:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-lucene-consumers:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-model:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-plexus-application:1.0-alpha-2-SNAPSHOT::plexus-application" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-policies:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-proxy:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-report-manager:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-repository-layer:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-scheduled:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-security:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-signature-consumers:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-transaction:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-webapp:1.0-alpha-2-SNAPSHOT::war" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.archiva:archiva-xml-tools:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "commons-collections:commons-collections:3.2::jar" ) ); + model.addDependencyManagement( toDependency( "commons-io:commons-io:1.2::jar" ) ); + model.addDependencyManagement( toDependency( "commons-lang:commons-lang:2.2::jar" ) ); + model.addDependencyManagement( toDependency( "commons-logging:commons-logging:1.0.4::jar" ) ); + model.addDependencyManagement( toDependency( "commons-logging:commons-logging-api:1.0.4::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.derby:derby:10.1.3.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.derby:derbytools:10.1.3.1::jar" ) ); + model.addDependencyManagement( toDependency( "dom4j:dom4j:1.6.1::jar" ) ); + model.addDependencyManagement( toDependency( "easymock:easymock:1.2_Java1.3::jar" ) ); + model.addDependencyManagement( toDependency( "hsqldb:hsqldb:1.8.0.7::jar" ) ); + model.addDependencyManagement( toDependency( "jaxen:jaxen:1.1::jar" ) ); + model.addDependencyManagement( toDependency( "javax.jdo:jdo2-api:2.0::jar" ) ); + model.addDependencyManagement( toDependency( "jdom:jdom:1.0::jar" ) ); + model.addDependencyManagement( toDependency( "jpox:jpox:1.1.7::jar" ) ); + model.addDependencyManagement( toDependency( "javax.servlet:jsp-api:2.0::jar" ) ); + model.addDependencyManagement( toDependency( "javax.servlet:jstl:1.1.2::jar" ) ); + model.addDependencyManagement( toDependency( "log4j:log4j:1.2.8::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.lucene:lucene-core:2.0.0::jar" ) ); + model.addDependencyManagement( toDependency( "javax.mail:mail:1.4::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven:maven-artifact:2.0.5::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven:maven-artifact-manager:2.0.5::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven:maven-model:2.0.5::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven:maven-project:2.0.5::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven:maven-repository-metadata:2.0.5::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.shared:maven-app-configuration-model:1.0::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.shared:maven-app-configuration-web:1.0::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.shared:maven-model-converter:2.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-appserver-host:2.0-alpha-8::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-appserver-service-jetty:2.0-alpha-8::plexus-service" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-cli:1.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-command-line:1.0-alpha-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-22::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-digest:1.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-expression-evaluator:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-i18n:1.0-beta-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-jdo2:1.0-alpha-8::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-naming:1.0-alpha-3::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-quartz:1.0-alpha-3::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-slf4j-logging:1.1-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-taskqueue:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-xwork-integration:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.cache:plexus-cache-api:1.0-alpha-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.cache:plexus-cache-ehcache:1.0-alpha-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-rbac-memory:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-rbac-role-manager:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-taglib:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-xwork-content:1.0-alpha-1::war" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-xwork-integration:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.registry:plexus-registry-api:1.0-alpha-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.registry:plexus-registry-commons:1.0-alpha-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.webdav:plexus-webdav-simple:1.0-alpha-2::jar" ) ); + model.addDependencyManagement( toDependency( "javax.servlet:servlet-api:2.4::jar" ) ); + model.addDependencyManagement( toDependency( "opensymphony:sitemesh:2.2.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.slf4j:slf4j-log4j12:1.2::jar" ) ); + model.addDependencyManagement( toDependency( "taglibs:standard:1.1.2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-file:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-http-lightweight:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "opensymphony:webwork:2.2.4::jar" ) ); + model.addDependencyManagement( toDependency( "xmlunit:xmlunit:1.0::jar" ) ); + model.addProperty( "wagon.version", "1.0-beta-2" ); + model.addProperty( "maven.version", "2.0.5" ); + model.addProperty( "redback.version", "1.0-alpha-1" ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-parent:5" ); + model.setParentProject( toParent( "org.apache:apache:3" ) ); + addModel( model ); + + model = toModel( "org.apache:apache:3" ); + addModel( model ); + + model = toModel( "junit:junit:3.8.1" ); + addModel( model ); + + model = toModel( "javax.activation:activation:1.1" ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-applet:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-web:1.0-alpha-2-SNAPSHOT" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-web:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-parent:1.0-alpha-2-SNAPSHOT" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-artifact-converter:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-base:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-repository-metadata:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact-manager:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-transaction:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.shared:maven-model-converter:2.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-repository-metadata:2.0.5" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.5" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven:2.0.5" ); + model.setParentProject( toParent( "org.apache.maven:maven-parent:5" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh-external:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-file:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-http-lightweight:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "easymock:easymock:1.2_Java1.3::jar", "test" ) ); + model.addDependencyManagement( toDependency( "classworlds:classworlds:1.1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0.3" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + model.addDependency( toDependency( "classworlds:classworlds:1.1-alpha-2::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-containers:1.0.3" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.4" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus:1.0.4" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-utils:1.0.4" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "classworlds:classworlds:1.1-alpha-2" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-utils:1.1" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.4" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-provider-api:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon:1.0-beta-2" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven:maven-parent:4" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-provider-test:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh-common-test:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh-common:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "junit:junit:3.8.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-interactivity-api:1.0-alpha-4::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-parent:4" ); + model.setParentProject( toParent( "org.apache:apache:3" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-provider-test:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon:1.0-beta-2" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-beta-2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8" ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar", "compile" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependency( toDependency( "classworlds:classworlds:1.1-alpha-2::jar", "compile" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-ssh-common-test:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-beta-2" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-ssh-common:1.0-beta-2::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-providers:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon:1.0-beta-2" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-test:1.0-beta-2::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh-common:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh-common-test:1.0-beta-2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-ssh-common:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-beta-2" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-interactivity-api:1.0-alpha-4::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-interactivity-api:1.0-alpha-4" ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-7::jar", "compile" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "classworlds:classworlds:1.1-alpha-2::jar", "compile" ) ); + model.addDependency( toDependency( "plexus:plexus-utils:1.0.2::jar", "compile" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-container-default:1.0-alpha-7" ); + model.setParentProject( toParent( "plexus:plexus-containers:1.0.2" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependency( toDependency( "plexus:plexus-utils:1.0.2::jar" ) ); + model.addDependency( toDependency( "classworlds:classworlds:1.1-alpha-2::jar" ) ); + addModel( model ); + + model = toModel( "plexus:plexus-containers:1.0.2" ); + model.setParentProject( toParent( "plexus:plexus-root:1.0.3" ) ); + addModel( model ); + + model = toModel( "plexus:plexus-root:1.0.3" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "plexus:plexus-utils:1.0.2" ); + model.setParentProject( toParent( "plexus:plexus-root:1.0.3" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-ssh:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-beta-2" ) ); + model.addDependency( toDependency( "com.jcraft:jsch:0.1.27::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-interactivity-api:1.0-alpha-4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-ssh-common:1.0-beta-2::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-ssh-common-test:1.0-beta-2::jar", "test" ) ); + addModel( model ); + + model = toModel( "com.jcraft:jsch:0.1.27" ); + dep = toDependency( "com.jcraft:jzlib:1.0.7::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "com.jcraft:jzlib:1.0.7" ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-ssh-external:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-beta-2" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-ssh-common:1.0-beta-2::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-ssh-common-test:1.0-beta-2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-file:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-beta-2" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-http-lightweight:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-beta-2" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-http-shared:1.0-beta-2::jar" ) ); + model.addDependency( toDependency( "xml-apis:xml-apis:1.0.b2::jar" ) ); + dep = toDependency( "plexus:plexus-jetty-httpd:1.0-beta-1::jar", "test" ); + addExclusion( dep, "plexus:plexus-container-default" ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-http-shared:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-beta-2" ) ); + model.addDependency( toDependency( "jtidy:jtidy:4aug2000r7-dev::jar" ) ); + addModel( model ); + + model = toModel( "jtidy:jtidy:4aug2000r7-dev" ); + addModel( model ); + + model = toModel( "xml-apis:xml-apis:1.0.b2" ); + addModel( model ); + + model = toModel( "plexus:plexus-jetty-httpd:1.0-beta-1" ); + model.setParentProject( toParent( "plexus:plexus-components:1.0" ) ); + model.addDependency( toDependency( "jetty:jetty:4.2.10::jar" ) ); + model.addDependency( toDependency( "servletapi:servletapi:2.3::jar" ) ); + addModel( model ); + + model = toModel( "plexus:plexus-components:1.0" ); + model.setParentProject( toParent( "plexus:plexus-root:1.0" ) ); + model.addDependency( toDependency( "plexus:plexus-container-default:1.0-alpha-2::jar" ) ); + addModel( model ); + + model = toModel( "plexus:plexus-root:1.0" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "plexus:plexus-container-default:1.0-alpha-2" ); + addModel( model ); + + model = toModel( "jetty:jetty:4.2.10" ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.3::jar", "runtime" ) ); + addModel( model ); + + model = toModel( "javax.servlet:servlet-api:2.3" ); + addModel( model ); + + model = toModel( "servletapi:servletapi:2.3" ); + model.setRelocation( new VersionedReference() ); + model.getRelocation().setGroupId( "javax.servlet" ); + model.getRelocation().setArtifactId( "servlet-api" ); + model.getRelocation().setVersion( "2.3" ); + addModel( model ); + + model = toModel( "easymock:easymock:1.2_Java1.3" ); + addModel( model ); + + model = toModel( "classworlds:classworlds:1.1" ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-artifact-manager:2.0.5" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.5" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-repository-metadata:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-file:1.0-beta-2::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-beta-2::jar" ) ); + model.addDependency( toDependency( "easymock:easymock:1.2_Java1.3::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-artifact:2.0.5" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.5" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-transaction:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-base:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-digest:1.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-digest:1.1" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.12" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4.1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-components:1.1.12" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.10" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-20::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-20::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus:1.0.10" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-component-api:1.0-alpha-20" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0-alpha-20" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-containers:1.0-alpha-20" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.10" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-19::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.3::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.9" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus:1.0.9" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-component-api:1.0-alpha-19" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0-alpha-19" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-containers:1.0-alpha-19" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.10" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-19::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.3::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-utils:1.3" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.8" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus:1.0.8" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-container-default:1.0-alpha-20" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0-alpha-20" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-19::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.3::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + model.addDependency( toDependency( "jmock:jmock:1.0.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "jmock:jmock:1.0.1" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-utils:1.4.1" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.11" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus:1.0.11" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-utils:1.4" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.9" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0-alpha-22" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-19::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.3::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + model.addDependency( toDependency( "jmock:jmock:1.0.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-containers:1.0-alpha-22" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.10" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-19::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.3::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.shared:maven-model-converter:2.1" ); + model.setParentProject( toParent( "org.apache.maven.shared:maven-shared-components:7" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-model-v3:2.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-model:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + model.addDependency( toDependency( "dom4j:dom4j:1.4::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.shared:maven-shared-components:7" ); + model.setParentProject( toParent( "org.apache.maven:maven-parent:5" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-model-v3:2.0" ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-model:2.0.4" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.4" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven:2.0.4" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh:1.0-alpha-7::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh-external:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-file:1.0-alpha-7::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-http-lightweight:1.0-alpha-6::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-provider-api:1.0-alpha-6" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon:1.0-alpha-6" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon:1.0-alpha-6" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-provider-test:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "junit:junit:3.8.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-provider-test:1.0-alpha-6" ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-ssh:1.0-alpha-7" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-alpha-6" ) ); + model.addDependency( toDependency( "com.jcraft:jsch:0.1.24::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-interactivity-api:1.0-alpha-4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-providers:1.0-alpha-6" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon:1.0-alpha-6" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-test:1.0-alpha-6::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-alpha-6::jar" ) ); + addModel( model ); + + model = toModel( "com.jcraft:jsch:0.1.24" ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-ssh-external:1.0-alpha-6" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-alpha-6" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-file:1.0-alpha-7" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-alpha-6" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-http-lightweight:1.0-alpha-6" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-alpha-6" ) ); + dep = toDependency( "plexus:plexus-jetty-httpd:1.0-beta-1::jar", "test" ); + addExclusion( dep, "plexus:plexus-container-default" ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "dom4j:dom4j:1.4" ); + model.addDependency( toDependency( "xml-apis:xml-apis:1.0.b2::jar" ) ); + model.addDependency( toDependency( "jaxen:jaxen:1.0-FCS::jar" ) ); + model.addDependency( toDependency( "saxpath:saxpath:1.0-FCS::jar" ) ); + model.addDependency( toDependency( "msv:msv:20020414::jar" ) ); + model.addDependency( toDependency( "relaxngDatatype:relaxngDatatype:20020414::jar" ) ); + model.addDependency( toDependency( "isorelax:isorelax:20020414::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "junitperf:junitperf:1.8::jar", "test" ) ); + model.addDependency( toDependency( "xerces:xerces:2.0.2::jar", "test" ) ); + model.addDependency( toDependency( "xalan:xalan:2.3.1::jar", "test" ) ); + model.addDependency( toDependency( "jtidy:jtidy:4aug2000r7-dev::jar", "test" ) ); + model.addDependency( toDependency( "pull-parser:pull-parser:2::jar", "test" ) ); + addModel( model ); + + model = toModel( "jaxen:jaxen:1.0-FCS" ); + addModel( model ); + + model = toModel( "saxpath:saxpath:1.0-FCS" ); + addModel( model ); + + model = toModel( "msv:msv:20020414" ); + addModel( model ); + + model = toModel( "relaxngDatatype:relaxngDatatype:20020414" ); + addModel( model ); + + model = toModel( "isorelax:isorelax:20020414" ); + addModel( model ); + + model = toModel( "junitperf:junitperf:1.8" ); + addModel( model ); + + model = toModel( "xerces:xerces:2.0.2" ); + model.setRelocation( new VersionedReference() ); + model.getRelocation().setGroupId( "xerces" ); + model.getRelocation().setArtifactId( "xercesImpl" ); + addModel( model ); + + model = toModel( "xerces:xercesImpl:2.0.2" ); + addModel( model ); + + model = toModel( "xalan:xalan:2.3.1" ); + addModel( model ); + + model = toModel( "pull-parser:pull-parser:2" ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-artifact-reports:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-reporting:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-report-manager:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-database:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-repository-layer:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-commons:1.0-alpha-2::jar", "test" ) ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.8.0.7::jar", "test" ) ); + model.addDependency( toDependency( "easymock:easymock:1.2_Java1.3::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-slf4j-logging:1.1-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.slf4j:slf4j-log4j12:1.2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-reporting:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-parent:1.0-alpha-2-SNAPSHOT" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-report-manager:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-reporting:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-database:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-repository-layer:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:2.2::jar" ) ); + model.addDependency( toDependency( "commons-io:commons-io:1.2::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-database:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-parent:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-consumer-api:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-configuration:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-model:1.0-alpha-2-SNAPSHOT::jar" ) ); + dep = toDependency( "org.codehaus.plexus:plexus-jdo2:1.0-alpha-8::jar" ); + addExclusion( dep, "xerces:xercesImpl" ); + addExclusion( dep, "xerces:xmlParserAPIs" ); + model.addDependency( dep ); + dep = toDependency( "jpox:jpox:1.1.7::jar", "compile" ); + addExclusion( dep, "javax.sql:jdbc-stdext" ); + model.addDependency( dep ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:2.2::jar" ) ); + model.addDependency( toDependency( "commons-io:commons-io:1.2::jar" ) ); + dep = toDependency( "commons-logging:commons-logging:1.0.4::jar" ); + addExclusion( dep, "logkit:logkit" ); + model.addDependency( dep ); + model.addDependency( toDependency( "log4j:log4j:1.2.8::jar" ) ); + model.addDependency( toDependency( "org.apache.derby:derby:10.1.3.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-commons:1.0-alpha-2::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-repository-layer:1.0-alpha-2-SNAPSHOT::jar", "test" ) ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.8.0.7::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.derby:derbytools:10.1.3.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-consumer-api:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-consumers:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-model:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:3.2::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-consumers:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-base:1.0-alpha-2-SNAPSHOT" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-model:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-base:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-common:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependency( toDependency( "javax.jdo:jdo2-api:2.0::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:2.2::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:3.2::jar" ) ); + model.addDependency( toDependency( "commons-io:commons-io:1.2::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-common:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-base:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:2.2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + addModel( model ); + + model = toModel( "commons-lang:commons-lang:2.2" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-component-api:1.0-alpha-22" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0-alpha-22" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + addModel( model ); + + model = toModel( "javax.jdo:jdo2-api:2.0" ); + model.addDependency( toDependency( "geronimo-spec:geronimo-spec-jta:1.0.1B-rc2::jar" ) ); + dep = toDependency( "xerces:xerces:2.4.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "xml-apis:xml-apis:1.0.b2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "geronimo-spec:geronimo-spec-jta:1.0.1B-rc2" ); + addModel( model ); + + model = toModel( "xerces:xerces:2.4.0" ); + model.setRelocation( new VersionedReference() ); + model.getRelocation().setGroupId( "xerces" ); + model.getRelocation().setArtifactId( "xercesImpl" ); + addModel( model ); + + model = toModel( "xerces:xercesImpl:2.4.0" ); + addModel( model ); + + model = toModel( "commons-collections:commons-collections:3.2" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "commons-io:commons-io:1.2" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-configuration:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-base:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-common:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-xml-tools:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-policies:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:2.2::jar" ) ); + model.addDependency( toDependency( "commons-io:commons-io:1.2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-api:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-commons:1.0-alpha-2::jar", "test" ) ); + model.addDependency( toDependency( "easymock:easymock:1.2_Java1.3::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-policies:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-base:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-common:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:2.2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-digest:1.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.cache:plexus-cache-ehcache:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "easymock:easymock:1.2_Java1.3::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-slf4j-logging:1.1-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.slf4j:slf4j-log4j12:1.2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.cache:plexus-cache-ehcache:1.0-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus.cache:plexus-cache-providers-parent:1.0-alpha-2" ) ); + model.addDependency( toDependency( "net.sf.ehcache:ehcache:1.2.4::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:3.2::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.cache:plexus-cache-providers-parent:1.0-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus.cache:plexus-cache-parent:1.0-alpha-2" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.cache:plexus-cache-api:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.cache:plexus-cache-test:1.0-alpha-2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.cache:plexus-cache-parent:1.0-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.9" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-16::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-16::jar" ) ); + model.addDependencyManagement( toDependency( "commons-lang:commons-lang:2.1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-components:1.1.9" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.10" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-16::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-16::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-component-api:1.0-alpha-16" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0-alpha-16" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-containers:1.0-alpha-16" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.9" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-16::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.3::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-container-default:1.0-alpha-16" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0-alpha-16" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-16::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.3::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + model.addDependency( toDependency( "jmock:jmock:1.0.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "commons-lang:commons-lang:2.1" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.cache:plexus-cache-api:1.0-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus.cache:plexus-cache-parent:1.0-alpha-2" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-16::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-16::jar" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:2.1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.cache:plexus-cache-test:1.0-alpha-2" ); + addModel( model ); + + model = toModel( "net.sf.ehcache:ehcache:1.2.4" ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.4::jar", "compile" ) ); + dep = toDependency( "org.hibernate:hibernate:3.2.0.cr3::jar", "test" ); + addExclusion( dep, "javax.transaction:jta" ); + addExclusion( dep, "javax.security:jacc" ); + model.addDependency( dep ); + dep = toDependency( "net.sf.hibernate:hibernate:2.1.8::jar", "test" ); + addExclusion( dep, "javax.transaction:jta" ); + addExclusion( dep, "javax.security:jacc" ); + model.addDependency( dep ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar", "test" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "httpunit:httpunit:1.6::jar", "test" ) ); + model.addDependency( toDependency( "commons-httpclient:commons-httpclient:3.0.1::jar", "test" ) ); + model.addDependency( toDependency( "com.cenqua.clover:clover:1.3.13::jar", "test" ) ); + model.addDependency( toDependency( "checkstyle:checkstyle:4.1::jar", "test" ) ); + model.addDependency( toDependency( "checkstyle:checkstyle-optional:4.1::jar", "test" ) ); + model.addDependency( toDependency( "commons-httpclient:commons-httpclient:3.0.1::jar", "test" ) ); + model.addDependency( toDependency( "httpunit:httpunit:1.6.1::jar", "test" ) ); + model.addDependency( toDependency( "httpunit:httpunit:1.6.1::jar", "test" ) ); + model.addProperty( "licenseFile", "${basedir}/tools/clover.license" ); + addModel( model ); + + model = toModel( "commons-logging:commons-logging:1.0.4" ); + dep = toDependency( "log4j:log4j:1.2.6::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "logkit:logkit:1.0.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + dep = toDependency( "avalon-framework:avalon-framework:4.1.3::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "log4j:log4j:1.2.6" ); + addModel( model ); + + model = toModel( "logkit:logkit:1.0.1" ); + addModel( model ); + + model = toModel( "junit:junit:3.7" ); + addModel( model ); + + model = toModel( "avalon-framework:avalon-framework:4.1.3" ); + addModel( model ); + + model = toModel( "org.hibernate:hibernate:3.2.0.cr3" ); + addModel( model ); + + model = toModel( "net.sf.hibernate:hibernate:2.1.8" ); + addModel( model ); + + model = toModel( "javax.servlet:servlet-api:2.4" ); + addModel( model ); + + model = toModel( "httpunit:httpunit:1.6" ); + model.addDependency( toDependency( "xerces:xmlParserAPIs:2.2.1::jar" ) ); + model.addDependency( toDependency( "xerces:xercesImpl:2.6.2::jar" ) ); + model.addDependency( toDependency( "nekohtml:nekohtml:0.9.1::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar" ) ); + model.addDependency( toDependency( "rhino:js:1.5R4.1::jar" ) ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.3::jar" ) ); + model.addDependency( toDependency( "jtidy:jtidy:4aug2000r7-dev::jar" ) ); + model.addDependency( toDependency( "javax.activation:activation:1.0.2::jar", "test" ) ); + model.addDependency( toDependency( "javax.mail:mail:1.3.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "xerces:xmlParserAPIs:2.2.1" ); + addModel( model ); + + model = toModel( "xerces:xercesImpl:2.6.2" ); + addModel( model ); + + model = toModel( "nekohtml:nekohtml:0.9.1" ); + model.addDependency( toDependency( "xerces:xerces:2.4.0::jar" ) ); + addModel( model ); + + model = toModel( "rhino:js:1.5R4.1" ); + addModel( model ); + + model = toModel( "javax.activation:activation:1.0.2" ); + addModel( model ); + + model = toModel( "javax.mail:mail:1.3.1" ); + model.addDependency( toDependency( "javax.activation:activation:1.0.2::jar", "compile" ) ); + addModel( model ); + + model = toModel( "commons-httpclient:commons-httpclient:3.0.1" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.3::jar" ) ); + model.addDependency( toDependency( "commons-codec:commons-codec:1.2::jar" ) ); + addModel( model ); + + model = toModel( "commons-logging:commons-logging:1.0.3" ); + dep = toDependency( "log4j:log4j:1.2.6::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "logkit:logkit:1.0.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + addModel( model ); + + model = toModel( "commons-codec:commons-codec:1.2" ); + addModel( model ); + + model = toModel( "com.cenqua.clover:clover:1.3.13" ); + addModel( model ); + + model = toModel( "checkstyle:checkstyle:4.1" ); + model.addDependency( toDependency( "antlr:antlr:2.7.2::jar" ) ); + model.addDependency( toDependency( "commons-beanutils:commons-beanutils-core:1.7.0::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.1::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.3::jar" ) ); + addModel( model ); + + model = toModel( "antlr:antlr:2.7.2" ); + addModel( model ); + + model = toModel( "commons-beanutils:commons-beanutils-core:1.7.0" ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.0::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + addModel( model ); + + model = toModel( "commons-logging:commons-logging:1.0" ); + addModel( model ); + + model = toModel( "commons-collections:commons-collections:2.0" ); + addModel( model ); + + model = toModel( "commons-collections:commons-collections:2.1" ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + addModel( model ); + + model = toModel( "checkstyle:checkstyle-optional:4.1" ); + model.addDependency( toDependency( "checkstyle:checkstyle:4.1::jar" ) ); + addModel( model ); + + model = toModel( "httpunit:httpunit:1.6.1" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-slf4j-logging:1.1-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-logging:1.0.4" ) ); + model.addDependency( toDependency( "org.slf4j:slf4j-simple:1.2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-logging-provider-test:1.0.4::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-logging:1.0.4" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.11" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-logging-provider-test:1.0.4::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-22::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-logging-provider-test:1.0.4" ); + addModel( model ); + + model = toModel( "org.slf4j:slf4j-simple:1.2" ); + model.setParentProject( toParent( "org.slf4j:slf4j-parent:1.2" ) ); + model.addDependency( toDependency( "org.slf4j:slf4j-api:1.2::jar" ) ); + addModel( model ); + + model = toModel( "org.slf4j:slf4j-parent:1.2" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.slf4j:slf4j-api:1.2" ); + model.setParentProject( toParent( "org.slf4j:slf4j-parent:1.2" ) ); + addModel( model ); + + model = toModel( "org.slf4j:slf4j-log4j12:1.2" ); + model.setParentProject( toParent( "org.slf4j:slf4j-parent:1.2" ) ); + model.addDependency( toDependency( "org.slf4j:slf4j-api:1.2::jar" ) ); + model.addDependency( toDependency( "log4j:log4j:1.2.13::jar" ) ); + addModel( model ); + + model = toModel( "log4j:log4j:1.2.13" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.registry:plexus-registry-api:1.0-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus.registry:plexus-registry:1.0-alpha-2" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-17::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.registry:plexus-registry:1.0-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.12" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-17::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.registry:plexus-registry-api:1.0-alpha-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.registry:plexus-registry-test:1.0-alpha-2::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-container-default:1.0-alpha-17" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0-alpha-17" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-17::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.3::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + model.addDependency( toDependency( "jmock:jmock:1.0.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-containers:1.0-alpha-17" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.9" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-17::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.3::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-component-api:1.0-alpha-17" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0-alpha-17" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.registry:plexus-registry-test:1.0-alpha-2" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.registry:plexus-registry-commons:1.0-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus.registry:plexus-registry-providers:1.0-alpha-2" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-api:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-test:1.0-alpha-2::jar", "test" ) ); + dep = toDependency( "commons-configuration:commons-configuration:1.3::jar" ); + addExclusion( dep, "commons-beanutils:commons-beanutils-core" ); + addExclusion( dep, "xerces:xerces" ); + addExclusion( dep, "xerces:xercesImpl" ); + addExclusion( dep, "xalan:xalan" ); + addExclusion( dep, "xml-apis:xml-apis" ); + addExclusion( dep, "servletapi:servletapi" ); + model.addDependency( dep ); + model.addDependency( toDependency( "commons-beanutils:commons-beanutils:1.7.0::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.registry:plexus-registry-providers:1.0-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus.registry:plexus-registry:1.0-alpha-2" ) ); + addModel( model ); + + model = toModel( "commons-configuration:commons-configuration:1.3" ); + model.addDependency( toDependency( "commons-collections:commons-collections:3.1::jar" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:2.1::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging-api:1.0.4::jar" ) ); + model.addDependency( toDependency( "commons-digester:commons-digester:1.6::jar" ) ); + model.addDependency( toDependency( "commons-beanutils:commons-beanutils-core:1.7.0::jar" ) ); + model.addDependency( toDependency( "commons-codec:commons-codec:1.3::jar" ) ); + model.addDependency( toDependency( "commons-jxpath:commons-jxpath:1.2::jar" ) ); + model.addDependency( toDependency( "xerces:xerces:2.2.1::jar" ) ); + model.addDependency( toDependency( "xalan:xalan:2.7.0::jar" ) ); + model.addDependency( toDependency( "xml-apis:xml-apis:2.0.2::jar" ) ); + dep = toDependency( "servletapi:servletapi:2.4::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "spice:spice-jndikit:1.1::jar", "test" ) ); + model.addDependency( toDependency( "commons-dbcp:commons-dbcp:1.1::jar", "test" ) ); + model.addDependency( toDependency( "commons-pool:commons-pool:1.1::jar", "test" ) ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.7.2.2::jar", "test" ) ); + model.addDependency( toDependency( "dbunit:dbunit:2.1::jar", "test" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "junit-addons:junit-addons:1.4::jar", "test" ) ); + model.addDependency( toDependency( "mockobjects:mockobjects-core:0.09::jar", "test" ) ); + model.addDependency( toDependency( "mockobjects:mockobjects-jdk1.4-j2ee1.3:0.09::jar", "test" ) ); + addModel( model ); + + model = toModel( "commons-collections:commons-collections:3.1" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "commons-logging:commons-logging-api:1.0.4" ); + addModel( model ); + + model = toModel( "commons-digester:commons-digester:1.6" ); + model.addDependency( toDependency( "commons-beanutils:commons-beanutils:1.6::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.1::jar" ) ); + model.addDependency( toDependency( "xml-apis:xml-apis:1.0.b2::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "commons-beanutils:commons-beanutils:1.6" ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.0::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + addModel( model ); + + model = toModel( "commons-codec:commons-codec:1.3" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "commons-jxpath:commons-jxpath:1.2" ); + model.addDependency( toDependency( "xerces:xerces:1.2.3::jar" ) ); + model.addDependency( toDependency( "servletapi:servletapi:2.2::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.8::jar" ) ); + model.addDependency( toDependency( "ant:ant-optional:1.5.1::jar" ) ); + model.addDependency( toDependency( "xml-apis:xml-apis:2.0.2::jar" ) ); + model.addDependency( toDependency( "jdom:jdom:b9::jar" ) ); + model.addDependency( toDependency( "commons-beanutils:commons-beanutils:1.4::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.0::jar" ) ); + addModel( model ); + + model = toModel( "xerces:xerces:1.2.3" ); + addModel( model ); + + model = toModel( "servletapi:servletapi:2.2" ); + model.setRelocation( new VersionedReference() ); + model.getRelocation().setGroupId( "javax.servlet" ); + model.getRelocation().setArtifactId( "servlet-api" ); + model.getRelocation().setVersion( "2.2" ); + addModel( model ); + + model = toModel( "javax.servlet:servlet-api:2.2" ); + addModel( model ); + + model = toModel( "junit:junit:3.8" ); + addModel( model ); + + model = toModel( "ant:ant-optional:1.5.1" ); + addModel( model ); + + model = toModel( "xml-apis:xml-apis:2.0.2" ); + model.setRelocation( new VersionedReference() ); + model.getRelocation().setGroupId( "xml-apis" ); + model.getRelocation().setArtifactId( "xml-apis" ); + model.getRelocation().setVersion( "1.0.b2" ); + addModel( model ); + + model = toModel( "jdom:jdom:b9" ); + addModel( model ); + + model = toModel( "commons-beanutils:commons-beanutils:1.4" ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.0::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + addModel( model ); + + model = toModel( "xerces:xerces:2.2.1" ); + addModel( model ); + + model = toModel( "xalan:xalan:2.7.0" ); + model.addDependency( toDependency( "xml-apis:xml-apis:2.0.2::jar" ) ); + dep = toDependency( "xerces:xercesImpl:2.6.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "xerces:xercesImpl:2.6.0" ); + addModel( model ); + + model = toModel( "servletapi:servletapi:2.4" ); + addModel( model ); + + model = toModel( "spice:spice-jndikit:1.1" ); + addModel( model ); + + model = toModel( "commons-dbcp:commons-dbcp:1.1" ); + addModel( model ); + + model = toModel( "commons-pool:commons-pool:1.1" ); + addModel( model ); + + model = toModel( "hsqldb:hsqldb:1.7.2.2" ); + addModel( model ); + + model = toModel( "dbunit:dbunit:2.1" ); + addModel( model ); + + model = toModel( "junit-addons:junit-addons:1.4" ); + addModel( model ); + + model = toModel( "mockobjects:mockobjects-core:0.09" ); + addModel( model ); + + model = toModel( "mockobjects:mockobjects-jdk1.4-j2ee1.3:0.09" ); + addModel( model ); + + model = toModel( "commons-beanutils:commons-beanutils:1.7.0" ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.3::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-jdo2:1.0-alpha-8" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.6" ) ); + model.addDependency( toDependency( "javax.jdo:jdo2-api:2.0::jar" ) ); + dep = toDependency( "jpox:jpox:1.1.1::jar", "test" ); + addExclusion( dep, "javax.sql:jdbc-stdext" ); + model.addDependency( dep ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.7.3.0::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-components:1.1.6" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.8" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + addModel( model ); + + model = toModel( "jpox:jpox:1.1.1" ); + model.setParentProject( toParent( "jpox:jpox-parent:1.1.1" ) ); + model.addDependency( toDependency( "log4j:log4j:1.2.8::jar" ) ); + model.addDependency( toDependency( "javax.jdo:jdo2-api:2.0::jar" ) ); + model.addDependency( toDependency( "javax.resource:connector:1.0::jar" ) ); + dep = toDependency( "javax.security:jaas:1.0.01::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "javax.sql:jdbc-stdext:2.0::jar" ) ); + dep = toDependency( "ant:ant:1.6::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "jpox:jpox-dbcp:1.1.1::jar", "test" ) ); + model.addDependency( toDependency( "commons-dbcp:commons-dbcp:1.2::jar", "test" ) ); + model.addDependency( toDependency( "commons-pool:commons-pool:1.2::jar", "test" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:3.1::jar", "test" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "jpox:jpox-parent:1.1.1" ); + addModel( model ); + + model = toModel( "log4j:log4j:1.2.8" ); + addModel( model ); + + model = toModel( "javax.resource:connector:1.0" ); + addModel( model ); + + model = toModel( "javax.security:jaas:1.0.01" ); + addModel( model ); + + model = toModel( "javax.sql:jdbc-stdext:2.0" ); + addModel( model ); + + model = toModel( "ant:ant:1.6" ); + addModel( model ); + + model = toModel( "jpox:jpox-dbcp:1.1.1" ); + addModel( model ); + + model = toModel( "commons-dbcp:commons-dbcp:1.2" ); + addModel( model ); + + model = toModel( "commons-pool:commons-pool:1.2" ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.1::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "xml-apis:xml-apis:2.0.2::jar" ) ); + model.addDependency( toDependency( "xerces:xerces:2.0.2::jar" ) ); + addModel( model ); + + model = toModel( "hsqldb:hsqldb:1.7.3.0" ); + addModel( model ); + + model = toModel( "jpox:jpox:1.1.7" ); + model.setParentProject( toParent( "jpox:jpox-parent:1.1.7" ) ); + model.addDependency( toDependency( "log4j:log4j:1.2.8::jar" ) ); + model.addDependency( toDependency( "javax.jdo:jdo2-api:2.0::jar" ) ); + model.addDependency( toDependency( "javax.resource:connector:1.0::jar" ) ); + model.addDependency( toDependency( "javax.transaction:jta:1.0.1B::jar" ) ); + dep = toDependency( "ant:ant:1.6::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "jpox:jpox-parent:1.1.7" ); + addModel( model ); + + model = toModel( "javax.transaction:jta:1.0.1B" ); + addModel( model ); + + model = toModel( "org.apache.derby:derby:10.1.3.1" ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-repository-layer:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-base:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-configuration:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-consumer-api:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-model:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-xml-tools:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-expression-evaluator:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "org.slf4j:slf4j-log4j12:1.2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.cache:plexus-cache-api:1.0-alpha-2::jar", "compile" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.cache:plexus-cache-ehcache:1.0-alpha-2::jar", "compile" ) ); + model.addDependency( toDependency( "xmlunit:xmlunit:1.0::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-commons:1.0-alpha-2::jar", "test" ) ); + model.addDependency( toDependency( "easymock:easymock:1.2_Java1.3::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-expression-evaluator:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.7" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-components:1.1.7" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.8" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + addModel( model ); + + model = toModel( "xmlunit:xmlunit:1.0" ); + addModel( model ); + + model = toModel( "hsqldb:hsqldb:1.8.0.7" ); + addModel( model ); + + model = toModel( "org.apache.derby:derbytools:10.1.3.1" ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-converter:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-base:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-consumer-api:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-repository-layer:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-artifact-converter:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.shared:maven-model-converter:2.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-digest:1.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-i18n:1.0-beta-6::jar" ) ); + model.addDependency( toDependency( "commons-io:commons-io:1.2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-commons:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.8.0.7::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-i18n:1.0-beta-6" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.4" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-components:1.1.4" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.4" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-core:1.0-alpha-2-SNAPSHOT-SNAPSHOT" ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-core-consumers:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-consumers:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-configuration:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-consumer-api:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-repository-layer:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-digest:1.1::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-database-consumers:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-consumers:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-database:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-artifact-reports:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-configuration:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-consumer-api:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-repository-layer:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-digest:1.1::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-indexer:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-base:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-repository-layer:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-model:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.lucene:lucene-core:2.0.0::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-digest:1.1::jar" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:2.2::jar" ) ); + model.addDependency( toDependency( "commons-io:commons-io:1.2::jar" ) ); + model.addDependency( toDependency( "easymock:easymock:1.2_Java1.3::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.lucene:lucene-core:2.0.0" ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-lucene-consumers:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-consumers:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-indexer:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-configuration:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-consumer-api:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-repository-layer:1.0-alpha-2-SNAPSHOT::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-plexus-application:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-web-standalone:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-webapp:1.0-alpha-2-SNAPSHOT::war" ) ); + model.addProperty( "archivaVersion", "1.0-alpha-2-SNAPSHOT" ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-web-standalone:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-web:1.0-alpha-2-SNAPSHOT" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-webapp:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-web:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-report-manager:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-scheduled:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-indexer:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-proxy:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-database:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-repository-layer:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-security:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-core-consumers:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-database-consumers:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-lucene-consumers:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-signature-consumers:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-applet:1.0-alpha-2-SNAPSHOT::jar", "provided" ) ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar", "provided" ) ); + model.addDependency( toDependency( "javax.servlet:jsp-api:2.0::jar", "provided" ) ); + model.addDependency( toDependency( "opensymphony:sitemesh:2.2.1::jar" ) ); + model.addDependency( toDependency( "taglibs:standard:1.1.2::jar" ) ); + model.addDependency( toDependency( "javax.servlet:jstl:1.1.2::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.shared:maven-app-configuration-model:1.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.shared:maven-app-configuration-web:1.0::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-slf4j-logging:1.1-alpha-1::jar", "runtime" ) ); + model.addDependency( toDependency( "org.slf4j:slf4j-log4j12:1.2::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.4::jar", "runtime" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:2.2::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-http-lightweight:1.0-beta-2::jar", "runtime" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-file:1.0-beta-2::jar", "runtime" ) ); + model.addDependency( toDependency( "opensymphony:webwork:2.2.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-api:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-commons:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.cache:plexus-cache-api:1.0-alpha-2::jar", "compile" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.cache:plexus-cache-ehcache:1.0-alpha-2::jar", "compile" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-xwork-content:1.0-alpha-1::war", "runtime" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-xwork-integration:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-taglib:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.webdav:plexus-webdav-simple:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-xwork-integration:1.0-alpha-6::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependency( toDependency( "org.apache.derby:derby:10.1.3.1::jar", "provided" ) ); + model.addDependency( toDependency( "javax.mail:mail:1.4::jar", "provided" ) ); + model.addDependency( toDependency( "javax.activation:activation:1.1::jar", "provided" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-scheduled:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-parent:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-configuration:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-database:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-repository-layer:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-taskqueue:1.0-alpha-6::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-quartz:1.0-alpha-3::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:2.2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-api:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-database-consumers:1.0-alpha-2-SNAPSHOT::jar", "test" ) ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.8.0.7::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-commons:1.0-alpha-2::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-slf4j-logging:1.1-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.slf4j:slf4j-log4j12:1.2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-taskqueue:1.0-alpha-6" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.7" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "backport-util-concurrent:backport-util-concurrent:3.0::jar" ) ); + addModel( model ); + + model = toModel( "backport-util-concurrent:backport-util-concurrent:3.0" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-quartz:1.0-alpha-3" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.6" ) ); + model.addDependency( toDependency( "quartz:quartz:1.4.5::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.2::jar" ) ); + addModel( model ); + + model = toModel( "quartz:quartz:1.4.5" ); + addModel( model ); + + model = toModel( "commons-logging:commons-logging:1.0.2" ); + dep = toDependency( "log4j:log4j:1.1.3::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "logkit:logkit:1.0.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + addModel( model ); + + model = toModel( "log4j:log4j:1.1.3" ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-proxy:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-base:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-configuration:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.archiva:archiva-repository-layer:1.0-alpha-2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "commons-io:commons-io:1.2::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-file:1.0-beta-2::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-beta-2::jar" ) ); + dep = toDependency( "org.codehaus.plexus:plexus-digest:1.1::jar" ); + addExclusion( dep, "org.codehaus.plexus:plexus-container-default" ); + model.addDependency( dep ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-22::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-commons:1.0-alpha-2::jar", "test" ) ); + model.addDependency( toDependency( "easymock:easymock:1.2_Java1.3::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-slf4j-logging:1.1-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.slf4j:slf4j-log4j12:1.2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-security:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-web:1.0-alpha-2-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-role-manager:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-memory:1.0-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-xwork-integration:1.0-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.derby:derby:10.1.3.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-rbac-role-manager:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-rbac:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-model:1.0-alpha-1::jar" ) ); + dep = toDependency( "net.java.dev.stax-utils:stax-utils:20060502::jar" ); + addExclusion( dep, "com.bea.xml:jsr173-ri" ); + model.addDependency( dep ); + model.addDependency( toDependency( "stax:stax-api:1.0.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.woodstox:wstx-asl:3.2.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-memory:1.0-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-jdo:1.0-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-model:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-common-jdo:1.0-alpha-1::jar" ) ); + dep = toDependency( "net.java.dev.stax-utils:stax-utils:20060502::jar" ); + addExclusion( dep, "com.bea.xml:jsr173-ri" ); + model.addDependency( dep ); + model.addDependency( toDependency( "stax:stax-api:1.0.1::jar" ) ); + dep = toDependency( "stax:stax:1.1.1-dev::jar", "test" ); + addExclusion( dep, "xmlbeans:xmlbeans-jsr173-api" ); + model.addDependency( dep ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.8.0.4::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-rbac:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback:1.0-alpha-1" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.10" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-20::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-20::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-configuration:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-system:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-policy:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-common-jdo:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-authentication-api:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-keys-api:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-keys-tests:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-keys-cached:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-keys-memory:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-keys-jdo:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-authentication-users:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-authentication-=keys=:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-authentication-memory:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-authentication-keys:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-authorization-api:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-users-api:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-users-jdo:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-users-memory:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-users-cached:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-users-tests:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-authorization-rbac:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-rbac-model:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-rbac-tests:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-rbac-memory:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-rbac-cached:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-rbac-jdo:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-rbac-role-manager:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-xwork-integration:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-taglib:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-xwork-content:1.0-alpha-1::war" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-xwork-integration:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-20::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-20::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.2::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-ehcache:1.0-alpha-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-mail-sender-api:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-mail-sender-javamail:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-expression-evaluator:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-log4j-logging:1.1-alpha-2::jar", "test" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-xwork-integration:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "xalan:xalan:2.7.0::jar" ) ); + model.addDependencyManagement( toDependency( "xml-apis:xml-apis:1.3.03::jar" ) ); + model.addDependencyManagement( toDependency( "commons-lang:commons-lang:2.2::jar" ) ); + model.addDependencyManagement( toDependency( "commons-collections:commons-collections:3.2::jar" ) ); + model.addDependencyManagement( toDependency( "commons-logging:commons-logging:1.0.4::jar" ) ); + model.addDependencyManagement( toDependency( "hsqldb:hsqldb:1.8.0.4::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.derby:derby:10.1.3.1::jar" ) ); + model.addProperty( "security.version", "1.0-alpha-1" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-configuration:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-expression-evaluator:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-commons:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-log4j-logging:1.1-alpha-2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.registry:plexus-registry-commons:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.registry:plexus-registry-providers:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-test:1.0-alpha-1::jar" ) ); + dep = toDependency( "commons-configuration:commons-configuration:1.3::jar" ); + addExclusion( dep, "commons-beanutils:commons-beanutils-core" ); + addExclusion( dep, "xerces:xerces" ); + addExclusion( dep, "xerces:xercesImpl" ); + addExclusion( dep, "xalan:xalan" ); + addExclusion( dep, "xml-apis:xml-apis" ); + addExclusion( dep, "servletapi:servletapi" ); + model.addDependency( dep ); + model.addDependency( toDependency( "commons-beanutils:commons-beanutils:1.7.0::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.registry:plexus-registry-providers:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.registry:plexus-registry:1.0-alpha-1" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.registry:plexus-registry:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.9" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-17::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.registry:plexus-registry-api:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.registry:plexus-registry-test:1.0-alpha-1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.registry:plexus-registry-api:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.registry:plexus-registry:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-17::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.registry:plexus-registry-test:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.registry:plexus-registry:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-17::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-log4j-logging:1.1-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-logging:1.0.2" ) ); + model.addDependency( toDependency( "log4j:log4j:1.2.8::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-logging-provider-test:1.0-alpha-2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-logging:1.0.2" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.4" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-logging-provider-test:1.0-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-logging:1.0.2" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-system:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-configuration:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authentication-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authorization-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-cached:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-cached:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authentication-memory:1.0-alpha-1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authentication-api:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-authentication:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-policy:1.0-alpha-1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authentication:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-api:1.0-alpha-1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-users-api:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-users:1.0-alpha-1" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-users:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback:1.0-alpha-1" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-policy:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-configuration:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-api:1.0-alpha-1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authorization-api:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-authorization:1.0-alpha-1" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authorization:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-api:1.0-alpha-1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-users-cached:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-users-providers:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-policy:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-ehcache:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-jdo:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-tests:1.0-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-memory:1.0-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-log4j-logging:1.1-alpha-2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-users-providers:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-users:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-api:1.0-alpha-1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-ehcache:1.0-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.7" ) ); + model.addDependency( toDependency( "net.sf.ehcache:ehcache:1.2.4::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:3.2::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-users-jdo:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-users-providers:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-common-jdo:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-policy:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-tests:1.0-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.8.0.4::jar", "test" ) ); + dep = toDependency( "net.java.dev.stax-utils:stax-utils:20060502::jar" ); + addExclusion( dep, "com.bea.xml:jsr173-ri" ); + model.addDependency( dep ); + model.addDependency( toDependency( "stax:stax-api:1.0.1::jar" ) ); + model.addDependency( toDependency( "woodstox:wstx-asl:3.2.0::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-utils:1.2" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.5" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus:1.0.5" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-common-jdo:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-common:1.0-alpha-1" ) ); + dep = toDependency( "org.codehaus.plexus:plexus-jdo2:1.0-alpha-8::jar" ); + addExclusion( dep, "xerces:xercesImpl" ); + addExclusion( dep, "xerces:xmlParserAPIs" ); + model.addDependency( dep ); + dep = toDependency( "jpox:jpox:1.1.7::jar", "compile" ); + addExclusion( dep, "javax.sql:jdbc-stdext" ); + model.addDependency( dep ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.8.0.4::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-configuration:1.0-alpha-1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-common:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback:1.0-alpha-1" ) ); + addModel( model ); + + model = toModel( "hsqldb:hsqldb:1.8.0.4" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-users-tests:1.0-alpha-1" ); + addModel( model ); + + model = toModel( "net.java.dev.stax-utils:stax-utils:20060502" ); + model.addDependency( toDependency( "com.bea.xml:jsr173-ri:1.0::jar" ) ); + addModel( model ); + + model = toModel( "com.bea.xml:jsr173-ri:1.0" ); + model.addDependency( toDependency( "javax.xml:jsr173:1.0::jar" ) ); + addModel( model ); + + model = toModel( "javax.xml:jsr173:1.0" ); + addModel( model ); + + model = toModel( "stax:stax-api:1.0.1" ); + addModel( model ); + + model = toModel( "woodstox:wstx-asl:3.2.0" ); + model.setRelocation( new VersionedReference() ); + model.getRelocation().setGroupId( "org.codehaus.woodstox" ); + addModel( model ); + + model = toModel( "org.codehaus.woodstox:wstx-asl:3.2.0" ); + model.addDependency( toDependency( "stax:stax-api:1.0.1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-users-memory:1.0-alpha-1" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-keys-api:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-keys:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-digest:1.0::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-keys:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback:1.0-alpha-1" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-digest:1.0" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.7" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-keys-cached:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-keys-providers:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-ehcache:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-jdo:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-tests:1.0-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-memory:1.0-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-log4j-logging:1.1-alpha-2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-keys-providers:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-keys:1.0-alpha-1" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-keys-jdo:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-keys-providers:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-common-jdo:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-tests:1.0-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.8.0.4::jar", "test" ) ); + dep = toDependency( "net.java.dev.stax-utils:stax-utils:20060502::jar" ); + addExclusion( dep, "com.bea.xml:jsr173-ri" ); + model.addDependency( dep ); + model.addDependency( toDependency( "stax:stax-api:1.0.1::jar" ) ); + model.addDependency( toDependency( "woodstox:wstx-asl:3.2.0::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-keys-tests:1.0-alpha-1" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-keys-memory:1.0-alpha-1" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authentication-memory:1.0-alpha-1" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authentication-users:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-authentication-providers:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authentication-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-policy:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-cached:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-memory:1.0-alpha-1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authentication-providers:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-authentication:1.0-alpha-1" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authentication-=keys=:1.0-alpha-1" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authentication-keys:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-authentication-providers:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authentication-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-cached:1.0-alpha-1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authorization-rbac:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-authorization-providers:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authorization-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-cached:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-cached:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-model:1.0-alpha-1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authorization-providers:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-authorization:1.0-alpha-1" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-rbac-cached:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-rbac-providers:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-system:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authorization-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-model:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-ehcache:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-jdo:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-memory:1.0-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-tests:1.0-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-log4j-logging:1.1-alpha-2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-rbac-providers:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-rbac:1.0-alpha-1" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-rbac-model:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-rbac:1.0-alpha-1" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-rbac-jdo:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-rbac-providers:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-model:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-tests:1.0-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-common-jdo:1.0-alpha-1::jar" ) ); + dep = toDependency( "net.java.dev.stax-utils:stax-utils:20060502::jar" ); + addExclusion( dep, "com.bea.xml:jsr173-ri" ); + model.addDependency( dep ); + model.addDependency( toDependency( "stax:stax-api:1.0.1::jar" ) ); + dep = toDependency( "stax:stax:1.1.1-dev::jar", "test" ); + addExclusion( dep, "xmlbeans:xmlbeans-jsr173-api" ); + model.addDependency( dep ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.8.0.4::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-log4j-logging:1.1-alpha-2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-rbac-tests:1.0-alpha-1" ); + addModel( model ); + + model = toModel( "stax:stax:1.1.1-dev" ); + model.addDependency( toDependency( "xmlbeans:xmlbeans-jsr173-api:2.0-dev::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar" ) ); + addModel( model ); + + model = toModel( "xmlbeans:xmlbeans-jsr173-api:2.0-dev" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-rbac-memory:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-rbac-providers:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-system:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authorization-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-model:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-tests:1.0-alpha-1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-xwork-integration:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-xwork:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-configuration:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-system:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-policy:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authentication-users:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authentication-keys:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authorization-rbac:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-role-manager:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-xwork-integration:1.0-alpha-6::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-mail-sender-api:1.0-alpha-6::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-mail-sender-javamail:1.0-alpha-6::jar" ) ); + model.addDependency( toDependency( "org.extremecomponents:extremecomponents:1.0.1::jar" ) ); + model.addDependency( toDependency( "commons-beanutils:commons-beanutils-bean-collections:1.7.0::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.2::jar" ) ); + dep = toDependency( "org.codehaus.plexus:plexus-velocity:1.1.2::jar" ); + addExclusion( dep, "plexus:plexus-utils" ); + addExclusion( dep, "commons-logging:commons-logging-api" ); + model.addDependency( dep ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar", "provided" ) ); + model.addDependency( toDependency( "taglibs:standard:1.1.2::jar" ) ); + model.addDependency( toDependency( "javax.servlet:jstl:1.1.2::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:3.2::jar" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:2.2::jar" ) ); + model.addDependency( toDependency( "opensymphony:sitemesh:2.2.1::jar" ) ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.8.0.4::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-memory:1.0-alpha-1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-xwork:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-integrations:1.0-alpha-1" ) ); + model.addDependencyManagement( toDependency( "taglibs:standard:1.1.2::jar" ) ); + model.addDependencyManagement( toDependency( "javax.servlet:jstl:1.1.2::jar" ) ); + model.addDependencyManagement( toDependency( "javax.servlet:servlet-api:2.4::jar", "provided" ) ); + model.addDependencyManagement( toDependency( "javax.servlet:jsp-api:2.0::jar", "provided" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-integrations:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-system:1.0-alpha-1::jar" ) ); + addModel( model ); + + model = toModel( "taglibs:standard:1.1.2" ); + addModel( model ); + + model = toModel( "javax.servlet:jstl:1.1.2" ); + model.addDependency( toDependency( "javax.servlet:jsp-api:2.0::jar", "provided" ) ); + addModel( model ); + + model = toModel( "javax.servlet:jsp-api:2.0" ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar", "compile" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-xwork-integration:1.0-alpha-6" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.12" ) ); + model.addDependency( toDependency( "org.easymock:easymock:2.2::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-17::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-17::jar" ) ); + model.addDependency( toDependency( "opensymphony:xwork:1.2.1::jar" ) ); + model.addDependency( toDependency( "opensymphony:webwork:2.2.4::jar" ) ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar", "provided" ) ); + addModel( model ); + + model = toModel( "org.easymock:easymock:2.2" ); + addModel( model ); + + model = toModel( "opensymphony:xwork:1.2.1" ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.4::jar" ) ); + model.addDependency( toDependency( "org.rifers:rife-continuations:0.0.2::jar" ) ); + model.addDependency( toDependency( "opensymphony:oscore:2.2.4::jar" ) ); + model.addDependency( toDependency( "ognl:ognl:2.6.7::jar" ) ); + dep = toDependency( "org.springframework:spring-core:1.2.6::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "org.springframework:spring-aop:1.2.6::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "org.springframework:spring-beans:1.2.6::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "org.springframework:spring-context:1.2.6::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "org.springframework:spring-web:1.2.6::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "org.springframework:spring-mock:1.2.6::jar", "test" ) ); + dep = toDependency( "cglib:cglib:2.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependency( toDependency( "mockobjects:mockobjects-core:0.09::jar", "test" ) ); + model.addDependency( toDependency( "easymock:easymock:1.2_Java1.3::jar", "test" ) ); + model.addDependency( toDependency( "easymock:easymockclassextension:1.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.rifers:rife-continuations:0.0.2" ); + addModel( model ); + + model = toModel( "opensymphony:oscore:2.2.4" ); + addModel( model ); + + model = toModel( "ognl:ognl:2.6.7" ); + addModel( model ); + + model = toModel( "org.springframework:spring-core:1.2.6" ); + model.setParentProject( toParent( "org.springframework:spring-parent:1.2.6" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.4::jar" ) ); + dep = toDependency( "log4j:log4j:1.2.9::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "commons-collections:commons-collections:3.1::jar" ) ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar", "provided" ) ); + model.addDependency( toDependency( "xml-apis:xml-apis:1.0.b2::jar", "provided" ) ); + addModel( model ); + + model = toModel( "org.springframework:spring-parent:1.2.6" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependencyManagement( toDependency( "commons-logging:commons-logging:1.0.4::jar" ) ); + dep = toDependency( "log4j:log4j:1.2.9::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "cglib:cglib:2.1_3::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "commons-attributes:commons-attributes-compiler:2.1::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "org.hibernate:hibernate:3.0.5::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "org.hibernate:hibernate-annotations:3.0beta2::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "struts:struts:1.2.7::jar" ); + addExclusion( dep, "servletapi:servletapi" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "jasperreports:jasperreports:1.0.3::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "freemarker:freemarker:2.3.4::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + model.addDependencyManagement( toDependency( "javax.servlet:jsp-api:2.0::jar", "provided" ) ); + model.addDependencyManagement( toDependency( "javax.servlet:servlet-api:2.4::jar", "provided" ) ); + model.addDependencyManagement( toDependency( "aopalliance:aopalliance:1.0::jar" ) ); + model.addDependencyManagement( toDependency( "oro:oro:2.0.8::jar" ) ); + dep = toDependency( "commons-pool:commons-pool:1.2::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "com.jamonapi:jamon:1.0::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + model.addDependencyManagement( toDependency( "xdoclet:xjavadoc:1.1::jar" ) ); + model.addDependencyManagement( toDependency( "javax.mail:mail:1.3.2::jar" ) ); + dep = toDependency( "velocity:velocity:1.4::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + model.addDependencyManagement( toDependency( "commons-collections:commons-collections:3.1::jar" ) ); + model.addDependencyManagement( toDependency( "xml-apis:xml-apis:1.0.b2::jar", "provided" ) ); + model.addDependencyManagement( toDependency( "javax.transaction:jta:1.0.1B::jar" ) ); + dep = toDependency( "jotm:jotm:2.0.10::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "net.sf.hibernate:hibernate:2.1.8::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "c3p0:c3p0:0.9.0.2::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "commons-dbcp:commons-dbcp:1.2.1::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "com.experlog:xapool:1.5.0::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + model.addDependencyManagement( toDependency( "commons-lang:commons-lang:2.1::jar" ) ); + dep = toDependency( "com.oracle.toplink:toplink:10.1.3::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "ojb:db-ojb:1.0.3::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "javax.jdo:jdo:2.0-20050809.1515::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "com.ibatis:ibatis-sqlmap:1.3.1::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "com.ibatis:ibatis2-sqlmap:2.1.5.582::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "javax.jms:jms:1.1::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "javax.ejb:ejb:2.0::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "javax.xml:jaxrpc-api:1.1::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "commons-httpclient:commons-httpclient:3.0-rc4::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "com.caucho:burlap:2.1.12::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "com.caucho:hessian:2.1.12::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + model.addDependencyManagement( toDependency( "javax.resource:connector:1.0::jar" ) ); + model.addDependencyManagement( toDependency( "ehcache:ehcache:1.1::jar" ) ); + model.addDependencyManagement( toDependency( "quartz:quartz:1.5.1::jar" ) ); + model.addDependencyManagement( toDependency( "com.servlets:cos:05Nov2002::jar" ) ); + model.addDependencyManagement( toDependency( "easymock:easymock:1.2_RC2_Java1.3::jar", "test" ) ); + model.addDependencyManagement( toDependency( "javax.servlet:jstl:1.0::jar" ) ); + model.addDependencyManagement( toDependency( "taglibs:standard:1.0.6::jar" ) ); + dep = toDependency( "javax.faces:jsf-api:1.1::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "velocity-tools:velocity-tools-generic:1.1::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "velocity-tools:velocity-tools-view:1.1::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "poi:poi:2.5.1-final-20040804::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "itext:itext:1.3::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "net.sourceforge.jexcelapi:jxl:2.5.7::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + addModel( model ); + + model = toModel( "log4j:log4j:1.2.9" ); + addModel( model ); + + model = toModel( "cglib:cglib:2.1_3" ); + addModel( model ); + + model = toModel( "commons-attributes:commons-attributes-compiler:2.1" ); + model.addDependency( toDependency( "commons-attributes:commons-attributes-api:2.1::jar" ) ); + addModel( model ); + + model = toModel( "commons-attributes:commons-attributes-api:2.1" ); + model.addDependency( toDependency( "ant:ant:1.5::jar" ) ); + model.addDependency( toDependency( "qdox:qdox:1.5::jar" ) ); + addModel( model ); + + model = toModel( "ant:ant:1.5" ); + addModel( model ); + + model = toModel( "qdox:qdox:1.5" ); + addModel( model ); + + model = toModel( "org.hibernate:hibernate:3.0.5" ); + addModel( model ); + + model = toModel( "org.hibernate:hibernate-annotations:3.0beta2" ); + addModel( model ); + + model = toModel( "struts:struts:1.2.7" ); + addModel( model ); + + model = toModel( "jasperreports:jasperreports:1.0.3" ); + addModel( model ); + + model = toModel( "freemarker:freemarker:2.3.4" ); + addModel( model ); + + model = toModel( "aopalliance:aopalliance:1.0" ); + addModel( model ); + + model = toModel( "oro:oro:2.0.8" ); + addModel( model ); + + model = toModel( "com.jamonapi:jamon:1.0" ); + addModel( model ); + + model = toModel( "xdoclet:xjavadoc:1.1" ); + addModel( model ); + + model = toModel( "javax.mail:mail:1.3.2" ); + model.addDependency( toDependency( "javax.activation:activation:1.0.2::jar", "compile" ) ); + addModel( model ); + + model = toModel( "velocity:velocity:1.4" ); + model.addDependency( toDependency( "velocity:velocity-dep:1.4::jar", "runtime" ) ); + addModel( model ); + + model = toModel( "velocity:velocity-dep:1.4" ); + addModel( model ); + + model = toModel( "jotm:jotm:2.0.10" ); + addModel( model ); + + model = toModel( "c3p0:c3p0:0.9.0.2" ); + addModel( model ); + + model = toModel( "commons-dbcp:commons-dbcp:1.2.1" ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.1::jar" ) ); + model.addDependency( toDependency( "commons-pool:commons-pool:1.2::jar" ) ); + dep = toDependency( "javax.sql:jdbc-stdext:2.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "xml-apis:xml-apis:2.0.2::jar" ) ); + model.addDependency( toDependency( "xerces:xerces:2.0.2::jar" ) ); + addModel( model ); + + model = toModel( "com.experlog:xapool:1.5.0" ); + addModel( model ); + + model = toModel( "com.oracle.toplink:toplink:10.1.3" ); + addModel( model ); + + model = toModel( "ojb:db-ojb:1.0.3" ); + addModel( model ); + + model = toModel( "javax.jdo:jdo:2.0-20050809.1515" ); + addModel( model ); + + model = toModel( "com.ibatis:ibatis-sqlmap:1.3.1" ); + addModel( model ); + + model = toModel( "com.ibatis:ibatis2-sqlmap:2.1.5.582" ); + addModel( model ); + + model = toModel( "javax.jms:jms:1.1" ); + addModel( model ); + + model = toModel( "javax.ejb:ejb:2.0" ); + addModel( model ); + + model = toModel( "javax.xml:jaxrpc-api:1.1" ); + addModel( model ); + + model = toModel( "commons-httpclient:commons-httpclient:3.0-rc4" ); + addModel( model ); + + model = toModel( "com.caucho:burlap:2.1.12" ); + addModel( model ); + + model = toModel( "com.caucho:hessian:2.1.12" ); + addModel( model ); + + model = toModel( "ehcache:ehcache:1.1" ); + addModel( model ); + + model = toModel( "quartz:quartz:1.5.1" ); + addModel( model ); + + model = toModel( "com.servlets:cos:05Nov2002" ); + addModel( model ); + + model = toModel( "easymock:easymock:1.2_RC2_Java1.3" ); + addModel( model ); + + model = toModel( "javax.servlet:jstl:1.0" ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.3::jar", "provided" ) ); + addModel( model ); + + model = toModel( "taglibs:standard:1.0.6" ); + addModel( model ); + + model = toModel( "javax.faces:jsf-api:1.1" ); + addModel( model ); + + model = toModel( "velocity-tools:velocity-tools-generic:1.1" ); + addModel( model ); + + model = toModel( "velocity-tools:velocity-tools-view:1.1" ); + addModel( model ); + + model = toModel( "poi:poi:2.5.1-final-20040804" ); + addModel( model ); + + model = toModel( "itext:itext:1.3" ); + addModel( model ); + + model = toModel( "net.sourceforge.jexcelapi:jxl:2.5.7" ); + addModel( model ); + + model = toModel( "org.springframework:spring-aop:1.2.6" ); + model.setParentProject( toParent( "org.springframework:spring-parent:1.2.6" ) ); + model.addDependency( toDependency( "org.springframework:spring-beans:1.2.6::jar" ) ); + model.addDependency( toDependency( "aopalliance:aopalliance:1.0::jar" ) ); + model.addDependency( toDependency( "oro:oro:2.0.8::jar" ) ); + dep = toDependency( "commons-pool:commons-pool:1.2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "commons-attributes:commons-attributes-compiler:2.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "com.jamonapi:jamon:1.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "cglib:cglib:2.1_3::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "xdoclet:xjavadoc:1.1::jar", "test" ) ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar", "provided" ) ); + addModel( model ); + + model = toModel( "org.springframework:spring-beans:1.2.6" ); + model.setParentProject( toParent( "org.springframework:spring-parent:1.2.6" ) ); + model.addDependency( toDependency( "org.springframework:spring-core:1.2.6::jar" ) ); + dep = toDependency( "cglib:cglib:2.1_3::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar", "provided" ) ); + model.addDependency( toDependency( "javax.mail:mail:1.3.2::jar", "test" ) ); + model.addDependency( toDependency( "org.hibernate:hibernate:3.0.5::jar", "test" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.springframework:spring-context:1.2.6" ); + model.setParentProject( toParent( "org.springframework:spring-parent:1.2.6" ) ); + model.addDependency( toDependency( "org.springframework:spring-aop:1.2.6::jar" ) ); + dep = toDependency( "velocity:velocity:1.4::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "freemarker:freemarker:2.3.4::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "jasperreports:jasperreports:1.0.3::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "org.springframework:spring-web:1.2.6" ); + model.setParentProject( toParent( "org.springframework:spring-parent:1.2.6" ) ); + model.addDependency( toDependency( "javax.servlet:jsp-api:2.0::jar", "provided" ) ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar", "provided" ) ); + model.addDependency( toDependency( "javax.servlet:jstl:1.0::jar" ) ); + model.addDependency( toDependency( "org.springframework:spring-context:1.2.6::jar" ) ); + dep = toDependency( "log4j:log4j:1.2.9::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "struts:struts:1.2.7::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "com.servlets:cos:05Nov2002::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "taglibs:standard:1.0.6::jar" ) ); + dep = toDependency( "javax.faces:jsf-api:1.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "org.springframework:spring-mock:1.2.6" ); + model.setParentProject( toParent( "org.springframework:spring-parent:1.2.6" ) ); + dep = toDependency( "org.springframework:spring-jdbc:1.2.6::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "org.springframework:spring-web:1.2.6::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "javax.servlet:jsp-api:2.0::jar", "provided" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + addModel( model ); + + model = toModel( "org.springframework:spring-jdbc:1.2.6" ); + addModel( model ); + + model = toModel( "cglib:cglib:2.1" ); + model.addDependency( toDependency( "asm:asm:1.5.3::jar" ) ); + model.addDependency( toDependency( "asm:asm-util:1.3.4::jar" ) ); + model.addDependency( toDependency( "aspectwerkz:aspectwerkz-core:0.8.1::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + addModel( model ); + + model = toModel( "asm:asm:1.5.3" ); + addModel( model ); + + model = toModel( "asm:asm-util:1.3.4" ); + addModel( model ); + + model = toModel( "aspectwerkz:aspectwerkz-core:0.8.1" ); + addModel( model ); + + model = toModel( "easymock:easymockclassextension:1.1" ); + addModel( model ); + + model = toModel( "opensymphony:webwork:2.2.4" ); + model.addDependency( toDependency( "opensymphony:xwork:1.2.1::jar" ) ); + dep = toDependency( "opensymphony:xwork-tiger:1.2.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "freemarker:freemarker:2.3.4::jar" ) ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar", "provided" ) ); + model.addDependency( toDependency( "javax.servlet:jsp-api:2.0::jar", "provided" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.4::jar" ) ); + dep = toDependency( "commons-lang:commons-lang:2.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "dwr:dwr:1.1-beta-3::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "velocity:velocity:1.4::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "velocity-tools:velocity-tools:1.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "commons-fileupload:commons-fileupload:1.1.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "servlets.com:cos:05Nov2002::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "opensymphony:pell-multipart:2.1.5::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "opensymphony:sitemesh:2.2.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "jetty:org.mortbay.jetty:5.1.4::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "eclipse:jdtcore:3.1.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "jasperreports:jasperreports:1.1.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "jfree:jfreechart:1.0.0::jar" ); + addExclusion( dep, "gnujaxp:gnujaxp" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "org.apache.struts.tiles:tiles-core:0.2-SNAPSHOT::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "commons-digester:commons-digester:1.7::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "portlet-api:portlet-api:1.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "org.apache.pluto:pluto:1.0.1-rc4::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-10-SNAPSHOT::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "picocontainer:picocontainer:1.2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "picocontainer:picocontainer-gems:1.2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "nanocontainer:nanocontainer:1.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "nanocontainer:nanocontainer-nanowar:1.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "org.springframework:spring-beans:1.2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "org.springframework:spring-core:1.2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "org.springframework:spring-context:1.2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "org.springframework:spring-web:1.2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "org.springframework:spring-mock:1.2::jar", "compile" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "xpp3:xpp3:1.1.3.4-RC8::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "junit:junit:3.8.1::jar", "compile" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "jmock:jmock:1.0.1::jar", "test" ) ); + model.addDependency( toDependency( "easymock:easymock:1.2_Java1.3::jar", "test" ) ); + model.addDependency( toDependency( "easymock:easymockclassextension:1.1::jar", "test" ) ); + model.addDependency( toDependency( "jmock:jmock-cglib:1.0.1::jar", "test" ) ); + model.addDependency( toDependency( "mockobjects:mockobjects-core:0.09::jar", "test" ) ); + model.addDependency( toDependency( "mockobjects:mockobjects-jdk1.3:0.09::jar", "test" ) ); + model.addDependency( toDependency( "mockobjects:mockobjects-alt-jdk1.3:0.09::jar", "test" ) ); + model.addDependency( toDependency( "mockobjects:mockobjects-alt-jdk1.3-j2ee1.3:0.09::jar", "test" ) ); + model.addDependency( toDependency( "mockobjects:mockobjects-jdk1.3-j2ee1.3:0.09::jar", "test" ) ); + addModel( model ); + + model = toModel( "opensymphony:xwork-tiger:1.2.1" ); + addModel( model ); + + model = toModel( "commons-lang:commons-lang:2.0" ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + addModel( model ); + + model = toModel( "dwr:dwr:1.1-beta-3" ); + addModel( model ); + + model = toModel( "velocity-tools:velocity-tools:1.1" ); + addModel( model ); + + model = toModel( "commons-fileupload:commons-fileupload:1.1.1" ); + addModel( model ); + + model = toModel( "servlets.com:cos:05Nov2002" ); + addModel( model ); + + model = toModel( "opensymphony:pell-multipart:2.1.5" ); + addModel( model ); + + model = toModel( "opensymphony:sitemesh:2.2.1" ); + addModel( model ); + + model = toModel( "jetty:org.mortbay.jetty:5.1.4" ); + addModel( model ); + + model = toModel( "eclipse:jdtcore:3.1.0" ); + addModel( model ); + + model = toModel( "jasperreports:jasperreports:1.1.0" ); + addModel( model ); + + model = toModel( "jfree:jfreechart:1.0.0" ); + addModel( model ); + + model = toModel( "org.apache.struts.tiles:tiles-core:0.2-SNAPSHOT" ); + addModel( model ); + + model = toModel( "commons-digester:commons-digester:1.7" ); + model.addDependency( toDependency( "commons-beanutils:commons-beanutils:1.6::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.1::jar" ) ); + model.addDependency( toDependency( "xml-apis:xml-apis:1.0.b2::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "portlet-api:portlet-api:1.0" ); + addModel( model ); + + model = toModel( "org.apache.pluto:pluto:1.0.1-rc4" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-container-default:1.0-alpha-10-SNAPSHOT" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0.6-SNAPSHOT" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.2::jar" ) ); + model.addDependency( toDependency( "classworlds:classworlds:1.1::jar" ) ); + model.addDependency( toDependency( "jmock:jmock:1.0.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-containers:1.0.6-SNAPSHOT" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.8-SNAPSHOT" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus:1.0.8-SNAPSHOT" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "picocontainer:picocontainer:1.2" ); + addModel( model ); + + model = toModel( "picocontainer:picocontainer-gems:1.2" ); + addModel( model ); + + model = toModel( "nanocontainer:nanocontainer:1.0" ); + addModel( model ); + + model = toModel( "nanocontainer:nanocontainer-nanowar:1.0" ); + addModel( model ); + + model = toModel( "org.springframework:spring-beans:1.2" ); + addModel( model ); + + model = toModel( "org.springframework:spring-core:1.2" ); + addModel( model ); + + model = toModel( "org.springframework:spring-context:1.2" ); + addModel( model ); + + model = toModel( "org.springframework:spring-web:1.2" ); + addModel( model ); + + model = toModel( "org.springframework:spring-mock:1.2" ); + addModel( model ); + + model = toModel( "xpp3:xpp3:1.1.3.4-RC8" ); + addModel( model ); + + model = toModel( "jmock:jmock-cglib:1.0.1" ); + model.addDependency( toDependency( "jmock:jmock:1.0.1::jar" ) ); + model.addDependency( toDependency( "cglib:cglib-full:2.0::jar" ) ); + addModel( model ); + + model = toModel( "cglib:cglib-full:2.0" ); + addModel( model ); + + model = toModel( "mockobjects:mockobjects-jdk1.3:0.09" ); + addModel( model ); + + model = toModel( "mockobjects:mockobjects-alt-jdk1.3:0.09" ); + addModel( model ); + + model = toModel( "mockobjects:mockobjects-alt-jdk1.3-j2ee1.3:0.09" ); + addModel( model ); + + model = toModel( "mockobjects:mockobjects-jdk1.3-j2ee1.3:0.09" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-mail-sender-api:1.0-alpha-6" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-mail-sender:1.0-alpha-6" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-mail-sender:1.0-alpha-6" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.9" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-mail-sender-javamail:1.0-alpha-6" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-mail-senders:1.0-alpha-6" ) ); + model.addDependency( toDependency( "javax.mail:mail:1.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-mail-sender-test:1.0-alpha-6::jar", "test" ) ); + dep = toDependency( "org.codehaus.plexus:plexus-naming:1.0-alpha-1::jar", "test" ); + addExclusion( dep, "geronimo-spec:geronimo-spec-javamail" ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-mail-senders:1.0-alpha-6" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-mail-sender:1.0-alpha-6" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-mail-sender-api:1.0-alpha-6::jar" ) ); + addModel( model ); + + model = toModel( "javax.mail:mail:1.4" ); + model.addDependency( toDependency( "javax.activation:activation:1.1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-mail-sender-test:1.0-alpha-6" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-mail-senders:1.0-alpha-6" ) ); + model.addDependency( toDependency( "dumbster:dumbster:1.5::jar" ) ); + addModel( model ); + + model = toModel( "dumbster:dumbster:1.5" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-naming:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.6" ) ); + model.addDependency( toDependency( "directory-naming:naming-core:0.8::jar" ) ); + model.addDependency( toDependency( "directory-naming:naming-java:0.8::jar" ) ); + model.addDependency( toDependency( "directory-naming:naming-factory:0.8::jar" ) ); + model.addDependency( toDependency( "commons-dbcp:commons-dbcp:1.2.1::jar" ) ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.7.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "directory-naming:naming-core:0.8" ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.3::jar" ) ); + addModel( model ); + + model = toModel( "directory-naming:naming-java:0.8" ); + model.addDependency( toDependency( "directory-naming:naming-core:0.8::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.3::jar" ) ); + addModel( model ); + + model = toModel( "directory-naming:naming-factory:0.8" ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.3::jar" ) ); + model.addDependency( toDependency( "directory-naming:naming-core:0.8::jar" ) ); + model.addDependency( toDependency( "geronimo-spec:geronimo-spec-javamail:1.3.1-rc1::jar" ) ); + addModel( model ); + + model = toModel( "geronimo-spec:geronimo-spec-javamail:1.3.1-rc1" ); + addModel( model ); + + model = toModel( "hsqldb:hsqldb:1.7.1" ); + addModel( model ); + + model = toModel( "org.extremecomponents:extremecomponents:1.0.1" ); + dep = toDependency( "avalon-framework:avalon-framework:4.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "batik:batik:1.5-fop-0.20-5::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "commons-beanutils:commons-beanutils:1.7.0::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:3.0::jar" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:2.0::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.4::jar" ) ); + dep = toDependency( "fop:fop:0.20.5::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + dep = toDependency( "poi:poi:2.5.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "servletapi:servletapi:2.3::jar", "provided" ) ); + model.addDependency( toDependency( "taglibs:standard:1.0.2::jar" ) ); + dep = toDependency( "xalan:xalan:2.5.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "xerces:xercesImpl:2.6.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "xml-apis:xml-apis:2.0.2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "avalon-framework:avalon-framework:4.0" ); + addModel( model ); + + model = toModel( "batik:batik:1.5-fop-0.20-5" ); + addModel( model ); + + model = toModel( "commons-collections:commons-collections:3.0" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "fop:fop:0.20.5" ); + addModel( model ); + + model = toModel( "poi:poi:2.5.1" ); + model.setRelocation( new VersionedReference() ); + model.getRelocation().setGroupId( "poi" ); + model.getRelocation().setArtifactId( "poi" ); + model.getRelocation().setVersion( "2.5.1-final-20040804" ); + addModel( model ); + + model = toModel( "taglibs:standard:1.0.2" ); + addModel( model ); + + model = toModel( "xalan:xalan:2.5.1" ); + addModel( model ); + + model = toModel( "xerces:xercesImpl:2.6.1" ); + addModel( model ); + + model = toModel( "commons-beanutils:commons-beanutils-bean-collections:1.7.0" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-velocity:1.1.2" ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-7::jar", "compile" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "classworlds:classworlds:1.1-alpha-2::jar", "compile" ) ); + model.addDependency( toDependency( "plexus:plexus-utils:1.0.2::jar", "compile" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.0::jar", "compile" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging-api:1.0.4::jar", "compile" ) ); + model.addDependency( toDependency( "velocity:velocity:1.4::jar", "compile" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-taglib:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-integrations:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-system:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-xwork-integration:1.0-alpha-6::jar" ) ); + model.addDependency( toDependency( "taglibs:standard:1.1.2::jar" ) ); + model.addDependency( toDependency( "javax.servlet:jstl:1.1.2::jar" ) ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar", "provided" ) ); + model.addDependency( toDependency( "javax.servlet:jsp-api:2.0::jar", "provided" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-xwork-content:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-xwork:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-xwork-integration:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-taglib:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "xml-apis:xml-apis:1.3.03" ); + model.setParentProject( toParent( "org.apache:apache:1" ) ); + addModel( model ); + + model = toModel( "org.apache:apache:1" ); + addModel( model ); + + model = toModel( "org.codehaus.woodstox:wstx-asl:3.2.1" ); + model.addDependency( toDependency( "stax:stax-api:1.0.1::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-signature-consumers:1.0-alpha-2-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.archiva:archiva-consumers:1.0-alpha-2-SNAPSHOT" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.shared:maven-app-configuration-model:1.0" ); + model.setParentProject( toParent( "org.apache.maven.shared:maven-app-configuration:1.0" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-api:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-20::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.shared:maven-app-configuration:1.0" ); + model.setParentProject( toParent( "org.apache.maven.shared:maven-shared-components:7" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.shared:maven-app-configuration-web:1.0" ); + model.setParentProject( toParent( "org.apache.maven.shared:maven-app-configuration:1.0" ) ); + model.addDependency( toDependency( "org.apache.maven.shared:maven-app-configuration-model:1.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-project:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-http-lightweight:1.0-beta-2::jar", "runtime" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-20::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-project:2.0.4" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.4" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-settings:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact-test:2.0.4::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-profile:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-model:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact-manager:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-settings:2.0.4" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.4" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-model:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-artifact-test:2.0.4" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.4" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-settings:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact-manager:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-artifact-manager:2.0.4" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.4" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-repository-metadata:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-file:1.0-alpha-7::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-alpha-6::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-repository-metadata:2.0.4" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.4" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-artifact:2.0.4" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.4" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-profile:2.0.4" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.4" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-model:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.webdav:plexus-webdav-simple:1.0-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus.webdav:plexus-webdav-providers-parent:1.0-alpha-2" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:2.1::jar" ) ); + model.addDependency( toDependency( "it.could:webdav:0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.webdav:plexus-webdav-providers-parent:1.0-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus.webdav:plexus-webdav-parent:1.0-alpha-2" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.webdav:plexus-webdav-api:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.webdav:plexus-webdav-test:1.0-alpha-2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.webdav:plexus-webdav-parent:1.0-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.12" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.webdav:plexus-webdav-api:1.0-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus.webdav:plexus-webdav-parent:1.0-alpha-2" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-20::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-20::jar" ) ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.3::jar" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:2.1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.webdav:plexus-webdav-test:1.0-alpha-2" ); + addModel( model ); + + model = toModel( "it.could:webdav:0.4" ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.3::jar", "runtime" ) ); + addModel( model ); + + model = toModel( "dom4j:dom4j:1.6.1" ); + dep = toDependency( "jaxme:jaxme-api:0.3::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "jaxen:jaxen:1.1-beta-6::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "msv:xsdlib:20030807::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "msv:relaxngDatatype:20030807::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "pull-parser:pull-parser:2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "xpp3:xpp3:1.1.3.3::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "stax:stax-api:1.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "xml-apis:xml-apis:1.0.b2::jar" ) ); + model.addDependency( toDependency( "junitperf:junitperf:1.8::jar", "test" ) ); + model.addDependency( toDependency( "stax:stax-ri:1.0::jar", "test" ) ); + model.addDependency( toDependency( "xerces:xercesImpl:2.6.2::jar", "test" ) ); + model.addDependency( toDependency( "xalan:xalan:2.5.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "jaxme:jaxme-api:0.3" ); + addModel( model ); + + model = toModel( "jaxen:jaxen:1.1-beta-6" ); + addModel( model ); + + model = toModel( "msv:xsdlib:20030807" ); + addModel( model ); + + model = toModel( "msv:relaxngDatatype:20030807" ); + addModel( model ); + + model = toModel( "xpp3:xpp3:1.1.3.3" ); + addModel( model ); + + model = toModel( "stax:stax-api:1.0" ); + addModel( model ); + + model = toModel( "stax:stax-ri:1.0" ); + addModel( model ); + + model = toModel( "jaxen:jaxen:1.1" ); + model.addDependency( toDependency( "dom4j:dom4j:1.6.1::jar" ) ); + model.addDependency( toDependency( "jdom:jdom:1.0::jar" ) ); + model.addDependency( toDependency( "xml-apis:xml-apis:1.3.02::jar" ) ); + model.addDependency( toDependency( "xerces:xercesImpl:2.6.2::jar" ) ); + model.addDependency( toDependency( "xom:xom:1.0::jar" ) ); + addModel( model ); + + model = toModel( "jdom:jdom:1.0" ); + dep = toDependency( "xerces:xercesImpl:2.6.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "xml-apis:xml-apis:1.0.b2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "jaxen:jaxen:1.0-FCS::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "saxpath:saxpath:1.0-FCS::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "xalan:xalan:2.5.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "xalan:xalan:2.5.0" ); + addModel( model ); + + model = toModel( "xml-apis:xml-apis:1.3.02" ); + addModel( model ); + + model = toModel( "xom:xom:1.0" ); + model.addDependency( toDependency( "xerces:xmlParserAPIs:2.6.2::jar" ) ); + model.addDependency( toDependency( "xerces:xercesImpl:2.6.2::jar" ) ); + model.addDependency( toDependency( "xalan:xalan:2.6.0::jar" ) ); + model.addDependency( toDependency( "com.ibm.icu:icu4j:2.6.1::jar" ) ); + addModel( model ); + + model = toModel( "xerces:xmlParserAPIs:2.6.2" ); + addModel( model ); + + model = toModel( "xalan:xalan:2.6.0" ); + model.addDependency( toDependency( "xml-apis:xml-apis:2.0.2::jar" ) ); + dep = toDependency( "xerces:xercesImpl:2.6.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "com.ibm.icu:icu4j:2.6.1" ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-model:2.0.5" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.5" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-project:2.0.5" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.5" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-settings:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact-test:2.0.5::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-profile:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-model:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact-manager:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-settings:2.0.5" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.5" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-model:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-artifact-test:2.0.5" ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-profile:2.0.5" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.5" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-model:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-appserver-host:2.0-alpha-8" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-appserver:2.0-alpha-8" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-20::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-20::jar" ) ); + model.addDependency( toDependency( "mx4j:mx4j:3.0.1::jar" ) ); + model.addDependency( toDependency( "mx4j:mx4j-remote:3.0.1::jar" ) ); + model.addDependency( toDependency( "org.livetribe:livetribe-slp:1.0.2::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-appserver:2.0-alpha-8" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.11" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-20::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-20::jar" ) ); + addModel( model ); + + model = toModel( "mx4j:mx4j:3.0.1" ); + addModel( model ); + + model = toModel( "mx4j:mx4j-remote:3.0.1" ); + addModel( model ); + + model = toModel( "org.livetribe:livetribe-slp:1.0.2" ); + model.setParentProject( toParent( "org.livetribe:livetribe:1.0" ) ); + model.addDependency( toDependency( "backport-util-concurrent:backport-util-concurrent:2.2::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.livetribe:livetribe:1.0" ); + addModel( model ); + + model = toModel( "backport-util-concurrent:backport-util-concurrent:2.2" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-appserver-service-jetty:2.0-alpha-8" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-appserver-services:2.0-alpha-8" ) ); + model.addDependency( toDependency( "ant:ant:1.6.2::jar" ) ); + model.addDependency( toDependency( "jetty:org.mortbay.jetty:5.1.10::jar" ) ); + model.addDependency( toDependency( "tomcat:jasper-compiler:5.5.15::jar" ) ); + model.addDependency( toDependency( "tomcat:jasper-runtime:5.5.15::jar" ) ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar" ) ); + model.addDependency( toDependency( "javax.servlet:jsp-api:2.0::jar" ) ); + dep = toDependency( "commons-el:commons-el:1.0::jar", "runtime" ); + addExclusion( dep, "log4j:log4j" ); + addExclusion( dep, "commons-logging:commons-logging" ); + addExclusion( dep, "logkit:logkit" ); + model.addDependency( dep ); + model.addDependency( toDependency( "jetty:org.mortbay.jetty.plus:5.1.10::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging-api:1.0.4::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.derby:derby:10.1.3.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-appserver-services:2.0-alpha-8" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-appserver:2.0-alpha-8" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-appserver-host:2.0-alpha-8::jar" ) ); + addModel( model ); + + model = toModel( "ant:ant:1.6.2" ); + dep = toDependency( "xerces:xerces-impl:2.6.2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "xml-apis:xml-apis:2.6.2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "xerces:xerces-impl:2.6.2" ); + addModel( model ); + + model = toModel( "xml-apis:xml-apis:2.6.2" ); + addModel( model ); + + model = toModel( "jetty:org.mortbay.jetty:5.1.10" ); + addModel( model ); + + model = toModel( "tomcat:jasper-compiler:5.5.15" ); + model.setParentProject( toParent( "tomcat:tomcat-parent:5.5.15" ) ); + model.addDependency( toDependency( "javax.servlet:jsp-api:2.0::jar" ) ); + model.addDependency( toDependency( "ant:ant:1.6.5::jar" ) ); + addModel( model ); + + model = toModel( "tomcat:tomcat-parent:5.5.15" ); + model.setParentProject( toParent( "org.apache:apache:3" ) ); + model.addDependencyManagement( toDependency( "commons-logging:commons-logging-api:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "ant:ant:1.6.5" ); + dep = toDependency( "xerces:xerces-impl:2.6.2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "xml-apis:xml-apis:2.6.2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "tomcat:jasper-runtime:5.5.15" ); + model.setParentProject( toParent( "tomcat:tomcat-parent:5.5.15" ) ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar" ) ); + model.addDependency( toDependency( "commons-el:commons-el:1.0::jar" ) ); + addModel( model ); + + model = toModel( "commons-el:commons-el:1.0" ); + model.addDependency( toDependency( "servletapi:servletapi:2.4-20040521::jar", "provided" ) ); + model.addDependency( toDependency( "jspapi:jsp-api:2.0-20040521::jar", "provided" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.3::jar" ) ); + addModel( model ); + + model = toModel( "servletapi:servletapi:2.4-20040521" ); + addModel( model ); + + model = toModel( "jspapi:jsp-api:2.0-20040521" ); + addModel( model ); + + model = toModel( "jetty:org.mortbay.jetty.plus:5.1.10" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-cli:1.1" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-tools:1.0.8" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-5::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-14::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + dep = toDependency( "commons-cli:commons-cli:1.0::jar" ); + addExclusion( dep, "commons-lang:commons-lang" ); + addExclusion( dep, "commons-logging:commons-logging" ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-tools:1.0.8" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.9" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-14::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-container-default:1.0-alpha-14" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0-alpha-14" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-13::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.3::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-5::jar" ) ); + model.addDependency( toDependency( "jmock:jmock:1.0.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-containers:1.0-alpha-14" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.9" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-5::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-13::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.3::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-5" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.9" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-component-api:1.0-alpha-13" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0.7-alpha-3" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-5::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-containers:1.0.7-alpha-3" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.9" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-5::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-13::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.3::jar" ) ); + addModel( model ); + + model = toModel( "commons-cli:commons-cli:1.0" ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0::jar" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:1.0::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + addModel( model ); + + model = toModel( "commons-lang:commons-lang:1.0" ); + model.addDependency( toDependency( "junit:junit:3.7::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-command-line:1.0-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.4" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-naming:1.0-alpha-3" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.9" ) ); + model.addDependency( toDependency( "directory-naming:naming-core:0.8::jar" ) ); + model.addDependency( toDependency( "directory-naming:naming-java:0.8::jar" ) ); + model.addDependency( toDependency( "directory-naming:naming-factory:0.8::jar" ) ); + model.addDependency( toDependency( "directory-naming:naming-config:0.8::jar" ) ); + model.addDependency( toDependency( "commons-dbcp:commons-dbcp:1.2.1::jar" ) ); + model.addDependency( toDependency( "commons-pool:commons-pool:1.2::jar" ) ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.7.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "directory-naming:naming-config:0.8" ); + model.addDependency( toDependency( "directory-naming:naming-core:0.8::jar" ) ); + model.addDependency( toDependency( "directory-naming:naming-factory:0.8::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.3::jar" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:1.0.1::jar" ) ); + model.addDependency( toDependency( "commons-digester:commons-digester:1.4.1::jar" ) ); + model.addDependency( toDependency( "directory-naming:naming-java:0.8::jar" ) ); + model.addDependency( toDependency( "commons-beanutils:commons-beanutils:1.6.1::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:3.1::jar" ) ); + model.addDependency( toDependency( "commons-dbcp:commons-dbcp:1.0::jar" ) ); + model.addDependency( toDependency( "commons-pool:commons-pool:1.0.1::jar" ) ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.7.1::jar" ) ); + addModel( model ); + + model = toModel( "commons-lang:commons-lang:1.0.1" ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + addModel( model ); + + model = toModel( "commons-digester:commons-digester:1.4.1" ); + model.addDependency( toDependency( "commons-beanutils:commons-beanutils:1.6::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.1::jar" ) ); + model.addDependency( toDependency( "xml-apis:xml-apis:2.0.2::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + addModel( model ); + + model = toModel( "commons-beanutils:commons-beanutils:1.6.1" ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.0::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + addModel( model ); + + model = toModel( "commons-dbcp:commons-dbcp:1.0" ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.0::jar" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:1.0-b1::jar" ) ); + model.addDependency( toDependency( "commons-pool:commons-pool:1.0::jar" ) ); + model.addDependency( toDependency( "jdbc:jdbc:2.0::jar" ) ); + model.addDependency( toDependency( "xml-apis:xml-apis:2.0.2::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.7::jar" ) ); + addModel( model ); + + model = toModel( "commons-lang:commons-lang:1.0-b1" ); + addModel( model ); + + model = toModel( "commons-pool:commons-pool:1.0" ); + addModel( model ); + + model = toModel( "jdbc:jdbc:2.0" ); + model.setRelocation( new VersionedReference() ); + model.getRelocation().setGroupId( "javax.sql" ); + model.getRelocation().setArtifactId( "jdbc-stdext" ); + model.getRelocation().setVersion( "2.0" ); + addModel( model ); + + model = toModel( "commons-pool:commons-pool:1.0.1" ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.0::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + addModel( model ); + + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/ContinuumStoreDependencyGraphTest.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/ContinuumStoreDependencyGraphTest.java new file mode 100644 index 000000000..e55bf17d1 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/ContinuumStoreDependencyGraphTest.java @@ -0,0 +1,98 @@ +package org.apache.maven.archiva.dependency.graph; + +/* + * 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.archiva.dependency.DependencyGraphFactory; +import org.apache.maven.archiva.model.DependencyScope; +import org.apache.maven.archiva.model.VersionedReference; + +import java.util.ArrayList; +import java.util.List; + +/** + * ContinuumStoreDependencyGraphTest + * + * DependencyGraphTest for testing org.apache.maven.continuum:continuum-store:1.1-SNAPSHOT + * + * Generated by archivadev:generate-dependency-tests plugin + * @version $Id$ + */ +public class ContinuumStoreDependencyGraphTest + extends AbstractDependencyGraphFactoryTestCase +{ + public void testResolvedDepsToNodes() + throws GraphTaskException + { + MemoryRepositoryDependencyGraphBuilder graphBuilder = + new MemoryRepositoryDependencyGraphBuilder(); + MemoryRepository repository = new ContinuumStoreMemoryRepository(); + graphBuilder.setMemoryRepository( repository ); + + // Create the factory, and add the test resolver. + DependencyGraphFactory factory = new DependencyGraphFactory(); + factory.setGraphBuilder( graphBuilder ); + factory.setDesiredScope( DependencyScope.TEST ); + + // Get the model to resolve from + VersionedReference rootRef = toVersionedReference( "org.apache.maven.continuum:continuum-store:1.1-SNAPSHOT"); + + // Perform the resolution. + DependencyGraph graph = factory.getGraph( rootRef ); + + // Test the results. + assertNotNull( "Graph shouldn't be null.", graph ); + + String expectedRootRef = "org.apache.maven.continuum:continuum-store:1.1-SNAPSHOT"; + List expectedNodes = new ArrayList(); + + // Check for all nodes, regardless of scope. + expectedNodes.clear(); + expectedNodes.add( "ant:ant:1.6::jar" ); + expectedNodes.add( "geronimo-spec:geronimo-spec-jta:1.0.1B-rc2::jar" ); + expectedNodes.add( "hsqldb:hsqldb:1.7.3.3::jar" ); + expectedNodes.add( "jakarta-regexp:jakarta-regexp:1.4::jar" ); + expectedNodes.add( "javax.jdo:jdo2-api:2.0::jar" ); + expectedNodes.add( "javax.resource:connector:1.0::jar" ); + expectedNodes.add( "javax.transaction:jta:1.0.1B::jar" ); + expectedNodes.add( "jmock:jmock:1.0.1::jar" ); + expectedNodes.add( "jpox:jpox:1.1.7::jar" ); + expectedNodes.add( "jpox:jpox-enhancer:1.1.7::jar" ); + expectedNodes.add( "junit:junit:3.8.1::jar" ); + expectedNodes.add( "log4j:log4j:1.2.8::jar" ); + expectedNodes.add( "net.java.dev.stax-utils:stax-utils:20060502::jar" ); + expectedNodes.add( "ognl:ognl:2.6.7::jar" ); + expectedNodes.add( "org.apache.bcel:bcel:5.2::jar" ); + expectedNodes.add( "org.apache.maven.continuum:continuum-api:1.1-SNAPSHOT::jar" ); + expectedNodes.add( "org.apache.maven.continuum:continuum-model:1.1-SNAPSHOT::jar" ); + expectedNodes.add( "org.apache.maven.continuum:continuum-test:1.1-SNAPSHOT::jar" ); + expectedNodes.add( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ); + expectedNodes.add( "org.codehaus.plexus:plexus-component-api:1.0-alpha-20::jar" ); + expectedNodes.add( "org.codehaus.plexus:plexus-container-default:1.0-alpha-20::jar" ); + expectedNodes.add( "org.codehaus.plexus:plexus-formica:1.0-beta-13::jar" ); + expectedNodes.add( "org.codehaus.plexus:plexus-i18n:1.0-beta-6::jar" ); + expectedNodes.add( "org.codehaus.plexus:plexus-jdo2:1.0-alpha-8::jar" ); + expectedNodes.add( "org.codehaus.plexus:plexus-utils:1.4::jar" ); + expectedNodes.add( "oro:oro:2.0.6::jar" ); + expectedNodes.add( "stax:stax-api:1.0.1::jar" ); + + assertGraph( graph, expectedRootRef, expectedNodes ); + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/ContinuumStoreMemoryRepository.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/ContinuumStoreMemoryRepository.java new file mode 100644 index 000000000..0ca081578 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/ContinuumStoreMemoryRepository.java @@ -0,0 +1,4142 @@ +package org.apache.maven.archiva.dependency.graph; + +/* + * 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.archiva.model.ArchivaProjectModel; +import org.apache.maven.archiva.model.Dependency; +import org.apache.maven.archiva.model.VersionedReference; + +/** + * ContinuumStoreMemoryRepository + * + * MemoryRepository for testing org.apache.maven.continuum:continuum-store:1.1-SNAPSHOT + * + * Generated by archivadev:generate-dependency-tests plugin + * @version $Id$ + */ +public class ContinuumStoreMemoryRepository + extends AbstractMemoryRepository +{ + public void initialize() + { + ArchivaProjectModel model; + Dependency dep; + + model = toModel( "org.apache.maven.continuum:continuum-store:1.1-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.continuum:continuum-parent:1.1-SNAPSHOT" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "jmock:jmock:1.0.1::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-20::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-20::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-jdo2:1.0-alpha-8::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.continuum:continuum-test:1.1-SNAPSHOT::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven.continuum:continuum-model:1.1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.continuum:continuum-api:1.1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.7.3.3::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + dep = toDependency( "org.apache.maven:maven-core:2.0.5::jar" ); + addExclusion( dep, "classworlds:classworlds" ); + model.addDependencyManagement( dep ); + model.addDependencyManagement( toDependency( "org.apache.maven:maven-model:2.0.5::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven:maven-artifact:2.0.5::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven:maven-artifact-manager:2.0.5::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven:maven-project:2.0.5::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven:maven-settings:2.0.5::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.scm:maven-scm-api:1.0::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.scm:maven-scm-manager-plexus:1.0::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.scm:maven-scm-provider-bazaar:1.0::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.scm:maven-scm-provider-clearcase:1.0::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.scm:maven-scm-provider-cvsjava:1.0::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.scm:maven-scm-provider-cvsexe:1.0::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.scm:maven-scm-provider-hg:1.0::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.scm:maven-scm-provider-local:1.0::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.scm:maven-scm-provider-perforce:1.0::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.scm:maven-scm-provider-starteam:1.0::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.scm:maven-scm-provider-svnexe:1.0::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.scm:maven-scm-provider-synergy:1.0::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.scm:maven-scm-provider-vss:1.0::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-file:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-http-lightweight:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh-external:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-webdav:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.continuum:continuum-model:1.1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.continuum:continuum-api:1.1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.continuum:continuum-configuration:1.1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.continuum:continuum-store:1.1-SNAPSHOT:tests:jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.continuum:continuum-store:1.1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.continuum:continuum-core:1.1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.continuum:continuum-test:1.1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.continuum:continuum-web:1.1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.continuum:continuum-xmlrpc-api:1.1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.continuum:continuum-xmlrpc-client:1.1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.continuum:continuum-xmlrpc-server:1.1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.continuum:continuum-plexus-application:1.1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.continuum:continuum-notifier-api:1.1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.continuum:continuum-notifier-irc:1.1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.continuum:continuum-notifier-jabber:1.1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.continuum:continuum-notifier-msn:1.1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.continuum:continuum-notifier-wagon:1.1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.continuum:continuum-release:1.1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.continuum:continuum-security:1.1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.continuum:continuum-webapp:1.1-SNAPSHOT::war" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.shared:maven-app-configuration-model:1.0::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.shared:maven-app-configuration-web:1.0::jar" ) ); + dep = toDependency( "jpox:jpox:1.1.7::jar" ); + addExclusion( dep, "javax.sql:jdbc-stdext" ); + model.addDependencyManagement( dep ); + dep = toDependency( "jpox:jpox-enhancer:1.1.7::jar" ); + addExclusion( dep, "javax.sql:jdbc-stdext" ); + model.addDependencyManagement( dep ); + model.addDependencyManagement( toDependency( "jpox:jpox-dbcp:1.1.7::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-jdo2:1.0-alpha-8::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-formica:1.0-beta-13::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-velocity:1.1.4::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-mail-sender-api:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-mail-sender-simple:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-mail-sender-test:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-mail-sender-javamail:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-log4j-logging:1.1-alpha-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-notification:1.0-alpha-5::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-taskqueue:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.derby:derby:10.1.3.1::jar" ) ); + model.addDependencyManagement( toDependency( "hsqldb:hsqldb:1.7.3.3::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-quartz:1.0-alpha-3::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-xwork-integration:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-rbac-role-manager:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-rbac-model:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-rbac-memory:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-system:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-xwork-content:1.0-alpha-1::war" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-xwork-integration:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-taglib:1.0-alpha-1::jar" ) ); + model.addProperty( "continuumWebappVersion", "1.1-SNAPSHOT" ); + model.addProperty( "wagon.version", "1.0-beta-2" ); + model.addProperty( "maven.version", "2.0.5" ); + model.addProperty( "maven-scm.version", "1.0" ); + model.addProperty( "redback.version", "1.0-alpha-1" ); + model.addProperty( "mail-sender.version", "1.0-alpha-6" ); + addModel( model ); + + model = toModel( "org.apache.maven.continuum:continuum-parent:1.1-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven:maven-parent:5" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "jmock:jmock:1.0.1::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-20::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-20::jar" ) ); + dep = toDependency( "org.apache.maven:maven-core:2.0.5::jar" ); + addExclusion( dep, "classworlds:classworlds" ); + model.addDependencyManagement( dep ); + model.addDependencyManagement( toDependency( "org.apache.maven:maven-model:2.0.5::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven:maven-artifact:2.0.5::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven:maven-artifact-manager:2.0.5::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven:maven-project:2.0.5::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven:maven-settings:2.0.5::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.scm:maven-scm-api:1.0-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.scm:maven-scm-manager-plexus:1.0-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.scm:maven-scm-provider-bazaar:1.0-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.scm:maven-scm-provider-clearcase:1.0-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.scm:maven-scm-provider-cvsjava:1.0-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.scm:maven-scm-provider-cvsexe:1.0-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.scm:maven-scm-provider-hg:1.0-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.scm:maven-scm-provider-local:1.0-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.scm:maven-scm-provider-perforce:1.0-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.scm:maven-scm-provider-starteam:1.0-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.scm:maven-scm-provider-svnexe:1.0-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.scm:maven-scm-provider-synergy:1.0-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.scm:maven-scm-provider-vss:1.0-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-file:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-http-lightweight:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh-external:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-webdav:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.continuum:continuum-model:1.1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.continuum:continuum-api:1.1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.continuum:continuum-configuration:1.1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.continuum:continuum-store:1.1-SNAPSHOT:tests:jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.continuum:continuum-store:1.1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.continuum:continuum-core:1.1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.continuum:continuum-test:1.1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.continuum:continuum-web:1.1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.continuum:continuum-xmlrpc-api:1.1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.continuum:continuum-xmlrpc-client:1.1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.continuum:continuum-xmlrpc-server:1.1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.continuum:continuum-plexus-application:1.1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.continuum:continuum-notifier-api:1.1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.continuum:continuum-notifier-irc:1.1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.continuum:continuum-notifier-jabber:1.1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.continuum:continuum-notifier-msn:1.1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.continuum:continuum-notifier-wagon:1.1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.continuum:continuum-release:1.1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.continuum:continuum-security:1.1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.continuum:continuum-webapp:1.1-SNAPSHOT::war" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.shared:maven-app-configuration-model:1.0::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.shared:maven-app-configuration-web:1.0::jar" ) ); + dep = toDependency( "jpox:jpox:1.1.7::jar" ); + addExclusion( dep, "javax.sql:jdbc-stdext" ); + model.addDependencyManagement( dep ); + dep = toDependency( "jpox:jpox-enhancer:1.1.7::jar" ); + addExclusion( dep, "javax.sql:jdbc-stdext" ); + model.addDependencyManagement( dep ); + model.addDependencyManagement( toDependency( "jpox:jpox-dbcp:1.1.7::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-jdo2:1.0-alpha-8::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-formica:1.0-beta-13::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-velocity:1.1.4::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-mail-sender-api:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-mail-sender-simple:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-mail-sender-test:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-mail-sender-javamail:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-log4j-logging:1.1-alpha-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-notification:1.0-alpha-5::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-taskqueue:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.derby:derby:10.1.3.1::jar" ) ); + model.addDependencyManagement( toDependency( "hsqldb:hsqldb:1.7.3.3::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-quartz:1.0-alpha-3::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-xwork-integration:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-rbac-role-manager:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-rbac-model:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-rbac-memory:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-system:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-xwork-content:1.0-alpha-1-SNAPSHOT::war" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-xwork-integration:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-taglib:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addProperty( "continuumWebappVersion", "1.1-SNAPSHOT" ); + model.addProperty( "wagon.version", "1.0-beta-2" ); + model.addProperty( "maven.version", "2.0.5" ); + model.addProperty( "maven-scm.version", "1.0-SNAPSHOT" ); + model.addProperty( "redback.version", "1.0-alpha-1-SNAPSHOT" ); + model.addProperty( "mail-sender.version", "1.0-alpha-6" ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-parent:5" ); + model.setParentProject( toParent( "org.apache:apache:3" ) ); + addModel( model ); + + model = toModel( "org.apache:apache:3" ); + addModel( model ); + + model = toModel( "junit:junit:3.8.1" ); + addModel( model ); + + model = toModel( "jmock:jmock:1.0.1" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-component-api:1.0-alpha-20" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0-alpha-20" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-containers:1.0-alpha-20" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.10" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-19::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.3::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus:1.0.10" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.9" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus:1.0.9" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-component-api:1.0-alpha-19" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0-alpha-19" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-containers:1.0-alpha-19" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.10" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-19::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.3::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-utils:1.3" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.8" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus:1.0.8" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-container-default:1.0-alpha-20" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0-alpha-20" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-19::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.3::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + model.addDependency( toDependency( "jmock:jmock:1.0.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-core:2.0.5" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.5" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-settings:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-file:1.0-beta-2::jar", "runtime" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-plugin-parameter-documenter:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-http-lightweight:1.0-beta-2::jar", "runtime" ) ); + model.addDependency( toDependency( "org.apache.maven.reporting:maven-reporting-api:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-profile:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-model:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-beta-2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-repository-metadata:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-error-diagnostics:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-project:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-plugin-registry:2.0.5::jar" ) ); + dep = toDependency( "commons-cli:commons-cli:1.0::jar" ); + addExclusion( dep, "commons-lang:commons-lang" ); + addExclusion( dep, "commons-logging:commons-logging" ); + model.addDependency( dep ); + model.addDependency( toDependency( "org.apache.maven:maven-plugin-api:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-ssh-external:1.0-beta-2::jar", "runtime" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-plugin-descriptor:2.0.5::jar" ) ); + dep = toDependency( "org.codehaus.plexus:plexus-interactivity-api:1.0-alpha-4::jar" ); + addExclusion( dep, "plexus:plexus-utils" ); + addExclusion( dep, "org.codehaus.plexus:plexus-container-default" ); + model.addDependency( dep ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact-manager:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-monitor:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-ssh:1.0-beta-2::jar", "runtime" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependency( toDependency( "classworlds:classworlds:1.1::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven:2.0.5" ); + model.setParentProject( toParent( "org.apache.maven:maven-parent:5" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh-external:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-file:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-http-lightweight:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "easymock:easymock:1.2_Java1.3::jar", "test" ) ); + model.addDependencyManagement( toDependency( "classworlds:classworlds:1.1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0.3" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + model.addDependency( toDependency( "classworlds:classworlds:1.1-alpha-2::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-containers:1.0.3" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.4" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus:1.0.4" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-utils:1.0.4" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "classworlds:classworlds:1.1-alpha-2" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-utils:1.1" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.4" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-provider-api:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon:1.0-beta-2" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven:maven-parent:4" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-provider-test:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh-common-test:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh-common:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "junit:junit:3.8.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-interactivity-api:1.0-alpha-4::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-parent:4" ); + model.setParentProject( toParent( "org.apache:apache:3" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-provider-test:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon:1.0-beta-2" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-beta-2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8" ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar", "compile" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependency( toDependency( "classworlds:classworlds:1.1-alpha-2::jar", "compile" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-ssh-common-test:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-beta-2" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-ssh-common:1.0-beta-2::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-providers:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon:1.0-beta-2" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-test:1.0-beta-2::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh-common:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh-common-test:1.0-beta-2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-ssh-common:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-beta-2" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-interactivity-api:1.0-alpha-4::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-interactivity-api:1.0-alpha-4" ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-7::jar", "compile" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "classworlds:classworlds:1.1-alpha-2::jar", "compile" ) ); + model.addDependency( toDependency( "plexus:plexus-utils:1.0.2::jar", "compile" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-container-default:1.0-alpha-7" ); + model.setParentProject( toParent( "plexus:plexus-containers:1.0.2" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependency( toDependency( "plexus:plexus-utils:1.0.2::jar" ) ); + model.addDependency( toDependency( "classworlds:classworlds:1.1-alpha-2::jar" ) ); + addModel( model ); + + model = toModel( "plexus:plexus-containers:1.0.2" ); + model.setParentProject( toParent( "plexus:plexus-root:1.0.3" ) ); + addModel( model ); + + model = toModel( "plexus:plexus-root:1.0.3" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "plexus:plexus-utils:1.0.2" ); + model.setParentProject( toParent( "plexus:plexus-root:1.0.3" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-ssh:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-beta-2" ) ); + model.addDependency( toDependency( "com.jcraft:jsch:0.1.27::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-interactivity-api:1.0-alpha-4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-ssh-common:1.0-beta-2::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-ssh-common-test:1.0-beta-2::jar", "test" ) ); + addModel( model ); + + model = toModel( "com.jcraft:jsch:0.1.27" ); + dep = toDependency( "com.jcraft:jzlib:1.0.7::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "com.jcraft:jzlib:1.0.7" ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-ssh-external:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-beta-2" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-ssh-common:1.0-beta-2::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-ssh-common-test:1.0-beta-2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-file:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-beta-2" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-http-lightweight:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-beta-2" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-http-shared:1.0-beta-2::jar" ) ); + model.addDependency( toDependency( "xml-apis:xml-apis:1.0.b2::jar" ) ); + dep = toDependency( "plexus:plexus-jetty-httpd:1.0-beta-1::jar", "test" ); + addExclusion( dep, "plexus:plexus-container-default" ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-http-shared:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-beta-2" ) ); + model.addDependency( toDependency( "jtidy:jtidy:4aug2000r7-dev::jar" ) ); + addModel( model ); + + model = toModel( "jtidy:jtidy:4aug2000r7-dev" ); + addModel( model ); + + model = toModel( "xml-apis:xml-apis:1.0.b2" ); + addModel( model ); + + model = toModel( "plexus:plexus-jetty-httpd:1.0-beta-1" ); + model.setParentProject( toParent( "plexus:plexus-components:1.0" ) ); + model.addDependency( toDependency( "jetty:jetty:4.2.10::jar" ) ); + model.addDependency( toDependency( "servletapi:servletapi:2.3::jar" ) ); + addModel( model ); + + model = toModel( "plexus:plexus-components:1.0" ); + model.setParentProject( toParent( "plexus:plexus-root:1.0" ) ); + model.addDependency( toDependency( "plexus:plexus-container-default:1.0-alpha-2::jar" ) ); + addModel( model ); + + model = toModel( "plexus:plexus-root:1.0" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "plexus:plexus-container-default:1.0-alpha-2" ); + addModel( model ); + + model = toModel( "jetty:jetty:4.2.10" ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.3::jar", "runtime" ) ); + addModel( model ); + + model = toModel( "javax.servlet:servlet-api:2.3" ); + addModel( model ); + + model = toModel( "servletapi:servletapi:2.3" ); + model.setRelocation( new VersionedReference() ); + model.getRelocation().setGroupId( "javax.servlet" ); + model.getRelocation().setArtifactId( "servlet-api" ); + model.getRelocation().setVersion( "2.3" ); + addModel( model ); + + model = toModel( "easymock:easymock:1.2_Java1.3" ); + addModel( model ); + + model = toModel( "classworlds:classworlds:1.1" ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-settings:2.0.5" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.5" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-model:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-model:2.0.5" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.5" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-plugin-parameter-documenter:2.0.5" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.5" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.reporting:maven-reporting-api:2.0.5" ); + model.setParentProject( toParent( "org.apache.maven.reporting:maven-reporting:2.0.5" ) ); + model.addDependency( toDependency( "org.apache.maven.doxia:doxia-sink-api:1.0-alpha-7::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.reporting:maven-reporting:2.0.5" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.5" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.doxia:doxia-sink-api:1.0-alpha-7" ); + model.setParentProject( toParent( "org.apache.maven.doxia:doxia:1.0-alpha-7" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.doxia:doxia:1.0-alpha-7" ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-profile:2.0.5" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.5" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-model:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-artifact:2.0.5" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.5" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-repository-metadata:2.0.5" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.5" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-error-diagnostics:2.0.5" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.5" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-project:2.0.5" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.5" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-settings:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact-test:2.0.5::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-profile:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-model:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact-manager:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-artifact-test:2.0.5" ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-artifact-manager:2.0.5" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.5" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-repository-metadata:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-file:1.0-beta-2::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-beta-2::jar" ) ); + model.addDependency( toDependency( "easymock:easymock:1.2_Java1.3::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-plugin-registry:2.0.5" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.5" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + addModel( model ); + + model = toModel( "commons-cli:commons-cli:1.0" ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0::jar" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:1.0::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + addModel( model ); + + model = toModel( "commons-logging:commons-logging:1.0" ); + addModel( model ); + + model = toModel( "commons-lang:commons-lang:1.0" ); + model.addDependency( toDependency( "junit:junit:3.7::jar" ) ); + addModel( model ); + + model = toModel( "junit:junit:3.7" ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-plugin-api:2.0.5" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.5" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-plugin-descriptor:2.0.5" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.5" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-plugin-api:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-monitor:2.0.5" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.5" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-api:1.0-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.scm:maven-scm:1.0-SNAPSHOT" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm:1.0-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven:maven-parent:5" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-manager-plexus:1.0-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.scm:maven-scm-managers:1.0-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-managers:1.0-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.scm:maven-scm:1.0-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-api:1.0-SNAPSHOT::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-provider-bazaar:1.0-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.scm:maven-scm-providers:1.0-SNAPSHOT" ) ); + model.addDependency( toDependency( "regexp:regexp:1.3::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-7::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-providers:1.0-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.scm:maven-scm:1.0-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-api:1.0-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-test:1.0-SNAPSHOT::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-test:1.0-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.scm:maven-scm:1.0-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-api:1.0-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-manager-plexus:1.0-SNAPSHOT::jar" ) ); + addModel( model ); + + model = toModel( "regexp:regexp:1.3" ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-provider-clearcase:1.0-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.scm:maven-scm-providers:1.0-SNAPSHOT" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-provider-cvsjava:1.0-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.scm:maven-scm-providers-cvs:1.0-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-cvs-commons:1.0-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.netbeans.lib:cvsclient:20060125::jar" ) ); + model.addDependency( toDependency( "ch.ethz.ganymed:ganymed-ssh2:build210::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-cvstest:1.0-SNAPSHOT::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-providers-cvs:1.0-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.scm:maven-scm-providers:1.0-SNAPSHOT" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-provider-cvs-commons:1.0-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.scm:maven-scm-providers-cvs:1.0-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-cvstest:1.0-SNAPSHOT::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-provider-cvstest:1.0-SNAPSHOT" ); + addModel( model ); + + model = toModel( "org.netbeans.lib:cvsclient:20060125" ); + addModel( model ); + + model = toModel( "ch.ethz.ganymed:ganymed-ssh2:build210" ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-provider-cvsexe:1.0-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.scm:maven-scm-providers-cvs:1.0-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-cvstest:1.0-SNAPSHOT::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-cvs-commons:1.0-SNAPSHOT::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-provider-hg:1.0-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.scm:maven-scm-providers:1.0-SNAPSHOT" ) ); + model.addDependency( toDependency( "regexp:regexp:1.3::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-provider-local:1.0-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.scm:maven-scm-providers:1.0-SNAPSHOT" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-provider-perforce:1.0-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.scm:maven-scm-providers:1.0-SNAPSHOT" ) ); + model.addDependency( toDependency( "regexp:regexp:1.3::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-provider-starteam:1.0-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.scm:maven-scm-providers:1.0-SNAPSHOT" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-provider-svnexe:1.0-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.scm:maven-scm-providers-svn:1.0-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-svn-commons:1.0-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-svntest:1.0-SNAPSHOT::jar", "test" ) ); + model.addDependency( toDependency( "regexp:regexp:1.3::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-providers-svn:1.0-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.scm:maven-scm-providers:1.0-SNAPSHOT" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-provider-svn-commons:1.0-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.scm:maven-scm-providers-svn:1.0-SNAPSHOT" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-provider-svntest:1.0-SNAPSHOT" ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-provider-synergy:1.0-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.scm:maven-scm-providers:1.0-SNAPSHOT" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-provider-vss:1.0-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.scm:maven-scm-providers:1.0-SNAPSHOT" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-webdav:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-beta-2" ) ); + model.addDependency( toDependency( "slide:slide-webdavlib:2.1::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.4::jar", "runtime" ) ); + model.addDependency( toDependency( "it.could:webdav:0.4::jar", "test" ) ); + model.addDependency( toDependency( "org.mortbay.jetty:jetty:4.2.12::jar", "test" ) ); + addModel( model ); + + model = toModel( "slide:slide-webdavlib:2.1" ); + model.addDependency( toDependency( "commons-httpclient:commons-httpclient:2.0.2::jar" ) ); + model.addDependency( toDependency( "jdom:jdom:1.0::jar" ) ); + model.addDependency( toDependency( "de.zeigermann.xml:xml-im-exporter:1.1::jar" ) ); + addModel( model ); + + model = toModel( "commons-httpclient:commons-httpclient:2.0.2" ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.3::jar" ) ); + addModel( model ); + + model = toModel( "commons-logging:commons-logging:1.0.3" ); + dep = toDependency( "log4j:log4j:1.2.6::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "logkit:logkit:1.0.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + addModel( model ); + + model = toModel( "log4j:log4j:1.2.6" ); + addModel( model ); + + model = toModel( "logkit:logkit:1.0.1" ); + addModel( model ); + + model = toModel( "jdom:jdom:1.0" ); + dep = toDependency( "xerces:xercesImpl:2.6.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "xml-apis:xml-apis:1.0.b2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "jaxen:jaxen:1.0-FCS::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "saxpath:saxpath:1.0-FCS::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "xalan:xalan:2.5.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "xerces:xercesImpl:2.6.0" ); + addModel( model ); + + model = toModel( "jaxen:jaxen:1.0-FCS" ); + addModel( model ); + + model = toModel( "saxpath:saxpath:1.0-FCS" ); + addModel( model ); + + model = toModel( "xalan:xalan:2.5.0" ); + addModel( model ); + + model = toModel( "de.zeigermann.xml:xml-im-exporter:1.1" ); + addModel( model ); + + model = toModel( "commons-logging:commons-logging:1.0.4" ); + dep = toDependency( "log4j:log4j:1.2.6::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "logkit:logkit:1.0.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + dep = toDependency( "avalon-framework:avalon-framework:4.1.3::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "avalon-framework:avalon-framework:4.1.3" ); + addModel( model ); + + model = toModel( "it.could:webdav:0.4" ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.3::jar", "runtime" ) ); + addModel( model ); + + model = toModel( "org.mortbay.jetty:jetty:4.2.12" ); + addModel( model ); + + model = toModel( "org.apache.maven.continuum:continuum-model:1.1-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.continuum:continuum-parent:1.1-SNAPSHOT" ) ); + dep = toDependency( "net.java.dev.stax-utils:stax-utils:20060502::jar" ); + addExclusion( dep, "com.bea.xml:jsr173-ri" ); + model.addDependency( dep ); + model.addDependency( toDependency( "stax:stax-api:1.0.1::jar" ) ); + addModel( model ); + + model = toModel( "net.java.dev.stax-utils:stax-utils:20060502" ); + model.addDependency( toDependency( "com.bea.xml:jsr173-ri:1.0::jar" ) ); + addModel( model ); + + model = toModel( "com.bea.xml:jsr173-ri:1.0" ); + model.addDependency( toDependency( "javax.xml:jsr173:1.0::jar" ) ); + addModel( model ); + + model = toModel( "javax.xml:jsr173:1.0" ); + addModel( model ); + + model = toModel( "stax:stax-api:1.0.1" ); + addModel( model ); + + model = toModel( "org.apache.maven.continuum:continuum-api:1.1-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.continuum:continuum-parent:1.1-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-formica:1.0-beta-13::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.continuum:continuum-model:1.1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-formica:1.0-beta-13" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.9" ) ); + model.addDependency( toDependency( "oro:oro:2.0.6::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-i18n:1.0-beta-6::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependency( toDependency( "ognl:ognl:2.6.7::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-components:1.1.9" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.10" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-16::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-16::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-component-api:1.0-alpha-16" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0-alpha-16" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-containers:1.0-alpha-16" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.9" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-16::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.3::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-container-default:1.0-alpha-16" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0-alpha-16" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-16::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.3::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + model.addDependency( toDependency( "jmock:jmock:1.0.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "oro:oro:2.0.6" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-i18n:1.0-beta-6" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.4" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-components:1.1.4" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.4" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-utils:1.4" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.9" ) ); + addModel( model ); + + model = toModel( "ognl:ognl:2.6.7" ); + addModel( model ); + + model = toModel( "org.apache.maven.continuum:continuum-configuration:1.1-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.continuum:continuum-parent:1.1-SNAPSHOT" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.continuum:continuum-core:1.1-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.continuum:continuum-parent:1.1-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-quartz:1.0-alpha-3::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-mail-sender-api:1.0-alpha-6::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-notification:1.0-alpha-5::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-settings:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.continuum:continuum-notifier-api:1.1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-model:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-svnexe:1.0-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-velocity:1.1.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.continuum:continuum-api:1.1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-command-line:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-beta-2::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-api:1.0-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-project:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-core:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-jdo2:1.0-alpha-8::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-formica:1.0-beta-13::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-action:1.0-alpha-6::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-taskqueue:1.0-alpha-6::jar" ) ); + model.addDependency( toDependency( "jpox:jpox:1.1.7::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.continuum:continuum-store:1.1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-manager-plexus:1.0-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "velocity:velocity:1.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.continuum:continuum-release:1.1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.continuum:continuum-security:1.1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-role-manager:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.7.3.3::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven.continuum:continuum-test:1.1-SNAPSHOT::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven.continuum:continuum-security:1.1-SNAPSHOT::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven.continuum:continuum-configuration:1.1-SNAPSHOT::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-local:1.0-SNAPSHOT::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.derby:derby:10.1.3.1::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-mail-sender-test:1.0-alpha-6::jar", "test" ) ); + model.addDependency( toDependency( "xml-apis:xml-apis:1.0.b2::jar", "test" ) ); + model.addDependency( toDependency( "xerces:xercesImpl:2.6.2::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-mail-sender-simple:1.0-alpha-6::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-xwork-integration:1.0-alpha-1-SNAPSHOT::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-memory:1.0-alpha-1-SNAPSHOT::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-quartz:1.0-alpha-3" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.6" ) ); + model.addDependency( toDependency( "quartz:quartz:1.4.5::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.2::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-components:1.1.6" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.8" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + addModel( model ); + + model = toModel( "quartz:quartz:1.4.5" ); + addModel( model ); + + model = toModel( "commons-logging:commons-logging:1.0.2" ); + dep = toDependency( "log4j:log4j:1.1.3::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "logkit:logkit:1.0.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + addModel( model ); + + model = toModel( "log4j:log4j:1.1.3" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-mail-sender-api:1.0-alpha-6" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-mail-sender:1.0-alpha-6" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-mail-sender:1.0-alpha-6" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.9" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-notification:1.0-alpha-5" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.4" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.continuum:continuum-notifier-api:1.1-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.continuum:continuum-notifiers:1.1-SNAPSHOT" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.continuum:continuum-notifiers:1.1-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.continuum:continuum-parent:1.1-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.continuum:continuum-api:1.1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-notification:1.0-alpha-5::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-velocity:1.1.4" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.8" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.0::jar" ) ); + model.addDependency( toDependency( "velocity:velocity:1.4::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-components:1.1.8" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.9" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-15::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-15::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-component-api:1.0-alpha-15" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0-alpha-15" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-6::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-containers:1.0-alpha-15" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.9" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-15::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.3::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-6" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.9" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-container-default:1.0-alpha-15" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0-alpha-15" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-15::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.3::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-6::jar" ) ); + model.addDependency( toDependency( "jmock:jmock:1.0.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "commons-collections:commons-collections:2.0" ); + addModel( model ); + + model = toModel( "velocity:velocity:1.4" ); + model.addDependency( toDependency( "velocity:velocity-dep:1.4::jar", "runtime" ) ); + addModel( model ); + + model = toModel( "velocity:velocity-dep:1.4" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-command-line:1.0-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.4" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-jdo2:1.0-alpha-8" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.6" ) ); + model.addDependency( toDependency( "javax.jdo:jdo2-api:2.0::jar" ) ); + dep = toDependency( "jpox:jpox:1.1.1::jar", "test" ); + addExclusion( dep, "javax.sql:jdbc-stdext" ); + model.addDependency( dep ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.7.3.0::jar", "test" ) ); + addModel( model ); + + model = toModel( "javax.jdo:jdo2-api:2.0" ); + model.addDependency( toDependency( "geronimo-spec:geronimo-spec-jta:1.0.1B-rc2::jar" ) ); + dep = toDependency( "xerces:xerces:2.4.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "xml-apis:xml-apis:1.0.b2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "geronimo-spec:geronimo-spec-jta:1.0.1B-rc2" ); + addModel( model ); + + model = toModel( "xerces:xerces:2.4.0" ); + model.setRelocation( new VersionedReference() ); + model.getRelocation().setGroupId( "xerces" ); + model.getRelocation().setArtifactId( "xercesImpl" ); + addModel( model ); + + model = toModel( "xerces:xercesImpl:2.4.0" ); + addModel( model ); + + model = toModel( "jpox:jpox:1.1.1" ); + model.setParentProject( toParent( "jpox:jpox-parent:1.1.1" ) ); + model.addDependency( toDependency( "log4j:log4j:1.2.8::jar" ) ); + model.addDependency( toDependency( "javax.jdo:jdo2-api:2.0::jar" ) ); + model.addDependency( toDependency( "javax.resource:connector:1.0::jar" ) ); + dep = toDependency( "javax.security:jaas:1.0.01::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "javax.sql:jdbc-stdext:2.0::jar" ) ); + dep = toDependency( "ant:ant:1.6::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "jpox:jpox-dbcp:1.1.1::jar", "test" ) ); + model.addDependency( toDependency( "commons-dbcp:commons-dbcp:1.2::jar", "test" ) ); + model.addDependency( toDependency( "commons-pool:commons-pool:1.2::jar", "test" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:3.1::jar", "test" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "jpox:jpox-parent:1.1.1" ); + addModel( model ); + + model = toModel( "log4j:log4j:1.2.8" ); + addModel( model ); + + model = toModel( "javax.resource:connector:1.0" ); + addModel( model ); + + model = toModel( "javax.security:jaas:1.0.01" ); + addModel( model ); + + model = toModel( "javax.sql:jdbc-stdext:2.0" ); + addModel( model ); + + model = toModel( "ant:ant:1.6" ); + addModel( model ); + + model = toModel( "jpox:jpox-dbcp:1.1.1" ); + addModel( model ); + + model = toModel( "commons-dbcp:commons-dbcp:1.2" ); + addModel( model ); + + model = toModel( "commons-pool:commons-pool:1.2" ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.1::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "xml-apis:xml-apis:2.0.2::jar" ) ); + model.addDependency( toDependency( "xerces:xerces:2.0.2::jar" ) ); + addModel( model ); + + model = toModel( "commons-collections:commons-collections:2.1" ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + addModel( model ); + + model = toModel( "xml-apis:xml-apis:2.0.2" ); + model.setRelocation( new VersionedReference() ); + model.getRelocation().setGroupId( "xml-apis" ); + model.getRelocation().setArtifactId( "xml-apis" ); + model.getRelocation().setVersion( "1.0.b2" ); + addModel( model ); + + model = toModel( "xerces:xerces:2.0.2" ); + model.setRelocation( new VersionedReference() ); + model.getRelocation().setGroupId( "xerces" ); + model.getRelocation().setArtifactId( "xercesImpl" ); + addModel( model ); + + model = toModel( "xerces:xercesImpl:2.0.2" ); + addModel( model ); + + model = toModel( "commons-collections:commons-collections:3.1" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "hsqldb:hsqldb:1.7.3.0" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-action:1.0-alpha-6" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.4" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-taskqueue:1.0-alpha-6" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.7" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "backport-util-concurrent:backport-util-concurrent:3.0::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-components:1.1.7" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.8" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + addModel( model ); + + model = toModel( "backport-util-concurrent:backport-util-concurrent:3.0" ); + addModel( model ); + + model = toModel( "jpox:jpox:1.1.7" ); + model.setParentProject( toParent( "jpox:jpox-parent:1.1.7" ) ); + model.addDependency( toDependency( "log4j:log4j:1.2.8::jar" ) ); + model.addDependency( toDependency( "javax.jdo:jdo2-api:2.0::jar" ) ); + model.addDependency( toDependency( "javax.resource:connector:1.0::jar" ) ); + model.addDependency( toDependency( "javax.transaction:jta:1.0.1B::jar" ) ); + dep = toDependency( "ant:ant:1.6::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "jpox:jpox-parent:1.1.7" ); + addModel( model ); + + model = toModel( "javax.transaction:jta:1.0.1B" ); + addModel( model ); + + model = toModel( "org.apache.maven.continuum:continuum-release:1.1-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.continuum:continuum-parent:1.1-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.continuum:continuum-api:1.1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-settings:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-project:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-model:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact-manager:2.0.5::jar" ) ); + dep = toDependency( "org.apache.maven.release:maven-release-manager:1.0-alpha-1::jar" ); + addExclusion( dep, "classworlds:classworlds" ); + model.addDependency( dep ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-taskqueue:1.0-alpha-6::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-api:1.0-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-manager-plexus:1.0-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-bazaar:1.0-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-clearcase:1.0-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-cvsjava:1.0-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-cvsexe:1.0-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-local:1.0-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-perforce:1.0-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-starteam:1.0-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-svnexe:1.0-SNAPSHOT::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.release:maven-release-manager:1.0-alpha-1" ); + model.setParentProject( toParent( "org.apache.maven.release:maven-release:1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-17::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.3::jar" ) ); + dep = toDependency( "org.codehaus.plexus:plexus-interactivity-api:1.0-alpha-6::jar" ); + addExclusion( dep, "plexus:plexus-utils" ); + model.addDependency( dep ); + model.addDependency( toDependency( "org.apache.maven:maven-model:2.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact:2.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-project:2.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-settings:2.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-api:1.0-rc1::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-manager-plexus:1.0-rc1::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-bazaar:1.0-rc1::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-clearcase:1.0-rc1::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-cvsexe:1.0-rc1::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-cvsjava:1.0-rc1::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-hg:1.0-rc1::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-perforce:1.0-rc1::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-starteam:1.0-rc1::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-svnexe:1.0-rc1::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-synergy:1.0-rc1::jar" ) ); + model.addDependency( toDependency( "jdom:jdom:1.0::jar" ) ); + dep = toDependency( "jaxen:jaxen:1.1-beta-8::jar" ); + addExclusion( dep, "dom4j:dom4j" ); + addExclusion( dep, "xerces:xmlParserAPIs" ); + addExclusion( dep, "xerces:xercesImpl" ); + addExclusion( dep, "xom:xom" ); + model.addDependency( dep ); + model.addDependency( toDependency( "org.apache.maven.shared:maven-plugin-testing-harness:1.0-beta-1::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-test:1.0-rc1::jar", "test" ) ); + model.addDependency( toDependency( "jmock:jmock-cglib:1.0.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.release:maven-release:1" ); + model.setParentProject( toParent( "org.apache.maven:maven-parent:5" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-container-default:1.0-alpha-17" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0-alpha-17" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-17::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.3::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + model.addDependency( toDependency( "jmock:jmock:1.0.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-containers:1.0-alpha-17" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.9" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-17::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.3::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-component-api:1.0-alpha-17" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0-alpha-17" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-interactivity-api:1.0-alpha-6" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-interactivity:1.0-alpha-6" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-interactivity:1.0-alpha-6" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.9" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-model:2.0" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven:2.0" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-alpha-5::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh:1.0-alpha-5::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-file:1.0-alpha-5::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-http-lightweight:1.0-alpha-5::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-provider-api:1.0-alpha-5" ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar", "compile" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-ssh:1.0-alpha-5" ); + model.addDependency( toDependency( "com.jcraft:jsch:0.1.23::jar", "compile" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar", "compile" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-alpha-5::jar", "compile" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar", "compile" ) ); + model.addDependency( toDependency( "classworlds:classworlds:1.1-alpha-2::jar", "compile" ) ); + model.addDependency( toDependency( "plexus:plexus-utils:1.0.2::jar", "compile" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-interactivity-api:1.0-alpha-4::jar", "compile" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-test:1.0-alpha-5::jar", "test" ) ); + addModel( model ); + + model = toModel( "com.jcraft:jsch:0.1.23" ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-provider-test:1.0-alpha-5" ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-file:1.0-alpha-5" ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar", "compile" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-alpha-5::jar", "compile" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar", "test" ) ); + model.addDependency( toDependency( "classworlds:classworlds:1.1-alpha-2::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-test:1.0-alpha-5::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-http-lightweight:1.0-alpha-5" ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar", "compile" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-alpha-5::jar", "compile" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar", "test" ) ); + model.addDependency( toDependency( "servletapi:servletapi:2.3::jar", "test" ) ); + model.addDependency( toDependency( "classworlds:classworlds:1.1-alpha-2::jar", "test" ) ); + model.addDependency( toDependency( "jetty:jetty:4.2.10::jar", "test" ) ); + model.addDependency( toDependency( "plexus:plexus-jetty-httpd:1.0-beta-1::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-test:1.0-alpha-5::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-artifact:2.0" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-project:2.0" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact-test:2.0::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-profile:2.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-model:2.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact-manager:2.0::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact:2.0::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-artifact-test:2.0" ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-profile:2.0" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-model:2.0::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-artifact-manager:2.0" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-repository-metadata:2.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-file:1.0-alpha-5::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact:2.0::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-alpha-5::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-repository-metadata:2.0" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-settings:2.0" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-model:2.0::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-api:1.0-rc1" ); + model.setParentProject( toParent( "org.apache.maven.scm:maven-scm:1.0-rc1" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm:1.0-rc1" ); + model.setParentProject( toParent( "org.apache.maven:maven-parent:5" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-manager-plexus:1.0-rc1" ); + model.setParentProject( toParent( "org.apache.maven.scm:maven-scm-managers:1.0-rc1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-managers:1.0-rc1" ); + model.setParentProject( toParent( "org.apache.maven.scm:maven-scm:1.0-rc1" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-api:1.0-rc1::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-provider-bazaar:1.0-rc1" ); + model.setParentProject( toParent( "org.apache.maven.scm:maven-scm-providers:1.0-rc1" ) ); + model.addDependency( toDependency( "regexp:regexp:1.3::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-7::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-providers:1.0-rc1" ); + model.setParentProject( toParent( "org.apache.maven.scm:maven-scm:1.0-rc1" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-api:1.0-rc1::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-test:1.0-rc1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-test:1.0-rc1" ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-provider-clearcase:1.0-rc1" ); + model.setParentProject( toParent( "org.apache.maven.scm:maven-scm-providers:1.0-rc1" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-provider-cvsexe:1.0-rc1" ); + model.setParentProject( toParent( "org.apache.maven.scm:maven-scm-providers-cvs:1.0-rc1" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-cvstest:1.0-rc1::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-cvs-commons:1.0-rc1::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-providers-cvs:1.0-rc1" ); + model.setParentProject( toParent( "org.apache.maven.scm:maven-scm-providers:1.0-rc1" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-provider-cvstest:1.0-rc1" ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-provider-cvs-commons:1.0-rc1" ); + model.setParentProject( toParent( "org.apache.maven.scm:maven-scm-providers-cvs:1.0-rc1" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-cvstest:1.0-rc1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-provider-cvsjava:1.0-rc1" ); + model.setParentProject( toParent( "org.apache.maven.scm:maven-scm-providers-cvs:1.0-rc1" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-cvs-commons:1.0-rc1::jar" ) ); + model.addDependency( toDependency( "org.netbeans.lib:cvsclient:20060125::jar" ) ); + model.addDependency( toDependency( "ch.ethz.ganymed:ganymed-ssh2:build210::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-cvstest:1.0-rc1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-provider-hg:1.0-rc1" ); + model.setParentProject( toParent( "org.apache.maven.scm:maven-scm-providers:1.0-rc1" ) ); + model.addDependency( toDependency( "regexp:regexp:1.3::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-provider-perforce:1.0-rc1" ); + model.setParentProject( toParent( "org.apache.maven.scm:maven-scm-providers:1.0-rc1" ) ); + model.addDependency( toDependency( "regexp:regexp:1.3::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-provider-starteam:1.0-rc1" ); + model.setParentProject( toParent( "org.apache.maven.scm:maven-scm-providers:1.0-rc1" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-provider-svnexe:1.0-rc1" ); + model.setParentProject( toParent( "org.apache.maven.scm:maven-scm-providers-svn:1.0-rc1" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-svn-commons:1.0-rc1::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-svntest:1.0-rc1::jar", "test" ) ); + model.addDependency( toDependency( "regexp:regexp:1.3::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-providers-svn:1.0-rc1" ); + model.setParentProject( toParent( "org.apache.maven.scm:maven-scm-providers:1.0-rc1" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-provider-svn-commons:1.0-rc1" ); + model.setParentProject( toParent( "org.apache.maven.scm:maven-scm-providers-svn:1.0-rc1" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-provider-svntest:1.0-rc1" ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-provider-synergy:1.0-rc1" ); + model.setParentProject( toParent( "org.apache.maven.scm:maven-scm-providers:1.0-rc1" ) ); + addModel( model ); + + model = toModel( "jaxen:jaxen:1.1-beta-8" ); + model.addDependency( toDependency( "dom4j:dom4j:1.6.1::jar" ) ); + model.addDependency( toDependency( "jdom:jdom:1.0::jar" ) ); + model.addDependency( toDependency( "xerces:xmlParserAPIs:2.6.2::jar" ) ); + model.addDependency( toDependency( "xerces:xercesImpl:2.6.2::jar" ) ); + model.addDependency( toDependency( "xom:xom:1.0b3::jar" ) ); + addModel( model ); + + model = toModel( "dom4j:dom4j:1.6.1" ); + dep = toDependency( "jaxme:jaxme-api:0.3::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "jaxen:jaxen:1.1-beta-6::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "msv:xsdlib:20030807::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "msv:relaxngDatatype:20030807::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "pull-parser:pull-parser:2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "xpp3:xpp3:1.1.3.3::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "stax:stax-api:1.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "xml-apis:xml-apis:1.0.b2::jar" ) ); + model.addDependency( toDependency( "junitperf:junitperf:1.8::jar", "test" ) ); + model.addDependency( toDependency( "stax:stax-ri:1.0::jar", "test" ) ); + model.addDependency( toDependency( "xerces:xercesImpl:2.6.2::jar", "test" ) ); + model.addDependency( toDependency( "xalan:xalan:2.5.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "jaxme:jaxme-api:0.3" ); + addModel( model ); + + model = toModel( "jaxen:jaxen:1.1-beta-6" ); + addModel( model ); + + model = toModel( "msv:xsdlib:20030807" ); + addModel( model ); + + model = toModel( "msv:relaxngDatatype:20030807" ); + addModel( model ); + + model = toModel( "pull-parser:pull-parser:2" ); + addModel( model ); + + model = toModel( "xpp3:xpp3:1.1.3.3" ); + addModel( model ); + + model = toModel( "stax:stax-api:1.0" ); + addModel( model ); + + model = toModel( "junitperf:junitperf:1.8" ); + addModel( model ); + + model = toModel( "stax:stax-ri:1.0" ); + addModel( model ); + + model = toModel( "xerces:xercesImpl:2.6.2" ); + addModel( model ); + + model = toModel( "xalan:xalan:2.5.1" ); + addModel( model ); + + model = toModel( "xerces:xmlParserAPIs:2.6.2" ); + addModel( model ); + + model = toModel( "xom:xom:1.0b3" ); + model.addDependency( toDependency( "xerces:xmlParserAPIs:2.6.1::jar" ) ); + model.addDependency( toDependency( "xerces:xercesImpl:2.2.1::jar" ) ); + model.addDependency( toDependency( "com.ibm.icu:icu4j:2.6.1::jar" ) ); + model.addDependency( toDependency( "xalan:xalan:2.6.0::jar" ) ); + model.addDependency( toDependency( "org.ccil.cowan.tagsoup:tagsoup:0.9.7::jar" ) ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar", "provided" ) ); + addModel( model ); + + model = toModel( "xerces:xmlParserAPIs:2.6.1" ); + addModel( model ); + + model = toModel( "xerces:xercesImpl:2.2.1" ); + addModel( model ); + + model = toModel( "com.ibm.icu:icu4j:2.6.1" ); + addModel( model ); + + model = toModel( "xalan:xalan:2.6.0" ); + model.addDependency( toDependency( "xml-apis:xml-apis:2.0.2::jar" ) ); + dep = toDependency( "xerces:xercesImpl:2.6.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "org.ccil.cowan.tagsoup:tagsoup:0.9.7" ); + addModel( model ); + + model = toModel( "javax.servlet:servlet-api:2.4" ); + addModel( model ); + + model = toModel( "org.apache.maven.shared:maven-plugin-testing-harness:1.0-beta-1" ); + model.setParentProject( toParent( "org.apache.maven.shared:maven-shared-components:1" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-project:2.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-core:2.0::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.shared:maven-shared-components:1" ); + model.setParentProject( toParent( "org.apache.maven:maven-parent:1" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-parent:1" ); + model.setParentProject( toParent( "org.apache:apache:1" ) ); + addModel( model ); + + model = toModel( "org.apache:apache:1" ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-core:2.0" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-settings:2.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-file:1.0-alpha-5::jar", "runtime" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-plugin-parameter-documenter:2.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-http-lightweight:1.0-alpha-5::jar", "runtime" ) ); + model.addDependency( toDependency( "org.apache.maven.reporting:maven-reporting-api:2.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-profile:2.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-model:2.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact:2.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-alpha-5::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-repository-metadata:2.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-error-diagnostics:2.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-project:2.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-plugin-registry:2.0::jar" ) ); + dep = toDependency( "commons-cli:commons-cli:1.0::jar" ); + addExclusion( dep, "commons-lang:commons-lang" ); + addExclusion( dep, "commons-logging:commons-logging" ); + model.addDependency( dep ); + model.addDependency( toDependency( "org.apache.maven:maven-plugin-api:2.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-plugin-descriptor:2.0::jar" ) ); + dep = toDependency( "org.codehaus.plexus:plexus-interactivity-api:1.0-alpha-4::jar" ); + addExclusion( dep, "plexus:plexus-utils" ); + addExclusion( dep, "org.codehaus.plexus:plexus-container-default" ); + model.addDependency( dep ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact-manager:2.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-monitor:2.0::jar" ) ); + dep = toDependency( "org.apache.maven.wagon:wagon-ssh:1.0-alpha-5::jar", "runtime" ); + addExclusion( dep, "plexus:plexus-utils" ); + addExclusion( dep, "org.codehaus.plexus:plexus-container-default" ); + model.addDependency( dep ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-plugin-parameter-documenter:2.0" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.reporting:maven-reporting-api:2.0" ); + model.setParentProject( toParent( "org.apache.maven.reporting:maven-reporting:2.0" ) ); + dep = toDependency( "doxia:doxia-sink-api:1.0-alpha-4::jar" ); + addExclusion( dep, "plexus:plexus-container-default" ); + addExclusion( dep, "plexus:plexus-utils" ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "org.apache.maven.reporting:maven-reporting:2.0" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0" ) ); + addModel( model ); + + model = toModel( "doxia:doxia-sink-api:1.0-alpha-4" ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-error-diagnostics:2.0" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-plugin-registry:2.0" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-plugin-api:2.0" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-plugin-descriptor:2.0" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-plugin-api:2.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact:2.0::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-monitor:2.0" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0" ) ); + addModel( model ); + + model = toModel( "jmock:jmock-cglib:1.0.1" ); + model.addDependency( toDependency( "jmock:jmock:1.0.1::jar" ) ); + model.addDependency( toDependency( "cglib:cglib-full:2.0::jar" ) ); + addModel( model ); + + model = toModel( "cglib:cglib-full:2.0" ); + addModel( model ); + + model = toModel( "org.apache.maven.continuum:continuum-security:1.1-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.continuum:continuum-parent:1.1-SNAPSHOT" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-rbac-role-manager:1.0-alpha-1-SNAPSHOT" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-rbac:1.0-alpha-1-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-model:1.0-alpha-1-SNAPSHOT::jar" ) ); + dep = toDependency( "net.java.dev.stax-utils:stax-utils:20060502::jar" ); + addExclusion( dep, "com.bea.xml:jsr173-ri" ); + model.addDependency( dep ); + model.addDependency( toDependency( "stax:stax-api:1.0.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.woodstox:wstx-asl:3.2.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-memory:1.0-alpha-1-SNAPSHOT::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-jdo:1.0-alpha-1-SNAPSHOT::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-model:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-common-jdo:1.0-alpha-1-SNAPSHOT::jar" ) ); + dep = toDependency( "net.java.dev.stax-utils:stax-utils:20060502::jar" ); + addExclusion( dep, "com.bea.xml:jsr173-ri" ); + model.addDependency( dep ); + model.addDependency( toDependency( "stax:stax-api:1.0.1::jar" ) ); + dep = toDependency( "stax:stax:1.1.1-dev::jar", "test" ); + addExclusion( dep, "xmlbeans:xmlbeans-jsr173-api" ); + model.addDependency( dep ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.8.0.4::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-rbac:1.0-alpha-1-SNAPSHOT" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback:1.0-alpha-1-SNAPSHOT" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback:1.0-alpha-1-SNAPSHOT" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.10" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-20::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-20::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-configuration:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-system:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-policy:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-common-jdo:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-authentication-api:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-keys-api:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-keys-tests:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-keys-cached:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-keys-memory:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-keys-jdo:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-authentication-users:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-authentication-=keys=:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-authentication-memory:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-authentication-keys:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-authorization-api:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-users-api:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-users-jdo:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-users-memory:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-users-cached:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-users-tests:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-authorization-rbac:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-rbac-model:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-rbac-tests:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-rbac-memory:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-rbac-cached:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-rbac-jdo:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-rbac-role-manager:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-xwork-integration:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-taglib:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-xwork-content:1.0-alpha-1-SNAPSHOT::war" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-xwork-integration:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-20::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-20::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.2::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-ehcache:1.0-alpha-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-mail-sender-api:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-mail-sender-javamail:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-expression-evaluator:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-log4j-logging:1.1-alpha-2::jar", "test" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-xwork-integration:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "xalan:xalan:2.7.0::jar" ) ); + model.addDependencyManagement( toDependency( "xml-apis:xml-apis:1.3.03::jar" ) ); + model.addDependencyManagement( toDependency( "commons-lang:commons-lang:2.2::jar" ) ); + model.addDependencyManagement( toDependency( "commons-collections:commons-collections:3.2::jar" ) ); + model.addDependencyManagement( toDependency( "commons-logging:commons-logging:1.0.4::jar" ) ); + model.addDependencyManagement( toDependency( "hsqldb:hsqldb:1.8.0.4::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.derby:derby:10.1.3.1::jar" ) ); + model.addProperty( "security.version", "1.0-alpha-1-SNAPSHOT" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-configuration:1.0-alpha-1-SNAPSHOT" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback:1.0-alpha-1-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-expression-evaluator:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-commons:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-log4j-logging:1.1-alpha-2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-expression-evaluator:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.7" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.registry:plexus-registry-commons:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.registry:plexus-registry-providers:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-test:1.0-alpha-1::jar" ) ); + dep = toDependency( "commons-configuration:commons-configuration:1.3::jar" ); + addExclusion( dep, "commons-beanutils:commons-beanutils-core" ); + addExclusion( dep, "xerces:xerces" ); + addExclusion( dep, "xerces:xercesImpl" ); + addExclusion( dep, "xalan:xalan" ); + addExclusion( dep, "xml-apis:xml-apis" ); + addExclusion( dep, "servletapi:servletapi" ); + model.addDependency( dep ); + model.addDependency( toDependency( "commons-beanutils:commons-beanutils:1.7.0::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.registry:plexus-registry-providers:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.registry:plexus-registry:1.0-alpha-1" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.registry:plexus-registry:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.9" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-17::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.registry:plexus-registry-api:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.registry:plexus-registry-test:1.0-alpha-1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.registry:plexus-registry-api:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.registry:plexus-registry:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-17::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.registry:plexus-registry-test:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.registry:plexus-registry:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-17::jar" ) ); + addModel( model ); + + model = toModel( "commons-configuration:commons-configuration:1.3" ); + model.addDependency( toDependency( "commons-collections:commons-collections:3.1::jar" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:2.1::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging-api:1.0.4::jar" ) ); + model.addDependency( toDependency( "commons-digester:commons-digester:1.6::jar" ) ); + model.addDependency( toDependency( "commons-beanutils:commons-beanutils-core:1.7.0::jar" ) ); + model.addDependency( toDependency( "commons-codec:commons-codec:1.3::jar" ) ); + model.addDependency( toDependency( "commons-jxpath:commons-jxpath:1.2::jar" ) ); + model.addDependency( toDependency( "xerces:xerces:2.2.1::jar" ) ); + model.addDependency( toDependency( "xalan:xalan:2.7.0::jar" ) ); + model.addDependency( toDependency( "xml-apis:xml-apis:2.0.2::jar" ) ); + dep = toDependency( "servletapi:servletapi:2.4::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "spice:spice-jndikit:1.1::jar", "test" ) ); + model.addDependency( toDependency( "commons-dbcp:commons-dbcp:1.1::jar", "test" ) ); + model.addDependency( toDependency( "commons-pool:commons-pool:1.1::jar", "test" ) ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.7.2.2::jar", "test" ) ); + model.addDependency( toDependency( "dbunit:dbunit:2.1::jar", "test" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "junit-addons:junit-addons:1.4::jar", "test" ) ); + model.addDependency( toDependency( "mockobjects:mockobjects-core:0.09::jar", "test" ) ); + model.addDependency( toDependency( "mockobjects:mockobjects-jdk1.4-j2ee1.3:0.09::jar", "test" ) ); + addModel( model ); + + model = toModel( "commons-lang:commons-lang:2.1" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "commons-logging:commons-logging-api:1.0.4" ); + addModel( model ); + + model = toModel( "commons-digester:commons-digester:1.6" ); + model.addDependency( toDependency( "commons-beanutils:commons-beanutils:1.6::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.1::jar" ) ); + model.addDependency( toDependency( "xml-apis:xml-apis:1.0.b2::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "commons-beanutils:commons-beanutils:1.6" ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.0::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + addModel( model ); + + model = toModel( "commons-beanutils:commons-beanutils-core:1.7.0" ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.0::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + addModel( model ); + + model = toModel( "commons-codec:commons-codec:1.3" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "commons-jxpath:commons-jxpath:1.2" ); + model.addDependency( toDependency( "xerces:xerces:1.2.3::jar" ) ); + model.addDependency( toDependency( "servletapi:servletapi:2.2::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.8::jar" ) ); + model.addDependency( toDependency( "ant:ant-optional:1.5.1::jar" ) ); + model.addDependency( toDependency( "xml-apis:xml-apis:2.0.2::jar" ) ); + model.addDependency( toDependency( "jdom:jdom:b9::jar" ) ); + model.addDependency( toDependency( "commons-beanutils:commons-beanutils:1.4::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.0::jar" ) ); + addModel( model ); + + model = toModel( "xerces:xerces:1.2.3" ); + addModel( model ); + + model = toModel( "servletapi:servletapi:2.2" ); + model.setRelocation( new VersionedReference() ); + model.getRelocation().setGroupId( "javax.servlet" ); + model.getRelocation().setArtifactId( "servlet-api" ); + model.getRelocation().setVersion( "2.2" ); + addModel( model ); + + model = toModel( "javax.servlet:servlet-api:2.2" ); + addModel( model ); + + model = toModel( "junit:junit:3.8" ); + addModel( model ); + + model = toModel( "ant:ant-optional:1.5.1" ); + addModel( model ); + + model = toModel( "jdom:jdom:b9" ); + addModel( model ); + + model = toModel( "commons-beanutils:commons-beanutils:1.4" ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.0::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + addModel( model ); + + model = toModel( "xerces:xerces:2.2.1" ); + addModel( model ); + + model = toModel( "xalan:xalan:2.7.0" ); + model.addDependency( toDependency( "xml-apis:xml-apis:2.0.2::jar" ) ); + dep = toDependency( "xerces:xercesImpl:2.6.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "servletapi:servletapi:2.4" ); + addModel( model ); + + model = toModel( "spice:spice-jndikit:1.1" ); + addModel( model ); + + model = toModel( "commons-dbcp:commons-dbcp:1.1" ); + addModel( model ); + + model = toModel( "commons-pool:commons-pool:1.1" ); + addModel( model ); + + model = toModel( "hsqldb:hsqldb:1.7.2.2" ); + addModel( model ); + + model = toModel( "dbunit:dbunit:2.1" ); + addModel( model ); + + model = toModel( "junit-addons:junit-addons:1.4" ); + addModel( model ); + + model = toModel( "mockobjects:mockobjects-core:0.09" ); + addModel( model ); + + model = toModel( "mockobjects:mockobjects-jdk1.4-j2ee1.3:0.09" ); + addModel( model ); + + model = toModel( "commons-beanutils:commons-beanutils:1.7.0" ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.3::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-log4j-logging:1.1-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-logging:1.0.2" ) ); + model.addDependency( toDependency( "log4j:log4j:1.2.8::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-logging-provider-test:1.0-alpha-2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-logging:1.0.2" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.4" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-logging-provider-test:1.0-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-logging:1.0.2" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-system:1.0-alpha-1-SNAPSHOT" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback:1.0-alpha-1-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-configuration:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authentication-api:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authorization-api:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-api:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-cached:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-api:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-cached:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authentication-memory:1.0-alpha-1-SNAPSHOT::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authentication-api:1.0-alpha-1-SNAPSHOT" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-authentication:1.0-alpha-1-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-policy:1.0-alpha-1-SNAPSHOT::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authentication:1.0-alpha-1-SNAPSHOT" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback:1.0-alpha-1-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-api:1.0-alpha-1-SNAPSHOT::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-users-api:1.0-alpha-1-SNAPSHOT" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-users:1.0-alpha-1-SNAPSHOT" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-users:1.0-alpha-1-SNAPSHOT" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback:1.0-alpha-1-SNAPSHOT" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-policy:1.0-alpha-1-SNAPSHOT" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback:1.0-alpha-1-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-configuration:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-api:1.0-alpha-1-SNAPSHOT::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authorization-api:1.0-alpha-1-SNAPSHOT" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-authorization:1.0-alpha-1-SNAPSHOT" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authorization:1.0-alpha-1-SNAPSHOT" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback:1.0-alpha-1-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-api:1.0-alpha-1-SNAPSHOT::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-users-cached:1.0-alpha-1-SNAPSHOT" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-users-providers:1.0-alpha-1-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-policy:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-ehcache:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-jdo:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-tests:1.0-alpha-1-SNAPSHOT::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-memory:1.0-alpha-1-SNAPSHOT::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-log4j-logging:1.1-alpha-2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-users-providers:1.0-alpha-1-SNAPSHOT" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-users:1.0-alpha-1-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-api:1.0-alpha-1-SNAPSHOT::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-ehcache:1.0-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.7" ) ); + model.addDependency( toDependency( "net.sf.ehcache:ehcache:1.2.4::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:3.2::jar" ) ); + addModel( model ); + + model = toModel( "net.sf.ehcache:ehcache:1.2.4" ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.4::jar", "compile" ) ); + dep = toDependency( "org.hibernate:hibernate:3.2.0.cr3::jar", "test" ); + addExclusion( dep, "javax.transaction:jta" ); + addExclusion( dep, "javax.security:jacc" ); + model.addDependency( dep ); + dep = toDependency( "net.sf.hibernate:hibernate:2.1.8::jar", "test" ); + addExclusion( dep, "javax.transaction:jta" ); + addExclusion( dep, "javax.security:jacc" ); + model.addDependency( dep ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar", "test" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "httpunit:httpunit:1.6::jar", "test" ) ); + model.addDependency( toDependency( "commons-httpclient:commons-httpclient:3.0.1::jar", "test" ) ); + model.addDependency( toDependency( "com.cenqua.clover:clover:1.3.13::jar", "test" ) ); + model.addDependency( toDependency( "checkstyle:checkstyle:4.1::jar", "test" ) ); + model.addDependency( toDependency( "checkstyle:checkstyle-optional:4.1::jar", "test" ) ); + model.addDependency( toDependency( "commons-httpclient:commons-httpclient:3.0.1::jar", "test" ) ); + model.addDependency( toDependency( "httpunit:httpunit:1.6.1::jar", "test" ) ); + model.addDependency( toDependency( "httpunit:httpunit:1.6.1::jar", "test" ) ); + model.addProperty( "licenseFile", "${basedir}/tools/clover.license" ); + addModel( model ); + + model = toModel( "org.hibernate:hibernate:3.2.0.cr3" ); + addModel( model ); + + model = toModel( "net.sf.hibernate:hibernate:2.1.8" ); + addModel( model ); + + model = toModel( "httpunit:httpunit:1.6" ); + model.addDependency( toDependency( "xerces:xmlParserAPIs:2.2.1::jar" ) ); + model.addDependency( toDependency( "xerces:xercesImpl:2.6.2::jar" ) ); + model.addDependency( toDependency( "nekohtml:nekohtml:0.9.1::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar" ) ); + model.addDependency( toDependency( "rhino:js:1.5R4.1::jar" ) ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.3::jar" ) ); + model.addDependency( toDependency( "jtidy:jtidy:4aug2000r7-dev::jar" ) ); + model.addDependency( toDependency( "javax.activation:activation:1.0.2::jar", "test" ) ); + model.addDependency( toDependency( "javax.mail:mail:1.3.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "xerces:xmlParserAPIs:2.2.1" ); + addModel( model ); + + model = toModel( "nekohtml:nekohtml:0.9.1" ); + model.addDependency( toDependency( "xerces:xerces:2.4.0::jar" ) ); + addModel( model ); + + model = toModel( "rhino:js:1.5R4.1" ); + addModel( model ); + + model = toModel( "javax.activation:activation:1.0.2" ); + addModel( model ); + + model = toModel( "javax.mail:mail:1.3.1" ); + model.addDependency( toDependency( "javax.activation:activation:1.0.2::jar", "compile" ) ); + addModel( model ); + + model = toModel( "commons-httpclient:commons-httpclient:3.0.1" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.3::jar" ) ); + model.addDependency( toDependency( "commons-codec:commons-codec:1.2::jar" ) ); + addModel( model ); + + model = toModel( "commons-codec:commons-codec:1.2" ); + addModel( model ); + + model = toModel( "com.cenqua.clover:clover:1.3.13" ); + addModel( model ); + + model = toModel( "checkstyle:checkstyle:4.1" ); + model.addDependency( toDependency( "antlr:antlr:2.7.2::jar" ) ); + model.addDependency( toDependency( "commons-beanutils:commons-beanutils-core:1.7.0::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.1::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.3::jar" ) ); + addModel( model ); + + model = toModel( "antlr:antlr:2.7.2" ); + addModel( model ); + + model = toModel( "checkstyle:checkstyle-optional:4.1" ); + model.addDependency( toDependency( "checkstyle:checkstyle:4.1::jar" ) ); + addModel( model ); + + model = toModel( "httpunit:httpunit:1.6.1" ); + addModel( model ); + + model = toModel( "commons-collections:commons-collections:3.2" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-users-jdo:1.0-alpha-1-SNAPSHOT" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-users-providers:1.0-alpha-1-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-common-jdo:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-policy:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-tests:1.0-alpha-1-SNAPSHOT::jar", "test" ) ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.8.0.4::jar", "test" ) ); + dep = toDependency( "net.java.dev.stax-utils:stax-utils:20060502::jar" ); + addExclusion( dep, "com.bea.xml:jsr173-ri" ); + model.addDependency( dep ); + model.addDependency( toDependency( "stax:stax-api:1.0.1::jar" ) ); + model.addDependency( toDependency( "woodstox:wstx-asl:3.2.0::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-utils:1.2" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.5" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus:1.0.5" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-common-jdo:1.0-alpha-1-SNAPSHOT" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-common:1.0-alpha-1-SNAPSHOT" ) ); + dep = toDependency( "org.codehaus.plexus:plexus-jdo2:1.0-alpha-8::jar" ); + addExclusion( dep, "xerces:xercesImpl" ); + addExclusion( dep, "xerces:xmlParserAPIs" ); + model.addDependency( dep ); + dep = toDependency( "jpox:jpox:1.1.7::jar", "compile" ); + addExclusion( dep, "javax.sql:jdbc-stdext" ); + model.addDependency( dep ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.8.0.4::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-configuration:1.0-alpha-1-SNAPSHOT::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-common:1.0-alpha-1-SNAPSHOT" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback:1.0-alpha-1-SNAPSHOT" ) ); + addModel( model ); + + model = toModel( "hsqldb:hsqldb:1.8.0.4" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-users-tests:1.0-alpha-1-SNAPSHOT" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-users:1.0-alpha-1-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-policy:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.2::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar" ) ); + addModel( model ); + + model = toModel( "woodstox:wstx-asl:3.2.0" ); + model.setRelocation( new VersionedReference() ); + model.getRelocation().setGroupId( "org.codehaus.woodstox" ); + addModel( model ); + + model = toModel( "org.codehaus.woodstox:wstx-asl:3.2.0" ); + model.addDependency( toDependency( "stax:stax-api:1.0.1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-users-memory:1.0-alpha-1-SNAPSHOT" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-users-providers:1.0-alpha-1-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-policy:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-tests:1.0-alpha-1-SNAPSHOT::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-keys-api:1.0-alpha-1-SNAPSHOT" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-keys:1.0-alpha-1-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-digest:1.0::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-keys:1.0-alpha-1-SNAPSHOT" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback:1.0-alpha-1-SNAPSHOT" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-digest:1.0" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.7" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-keys-cached:1.0-alpha-1-SNAPSHOT" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-keys-providers:1.0-alpha-1-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-api:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-ehcache:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-jdo:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-tests:1.0-alpha-1-SNAPSHOT::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-memory:1.0-alpha-1-SNAPSHOT::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-log4j-logging:1.1-alpha-2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-keys-providers:1.0-alpha-1-SNAPSHOT" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-keys:1.0-alpha-1-SNAPSHOT" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-keys-jdo:1.0-alpha-1-SNAPSHOT" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-keys-providers:1.0-alpha-1-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-api:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-common-jdo:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-tests:1.0-alpha-1-SNAPSHOT::jar", "test" ) ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.8.0.4::jar", "test" ) ); + dep = toDependency( "net.java.dev.stax-utils:stax-utils:20060502::jar" ); + addExclusion( dep, "com.bea.xml:jsr173-ri" ); + model.addDependency( dep ); + model.addDependency( toDependency( "stax:stax-api:1.0.1::jar" ) ); + model.addDependency( toDependency( "woodstox:wstx-asl:3.2.0::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-keys-tests:1.0-alpha-1-SNAPSHOT" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-keys:1.0-alpha-1-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-api:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-keys-memory:1.0-alpha-1-SNAPSHOT" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-keys-providers:1.0-alpha-1-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-api:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-tests:1.0-alpha-1-SNAPSHOT::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authentication-memory:1.0-alpha-1-SNAPSHOT" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-authentication-providers:1.0-alpha-1-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authentication-api:1.0-alpha-1-SNAPSHOT::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authentication-providers:1.0-alpha-1-SNAPSHOT" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-authentication:1.0-alpha-1-SNAPSHOT" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authentication-users:1.0-alpha-1-SNAPSHOT" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-authentication-providers:1.0-alpha-1-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authentication-api:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-policy:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-cached:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-memory:1.0-alpha-1-SNAPSHOT::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authentication-=keys=:1.0-alpha-1-SNAPSHOT" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authentication-keys:1.0-alpha-1-SNAPSHOT" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-authentication-providers:1.0-alpha-1-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authentication-api:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-api:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-cached:1.0-alpha-1-SNAPSHOT::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authorization-rbac:1.0-alpha-1-SNAPSHOT" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-authorization-providers:1.0-alpha-1-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-api:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authorization-api:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-cached:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-cached:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-model:1.0-alpha-1-SNAPSHOT::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authorization-providers:1.0-alpha-1-SNAPSHOT" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-authorization:1.0-alpha-1-SNAPSHOT" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-rbac-cached:1.0-alpha-1-SNAPSHOT" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-rbac-providers:1.0-alpha-1-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-system:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authorization-api:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-model:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-ehcache:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-jdo:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-memory:1.0-alpha-1-SNAPSHOT::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-tests:1.0-alpha-1-SNAPSHOT::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-log4j-logging:1.1-alpha-2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-rbac-providers:1.0-alpha-1-SNAPSHOT" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-rbac:1.0-alpha-1-SNAPSHOT" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-rbac-model:1.0-alpha-1-SNAPSHOT" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-rbac:1.0-alpha-1-SNAPSHOT" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-rbac-jdo:1.0-alpha-1-SNAPSHOT" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-rbac-providers:1.0-alpha-1-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-model:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-tests:1.0-alpha-1-SNAPSHOT::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-common-jdo:1.0-alpha-1-SNAPSHOT::jar" ) ); + dep = toDependency( "net.java.dev.stax-utils:stax-utils:20060502::jar" ); + addExclusion( dep, "com.bea.xml:jsr173-ri" ); + model.addDependency( dep ); + model.addDependency( toDependency( "stax:stax-api:1.0.1::jar" ) ); + dep = toDependency( "stax:stax:1.1.1-dev::jar", "test" ); + addExclusion( dep, "xmlbeans:xmlbeans-jsr173-api" ); + model.addDependency( dep ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.8.0.4::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-log4j-logging:1.1-alpha-2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-rbac-tests:1.0-alpha-1-SNAPSHOT" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-rbac:1.0-alpha-1-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-system:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authorization-api:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-model:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar" ) ); + addModel( model ); + + model = toModel( "stax:stax:1.1.1-dev" ); + model.addDependency( toDependency( "xmlbeans:xmlbeans-jsr173-api:2.0-dev::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar" ) ); + addModel( model ); + + model = toModel( "xmlbeans:xmlbeans-jsr173-api:2.0-dev" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-rbac-memory:1.0-alpha-1-SNAPSHOT" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-rbac-providers:1.0-alpha-1-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-system:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authorization-api:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-model:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-tests:1.0-alpha-1-SNAPSHOT::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-xwork-integration:1.0-alpha-1-SNAPSHOT" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-xwork:1.0-alpha-1-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-configuration:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-system:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-policy:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authentication-users:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-api:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authentication-keys:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authorization-rbac:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-role-manager:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-xwork-integration:1.0-alpha-6::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-mail-sender-api:1.0-alpha-6::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-mail-sender-javamail:1.0-alpha-6::jar" ) ); + model.addDependency( toDependency( "org.extremecomponents:extremecomponents:1.0.1::jar" ) ); + model.addDependency( toDependency( "commons-beanutils:commons-beanutils-bean-collections:1.7.0::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.2::jar" ) ); + dep = toDependency( "org.codehaus.plexus:plexus-velocity:1.1.2::jar" ); + addExclusion( dep, "plexus:plexus-utils" ); + addExclusion( dep, "commons-logging:commons-logging-api" ); + model.addDependency( dep ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar", "provided" ) ); + model.addDependency( toDependency( "taglibs:standard:1.1.2::jar" ) ); + model.addDependency( toDependency( "javax.servlet:jstl:1.1.2::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:3.2::jar" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:2.2::jar" ) ); + model.addDependency( toDependency( "opensymphony:sitemesh:2.2.1::jar" ) ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.8.0.4::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-memory:1.0-alpha-1-SNAPSHOT::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-xwork:1.0-alpha-1-SNAPSHOT" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-integrations:1.0-alpha-1-SNAPSHOT" ) ); + model.addDependencyManagement( toDependency( "taglibs:standard:1.1.2::jar" ) ); + model.addDependencyManagement( toDependency( "javax.servlet:jstl:1.1.2::jar" ) ); + model.addDependencyManagement( toDependency( "javax.servlet:servlet-api:2.4::jar", "provided" ) ); + model.addDependencyManagement( toDependency( "javax.servlet:jsp-api:2.0::jar", "provided" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-integrations:1.0-alpha-1-SNAPSHOT" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback:1.0-alpha-1-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-system:1.0-alpha-1-SNAPSHOT::jar" ) ); + addModel( model ); + + model = toModel( "taglibs:standard:1.1.2" ); + addModel( model ); + + model = toModel( "javax.servlet:jstl:1.1.2" ); + model.addDependency( toDependency( "javax.servlet:jsp-api:2.0::jar", "provided" ) ); + addModel( model ); + + model = toModel( "javax.servlet:jsp-api:2.0" ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar", "compile" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-xwork-integration:1.0-alpha-6" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.12" ) ); + model.addDependency( toDependency( "org.easymock:easymock:2.2::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-17::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-17::jar" ) ); + model.addDependency( toDependency( "opensymphony:xwork:1.2.1::jar" ) ); + model.addDependency( toDependency( "opensymphony:webwork:2.2.4::jar" ) ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar", "provided" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-components:1.1.12" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.10" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-20::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-20::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.easymock:easymock:2.2" ); + addModel( model ); + + model = toModel( "opensymphony:xwork:1.2.1" ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.4::jar" ) ); + model.addDependency( toDependency( "org.rifers:rife-continuations:0.0.2::jar" ) ); + model.addDependency( toDependency( "opensymphony:oscore:2.2.4::jar" ) ); + model.addDependency( toDependency( "ognl:ognl:2.6.7::jar" ) ); + dep = toDependency( "org.springframework:spring-core:1.2.6::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "org.springframework:spring-aop:1.2.6::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "org.springframework:spring-beans:1.2.6::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "org.springframework:spring-context:1.2.6::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "org.springframework:spring-web:1.2.6::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "org.springframework:spring-mock:1.2.6::jar", "test" ) ); + dep = toDependency( "cglib:cglib:2.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependency( toDependency( "mockobjects:mockobjects-core:0.09::jar", "test" ) ); + model.addDependency( toDependency( "easymock:easymock:1.2_Java1.3::jar", "test" ) ); + model.addDependency( toDependency( "easymock:easymockclassextension:1.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.rifers:rife-continuations:0.0.2" ); + addModel( model ); + + model = toModel( "opensymphony:oscore:2.2.4" ); + addModel( model ); + + model = toModel( "org.springframework:spring-core:1.2.6" ); + model.setParentProject( toParent( "org.springframework:spring-parent:1.2.6" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.4::jar" ) ); + dep = toDependency( "log4j:log4j:1.2.9::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "commons-collections:commons-collections:3.1::jar" ) ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar", "provided" ) ); + model.addDependency( toDependency( "xml-apis:xml-apis:1.0.b2::jar", "provided" ) ); + addModel( model ); + + model = toModel( "org.springframework:spring-parent:1.2.6" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependencyManagement( toDependency( "commons-logging:commons-logging:1.0.4::jar" ) ); + dep = toDependency( "log4j:log4j:1.2.9::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "cglib:cglib:2.1_3::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "commons-attributes:commons-attributes-compiler:2.1::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "org.hibernate:hibernate:3.0.5::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "org.hibernate:hibernate-annotations:3.0beta2::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "struts:struts:1.2.7::jar" ); + addExclusion( dep, "servletapi:servletapi" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "jasperreports:jasperreports:1.0.3::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "freemarker:freemarker:2.3.4::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + model.addDependencyManagement( toDependency( "javax.servlet:jsp-api:2.0::jar", "provided" ) ); + model.addDependencyManagement( toDependency( "javax.servlet:servlet-api:2.4::jar", "provided" ) ); + model.addDependencyManagement( toDependency( "aopalliance:aopalliance:1.0::jar" ) ); + model.addDependencyManagement( toDependency( "oro:oro:2.0.8::jar" ) ); + dep = toDependency( "commons-pool:commons-pool:1.2::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "com.jamonapi:jamon:1.0::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + model.addDependencyManagement( toDependency( "xdoclet:xjavadoc:1.1::jar" ) ); + model.addDependencyManagement( toDependency( "javax.mail:mail:1.3.2::jar" ) ); + dep = toDependency( "velocity:velocity:1.4::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + model.addDependencyManagement( toDependency( "commons-collections:commons-collections:3.1::jar" ) ); + model.addDependencyManagement( toDependency( "xml-apis:xml-apis:1.0.b2::jar", "provided" ) ); + model.addDependencyManagement( toDependency( "javax.transaction:jta:1.0.1B::jar" ) ); + dep = toDependency( "jotm:jotm:2.0.10::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "net.sf.hibernate:hibernate:2.1.8::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "c3p0:c3p0:0.9.0.2::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "commons-dbcp:commons-dbcp:1.2.1::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "com.experlog:xapool:1.5.0::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + model.addDependencyManagement( toDependency( "commons-lang:commons-lang:2.1::jar" ) ); + dep = toDependency( "com.oracle.toplink:toplink:10.1.3::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "ojb:db-ojb:1.0.3::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "javax.jdo:jdo:2.0-20050809.1515::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "com.ibatis:ibatis-sqlmap:1.3.1::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "com.ibatis:ibatis2-sqlmap:2.1.5.582::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "javax.jms:jms:1.1::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "javax.ejb:ejb:2.0::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "javax.xml:jaxrpc-api:1.1::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "commons-httpclient:commons-httpclient:3.0-rc4::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "com.caucho:burlap:2.1.12::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "com.caucho:hessian:2.1.12::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + model.addDependencyManagement( toDependency( "javax.resource:connector:1.0::jar" ) ); + model.addDependencyManagement( toDependency( "ehcache:ehcache:1.1::jar" ) ); + model.addDependencyManagement( toDependency( "quartz:quartz:1.5.1::jar" ) ); + model.addDependencyManagement( toDependency( "com.servlets:cos:05Nov2002::jar" ) ); + model.addDependencyManagement( toDependency( "easymock:easymock:1.2_RC2_Java1.3::jar", "test" ) ); + model.addDependencyManagement( toDependency( "javax.servlet:jstl:1.0::jar" ) ); + model.addDependencyManagement( toDependency( "taglibs:standard:1.0.6::jar" ) ); + dep = toDependency( "javax.faces:jsf-api:1.1::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "velocity-tools:velocity-tools-generic:1.1::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "velocity-tools:velocity-tools-view:1.1::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "poi:poi:2.5.1-final-20040804::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "itext:itext:1.3::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + dep = toDependency( "net.sourceforge.jexcelapi:jxl:2.5.7::jar" ); + dep.setOptional( true ); + model.addDependencyManagement( dep ); + addModel( model ); + + model = toModel( "log4j:log4j:1.2.9" ); + addModel( model ); + + model = toModel( "cglib:cglib:2.1_3" ); + addModel( model ); + + model = toModel( "commons-attributes:commons-attributes-compiler:2.1" ); + model.addDependency( toDependency( "commons-attributes:commons-attributes-api:2.1::jar" ) ); + addModel( model ); + + model = toModel( "commons-attributes:commons-attributes-api:2.1" ); + model.addDependency( toDependency( "ant:ant:1.5::jar" ) ); + model.addDependency( toDependency( "qdox:qdox:1.5::jar" ) ); + addModel( model ); + + model = toModel( "ant:ant:1.5" ); + addModel( model ); + + model = toModel( "qdox:qdox:1.5" ); + addModel( model ); + + model = toModel( "org.hibernate:hibernate:3.0.5" ); + addModel( model ); + + model = toModel( "org.hibernate:hibernate-annotations:3.0beta2" ); + addModel( model ); + + model = toModel( "struts:struts:1.2.7" ); + addModel( model ); + + model = toModel( "jasperreports:jasperreports:1.0.3" ); + addModel( model ); + + model = toModel( "freemarker:freemarker:2.3.4" ); + addModel( model ); + + model = toModel( "aopalliance:aopalliance:1.0" ); + addModel( model ); + + model = toModel( "oro:oro:2.0.8" ); + addModel( model ); + + model = toModel( "com.jamonapi:jamon:1.0" ); + addModel( model ); + + model = toModel( "xdoclet:xjavadoc:1.1" ); + addModel( model ); + + model = toModel( "javax.mail:mail:1.3.2" ); + model.addDependency( toDependency( "javax.activation:activation:1.0.2::jar", "compile" ) ); + addModel( model ); + + model = toModel( "jotm:jotm:2.0.10" ); + addModel( model ); + + model = toModel( "c3p0:c3p0:0.9.0.2" ); + addModel( model ); + + model = toModel( "commons-dbcp:commons-dbcp:1.2.1" ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.1::jar" ) ); + model.addDependency( toDependency( "commons-pool:commons-pool:1.2::jar" ) ); + dep = toDependency( "javax.sql:jdbc-stdext:2.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "xml-apis:xml-apis:2.0.2::jar" ) ); + model.addDependency( toDependency( "xerces:xerces:2.0.2::jar" ) ); + addModel( model ); + + model = toModel( "com.experlog:xapool:1.5.0" ); + addModel( model ); + + model = toModel( "com.oracle.toplink:toplink:10.1.3" ); + addModel( model ); + + model = toModel( "ojb:db-ojb:1.0.3" ); + addModel( model ); + + model = toModel( "javax.jdo:jdo:2.0-20050809.1515" ); + addModel( model ); + + model = toModel( "com.ibatis:ibatis-sqlmap:1.3.1" ); + addModel( model ); + + model = toModel( "com.ibatis:ibatis2-sqlmap:2.1.5.582" ); + addModel( model ); + + model = toModel( "javax.jms:jms:1.1" ); + addModel( model ); + + model = toModel( "javax.ejb:ejb:2.0" ); + addModel( model ); + + model = toModel( "javax.xml:jaxrpc-api:1.1" ); + addModel( model ); + + model = toModel( "commons-httpclient:commons-httpclient:3.0-rc4" ); + addModel( model ); + + model = toModel( "com.caucho:burlap:2.1.12" ); + addModel( model ); + + model = toModel( "com.caucho:hessian:2.1.12" ); + addModel( model ); + + model = toModel( "ehcache:ehcache:1.1" ); + addModel( model ); + + model = toModel( "quartz:quartz:1.5.1" ); + addModel( model ); + + model = toModel( "com.servlets:cos:05Nov2002" ); + addModel( model ); + + model = toModel( "easymock:easymock:1.2_RC2_Java1.3" ); + addModel( model ); + + model = toModel( "javax.servlet:jstl:1.0" ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.3::jar", "provided" ) ); + addModel( model ); + + model = toModel( "taglibs:standard:1.0.6" ); + addModel( model ); + + model = toModel( "javax.faces:jsf-api:1.1" ); + addModel( model ); + + model = toModel( "velocity-tools:velocity-tools-generic:1.1" ); + addModel( model ); + + model = toModel( "velocity-tools:velocity-tools-view:1.1" ); + addModel( model ); + + model = toModel( "poi:poi:2.5.1-final-20040804" ); + addModel( model ); + + model = toModel( "itext:itext:1.3" ); + addModel( model ); + + model = toModel( "net.sourceforge.jexcelapi:jxl:2.5.7" ); + addModel( model ); + + model = toModel( "org.springframework:spring-aop:1.2.6" ); + model.setParentProject( toParent( "org.springframework:spring-parent:1.2.6" ) ); + model.addDependency( toDependency( "org.springframework:spring-beans:1.2.6::jar" ) ); + model.addDependency( toDependency( "aopalliance:aopalliance:1.0::jar" ) ); + model.addDependency( toDependency( "oro:oro:2.0.8::jar" ) ); + dep = toDependency( "commons-pool:commons-pool:1.2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "commons-attributes:commons-attributes-compiler:2.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "com.jamonapi:jamon:1.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "cglib:cglib:2.1_3::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "xdoclet:xjavadoc:1.1::jar", "test" ) ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar", "provided" ) ); + addModel( model ); + + model = toModel( "org.springframework:spring-beans:1.2.6" ); + model.setParentProject( toParent( "org.springframework:spring-parent:1.2.6" ) ); + model.addDependency( toDependency( "org.springframework:spring-core:1.2.6::jar" ) ); + dep = toDependency( "cglib:cglib:2.1_3::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar", "provided" ) ); + model.addDependency( toDependency( "javax.mail:mail:1.3.2::jar", "test" ) ); + model.addDependency( toDependency( "org.hibernate:hibernate:3.0.5::jar", "test" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.springframework:spring-context:1.2.6" ); + model.setParentProject( toParent( "org.springframework:spring-parent:1.2.6" ) ); + model.addDependency( toDependency( "org.springframework:spring-aop:1.2.6::jar" ) ); + dep = toDependency( "velocity:velocity:1.4::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "freemarker:freemarker:2.3.4::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "jasperreports:jasperreports:1.0.3::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "org.springframework:spring-web:1.2.6" ); + model.setParentProject( toParent( "org.springframework:spring-parent:1.2.6" ) ); + model.addDependency( toDependency( "javax.servlet:jsp-api:2.0::jar", "provided" ) ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar", "provided" ) ); + model.addDependency( toDependency( "javax.servlet:jstl:1.0::jar" ) ); + model.addDependency( toDependency( "org.springframework:spring-context:1.2.6::jar" ) ); + dep = toDependency( "log4j:log4j:1.2.9::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "struts:struts:1.2.7::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "com.servlets:cos:05Nov2002::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "taglibs:standard:1.0.6::jar" ) ); + dep = toDependency( "javax.faces:jsf-api:1.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "org.springframework:spring-mock:1.2.6" ); + model.setParentProject( toParent( "org.springframework:spring-parent:1.2.6" ) ); + dep = toDependency( "org.springframework:spring-jdbc:1.2.6::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "org.springframework:spring-web:1.2.6::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "javax.servlet:jsp-api:2.0::jar", "provided" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + addModel( model ); + + model = toModel( "org.springframework:spring-jdbc:1.2.6" ); + addModel( model ); + + model = toModel( "cglib:cglib:2.1" ); + model.addDependency( toDependency( "asm:asm:1.5.3::jar" ) ); + model.addDependency( toDependency( "asm:asm-util:1.3.4::jar" ) ); + model.addDependency( toDependency( "aspectwerkz:aspectwerkz-core:0.8.1::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + addModel( model ); + + model = toModel( "asm:asm:1.5.3" ); + addModel( model ); + + model = toModel( "asm:asm-util:1.3.4" ); + addModel( model ); + + model = toModel( "aspectwerkz:aspectwerkz-core:0.8.1" ); + addModel( model ); + + model = toModel( "easymock:easymockclassextension:1.1" ); + addModel( model ); + + model = toModel( "opensymphony:webwork:2.2.4" ); + model.addDependency( toDependency( "opensymphony:xwork:1.2.1::jar" ) ); + dep = toDependency( "opensymphony:xwork-tiger:1.2.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "freemarker:freemarker:2.3.4::jar" ) ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar", "provided" ) ); + model.addDependency( toDependency( "javax.servlet:jsp-api:2.0::jar", "provided" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.4::jar" ) ); + dep = toDependency( "commons-lang:commons-lang:2.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "dwr:dwr:1.1-beta-3::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "velocity:velocity:1.4::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "velocity-tools:velocity-tools:1.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "commons-fileupload:commons-fileupload:1.1.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "servlets.com:cos:05Nov2002::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "opensymphony:pell-multipart:2.1.5::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "opensymphony:sitemesh:2.2.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "jetty:org.mortbay.jetty:5.1.4::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "eclipse:jdtcore:3.1.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "jasperreports:jasperreports:1.1.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "jfree:jfreechart:1.0.0::jar" ); + addExclusion( dep, "gnujaxp:gnujaxp" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "org.apache.struts.tiles:tiles-core:0.2-SNAPSHOT::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "commons-digester:commons-digester:1.7::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "portlet-api:portlet-api:1.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "org.apache.pluto:pluto:1.0.1-rc4::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-10-SNAPSHOT::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "picocontainer:picocontainer:1.2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "picocontainer:picocontainer-gems:1.2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "nanocontainer:nanocontainer:1.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "nanocontainer:nanocontainer-nanowar:1.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "org.springframework:spring-beans:1.2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "org.springframework:spring-core:1.2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "org.springframework:spring-context:1.2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "org.springframework:spring-web:1.2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "org.springframework:spring-mock:1.2::jar", "compile" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "xpp3:xpp3:1.1.3.4-RC8::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "junit:junit:3.8.1::jar", "compile" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "jmock:jmock:1.0.1::jar", "test" ) ); + model.addDependency( toDependency( "easymock:easymock:1.2_Java1.3::jar", "test" ) ); + model.addDependency( toDependency( "easymock:easymockclassextension:1.1::jar", "test" ) ); + model.addDependency( toDependency( "jmock:jmock-cglib:1.0.1::jar", "test" ) ); + model.addDependency( toDependency( "mockobjects:mockobjects-core:0.09::jar", "test" ) ); + model.addDependency( toDependency( "mockobjects:mockobjects-jdk1.3:0.09::jar", "test" ) ); + model.addDependency( toDependency( "mockobjects:mockobjects-alt-jdk1.3:0.09::jar", "test" ) ); + model.addDependency( toDependency( "mockobjects:mockobjects-alt-jdk1.3-j2ee1.3:0.09::jar", "test" ) ); + model.addDependency( toDependency( "mockobjects:mockobjects-jdk1.3-j2ee1.3:0.09::jar", "test" ) ); + addModel( model ); + + model = toModel( "opensymphony:xwork-tiger:1.2.1" ); + addModel( model ); + + model = toModel( "commons-lang:commons-lang:2.0" ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + addModel( model ); + + model = toModel( "dwr:dwr:1.1-beta-3" ); + addModel( model ); + + model = toModel( "velocity-tools:velocity-tools:1.1" ); + addModel( model ); + + model = toModel( "commons-fileupload:commons-fileupload:1.1.1" ); + addModel( model ); + + model = toModel( "servlets.com:cos:05Nov2002" ); + addModel( model ); + + model = toModel( "opensymphony:pell-multipart:2.1.5" ); + addModel( model ); + + model = toModel( "opensymphony:sitemesh:2.2.1" ); + addModel( model ); + + model = toModel( "jetty:org.mortbay.jetty:5.1.4" ); + addModel( model ); + + model = toModel( "eclipse:jdtcore:3.1.0" ); + addModel( model ); + + model = toModel( "jasperreports:jasperreports:1.1.0" ); + addModel( model ); + + model = toModel( "jfree:jfreechart:1.0.0" ); + addModel( model ); + + model = toModel( "org.apache.struts.tiles:tiles-core:0.2-SNAPSHOT" ); + addModel( model ); + + model = toModel( "commons-digester:commons-digester:1.7" ); + model.addDependency( toDependency( "commons-beanutils:commons-beanutils:1.6::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.1::jar" ) ); + model.addDependency( toDependency( "xml-apis:xml-apis:1.0.b2::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "portlet-api:portlet-api:1.0" ); + addModel( model ); + + model = toModel( "org.apache.pluto:pluto:1.0.1-rc4" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-container-default:1.0-alpha-10-SNAPSHOT" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0.6-SNAPSHOT" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.2::jar" ) ); + model.addDependency( toDependency( "classworlds:classworlds:1.1::jar" ) ); + model.addDependency( toDependency( "jmock:jmock:1.0.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-containers:1.0.6-SNAPSHOT" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.8-SNAPSHOT" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus:1.0.8-SNAPSHOT" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "picocontainer:picocontainer:1.2" ); + addModel( model ); + + model = toModel( "picocontainer:picocontainer-gems:1.2" ); + addModel( model ); + + model = toModel( "nanocontainer:nanocontainer:1.0" ); + addModel( model ); + + model = toModel( "nanocontainer:nanocontainer-nanowar:1.0" ); + addModel( model ); + + model = toModel( "org.springframework:spring-beans:1.2" ); + addModel( model ); + + model = toModel( "org.springframework:spring-core:1.2" ); + addModel( model ); + + model = toModel( "org.springframework:spring-context:1.2" ); + addModel( model ); + + model = toModel( "org.springframework:spring-web:1.2" ); + addModel( model ); + + model = toModel( "org.springframework:spring-mock:1.2" ); + addModel( model ); + + model = toModel( "xpp3:xpp3:1.1.3.4-RC8" ); + addModel( model ); + + model = toModel( "mockobjects:mockobjects-jdk1.3:0.09" ); + addModel( model ); + + model = toModel( "mockobjects:mockobjects-alt-jdk1.3:0.09" ); + addModel( model ); + + model = toModel( "mockobjects:mockobjects-alt-jdk1.3-j2ee1.3:0.09" ); + addModel( model ); + + model = toModel( "mockobjects:mockobjects-jdk1.3-j2ee1.3:0.09" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-mail-sender-javamail:1.0-alpha-6" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-mail-senders:1.0-alpha-6" ) ); + model.addDependency( toDependency( "javax.mail:mail:1.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-mail-sender-test:1.0-alpha-6::jar", "test" ) ); + dep = toDependency( "org.codehaus.plexus:plexus-naming:1.0-alpha-1::jar", "test" ); + addExclusion( dep, "geronimo-spec:geronimo-spec-javamail" ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-mail-senders:1.0-alpha-6" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-mail-sender:1.0-alpha-6" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-mail-sender-api:1.0-alpha-6::jar" ) ); + addModel( model ); + + model = toModel( "javax.mail:mail:1.4" ); + model.addDependency( toDependency( "javax.activation:activation:1.1::jar" ) ); + addModel( model ); + + model = toModel( "javax.activation:activation:1.1" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-mail-sender-test:1.0-alpha-6" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-mail-senders:1.0-alpha-6" ) ); + model.addDependency( toDependency( "dumbster:dumbster:1.5::jar" ) ); + addModel( model ); + + model = toModel( "dumbster:dumbster:1.5" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-naming:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.6" ) ); + model.addDependency( toDependency( "directory-naming:naming-core:0.8::jar" ) ); + model.addDependency( toDependency( "directory-naming:naming-java:0.8::jar" ) ); + model.addDependency( toDependency( "directory-naming:naming-factory:0.8::jar" ) ); + model.addDependency( toDependency( "commons-dbcp:commons-dbcp:1.2.1::jar" ) ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.7.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "directory-naming:naming-core:0.8" ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.3::jar" ) ); + addModel( model ); + + model = toModel( "directory-naming:naming-java:0.8" ); + model.addDependency( toDependency( "directory-naming:naming-core:0.8::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.3::jar" ) ); + addModel( model ); + + model = toModel( "directory-naming:naming-factory:0.8" ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.3::jar" ) ); + model.addDependency( toDependency( "directory-naming:naming-core:0.8::jar" ) ); + model.addDependency( toDependency( "geronimo-spec:geronimo-spec-javamail:1.3.1-rc1::jar" ) ); + addModel( model ); + + model = toModel( "geronimo-spec:geronimo-spec-javamail:1.3.1-rc1" ); + addModel( model ); + + model = toModel( "hsqldb:hsqldb:1.7.1" ); + addModel( model ); + + model = toModel( "org.extremecomponents:extremecomponents:1.0.1" ); + dep = toDependency( "avalon-framework:avalon-framework:4.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "batik:batik:1.5-fop-0.20-5::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "commons-beanutils:commons-beanutils:1.7.0::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:3.0::jar" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:2.0::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.4::jar" ) ); + dep = toDependency( "fop:fop:0.20.5::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + dep = toDependency( "poi:poi:2.5.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "servletapi:servletapi:2.3::jar", "provided" ) ); + model.addDependency( toDependency( "taglibs:standard:1.0.2::jar" ) ); + dep = toDependency( "xalan:xalan:2.5.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "xerces:xercesImpl:2.6.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "xml-apis:xml-apis:2.0.2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "avalon-framework:avalon-framework:4.0" ); + addModel( model ); + + model = toModel( "batik:batik:1.5-fop-0.20-5" ); + addModel( model ); + + model = toModel( "commons-collections:commons-collections:3.0" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "fop:fop:0.20.5" ); + addModel( model ); + + model = toModel( "poi:poi:2.5.1" ); + model.setRelocation( new VersionedReference() ); + model.getRelocation().setGroupId( "poi" ); + model.getRelocation().setArtifactId( "poi" ); + model.getRelocation().setVersion( "2.5.1-final-20040804" ); + addModel( model ); + + model = toModel( "taglibs:standard:1.0.2" ); + addModel( model ); + + model = toModel( "xerces:xercesImpl:2.6.1" ); + addModel( model ); + + model = toModel( "commons-beanutils:commons-beanutils-bean-collections:1.7.0" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-velocity:1.1.2" ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-7::jar", "compile" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "classworlds:classworlds:1.1-alpha-2::jar", "compile" ) ); + model.addDependency( toDependency( "plexus:plexus-utils:1.0.2::jar", "compile" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.0::jar", "compile" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging-api:1.0.4::jar", "compile" ) ); + model.addDependency( toDependency( "velocity:velocity:1.4::jar", "compile" ) ); + addModel( model ); + + model = toModel( "commons-lang:commons-lang:2.2" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-taglib:1.0-alpha-1-SNAPSHOT" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-integrations:1.0-alpha-1-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-system:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-xwork-integration:1.0-alpha-6::jar" ) ); + model.addDependency( toDependency( "taglibs:standard:1.1.2::jar" ) ); + model.addDependency( toDependency( "javax.servlet:jstl:1.1.2::jar" ) ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar", "provided" ) ); + model.addDependency( toDependency( "javax.servlet:jsp-api:2.0::jar", "provided" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-xwork-content:1.0-alpha-1-SNAPSHOT" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-xwork:1.0-alpha-1-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-xwork-integration:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-taglib:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "xml-apis:xml-apis:1.3.03" ); + model.setParentProject( toParent( "org.apache:apache:1" ) ); + addModel( model ); + + model = toModel( "org.apache.derby:derby:10.1.3.1" ); + addModel( model ); + + model = toModel( "org.codehaus.woodstox:wstx-asl:3.2.1" ); + model.addDependency( toDependency( "stax:stax-api:1.0.1::jar" ) ); + addModel( model ); + + model = toModel( "hsqldb:hsqldb:1.7.3.3" ); + addModel( model ); + + model = toModel( "org.apache.maven.continuum:continuum-test:1.1-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.continuum:continuum-parent:1.1-SNAPSHOT" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-jdo2:1.0-alpha-8::jar" ) ); + model.addDependency( toDependency( "jpox:jpox-enhancer:1.1.7::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.continuum:continuum-api:1.1-SNAPSHOT::jar" ) ); + addModel( model ); + + model = toModel( "jpox:jpox-enhancer:1.1.7" ); + model.setParentProject( toParent( "jpox:jpox-parent:1.1.7" ) ); + model.addDependency( toDependency( "jpox:jpox:1.1.7::jar" ) ); + model.addDependency( toDependency( "org.apache.bcel:bcel:5.2::jar" ) ); + model.addDependency( toDependency( "ant:ant:1.6::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.bcel:bcel:5.2" ); + model.addDependency( toDependency( "jakarta-regexp:jakarta-regexp:1.4::jar" ) ); + addModel( model ); + + model = toModel( "jakarta-regexp:jakarta-regexp:1.4" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-mail-sender-simple:1.0-alpha-6" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-mail-senders:1.0-alpha-6" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-mail-sender-test:1.0-alpha-6::jar", "test" ) ); + model.addDependency( toDependency( "dumbster:dumbster:1.5::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.continuum:continuum-web:1.1-SNAPSHOT" ); + addModel( model ); + + model = toModel( "org.apache.maven.continuum:continuum-xmlrpc-api:1.1-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.continuum:continuum-xmlrpc:1.1-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.continuum:continuum-api:1.1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.xmlrpc:xmlrpc-common:3.0::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.continuum:continuum-xmlrpc:1.1-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.continuum:continuum-parent:1.1-SNAPSHOT" ) ); + addModel( model ); + + model = toModel( "org.apache.xmlrpc:xmlrpc-common:3.0" ); + model.setParentProject( toParent( "org.apache.xmlrpc:xmlrpc:3.0" ) ); + model.addDependency( toDependency( "org.apache.ws.commons:ws-commons-util:1.0.1::jar" ) ); + model.addDependency( toDependency( "jaxme:jaxmeapi:0.5.1::jar", "provided" ) ); + addModel( model ); + + model = toModel( "org.apache.xmlrpc:xmlrpc:3.0" ); + model.setParentProject( toParent( "org.apache:apache:3" ) ); + model.addDependencyManagement( toDependency( "commons-httpclient:commons-httpclient:3.0.1::jar", "provided" ) ); + model.addDependencyManagement( toDependency( "commons-logging:commons-logging:1.1::jar" ) ); + model.addDependencyManagement( toDependency( "javax.servlet:servlet-api:2.4::jar", "provided" ) ); + model.addDependencyManagement( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependencyManagement( toDependency( "org.apache.ws.commons:ws-commons-util:1.0.1::jar" ) ); + model.addDependencyManagement( toDependency( "jaxme:jaxmeapi:0.5.1::jar", "provided" ) ); + addModel( model ); + + model = toModel( "commons-logging:commons-logging:1.1" ); + model.addDependency( toDependency( "log4j:log4j:1.2.12::jar" ) ); + model.addDependency( toDependency( "logkit:logkit:1.0.1::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "avalon-framework:avalon-framework:4.1.3::jar" ) ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.3::jar" ) ); + addModel( model ); + + model = toModel( "log4j:log4j:1.2.12" ); + addModel( model ); + + model = toModel( "org.apache.ws.commons:ws-commons-util:1.0.1" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar" ) ); + model.addDependency( toDependency( "xml-apis:xml-apis:1.0.b2::jar" ) ); + addModel( model ); + + model = toModel( "jaxme:jaxmeapi:0.5.1" ); + addModel( model ); + + model = toModel( "org.apache.maven.continuum:continuum-xmlrpc-client:1.1-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.continuum:continuum-xmlrpc:1.1-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.continuum:continuum-xmlrpc-api:1.1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.xmlrpc:xmlrpc-client:3.0::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.xmlrpc:xmlrpc-client:3.0" ); + model.setParentProject( toParent( "org.apache.xmlrpc:xmlrpc:3.0" ) ); + model.addDependency( toDependency( "org.apache.xmlrpc:xmlrpc-common:3.0::jar" ) ); + model.addDependency( toDependency( "commons-httpclient:commons-httpclient:3.0.1::jar", "provided" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.continuum:continuum-xmlrpc-server:1.1-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.continuum:continuum-xmlrpc:1.1-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.continuum:continuum-xmlrpc-api:1.1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.continuum:continuum-security:1.1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-system:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-xwork-integration:1.0-alpha-6::jar" ) ); + model.addDependency( toDependency( "org.apache.xmlrpc:xmlrpc-server:3.0::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.xmlrpc:xmlrpc-server:3.0" ); + model.setParentProject( toParent( "org.apache.xmlrpc:xmlrpc:3.0" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.1::jar" ) ); + model.addDependency( toDependency( "org.apache.xmlrpc:xmlrpc-common:3.0::jar" ) ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar", "provided" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.continuum:continuum-plexus-application:1.1-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.continuum:continuum-parent:1.1-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.continuum:continuum-webapp:1.1-SNAPSHOT::war" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.continuum:continuum-webapp:1.1-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.continuum:continuum-parent:1.1-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.continuum:continuum-configuration:1.1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-api:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-commons:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.shared:maven-app-configuration-model:1.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.shared:maven-app-configuration-web:1.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.continuum:continuum-core:1.1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.continuum:continuum-security:1.1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-xwork-integration:1.0-alpha-6::jar" ) ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar", "provided" ) ); + model.addDependency( toDependency( "javax.servlet:jsp-api:2.0::jar", "provided" ) ); + model.addDependency( toDependency( "opensymphony:sitemesh:2.2.1::jar" ) ); + dep = toDependency( "org.extremecomponents:extremecomponents:1.0.1::jar" ); + addExclusion( dep, "commons-collections:commons-collections" ); + model.addDependency( dep ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-log4j-logging:1.1-alpha-2::jar" ) ); + model.addDependency( toDependency( "org.apache.derby:derby:10.1.3.1::jar", "provided" ) ); + model.addDependency( toDependency( "commons-fileupload:commons-fileupload:1.1::jar" ) ); + model.addDependency( toDependency( "taglibs:standard:1.1.2::jar" ) ); + model.addDependency( toDependency( "javax.servlet:jstl:1.1.2::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-bazaar:1.0-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-clearcase:1.0-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-cvsjava:1.0-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-cvsexe:1.0-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-hg:1.0-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-local:1.0-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-perforce:1.0-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-starteam:1.0-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-svnexe:1.0-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-synergy:1.0-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-vss:1.0-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.continuum:continuum-notifier-irc:1.1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.continuum:continuum-notifier-jabber:1.1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.continuum:continuum-notifier-msn:1.1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.continuum:continuum-notifier-wagon:1.1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.continuum:continuum-xmlrpc-server:1.1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-beta-2::jar", "runtime" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-file:1.0-beta-2::jar", "runtime" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-http-lightweight:1.0-beta-2::jar", "runtime" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-ssh:1.0-beta-2::jar", "runtime" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-ssh-external:1.0-beta-2::jar", "runtime" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-webdav:1.0-beta-2::jar", "runtime" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-xwork-content:1.0-alpha-1-SNAPSHOT::war", "runtime" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-xwork-integration:1.0-alpha-1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-taglib:1.0-alpha-1-SNAPSHOT::jar" ) ); + dep = toDependency( "org.codehaus.plexus:plexus-jdo2:1.0-alpha-8::jar" ); + addExclusion( dep, "xerces:xercesImpl" ); + addExclusion( dep, "xerces:xmlParserAPIs" ); + model.addDependency( dep ); + model.addDependency( toDependency( "geronimo-spec:geronimo-spec-jta:1.0.1B-rc2::jar", "provided" ) ); + dep = toDependency( "jpox:jpox:1.1.7::jar" ); + addExclusion( dep, "javax.sql:jdbc-stdext" ); + model.addDependency( dep ); + model.addDependency( toDependency( "commons-lang:commons-lang:2.2::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:3.2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-mail-sender-javamail:1.0-alpha-6::jar" ) ); + model.addDependency( toDependency( "javax.mail:mail:1.4::jar", "provided" ) ); + model.addDependency( toDependency( "javax.activation:activation:1.1::jar", "provided" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.registry:plexus-registry-api:1.0-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus.registry:plexus-registry:1.0-alpha-2" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-17::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.registry:plexus-registry:1.0-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.12" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-17::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.registry:plexus-registry-api:1.0-alpha-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.registry:plexus-registry-test:1.0-alpha-2::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.registry:plexus-registry-test:1.0-alpha-2" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.registry:plexus-registry-commons:1.0-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus.registry:plexus-registry-providers:1.0-alpha-2" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-api:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-test:1.0-alpha-2::jar", "test" ) ); + dep = toDependency( "commons-configuration:commons-configuration:1.3::jar" ); + addExclusion( dep, "commons-beanutils:commons-beanutils-core" ); + addExclusion( dep, "xerces:xerces" ); + addExclusion( dep, "xerces:xercesImpl" ); + addExclusion( dep, "xalan:xalan" ); + addExclusion( dep, "xml-apis:xml-apis" ); + addExclusion( dep, "servletapi:servletapi" ); + model.addDependency( dep ); + model.addDependency( toDependency( "commons-beanutils:commons-beanutils:1.7.0::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.registry:plexus-registry-providers:1.0-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus.registry:plexus-registry:1.0-alpha-2" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.shared:maven-app-configuration-model:1.0" ); + model.setParentProject( toParent( "org.apache.maven.shared:maven-app-configuration:1.0" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-api:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-20::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.shared:maven-app-configuration:1.0" ); + model.setParentProject( toParent( "org.apache.maven.shared:maven-shared-components:7" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.shared:maven-shared-components:7" ); + model.setParentProject( toParent( "org.apache.maven:maven-parent:5" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.shared:maven-app-configuration-web:1.0" ); + model.setParentProject( toParent( "org.apache.maven.shared:maven-app-configuration:1.0" ) ); + model.addDependency( toDependency( "org.apache.maven.shared:maven-app-configuration-model:1.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-project:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-http-lightweight:1.0-beta-2::jar", "runtime" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-20::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-project:2.0.4" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.4" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-settings:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact-test:2.0.4::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-profile:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-model:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact-manager:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven:2.0.4" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh:1.0-alpha-7::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh-external:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-file:1.0-alpha-7::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-http-lightweight:1.0-alpha-6::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-provider-api:1.0-alpha-6" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon:1.0-alpha-6" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon:1.0-alpha-6" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-provider-test:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "junit:junit:3.8.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-provider-test:1.0-alpha-6" ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-ssh:1.0-alpha-7" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-alpha-6" ) ); + model.addDependency( toDependency( "com.jcraft:jsch:0.1.24::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-interactivity-api:1.0-alpha-4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-providers:1.0-alpha-6" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon:1.0-alpha-6" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-test:1.0-alpha-6::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-alpha-6::jar" ) ); + addModel( model ); + + model = toModel( "com.jcraft:jsch:0.1.24" ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-ssh-external:1.0-alpha-6" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-alpha-6" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-file:1.0-alpha-7" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-alpha-6" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-http-lightweight:1.0-alpha-6" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-alpha-6" ) ); + dep = toDependency( "plexus:plexus-jetty-httpd:1.0-beta-1::jar", "test" ); + addExclusion( dep, "plexus:plexus-container-default" ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-settings:2.0.4" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.4" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-model:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-model:2.0.4" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.4" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-artifact-test:2.0.4" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.4" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-settings:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact-manager:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-artifact-manager:2.0.4" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.4" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-repository-metadata:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-file:1.0-alpha-7::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-alpha-6::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-repository-metadata:2.0.4" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.4" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-artifact:2.0.4" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.4" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-profile:2.0.4" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.4" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-model:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + addModel( model ); + + model = toModel( "commons-fileupload:commons-fileupload:1.1" ); + model.addDependency( toDependency( "commons-io:commons-io:1.1::jar" ) ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.3::jar", "provided" ) ); + model.addDependency( toDependency( "javax.portlet:portlet-api:1.0::jar", "provided" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "commons-io:commons-io:1.1" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "javax.portlet:portlet-api:1.0" ); + addModel( model ); + + model = toModel( "org.apache.maven.continuum:continuum-notifier-irc:1.1-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.continuum:continuum-notifiers:1.1-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-ircbot:1.1-alpha-6::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.continuum:continuum-notifier-api:1.1-SNAPSHOT::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-ircbot:1.1-alpha-6" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.4" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.continuum:continuum-notifier-jabber:1.1-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.continuum:continuum-notifiers:1.1-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.continuum:continuum-notifier-api:1.1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-jabber:1.0-alpha-4::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-jabber:1.0-alpha-4" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.5" ) ); + model.addDependency( toDependency( "jivesoftware:smackx:2.0.0::jar" ) ); + model.addDependency( toDependency( "jivesoftware:smack:2.0.0::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-components:1.1.5" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.5" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + addModel( model ); + + model = toModel( "jivesoftware:smackx:2.0.0" ); + addModel( model ); + + model = toModel( "jivesoftware:smack:2.0.0" ); + addModel( model ); + + model = toModel( "org.apache.maven.continuum:continuum-notifier-msn:1.1-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.continuum:continuum-notifiers:1.1-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-msn:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.continuum:continuum-notifier-api:1.1-SNAPSHOT::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-msn:1.0-alpha-2" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.4" ) ); + model.addDependency( toDependency( "jmsn:msnmlib:1.4-20050613::jar" ) ); + addModel( model ); + + model = toModel( "jmsn:msnmlib:1.4-20050613" ); + addModel( model ); + + model = toModel( "org.apache.maven.continuum:continuum-notifier-wagon:1.1-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.continuum:continuum-notifiers:1.1-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-project:2.0.5::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-notification:1.0-alpha-5::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.continuum:continuum-core:1.1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.continuum:continuum-notifier-api:1.1-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-webdav:1.0-beta-2::jar", "test" ) ); + model.addDependency( toDependency( "it.could:webdav:0.4::jar", "test" ) ); + model.addDependency( toDependency( "org.mortbay.jetty:jetty:4.2.12::jar", "test" ) ); + addModel( model ); + + model = toModel( "jpox:jpox-dbcp:1.1.7" ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-api:1.0" ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-manager-plexus:1.0" ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-provider-bazaar:1.0" ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-provider-clearcase:1.0" ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-provider-cvsjava:1.0" ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-provider-cvsexe:1.0" ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-provider-hg:1.0" ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-provider-local:1.0" ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-provider-perforce:1.0" ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-provider-starteam:1.0" ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-provider-svnexe:1.0" ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-provider-synergy:1.0" ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-provider-vss:1.0" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-rbac-role-manager:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-rbac:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-model:1.0-alpha-1::jar" ) ); + dep = toDependency( "net.java.dev.stax-utils:stax-utils:20060502::jar" ); + addExclusion( dep, "com.bea.xml:jsr173-ri" ); + model.addDependency( dep ); + model.addDependency( toDependency( "stax:stax-api:1.0.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.woodstox:wstx-asl:3.2.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-memory:1.0-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-jdo:1.0-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-model:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-common-jdo:1.0-alpha-1::jar" ) ); + dep = toDependency( "net.java.dev.stax-utils:stax-utils:20060502::jar" ); + addExclusion( dep, "com.bea.xml:jsr173-ri" ); + model.addDependency( dep ); + model.addDependency( toDependency( "stax:stax-api:1.0.1::jar" ) ); + dep = toDependency( "stax:stax:1.1.1-dev::jar", "test" ); + addExclusion( dep, "xmlbeans:xmlbeans-jsr173-api" ); + model.addDependency( dep ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.8.0.4::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-rbac:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback:1.0-alpha-1" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.10" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-20::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-20::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-configuration:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-system:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-policy:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-common-jdo:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-authentication-api:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-keys-api:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-keys-tests:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-keys-cached:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-keys-memory:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-keys-jdo:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-authentication-users:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-authentication-=keys=:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-authentication-memory:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-authentication-keys:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-authorization-api:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-users-api:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-users-jdo:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-users-memory:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-users-cached:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-users-tests:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-authorization-rbac:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-rbac-model:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-rbac-tests:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-rbac-memory:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-rbac-cached:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-rbac-jdo:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-rbac-role-manager:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-xwork-integration:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-taglib:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-xwork-content:1.0-alpha-1::war" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus.redback:redback-xwork-integration:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-20::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-20::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.2::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-ehcache:1.0-alpha-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-mail-sender-api:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-mail-sender-javamail:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-expression-evaluator:1.0-alpha-1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-log4j-logging:1.1-alpha-2::jar", "test" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-xwork-integration:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "xalan:xalan:2.7.0::jar" ) ); + model.addDependencyManagement( toDependency( "xml-apis:xml-apis:1.3.03::jar" ) ); + model.addDependencyManagement( toDependency( "commons-lang:commons-lang:2.2::jar" ) ); + model.addDependencyManagement( toDependency( "commons-collections:commons-collections:3.2::jar" ) ); + model.addDependencyManagement( toDependency( "commons-logging:commons-logging:1.0.4::jar" ) ); + model.addDependencyManagement( toDependency( "hsqldb:hsqldb:1.8.0.4::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.derby:derby:10.1.3.1::jar" ) ); + model.addProperty( "security.version", "1.0-alpha-1" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-configuration:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-expression-evaluator:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.registry:plexus-registry-commons:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-log4j-logging:1.1-alpha-2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-system:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-configuration:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authentication-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authorization-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-cached:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-cached:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authentication-memory:1.0-alpha-1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authentication-api:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-authentication:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-policy:1.0-alpha-1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authentication:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-api:1.0-alpha-1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-users-api:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-users:1.0-alpha-1" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-users:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback:1.0-alpha-1" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-policy:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-configuration:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-api:1.0-alpha-1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authorization-api:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-authorization:1.0-alpha-1" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authorization:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-api:1.0-alpha-1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-users-cached:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-users-providers:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-policy:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-ehcache:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-jdo:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-tests:1.0-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-memory:1.0-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-log4j-logging:1.1-alpha-2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-users-providers:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-users:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-api:1.0-alpha-1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-users-jdo:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-users-providers:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-common-jdo:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-policy:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-tests:1.0-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.8.0.4::jar", "test" ) ); + dep = toDependency( "net.java.dev.stax-utils:stax-utils:20060502::jar" ); + addExclusion( dep, "com.bea.xml:jsr173-ri" ); + model.addDependency( dep ); + model.addDependency( toDependency( "stax:stax-api:1.0.1::jar" ) ); + model.addDependency( toDependency( "woodstox:wstx-asl:3.2.0::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-common-jdo:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-common:1.0-alpha-1" ) ); + dep = toDependency( "org.codehaus.plexus:plexus-jdo2:1.0-alpha-8::jar" ); + addExclusion( dep, "xerces:xercesImpl" ); + addExclusion( dep, "xerces:xmlParserAPIs" ); + model.addDependency( dep ); + dep = toDependency( "jpox:jpox:1.1.7::jar", "compile" ); + addExclusion( dep, "javax.sql:jdbc-stdext" ); + model.addDependency( dep ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.8.0.4::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-configuration:1.0-alpha-1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-common:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback:1.0-alpha-1" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-users-tests:1.0-alpha-1" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-users-memory:1.0-alpha-1" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-keys-api:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-keys:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-digest:1.0::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-keys:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback:1.0-alpha-1" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-keys-cached:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-keys-providers:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-ehcache:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-jdo:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-tests:1.0-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-memory:1.0-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-log4j-logging:1.1-alpha-2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-keys-providers:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-keys:1.0-alpha-1" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-keys-jdo:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-keys-providers:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-common-jdo:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-tests:1.0-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.8.0.4::jar", "test" ) ); + dep = toDependency( "net.java.dev.stax-utils:stax-utils:20060502::jar" ); + addExclusion( dep, "com.bea.xml:jsr173-ri" ); + model.addDependency( dep ); + model.addDependency( toDependency( "stax:stax-api:1.0.1::jar" ) ); + model.addDependency( toDependency( "woodstox:wstx-asl:3.2.0::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-keys-tests:1.0-alpha-1" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-keys-memory:1.0-alpha-1" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authentication-memory:1.0-alpha-1" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authentication-users:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-authentication-providers:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authentication-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-policy:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-cached:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-memory:1.0-alpha-1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authentication-providers:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-authentication:1.0-alpha-1" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authentication-=keys=:1.0-alpha-1" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authentication-keys:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-authentication-providers:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authentication-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-cached:1.0-alpha-1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authorization-rbac:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-authorization-providers:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authorization-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-cached:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-users-cached:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-model:1.0-alpha-1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-authorization-providers:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-authorization:1.0-alpha-1" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-rbac-cached:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-rbac-providers:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-system:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authorization-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-model:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-ehcache:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-jdo:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-memory:1.0-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-tests:1.0-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-log4j-logging:1.1-alpha-2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-rbac-providers:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-rbac:1.0-alpha-1" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-rbac-model:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-rbac:1.0-alpha-1" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-rbac-jdo:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-rbac-providers:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-model:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-tests:1.0-alpha-1::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-common-jdo:1.0-alpha-1::jar" ) ); + dep = toDependency( "net.java.dev.stax-utils:stax-utils:20060502::jar" ); + addExclusion( dep, "com.bea.xml:jsr173-ri" ); + model.addDependency( dep ); + model.addDependency( toDependency( "stax:stax-api:1.0.1::jar" ) ); + dep = toDependency( "stax:stax:1.1.1-dev::jar", "test" ); + addExclusion( dep, "xmlbeans:xmlbeans-jsr173-api" ); + model.addDependency( dep ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.8.0.4::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-log4j-logging:1.1-alpha-2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-rbac-tests:1.0-alpha-1" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-rbac-memory:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-rbac-providers:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-system:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authorization-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-model:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-tests:1.0-alpha-1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-xwork-integration:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-xwork:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-configuration:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-system:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-policy:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authentication-users:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authentication-keys:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-authorization-rbac:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-rbac-role-manager:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-xwork-integration:1.0-alpha-6::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-mail-sender-api:1.0-alpha-6::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-mail-sender-javamail:1.0-alpha-6::jar" ) ); + model.addDependency( toDependency( "org.extremecomponents:extremecomponents:1.0.1::jar" ) ); + model.addDependency( toDependency( "commons-beanutils:commons-beanutils-bean-collections:1.7.0::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.2::jar" ) ); + dep = toDependency( "org.codehaus.plexus:plexus-velocity:1.1.2::jar" ); + addExclusion( dep, "plexus:plexus-utils" ); + addExclusion( dep, "commons-logging:commons-logging-api" ); + model.addDependency( dep ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar", "provided" ) ); + model.addDependency( toDependency( "taglibs:standard:1.1.2::jar" ) ); + model.addDependency( toDependency( "javax.servlet:jstl:1.1.2::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:3.2::jar" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:2.2::jar" ) ); + model.addDependency( toDependency( "opensymphony:sitemesh:2.2.1::jar" ) ); + model.addDependency( toDependency( "hsqldb:hsqldb:1.8.0.4::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-keys-memory:1.0-alpha-1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-xwork:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-integrations:1.0-alpha-1" ) ); + model.addDependencyManagement( toDependency( "taglibs:standard:1.1.2::jar" ) ); + model.addDependencyManagement( toDependency( "javax.servlet:jstl:1.1.2::jar" ) ); + model.addDependencyManagement( toDependency( "javax.servlet:servlet-api:2.4::jar", "provided" ) ); + model.addDependencyManagement( toDependency( "javax.servlet:jsp-api:2.0::jar", "provided" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-integrations:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-system:1.0-alpha-1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-taglib:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-integrations:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-system:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-xwork-integration:1.0-alpha-6::jar" ) ); + model.addDependency( toDependency( "taglibs:standard:1.1.2::jar" ) ); + model.addDependency( toDependency( "javax.servlet:jstl:1.1.2::jar" ) ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.4::jar", "provided" ) ); + model.addDependency( toDependency( "javax.servlet:jsp-api:2.0::jar", "provided" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.redback:redback-xwork-content:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.redback:redback-xwork:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-xwork-integration:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.redback:redback-taglib:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.4::jar" ) ); + addModel( model ); + + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/DepManDeepVersionDependencyGraphTest.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/DepManDeepVersionDependencyGraphTest.java new file mode 100644 index 000000000..fa5b32f11 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/DepManDeepVersionDependencyGraphTest.java @@ -0,0 +1,74 @@ +package org.apache.maven.archiva.dependency.graph; + +/* + * 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.archiva.dependency.DependencyGraphFactory; +import org.apache.maven.archiva.model.DependencyScope; +import org.apache.maven.archiva.model.VersionedReference; + +import java.util.ArrayList; +import java.util.List; + +/** + * DepManDeepVersionDependencyGraphTest + * + * DependencyGraphTest for testing net.example.depman.deepversion:A:1.0 + * + * @version $Id$ + */ +public class DepManDeepVersionDependencyGraphTest + extends AbstractDependencyGraphFactoryTestCase +{ + public void testResolvedDepsToNodes() + throws GraphTaskException + { + MemoryRepositoryDependencyGraphBuilder graphBuilder = new MemoryRepositoryDependencyGraphBuilder(); + MemoryRepository repository = new DepManDeepVersionMemoryRepository(); + graphBuilder.setMemoryRepository( repository ); + + // Create the factory, and add the test resolver. + DependencyGraphFactory factory = new DependencyGraphFactory(); + factory.setGraphBuilder( graphBuilder ); + factory.setDesiredScope( DependencyScope.TEST ); + + // Get the model to resolve from + VersionedReference rootRef = toVersionedReference( "net.example.depman.deepversion:A:1.0" ); + + // Perform the resolution. + DependencyGraph graph = factory.getGraph( rootRef ); + + // Test the results. + assertNotNull( "Graph shouldn't be null.", graph ); + + String expectedRootRef = "net.example.depman.deepversion:A:1.0"; + List expectedNodes = new ArrayList(); + + // Check for all nodes, regardless of scope. + expectedNodes.clear(); + expectedNodes.add( "net.example.depman.deepversion:B:1.0::jar" ); + expectedNodes.add( "net.example.depman.deepversion:C:1.0::jar" ); + expectedNodes.add( "net.example.depman.deepversion:D:2.0::jar" ); + expectedNodes.add( "net.example.depman.deepversion:E:3.0::jar" ); + expectedNodes.add( "net.example.depman.deepversion:F:1.0::jar" ); + + assertGraph( graph, expectedRootRef, expectedNodes ); + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/DepManDeepVersionMemoryRepository.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/DepManDeepVersionMemoryRepository.java new file mode 100644 index 000000000..13f48a633 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/DepManDeepVersionMemoryRepository.java @@ -0,0 +1,77 @@ +package org.apache.maven.archiva.dependency.graph; + +/* + * 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.archiva.model.ArchivaProjectModel; + +/** + * DepManDeepVersionMemoryRepository + * + * MemoryRepository for testing net.example.depman.deepversion:A:1.0 + * + * @version $Id$ + */ +public class DepManDeepVersionMemoryRepository + extends AbstractMemoryRepository +{ + public void initialize() + { + ArchivaProjectModel model; + + model = toModel( "net.example.depman.deepversion:A:1.0" ); + model.addDependency( toDependency( "net.example.depman.deepversion:B:1.0::jar" ) ); + model.addDependency( toDependency( "net.example.depman.deepversion:C:1.0::jar" ) ); + model.addDependencyManagement( toDependency( "net.example.depman.deepversion:D:2.0::jar" ) ); + addModel( model ); + + /* Having a depman in A for D:2.0 will cause an orphaned E:2.0 during the depman + * application phase. + * + * This is intentional, to test out the depman application and recovery. + */ + + model = toModel( "net.example.depman.deepversion:B:1.0" ); + model.addDependency( toDependency( "net.example.depman.deepversion:D:1.0::jar" ) ); + addModel( model ); + + model = toModel( "net.example.depman.deepversion:E:2.0" ); + addModel( model ); + + model = toModel( "net.example.depman.deepversion:E:3.0" ); + model.addDependency( toDependency( "net.example.depman.deepversion:F:1.0::jar" ) ); + addModel( model ); + + model = toModel( "net.example.depman.deepversion:F:1.0" ); + addModel( model ); + + model = toModel( "net.example.depman.deepversion:C:1.0" ); + model.addDependency( toDependency( "net.example.depman.deepversion:D:1.0::jar" ) ); + addModel( model ); + + model = toModel( "net.example.depman.deepversion:D:1.0" ); + model.addDependency( toDependency( "net.example.depman.deepversion:E:2.0::jar" ) ); + addModel( model ); + + model = toModel( "net.example.depman.deepversion:D:2.0" ); + model.addDependency( toDependency( "net.example.depman.deepversion:E:3.0::jar" ) ); + addModel( model ); + + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/GraphvizDotTool.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/GraphvizDotTool.java new file mode 100644 index 000000000..e33a867ea --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/GraphvizDotTool.java @@ -0,0 +1,347 @@ +package org.apache.maven.archiva.dependency.graph; + +/* + * 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.Assert; +import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.lang.StringEscapeUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.maven.archiva.dependency.DependencyGraphFactory; +import org.apache.maven.archiva.model.DependencyScope; +import org.apache.maven.archiva.model.VersionedReference; + +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.io.PrintWriter; +import java.util.Iterator; +import java.util.List; + +/** + * GraphvizDotTool - testing utility to help understand the graph. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class GraphvizDotTool + implements GraphListener +{ + private int phaseNumber = 0; + + protected VersionedReference toVersionedReference( String key ) + { + String parts[] = StringUtils.splitPreserveAllTokens( key, ':' ); + Assert.assertEquals( "Versioned Reference [" + key + "] part count.", 3, parts.length ); + + VersionedReference ref = new VersionedReference(); + ref.setGroupId( parts[0] ); + ref.setArtifactId( parts[1] ); + ref.setVersion( parts[2] ); + return ref; + } + + private DependencyGraph getDependencyGraph( MemoryRepository repository, String rootRefKey ) + throws GraphTaskException + { + MemoryRepositoryDependencyGraphBuilder graphBuilder = new MemoryRepositoryDependencyGraphBuilder(); + graphBuilder.setMemoryRepository( repository ); + + // Create the factory, and add the test resolver. + DependencyGraphFactory factory = new DependencyGraphFactory(); + factory.setGraphBuilder( graphBuilder ); + factory.setDesiredScope( DependencyScope.TEST ); + factory.addGraphListener( this ); + + // Get the model to resolve from + VersionedReference rootRef = toVersionedReference( rootRefKey ); + + // Perform the resolution. + phaseNumber = 0; + DependencyGraph graph = factory.getGraph( rootRef ); + + // Test the results. + Assert.assertNotNull( "Graph shouldn't be null.", graph ); + + return graph; + } + + public void testGenerateDots() + throws GraphTaskException + { + getDependencyGraph( new ArchivaWebappMemoryRepository(), + "org.apache.maven.archiva:archiva-webapp:1.0-alpha-2-SNAPSHOT" ); + + // getDependencyGraph( new ArchivaCommonMemoryRepository(), + // "org.apache.maven.archiva:archiva-common:1.0-alpha-2-SNAPSHOT" ); + // + // getDependencyGraph( new ArchivaXmlToolsMemoryRepository(), + // "org.apache.maven.archiva:archiva-xml-tools:1.0-alpha-2-SNAPSHOT" ); + // + // getDependencyGraph( new ContinuumStoreMemoryRepository(), + // "org.apache.maven.continuum:continuum-store:1.1-SNAPSHOT" ); + // + // getDependencyGraph( new MavenProjectInfoReportsPluginMemoryRepository(), + // "org.apache.maven.plugins:maven-project-info-reports-plugin:2.1-SNAPSHOT" ); + // + // getDependencyGraph( new WagonManagerMemoryRepository(), "org.apache.maven.wagon:wagon-manager:2.0-SNAPSHOT" ); + + getDependencyGraph( new DepManDeepVersionMemoryRepository(), "net.example.depman.deepversion:A:1.0" ); + } + + public void dependencyResolutionEvent( DependencyResolutionEvent event ) + { + /* do nothing */ + } + + public void graphError( GraphTaskException e, DependencyGraph currentGraph ) + { + /* do nothing */ + } + + public void graphPhaseEvent( GraphPhaseEvent event ) + { + String graphId = event.getGraph().getRootNode().getArtifact().getArtifactId(); + String title = "Graph: " + graphId; + + switch ( event.getType() ) + { + case GraphPhaseEvent.GRAPH_TASK_POST: + phaseNumber++; + title += " - Phase: " + phaseNumber + " - Task: " + event.getTask().getTaskId(); + writeDot( "target/graph_" + graphId + "_" + phaseNumber + "_" + event.getTask().getTaskId() + ".dot", + event.getGraph(), title ); + break; + case GraphPhaseEvent.GRAPH_DONE: + title += " FINISHED"; + writeDot( "target/graph_" + graphId + ".dot", event.getGraph(), title ); + break; + } + } + + private void writeDot( String outputFilename, DependencyGraph graph, String title ) + { + System.out.println( "Writing Graphviz output: " + outputFilename ); + try + { + File outputFile = new File( outputFilename ); + FileWriter writer = new FileWriter( outputFile ); + PrintWriter dot = new PrintWriter( writer ); + + dot.println( "// Auto generated dot file from plexus-graph-visualizer-graphviz." ); + + dot.println( "digraph example {" ); + + dot.println( "" ); + + dot.println( " // Graph Defaults" ); + dot.println( " graph [" ); + dot.println( " bgcolor=\"#ffffff\"," ); + dot.println( " fontname=\"Helvetica\"," ); + dot.println( " fontsize=\"11\"," ); + dot.println( " label=\"" + title + "\"," ); + dot.println( " labeljust=\"l\"" ); + dot.println( " rankdir=\"LR\"" ); + dot.println( " ];" ); + + // Node Defaults. + + dot.println( "" ); + dot.println( " // Node Defaults." ); + dot.println( " node [" ); + dot.println( " fontname=\"Helvetica\"," ); + dot.println( " fontsize=\"11\"," ); + dot.println( " shape=\"box\"" ); + dot.println( " ];" ); + + // Edge Defaults. + + dot.println( "" ); + dot.println( " // Edge Defaults." ); + dot.println( " edge [" ); + dot.println( " arrowsize=\"0.8\"" ); + dot.println( " fontsize=\"11\"," ); + dot.println( " ];" ); + + Iterator it; + + it = graph.getNodes().iterator(); + while ( it.hasNext() ) + { + DependencyGraphNode node = (DependencyGraphNode) it.next(); + + writeNode( dot, graph, node ); + } + + it = graph.getEdges().iterator(); + while ( it.hasNext() ) + { + DependencyGraphEdge edge = (DependencyGraphEdge) it.next(); + + DependencyGraphNode from = graph.getNode( edge.getNodeFrom() ); + DependencyGraphNode to = graph.getNode( edge.getNodeTo() ); + + writeEdge( dot, edge, from, to ); + } + + dot.println( "}" ); + dot.flush(); + dot.close(); + } + catch ( IOException e ) + { + System.err.println( "Unable to write GraphViz file " + outputFilename + " : " + e.getMessage() ); + e.printStackTrace( System.err ); + } + } + + private String toLabel( DependencyGraphNode node ) + { + StringBuffer lbl = new StringBuffer(); + + lbl.append( node.getArtifact().getGroupId() ).append( "\n" ); + lbl.append( node.getArtifact().getArtifactId() ).append( "\n" ); + lbl.append( node.getArtifact().getVersion() ); + + return StringEscapeUtils.escapeJava( lbl.toString() ); + } + + private String toId( DependencyGraphNode node ) + { + StringBuffer id = new StringBuffer(); + + String raw = DependencyGraphKeys.toKey( node.getArtifact() ); + + for ( int i = 0; i < raw.length(); i++ ) + { + char c = raw.charAt( i ); + if ( Character.isLetterOrDigit( c ) ) + { + id.append( Character.toUpperCase( c ) ); + } + else if ( ( c == '-' ) || ( c == '_' ) ) + { + id.append( "_" ); + } + } + + return id.toString(); + } + + private void writeNode( PrintWriter dot, DependencyGraph graph, DependencyGraphNode node ) + { + dot.println( "" ); + dot.println( " // Node" ); + dot.println( " \"" + toId( node ) + "\" [" ); + dot.println( " label=\"" + toLabel( node ) + "\"," ); + + List edgesTo = graph.getEdgesTo( node ); + boolean orphan = CollectionUtils.isEmpty( edgesTo ); + + if ( node.isFromParent() ) + { + dot.println( " color=\"#FF0000\"," ); + dot.println( " shape=ellipse," ); + } + else + { + dot.println( " shape=box," ); + } + + if ( node.isConflicted() ) + { + // dot.println( " fontcolor=\"#FF88FF\"," ); + dot.println( " style=filled," ); + dot.println( " fillcolor=\"#88FF88\"," ); + } + else if ( orphan ) + { + dot.println( " style=filled," ); + dot.println( " fillcolor=\"#8888FF\"," ); + } + + dot.println( " ];" ); + } + + private void writeEdge( PrintWriter dot, DependencyGraphEdge edge, DependencyGraphNode from, DependencyGraphNode to ) + { + dot.println( "" ); + dot.println( " // Edge" ); + + dot.println( " \"" + toId( from ) + "\" -> \"" + toId( to ) + "\" [" ); + + if ( edge.isDisabled() ) + { + switch ( edge.getDisabledType() ) + { + case DependencyGraph.DISABLED_CYCLIC: + dot.println( " color=\"#FF0000\"," ); + break; + case DependencyGraph.DISABLED_OPTIONAL: + dot.println( " color=\"#FF00FF\"," ); + break; + case DependencyGraph.DISABLED_NEARER_DEP: + dot.println( " color=\"#00FF00\"," ); + break; + case DependencyGraph.DISABLED_NEARER_EDGE: + dot.println( " color=\"#88FF88\"," ); + break; + default: + case DependencyGraph.DISABLED_EXCLUDED: + dot.println( " color=\"#0000FF\"," ); + break; + } + + dot.println( " label=\"" + edge.getDisabledReason() + "\"," ); + dot.println( " fontsize=\"8\"," ); + } + else if ( DependencyScope.TEST.equals( edge.getScope() ) ) + { + dot.println( " style=\"dashed\"," ); + dot.println( " color=\"#DDDDDD\"," ); + } + else if ( DependencyScope.RUNTIME.equals( edge.getScope() ) ) + { + dot.println( " style=\"dashed\"," ); + dot.println( " color=\"#DDFFDD\"," ); + dot.println( " label=\"runtime\"," ); + dot.println( " fontsize=\"8\"," ); + } + else if ( DependencyScope.PROVIDED.equals( edge.getScope() ) ) + { + dot.println( " style=\"dashed\"," ); + dot.println( " color=\"#DDDDFF\"," ); + dot.println( " label=\"provided\"," ); + dot.println( " fontsize=\"8\"," ); + } + else if ( DependencyScope.SYSTEM.equals( edge.getScope() ) ) + { + dot.println( " style=\"dashed\"," ); + dot.println( " color=\"#FFDDDD\"," ); + dot.println( " label=\"system\"," ); + dot.println( " fontsize=\"8\"," ); + } + + dot.println( " arrowtail=none," ); + dot.println( " arrowhead=normal" ); + + dot.println( " ];" ); + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/MavenProjectInfoReportsPluginDependencyGraphTest.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/MavenProjectInfoReportsPluginDependencyGraphTest.java new file mode 100644 index 000000000..c1497604f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/MavenProjectInfoReportsPluginDependencyGraphTest.java @@ -0,0 +1,135 @@ +package org.apache.maven.archiva.dependency.graph; + +/* + * 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. + */ + + +/** + * MavenProjectInfoReportsPluginDependencyGraphTest + * + * DependencyGraphTest for testing org.apache.maven.plugins:maven-project-info-reports-plugin:2.1-SNAPSHOT + * + * Generated by archivadev:generate-dependency-tests plugin + * @version $Id$ + */ +public class MavenProjectInfoReportsPluginDependencyGraphTest + extends AbstractDependencyGraphFactoryTestCase +{ + public void testResolvedDepsToNodes() + throws GraphTaskException + { +/* TODO: Can't test a snapshot dependency from the repository + MemoryRepositoryDependencyGraphBuilder graphBuilder = + new MemoryRepositoryDependencyGraphBuilder(); + MemoryRepository repository = new MavenProjectInfoReportsPluginMemoryRepository(); + graphBuilder.setMemoryRepository( repository ); + + // Create the factory, and add the test resolver. + DependencyGraphFactory factory = new DependencyGraphFactory(); + factory.setGraphBuilder( graphBuilder ); + factory.setDesiredScope( DependencyScope.TEST ); + + // Get the model to resolve from + VersionedReference rootRef = toVersionedReference( "org.apache.maven.plugins:maven-project-info-reports-plugin:2.1-SNAPSHOT"); + + // Perform the resolution. + DependencyGraph graph = factory.getGraph( rootRef ); + + // Test the results. + assertNotNull( "Graph shouldn't be null.", graph ); + + String expectedRootRef = "org.apache.maven.plugins:maven-project-info-reports-plugin:2.1-SNAPSHOT"; + List expectedNodes = new ArrayList(); + + // Check for all nodes, regardless of scope. + expectedNodes.clear(); + expectedNodes.add( "classworlds:classworlds:1.1-alpha-2::jar" ); + expectedNodes.add( "com.jcraft:jsch:0.1.27::jar" ); + expectedNodes.add( "commons-beanutils:commons-beanutils:1.7.0::jar" ); + expectedNodes.add( "commons-cli:commons-cli:1.0::jar" ); + expectedNodes.add( "commons-collections:commons-collections:3.1::jar" ); + expectedNodes.add( "commons-digester:commons-digester:1.6::jar" ); + expectedNodes.add( "commons-logging:commons-logging:1.0.4::jar" ); + expectedNodes.add( "commons-validator:commons-validator:1.2.0::jar" ); + expectedNodes.add( "httpunit:httpunit:1.6::jar" ); + expectedNodes.add( "jakarta-regexp:jakarta-regexp:1.4::jar" ); + expectedNodes.add( "javax.servlet:servlet-api:2.3::jar" ); + expectedNodes.add( "jtidy:jtidy:4aug2000r7-dev::jar" ); + expectedNodes.add( "junit:junit:3.8.1::jar" ); + expectedNodes.add( "nekohtml:nekohtml:0.9.1::jar" ); + expectedNodes.add( "org.apache.bcel:bcel:5.2::jar" ); + expectedNodes.add( "org.apache.maven:maven-artifact:2.0.4::jar" ); + expectedNodes.add( "org.apache.maven:maven-artifact-manager:2.0.2::jar" ); + expectedNodes.add( "org.apache.maven:maven-core:2.0::jar" ); + expectedNodes.add( "org.apache.maven:maven-error-diagnostics:2.0::jar" ); + expectedNodes.add( "org.apache.maven:maven-model:2.0.4::jar" ); + expectedNodes.add( "org.apache.maven:maven-monitor:2.0::jar" ); + expectedNodes.add( "org.apache.maven:maven-plugin-api:2.0.4::jar" ); + expectedNodes.add( "org.apache.maven:maven-plugin-descriptor:2.0::jar" ); + expectedNodes.add( "org.apache.maven:maven-plugin-parameter-documenter:2.0::jar" ); + expectedNodes.add( "org.apache.maven:maven-plugin-registry:2.0::jar" ); + expectedNodes.add( "org.apache.maven:maven-profile:2.0::jar" ); + expectedNodes.add( "org.apache.maven:maven-project:2.0.4::jar" ); + expectedNodes.add( "org.apache.maven:maven-repository-metadata:2.0::jar" ); + expectedNodes.add( "org.apache.maven:maven-settings:2.0.4::jar" ); + expectedNodes.add( "org.apache.maven.doxia:doxia-core:1.0-alpha-8::jar" ); + expectedNodes.add( "org.apache.maven.doxia:doxia-decoration-model:1.0-alpha-8::jar" ); + expectedNodes.add( "org.apache.maven.doxia:doxia-sink-api:1.0-alpha-8::jar" ); + expectedNodes.add( "org.apache.maven.doxia:doxia-site-renderer:1.0-alpha-8::jar" ); + expectedNodes.add( "org.apache.maven.reporting:maven-reporting-api:2.0.4::jar" ); + expectedNodes.add( "org.apache.maven.reporting:maven-reporting-impl:2.0.4::jar" ); + expectedNodes.add( "org.apache.maven.scm:maven-scm-api:1.0-beta-4::jar" ); + expectedNodes.add( "org.apache.maven.scm:maven-scm-manager-plexus:1.0-beta-4::jar" ); + expectedNodes.add( "org.apache.maven.scm:maven-scm-provider-clearcase:1.0-beta-4::jar" ); + expectedNodes.add( "org.apache.maven.scm:maven-scm-provider-cvs-commons:1.0-beta-4::jar" ); + expectedNodes.add( "org.apache.maven.scm:maven-scm-provider-cvsexe:1.0-beta-4::jar" ); + expectedNodes.add( "org.apache.maven.scm:maven-scm-provider-perforce:1.0-beta-4::jar" ); + expectedNodes.add( "org.apache.maven.scm:maven-scm-provider-starteam:1.0-beta-4::jar" ); + expectedNodes.add( "org.apache.maven.scm:maven-scm-provider-svn-commons:1.0-beta-4::jar" ); + expectedNodes.add( "org.apache.maven.scm:maven-scm-provider-svnexe:1.0-beta-4::jar" ); + expectedNodes.add( "org.apache.maven.shared:maven-dependency-tree:1.0-alpha-2::jar" ); + expectedNodes.add( "org.apache.maven.shared:maven-plugin-testing-harness:1.0::jar" ); + expectedNodes.add( "org.apache.maven.shared:maven-shared-jar:1.0-SNAPSHOT::jar" ); + expectedNodes.add( "org.apache.maven.wagon:wagon-file:1.0-beta-2::jar" ); + expectedNodes.add( "org.apache.maven.wagon:wagon-http-lightweight:1.0-beta-2::jar" ); + expectedNodes.add( "org.apache.maven.wagon:wagon-http-shared:1.0-beta-2::jar" ); + expectedNodes.add( "org.apache.maven.wagon:wagon-provider-api:1.0-beta-2::jar" ); + expectedNodes.add( "org.apache.maven.wagon:wagon-ssh:1.0-beta-2::jar" ); + expectedNodes.add( "org.apache.maven.wagon:wagon-ssh-common:1.0-beta-2::jar" ); + expectedNodes.add( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ); + expectedNodes.add( "org.codehaus.plexus:plexus-digest:1.0::jar" ); + expectedNodes.add( "org.codehaus.plexus:plexus-i18n:1.0-beta-6::jar" ); + expectedNodes.add( "org.codehaus.plexus:plexus-interactivity-api:1.0-alpha-4::jar" ); + expectedNodes.add( "org.codehaus.plexus:plexus-utils:1.1::jar" ); + expectedNodes.add( "org.codehaus.plexus:plexus-velocity:1.1.3::jar" ); + expectedNodes.add( "oro:oro:2.0.7::jar" ); + expectedNodes.add( "plexus:plexus-utils:1.0.2::jar" ); + expectedNodes.add( "regexp:regexp:1.3::jar" ); + expectedNodes.add( "rhino:js:1.5R4.1::jar" ); + expectedNodes.add( "velocity:velocity:1.4::jar" ); + expectedNodes.add( "velocity:velocity-dep:1.4::jar" ); + expectedNodes.add( "xerces:xercesImpl:2.6.2::jar" ); + expectedNodes.add( "xerces:xmlParserAPIs:2.2.1::jar" ); + expectedNodes.add( "xml-apis:xml-apis:1.0.b2::jar" ); + + assertGraph( graph, expectedRootRef, expectedNodes ); +*/ + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/MavenProjectInfoReportsPluginMemoryRepository.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/MavenProjectInfoReportsPluginMemoryRepository.java new file mode 100644 index 000000000..a61f1c5b3 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/MavenProjectInfoReportsPluginMemoryRepository.java @@ -0,0 +1,1040 @@ +package org.apache.maven.archiva.dependency.graph; + +/* + * 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.archiva.model.ArchivaProjectModel; +import org.apache.maven.archiva.model.Dependency; +import org.apache.maven.archiva.model.VersionedReference; + +/** + * MavenProjectInfoReportsPluginMemoryRepository + * + * MemoryRepository for testing org.apache.maven.plugins:maven-project-info-reports-plugin:2.1-SNAPSHOT + * + * Generated by archivadev:generate-dependency-tests plugin + * @version $Id$ + */ +public class MavenProjectInfoReportsPluginMemoryRepository + extends AbstractMemoryRepository +{ + public void initialize() + { + ArchivaProjectModel model; + Dependency dep; + + model = toModel( "org.apache.maven.plugins:maven-project-info-reports-plugin:2.1-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.plugins:maven-plugins:8" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-plugin-api:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-settings:2.0.4::jar" ) ); + model.addDependency( toDependency( "commons-validator:commons-validator:1.2.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-model:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.reporting:maven-reporting-impl:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.shared:maven-shared-jar:1.0-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.shared:maven-dependency-tree:1.0-alpha-2::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-beta-2::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-ssh:1.0-beta-2::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-file:1.0-beta-2::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-http-lightweight:1.0-beta-2::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-api:1.0-beta-4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-manager-plexus:1.0-beta-4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-perforce:1.0-beta-4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-clearcase:1.0-beta-4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-starteam:1.0-beta-4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-svnexe:1.0-beta-4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-cvsexe:1.0-beta-4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.doxia:doxia-core:1.0-alpha-8::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.doxia:doxia-site-renderer:1.0-alpha-8::jar" ) ); + model.addDependency( toDependency( "httpunit:httpunit:1.6::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven.shared:maven-plugin-testing-harness:1.0::jar", "test" ) ); + model.addProperty( "wagon.version", "1.0-beta-2" ); + model.addProperty( "scm.version", "1.0-beta-4" ); + addModel( model ); + + model = toModel( "org.apache.maven.plugins:maven-plugins:8" ); + model.setParentProject( toParent( "org.apache.maven:maven-parent:5" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-parent:5" ); + model.setParentProject( toParent( "org.apache:apache:3" ) ); + addModel( model ); + + model = toModel( "org.apache:apache:3" ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-plugin-api:2.0.4" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.4" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven:2.0.4" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh:1.0-alpha-7::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh-external:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-file:1.0-alpha-7::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-http-lightweight:1.0-alpha-6::jar" ) ); + addModel( model ); + + model = toModel( "junit:junit:3.8.1" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0.3" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + model.addDependency( toDependency( "classworlds:classworlds:1.1-alpha-2::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-containers:1.0.3" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.4" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus:1.0.4" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-utils:1.0.4" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "classworlds:classworlds:1.1-alpha-2" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-utils:1.1" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.4" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-provider-api:1.0-alpha-6" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon:1.0-alpha-6" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon:1.0-alpha-6" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-provider-test:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "junit:junit:3.8.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-provider-test:1.0-alpha-6" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8" ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar", "compile" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependency( toDependency( "classworlds:classworlds:1.1-alpha-2::jar", "compile" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-ssh:1.0-alpha-7" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-alpha-6" ) ); + model.addDependency( toDependency( "com.jcraft:jsch:0.1.24::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-interactivity-api:1.0-alpha-4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-providers:1.0-alpha-6" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon:1.0-alpha-6" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-test:1.0-alpha-6::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-alpha-6::jar" ) ); + addModel( model ); + + model = toModel( "com.jcraft:jsch:0.1.24" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-interactivity-api:1.0-alpha-4" ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-7::jar", "compile" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "classworlds:classworlds:1.1-alpha-2::jar", "compile" ) ); + model.addDependency( toDependency( "plexus:plexus-utils:1.0.2::jar", "compile" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-container-default:1.0-alpha-7" ); + model.setParentProject( toParent( "plexus:plexus-containers:1.0.2" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependency( toDependency( "plexus:plexus-utils:1.0.2::jar" ) ); + model.addDependency( toDependency( "classworlds:classworlds:1.1-alpha-2::jar" ) ); + addModel( model ); + + model = toModel( "plexus:plexus-containers:1.0.2" ); + model.setParentProject( toParent( "plexus:plexus-root:1.0.3" ) ); + addModel( model ); + + model = toModel( "plexus:plexus-root:1.0.3" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "plexus:plexus-utils:1.0.2" ); + model.setParentProject( toParent( "plexus:plexus-root:1.0.3" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-ssh-external:1.0-alpha-6" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-alpha-6" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-file:1.0-alpha-7" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-alpha-6" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-http-lightweight:1.0-alpha-6" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-alpha-6" ) ); + dep = toDependency( "plexus:plexus-jetty-httpd:1.0-beta-1::jar", "test" ); + addExclusion( dep, "plexus:plexus-container-default" ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "plexus:plexus-jetty-httpd:1.0-beta-1" ); + model.setParentProject( toParent( "plexus:plexus-components:1.0" ) ); + model.addDependency( toDependency( "jetty:jetty:4.2.10::jar" ) ); + model.addDependency( toDependency( "servletapi:servletapi:2.3::jar" ) ); + addModel( model ); + + model = toModel( "plexus:plexus-components:1.0" ); + model.setParentProject( toParent( "plexus:plexus-root:1.0" ) ); + model.addDependency( toDependency( "plexus:plexus-container-default:1.0-alpha-2::jar" ) ); + addModel( model ); + + model = toModel( "plexus:plexus-root:1.0" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "plexus:plexus-container-default:1.0-alpha-2" ); + addModel( model ); + + model = toModel( "jetty:jetty:4.2.10" ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.3::jar", "runtime" ) ); + addModel( model ); + + model = toModel( "javax.servlet:servlet-api:2.3" ); + addModel( model ); + + model = toModel( "servletapi:servletapi:2.3" ); + model.setRelocation( new VersionedReference() ); + model.getRelocation().setGroupId( "javax.servlet" ); + model.getRelocation().setArtifactId( "servlet-api" ); + model.getRelocation().setVersion( "2.3" ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-settings:2.0.4" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.4" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-model:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-model:2.0.4" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.4" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + addModel( model ); + + model = toModel( "commons-validator:commons-validator:1.2.0" ); + model.addDependency( toDependency( "commons-beanutils:commons-beanutils:1.7.0::jar" ) ); + model.addDependency( toDependency( "commons-digester:commons-digester:1.6::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.4::jar" ) ); + model.addDependency( toDependency( "oro:oro:2.0.8::jar" ) ); + model.addDependency( toDependency( "xml-apis:xml-apis:2.0.2::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "commons-beanutils:commons-beanutils:1.7.0" ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.3::jar" ) ); + addModel( model ); + + model = toModel( "commons-logging:commons-logging:1.0.3" ); + dep = toDependency( "log4j:log4j:1.2.6::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "logkit:logkit:1.0.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + addModel( model ); + + model = toModel( "log4j:log4j:1.2.6" ); + addModel( model ); + + model = toModel( "logkit:logkit:1.0.1" ); + addModel( model ); + + model = toModel( "junit:junit:3.7" ); + addModel( model ); + + model = toModel( "commons-digester:commons-digester:1.6" ); + model.addDependency( toDependency( "commons-beanutils:commons-beanutils:1.6::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.1::jar" ) ); + model.addDependency( toDependency( "xml-apis:xml-apis:1.0.b2::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "commons-beanutils:commons-beanutils:1.6" ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0::jar" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.0::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + addModel( model ); + + model = toModel( "commons-logging:commons-logging:1.0" ); + addModel( model ); + + model = toModel( "commons-collections:commons-collections:2.0" ); + addModel( model ); + + model = toModel( "commons-collections:commons-collections:2.1" ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + addModel( model ); + + model = toModel( "xml-apis:xml-apis:1.0.b2" ); + addModel( model ); + + model = toModel( "commons-logging:commons-logging:1.0.4" ); + dep = toDependency( "log4j:log4j:1.2.6::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "logkit:logkit:1.0.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + dep = toDependency( "avalon-framework:avalon-framework:4.1.3::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "avalon-framework:avalon-framework:4.1.3" ); + addModel( model ); + + model = toModel( "oro:oro:2.0.8" ); + addModel( model ); + + model = toModel( "xml-apis:xml-apis:2.0.2" ); + model.setRelocation( new VersionedReference() ); + model.getRelocation().setGroupId( "xml-apis" ); + model.getRelocation().setArtifactId( "xml-apis" ); + model.getRelocation().setVersion( "1.0.b2" ); + addModel( model ); + + model = toModel( "org.apache.maven.reporting:maven-reporting-impl:2.0.4" ); + model.setParentProject( toParent( "org.apache.maven.reporting:maven-reporting:2.0.4" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-project:2.0.4::jar" ) ); + model.addDependency( toDependency( "commons-validator:commons-validator:1.2.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.doxia:doxia-core:1.0-alpha-7::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-plugin-api:2.0.4::jar" ) ); + model.addDependency( toDependency( "oro:oro:2.0.7::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.reporting:maven-reporting-api:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.doxia:doxia-site-renderer:1.0-alpha-7::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.reporting:maven-reporting:2.0.4" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.4" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-project:2.0.4" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.4" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-settings:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact-test:2.0.4::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-profile:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-model:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact-manager:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-artifact-test:2.0.4" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.4" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-settings:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact-manager:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-artifact-manager:2.0.4" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.4" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-repository-metadata:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-file:1.0-alpha-7::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-alpha-6::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-repository-metadata:2.0.4" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.4" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-artifact:2.0.4" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.4" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-profile:2.0.4" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.4" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-model:2.0.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.doxia:doxia-core:1.0-alpha-7" ); + model.setParentProject( toParent( "org.apache.maven.doxia:doxia:1.0-alpha-7" ) ); + model.addDependency( toDependency( "oro:oro:2.0.7::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.doxia:doxia-sink-api:1.0-alpha-7::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.doxia:doxia:1.0-alpha-7" ); + addModel( model ); + + model = toModel( "oro:oro:2.0.7" ); + addModel( model ); + + model = toModel( "org.apache.maven.doxia:doxia-sink-api:1.0-alpha-7" ); + model.setParentProject( toParent( "org.apache.maven.doxia:doxia:1.0-alpha-7" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.reporting:maven-reporting-api:2.0.4" ); + model.setParentProject( toParent( "org.apache.maven.reporting:maven-reporting:2.0.4" ) ); + model.addDependency( toDependency( "org.apache.maven.doxia:doxia-sink-api:1.0-alpha-7::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.doxia:doxia-site-renderer:1.0-alpha-7" ); + model.setParentProject( toParent( "org.apache.maven.doxia:doxia:1.0-alpha-7" ) ); + model.addDependency( toDependency( "org.apache.maven.doxia:doxia-core:1.0-alpha-7::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-i18n:1.0-beta-6::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-velocity:1.1.2::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.doxia:doxia-decoration-model:1.0-alpha-7::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-i18n:1.0-beta-6" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.4" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-components:1.1.4" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.4" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-velocity:1.1.2" ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-7::jar", "compile" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "classworlds:classworlds:1.1-alpha-2::jar", "compile" ) ); + model.addDependency( toDependency( "plexus:plexus-utils:1.0.2::jar", "compile" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.0::jar", "compile" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging-api:1.0.4::jar", "compile" ) ); + model.addDependency( toDependency( "velocity:velocity:1.4::jar", "compile" ) ); + addModel( model ); + + model = toModel( "commons-logging:commons-logging-api:1.0.4" ); + addModel( model ); + + model = toModel( "velocity:velocity:1.4" ); + model.addDependency( toDependency( "velocity:velocity-dep:1.4::jar", "runtime" ) ); + addModel( model ); + + model = toModel( "velocity:velocity-dep:1.4" ); + addModel( model ); + + model = toModel( "org.apache.maven.doxia:doxia-decoration-model:1.0-alpha-7" ); + model.setParentProject( toParent( "org.apache.maven.doxia:doxia:1.0-alpha-7" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.shared:maven-shared-jar:1.0-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.shared:maven-shared-components:3" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-model:2.0.2::jar", "compile" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact-manager:2.0.2::jar", "compile" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-digest:1.0::jar" ) ); + model.addDependency( toDependency( "org.apache.bcel:bcel:5.2::jar", "compile" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:3.1::jar", "compile" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.shared:maven-shared-components:3" ); + model.setParentProject( toParent( "org.apache.maven:maven-parent:4" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-parent:4" ); + model.setParentProject( toParent( "org.apache:apache:3" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-model:2.0.2" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.2" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven:2.0.2" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh-external:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-file:1.0-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-http-lightweight:1.0-alpha-6::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-ssh:1.0-alpha-6" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-alpha-6" ) ); + model.addDependency( toDependency( "com.jcraft:jsch:0.1.24::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-interactivity-api:1.0-alpha-4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-file:1.0-alpha-6" ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-artifact-manager:2.0.2" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.2" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-repository-metadata:2.0.2::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-file:1.0-alpha-6::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact:2.0.2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-alpha-6::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-repository-metadata:2.0.2" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.2" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-artifact:2.0.2" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0.2" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-digest:1.0" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.7" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-components:1.1.7" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.8" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus:1.0.8" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.bcel:bcel:5.2" ); + model.addDependency( toDependency( "jakarta-regexp:jakarta-regexp:1.4::jar" ) ); + addModel( model ); + + model = toModel( "jakarta-regexp:jakarta-regexp:1.4" ); + addModel( model ); + + model = toModel( "commons-collections:commons-collections:3.1" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.shared:maven-dependency-tree:1.0-alpha-2" ); + model.setParentProject( toParent( "org.apache.maven.shared:maven-shared-components:5" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-project:2.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.shared:maven-shared-components:5" ); + model.setParentProject( toParent( "org.apache.maven:maven-parent:4" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-provider-api:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon:1.0-beta-2" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven:maven-parent:4" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-provider-test:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh-common-test:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh-common:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "junit:junit:3.8.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-interactivity-api:1.0-alpha-4::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-provider-test:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon:1.0-beta-2" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-beta-2::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-ssh-common-test:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-beta-2" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-ssh-common:1.0-beta-2::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-providers:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon:1.0-beta-2" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-test:1.0-beta-2::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh-common:1.0-beta-2::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh-common-test:1.0-beta-2::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-ssh-common:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-beta-2" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-interactivity-api:1.0-alpha-4::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-ssh:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-beta-2" ) ); + model.addDependency( toDependency( "com.jcraft:jsch:0.1.27::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-interactivity-api:1.0-alpha-4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-ssh-common:1.0-beta-2::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-ssh-common-test:1.0-beta-2::jar", "test" ) ); + addModel( model ); + + model = toModel( "com.jcraft:jsch:0.1.27" ); + dep = toDependency( "com.jcraft:jzlib:1.0.7::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "com.jcraft:jzlib:1.0.7" ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-file:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-beta-2" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-http-lightweight:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-beta-2" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-http-shared:1.0-beta-2::jar" ) ); + model.addDependency( toDependency( "xml-apis:xml-apis:1.0.b2::jar" ) ); + dep = toDependency( "plexus:plexus-jetty-httpd:1.0-beta-1::jar", "test" ); + addExclusion( dep, "plexus:plexus-container-default" ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-http-shared:1.0-beta-2" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:1.0-beta-2" ) ); + model.addDependency( toDependency( "jtidy:jtidy:4aug2000r7-dev::jar" ) ); + addModel( model ); + + model = toModel( "jtidy:jtidy:4aug2000r7-dev" ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-api:1.0-beta-4" ); + model.setParentProject( toParent( "org.apache.maven.scm:maven-scm:1.0-beta-4" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm:1.0-beta-4" ); + model.setParentProject( toParent( "org.apache.maven:maven-parent:4" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-manager-plexus:1.0-beta-4" ); + model.setParentProject( toParent( "org.apache.maven.scm:maven-scm-managers:1.0-beta-4" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-managers:1.0-beta-4" ); + model.setParentProject( toParent( "org.apache.maven.scm:maven-scm:1.0-beta-4" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-api:1.0-beta-4::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-provider-perforce:1.0-beta-4" ); + model.setParentProject( toParent( "org.apache.maven.scm:maven-scm-providers:1.0-beta-4" ) ); + model.addDependency( toDependency( "regexp:regexp:1.3::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-providers:1.0-beta-4" ); + model.setParentProject( toParent( "org.apache.maven.scm:maven-scm:1.0-beta-4" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-api:1.0-beta-4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-test:1.0-beta-4::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-test:1.0-beta-4" ); + model.setParentProject( toParent( "org.apache.maven.scm:maven-scm:1.0-beta-4" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-api:1.0-beta-4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-manager-plexus:1.0-beta-4::jar" ) ); + addModel( model ); + + model = toModel( "regexp:regexp:1.3" ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-provider-clearcase:1.0-beta-4" ); + model.setParentProject( toParent( "org.apache.maven.scm:maven-scm-providers:1.0-beta-4" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-provider-starteam:1.0-beta-4" ); + model.setParentProject( toParent( "org.apache.maven.scm:maven-scm-providers:1.0-beta-4" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-provider-svnexe:1.0-beta-4" ); + model.setParentProject( toParent( "org.apache.maven.scm:maven-scm-providers-svn:1.0-beta-4" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-svn-commons:1.0-beta-4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-svntest:1.0-beta-4::jar", "test" ) ); + model.addDependency( toDependency( "regexp:regexp:1.3::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-providers-svn:1.0-beta-4" ); + model.setParentProject( toParent( "org.apache.maven.scm:maven-scm-providers:1.0-beta-4" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-provider-svn-commons:1.0-beta-4" ); + model.setParentProject( toParent( "org.apache.maven.scm:maven-scm-providers-svn:1.0-beta-4" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-provider-svntest:1.0-beta-4" ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-provider-cvsexe:1.0-beta-4" ); + model.setParentProject( toParent( "org.apache.maven.scm:maven-scm-providers-cvs:1.0-beta-4" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-cvstest:1.0-beta-4::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-cvs-commons:1.0-beta-4::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-providers-cvs:1.0-beta-4" ); + model.setParentProject( toParent( "org.apache.maven.scm:maven-scm-providers:1.0-beta-4" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-provider-cvstest:1.0-beta-4" ); + addModel( model ); + + model = toModel( "org.apache.maven.scm:maven-scm-provider-cvs-commons:1.0-beta-4" ); + model.setParentProject( toParent( "org.apache.maven.scm:maven-scm-providers-cvs:1.0-beta-4" ) ); + model.addDependency( toDependency( "org.apache.maven.scm:maven-scm-provider-cvstest:1.0-beta-4::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.doxia:doxia-core:1.0-alpha-8" ); + model.setParentProject( toParent( "org.apache.maven.doxia:doxia:1.0-alpha-8" ) ); + model.addDependency( toDependency( "oro:oro:2.0.7::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.doxia:doxia-sink-api:1.0-alpha-8::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar", "runtime" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.doxia:doxia:1.0-alpha-8" ); + model.setParentProject( toParent( "org.apache.maven:maven-parent:1" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-parent:1" ); + model.setParentProject( toParent( "org.apache:apache:1" ) ); + addModel( model ); + + model = toModel( "org.apache:apache:1" ); + addModel( model ); + + model = toModel( "org.apache.maven.doxia:doxia-sink-api:1.0-alpha-8" ); + model.setParentProject( toParent( "org.apache.maven.doxia:doxia:1.0-alpha-8" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.doxia:doxia-site-renderer:1.0-alpha-8" ); + model.setParentProject( toParent( "org.apache.maven.doxia:doxia:1.0-alpha-8" ) ); + model.addDependency( toDependency( "org.apache.maven.doxia:doxia-core:1.0-alpha-8::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-i18n:1.0-beta-6::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-velocity:1.1.3::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.doxia:doxia-decoration-model:1.0-alpha-8::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-velocity:1.1.3" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.5" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:2.0::jar" ) ); + model.addDependency( toDependency( "velocity:velocity:1.4::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-components:1.1.5" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.5" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus:1.0.5" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.doxia:doxia-decoration-model:1.0-alpha-8" ); + model.setParentProject( toParent( "org.apache.maven.doxia:doxia:1.0-alpha-8" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "httpunit:httpunit:1.6" ); + model.addDependency( toDependency( "xerces:xmlParserAPIs:2.2.1::jar" ) ); + model.addDependency( toDependency( "xerces:xercesImpl:2.6.2::jar" ) ); + model.addDependency( toDependency( "nekohtml:nekohtml:0.9.1::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar" ) ); + model.addDependency( toDependency( "rhino:js:1.5R4.1::jar" ) ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.3::jar" ) ); + model.addDependency( toDependency( "jtidy:jtidy:4aug2000r7-dev::jar" ) ); + model.addDependency( toDependency( "javax.activation:activation:1.0.2::jar", "test" ) ); + model.addDependency( toDependency( "javax.mail:mail:1.3.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "xerces:xmlParserAPIs:2.2.1" ); + addModel( model ); + + model = toModel( "xerces:xercesImpl:2.6.2" ); + addModel( model ); + + model = toModel( "nekohtml:nekohtml:0.9.1" ); + model.addDependency( toDependency( "xerces:xerces:2.4.0::jar" ) ); + addModel( model ); + + model = toModel( "xerces:xerces:2.4.0" ); + model.setRelocation( new VersionedReference() ); + model.getRelocation().setGroupId( "xerces" ); + model.getRelocation().setArtifactId( "xercesImpl" ); + addModel( model ); + + model = toModel( "xerces:xercesImpl:2.4.0" ); + addModel( model ); + + model = toModel( "rhino:js:1.5R4.1" ); + addModel( model ); + + model = toModel( "javax.activation:activation:1.0.2" ); + addModel( model ); + + model = toModel( "javax.mail:mail:1.3.1" ); + model.addDependency( toDependency( "javax.activation:activation:1.0.2::jar", "compile" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.shared:maven-plugin-testing-harness:1.0" ); + model.setParentProject( toParent( "org.apache.maven.shared:maven-shared-components:7" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-project:2.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-core:2.0::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.1::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.shared:maven-shared-components:7" ); + model.setParentProject( toParent( "org.apache.maven:maven-parent:5" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-project:2.0" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact-test:2.0::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-profile:2.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-model:2.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact-manager:2.0::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact:2.0::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven:2.0" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-alpha-5::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh:1.0-alpha-5::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-file:1.0-alpha-5::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-http-lightweight:1.0-alpha-5::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-provider-api:1.0-alpha-5" ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar", "compile" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-ssh:1.0-alpha-5" ); + model.addDependency( toDependency( "com.jcraft:jsch:0.1.23::jar", "compile" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar", "compile" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-alpha-5::jar", "compile" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar", "compile" ) ); + model.addDependency( toDependency( "classworlds:classworlds:1.1-alpha-2::jar", "compile" ) ); + model.addDependency( toDependency( "plexus:plexus-utils:1.0.2::jar", "compile" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-interactivity-api:1.0-alpha-4::jar", "compile" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-test:1.0-alpha-5::jar", "test" ) ); + addModel( model ); + + model = toModel( "com.jcraft:jsch:0.1.23" ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-provider-test:1.0-alpha-5" ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-file:1.0-alpha-5" ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar", "compile" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-alpha-5::jar", "compile" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar", "test" ) ); + model.addDependency( toDependency( "classworlds:classworlds:1.1-alpha-2::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-test:1.0-alpha-5::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-http-lightweight:1.0-alpha-5" ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar", "compile" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-alpha-5::jar", "compile" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar", "test" ) ); + model.addDependency( toDependency( "servletapi:servletapi:2.3::jar", "test" ) ); + model.addDependency( toDependency( "classworlds:classworlds:1.1-alpha-2::jar", "test" ) ); + model.addDependency( toDependency( "jetty:jetty:4.2.10::jar", "test" ) ); + model.addDependency( toDependency( "plexus:plexus-jetty-httpd:1.0-beta-1::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-test:1.0-alpha-5::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-artifact-test:2.0" ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-profile:2.0" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-model:2.0::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-model:2.0" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-artifact-manager:2.0" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-repository-metadata:2.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-file:1.0-alpha-5::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact:2.0::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-alpha-5::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-repository-metadata:2.0" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-artifact:2.0" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-core:2.0" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-settings:2.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-file:1.0-alpha-5::jar", "runtime" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-plugin-parameter-documenter:2.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-http-lightweight:1.0-alpha-5::jar", "runtime" ) ); + model.addDependency( toDependency( "org.apache.maven.reporting:maven-reporting-api:2.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-profile:2.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-model:2.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact:2.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-alpha-5::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-repository-metadata:2.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-error-diagnostics:2.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-project:2.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-plugin-registry:2.0::jar" ) ); + dep = toDependency( "commons-cli:commons-cli:1.0::jar" ); + addExclusion( dep, "commons-lang:commons-lang" ); + addExclusion( dep, "commons-logging:commons-logging" ); + model.addDependency( dep ); + model.addDependency( toDependency( "org.apache.maven:maven-plugin-api:2.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-plugin-descriptor:2.0::jar" ) ); + dep = toDependency( "org.codehaus.plexus:plexus-interactivity-api:1.0-alpha-4::jar" ); + addExclusion( dep, "plexus:plexus-utils" ); + addExclusion( dep, "org.codehaus.plexus:plexus-container-default" ); + model.addDependency( dep ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact-manager:2.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-monitor:2.0::jar" ) ); + dep = toDependency( "org.apache.maven.wagon:wagon-ssh:1.0-alpha-5::jar", "runtime" ); + addExclusion( dep, "plexus:plexus-utils" ); + addExclusion( dep, "org.codehaus.plexus:plexus-container-default" ); + model.addDependency( dep ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-settings:2.0" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-model:2.0::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-plugin-parameter-documenter:2.0" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.reporting:maven-reporting-api:2.0" ); + model.setParentProject( toParent( "org.apache.maven.reporting:maven-reporting:2.0" ) ); + dep = toDependency( "doxia:doxia-sink-api:1.0-alpha-4::jar" ); + addExclusion( dep, "plexus:plexus-container-default" ); + addExclusion( dep, "plexus:plexus-utils" ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "org.apache.maven.reporting:maven-reporting:2.0" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0" ) ); + addModel( model ); + + model = toModel( "doxia:doxia-sink-api:1.0-alpha-4" ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-error-diagnostics:2.0" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-plugin-registry:2.0" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + addModel( model ); + + model = toModel( "commons-cli:commons-cli:1.0" ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0::jar" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:1.0::jar" ) ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + addModel( model ); + + model = toModel( "commons-lang:commons-lang:1.0" ); + model.addDependency( toDependency( "junit:junit:3.7::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-plugin-api:2.0" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-plugin-descriptor:2.0" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-plugin-api:2.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact:2.0::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-monitor:2.0" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0" ) ); + addModel( model ); + + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/MemoryRepository.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/MemoryRepository.java new file mode 100644 index 000000000..1e3239b6a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/MemoryRepository.java @@ -0,0 +1,35 @@ +package org.apache.maven.archiva.dependency.graph; + +/* + * 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.archiva.model.ArchivaProjectModel; + +/** + * MemoryRepository + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public interface MemoryRepository +{ + public abstract void addModel( ArchivaProjectModel model ); + + public abstract ArchivaProjectModel getProjectModel( String groupId, String artifactId, String version ); +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/MemoryRepositoryDependencyGraphBuilder.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/MemoryRepositoryDependencyGraphBuilder.java new file mode 100644 index 000000000..0f95757ae --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/MemoryRepositoryDependencyGraphBuilder.java @@ -0,0 +1,96 @@ +package org.apache.maven.archiva.dependency.graph; + +/* + * 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.archiva.model.ArchivaProjectModel; +import org.apache.maven.archiva.model.ArtifactReference; +import org.apache.maven.archiva.model.VersionedReference; + +/** + * MemoryRepositoryProjectResolver + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class MemoryRepositoryDependencyGraphBuilder + implements DependencyGraphBuilder +{ + private MemoryRepository memoryRepository; + + public ArchivaProjectModel resolveProjectModel( VersionedReference reference ) + { + ArtifactReference artifact = new ArtifactReference(); + artifact.setGroupId( reference.getGroupId() ); + artifact.setArtifactId( reference.getArtifactId() ); + artifact.setVersion( reference.getVersion() ); + artifact.setType( "pom" ); + + return resolveProjectModel( artifact ); + } + + public ArchivaProjectModel resolveProjectModel( ArtifactReference reference ) + { + ArchivaProjectModel model = memoryRepository + .getProjectModel( reference.getGroupId(), reference.getArtifactId(), reference.getVersion() ); + + if ( model == null ) + { + throw new NullPointerException( "Unable to find model for " + DependencyGraphKeys.toKey( reference ) ); + } + + if ( model.getParentProject() != null ) + { + ArchivaProjectModel parentModel = resolveProjectModel( model.getParentProject() ); + + model.getDependencies().addAll( parentModel.getDependencies() ); + model.getDependencyManagement().addAll( parentModel.getDependencyManagement() ); + } + + return model; + } + + public MemoryRepository getMemoryRepository() + { + return memoryRepository; + } + + public void setMemoryRepository( MemoryRepository memoryRepository ) + { + this.memoryRepository = memoryRepository; + } + + public DependencyGraph createGraph( VersionedReference versionedProjectReference ) + { + String groupId = versionedProjectReference.getGroupId(); + String artifactId = versionedProjectReference.getArtifactId(); + String version = versionedProjectReference.getVersion(); + + DependencyGraph graph = new DependencyGraph( groupId, artifactId, version ); + return graph; + } + + public void resolveNode( DependencyGraph graph, DependencyGraphNode fromNode, + VersionedReference versionedProjectReference ) + { + ArchivaProjectModel model = resolveProjectModel( fromNode.getArtifact() ); + + DependencyGraphUtils.addNodeFromModel( model, graph, fromNode ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/SimpleDependencyGraphTest.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/SimpleDependencyGraphTest.java new file mode 100644 index 000000000..f6da54f19 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/SimpleDependencyGraphTest.java @@ -0,0 +1,71 @@ +package org.apache.maven.archiva.dependency.graph; + +/* + * 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.archiva.dependency.DependencyGraphFactory; +import org.apache.maven.archiva.model.DependencyScope; +import org.apache.maven.archiva.model.VersionedReference; + +import java.util.ArrayList; +import java.util.List; + +/** + * SimpleDependencyGraphTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class SimpleDependencyGraphTest + extends AbstractDependencyGraphFactoryTestCase +{ + public void testResolveDependenciesBasic() throws GraphTaskException + { + MemoryRepositoryDependencyGraphBuilder graphBuilder = new MemoryRepositoryDependencyGraphBuilder(); + MemoryRepository repository = new SimpleMemoryRepository(); + graphBuilder.setMemoryRepository( repository ); + + // Create the factory, and add the test resolver. + DependencyGraphFactory factory = new DependencyGraphFactory(); + factory.setGraphBuilder( graphBuilder ); + factory.setDesiredScope( DependencyScope.TEST ); + + // Get the model to resolve from + VersionedReference rootRef = toVersionedReference( "org.apache.maven.archiva:archiva-commons:1.0" ); + + // Perform the resolution. + DependencyGraph graph = factory.getGraph( rootRef ); + + // Test the results. + assertNotNull( "Graph shouldn't be null.", graph ); + + List expectedNodes = new ArrayList(); + expectedNodes.add( "org.apache.maven.archiva:archiva-commons:1.0::pom" ); + expectedNodes.add( "org.codehaus.plexus:plexus-digest:1.0::jar" ); + expectedNodes.add( "junit:junit:3.8.1::jar" ); + assertNodes( graph, expectedNodes ); + + List expectedEdges = new ArrayList(); + expectedEdges.add( new ExpectedEdge( "org.apache.maven.archiva:archiva-commons:1.0::pom", + "org.codehaus.plexus:plexus-digest:1.0::jar" ) ); + expectedEdges.add( new ExpectedEdge( "org.codehaus.plexus:plexus-digest:1.0::jar", "junit:junit:3.8.1::jar" ) ); + + assertEdges( graph, expectedEdges ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/SimpleMemoryRepository.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/SimpleMemoryRepository.java new file mode 100644 index 000000000..efb927ff1 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/SimpleMemoryRepository.java @@ -0,0 +1,48 @@ +package org.apache.maven.archiva.dependency.graph; + +/* + * 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.archiva.model.ArchivaProjectModel; + +/** + * SimpleMemoryRepository + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class SimpleMemoryRepository + extends AbstractMemoryRepository +{ + public void initialize() + { + ArchivaProjectModel model; + + model = toModel( "org.codehaus.plexus:plexus-digest:1.0" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar" ) ); + addModel( model ); + + model = toModel( "junit:junit:3.8.1" ); + addModel( model ); + + model = toModel( "org.apache.maven.archiva:archiva-commons:1.0" ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-digest:1.0::jar" ) ); + addModel( model ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/WagonManagerDependencyGraphTest.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/WagonManagerDependencyGraphTest.java new file mode 100644 index 000000000..3fcc04c4f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/WagonManagerDependencyGraphTest.java @@ -0,0 +1,104 @@ +package org.apache.maven.archiva.dependency.graph; + +/* + * 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.archiva.dependency.DependencyGraphFactory; +import org.apache.maven.archiva.model.DependencyScope; +import org.apache.maven.archiva.model.VersionedReference; + +import java.util.ArrayList; +import java.util.List; + +/** + * WagonManagerDependencyGraphTest + * + * DependencyGraphTest for testing org.apache.maven.wagon:wagon-manager:2.0-SNAPSHOT + * + * Generated by archivadev:generate-dependency-tests plugin + * @version $Id$ + */ +public class WagonManagerDependencyGraphTest + extends AbstractDependencyGraphFactoryTestCase +{ + public void testResolvedDepsToNodes() + throws GraphTaskException + { + MemoryRepositoryDependencyGraphBuilder graphBuilder = + new MemoryRepositoryDependencyGraphBuilder(); + MemoryRepository repository = new WagonManagerMemoryRepository(); + graphBuilder.setMemoryRepository( repository ); + + // Create the factory, and add the test resolver. + DependencyGraphFactory factory = new DependencyGraphFactory(); + factory.setGraphBuilder( graphBuilder ); + factory.setDesiredScope( DependencyScope.TEST ); + + // Get the model to resolve from + VersionedReference rootRef = toVersionedReference( "org.apache.maven.wagon:wagon-manager:2.0-SNAPSHOT"); + + // Perform the resolution. + DependencyGraph graph = factory.getGraph( rootRef ); + + // Test the results. + assertNotNull( "Graph shouldn't be null.", graph ); + + String expectedRootRef = "org.apache.maven.wagon:wagon-manager:2.0-SNAPSHOT"; + List expectedNodes = new ArrayList(); + + // Check for all nodes, regardless of scope. + expectedNodes.clear(); + expectedNodes.add( "classworlds:classworlds:1.1-alpha-2::jar" ); + expectedNodes.add( "com.jcraft:jsch:0.1.27::jar" ); + expectedNodes.add( "commons-httpclient:commons-httpclient:2.0.2::jar" ); + expectedNodes.add( "commons-lang:commons-lang:2.1::jar" ); + expectedNodes.add( "commons-logging:commons-logging:1.0.4::jar" ); + expectedNodes.add( "commons-net:commons-net:1.4.1::jar" ); + expectedNodes.add( "de.zeigermann.xml:xml-im-exporter:1.1::jar" ); + expectedNodes.add( "it.could:webdav:0.4::jar" ); + expectedNodes.add( "javax.servlet:servlet-api:2.3::jar" ); + expectedNodes.add( "jdom:jdom:1.0::jar" ); + expectedNodes.add( "jtidy:jtidy:4aug2000r7-dev::jar" ); + expectedNodes.add( "junit:junit:3.8.1::jar" ); + expectedNodes.add( "org.apache.maven.wagon:wagon-file:2.0-SNAPSHOT::jar" ); + expectedNodes.add( "org.apache.maven.wagon:wagon-ftp:2.0-SNAPSHOT::jar" ); + expectedNodes.add( "org.apache.maven.wagon:wagon-http-lightweight:2.0-SNAPSHOT::jar" ); + expectedNodes.add( "org.apache.maven.wagon:wagon-http-shared:2.0-SNAPSHOT::jar" ); + expectedNodes.add( "org.apache.maven.wagon:wagon-provider-api:2.0-SNAPSHOT::jar" ); + expectedNodes.add( "org.apache.maven.wagon:wagon-ssh:2.0-SNAPSHOT::jar" ); + expectedNodes.add( "org.apache.maven.wagon:wagon-ssh-common:2.0-SNAPSHOT::jar" ); + expectedNodes.add( "org.apache.maven.wagon:wagon-ssh-external:2.0-SNAPSHOT::jar" ); + expectedNodes.add( "org.apache.maven.wagon:wagon-webdav:2.0-SNAPSHOT::jar" ); + expectedNodes.add( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ); + expectedNodes.add( "org.codehaus.plexus:plexus-component-api:1.0-alpha-16::jar" ); + expectedNodes.add( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar" ); + expectedNodes.add( "org.codehaus.plexus:plexus-interactivity-api:1.0-alpha-6::jar" ); + expectedNodes.add( "org.codehaus.plexus:plexus-utils:1.4.2-SNAPSHOT::jar" ); + expectedNodes.add( "org.codehaus.plexus.webdav:plexus-webdav-api:1.0-alpha-1::jar" ); + expectedNodes.add( "org.codehaus.plexus.webdav:plexus-webdav-simple:1.0-alpha-1::jar" ); + expectedNodes.add( "org.mortbay.jetty:jetty:6.0.2::jar" ); + expectedNodes.add( "org.mortbay.jetty:jetty-util:6.0.2::jar" ); + expectedNodes.add( "org.mortbay.jetty:servlet-api-2.5:6.0.2::jar" ); + expectedNodes.add( "oro:oro:2.0.8::jar" ); + expectedNodes.add( "slide:slide-webdavlib:2.1::jar" ); + + assertGraph( graph, expectedRootRef, expectedNodes ); + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/WagonManagerMemoryRepository.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/WagonManagerMemoryRepository.java new file mode 100644 index 000000000..ca3e7ffe6 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/WagonManagerMemoryRepository.java @@ -0,0 +1,772 @@ +package org.apache.maven.archiva.dependency.graph; + +/* + * 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.archiva.model.ArchivaProjectModel; +import org.apache.maven.archiva.model.Dependency; +import org.apache.maven.archiva.model.VersionedReference; + +/** + * WagonManagerMemoryRepository + * + * MemoryRepository for testing org.apache.maven.wagon:wagon-manager:2.0-SNAPSHOT + * + * Generated by archivadev:generate-dependency-tests plugin + * @version $Id$ + */ +public class WagonManagerMemoryRepository + extends AbstractMemoryRepository +{ + public void initialize() + { + ArchivaProjectModel model; + Dependency dep; + + model = toModel( "org.apache.maven.wagon:wagon-manager:2.0-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon:2.0-SNAPSHOT" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-api:2.0-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-file:2.0-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-ftp:2.0-SNAPSHOT::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-http-lightweight:2.0-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-ssh:2.0-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-ssh-external:2.0-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-webdav:2.0-SNAPSHOT::jar", "test" ) ); + dep = toDependency( "org.codehaus.plexus.webdav:plexus-webdav-simple:1.0-alpha-1::jar", "test" ); + addExclusion( dep, "org.codehaus.plexus:plexus-component-api" ); + model.addDependency( dep ); + model.addDependency( toDependency( "org.mortbay.jetty:jetty:6.0.2::jar", "test" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-provider-api:2.0-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-provider-test:2.0-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh-common-test:2.0-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh-common:2.0-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "junit:junit:3.8.1::jar" ) ); + dep = toDependency( "org.codehaus.plexus:plexus-interactivity-api:1.0-alpha-6::jar" ); + addExclusion( dep, "plexus:plexus-utils" ); + addExclusion( dep, "org.codehaus.plexus:plexus-container-default" ); + addExclusion( dep, "classworlds:classworlds" ); + model.addDependencyManagement( dep ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar", "test" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.4.2-SNAPSHOT::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon:2.0-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven:maven-parent:5" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-provider-api:2.0-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-provider-test:2.0-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh-common-test:2.0-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh-common:2.0-SNAPSHOT::jar" ) ); + model.addDependencyManagement( toDependency( "junit:junit:3.8.1::jar" ) ); + dep = toDependency( "org.codehaus.plexus:plexus-interactivity-api:1.0-alpha-6::jar" ); + addExclusion( dep, "plexus:plexus-utils" ); + addExclusion( dep, "org.codehaus.plexus:plexus-container-default" ); + addExclusion( dep, "classworlds:classworlds" ); + model.addDependencyManagement( dep ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9::jar", "test" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.4.2-SNAPSHOT::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-parent:5" ); + model.setParentProject( toParent( "org.apache:apache:3" ) ); + addModel( model ); + + model = toModel( "org.apache:apache:3" ); + addModel( model ); + + model = toModel( "junit:junit:3.8.1" ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-provider-api:2.0-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon:2.0-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4.2-SNAPSHOT::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-utils:1.4.2-SNAPSHOT" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.11" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus:1.0.11" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-provider-test:2.0-SNAPSHOT" ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-ssh-common-test:2.0-SNAPSHOT" ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-ssh-common:2.0-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:2.0-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4.2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-interactivity-api:1.0-alpha-6::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-providers:2.0-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon:2.0-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-api:2.0-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-test:2.0-SNAPSHOT::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-interactivity-api:1.0-alpha-6" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-interactivity:1.0-alpha-6" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-interactivity:1.0-alpha-6" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.9" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-components:1.1.9" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.10" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-16::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-16::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus:1.0.10" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-component-api:1.0-alpha-16" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0-alpha-16" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-containers:1.0-alpha-16" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.9" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-16::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.3::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus:1.0.9" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.9" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-utils:1.3" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.8" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus:1.0.8" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-container-default:1.0-alpha-16" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0-alpha-16" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-16::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.3::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-7::jar" ) ); + model.addDependency( toDependency( "jmock:jmock:1.0.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "jmock:jmock:1.0.1" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-utils:1.4" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.9" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-container-default:1.0-alpha-9" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0.3" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + model.addDependency( toDependency( "classworlds:classworlds:1.1-alpha-2::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-containers:1.0.3" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.4" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus:1.0.4" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-utils:1.0.4" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "classworlds:classworlds:1.1-alpha-2" ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-file:2.0-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:2.0-SNAPSHOT" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-ftp:2.0-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:2.0-SNAPSHOT" ) ); + model.addDependency( toDependency( "commons-net:commons-net:1.4.1::jar" ) ); + dep = toDependency( "org.codehaus.plexus:plexus-ftpd:1.0-alpha-1::jar", "test" ); + addExclusion( dep, "plexus:plexus-container-default" ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "commons-net:commons-net:1.4.1" ); + model.addDependency( toDependency( "oro:oro:2.0.8::jar" ) ); + addModel( model ); + + model = toModel( "oro:oro:2.0.8" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-ftpd:1.0-alpha-1" ); + model.addDependency( toDependency( "concurrent:concurrent:1.3.4::jar", "compile" ) ); + model.addDependency( toDependency( "cornerstone-threads:cornerstone-threads-api:1.0::jar", "compile" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "cornerstone-sockets:cornerstone-sockets-api:1.0::jar", "compile" ) ); + model.addDependency( toDependency( "cornerstone-connection:cornerstone-connection-impl:1.0::jar", "compile" ) ); + model.addDependency( toDependency( "excalibur-pool:excalibur-pool-impl:2.0::jar", "compile" ) ); + model.addDependency( toDependency( "excalibur-thread:excalibur-thread:1.1.1::jar", "compile" ) ); + model.addDependency( toDependency( "cornerstone-sockets:cornerstone-sockets-impl:1.0::jar", "compile" ) ); + model.addDependency( toDependency( "cornerstone-connection:cornerstone-connection-api:1.0::jar", "compile" ) ); + model.addDependency( toDependency( "commons-collections:commons-collections:3.0::jar", "compile" ) ); + model.addDependency( toDependency( "avalon:avalon-framework:4.1.4::jar", "compile" ) ); + model.addDependency( toDependency( "cornerstone-threads:cornerstone-threads-impl:1.0::jar", "compile" ) ); + model.addDependency( toDependency( "excalibur-pool:excalibur-pool-api:2.0::jar", "compile" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-avalon-personality:0.13::jar", "compile" ) ); + model.addDependency( toDependency( "plexus:plexus-container-default:1.0-alpha-2::jar", "compile" ) ); + addModel( model ); + + model = toModel( "concurrent:concurrent:1.3.4" ); + addModel( model ); + + model = toModel( "cornerstone-threads:cornerstone-threads-api:1.0" ); + addModel( model ); + + model = toModel( "cornerstone-sockets:cornerstone-sockets-api:1.0" ); + addModel( model ); + + model = toModel( "cornerstone-connection:cornerstone-connection-impl:1.0" ); + addModel( model ); + + model = toModel( "excalibur-pool:excalibur-pool-impl:2.0" ); + addModel( model ); + + model = toModel( "excalibur-thread:excalibur-thread:1.1.1" ); + addModel( model ); + + model = toModel( "cornerstone-sockets:cornerstone-sockets-impl:1.0" ); + addModel( model ); + + model = toModel( "cornerstone-connection:cornerstone-connection-api:1.0" ); + addModel( model ); + + model = toModel( "commons-collections:commons-collections:3.0" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "avalon:avalon-framework:4.1.4" ); + addModel( model ); + + model = toModel( "cornerstone-threads:cornerstone-threads-impl:1.0" ); + addModel( model ); + + model = toModel( "excalibur-pool:excalibur-pool-api:2.0" ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-avalon-personality:0.13" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "avalon:avalon-framework:4.1.4::jar", "compile" ) ); + model.addDependency( toDependency( "plexus:plexus-container-default:1.0-alpha-2::jar", "compile" ) ); + addModel( model ); + + model = toModel( "plexus:plexus-container-default:1.0-alpha-2" ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-http-lightweight:2.0-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:2.0-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-http-shared:2.0-SNAPSHOT::jar" ) ); + dep = toDependency( "plexus:plexus-jetty-httpd:1.0-beta-1::jar", "test" ); + addExclusion( dep, "plexus:plexus-container-default" ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-http-shared:2.0-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:2.0-SNAPSHOT" ) ); + model.addDependency( toDependency( "jtidy:jtidy:4aug2000r7-dev::jar" ) ); + addModel( model ); + + model = toModel( "jtidy:jtidy:4aug2000r7-dev" ); + addModel( model ); + + model = toModel( "plexus:plexus-jetty-httpd:1.0-beta-1" ); + model.setParentProject( toParent( "plexus:plexus-components:1.0" ) ); + model.addDependency( toDependency( "jetty:jetty:4.2.10::jar" ) ); + model.addDependency( toDependency( "servletapi:servletapi:2.3::jar" ) ); + addModel( model ); + + model = toModel( "plexus:plexus-components:1.0" ); + model.setParentProject( toParent( "plexus:plexus-root:1.0" ) ); + model.addDependency( toDependency( "plexus:plexus-container-default:1.0-alpha-2::jar" ) ); + addModel( model ); + + model = toModel( "plexus:plexus-root:1.0" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "jetty:jetty:4.2.10" ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.3::jar", "runtime" ) ); + addModel( model ); + + model = toModel( "javax.servlet:servlet-api:2.3" ); + addModel( model ); + + model = toModel( "servletapi:servletapi:2.3" ); + model.setRelocation( new VersionedReference() ); + model.getRelocation().setGroupId( "javax.servlet" ); + model.getRelocation().setArtifactId( "servlet-api" ); + model.getRelocation().setVersion( "2.3" ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-ssh:2.0-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:2.0-SNAPSHOT" ) ); + model.addDependency( toDependency( "com.jcraft:jsch:0.1.27::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-interactivity-api:1.0-alpha-6::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4.2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-ssh-common:2.0-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-ssh-common-test:2.0-SNAPSHOT::jar", "test" ) ); + addModel( model ); + + model = toModel( "com.jcraft:jsch:0.1.27" ); + dep = toDependency( "com.jcraft:jzlib:1.0.7::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "com.jcraft:jzlib:1.0.7" ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-ssh-external:2.0-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:2.0-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4.2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-ssh-common:2.0-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-ssh-common-test:2.0-SNAPSHOT::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-webdav:2.0-SNAPSHOT" ); + model.setParentProject( toParent( "org.apache.maven.wagon:wagon-providers:2.0-SNAPSHOT" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.4.2-SNAPSHOT::jar" ) ); + model.addDependency( toDependency( "slide:slide-webdavlib:2.1::jar" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.4::jar", "runtime" ) ); + model.addDependency( toDependency( "it.could:webdav:0.4::jar", "test" ) ); + addModel( model ); + + model = toModel( "slide:slide-webdavlib:2.1" ); + model.addDependency( toDependency( "commons-httpclient:commons-httpclient:2.0.2::jar" ) ); + model.addDependency( toDependency( "jdom:jdom:1.0::jar" ) ); + model.addDependency( toDependency( "de.zeigermann.xml:xml-im-exporter:1.1::jar" ) ); + addModel( model ); + + model = toModel( "commons-httpclient:commons-httpclient:2.0.2" ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.3::jar" ) ); + addModel( model ); + + model = toModel( "commons-logging:commons-logging:1.0.3" ); + dep = toDependency( "log4j:log4j:1.2.6::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "logkit:logkit:1.0.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + addModel( model ); + + model = toModel( "log4j:log4j:1.2.6" ); + addModel( model ); + + model = toModel( "logkit:logkit:1.0.1" ); + addModel( model ); + + model = toModel( "junit:junit:3.7" ); + addModel( model ); + + model = toModel( "jdom:jdom:1.0" ); + dep = toDependency( "xerces:xercesImpl:2.6.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "xml-apis:xml-apis:1.0.b2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "jaxen:jaxen:1.0-FCS::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "saxpath:saxpath:1.0-FCS::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "xalan:xalan:2.5.0::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "xerces:xercesImpl:2.6.0" ); + addModel( model ); + + model = toModel( "xml-apis:xml-apis:1.0.b2" ); + addModel( model ); + + model = toModel( "jaxen:jaxen:1.0-FCS" ); + addModel( model ); + + model = toModel( "saxpath:saxpath:1.0-FCS" ); + addModel( model ); + + model = toModel( "xalan:xalan:2.5.0" ); + addModel( model ); + + model = toModel( "de.zeigermann.xml:xml-im-exporter:1.1" ); + addModel( model ); + + model = toModel( "commons-logging:commons-logging:1.0.4" ); + dep = toDependency( "log4j:log4j:1.2.6::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "logkit:logkit:1.0.1::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + model.addDependency( toDependency( "junit:junit:3.7::jar", "test" ) ); + dep = toDependency( "avalon-framework:avalon-framework:4.1.3::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "avalon-framework:avalon-framework:4.1.3" ); + addModel( model ); + + model = toModel( "it.could:webdav:0.4" ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.3::jar", "runtime" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.webdav:plexus-webdav-simple:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.webdav:plexus-webdav-providers-parent:1.0-alpha-1" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:2.1::jar" ) ); + model.addDependency( toDependency( "it.could:webdav:0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.webdav:plexus-webdav-providers-parent:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.webdav:plexus-webdav-parent:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.webdav:plexus-webdav-api:1.0-alpha-1::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus.webdav:plexus-webdav-test:1.0-alpha-1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.webdav:plexus-webdav-parent:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-components:1.1.8" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-components:1.1.8" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.9" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-15::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-15::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-component-api:1.0-alpha-15" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0-alpha-15" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-6::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-containers:1.0-alpha-15" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.9" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-6::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-15::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.3::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-6" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus:1.0.9" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-container-default:1.0-alpha-15" ); + model.setParentProject( toParent( "org.codehaus.plexus:plexus-containers:1.0-alpha-15" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-15::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.3::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-classworlds:1.2-alpha-6::jar" ) ); + model.addDependency( toDependency( "jmock:jmock:1.0.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.webdav:plexus-webdav-api:1.0-alpha-1" ); + model.setParentProject( toParent( "org.codehaus.plexus.webdav:plexus-webdav-parent:1.0-alpha-1" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-component-api:1.0-alpha-16::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-16::jar" ) ); + model.addDependency( toDependency( "javax.servlet:servlet-api:2.3::jar" ) ); + model.addDependency( toDependency( "commons-lang:commons-lang:2.1::jar" ) ); + addModel( model ); + + model = toModel( "commons-lang:commons-lang:2.1" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus.webdav:plexus-webdav-test:1.0-alpha-1" ); + addModel( model ); + + model = toModel( "org.mortbay.jetty:jetty:6.0.2" ); + model.setParentProject( toParent( "org.mortbay.jetty:project:6.0.2" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "org.mortbay.jetty:jetty-util:6.0.2::jar" ) ); + model.addDependency( toDependency( "org.mortbay.jetty:servlet-api-2.5:6.0.2::jar" ) ); + addModel( model ); + + model = toModel( "org.mortbay.jetty:project:6.0.2" ); + model.addDependencyManagement( toDependency( "org.apache.maven:maven-plugin-tools-api:2.0::jar" ) ); + model.addDependencyManagement( toDependency( "junit:junit:3.8.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.slf4j:jcl104-over-slf4j:1.0.1::jar" ) ); + model.addDependencyManagement( toDependency( "org.slf4j:slf4j-simple:1.0.1::jar" ) ); + model.addDependencyManagement( toDependency( "mx4j:mx4j:3.0.1::jar" ) ); + model.addDependencyManagement( toDependency( "mx4j:mx4j-tools:3.0.1::jar" ) ); + model.addDependencyManagement( toDependency( "xerces:xercesImpl:${xerces-version}::jar" ) ); + model.addDependencyManagement( toDependency( "commons-el:commons-el:1.0::jar" ) ); + model.addDependencyManagement( toDependency( "ant:ant:1.6.5::jar" ) ); + model.addDependencyManagement( toDependency( "javax.mail:mail:1.4::jar" ) ); + model.addDependencyManagement( toDependency( "javax.activation:activation:1.1::jar" ) ); + model.addProperty( "jasper-version", "5.5.15" ); + model.addProperty( "junit-version", "3.8.1" ); + model.addProperty( "ant-version", "1.6.5" ); + model.addProperty( "mail-version", "1.4" ); + model.addProperty( "commons-el-version", "1.0" ); + model.addProperty( "slf4j-version", "1.0.1" ); + model.addProperty( "eclipse-compiler-version", "3.1.1" ); + model.addProperty( "mx4j-version", "3.0.1" ); + model.addProperty( "jta-spec-version", "1.0.1B-rc4" ); + model.addProperty( "activation-version", "1.1" ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-plugin-tools-api:2.0" ); + model.setParentProject( toParent( "org.apache.maven:maven-plugin-tools:2.0" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-project:2.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-plugin-descriptor:2.0::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-plugin-tools:2.0" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven:2.0" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + model.addDependencyManagement( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-alpha-5::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-ssh:1.0-alpha-5::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-file:1.0-alpha-5::jar" ) ); + model.addDependencyManagement( toDependency( "org.apache.maven.wagon:wagon-http-lightweight:1.0-alpha-5::jar" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8" ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar", "compile" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependency( toDependency( "classworlds:classworlds:1.1-alpha-2::jar", "compile" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-provider-api:1.0-alpha-5" ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar", "compile" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-ssh:1.0-alpha-5" ); + model.addDependency( toDependency( "com.jcraft:jsch:0.1.23::jar", "compile" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar", "compile" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-alpha-5::jar", "compile" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar", "compile" ) ); + model.addDependency( toDependency( "classworlds:classworlds:1.1-alpha-2::jar", "compile" ) ); + model.addDependency( toDependency( "plexus:plexus-utils:1.0.2::jar", "compile" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-interactivity-api:1.0-alpha-4::jar", "compile" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-test:1.0-alpha-5::jar", "test" ) ); + addModel( model ); + + model = toModel( "com.jcraft:jsch:0.1.23" ); + addModel( model ); + + model = toModel( "plexus:plexus-utils:1.0.2" ); + model.setParentProject( toParent( "plexus:plexus-root:1.0.3" ) ); + addModel( model ); + + model = toModel( "plexus:plexus-root:1.0.3" ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-interactivity-api:1.0-alpha-4" ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-7::jar", "compile" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "classworlds:classworlds:1.1-alpha-2::jar", "compile" ) ); + model.addDependency( toDependency( "plexus:plexus-utils:1.0.2::jar", "compile" ) ); + addModel( model ); + + model = toModel( "org.codehaus.plexus:plexus-container-default:1.0-alpha-7" ); + model.setParentProject( toParent( "plexus:plexus-containers:1.0.2" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "compile" ) ); + model.addDependency( toDependency( "plexus:plexus-utils:1.0.2::jar" ) ); + model.addDependency( toDependency( "classworlds:classworlds:1.1-alpha-2::jar" ) ); + addModel( model ); + + model = toModel( "plexus:plexus-containers:1.0.2" ); + model.setParentProject( toParent( "plexus:plexus-root:1.0.3" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-provider-test:1.0-alpha-5" ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-file:1.0-alpha-5" ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar", "compile" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-alpha-5::jar", "compile" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar", "test" ) ); + model.addDependency( toDependency( "classworlds:classworlds:1.1-alpha-2::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-test:1.0-alpha-5::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven.wagon:wagon-http-lightweight:1.0-alpha-5" ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar", "compile" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-alpha-5::jar", "compile" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar", "test" ) ); + model.addDependency( toDependency( "servletapi:servletapi:2.3::jar", "test" ) ); + model.addDependency( toDependency( "classworlds:classworlds:1.1-alpha-2::jar", "test" ) ); + model.addDependency( toDependency( "jetty:jetty:4.2.10::jar", "test" ) ); + model.addDependency( toDependency( "plexus:plexus-jetty-httpd:1.0-beta-1::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-test:1.0-alpha-5::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-project:2.0" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact-test:2.0::jar", "test" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-profile:2.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-model:2.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact-manager:2.0::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact:2.0::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-artifact-test:2.0" ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-profile:2.0" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-model:2.0::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-model:2.0" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-artifact-manager:2.0" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-repository-metadata:2.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-file:1.0-alpha-5::jar", "test" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact:2.0::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + model.addDependency( toDependency( "org.apache.maven.wagon:wagon-provider-api:1.0-alpha-5::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-repository-metadata:2.0" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-artifact:2.0" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-utils:1.0.4::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-plugin-descriptor:2.0" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-plugin-api:2.0::jar" ) ); + model.addDependency( toDependency( "org.apache.maven:maven-artifact:2.0::jar" ) ); + model.addDependency( toDependency( "org.codehaus.plexus:plexus-container-default:1.0-alpha-8::jar" ) ); + addModel( model ); + + model = toModel( "org.apache.maven:maven-plugin-api:2.0" ); + model.setParentProject( toParent( "org.apache.maven:maven:2.0" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + addModel( model ); + + model = toModel( "org.slf4j:jcl104-over-slf4j:1.0.1" ); + addModel( model ); + + model = toModel( "org.slf4j:slf4j-simple:1.0.1" ); + addModel( model ); + + model = toModel( "mx4j:mx4j:3.0.1" ); + addModel( model ); + + model = toModel( "mx4j:mx4j-tools:3.0.1" ); + addModel( model ); + + model = toModel( "xerces:xercesImpl:${xerces-version}" ); + addModel( model ); + + model = toModel( "commons-el:commons-el:1.0" ); + model.addDependency( toDependency( "servletapi:servletapi:2.4-20040521::jar", "provided" ) ); + model.addDependency( toDependency( "jspapi:jsp-api:2.0-20040521::jar", "provided" ) ); + model.addDependency( toDependency( "commons-logging:commons-logging:1.0.3::jar" ) ); + addModel( model ); + + model = toModel( "servletapi:servletapi:2.4-20040521" ); + addModel( model ); + + model = toModel( "jspapi:jsp-api:2.0-20040521" ); + addModel( model ); + + model = toModel( "ant:ant:1.6.5" ); + dep = toDependency( "xerces:xerces-impl:2.6.2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + dep = toDependency( "xml-apis:xml-apis:2.6.2::jar" ); + dep.setOptional( true ); + model.addDependency( dep ); + addModel( model ); + + model = toModel( "xerces:xerces-impl:2.6.2" ); + addModel( model ); + + model = toModel( "xml-apis:xml-apis:2.6.2" ); + addModel( model ); + + model = toModel( "javax.mail:mail:1.4" ); + model.addDependency( toDependency( "javax.activation:activation:1.1::jar" ) ); + addModel( model ); + + model = toModel( "javax.activation:activation:1.1" ); + addModel( model ); + + model = toModel( "org.mortbay.jetty:jetty-util:6.0.2" ); + model.setParentProject( toParent( "org.mortbay.jetty:project:6.0.2" ) ); + model.addDependency( toDependency( "junit:junit:3.8.1::jar", "test" ) ); + model.addDependency( toDependency( "org.mortbay.jetty:servlet-api-2.5:6.0.2::jar", "provided" ) ); + addModel( model ); + + model = toModel( "org.mortbay.jetty:servlet-api-2.5:6.0.2" ); + model.setParentProject( toParent( "org.mortbay.jetty:project:6.0.2" ) ); + addModel( model ); + + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/functors/ToKeyTransformer.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/functors/ToKeyTransformer.java new file mode 100644 index 000000000..26e476ea0 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/functors/ToKeyTransformer.java @@ -0,0 +1,67 @@ +package org.apache.maven.archiva.dependency.graph.functors; + +/* + * 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.collections.Transformer; +import org.apache.maven.archiva.dependency.graph.DependencyGraphEdge; +import org.apache.maven.archiva.dependency.graph.DependencyGraphKeys; +import org.apache.maven.archiva.dependency.graph.DependencyGraphNode; +import org.apache.maven.archiva.model.ArchivaProjectModel; +import org.apache.maven.archiva.model.ArtifactReference; +import org.apache.maven.archiva.model.Keys; + +/** + * ToKeyTransformer + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ToKeyTransformer + implements Transformer +{ + + public Object transform( Object input ) + { + if ( input instanceof ArchivaProjectModel ) + { + return Keys.toKey( (ArchivaProjectModel) input ); + } + + if ( input instanceof DependencyGraphNode ) + { + return DependencyGraphKeys.toKey( ((DependencyGraphNode) input).getArtifact() ); + } + + if ( input instanceof DependencyGraphEdge ) + { + DependencyGraphEdge edge = (DependencyGraphEdge) input; + // Potentially Confusing, but this is called "To"KeyTransformer after all. + return DependencyGraphKeys.toKey( edge.getNodeTo() ); + } + + if ( input instanceof ArtifactReference ) + { + return DependencyGraphKeys.toKey( ((ArtifactReference) input) ); + } + + return input; + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/tasks/DependencyManagementStackTest.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/tasks/DependencyManagementStackTest.java new file mode 100644 index 000000000..51664be04 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/tasks/DependencyManagementStackTest.java @@ -0,0 +1,226 @@ +package org.apache.maven.archiva.dependency.graph.tasks; + +/* + * 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.maven.archiva.dependency.graph.DependencyGraphNode; +import org.apache.maven.archiva.dependency.graph.tasks.DependencyManagementStack.Rules; +import org.apache.maven.archiva.model.ArtifactReference; +import org.apache.maven.archiva.model.Dependency; + +import junit.framework.TestCase; + +/** + * DependencyManagementStackTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class DependencyManagementStackTest + extends TestCase +{ + public DependencyGraphNode toNode( String key ) + { + String parts[] = StringUtils.splitPreserveAllTokens( key, ":" ); + assertEquals( "toNode(" + key + ") requires 5 parts", 5, parts.length ); + + ArtifactReference ref = new ArtifactReference(); + ref.setGroupId( parts[0] ); + ref.setArtifactId( parts[1] ); + ref.setVersion( parts[2] ); + ref.setClassifier( parts[3] ); + ref.setType( parts[4] ); + + return new DependencyGraphNode( ref ); + } + + protected Dependency toDependency( String key ) + { + String parts[] = StringUtils.splitPreserveAllTokens( key, ':' ); + + assertEquals( "Dependency key [" + key + "] should be 5 parts.", 5, parts.length ); + + Dependency dep = new Dependency(); + + dep.setGroupId( parts[0] ); + dep.setArtifactId( parts[1] ); + dep.setVersion( parts[2] ); + dep.setClassifier( parts[3] ); + dep.setType( parts[4] ); + + return dep; + } + + public void testPushPopSimple() + { + DependencyGraphNode node = toNode( "org.apache.maven.archiva:depmanstack-testcase:1.0::jar" ); + Dependency dep = toDependency( "junit:junit:3.8.1::jar" ); + dep.setScope( "test" ); + node.addDependencyManagement( dep ); + + DependencyManagementStack stack = new DependencyManagementStack(); + stack.push( node ); + DependencyGraphNode oldnode = stack.pop(); + assertEquals( "added node to old node", node, oldnode ); + } + + public void testPushPopTwoDeep() + { + DependencyManagementStack stack = new DependencyManagementStack(); + Dependency dep; + + // top node. + DependencyGraphNode projectNode = toNode( "org.apache.maven.archiva:depmanstack-testcase:1.0::jar" ); + dep = toDependency( "junit:junit:3.8.1::jar" ); + dep.setScope( "test" ); + projectNode.addDependencyManagement( dep ); + stack.push( projectNode ); + + // direct node. + DependencyGraphNode directNode = toNode( "org.apache.maven.archiva:depmanstack-common:1.0::jar" ); + dep = toDependency( "junit:junit:3.7::jar" ); + dep.setScope( "test" ); + directNode.addDependencyManagement( dep ); + stack.push( directNode ); + + // transitive node. + DependencyGraphNode transNode = toNode( "org.apache.maven.archiva:depmanstack-model:1.0::jar" ); + dep = toDependency( "junit:junit:3.7::jar" ); + transNode.addDependencyManagement( dep ); + stack.push( transNode ); + + // Test it + assertEquals( "popped node is trans node", transNode, stack.pop() ); + assertEquals( "popped node is direct node", directNode, stack.pop() ); + assertEquals( "popped node is project node", projectNode, stack.pop() ); + } + + public void testApplyNodeVersionParentWins() + { + DependencyManagementStack stack = new DependencyManagementStack(); + Dependency dep; + + // top node. + DependencyGraphNode projectNode = toNode( "org.apache.maven.archiva:depmanstack-testcase:1.0::jar" ); + dep = toDependency( "junit:junit:3.8.1::jar" ); + dep.setScope( "test" ); + projectNode.addDependencyManagement( dep ); + stack.push( projectNode ); + + // direct node. + DependencyGraphNode directNode = toNode( "org.apache.maven.archiva:depmanstack-common:1.0::jar" ); + dep = toDependency( "junit:junit:3.7::jar" ); + dep.setScope( "test" ); + directNode.addDependencyManagement( dep ); + stack.push( directNode ); + + // transitive node. + DependencyGraphNode transNode = toNode( "org.apache.maven.archiva:depmanstack-model:1.0::jar" ); + dep = toDependency( "junit:junit:3.7.1::jar" ); + transNode.addDependencyManagement( dep ); + stack.push( transNode ); + + // Test it + DependencyGraphNode junitNode = toNode( "junit:junit:1.0::jar" ); + + assertRules( "junit (lvl:trans)", stack, junitNode, "3.8.1", "test", null ); + stack.pop(); + assertRules( "junit (lvl:direct)", stack, junitNode, "3.8.1", "test", null ); + stack.pop(); + assertRules( "junit (lvl:project)", stack, junitNode, "3.8.1", "test", null ); + } + + /** + * This test is based off of Carlos Sanchez's depman example use case. + * + * In a simple project chain of A:1.0 -> B:1.0 -> C:1.0 -> D:1.0 + * If B:1.0 has a dependency management section stating dep D should be version 2.0 + * Then the dep D when viewed from A should be version 2.0 + */ + public void testApplyNodeVersionCarlosABCD() + { + DependencyManagementStack stack = new DependencyManagementStack(); + Dependency dep; + + // project node, A + DependencyGraphNode nodeA = toNode( "org.apache.maven.archiva:carlos-A:1.0::jar" ); + stack.push( nodeA ); + + // sub node, B + DependencyGraphNode nodeB = toNode( "org.apache.maven.archiva:carlos-B:1.0::jar" ); + dep = toDependency( "org.apache.maven.archiva:carlos-D:2.0::jar" ); + nodeB.addDependencyManagement( dep ); + stack.push( nodeB ); + + // sub node, C + DependencyGraphNode nodeC = toNode( "org.apache.maven.archiva:carlos-C:1.0::jar" ); + stack.push( nodeC ); + + // sub node, D + // Not added to the stack, as this is the node that is having the rules applied to it. + DependencyGraphNode nodeD = toNode( "org.apache.maven.archiva:carlos-D:1.0::jar" ); + + // Test it + assertRules( "node D (lvl:C)", stack, nodeD, "2.0", null, null ); + stack.pop(); + assertRules( "node D (lvl:B)", stack, nodeD, "2.0", null, null ); + stack.pop(); + assertNoRules( "node D (lvl:A)", stack, nodeD, "2.0", null, null ); + } + + /** + * Test for expected rules, that should be enforced for the provided node. + * NOTE: This test will update the node.artifact.version to whatever is stated in the rules. + */ + private void assertRules( String msg, DependencyManagementStack stack, DependencyGraphNode node, + String expectedVersion, String expectedScope, String expectedExclusions[] ) + { + Rules rules = stack.getRules( node ); + assertNotNull( msg + " rules should not be null.", rules ); + + node.getArtifact().setVersion( rules.artifact.getVersion() ); + + assertEquals( msg + ": version", expectedVersion, rules.artifact.getVersion() ); + assertEquals( msg + ": scope", expectedScope, rules.scope ); + + if ( expectedExclusions != null ) + { + // TODO: test for exclusion settings. + } + } + + /** + * Test for when there are no rules being enforced for the provided node. + * Similar to assertRules() above. + */ + private void assertNoRules( String msg, DependencyManagementStack stack, DependencyGraphNode node, + String expectedVersion, String expectedScope, String expectedExclusions[] ) + { + Rules rules = stack.getRules( node ); + assertNull( msg + " rules should be null.", rules ); + + assertEquals( msg + ": version", expectedVersion, node.getArtifact().getVersion() ); + + if ( expectedExclusions != null ) + { + // TODO: test for exclusion settings. + } + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/walk/DependencyGraphWalkerTest.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/walk/DependencyGraphWalkerTest.java new file mode 100644 index 000000000..24db70b25 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/walk/DependencyGraphWalkerTest.java @@ -0,0 +1,229 @@ +package org.apache.maven.archiva.dependency.graph.walk; + +/* + * 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.maven.archiva.dependency.graph.DependencyGraph; +import org.apache.maven.archiva.dependency.graph.DependencyGraphEdge; +import org.apache.maven.archiva.dependency.graph.DependencyGraphKeys; +import org.apache.maven.archiva.dependency.graph.DependencyGraphNode; +import org.apache.maven.archiva.dependency.graph.tasks.FlagCyclicEdgesTask; +import org.apache.maven.archiva.model.ArtifactReference; + +import java.util.List; + +import junit.framework.TestCase; + +/** + * DependencyGraphWalkerTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class DependencyGraphWalkerTest + extends TestCase +{ + /** + *

+     *  [foo-util] ---> [foo-common]
+     *      \
+     *       ---------> [foo-xml] ---> [xercesImpl] ---> [xmlParserAPIs]
+     *                        \  \
+     *                         \  ---> [jdom] ----+
+     *                          \                 |
+     *                           ----> [jaxen] <--+
+     * 
+ */ + public void testModerateWalk() + { + DependencyGraph graph = new DependencyGraph( "org.foo", "foo-util", "1.0" ); + String rootKey = DependencyGraphKeys.toKey( graph.getRootNode().getArtifact() ); + addEdgeAndNodes( graph, toEdge( rootKey, "org.foo:foo-common:1.0::jar" ) ); + addEdgeAndNodes( graph, toEdge( rootKey, "org.foo:foo-xml:1.0::jar" ) ); + + addEdgeAndNodes( graph, toEdge( "org.foo:foo-xml:1.0::jar", "xerces:xercesImpl:2.2.1::jar" ) ); + addEdgeAndNodes( graph, toEdge( "xerces:xercesImpl:2.2.1::jar", "xerces:xmlParserAPIs:2.2.1::jar" ) ); + addEdgeAndNodes( graph, toEdge( "org.foo:foo-xml:1.0::jar", "jdom:jdom:1.0::jar" ) ); + addEdgeAndNodes( graph, toEdge( "org.foo:foo-xml:1.0::jar", "jaxen:jaxen:1.0::jar" ) ); + addEdgeAndNodes( graph, toEdge( "jdom:jdom:1.0::jar", "jaxen:jaxen:1.0::jar" ) ); + + DependencyGraphWalker walker = new WalkDepthFirstSearch(); + WalkCollector walkCollector = new WalkCollector(); + walker.visit( graph, walkCollector ); + + String expectedPath[] = new String[] { + rootKey, + "org.foo:foo-common:1.0::jar", + "org.foo:foo-xml:1.0::jar", + "jaxen:jaxen:1.0::jar", + "xerces:xercesImpl:2.2.1::jar", + "xerces:xmlParserAPIs:2.2.1::jar", + "jdom:jdom:1.0::jar" }; + + assertVisitor( walkCollector, 1, 7, 7 ); + assertPath( expectedPath, walkCollector.getCollectedPath() ); + } + + /** + *
+     *  [foo-util] ---> [foo-common]
+     *      \
+     *       ---------> [foo-xml] ---> [xercesImpl] ---> [xmlParserAPIs]
+     * 
+ */ + public void testSimpleWalk() + { + DependencyGraph graph = new DependencyGraph( "org.foo", "foo-util", "1.0" ); + String rootKey = DependencyGraphKeys.toKey( graph.getRootNode().getArtifact() ); + addEdgeAndNodes( graph, toEdge( rootKey, "org.foo:foo-common:1.0::jar" ) ); + addEdgeAndNodes( graph, toEdge( rootKey, "org.foo:foo-xml:1.0::jar" ) ); + addEdgeAndNodes( graph, toEdge( "org.foo:foo-xml:1.0::jar", "xerces:xercesImpl:2.2.1::jar" ) ); + addEdgeAndNodes( graph, toEdge( "xerces:xercesImpl:2.2.1::jar", "xerces:xmlParserAPIs:2.2.1::jar" ) ); + + DependencyGraphWalker walker = new WalkDepthFirstSearch(); + WalkCollector walkCollector = new WalkCollector(); + walker.visit( graph, walkCollector ); + + String expectedPath[] = new String[] { + rootKey, + "org.foo:foo-common:1.0::jar", + "org.foo:foo-xml:1.0::jar", + "xerces:xercesImpl:2.2.1::jar", + "xerces:xmlParserAPIs:2.2.1::jar" }; + + assertVisitor( walkCollector, 1, 5, 4 ); + assertPath( expectedPath, walkCollector.getCollectedPath() ); + } + + /** + *
+     *  [foo-util] ---> [foo-common]
+     *      \
+     *       \              +----------------------------------------+
+     *        \             v                                        |
+     *         -------> [foo-xml] ---> [xercesImpl] ---> [xmlParserAPIs]
+     *                        \  \
+     *                         \  ---> [jdom] ----+
+     *                          \                 |
+     *                           ----> [jaxen] <--+
+     * 
+ */ + public void testDeepNodeWalk() + { + DependencyGraph graph = new DependencyGraph( "org.foo", "foo-util", "1.0" ); + String rootKey = DependencyGraphKeys.toKey( graph.getRootNode().getArtifact() ); + addEdgeAndNodes( graph, toEdge( rootKey, "org.foo:foo-common:1.0::jar" ) ); + addEdgeAndNodes( graph, toEdge( rootKey, "org.foo:foo-xml:1.0::jar" ) ); + + addEdgeAndNodes( graph, toEdge( "org.foo:foo-xml:1.0::jar", "xerces:xercesImpl:2.2.1::jar" ) ); + addEdgeAndNodes( graph, toEdge( "xerces:xercesImpl:2.2.1::jar", "xerces:xmlParserAPIs:2.2.1::jar" ) ); + addEdgeAndNodes( graph, toEdge( "org.foo:foo-xml:1.0::jar", "jdom:jdom:1.0::jar" ) ); + addEdgeAndNodes( graph, toEdge( "org.foo:foo-xml:1.0::jar", "jaxen:jaxen:1.0::jar" ) ); + addEdgeAndNodes( graph, toEdge( "jdom:jdom:1.0::jar", "jaxen:jaxen:1.0::jar" ) ); + // introduce cyclic dep. intentional. should only result in walking to foo-xml once. + addEdgeAndNodes( graph, toEdge( "xerces:xmlParserAPIs:2.2.1::jar", "org.foo:foo-xml:1.0::jar" ) ); + + new FlagCyclicEdgesTask().executeTask( graph ); + + DependencyGraphWalker walker = new WalkDepthFirstSearch(); + WalkCollector walkCollector = new WalkCollector(); + ArtifactReference startRef = toArtifactReference( "org.foo:foo-xml:1.0::jar" ); + DependencyGraphNode startNode = new DependencyGraphNode( startRef ); + walker.visit( graph, startNode, walkCollector ); + + String expectedPath[] = new String[] { + "org.foo:foo-xml:1.0::jar", + "jaxen:jaxen:1.0::jar", + "xerces:xercesImpl:2.2.1::jar", + "xerces:xmlParserAPIs:2.2.1::jar", + "jdom:jdom:1.0::jar" }; + + assertVisitor( walkCollector, 1, 5, 6 ); + assertPath( expectedPath, walkCollector.getCollectedPath() ); + } + + private void addEdgeAndNodes( DependencyGraph graph, DependencyGraphEdge edge ) + { + ensureNodeExists( graph, edge.getNodeFrom() ); + ensureNodeExists( graph, edge.getNodeTo() ); + graph.addEdge( edge ); + } + + private void ensureNodeExists( DependencyGraph graph, ArtifactReference artifact ) + { + DependencyGraphNode node = graph.getNode( artifact ); + if ( node == null ) + { + node = new DependencyGraphNode( artifact ); + graph.addNode( node ); + } + } + + private void assertPath( String[] expectedPath, List collectedPath ) + { + assertEquals( "Path.length", expectedPath.length, collectedPath.size() ); + + for ( int i = 0; i < expectedPath.length; i++ ) + { + assertEquals( "Walk path[" + i + "]", expectedPath[i], (String) collectedPath.get( i ) ); + } + } + + private void assertVisitor( WalkCollector walkCollector, int countGraphs, int countNodes, int countEdges ) + { + assertEquals( "Count of graph discovery.", countGraphs, walkCollector.getCountDiscoverGraph() ); + assertEquals( "Count of graph finished.", countGraphs, walkCollector.getCountFinishGraph() ); + assertEquals( "Discover - Finish = 0 (on graph counts)", 0, + ( walkCollector.getCountDiscoverGraph() - walkCollector.getCountFinishGraph() ) ); + + assertEquals( "Count of node discovery.", countNodes, walkCollector.getCountDiscoverNode() ); + assertEquals( "Count of node finished.", countNodes, walkCollector.getCountFinishNode() ); + assertEquals( "Discover - Finish = 0 (on node counts)", 0, + ( walkCollector.getCountDiscoverNode() - walkCollector.getCountFinishNode() ) ); + + assertEquals( "Count of edge discovery.", countEdges, walkCollector.getCountDiscoverEdge() ); + assertEquals( "Count of edge finished.", countEdges, walkCollector.getCountFinishEdge() ); + assertEquals( "Discover - Finish = 0 (on edge counts)", 0, + ( walkCollector.getCountDiscoverEdge() - walkCollector.getCountFinishEdge() ) ); + } + + private DependencyGraphEdge toEdge( String fromKey, String toKey ) + { + ArtifactReference nodeFrom = toArtifactReference( fromKey ); + ArtifactReference nodeTo = toArtifactReference( toKey ); + + return new DependencyGraphEdge( nodeFrom, nodeTo ); + } + + private ArtifactReference toArtifactReference( String key ) + { + String parts[] = StringUtils.splitPreserveAllTokens( key, ':' ); + assertEquals( "ArtifactReference [" + key + "] parts should equal 5", 5, parts.length ); + + ArtifactReference artifact = new ArtifactReference(); + artifact.setGroupId( parts[0] ); + artifact.setArtifactId( parts[1] ); + artifact.setVersion( parts[2] ); + artifact.setClassifier( parts[3] ); + artifact.setType( parts[4] ); + + return artifact; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/walk/WalkCollector.java b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/walk/WalkCollector.java new file mode 100644 index 000000000..c07f1a7cb --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-dependency-graph/src/test/java/org/apache/maven/archiva/dependency/graph/walk/WalkCollector.java @@ -0,0 +1,113 @@ +package org.apache.maven.archiva.dependency.graph.walk; + +/* + * 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.archiva.dependency.graph.DependencyGraph; +import org.apache.maven.archiva.dependency.graph.DependencyGraphEdge; +import org.apache.maven.archiva.dependency.graph.DependencyGraphNode; +import org.apache.maven.archiva.model.ArtifactReference; + +import java.util.ArrayList; +import java.util.List; + +class WalkCollector + implements DependencyGraphVisitor +{ + private List walkPath = new ArrayList(); + + private int countDiscoverGraph = 0; + + private int countFinishGraph = 0; + + private int countDiscoverNode = 0; + + private int countFinishNode = 0; + + private int countDiscoverEdge = 0; + + private int countFinishEdge = 0; + + public void discoverEdge( DependencyGraphEdge edge ) + { + countDiscoverEdge++; + } + + public void discoverGraph( DependencyGraph graph ) + { + countDiscoverGraph++; + } + + public void discoverNode( DependencyGraphNode node ) + { + countDiscoverNode++; + walkPath.add( ArtifactReference.toKey( node.getArtifact() ) ); + } + + public void finishEdge( DependencyGraphEdge edge ) + { + countFinishEdge++; + } + + public void finishGraph( DependencyGraph graph ) + { + countFinishGraph++; + } + + public void finishNode( DependencyGraphNode node ) + { + countFinishNode++; + } + + public List getCollectedPath() + { + return walkPath; + } + + public int getCountDiscoverEdge() + { + return countDiscoverEdge; + } + + public int getCountDiscoverGraph() + { + return countDiscoverGraph; + } + + public int getCountDiscoverNode() + { + return countDiscoverNode; + } + + public int getCountFinishEdge() + { + return countFinishEdge; + } + + public int getCountFinishGraph() + { + return countFinishGraph; + } + + public int getCountFinishNode() + { + return countFinishNode; + } + +} \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/pom.xml b/MRM-541/archiva-modules/archiva-base/archiva-indexer/pom.xml new file mode 100644 index 000000000..31f88e679 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/pom.xml @@ -0,0 +1,80 @@ + + + + + + org.apache.archiva + archiva-base + 1.2-SNAPSHOT + + 4.0.0 + archiva-indexer + Archiva Base :: Indexer + + + org.apache.archiva + archiva-repository-layer + + + org.apache.archiva + archiva-model + + + org.apache.lucene + lucene-core + + + org.codehaus.plexus + plexus-spring + test + + + org.codehaus.plexus + plexus-utils + + + org.codehaus.plexus + plexus-digest + + + commons-lang + commons-lang + + + commons-io + commons-io + + + + + + org.codehaus.mojo + cobertura-maven-plugin + + + + 80 + 80 + + + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/ArtifactKeys.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/ArtifactKeys.java new file mode 100644 index 000000000..b470fca81 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/ArtifactKeys.java @@ -0,0 +1,45 @@ +package org.apache.maven.archiva.indexer; + +/* + * 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. + */ + +/** + * ArtifactKeys + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ArtifactKeys +{ + public static final String GROUPID = "groupId"; + + public static final String GROUPID_EXACT = GROUPID + "_u"; + + public static final String ARTIFACTID = "artifactId"; + + public static final String ARTIFACTID_EXACT = ARTIFACTID + "_u"; + + public static final String VERSION = "version"; + + public static final String VERSION_EXACT = VERSION + "_u"; + + public static final String TYPE = "type"; + + public static final String CLASSIFIER = "classifier"; +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/RepositoryContentIndex.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/RepositoryContentIndex.java new file mode 100644 index 000000000..be089107e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/RepositoryContentIndex.java @@ -0,0 +1,152 @@ +package org.apache.maven.archiva.indexer; + +/* + * 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.lucene.analysis.Analyzer; +import org.apache.lucene.queryParser.QueryParser; +import org.apache.lucene.search.Searchable; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.indexer.lucene.LuceneEntryConverter; +import org.apache.maven.archiva.indexer.lucene.LuceneRepositoryContentRecord; + +import java.io.File; +import java.util.Collection; + +/** + * Common access methods for a Repository Content index. + * + * @author Brett Porter + */ +public interface RepositoryContentIndex +{ + /** + * Indexes the records. + * + * @param records list of {@link LuceneRepositoryContentRecord} objects. + * @throws RepositoryIndexException if there is a problem indexing the records. + */ + void indexRecords( Collection records ) + throws RepositoryIndexException; + + /** + * Modify (potentially) existing records in the index. + * + * @param records the collection of {@link LuceneRepositoryContentRecord} objects to modify in the index. + * @throws RepositoryIndexException if there is a problem modifying the records. + */ + public void modifyRecords( Collection records ) + throws RepositoryIndexException; + + /** + * Modify an existing (potential) record in the index. + * + * @param record the record to modify. + * @throws RepositoryIndexException if there is a problem modifying the record. + */ + public void modifyRecord( LuceneRepositoryContentRecord record ) + throws RepositoryIndexException; + + /** + * Check if the index already exists. + * + * @return true if the index already exists + * @throws RepositoryIndexException if the index location is not valid + */ + boolean exists() + throws RepositoryIndexException; + + /** + * Delete records from the index. Simply ignore the request any did not exist. + * + * @param records the records to delete + * @throws RepositoryIndexException if there is a problem removing the record + */ + void deleteRecords( Collection records ) + throws RepositoryIndexException; + + /** + * Delete a record from the index. Simply ignore the request any did not exist. + * + * @param record the record to be deleted + * @throws RepositoryIndexException if there is a problem removing the record + */ + void deleteRecord( LuceneRepositoryContentRecord record ) + throws RepositoryIndexException; + + /** + * Retrieve all primary keys of records in the index. + * + * @return the keys + * @throws RepositoryIndexException if there was an error searching the index + */ + Collection getAllRecordKeys() + throws RepositoryIndexException; + + /** + * Get the index directory. + * + * @return the index directory. + */ + File getIndexDirectory(); + + /** + * Get the {@link QueryParser} appropriate for searches within this index. + * + * @return the query parser; + */ + QueryParser getQueryParser(); + + /** + * Get the id of index. + * + * @return the id of index. + */ + String getId(); + + /** + * Get the repository that this index belongs to. + * + * @return the repository that this index belongs to. + */ + ManagedRepositoryConfiguration getRepository(); + + /** + * Get the analyzer in use for this index. + * + * @return the analyzer in use. + */ + Analyzer getAnalyzer(); + + /** + * Get the document to record (and back again) converter. + * + * @return the converter in use. + */ + LuceneEntryConverter getEntryConverter(); + + /** + * Create a Searchable for this index. + * + * @return the Searchable. + * @throws RepositoryIndexSearchException if there was a problem creating the searchable. + */ + Searchable getSearchable() + throws RepositoryIndexSearchException; +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/RepositoryContentIndexFactory.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/RepositoryContentIndexFactory.java new file mode 100644 index 000000000..2eb796eed --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/RepositoryContentIndexFactory.java @@ -0,0 +1,54 @@ +package org.apache.maven.archiva.indexer; + +/* + * 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.archiva.configuration.ManagedRepositoryConfiguration; + +/** + * Obtain an index instance. + * + * @author Brett Porter + */ +public interface RepositoryContentIndexFactory +{ + /** + * Method to create an instance of the bytecode index. + * + * @param repository the repository to create the content index from. + * @return the index instance + */ + RepositoryContentIndex createBytecodeIndex( ManagedRepositoryConfiguration repository ); + + /** + * Method to create an instance of the file content index. + * + * @param repository the repository to create the file content index from. + * @return the index instance + */ + RepositoryContentIndex createFileContentIndex( ManagedRepositoryConfiguration repository ); + + /** + * Method to create an instance of the hashcode index. + * + * @param repository the repository to create the content index from. + * @return the index instance + */ + RepositoryContentIndex createHashcodeIndex( ManagedRepositoryConfiguration repository ); +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/RepositoryIndexException.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/RepositoryIndexException.java new file mode 100644 index 000000000..bca043991 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/RepositoryIndexException.java @@ -0,0 +1,37 @@ +package org.apache.maven.archiva.indexer; + +/* + * 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 Edwin Punzalan + */ +public class RepositoryIndexException + extends Exception +{ + public RepositoryIndexException( String message, Throwable cause ) + { + super( message, cause ); + } + + public RepositoryIndexException( String message ) + { + super( message ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/RepositoryIndexSearchException.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/RepositoryIndexSearchException.java new file mode 100644 index 000000000..c8be03b9c --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/RepositoryIndexSearchException.java @@ -0,0 +1,32 @@ +package org.apache.maven.archiva.indexer; + +/* + * 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 Brett Porter + */ +public class RepositoryIndexSearchException + extends Exception +{ + public RepositoryIndexSearchException( String message, Throwable cause ) + { + super( message, cause ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/bytecode/BytecodeAnalyzer.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/bytecode/BytecodeAnalyzer.java new file mode 100644 index 000000000..e9a16f04e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/bytecode/BytecodeAnalyzer.java @@ -0,0 +1,73 @@ +package org.apache.maven.archiva.indexer.bytecode; + +/* + * 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.lucene.analysis.Analyzer; +import org.apache.lucene.analysis.LowerCaseFilter; +import org.apache.lucene.analysis.StopAnalyzer; +import org.apache.lucene.analysis.StopFilter; +import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.analysis.standard.StandardAnalyzer; +import org.apache.maven.archiva.indexer.ArtifactKeys; +import org.apache.maven.archiva.indexer.lucene.analyzers.ClassnameTokenizer; +import org.apache.maven.archiva.indexer.lucene.analyzers.FilenamesTokenizer; +import org.apache.maven.archiva.indexer.lucene.analyzers.GroupIdTokenizer; +import org.apache.maven.archiva.indexer.lucene.analyzers.VersionTokenizer; + +import java.io.Reader; + +/** + * BytecodeAnalyzer + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class BytecodeAnalyzer extends Analyzer +{ + private static final Analyzer STANDARD = new StandardAnalyzer(); + + public TokenStream tokenStream( String field, Reader reader ) + { + TokenStream tokenStream = null; + + if ( BytecodeKeys.CLASSES.equals( field ) ) + { + tokenStream = new ClassnameTokenizer( reader ); + } + else if ( BytecodeKeys.FILES.equals( field ) ) + { + tokenStream = new FilenamesTokenizer( reader ); + } + else if ( ArtifactKeys.GROUPID.equals( field ) ) + { + tokenStream = new GroupIdTokenizer( reader ); + } + else if ( ArtifactKeys.VERSION.equals( field ) ) + { + tokenStream = new VersionTokenizer( reader ); + } + else + { + tokenStream = STANDARD.tokenStream( field, reader ); + } + + return new LowerCaseFilter( new StopFilter( tokenStream, StopAnalyzer.ENGLISH_STOP_WORDS ) ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/bytecode/BytecodeEntryConverter.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/bytecode/BytecodeEntryConverter.java new file mode 100644 index 000000000..a800b2251 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/bytecode/BytecodeEntryConverter.java @@ -0,0 +1,114 @@ +package org.apache.maven.archiva.indexer.bytecode; + +/* + * 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.lucene.document.Document; +import org.apache.maven.archiva.indexer.ArtifactKeys; +import org.apache.maven.archiva.indexer.lucene.LuceneDocumentMaker; +import org.apache.maven.archiva.indexer.lucene.LuceneEntryConverter; +import org.apache.maven.archiva.indexer.lucene.LuceneRepositoryContentRecord; +import org.apache.maven.archiva.model.ArchivaArtifact; +import org.apache.maven.archiva.model.platform.JavaArtifactHelper; + +import java.text.ParseException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * Converter for Bytecode records and documents. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class BytecodeEntryConverter implements LuceneEntryConverter +{ + + public Document convert( LuceneRepositoryContentRecord record ) + { + if ( !( record instanceof BytecodeRecord ) ) + { + throw new ClassCastException( "Unable to convert type " + record.getClass().getName() + " to " + + BytecodeRecord.class.getName() + "." ); + } + + BytecodeRecord bytecode = (BytecodeRecord) record; + + LuceneDocumentMaker doc = new LuceneDocumentMaker( bytecode ); + + // Artifact Reference + doc.addFieldTokenized( ArtifactKeys.GROUPID, bytecode.getArtifact().getGroupId() ); + doc.addFieldExact( ArtifactKeys.GROUPID_EXACT, bytecode.getArtifact().getGroupId() ); + doc.addFieldTokenized( ArtifactKeys.ARTIFACTID, bytecode.getArtifact().getArtifactId() ); + doc.addFieldExact( ArtifactKeys.ARTIFACTID_EXACT, bytecode.getArtifact().getArtifactId() ); + doc.addFieldTokenized( ArtifactKeys.VERSION, bytecode.getArtifact().getVersion() ); + doc.addFieldExact( ArtifactKeys.VERSION_EXACT, bytecode.getArtifact().getVersion() ); + doc.addFieldTokenized( ArtifactKeys.TYPE, bytecode.getArtifact().getType() ); + doc.addFieldUntokenized( ArtifactKeys.CLASSIFIER, bytecode.getArtifact().getClassifier() ); + + // Bytecode Specifics + doc.addFieldExact( BytecodeKeys.JDK, JavaArtifactHelper.getJavaDetails( bytecode.getArtifact() ).getJdk() ); + doc.addFieldTokenized( BytecodeKeys.CLASSES, bytecode.getClasses() ); + doc.addFieldTokenized( BytecodeKeys.METHODS, bytecode.getMethods() ); + doc.addFieldTokenized( BytecodeKeys.FILES, bytecode.getFiles() ); + + return doc.getDocument(); + } + + public LuceneRepositoryContentRecord convert( Document document ) throws ParseException + { + BytecodeRecord record = new BytecodeRecord(); + + record.setRepositoryId( document.get( LuceneDocumentMaker.REPOSITORY_ID ) ); + + // Artifact Reference + String groupId = document.get( ArtifactKeys.GROUPID ); + String artifactId = document.get( ArtifactKeys.ARTIFACTID ); + String version = document.get( ArtifactKeys.VERSION ); + String classifier = document.get( ArtifactKeys.CLASSIFIER ); + String type = document.get( ArtifactKeys.TYPE ); + + ArchivaArtifact artifact = new ArchivaArtifact( groupId, artifactId, version, classifier, type ); + record.setArtifact( artifact ); + + // Bytecode Specifics + JavaArtifactHelper.getJavaDetails( record.getArtifact() ).setJdk( document.get( BytecodeKeys.JDK ) ); + record.setClasses( getList( document, BytecodeKeys.CLASSES ) ); + record.setMethods( getList( document, BytecodeKeys.METHODS ) ); + record.setFiles( getList( document, BytecodeKeys.FILES ) ); + + return record; + } + + public List getList( Document document, String key ) + { + String rawlist = document.get( key ); + + if ( rawlist == null ) + { + return null; + } + + List ret = new ArrayList(); + ret.addAll( Arrays.asList( rawlist.split( "\n" ) ) ); + + return ret; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/bytecode/BytecodeHandlers.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/bytecode/BytecodeHandlers.java new file mode 100644 index 000000000..3027345d5 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/bytecode/BytecodeHandlers.java @@ -0,0 +1,77 @@ +package org.apache.maven.archiva.indexer.bytecode; + +/* + * 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.lucene.analysis.Analyzer; +import org.apache.lucene.queryParser.MultiFieldQueryParser; +import org.apache.lucene.queryParser.QueryParser; +import org.apache.maven.archiva.indexer.lucene.LuceneEntryConverter; +import org.apache.maven.archiva.indexer.lucene.LuceneIndexHandlers; + +/** + * BytecodeHandlers + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class BytecodeHandlers + implements LuceneIndexHandlers +{ + private BytecodeAnalyzer analyzer; + + private BytecodeEntryConverter converter; + + private QueryParser queryParser; + + public BytecodeHandlers() + { + converter = new BytecodeEntryConverter(); + analyzer = new BytecodeAnalyzer(); + queryParser = new MultiFieldQueryParser( new String[] { + BytecodeKeys.GROUPID, + BytecodeKeys.ARTIFACTID, + BytecodeKeys.VERSION, + BytecodeKeys.CLASSIFIER, + BytecodeKeys.TYPE, + BytecodeKeys.CLASSES, + BytecodeKeys.FILES, + BytecodeKeys.METHODS }, analyzer ); + } + + public String getId() + { + return BytecodeKeys.ID; + } + + public Analyzer getAnalyzer() + { + return analyzer; + } + + public LuceneEntryConverter getConverter() + { + return converter; + } + + public QueryParser getQueryParser() + { + return queryParser; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/bytecode/BytecodeKeys.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/bytecode/BytecodeKeys.java new file mode 100644 index 000000000..487e35488 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/bytecode/BytecodeKeys.java @@ -0,0 +1,42 @@ +package org.apache.maven.archiva.indexer.bytecode; + +/* + * 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.archiva.indexer.ArtifactKeys; + +/** + * BytecodeKeys + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class BytecodeKeys + extends ArtifactKeys +{ + public static final String ID = "bytecode"; + + public static final String CLASSES = "classes"; + + public static final String METHODS = "methods"; + + public static final String FILES = "files"; + + public static final String JDK = "jdk"; +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/bytecode/BytecodeRecord.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/bytecode/BytecodeRecord.java new file mode 100644 index 000000000..888067da5 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/bytecode/BytecodeRecord.java @@ -0,0 +1,178 @@ +package org.apache.maven.archiva.indexer.bytecode; + +/* + * 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.archiva.indexer.lucene.LuceneRepositoryContentRecord; +import org.apache.maven.archiva.model.ArchivaArtifact; + +import java.util.List; + +/** + * Lucene Record for Bytecode information. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class BytecodeRecord + implements LuceneRepositoryContentRecord +{ + private String repositoryId; + + private ArchivaArtifact artifact; + + private String filename; + + private List classes; + + private List methods; + + private List files; + + public ArchivaArtifact getArtifact() + { + return artifact; + } + + public List getClasses() + { + return classes; + } + + public List getFiles() + { + return files; + } + + public List getMethods() + { + return methods; + } + + public String getRepositoryId() + { + return repositoryId; + } + + public String getPrimaryKey() + { + StringBuffer id = new StringBuffer(); + id.append( artifact.getGroupId() ).append( ":" ); + id.append( artifact.getArtifactId() ).append( ":" ); + id.append( artifact.getVersion() ); + + if ( artifact.getClassifier() != null ) + { + id.append( ":" ).append( artifact.getClassifier() ); + } + + id.append( ":" ).append( artifact.getType() ); + + return id.toString(); + } + + public void setArtifact( ArchivaArtifact artifact ) + { + this.artifact = artifact; + } + + public void setClasses( List classes ) + { + this.classes = classes; + } + + public void setFiles( List files ) + { + this.files = files; + } + + public void setMethods( List methods ) + { + this.methods = methods; + } + + public void setRepositoryId( String repositoryId ) + { + this.repositoryId = repositoryId; + } + + public int hashCode() + { + final int PRIME = 31; + int result = 1; + result = PRIME * result + ( ( artifact == null ) ? 0 : artifact.hashCode() ); + return result; + } + + public boolean equals( Object obj ) + { + if ( this == obj ) + { + return true; + } + + if ( obj == null ) + { + return false; + } + + if ( getClass() != obj.getClass() ) + { + return false; + } + + final BytecodeRecord other = (BytecodeRecord) obj; + + if ( artifact == null ) + { + if ( other.artifact != null ) + { + return false; + } + } + else if ( !artifact.equals( other.artifact ) ) + { + return false; + } + + return true; + } + + public String getFilename() + { + return filename; + } + + public void setFilename( String filename ) + { + this.filename = filename; + } + + public String toString() + { + StringBuffer sb = new StringBuffer(); + + sb.append( "BytecodeRecord[" ); + sb.append( "artifact=" ).append( artifact ); + sb.append( ",filename=" ).append( filename ); + sb.append( "]" ); + return sb.toString(); + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/filecontent/FileContentAnalyzer.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/filecontent/FileContentAnalyzer.java new file mode 100644 index 000000000..02955d518 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/filecontent/FileContentAnalyzer.java @@ -0,0 +1,48 @@ +package org.apache.maven.archiva.indexer.filecontent; + +/* + * 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.lucene.analysis.Analyzer; +import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.analysis.standard.StandardAnalyzer; +import org.apache.maven.archiva.indexer.lucene.analyzers.FilenamesTokenizer; + +import java.io.Reader; + +/** + * FileContentAnalyzer + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class FileContentAnalyzer extends Analyzer +{ + private static final Analyzer STANDARD = new StandardAnalyzer(); + + public TokenStream tokenStream( String field, Reader reader ) + { + if ( FileContentKeys.FILENAME.equals( field ) ) + { + return new FilenamesTokenizer( reader ); + } + + return STANDARD.tokenStream( field, reader ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/filecontent/FileContentConverter.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/filecontent/FileContentConverter.java new file mode 100644 index 000000000..efe71f562 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/filecontent/FileContentConverter.java @@ -0,0 +1,100 @@ +package org.apache.maven.archiva.indexer.filecontent; + +/* + * 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.lucene.document.Document; +import org.apache.maven.archiva.indexer.ArtifactKeys; +import org.apache.maven.archiva.indexer.lucene.LuceneDocumentMaker; +import org.apache.maven.archiva.indexer.lucene.LuceneEntryConverter; +import org.apache.maven.archiva.indexer.lucene.LuceneRepositoryContentRecord; +import org.apache.maven.archiva.model.ArchivaArtifact; + +import java.text.ParseException; + +/** + * FileContentConverter + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class FileContentConverter + implements LuceneEntryConverter +{ + + public Document convert( LuceneRepositoryContentRecord record ) + { + if ( !( record instanceof FileContentRecord ) ) + { + throw new ClassCastException( "Unable to convert type " + record.getClass().getName() + " to " + + FileContentRecord.class.getName() + "." ); + } + + FileContentRecord filecontent = (FileContentRecord) record; + + LuceneDocumentMaker doc = new LuceneDocumentMaker( filecontent ); + + if( filecontent.getArtifact() != null ) + { + // Artifact Reference + doc.addFieldTokenized( ArtifactKeys.GROUPID, filecontent.getArtifact().getGroupId() ); + doc.addFieldExact( ArtifactKeys.GROUPID_EXACT, filecontent.getArtifact().getGroupId() ); + doc.addFieldTokenized( ArtifactKeys.ARTIFACTID, filecontent.getArtifact().getArtifactId() ); + doc.addFieldExact( ArtifactKeys.ARTIFACTID_EXACT, filecontent.getArtifact().getArtifactId() ); + doc.addFieldTokenized( ArtifactKeys.VERSION, filecontent.getArtifact().getVersion() ); + doc.addFieldExact( ArtifactKeys.VERSION_EXACT, filecontent.getArtifact().getVersion() ); + doc.addFieldTokenized( ArtifactKeys.TYPE, filecontent.getArtifact().getType() ); + doc.addFieldUntokenized( ArtifactKeys.CLASSIFIER, filecontent.getArtifact().getClassifier() ); + } + + doc.addFieldTokenized( FileContentKeys.FILENAME, filecontent.getFilename() ); + doc.addFieldTokenized( FileContentKeys.CONTENT, filecontent.getContents() ); + + return doc.getDocument(); + } + + public LuceneRepositoryContentRecord convert( Document document ) + throws ParseException + { + FileContentRecord record = new FileContentRecord(); + + record.setRepositoryId( document.get( LuceneDocumentMaker.REPOSITORY_ID ) ); + + // Artifact Reference + String groupId = document.get( ArtifactKeys.GROUPID ); + String artifactId = document.get( ArtifactKeys.ARTIFACTID ); + String version = document.get( ArtifactKeys.VERSION ); + String classifier = document.get( ArtifactKeys.CLASSIFIER ); + String type = document.get( ArtifactKeys.TYPE ); + + if( StringUtils.isNotBlank( groupId ) && StringUtils.isNotBlank( artifactId ) ) + { + ArchivaArtifact artifact = new ArchivaArtifact( groupId, artifactId, version, classifier, type ); + record.setArtifact( artifact ); + } + + // Filecontent Specifics + record.setFilename( document.get( FileContentKeys.FILENAME ) ); + record.setContents( document.get( FileContentKeys.CONTENT ) ); + + return record; + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/filecontent/FileContentHandlers.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/filecontent/FileContentHandlers.java new file mode 100644 index 000000000..23246e3fa --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/filecontent/FileContentHandlers.java @@ -0,0 +1,70 @@ +package org.apache.maven.archiva.indexer.filecontent; + +/* + * 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.lucene.analysis.Analyzer; +import org.apache.lucene.queryParser.MultiFieldQueryParser; +import org.apache.lucene.queryParser.QueryParser; +import org.apache.maven.archiva.indexer.lucene.LuceneEntryConverter; +import org.apache.maven.archiva.indexer.lucene.LuceneIndexHandlers; + +/** + * FileContentHandlers + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class FileContentHandlers + implements LuceneIndexHandlers +{ + private FileContentAnalyzer analyzer; + + private FileContentConverter converter; + + private QueryParser queryParser; + + public FileContentHandlers() + { + analyzer = new FileContentAnalyzer(); + converter = new FileContentConverter(); + queryParser = new MultiFieldQueryParser( new String[] { FileContentKeys.FILENAME, FileContentKeys.CONTENT }, + analyzer ); + } + + public String getId() + { + return FileContentKeys.ID; + } + + public Analyzer getAnalyzer() + { + return analyzer; + } + + public LuceneEntryConverter getConverter() + { + return converter; + } + + public QueryParser getQueryParser() + { + return queryParser; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/filecontent/FileContentKeys.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/filecontent/FileContentKeys.java new file mode 100644 index 000000000..b13e4846f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/filecontent/FileContentKeys.java @@ -0,0 +1,38 @@ +package org.apache.maven.archiva.indexer.filecontent; + +/* + * 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.archiva.indexer.ArtifactKeys; + +/** + * Lucene Index Keys for the various fields in the FileContent index. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class FileContentKeys + extends ArtifactKeys +{ + public static final String ID = "filecontent"; + + public static final String FILENAME = "filename"; + + public static final String CONTENT = "content"; +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/filecontent/FileContentRecord.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/filecontent/FileContentRecord.java new file mode 100644 index 000000000..af039c8c7 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/filecontent/FileContentRecord.java @@ -0,0 +1,130 @@ +package org.apache.maven.archiva.indexer.filecontent; + +/* + * 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.archiva.indexer.lucene.LuceneRepositoryContentRecord; +import org.apache.maven.archiva.model.ArchivaArtifact; + +/** + * Lucene record for {@link File} contents. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class FileContentRecord + implements LuceneRepositoryContentRecord +{ + private String repositoryId; + + private String filename; + + /** + * Optional artifact reference for the file content. + */ + private ArchivaArtifact artifact; + + private String contents; + + public String getRepositoryId() + { + return repositoryId; + } + + public void setRepositoryId( String repositoryId ) + { + this.repositoryId = repositoryId; + } + + public String getContents() + { + return contents; + } + + public void setContents( String contents ) + { + this.contents = contents; + } + + public String getPrimaryKey() + { + return repositoryId + ":" + filename; + } + + public int hashCode() + { + final int PRIME = 31; + int result = 1; + result = PRIME * result + ( ( filename == null ) ? 0 : filename.hashCode() ); + return result; + } + + public boolean equals( Object obj ) + { + if ( this == obj ) + { + return true; + } + + if ( obj == null ) + { + return false; + } + + if ( getClass() != obj.getClass() ) + { + return false; + } + + final FileContentRecord other = (FileContentRecord) obj; + + if ( filename == null ) + { + if ( other.filename != null ) + { + return false; + } + } + else if ( !filename.equals( other.filename ) ) + { + return false; + } + return true; + } + + public String getFilename() + { + return filename; + } + + public void setFilename( String filename ) + { + this.filename = filename; + } + + public ArchivaArtifact getArtifact() + { + return artifact; + } + + public void setArtifact( ArchivaArtifact artifact ) + { + this.artifact = artifact; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/BytecodeIndexTransformer.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/BytecodeIndexTransformer.java new file mode 100644 index 000000000..5d232aef5 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/BytecodeIndexTransformer.java @@ -0,0 +1,51 @@ +package org.apache.maven.archiva.indexer.functors; + +/* + * 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.collections.Transformer; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.indexer.RepositoryContentIndexFactory; + +/** + * BytecodeIndexTransformer + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component role="org.apache.commons.collections.Transformer" role-hint="bytecode" + */ +public class BytecodeIndexTransformer + implements Transformer +{ + /** + * @plexus.requirement role-hint="lucene" + */ + private RepositoryContentIndexFactory indexFactory; + + public Object transform( Object input ) + { + if ( input instanceof ManagedRepositoryConfiguration ) + { + return indexFactory.createBytecodeIndex( (ManagedRepositoryConfiguration) input ); + } + + return input; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/FileContentIndexTransformer.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/FileContentIndexTransformer.java new file mode 100644 index 000000000..2b20cbf2e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/FileContentIndexTransformer.java @@ -0,0 +1,51 @@ +package org.apache.maven.archiva.indexer.functors; + +/* + * 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.collections.Transformer; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.indexer.RepositoryContentIndexFactory; + +/** + * FileContentIndexTransformer + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component role="org.apache.commons.collections.Transformer" role-hint="filecontent" + */ +public class FileContentIndexTransformer + implements Transformer +{ + /** + * @plexus.requirement role-hint="lucene" + */ + private RepositoryContentIndexFactory indexFactory; + + public Object transform( Object input ) + { + if ( input instanceof ManagedRepositoryConfiguration ) + { + return indexFactory.createFileContentIndex( (ManagedRepositoryConfiguration) input ); + } + + return input; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/HashcodesIndexTransformer.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/HashcodesIndexTransformer.java new file mode 100644 index 000000000..6101e8891 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/HashcodesIndexTransformer.java @@ -0,0 +1,51 @@ +package org.apache.maven.archiva.indexer.functors; + +/* + * 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.collections.Transformer; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.indexer.RepositoryContentIndexFactory; + +/** + * HashcodesIndexTransformer + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component role="org.apache.commons.collections.Transformer" role-hint="hashcodes" + */ +public class HashcodesIndexTransformer + implements Transformer +{ + /** + * @plexus.requirement role-hint="lucene" + */ + private RepositoryContentIndexFactory indexFactory; + + public Object transform( Object input ) + { + if ( input instanceof ManagedRepositoryConfiguration ) + { + return indexFactory.createHashcodeIndex( (ManagedRepositoryConfiguration) input ); + } + + return input; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/IndexExistsPredicate.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/IndexExistsPredicate.java new file mode 100644 index 000000000..11848fbd3 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/IndexExistsPredicate.java @@ -0,0 +1,61 @@ +package org.apache.maven.archiva.indexer.functors; + +/* + * 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.collections.Predicate; +import org.apache.maven.archiva.indexer.RepositoryContentIndex; +import org.apache.maven.archiva.indexer.RepositoryIndexException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Test the {@link RepositoryContentIndex} object for the existance of an index. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class IndexExistsPredicate + implements Predicate +{ + private Logger log = LoggerFactory.getLogger( IndexExistsPredicate.class ); + + public boolean evaluate( Object object ) + { + boolean satisfies = false; + + if ( object instanceof RepositoryContentIndex ) + { + RepositoryContentIndex index = (RepositoryContentIndex) object; + try + { + satisfies = index.exists(); + } + catch ( RepositoryIndexException e ) + { + log.info( + "Repository Content Index [" + index.getId() + "] for repository [" + + index.getRepository().getId() + "] does not exist yet in [" + + index.getIndexDirectory().getAbsolutePath() + "]." ); + } + } + + return satisfies; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/SearchableTransformer.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/SearchableTransformer.java new file mode 100644 index 000000000..0bee20a43 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/SearchableTransformer.java @@ -0,0 +1,58 @@ +package org.apache.maven.archiva.indexer.functors; + +/* + * 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.collections.Transformer; +import org.apache.maven.archiva.indexer.RepositoryIndexSearchException; +import org.apache.maven.archiva.indexer.lucene.LuceneRepositoryContentIndex; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * SearchableTransformer + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component role="org.apache.commons.collections.Transformer" role-hint="searchable" + */ +public class SearchableTransformer + implements Transformer +{ + private Logger log = LoggerFactory.getLogger( SearchableTransformer.class ); + + public Object transform( Object input ) + { + if ( input instanceof LuceneRepositoryContentIndex ) + { + try + { + LuceneRepositoryContentIndex index = (LuceneRepositoryContentIndex) input; + return index.getSearchable(); + } + catch ( RepositoryIndexSearchException e ) + { + log.warn("Unable to get searchable for index:" + e.getMessage(), e); + } + } + + return input; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/UserAllowedToSearchRepositoryPredicate.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/UserAllowedToSearchRepositoryPredicate.java new file mode 100644 index 000000000..528de940d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/functors/UserAllowedToSearchRepositoryPredicate.java @@ -0,0 +1,46 @@ +package org.apache.maven.archiva.indexer.functors; + +/* + * 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.collections.Predicate; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; + +/** + * UserAllowedToSearchRepositoryPredicate + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class UserAllowedToSearchRepositoryPredicate + implements Predicate +{ + public boolean evaluate( Object object ) + { + boolean satisfies = false; + + if ( object instanceof ManagedRepositoryConfiguration ) + { + // TODO: perform check here. + satisfies = true; // Everyone is allowed! (for now) + } + + return satisfies; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/hashcodes/HashcodesAnalyzer.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/hashcodes/HashcodesAnalyzer.java new file mode 100644 index 000000000..08efa2858 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/hashcodes/HashcodesAnalyzer.java @@ -0,0 +1,63 @@ +package org.apache.maven.archiva.indexer.hashcodes; + +/* + * 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.lucene.analysis.Analyzer; +import org.apache.lucene.analysis.LowerCaseFilter; +import org.apache.lucene.analysis.StopAnalyzer; +import org.apache.lucene.analysis.StopFilter; +import org.apache.lucene.analysis.TokenStream; +import org.apache.lucene.analysis.standard.StandardAnalyzer; +import org.apache.maven.archiva.indexer.ArtifactKeys; +import org.apache.maven.archiva.indexer.lucene.analyzers.GroupIdTokenizer; +import org.apache.maven.archiva.indexer.lucene.analyzers.VersionTokenizer; + +import java.io.Reader; + +/** + * HashcodesAnalyzer + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class HashcodesAnalyzer extends Analyzer +{ + private static final Analyzer STANDARD = new StandardAnalyzer(); + + public TokenStream tokenStream( String field, Reader reader ) + { + TokenStream tokenStream = null; + + if ( ArtifactKeys.GROUPID.equals( field ) ) + { + tokenStream = new GroupIdTokenizer( reader ); + } + else if ( ArtifactKeys.VERSION.equals( field ) ) + { + tokenStream = new VersionTokenizer( reader ); + } + else + { + tokenStream = STANDARD.tokenStream( field, reader ); + } + + return new LowerCaseFilter( new StopFilter( tokenStream, StopAnalyzer.ENGLISH_STOP_WORDS ) ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/hashcodes/HashcodesEntryConverter.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/hashcodes/HashcodesEntryConverter.java new file mode 100644 index 000000000..6f5b2810b --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/hashcodes/HashcodesEntryConverter.java @@ -0,0 +1,91 @@ +package org.apache.maven.archiva.indexer.hashcodes; + +/* + * 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.lucene.document.Document; +import org.apache.maven.archiva.indexer.ArtifactKeys; +import org.apache.maven.archiva.indexer.lucene.LuceneDocumentMaker; +import org.apache.maven.archiva.indexer.lucene.LuceneEntryConverter; +import org.apache.maven.archiva.indexer.lucene.LuceneRepositoryContentRecord; +import org.apache.maven.archiva.model.ArchivaArtifact; + +import java.text.ParseException; + +/** + * Converter for Hashcode records and documents. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class HashcodesEntryConverter implements LuceneEntryConverter +{ + + public Document convert( LuceneRepositoryContentRecord record ) + { + if ( !( record instanceof HashcodesRecord ) ) + { + throw new ClassCastException( "Unable to convert type " + record.getClass().getName() + " to " + + HashcodesRecord.class.getName() + "." ); + } + + HashcodesRecord hashcodes = (HashcodesRecord) record; + + LuceneDocumentMaker doc = new LuceneDocumentMaker( hashcodes ); + + // Artifact Reference + doc.addFieldTokenized( ArtifactKeys.GROUPID, hashcodes.getArtifact().getGroupId() ); + doc.addFieldExact( ArtifactKeys.GROUPID_EXACT, hashcodes.getArtifact().getGroupId() ); + doc.addFieldTokenized( ArtifactKeys.ARTIFACTID, hashcodes.getArtifact().getArtifactId() ); + doc.addFieldExact( ArtifactKeys.ARTIFACTID_EXACT, hashcodes.getArtifact().getArtifactId() ); + doc.addFieldTokenized( ArtifactKeys.VERSION, hashcodes.getArtifact().getVersion() ); + doc.addFieldExact( ArtifactKeys.VERSION_EXACT, hashcodes.getArtifact().getVersion() ); + doc.addFieldTokenized( ArtifactKeys.TYPE, hashcodes.getArtifact().getType() ); + doc.addFieldUntokenized( ArtifactKeys.CLASSIFIER, hashcodes.getArtifact().getClassifier() ); + + // Hashcode Specifics + doc.addFieldUntokenized( HashcodesKeys.MD5, hashcodes.getArtifact().getModel().getChecksumMD5() ); + doc.addFieldUntokenized( HashcodesKeys.SHA1, hashcodes.getArtifact().getModel().getChecksumSHA1() ); + + return doc.getDocument(); + } + + public LuceneRepositoryContentRecord convert( Document document ) throws ParseException + { + HashcodesRecord record = new HashcodesRecord(); + + record.setRepositoryId( document.get( LuceneDocumentMaker.REPOSITORY_ID ) ); + + // Artifact Reference + String groupId = document.get( ArtifactKeys.GROUPID ); + String artifactId = document.get( ArtifactKeys.ARTIFACTID ); + String version = document.get( ArtifactKeys.VERSION ); + String classifier = document.get( ArtifactKeys.CLASSIFIER ); + String type = document.get( ArtifactKeys.TYPE ); + + ArchivaArtifact artifact = new ArchivaArtifact( groupId, artifactId, version, classifier, type ); + record.setArtifact( artifact ); + + // Hashcode Specifics + record.getArtifact().getModel().setChecksumMD5( document.get( HashcodesKeys.MD5 ) ); + record.getArtifact().getModel().setChecksumSHA1( document.get( HashcodesKeys.SHA1 ) ); + + return record; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/hashcodes/HashcodesHandlers.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/hashcodes/HashcodesHandlers.java new file mode 100644 index 000000000..15ed13a3c --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/hashcodes/HashcodesHandlers.java @@ -0,0 +1,76 @@ +package org.apache.maven.archiva.indexer.hashcodes; + +/* + * 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.lucene.analysis.Analyzer; +import org.apache.lucene.queryParser.MultiFieldQueryParser; +import org.apache.lucene.queryParser.QueryParser; +import org.apache.maven.archiva.indexer.lucene.LuceneEntryConverter; +import org.apache.maven.archiva.indexer.lucene.LuceneIndexHandlers; + +/** + * HashcodesHandlers + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class HashcodesHandlers + implements LuceneIndexHandlers +{ + private HashcodesAnalyzer analyzer; + + private HashcodesEntryConverter converter; + + private QueryParser queryParser; + + public HashcodesHandlers() + { + converter = new HashcodesEntryConverter(); + analyzer = new HashcodesAnalyzer(); + queryParser = new MultiFieldQueryParser( new String[] { + HashcodesKeys.GROUPID, + HashcodesKeys.ARTIFACTID, + HashcodesKeys.VERSION, + HashcodesKeys.CLASSIFIER, + HashcodesKeys.TYPE, + HashcodesKeys.MD5, + HashcodesKeys.SHA1 }, analyzer ); + } + + public String getId() + { + return HashcodesKeys.ID; + } + + public Analyzer getAnalyzer() + { + return analyzer; + } + + public LuceneEntryConverter getConverter() + { + return converter; + } + + public QueryParser getQueryParser() + { + return queryParser; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/hashcodes/HashcodesKeys.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/hashcodes/HashcodesKeys.java new file mode 100644 index 000000000..ede5b6a64 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/hashcodes/HashcodesKeys.java @@ -0,0 +1,37 @@ +package org.apache.maven.archiva.indexer.hashcodes; + +/* + * 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.archiva.indexer.ArtifactKeys; + +/** + * Lucene Index Keys for the various fields in the Hashcodes Index. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class HashcodesKeys extends ArtifactKeys +{ + public static final String ID = "hashcodes"; + + public static final String MD5 = "md5"; + + public static final String SHA1 = "sha1"; +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/hashcodes/HashcodesRecord.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/hashcodes/HashcodesRecord.java new file mode 100644 index 000000000..01f56b190 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/hashcodes/HashcodesRecord.java @@ -0,0 +1,139 @@ +package org.apache.maven.archiva.indexer.hashcodes; + +/* + * 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.archiva.indexer.lucene.LuceneRepositoryContentRecord; +import org.apache.maven.archiva.model.ArchivaArtifact; + +/** + * Lucene record for {@link ArchivaArtifact} hashcodes information. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class HashcodesRecord + implements LuceneRepositoryContentRecord +{ + private String repositoryId; + + private ArchivaArtifact artifact; + + private String filename; + + public ArchivaArtifact getArtifact() + { + return artifact; + } + + public void setArtifact( ArchivaArtifact artifact ) + { + this.artifact = artifact; + } + + public String getPrimaryKey() + { + StringBuffer id = new StringBuffer(); + id.append( artifact.getGroupId() ).append( ":" ); + id.append( artifact.getArtifactId() ).append( ":" ); + id.append( artifact.getVersion() ); + + if ( artifact.getClassifier() != null ) + { + id.append( ":" ).append( artifact.getClassifier() ); + } + + id.append( ":" ).append( artifact.getType() ); + + return id.toString(); + } + + public int hashCode() + { + final int PRIME = 31; + int result = 1; + result = PRIME * result + ( ( artifact == null ) ? 0 : artifact.hashCode() ); + return result; + } + + public boolean equals( Object obj ) + { + if ( this == obj ) + { + return true; + } + + if ( obj == null ) + { + return false; + } + + if ( getClass() != obj.getClass() ) + { + return false; + } + + final HashcodesRecord other = (HashcodesRecord) obj; + + if ( artifact == null ) + { + if ( other.artifact != null ) + { + return false; + } + } + else if ( !artifact.equals( other.artifact ) ) + { + return false; + } + + return true; + } + + public String getRepositoryId() + { + return this.repositoryId; + } + + public void setRepositoryId( String repositoryId ) + { + this.repositoryId = repositoryId; + } + + public String getFilename() + { + return filename; + } + + public void setFilename( String filename ) + { + this.filename = filename; + } + + public String toString() + { + StringBuffer sb = new StringBuffer(); + + sb.append( "HashcodesRecord[" ); + sb.append( "artifact=" ).append( artifact ); + sb.append( ",filename=" ).append( filename ); + sb.append( "]" ); + return sb.toString(); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/lucene/LuceneDocumentMaker.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/lucene/LuceneDocumentMaker.java new file mode 100644 index 000000000..90db51a1d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/lucene/LuceneDocumentMaker.java @@ -0,0 +1,119 @@ +package org.apache.maven.archiva.indexer.lucene; + +/* + * 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.lucene.document.Document; +import org.apache.lucene.document.Field; + +import java.util.List; + +/** + * LuceneDocumentMaker - a utility class for making lucene documents. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class LuceneDocumentMaker +{ + public static final String PRIMARY_KEY = "pk"; + + public static final String REPOSITORY_ID = "repoId"; + + private Document document; + + /** + * Construct a LuceneDocumentMaker based on the record provider. + * + * @param record the record. + * @throws IllegalArgumentException if the primary key is invalid. + */ + public LuceneDocumentMaker( LuceneRepositoryContentRecord record ) throws IllegalArgumentException + { + if ( record == null ) + { + throw new IllegalArgumentException( "Not allowed to have a null record provider." ); + } + + String primaryKey = record.getPrimaryKey(); + + if ( StringUtils.isBlank( primaryKey ) ) + { + throw new IllegalArgumentException( "Not allowed to have a blank primary key." ); + } + + String repositoryId = record.getRepositoryId(); + + if ( StringUtils.isBlank( repositoryId ) ) + { + throw new IllegalArgumentException( "Not allowed to have a blank repository id." ); + } + + document = new Document(); + + document.add( new Field( PRIMARY_KEY, primaryKey, Field.Store.NO, Field.Index.UN_TOKENIZED ) ); + document.add( new Field( REPOSITORY_ID, repositoryId, Field.Store.YES, Field.Index.UN_TOKENIZED ) ); + } + + public LuceneDocumentMaker addFieldTokenized( String key, String value ) + { + if ( value != null ) + { + document.add( new Field( key, value, Field.Store.YES, Field.Index.TOKENIZED ) ); + } + + return this; + } + + public LuceneDocumentMaker addFieldTokenized( String key, List list ) + { + if ( ( list != null ) && ( !list.isEmpty() ) ) + { + return addFieldTokenized( key, StringUtils.join( list.iterator(), "\n" ) ); + } + + return this; + } + + public LuceneDocumentMaker addFieldUntokenized( String name, String value ) + { + if ( value != null ) + { + document.add( new Field( name, value, Field.Store.YES, Field.Index.UN_TOKENIZED ) ); + } + + return this; + } + + public LuceneDocumentMaker addFieldExact( String name, String value ) + { + if ( value != null ) + { + document.add( new Field( name, value, Field.Store.NO, Field.Index.UN_TOKENIZED ) ); + } + + return this; + } + + public Document getDocument() + { + return this.document; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/lucene/LuceneEntryConverter.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/lucene/LuceneEntryConverter.java new file mode 100644 index 000000000..6b6437063 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/lucene/LuceneEntryConverter.java @@ -0,0 +1,50 @@ +package org.apache.maven.archiva.indexer.lucene; + +/* + * 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.lucene.document.Document; + +import java.text.ParseException; + +/** + * A converter for {@link LuceneRepositoryContentRecord} to Lucene {@link Document} objects and back. + * + * @author Brett Porter + */ +public interface LuceneEntryConverter +{ + /** + * Convert an index record to a Lucene document. + * + * @param record the record + * @return the document + */ + Document convert( LuceneRepositoryContentRecord record ); + + /** + * Convert a Lucene document to an index record. + * + * @param document the document + * @return the record + * @throws java.text.ParseException if there is a problem parsing a field (specifically, dates) + */ + LuceneRepositoryContentRecord convert( Document document ) + throws ParseException; +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/lucene/LuceneIndexHandlers.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/lucene/LuceneIndexHandlers.java new file mode 100644 index 000000000..85378482d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/lucene/LuceneIndexHandlers.java @@ -0,0 +1,60 @@ +package org.apache.maven.archiva.indexer.lucene; + +/* + * 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.lucene.analysis.Analyzer; +import org.apache.lucene.queryParser.QueryParser; + +/** + * The important bits and pieces for handling a specific lucene index + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public interface LuceneIndexHandlers +{ + /** + * Get the converter to use with this index. + * + * @return the converter to use. + */ + public LuceneEntryConverter getConverter(); + + /** + * Get the analyzer to user with this index. + * + * @return the analzer to use. + */ + public Analyzer getAnalyzer(); + + /** + * Get the {@link QueryParser} appropriate for searches within this index. + * + * @return the query parser. + */ + public QueryParser getQueryParser(); + + /** + * Get the id of the index handler. + * + * @return the id of the index handler. + */ + public String getId(); +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/lucene/LuceneQuery.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/lucene/LuceneQuery.java new file mode 100644 index 000000000..c476c059d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/lucene/LuceneQuery.java @@ -0,0 +1,43 @@ +package org.apache.maven.archiva.indexer.lucene; + +/* + * 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.archiva.indexer.query.Query; + +/** + * A holder for a lucene query to pass to the indexer API. + * + * @author Brett Porter + */ +public class LuceneQuery + implements Query +{ + private final org.apache.lucene.search.Query query; + + public LuceneQuery( org.apache.lucene.search.Query query ) + { + this.query = query; + } + + public org.apache.lucene.search.Query getLuceneQuery() + { + return query; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/lucene/LuceneRepositoryContentIndex.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/lucene/LuceneRepositoryContentIndex.java new file mode 100644 index 000000000..8e79138e8 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/lucene/LuceneRepositoryContentIndex.java @@ -0,0 +1,448 @@ +package org.apache.maven.archiva.indexer.lucene; + +/* + * 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.lucene.analysis.Analyzer; +import org.apache.lucene.document.Document; +import org.apache.lucene.index.IndexReader; +import org.apache.lucene.index.IndexWriter; +import org.apache.lucene.index.Term; +import org.apache.lucene.index.TermEnum; +import org.apache.lucene.queryParser.QueryParser; +import org.apache.lucene.search.IndexSearcher; +import org.apache.lucene.search.Searchable; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.indexer.RepositoryContentIndex; +import org.apache.maven.archiva.indexer.RepositoryIndexException; +import org.apache.maven.archiva.indexer.RepositoryIndexSearchException; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; + +/** + * Lucene implementation of a repository index. + * + * @author Brett Porter + */ +public class LuceneRepositoryContentIndex + implements RepositoryContentIndex +{ + /** + * The max field length for a field in a document. + */ + private static final int MAX_FIELD_LENGTH = 40000; + + /** + * The location of the index on the file system. + */ + private File indexLocation; + + /** + * The Lucene Index Handlers + */ + private LuceneIndexHandlers indexHandlers; + + private ManagedRepositoryConfiguration repository; + + public LuceneRepositoryContentIndex( ManagedRepositoryConfiguration repository, File indexDir, LuceneIndexHandlers handlers ) + { + this.repository = repository; + this.indexLocation = indexDir; + this.indexHandlers = handlers; + } + + public void indexRecords( Collection records ) + throws RepositoryIndexException + { + deleteRecords( records ); + + addRecords( records ); + } + + public void modifyRecords( Collection records ) + throws RepositoryIndexException + { + synchronized( repository ) + { + IndexWriter indexWriter = null; + try + { + indexWriter = new IndexWriter( indexLocation, indexHandlers.getAnalyzer(), !exists() ); + indexWriter.setMaxFieldLength( MAX_FIELD_LENGTH ); + + for ( Iterator i = records.iterator(); i.hasNext(); ) + { + LuceneRepositoryContentRecord record = (LuceneRepositoryContentRecord) i.next(); + + if ( record != null ) + { + Term term = new Term( LuceneDocumentMaker.PRIMARY_KEY, record.getPrimaryKey() ); + + indexWriter.deleteDocuments( term ); + + Document document = indexHandlers.getConverter().convert( record ); + + indexWriter.addDocument( document ); + } + } + indexWriter.optimize(); + } + catch ( IOException e ) + { + throw new RepositoryIndexException( "Error updating index: " + e.getMessage(), e ); + } + finally + { + closeQuietly( indexWriter ); + } + } + } + + public void modifyRecord( LuceneRepositoryContentRecord record ) + throws RepositoryIndexException + { + synchronized( repository ) + { + IndexWriter indexWriter = null; + try + { + indexWriter = new IndexWriter( indexLocation, indexHandlers.getAnalyzer(), !exists() ); + indexWriter.setMaxFieldLength( MAX_FIELD_LENGTH ); + + if ( record != null ) + { + Term term = new Term( LuceneDocumentMaker.PRIMARY_KEY, record.getPrimaryKey() ); + + indexWriter.deleteDocuments( term ); + + Document document = indexHandlers.getConverter().convert( record ); + + indexWriter.addDocument( document ); + } + indexWriter.optimize(); + } + catch ( IOException e ) + { + throw new RepositoryIndexException( "Error updating index: " + e.getMessage(), e ); + } + finally + { + closeQuietly( indexWriter ); + } + } + } + + + private void addRecords( Collection records ) + throws RepositoryIndexException + { + synchronized( repository ) + { + IndexWriter indexWriter; + try + { + indexWriter = new IndexWriter( indexLocation, indexHandlers.getAnalyzer(), !exists() ); + indexWriter.setMaxFieldLength( MAX_FIELD_LENGTH ); + } + catch ( IOException e ) + { + throw new RepositoryIndexException( "Unable to open index", e ); + } + + try + { + for ( Iterator i = records.iterator(); i.hasNext(); ) + { + LuceneRepositoryContentRecord record = (LuceneRepositoryContentRecord) i.next(); + + if ( record != null ) + { + Document document = indexHandlers.getConverter().convert( record ); + + indexWriter.addDocument( document ); + } + } + + indexWriter.optimize(); + } + catch ( IOException e ) + { + throw new RepositoryIndexException( "Failed to add an index document", e ); + } + finally + { + closeQuietly( indexWriter ); + } + } + } + + public void deleteRecords( Collection records ) + throws RepositoryIndexException + { + synchronized( repository ) + { + if ( exists() ) + { + IndexReader indexReader = null; + try + { + indexReader = IndexReader.open( indexLocation ); + + for ( Iterator i = records.iterator(); i.hasNext(); ) + { + LuceneRepositoryContentRecord record = (LuceneRepositoryContentRecord) i.next(); + + if ( record != null ) + { + Term term = new Term( LuceneDocumentMaker.PRIMARY_KEY, record.getPrimaryKey() ); + + indexReader.deleteDocuments( term ); + } + } + } + catch ( IOException e ) + { + throw new RepositoryIndexException( "Error deleting document: " + e.getMessage(), e ); + } + finally + { + closeQuietly( indexReader ); + } + } + } + } + + public void deleteRecord( LuceneRepositoryContentRecord record ) + throws RepositoryIndexException + { + synchronized( repository ) + { + if ( exists() ) + { + IndexReader indexReader = null; + try + { + indexReader = IndexReader.open( indexLocation ); + + if ( record != null ) + { + Term term = new Term( LuceneDocumentMaker.PRIMARY_KEY, record.getPrimaryKey() ); + + indexReader.deleteDocuments( term ); + } + } + catch ( IOException e ) + { + throw new RepositoryIndexException( "Error deleting document: " + e.getMessage(), e ); + } + finally + { + closeQuietly( indexReader ); + } + } + } + } + + + public Collection getAllRecordKeys() + throws RepositoryIndexException + { + return getAllFieldValues( LuceneDocumentMaker.PRIMARY_KEY ); + } + + private List getAllFieldValues( String fieldName ) + throws RepositoryIndexException + { + synchronized( repository ) + { + List keys = new ArrayList(); + + if ( exists() ) + { + IndexReader indexReader = null; + TermEnum terms = null; + try + { + indexReader = IndexReader.open( indexLocation ); + + terms = indexReader.terms( new Term( fieldName, "" ) ); + while ( fieldName.equals( terms.term().field() ) ) + { + keys.add( terms.term().text() ); + + if ( !terms.next() ) + { + break; + } + } + } + catch ( IOException e ) + { + throw new RepositoryIndexException( "Error deleting document: " + e.getMessage(), e ); + } + finally + { + closeQuietly( indexReader ); + closeQuietly( terms ); + } + } + return keys; + } + } + + public Searchable getSearchable() + throws RepositoryIndexSearchException + { + try + { + IndexSearcher searcher = new IndexSearcher( indexLocation.getAbsolutePath() ); + return searcher; + } + catch ( IOException e ) + { + throw new RepositoryIndexSearchException( "Unable to open index: " + e.getMessage(), e ); + } + } + + public boolean exists() + throws RepositoryIndexException + { + if ( IndexReader.indexExists( indexLocation ) ) + { + return true; + } + else if ( !indexLocation.exists() ) + { + return false; + } + else if ( indexLocation.isDirectory() ) + { + if ( indexLocation.listFiles().length > 1 ) + { + throw new RepositoryIndexException( indexLocation + " is not a valid index directory." ); + } + else + { + return false; + } + } + else + { + throw new RepositoryIndexException( indexLocation + " is not a directory." ); + } + } + + public QueryParser getQueryParser() + { + return this.indexHandlers.getQueryParser(); + } + + public static void closeSearchable( Searchable searchable ) + { + if( searchable != null ) + { + try + { + searchable.close(); + } + catch ( IOException e ) + { + // Ignore + } + } + } + + private static void closeQuietly( TermEnum terms ) + throws RepositoryIndexException + { + if ( terms != null ) + { + try + { + terms.close(); + } + catch ( IOException e ) + { + // ignore + } + } + } + + private static void closeQuietly( IndexWriter indexWriter ) + throws RepositoryIndexException + { + try + { + if ( indexWriter != null ) + { + indexWriter.close(); + } + } + catch ( IOException e ) + { + // write should compain if it can't be closed, data probably not persisted + throw new RepositoryIndexException( e.getMessage(), e ); + } + } + + private static void closeQuietly( IndexReader reader ) + { + try + { + if ( reader != null ) + { + reader.close(); + } + } + catch ( IOException e ) + { + // ignore + } + } + + public File getIndexDirectory() + { + return this.indexLocation; + } + + public String getId() + { + return this.indexHandlers.getId(); + } + + public ManagedRepositoryConfiguration getRepository() + { + return repository; + } + + public Analyzer getAnalyzer() + { + return this.indexHandlers.getAnalyzer(); + } + + public LuceneEntryConverter getEntryConverter() + { + return this.indexHandlers.getConverter(); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/lucene/LuceneRepositoryContentIndexFactory.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/lucene/LuceneRepositoryContentIndexFactory.java new file mode 100644 index 000000000..8564bd74a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/lucene/LuceneRepositoryContentIndexFactory.java @@ -0,0 +1,104 @@ +package org.apache.maven.archiva.indexer.lucene; + +/* + * 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.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.indexer.RepositoryContentIndex; +import org.apache.maven.archiva.indexer.RepositoryContentIndexFactory; +import org.apache.maven.archiva.indexer.bytecode.BytecodeHandlers; +import org.apache.maven.archiva.indexer.filecontent.FileContentHandlers; +import org.apache.maven.archiva.indexer.hashcodes.HashcodesHandlers; + +import java.io.File; + +/** + * Factory for Lucene repository content index instances. + * + * @author Brett Porter + * @author Joakim Erdfelt + * @plexus.component role="org.apache.maven.archiva.indexer.RepositoryContentIndexFactory" role-hint="lucene" + */ +public class LuceneRepositoryContentIndexFactory + implements RepositoryContentIndexFactory +{ + /** + * @plexus.requirement + */ + private ArchivaConfiguration configuration; + + public RepositoryContentIndex createBytecodeIndex( ManagedRepositoryConfiguration repository ) + { + File indexDir = toIndexDir( repository, "bytecode" ); + return new LuceneRepositoryContentIndex( repository, indexDir, new BytecodeHandlers() ); + } + + public RepositoryContentIndex createFileContentIndex( ManagedRepositoryConfiguration repository ) + { + File indexDir = toIndexDir( repository, "filecontent" ); + return new LuceneRepositoryContentIndex( repository, indexDir, new FileContentHandlers() ); + } + + public RepositoryContentIndex createHashcodeIndex( ManagedRepositoryConfiguration repository ) + { + File indexDir = toIndexDir( repository, "hashcodes" ); + return new LuceneRepositoryContentIndex( repository, indexDir, new HashcodesHandlers() ); + } + + /** + * Obtain the index directory for the provided repository. + * + * @param repository the repository to obtain the index directory from. + * @param indexId the id of the index + * @return the directory to put the index into. + */ + private File toIndexDir( ManagedRepositoryConfiguration repository, String indexId ) + { + // Attempt to get the specified indexDir in the configuration first. + ManagedRepositoryConfiguration repoConfig = + configuration.getConfiguration().findManagedRepositoryById( repository.getId() ); + File indexDir; + + if ( repoConfig == null ) + { + // No configured index dir, use the repository path instead. + String repoPath = repository.getLocation(); + indexDir = new File( repoPath, ".index/" + indexId + "/" ); + } + else + { + // Use configured index dir. + String repoPath = repoConfig.getIndexDir(); + if ( StringUtils.isBlank( repoPath ) ) + { + repoPath = repository.getLocation(); + if ( !repoPath.endsWith( "/" ) ) + { + repoPath += "/"; + } + repoPath += ".index"; + } + indexDir = new File( repoPath, "/" + indexId + "/" ); + } + + return indexDir; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/lucene/LuceneRepositoryContentRecord.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/lucene/LuceneRepositoryContentRecord.java new file mode 100644 index 000000000..f3ec7b540 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/lucene/LuceneRepositoryContentRecord.java @@ -0,0 +1,42 @@ +package org.apache.maven.archiva.indexer.lucene; + +/* + * 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 repository content index record. + * + * @author Brett Porter + */ +public interface LuceneRepositoryContentRecord +{ + /** + * Get the primary key used to identify the record uniquely in the index. + * + * @return the primary key + */ + public String getPrimaryKey(); + + /** + * Get the repository that this record belongs to. + * + * @return the repository id for this record. + */ + public String getRepositoryId(); +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/lucene/analyzers/ClassnameTokenizer.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/lucene/analyzers/ClassnameTokenizer.java new file mode 100644 index 000000000..5e2044c65 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/lucene/analyzers/ClassnameTokenizer.java @@ -0,0 +1,58 @@ +package org.apache.maven.archiva.indexer.lucene.analyzers; + +/* + * 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.lucene.analysis.CharTokenizer; + +import java.io.Reader; + +/** + * Lucene Tokenizer for {@link BytecodeKeys#CLASSES} fields. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ClassnameTokenizer extends CharTokenizer +{ + public ClassnameTokenizer( Reader reader ) + { + super( reader ); + } + + /** + * Determine Token Character. + * + * The field is a list of full classnames "com.foo.Object" seperated by + * newline characters. "\n". + * + * Identify newline "\n" and "." as the token delimiters. + */ + protected boolean isTokenChar( char c ) + { + return ( ( c != '\n' ) && ( c != '.' ) ); + } + + /* + protected char normalize( char c ) + { + return Character.toLowerCase( c ); + } + */ +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/lucene/analyzers/FilenamesTokenizer.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/lucene/analyzers/FilenamesTokenizer.java new file mode 100644 index 000000000..5094d7529 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/lucene/analyzers/FilenamesTokenizer.java @@ -0,0 +1,51 @@ +package org.apache.maven.archiva.indexer.lucene.analyzers; + +/* + * 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.lucene.analysis.CharTokenizer; + +import java.io.Reader; + +/** + * Lucene Tokenizer for {@link BytecodeKeys#FILES} fields. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class FilenamesTokenizer extends CharTokenizer +{ + public FilenamesTokenizer( Reader reader ) + { + super( reader ); + } + + /** + * Determine Token Character. + * + * The field is a list of full filenames "/home/archiva/foo/readme.txt" seperated by + * newline characters. "\n". + * + * Identify newline "\n" and "/" as the token delimiters. + */ + protected boolean isTokenChar( char c ) + { + return ( ( c != '\n' ) && ( c != '/' ) ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/lucene/analyzers/GroupIdTokenizer.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/lucene/analyzers/GroupIdTokenizer.java new file mode 100644 index 000000000..b6134e8ab --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/lucene/analyzers/GroupIdTokenizer.java @@ -0,0 +1,51 @@ +package org.apache.maven.archiva.indexer.lucene.analyzers; + +/* + * 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.lucene.analysis.CharTokenizer; + +import java.io.Reader; + +/** + * Lucene Tokenizer for {@link ArtifactKeys#GROUPID} fields. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class GroupIdTokenizer extends CharTokenizer +{ + public GroupIdTokenizer( Reader reader ) + { + super( reader ); + } + + /** + * Determine Token Character. + * + * The field is a groupId "com.foo.project". + * + * Identify "." as the token delimiter. + */ + protected boolean isTokenChar( char c ) + { + return ( c != '.' ); + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/lucene/analyzers/VersionTokenizer.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/lucene/analyzers/VersionTokenizer.java new file mode 100644 index 000000000..f4e79804b --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/lucene/analyzers/VersionTokenizer.java @@ -0,0 +1,50 @@ +package org.apache.maven.archiva.indexer.lucene.analyzers; + +/* + * 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.lucene.analysis.CharTokenizer; + +import java.io.Reader; + +/** + * Lucene Tokenizer for {@link ArtifactKeys#VERSION} fields. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class VersionTokenizer extends CharTokenizer +{ + public VersionTokenizer( Reader reader ) + { + super( reader ); + } + + /** + * Determine Token Character. + * + * The field is a version id in the form "1.0-alpha-4-SNAPSHOT". + * + * Identify "-" as the token delimiter. + */ + protected boolean isTokenChar( char c ) + { + return ( c != '.' ) && ( c != '-' ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/query/CompoundQuery.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/query/CompoundQuery.java new file mode 100644 index 000000000..b3fb6ce1a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/query/CompoundQuery.java @@ -0,0 +1,108 @@ +package org.apache.maven.archiva.indexer.query; + +/* + * 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.List; + +/** + * Class to hold multiple SinglePhraseQueries and/or other CompoundQueries. + * + * @author Edwin Punzalan + */ +public class CompoundQuery + implements Query +{ + /** + * The query terms. + */ + private final List compoundQueryTerms = new ArrayList(); + + /** + * Appends a required term to this query. + * + * @param term the term to be appended to this query + */ + public void and( QueryTerm term ) + { + compoundQueryTerms.add( CompoundQueryTerm.and( new SingleTermQuery( term ) ) ); + } + + /** + * Appends an optional term to this query. + * + * @param term the term to be appended to this query + */ + public void or( QueryTerm term ) + { + compoundQueryTerms.add( CompoundQueryTerm.or( new SingleTermQuery( term ) ) ); + } + + /** + * Appends a prohibited term to this query. + * + * @param term the term to be appended to this query + */ + public void not( QueryTerm term ) + { + compoundQueryTerms.add( CompoundQueryTerm.not( new SingleTermQuery( term ) ) ); + } + + /** + * Appends a required subquery to this query. + * + * @param query the subquery to be appended to this query + */ + public void and( Query query ) + { + compoundQueryTerms.add( CompoundQueryTerm.and( query ) ); + } + + /** + * Appends an optional subquery to this query. + * + * @param query the subquery to be appended to this query + */ + public void or( Query query ) + { + compoundQueryTerms.add( CompoundQueryTerm.or( query ) ); + } + + /** + * Appends a prohibited subquery to this query. + * + * @param query the subquery to be appended to this query + */ + public void not( Query query ) + { + compoundQueryTerms.add( CompoundQueryTerm.not( query ) ); + } + + /** + * Method to get the List of Queries appended into this + * + * @return List of all Queries added to this Query + */ + public List getCompoundQueryTerms() + { + return compoundQueryTerms; + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/query/CompoundQueryTerm.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/query/CompoundQueryTerm.java new file mode 100644 index 000000000..434e487a2 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/query/CompoundQueryTerm.java @@ -0,0 +1,103 @@ +package org.apache.maven.archiva.indexer.query; + +/* + * 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. + */ + +/** + * Base of all query terms. + * + * @author Brett Porter + */ +public class CompoundQueryTerm +{ + /** + * The query to add to the compound query. + */ + private final Query query; + + /** + * Whether the term is required (an AND). + */ + private final boolean required; + + /** + * Whether the term is prohibited (a NOT). + */ + private final boolean prohibited; + + /** + * Class constructor + * + * @param query the subquery to add + * @param required whether the term is required (an AND) + * @param prohibited whether the term is prohibited (a NOT) + */ + private CompoundQueryTerm( Query query, boolean required, boolean prohibited ) + { + this.query = query; + this.prohibited = prohibited; + this.required = required; + } + + /** + * Method to test if the Query is a search requirement + * + * @return true if this Query is a search requirement, otherwise returns false + */ + public boolean isRequired() + { + return required; + } + + /** + * Method to test if the Query is prohibited in the search result + * + * @return true if this Query is prohibited in the search result + */ + public boolean isProhibited() + { + return prohibited; + } + + + /** + * The subquery to execute. + * + * @return the query + */ + public Query getQuery() + { + return query; + } + + static CompoundQueryTerm and( Query query ) + { + return new CompoundQueryTerm( query, true, false ); + } + + static CompoundQueryTerm or( Query query ) + { + return new CompoundQueryTerm( query, false, false ); + } + + static CompoundQueryTerm not( Query query ) + { + return new CompoundQueryTerm( query, false, true ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/query/Query.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/query/Query.java new file mode 100644 index 000000000..9c0c608dd --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/query/Query.java @@ -0,0 +1,29 @@ +package org.apache.maven.archiva.indexer.query; + +/* + * 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. + */ + +/** + * Interface to label the query classes + * + * @author Edwin Punzalan + */ +public interface Query +{ +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/query/QueryTerm.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/query/QueryTerm.java new file mode 100644 index 000000000..259729e87 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/query/QueryTerm.java @@ -0,0 +1,64 @@ +package org.apache.maven.archiva.indexer.query; + +/* + * 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. + */ + +/** + * Class to hold a single field search condition + * + * @author Edwin Punzalan + */ +public class QueryTerm +{ + private String field; + + private String value; + + /** + * Class constructor + * + * @param field the index field to search + * @param value the index value requirement + */ + public QueryTerm( String field, String value ) + { + this.field = field; + this.value = value; + } + + /** + * Method to retrieve the name of the index field searched + * + * @return the name of the index field + */ + public String getField() + { + return field; + } + + /** + * Method to retrieve the value used in searching the index field + * + * @return the value to corresspond the index field + */ + public String getValue() + { + return value; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/query/RangeQuery.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/query/RangeQuery.java new file mode 100644 index 000000000..1e455d5f0 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/query/RangeQuery.java @@ -0,0 +1,153 @@ +package org.apache.maven.archiva.indexer.query; + +/* + * 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. + */ + +/** + * Query object that handles range queries (presently used for dates). + * + * @author Maria Odea Ching + * @author Brett Porter + */ +public class RangeQuery + implements Query +{ + /** + * Whether values equal to the boundaries are included in the query results. + */ + private final boolean inclusive; + + /** + * The lower bound. + */ + private final QueryTerm begin; + + /** + * The upper bound. + */ + private final QueryTerm end; + + /** + * Constructor. + * + * @param begin the lower bound + * @param end the upper bound + * @param inclusive whether to include the boundaries in the query + */ + private RangeQuery( QueryTerm begin, QueryTerm end, boolean inclusive ) + { + this.begin = begin; + this.end = end; + this.inclusive = inclusive; + } + + /** + * Create an open range, including all results. + * + * @return the query object + */ + public static RangeQuery createOpenRange() + { + return new RangeQuery( null, null, false ); + } + + /** + * Create a bounded range, excluding the endpoints. + * + * @param begin the lower bound value to compare to + * @param end the upper bound value to compare to + * @return the query object + */ + public static RangeQuery createExclusiveRange( QueryTerm begin, QueryTerm end ) + { + return new RangeQuery( begin, end, false ); + } + + /** + * Create a bounded range, including the endpoints. + * + * @param begin the lower bound value to compare to + * @param end the upper bound value to compare to + * @return the query object + */ + public static RangeQuery createInclusiveRange( QueryTerm begin, QueryTerm end ) + { + return new RangeQuery( begin, end, true ); + } + + /** + * Create a range that is greater than or equal to a given term. + * + * @param begin the value to compare to + * @return the query object + */ + public static RangeQuery createGreaterThanOrEqualToRange( QueryTerm begin ) + { + return new RangeQuery( begin, null, true ); + } + + /** + * Create a range that is greater than a given term. + * + * @param begin the value to compare to + * @return the query object + */ + public static RangeQuery createGreaterThanRange( QueryTerm begin ) + { + return new RangeQuery( begin, null, false ); + } + + /** + * Create a range that is less than or equal to a given term. + * + * @param end the value to compare to + * @return the query object + */ + public static RangeQuery createLessThanOrEqualToRange( QueryTerm end ) + { + return new RangeQuery( null, end, true ); + } + + /** + * Create a range that is less than a given term. + * + * @param end the value to compare to + * @return the query object + */ + public static RangeQuery createLessThanRange( QueryTerm end ) + { + return new RangeQuery( null, end, false ); + } + + public QueryTerm getBegin() + { + return begin; + } + + public QueryTerm getEnd() + { + return end; + } + + public boolean isInclusive() + { + return inclusive; + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/query/SingleTermQuery.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/query/SingleTermQuery.java new file mode 100644 index 000000000..587fcf5c0 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/query/SingleTermQuery.java @@ -0,0 +1,65 @@ +package org.apache.maven.archiva.indexer.query; + +/* + * 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. + */ + +/** + * Query for a single term. + * + * @author Brett Porter + */ +public class SingleTermQuery + implements Query +{ + /** + * The term to query for. + */ + private final QueryTerm term; + + /** + * Constructor. + * + * @param term the term to query + */ + public SingleTermQuery( QueryTerm term ) + { + this.term = term; + } + + /** + * Shorthand constructor - create a single term query from a field and value + * + * @param field the field name + * @param value the value to check for + */ + public SingleTermQuery( String field, String value ) + { + this.term = new QueryTerm( field, value ); + } + + public String getField() + { + return term.getField(); + } + + public String getValue() + { + return term.getValue(); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/search/CrossRepositorySearch.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/search/CrossRepositorySearch.java new file mode 100644 index 000000000..63e21151c --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/search/CrossRepositorySearch.java @@ -0,0 +1,72 @@ +package org.apache.maven.archiva.indexer.search; + +/* + * 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; + +/** + * Search across repositories in lucene indexes. + * + * @author Joakim Erdfelt + * @version $Id$ + * @todo add security to not perform search in repositories you don't have access to. + */ +public interface CrossRepositorySearch +{ + /** + * Search for the specific term across all repositories. + * + * @param term the term to search for. + * @param limits the limits to apply to the search results. + * @return the results. + */ + public SearchResults searchForTerm( String principal, List selectedRepos, String term, SearchResultLimits limits ); + + /** + * Search for a specific term from the previous search results. + * + * @param principal the user doing the search. + * @param selectedRepos the repositories to search from. + * @param term the term to search for. + * @param limits the limits to apply to the search results. + * @param previousSearchTerms the list of the previous search terms. + * @return the results + */ + public SearchResults searchForTerm( String principal, List selectedRepos, String term, + SearchResultLimits limits, List previousSearchTerms ); + + /** + * Search for the specific bytecode across all repositories. + * + * @param term the term to search for. + * @param limits the limits to apply to the search results. + * @return the results. + */ + public SearchResults searchForBytecode( String principal, List selectedRepos, String term, SearchResultLimits limits ); + + /** + * Search for the specific checksum string across all repositories. + * + * @param checksum the checksum string to search for. + * @param limits the limits to apply to the search results. + * @return the results. + */ + public SearchResults searchForChecksum( String principal, List selectedRepos, String checksum, SearchResultLimits limits ); +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/search/DefaultCrossRepositorySearch.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/search/DefaultCrossRepositorySearch.java new file mode 100644 index 000000000..ede311346 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/search/DefaultCrossRepositorySearch.java @@ -0,0 +1,411 @@ +package org.apache.maven.archiva.indexer.search; + +/* + * 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.IOException; +import java.util.ArrayList; +import java.util.List; + +import org.apache.lucene.document.Document; +import org.apache.lucene.queryParser.MultiFieldQueryParser; +import org.apache.lucene.queryParser.ParseException; +import org.apache.lucene.queryParser.QueryParser; +import org.apache.lucene.search.BooleanClause; +import org.apache.lucene.search.BooleanQuery; +import org.apache.lucene.search.Filter; +import org.apache.lucene.search.Hits; +import org.apache.lucene.search.MultiSearcher; +import org.apache.lucene.search.QueryWrapperFilter; +import org.apache.lucene.search.Searchable; +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.ConfigurationNames; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.indexer.RepositoryContentIndex; +import org.apache.maven.archiva.indexer.RepositoryContentIndexFactory; +import org.apache.maven.archiva.indexer.RepositoryIndexException; +import org.apache.maven.archiva.indexer.RepositoryIndexSearchException; +import org.apache.maven.archiva.indexer.bytecode.BytecodeHandlers; +import org.apache.maven.archiva.indexer.filecontent.FileContentHandlers; +import org.apache.maven.archiva.indexer.hashcodes.HashcodesHandlers; +import org.apache.maven.archiva.indexer.hashcodes.HashcodesKeys; +import org.apache.maven.archiva.indexer.lucene.LuceneEntryConverter; +import org.apache.maven.archiva.indexer.lucene.LuceneQuery; +import org.apache.maven.archiva.indexer.lucene.LuceneRepositoryContentRecord; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException; +import org.codehaus.plexus.registry.Registry; +import org.codehaus.plexus.registry.RegistryListener; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * DefaultCrossRepositorySearch + * + * @author Joakim Erdfelt + * @version $Id$ + * @plexus.component role="org.apache.maven.archiva.indexer.search.CrossRepositorySearch" role-hint="default" + */ +public class DefaultCrossRepositorySearch + implements CrossRepositorySearch, RegistryListener, Initializable +{ + private Logger log = LoggerFactory.getLogger( DefaultCrossRepositorySearch.class ); + + /** + * @plexus.requirement role-hint="lucene" + */ + private RepositoryContentIndexFactory indexFactory; + + /** + * @plexus.requirement + */ + private ArchivaConfiguration configuration; + + private List localIndexedRepositories = new ArrayList(); + + public SearchResults searchForChecksum( String principal, List selectedRepos, String checksum, SearchResultLimits limits ) + { + List indexes = getHashcodeIndexes( principal, selectedRepos ); + + try + { + QueryParser parser = new MultiFieldQueryParser( new String[]{HashcodesKeys.MD5, HashcodesKeys.SHA1}, + new HashcodesHandlers().getAnalyzer() ); + LuceneQuery query = new LuceneQuery( parser.parse( checksum ) ); + SearchResults results = searchAll( query, limits, indexes, null ); + results.getRepositories().addAll( this.localIndexedRepositories ); + + return results; + } + catch ( ParseException e ) + { + log.warn( "Unable to parse query [" + checksum + "]: " + e.getMessage(), e ); + } + + // empty results. + return new SearchResults(); + } + + public SearchResults searchForBytecode( String principal, List selectedRepos, String term, SearchResultLimits limits ) + { + List indexes = getBytecodeIndexes( principal, selectedRepos ); + + try + { + QueryParser parser = new BytecodeHandlers().getQueryParser(); + LuceneQuery query = new LuceneQuery( parser.parse( term ) ); + SearchResults results = searchAll( query, limits, indexes, null ); + results.getRepositories().addAll( this.localIndexedRepositories ); + + return results; + } + catch ( ParseException e ) + { + log.warn( "Unable to parse query [" + term + "]: " + e.getMessage(), e ); + } + + // empty results. + return new SearchResults(); + } + + + public SearchResults searchForTerm( String principal, List selectedRepos, String term, SearchResultLimits limits ) + { + return searchForTerm( principal, selectedRepos, term, limits, null ); + } + + public SearchResults searchForTerm( String principal, List selectedRepos, String term, + SearchResultLimits limits, List previousSearchTerms ) + { + List indexes = getFileContentIndexes( principal, selectedRepos ); + + try + { + QueryParser parser = new FileContentHandlers().getQueryParser(); + LuceneQuery query = null; + SearchResults results = null; + if( previousSearchTerms == null || previousSearchTerms.isEmpty() ) + { + query = new LuceneQuery( parser.parse( term ) ); + results = searchAll( query, limits, indexes, null ); + } + else + { + // AND the previous search terms + BooleanQuery booleanQuery = new BooleanQuery(); + for( String previousSearchTerm : previousSearchTerms ) + { + booleanQuery.add( parser.parse( previousSearchTerm ), BooleanClause.Occur.MUST ); + } + + query = new LuceneQuery( booleanQuery ); + Filter filter = new QueryWrapperFilter( parser.parse( term ) ); + results = searchAll( query, limits, indexes, filter ); + } + results.getRepositories().addAll( this.localIndexedRepositories ); + + return results; + } + catch ( ParseException e ) + { + log.warn( "Unable to parse query [" + term + "]: " + e.getMessage(), e ); + } + + // empty results. + return new SearchResults(); + } + + private SearchResults searchAll( LuceneQuery luceneQuery, SearchResultLimits limits, List indexes, Filter filter ) + { + org.apache.lucene.search.Query specificQuery = luceneQuery.getLuceneQuery(); + + SearchResults results = new SearchResults(); + + if ( indexes.isEmpty() ) + { + // No point going any further. + return results; + } + + // Setup the converter + LuceneEntryConverter converter = null; + RepositoryContentIndex index = indexes.get( 0 ); + converter = index.getEntryConverter(); + + // Process indexes into an array of Searchables. + List searchableList = toSearchables( indexes ); + + Searchable searchables[] = new Searchable[searchableList.size()]; + searchableList.toArray( searchables ); + + MultiSearcher searcher = null; + + try + { + // Create a multi-searcher for looking up the information. + searcher = new MultiSearcher( searchables ); + + // Perform the search. + Hits hits = null; + if( filter != null ) + { + hits = searcher.search( specificQuery, filter ); + } + else + { + hits = searcher.search( specificQuery ); + } + + int hitCount = hits.length(); + + // Now process the limits. + results.setLimits( limits ); + results.setTotalHits( hitCount ); + + int fetchCount = limits.getPageSize(); + int offset = ( limits.getSelectedPage() * limits.getPageSize() ); + + if ( limits.getSelectedPage() == SearchResultLimits.ALL_PAGES ) + { + fetchCount = hitCount; + offset = 0; + } + + // Goto offset. + if ( offset < hitCount ) + { + // only process if the offset is within the hit count. + for ( int i = 0; i < fetchCount; i++ ) + { + // Stop fetching if we are past the total # of available hits. + if ( offset + i >= hitCount ) + { + break; + } + + try + { + Document doc = hits.doc( offset + i ); + LuceneRepositoryContentRecord record = converter.convert( doc ); + results.addHit( record ); + } + catch ( java.text.ParseException e ) + { + log.warn( "Unable to parse document into record: " + e.getMessage(), e ); + } + } + } + + } + catch ( IOException e ) + { + log.error( "Unable to setup multi-search: " + e.getMessage(), e ); + } + finally + { + try + { + if ( searcher != null ) + { + searcher.close(); + } + } + catch ( IOException ie ) + { + log.error( "Unable to close index searcher: " + ie.getMessage(), ie ); + } + } + + return results; + } + + private List toSearchables( List indexes ) + { + List searchableList = new ArrayList(); + for ( RepositoryContentIndex contentIndex : indexes ) + { + try + { + searchableList.add( contentIndex.getSearchable() ); + } + catch ( RepositoryIndexSearchException e ) + { + log.warn( "Unable to get searchable for index [" + contentIndex.getId() + "] :" + + e.getMessage(), e ); + } + } + return searchableList; + } + + public List getBytecodeIndexes( String principal, List selectedRepos ) + { + List ret = new ArrayList(); + + for ( ManagedRepositoryConfiguration repoConfig : localIndexedRepositories ) + { + // Only used selected repo + if ( selectedRepos.contains( repoConfig.getId() ) ) + { + RepositoryContentIndex index = indexFactory.createBytecodeIndex( repoConfig ); + // If they exist. + if ( indexExists( index ) ) + { + ret.add( index ); + } + } + } + + return ret; + } + + public List getFileContentIndexes( String principal, List selectedRepos ) + { + List ret = new ArrayList(); + + for ( ManagedRepositoryConfiguration repoConfig : localIndexedRepositories ) + { + // Only used selected repo + if ( selectedRepos.contains( repoConfig.getId() ) ) + { + RepositoryContentIndex index = indexFactory.createFileContentIndex( repoConfig ); + // If they exist. + if ( indexExists( index ) ) + { + ret.add( index ); + } + } + } + + return ret; + } + + public List getHashcodeIndexes( String principal, List selectedRepos ) + { + List ret = new ArrayList(); + + for ( ManagedRepositoryConfiguration repoConfig : localIndexedRepositories ) + { + // Only used selected repo + if ( selectedRepos.contains( repoConfig.getId() ) ) + { + RepositoryContentIndex index = indexFactory.createHashcodeIndex( repoConfig ); + // If they exist. + if ( indexExists( index ) ) + { + ret.add( index ); + } + } + } + + return ret; + } + + private boolean indexExists( RepositoryContentIndex index ) + { + try + { + return index.exists(); + } + catch ( RepositoryIndexException e ) + { + log.info( + "Repository Content Index [" + index.getId() + "] for repository [" + + index.getRepository().getId() + "] does not exist yet in [" + + index.getIndexDirectory().getAbsolutePath() + "]." ); + return false; + } + } + + public void afterConfigurationChange( Registry registry, String propertyName, Object propertyValue ) + { + if ( ConfigurationNames.isManagedRepositories( propertyName ) ) + { + initRepositories(); + } + } + + public void beforeConfigurationChange( Registry registry, String propertyName, Object propertyValue ) + { + /* Nothing to do here */ + } + + private void initRepositories() + { + synchronized ( this.localIndexedRepositories ) + { + this.localIndexedRepositories.clear(); + + List repos = configuration.getConfiguration().getManagedRepositories(); + for ( ManagedRepositoryConfiguration repo : repos ) + { + if ( repo.isScanned() ) + { + localIndexedRepositories.add( repo ); + } + } + } + } + + public void initialize() + throws InitializationException + { + initRepositories(); + configuration.addChangeListener( this ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/search/SearchResultHit.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/search/SearchResultHit.java new file mode 100644 index 000000000..2933fae8e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/search/SearchResultHit.java @@ -0,0 +1,153 @@ +package org.apache.maven.archiva.indexer.search; + +/* + * 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.maven.archiva.model.ArchivaArtifact; + +import java.util.ArrayList; +import java.util.List; + +/** + * SearchResultHit + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class SearchResultHit +{ + // The (optional) context for this result. + private String context; + + // Basic hit, direct to non-artifact resource. + private String url; + + // Advanced hit, reference to groupId. + private String groupId; + + // Advanced hit, reference to artifactId. + private String artifactId; + + private String version = ""; + + private String repositoryId = ""; + + // Advanced hit, if artifact, all versions of artifact + private List artifacts = new ArrayList(); + + private List versions = new ArrayList(); + + public String getContext() + { + return context; + } + + public void setContext( String context ) + { + this.context = context; + } + + public String getUrl() + { + return url; + } + + public void setUrl( String url ) + { + this.url = url; + } + + public String getUrlFilename() + { + return this.url.substring( this.url.lastIndexOf( '/' ) ); + } + + public String getArtifactId() + { + return artifactId; + } + + public void setArtifactId( String artifactId ) + { + this.artifactId = artifactId; + } + + public void addArtifact( ArchivaArtifact artifact ) + { + this.artifacts.add( artifact ); + + String ver = artifact.getVersion(); + + if ( !this.versions.contains( ver ) ) + { + this.versions.add( ver ); + } + + if ( StringUtils.isBlank( this.groupId ) ) + { + this.groupId = artifact.getGroupId(); + } + + if ( StringUtils.isBlank( this.artifactId ) ) + { + this.artifactId = artifact.getArtifactId(); + } + + if ( StringUtils.isBlank( this.version ) ) + { + this.version = ver; + } + } + + public List getArtifacts() + { + return artifacts; + } + + public String getGroupId() + { + return groupId; + } + + public void setGroupId( String groupId ) + { + this.groupId = groupId; + } + + public String getVersion() + { + return version; + } + + public List getVersions() + { + return versions; + } + + public String getRepositoryId() + { + return repositoryId; + } + + public void setRepositoryId( String repositoryId ) + { + this.repositoryId = repositoryId; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/search/SearchResultLimits.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/search/SearchResultLimits.java new file mode 100644 index 000000000..83979aaec --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/search/SearchResultLimits.java @@ -0,0 +1,70 @@ +package org.apache.maven.archiva.indexer.search; + +/* + * 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. + */ + +/** + * SearchResultLimits - used to provide the search some limits on how the results are returned. + * This can provide paging for the + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class SearchResultLimits +{ + /** + * Constant to use for {@link #setSelectedPage(int)} to indicate a desire to get ALL PAGES. + * USE WITH CAUTION!! + */ + public static final int ALL_PAGES = ( -1 ); + + private int pageSize = 30; + + private int selectedPage = 0; + + public SearchResultLimits( int selectedPage ) + { + this.selectedPage = selectedPage; + } + + public int getPageSize() + { + return pageSize; + } + + /** + * Set page size for maximum # of hits to return per page. + * + * @param pageSize size of page by # of hits. (maximum value is 200) + */ + public void setPageSize( int pageSize ) + { + this.pageSize = Math.min( 200, pageSize ); + } + + public int getSelectedPage() + { + return selectedPage; + } + + public void setSelectedPage( int selectedPage ) + { + this.selectedPage = selectedPage; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/search/SearchResults.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/search/SearchResults.java new file mode 100644 index 000000000..c82097467 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/search/SearchResults.java @@ -0,0 +1,189 @@ +package org.apache.maven.archiva.indexer.search; + +/* + * 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.maven.archiva.indexer.bytecode.BytecodeRecord; +import org.apache.maven.archiva.indexer.filecontent.FileContentRecord; +import org.apache.maven.archiva.indexer.hashcodes.HashcodesRecord; +import org.apache.maven.archiva.indexer.lucene.LuceneRepositoryContentRecord; +import org.apache.maven.archiva.model.ArchivaArtifact; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * SearchResults + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class SearchResults +{ + private List repositories = new ArrayList(); + + private Map hits = new HashMap(); + + private int totalHits; + + private SearchResultLimits limits; + + public SearchResults() + { + /* do nothing */ + } + + public void addHit( LuceneRepositoryContentRecord record ) + { + if ( record instanceof FileContentRecord ) + { + FileContentRecord filecontent = (FileContentRecord) record; + addFileContentHit( filecontent ); + } + else if ( record instanceof HashcodesRecord ) + { + HashcodesRecord hashcodes = (HashcodesRecord) record; + addHashcodeHit( hashcodes ); + } + else if ( record instanceof BytecodeRecord ) + { + BytecodeRecord bytecode = (BytecodeRecord) record; + addBytecodeHit( bytecode ); + } + } + + private void addBytecodeHit( BytecodeRecord bytecode ) + { + String key = toKey( bytecode.getArtifact() ); + + SearchResultHit hit = (SearchResultHit) this.hits.get( key ); + + if ( hit == null ) + { + hit = new SearchResultHit(); + } + + hit.setRepositoryId( bytecode.getRepositoryId() ); + hit.addArtifact( bytecode.getArtifact() ); + hit.setContext( null ); // TODO: provide context on why this is a valuable hit. + + this.hits.put( key, hit ); + } + + private String toKey( ArchivaArtifact artifact ) + { + StringBuffer key = new StringBuffer(); + + key.append( StringUtils.defaultString( artifact.getModel().getRepositoryId() ) ).append( ":" ); + key.append( StringUtils.defaultString( artifact.getGroupId() ) ).append( ":" ); + key.append( StringUtils.defaultString( artifact.getArtifactId() ) ); + + return key.toString(); + } + + private void addHashcodeHit( HashcodesRecord hashcodes ) + { + String key = toKey( hashcodes.getArtifact() ); + + SearchResultHit hit = (SearchResultHit) this.hits.get( key ); + + if ( hit == null ) + { + hit = new SearchResultHit(); + } + + hit.addArtifact( hashcodes.getArtifact() ); + hit.setContext( null ); // TODO: provide context on why this is a valuable hit. + + this.hits.put( key, hit ); + } + + public void addFileContentHit( FileContentRecord filecontent ) + { + String key = filecontent.getPrimaryKey(); + + SearchResultHit hit = (SearchResultHit) this.hits.get( key ); + + if ( hit == null ) + { + // Only need to worry about this hit if it is truely new. + hit = new SearchResultHit(); + + hit.setRepositoryId( filecontent.getRepositoryId() ); + hit.setUrl( filecontent.getRepositoryId() + "/" + filecontent.getFilename() ); + hit.setContext( null ); // TODO: handle context + highlight later. + + // Test for possible artifact reference ... + if( filecontent.getArtifact() != null ) + { + hit.addArtifact( filecontent.getArtifact() ); + } + + this.hits.put( key, hit ); + } + } + + /** + * Get the list of {@link SearchResultHit} objects. + * + * @return the list of {@link SearchResultHit} objects. + */ + public List getHits() + { + return new ArrayList( hits.values() ); + } + + public List getRepositories() + { + return repositories; + } + + public boolean isEmpty() + { + return hits.isEmpty(); + } + + public void setRepositories( List repositories ) + { + this.repositories = repositories; + } + + public SearchResultLimits getLimits() + { + return limits; + } + + public void setLimits( SearchResultLimits limits ) + { + this.limits = limits; + } + + public int getTotalHits() + { + return totalHits; + } + + public void setTotalHits( int totalHits ) + { + this.totalHits = totalHits; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/site/site.xml b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/site/site.xml new file mode 100644 index 000000000..7b39b50d6 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/site/site.xml @@ -0,0 +1,27 @@ + + + + + + + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/artifact-dumps/archiva-common-1.0.jar.txt b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/artifact-dumps/archiva-common-1.0.jar.txt new file mode 100644 index 000000000..1897823ee --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/artifact-dumps/archiva-common-1.0.jar.txt @@ -0,0 +1,56 @@ +FILENAME|archiva-common-1.0-SNAPSHOT.jar +SIZE|8516 +HASH_MD5|a5d0d280ce83133432d8fed8f2ce3474 +HASH_SHA1|c2635a1b38bd4520a6604664c04b2b3c32330864 +HASH_BYTECODE|2868f6661c55afda5a3b62859fbc8b1beb021b6e +JDK|1.4 +CLASS|org.apache.maven.archiva.common.ArchivaException +CLASS|org.apache.maven.archiva.common.utils.BaseFile +CLASS|org.apache.maven.archiva.common.utils.DateUtil +CLASS|org.apache.maven.archiva.common.utils.PathUtil +CLASS|org.apache.maven.archiva.common.utils.VersionUtil +METHOD|org.apache.maven.archiva.common.ArchivaException.(Ljava/lang/String;Ljava/lang/Throwable;)V +METHOD|org.apache.maven.archiva.common.ArchivaException.(Ljava/lang/String;)V +METHOD|org.apache.maven.archiva.common.utils.BaseFile.(Ljava/io/File;)V +METHOD|org.apache.maven.archiva.common.utils.BaseFile.(Ljava/io/File;Ljava/io/File;)V +METHOD|org.apache.maven.archiva.common.utils.BaseFile.(Ljava/io/File;Ljava/lang/String;)V +METHOD|org.apache.maven.archiva.common.utils.BaseFile.(Ljava/lang/String;)V +METHOD|org.apache.maven.archiva.common.utils.BaseFile.(Ljava/lang/String;Ljava/io/File;)V +METHOD|org.apache.maven.archiva.common.utils.BaseFile.(Ljava/lang/String;Ljava/lang/String;)V +METHOD|org.apache.maven.archiva.common.utils.BaseFile.(Ljava/net/URI;)V +METHOD|org.apache.maven.archiva.common.utils.BaseFile.getBaseDir()Ljava/io/File; +METHOD|org.apache.maven.archiva.common.utils.BaseFile.getRelativePath()Ljava/lang/String; +METHOD|org.apache.maven.archiva.common.utils.BaseFile.setBaseDir(Ljava/io/File;)V +METHOD|org.apache.maven.archiva.common.utils.BaseFile.setBaseDir(Ljava/lang/String;)V +METHOD|org.apache.maven.archiva.common.utils.BaseFile.class$(Ljava/lang/String;)Ljava/lang/Class; +METHOD|org.apache.maven.archiva.common.utils.DateUtil.()V +METHOD|org.apache.maven.archiva.common.utils.DateUtil.getDuration(J)Ljava/lang/String; +METHOD|org.apache.maven.archiva.common.utils.DateUtil.getDuration(JJ)Ljava/lang/String; +METHOD|org.apache.maven.archiva.common.utils.DateUtil.getDuration(Ljava/util/Date;Ljava/util/Date;)Ljava/lang/String; +METHOD|org.apache.maven.archiva.common.utils.DateUtil.getDuration(Ljava/util/Calendar;Ljava/util/Calendar;)Ljava/lang/String; +METHOD|org.apache.maven.archiva.common.utils.DateUtil.appendInterval(Ljava/lang/StringBuffer;ILjava/lang/String;)V +METHOD|org.apache.maven.archiva.common.utils.PathUtil.()V +METHOD|org.apache.maven.archiva.common.utils.PathUtil.getRelative(Ljava/lang/String;Ljava/io/File;)Ljava/lang/String; +METHOD|org.apache.maven.archiva.common.utils.PathUtil.getRelative(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; +METHOD|org.apache.maven.archiva.common.utils.VersionUtil.()V +METHOD|org.apache.maven.archiva.common.utils.VersionUtil.isSnapshot(Ljava/lang/String;)Z +METHOD|org.apache.maven.archiva.common.utils.VersionUtil.getBaseVersion(Ljava/lang/String;)Ljava/lang/String; +METHOD|org.apache.maven.archiva.common.utils.VersionUtil.()V +FILE|META-INF/ +FILE|META-INF/MANIFEST.MF +FILE|META-INF/maven/ +FILE|META-INF/maven/org.apache.maven.archiva/ +FILE|META-INF/maven/org.apache.maven.archiva/archiva-common/ +FILE|META-INF/maven/org.apache.maven.archiva/archiva-common/pom.properties +FILE|META-INF/maven/org.apache.maven.archiva/archiva-common/pom.xml +FILE|org/ +FILE|org/apache/ +FILE|org/apache/maven/ +FILE|org/apache/maven/archiva/ +FILE|org/apache/maven/archiva/common/ +FILE|org/apache/maven/archiva/common/ArchivaException.class +FILE|org/apache/maven/archiva/common/utils/ +FILE|org/apache/maven/archiva/common/utils/BaseFile.class +FILE|org/apache/maven/archiva/common/utils/DateUtil.class +FILE|org/apache/maven/archiva/common/utils/PathUtil.class +FILE|org/apache/maven/archiva/common/utils/VersionUtil.class diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/artifact-dumps/continuum-webapp-1.0.3-SNAPSHOT.war.txt b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/artifact-dumps/continuum-webapp-1.0.3-SNAPSHOT.war.txt new file mode 100644 index 000000000..c27604795 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/artifact-dumps/continuum-webapp-1.0.3-SNAPSHOT.war.txt @@ -0,0 +1,1492 @@ +FILENAME|continuum-webapp-1.0.3-SNAPSHOT.war +SIZE|12014375 +HASH_MD5|72bd7b7c170a8a6404b1d28c5244837a +HASH_SHA1|1b8e405f706abd47a324e68f0962ade82809ec02 +HASH_BYTECODE|5339229350071bf5d84e6520308515af3220eb2c +JDK|1.1 +CLASS|org.apache.maven.continuum.web.action.AboutAction +CLASS|org.apache.maven.continuum.web.action.AddMavenOneProjectAction +CLASS|org.apache.maven.continuum.web.action.AddMavenProjectAction +CLASS|org.apache.maven.continuum.web.action.AddMavenTwoProjectAction +CLASS|org.apache.maven.continuum.web.action.AddProjectAction +CLASS|org.apache.maven.continuum.web.action.BuildDefinitionAction +CLASS|org.apache.maven.continuum.web.action.BuildProjectAction +CLASS|org.apache.maven.continuum.web.action.BuildResultAction +CLASS|org.apache.maven.continuum.web.action.BuildResultsListAction +CLASS|org.apache.maven.continuum.web.action.CancelBuildAction +CLASS|org.apache.maven.continuum.web.action.CheckConfigurationAction +CLASS|org.apache.maven.continuum.web.action.ContinuumActionSupport +CLASS|org.apache.maven.continuum.web.action.ContinuumConfirmAction +CLASS|org.apache.maven.continuum.web.action.DeleteProjectAction +CLASS|org.apache.maven.continuum.web.action.GroupSummaryAction +CLASS|org.apache.maven.continuum.web.action.ProjectEditAction +CLASS|org.apache.maven.continuum.web.action.ProjectGroupAction +CLASS|org.apache.maven.continuum.web.action.ProjectViewAction +CLASS|org.apache.maven.continuum.web.action.ReleaseCleanupAction +CLASS|org.apache.maven.continuum.web.action.ReleaseInProgressAction +CLASS|org.apache.maven.continuum.web.action.ReleasePerformAction +CLASS|org.apache.maven.continuum.web.action.ReleasePrepareAction +CLASS|org.apache.maven.continuum.web.action.ReleaseProjectAction +CLASS|org.apache.maven.continuum.web.action.ReleaseProjectGoalAction +CLASS|org.apache.maven.continuum.web.action.ScheduleAction +CLASS|org.apache.maven.continuum.web.action.SummaryAction +CLASS|org.apache.maven.continuum.web.action.SurefireReportAction$1 +CLASS|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTest +CLASS|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTestCase +CLASS|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTestSuite +CLASS|org.apache.maven.continuum.web.action.SurefireReportAction +CLASS|org.apache.maven.continuum.web.action.UserGroupManagementAction +CLASS|org.apache.maven.continuum.web.action.UserManagementAction +CLASS|org.apache.maven.continuum.web.action.WorkingCopyAction +CLASS|org.apache.maven.continuum.web.action.admin.ConfigurationAction +CLASS|org.apache.maven.continuum.web.action.component.BuildDefinitionSummaryAction +CLASS|org.apache.maven.continuum.web.action.component.ContinuumTabAction +CLASS|org.apache.maven.continuum.web.action.component.NotifierSummaryAction +CLASS|org.apache.maven.continuum.web.action.notifier.AbstractGroupNotifierEditAction +CLASS|org.apache.maven.continuum.web.action.notifier.AbstractNotifierEditActionSupport +CLASS|org.apache.maven.continuum.web.action.notifier.AbstractProjectNotifierEditAction +CLASS|org.apache.maven.continuum.web.action.notifier.AddGroupNotifierAction +CLASS|org.apache.maven.continuum.web.action.notifier.AddProjectNotifierAction +CLASS|org.apache.maven.continuum.web.action.notifier.DeleteGroupNotifierAction +CLASS|org.apache.maven.continuum.web.action.notifier.DeleteProjectNotifierAction +CLASS|org.apache.maven.continuum.web.action.notifier.IrcGroupNotifierEditAction +CLASS|org.apache.maven.continuum.web.action.notifier.IrcProjectNotifierEditAction +CLASS|org.apache.maven.continuum.web.action.notifier.JabberGroupNotifierEditAction +CLASS|org.apache.maven.continuum.web.action.notifier.JabberProjectNotifierEditAction +CLASS|org.apache.maven.continuum.web.action.notifier.MailGroupNotifierEditAction +CLASS|org.apache.maven.continuum.web.action.notifier.MailProjectNotifierEditAction +CLASS|org.apache.maven.continuum.web.action.notifier.MsnGroupNotifierEditAction +CLASS|org.apache.maven.continuum.web.action.notifier.MsnProjectNotifierEditAction +CLASS|org.apache.maven.continuum.web.checks.security.RoleProfileEnvironmentCheck +CLASS|org.apache.maven.continuum.web.components.Data +CLASS|org.apache.maven.continuum.web.components.SubmitCancel +CLASS|org.apache.maven.continuum.web.exception.ContinuumActionException +CLASS|org.apache.maven.continuum.web.filter.FilterToComponentProxy +CLASS|org.apache.maven.continuum.web.interceptor.ForceContinuumConfigurationInterceptor +CLASS|org.apache.maven.continuum.web.model.BuildDefinitionSummary +CLASS|org.apache.maven.continuum.web.model.ContinuumViewModels +CLASS|org.apache.maven.continuum.web.model.GroupSummary +CLASS|org.apache.maven.continuum.web.model.NotifierSummary +CLASS|org.apache.maven.continuum.web.model.ProjectSummary +CLASS|org.apache.maven.continuum.web.model.Session +CLASS|org.apache.maven.continuum.web.model.SessionUser +CLASS|org.apache.maven.continuum.web.util.StateGenerator +CLASS|org.apache.maven.continuum.web.util.WorkingCopyContentGenerator +CLASS|org.apache.maven.continuum.web.view.BuildCell +CLASS|org.apache.maven.continuum.web.view.BuildNowCell +CLASS|org.apache.maven.continuum.web.view.BuildStatusCell +CLASS|org.apache.maven.continuum.web.view.StateCell +CLASS|org.apache.maven.continuum.web.view.buildresults.StateCell +CLASS|org.apache.maven.continuum.web.view.commons.DateCell +CLASS|org.apache.maven.continuum.web.view.jsp.ui.DataTag +CLASS|org.apache.maven.continuum.web.view.jsp.ui.DateTag +CLASS|org.apache.maven.continuum.web.view.jsp.ui.SubmitCancelTag +CLASS|org.apache.maven.continuum.web.view.projectview.NotifierEventCell +CLASS|org.apache.maven.continuum.web.view.projectview.NotifierFromCell +CLASS|org.apache.maven.continuum.web.view.projectview.NotifierRecipientCell +CLASS|org.apache.maven.continuum.web.xmlrpc.DefaultXmlRpcService +CLASS|org.apache.maven.continuum.web.xmlrpc.XmlRpcService$1 +CLASS|org.apache.maven.continuum.web.xmlrpc.XmlRpcService +METHOD|org.apache.maven.continuum.web.action.AboutAction.()V +METHOD|org.apache.maven.continuum.web.action.AboutAction.doDefault()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.AddMavenOneProjectAction.()V +METHOD|org.apache.maven.continuum.web.action.AddMavenOneProjectAction.doExecute(Ljava/lang/String;)Lorg/apache/maven/continuum/project/builder/ContinuumProjectBuildingResult; +METHOD|org.apache.maven.continuum.web.action.AddMavenOneProjectAction.getM1Pom()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.AddMavenOneProjectAction.setM1Pom(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.AddMavenOneProjectAction.getM1PomFile()Ljava/io/File; +METHOD|org.apache.maven.continuum.web.action.AddMavenOneProjectAction.setM1PomFile(Ljava/io/File;)V +METHOD|org.apache.maven.continuum.web.action.AddMavenOneProjectAction.getM1PomUrl()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.AddMavenOneProjectAction.setM1PomUrl(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.AddMavenProjectAction.()V +METHOD|org.apache.maven.continuum.web.action.AddMavenProjectAction.execute()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.AddMavenProjectAction.doExecute(Ljava/lang/String;)Lorg/apache/maven/continuum/project/builder/ContinuumProjectBuildingResult; +METHOD|org.apache.maven.continuum.web.action.AddMavenProjectAction.doDefault()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.AddMavenProjectAction.getPom()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.AddMavenProjectAction.setPom(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.AddMavenProjectAction.getPomFile()Ljava/io/File; +METHOD|org.apache.maven.continuum.web.action.AddMavenProjectAction.setPomFile(Ljava/io/File;)V +METHOD|org.apache.maven.continuum.web.action.AddMavenProjectAction.getPomUrl()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.AddMavenProjectAction.setPomUrl(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.AddMavenTwoProjectAction.()V +METHOD|org.apache.maven.continuum.web.action.AddMavenTwoProjectAction.doExecute(Ljava/lang/String;)Lorg/apache/maven/continuum/project/builder/ContinuumProjectBuildingResult; +METHOD|org.apache.maven.continuum.web.action.AddMavenTwoProjectAction.doDefault()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.AddMavenTwoProjectAction.getM2PomFile()Ljava/io/File; +METHOD|org.apache.maven.continuum.web.action.AddMavenTwoProjectAction.setM2PomFile(Ljava/io/File;)V +METHOD|org.apache.maven.continuum.web.action.AddMavenTwoProjectAction.getM2PomUrl()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.AddMavenTwoProjectAction.setM2PomUrl(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.AddProjectAction.()V +METHOD|org.apache.maven.continuum.web.action.AddProjectAction.validate()V +METHOD|org.apache.maven.continuum.web.action.AddProjectAction.add()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.AddProjectAction.input()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.AddProjectAction.getProjectName()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.AddProjectAction.setProjectName(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.AddProjectAction.getProjectScmPassword()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.AddProjectAction.setProjectScmPassword(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.AddProjectAction.getProjectScmTag()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.AddProjectAction.setProjectScmTag(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.AddProjectAction.getProjectScmUrl()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.AddProjectAction.setProjectScmUrl(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.AddProjectAction.getProjectScmUsername()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.AddProjectAction.setProjectScmUsername(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.AddProjectAction.getProjectType()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.AddProjectAction.setProjectType(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.AddProjectAction.getProjectVersion()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.AddProjectAction.setProjectVersion(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.BuildDefinitionAction.()V +METHOD|org.apache.maven.continuum.web.action.BuildDefinitionAction.prepare()V +METHOD|org.apache.maven.continuum.web.action.BuildDefinitionAction.input()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.BuildDefinitionAction.saveToProject()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.BuildDefinitionAction.saveToGroup()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.BuildDefinitionAction.removeFromProject()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.BuildDefinitionAction.removeFromProjectGroup()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.BuildDefinitionAction.getBuildDefinitionFromInput()Lorg/apache/maven/continuum/model/project/BuildDefinition; +METHOD|org.apache.maven.continuum.web.action.BuildDefinitionAction.getBuildDefinitionId()I +METHOD|org.apache.maven.continuum.web.action.BuildDefinitionAction.setBuildDefinitionId(I)V +METHOD|org.apache.maven.continuum.web.action.BuildDefinitionAction.getProjectId()I +METHOD|org.apache.maven.continuum.web.action.BuildDefinitionAction.setProjectId(I)V +METHOD|org.apache.maven.continuum.web.action.BuildDefinitionAction.getProjectGroupId()I +METHOD|org.apache.maven.continuum.web.action.BuildDefinitionAction.setProjectGroupId(I)V +METHOD|org.apache.maven.continuum.web.action.BuildDefinitionAction.getScheduleId()I +METHOD|org.apache.maven.continuum.web.action.BuildDefinitionAction.setScheduleId(I)V +METHOD|org.apache.maven.continuum.web.action.BuildDefinitionAction.isDefaultBuildDefinition()Z +METHOD|org.apache.maven.continuum.web.action.BuildDefinitionAction.setDefaultBuildDefinition(Z)V +METHOD|org.apache.maven.continuum.web.action.BuildDefinitionAction.isConfirmed()Z +METHOD|org.apache.maven.continuum.web.action.BuildDefinitionAction.setConfirmed(Z)V +METHOD|org.apache.maven.continuum.web.action.BuildDefinitionAction.getExecutor()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.BuildDefinitionAction.setExecutor(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.BuildDefinitionAction.getGoals()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.BuildDefinitionAction.setGoals(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.BuildDefinitionAction.getArguments()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.BuildDefinitionAction.setArguments(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.BuildDefinitionAction.getBuildFile()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.BuildDefinitionAction.setBuildFile(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.BuildDefinitionAction.isBuildFresh()Z +METHOD|org.apache.maven.continuum.web.action.BuildDefinitionAction.setBuildFresh(Z)V +METHOD|org.apache.maven.continuum.web.action.BuildDefinitionAction.getSchedules()Ljava/util/Map; +METHOD|org.apache.maven.continuum.web.action.BuildDefinitionAction.setSchedules(Ljava/util/Map;)V +METHOD|org.apache.maven.continuum.web.action.BuildDefinitionAction.getProfiles()Ljava/util/Map; +METHOD|org.apache.maven.continuum.web.action.BuildDefinitionAction.setProfiles(Ljava/util/Map;)V +METHOD|org.apache.maven.continuum.web.action.BuildProjectAction.()V +METHOD|org.apache.maven.continuum.web.action.BuildProjectAction.execute()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.BuildProjectAction.setProjectId(I)V +METHOD|org.apache.maven.continuum.web.action.BuildProjectAction.getProjectId()I +METHOD|org.apache.maven.continuum.web.action.BuildResultAction.()V +METHOD|org.apache.maven.continuum.web.action.BuildResultAction.execute()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.BuildResultAction.getBuildId()I +METHOD|org.apache.maven.continuum.web.action.BuildResultAction.setBuildId(I)V +METHOD|org.apache.maven.continuum.web.action.BuildResultAction.getProjectId()I +METHOD|org.apache.maven.continuum.web.action.BuildResultAction.setProjectId(I)V +METHOD|org.apache.maven.continuum.web.action.BuildResultAction.getProjectName()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.BuildResultAction.setProjectName(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.BuildResultAction.getBuildResult()Lorg/apache/maven/continuum/model/project/BuildResult; +METHOD|org.apache.maven.continuum.web.action.BuildResultAction.getChangesSinceLastSuccess()Ljava/util/List; +METHOD|org.apache.maven.continuum.web.action.BuildResultAction.isHasSurefireResults()Z +METHOD|org.apache.maven.continuum.web.action.BuildResultAction.setHasSurefireResults(Z)V +METHOD|org.apache.maven.continuum.web.action.BuildResultAction.getBuildOutput()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.BuildResultAction.getState()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.BuildResultsListAction.()V +METHOD|org.apache.maven.continuum.web.action.BuildResultsListAction.execute()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.BuildResultsListAction.getProjectId()I +METHOD|org.apache.maven.continuum.web.action.BuildResultsListAction.setProjectId(I)V +METHOD|org.apache.maven.continuum.web.action.BuildResultsListAction.getBuildResults()Ljava/util/Collection; +METHOD|org.apache.maven.continuum.web.action.BuildResultsListAction.getProjectName()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.BuildResultsListAction.setProjectName(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.CancelBuildAction.()V +METHOD|org.apache.maven.continuum.web.action.CancelBuildAction.execute()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.CancelBuildAction.setProjectId(I)V +METHOD|org.apache.maven.continuum.web.action.CheckConfigurationAction.()V +METHOD|org.apache.maven.continuum.web.action.CheckConfigurationAction.execute()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ContinuumActionSupport.()V +METHOD|org.apache.maven.continuum.web.action.ContinuumActionSupport.prepare()V +METHOD|org.apache.maven.continuum.web.action.ContinuumActionSupport.getContinuum()Lorg/apache/maven/continuum/Continuum; +METHOD|org.apache.maven.continuum.web.action.ContinuumActionSupport.setContinuum(Lorg/apache/maven/continuum/Continuum;)V +METHOD|org.apache.maven.continuum.web.action.ContinuumConfirmAction.()V +METHOD|org.apache.maven.continuum.web.action.ContinuumConfirmAction.setConfirmationInfo(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.ContinuumConfirmAction.setConfirmedName(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.ContinuumConfirmAction.getConfirmedName()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ContinuumConfirmAction.setConfirmedValue(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.ContinuumConfirmAction.getConfirmedValue()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ContinuumConfirmAction.setConfirmationTitle(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.ContinuumConfirmAction.getConfirmationTitle()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ContinuumConfirmAction.setConfirmedDisplay(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.ContinuumConfirmAction.getConfirmedDisplay()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ContinuumConfirmAction.setConfirmed(Z)V +METHOD|org.apache.maven.continuum.web.action.ContinuumConfirmAction.getConfirmed()Z +METHOD|org.apache.maven.continuum.web.action.ContinuumConfirmAction.setAction(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.ContinuumConfirmAction.getAction()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.DeleteProjectAction.()V +METHOD|org.apache.maven.continuum.web.action.DeleteProjectAction.execute()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.DeleteProjectAction.doDefault()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.DeleteProjectAction.setProjectId(I)V +METHOD|org.apache.maven.continuum.web.action.DeleteProjectAction.getProjectId()I +METHOD|org.apache.maven.continuum.web.action.DeleteProjectAction.setProjectName(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.DeleteProjectAction.getProjectName()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.GroupSummaryAction.()V +METHOD|org.apache.maven.continuum.web.action.GroupSummaryAction.execute()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.GroupSummaryAction.getGroups()Ljava/util/List; +METHOD|org.apache.maven.continuum.web.action.GroupSummaryAction.getInfoMessage()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.GroupSummaryAction.setInfoMessage(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.ProjectEditAction.()V +METHOD|org.apache.maven.continuum.web.action.ProjectEditAction.save()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ProjectEditAction.edit()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ProjectEditAction.getProject(I)Lorg/apache/maven/continuum/model/project/Project; +METHOD|org.apache.maven.continuum.web.action.ProjectEditAction.getProjectId()I +METHOD|org.apache.maven.continuum.web.action.ProjectEditAction.setProjectId(I)V +METHOD|org.apache.maven.continuum.web.action.ProjectEditAction.getName()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ProjectEditAction.setName(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.ProjectEditAction.getVersion()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ProjectEditAction.setVersion(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.ProjectEditAction.getScmUrl()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ProjectEditAction.setScmUrl(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.ProjectEditAction.getScmUsername()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ProjectEditAction.setScmUsername(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.ProjectEditAction.getScmPassword()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ProjectEditAction.setScmPassword(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.ProjectEditAction.getScmTag()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ProjectEditAction.setScmTag(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.ProjectEditAction.getProject()Lorg/apache/maven/continuum/model/project/Project; +METHOD|org.apache.maven.continuum.web.action.ProjectGroupAction.()V +METHOD|org.apache.maven.continuum.web.action.ProjectGroupAction.summary()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ProjectGroupAction.members()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ProjectGroupAction.buildDefinitions()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ProjectGroupAction.notifiers()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ProjectGroupAction.remove()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ProjectGroupAction.build()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ProjectGroupAction.getProjectGroupId()I +METHOD|org.apache.maven.continuum.web.action.ProjectGroupAction.setProjectGroupId(I)V +METHOD|org.apache.maven.continuum.web.action.ProjectGroupAction.getProjectGroup()Lorg/apache/maven/continuum/model/project/ProjectGroup; +METHOD|org.apache.maven.continuum.web.action.ProjectGroupAction.setProjectGroup(Lorg/apache/maven/continuum/model/project/ProjectGroup;)V +METHOD|org.apache.maven.continuum.web.action.ProjectGroupAction.isConfirmed()Z +METHOD|org.apache.maven.continuum.web.action.ProjectGroupAction.setConfirmed(Z)V +METHOD|org.apache.maven.continuum.web.action.ProjectViewAction.()V +METHOD|org.apache.maven.continuum.web.action.ProjectViewAction.execute()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ProjectViewAction.setProjectId(I)V +METHOD|org.apache.maven.continuum.web.action.ProjectViewAction.getProject()Lorg/apache/maven/continuum/model/project/Project; +METHOD|org.apache.maven.continuum.web.action.ProjectViewAction.getProjectId()I +METHOD|org.apache.maven.continuum.web.action.ProjectViewAction.getProjectGroupId()I +METHOD|org.apache.maven.continuum.web.action.ProjectViewAction.setProjectGroupId(I)V +METHOD|org.apache.maven.continuum.web.action.ProjectViewAction.getProjectGroup()Lorg/apache/maven/continuum/model/project/ProjectGroup; +METHOD|org.apache.maven.continuum.web.action.ReleaseCleanupAction.()V +METHOD|org.apache.maven.continuum.web.action.ReleaseCleanupAction.execute()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ReleaseCleanupAction.getReleaseId()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ReleaseCleanupAction.setReleaseId(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.ReleaseCleanupAction.getProjectId()I +METHOD|org.apache.maven.continuum.web.action.ReleaseCleanupAction.setProjectId(I)V +METHOD|org.apache.maven.continuum.web.action.ReleaseInProgressAction.()V +METHOD|org.apache.maven.continuum.web.action.ReleaseInProgressAction.execute()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ReleaseInProgressAction.viewResult()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ReleaseInProgressAction.getReleaseId()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ReleaseInProgressAction.setReleaseId(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.ReleaseInProgressAction.getListener()Lorg/apache/maven/continuum/release/ContinuumReleaseManagerListener; +METHOD|org.apache.maven.continuum.web.action.ReleaseInProgressAction.setListener(Lorg/apache/maven/continuum/release/ContinuumReleaseManagerListener;)V +METHOD|org.apache.maven.continuum.web.action.ReleaseInProgressAction.getResult()Lorg/apache/maven/shared/release/ReleaseResult; +METHOD|org.apache.maven.continuum.web.action.ReleaseInProgressAction.setResult(Lorg/apache/maven/shared/release/ReleaseResult;)V +METHOD|org.apache.maven.continuum.web.action.ReleaseInProgressAction.getProjectId()I +METHOD|org.apache.maven.continuum.web.action.ReleaseInProgressAction.setProjectId(I)V +METHOD|org.apache.maven.continuum.web.action.ReleasePerformAction.()V +METHOD|org.apache.maven.continuum.web.action.ReleasePerformAction.inputFromScm()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ReleasePerformAction.input()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ReleasePerformAction.execute()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ReleasePerformAction.executeFromScm()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ReleasePerformAction.populateFromProject()V +METHOD|org.apache.maven.continuum.web.action.ReleasePerformAction.getReleaseId()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ReleasePerformAction.setReleaseId(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.ReleasePerformAction.getScmUrl()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ReleasePerformAction.setScmUrl(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.ReleasePerformAction.getScmUsername()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ReleasePerformAction.setScmUsername(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.ReleasePerformAction.getScmPassword()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ReleasePerformAction.setScmPassword(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.ReleasePerformAction.getScmTag()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ReleasePerformAction.setScmTag(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.ReleasePerformAction.getScmTagBase()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ReleasePerformAction.setScmTagBase(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.ReleasePerformAction.getGoals()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ReleasePerformAction.setGoals(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.ReleasePerformAction.isUseReleaseProfile()Z +METHOD|org.apache.maven.continuum.web.action.ReleasePerformAction.setUseReleaseProfile(Z)V +METHOD|org.apache.maven.continuum.web.action.ReleasePerformAction.getListener()Lorg/apache/maven/continuum/release/ContinuumReleaseManagerListener; +METHOD|org.apache.maven.continuum.web.action.ReleasePerformAction.setListener(Lorg/apache/maven/continuum/release/ContinuumReleaseManagerListener;)V +METHOD|org.apache.maven.continuum.web.action.ReleasePerformAction.getResult()Lorg/apache/maven/shared/release/ReleaseResult; +METHOD|org.apache.maven.continuum.web.action.ReleasePerformAction.setResult(Lorg/apache/maven/shared/release/ReleaseResult;)V +METHOD|org.apache.maven.continuum.web.action.ReleasePerformAction.getProjectId()I +METHOD|org.apache.maven.continuum.web.action.ReleasePerformAction.setProjectId(I)V +METHOD|org.apache.maven.continuum.web.action.ReleasePrepareAction.()V +METHOD|org.apache.maven.continuum.web.action.ReleasePrepareAction.input()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ReleasePrepareAction.getReleasePluginParameters(Ljava/lang/String;Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.ReleasePrepareAction.execute()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ReleasePrepareAction.viewResult()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ReleasePrepareAction.checkProgress()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ReleasePrepareAction.processProject(Ljava/lang/String;Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.ReleasePrepareAction.setProperties(Lorg/apache/maven/model/Model;)V +METHOD|org.apache.maven.continuum.web.action.ReleasePrepareAction.getDevVersionMap()Ljava/util/Map; +METHOD|org.apache.maven.continuum.web.action.ReleasePrepareAction.getRelVersionMap()Ljava/util/Map; +METHOD|org.apache.maven.continuum.web.action.ReleasePrepareAction.getVersionMap(Ljava/util/List;Ljava/util/List;)Ljava/util/Map; +METHOD|org.apache.maven.continuum.web.action.ReleasePrepareAction.getReleaseProperties()Ljava/util/Properties; +METHOD|org.apache.maven.continuum.web.action.ReleasePrepareAction.getProjectKeys()Ljava/util/List; +METHOD|org.apache.maven.continuum.web.action.ReleasePrepareAction.setProjectKeys(Ljava/util/List;)V +METHOD|org.apache.maven.continuum.web.action.ReleasePrepareAction.getDevVersions()Ljava/util/List; +METHOD|org.apache.maven.continuum.web.action.ReleasePrepareAction.setDevVersions(Ljava/util/List;)V +METHOD|org.apache.maven.continuum.web.action.ReleasePrepareAction.getRelVersions()Ljava/util/List; +METHOD|org.apache.maven.continuum.web.action.ReleasePrepareAction.setRelVersions(Ljava/util/List;)V +METHOD|org.apache.maven.continuum.web.action.ReleasePrepareAction.getProjectId()I +METHOD|org.apache.maven.continuum.web.action.ReleasePrepareAction.setProjectId(I)V +METHOD|org.apache.maven.continuum.web.action.ReleasePrepareAction.getScmUsername()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ReleasePrepareAction.setScmUsername(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.ReleasePrepareAction.getScmPassword()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ReleasePrepareAction.setScmPassword(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.ReleasePrepareAction.getScmTag()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ReleasePrepareAction.setScmTag(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.ReleasePrepareAction.getScmTagBase()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ReleasePrepareAction.setScmTagBase(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.ReleasePrepareAction.getProjects()Ljava/util/List; +METHOD|org.apache.maven.continuum.web.action.ReleasePrepareAction.setProjects(Ljava/util/List;)V +METHOD|org.apache.maven.continuum.web.action.ReleasePrepareAction.getListener()Lorg/apache/maven/continuum/release/ContinuumReleaseManagerListener; +METHOD|org.apache.maven.continuum.web.action.ReleasePrepareAction.setListener(Lorg/apache/maven/continuum/release/DefaultReleaseManagerListener;)V +METHOD|org.apache.maven.continuum.web.action.ReleasePrepareAction.getName()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ReleasePrepareAction.setName(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.ReleasePrepareAction.getReleaseId()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ReleasePrepareAction.setReleaseId(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.ReleasePrepareAction.getResult()Lorg/apache/maven/shared/release/ReleaseResult; +METHOD|org.apache.maven.continuum.web.action.ReleasePrepareAction.setResult(Lorg/apache/maven/shared/release/ReleaseResult;)V +METHOD|org.apache.maven.continuum.web.action.ReleasePrepareAction.getPrepareGoals()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ReleasePrepareAction.setPrepareGoals(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.ReleaseProjectAction.()V +METHOD|org.apache.maven.continuum.web.action.ReleaseProjectAction.promptReleaseGoal()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ReleaseProjectAction.execute()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ReleaseProjectAction.getProjectId()I +METHOD|org.apache.maven.continuum.web.action.ReleaseProjectAction.setProjectId(I)V +METHOD|org.apache.maven.continuum.web.action.ReleaseProjectAction.getPreparedReleaseName()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ReleaseProjectAction.setPreparedReleaseName(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.ReleaseProjectAction.getGoal()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ReleaseProjectAction.setGoal(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.ReleaseProjectAction.getProject()Lorg/apache/maven/continuum/model/project/Project; +METHOD|org.apache.maven.continuum.web.action.ReleaseProjectAction.setProject(Lorg/apache/maven/continuum/model/project/Project;)V +METHOD|org.apache.maven.continuum.web.action.ReleaseProjectAction.getScmUrl()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ReleaseProjectAction.setScmUrl(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.ReleaseProjectAction.getReleaseList()Ljava/util/List; +METHOD|org.apache.maven.continuum.web.action.ReleaseProjectAction.setReleaseList(Ljava/util/List;)V +METHOD|org.apache.maven.continuum.web.action.ReleaseProjectAction.getPreparedReleaseId()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ReleaseProjectAction.setPreparedReleaseId(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.ReleaseProjectAction.getProjectName()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ReleaseProjectAction.setProjectName(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.ReleaseProjectGoalAction.()V +METHOD|org.apache.maven.continuum.web.action.ReleaseProjectGoalAction.execute()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ReleaseProjectGoalAction.getProjectId()I +METHOD|org.apache.maven.continuum.web.action.ReleaseProjectGoalAction.setProjectId(I)V +METHOD|org.apache.maven.continuum.web.action.ReleaseProjectGoalAction.getProjectGroupId()I +METHOD|org.apache.maven.continuum.web.action.ReleaseProjectGoalAction.setProjectGroupId(I)V +METHOD|org.apache.maven.continuum.web.action.ReleaseProjectGoalAction.getProjectName()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ReleaseProjectGoalAction.setProjectName(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.ReleaseProjectGoalAction.getPreparedReleaseName()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ReleaseProjectGoalAction.setPreparedReleaseName(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.ReleaseProjectGoalAction.getPreparedReleaseId()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ReleaseProjectGoalAction.setPreparedReleaseId(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.ScheduleAction.()V +METHOD|org.apache.maven.continuum.web.action.ScheduleAction.summary()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ScheduleAction.input()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ScheduleAction.save()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ScheduleAction.setFields(Lorg/apache/maven/continuum/model/project/Schedule;)Lorg/apache/maven/continuum/model/project/Schedule; +METHOD|org.apache.maven.continuum.web.action.ScheduleAction.confirm()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ScheduleAction.remove()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ScheduleAction.getSchedules()Ljava/util/Collection; +METHOD|org.apache.maven.continuum.web.action.ScheduleAction.getId()I +METHOD|org.apache.maven.continuum.web.action.ScheduleAction.setId(I)V +METHOD|org.apache.maven.continuum.web.action.ScheduleAction.isActive()Z +METHOD|org.apache.maven.continuum.web.action.ScheduleAction.setActive(Z)V +METHOD|org.apache.maven.continuum.web.action.ScheduleAction.getDelay()I +METHOD|org.apache.maven.continuum.web.action.ScheduleAction.setDelay(I)V +METHOD|org.apache.maven.continuum.web.action.ScheduleAction.getDescription()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ScheduleAction.setDescription(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.ScheduleAction.getName()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ScheduleAction.setName(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.ScheduleAction.getSchedule()Lorg/apache/maven/continuum/model/project/Schedule; +METHOD|org.apache.maven.continuum.web.action.ScheduleAction.setSchedule(Lorg/apache/maven/continuum/model/project/Schedule;)V +METHOD|org.apache.maven.continuum.web.action.ScheduleAction.isConfirmed()Z +METHOD|org.apache.maven.continuum.web.action.ScheduleAction.setConfirmed(Z)V +METHOD|org.apache.maven.continuum.web.action.ScheduleAction.getMaxJobExecutionTime()I +METHOD|org.apache.maven.continuum.web.action.ScheduleAction.setMaxJobExecutionTime(I)V +METHOD|org.apache.maven.continuum.web.action.ScheduleAction.getSecond()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ScheduleAction.setSecond(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.ScheduleAction.getMinute()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ScheduleAction.setMinute(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.ScheduleAction.getHour()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ScheduleAction.setHour(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.ScheduleAction.getDayOfMonth()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ScheduleAction.setDayOfMonth(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.ScheduleAction.getYear()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ScheduleAction.setYear(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.ScheduleAction.getMonth()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ScheduleAction.setMonth(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.ScheduleAction.getDayOfWeek()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.ScheduleAction.setDayOfWeek(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.ScheduleAction.getCronExpression()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.SummaryAction.()V +METHOD|org.apache.maven.continuum.web.action.SummaryAction.execute()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.SummaryAction.getNbSuccesses()I +METHOD|org.apache.maven.continuum.web.action.SummaryAction.getNbFailures()I +METHOD|org.apache.maven.continuum.web.action.SummaryAction.getNbErrors()I +METHOD|org.apache.maven.continuum.web.action.SummaryAction.getProjects()Ljava/util/List; +METHOD|org.apache.maven.continuum.web.action.SummaryAction.getProjectGroupId()I +METHOD|org.apache.maven.continuum.web.action.SummaryAction.setProjectGroupId(I)V +METHOD|org.apache.maven.continuum.web.action.SummaryAction.getProjectGroupName()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.SummaryAction.setProjectGroupName(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTest.(Lorg/apache/maven/continuum/web/action/SurefireReportAction;)V +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTest.getName()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTest.setName(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTest.getTests()I +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTest.setTests(I)V +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTest.getErrors()I +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTest.setErrors(I)V +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTest.getFailures()I +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTest.setFailures(I)V +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTest.getSuccessRate()F +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTest.getElapsedTime()F +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTest.setElapsedTime(F)V +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTest.getChildren()Ljava/util/List; +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTest.setChildren(Ljava/util/List;)V +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTest.getId()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTest.setId(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTestCase.(Lorg/apache/maven/continuum/web/action/SurefireReportAction;)V +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTestCase.getName()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTestCase.setName(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTestCase.getFullClassName()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTestCase.setFullClassName(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTestCase.getClassName()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTestCase.setClassName(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTestCase.getTime()F +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTestCase.setTime(F)V +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTestCase.getFullName()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTestCase.setFullName(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTestCase.getFailureType()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTestCase.setFailureType(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTestCase.getFailureMessage()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTestCase.setFailureMessage(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTestCase.getFailureDetails()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTestCase.setFailureDetails(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTestSuite.(Lorg/apache/maven/continuum/web/action/SurefireReportAction;)V +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTestSuite.parse(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTestSuite.startElement(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lorg/xml/sax/Attributes;)V +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTestSuite.endElement(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTestSuite.characters([CII)V +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTestSuite.getTestCases()Ljava/util/List; +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTestSuite.getNumberOfErrors()I +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTestSuite.setNumberOfErrors(I)V +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTestSuite.getNumberOfFailures()I +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTestSuite.setNumberOfFailures(I)V +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTestSuite.getNumberOfTests()I +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTestSuite.setNumberOfTests(I)V +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTestSuite.getName()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTestSuite.setName(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTestSuite.getFName()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTestSuite.setFName(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTestSuite.getPackageName()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTestSuite.setPackageName(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTestSuite.getTimeElapsed()F +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTestSuite.setTimeElapsed(F)V +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTestSuite.parseCause(Ljava/lang/String;)Ljava/util/List; +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTestSuite.parseCause(Ljava/lang/String;Ljava/lang/String;)Ljava/util/List; +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTestSuite.setTestCases(Ljava/util/List;)V +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction$ReportTestSuite.(Lorg/apache/maven/continuum/web/action/SurefireReportAction;Lorg/apache/maven/continuum/web/action/SurefireReportAction$1;)V +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction.()V +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction.execute()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction.parseReports(Ljava/io/File;)V +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction.getSummary(Ljava/util/List;)V +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction.getDetails(Ljava/util/List;)V +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction.getBuildId()I +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction.setBuildId(I)V +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction.getProjectId()I +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction.setProjectId(I)V +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction.getIncludedFiles(Ljava/io/File;Ljava/lang/String;Ljava/lang/String;)[Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction.getTestSuites()Ljava/util/List; +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction.setTestSuites(Ljava/util/List;)V +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction.getProjectName()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction.setProjectName(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction.getTestSummaryList()Ljava/util/List; +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction.setTestSummaryList(Ljava/util/List;)V +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction.getTestPackageList()Ljava/util/List; +METHOD|org.apache.maven.continuum.web.action.SurefireReportAction.setTestPackageList(Ljava/util/List;)V +METHOD|org.apache.maven.continuum.web.action.UserGroupManagementAction.()V +METHOD|org.apache.maven.continuum.web.action.UserGroupManagementAction.summary()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.UserGroupManagementAction.input()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.UserGroupManagementAction.save()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.UserGroupManagementAction.remove()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.UserGroupManagementAction.getUserGroupId()I +METHOD|org.apache.maven.continuum.web.action.UserGroupManagementAction.setUserGroupId(I)V +METHOD|org.apache.maven.continuum.web.action.UserGroupManagementAction.getDescription()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.UserGroupManagementAction.setDescription(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.UserGroupManagementAction.getName()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.UserGroupManagementAction.setName(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.UserGroupManagementAction.getUserGroups()Ljava/util/List; +METHOD|org.apache.maven.continuum.web.action.UserGroupManagementAction.setUserGroups(Ljava/util/List;)V +METHOD|org.apache.maven.continuum.web.action.UserManagementAction.()V +METHOD|org.apache.maven.continuum.web.action.UserManagementAction.prepare()V +METHOD|org.apache.maven.continuum.web.action.UserManagementAction.summary()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.UserManagementAction.input()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.UserManagementAction.save()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.UserManagementAction.remove()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.UserManagementAction.getUserId()I +METHOD|org.apache.maven.continuum.web.action.UserManagementAction.setUserId(I)V +METHOD|org.apache.maven.continuum.web.action.UserManagementAction.getUsername()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.UserManagementAction.setUsername(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.UserManagementAction.getFullName()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.UserManagementAction.setFullName(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.UserManagementAction.getEmail()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.UserManagementAction.setEmail(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.UserManagementAction.getPassword()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.UserManagementAction.setPassword(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.UserManagementAction.getPasswordTwo()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.UserManagementAction.setPasswordTwo(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.UserManagementAction.getUsers()Ljava/util/List; +METHOD|org.apache.maven.continuum.web.action.UserManagementAction.setUsers(Ljava/util/List;)V +METHOD|org.apache.maven.continuum.web.action.UserManagementAction.getUserGroupId()I +METHOD|org.apache.maven.continuum.web.action.UserManagementAction.setUserGroupId(I)V +METHOD|org.apache.maven.continuum.web.action.UserManagementAction.getUserGroups()Ljava/util/Map; +METHOD|org.apache.maven.continuum.web.action.UserManagementAction.setUserGroups(Ljava/util/Map;)V +METHOD|org.apache.maven.continuum.web.action.WorkingCopyAction.()V +METHOD|org.apache.maven.continuum.web.action.WorkingCopyAction.execute()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.WorkingCopyAction.getProjectId()I +METHOD|org.apache.maven.continuum.web.action.WorkingCopyAction.setProjectId(I)V +METHOD|org.apache.maven.continuum.web.action.WorkingCopyAction.getProjectName()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.WorkingCopyAction.getUserDirectory()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.WorkingCopyAction.setUserDirectory(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.WorkingCopyAction.setFile(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.WorkingCopyAction.getFiles()Ljava/util/List; +METHOD|org.apache.maven.continuum.web.action.WorkingCopyAction.getOutput()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.WorkingCopyAction.getFileContent()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.WorkingCopyAction.getInputStream()Ljava/io/InputStream; +METHOD|org.apache.maven.continuum.web.action.WorkingCopyAction.getFileLength()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.WorkingCopyAction.getDownloadFilename()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.WorkingCopyAction.getMimeType()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.WorkingCopyAction.()V +METHOD|org.apache.maven.continuum.web.action.admin.ConfigurationAction.()V +METHOD|org.apache.maven.continuum.web.action.admin.ConfigurationAction.prepare()V +METHOD|org.apache.maven.continuum.web.action.admin.ConfigurationAction.save()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.admin.ConfigurationAction.resolveGuestAccountLockingStatus()V +METHOD|org.apache.maven.continuum.web.action.admin.ConfigurationAction.getGuestAccountLockingStatus()Z +METHOD|org.apache.maven.continuum.web.action.admin.ConfigurationAction.isGuestAccountEnabled()Z +METHOD|org.apache.maven.continuum.web.action.admin.ConfigurationAction.setGuestAccountEnabled(Z)V +METHOD|org.apache.maven.continuum.web.action.admin.ConfigurationAction.getWorkingDirectory()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.admin.ConfigurationAction.setWorkingDirectory(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.admin.ConfigurationAction.getDeploymentRepositoryDirectory()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.admin.ConfigurationAction.setDeploymentRepositoryDirectory(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.admin.ConfigurationAction.getBuildOutputDirectory()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.admin.ConfigurationAction.setBuildOutputDirectory(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.admin.ConfigurationAction.getBaseUrl()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.admin.ConfigurationAction.setBaseUrl(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.admin.ConfigurationAction.getSecureActionBundle()Lorg/codehaus/plexus/security/ui/web/interceptor/SecureActionBundle; +METHOD|org.apache.maven.continuum.web.action.component.BuildDefinitionSummaryAction.()V +METHOD|org.apache.maven.continuum.web.action.component.BuildDefinitionSummaryAction.summarizeForProject()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.component.BuildDefinitionSummaryAction.summarizeForGroup()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.component.BuildDefinitionSummaryAction.gatherProjectBuildDefinitionSummaries(I)Ljava/util/List; +METHOD|org.apache.maven.continuum.web.action.component.BuildDefinitionSummaryAction.gatherGroupBuildDefinitionSummaries(I)Ljava/util/List; +METHOD|org.apache.maven.continuum.web.action.component.BuildDefinitionSummaryAction.generateBuildDefinitionSummary(Lorg/apache/maven/continuum/model/project/BuildDefinition;)Lorg/apache/maven/continuum/web/model/BuildDefinitionSummary; +METHOD|org.apache.maven.continuum.web.action.component.BuildDefinitionSummaryAction.getProjectId()I +METHOD|org.apache.maven.continuum.web.action.component.BuildDefinitionSummaryAction.setProjectId(I)V +METHOD|org.apache.maven.continuum.web.action.component.BuildDefinitionSummaryAction.getProjectGroupId()I +METHOD|org.apache.maven.continuum.web.action.component.BuildDefinitionSummaryAction.setProjectGroupId(I)V +METHOD|org.apache.maven.continuum.web.action.component.BuildDefinitionSummaryAction.getProjectGroupName()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.component.BuildDefinitionSummaryAction.setProjectGroupName(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.component.BuildDefinitionSummaryAction.getProjectBuildDefinitionSummaries()Ljava/util/List; +METHOD|org.apache.maven.continuum.web.action.component.BuildDefinitionSummaryAction.setProjectBuildDefinitionSummaries(Ljava/util/List;)V +METHOD|org.apache.maven.continuum.web.action.component.BuildDefinitionSummaryAction.getGroupBuildDefinitionSummaries()Ljava/util/List; +METHOD|org.apache.maven.continuum.web.action.component.BuildDefinitionSummaryAction.setGroupBuildDefinitionSummaries(Ljava/util/List;)V +METHOD|org.apache.maven.continuum.web.action.component.BuildDefinitionSummaryAction.getAllBuildDefinitionSummaries()Ljava/util/List; +METHOD|org.apache.maven.continuum.web.action.component.BuildDefinitionSummaryAction.setAllBuildDefinitionSummaries(Ljava/util/List;)V +METHOD|org.apache.maven.continuum.web.action.component.BuildDefinitionSummaryAction.getProjectGroup()Lorg/apache/maven/continuum/model/project/ProjectGroup; +METHOD|org.apache.maven.continuum.web.action.component.BuildDefinitionSummaryAction.setProjectGroup(Lorg/apache/maven/continuum/model/project/ProjectGroup;)V +METHOD|org.apache.maven.continuum.web.action.component.ContinuumTabAction.()V +METHOD|org.apache.maven.continuum.web.action.component.ContinuumTabAction.getTabName()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.component.ContinuumTabAction.setTabName(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.component.NotifierSummaryAction.()V +METHOD|org.apache.maven.continuum.web.action.component.NotifierSummaryAction.summarizeForProject()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.component.NotifierSummaryAction.summarizeForProjectGroup()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.component.NotifierSummaryAction.gatherGroupNotifierSummaries(I)Ljava/util/List; +METHOD|org.apache.maven.continuum.web.action.component.NotifierSummaryAction.generateNotifierSummary(Lorg/apache/maven/continuum/model/project/ProjectNotifier;)Lorg/apache/maven/continuum/web/model/NotifierSummary; +METHOD|org.apache.maven.continuum.web.action.component.NotifierSummaryAction.getProjectGroupId()I +METHOD|org.apache.maven.continuum.web.action.component.NotifierSummaryAction.setProjectGroupId(I)V +METHOD|org.apache.maven.continuum.web.action.component.NotifierSummaryAction.getProjectGroupName()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.component.NotifierSummaryAction.setProjectGroupName(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.component.NotifierSummaryAction.getProjectId()I +METHOD|org.apache.maven.continuum.web.action.component.NotifierSummaryAction.setProjectId(I)V +METHOD|org.apache.maven.continuum.web.action.component.NotifierSummaryAction.getProjectGroup()Lorg/apache/maven/continuum/model/project/ProjectGroup; +METHOD|org.apache.maven.continuum.web.action.component.NotifierSummaryAction.setProjectGroup(Lorg/apache/maven/continuum/model/project/ProjectGroup;)V +METHOD|org.apache.maven.continuum.web.action.component.NotifierSummaryAction.getProjectGroupNotifierSummaries()Ljava/util/List; +METHOD|org.apache.maven.continuum.web.action.component.NotifierSummaryAction.setProjectGroupNotifierSummaries(Ljava/util/List;)V +METHOD|org.apache.maven.continuum.web.action.notifier.AbstractGroupNotifierEditAction.()V +METHOD|org.apache.maven.continuum.web.action.notifier.AbstractGroupNotifierEditAction.saveNotifier(Lorg/apache/maven/continuum/model/project/ProjectNotifier;)V +METHOD|org.apache.maven.continuum.web.action.notifier.AbstractGroupNotifierEditAction.getNotifier()Lorg/apache/maven/continuum/model/project/ProjectNotifier; +METHOD|org.apache.maven.continuum.web.action.notifier.AbstractGroupNotifierEditAction.getProjectGroupId()I +METHOD|org.apache.maven.continuum.web.action.notifier.AbstractGroupNotifierEditAction.setProjectGroupId(I)V +METHOD|org.apache.maven.continuum.web.action.notifier.AbstractNotifierEditActionSupport.()V +METHOD|org.apache.maven.continuum.web.action.notifier.AbstractNotifierEditActionSupport.getNotifier()Lorg/apache/maven/continuum/model/project/ProjectNotifier; +METHOD|org.apache.maven.continuum.web.action.notifier.AbstractNotifierEditActionSupport.saveNotifier(Lorg/apache/maven/continuum/model/project/ProjectNotifier;)V +METHOD|org.apache.maven.continuum.web.action.notifier.AbstractNotifierEditActionSupport.save()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.notifier.AbstractNotifierEditActionSupport.edit()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.notifier.AbstractNotifierEditActionSupport.getNotifierId()I +METHOD|org.apache.maven.continuum.web.action.notifier.AbstractNotifierEditActionSupport.getNotifierType()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.notifier.AbstractNotifierEditActionSupport.setNotifierType(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.notifier.AbstractNotifierEditActionSupport.isSendOnSuccess()Z +METHOD|org.apache.maven.continuum.web.action.notifier.AbstractNotifierEditActionSupport.setSendOnSuccess(Z)V +METHOD|org.apache.maven.continuum.web.action.notifier.AbstractNotifierEditActionSupport.isSendOnFailure()Z +METHOD|org.apache.maven.continuum.web.action.notifier.AbstractNotifierEditActionSupport.setSendOnFailure(Z)V +METHOD|org.apache.maven.continuum.web.action.notifier.AbstractNotifierEditActionSupport.isSendOnError()Z +METHOD|org.apache.maven.continuum.web.action.notifier.AbstractNotifierEditActionSupport.setSendOnError(Z)V +METHOD|org.apache.maven.continuum.web.action.notifier.AbstractNotifierEditActionSupport.isSendOnWarning()Z +METHOD|org.apache.maven.continuum.web.action.notifier.AbstractNotifierEditActionSupport.setSendOnWarning(Z)V +METHOD|org.apache.maven.continuum.web.action.notifier.AbstractNotifierEditActionSupport.setNotifierId(I)V +METHOD|org.apache.maven.continuum.web.action.notifier.AbstractNotifierEditActionSupport.initConfiguration(Ljava/util/Map;)V +METHOD|org.apache.maven.continuum.web.action.notifier.AbstractNotifierEditActionSupport.setNotifierConfiguration(Lorg/apache/maven/continuum/model/project/ProjectNotifier;)V +METHOD|org.apache.maven.continuum.web.action.notifier.AbstractProjectNotifierEditAction.()V +METHOD|org.apache.maven.continuum.web.action.notifier.AbstractProjectNotifierEditAction.saveNotifier(Lorg/apache/maven/continuum/model/project/ProjectNotifier;)V +METHOD|org.apache.maven.continuum.web.action.notifier.AbstractProjectNotifierEditAction.getNotifier()Lorg/apache/maven/continuum/model/project/ProjectNotifier; +METHOD|org.apache.maven.continuum.web.action.notifier.AbstractProjectNotifierEditAction.getProjectId()I +METHOD|org.apache.maven.continuum.web.action.notifier.AbstractProjectNotifierEditAction.setProjectId(I)V +METHOD|org.apache.maven.continuum.web.action.notifier.AddGroupNotifierAction.()V +METHOD|org.apache.maven.continuum.web.action.notifier.AddGroupNotifierAction.execute()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.notifier.AddGroupNotifierAction.doDefault()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.notifier.AddGroupNotifierAction.getNotifierType()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.notifier.AddGroupNotifierAction.setNotifierType(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.notifier.AddGroupNotifierAction.getProjectGroupId()I +METHOD|org.apache.maven.continuum.web.action.notifier.AddGroupNotifierAction.setProjectGroupId(I)V +METHOD|org.apache.maven.continuum.web.action.notifier.AddProjectNotifierAction.()V +METHOD|org.apache.maven.continuum.web.action.notifier.AddProjectNotifierAction.execute()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.notifier.AddProjectNotifierAction.doDefault()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.notifier.AddProjectNotifierAction.getNotifierType()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.notifier.AddProjectNotifierAction.setNotifierType(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.notifier.AddProjectNotifierAction.getProjectId()I +METHOD|org.apache.maven.continuum.web.action.notifier.AddProjectNotifierAction.setProjectId(I)V +METHOD|org.apache.maven.continuum.web.action.notifier.DeleteGroupNotifierAction.()V +METHOD|org.apache.maven.continuum.web.action.notifier.DeleteGroupNotifierAction.execute()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.notifier.DeleteGroupNotifierAction.doDefault()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.notifier.DeleteGroupNotifierAction.setNotifierId(I)V +METHOD|org.apache.maven.continuum.web.action.notifier.DeleteGroupNotifierAction.getNotifierId()I +METHOD|org.apache.maven.continuum.web.action.notifier.DeleteGroupNotifierAction.setNotifierType(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.notifier.DeleteGroupNotifierAction.getNotifierType()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.notifier.DeleteGroupNotifierAction.getProjectGroupId()I +METHOD|org.apache.maven.continuum.web.action.notifier.DeleteGroupNotifierAction.setProjectGroupId(I)V +METHOD|org.apache.maven.continuum.web.action.notifier.DeleteProjectNotifierAction.()V +METHOD|org.apache.maven.continuum.web.action.notifier.DeleteProjectNotifierAction.execute()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.notifier.DeleteProjectNotifierAction.doDefault()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.notifier.DeleteProjectNotifierAction.setProjectId(I)V +METHOD|org.apache.maven.continuum.web.action.notifier.DeleteProjectNotifierAction.getProjectId()I +METHOD|org.apache.maven.continuum.web.action.notifier.DeleteProjectNotifierAction.setNotifierId(I)V +METHOD|org.apache.maven.continuum.web.action.notifier.DeleteProjectNotifierAction.getNotifierId()I +METHOD|org.apache.maven.continuum.web.action.notifier.DeleteProjectNotifierAction.setNotifierType(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.notifier.DeleteProjectNotifierAction.getNotifierType()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.notifier.IrcGroupNotifierEditAction.()V +METHOD|org.apache.maven.continuum.web.action.notifier.IrcGroupNotifierEditAction.initConfiguration(Ljava/util/Map;)V +METHOD|org.apache.maven.continuum.web.action.notifier.IrcGroupNotifierEditAction.setNotifierConfiguration(Lorg/apache/maven/continuum/model/project/ProjectNotifier;)V +METHOD|org.apache.maven.continuum.web.action.notifier.IrcGroupNotifierEditAction.getHost()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.notifier.IrcGroupNotifierEditAction.setHost(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.notifier.IrcGroupNotifierEditAction.getPort()I +METHOD|org.apache.maven.continuum.web.action.notifier.IrcGroupNotifierEditAction.setPort(I)V +METHOD|org.apache.maven.continuum.web.action.notifier.IrcGroupNotifierEditAction.getChannel()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.notifier.IrcGroupNotifierEditAction.setChannel(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.notifier.IrcGroupNotifierEditAction.getNick()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.notifier.IrcGroupNotifierEditAction.setNick(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.notifier.IrcGroupNotifierEditAction.getFullName()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.notifier.IrcGroupNotifierEditAction.setFullName(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.notifier.IrcGroupNotifierEditAction.getPassword()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.notifier.IrcGroupNotifierEditAction.setPassword(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.notifier.IrcProjectNotifierEditAction.()V +METHOD|org.apache.maven.continuum.web.action.notifier.IrcProjectNotifierEditAction.initConfiguration(Ljava/util/Map;)V +METHOD|org.apache.maven.continuum.web.action.notifier.IrcProjectNotifierEditAction.setNotifierConfiguration(Lorg/apache/maven/continuum/model/project/ProjectNotifier;)V +METHOD|org.apache.maven.continuum.web.action.notifier.IrcProjectNotifierEditAction.getHost()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.notifier.IrcProjectNotifierEditAction.setHost(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.notifier.IrcProjectNotifierEditAction.getPort()I +METHOD|org.apache.maven.continuum.web.action.notifier.IrcProjectNotifierEditAction.setPort(I)V +METHOD|org.apache.maven.continuum.web.action.notifier.IrcProjectNotifierEditAction.getChannel()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.notifier.IrcProjectNotifierEditAction.setChannel(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.notifier.IrcProjectNotifierEditAction.getNick()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.notifier.IrcProjectNotifierEditAction.setNick(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.notifier.IrcProjectNotifierEditAction.getFullName()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.notifier.IrcProjectNotifierEditAction.setFullName(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.notifier.IrcProjectNotifierEditAction.getPassword()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.notifier.IrcProjectNotifierEditAction.setPassword(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.notifier.JabberGroupNotifierEditAction.()V +METHOD|org.apache.maven.continuum.web.action.notifier.JabberGroupNotifierEditAction.initConfiguration(Ljava/util/Map;)V +METHOD|org.apache.maven.continuum.web.action.notifier.JabberGroupNotifierEditAction.setNotifierConfiguration(Lorg/apache/maven/continuum/model/project/ProjectNotifier;)V +METHOD|org.apache.maven.continuum.web.action.notifier.JabberGroupNotifierEditAction.getHost()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.notifier.JabberGroupNotifierEditAction.setHost(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.notifier.JabberGroupNotifierEditAction.getPort()I +METHOD|org.apache.maven.continuum.web.action.notifier.JabberGroupNotifierEditAction.setPort(I)V +METHOD|org.apache.maven.continuum.web.action.notifier.JabberGroupNotifierEditAction.getLogin()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.notifier.JabberGroupNotifierEditAction.setLogin(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.notifier.JabberGroupNotifierEditAction.getPassword()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.notifier.JabberGroupNotifierEditAction.setPassword(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.notifier.JabberGroupNotifierEditAction.getDomainName()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.notifier.JabberGroupNotifierEditAction.setDomainName(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.notifier.JabberGroupNotifierEditAction.getAddress()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.notifier.JabberGroupNotifierEditAction.setAddress(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.notifier.JabberGroupNotifierEditAction.isSslConnection()Z +METHOD|org.apache.maven.continuum.web.action.notifier.JabberGroupNotifierEditAction.setSslConnection(Z)V +METHOD|org.apache.maven.continuum.web.action.notifier.JabberGroupNotifierEditAction.isGroup()Z +METHOD|org.apache.maven.continuum.web.action.notifier.JabberGroupNotifierEditAction.setGroup(Z)V +METHOD|org.apache.maven.continuum.web.action.notifier.JabberProjectNotifierEditAction.()V +METHOD|org.apache.maven.continuum.web.action.notifier.JabberProjectNotifierEditAction.initConfiguration(Ljava/util/Map;)V +METHOD|org.apache.maven.continuum.web.action.notifier.JabberProjectNotifierEditAction.setNotifierConfiguration(Lorg/apache/maven/continuum/model/project/ProjectNotifier;)V +METHOD|org.apache.maven.continuum.web.action.notifier.JabberProjectNotifierEditAction.getHost()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.notifier.JabberProjectNotifierEditAction.setHost(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.notifier.JabberProjectNotifierEditAction.getPort()I +METHOD|org.apache.maven.continuum.web.action.notifier.JabberProjectNotifierEditAction.setPort(I)V +METHOD|org.apache.maven.continuum.web.action.notifier.JabberProjectNotifierEditAction.getLogin()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.notifier.JabberProjectNotifierEditAction.setLogin(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.notifier.JabberProjectNotifierEditAction.getPassword()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.notifier.JabberProjectNotifierEditAction.setPassword(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.notifier.JabberProjectNotifierEditAction.getDomainName()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.notifier.JabberProjectNotifierEditAction.setDomainName(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.notifier.JabberProjectNotifierEditAction.getAddress()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.notifier.JabberProjectNotifierEditAction.setAddress(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.notifier.JabberProjectNotifierEditAction.isSslConnection()Z +METHOD|org.apache.maven.continuum.web.action.notifier.JabberProjectNotifierEditAction.setSslConnection(Z)V +METHOD|org.apache.maven.continuum.web.action.notifier.JabberProjectNotifierEditAction.isGroup()Z +METHOD|org.apache.maven.continuum.web.action.notifier.JabberProjectNotifierEditAction.setGroup(Z)V +METHOD|org.apache.maven.continuum.web.action.notifier.MailGroupNotifierEditAction.()V +METHOD|org.apache.maven.continuum.web.action.notifier.MailGroupNotifierEditAction.initConfiguration(Ljava/util/Map;)V +METHOD|org.apache.maven.continuum.web.action.notifier.MailGroupNotifierEditAction.setNotifierConfiguration(Lorg/apache/maven/continuum/model/project/ProjectNotifier;)V +METHOD|org.apache.maven.continuum.web.action.notifier.MailGroupNotifierEditAction.getAddress()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.notifier.MailGroupNotifierEditAction.setAddress(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.notifier.MailProjectNotifierEditAction.()V +METHOD|org.apache.maven.continuum.web.action.notifier.MailProjectNotifierEditAction.initConfiguration(Ljava/util/Map;)V +METHOD|org.apache.maven.continuum.web.action.notifier.MailProjectNotifierEditAction.setNotifierConfiguration(Lorg/apache/maven/continuum/model/project/ProjectNotifier;)V +METHOD|org.apache.maven.continuum.web.action.notifier.MailProjectNotifierEditAction.getAddress()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.notifier.MailProjectNotifierEditAction.setAddress(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.notifier.MsnGroupNotifierEditAction.()V +METHOD|org.apache.maven.continuum.web.action.notifier.MsnGroupNotifierEditAction.initConfiguration(Ljava/util/Map;)V +METHOD|org.apache.maven.continuum.web.action.notifier.MsnGroupNotifierEditAction.setNotifierConfiguration(Lorg/apache/maven/continuum/model/project/ProjectNotifier;)V +METHOD|org.apache.maven.continuum.web.action.notifier.MsnGroupNotifierEditAction.getLogin()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.notifier.MsnGroupNotifierEditAction.setLogin(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.notifier.MsnGroupNotifierEditAction.getPassword()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.notifier.MsnGroupNotifierEditAction.setPassword(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.notifier.MsnGroupNotifierEditAction.getAddress()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.notifier.MsnGroupNotifierEditAction.setAddress(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.notifier.MsnProjectNotifierEditAction.()V +METHOD|org.apache.maven.continuum.web.action.notifier.MsnProjectNotifierEditAction.initConfiguration(Ljava/util/Map;)V +METHOD|org.apache.maven.continuum.web.action.notifier.MsnProjectNotifierEditAction.setNotifierConfiguration(Lorg/apache/maven/continuum/model/project/ProjectNotifier;)V +METHOD|org.apache.maven.continuum.web.action.notifier.MsnProjectNotifierEditAction.getLogin()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.notifier.MsnProjectNotifierEditAction.setLogin(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.notifier.MsnProjectNotifierEditAction.getPassword()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.notifier.MsnProjectNotifierEditAction.setPassword(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.action.notifier.MsnProjectNotifierEditAction.getAddress()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.action.notifier.MsnProjectNotifierEditAction.setAddress(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.checks.security.RoleProfileEnvironmentCheck.()V +METHOD|org.apache.maven.continuum.web.checks.security.RoleProfileEnvironmentCheck.validateEnvironment(Ljava/util/List;)V +METHOD|org.apache.maven.continuum.web.components.Data.(Lcom/opensymphony/xwork/util/OgnlValueStack;Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V +METHOD|org.apache.maven.continuum.web.components.Data.getDefaultTemplate()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.components.Data.setValueLink(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.components.Data.getValueLink()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.components.Data.evaluateExtraParams()V +METHOD|org.apache.maven.continuum.web.components.SubmitCancel.(Lcom/opensymphony/xwork/util/OgnlValueStack;Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V +METHOD|org.apache.maven.continuum.web.components.SubmitCancel.getDefaultTemplate()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.components.SubmitCancel.evaluateParams()V +METHOD|org.apache.maven.continuum.web.components.SubmitCancel.setCancel(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.exception.ContinuumActionException.(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.exception.ContinuumActionException.(Ljava/lang/String;Ljava/lang/Throwable;)V +METHOD|org.apache.maven.continuum.web.filter.FilterToComponentProxy.()V +METHOD|org.apache.maven.continuum.web.interceptor.ForceContinuumConfigurationInterceptor.()V +METHOD|org.apache.maven.continuum.web.interceptor.ForceContinuumConfigurationInterceptor.destroy()V +METHOD|org.apache.maven.continuum.web.interceptor.ForceContinuumConfigurationInterceptor.init()V +METHOD|org.apache.maven.continuum.web.interceptor.ForceContinuumConfigurationInterceptor.intercept(Lcom/opensymphony/xwork/ActionInvocation;)Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.interceptor.ForceContinuumConfigurationInterceptor.()V +METHOD|org.apache.maven.continuum.web.model.BuildDefinitionSummary.()V +METHOD|org.apache.maven.continuum.web.model.BuildDefinitionSummary.getArguments()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.model.BuildDefinitionSummary.getBuildFile()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.model.BuildDefinitionSummary.getFrom()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.model.BuildDefinitionSummary.getGoals()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.model.BuildDefinitionSummary.getId()I +METHOD|org.apache.maven.continuum.web.model.BuildDefinitionSummary.getProfileName()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.model.BuildDefinitionSummary.getProjectGroupId()I +METHOD|org.apache.maven.continuum.web.model.BuildDefinitionSummary.getProjectId()I +METHOD|org.apache.maven.continuum.web.model.BuildDefinitionSummary.getProjectName()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.model.BuildDefinitionSummary.getScheduleName()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.model.BuildDefinitionSummary.isIsDefault()Z +METHOD|org.apache.maven.continuum.web.model.BuildDefinitionSummary.setArguments(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.model.BuildDefinitionSummary.setBuildFile(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.model.BuildDefinitionSummary.setFrom(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.model.BuildDefinitionSummary.setGoals(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.model.BuildDefinitionSummary.setId(I)V +METHOD|org.apache.maven.continuum.web.model.BuildDefinitionSummary.setIsDefault(Z)V +METHOD|org.apache.maven.continuum.web.model.BuildDefinitionSummary.setProfileName(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.model.BuildDefinitionSummary.setProjectGroupId(I)V +METHOD|org.apache.maven.continuum.web.model.BuildDefinitionSummary.setProjectId(I)V +METHOD|org.apache.maven.continuum.web.model.BuildDefinitionSummary.setProjectName(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.model.BuildDefinitionSummary.setScheduleName(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.model.BuildDefinitionSummary.setModelEncoding(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.model.BuildDefinitionSummary.getModelEncoding()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.model.ContinuumViewModels.()V +METHOD|org.apache.maven.continuum.web.model.ContinuumViewModels.addBuildDefinitionSummary(Lorg/apache/maven/continuum/web/model/BuildDefinitionSummary;)V +METHOD|org.apache.maven.continuum.web.model.ContinuumViewModels.addGroupSummary(Lorg/apache/maven/continuum/web/model/GroupSummary;)V +METHOD|org.apache.maven.continuum.web.model.ContinuumViewModels.addNotifierSummary(Lorg/apache/maven/continuum/web/model/NotifierSummary;)V +METHOD|org.apache.maven.continuum.web.model.ContinuumViewModels.addProjectSummary(Lorg/apache/maven/continuum/web/model/ProjectSummary;)V +METHOD|org.apache.maven.continuum.web.model.ContinuumViewModels.getBuildDefinitionSummarys()Ljava/util/List; +METHOD|org.apache.maven.continuum.web.model.ContinuumViewModels.getGroupSummarys()Ljava/util/List; +METHOD|org.apache.maven.continuum.web.model.ContinuumViewModels.getNotifierSummarys()Ljava/util/List; +METHOD|org.apache.maven.continuum.web.model.ContinuumViewModels.getProjectSummarys()Ljava/util/List; +METHOD|org.apache.maven.continuum.web.model.ContinuumViewModels.removeBuildDefinitionSummary(Lorg/apache/maven/continuum/web/model/BuildDefinitionSummary;)V +METHOD|org.apache.maven.continuum.web.model.ContinuumViewModels.removeGroupSummary(Lorg/apache/maven/continuum/web/model/GroupSummary;)V +METHOD|org.apache.maven.continuum.web.model.ContinuumViewModels.removeNotifierSummary(Lorg/apache/maven/continuum/web/model/NotifierSummary;)V +METHOD|org.apache.maven.continuum.web.model.ContinuumViewModels.removeProjectSummary(Lorg/apache/maven/continuum/web/model/ProjectSummary;)V +METHOD|org.apache.maven.continuum.web.model.ContinuumViewModels.setBuildDefinitionSummarys(Ljava/util/List;)V +METHOD|org.apache.maven.continuum.web.model.ContinuumViewModels.setGroupSummarys(Ljava/util/List;)V +METHOD|org.apache.maven.continuum.web.model.ContinuumViewModels.setNotifierSummarys(Ljava/util/List;)V +METHOD|org.apache.maven.continuum.web.model.ContinuumViewModels.setProjectSummarys(Ljava/util/List;)V +METHOD|org.apache.maven.continuum.web.model.ContinuumViewModels.setModelEncoding(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.model.ContinuumViewModels.getModelEncoding()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.model.ContinuumViewModels.class$(Ljava/lang/String;)Ljava/lang/Class; +METHOD|org.apache.maven.continuum.web.model.GroupSummary.()V +METHOD|org.apache.maven.continuum.web.model.GroupSummary.addProject(Lorg/apache/maven/continuum/web/model/ProjectSummary;)V +METHOD|org.apache.maven.continuum.web.model.GroupSummary.getDescription()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.model.GroupSummary.getGroupId()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.model.GroupSummary.getId()I +METHOD|org.apache.maven.continuum.web.model.GroupSummary.getName()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.model.GroupSummary.getNextScheduledBuild()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.model.GroupSummary.getNumErrors()I +METHOD|org.apache.maven.continuum.web.model.GroupSummary.getNumFailures()I +METHOD|org.apache.maven.continuum.web.model.GroupSummary.getNumProjects()I +METHOD|org.apache.maven.continuum.web.model.GroupSummary.getNumSuccesses()I +METHOD|org.apache.maven.continuum.web.model.GroupSummary.getProjectType()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.model.GroupSummary.getProjects()Ljava/util/List; +METHOD|org.apache.maven.continuum.web.model.GroupSummary.getStatusMessage()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.model.GroupSummary.removeProject(Lorg/apache/maven/continuum/web/model/ProjectSummary;)V +METHOD|org.apache.maven.continuum.web.model.GroupSummary.setDescription(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.model.GroupSummary.setGroupId(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.model.GroupSummary.setId(I)V +METHOD|org.apache.maven.continuum.web.model.GroupSummary.setName(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.model.GroupSummary.setNextScheduledBuild(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.model.GroupSummary.setNumErrors(I)V +METHOD|org.apache.maven.continuum.web.model.GroupSummary.setNumFailures(I)V +METHOD|org.apache.maven.continuum.web.model.GroupSummary.setNumProjects(I)V +METHOD|org.apache.maven.continuum.web.model.GroupSummary.setNumSuccesses(I)V +METHOD|org.apache.maven.continuum.web.model.GroupSummary.setProjectType(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.model.GroupSummary.setProjects(Ljava/util/List;)V +METHOD|org.apache.maven.continuum.web.model.GroupSummary.setStatusMessage(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.model.GroupSummary.setModelEncoding(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.model.GroupSummary.getModelEncoding()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.model.GroupSummary.class$(Ljava/lang/String;)Ljava/lang/Class; +METHOD|org.apache.maven.continuum.web.model.NotifierSummary.()V +METHOD|org.apache.maven.continuum.web.model.NotifierSummary.getEvents()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.model.NotifierSummary.getId()I +METHOD|org.apache.maven.continuum.web.model.NotifierSummary.getProjectGroupId()I +METHOD|org.apache.maven.continuum.web.model.NotifierSummary.getProjectId()I +METHOD|org.apache.maven.continuum.web.model.NotifierSummary.getRecipient()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.model.NotifierSummary.getSender()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.model.NotifierSummary.getType()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.model.NotifierSummary.isEnabled()Z +METHOD|org.apache.maven.continuum.web.model.NotifierSummary.setEnabled(Z)V +METHOD|org.apache.maven.continuum.web.model.NotifierSummary.setEvents(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.model.NotifierSummary.setId(I)V +METHOD|org.apache.maven.continuum.web.model.NotifierSummary.setProjectGroupId(I)V +METHOD|org.apache.maven.continuum.web.model.NotifierSummary.setProjectId(I)V +METHOD|org.apache.maven.continuum.web.model.NotifierSummary.setRecipient(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.model.NotifierSummary.setSender(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.model.NotifierSummary.setType(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.model.NotifierSummary.setModelEncoding(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.model.NotifierSummary.getModelEncoding()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.model.ProjectSummary.()V +METHOD|org.apache.maven.continuum.web.model.ProjectSummary.getBuildInSuccessId()I +METHOD|org.apache.maven.continuum.web.model.ProjectSummary.getBuildNumber()I +METHOD|org.apache.maven.continuum.web.model.ProjectSummary.getId()I +METHOD|org.apache.maven.continuum.web.model.ProjectSummary.getLatestBuildId()I +METHOD|org.apache.maven.continuum.web.model.ProjectSummary.getName()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.model.ProjectSummary.getProjectGroupName()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.model.ProjectSummary.getState()I +METHOD|org.apache.maven.continuum.web.model.ProjectSummary.getVersion()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.model.ProjectSummary.isInQueue()Z +METHOD|org.apache.maven.continuum.web.model.ProjectSummary.setBuildInSuccessId(I)V +METHOD|org.apache.maven.continuum.web.model.ProjectSummary.setBuildNumber(I)V +METHOD|org.apache.maven.continuum.web.model.ProjectSummary.setId(I)V +METHOD|org.apache.maven.continuum.web.model.ProjectSummary.setInQueue(Z)V +METHOD|org.apache.maven.continuum.web.model.ProjectSummary.setLatestBuildId(I)V +METHOD|org.apache.maven.continuum.web.model.ProjectSummary.setName(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.model.ProjectSummary.setProjectGroupName(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.model.ProjectSummary.setState(I)V +METHOD|org.apache.maven.continuum.web.model.ProjectSummary.setVersion(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.model.ProjectSummary.setModelEncoding(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.model.ProjectSummary.getModelEncoding()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.model.Session.()V +METHOD|org.apache.maven.continuum.web.model.Session.addSessionUser(Lorg/apache/maven/continuum/web/model/SessionUser;)V +METHOD|org.apache.maven.continuum.web.model.Session.getSessionUsers()Ljava/util/List; +METHOD|org.apache.maven.continuum.web.model.Session.removeSessionUser(Lorg/apache/maven/continuum/web/model/SessionUser;)V +METHOD|org.apache.maven.continuum.web.model.Session.setSessionUsers(Ljava/util/List;)V +METHOD|org.apache.maven.continuum.web.model.Session.setModelEncoding(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.model.Session.getModelEncoding()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.model.Session.class$(Ljava/lang/String;)Ljava/lang/Class; +METHOD|org.apache.maven.continuum.web.model.SessionUser.()V +METHOD|org.apache.maven.continuum.web.model.SessionUser.getEmail()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.model.SessionUser.getFullName()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.model.SessionUser.getId()I +METHOD|org.apache.maven.continuum.web.model.SessionUser.getUserGroupId()I +METHOD|org.apache.maven.continuum.web.model.SessionUser.getUsername()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.model.SessionUser.isLoggedIn()Z +METHOD|org.apache.maven.continuum.web.model.SessionUser.setEmail(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.model.SessionUser.setFullName(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.model.SessionUser.setId(I)V +METHOD|org.apache.maven.continuum.web.model.SessionUser.setLoggedIn(Z)V +METHOD|org.apache.maven.continuum.web.model.SessionUser.setUserGroupId(I)V +METHOD|org.apache.maven.continuum.web.model.SessionUser.setUsername(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.model.SessionUser.setModelEncoding(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.model.SessionUser.getModelEncoding()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.util.StateGenerator.()V +METHOD|org.apache.maven.continuum.web.util.StateGenerator.generate(ILjava/lang/String;)Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.util.WorkingCopyContentGenerator.()V +METHOD|org.apache.maven.continuum.web.util.WorkingCopyContentGenerator.generate(Ljava/lang/Object;Ljava/lang/String;Ljava/io/File;)Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.util.WorkingCopyContentGenerator.print(Ljava/util/List;Ljava/lang/String;Ljava/lang/String;Ljava/lang/StringBuffer;)V +METHOD|org.apache.maven.continuum.web.util.WorkingCopyContentGenerator.print(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/String;Ljava/lang/StringBuffer;)V +METHOD|org.apache.maven.continuum.web.view.BuildCell.()V +METHOD|org.apache.maven.continuum.web.view.BuildCell.getCellValue(Lorg/extremecomponents/table/core/TableModel;Lorg/extremecomponents/table/bean/Column;)Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.view.BuildCell.isAuthorized(Lorg/apache/maven/continuum/web/model/ProjectSummary;)Z +METHOD|org.apache.maven.continuum.web.view.BuildNowCell.()V +METHOD|org.apache.maven.continuum.web.view.BuildNowCell.getCellValue(Lorg/extremecomponents/table/core/TableModel;Lorg/extremecomponents/table/bean/Column;)Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.view.BuildNowCell.createActionLink(Ljava/lang/String;Lorg/apache/maven/continuum/web/model/ProjectSummary;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.view.BuildNowCell.image(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.view.BuildStatusCell.()V +METHOD|org.apache.maven.continuum.web.view.BuildStatusCell.getCellValue(Lorg/extremecomponents/table/core/TableModel;Lorg/extremecomponents/table/bean/Column;)Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.view.StateCell.()V +METHOD|org.apache.maven.continuum.web.view.StateCell.getCellValue(Lorg/extremecomponents/table/core/TableModel;Lorg/extremecomponents/table/bean/Column;)Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.view.StateCell.createActionLink(Ljava/lang/String;Lorg/apache/maven/continuum/web/model/ProjectSummary;Ljava/lang/String;)Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.view.buildresults.StateCell.()V +METHOD|org.apache.maven.continuum.web.view.buildresults.StateCell.getCellValue(Lorg/extremecomponents/table/core/TableModel;Lorg/extremecomponents/table/bean/Column;)Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.view.commons.DateCell.()V +METHOD|org.apache.maven.continuum.web.view.commons.DateCell.getCellValue(Lorg/extremecomponents/table/core/TableModel;Lorg/extremecomponents/table/bean/Column;)Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.view.jsp.ui.DataTag.()V +METHOD|org.apache.maven.continuum.web.view.jsp.ui.DataTag.getBean(Lcom/opensymphony/xwork/util/OgnlValueStack;Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)Lcom/opensymphony/webwork/components/Component; +METHOD|org.apache.maven.continuum.web.view.jsp.ui.DataTag.setValueLink(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.view.jsp.ui.DataTag.populateParams()V +METHOD|org.apache.maven.continuum.web.view.jsp.ui.DateTag.()V +METHOD|org.apache.maven.continuum.web.view.jsp.ui.DateTag.doEndTag()I +METHOD|org.apache.maven.continuum.web.view.jsp.ui.DateTag.findProviderInStack()Lcom/opensymphony/xwork/TextProvider; +METHOD|org.apache.maven.continuum.web.view.jsp.ui.DateTag.formatTime(Ljava/util/Date;)Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.view.jsp.ui.DateTag.doStartTag()I +METHOD|org.apache.maven.continuum.web.view.jsp.ui.DateTag.setName(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.view.jsp.ui.DateTag.getFormat()Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.view.jsp.ui.DateTag.setFormat(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.view.jsp.ui.DateTag.isNice()Z +METHOD|org.apache.maven.continuum.web.view.jsp.ui.DateTag.setNice(Z)V +METHOD|org.apache.maven.continuum.web.view.jsp.ui.SubmitCancelTag.()V +METHOD|org.apache.maven.continuum.web.view.jsp.ui.SubmitCancelTag.getBean(Lcom/opensymphony/xwork/util/OgnlValueStack;Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)Lcom/opensymphony/webwork/components/Component; +METHOD|org.apache.maven.continuum.web.view.jsp.ui.SubmitCancelTag.populateParams()V +METHOD|org.apache.maven.continuum.web.view.jsp.ui.SubmitCancelTag.setCancel(Ljava/lang/String;)V +METHOD|org.apache.maven.continuum.web.view.projectview.NotifierEventCell.()V +METHOD|org.apache.maven.continuum.web.view.projectview.NotifierEventCell.getCellValue(Lorg/extremecomponents/table/core/TableModel;Lorg/extremecomponents/table/bean/Column;)Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.view.projectview.NotifierFromCell.()V +METHOD|org.apache.maven.continuum.web.view.projectview.NotifierFromCell.getCellValue(Lorg/extremecomponents/table/core/TableModel;Lorg/extremecomponents/table/bean/Column;)Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.view.projectview.NotifierRecipientCell.()V +METHOD|org.apache.maven.continuum.web.view.projectview.NotifierRecipientCell.getCellValue(Lorg/extremecomponents/table/core/TableModel;Lorg/extremecomponents/table/bean/Column;)Ljava/lang/String; +METHOD|org.apache.maven.continuum.web.xmlrpc.DefaultXmlRpcService.()V +METHOD|org.apache.maven.continuum.web.xmlrpc.DefaultXmlRpcService.start()V +METHOD|org.apache.maven.continuum.web.xmlrpc.DefaultXmlRpcService.stop()V +METHOD|org.apache.maven.continuum.web.xmlrpc.XmlRpcService$1.class$(Ljava/lang/String;)Ljava/lang/Class; +METHOD|org.apache.maven.continuum.web.xmlrpc.XmlRpcService.()V +FILE|META-INF/ +FILE|META-INF/MANIFEST.MF +FILE|META-INF/maven/ +FILE|META-INF/maven/org.apache.maven.continuum/ +FILE|META-INF/maven/org.apache.maven.continuum/continuum-webapp/ +FILE|META-INF/maven/org.apache.maven.continuum/continuum-webapp/pom.properties +FILE|META-INF/maven/org.apache.maven.continuum/continuum-webapp/pom.xml +FILE|WEB-INF/ +FILE|WEB-INF/classes/ +FILE|WEB-INF/classes/META-INF/ +FILE|WEB-INF/classes/META-INF/plexus/ +FILE|WEB-INF/classes/META-INF/plexus/application.xml +FILE|WEB-INF/classes/META-INF/plexus/components.xml +FILE|WEB-INF/classes/extremecomponents.properties +FILE|WEB-INF/classes/localization/ +FILE|WEB-INF/classes/localization/Continuum.properties +FILE|WEB-INF/classes/org/ +FILE|WEB-INF/classes/org/apache/ +FILE|WEB-INF/classes/org/apache/maven/ +FILE|WEB-INF/classes/org/apache/maven/continuum/ +FILE|WEB-INF/classes/org/apache/maven/continuum/web/ +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/ +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/AboutAction.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/AddMavenOneProjectAction.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/AddMavenProjectAction.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/AddMavenTwoProjectAction.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/AddProjectAction-addProject-validation.xml +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/AddProjectAction.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/AddProjectAction.properties +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/BuildDefinitionAction-saveGroupBuildDefinition-validation.xml +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/BuildDefinitionAction-saveProjectBuildDefinition-validation.xml +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/BuildDefinitionAction.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/BuildDefinitionAction.properties +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/BuildDefinitionEditAction-buildDefinitionSave-validation.xml +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/BuildDefinitionEditAction.properties +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/BuildProjectAction.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/BuildResultAction.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/BuildResultsListAction.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/CancelBuildAction.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/CheckConfigurationAction.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/ContinuumActionSupport.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/ContinuumConfirmAction.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/DeleteProjectAction.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/GroupSummaryAction.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/IrcNotifierEditAction-ircNotifierSave-validation.xml +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/IrcNotifierEditAction.properties +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/JabberNotifierEditAction-jabberNotifierSave-validation.xml +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/JabberNotifierEditAction.properties +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/LoginAction-validation.xml +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/LoginAction.properties +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/MailNotifierEditAction-mailNotifierSave-validation.xml +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/MailNotifierEditAction.properties +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/MsnNotifierEditAction-msnNotifierSave-validation.xml +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/MsnNotifierEditAction.properties +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/ProjectEditAction-projectSave-validation.xml +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/ProjectEditAction.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/ProjectEditAction.properties +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/ProjectGroupAction.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/ProjectViewAction.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/ReleaseCleanupAction.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/ReleaseInProgressAction.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/ReleasePerformAction-releasePerform-validation.xml +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/ReleasePerformAction-releasePerformFromScm-validation.xml +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/ReleasePerformAction.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/ReleasePerformAction.properties +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/ReleasePrepareAction-releasePrepare-validation.xml +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/ReleasePrepareAction.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/ReleasePrepareAction.properties +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/ReleaseProjectAction.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/ReleaseProjectGoalAction.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/ScheduleAction-saveSchedule-validation.xml +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/ScheduleAction.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/SummaryAction.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/SurefireReportAction$1.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/SurefireReportAction$ReportTest.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/SurefireReportAction$ReportTestCase.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/SurefireReportAction$ReportTestSuite.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/SurefireReportAction.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/UserGroupManagementAction-saveUserGroup-validation.xml +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/UserGroupManagementAction.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/UserGroupManagementAction.properties +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/UserManagementAction-saveUser-validation.xml +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/UserManagementAction.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/UserManagementAction.properties +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/WorkingCopyAction.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/admin/ +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/admin/ConfigurationAction-configuration-validation.xml +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/admin/ConfigurationAction.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/admin/ConfigurationAction.properties +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/component/ +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/component/BuildDefinitionSummaryAction.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/component/ContinuumTabAction.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/component/NotifierSummaryAction.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/notifier/ +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/notifier/AbstractGroupNotifierEditAction.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/notifier/AbstractNotifierEditActionSupport.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/notifier/AbstractProjectNotifierEditAction.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/notifier/AddGroupNotifierAction.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/notifier/AddProjectNotifierAction.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/notifier/DeleteGroupNotifierAction.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/notifier/DeleteProjectNotifierAction.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/notifier/IrcGroupNotifierEditAction-ircProjectGroupNotifierSave-validation.xml +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/notifier/IrcGroupNotifierEditAction.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/notifier/IrcGroupNotifierEditAction.properties +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/notifier/IrcProjectNotifierEditAction-ircProjectNotifierSave-validation.xml +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/notifier/IrcProjectNotifierEditAction.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/notifier/IrcProjectNotifierEditAction.properties +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/notifier/JabberGroupNotifierEditAction-jabberProjectGroupNotifierSave-validation.xml +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/notifier/JabberGroupNotifierEditAction.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/notifier/JabberGroupNotifierEditAction.properties +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/notifier/JabberProjectNotifierEditAction-jabberProjectNotifierSave-validation.xml +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/notifier/JabberProjectNotifierEditAction.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/notifier/JabberProjectNotifierEditAction.properties +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/notifier/MailGroupNotifierEditAction-mailProjectGroupNotifierSave-validation.xml +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/notifier/MailGroupNotifierEditAction.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/notifier/MailGroupNotifierEditAction.properties +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/notifier/MailProjectNotifierEditAction-mailProjectNotifierSave-validation.xml +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/notifier/MailProjectNotifierEditAction.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/notifier/MailProjectNotifierEditAction.properties +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/notifier/MsnGroupNotifierEditAction-msnProjectGroupNotifierSave-validation.xml +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/notifier/MsnGroupNotifierEditAction.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/notifier/MsnGroupNotifierEditAction.properties +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/notifier/MsnProjectNotifierEditAction-msnProjectNotifierSave-validation.xml +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/notifier/MsnProjectNotifierEditAction.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/notifier/MsnProjectNotifierEditAction.properties +FILE|WEB-INF/classes/org/apache/maven/continuum/web/action/scheduleAction.properties +FILE|WEB-INF/classes/org/apache/maven/continuum/web/checks/ +FILE|WEB-INF/classes/org/apache/maven/continuum/web/checks/security/ +FILE|WEB-INF/classes/org/apache/maven/continuum/web/checks/security/RoleProfileEnvironmentCheck.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/components/ +FILE|WEB-INF/classes/org/apache/maven/continuum/web/components/Data.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/components/SubmitCancel.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/exception/ +FILE|WEB-INF/classes/org/apache/maven/continuum/web/exception/ContinuumActionException.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/filter/ +FILE|WEB-INF/classes/org/apache/maven/continuum/web/filter/FilterToComponentProxy.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/interceptor/ +FILE|WEB-INF/classes/org/apache/maven/continuum/web/interceptor/ForceContinuumConfigurationInterceptor.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/model/ +FILE|WEB-INF/classes/org/apache/maven/continuum/web/model/BuildDefinitionSummary.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/model/ContinuumViewModels.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/model/GroupSummary.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/model/NotifierSummary.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/model/ProjectSummary.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/model/Session.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/model/SessionUser.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/util/ +FILE|WEB-INF/classes/org/apache/maven/continuum/web/util/StateGenerator.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/util/WorkingCopyContentGenerator.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/view/ +FILE|WEB-INF/classes/org/apache/maven/continuum/web/view/BuildCell.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/view/BuildNowCell.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/view/BuildStatusCell.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/view/StateCell.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/view/buildresults/ +FILE|WEB-INF/classes/org/apache/maven/continuum/web/view/buildresults/StateCell.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/view/commons/ +FILE|WEB-INF/classes/org/apache/maven/continuum/web/view/commons/DateCell.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/view/jsp/ +FILE|WEB-INF/classes/org/apache/maven/continuum/web/view/jsp/ui/ +FILE|WEB-INF/classes/org/apache/maven/continuum/web/view/jsp/ui/DataTag.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/view/jsp/ui/DateTag.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/view/jsp/ui/SubmitCancelTag.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/view/projectview/ +FILE|WEB-INF/classes/org/apache/maven/continuum/web/view/projectview/NotifierEventCell.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/view/projectview/NotifierFromCell.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/view/projectview/NotifierRecipientCell.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/xmlrpc/ +FILE|WEB-INF/classes/org/apache/maven/continuum/web/xmlrpc/DefaultXmlRpcService.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/xmlrpc/XmlRpcService$1.class +FILE|WEB-INF/classes/org/apache/maven/continuum/web/xmlrpc/XmlRpcService.class +FILE|WEB-INF/classes/osuser.xml +FILE|WEB-INF/classes/template/ +FILE|WEB-INF/classes/template/default/ +FILE|WEB-INF/classes/template/default/checkbox.ftl +FILE|WEB-INF/classes/template/default/checkboxlist.ftl +FILE|WEB-INF/classes/template/default/combobox.ftl +FILE|WEB-INF/classes/template/default/controlfooter.ftl +FILE|WEB-INF/classes/template/default/controlheader-core.ftl +FILE|WEB-INF/classes/template/default/controlheader.ftl +FILE|WEB-INF/classes/template/default/data.ftl +FILE|WEB-INF/classes/template/default/datepicker.ftl +FILE|WEB-INF/classes/template/default/debug.ftl +FILE|WEB-INF/classes/template/default/doubleselect.ftl +FILE|WEB-INF/classes/template/default/empty.ftl +FILE|WEB-INF/classes/template/default/file.ftl +FILE|WEB-INF/classes/template/default/form-close-validate.ftl +FILE|WEB-INF/classes/template/default/form-close.ftl +FILE|WEB-INF/classes/template/default/form-validate.ftl +FILE|WEB-INF/classes/template/default/form.ftl +FILE|WEB-INF/classes/template/default/head.ftl +FILE|WEB-INF/classes/template/default/hidde.ftl +FILE|WEB-INF/classes/template/default/label.ftl +FILE|WEB-INF/classes/template/default/optiontransferselect.ftl +FILE|WEB-INF/classes/template/default/password.ftl +FILE|WEB-INF/classes/template/default/radiomap.ftl +FILE|WEB-INF/classes/template/default/reset.ftl +FILE|WEB-INF/classes/template/default/richtexteditor.ftl +FILE|WEB-INF/classes/template/default/select.ftl +FILE|WEB-INF/classes/template/default/styles.css +FILE|WEB-INF/classes/template/default/submit.ftl +FILE|WEB-INF/classes/template/default/submitCancel.ftl +FILE|WEB-INF/classes/template/default/text.ftl +FILE|WEB-INF/classes/template/default/textarea.ftl +FILE|WEB-INF/classes/template/default/theme.properties +FILE|WEB-INF/classes/template/default/tooltip.ftl +FILE|WEB-INF/classes/template/default/updownselect.ftl +FILE|WEB-INF/classes/template/default/validation.js +FILE|WEB-INF/classes/validators.xml +FILE|WEB-INF/classes/webwork.properties +FILE|WEB-INF/classes/xwork-security.xml +FILE|WEB-INF/classes/xwork.xml +FILE|WEB-INF/continuum.tld +FILE|WEB-INF/decorators.xml +FILE|WEB-INF/jsp/ +FILE|WEB-INF/jsp/about.jsp +FILE|WEB-INF/jsp/addMavenOneProject.jsp +FILE|WEB-INF/jsp/addMavenTwoProject.jsp +FILE|WEB-INF/jsp/addProject.jsp +FILE|WEB-INF/jsp/admin/ +FILE|WEB-INF/jsp/admin/configuration.jsp +FILE|WEB-INF/jsp/admin/configurationEdit.jsp +FILE|WEB-INF/jsp/buildDefinitionEdit.jsp +FILE|WEB-INF/jsp/buildResult.jsp +FILE|WEB-INF/jsp/buildResults.jsp +FILE|WEB-INF/jsp/components/ +FILE|WEB-INF/jsp/components/buildDefinitionGroupSummaryComponent.jsp +FILE|WEB-INF/jsp/components/buildDefinitionSummaryComponent.jsp +FILE|WEB-INF/jsp/components/buildNowCell.jsp +FILE|WEB-INF/jsp/components/companyLogo.jsp +FILE|WEB-INF/jsp/components/failureComponent.jsp +FILE|WEB-INF/jsp/components/projectGroupNotifierSummaryComponent.jsp +FILE|WEB-INF/jsp/components/projectGroupTabComponent.jsp +FILE|WEB-INF/jsp/components/projectNotifierSummaryComponent.jsp +FILE|WEB-INF/jsp/components/projectSummaryComponent.jsp +FILE|WEB-INF/jsp/confirmBuildDefinitionRemoval.jsp +FILE|WEB-INF/jsp/confirmGroupRemoval.jsp +FILE|WEB-INF/jsp/confirmScheduleRemoval.jsp +FILE|WEB-INF/jsp/confirmation.jsp +FILE|WEB-INF/jsp/decorators/ +FILE|WEB-INF/jsp/decorators/default.jsp +FILE|WEB-INF/jsp/decorators/none.jsp +FILE|WEB-INF/jsp/deleteBuildDefinition.jsp +FILE|WEB-INF/jsp/deleteNotifier.jsp +FILE|WEB-INF/jsp/deleteProject.jsp +FILE|WEB-INF/jsp/editSchedule.jsp +FILE|WEB-INF/jsp/error/ +FILE|WEB-INF/jsp/error/error.jsp +FILE|WEB-INF/jsp/groupSummary.jsp +FILE|WEB-INF/jsp/navigations/ +FILE|WEB-INF/jsp/navigations/DefaultBottom.jsp +FILE|WEB-INF/jsp/navigations/DefaultTop.jsp +FILE|WEB-INF/jsp/navigations/Menu.jsp +FILE|WEB-INF/jsp/navigations/ProjectGroupMenu.jsp +FILE|WEB-INF/jsp/navigations/ProjectMenu.jsp +FILE|WEB-INF/jsp/notifierIrc.jsp +FILE|WEB-INF/jsp/notifierJabber.jsp +FILE|WEB-INF/jsp/notifierMail.jsp +FILE|WEB-INF/jsp/notifierMsn.jsp +FILE|WEB-INF/jsp/notifierSelectType.jsp +FILE|WEB-INF/jsp/projectEdit.jsp +FILE|WEB-INF/jsp/projectGroupBuildDefinition.jsp +FILE|WEB-INF/jsp/projectGroupMembers.jsp +FILE|WEB-INF/jsp/projectGroupNotifier.jsp +FILE|WEB-INF/jsp/projectGroupSummary.jsp +FILE|WEB-INF/jsp/projectView.jsp +FILE|WEB-INF/jsp/pss/ +FILE|WEB-INF/jsp/pss/accessDenied.jsp +FILE|WEB-INF/jsp/pss/account.jsp +FILE|WEB-INF/jsp/pss/admin/ +FILE|WEB-INF/jsp/pss/admin/adminConsole.jsp +FILE|WEB-INF/jsp/pss/admin/console.jsp +FILE|WEB-INF/jsp/pss/admin/createAdmin.jsp +FILE|WEB-INF/jsp/pss/admin/operationList.jsp +FILE|WEB-INF/jsp/pss/admin/permissionList.jsp +FILE|WEB-INF/jsp/pss/admin/resourceList.jsp +FILE|WEB-INF/jsp/pss/admin/role.jsp +FILE|WEB-INF/jsp/pss/admin/roleCreate.jsp +FILE|WEB-INF/jsp/pss/admin/roleList.jsp +FILE|WEB-INF/jsp/pss/admin/roleSummary.jsp +FILE|WEB-INF/jsp/pss/admin/systemInformation.jsp +FILE|WEB-INF/jsp/pss/admin/userCreate.jsp +FILE|WEB-INF/jsp/pss/admin/userDelete.jsp +FILE|WEB-INF/jsp/pss/admin/userEdit.jsp +FILE|WEB-INF/jsp/pss/admin/userFind.jsp +FILE|WEB-INF/jsp/pss/admin/userList.jsp +FILE|WEB-INF/jsp/pss/alert.jsp +FILE|WEB-INF/jsp/pss/generalError.jsp +FILE|WEB-INF/jsp/pss/include/ +FILE|WEB-INF/jsp/pss/include/assignments.jsp +FILE|WEB-INF/jsp/pss/include/error.jsp +FILE|WEB-INF/jsp/pss/include/formValidationResults.jsp +FILE|WEB-INF/jsp/pss/include/grantRoles.jsp +FILE|WEB-INF/jsp/pss/include/rbacListNavigation.jsp +FILE|WEB-INF/jsp/pss/include/removeRoles.jsp +FILE|WEB-INF/jsp/pss/include/roleRow.jsp +FILE|WEB-INF/jsp/pss/include/securityLinks.jsp +FILE|WEB-INF/jsp/pss/include/userCredentials.jsp +FILE|WEB-INF/jsp/pss/login.jsp +FILE|WEB-INF/jsp/pss/password.jsp +FILE|WEB-INF/jsp/pss/register.jsp +FILE|WEB-INF/jsp/pss/requestPasswordReset.jsp +FILE|WEB-INF/jsp/pss/requiresAuthentication.jsp +FILE|WEB-INF/jsp/pss/statusline.jsp +FILE|WEB-INF/jsp/pss/validate.jsp +FILE|WEB-INF/jsp/pss/validationNotification.jsp +FILE|WEB-INF/jsp/releaseFinished.jsp +FILE|WEB-INF/jsp/releaseInProgress.jsp +FILE|WEB-INF/jsp/releaseInitialized.jsp +FILE|WEB-INF/jsp/releasePerform.jsp +FILE|WEB-INF/jsp/releasePerformFromScm.jsp +FILE|WEB-INF/jsp/releasePrepare.jsp +FILE|WEB-INF/jsp/releaseProject.jsp +FILE|WEB-INF/jsp/releaseViewResult.jsp +FILE|WEB-INF/jsp/schedules.jsp +FILE|WEB-INF/jsp/summary.jsp +FILE|WEB-INF/jsp/surefireReport.jsp +FILE|WEB-INF/jsp/workingCopy.jsp +FILE|WEB-INF/lib/ +FILE|WEB-INF/lib/backport-util-concurrent-2.2.jar +FILE|WEB-INF/lib/commons-beanutils-1.7.0.jar +FILE|WEB-INF/lib/commons-cli-1.0.jar +FILE|WEB-INF/lib/commons-codec-1.3.jar +FILE|WEB-INF/lib/commons-collections-2.0.jar +FILE|WEB-INF/lib/commons-collections-3.0.jar +FILE|WEB-INF/lib/commons-fileupload-1.1.jar +FILE|WEB-INF/lib/commons-httpclient-2.0.2.jar +FILE|WEB-INF/lib/commons-io-1.1.jar +FILE|WEB-INF/lib/commons-lang-2.0.jar +FILE|WEB-INF/lib/commons-logging-1.0.4.jar +FILE|WEB-INF/lib/commons-logging-api-1.0.4.jar +FILE|WEB-INF/lib/continuum-api-1.0.3-maestro-1.2-SNAPSHOT.jar +FILE|WEB-INF/lib/continuum-core-1.0.3-maestro-1.2-SNAPSHOT.jar +FILE|WEB-INF/lib/continuum-model-1.0.3-maestro-1.2-SNAPSHOT.jar +FILE|WEB-INF/lib/continuum-notifier-api-1.0.3-maestro-1.2-SNAPSHOT.jar +FILE|WEB-INF/lib/continuum-notifier-irc-1.0.3-maestro-1.2-SNAPSHOT.jar +FILE|WEB-INF/lib/continuum-notifier-jabber-1.0.3-maestro-1.2-SNAPSHOT.jar +FILE|WEB-INF/lib/continuum-notifier-msn-1.0.3-maestro-1.2-SNAPSHOT.jar +FILE|WEB-INF/lib/continuum-release-1.0.3-maestro-1.2-SNAPSHOT.jar +FILE|WEB-INF/lib/continuum-security-1.0.3-maestro-1.2-SNAPSHOT.jar +FILE|WEB-INF/lib/continuum-store-1.0.3-maestro-1.2-SNAPSHOT.jar +FILE|WEB-INF/lib/continuum-xmlrpc-1.0.3-maestro-1.2-SNAPSHOT.jar +FILE|WEB-INF/lib/derby-10.1.3.1.jar +FILE|WEB-INF/lib/doxia-sink-api-1.0-alpha-7.jar +FILE|WEB-INF/lib/extremecomponents-1.0.1.jar +FILE|WEB-INF/lib/freemarker-2.3.4.jar +FILE|WEB-INF/lib/geronimo-spec-jta-1.0.1B-rc2.jar +FILE|WEB-INF/lib/jaxen-1.1-beta-8.jar +FILE|WEB-INF/lib/jdom-1.0.jar +FILE|WEB-INF/lib/jsch-0.1.24.jar +FILE|WEB-INF/lib/jstl-1.1.2.jar +FILE|WEB-INF/lib/maestro-projectserver-store-1.2-SNAPSHOT.jar +FILE|WEB-INF/lib/maven-artifact-2.0.4-maestro-1.2-SNAPSHOT.jar +FILE|WEB-INF/lib/maven-artifact-manager-2.0.4-maestro-1.2-SNAPSHOT.jar +FILE|WEB-INF/lib/maven-core-2.0.4-maestro-1.2-SNAPSHOT.jar +FILE|WEB-INF/lib/maven-error-diagnostics-2.0.4-maestro-1.2-SNAPSHOT.jar +FILE|WEB-INF/lib/maven-model-2.0.4-maestro-1.2-SNAPSHOT.jar +FILE|WEB-INF/lib/maven-monitor-2.0.4-maestro-1.2-SNAPSHOT.jar +FILE|WEB-INF/lib/maven-plugin-api-2.0.4-maestro-1.2-SNAPSHOT.jar +FILE|WEB-INF/lib/maven-plugin-descriptor-2.0.4-maestro-1.2-SNAPSHOT.jar +FILE|WEB-INF/lib/maven-plugin-parameter-documenter-2.0.4-maestro-1.2-SNAPSHOT.jar +FILE|WEB-INF/lib/maven-plugin-registry-2.0.4-maestro-1.2-SNAPSHOT.jar +FILE|WEB-INF/lib/maven-profile-2.0.4-maestro-1.2-SNAPSHOT.jar +FILE|WEB-INF/lib/maven-project-2.0.4-maestro-1.2-SNAPSHOT.jar +FILE|WEB-INF/lib/maven-release-manager-1.0-20061027.091829-1.jar +FILE|WEB-INF/lib/maven-reporting-api-2.0.4-maestro-1.2-SNAPSHOT.jar +FILE|WEB-INF/lib/maven-repository-metadata-2.0.4-maestro-1.2-SNAPSHOT.jar +FILE|WEB-INF/lib/maven-scm-api-1.0-maestro-1.2-SNAPSHOT.jar +FILE|WEB-INF/lib/maven-scm-manager-plexus-1.0-maestro-1.2-SNAPSHOT.jar +FILE|WEB-INF/lib/maven-scm-provider-bazaar-1.0-maestro-1.2-SNAPSHOT.jar +FILE|WEB-INF/lib/maven-scm-provider-clearcase-1.0-maestro-1.2-SNAPSHOT.jar +FILE|WEB-INF/lib/maven-scm-provider-cvs-commons-1.0-maestro-1.2-SNAPSHOT.jar +FILE|WEB-INF/lib/maven-scm-provider-cvsexe-1.0-maestro-1.2-SNAPSHOT.jar +FILE|WEB-INF/lib/maven-scm-provider-local-1.0-maestro-1.2-SNAPSHOT.jar +FILE|WEB-INF/lib/maven-scm-provider-perforce-1.0-maestro-1.2-SNAPSHOT.jar +FILE|WEB-INF/lib/maven-scm-provider-starteam-1.0-maestro-1.2-SNAPSHOT.jar +FILE|WEB-INF/lib/maven-scm-provider-svn-commons-1.0-maestro-1.2-SNAPSHOT.jar +FILE|WEB-INF/lib/maven-scm-provider-svnexe-1.0-maestro-1.2-SNAPSHOT.jar +FILE|WEB-INF/lib/maven-settings-2.0.4-maestro-1.2-SNAPSHOT.jar +FILE|WEB-INF/lib/msnmlib-1.4-20050613.jar +FILE|WEB-INF/lib/ognl-2.6.7.jar +FILE|WEB-INF/lib/oro-2.0.6.jar +FILE|WEB-INF/lib/oscore-2.2.4.jar +FILE|WEB-INF/lib/plexus-action-1.0-alpha-6.jar +FILE|WEB-INF/lib/plexus-command-line-1.0-alpha-2.jar +FILE|WEB-INF/lib/plexus-formica-1.0-beta-11.jar +FILE|WEB-INF/lib/plexus-i18n-1.0-beta-6.jar +FILE|WEB-INF/lib/plexus-interactivity-api-1.0-alpha-4.jar +FILE|WEB-INF/lib/plexus-ircbot-1.1-alpha-6.jar +FILE|WEB-INF/lib/plexus-jabber-1.0-alpha-4.jar +FILE|WEB-INF/lib/plexus-jdo2-1.0-alpha-7.jar +FILE|WEB-INF/lib/plexus-log4j-logging-1.1-alpha-2.jar +FILE|WEB-INF/lib/plexus-mail-sender-api-1.0-alpha-3.jar +FILE|WEB-INF/lib/plexus-mail-sender-javamail-1.0-alpha-3.jar +FILE|WEB-INF/lib/plexus-msn-1.0-alpha-2.jar +FILE|WEB-INF/lib/plexus-notification-1.0-alpha-5.jar +FILE|WEB-INF/lib/plexus-quartz-1.0-alpha-3.jar +FILE|WEB-INF/lib/plexus-security-authentication-api-1.0-alpha-6-20061027.200547-2.jar +FILE|WEB-INF/lib/plexus-security-authentication-api-1.0-alpha-6-SNAPSHOT.jar +FILE|WEB-INF/lib/plexus-security-authentication-provider-keystore-1.0-alpha-6-20061027.200547-2.jar +FILE|WEB-INF/lib/plexus-security-authentication-provider-user-manager-1.0-alpha-6-20061027.200547-2.jar +FILE|WEB-INF/lib/plexus-security-authorization-api-1.0-alpha-6-SNAPSHOT.jar +FILE|WEB-INF/lib/plexus-security-authorization-rbac-authorizer-1.0-alpha-6-20061027.200547-2.jar +FILE|WEB-INF/lib/plexus-security-authorization-rbac-model-1.0-alpha-6-20061027.200547-2.jar +FILE|WEB-INF/lib/plexus-security-authorization-rbac-model-1.0-alpha-6-SNAPSHOT.jar +FILE|WEB-INF/lib/plexus-security-authorization-rbac-store-jdo-1.0-alpha-6-20061027.200547-2.jar +FILE|WEB-INF/lib/plexus-security-keys-api-1.0-alpha-6-20061027.200547-2.jar +FILE|WEB-INF/lib/plexus-security-keys-api-1.0-alpha-6-SNAPSHOT.jar +FILE|WEB-INF/lib/plexus-security-keys-jdo-1.0-alpha-6-20061027.200547-2.jar +FILE|WEB-INF/lib/plexus-security-policy-1.0-alpha-6-20061027.200547-2.jar +FILE|WEB-INF/lib/plexus-security-policy-1.0-alpha-6-SNAPSHOT.jar +FILE|WEB-INF/lib/plexus-security-rbac-profile-1.0-alpha-6-20061027.200547-2.jar +FILE|WEB-INF/lib/plexus-security-rbac-profile-1.0-alpha-6-SNAPSHOT.jar +FILE|WEB-INF/lib/plexus-security-system-1.0-alpha-6-SNAPSHOT.jar +FILE|WEB-INF/lib/plexus-security-ui-web-integration-1.0-alpha-6-SNAPSHOT.jar +FILE|WEB-INF/lib/plexus-security-ui-web-taglib-1.0-alpha-6-20061027.200547-2.jar +FILE|WEB-INF/lib/plexus-security-ui-web-taglib-1.0-alpha-6-SNAPSHOT.jar +FILE|WEB-INF/lib/plexus-security-user-management-api-1.0-alpha-6-SNAPSHOT.jar +FILE|WEB-INF/lib/plexus-security-user-management-provider-jdo-1.0-alpha-6-20061027.200547-2.jar +FILE|WEB-INF/lib/plexus-taskqueue-1.0-alpha-4.jar +FILE|WEB-INF/lib/plexus-utils-1.2.jar +FILE|WEB-INF/lib/plexus-utils-1.3.jar +FILE|WEB-INF/lib/plexus-velocity-1.1.2.jar +FILE|WEB-INF/lib/plexus-xmlrpc-1.0-beta-4.jar +FILE|WEB-INF/lib/plexus-xwork-integration-1.0-alpha-2.jar +FILE|WEB-INF/lib/quartz-1.4.5.jar +FILE|WEB-INF/lib/regexp-1.3.jar +FILE|WEB-INF/lib/rife-continuations-0.0.2.jar +FILE|WEB-INF/lib/sitemesh-2.2.1.jar +FILE|WEB-INF/lib/smack-2.0.0.jar +FILE|WEB-INF/lib/smackx-2.0.0.jar +FILE|WEB-INF/lib/standard-1.1.2.jar +FILE|WEB-INF/lib/velocity-1.4.jar +FILE|WEB-INF/lib/wagon-file-1.0-alpha-7.jar +FILE|WEB-INF/lib/wagon-http-lightweight-1.0-alpha-6.jar +FILE|WEB-INF/lib/wagon-provider-api-1.0-alpha-6.jar +FILE|WEB-INF/lib/wagon-ssh-1.0-alpha-7.jar +FILE|WEB-INF/lib/wagon-ssh-external-1.0-alpha-6.jar +FILE|WEB-INF/lib/webwork-2.2.4.jar +FILE|WEB-INF/lib/xmlrpc-1.2.jar +FILE|WEB-INF/lib/xwork-1.2.1.jar +FILE|WEB-INF/sitemesh.xml +FILE|WEB-INF/web.xml +FILE|css/ +FILE|css/extremecomponents.css +FILE|css/print.css +FILE|css/tigris.css +FILE|favicon.ico +FILE|images/ +FILE|images/arrow.gif +FILE|images/asf_logo_wide.gif +FILE|images/bg_warning.gif +FILE|images/buildhistory.gif +FILE|images/buildhistory_disabled.gif +FILE|images/building.gif +FILE|images/buildnow.gif +FILE|images/buildnow_disabled.gif +FILE|images/cancelbuild.gif +FILE|images/checkingout.gif +FILE|images/continuum_logo_75.gif +FILE|images/delete.gif +FILE|images/delete_disabled.gif +FILE|images/edit.gif +FILE|images/edit_disabled.gif +FILE|images/file.gif +FILE|images/folder-closed.gif +FILE|images/folder-open.gif +FILE|images/footerborder.gif +FILE|images/icon_arrowfolder1_sml.gif +FILE|images/icon_arrowfolder2_sml.gif +FILE|images/icon_arrowfolderclosed1_sml.gif +FILE|images/icon_arrowfolderopen2_sml.gif +FILE|images/icon_error_lrg.gif +FILE|images/icon_error_sml.gif +FILE|images/icon_sortdown.gif +FILE|images/icon_sortleft.gif +FILE|images/icon_sortright.gif +FILE|images/icon_sortup.gif +FILE|images/icon_success_sml.gif +FILE|images/icon_warning_sml.gif +FILE|images/inqueue.gif +FILE|images/legendbg.gif +FILE|images/legendbg2.gif +FILE|images/link.gif +FILE|images/linkover.gif +FILE|images/maestro_logo.gif +FILE|images/mergere-small.gif +FILE|images/nw_maj.gif +FILE|images/nw_maj_hi.gif +FILE|images/nw_maj_rond.gif +FILE|images/nw_med.gif +FILE|images/nw_med_hi.gif +FILE|images/nw_med_rond.gif +FILE|images/nw_min.gif +FILE|images/nw_min_036.gif +FILE|images/nw_min_hi.gif +FILE|images/releaseproject.gif +FILE|images/releaseproject_disabled.gif +FILE|images/se_maj_rond.gif +FILE|images/strich.gif +FILE|images/super.gif +FILE|images/sw_maj_rond.gif +FILE|images/sw_med_rond.gif +FILE|images/sw_min.gif +FILE|images/workingcopy.gif +FILE|images/workingcopy_disabled.gif +FILE|index.jsp +FILE|scripts/ +FILE|scripts/tigris.js +FILE|template/ +FILE|template/pss/ +FILE|template/pss/checkboxlist.ftl diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/artifact-dumps/daytrader-ear-1.1.ear.txt b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/artifact-dumps/daytrader-ear-1.1.ear.txt new file mode 100644 index 000000000..875ffdf51 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/artifact-dumps/daytrader-ear-1.1.ear.txt @@ -0,0 +1,18 @@ +FILENAME|daytrader-ear-1.1.ear +SIZE|1005420 +HASH_MD5|4d677e8e95fb342512e3d05ea68a501d +HASH_SHA1|58f1e8ae41f12747947c947437e262d9f3bd3ce7 +HASH_BYTECODE| +JDK|1.0 +FILE|META-INF/ +FILE|META-INF/MANIFEST.MF +FILE|META-INF/application.xml +FILE|META-INF/maven/ +FILE|META-INF/maven/geronimo/ +FILE|META-INF/maven/geronimo/daytrader-ear/ +FILE|META-INF/maven/geronimo/daytrader-ear/pom.properties +FILE|META-INF/maven/geronimo/daytrader-ear/pom.xml +FILE|dt-ejb.jar +FILE|streamer.jar +FILE|web.war +FILE|wsappclient.jar diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/artifact-dumps/maven-archetype-simple-1.0-alpha-4.jar.txt b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/artifact-dumps/maven-archetype-simple-1.0-alpha-4.jar.txt new file mode 100644 index 000000000..7b7cbd491 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/artifact-dumps/maven-archetype-simple-1.0-alpha-4.jar.txt @@ -0,0 +1,19 @@ +FILENAME|maven-archetype-simple-1.0-alpha-4.jar +SIZE|4451 +HASH_MD5|446c23f1e3f88f2dd2d490f8492f65dc +HASH_SHA1|a9a5b26651836425dacd77fa3646701dff648e14 +HASH_BYTECODE|734edd1419ea3e792e7c15b22b1d823947c43e5a +JDK|1.1 +CLASS|archetype.App +METHOD|archetype.App.()V +METHOD|archetype.App.main([Ljava/lang/String;)V +FILE|META-INF/ +FILE|META-INF/MANIFEST.MF +FILE|META-INF/maven/ +FILE|META-INF/maven/org.apache.maven.archetypes/ +FILE|META-INF/maven/org.apache.maven.archetypes/maven-archetype-simple/ +FILE|META-INF/maven/org.apache.maven.archetypes/maven-archetype-simple/pom.properties +FILE|META-INF/maven/org.apache.maven.archetypes/maven-archetype-simple/pom.xml +FILE|app.properties +FILE|archetype/ +FILE|archetype/App.class diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/artifact-dumps/maven-help-plugin-2.0.2-20070119.121239-2.jar.txt b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/artifact-dumps/maven-help-plugin-2.0.2-20070119.121239-2.jar.txt new file mode 100644 index 000000000..e8572febd --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/artifact-dumps/maven-help-plugin-2.0.2-20070119.121239-2.jar.txt @@ -0,0 +1,88 @@ +FILENAME|maven-help-plugin-2.0.2-20070119.121239-2.jar +SIZE|20741 +HASH_MD5|16b9374e2f36e42978880b62dce34a0a +HASH_SHA1|dc87f75ac4ba9c63066372ffae9830e42648f829 +HASH_BYTECODE|c4495d02a84259a458b13023d935efd8c33fcf33 +JDK|1.1 +CLASS|org.apache.maven.plugins.help.ActiveProfilesMojo +CLASS|org.apache.maven.plugins.help.DependenciesMojo +CLASS|org.apache.maven.plugins.help.DescribeMojo$1 +CLASS|org.apache.maven.plugins.help.DescribeMojo$PluginInfo +CLASS|org.apache.maven.plugins.help.DescribeMojo +CLASS|org.apache.maven.plugins.help.EffectivePomMojo +CLASS|org.apache.maven.plugins.help.EffectiveSettingsMojo +METHOD|org.apache.maven.plugins.help.ActiveProfilesMojo.()V +METHOD|org.apache.maven.plugins.help.ActiveProfilesMojo.execute()V +METHOD|org.apache.maven.plugins.help.ActiveProfilesMojo.writeFile(Ljava/lang/StringBuffer;)V +METHOD|org.apache.maven.plugins.help.ActiveProfilesMojo.getActiveProfileStatement(Lorg/apache/maven/project/MavenProject;Ljava/lang/StringBuffer;)V +METHOD|org.apache.maven.plugins.help.ActiveProfilesMojo.setProjects(Ljava/util/List;)V +METHOD|org.apache.maven.plugins.help.DependenciesMojo.()V +METHOD|org.apache.maven.plugins.help.DependenciesMojo.execute()V +METHOD|org.apache.maven.plugins.help.DependenciesMojo.serialiseDependencyTree(Lorg/apache/maven/shared/dependency/tree/DependencyTree;)Ljava/lang/String; +METHOD|org.apache.maven.plugins.help.DependenciesMojo.serialiseDependencyNode(Lorg/apache/maven/shared/dependency/tree/DependencyNode;Ljava/lang/StringBuffer;)V +METHOD|org.apache.maven.plugins.help.DependenciesMojo.write(Ljava/lang/String;Ljava/io/File;)V +METHOD|org.apache.maven.plugins.help.DependenciesMojo.log(Ljava/lang/String;)V +METHOD|org.apache.maven.plugins.help.DependenciesMojo.()V +METHOD|org.apache.maven.plugins.help.DescribeMojo$PluginInfo.()V +METHOD|org.apache.maven.plugins.help.DescribeMojo$PluginInfo.(Lorg/apache/maven/plugins/help/DescribeMojo$1;)V +METHOD|org.apache.maven.plugins.help.DescribeMojo.()V +METHOD|org.apache.maven.plugins.help.DescribeMojo.execute()V +METHOD|org.apache.maven.plugins.help.DescribeMojo.writeDescription(Ljava/lang/StringBuffer;)V +METHOD|org.apache.maven.plugins.help.DescribeMojo.lookupPluginDescriptor(Lorg/apache/maven/plugins/help/DescribeMojo$PluginInfo;)Lorg/apache/maven/plugin/descriptor/PluginDescriptor; +METHOD|org.apache.maven.plugins.help.DescribeMojo.parsePluginLookupInfo(Lorg/apache/maven/plugins/help/DescribeMojo$PluginInfo;)V +METHOD|org.apache.maven.plugins.help.DescribeMojo.describePlugin(Lorg/apache/maven/plugin/descriptor/PluginDescriptor;Ljava/lang/StringBuffer;)V +METHOD|org.apache.maven.plugins.help.DescribeMojo.formatDescription(Ljava/lang/String;)Ljava/lang/String; +METHOD|org.apache.maven.plugins.help.DescribeMojo.prettyAppend(Ljava/lang/String;Ljava/lang/StringBuffer;)V +METHOD|org.apache.maven.plugins.help.DescribeMojo.describeMojo(Lorg/apache/maven/plugin/descriptor/MojoDescriptor;Ljava/lang/StringBuffer;)V +METHOD|org.apache.maven.plugins.help.DescribeMojo.describeMojoGuts(Lorg/apache/maven/plugin/descriptor/MojoDescriptor;Ljava/lang/StringBuffer;Z)V +METHOD|org.apache.maven.plugins.help.DescribeMojo.describeMojoRequirements(Lorg/apache/maven/plugin/descriptor/MojoDescriptor;Ljava/lang/StringBuffer;)V +METHOD|org.apache.maven.plugins.help.DescribeMojo.describeMojoParameters(Lorg/apache/maven/plugin/descriptor/MojoDescriptor;Ljava/lang/StringBuffer;)V +METHOD|org.apache.maven.plugins.help.DescribeMojo.getPlugin()Ljava/lang/String; +METHOD|org.apache.maven.plugins.help.DescribeMojo.setPlugin(Ljava/lang/String;)V +METHOD|org.apache.maven.plugins.help.DescribeMojo.getPluginManager()Lorg/apache/maven/plugin/PluginManager; +METHOD|org.apache.maven.plugins.help.DescribeMojo.setPluginManager(Lorg/apache/maven/plugin/PluginManager;)V +METHOD|org.apache.maven.plugins.help.DescribeMojo.getArtifactId()Ljava/lang/String; +METHOD|org.apache.maven.plugins.help.DescribeMojo.setArtifactId(Ljava/lang/String;)V +METHOD|org.apache.maven.plugins.help.DescribeMojo.getGroupId()Ljava/lang/String; +METHOD|org.apache.maven.plugins.help.DescribeMojo.setGroupId(Ljava/lang/String;)V +METHOD|org.apache.maven.plugins.help.DescribeMojo.getLocalRepository()Lorg/apache/maven/artifact/repository/ArtifactRepository; +METHOD|org.apache.maven.plugins.help.DescribeMojo.setLocalRepository(Lorg/apache/maven/artifact/repository/ArtifactRepository;)V +METHOD|org.apache.maven.plugins.help.DescribeMojo.getMojo()Ljava/lang/String; +METHOD|org.apache.maven.plugins.help.DescribeMojo.setMojo(Ljava/lang/String;)V +METHOD|org.apache.maven.plugins.help.DescribeMojo.getOutput()Ljava/io/File; +METHOD|org.apache.maven.plugins.help.DescribeMojo.setOutput(Ljava/io/File;)V +METHOD|org.apache.maven.plugins.help.DescribeMojo.getProject()Lorg/apache/maven/project/MavenProject; +METHOD|org.apache.maven.plugins.help.DescribeMojo.setProject(Lorg/apache/maven/project/MavenProject;)V +METHOD|org.apache.maven.plugins.help.DescribeMojo.getSettings()Lorg/apache/maven/settings/Settings; +METHOD|org.apache.maven.plugins.help.DescribeMojo.setSettings(Lorg/apache/maven/settings/Settings;)V +METHOD|org.apache.maven.plugins.help.DescribeMojo.getVersion()Ljava/lang/String; +METHOD|org.apache.maven.plugins.help.DescribeMojo.setVersion(Ljava/lang/String;)V +METHOD|org.apache.maven.plugins.help.EffectivePomMojo.()V +METHOD|org.apache.maven.plugins.help.EffectivePomMojo.execute()V +METHOD|org.apache.maven.plugins.help.EffectivePomMojo.getEffectivePom(Lorg/apache/maven/project/MavenProject;Ljava/lang/StringBuffer;)V +METHOD|org.apache.maven.plugins.help.EffectivePomMojo.setOutput(Ljava/io/File;)V +METHOD|org.apache.maven.plugins.help.EffectivePomMojo.setProjects(Ljava/util/List;)V +METHOD|org.apache.maven.plugins.help.EffectiveSettingsMojo.()V +METHOD|org.apache.maven.plugins.help.EffectiveSettingsMojo.execute()V +METHOD|org.apache.maven.plugins.help.EffectiveSettingsMojo.setOutput(Ljava/lang/String;)V +METHOD|org.apache.maven.plugins.help.EffectiveSettingsMojo.setSettings(Lorg/apache/maven/settings/Settings;)V +FILE|META-INF/ +FILE|META-INF/MANIFEST.MF +FILE|META-INF/maven/ +FILE|META-INF/maven/org.apache.maven.plugins/ +FILE|META-INF/maven/org.apache.maven.plugins/maven-help-plugin/ +FILE|META-INF/maven/org.apache.maven.plugins/maven-help-plugin/pom.properties +FILE|META-INF/maven/org.apache.maven.plugins/maven-help-plugin/pom.xml +FILE|META-INF/maven/plugin.xml +FILE|org/ +FILE|org/apache/ +FILE|org/apache/maven/ +FILE|org/apache/maven/plugins/ +FILE|org/apache/maven/plugins/help/ +FILE|org/apache/maven/plugins/help/ActiveProfilesMojo.class +FILE|org/apache/maven/plugins/help/DependenciesMojo.class +FILE|org/apache/maven/plugins/help/DescribeMojo$1.class +FILE|org/apache/maven/plugins/help/DescribeMojo$PluginInfo.class +FILE|org/apache/maven/plugins/help/DescribeMojo.class +FILE|org/apache/maven/plugins/help/EffectivePomMojo.class +FILE|org/apache/maven/plugins/help/EffectiveSettingsMojo.class diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/artifact-dumps/redback-authorization-open-1.0-alpha-1-SNAPSHOT.jar.txt b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/artifact-dumps/redback-authorization-open-1.0-alpha-1-SNAPSHOT.jar.txt new file mode 100644 index 000000000..bbad7a8a2 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/artifact-dumps/redback-authorization-open-1.0-alpha-1-SNAPSHOT.jar.txt @@ -0,0 +1,26 @@ +FILENAME|redback-authorization-open-1.0-alpha-1-SNAPSHOT.jar +SIZE|4080 +HASH_MD5|f42047fe2e177ac04d0df7aa44d408be +HASH_SHA1|2bb14b388973351b0a4dfe11d171965f59cc61a1 +HASH_BYTECODE|817c08abe3d48d67a5c49c13e7c5497da7bd5e8e +JDK|1.4 +CLASS|org.codehaus.plexus.redback.authorization.open.OpenAuthorizer +METHOD|org.codehaus.plexus.redback.authorization.open.OpenAuthorizer.()V +METHOD|org.codehaus.plexus.redback.authorization.open.OpenAuthorizer.getId()Ljava/lang/String; +METHOD|org.codehaus.plexus.redback.authorization.open.OpenAuthorizer.isAuthorized(Lorg/codehaus/plexus/redback/authorization/AuthorizationDataSource;)Lorg/codehaus/plexus/redback/authorization/AuthorizationResult; +FILE|META-INF/ +FILE|META-INF/MANIFEST.MF +FILE|META-INF/maven/ +FILE|META-INF/maven/org.codehaus.plexus.redback/ +FILE|META-INF/maven/org.codehaus.plexus.redback/redback-authorization-open/ +FILE|META-INF/maven/org.codehaus.plexus.redback/redback-authorization-open/pom.properties +FILE|META-INF/maven/org.codehaus.plexus.redback/redback-authorization-open/pom.xml +FILE|META-INF/plexus/ +FILE|META-INF/plexus/components.xml +FILE|org/ +FILE|org/codehaus/ +FILE|org/codehaus/plexus/ +FILE|org/codehaus/plexus/redback/ +FILE|org/codehaus/plexus/redback/authorization/ +FILE|org/codehaus/plexus/redback/authorization/open/ +FILE|org/codehaus/plexus/redback/authorization/open/OpenAuthorizer.class diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/artifact-dumps/testng-5.1-jdk15.jar.txt b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/artifact-dumps/testng-5.1-jdk15.jar.txt new file mode 100644 index 000000000..2e5f53abc --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/artifact-dumps/testng-5.1-jdk15.jar.txt @@ -0,0 +1,4789 @@ +FILENAME|testng-5.1-jdk15.jar +SIZE|692505 +HASH_MD5|3345656c1bf32a45e9546d69e35a21d4 +HASH_SHA1|7a0d2b8239517c561aefe2fa2971db522a3e3a47 +HASH_BYTECODE|0ea3f1aa7fc9725958af443f2e4ca13bd7d60968 +JDK|1.5 +CLASS|bsh.BSHAllocationExpression +CLASS|bsh.BSHAmbiguousName +CLASS|bsh.BSHArguments +CLASS|bsh.BSHArrayDimensions +CLASS|bsh.BSHArrayInitializer +CLASS|bsh.BSHAssignment +CLASS|bsh.BSHBinaryExpression +CLASS|bsh.BSHBlock$NodeFilter +CLASS|bsh.BSHBlock +CLASS|bsh.BSHCastExpression +CLASS|bsh.BSHClassDeclaration +CLASS|bsh.BSHEnhancedForStatement +CLASS|bsh.BSHForStatement +CLASS|bsh.BSHFormalComment +CLASS|bsh.BSHFormalParameter +CLASS|bsh.BSHFormalParameters +CLASS|bsh.BSHIfStatement +CLASS|bsh.BSHImportDeclaration +CLASS|bsh.BSHLiteral +CLASS|bsh.BSHMethodDeclaration +CLASS|bsh.BSHMethodInvocation +CLASS|bsh.BSHPackageDeclaration +CLASS|bsh.BSHPrimaryExpression +CLASS|bsh.BSHPrimarySuffix +CLASS|bsh.BSHPrimitiveType +CLASS|bsh.BSHReturnStatement +CLASS|bsh.BSHReturnType +CLASS|bsh.BSHStatementExpressionList +CLASS|bsh.BSHSwitchLabel +CLASS|bsh.BSHSwitchStatement +CLASS|bsh.BSHTernaryExpression +CLASS|bsh.BSHThrowStatement +CLASS|bsh.BSHTryStatement +CLASS|bsh.BSHType +CLASS|bsh.BSHTypedVariableDeclaration +CLASS|bsh.BSHUnaryExpression +CLASS|bsh.BSHVariableDeclarator +CLASS|bsh.BSHWhileStatement +CLASS|bsh.BlockNameSpace +CLASS|bsh.BshClassManager$Listener +CLASS|bsh.BshClassManager$SignatureKey +CLASS|bsh.BshClassManager +CLASS|bsh.BshIterator +CLASS|bsh.BshMethod +CLASS|bsh.CallStack +CLASS|bsh.Capabilities$Unavailable +CLASS|bsh.Capabilities +CLASS|bsh.ClassGenerator +CLASS|bsh.ClassGeneratorImpl$ClassNodeFilter +CLASS|bsh.ClassGeneratorImpl +CLASS|bsh.ClassGeneratorUtil$ConstructorArgs +CLASS|bsh.ClassGeneratorUtil +CLASS|bsh.ClassIdentifier +CLASS|bsh.ClassPathException +CLASS|bsh.CollectionManager$1 +CLASS|bsh.CollectionManager$BasicBshIterator +CLASS|bsh.CollectionManager +CLASS|bsh.CommandLineReader +CLASS|bsh.Console +CLASS|bsh.ConsoleInterface +CLASS|bsh.DelayedEvalBshMethod +CLASS|bsh.EvalError +CLASS|bsh.ExternalNameSpace +CLASS|bsh.Interpreter$1 +CLASS|bsh.Interpreter +CLASS|bsh.InterpreterError +CLASS|bsh.JJTParserState +CLASS|bsh.JavaCharStream +CLASS|bsh.LHS +CLASS|bsh.Modifiers +CLASS|bsh.Name +CLASS|bsh.NameSource$Listener +CLASS|bsh.NameSource +CLASS|bsh.NameSpace +CLASS|bsh.Node +CLASS|bsh.ParseException +CLASS|bsh.Parser$1 +CLASS|bsh.Parser$LookaheadSuccess +CLASS|bsh.Parser +CLASS|bsh.ParserConstants +CLASS|bsh.ParserTokenManager +CLASS|bsh.ParserTreeConstants +CLASS|bsh.Primitive$Special +CLASS|bsh.Primitive +CLASS|bsh.Reflect +CLASS|bsh.ReflectError +CLASS|bsh.ReflectManager +CLASS|bsh.Remote +CLASS|bsh.ReturnControl +CLASS|bsh.SimpleNode$1 +CLASS|bsh.SimpleNode +CLASS|bsh.StringUtil +CLASS|bsh.TargetError +CLASS|bsh.This +CLASS|bsh.Token +CLASS|bsh.TokenMgrError +CLASS|bsh.Types +CLASS|bsh.UtilEvalError +CLASS|bsh.UtilTargetError +CLASS|bsh.Variable +CLASS|bsh.XThis$Handler +CLASS|bsh.XThis +CLASS|bsh.classpath.BshClassLoader +CLASS|bsh.classpath.BshClassPath$AmbiguousName +CLASS|bsh.classpath.BshClassPath$ClassSource +CLASS|bsh.classpath.BshClassPath$DirClassSource +CLASS|bsh.classpath.BshClassPath$GeneratedClassSource +CLASS|bsh.classpath.BshClassPath$JarClassSource +CLASS|bsh.classpath.BshClassPath$MappingFeedback +CLASS|bsh.classpath.BshClassPath$UnqualifiedNameTable +CLASS|bsh.classpath.BshClassPath +CLASS|bsh.classpath.ClassManagerImpl +CLASS|bsh.classpath.ClassPathListener +CLASS|bsh.classpath.DiscreteFilesClassLoader$ClassSourceMap +CLASS|bsh.classpath.DiscreteFilesClassLoader +CLASS|bsh.collection.CollectionIterator +CLASS|bsh.collection.CollectionManagerImpl +CLASS|bsh.commands.dir +CLASS|bsh.org.objectweb.asm.ByteVector +CLASS|bsh.org.objectweb.asm.ClassVisitor +CLASS|bsh.org.objectweb.asm.ClassWriter +CLASS|bsh.org.objectweb.asm.CodeVisitor +CLASS|bsh.org.objectweb.asm.CodeWriter +CLASS|bsh.org.objectweb.asm.Constants +CLASS|bsh.org.objectweb.asm.Edge +CLASS|bsh.org.objectweb.asm.Item +CLASS|bsh.org.objectweb.asm.Label +CLASS|bsh.org.objectweb.asm.Type +CLASS|bsh.reflect.ReflectManagerImpl +CLASS|bsh.servlet.BshServlet +CLASS|bsh.servlet.SimpleTemplate +CLASS|bsh.util.AWTConsole$1 +CLASS|bsh.util.AWTConsole +CLASS|bsh.util.AWTDemoApplet +CLASS|bsh.util.AWTRemoteApplet +CLASS|bsh.util.BeanShellBSFEngine +CLASS|bsh.util.BshCanvas +CLASS|bsh.util.ClassBrowser$1 +CLASS|bsh.util.ClassBrowser$2 +CLASS|bsh.util.ClassBrowser$PackageTree +CLASS|bsh.util.ClassBrowser +CLASS|bsh.util.GUIConsoleInterface +CLASS|bsh.util.Httpd +CLASS|bsh.util.HttpdConnection +CLASS|bsh.util.JConsole$1 +CLASS|bsh.util.JConsole$2 +CLASS|bsh.util.JConsole$3 +CLASS|bsh.util.JConsole$4 +CLASS|bsh.util.JConsole$5 +CLASS|bsh.util.JConsole$BlockingPipedInputStream +CLASS|bsh.util.JConsole +CLASS|bsh.util.JDemoApplet +CLASS|bsh.util.JRemoteApplet +CLASS|bsh.util.NameCompletion +CLASS|bsh.util.NameCompletionTable +CLASS|bsh.util.Sessiond +CLASS|bsh.util.SessiondConnection +CLASS|bsh.util.Util +CLASS|com.beust.testng.TestNG +CLASS|com.beust.testng.TestNGAntTask +CLASS|com.thoughtworks.qdox.JavaDocBuilder$1 +CLASS|com.thoughtworks.qdox.JavaDocBuilder +CLASS|com.thoughtworks.qdox.Searcher +CLASS|com.thoughtworks.qdox.ant.AbstractQdoxTask +CLASS|com.thoughtworks.qdox.directorywalker.DirectoryScanner$1 +CLASS|com.thoughtworks.qdox.directorywalker.DirectoryScanner +CLASS|com.thoughtworks.qdox.directorywalker.FileVisitor +CLASS|com.thoughtworks.qdox.directorywalker.Filter +CLASS|com.thoughtworks.qdox.directorywalker.SuffixFilter +CLASS|com.thoughtworks.qdox.junit.APITestCase$1 +CLASS|com.thoughtworks.qdox.junit.APITestCase +CLASS|com.thoughtworks.qdox.model.AbstractInheritableJavaEntity +CLASS|com.thoughtworks.qdox.model.AbstractJavaEntity +CLASS|com.thoughtworks.qdox.model.BeanProperty +CLASS|com.thoughtworks.qdox.model.ClassLibrary +CLASS|com.thoughtworks.qdox.model.DefaultDocletTag +CLASS|com.thoughtworks.qdox.model.DefaultDocletTagFactory +CLASS|com.thoughtworks.qdox.model.DocletTag +CLASS|com.thoughtworks.qdox.model.DocletTagFactory +CLASS|com.thoughtworks.qdox.model.IndentBuffer +CLASS|com.thoughtworks.qdox.model.JavaClass +CLASS|com.thoughtworks.qdox.model.JavaClassCache +CLASS|com.thoughtworks.qdox.model.JavaClassParent +CLASS|com.thoughtworks.qdox.model.JavaField +CLASS|com.thoughtworks.qdox.model.JavaMethod +CLASS|com.thoughtworks.qdox.model.JavaParameter +CLASS|com.thoughtworks.qdox.model.JavaSource +CLASS|com.thoughtworks.qdox.model.Member +CLASS|com.thoughtworks.qdox.model.ModelBuilder +CLASS|com.thoughtworks.qdox.model.Type +CLASS|com.thoughtworks.qdox.model.util.TagParser +CLASS|com.thoughtworks.qdox.parser.Builder +CLASS|com.thoughtworks.qdox.parser.Lexer +CLASS|com.thoughtworks.qdox.parser.ParseException +CLASS|com.thoughtworks.qdox.parser.impl.JFlexLexer +CLASS|com.thoughtworks.qdox.parser.impl.Parser$1 +CLASS|com.thoughtworks.qdox.parser.impl.Parser$Value +CLASS|com.thoughtworks.qdox.parser.impl.Parser +CLASS|com.thoughtworks.qdox.parser.structs.ClassDef +CLASS|com.thoughtworks.qdox.parser.structs.FieldDef +CLASS|com.thoughtworks.qdox.parser.structs.LocatedDef +CLASS|com.thoughtworks.qdox.parser.structs.MethodDef +CLASS|com.thoughtworks.qdox.parser.structs.TagDef +CLASS|com.thoughtworks.qdox.parser.structs.TypeDef +CLASS|org.testng.Assert +CLASS|org.testng.AssertJUnit +CLASS|org.testng.ClassMethodMap +CLASS|org.testng.IClass +CLASS|org.testng.IExtraOutput +CLASS|org.testng.IHookCallBack +CLASS|org.testng.IHookable +CLASS|org.testng.IInstanceInfo +CLASS|org.testng.IMethodSelector +CLASS|org.testng.IReporter +CLASS|org.testng.IResultMap +CLASS|org.testng.ISuite +CLASS|org.testng.ISuiteListener +CLASS|org.testng.ISuiteResult +CLASS|org.testng.ITest +CLASS|org.testng.ITestClass +CLASS|org.testng.ITestClassFinder +CLASS|org.testng.ITestContext +CLASS|org.testng.ITestListener +CLASS|org.testng.ITestMethodFinder +CLASS|org.testng.ITestNGMethod +CLASS|org.testng.ITestResult +CLASS|org.testng.ITestRunnerFactory +CLASS|org.testng.JUnitConverter +CLASS|org.testng.JUnitConverterTask +CLASS|org.testng.Reporter +CLASS|org.testng.SuiteResult$1 +CLASS|org.testng.SuiteResult +CLASS|org.testng.SuiteRunner$DefaultTestRunnerFactory +CLASS|org.testng.SuiteRunner$ProxyTestRunnerFactory +CLASS|org.testng.SuiteRunner +CLASS|org.testng.TestClass +CLASS|org.testng.TestException +CLASS|org.testng.TestListenerAdapter +CLASS|org.testng.TestNG +CLASS|org.testng.TestNGAntTask +CLASS|org.testng.TestNGCommandLineArgs +CLASS|org.testng.TestNGException +CLASS|org.testng.TestRunner +CLASS|org.testng.annotations.AfterClass +CLASS|org.testng.annotations.AfterGroups +CLASS|org.testng.annotations.AfterMethod +CLASS|org.testng.annotations.AfterSuite +CLASS|org.testng.annotations.AfterTest +CLASS|org.testng.annotations.BeforeClass +CLASS|org.testng.annotations.BeforeGroups +CLASS|org.testng.annotations.BeforeMethod +CLASS|org.testng.annotations.BeforeSuite +CLASS|org.testng.annotations.BeforeTest +CLASS|org.testng.annotations.Configuration +CLASS|org.testng.annotations.DataProvider +CLASS|org.testng.annotations.ExpectedExceptions +CLASS|org.testng.annotations.Factory +CLASS|org.testng.annotations.Parameters +CLASS|org.testng.annotations.Test +CLASS|org.testng.internal.ArrayIterator +CLASS|org.testng.internal.BaseClassFinder +CLASS|org.testng.internal.BaseTestMethod$1 +CLASS|org.testng.internal.BaseTestMethod +CLASS|org.testng.internal.ClassHelper +CLASS|org.testng.internal.ClassImpl +CLASS|org.testng.internal.ConfigurationGroupMethods +CLASS|org.testng.internal.ConfigurationMethod +CLASS|org.testng.internal.Constants +CLASS|org.testng.internal.ExtraOutput +CLASS|org.testng.internal.FactoryMethod +CLASS|org.testng.internal.Graph$Node +CLASS|org.testng.internal.Graph +CLASS|org.testng.internal.HostFile +CLASS|org.testng.internal.IInvoker +CLASS|org.testng.internal.ITestResultNotifier +CLASS|org.testng.internal.InstanceInfo +CLASS|org.testng.internal.InvokeMethodRunnable$TestNGRuntimeException +CLASS|org.testng.internal.InvokeMethodRunnable +CLASS|org.testng.internal.InvokedMethod +CLASS|org.testng.internal.Invoker$1 +CLASS|org.testng.internal.Invoker +CLASS|org.testng.internal.JUnitUtils +CLASS|org.testng.internal.MethodHelper +CLASS|org.testng.internal.MethodInheritance +CLASS|org.testng.internal.MethodSelectorDescriptor +CLASS|org.testng.internal.PackageUtils$1 +CLASS|org.testng.internal.PackageUtils +CLASS|org.testng.internal.Parameters +CLASS|org.testng.internal.ResultMap +CLASS|org.testng.internal.RunInfo +CLASS|org.testng.internal.TestMethodWorker +CLASS|org.testng.internal.TestNGClassFinder +CLASS|org.testng.internal.TestNGMethod$1 +CLASS|org.testng.internal.TestNGMethod +CLASS|org.testng.internal.TestNGMethodFinder +CLASS|org.testng.internal.TestNGProperty +CLASS|org.testng.internal.TestResult +CLASS|org.testng.internal.Utils +CLASS|org.testng.internal.XmlMethodSelector +CLASS|org.testng.internal.annotations.AfterSuiteAnnotation +CLASS|org.testng.internal.annotations.AnnotationConfiguration +CLASS|org.testng.internal.annotations.AnnotationHelper +CLASS|org.testng.internal.annotations.BaseBeforeAfter +CLASS|org.testng.internal.annotations.BeforeSuiteAnnotation +CLASS|org.testng.internal.annotations.ConfigurationAnnotation +CLASS|org.testng.internal.annotations.Converter +CLASS|org.testng.internal.annotations.DataProviderAnnotation +CLASS|org.testng.internal.annotations.ExpectedExceptionsAnnotation +CLASS|org.testng.internal.annotations.FactoryAnnotation +CLASS|org.testng.internal.annotations.IAfterClass +CLASS|org.testng.internal.annotations.IAfterGroups +CLASS|org.testng.internal.annotations.IAfterMethod +CLASS|org.testng.internal.annotations.IAfterSuite +CLASS|org.testng.internal.annotations.IAfterTest +CLASS|org.testng.internal.annotations.IAfterTests +CLASS|org.testng.internal.annotations.IAnnotation +CLASS|org.testng.internal.annotations.IAnnotationFinder +CLASS|org.testng.internal.annotations.IBaseBeforeAfter +CLASS|org.testng.internal.annotations.IBeforeClass +CLASS|org.testng.internal.annotations.IBeforeGroups +CLASS|org.testng.internal.annotations.IBeforeMethod +CLASS|org.testng.internal.annotations.IBeforeSuite +CLASS|org.testng.internal.annotations.IBeforeTest +CLASS|org.testng.internal.annotations.IConfiguration +CLASS|org.testng.internal.annotations.IDataProvider +CLASS|org.testng.internal.annotations.IExpectedExceptions +CLASS|org.testng.internal.annotations.IFactory +CLASS|org.testng.internal.annotations.IParameterizable +CLASS|org.testng.internal.annotations.IParameters +CLASS|org.testng.internal.annotations.ITest +CLASS|org.testng.internal.annotations.ITestOrConfiguration +CLASS|org.testng.internal.annotations.JDK14AnnotationFinder$1 +CLASS|org.testng.internal.annotations.JDK14AnnotationFinder +CLASS|org.testng.internal.annotations.JDK14TagFactory +CLASS|org.testng.internal.annotations.JDK15AnnotationFinder +CLASS|org.testng.internal.annotations.JDK15TagFactory +CLASS|org.testng.internal.annotations.ParametersAnnotation +CLASS|org.testng.internal.annotations.TestAnnotation +CLASS|org.testng.internal.annotations.TestOrConfiguration +CLASS|org.testng.internal.remote.SlavePool +CLASS|org.testng.internal.thread.CountDownAdapter +CLASS|org.testng.internal.thread.ExecutorAdapter +CLASS|org.testng.internal.thread.FutureResultAdapter +CLASS|org.testng.internal.thread.ICountDown +CLASS|org.testng.internal.thread.IExecutor +CLASS|org.testng.internal.thread.IFutureResult +CLASS|org.testng.internal.thread.IPooledExecutor +CLASS|org.testng.internal.thread.IThreadFactory +CLASS|org.testng.internal.thread.PooledExecutorAdapter +CLASS|org.testng.internal.thread.TestNGThread +CLASS|org.testng.internal.thread.ThreadExecutionException +CLASS|org.testng.internal.thread.ThreadTimeoutException +CLASS|org.testng.internal.thread.ThreadUtil$ThreadFactoryImpl +CLASS|org.testng.internal.thread.ThreadUtil +CLASS|org.testng.junit.INameFilter +CLASS|org.testng.junit.JUnitClassFinder +CLASS|org.testng.junit.JUnitDirectoryConverter +CLASS|org.testng.junit.JUnitMethodFinder$1 +CLASS|org.testng.junit.JUnitMethodFinder$2 +CLASS|org.testng.junit.JUnitMethodFinder$3 +CLASS|org.testng.junit.JUnitMethodFinder +CLASS|org.testng.junit.JUnitTestConverter +CLASS|org.testng.log.TextFormatter +CLASS|org.testng.log4testng.Logger +CLASS|org.testng.remote.ConnectionInfo +CLASS|org.testng.remote.RemoteSuiteWorker +CLASS|org.testng.remote.RemoteTestWorker +CLASS|org.testng.remote.RemoteWorker +CLASS|org.testng.remote.strprotocol.AbstractRemoteTestRunnerClient$ServerConnection +CLASS|org.testng.remote.strprotocol.AbstractRemoteTestRunnerClient +CLASS|org.testng.remote.strprotocol.GenericMessage +CLASS|org.testng.remote.strprotocol.IMessage +CLASS|org.testng.remote.strprotocol.IRemoteSuiteListener +CLASS|org.testng.remote.strprotocol.IRemoteTestListener +CLASS|org.testng.remote.strprotocol.IStringMessage +CLASS|org.testng.remote.strprotocol.MessageHelper +CLASS|org.testng.remote.strprotocol.RemoteMessageSenderTestListener +CLASS|org.testng.remote.strprotocol.StringMessageSenderHelper$ReaderThread +CLASS|org.testng.remote.strprotocol.StringMessageSenderHelper +CLASS|org.testng.remote.strprotocol.SuiteMessage +CLASS|org.testng.remote.strprotocol.TestMessage +CLASS|org.testng.remote.strprotocol.TestResultMessage +CLASS|org.testng.reporters.DotTestListener +CLASS|org.testng.reporters.ExitCodeListener +CLASS|org.testng.reporters.FailedReporter +CLASS|org.testng.reporters.HtmlHelper +CLASS|org.testng.reporters.JUnitXMLReporter +CLASS|org.testng.reporters.SuiteHTMLReporter$1 +CLASS|org.testng.reporters.SuiteHTMLReporter +CLASS|org.testng.reporters.Tag +CLASS|org.testng.reporters.TestHTMLReporter$1 +CLASS|org.testng.reporters.TestHTMLReporter +CLASS|org.testng.reporters.TextReporter +CLASS|org.testng.reporters.XMLConstants +CLASS|org.testng.reporters.XMLReporter +CLASS|org.testng.reporters.XMLStringBuffer +CLASS|org.testng.reporters.XMLUtils +CLASS|org.testng.xml.ClassSuite +CLASS|org.testng.xml.LaunchSuite$1 +CLASS|org.testng.xml.LaunchSuite$ClassListSuite +CLASS|org.testng.xml.LaunchSuite$CustomizedSuite +CLASS|org.testng.xml.LaunchSuite$ExistingSuite +CLASS|org.testng.xml.LaunchSuite$MethodsSuite +CLASS|org.testng.xml.LaunchSuite +CLASS|org.testng.xml.Parser +CLASS|org.testng.xml.SuiteGenerator +CLASS|org.testng.xml.TestNGContentHandler +CLASS|org.testng.xml.XmlClass +CLASS|org.testng.xml.XmlMethodSelector +CLASS|org.testng.xml.XmlPackage +CLASS|org.testng.xml.XmlSuite +CLASS|org.testng.xml.XmlTest +METHOD|bsh.BSHAllocationExpression.(I)V +METHOD|bsh.BSHAllocationExpression.eval(Lbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Object; +METHOD|bsh.BSHAllocationExpression.objectAllocation(Lbsh/BSHAmbiguousName;Lbsh/BSHArguments;Lbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Object; +METHOD|bsh.BSHAllocationExpression.constructObject(Ljava/lang/Class;[Ljava/lang/Object;Lbsh/CallStack;)Ljava/lang/Object; +METHOD|bsh.BSHAllocationExpression.constructWithClassBody(Ljava/lang/Class;[Ljava/lang/Object;Lbsh/BSHBlock;Lbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Object; +METHOD|bsh.BSHAllocationExpression.constructWithInterfaceBody(Ljava/lang/Class;[Ljava/lang/Object;Lbsh/BSHBlock;Lbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Object; +METHOD|bsh.BSHAllocationExpression.objectArrayAllocation(Lbsh/BSHAmbiguousName;Lbsh/BSHArrayDimensions;Lbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Object; +METHOD|bsh.BSHAllocationExpression.primitiveArrayAllocation(Lbsh/BSHPrimitiveType;Lbsh/BSHArrayDimensions;Lbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Object; +METHOD|bsh.BSHAllocationExpression.arrayAllocation(Lbsh/BSHArrayDimensions;Ljava/lang/Class;Lbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Object; +METHOD|bsh.BSHAllocationExpression.arrayNewInstance(Ljava/lang/Class;Lbsh/BSHArrayDimensions;Lbsh/CallStack;)Ljava/lang/Object; +METHOD|bsh.BSHAllocationExpression.()V +METHOD|bsh.BSHAmbiguousName.(I)V +METHOD|bsh.BSHAmbiguousName.getName(Lbsh/NameSpace;)Lbsh/Name; +METHOD|bsh.BSHAmbiguousName.toObject(Lbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Object; +METHOD|bsh.BSHAmbiguousName.toObject(Lbsh/CallStack;Lbsh/Interpreter;Z)Ljava/lang/Object; +METHOD|bsh.BSHAmbiguousName.toClass(Lbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Class; +METHOD|bsh.BSHAmbiguousName.toLHS(Lbsh/CallStack;Lbsh/Interpreter;)Lbsh/LHS; +METHOD|bsh.BSHAmbiguousName.eval(Lbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Object; +METHOD|bsh.BSHAmbiguousName.toString()Ljava/lang/String; +METHOD|bsh.BSHArguments.(I)V +METHOD|bsh.BSHArguments.getArguments(Lbsh/CallStack;Lbsh/Interpreter;)[Ljava/lang/Object; +METHOD|bsh.BSHArrayDimensions.(I)V +METHOD|bsh.BSHArrayDimensions.addDefinedDimension()V +METHOD|bsh.BSHArrayDimensions.addUndefinedDimension()V +METHOD|bsh.BSHArrayDimensions.eval(Ljava/lang/Class;Lbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Object; +METHOD|bsh.BSHArrayDimensions.eval(Lbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Object; +METHOD|bsh.BSHArrayInitializer.(I)V +METHOD|bsh.BSHArrayInitializer.eval(Lbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Object; +METHOD|bsh.BSHArrayInitializer.eval(Ljava/lang/Class;ILbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Object; +METHOD|bsh.BSHArrayInitializer.throwTypeError(Ljava/lang/Class;Ljava/lang/Object;ILbsh/CallStack;)V +METHOD|bsh.BSHAssignment.(I)V +METHOD|bsh.BSHAssignment.eval(Lbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Object; +METHOD|bsh.BSHAssignment.operation(Ljava/lang/Object;Ljava/lang/Object;I)Ljava/lang/Object; +METHOD|bsh.BSHBinaryExpression.(I)V +METHOD|bsh.BSHBinaryExpression.eval(Lbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Object; +METHOD|bsh.BSHBinaryExpression.isPrimitiveValue(Ljava/lang/Object;)Z +METHOD|bsh.BSHBinaryExpression.isWrapper(Ljava/lang/Object;)Z +METHOD|bsh.BSHBinaryExpression.class$(Ljava/lang/String;)Ljava/lang/Class; +METHOD|bsh.BSHBlock$NodeFilter.isVisible(Lbsh/SimpleNode;)Z +METHOD|bsh.BSHBlock.(I)V +METHOD|bsh.BSHBlock.eval(Lbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Object; +METHOD|bsh.BSHBlock.eval(Lbsh/CallStack;Lbsh/Interpreter;Z)Ljava/lang/Object; +METHOD|bsh.BSHBlock.evalBlock(Lbsh/CallStack;Lbsh/Interpreter;ZLbsh/BSHBlock$NodeFilter;)Ljava/lang/Object; +METHOD|bsh.BSHCastExpression.(I)V +METHOD|bsh.BSHCastExpression.eval(Lbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Object; +METHOD|bsh.BSHClassDeclaration.(I)V +METHOD|bsh.BSHClassDeclaration.eval(Lbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Object; +METHOD|bsh.BSHClassDeclaration.toString()Ljava/lang/String; +METHOD|bsh.BSHEnhancedForStatement.(I)V +METHOD|bsh.BSHEnhancedForStatement.eval(Lbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Object; +METHOD|bsh.BSHForStatement.(I)V +METHOD|bsh.BSHForStatement.eval(Lbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Object; +METHOD|bsh.BSHFormalComment.(I)V +METHOD|bsh.BSHFormalParameter.(I)V +METHOD|bsh.BSHFormalParameter.getTypeDescriptor(Lbsh/CallStack;Lbsh/Interpreter;Ljava/lang/String;)Ljava/lang/String; +METHOD|bsh.BSHFormalParameter.eval(Lbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Object; +METHOD|bsh.BSHFormalParameter.()V +METHOD|bsh.BSHFormalParameters.(I)V +METHOD|bsh.BSHFormalParameters.insureParsed()V +METHOD|bsh.BSHFormalParameters.getParamNames()[Ljava/lang/String; +METHOD|bsh.BSHFormalParameters.getTypeDescriptors(Lbsh/CallStack;Lbsh/Interpreter;Ljava/lang/String;)[Ljava/lang/String; +METHOD|bsh.BSHFormalParameters.eval(Lbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Object; +METHOD|bsh.BSHIfStatement.(I)V +METHOD|bsh.BSHIfStatement.eval(Lbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Object; +METHOD|bsh.BSHIfStatement.evaluateCondition(Lbsh/SimpleNode;Lbsh/CallStack;Lbsh/Interpreter;)Z +METHOD|bsh.BSHImportDeclaration.(I)V +METHOD|bsh.BSHImportDeclaration.eval(Lbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Object; +METHOD|bsh.BSHLiteral.(I)V +METHOD|bsh.BSHLiteral.eval(Lbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Object; +METHOD|bsh.BSHLiteral.getEscapeChar(C)C +METHOD|bsh.BSHLiteral.charSetup(Ljava/lang/String;)V +METHOD|bsh.BSHLiteral.stringSetup(Ljava/lang/String;)V +METHOD|bsh.BSHMethodDeclaration.(I)V +METHOD|bsh.BSHMethodDeclaration.insureNodesParsed()V +METHOD|bsh.BSHMethodDeclaration.evalReturnType(Lbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Class; +METHOD|bsh.BSHMethodDeclaration.getReturnTypeDescriptor(Lbsh/CallStack;Lbsh/Interpreter;Ljava/lang/String;)Ljava/lang/String; +METHOD|bsh.BSHMethodDeclaration.getReturnTypeNode()Lbsh/BSHReturnType; +METHOD|bsh.BSHMethodDeclaration.eval(Lbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Object; +METHOD|bsh.BSHMethodDeclaration.evalNodes(Lbsh/CallStack;Lbsh/Interpreter;)V +METHOD|bsh.BSHMethodDeclaration.toString()Ljava/lang/String; +METHOD|bsh.BSHMethodInvocation.(I)V +METHOD|bsh.BSHMethodInvocation.getNameNode()Lbsh/BSHAmbiguousName; +METHOD|bsh.BSHMethodInvocation.getArgsNode()Lbsh/BSHArguments; +METHOD|bsh.BSHMethodInvocation.eval(Lbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Object; +METHOD|bsh.BSHPackageDeclaration.(I)V +METHOD|bsh.BSHPackageDeclaration.eval(Lbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Object; +METHOD|bsh.BSHPrimaryExpression.(I)V +METHOD|bsh.BSHPrimaryExpression.eval(Lbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Object; +METHOD|bsh.BSHPrimaryExpression.toLHS(Lbsh/CallStack;Lbsh/Interpreter;)Lbsh/LHS; +METHOD|bsh.BSHPrimaryExpression.eval(ZLbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Object; +METHOD|bsh.BSHPrimarySuffix.(I)V +METHOD|bsh.BSHPrimarySuffix.doSuffix(Ljava/lang/Object;ZLbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Object; +METHOD|bsh.BSHPrimarySuffix.doName(Ljava/lang/Object;ZLbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Object; +METHOD|bsh.BSHPrimarySuffix.getIndexAux(Ljava/lang/Object;Lbsh/CallStack;Lbsh/Interpreter;Lbsh/SimpleNode;)I +METHOD|bsh.BSHPrimarySuffix.doIndex(Ljava/lang/Object;ZLbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Object; +METHOD|bsh.BSHPrimarySuffix.doProperty(ZLjava/lang/Object;Lbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Object; +METHOD|bsh.BSHPrimitiveType.(I)V +METHOD|bsh.BSHPrimitiveType.getType()Ljava/lang/Class; +METHOD|bsh.BSHReturnStatement.(I)V +METHOD|bsh.BSHReturnStatement.eval(Lbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Object; +METHOD|bsh.BSHReturnType.(I)V +METHOD|bsh.BSHReturnType.getTypeNode()Lbsh/BSHType; +METHOD|bsh.BSHReturnType.getTypeDescriptor(Lbsh/CallStack;Lbsh/Interpreter;Ljava/lang/String;)Ljava/lang/String; +METHOD|bsh.BSHReturnType.evalReturnType(Lbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Class; +METHOD|bsh.BSHStatementExpressionList.(I)V +METHOD|bsh.BSHStatementExpressionList.eval(Lbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Object; +METHOD|bsh.BSHSwitchLabel.(I)V +METHOD|bsh.BSHSwitchLabel.eval(Lbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Object; +METHOD|bsh.BSHSwitchStatement.(I)V +METHOD|bsh.BSHSwitchStatement.eval(Lbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Object; +METHOD|bsh.BSHSwitchStatement.primitiveEquals(Ljava/lang/Object;Ljava/lang/Object;Lbsh/CallStack;Lbsh/SimpleNode;)Z +METHOD|bsh.BSHTernaryExpression.(I)V +METHOD|bsh.BSHTernaryExpression.eval(Lbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Object; +METHOD|bsh.BSHThrowStatement.(I)V +METHOD|bsh.BSHThrowStatement.eval(Lbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Object; +METHOD|bsh.BSHTryStatement.(I)V +METHOD|bsh.BSHTryStatement.eval(Lbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Object; +METHOD|bsh.BSHType.(I)V +METHOD|bsh.BSHType.addArrayDimension()V +METHOD|bsh.BSHType.getTypeNode()Lbsh/SimpleNode; +METHOD|bsh.BSHType.getTypeDescriptor(Lbsh/CallStack;Lbsh/Interpreter;Ljava/lang/String;)Ljava/lang/String; +METHOD|bsh.BSHType.getType(Lbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Class; +METHOD|bsh.BSHType.getBaseType()Ljava/lang/Class; +METHOD|bsh.BSHType.getArrayDims()I +METHOD|bsh.BSHType.classLoaderChanged()V +METHOD|bsh.BSHType.getTypeDescriptor(Ljava/lang/Class;)Ljava/lang/String; +METHOD|bsh.BSHTypedVariableDeclaration.(I)V +METHOD|bsh.BSHTypedVariableDeclaration.getTypeNode()Lbsh/BSHType; +METHOD|bsh.BSHTypedVariableDeclaration.evalType(Lbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Class; +METHOD|bsh.BSHTypedVariableDeclaration.getDeclarators()[Lbsh/BSHVariableDeclarator; +METHOD|bsh.BSHTypedVariableDeclaration.eval(Lbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Object; +METHOD|bsh.BSHTypedVariableDeclaration.getTypeDescriptor(Lbsh/CallStack;Lbsh/Interpreter;Ljava/lang/String;)Ljava/lang/String; +METHOD|bsh.BSHUnaryExpression.(I)V +METHOD|bsh.BSHUnaryExpression.eval(Lbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Object; +METHOD|bsh.BSHUnaryExpression.lhsUnaryOperation(Lbsh/LHS;Z)Ljava/lang/Object; +METHOD|bsh.BSHUnaryExpression.unaryOperation(Ljava/lang/Object;I)Ljava/lang/Object; +METHOD|bsh.BSHUnaryExpression.primitiveWrapperUnaryOperation(Ljava/lang/Object;I)Ljava/lang/Object; +METHOD|bsh.BSHVariableDeclarator.(I)V +METHOD|bsh.BSHVariableDeclarator.eval(Lbsh/BSHType;Lbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Object; +METHOD|bsh.BSHVariableDeclarator.toString()Ljava/lang/String; +METHOD|bsh.BSHWhileStatement.(I)V +METHOD|bsh.BSHWhileStatement.eval(Lbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Object; +METHOD|bsh.BlockNameSpace.(Lbsh/NameSpace;)V +METHOD|bsh.BlockNameSpace.setVariable(Ljava/lang/String;Ljava/lang/Object;ZZ)V +METHOD|bsh.BlockNameSpace.setBlockVariable(Ljava/lang/String;Ljava/lang/Object;)V +METHOD|bsh.BlockNameSpace.weHaveVar(Ljava/lang/String;)Z +METHOD|bsh.BlockNameSpace.getNonBlockParent()Lbsh/NameSpace; +METHOD|bsh.BlockNameSpace.getThis(Lbsh/Interpreter;)Lbsh/This; +METHOD|bsh.BlockNameSpace.getSuper(Lbsh/Interpreter;)Lbsh/This; +METHOD|bsh.BlockNameSpace.importClass(Ljava/lang/String;)V +METHOD|bsh.BlockNameSpace.importPackage(Ljava/lang/String;)V +METHOD|bsh.BlockNameSpace.setMethod(Ljava/lang/String;Lbsh/BshMethod;)V +METHOD|bsh.BshClassManager$Listener.classLoaderChanged()V +METHOD|bsh.BshClassManager$SignatureKey.(Ljava/lang/Class;Ljava/lang/String;[Ljava/lang/Class;)V +METHOD|bsh.BshClassManager$SignatureKey.hashCode()I +METHOD|bsh.BshClassManager$SignatureKey.equals(Ljava/lang/Object;)Z +METHOD|bsh.BshClassManager.()V +METHOD|bsh.BshClassManager.createClassManager(Lbsh/Interpreter;)Lbsh/BshClassManager; +METHOD|bsh.BshClassManager.classExists(Ljava/lang/String;)Z +METHOD|bsh.BshClassManager.classForName(Ljava/lang/String;)Ljava/lang/Class; +METHOD|bsh.BshClassManager.loadSourceClass(Ljava/lang/String;)Ljava/lang/Class; +METHOD|bsh.BshClassManager.plainClassForName(Ljava/lang/String;)Ljava/lang/Class; +METHOD|bsh.BshClassManager.getResource(Ljava/lang/String;)Ljava/net/URL; +METHOD|bsh.BshClassManager.getResourceAsStream(Ljava/lang/String;)Ljava/io/InputStream; +METHOD|bsh.BshClassManager.cacheClassInfo(Ljava/lang/String;Ljava/lang/Class;)V +METHOD|bsh.BshClassManager.cacheResolvedMethod(Ljava/lang/Class;[Ljava/lang/Class;Ljava/lang/reflect/Method;)V +METHOD|bsh.BshClassManager.getResolvedMethod(Ljava/lang/Class;Ljava/lang/String;[Ljava/lang/Class;Z)Ljava/lang/reflect/Method; +METHOD|bsh.BshClassManager.clearCaches()V +METHOD|bsh.BshClassManager.setClassLoader(Ljava/lang/ClassLoader;)V +METHOD|bsh.BshClassManager.addClassPath(Ljava/net/URL;)V +METHOD|bsh.BshClassManager.reset()V +METHOD|bsh.BshClassManager.setClassPath([Ljava/net/URL;)V +METHOD|bsh.BshClassManager.reloadAllClasses()V +METHOD|bsh.BshClassManager.reloadClasses([Ljava/lang/String;)V +METHOD|bsh.BshClassManager.reloadPackage(Ljava/lang/String;)V +METHOD|bsh.BshClassManager.doSuperImport()V +METHOD|bsh.BshClassManager.hasSuperImport()Z +METHOD|bsh.BshClassManager.getClassNameByUnqName(Ljava/lang/String;)Ljava/lang/String; +METHOD|bsh.BshClassManager.addListener(Lbsh/BshClassManager$Listener;)V +METHOD|bsh.BshClassManager.removeListener(Lbsh/BshClassManager$Listener;)V +METHOD|bsh.BshClassManager.dump(Ljava/io/PrintWriter;)V +METHOD|bsh.BshClassManager.definingClass(Ljava/lang/String;)V +METHOD|bsh.BshClassManager.isClassBeingDefined(Ljava/lang/String;)Z +METHOD|bsh.BshClassManager.getClassBeingDefined(Ljava/lang/String;)Ljava/lang/String; +METHOD|bsh.BshClassManager.doneDefiningClass(Ljava/lang/String;)V +METHOD|bsh.BshClassManager.defineClass(Ljava/lang/String;[B)Ljava/lang/Class; +METHOD|bsh.BshClassManager.classLoaderChanged()V +METHOD|bsh.BshClassManager.noClassDefFound(Ljava/lang/String;Ljava/lang/Error;)Ljava/lang/Error; +METHOD|bsh.BshClassManager.cmUnavailable()Lbsh/UtilEvalError; +METHOD|bsh.BshClassManager.class$(Ljava/lang/String;)Ljava/lang/Class; +METHOD|bsh.BshClassManager.()V +METHOD|bsh.BshIterator.next()Ljava/lang/Object; +METHOD|bsh.BshIterator.hasNext()Z +METHOD|bsh.BshMethod.(Lbsh/BSHMethodDeclaration;Lbsh/NameSpace;Lbsh/Modifiers;)V +METHOD|bsh.BshMethod.(Ljava/lang/String;Ljava/lang/Class;[Ljava/lang/String;[Ljava/lang/Class;Lbsh/BSHBlock;Lbsh/NameSpace;Lbsh/Modifiers;)V +METHOD|bsh.BshMethod.(Ljava/lang/reflect/Method;Ljava/lang/Object;)V +METHOD|bsh.BshMethod.getParameterTypes()[Ljava/lang/Class; +METHOD|bsh.BshMethod.getParameterNames()[Ljava/lang/String; +METHOD|bsh.BshMethod.getReturnType()Ljava/lang/Class; +METHOD|bsh.BshMethod.getModifiers()Lbsh/Modifiers; +METHOD|bsh.BshMethod.getName()Ljava/lang/String; +METHOD|bsh.BshMethod.invoke([Ljava/lang/Object;Lbsh/Interpreter;)Ljava/lang/Object; +METHOD|bsh.BshMethod.invoke([Ljava/lang/Object;Lbsh/Interpreter;Lbsh/CallStack;Lbsh/SimpleNode;)Ljava/lang/Object; +METHOD|bsh.BshMethod.invoke([Ljava/lang/Object;Lbsh/Interpreter;Lbsh/CallStack;Lbsh/SimpleNode;Z)Ljava/lang/Object; +METHOD|bsh.BshMethod.invokeImpl([Ljava/lang/Object;Lbsh/Interpreter;Lbsh/CallStack;Lbsh/SimpleNode;Z)Ljava/lang/Object; +METHOD|bsh.BshMethod.hasModifier(Ljava/lang/String;)Z +METHOD|bsh.BshMethod.toString()Ljava/lang/String; +METHOD|bsh.CallStack.()V +METHOD|bsh.CallStack.(Lbsh/NameSpace;)V +METHOD|bsh.CallStack.clear()V +METHOD|bsh.CallStack.push(Lbsh/NameSpace;)V +METHOD|bsh.CallStack.top()Lbsh/NameSpace; +METHOD|bsh.CallStack.get(I)Lbsh/NameSpace; +METHOD|bsh.CallStack.set(ILbsh/NameSpace;)V +METHOD|bsh.CallStack.pop()Lbsh/NameSpace; +METHOD|bsh.CallStack.swap(Lbsh/NameSpace;)Lbsh/NameSpace; +METHOD|bsh.CallStack.depth()I +METHOD|bsh.CallStack.toArray()[Lbsh/NameSpace; +METHOD|bsh.CallStack.toString()Ljava/lang/String; +METHOD|bsh.CallStack.copy()Lbsh/CallStack; +METHOD|bsh.Capabilities$Unavailable.(Ljava/lang/String;)V +METHOD|bsh.Capabilities.()V +METHOD|bsh.Capabilities.haveSwing()Z +METHOD|bsh.Capabilities.canGenerateInterfaces()Z +METHOD|bsh.Capabilities.haveAccessibility()Z +METHOD|bsh.Capabilities.setAccessibility(Z)V +METHOD|bsh.Capabilities.classExists(Ljava/lang/String;)Z +METHOD|bsh.Capabilities.class$(Ljava/lang/String;)Ljava/lang/Class; +METHOD|bsh.Capabilities.()V +METHOD|bsh.ClassGenerator.()V +METHOD|bsh.ClassGenerator.getClassGenerator()Lbsh/ClassGenerator; +METHOD|bsh.ClassGenerator.generateClass(Ljava/lang/String;Lbsh/Modifiers;[Ljava/lang/Class;Ljava/lang/Class;Lbsh/BSHBlock;ZLbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Class; +METHOD|bsh.ClassGenerator.invokeSuperclassMethod(Lbsh/BshClassManager;Ljava/lang/Object;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/Object; +METHOD|bsh.ClassGenerator.setInstanceNameSpaceParent(Ljava/lang/Object;Ljava/lang/String;Lbsh/NameSpace;)V +METHOD|bsh.ClassGeneratorImpl$ClassNodeFilter.(I)V +METHOD|bsh.ClassGeneratorImpl$ClassNodeFilter.isVisible(Lbsh/SimpleNode;)Z +METHOD|bsh.ClassGeneratorImpl$ClassNodeFilter.isStatic(Lbsh/SimpleNode;)Z +METHOD|bsh.ClassGeneratorImpl$ClassNodeFilter.()V +METHOD|bsh.ClassGeneratorImpl.()V +METHOD|bsh.ClassGeneratorImpl.generateClass(Ljava/lang/String;Lbsh/Modifiers;[Ljava/lang/Class;Ljava/lang/Class;Lbsh/BSHBlock;ZLbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Class; +METHOD|bsh.ClassGeneratorImpl.invokeSuperclassMethod(Lbsh/BshClassManager;Ljava/lang/Object;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/Object; +METHOD|bsh.ClassGeneratorImpl.setInstanceNameSpaceParent(Ljava/lang/Object;Ljava/lang/String;Lbsh/NameSpace;)V +METHOD|bsh.ClassGeneratorImpl.generateClassImpl(Ljava/lang/String;Lbsh/Modifiers;[Ljava/lang/Class;Ljava/lang/Class;Lbsh/BSHBlock;ZLbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Class; +METHOD|bsh.ClassGeneratorImpl.getDeclaredVariables(Lbsh/BSHBlock;Lbsh/CallStack;Lbsh/Interpreter;Ljava/lang/String;)[Lbsh/Variable; +METHOD|bsh.ClassGeneratorImpl.getDeclaredMethods(Lbsh/BSHBlock;Lbsh/CallStack;Lbsh/Interpreter;Ljava/lang/String;)[Lbsh/DelayedEvalBshMethod; +METHOD|bsh.ClassGeneratorImpl.invokeSuperclassMethodImpl(Lbsh/BshClassManager;Ljava/lang/Object;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/Object; +METHOD|bsh.ClassGeneratorUtil$ConstructorArgs.()V +METHOD|bsh.ClassGeneratorUtil$ConstructorArgs.(I[Ljava/lang/Object;)V +METHOD|bsh.ClassGeneratorUtil$ConstructorArgs.next()Ljava/lang/Object; +METHOD|bsh.ClassGeneratorUtil$ConstructorArgs.getBoolean()Z +METHOD|bsh.ClassGeneratorUtil$ConstructorArgs.getByte()B +METHOD|bsh.ClassGeneratorUtil$ConstructorArgs.getChar()C +METHOD|bsh.ClassGeneratorUtil$ConstructorArgs.getShort()S +METHOD|bsh.ClassGeneratorUtil$ConstructorArgs.getInt()I +METHOD|bsh.ClassGeneratorUtil$ConstructorArgs.getLong()J +METHOD|bsh.ClassGeneratorUtil$ConstructorArgs.getDouble()D +METHOD|bsh.ClassGeneratorUtil$ConstructorArgs.getFloat()F +METHOD|bsh.ClassGeneratorUtil$ConstructorArgs.getObject()Ljava/lang/Object; +METHOD|bsh.ClassGeneratorUtil$ConstructorArgs.()V +METHOD|bsh.ClassGeneratorUtil.(Lbsh/Modifiers;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Class;[Ljava/lang/Class;[Lbsh/Variable;[Lbsh/DelayedEvalBshMethod;Lbsh/NameSpace;Z)V +METHOD|bsh.ClassGeneratorUtil.generateClass()[B +METHOD|bsh.ClassGeneratorUtil.getASMModifiers(Lbsh/Modifiers;)I +METHOD|bsh.ClassGeneratorUtil.generateField(Ljava/lang/String;Ljava/lang/String;ILbsh/org/objectweb/asm/ClassWriter;)V +METHOD|bsh.ClassGeneratorUtil.generateMethod(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;ILbsh/org/objectweb/asm/ClassWriter;)V +METHOD|bsh.ClassGeneratorUtil.generateConstructor(I[Ljava/lang/String;ILbsh/org/objectweb/asm/ClassWriter;)V +METHOD|bsh.ClassGeneratorUtil.generateConstructorSwitch(IIILbsh/org/objectweb/asm/CodeVisitor;)V +METHOD|bsh.ClassGeneratorUtil.doSwitchBranch(ILjava/lang/String;[Ljava/lang/String;Lbsh/org/objectweb/asm/Label;[Lbsh/org/objectweb/asm/Label;ILbsh/org/objectweb/asm/CodeVisitor;)V +METHOD|bsh.ClassGeneratorUtil.getMethodDescriptor(Ljava/lang/String;[Ljava/lang/String;)Ljava/lang/String; +METHOD|bsh.ClassGeneratorUtil.generateSuperDelegateMethod(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;ILbsh/org/objectweb/asm/ClassWriter;)V +METHOD|bsh.ClassGeneratorUtil.classContainsMethod(Ljava/lang/Class;Ljava/lang/String;[Ljava/lang/String;)Z +METHOD|bsh.ClassGeneratorUtil.generatePlainReturnCode(Ljava/lang/String;Lbsh/org/objectweb/asm/CodeVisitor;)V +METHOD|bsh.ClassGeneratorUtil.generateParameterReifierCode([Ljava/lang/String;ZLbsh/org/objectweb/asm/CodeVisitor;)V +METHOD|bsh.ClassGeneratorUtil.generateReturnCode(Ljava/lang/String;Lbsh/org/objectweb/asm/CodeVisitor;)V +METHOD|bsh.ClassGeneratorUtil.getConstructorArgs(Ljava/lang/String;Lbsh/This;[Ljava/lang/Object;I)Lbsh/ClassGeneratorUtil$ConstructorArgs; +METHOD|bsh.ClassGeneratorUtil.initInstance(Ljava/lang/Object;Ljava/lang/String;[Ljava/lang/Object;)V +METHOD|bsh.ClassGeneratorUtil.getClassStaticThis(Ljava/lang/Class;Ljava/lang/String;)Lbsh/This; +METHOD|bsh.ClassGeneratorUtil.getClassInstanceThis(Ljava/lang/Object;Ljava/lang/String;)Lbsh/This; +METHOD|bsh.ClassGeneratorUtil.isPrimitive(Ljava/lang/String;)Z +METHOD|bsh.ClassGeneratorUtil.getTypeDescriptors([Ljava/lang/Class;)[Ljava/lang/String; +METHOD|bsh.ClassGeneratorUtil.descriptorToClassName(Ljava/lang/String;)Ljava/lang/String; +METHOD|bsh.ClassGeneratorUtil.getBaseName(Ljava/lang/String;)Ljava/lang/String; +METHOD|bsh.ClassGeneratorUtil.class$(Ljava/lang/String;)Ljava/lang/Class; +METHOD|bsh.ClassIdentifier.(Ljava/lang/Class;)V +METHOD|bsh.ClassIdentifier.getTargetClass()Ljava/lang/Class; +METHOD|bsh.ClassIdentifier.toString()Ljava/lang/String; +METHOD|bsh.ClassPathException.(Ljava/lang/String;)V +METHOD|bsh.CollectionManager$1.(Lbsh/CollectionManager$BasicBshIterator;Ljava/lang/Object;)V +METHOD|bsh.CollectionManager$1.nextElement()Ljava/lang/Object; +METHOD|bsh.CollectionManager$1.hasMoreElements()Z +METHOD|bsh.CollectionManager$BasicBshIterator.(Ljava/lang/Object;)V +METHOD|bsh.CollectionManager$BasicBshIterator.createEnumeration(Ljava/lang/Object;)Ljava/util/Enumeration; +METHOD|bsh.CollectionManager$BasicBshIterator.next()Ljava/lang/Object; +METHOD|bsh.CollectionManager$BasicBshIterator.hasNext()Z +METHOD|bsh.CollectionManager.()V +METHOD|bsh.CollectionManager.getCollectionManager()Lbsh/CollectionManager; +METHOD|bsh.CollectionManager.isBshIterable(Ljava/lang/Object;)Z +METHOD|bsh.CollectionManager.getBshIterator(Ljava/lang/Object;)Lbsh/BshIterator; +METHOD|bsh.CollectionManager.isMap(Ljava/lang/Object;)Z +METHOD|bsh.CollectionManager.getFromMap(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; +METHOD|bsh.CollectionManager.putInMap(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; +METHOD|bsh.CommandLineReader.(Ljava/io/Reader;)V +METHOD|bsh.CommandLineReader.read()I +METHOD|bsh.CommandLineReader.read([CII)I +METHOD|bsh.CommandLineReader.main([Ljava/lang/String;)V +METHOD|bsh.Console.()V +METHOD|bsh.Console.main([Ljava/lang/String;)V +METHOD|bsh.ConsoleInterface.getIn()Ljava/io/Reader; +METHOD|bsh.ConsoleInterface.getOut()Ljava/io/PrintStream; +METHOD|bsh.ConsoleInterface.getErr()Ljava/io/PrintStream; +METHOD|bsh.ConsoleInterface.println(Ljava/lang/Object;)V +METHOD|bsh.ConsoleInterface.print(Ljava/lang/Object;)V +METHOD|bsh.ConsoleInterface.error(Ljava/lang/Object;)V +METHOD|bsh.DelayedEvalBshMethod.(Ljava/lang/String;Ljava/lang/String;Lbsh/BSHReturnType;[Ljava/lang/String;[Ljava/lang/String;Lbsh/BSHFormalParameters;Lbsh/BSHBlock;Lbsh/NameSpace;Lbsh/Modifiers;Lbsh/CallStack;Lbsh/Interpreter;)V +METHOD|bsh.DelayedEvalBshMethod.getReturnTypeDescriptor()Ljava/lang/String; +METHOD|bsh.DelayedEvalBshMethod.getReturnType()Ljava/lang/Class; +METHOD|bsh.DelayedEvalBshMethod.getParamTypeDescriptors()[Ljava/lang/String; +METHOD|bsh.DelayedEvalBshMethod.getParameterTypes()[Ljava/lang/Class; +METHOD|bsh.EvalError.(Ljava/lang/String;Lbsh/SimpleNode;Lbsh/CallStack;)V +METHOD|bsh.EvalError.toString()Ljava/lang/String; +METHOD|bsh.EvalError.reThrow(Ljava/lang/String;)V +METHOD|bsh.EvalError.getNode()Lbsh/SimpleNode; +METHOD|bsh.EvalError.setNode(Lbsh/SimpleNode;)V +METHOD|bsh.EvalError.getErrorText()Ljava/lang/String; +METHOD|bsh.EvalError.getErrorLineNumber()I +METHOD|bsh.EvalError.getErrorSourceFile()Ljava/lang/String; +METHOD|bsh.EvalError.getScriptStackTrace()Ljava/lang/String; +METHOD|bsh.EvalError.getMessage()Ljava/lang/String; +METHOD|bsh.EvalError.setMessage(Ljava/lang/String;)V +METHOD|bsh.EvalError.prependMessage(Ljava/lang/String;)V +METHOD|bsh.ExternalNameSpace.()V +METHOD|bsh.ExternalNameSpace.(Lbsh/NameSpace;Ljava/lang/String;Ljava/util/Map;)V +METHOD|bsh.ExternalNameSpace.getMap()Ljava/util/Map; +METHOD|bsh.ExternalNameSpace.setMap(Ljava/util/Map;)V +METHOD|bsh.ExternalNameSpace.setVariable(Ljava/lang/String;Ljava/lang/Object;ZZ)V +METHOD|bsh.ExternalNameSpace.unsetVariable(Ljava/lang/String;)V +METHOD|bsh.ExternalNameSpace.getVariableNames()[Ljava/lang/String; +METHOD|bsh.ExternalNameSpace.getVariableImpl(Ljava/lang/String;Z)Lbsh/Variable; +METHOD|bsh.ExternalNameSpace.getDeclaredVariables()[Lbsh/Variable; +METHOD|bsh.ExternalNameSpace.setTypedVariable(Ljava/lang/String;Ljava/lang/Class;Ljava/lang/Object;Lbsh/Modifiers;)V +METHOD|bsh.ExternalNameSpace.setMethod(Ljava/lang/String;Lbsh/BshMethod;)V +METHOD|bsh.ExternalNameSpace.getMethod(Ljava/lang/String;[Ljava/lang/Class;Z)Lbsh/BshMethod; +METHOD|bsh.ExternalNameSpace.getAllNamesAux(Ljava/util/Vector;)V +METHOD|bsh.ExternalNameSpace.clear()V +METHOD|bsh.ExternalNameSpace.putExternalMap(Ljava/lang/String;Ljava/lang/Object;)V +METHOD|bsh.Interpreter$1.(Ljava/io/InputStream;)V +METHOD|bsh.Interpreter$1.available()I +METHOD|bsh.Interpreter.(Ljava/io/Reader;Ljava/io/PrintStream;Ljava/io/PrintStream;ZLbsh/NameSpace;Lbsh/Interpreter;Ljava/lang/String;)V +METHOD|bsh.Interpreter.(Ljava/io/Reader;Ljava/io/PrintStream;Ljava/io/PrintStream;ZLbsh/NameSpace;)V +METHOD|bsh.Interpreter.(Ljava/io/Reader;Ljava/io/PrintStream;Ljava/io/PrintStream;Z)V +METHOD|bsh.Interpreter.(Lbsh/ConsoleInterface;Lbsh/NameSpace;)V +METHOD|bsh.Interpreter.(Lbsh/ConsoleInterface;)V +METHOD|bsh.Interpreter.()V +METHOD|bsh.Interpreter.setConsole(Lbsh/ConsoleInterface;)V +METHOD|bsh.Interpreter.initRootSystemObject()V +METHOD|bsh.Interpreter.setNameSpace(Lbsh/NameSpace;)V +METHOD|bsh.Interpreter.getNameSpace()Lbsh/NameSpace; +METHOD|bsh.Interpreter.main([Ljava/lang/String;)V +METHOD|bsh.Interpreter.invokeMain(Ljava/lang/Class;[Ljava/lang/String;)V +METHOD|bsh.Interpreter.run()V +METHOD|bsh.Interpreter.source(Ljava/lang/String;Lbsh/NameSpace;)Ljava/lang/Object; +METHOD|bsh.Interpreter.source(Ljava/lang/String;)Ljava/lang/Object; +METHOD|bsh.Interpreter.eval(Ljava/io/Reader;Lbsh/NameSpace;Ljava/lang/String;)Ljava/lang/Object; +METHOD|bsh.Interpreter.eval(Ljava/io/Reader;)Ljava/lang/Object; +METHOD|bsh.Interpreter.eval(Ljava/lang/String;)Ljava/lang/Object; +METHOD|bsh.Interpreter.eval(Ljava/lang/String;Lbsh/NameSpace;)Ljava/lang/Object; +METHOD|bsh.Interpreter.showEvalString(Ljava/lang/String;)Ljava/lang/String; +METHOD|bsh.Interpreter.error(Ljava/lang/Object;)V +METHOD|bsh.Interpreter.getIn()Ljava/io/Reader; +METHOD|bsh.Interpreter.getOut()Ljava/io/PrintStream; +METHOD|bsh.Interpreter.getErr()Ljava/io/PrintStream; +METHOD|bsh.Interpreter.println(Ljava/lang/Object;)V +METHOD|bsh.Interpreter.print(Ljava/lang/Object;)V +METHOD|bsh.Interpreter.debug(Ljava/lang/String;)V +METHOD|bsh.Interpreter.get(Ljava/lang/String;)Ljava/lang/Object; +METHOD|bsh.Interpreter.getu(Ljava/lang/String;)Ljava/lang/Object; +METHOD|bsh.Interpreter.set(Ljava/lang/String;Ljava/lang/Object;)V +METHOD|bsh.Interpreter.setu(Ljava/lang/String;Ljava/lang/Object;)V +METHOD|bsh.Interpreter.set(Ljava/lang/String;J)V +METHOD|bsh.Interpreter.set(Ljava/lang/String;I)V +METHOD|bsh.Interpreter.set(Ljava/lang/String;D)V +METHOD|bsh.Interpreter.set(Ljava/lang/String;F)V +METHOD|bsh.Interpreter.set(Ljava/lang/String;Z)V +METHOD|bsh.Interpreter.unset(Ljava/lang/String;)V +METHOD|bsh.Interpreter.getInterface(Ljava/lang/Class;)Ljava/lang/Object; +METHOD|bsh.Interpreter.get_jjtree()Lbsh/JJTParserState; +METHOD|bsh.Interpreter.get_jj_input_stream()Lbsh/JavaCharStream; +METHOD|bsh.Interpreter.Line()Z +METHOD|bsh.Interpreter.loadRCFiles()V +METHOD|bsh.Interpreter.pathToFile(Ljava/lang/String;)Ljava/io/File; +METHOD|bsh.Interpreter.redirectOutputToFile(Ljava/lang/String;)V +METHOD|bsh.Interpreter.setClassLoader(Ljava/lang/ClassLoader;)V +METHOD|bsh.Interpreter.getClassManager()Lbsh/BshClassManager; +METHOD|bsh.Interpreter.setStrictJava(Z)V +METHOD|bsh.Interpreter.getStrictJava()Z +METHOD|bsh.Interpreter.staticInit()V +METHOD|bsh.Interpreter.getSourceFileInfo()Ljava/lang/String; +METHOD|bsh.Interpreter.getParent()Lbsh/Interpreter; +METHOD|bsh.Interpreter.setOut(Ljava/io/PrintStream;)V +METHOD|bsh.Interpreter.setErr(Ljava/io/PrintStream;)V +METHOD|bsh.Interpreter.readObject(Ljava/io/ObjectInputStream;)V +METHOD|bsh.Interpreter.getBshPrompt()Ljava/lang/String; +METHOD|bsh.Interpreter.setExitOnEOF(Z)V +METHOD|bsh.Interpreter.setShowResults(Z)V +METHOD|bsh.Interpreter.getShowResults()Z +METHOD|bsh.Interpreter.class$(Ljava/lang/String;)Ljava/lang/Class; +METHOD|bsh.Interpreter.()V +METHOD|bsh.InterpreterError.(Ljava/lang/String;)V +METHOD|bsh.JJTParserState.()V +METHOD|bsh.JJTParserState.nodeCreated()Z +METHOD|bsh.JJTParserState.reset()V +METHOD|bsh.JJTParserState.rootNode()Lbsh/Node; +METHOD|bsh.JJTParserState.pushNode(Lbsh/Node;)V +METHOD|bsh.JJTParserState.popNode()Lbsh/Node; +METHOD|bsh.JJTParserState.peekNode()Lbsh/Node; +METHOD|bsh.JJTParserState.nodeArity()I +METHOD|bsh.JJTParserState.clearNodeScope(Lbsh/Node;)V +METHOD|bsh.JJTParserState.openNodeScope(Lbsh/Node;)V +METHOD|bsh.JJTParserState.closeNodeScope(Lbsh/Node;I)V +METHOD|bsh.JJTParserState.closeNodeScope(Lbsh/Node;Z)V +METHOD|bsh.JavaCharStream.hexval(C)I +METHOD|bsh.JavaCharStream.ExpandBuff(Z)V +METHOD|bsh.JavaCharStream.FillBuff()V +METHOD|bsh.JavaCharStream.ReadByte()C +METHOD|bsh.JavaCharStream.BeginToken()C +METHOD|bsh.JavaCharStream.AdjustBuffSize()V +METHOD|bsh.JavaCharStream.UpdateLineColumn(C)V +METHOD|bsh.JavaCharStream.readChar()C +METHOD|bsh.JavaCharStream.getColumn()I +METHOD|bsh.JavaCharStream.getLine()I +METHOD|bsh.JavaCharStream.getEndColumn()I +METHOD|bsh.JavaCharStream.getEndLine()I +METHOD|bsh.JavaCharStream.getBeginColumn()I +METHOD|bsh.JavaCharStream.getBeginLine()I +METHOD|bsh.JavaCharStream.backup(I)V +METHOD|bsh.JavaCharStream.(Ljava/io/Reader;III)V +METHOD|bsh.JavaCharStream.(Ljava/io/Reader;II)V +METHOD|bsh.JavaCharStream.(Ljava/io/Reader;)V +METHOD|bsh.JavaCharStream.ReInit(Ljava/io/Reader;III)V +METHOD|bsh.JavaCharStream.ReInit(Ljava/io/Reader;II)V +METHOD|bsh.JavaCharStream.ReInit(Ljava/io/Reader;)V +METHOD|bsh.JavaCharStream.(Ljava/io/InputStream;III)V +METHOD|bsh.JavaCharStream.(Ljava/io/InputStream;II)V +METHOD|bsh.JavaCharStream.(Ljava/io/InputStream;)V +METHOD|bsh.JavaCharStream.ReInit(Ljava/io/InputStream;III)V +METHOD|bsh.JavaCharStream.ReInit(Ljava/io/InputStream;II)V +METHOD|bsh.JavaCharStream.ReInit(Ljava/io/InputStream;)V +METHOD|bsh.JavaCharStream.GetImage()Ljava/lang/String; +METHOD|bsh.JavaCharStream.GetSuffix(I)[C +METHOD|bsh.JavaCharStream.Done()V +METHOD|bsh.JavaCharStream.adjustBeginLineColumn(II)V +METHOD|bsh.LHS.(Lbsh/NameSpace;Ljava/lang/String;)V +METHOD|bsh.LHS.(Lbsh/NameSpace;Ljava/lang/String;Z)V +METHOD|bsh.LHS.(Ljava/lang/reflect/Field;)V +METHOD|bsh.LHS.(Ljava/lang/Object;Ljava/lang/reflect/Field;)V +METHOD|bsh.LHS.(Ljava/lang/Object;Ljava/lang/String;)V +METHOD|bsh.LHS.(Ljava/lang/Object;I)V +METHOD|bsh.LHS.getValue()Ljava/lang/Object; +METHOD|bsh.LHS.assign(Ljava/lang/Object;Z)Ljava/lang/Object; +METHOD|bsh.LHS.toString()Ljava/lang/String; +METHOD|bsh.Modifiers.()V +METHOD|bsh.Modifiers.addModifier(ILjava/lang/String;)V +METHOD|bsh.Modifiers.hasModifier(Ljava/lang/String;)Z +METHOD|bsh.Modifiers.validateForMethod()V +METHOD|bsh.Modifiers.validateForField()V +METHOD|bsh.Modifiers.validateForClass()V +METHOD|bsh.Modifiers.insureNo(Ljava/lang/String;Ljava/lang/String;)V +METHOD|bsh.Modifiers.toString()Ljava/lang/String; +METHOD|bsh.Name.reset()V +METHOD|bsh.Name.(Lbsh/NameSpace;Ljava/lang/String;)V +METHOD|bsh.Name.toObject(Lbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Object; +METHOD|bsh.Name.toObject(Lbsh/CallStack;Lbsh/Interpreter;Z)Ljava/lang/Object; +METHOD|bsh.Name.completeRound(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/Object; +METHOD|bsh.Name.consumeNextObjectField(Lbsh/CallStack;Lbsh/Interpreter;ZZ)Ljava/lang/Object; +METHOD|bsh.Name.resolveThisFieldReference(Lbsh/CallStack;Lbsh/NameSpace;Lbsh/Interpreter;Ljava/lang/String;Z)Ljava/lang/Object; +METHOD|bsh.Name.getClassNameSpace(Lbsh/NameSpace;)Lbsh/NameSpace; +METHOD|bsh.Name.toClass()Ljava/lang/Class; +METHOD|bsh.Name.toLHS(Lbsh/CallStack;Lbsh/Interpreter;)Lbsh/LHS; +METHOD|bsh.Name.invokeMethod(Lbsh/Interpreter;[Ljava/lang/Object;Lbsh/CallStack;Lbsh/SimpleNode;)Ljava/lang/Object; +METHOD|bsh.Name.invokeLocalMethod(Lbsh/Interpreter;[Ljava/lang/Object;Lbsh/CallStack;Lbsh/SimpleNode;)Ljava/lang/Object; +METHOD|bsh.Name.isCompound(Ljava/lang/String;)Z +METHOD|bsh.Name.countParts(Ljava/lang/String;)I +METHOD|bsh.Name.prefix(Ljava/lang/String;)Ljava/lang/String; +METHOD|bsh.Name.prefix(Ljava/lang/String;I)Ljava/lang/String; +METHOD|bsh.Name.suffix(Ljava/lang/String;)Ljava/lang/String; +METHOD|bsh.Name.suffix(Ljava/lang/String;I)Ljava/lang/String; +METHOD|bsh.Name.toString()Ljava/lang/String; +METHOD|bsh.Name.()V +METHOD|bsh.NameSource$Listener.nameSourceChanged(Lbsh/NameSource;)V +METHOD|bsh.NameSource.getAllNames()[Ljava/lang/String; +METHOD|bsh.NameSource.addNameSourceListener(Lbsh/NameSource$Listener;)V +METHOD|bsh.NameSpace.setClassStatic(Ljava/lang/Class;)V +METHOD|bsh.NameSpace.setClassInstance(Ljava/lang/Object;)V +METHOD|bsh.NameSpace.getClassInstance()Ljava/lang/Object; +METHOD|bsh.NameSpace.(Lbsh/NameSpace;Ljava/lang/String;)V +METHOD|bsh.NameSpace.(Lbsh/BshClassManager;Ljava/lang/String;)V +METHOD|bsh.NameSpace.(Lbsh/NameSpace;Lbsh/BshClassManager;Ljava/lang/String;)V +METHOD|bsh.NameSpace.setName(Ljava/lang/String;)V +METHOD|bsh.NameSpace.getName()Ljava/lang/String; +METHOD|bsh.NameSpace.setNode(Lbsh/SimpleNode;)V +METHOD|bsh.NameSpace.getNode()Lbsh/SimpleNode; +METHOD|bsh.NameSpace.get(Ljava/lang/String;Lbsh/Interpreter;)Ljava/lang/Object; +METHOD|bsh.NameSpace.setVariable(Ljava/lang/String;Ljava/lang/Object;Z)V +METHOD|bsh.NameSpace.setLocalVariable(Ljava/lang/String;Ljava/lang/Object;Z)V +METHOD|bsh.NameSpace.setVariable(Ljava/lang/String;Ljava/lang/Object;ZZ)V +METHOD|bsh.NameSpace.unsetVariable(Ljava/lang/String;)V +METHOD|bsh.NameSpace.getVariableNames()[Ljava/lang/String; +METHOD|bsh.NameSpace.getMethodNames()[Ljava/lang/String; +METHOD|bsh.NameSpace.getMethods()[Lbsh/BshMethod; +METHOD|bsh.NameSpace.enumerationToStringArray(Ljava/util/Enumeration;)[Ljava/lang/String; +METHOD|bsh.NameSpace.flattenMethodCollection(Ljava/util/Enumeration;)[Lbsh/BshMethod; +METHOD|bsh.NameSpace.getParent()Lbsh/NameSpace; +METHOD|bsh.NameSpace.getSuper(Lbsh/Interpreter;)Lbsh/This; +METHOD|bsh.NameSpace.getGlobal(Lbsh/Interpreter;)Lbsh/This; +METHOD|bsh.NameSpace.getThis(Lbsh/Interpreter;)Lbsh/This; +METHOD|bsh.NameSpace.getClassManager()Lbsh/BshClassManager; +METHOD|bsh.NameSpace.setClassManager(Lbsh/BshClassManager;)V +METHOD|bsh.NameSpace.prune()V +METHOD|bsh.NameSpace.setParent(Lbsh/NameSpace;)V +METHOD|bsh.NameSpace.getVariable(Ljava/lang/String;)Ljava/lang/Object; +METHOD|bsh.NameSpace.getVariable(Ljava/lang/String;Z)Ljava/lang/Object; +METHOD|bsh.NameSpace.getVariableImpl(Ljava/lang/String;Z)Lbsh/Variable; +METHOD|bsh.NameSpace.getDeclaredVariables()[Lbsh/Variable; +METHOD|bsh.NameSpace.unwrapVariable(Lbsh/Variable;)Ljava/lang/Object; +METHOD|bsh.NameSpace.setTypedVariable(Ljava/lang/String;Ljava/lang/Class;Ljava/lang/Object;Z)V +METHOD|bsh.NameSpace.setTypedVariable(Ljava/lang/String;Ljava/lang/Class;Ljava/lang/Object;Lbsh/Modifiers;)V +METHOD|bsh.NameSpace.setMethod(Ljava/lang/String;Lbsh/BshMethod;)V +METHOD|bsh.NameSpace.getMethod(Ljava/lang/String;[Ljava/lang/Class;)Lbsh/BshMethod; +METHOD|bsh.NameSpace.getMethod(Ljava/lang/String;[Ljava/lang/Class;Z)Lbsh/BshMethod; +METHOD|bsh.NameSpace.importClass(Ljava/lang/String;)V +METHOD|bsh.NameSpace.importPackage(Ljava/lang/String;)V +METHOD|bsh.NameSpace.importCommands(Ljava/lang/String;)V +METHOD|bsh.NameSpace.getCommand(Ljava/lang/String;[Ljava/lang/Class;Lbsh/Interpreter;)Ljava/lang/Object; +METHOD|bsh.NameSpace.getImportedMethod(Ljava/lang/String;[Ljava/lang/Class;)Lbsh/BshMethod; +METHOD|bsh.NameSpace.getImportedVar(Ljava/lang/String;)Lbsh/Variable; +METHOD|bsh.NameSpace.loadScriptedCommand(Ljava/io/InputStream;Ljava/lang/String;[Ljava/lang/Class;Ljava/lang/String;Lbsh/Interpreter;)Lbsh/BshMethod; +METHOD|bsh.NameSpace.cacheClass(Ljava/lang/String;Ljava/lang/Class;)V +METHOD|bsh.NameSpace.getClass(Ljava/lang/String;)Ljava/lang/Class; +METHOD|bsh.NameSpace.getClassImpl(Ljava/lang/String;)Ljava/lang/Class; +METHOD|bsh.NameSpace.getImportedClassImpl(Ljava/lang/String;)Ljava/lang/Class; +METHOD|bsh.NameSpace.classForName(Ljava/lang/String;)Ljava/lang/Class; +METHOD|bsh.NameSpace.getAllNames()[Ljava/lang/String; +METHOD|bsh.NameSpace.getAllNamesAux(Ljava/util/Vector;)V +METHOD|bsh.NameSpace.addNameSourceListener(Lbsh/NameSource$Listener;)V +METHOD|bsh.NameSpace.doSuperImport()V +METHOD|bsh.NameSpace.toString()Ljava/lang/String; +METHOD|bsh.NameSpace.writeObject(Ljava/io/ObjectOutputStream;)V +METHOD|bsh.NameSpace.invokeMethod(Ljava/lang/String;[Ljava/lang/Object;Lbsh/Interpreter;)Ljava/lang/Object; +METHOD|bsh.NameSpace.invokeMethod(Ljava/lang/String;[Ljava/lang/Object;Lbsh/Interpreter;Lbsh/CallStack;Lbsh/SimpleNode;)Ljava/lang/Object; +METHOD|bsh.NameSpace.classLoaderChanged()V +METHOD|bsh.NameSpace.nameSpaceChanged()V +METHOD|bsh.NameSpace.loadDefaultImports()V +METHOD|bsh.NameSpace.getNameResolver(Ljava/lang/String;)Lbsh/Name; +METHOD|bsh.NameSpace.getInvocationLine()I +METHOD|bsh.NameSpace.getInvocationText()Ljava/lang/String; +METHOD|bsh.NameSpace.identifierToClass(Lbsh/ClassIdentifier;)Ljava/lang/Class; +METHOD|bsh.NameSpace.clear()V +METHOD|bsh.NameSpace.importObject(Ljava/lang/Object;)V +METHOD|bsh.NameSpace.importStatic(Ljava/lang/Class;)V +METHOD|bsh.NameSpace.setPackage(Ljava/lang/String;)V +METHOD|bsh.NameSpace.getPackage()Ljava/lang/String; +METHOD|bsh.NameSpace.()V +METHOD|bsh.Node.jjtOpen()V +METHOD|bsh.Node.jjtClose()V +METHOD|bsh.Node.jjtSetParent(Lbsh/Node;)V +METHOD|bsh.Node.jjtGetParent()Lbsh/Node; +METHOD|bsh.Node.jjtAddChild(Lbsh/Node;I)V +METHOD|bsh.Node.jjtGetChild(I)Lbsh/Node; +METHOD|bsh.Node.jjtGetNumChildren()I +METHOD|bsh.ParseException.setErrorSourceFile(Ljava/lang/String;)V +METHOD|bsh.ParseException.getErrorSourceFile()Ljava/lang/String; +METHOD|bsh.ParseException.(Lbsh/Token;[[I[Ljava/lang/String;)V +METHOD|bsh.ParseException.()V +METHOD|bsh.ParseException.(Ljava/lang/String;)V +METHOD|bsh.ParseException.getMessage()Ljava/lang/String; +METHOD|bsh.ParseException.getMessage(Z)Ljava/lang/String; +METHOD|bsh.ParseException.add_escapes(Ljava/lang/String;)Ljava/lang/String; +METHOD|bsh.ParseException.getErrorLineNumber()I +METHOD|bsh.ParseException.getErrorText()Ljava/lang/String; +METHOD|bsh.ParseException.toString()Ljava/lang/String; +METHOD|bsh.Parser$LookaheadSuccess.()V +METHOD|bsh.Parser$LookaheadSuccess.(Lbsh/Parser$1;)V +METHOD|bsh.Parser.setRetainComments(Z)V +METHOD|bsh.Parser.jjtreeOpenNodeScope(Lbsh/Node;)V +METHOD|bsh.Parser.jjtreeCloseNodeScope(Lbsh/Node;)V +METHOD|bsh.Parser.reInitInput(Ljava/io/Reader;)V +METHOD|bsh.Parser.popNode()Lbsh/SimpleNode; +METHOD|bsh.Parser.reInitTokenInput(Ljava/io/Reader;)V +METHOD|bsh.Parser.main([Ljava/lang/String;)V +METHOD|bsh.Parser.isRegularForStatement()Z +METHOD|bsh.Parser.createParseException(Ljava/lang/String;)Lbsh/ParseException; +METHOD|bsh.Parser.Line()Z +METHOD|bsh.Parser.Modifiers(IZ)Lbsh/Modifiers; +METHOD|bsh.Parser.ClassDeclaration()V +METHOD|bsh.Parser.MethodDeclaration()V +METHOD|bsh.Parser.PackageDeclaration()V +METHOD|bsh.Parser.ImportDeclaration()V +METHOD|bsh.Parser.VariableDeclarator()V +METHOD|bsh.Parser.VariableInitializer()V +METHOD|bsh.Parser.ArrayInitializer()V +METHOD|bsh.Parser.FormalParameters()V +METHOD|bsh.Parser.FormalParameter()V +METHOD|bsh.Parser.Type()V +METHOD|bsh.Parser.ReturnType()V +METHOD|bsh.Parser.PrimitiveType()V +METHOD|bsh.Parser.AmbiguousName()V +METHOD|bsh.Parser.NameList()I +METHOD|bsh.Parser.Expression()V +METHOD|bsh.Parser.Assignment()V +METHOD|bsh.Parser.AssignmentOperator()I +METHOD|bsh.Parser.ConditionalExpression()V +METHOD|bsh.Parser.ConditionalOrExpression()V +METHOD|bsh.Parser.ConditionalAndExpression()V +METHOD|bsh.Parser.InclusiveOrExpression()V +METHOD|bsh.Parser.ExclusiveOrExpression()V +METHOD|bsh.Parser.AndExpression()V +METHOD|bsh.Parser.EqualityExpression()V +METHOD|bsh.Parser.InstanceOfExpression()V +METHOD|bsh.Parser.RelationalExpression()V +METHOD|bsh.Parser.ShiftExpression()V +METHOD|bsh.Parser.AdditiveExpression()V +METHOD|bsh.Parser.MultiplicativeExpression()V +METHOD|bsh.Parser.UnaryExpression()V +METHOD|bsh.Parser.PreIncrementExpression()V +METHOD|bsh.Parser.PreDecrementExpression()V +METHOD|bsh.Parser.UnaryExpressionNotPlusMinus()V +METHOD|bsh.Parser.CastLookahead()V +METHOD|bsh.Parser.PostfixExpression()V +METHOD|bsh.Parser.CastExpression()V +METHOD|bsh.Parser.PrimaryExpression()V +METHOD|bsh.Parser.MethodInvocation()V +METHOD|bsh.Parser.PrimaryPrefix()V +METHOD|bsh.Parser.PrimarySuffix()V +METHOD|bsh.Parser.Literal()V +METHOD|bsh.Parser.BooleanLiteral()Z +METHOD|bsh.Parser.NullLiteral()V +METHOD|bsh.Parser.VoidLiteral()V +METHOD|bsh.Parser.Arguments()V +METHOD|bsh.Parser.ArgumentList()V +METHOD|bsh.Parser.AllocationExpression()V +METHOD|bsh.Parser.ArrayDimensions()V +METHOD|bsh.Parser.Statement()V +METHOD|bsh.Parser.LabeledStatement()V +METHOD|bsh.Parser.Block()V +METHOD|bsh.Parser.BlockStatement()V +METHOD|bsh.Parser.FormalComment()V +METHOD|bsh.Parser.EmptyStatement()V +METHOD|bsh.Parser.StatementExpression()V +METHOD|bsh.Parser.SwitchStatement()V +METHOD|bsh.Parser.SwitchLabel()V +METHOD|bsh.Parser.IfStatement()V +METHOD|bsh.Parser.WhileStatement()V +METHOD|bsh.Parser.DoStatement()V +METHOD|bsh.Parser.ForStatement()V +METHOD|bsh.Parser.EnhancedForStatement()V +METHOD|bsh.Parser.ForInit()V +METHOD|bsh.Parser.TypedVariableDeclaration()V +METHOD|bsh.Parser.StatementExpressionList()V +METHOD|bsh.Parser.ForUpdate()V +METHOD|bsh.Parser.BreakStatement()V +METHOD|bsh.Parser.ContinueStatement()V +METHOD|bsh.Parser.ReturnStatement()V +METHOD|bsh.Parser.SynchronizedStatement()V +METHOD|bsh.Parser.ThrowStatement()V +METHOD|bsh.Parser.TryStatement()V +METHOD|bsh.Parser.jj_2_1(I)Z +METHOD|bsh.Parser.jj_2_2(I)Z +METHOD|bsh.Parser.jj_2_3(I)Z +METHOD|bsh.Parser.jj_2_4(I)Z +METHOD|bsh.Parser.jj_2_5(I)Z +METHOD|bsh.Parser.jj_2_6(I)Z +METHOD|bsh.Parser.jj_2_7(I)Z +METHOD|bsh.Parser.jj_2_8(I)Z +METHOD|bsh.Parser.jj_2_9(I)Z +METHOD|bsh.Parser.jj_2_10(I)Z +METHOD|bsh.Parser.jj_2_11(I)Z +METHOD|bsh.Parser.jj_2_12(I)Z +METHOD|bsh.Parser.jj_2_13(I)Z +METHOD|bsh.Parser.jj_2_14(I)Z +METHOD|bsh.Parser.jj_2_15(I)Z +METHOD|bsh.Parser.jj_2_16(I)Z +METHOD|bsh.Parser.jj_2_17(I)Z +METHOD|bsh.Parser.jj_2_18(I)Z +METHOD|bsh.Parser.jj_2_19(I)Z +METHOD|bsh.Parser.jj_2_20(I)Z +METHOD|bsh.Parser.jj_2_21(I)Z +METHOD|bsh.Parser.jj_2_22(I)Z +METHOD|bsh.Parser.jj_2_23(I)Z +METHOD|bsh.Parser.jj_2_24(I)Z +METHOD|bsh.Parser.jj_2_25(I)Z +METHOD|bsh.Parser.jj_2_26(I)Z +METHOD|bsh.Parser.jj_2_27(I)Z +METHOD|bsh.Parser.jj_2_28(I)Z +METHOD|bsh.Parser.jj_2_29(I)Z +METHOD|bsh.Parser.jj_2_30(I)Z +METHOD|bsh.Parser.jj_2_31(I)Z +METHOD|bsh.Parser.jj_3R_46()Z +METHOD|bsh.Parser.jj_3R_28()Z +METHOD|bsh.Parser.jj_3_23()Z +METHOD|bsh.Parser.jj_3R_161()Z +METHOD|bsh.Parser.jj_3R_38()Z +METHOD|bsh.Parser.jj_3R_158()Z +METHOD|bsh.Parser.jj_3R_40()Z +METHOD|bsh.Parser.jj_3R_156()Z +METHOD|bsh.Parser.jj_3R_165()Z +METHOD|bsh.Parser.jj_3R_153()Z +METHOD|bsh.Parser.jj_3R_90()Z +METHOD|bsh.Parser.jj_3R_89()Z +METHOD|bsh.Parser.jj_3R_88()Z +METHOD|bsh.Parser.jj_3R_162()Z +METHOD|bsh.Parser.jj_3R_87()Z +METHOD|bsh.Parser.jj_3R_148()Z +METHOD|bsh.Parser.jj_3R_86()Z +METHOD|bsh.Parser.jj_3R_85()Z +METHOD|bsh.Parser.jj_3R_84()Z +METHOD|bsh.Parser.jj_3R_159()Z +METHOD|bsh.Parser.jj_3R_83()Z +METHOD|bsh.Parser.jj_3R_135()Z +METHOD|bsh.Parser.jj_3R_82()Z +METHOD|bsh.Parser.jj_3R_81()Z +METHOD|bsh.Parser.jj_3R_80()Z +METHOD|bsh.Parser.jj_3R_108()Z +METHOD|bsh.Parser.jj_3R_79()Z +METHOD|bsh.Parser.jj_3R_78()Z +METHOD|bsh.Parser.jj_3_17()Z +METHOD|bsh.Parser.jj_3R_77()Z +METHOD|bsh.Parser.jj_3R_45()Z +METHOD|bsh.Parser.jj_3_22()Z +METHOD|bsh.Parser.jj_3R_34()Z +METHOD|bsh.Parser.jj_3R_111()Z +METHOD|bsh.Parser.jj_3R_160()Z +METHOD|bsh.Parser.jj_3R_152()Z +METHOD|bsh.Parser.jj_3R_157()Z +METHOD|bsh.Parser.jj_3_8()Z +METHOD|bsh.Parser.jj_3_20()Z +METHOD|bsh.Parser.jj_3R_151()Z +METHOD|bsh.Parser.jj_3_19()Z +METHOD|bsh.Parser.jj_3R_107()Z +METHOD|bsh.Parser.jj_3_21()Z +METHOD|bsh.Parser.jj_3R_150()Z +METHOD|bsh.Parser.jj_3R_71()Z +METHOD|bsh.Parser.jj_3R_39()Z +METHOD|bsh.Parser.jj_3R_70()Z +METHOD|bsh.Parser.jj_3R_145()Z +METHOD|bsh.Parser.jj_3_18()Z +METHOD|bsh.Parser.jj_3R_130()Z +METHOD|bsh.Parser.jj_3R_147()Z +METHOD|bsh.Parser.jj_3R_76()Z +METHOD|bsh.Parser.jj_3R_134()Z +METHOD|bsh.Parser.jj_3R_106()Z +METHOD|bsh.Parser.jj_3_7()Z +METHOD|bsh.Parser.jj_3R_69()Z +METHOD|bsh.Parser.jj_3R_29()Z +METHOD|bsh.Parser.jj_3R_68()Z +METHOD|bsh.Parser.jj_3R_67()Z +METHOD|bsh.Parser.jj_3R_155()Z +METHOD|bsh.Parser.jj_3R_66()Z +METHOD|bsh.Parser.jj_3R_65()Z +METHOD|bsh.Parser.jj_3R_154()Z +METHOD|bsh.Parser.jj_3R_149()Z +METHOD|bsh.Parser.jj_3R_64()Z +METHOD|bsh.Parser.jj_3R_56()Z +METHOD|bsh.Parser.jj_3R_63()Z +METHOD|bsh.Parser.jj_3R_62()Z +METHOD|bsh.Parser.jj_3R_61()Z +METHOD|bsh.Parser.jj_3R_36()Z +METHOD|bsh.Parser.jj_3R_144()Z +METHOD|bsh.Parser.jj_3R_74()Z +METHOD|bsh.Parser.jj_3R_42()Z +METHOD|bsh.Parser.jj_3R_73()Z +METHOD|bsh.Parser.jj_3R_143()Z +METHOD|bsh.Parser.jj_3_6()Z +METHOD|bsh.Parser.jj_3R_142()Z +METHOD|bsh.Parser.jj_3R_55()Z +METHOD|bsh.Parser.jj_3R_110()Z +METHOD|bsh.Parser.jj_3R_141()Z +METHOD|bsh.Parser.jj_3R_32()Z +METHOD|bsh.Parser.jj_3R_140()Z +METHOD|bsh.Parser.jj_3R_190()Z +METHOD|bsh.Parser.jj_3_4()Z +METHOD|bsh.Parser.jj_3R_189()Z +METHOD|bsh.Parser.jj_3R_136()Z +METHOD|bsh.Parser.jj_3_5()Z +METHOD|bsh.Parser.jj_3R_75()Z +METHOD|bsh.Parser.jj_3R_109()Z +METHOD|bsh.Parser.jj_3R_124()Z +METHOD|bsh.Parser.jj_3R_43()Z +METHOD|bsh.Parser.jj_3R_163()Z +METHOD|bsh.Parser.jj_3R_139()Z +METHOD|bsh.Parser.jj_3R_97()Z +METHOD|bsh.Parser.jj_3R_30()Z +METHOD|bsh.Parser.jj_3R_123()Z +METHOD|bsh.Parser.jj_3R_180()Z +METHOD|bsh.Parser.jj_3R_54()Z +METHOD|bsh.Parser.jj_3R_188()Z +METHOD|bsh.Parser.jj_3R_53()Z +METHOD|bsh.Parser.jj_3R_31()Z +METHOD|bsh.Parser.jj_3R_122()Z +METHOD|bsh.Parser.jj_3R_177()Z +METHOD|bsh.Parser.jj_3R_210()Z +METHOD|bsh.Parser.jj_3R_121()Z +METHOD|bsh.Parser.jj_3R_129()Z +METHOD|bsh.Parser.jj_3R_138()Z +METHOD|bsh.Parser.jj_3R_146()Z +METHOD|bsh.Parser.jj_3R_176()Z +METHOD|bsh.Parser.jj_3R_105()Z +METHOD|bsh.Parser.jj_3R_120()Z +METHOD|bsh.Parser.jj_3R_119()Z +METHOD|bsh.Parser.jj_3R_195()Z +METHOD|bsh.Parser.jj_3R_128()Z +METHOD|bsh.Parser.jj_3R_133()Z +METHOD|bsh.Parser.jj_3R_205()Z +METHOD|bsh.Parser.jj_3R_132()Z +METHOD|bsh.Parser.jj_3_3()Z +METHOD|bsh.Parser.jj_3R_94()Z +METHOD|bsh.Parser.jj_3R_93()Z +METHOD|bsh.Parser.jj_3R_131()Z +METHOD|bsh.Parser.jj_3R_95()Z +METHOD|bsh.Parser.jj_3_2()Z +METHOD|bsh.Parser.jj_3R_175()Z +METHOD|bsh.Parser.jj_3_16()Z +METHOD|bsh.Parser.jj_3R_104()Z +METHOD|bsh.Parser.jj_3R_174()Z +METHOD|bsh.Parser.jj_3_15()Z +METHOD|bsh.Parser.jj_3_31()Z +METHOD|bsh.Parser.jj_3_14()Z +METHOD|bsh.Parser.jj_3R_126()Z +METHOD|bsh.Parser.jj_3R_127()Z +METHOD|bsh.Parser.jj_3R_92()Z +METHOD|bsh.Parser.jj_3R_204()Z +METHOD|bsh.Parser.jj_3R_103()Z +METHOD|bsh.Parser.jj_3R_203()Z +METHOD|bsh.Parser.jj_3R_194()Z +METHOD|bsh.Parser.jj_3R_102()Z +METHOD|bsh.Parser.jj_3R_58()Z +METHOD|bsh.Parser.jj_3R_125()Z +METHOD|bsh.Parser.jj_3R_101()Z +METHOD|bsh.Parser.jj_3R_100()Z +METHOD|bsh.Parser.jj_3R_99()Z +METHOD|bsh.Parser.jj_3R_137()Z +METHOD|bsh.Parser.jj_3R_184()Z +METHOD|bsh.Parser.jj_3R_173()Z +METHOD|bsh.Parser.jj_3R_57()Z +METHOD|bsh.Parser.jj_3R_98()Z +METHOD|bsh.Parser.jj_3R_172()Z +METHOD|bsh.Parser.jj_3_30()Z +METHOD|bsh.Parser.jj_3R_118()Z +METHOD|bsh.Parser.jj_3R_37()Z +METHOD|bsh.Parser.jj_3R_185()Z +METHOD|bsh.Parser.jj_3R_91()Z +METHOD|bsh.Parser.jj_3_13()Z +METHOD|bsh.Parser.jj_3R_187()Z +METHOD|bsh.Parser.jj_3R_186()Z +METHOD|bsh.Parser.jj_3R_33()Z +METHOD|bsh.Parser.jj_3R_217()Z +METHOD|bsh.Parser.jj_3R_216()Z +METHOD|bsh.Parser.jj_3R_117()Z +METHOD|bsh.Parser.jj_3R_214()Z +METHOD|bsh.Parser.jj_3_12()Z +METHOD|bsh.Parser.jj_3R_219()Z +METHOD|bsh.Parser.jj_3R_116()Z +METHOD|bsh.Parser.jj_3_11()Z +METHOD|bsh.Parser.jj_3R_218()Z +METHOD|bsh.Parser.jj_3R_215()Z +METHOD|bsh.Parser.jj_3R_72()Z +METHOD|bsh.Parser.jj_3R_115()Z +METHOD|bsh.Parser.jj_3R_60()Z +METHOD|bsh.Parser.jj_3R_59()Z +METHOD|bsh.Parser.jj_3_9()Z +METHOD|bsh.Parser.jj_3_29()Z +METHOD|bsh.Parser.jj_3R_114()Z +METHOD|bsh.Parser.jj_3R_41()Z +METHOD|bsh.Parser.jj_3R_35()Z +METHOD|bsh.Parser.jj_3_10()Z +METHOD|bsh.Parser.jj_3R_213()Z +METHOD|bsh.Parser.jj_3R_212()Z +METHOD|bsh.Parser.jj_3R_202()Z +METHOD|bsh.Parser.jj_3R_211()Z +METHOD|bsh.Parser.jj_3R_208()Z +METHOD|bsh.Parser.jj_3R_201()Z +METHOD|bsh.Parser.jj_3R_193()Z +METHOD|bsh.Parser.jj_3R_183()Z +METHOD|bsh.Parser.jj_3R_207()Z +METHOD|bsh.Parser.jj_3_1()Z +METHOD|bsh.Parser.jj_3R_113()Z +METHOD|bsh.Parser.jj_3R_209()Z +METHOD|bsh.Parser.jj_3R_206()Z +METHOD|bsh.Parser.jj_3R_199()Z +METHOD|bsh.Parser.jj_3R_198()Z +METHOD|bsh.Parser.jj_3R_197()Z +METHOD|bsh.Parser.jj_3R_196()Z +METHOD|bsh.Parser.jj_3R_191()Z +METHOD|bsh.Parser.jj_3R_44()Z +METHOD|bsh.Parser.jj_3R_112()Z +METHOD|bsh.Parser.jj_3R_181()Z +METHOD|bsh.Parser.jj_3R_200()Z +METHOD|bsh.Parser.jj_3R_178()Z +METHOD|bsh.Parser.jj_3R_96()Z +METHOD|bsh.Parser.jj_3R_192()Z +METHOD|bsh.Parser.jj_3R_171()Z +METHOD|bsh.Parser.jj_3R_170()Z +METHOD|bsh.Parser.jj_3R_52()Z +METHOD|bsh.Parser.jj_3R_182()Z +METHOD|bsh.Parser.jj_3_27()Z +METHOD|bsh.Parser.jj_3R_51()Z +METHOD|bsh.Parser.jj_3R_168()Z +METHOD|bsh.Parser.jj_3R_50()Z +METHOD|bsh.Parser.jj_3_26()Z +METHOD|bsh.Parser.jj_3R_179()Z +METHOD|bsh.Parser.jj_3_28()Z +METHOD|bsh.Parser.jj_3R_166()Z +METHOD|bsh.Parser.jj_3_25()Z +METHOD|bsh.Parser.jj_3R_49()Z +METHOD|bsh.Parser.jj_3_24()Z +METHOD|bsh.Parser.jj_3R_167()Z +METHOD|bsh.Parser.jj_3R_48()Z +METHOD|bsh.Parser.jj_3R_164()Z +METHOD|bsh.Parser.jj_3R_47()Z +METHOD|bsh.Parser.jj_3R_169()Z +METHOD|bsh.Parser.(Ljava/io/InputStream;)V +METHOD|bsh.Parser.ReInit(Ljava/io/InputStream;)V +METHOD|bsh.Parser.(Ljava/io/Reader;)V +METHOD|bsh.Parser.ReInit(Ljava/io/Reader;)V +METHOD|bsh.Parser.(Lbsh/ParserTokenManager;)V +METHOD|bsh.Parser.ReInit(Lbsh/ParserTokenManager;)V +METHOD|bsh.Parser.jj_consume_token(I)Lbsh/Token; +METHOD|bsh.Parser.jj_scan_token(I)Z +METHOD|bsh.Parser.getNextToken()Lbsh/Token; +METHOD|bsh.Parser.getToken(I)Lbsh/Token; +METHOD|bsh.Parser.jj_ntk()I +METHOD|bsh.Parser.generateParseException()Lbsh/ParseException; +METHOD|bsh.Parser.enable_tracing()V +METHOD|bsh.Parser.disable_tracing()V +METHOD|bsh.ParserConstants.()V +METHOD|bsh.ParserTokenManager.setDebugStream(Ljava/io/PrintStream;)V +METHOD|bsh.ParserTokenManager.jjStopStringLiteralDfa_0(IJJJ)I +METHOD|bsh.ParserTokenManager.jjStartNfa_0(IJJJ)I +METHOD|bsh.ParserTokenManager.jjStopAtPos(II)I +METHOD|bsh.ParserTokenManager.jjStartNfaWithStates_0(III)I +METHOD|bsh.ParserTokenManager.jjMoveStringLiteralDfa0_0()I +METHOD|bsh.ParserTokenManager.jjMoveStringLiteralDfa1_0(JJJ)I +METHOD|bsh.ParserTokenManager.jjMoveStringLiteralDfa2_0(JJJJJJ)I +METHOD|bsh.ParserTokenManager.jjMoveStringLiteralDfa3_0(JJJJJJ)I +METHOD|bsh.ParserTokenManager.jjMoveStringLiteralDfa4_0(JJJJJJ)I +METHOD|bsh.ParserTokenManager.jjMoveStringLiteralDfa5_0(JJJJJJ)I +METHOD|bsh.ParserTokenManager.jjMoveStringLiteralDfa6_0(JJJJJJ)I +METHOD|bsh.ParserTokenManager.jjMoveStringLiteralDfa7_0(JJJJJJ)I +METHOD|bsh.ParserTokenManager.jjMoveStringLiteralDfa8_0(JJJJJJ)I +METHOD|bsh.ParserTokenManager.jjMoveStringLiteralDfa9_0(JJJJJJ)I +METHOD|bsh.ParserTokenManager.jjMoveStringLiteralDfa10_0(JJJJJJ)I +METHOD|bsh.ParserTokenManager.jjMoveStringLiteralDfa11_0(JJJJJJ)I +METHOD|bsh.ParserTokenManager.jjMoveStringLiteralDfa12_0(JJJJJJ)I +METHOD|bsh.ParserTokenManager.jjMoveStringLiteralDfa13_0(JJJJ)I +METHOD|bsh.ParserTokenManager.jjMoveStringLiteralDfa14_0(JJJJ)I +METHOD|bsh.ParserTokenManager.jjMoveStringLiteralDfa15_0(JJJJ)I +METHOD|bsh.ParserTokenManager.jjMoveStringLiteralDfa16_0(JJJJ)I +METHOD|bsh.ParserTokenManager.jjMoveStringLiteralDfa17_0(JJJJ)I +METHOD|bsh.ParserTokenManager.jjMoveStringLiteralDfa18_0(JJJJ)I +METHOD|bsh.ParserTokenManager.jjMoveStringLiteralDfa19_0(JJJJ)I +METHOD|bsh.ParserTokenManager.jjMoveStringLiteralDfa20_0(JJJJ)I +METHOD|bsh.ParserTokenManager.jjMoveStringLiteralDfa21_0(JJJJ)I +METHOD|bsh.ParserTokenManager.jjMoveStringLiteralDfa22_0(JJ)I +METHOD|bsh.ParserTokenManager.jjMoveStringLiteralDfa23_0(JJ)I +METHOD|bsh.ParserTokenManager.jjMoveStringLiteralDfa24_0(JJ)I +METHOD|bsh.ParserTokenManager.jjMoveStringLiteralDfa25_0(JJ)I +METHOD|bsh.ParserTokenManager.jjMoveStringLiteralDfa26_0(JJ)I +METHOD|bsh.ParserTokenManager.jjMoveStringLiteralDfa27_0(JJ)I +METHOD|bsh.ParserTokenManager.jjCheckNAdd(I)V +METHOD|bsh.ParserTokenManager.jjAddStates(II)V +METHOD|bsh.ParserTokenManager.jjCheckNAddTwoStates(II)V +METHOD|bsh.ParserTokenManager.jjCheckNAddStates(II)V +METHOD|bsh.ParserTokenManager.jjCheckNAddStates(I)V +METHOD|bsh.ParserTokenManager.jjMoveNfa_0(II)I +METHOD|bsh.ParserTokenManager.jjCanMove_0(IIIJJ)Z +METHOD|bsh.ParserTokenManager.jjCanMove_1(IIIJJ)Z +METHOD|bsh.ParserTokenManager.jjCanMove_2(IIIJJ)Z +METHOD|bsh.ParserTokenManager.(Lbsh/JavaCharStream;)V +METHOD|bsh.ParserTokenManager.(Lbsh/JavaCharStream;I)V +METHOD|bsh.ParserTokenManager.ReInit(Lbsh/JavaCharStream;)V +METHOD|bsh.ParserTokenManager.ReInitRounds()V +METHOD|bsh.ParserTokenManager.ReInit(Lbsh/JavaCharStream;I)V +METHOD|bsh.ParserTokenManager.SwitchTo(I)V +METHOD|bsh.ParserTokenManager.jjFillToken()Lbsh/Token; +METHOD|bsh.ParserTokenManager.getNextToken()Lbsh/Token; +METHOD|bsh.ParserTokenManager.()V +METHOD|bsh.ParserTreeConstants.()V +METHOD|bsh.Primitive$Special.()V +METHOD|bsh.Primitive$Special.()V +METHOD|bsh.Primitive.(Ljava/lang/Object;)V +METHOD|bsh.Primitive.(Z)V +METHOD|bsh.Primitive.(B)V +METHOD|bsh.Primitive.(S)V +METHOD|bsh.Primitive.(C)V +METHOD|bsh.Primitive.(I)V +METHOD|bsh.Primitive.(J)V +METHOD|bsh.Primitive.(F)V +METHOD|bsh.Primitive.(D)V +METHOD|bsh.Primitive.getValue()Ljava/lang/Object; +METHOD|bsh.Primitive.toString()Ljava/lang/String; +METHOD|bsh.Primitive.getType()Ljava/lang/Class; +METHOD|bsh.Primitive.binaryOperation(Ljava/lang/Object;Ljava/lang/Object;I)Ljava/lang/Object; +METHOD|bsh.Primitive.binaryOperationImpl(Ljava/lang/Object;Ljava/lang/Object;I)Ljava/lang/Object; +METHOD|bsh.Primitive.booleanBinaryOperation(Ljava/lang/Boolean;Ljava/lang/Boolean;I)Ljava/lang/Boolean; +METHOD|bsh.Primitive.longBinaryOperation(Ljava/lang/Long;Ljava/lang/Long;I)Ljava/lang/Object; +METHOD|bsh.Primitive.intBinaryOperation(Ljava/lang/Integer;Ljava/lang/Integer;I)Ljava/lang/Object; +METHOD|bsh.Primitive.doubleBinaryOperation(Ljava/lang/Double;Ljava/lang/Double;I)Ljava/lang/Object; +METHOD|bsh.Primitive.floatBinaryOperation(Ljava/lang/Float;Ljava/lang/Float;I)Ljava/lang/Object; +METHOD|bsh.Primitive.promoteToInteger(Ljava/lang/Object;)Ljava/lang/Object; +METHOD|bsh.Primitive.promotePrimitives(Ljava/lang/Object;Ljava/lang/Object;)[Ljava/lang/Object; +METHOD|bsh.Primitive.unaryOperation(Lbsh/Primitive;I)Lbsh/Primitive; +METHOD|bsh.Primitive.booleanUnaryOperation(Ljava/lang/Boolean;I)Z +METHOD|bsh.Primitive.intUnaryOperation(Ljava/lang/Integer;I)I +METHOD|bsh.Primitive.longUnaryOperation(Ljava/lang/Long;I)J +METHOD|bsh.Primitive.floatUnaryOperation(Ljava/lang/Float;I)F +METHOD|bsh.Primitive.doubleUnaryOperation(Ljava/lang/Double;I)D +METHOD|bsh.Primitive.intValue()I +METHOD|bsh.Primitive.booleanValue()Z +METHOD|bsh.Primitive.isNumber()Z +METHOD|bsh.Primitive.numberValue()Ljava/lang/Number; +METHOD|bsh.Primitive.equals(Ljava/lang/Object;)Z +METHOD|bsh.Primitive.hashCode()I +METHOD|bsh.Primitive.unwrap(Ljava/lang/Object;)Ljava/lang/Object; +METHOD|bsh.Primitive.unwrap([Ljava/lang/Object;)[Ljava/lang/Object; +METHOD|bsh.Primitive.wrap([Ljava/lang/Object;[Ljava/lang/Class;)[Ljava/lang/Object; +METHOD|bsh.Primitive.wrap(Ljava/lang/Object;Ljava/lang/Class;)Ljava/lang/Object; +METHOD|bsh.Primitive.getDefaultValue(Ljava/lang/Class;)Lbsh/Primitive; +METHOD|bsh.Primitive.boxType(Ljava/lang/Class;)Ljava/lang/Class; +METHOD|bsh.Primitive.unboxType(Ljava/lang/Class;)Ljava/lang/Class; +METHOD|bsh.Primitive.castToType(Ljava/lang/Class;I)Lbsh/Primitive; +METHOD|bsh.Primitive.castPrimitive(Ljava/lang/Class;Ljava/lang/Class;Lbsh/Primitive;ZI)Lbsh/Primitive; +METHOD|bsh.Primitive.isWrapperType(Ljava/lang/Class;)Z +METHOD|bsh.Primitive.castWrapper(Ljava/lang/Class;Ljava/lang/Object;)Ljava/lang/Object; +METHOD|bsh.Primitive.class$(Ljava/lang/String;)Ljava/lang/Class; +METHOD|bsh.Primitive.()V +METHOD|bsh.Reflect.()V +METHOD|bsh.Reflect.invokeObjectMethod(Ljava/lang/Object;Ljava/lang/String;[Ljava/lang/Object;Lbsh/Interpreter;Lbsh/CallStack;Lbsh/SimpleNode;)Ljava/lang/Object; +METHOD|bsh.Reflect.invokeStaticMethod(Lbsh/BshClassManager;Ljava/lang/Class;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/Object; +METHOD|bsh.Reflect.invokeMethod(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; +METHOD|bsh.Reflect.getIndex(Ljava/lang/Object;I)Ljava/lang/Object; +METHOD|bsh.Reflect.setIndex(Ljava/lang/Object;ILjava/lang/Object;)V +METHOD|bsh.Reflect.getStaticFieldValue(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Object; +METHOD|bsh.Reflect.getObjectFieldValue(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object; +METHOD|bsh.Reflect.getLHSStaticField(Ljava/lang/Class;Ljava/lang/String;)Lbsh/LHS; +METHOD|bsh.Reflect.getLHSObjectField(Ljava/lang/Object;Ljava/lang/String;)Lbsh/LHS; +METHOD|bsh.Reflect.getFieldValue(Ljava/lang/Class;Ljava/lang/Object;Ljava/lang/String;Z)Ljava/lang/Object; +METHOD|bsh.Reflect.resolveJavaField(Ljava/lang/Class;Ljava/lang/String;Z)Ljava/lang/reflect/Field; +METHOD|bsh.Reflect.resolveExpectedJavaField(Ljava/lang/Class;Ljava/lang/String;Z)Ljava/lang/reflect/Field; +METHOD|bsh.Reflect.findAccessibleField(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/reflect/Field; +METHOD|bsh.Reflect.resolveExpectedJavaMethod(Lbsh/BshClassManager;Ljava/lang/Class;Ljava/lang/Object;Ljava/lang/String;[Ljava/lang/Object;Z)Ljava/lang/reflect/Method; +METHOD|bsh.Reflect.resolveJavaMethod(Lbsh/BshClassManager;Ljava/lang/Class;Ljava/lang/String;[Ljava/lang/Class;Z)Ljava/lang/reflect/Method; +METHOD|bsh.Reflect.findOverloadedMethod(Ljava/lang/Class;Ljava/lang/String;[Ljava/lang/Class;Z)Ljava/lang/reflect/Method; +METHOD|bsh.Reflect.getCandidateMethods(Ljava/lang/Class;Ljava/lang/String;IZ)[Ljava/lang/reflect/Method; +METHOD|bsh.Reflect.gatherMethodsRecursive(Ljava/lang/Class;Ljava/lang/String;IZLjava/util/Vector;)Ljava/util/Vector; +METHOD|bsh.Reflect.addCandidates([Ljava/lang/reflect/Method;Ljava/lang/String;IZLjava/util/Vector;)Ljava/util/Vector; +METHOD|bsh.Reflect.constructObject(Ljava/lang/Class;[Ljava/lang/Object;)Ljava/lang/Object; +METHOD|bsh.Reflect.findMostSpecificConstructor([Ljava/lang/Class;[Ljava/lang/reflect/Constructor;)Ljava/lang/reflect/Constructor; +METHOD|bsh.Reflect.findMostSpecificConstructorIndex([Ljava/lang/Class;[Ljava/lang/reflect/Constructor;)I +METHOD|bsh.Reflect.findMostSpecificMethod([Ljava/lang/Class;[Ljava/lang/reflect/Method;)Ljava/lang/reflect/Method; +METHOD|bsh.Reflect.findMostSpecificSignature([Ljava/lang/Class;[[Ljava/lang/Class;)I +METHOD|bsh.Reflect.accessorName(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; +METHOD|bsh.Reflect.hasObjectPropertyGetter(Ljava/lang/Class;Ljava/lang/String;)Z +METHOD|bsh.Reflect.hasObjectPropertySetter(Ljava/lang/Class;Ljava/lang/String;)Z +METHOD|bsh.Reflect.getObjectProperty(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object; +METHOD|bsh.Reflect.setObjectProperty(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)V +METHOD|bsh.Reflect.normalizeClassName(Ljava/lang/Class;)Ljava/lang/String; +METHOD|bsh.Reflect.getArrayDimensions(Ljava/lang/Class;)I +METHOD|bsh.Reflect.getArrayBaseType(Ljava/lang/Class;)Ljava/lang/Class; +METHOD|bsh.Reflect.invokeCompiledCommand(Ljava/lang/Class;[Ljava/lang/Object;Lbsh/Interpreter;Lbsh/CallStack;)Ljava/lang/Object; +METHOD|bsh.Reflect.logInvokeMethod(Ljava/lang/String;Ljava/lang/reflect/Method;[Ljava/lang/Object;)V +METHOD|bsh.Reflect.checkFoundStaticMethod(Ljava/lang/reflect/Method;ZLjava/lang/Class;)V +METHOD|bsh.Reflect.cantFindConstructor(Ljava/lang/Class;[Ljava/lang/Class;)Lbsh/ReflectError; +METHOD|bsh.Reflect.isPublic(Ljava/lang/Class;)Z +METHOD|bsh.Reflect.isPublic(Ljava/lang/reflect/Method;)Z +METHOD|bsh.Reflect.isPublic(Ljava/lang/reflect/Constructor;)Z +METHOD|bsh.Reflect.isStatic(Ljava/lang/reflect/Method;)Z +METHOD|bsh.ReflectError.()V +METHOD|bsh.ReflectError.(Ljava/lang/String;)V +METHOD|bsh.ReflectManager.()V +METHOD|bsh.ReflectManager.getReflectManager()Lbsh/ReflectManager; +METHOD|bsh.ReflectManager.RMSetAccessible(Ljava/lang/Object;)Z +METHOD|bsh.ReflectManager.setAccessible(Ljava/lang/Object;)Z +METHOD|bsh.Remote.()V +METHOD|bsh.Remote.main([Ljava/lang/String;)V +METHOD|bsh.Remote.eval(Ljava/lang/String;Ljava/lang/String;)I +METHOD|bsh.Remote.doBsh(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; +METHOD|bsh.Remote.sendLine(Ljava/lang/String;Ljava/io/OutputStream;)V +METHOD|bsh.Remote.doHttp(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; +METHOD|bsh.Remote.getFile(Ljava/lang/String;)Ljava/lang/String; +METHOD|bsh.ReturnControl.(ILjava/lang/Object;Lbsh/SimpleNode;)V +METHOD|bsh.SimpleNode$1.(I)V +METHOD|bsh.SimpleNode$1.getSourceFile()Ljava/lang/String; +METHOD|bsh.SimpleNode$1.getLineNumber()I +METHOD|bsh.SimpleNode$1.getText()Ljava/lang/String; +METHOD|bsh.SimpleNode.(I)V +METHOD|bsh.SimpleNode.jjtOpen()V +METHOD|bsh.SimpleNode.jjtClose()V +METHOD|bsh.SimpleNode.jjtSetParent(Lbsh/Node;)V +METHOD|bsh.SimpleNode.jjtGetParent()Lbsh/Node; +METHOD|bsh.SimpleNode.jjtAddChild(Lbsh/Node;I)V +METHOD|bsh.SimpleNode.jjtGetChild(I)Lbsh/Node; +METHOD|bsh.SimpleNode.getChild(I)Lbsh/SimpleNode; +METHOD|bsh.SimpleNode.jjtGetNumChildren()I +METHOD|bsh.SimpleNode.toString()Ljava/lang/String; +METHOD|bsh.SimpleNode.toString(Ljava/lang/String;)Ljava/lang/String; +METHOD|bsh.SimpleNode.dump(Ljava/lang/String;)V +METHOD|bsh.SimpleNode.prune()V +METHOD|bsh.SimpleNode.eval(Lbsh/CallStack;Lbsh/Interpreter;)Ljava/lang/Object; +METHOD|bsh.SimpleNode.setSourceFile(Ljava/lang/String;)V +METHOD|bsh.SimpleNode.getSourceFile()Ljava/lang/String; +METHOD|bsh.SimpleNode.getLineNumber()I +METHOD|bsh.SimpleNode.getText()Ljava/lang/String; +METHOD|bsh.SimpleNode.()V +METHOD|bsh.StringUtil.()V +METHOD|bsh.StringUtil.split(Ljava/lang/String;Ljava/lang/String;)[Ljava/lang/String; +METHOD|bsh.StringUtil.bubbleSort([Ljava/lang/String;)[Ljava/lang/String; +METHOD|bsh.StringUtil.maxCommonPrefix(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; +METHOD|bsh.StringUtil.methodString(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/String; +METHOD|bsh.StringUtil.normalizeClassName(Ljava/lang/Class;)Ljava/lang/String; +METHOD|bsh.TargetError.(Ljava/lang/String;Ljava/lang/Throwable;Lbsh/SimpleNode;Lbsh/CallStack;Z)V +METHOD|bsh.TargetError.(Ljava/lang/Throwable;Lbsh/SimpleNode;Lbsh/CallStack;)V +METHOD|bsh.TargetError.getTarget()Ljava/lang/Throwable; +METHOD|bsh.TargetError.toString()Ljava/lang/String; +METHOD|bsh.TargetError.printStackTrace()V +METHOD|bsh.TargetError.printStackTrace(Ljava/io/PrintStream;)V +METHOD|bsh.TargetError.printStackTrace(ZLjava/io/PrintStream;)V +METHOD|bsh.TargetError.printTargetError(Ljava/lang/Throwable;)Ljava/lang/String; +METHOD|bsh.TargetError.xPrintTargetError(Ljava/lang/Throwable;)Ljava/lang/String; +METHOD|bsh.TargetError.inNativeCode()Z +METHOD|bsh.This.getThis(Lbsh/NameSpace;Lbsh/Interpreter;)Lbsh/This; +METHOD|bsh.This.getInterface(Ljava/lang/Class;)Ljava/lang/Object; +METHOD|bsh.This.getInterface([Ljava/lang/Class;)Ljava/lang/Object; +METHOD|bsh.This.(Lbsh/NameSpace;Lbsh/Interpreter;)V +METHOD|bsh.This.getNameSpace()Lbsh/NameSpace; +METHOD|bsh.This.toString()Ljava/lang/String; +METHOD|bsh.This.run()V +METHOD|bsh.This.invokeMethod(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/Object; +METHOD|bsh.This.invokeMethod(Ljava/lang/String;[Ljava/lang/Object;Lbsh/Interpreter;Lbsh/CallStack;Lbsh/SimpleNode;Z)Ljava/lang/Object; +METHOD|bsh.This.bind(Lbsh/This;Lbsh/NameSpace;Lbsh/Interpreter;)V +METHOD|bsh.This.isExposedThisMethod(Ljava/lang/String;)Z +METHOD|bsh.Token.()V +METHOD|bsh.Token.toString()Ljava/lang/String; +METHOD|bsh.Token.newToken(I)Lbsh/Token; +METHOD|bsh.TokenMgrError.addEscapes(Ljava/lang/String;)Ljava/lang/String; +METHOD|bsh.TokenMgrError.LexicalError(ZIIILjava/lang/String;C)Ljava/lang/String; +METHOD|bsh.TokenMgrError.getMessage()Ljava/lang/String; +METHOD|bsh.TokenMgrError.()V +METHOD|bsh.TokenMgrError.(Ljava/lang/String;I)V +METHOD|bsh.TokenMgrError.(ZIIILjava/lang/String;CI)V +METHOD|bsh.Types.()V +METHOD|bsh.Types.getTypes([Ljava/lang/Object;)[Ljava/lang/Class; +METHOD|bsh.Types.isSignatureAssignable([Ljava/lang/Class;[Ljava/lang/Class;I)Z +METHOD|bsh.Types.isSignatureVarargsAssignable([Ljava/lang/Class;[Ljava/lang/Class;)Z +METHOD|bsh.Types.isJavaAssignable(Ljava/lang/Class;Ljava/lang/Class;)Z +METHOD|bsh.Types.isJavaBaseAssignable(Ljava/lang/Class;Ljava/lang/Class;)Z +METHOD|bsh.Types.isJavaBoxTypesAssignable(Ljava/lang/Class;Ljava/lang/Class;)Z +METHOD|bsh.Types.isBshAssignable(Ljava/lang/Class;Ljava/lang/Class;)Z +METHOD|bsh.Types.castObject(Ljava/lang/Object;Ljava/lang/Class;I)Ljava/lang/Object; +METHOD|bsh.Types.castObject(Ljava/lang/Class;Ljava/lang/Class;Ljava/lang/Object;IZ)Ljava/lang/Object; +METHOD|bsh.Types.castError(Ljava/lang/Class;Ljava/lang/Class;I)Lbsh/UtilEvalError; +METHOD|bsh.Types.castError(Ljava/lang/String;Ljava/lang/String;I)Lbsh/UtilEvalError; +METHOD|bsh.Types.class$(Ljava/lang/String;)Ljava/lang/Class; +METHOD|bsh.Types.()V +METHOD|bsh.UtilEvalError.()V +METHOD|bsh.UtilEvalError.(Ljava/lang/String;)V +METHOD|bsh.UtilEvalError.toEvalError(Ljava/lang/String;Lbsh/SimpleNode;Lbsh/CallStack;)Lbsh/EvalError; +METHOD|bsh.UtilEvalError.toEvalError(Lbsh/SimpleNode;Lbsh/CallStack;)Lbsh/EvalError; +METHOD|bsh.UtilTargetError.(Ljava/lang/String;Ljava/lang/Throwable;)V +METHOD|bsh.UtilTargetError.(Ljava/lang/Throwable;)V +METHOD|bsh.UtilTargetError.toEvalError(Ljava/lang/String;Lbsh/SimpleNode;Lbsh/CallStack;)Lbsh/EvalError; +METHOD|bsh.Variable.(Ljava/lang/String;Ljava/lang/Class;Lbsh/LHS;)V +METHOD|bsh.Variable.(Ljava/lang/String;Ljava/lang/Object;Lbsh/Modifiers;)V +METHOD|bsh.Variable.(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Object;Lbsh/Modifiers;)V +METHOD|bsh.Variable.(Ljava/lang/String;Ljava/lang/Class;Ljava/lang/Object;Lbsh/Modifiers;)V +METHOD|bsh.Variable.setValue(Ljava/lang/Object;I)V +METHOD|bsh.Variable.getValue()Ljava/lang/Object; +METHOD|bsh.Variable.getType()Ljava/lang/Class; +METHOD|bsh.Variable.getTypeDescriptor()Ljava/lang/String; +METHOD|bsh.Variable.getModifiers()Lbsh/Modifiers; +METHOD|bsh.Variable.getName()Ljava/lang/String; +METHOD|bsh.Variable.hasModifier(Ljava/lang/String;)Z +METHOD|bsh.Variable.toString()Ljava/lang/String; +METHOD|bsh.XThis$Handler.(Lbsh/XThis;)V +METHOD|bsh.XThis$Handler.invoke(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object; +METHOD|bsh.XThis$Handler.invokeImpl(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object; +METHOD|bsh.XThis.(Lbsh/NameSpace;Lbsh/Interpreter;)V +METHOD|bsh.XThis.toString()Ljava/lang/String; +METHOD|bsh.XThis.getInterface(Ljava/lang/Class;)Ljava/lang/Object; +METHOD|bsh.XThis.getInterface([Ljava/lang/Class;)Ljava/lang/Object; +METHOD|bsh.XThis.class$(Ljava/lang/String;)Ljava/lang/Class; +METHOD|bsh.classpath.BshClassLoader.(Lbsh/BshClassManager;[Ljava/net/URL;)V +METHOD|bsh.classpath.BshClassLoader.(Lbsh/BshClassManager;Lbsh/classpath/BshClassPath;)V +METHOD|bsh.classpath.BshClassLoader.(Lbsh/BshClassManager;)V +METHOD|bsh.classpath.BshClassLoader.addURL(Ljava/net/URL;)V +METHOD|bsh.classpath.BshClassLoader.loadClass(Ljava/lang/String;Z)Ljava/lang/Class; +METHOD|bsh.classpath.BshClassLoader.findClass(Ljava/lang/String;)Ljava/lang/Class; +METHOD|bsh.classpath.BshClassLoader.getClassManager()Lbsh/BshClassManager; +METHOD|bsh.classpath.BshClassLoader.class$(Ljava/lang/String;)Ljava/lang/Class; +METHOD|bsh.classpath.BshClassPath$AmbiguousName.()V +METHOD|bsh.classpath.BshClassPath$AmbiguousName.add(Ljava/lang/String;)V +METHOD|bsh.classpath.BshClassPath$AmbiguousName.get()Ljava/util/List; +METHOD|bsh.classpath.BshClassPath$ClassSource.()V +METHOD|bsh.classpath.BshClassPath$ClassSource.getCode(Ljava/lang/String;)[B +METHOD|bsh.classpath.BshClassPath$DirClassSource.(Ljava/io/File;)V +METHOD|bsh.classpath.BshClassPath$DirClassSource.getDir()Ljava/io/File; +METHOD|bsh.classpath.BshClassPath$DirClassSource.toString()Ljava/lang/String; +METHOD|bsh.classpath.BshClassPath$DirClassSource.getCode(Ljava/lang/String;)[B +METHOD|bsh.classpath.BshClassPath$DirClassSource.readBytesFromFile(Ljava/io/File;Ljava/lang/String;)[B +METHOD|bsh.classpath.BshClassPath$GeneratedClassSource.([B)V +METHOD|bsh.classpath.BshClassPath$GeneratedClassSource.getCode(Ljava/lang/String;)[B +METHOD|bsh.classpath.BshClassPath$JarClassSource.(Ljava/net/URL;)V +METHOD|bsh.classpath.BshClassPath$JarClassSource.getURL()Ljava/net/URL; +METHOD|bsh.classpath.BshClassPath$JarClassSource.getCode(Ljava/lang/String;)[B +METHOD|bsh.classpath.BshClassPath$JarClassSource.toString()Ljava/lang/String; +METHOD|bsh.classpath.BshClassPath$MappingFeedback.startClassMapping()V +METHOD|bsh.classpath.BshClassPath$MappingFeedback.classMapping(Ljava/lang/String;)V +METHOD|bsh.classpath.BshClassPath$MappingFeedback.errorWhileMapping(Ljava/lang/String;)V +METHOD|bsh.classpath.BshClassPath$MappingFeedback.endClassMapping()V +METHOD|bsh.classpath.BshClassPath$UnqualifiedNameTable.()V +METHOD|bsh.classpath.BshClassPath$UnqualifiedNameTable.add(Ljava/lang/String;)V +METHOD|bsh.classpath.BshClassPath.(Ljava/lang/String;)V +METHOD|bsh.classpath.BshClassPath.(Ljava/lang/String;[Ljava/net/URL;)V +METHOD|bsh.classpath.BshClassPath.setPath([Ljava/net/URL;)V +METHOD|bsh.classpath.BshClassPath.addComponent(Lbsh/classpath/BshClassPath;)V +METHOD|bsh.classpath.BshClassPath.add([Ljava/net/URL;)V +METHOD|bsh.classpath.BshClassPath.add(Ljava/net/URL;)V +METHOD|bsh.classpath.BshClassPath.getPathComponents()[Ljava/net/URL; +METHOD|bsh.classpath.BshClassPath.getClassesForPackage(Ljava/lang/String;)Ljava/util/Set; +METHOD|bsh.classpath.BshClassPath.getClassSource(Ljava/lang/String;)Lbsh/classpath/BshClassPath$ClassSource; +METHOD|bsh.classpath.BshClassPath.setClassSource(Ljava/lang/String;Lbsh/classpath/BshClassPath$ClassSource;)V +METHOD|bsh.classpath.BshClassPath.insureInitialized()V +METHOD|bsh.classpath.BshClassPath.insureInitialized(Z)V +METHOD|bsh.classpath.BshClassPath.getFullPath()Ljava/util/List; +METHOD|bsh.classpath.BshClassPath.getClassNameByUnqName(Ljava/lang/String;)Ljava/lang/String; +METHOD|bsh.classpath.BshClassPath.getUnqualifiedNameTable()Lbsh/classpath/BshClassPath$UnqualifiedNameTable; +METHOD|bsh.classpath.BshClassPath.buildUnqualifiedNameTable()Lbsh/classpath/BshClassPath$UnqualifiedNameTable; +METHOD|bsh.classpath.BshClassPath.getAllNames()[Ljava/lang/String; +METHOD|bsh.classpath.BshClassPath.map([Ljava/net/URL;)V +METHOD|bsh.classpath.BshClassPath.map(Ljava/net/URL;)V +METHOD|bsh.classpath.BshClassPath.map([Ljava/lang/String;Ljava/lang/Object;)V +METHOD|bsh.classpath.BshClassPath.mapClass(Ljava/lang/String;Ljava/lang/Object;)V +METHOD|bsh.classpath.BshClassPath.reset()V +METHOD|bsh.classpath.BshClassPath.clearCachedStructures()V +METHOD|bsh.classpath.BshClassPath.classPathChanged()V +METHOD|bsh.classpath.BshClassPath.traverseDirForClasses(Ljava/io/File;)[Ljava/lang/String; +METHOD|bsh.classpath.BshClassPath.traverseDirForClassesAux(Ljava/io/File;Ljava/io/File;)Ljava/util/List; +METHOD|bsh.classpath.BshClassPath.searchJarForClasses(Ljava/net/URL;)[Ljava/lang/String; +METHOD|bsh.classpath.BshClassPath.isClassFileName(Ljava/lang/String;)Z +METHOD|bsh.classpath.BshClassPath.isArchiveFileName(Ljava/lang/String;)Z +METHOD|bsh.classpath.BshClassPath.canonicalizeClassName(Ljava/lang/String;)Ljava/lang/String; +METHOD|bsh.classpath.BshClassPath.splitClassname(Ljava/lang/String;)[Ljava/lang/String; +METHOD|bsh.classpath.BshClassPath.removeInnerClassNames(Ljava/util/Collection;)Ljava/util/Collection; +METHOD|bsh.classpath.BshClassPath.getUserClassPathComponents()[Ljava/net/URL; +METHOD|bsh.classpath.BshClassPath.getPackagesSet()Ljava/util/Set; +METHOD|bsh.classpath.BshClassPath.addListener(Lbsh/classpath/ClassPathListener;)V +METHOD|bsh.classpath.BshClassPath.removeListener(Lbsh/classpath/ClassPathListener;)V +METHOD|bsh.classpath.BshClassPath.notifyListeners()V +METHOD|bsh.classpath.BshClassPath.getUserClassPath()Lbsh/classpath/BshClassPath; +METHOD|bsh.classpath.BshClassPath.getBootClassPath()Lbsh/classpath/BshClassPath; +METHOD|bsh.classpath.BshClassPath.getRTJarPath()Ljava/lang/String; +METHOD|bsh.classpath.BshClassPath.main([Ljava/lang/String;)V +METHOD|bsh.classpath.BshClassPath.toString()Ljava/lang/String; +METHOD|bsh.classpath.BshClassPath.nameSpaceChanged()V +METHOD|bsh.classpath.BshClassPath.addNameSourceListener(Lbsh/NameSource$Listener;)V +METHOD|bsh.classpath.BshClassPath.addMappingFeedback(Lbsh/classpath/BshClassPath$MappingFeedback;)V +METHOD|bsh.classpath.BshClassPath.startClassMapping()V +METHOD|bsh.classpath.BshClassPath.classMapping(Ljava/lang/String;)V +METHOD|bsh.classpath.BshClassPath.errorWhileMapping(Ljava/lang/String;)V +METHOD|bsh.classpath.BshClassPath.endClassMapping()V +METHOD|bsh.classpath.BshClassPath.class$(Ljava/lang/String;)Ljava/lang/Class; +METHOD|bsh.classpath.ClassManagerImpl.()V +METHOD|bsh.classpath.ClassManagerImpl.classForName(Ljava/lang/String;)Ljava/lang/Class; +METHOD|bsh.classpath.ClassManagerImpl.getResource(Ljava/lang/String;)Ljava/net/URL; +METHOD|bsh.classpath.ClassManagerImpl.getResourceAsStream(Ljava/lang/String;)Ljava/io/InputStream; +METHOD|bsh.classpath.ClassManagerImpl.getLoaderForClass(Ljava/lang/String;)Ljava/lang/ClassLoader; +METHOD|bsh.classpath.ClassManagerImpl.addClassPath(Ljava/net/URL;)V +METHOD|bsh.classpath.ClassManagerImpl.reset()V +METHOD|bsh.classpath.ClassManagerImpl.setClassPath([Ljava/net/URL;)V +METHOD|bsh.classpath.ClassManagerImpl.reloadAllClasses()V +METHOD|bsh.classpath.ClassManagerImpl.initBaseLoader()V +METHOD|bsh.classpath.ClassManagerImpl.reloadClasses([Ljava/lang/String;)V +METHOD|bsh.classpath.ClassManagerImpl.reloadPackage(Ljava/lang/String;)V +METHOD|bsh.classpath.ClassManagerImpl.getClassPath()Lbsh/classpath/BshClassPath; +METHOD|bsh.classpath.ClassManagerImpl.doSuperImport()V +METHOD|bsh.classpath.ClassManagerImpl.hasSuperImport()Z +METHOD|bsh.classpath.ClassManagerImpl.getClassNameByUnqName(Ljava/lang/String;)Ljava/lang/String; +METHOD|bsh.classpath.ClassManagerImpl.addListener(Lbsh/BshClassManager$Listener;)V +METHOD|bsh.classpath.ClassManagerImpl.removeListener(Lbsh/BshClassManager$Listener;)V +METHOD|bsh.classpath.ClassManagerImpl.getBaseLoader()Ljava/lang/ClassLoader; +METHOD|bsh.classpath.ClassManagerImpl.defineClass(Ljava/lang/String;[B)Ljava/lang/Class; +METHOD|bsh.classpath.ClassManagerImpl.classLoaderChanged()V +METHOD|bsh.classpath.ClassManagerImpl.dump(Ljava/io/PrintWriter;)V +METHOD|bsh.classpath.ClassManagerImpl.class$(Ljava/lang/String;)Ljava/lang/Class; +METHOD|bsh.classpath.ClassPathListener.classPathChanged()V +METHOD|bsh.classpath.DiscreteFilesClassLoader$ClassSourceMap.()V +METHOD|bsh.classpath.DiscreteFilesClassLoader$ClassSourceMap.put(Ljava/lang/String;Lbsh/classpath/BshClassPath$ClassSource;)V +METHOD|bsh.classpath.DiscreteFilesClassLoader$ClassSourceMap.get(Ljava/lang/String;)Lbsh/classpath/BshClassPath$ClassSource; +METHOD|bsh.classpath.DiscreteFilesClassLoader.(Lbsh/BshClassManager;Lbsh/classpath/DiscreteFilesClassLoader$ClassSourceMap;)V +METHOD|bsh.classpath.DiscreteFilesClassLoader.findClass(Ljava/lang/String;)Ljava/lang/Class; +METHOD|bsh.classpath.DiscreteFilesClassLoader.toString()Ljava/lang/String; +METHOD|bsh.collection.CollectionIterator.(Ljava/lang/Object;)V +METHOD|bsh.collection.CollectionIterator.createIterator(Ljava/lang/Object;)Ljava/util/Iterator; +METHOD|bsh.collection.CollectionIterator.next()Ljava/lang/Object; +METHOD|bsh.collection.CollectionIterator.hasNext()Z +METHOD|bsh.collection.CollectionManagerImpl.()V +METHOD|bsh.collection.CollectionManagerImpl.getBshIterator(Ljava/lang/Object;)Lbsh/BshIterator; +METHOD|bsh.collection.CollectionManagerImpl.isMap(Ljava/lang/Object;)Z +METHOD|bsh.collection.CollectionManagerImpl.getFromMap(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; +METHOD|bsh.collection.CollectionManagerImpl.putInMap(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; +METHOD|bsh.commands.dir.()V +METHOD|bsh.commands.dir.usage()Ljava/lang/String; +METHOD|bsh.commands.dir.invoke(Lbsh/Interpreter;Lbsh/CallStack;)V +METHOD|bsh.commands.dir.invoke(Lbsh/Interpreter;Lbsh/CallStack;Ljava/lang/String;)V +METHOD|bsh.commands.dir.()V +METHOD|bsh.org.objectweb.asm.ByteVector.()V +METHOD|bsh.org.objectweb.asm.ByteVector.(I)V +METHOD|bsh.org.objectweb.asm.ByteVector.put1(I)Lbsh/org/objectweb/asm/ByteVector; +METHOD|bsh.org.objectweb.asm.ByteVector.put11(II)Lbsh/org/objectweb/asm/ByteVector; +METHOD|bsh.org.objectweb.asm.ByteVector.put2(I)Lbsh/org/objectweb/asm/ByteVector; +METHOD|bsh.org.objectweb.asm.ByteVector.put12(II)Lbsh/org/objectweb/asm/ByteVector; +METHOD|bsh.org.objectweb.asm.ByteVector.put4(I)Lbsh/org/objectweb/asm/ByteVector; +METHOD|bsh.org.objectweb.asm.ByteVector.put8(J)Lbsh/org/objectweb/asm/ByteVector; +METHOD|bsh.org.objectweb.asm.ByteVector.putUTF(Ljava/lang/String;)Lbsh/org/objectweb/asm/ByteVector; +METHOD|bsh.org.objectweb.asm.ByteVector.putByteArray([BII)Lbsh/org/objectweb/asm/ByteVector; +METHOD|bsh.org.objectweb.asm.ByteVector.enlarge(I)V +METHOD|bsh.org.objectweb.asm.ClassVisitor.visit(ILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V +METHOD|bsh.org.objectweb.asm.ClassVisitor.visitInnerClass(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;I)V +METHOD|bsh.org.objectweb.asm.ClassVisitor.visitField(ILjava/lang/String;Ljava/lang/String;Ljava/lang/Object;)V +METHOD|bsh.org.objectweb.asm.ClassVisitor.visitMethod(ILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;)Lbsh/org/objectweb/asm/CodeVisitor; +METHOD|bsh.org.objectweb.asm.ClassVisitor.visitEnd()V +METHOD|bsh.org.objectweb.asm.ClassWriter.(Z)V +METHOD|bsh.org.objectweb.asm.ClassWriter.visit(ILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V +METHOD|bsh.org.objectweb.asm.ClassWriter.visitInnerClass(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;I)V +METHOD|bsh.org.objectweb.asm.ClassWriter.visitField(ILjava/lang/String;Ljava/lang/String;Ljava/lang/Object;)V +METHOD|bsh.org.objectweb.asm.ClassWriter.visitMethod(ILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;)Lbsh/org/objectweb/asm/CodeVisitor; +METHOD|bsh.org.objectweb.asm.ClassWriter.visitEnd()V +METHOD|bsh.org.objectweb.asm.ClassWriter.toByteArray()[B +METHOD|bsh.org.objectweb.asm.ClassWriter.newCst(Ljava/lang/Object;)Lbsh/org/objectweb/asm/Item; +METHOD|bsh.org.objectweb.asm.ClassWriter.newUTF8(Ljava/lang/String;)Lbsh/org/objectweb/asm/Item; +METHOD|bsh.org.objectweb.asm.ClassWriter.newClass(Ljava/lang/String;)Lbsh/org/objectweb/asm/Item; +METHOD|bsh.org.objectweb.asm.ClassWriter.newField(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lbsh/org/objectweb/asm/Item; +METHOD|bsh.org.objectweb.asm.ClassWriter.newMethod(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lbsh/org/objectweb/asm/Item; +METHOD|bsh.org.objectweb.asm.ClassWriter.newItfMethod(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lbsh/org/objectweb/asm/Item; +METHOD|bsh.org.objectweb.asm.ClassWriter.newInteger(I)Lbsh/org/objectweb/asm/Item; +METHOD|bsh.org.objectweb.asm.ClassWriter.newFloat(F)Lbsh/org/objectweb/asm/Item; +METHOD|bsh.org.objectweb.asm.ClassWriter.newLong(J)Lbsh/org/objectweb/asm/Item; +METHOD|bsh.org.objectweb.asm.ClassWriter.newDouble(D)Lbsh/org/objectweb/asm/Item; +METHOD|bsh.org.objectweb.asm.ClassWriter.newString(Ljava/lang/String;)Lbsh/org/objectweb/asm/Item; +METHOD|bsh.org.objectweb.asm.ClassWriter.newNameType(Ljava/lang/String;Ljava/lang/String;)Lbsh/org/objectweb/asm/Item; +METHOD|bsh.org.objectweb.asm.ClassWriter.get(Lbsh/org/objectweb/asm/Item;)Lbsh/org/objectweb/asm/Item; +METHOD|bsh.org.objectweb.asm.ClassWriter.put(Lbsh/org/objectweb/asm/Item;)V +METHOD|bsh.org.objectweb.asm.ClassWriter.put122(III)V +METHOD|bsh.org.objectweb.asm.ClassWriter.()V +METHOD|bsh.org.objectweb.asm.CodeVisitor.visitInsn(I)V +METHOD|bsh.org.objectweb.asm.CodeVisitor.visitIntInsn(II)V +METHOD|bsh.org.objectweb.asm.CodeVisitor.visitVarInsn(II)V +METHOD|bsh.org.objectweb.asm.CodeVisitor.visitTypeInsn(ILjava/lang/String;)V +METHOD|bsh.org.objectweb.asm.CodeVisitor.visitFieldInsn(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V +METHOD|bsh.org.objectweb.asm.CodeVisitor.visitMethodInsn(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V +METHOD|bsh.org.objectweb.asm.CodeVisitor.visitJumpInsn(ILbsh/org/objectweb/asm/Label;)V +METHOD|bsh.org.objectweb.asm.CodeVisitor.visitLabel(Lbsh/org/objectweb/asm/Label;)V +METHOD|bsh.org.objectweb.asm.CodeVisitor.visitLdcInsn(Ljava/lang/Object;)V +METHOD|bsh.org.objectweb.asm.CodeVisitor.visitIincInsn(II)V +METHOD|bsh.org.objectweb.asm.CodeVisitor.visitTableSwitchInsn(IILbsh/org/objectweb/asm/Label;[Lbsh/org/objectweb/asm/Label;)V +METHOD|bsh.org.objectweb.asm.CodeVisitor.visitLookupSwitchInsn(Lbsh/org/objectweb/asm/Label;[I[Lbsh/org/objectweb/asm/Label;)V +METHOD|bsh.org.objectweb.asm.CodeVisitor.visitMultiANewArrayInsn(Ljava/lang/String;I)V +METHOD|bsh.org.objectweb.asm.CodeVisitor.visitTryCatchBlock(Lbsh/org/objectweb/asm/Label;Lbsh/org/objectweb/asm/Label;Lbsh/org/objectweb/asm/Label;Ljava/lang/String;)V +METHOD|bsh.org.objectweb.asm.CodeVisitor.visitMaxs(II)V +METHOD|bsh.org.objectweb.asm.CodeVisitor.visitLocalVariable(Ljava/lang/String;Ljava/lang/String;Lbsh/org/objectweb/asm/Label;Lbsh/org/objectweb/asm/Label;I)V +METHOD|bsh.org.objectweb.asm.CodeVisitor.visitLineNumber(ILbsh/org/objectweb/asm/Label;)V +METHOD|bsh.org.objectweb.asm.CodeWriter.(Lbsh/org/objectweb/asm/ClassWriter;Z)V +METHOD|bsh.org.objectweb.asm.CodeWriter.init(ILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;)V +METHOD|bsh.org.objectweb.asm.CodeWriter.visitInsn(I)V +METHOD|bsh.org.objectweb.asm.CodeWriter.visitIntInsn(II)V +METHOD|bsh.org.objectweb.asm.CodeWriter.visitVarInsn(II)V +METHOD|bsh.org.objectweb.asm.CodeWriter.visitTypeInsn(ILjava/lang/String;)V +METHOD|bsh.org.objectweb.asm.CodeWriter.visitFieldInsn(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V +METHOD|bsh.org.objectweb.asm.CodeWriter.visitMethodInsn(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V +METHOD|bsh.org.objectweb.asm.CodeWriter.visitJumpInsn(ILbsh/org/objectweb/asm/Label;)V +METHOD|bsh.org.objectweb.asm.CodeWriter.visitLabel(Lbsh/org/objectweb/asm/Label;)V +METHOD|bsh.org.objectweb.asm.CodeWriter.visitLdcInsn(Ljava/lang/Object;)V +METHOD|bsh.org.objectweb.asm.CodeWriter.visitIincInsn(II)V +METHOD|bsh.org.objectweb.asm.CodeWriter.visitTableSwitchInsn(IILbsh/org/objectweb/asm/Label;[Lbsh/org/objectweb/asm/Label;)V +METHOD|bsh.org.objectweb.asm.CodeWriter.visitLookupSwitchInsn(Lbsh/org/objectweb/asm/Label;[I[Lbsh/org/objectweb/asm/Label;)V +METHOD|bsh.org.objectweb.asm.CodeWriter.visitMultiANewArrayInsn(Ljava/lang/String;I)V +METHOD|bsh.org.objectweb.asm.CodeWriter.visitTryCatchBlock(Lbsh/org/objectweb/asm/Label;Lbsh/org/objectweb/asm/Label;Lbsh/org/objectweb/asm/Label;Ljava/lang/String;)V +METHOD|bsh.org.objectweb.asm.CodeWriter.visitMaxs(II)V +METHOD|bsh.org.objectweb.asm.CodeWriter.visitLocalVariable(Ljava/lang/String;Ljava/lang/String;Lbsh/org/objectweb/asm/Label;Lbsh/org/objectweb/asm/Label;I)V +METHOD|bsh.org.objectweb.asm.CodeWriter.visitLineNumber(ILbsh/org/objectweb/asm/Label;)V +METHOD|bsh.org.objectweb.asm.CodeWriter.getArgumentsAndReturnSizes(Ljava/lang/String;)I +METHOD|bsh.org.objectweb.asm.CodeWriter.addSuccessor(ILbsh/org/objectweb/asm/Label;)V +METHOD|bsh.org.objectweb.asm.CodeWriter.getSize()I +METHOD|bsh.org.objectweb.asm.CodeWriter.put(Lbsh/org/objectweb/asm/ByteVector;)V +METHOD|bsh.org.objectweb.asm.CodeWriter.resizeInstructions([I[II)[I +METHOD|bsh.org.objectweb.asm.CodeWriter.readUnsignedShort([BI)I +METHOD|bsh.org.objectweb.asm.CodeWriter.readShort([BI)S +METHOD|bsh.org.objectweb.asm.CodeWriter.readInt([BI)I +METHOD|bsh.org.objectweb.asm.CodeWriter.writeShort([BII)V +METHOD|bsh.org.objectweb.asm.CodeWriter.getNewOffset([I[III)I +METHOD|bsh.org.objectweb.asm.CodeWriter.getCodeSize()I +METHOD|bsh.org.objectweb.asm.CodeWriter.getCode()[B +METHOD|bsh.org.objectweb.asm.CodeWriter.()V +METHOD|bsh.org.objectweb.asm.Edge.()V +METHOD|bsh.org.objectweb.asm.Item.()V +METHOD|bsh.org.objectweb.asm.Item.(SLbsh/org/objectweb/asm/Item;)V +METHOD|bsh.org.objectweb.asm.Item.set(I)V +METHOD|bsh.org.objectweb.asm.Item.set(J)V +METHOD|bsh.org.objectweb.asm.Item.set(F)V +METHOD|bsh.org.objectweb.asm.Item.set(D)V +METHOD|bsh.org.objectweb.asm.Item.set(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V +METHOD|bsh.org.objectweb.asm.Item.isEqualTo(Lbsh/org/objectweb/asm/Item;)Z +METHOD|bsh.org.objectweb.asm.Label.()V +METHOD|bsh.org.objectweb.asm.Label.put(Lbsh/org/objectweb/asm/CodeWriter;Lbsh/org/objectweb/asm/ByteVector;IZ)V +METHOD|bsh.org.objectweb.asm.Label.addReference(II)V +METHOD|bsh.org.objectweb.asm.Label.resolve(Lbsh/org/objectweb/asm/CodeWriter;I[B)Z +METHOD|bsh.org.objectweb.asm.Type.(I)V +METHOD|bsh.org.objectweb.asm.Type.(I[CII)V +METHOD|bsh.org.objectweb.asm.Type.getType(Ljava/lang/String;)Lbsh/org/objectweb/asm/Type; +METHOD|bsh.org.objectweb.asm.Type.getType(Ljava/lang/Class;)Lbsh/org/objectweb/asm/Type; +METHOD|bsh.org.objectweb.asm.Type.getArgumentTypes(Ljava/lang/String;)[Lbsh/org/objectweb/asm/Type; +METHOD|bsh.org.objectweb.asm.Type.getArgumentTypes(Ljava/lang/reflect/Method;)[Lbsh/org/objectweb/asm/Type; +METHOD|bsh.org.objectweb.asm.Type.getReturnType(Ljava/lang/String;)Lbsh/org/objectweb/asm/Type; +METHOD|bsh.org.objectweb.asm.Type.getReturnType(Ljava/lang/reflect/Method;)Lbsh/org/objectweb/asm/Type; +METHOD|bsh.org.objectweb.asm.Type.getType([CI)Lbsh/org/objectweb/asm/Type; +METHOD|bsh.org.objectweb.asm.Type.getSort()I +METHOD|bsh.org.objectweb.asm.Type.getDimensions()I +METHOD|bsh.org.objectweb.asm.Type.getElementType()Lbsh/org/objectweb/asm/Type; +METHOD|bsh.org.objectweb.asm.Type.getClassName()Ljava/lang/String; +METHOD|bsh.org.objectweb.asm.Type.getInternalName()Ljava/lang/String; +METHOD|bsh.org.objectweb.asm.Type.getDescriptor()Ljava/lang/String; +METHOD|bsh.org.objectweb.asm.Type.getMethodDescriptor(Lbsh/org/objectweb/asm/Type;[Lbsh/org/objectweb/asm/Type;)Ljava/lang/String; +METHOD|bsh.org.objectweb.asm.Type.getDescriptor(Ljava/lang/StringBuffer;)V +METHOD|bsh.org.objectweb.asm.Type.getInternalName(Ljava/lang/Class;)Ljava/lang/String; +METHOD|bsh.org.objectweb.asm.Type.getDescriptor(Ljava/lang/Class;)Ljava/lang/String; +METHOD|bsh.org.objectweb.asm.Type.getMethodDescriptor(Ljava/lang/reflect/Method;)Ljava/lang/String; +METHOD|bsh.org.objectweb.asm.Type.getDescriptor(Ljava/lang/StringBuffer;Ljava/lang/Class;)V +METHOD|bsh.org.objectweb.asm.Type.getSize()I +METHOD|bsh.org.objectweb.asm.Type.getOpcode(I)I +METHOD|bsh.org.objectweb.asm.Type.()V +METHOD|bsh.reflect.ReflectManagerImpl.()V +METHOD|bsh.reflect.ReflectManagerImpl.setAccessible(Ljava/lang/Object;)Z +METHOD|bsh.servlet.BshServlet.()V +METHOD|bsh.servlet.BshServlet.getBshVersion()Ljava/lang/String; +METHOD|bsh.servlet.BshServlet.doGet(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V +METHOD|bsh.servlet.BshServlet.sendHTML(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Ljava/lang/String;Ljava/lang/Exception;Ljava/lang/Object;Ljava/lang/StringBuffer;Z)V +METHOD|bsh.servlet.BshServlet.sendRaw(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Ljava/lang/Exception;Ljava/lang/Object;Ljava/lang/StringBuffer;)V +METHOD|bsh.servlet.BshServlet.formatScriptResultHTML(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Exception;Ljava/lang/StringBuffer;)Ljava/lang/String; +METHOD|bsh.servlet.BshServlet.showScriptContextHTML(Ljava/lang/String;II)Ljava/lang/String; +METHOD|bsh.servlet.BshServlet.doPost(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V +METHOD|bsh.servlet.BshServlet.evalScript(Ljava/lang/String;Ljava/lang/StringBuffer;ZLjavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)Ljava/lang/Object; +METHOD|bsh.servlet.BshServlet.escape(Ljava/lang/String;)Ljava/lang/String; +METHOD|bsh.servlet.BshServlet.class$(Ljava/lang/String;)Ljava/lang/Class; +METHOD|bsh.servlet.BshServlet.()V +METHOD|bsh.servlet.SimpleTemplate.getTemplate(Ljava/lang/String;)Lbsh/servlet/SimpleTemplate; +METHOD|bsh.servlet.SimpleTemplate.getStringFromStream(Ljava/io/InputStream;)Ljava/lang/String; +METHOD|bsh.servlet.SimpleTemplate.getStringFromStream(Ljava/io/Reader;)Ljava/lang/String; +METHOD|bsh.servlet.SimpleTemplate.(Ljava/lang/String;)V +METHOD|bsh.servlet.SimpleTemplate.(Ljava/io/Reader;)V +METHOD|bsh.servlet.SimpleTemplate.(Ljava/net/URL;)V +METHOD|bsh.servlet.SimpleTemplate.init(Ljava/lang/String;)V +METHOD|bsh.servlet.SimpleTemplate.replace(Ljava/lang/String;Ljava/lang/String;)V +METHOD|bsh.servlet.SimpleTemplate.findTemplate(Ljava/lang/String;)[I +METHOD|bsh.servlet.SimpleTemplate.toString()Ljava/lang/String; +METHOD|bsh.servlet.SimpleTemplate.write(Ljava/io/PrintWriter;)V +METHOD|bsh.servlet.SimpleTemplate.write(Ljava/io/PrintStream;)V +METHOD|bsh.servlet.SimpleTemplate.main([Ljava/lang/String;)V +METHOD|bsh.servlet.SimpleTemplate.setCacheTemplates(Z)V +METHOD|bsh.servlet.SimpleTemplate.()V +METHOD|bsh.util.AWTConsole$1.(Ljava/awt/Frame;)V +METHOD|bsh.util.AWTConsole$1.windowClosing(Ljava/awt/event/WindowEvent;)V +METHOD|bsh.util.AWTConsole.getIn()Ljava/io/Reader; +METHOD|bsh.util.AWTConsole.getOut()Ljava/io/PrintStream; +METHOD|bsh.util.AWTConsole.getErr()Ljava/io/PrintStream; +METHOD|bsh.util.AWTConsole.(IILjava/io/InputStream;Ljava/io/OutputStream;)V +METHOD|bsh.util.AWTConsole.keyPressed(Ljava/awt/event/KeyEvent;)V +METHOD|bsh.util.AWTConsole.()V +METHOD|bsh.util.AWTConsole.(Ljava/io/InputStream;Ljava/io/OutputStream;)V +METHOD|bsh.util.AWTConsole.type(ICI)V +METHOD|bsh.util.AWTConsole.doChar(C)V +METHOD|bsh.util.AWTConsole.enter()V +METHOD|bsh.util.AWTConsole.setCaretPosition(I)V +METHOD|bsh.util.AWTConsole.countNLs()I +METHOD|bsh.util.AWTConsole.historyUp()V +METHOD|bsh.util.AWTConsole.historyDown()V +METHOD|bsh.util.AWTConsole.showHistoryLine()V +METHOD|bsh.util.AWTConsole.acceptLine(Ljava/lang/String;)V +METHOD|bsh.util.AWTConsole.println(Ljava/lang/Object;)V +METHOD|bsh.util.AWTConsole.error(Ljava/lang/Object;)V +METHOD|bsh.util.AWTConsole.print(Ljava/lang/Object;Ljava/awt/Color;)V +METHOD|bsh.util.AWTConsole.print(Ljava/lang/Object;)V +METHOD|bsh.util.AWTConsole.inPipeWatcher()V +METHOD|bsh.util.AWTConsole.run()V +METHOD|bsh.util.AWTConsole.main([Ljava/lang/String;)V +METHOD|bsh.util.AWTConsole.toString()Ljava/lang/String; +METHOD|bsh.util.AWTConsole.keyTyped(Ljava/awt/event/KeyEvent;)V +METHOD|bsh.util.AWTConsole.keyReleased(Ljava/awt/event/KeyEvent;)V +METHOD|bsh.util.AWTDemoApplet.()V +METHOD|bsh.util.AWTDemoApplet.init()V +METHOD|bsh.util.AWTRemoteApplet.()V +METHOD|bsh.util.AWTRemoteApplet.init()V +METHOD|bsh.util.BeanShellBSFEngine.()V +METHOD|bsh.util.BeanShellBSFEngine.initialize(Lorg/apache/bsf/BSFManager;Ljava/lang/String;Ljava/util/Vector;)V +METHOD|bsh.util.BeanShellBSFEngine.setDebug(Z)V +METHOD|bsh.util.BeanShellBSFEngine.call(Ljava/lang/Object;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/Object; +METHOD|bsh.util.BeanShellBSFEngine.apply(Ljava/lang/String;IILjava/lang/Object;Ljava/util/Vector;Ljava/util/Vector;)Ljava/lang/Object; +METHOD|bsh.util.BeanShellBSFEngine.eval(Ljava/lang/String;IILjava/lang/Object;)Ljava/lang/Object; +METHOD|bsh.util.BeanShellBSFEngine.exec(Ljava/lang/String;IILjava/lang/Object;)V +METHOD|bsh.util.BeanShellBSFEngine.declareBean(Lorg/apache/bsf/BSFDeclaredBean;)V +METHOD|bsh.util.BeanShellBSFEngine.undeclareBean(Lorg/apache/bsf/BSFDeclaredBean;)V +METHOD|bsh.util.BeanShellBSFEngine.terminate()V +METHOD|bsh.util.BeanShellBSFEngine.sourceInfo(Ljava/lang/String;II)Ljava/lang/String; +METHOD|bsh.util.BshCanvas.()V +METHOD|bsh.util.BshCanvas.(Lbsh/This;)V +METHOD|bsh.util.BshCanvas.paintComponent(Ljava/awt/Graphics;)V +METHOD|bsh.util.BshCanvas.getBufferedGraphics()Ljava/awt/Graphics; +METHOD|bsh.util.BshCanvas.setBounds(IIII)V +METHOD|bsh.util.ClassBrowser$1.(Lbsh/util/ClassBrowser;)V +METHOD|bsh.util.ClassBrowser$1.valueChanged(Ljavax/swing/event/TreeSelectionEvent;)V +METHOD|bsh.util.ClassBrowser$2.(Lbsh/util/ClassBrowser;)V +METHOD|bsh.util.ClassBrowser$2.valueChanged(Ljavax/swing/event/TreeSelectionEvent;)V +METHOD|bsh.util.ClassBrowser$PackageTree.(Lbsh/util/ClassBrowser;Ljava/util/Collection;)V +METHOD|bsh.util.ClassBrowser$PackageTree.setPackages(Ljava/util/Collection;)V +METHOD|bsh.util.ClassBrowser$PackageTree.makeTreeModel(Ljava/util/Collection;)Ljavax/swing/tree/DefaultTreeModel; +METHOD|bsh.util.ClassBrowser$PackageTree.makeNode(Ljava/util/Map;Ljava/lang/String;)Ljavax/swing/tree/MutableTreeNode; +METHOD|bsh.util.ClassBrowser$PackageTree.mapNodes(Ljavax/swing/tree/TreeNode;)V +METHOD|bsh.util.ClassBrowser$PackageTree.addNodeMap(Ljavax/swing/tree/TreeNode;)V +METHOD|bsh.util.ClassBrowser$PackageTree.setSelectedPackage(Ljava/lang/String;)V +METHOD|bsh.util.ClassBrowser.()V +METHOD|bsh.util.ClassBrowser.(Lbsh/BshClassManager;)V +METHOD|bsh.util.ClassBrowser.toSortedStrings(Ljava/util/Collection;)[Ljava/lang/String; +METHOD|bsh.util.ClassBrowser.setClist(Ljava/lang/String;)V +METHOD|bsh.util.ClassBrowser.parseConstructors([Ljava/lang/reflect/Constructor;)[Ljava/lang/String; +METHOD|bsh.util.ClassBrowser.parseMethods([Ljava/lang/reflect/Method;)[Ljava/lang/String; +METHOD|bsh.util.ClassBrowser.parseFields([Ljava/lang/reflect/Field;)[Ljava/lang/String; +METHOD|bsh.util.ClassBrowser.getPublicConstructors([Ljava/lang/reflect/Constructor;)[Ljava/lang/reflect/Constructor; +METHOD|bsh.util.ClassBrowser.getPublicMethods([Ljava/lang/reflect/Method;)[Ljava/lang/reflect/Method; +METHOD|bsh.util.ClassBrowser.getPublicFields([Ljava/lang/reflect/Field;)[Ljava/lang/reflect/Field; +METHOD|bsh.util.ClassBrowser.setConslist(Ljava/lang/Class;)V +METHOD|bsh.util.ClassBrowser.setMlist(Ljava/lang/String;)V +METHOD|bsh.util.ClassBrowser.setFieldList(Ljava/lang/Class;)V +METHOD|bsh.util.ClassBrowser.setMethodLine(Ljava/lang/Object;)V +METHOD|bsh.util.ClassBrowser.setClassTree(Ljava/lang/Class;)V +METHOD|bsh.util.ClassBrowser.labeledPane(Ljavax/swing/JComponent;Ljava/lang/String;)Ljavax/swing/JPanel; +METHOD|bsh.util.ClassBrowser.init()V +METHOD|bsh.util.ClassBrowser.splitPane(IZLjavax/swing/JComponent;Ljavax/swing/JComponent;)Ljavax/swing/JSplitPane; +METHOD|bsh.util.ClassBrowser.main([Ljava/lang/String;)V +METHOD|bsh.util.ClassBrowser.setFrame(Ljavax/swing/JFrame;)V +METHOD|bsh.util.ClassBrowser.setFrame(Ljavax/swing/JInternalFrame;)V +METHOD|bsh.util.ClassBrowser.valueChanged(Ljavax/swing/event/ListSelectionEvent;)V +METHOD|bsh.util.ClassBrowser.driveToClass(Ljava/lang/String;)V +METHOD|bsh.util.ClassBrowser.toFront()V +METHOD|bsh.util.ClassBrowser.classPathChanged()V +METHOD|bsh.util.ClassBrowser.()V +METHOD|bsh.util.GUIConsoleInterface.print(Ljava/lang/Object;Ljava/awt/Color;)V +METHOD|bsh.util.GUIConsoleInterface.setNameCompletion(Lbsh/util/NameCompletion;)V +METHOD|bsh.util.GUIConsoleInterface.setWaitFeedback(Z)V +METHOD|bsh.util.Httpd.main([Ljava/lang/String;)V +METHOD|bsh.util.Httpd.(I)V +METHOD|bsh.util.Httpd.run()V +METHOD|bsh.util.HttpdConnection.(Ljava/net/Socket;)V +METHOD|bsh.util.HttpdConnection.run()V +METHOD|bsh.util.HttpdConnection.serveFile(Ljava/lang/String;)V +METHOD|bsh.util.HttpdConnection.sendFileData(Ljava/lang/String;)V +METHOD|bsh.util.HttpdConnection.error(ILjava/lang/String;)V +METHOD|bsh.util.JConsole$1.(Lbsh/util/JConsole;Ljavax/swing/text/StyledDocument;)V +METHOD|bsh.util.JConsole$1.cut()V +METHOD|bsh.util.JConsole$1.paste()V +METHOD|bsh.util.JConsole$2.(Lbsh/util/JConsole;Ljava/lang/Object;)V +METHOD|bsh.util.JConsole$2.run()V +METHOD|bsh.util.JConsole$3.(Lbsh/util/JConsole;Ljavax/swing/Icon;)V +METHOD|bsh.util.JConsole$3.run()V +METHOD|bsh.util.JConsole$4.(Lbsh/util/JConsole;Ljava/awt/Font;Ljava/awt/Color;Ljava/lang/Object;)V +METHOD|bsh.util.JConsole$4.run()V +METHOD|bsh.util.JConsole$5.(Lbsh/util/JConsole;Ljava/lang/String;ILjava/awt/Color;ZZZLjava/lang/Object;)V +METHOD|bsh.util.JConsole$5.run()V +METHOD|bsh.util.JConsole$BlockingPipedInputStream.(Ljava/io/PipedOutputStream;)V +METHOD|bsh.util.JConsole$BlockingPipedInputStream.read()I +METHOD|bsh.util.JConsole$BlockingPipedInputStream.close()V +METHOD|bsh.util.JConsole.getInputStream()Ljava/io/InputStream; +METHOD|bsh.util.JConsole.getIn()Ljava/io/Reader; +METHOD|bsh.util.JConsole.getOut()Ljava/io/PrintStream; +METHOD|bsh.util.JConsole.getErr()Ljava/io/PrintStream; +METHOD|bsh.util.JConsole.()V +METHOD|bsh.util.JConsole.(Ljava/io/InputStream;Ljava/io/OutputStream;)V +METHOD|bsh.util.JConsole.requestFocus()V +METHOD|bsh.util.JConsole.keyPressed(Ljava/awt/event/KeyEvent;)V +METHOD|bsh.util.JConsole.keyTyped(Ljava/awt/event/KeyEvent;)V +METHOD|bsh.util.JConsole.keyReleased(Ljava/awt/event/KeyEvent;)V +METHOD|bsh.util.JConsole.type(Ljava/awt/event/KeyEvent;)V +METHOD|bsh.util.JConsole.doCommandCompletion(Ljava/lang/String;)V +METHOD|bsh.util.JConsole.resetCommandStart()V +METHOD|bsh.util.JConsole.append(Ljava/lang/String;)V +METHOD|bsh.util.JConsole.replaceRange(Ljava/lang/Object;II)Ljava/lang/String; +METHOD|bsh.util.JConsole.forceCaretMoveToEnd()V +METHOD|bsh.util.JConsole.forceCaretMoveToStart()V +METHOD|bsh.util.JConsole.enter()V +METHOD|bsh.util.JConsole.getCmd()Ljava/lang/String; +METHOD|bsh.util.JConsole.historyUp()V +METHOD|bsh.util.JConsole.historyDown()V +METHOD|bsh.util.JConsole.showHistoryLine()V +METHOD|bsh.util.JConsole.acceptLine(Ljava/lang/String;)V +METHOD|bsh.util.JConsole.println(Ljava/lang/Object;)V +METHOD|bsh.util.JConsole.print(Ljava/lang/Object;)V +METHOD|bsh.util.JConsole.println()V +METHOD|bsh.util.JConsole.error(Ljava/lang/Object;)V +METHOD|bsh.util.JConsole.println(Ljavax/swing/Icon;)V +METHOD|bsh.util.JConsole.print(Ljavax/swing/Icon;)V +METHOD|bsh.util.JConsole.print(Ljava/lang/Object;Ljava/awt/Font;)V +METHOD|bsh.util.JConsole.print(Ljava/lang/Object;Ljava/awt/Color;)V +METHOD|bsh.util.JConsole.print(Ljava/lang/Object;Ljava/awt/Font;Ljava/awt/Color;)V +METHOD|bsh.util.JConsole.print(Ljava/lang/Object;Ljava/lang/String;ILjava/awt/Color;)V +METHOD|bsh.util.JConsole.print(Ljava/lang/Object;Ljava/lang/String;ILjava/awt/Color;ZZZ)V +METHOD|bsh.util.JConsole.setStyle(Ljava/awt/Font;)Ljavax/swing/text/AttributeSet; +METHOD|bsh.util.JConsole.setStyle(Ljava/awt/Color;)Ljavax/swing/text/AttributeSet; +METHOD|bsh.util.JConsole.setStyle(Ljava/awt/Font;Ljava/awt/Color;)Ljavax/swing/text/AttributeSet; +METHOD|bsh.util.JConsole.setStyle(Ljava/lang/String;ILjava/awt/Color;)Ljavax/swing/text/AttributeSet; +METHOD|bsh.util.JConsole.setStyle(Ljava/lang/String;ILjava/awt/Color;ZZZ)Ljavax/swing/text/AttributeSet; +METHOD|bsh.util.JConsole.setStyle(Ljavax/swing/text/AttributeSet;)V +METHOD|bsh.util.JConsole.setStyle(Ljavax/swing/text/AttributeSet;Z)V +METHOD|bsh.util.JConsole.getStyle()Ljavax/swing/text/AttributeSet; +METHOD|bsh.util.JConsole.setFont(Ljava/awt/Font;)V +METHOD|bsh.util.JConsole.inPipeWatcher()V +METHOD|bsh.util.JConsole.run()V +METHOD|bsh.util.JConsole.toString()Ljava/lang/String; +METHOD|bsh.util.JConsole.mouseClicked(Ljava/awt/event/MouseEvent;)V +METHOD|bsh.util.JConsole.mousePressed(Ljava/awt/event/MouseEvent;)V +METHOD|bsh.util.JConsole.mouseReleased(Ljava/awt/event/MouseEvent;)V +METHOD|bsh.util.JConsole.mouseEntered(Ljava/awt/event/MouseEvent;)V +METHOD|bsh.util.JConsole.mouseExited(Ljava/awt/event/MouseEvent;)V +METHOD|bsh.util.JConsole.propertyChange(Ljava/beans/PropertyChangeEvent;)V +METHOD|bsh.util.JConsole.actionPerformed(Ljava/awt/event/ActionEvent;)V +METHOD|bsh.util.JConsole.invokeAndWait(Ljava/lang/Runnable;)V +METHOD|bsh.util.JConsole.setNameCompletion(Lbsh/util/NameCompletion;)V +METHOD|bsh.util.JConsole.setWaitFeedback(Z)V +METHOD|bsh.util.JConsole.textLength()I +METHOD|bsh.util.JConsole.access$000(Lbsh/util/JConsole;)Ljavax/swing/JTextPane; +METHOD|bsh.util.JConsole.access$100(Lbsh/util/JConsole;)I +METHOD|bsh.util.JConsole.access$200(Lbsh/util/JConsole;)V +METHOD|bsh.util.JConsole.access$300(Lbsh/util/JConsole;Ljava/lang/String;)V +METHOD|bsh.util.JConsole.access$400(Lbsh/util/JConsole;)V +METHOD|bsh.util.JConsole.access$500(Lbsh/util/JConsole;)Ljavax/swing/text/AttributeSet; +METHOD|bsh.util.JConsole.access$600(Lbsh/util/JConsole;Ljava/awt/Font;Ljava/awt/Color;)Ljavax/swing/text/AttributeSet; +METHOD|bsh.util.JConsole.access$700(Lbsh/util/JConsole;Ljavax/swing/text/AttributeSet;Z)V +METHOD|bsh.util.JConsole.access$800(Lbsh/util/JConsole;Ljava/lang/String;ILjava/awt/Color;ZZZ)Ljavax/swing/text/AttributeSet; +METHOD|bsh.util.JDemoApplet.()V +METHOD|bsh.util.JDemoApplet.init()V +METHOD|bsh.util.JRemoteApplet.()V +METHOD|bsh.util.JRemoteApplet.init()V +METHOD|bsh.util.NameCompletion.completeName(Ljava/lang/String;)[Ljava/lang/String; +METHOD|bsh.util.NameCompletionTable.()V +METHOD|bsh.util.NameCompletionTable.add(Lbsh/util/NameCompletionTable;)V +METHOD|bsh.util.NameCompletionTable.add(Lbsh/NameSource;)V +METHOD|bsh.util.NameCompletionTable.getMatchingNames(Ljava/lang/String;Ljava/util/List;)V +METHOD|bsh.util.NameCompletionTable.completeName(Ljava/lang/String;)[Ljava/lang/String; +METHOD|bsh.util.Sessiond.(Lbsh/NameSpace;I)V +METHOD|bsh.util.Sessiond.run()V +METHOD|bsh.util.SessiondConnection.(Lbsh/NameSpace;Ljava/net/Socket;)V +METHOD|bsh.util.SessiondConnection.run()V +METHOD|bsh.util.Util.()V +METHOD|bsh.util.Util.startSplashScreen()V +METHOD|bsh.util.Util.endSplashScreen()V +METHOD|bsh.util.Util.class$(Ljava/lang/String;)Ljava/lang/Class; +METHOD|com.beust.testng.TestNG.()V +METHOD|com.beust.testng.TestNGAntTask.()V +METHOD|com.thoughtworks.qdox.JavaDocBuilder$1.(Lcom/thoughtworks/qdox/JavaDocBuilder;)V +METHOD|com.thoughtworks.qdox.JavaDocBuilder$1.visitFile(Ljava/io/File;)V +METHOD|com.thoughtworks.qdox.JavaDocBuilder.()V +METHOD|com.thoughtworks.qdox.JavaDocBuilder.(Lcom/thoughtworks/qdox/model/DocletTagFactory;)V +METHOD|com.thoughtworks.qdox.JavaDocBuilder.addClasses(Lcom/thoughtworks/qdox/model/JavaSource;)V +METHOD|com.thoughtworks.qdox.JavaDocBuilder.addClass(Lcom/thoughtworks/qdox/model/JavaClass;)V +METHOD|com.thoughtworks.qdox.JavaDocBuilder.getClassByName(Ljava/lang/String;)Lcom/thoughtworks/qdox/model/JavaClass; +METHOD|com.thoughtworks.qdox.JavaDocBuilder.createUnknownClass(Ljava/lang/String;)Lcom/thoughtworks/qdox/model/JavaClass; +METHOD|com.thoughtworks.qdox.JavaDocBuilder.createBinaryClass(Ljava/lang/String;)Lcom/thoughtworks/qdox/model/JavaClass; +METHOD|com.thoughtworks.qdox.JavaDocBuilder.addModifiers(Ljava/util/Set;I)V +METHOD|com.thoughtworks.qdox.JavaDocBuilder.addField(Ljava/lang/reflect/Field;Lcom/thoughtworks/qdox/model/ModelBuilder;)V +METHOD|com.thoughtworks.qdox.JavaDocBuilder.addMethodOrConstructor(Ljava/lang/reflect/Member;Lcom/thoughtworks/qdox/model/ModelBuilder;)V +METHOD|com.thoughtworks.qdox.JavaDocBuilder.getDimension(Ljava/lang/Class;)I +METHOD|com.thoughtworks.qdox.JavaDocBuilder.getTypeName(Ljava/lang/Class;)Ljava/lang/String; +METHOD|com.thoughtworks.qdox.JavaDocBuilder.getPackageName(Ljava/lang/String;)Ljava/lang/String; +METHOD|com.thoughtworks.qdox.JavaDocBuilder.getClassName(Ljava/lang/String;)Ljava/lang/String; +METHOD|com.thoughtworks.qdox.JavaDocBuilder.addSource(Ljava/io/Reader;)Lcom/thoughtworks/qdox/model/JavaSource; +METHOD|com.thoughtworks.qdox.JavaDocBuilder.addSource(Ljava/io/Reader;Ljava/lang/String;)Lcom/thoughtworks/qdox/model/JavaSource; +METHOD|com.thoughtworks.qdox.JavaDocBuilder.addSource(Ljava/io/File;)Lcom/thoughtworks/qdox/model/JavaSource; +METHOD|com.thoughtworks.qdox.JavaDocBuilder.addSource(Ljava/net/URL;)Lcom/thoughtworks/qdox/model/JavaSource; +METHOD|com.thoughtworks.qdox.JavaDocBuilder.getSources()[Lcom/thoughtworks/qdox/model/JavaSource; +METHOD|com.thoughtworks.qdox.JavaDocBuilder.getClasses()[Lcom/thoughtworks/qdox/model/JavaClass; +METHOD|com.thoughtworks.qdox.JavaDocBuilder.addClassesRecursive(Lcom/thoughtworks/qdox/model/JavaSource;Ljava/util/Set;)V +METHOD|com.thoughtworks.qdox.JavaDocBuilder.addClassesRecursive(Lcom/thoughtworks/qdox/model/JavaClass;Ljava/util/Set;)V +METHOD|com.thoughtworks.qdox.JavaDocBuilder.addSourceTree(Ljava/io/File;)V +METHOD|com.thoughtworks.qdox.JavaDocBuilder.search(Lcom/thoughtworks/qdox/Searcher;)Ljava/util/List; +METHOD|com.thoughtworks.qdox.JavaDocBuilder.getClassLibrary()Lcom/thoughtworks/qdox/model/ClassLibrary; +METHOD|com.thoughtworks.qdox.JavaDocBuilder.save(Ljava/io/File;)V +METHOD|com.thoughtworks.qdox.JavaDocBuilder.load(Ljava/io/File;)Lcom/thoughtworks/qdox/JavaDocBuilder; +METHOD|com.thoughtworks.qdox.JavaDocBuilder.setEncoding(Ljava/lang/String;)V +METHOD|com.thoughtworks.qdox.JavaDocBuilder.access$000(Lcom/thoughtworks/qdox/JavaDocBuilder;)Ljava/lang/String; +METHOD|com.thoughtworks.qdox.Searcher.eval(Lcom/thoughtworks/qdox/model/JavaClass;)Z +METHOD|com.thoughtworks.qdox.ant.AbstractQdoxTask.()V +METHOD|com.thoughtworks.qdox.ant.AbstractQdoxTask.addFileset(Lorg/apache/tools/ant/types/FileSet;)V +METHOD|com.thoughtworks.qdox.ant.AbstractQdoxTask.buildFileMap()V +METHOD|com.thoughtworks.qdox.ant.AbstractQdoxTask.buildFileMap(Ljava/io/File;[Ljava/lang/String;)V +METHOD|com.thoughtworks.qdox.ant.AbstractQdoxTask.execute()V +METHOD|com.thoughtworks.qdox.ant.AbstractQdoxTask.createDocletTagFactory()Lcom/thoughtworks/qdox/model/DocletTagFactory; +METHOD|com.thoughtworks.qdox.ant.AbstractQdoxTask.mergeBuilderSources(Lcom/thoughtworks/qdox/JavaDocBuilder;)V +METHOD|com.thoughtworks.qdox.ant.AbstractQdoxTask.processSources([Lcom/thoughtworks/qdox/model/JavaSource;)V +METHOD|com.thoughtworks.qdox.ant.AbstractQdoxTask.processClasses([Lcom/thoughtworks/qdox/model/JavaClass;)V +METHOD|com.thoughtworks.qdox.ant.AbstractQdoxTask.validateAttributes()V +METHOD|com.thoughtworks.qdox.directorywalker.DirectoryScanner$1.(Lcom/thoughtworks/qdox/directorywalker/DirectoryScanner;Ljava/util/List;)V +METHOD|com.thoughtworks.qdox.directorywalker.DirectoryScanner$1.visitFile(Ljava/io/File;)V +METHOD|com.thoughtworks.qdox.directorywalker.DirectoryScanner.(Ljava/io/File;)V +METHOD|com.thoughtworks.qdox.directorywalker.DirectoryScanner.scan()[Ljava/io/File; +METHOD|com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(Lcom/thoughtworks/qdox/directorywalker/FileVisitor;Ljava/io/File;)V +METHOD|com.thoughtworks.qdox.directorywalker.DirectoryScanner.addFilter(Lcom/thoughtworks/qdox/directorywalker/Filter;)V +METHOD|com.thoughtworks.qdox.directorywalker.DirectoryScanner.scan(Lcom/thoughtworks/qdox/directorywalker/FileVisitor;)V +METHOD|com.thoughtworks.qdox.directorywalker.FileVisitor.visitFile(Ljava/io/File;)V +METHOD|com.thoughtworks.qdox.directorywalker.Filter.filter(Ljava/io/File;)Z +METHOD|com.thoughtworks.qdox.directorywalker.SuffixFilter.(Ljava/lang/String;)V +METHOD|com.thoughtworks.qdox.directorywalker.SuffixFilter.filter(Ljava/io/File;)Z +METHOD|com.thoughtworks.qdox.junit.APITestCase$1.()V +METHOD|com.thoughtworks.qdox.junit.APITestCase$1.compare(Ljava/lang/Object;Ljava/lang/Object;)I +METHOD|com.thoughtworks.qdox.junit.APITestCase.()V +METHOD|com.thoughtworks.qdox.junit.APITestCase.assertApiEquals(Ljava/net/URL;Ljava/net/URL;)V +METHOD|com.thoughtworks.qdox.junit.APITestCase.assertApiEquals(Lcom/thoughtworks/qdox/model/JavaSource;Lcom/thoughtworks/qdox/model/JavaSource;)V +METHOD|com.thoughtworks.qdox.junit.APITestCase.assertClassesEqual(Lcom/thoughtworks/qdox/model/JavaClass;Lcom/thoughtworks/qdox/model/JavaClass;)V +METHOD|com.thoughtworks.qdox.junit.APITestCase.assertFieldEquals(Lcom/thoughtworks/qdox/model/JavaField;Lcom/thoughtworks/qdox/model/JavaField;)V +METHOD|com.thoughtworks.qdox.junit.APITestCase.assertFieldsEqual(Lcom/thoughtworks/qdox/model/JavaClass;Lcom/thoughtworks/qdox/model/JavaClass;)V +METHOD|com.thoughtworks.qdox.junit.APITestCase.assertInnerClassesEquals(Lcom/thoughtworks/qdox/model/JavaClass;Lcom/thoughtworks/qdox/model/JavaClass;)V +METHOD|com.thoughtworks.qdox.junit.APITestCase.assertInterfacesEqual(Lcom/thoughtworks/qdox/model/JavaClass;Lcom/thoughtworks/qdox/model/JavaClass;)V +METHOD|com.thoughtworks.qdox.junit.APITestCase.assertMethodsEqual(Lcom/thoughtworks/qdox/model/JavaClass;Lcom/thoughtworks/qdox/model/JavaClass;)V +METHOD|com.thoughtworks.qdox.junit.APITestCase.assertModifiersEquals(Ljava/lang/String;Lcom/thoughtworks/qdox/model/AbstractJavaEntity;Lcom/thoughtworks/qdox/model/AbstractJavaEntity;)V +METHOD|com.thoughtworks.qdox.junit.APITestCase.assertNotDir(Ljava/io/File;Ljava/io/File;)V +METHOD|com.thoughtworks.qdox.junit.APITestCase.getDir()Ljava/io/File; +METHOD|com.thoughtworks.qdox.junit.APITestCase.getRootDir()Ljava/io/File; +METHOD|com.thoughtworks.qdox.junit.APITestCase.()V +METHOD|com.thoughtworks.qdox.model.AbstractInheritableJavaEntity.getTagByName(Ljava/lang/String;Z)Lcom/thoughtworks/qdox/model/DocletTag; +METHOD|com.thoughtworks.qdox.model.AbstractInheritableJavaEntity.(Lcom/thoughtworks/qdox/model/JavaClassParent;I)V +METHOD|com.thoughtworks.qdox.model.AbstractInheritableJavaEntity.getTagsByName(Ljava/lang/String;Z)[Lcom/thoughtworks/qdox/model/DocletTag; +METHOD|com.thoughtworks.qdox.model.AbstractJavaEntity.(Lcom/thoughtworks/qdox/model/JavaClassParent;I)V +METHOD|com.thoughtworks.qdox.model.AbstractJavaEntity.getLineNumber()I +METHOD|com.thoughtworks.qdox.model.AbstractJavaEntity.getName()Ljava/lang/String; +METHOD|com.thoughtworks.qdox.model.AbstractJavaEntity.getModifiers()[Ljava/lang/String; +METHOD|com.thoughtworks.qdox.model.AbstractJavaEntity.getComment()Ljava/lang/String; +METHOD|com.thoughtworks.qdox.model.AbstractJavaEntity.getTags()[Lcom/thoughtworks/qdox/model/DocletTag; +METHOD|com.thoughtworks.qdox.model.AbstractJavaEntity.getTagsByName(Ljava/lang/String;)[Lcom/thoughtworks/qdox/model/DocletTag; +METHOD|com.thoughtworks.qdox.model.AbstractJavaEntity.getTagByName(Ljava/lang/String;)Lcom/thoughtworks/qdox/model/DocletTag; +METHOD|com.thoughtworks.qdox.model.AbstractJavaEntity.getNamedParameter(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; +METHOD|com.thoughtworks.qdox.model.AbstractJavaEntity.commentHeader(Lcom/thoughtworks/qdox/model/IndentBuffer;)V +METHOD|com.thoughtworks.qdox.model.AbstractJavaEntity.toString()Ljava/lang/String; +METHOD|com.thoughtworks.qdox.model.AbstractJavaEntity.write(Lcom/thoughtworks/qdox/model/IndentBuffer;)V +METHOD|com.thoughtworks.qdox.model.AbstractJavaEntity.writeBody(Lcom/thoughtworks/qdox/model/IndentBuffer;)V +METHOD|com.thoughtworks.qdox.model.AbstractJavaEntity.setName(Ljava/lang/String;)V +METHOD|com.thoughtworks.qdox.model.AbstractJavaEntity.setModifiers([Ljava/lang/String;)V +METHOD|com.thoughtworks.qdox.model.AbstractJavaEntity.setComment(Ljava/lang/String;)V +METHOD|com.thoughtworks.qdox.model.AbstractJavaEntity.setTags(Ljava/util/List;)V +METHOD|com.thoughtworks.qdox.model.AbstractJavaEntity.isAbstract()Z +METHOD|com.thoughtworks.qdox.model.AbstractJavaEntity.isPublic()Z +METHOD|com.thoughtworks.qdox.model.AbstractJavaEntity.isPrivate()Z +METHOD|com.thoughtworks.qdox.model.AbstractJavaEntity.isProtected()Z +METHOD|com.thoughtworks.qdox.model.AbstractJavaEntity.isStatic()Z +METHOD|com.thoughtworks.qdox.model.AbstractJavaEntity.isFinal()Z +METHOD|com.thoughtworks.qdox.model.AbstractJavaEntity.isSynchronized()Z +METHOD|com.thoughtworks.qdox.model.AbstractJavaEntity.isTransient()Z +METHOD|com.thoughtworks.qdox.model.AbstractJavaEntity.isVolatile()Z +METHOD|com.thoughtworks.qdox.model.AbstractJavaEntity.isNative()Z +METHOD|com.thoughtworks.qdox.model.AbstractJavaEntity.isStrictfp()Z +METHOD|com.thoughtworks.qdox.model.AbstractJavaEntity.isModifierPresent(Ljava/lang/String;)Z +METHOD|com.thoughtworks.qdox.model.AbstractJavaEntity.writeNonAccessibilityModifiers(Lcom/thoughtworks/qdox/model/IndentBuffer;)V +METHOD|com.thoughtworks.qdox.model.AbstractJavaEntity.writeAccessibilityModifier(Lcom/thoughtworks/qdox/model/IndentBuffer;)V +METHOD|com.thoughtworks.qdox.model.AbstractJavaEntity.writeAllModifiers(Lcom/thoughtworks/qdox/model/IndentBuffer;)V +METHOD|com.thoughtworks.qdox.model.AbstractJavaEntity.getParent()Lcom/thoughtworks/qdox/model/JavaClassParent; +METHOD|com.thoughtworks.qdox.model.AbstractJavaEntity.getSource()Lcom/thoughtworks/qdox/model/JavaSource; +METHOD|com.thoughtworks.qdox.model.AbstractJavaEntity.compareTo(Ljava/lang/Object;)I +METHOD|com.thoughtworks.qdox.model.BeanProperty.(Ljava/lang/String;)V +METHOD|com.thoughtworks.qdox.model.BeanProperty.getName()Ljava/lang/String; +METHOD|com.thoughtworks.qdox.model.BeanProperty.setType(Lcom/thoughtworks/qdox/model/Type;)V +METHOD|com.thoughtworks.qdox.model.BeanProperty.getType()Lcom/thoughtworks/qdox/model/Type; +METHOD|com.thoughtworks.qdox.model.BeanProperty.getAccessor()Lcom/thoughtworks/qdox/model/JavaMethod; +METHOD|com.thoughtworks.qdox.model.BeanProperty.setAccessor(Lcom/thoughtworks/qdox/model/JavaMethod;)V +METHOD|com.thoughtworks.qdox.model.BeanProperty.getMutator()Lcom/thoughtworks/qdox/model/JavaMethod; +METHOD|com.thoughtworks.qdox.model.BeanProperty.setMutator(Lcom/thoughtworks/qdox/model/JavaMethod;)V +METHOD|com.thoughtworks.qdox.model.ClassLibrary.(Lcom/thoughtworks/qdox/model/JavaClassCache;)V +METHOD|com.thoughtworks.qdox.model.ClassLibrary.add(Ljava/lang/String;)V +METHOD|com.thoughtworks.qdox.model.ClassLibrary.getClassByName(Ljava/lang/String;)Lcom/thoughtworks/qdox/model/JavaClass; +METHOD|com.thoughtworks.qdox.model.ClassLibrary.contains(Ljava/lang/String;)Z +METHOD|com.thoughtworks.qdox.model.ClassLibrary.getClass(Ljava/lang/String;)Ljava/lang/Class; +METHOD|com.thoughtworks.qdox.model.ClassLibrary.all()Ljava/util/Collection; +METHOD|com.thoughtworks.qdox.model.ClassLibrary.addClassLoader(Ljava/lang/ClassLoader;)V +METHOD|com.thoughtworks.qdox.model.ClassLibrary.addDefaultLoader()V +METHOD|com.thoughtworks.qdox.model.ClassLibrary.readObject(Ljava/io/ObjectInputStream;)V +METHOD|com.thoughtworks.qdox.model.DefaultDocletTag.(Ljava/lang/String;Ljava/lang/String;Lcom/thoughtworks/qdox/model/AbstractJavaEntity;I)V +METHOD|com.thoughtworks.qdox.model.DefaultDocletTag.(Ljava/lang/String;Ljava/lang/String;)V +METHOD|com.thoughtworks.qdox.model.DefaultDocletTag.getName()Ljava/lang/String; +METHOD|com.thoughtworks.qdox.model.DefaultDocletTag.getValue()Ljava/lang/String; +METHOD|com.thoughtworks.qdox.model.DefaultDocletTag.getParameters()[Ljava/lang/String; +METHOD|com.thoughtworks.qdox.model.DefaultDocletTag.getNamedParameterMap()Ljava/util/Map; +METHOD|com.thoughtworks.qdox.model.DefaultDocletTag.getNamedParameter(Ljava/lang/String;)Ljava/lang/String; +METHOD|com.thoughtworks.qdox.model.DefaultDocletTag.getContext()Lcom/thoughtworks/qdox/model/AbstractJavaEntity; +METHOD|com.thoughtworks.qdox.model.DefaultDocletTag.getLineNumber()I +METHOD|com.thoughtworks.qdox.model.DefaultDocletTagFactory.()V +METHOD|com.thoughtworks.qdox.model.DefaultDocletTagFactory.createDocletTag(Ljava/lang/String;Ljava/lang/String;Lcom/thoughtworks/qdox/model/AbstractJavaEntity;I)Lcom/thoughtworks/qdox/model/DocletTag; +METHOD|com.thoughtworks.qdox.model.DefaultDocletTagFactory.createDocletTag(Ljava/lang/String;Ljava/lang/String;)Lcom/thoughtworks/qdox/model/DocletTag; +METHOD|com.thoughtworks.qdox.model.DocletTag.getName()Ljava/lang/String; +METHOD|com.thoughtworks.qdox.model.DocletTag.getValue()Ljava/lang/String; +METHOD|com.thoughtworks.qdox.model.DocletTag.getParameters()[Ljava/lang/String; +METHOD|com.thoughtworks.qdox.model.DocletTag.getNamedParameter(Ljava/lang/String;)Ljava/lang/String; +METHOD|com.thoughtworks.qdox.model.DocletTag.getNamedParameterMap()Ljava/util/Map; +METHOD|com.thoughtworks.qdox.model.DocletTag.getLineNumber()I +METHOD|com.thoughtworks.qdox.model.DocletTag.getContext()Lcom/thoughtworks/qdox/model/AbstractJavaEntity; +METHOD|com.thoughtworks.qdox.model.DocletTagFactory.createDocletTag(Ljava/lang/String;Ljava/lang/String;Lcom/thoughtworks/qdox/model/AbstractJavaEntity;I)Lcom/thoughtworks/qdox/model/DocletTag; +METHOD|com.thoughtworks.qdox.model.DocletTagFactory.createDocletTag(Ljava/lang/String;Ljava/lang/String;)Lcom/thoughtworks/qdox/model/DocletTag; +METHOD|com.thoughtworks.qdox.model.IndentBuffer.()V +METHOD|com.thoughtworks.qdox.model.IndentBuffer.write(Ljava/lang/String;)V +METHOD|com.thoughtworks.qdox.model.IndentBuffer.write(C)V +METHOD|com.thoughtworks.qdox.model.IndentBuffer.newline()V +METHOD|com.thoughtworks.qdox.model.IndentBuffer.indent()V +METHOD|com.thoughtworks.qdox.model.IndentBuffer.deindent()V +METHOD|com.thoughtworks.qdox.model.IndentBuffer.toString()Ljava/lang/String; +METHOD|com.thoughtworks.qdox.model.IndentBuffer.checkNewLine()V +METHOD|com.thoughtworks.qdox.model.JavaClass.(Lcom/thoughtworks/qdox/model/JavaClassParent;I)V +METHOD|com.thoughtworks.qdox.model.JavaClass.(Lcom/thoughtworks/qdox/model/JavaClassParent;)V +METHOD|com.thoughtworks.qdox.model.JavaClass.setJavaClassCache(Lcom/thoughtworks/qdox/model/JavaClassCache;)V +METHOD|com.thoughtworks.qdox.model.JavaClass.isInterface()Z +METHOD|com.thoughtworks.qdox.model.JavaClass.getSuperClass()Lcom/thoughtworks/qdox/model/Type; +METHOD|com.thoughtworks.qdox.model.JavaClass.getSuperJavaClass()Lcom/thoughtworks/qdox/model/JavaClass; +METHOD|com.thoughtworks.qdox.model.JavaClass.getImplements()[Lcom/thoughtworks/qdox/model/Type; +METHOD|com.thoughtworks.qdox.model.JavaClass.getImplementedInterfaces()[Lcom/thoughtworks/qdox/model/JavaClass; +METHOD|com.thoughtworks.qdox.model.JavaClass.writeBody(Lcom/thoughtworks/qdox/model/IndentBuffer;)V +METHOD|com.thoughtworks.qdox.model.JavaClass.setInterface(Z)V +METHOD|com.thoughtworks.qdox.model.JavaClass.addMethod(Lcom/thoughtworks/qdox/model/JavaMethod;)V +METHOD|com.thoughtworks.qdox.model.JavaClass.setSuperClass(Lcom/thoughtworks/qdox/model/Type;)V +METHOD|com.thoughtworks.qdox.model.JavaClass.setImplementz([Lcom/thoughtworks/qdox/model/Type;)V +METHOD|com.thoughtworks.qdox.model.JavaClass.addField(Lcom/thoughtworks/qdox/model/JavaField;)V +METHOD|com.thoughtworks.qdox.model.JavaClass.getParentSource()Lcom/thoughtworks/qdox/model/JavaSource; +METHOD|com.thoughtworks.qdox.model.JavaClass.getPackage()Ljava/lang/String; +METHOD|com.thoughtworks.qdox.model.JavaClass.getFullyQualifiedName()Ljava/lang/String; +METHOD|com.thoughtworks.qdox.model.JavaClass.isInner()Z +METHOD|com.thoughtworks.qdox.model.JavaClass.resolveType(Ljava/lang/String;)Ljava/lang/String; +METHOD|com.thoughtworks.qdox.model.JavaClass.getClassLibrary()Lcom/thoughtworks/qdox/model/ClassLibrary; +METHOD|com.thoughtworks.qdox.model.JavaClass.getClassNamePrefix()Ljava/lang/String; +METHOD|com.thoughtworks.qdox.model.JavaClass.asType()Lcom/thoughtworks/qdox/model/Type; +METHOD|com.thoughtworks.qdox.model.JavaClass.getMethods()[Lcom/thoughtworks/qdox/model/JavaMethod; +METHOD|com.thoughtworks.qdox.model.JavaClass.getMethods(Z)[Lcom/thoughtworks/qdox/model/JavaMethod; +METHOD|com.thoughtworks.qdox.model.JavaClass.addMethodsFromSuperclassAndInterfaces(Ljava/util/Set;Ljava/util/List;Lcom/thoughtworks/qdox/model/JavaClass;)V +METHOD|com.thoughtworks.qdox.model.JavaClass.addNewMethods(Ljava/util/Set;Ljava/util/List;[Lcom/thoughtworks/qdox/model/JavaMethod;)V +METHOD|com.thoughtworks.qdox.model.JavaClass.getMethodBySignature(Ljava/lang/String;[Lcom/thoughtworks/qdox/model/Type;)Lcom/thoughtworks/qdox/model/JavaMethod; +METHOD|com.thoughtworks.qdox.model.JavaClass.getMethodBySignature(Ljava/lang/String;[Lcom/thoughtworks/qdox/model/Type;Z)Lcom/thoughtworks/qdox/model/JavaMethod; +METHOD|com.thoughtworks.qdox.model.JavaClass.getMethodsBySignature(Ljava/lang/String;[Lcom/thoughtworks/qdox/model/Type;Z)[Lcom/thoughtworks/qdox/model/JavaMethod; +METHOD|com.thoughtworks.qdox.model.JavaClass.getFields()[Lcom/thoughtworks/qdox/model/JavaField; +METHOD|com.thoughtworks.qdox.model.JavaClass.getFieldByName(Ljava/lang/String;)Lcom/thoughtworks/qdox/model/JavaField; +METHOD|com.thoughtworks.qdox.model.JavaClass.addClass(Lcom/thoughtworks/qdox/model/JavaClass;)V +METHOD|com.thoughtworks.qdox.model.JavaClass.getClasses()[Lcom/thoughtworks/qdox/model/JavaClass; +METHOD|com.thoughtworks.qdox.model.JavaClass.getInnerClasses()[Lcom/thoughtworks/qdox/model/JavaClass; +METHOD|com.thoughtworks.qdox.model.JavaClass.getInnerClassByName(Ljava/lang/String;)Lcom/thoughtworks/qdox/model/JavaClass; +METHOD|com.thoughtworks.qdox.model.JavaClass.isA(Ljava/lang/String;)Z +METHOD|com.thoughtworks.qdox.model.JavaClass.isA(Lcom/thoughtworks/qdox/model/JavaClass;)Z +METHOD|com.thoughtworks.qdox.model.JavaClass.getBeanProperties()[Lcom/thoughtworks/qdox/model/BeanProperty; +METHOD|com.thoughtworks.qdox.model.JavaClass.getBeanProperties(Z)[Lcom/thoughtworks/qdox/model/BeanProperty; +METHOD|com.thoughtworks.qdox.model.JavaClass.getBeanPropertyMap(Z)Ljava/util/Map; +METHOD|com.thoughtworks.qdox.model.JavaClass.getOrCreateProperty(Ljava/util/Map;Ljava/lang/String;)Lcom/thoughtworks/qdox/model/BeanProperty; +METHOD|com.thoughtworks.qdox.model.JavaClass.getBeanProperty(Ljava/lang/String;)Lcom/thoughtworks/qdox/model/BeanProperty; +METHOD|com.thoughtworks.qdox.model.JavaClass.getBeanProperty(Ljava/lang/String;Z)Lcom/thoughtworks/qdox/model/BeanProperty; +METHOD|com.thoughtworks.qdox.model.JavaClass.getDerivedClasses()[Lcom/thoughtworks/qdox/model/JavaClass; +METHOD|com.thoughtworks.qdox.model.JavaClass.getTagsByName(Ljava/lang/String;Z)[Lcom/thoughtworks/qdox/model/DocletTag; +METHOD|com.thoughtworks.qdox.model.JavaClass.addTagsRecursive(Ljava/util/List;Lcom/thoughtworks/qdox/model/JavaClass;Ljava/lang/String;Z)V +METHOD|com.thoughtworks.qdox.model.JavaClass.addNewTags(Ljava/util/List;[Lcom/thoughtworks/qdox/model/DocletTag;)V +METHOD|com.thoughtworks.qdox.model.JavaClass.compareTo(Ljava/lang/Object;)I +METHOD|com.thoughtworks.qdox.model.JavaClass.()V +METHOD|com.thoughtworks.qdox.model.JavaClassCache.getClassByName(Ljava/lang/String;)Lcom/thoughtworks/qdox/model/JavaClass; +METHOD|com.thoughtworks.qdox.model.JavaClassParent.resolveType(Ljava/lang/String;)Ljava/lang/String; +METHOD|com.thoughtworks.qdox.model.JavaClassParent.getClassLibrary()Lcom/thoughtworks/qdox/model/ClassLibrary; +METHOD|com.thoughtworks.qdox.model.JavaClassParent.getClassNamePrefix()Ljava/lang/String; +METHOD|com.thoughtworks.qdox.model.JavaClassParent.getParentSource()Lcom/thoughtworks/qdox/model/JavaSource; +METHOD|com.thoughtworks.qdox.model.JavaClassParent.addClass(Lcom/thoughtworks/qdox/model/JavaClass;)V +METHOD|com.thoughtworks.qdox.model.JavaField.(Lcom/thoughtworks/qdox/model/JavaClass;I)V +METHOD|com.thoughtworks.qdox.model.JavaField.(Lcom/thoughtworks/qdox/model/JavaClass;)V +METHOD|com.thoughtworks.qdox.model.JavaField.()V +METHOD|com.thoughtworks.qdox.model.JavaField.getType()Lcom/thoughtworks/qdox/model/Type; +METHOD|com.thoughtworks.qdox.model.JavaField.writeBody(Lcom/thoughtworks/qdox/model/IndentBuffer;)V +METHOD|com.thoughtworks.qdox.model.JavaField.setType(Lcom/thoughtworks/qdox/model/Type;)V +METHOD|com.thoughtworks.qdox.model.JavaField.compareTo(Ljava/lang/Object;)I +METHOD|com.thoughtworks.qdox.model.JavaField.getDeclarationSignature(Z)Ljava/lang/String; +METHOD|com.thoughtworks.qdox.model.JavaField.getCallSignature()Ljava/lang/String; +METHOD|com.thoughtworks.qdox.model.JavaMethod.(Lcom/thoughtworks/qdox/model/JavaClass;I)V +METHOD|com.thoughtworks.qdox.model.JavaMethod.(Lcom/thoughtworks/qdox/model/JavaClass;)V +METHOD|com.thoughtworks.qdox.model.JavaMethod.()V +METHOD|com.thoughtworks.qdox.model.JavaMethod.getReturns()Lcom/thoughtworks/qdox/model/Type; +METHOD|com.thoughtworks.qdox.model.JavaMethod.getParameters()[Lcom/thoughtworks/qdox/model/JavaParameter; +METHOD|com.thoughtworks.qdox.model.JavaMethod.getParameterByName(Ljava/lang/String;)Lcom/thoughtworks/qdox/model/JavaParameter; +METHOD|com.thoughtworks.qdox.model.JavaMethod.getExceptions()[Lcom/thoughtworks/qdox/model/Type; +METHOD|com.thoughtworks.qdox.model.JavaMethod.isConstructor()Z +METHOD|com.thoughtworks.qdox.model.JavaMethod.writeBody(Lcom/thoughtworks/qdox/model/IndentBuffer;)V +METHOD|com.thoughtworks.qdox.model.JavaMethod.writeBody(Lcom/thoughtworks/qdox/model/IndentBuffer;ZZZ)V +METHOD|com.thoughtworks.qdox.model.JavaMethod.getSignature(ZZ)Ljava/lang/String; +METHOD|com.thoughtworks.qdox.model.JavaMethod.getDeclarationSignature(Z)Ljava/lang/String; +METHOD|com.thoughtworks.qdox.model.JavaMethod.getCallSignature()Ljava/lang/String; +METHOD|com.thoughtworks.qdox.model.JavaMethod.setReturns(Lcom/thoughtworks/qdox/model/Type;)V +METHOD|com.thoughtworks.qdox.model.JavaMethod.setParameters([Lcom/thoughtworks/qdox/model/JavaParameter;)V +METHOD|com.thoughtworks.qdox.model.JavaMethod.setExceptions([Lcom/thoughtworks/qdox/model/Type;)V +METHOD|com.thoughtworks.qdox.model.JavaMethod.setConstructor(Z)V +METHOD|com.thoughtworks.qdox.model.JavaMethod.equals(Ljava/lang/Object;)Z +METHOD|com.thoughtworks.qdox.model.JavaMethod.signatureMatches(Ljava/lang/String;[Lcom/thoughtworks/qdox/model/Type;)Z +METHOD|com.thoughtworks.qdox.model.JavaMethod.hashCode()I +METHOD|com.thoughtworks.qdox.model.JavaMethod.getParentClass()Lcom/thoughtworks/qdox/model/JavaClass; +METHOD|com.thoughtworks.qdox.model.JavaMethod.setParentClass(Lcom/thoughtworks/qdox/model/JavaClass;)V +METHOD|com.thoughtworks.qdox.model.JavaMethod.isPublic()Z +METHOD|com.thoughtworks.qdox.model.JavaMethod.isPropertyAccessor()Z +METHOD|com.thoughtworks.qdox.model.JavaMethod.isPropertyMutator()Z +METHOD|com.thoughtworks.qdox.model.JavaMethod.getPropertyType()Lcom/thoughtworks/qdox/model/Type; +METHOD|com.thoughtworks.qdox.model.JavaMethod.getPropertyName()Ljava/lang/String; +METHOD|com.thoughtworks.qdox.model.JavaMethod.getTagsByName(Ljava/lang/String;Z)[Lcom/thoughtworks/qdox/model/DocletTag; +METHOD|com.thoughtworks.qdox.model.JavaMethod.compareTo(Ljava/lang/Object;)I +METHOD|com.thoughtworks.qdox.model.JavaParameter.(Lcom/thoughtworks/qdox/model/Type;Ljava/lang/String;)V +METHOD|com.thoughtworks.qdox.model.JavaParameter.getName()Ljava/lang/String; +METHOD|com.thoughtworks.qdox.model.JavaParameter.getType()Lcom/thoughtworks/qdox/model/Type; +METHOD|com.thoughtworks.qdox.model.JavaParameter.equals(Ljava/lang/Object;)Z +METHOD|com.thoughtworks.qdox.model.JavaParameter.hashCode()I +METHOD|com.thoughtworks.qdox.model.JavaParameter.getParentMethod()Lcom/thoughtworks/qdox/model/JavaMethod; +METHOD|com.thoughtworks.qdox.model.JavaParameter.setParentMethod(Lcom/thoughtworks/qdox/model/JavaMethod;)V +METHOD|com.thoughtworks.qdox.model.JavaParameter.()V +METHOD|com.thoughtworks.qdox.model.JavaSource.()V +METHOD|com.thoughtworks.qdox.model.JavaSource.setURL(Ljava/net/URL;)V +METHOD|com.thoughtworks.qdox.model.JavaSource.getURL()Ljava/net/URL; +METHOD|com.thoughtworks.qdox.model.JavaSource.setFile(Ljava/io/File;)V +METHOD|com.thoughtworks.qdox.model.JavaSource.getFile()Ljava/io/File; +METHOD|com.thoughtworks.qdox.model.JavaSource.getPackage()Ljava/lang/String; +METHOD|com.thoughtworks.qdox.model.JavaSource.setPackage(Ljava/lang/String;)V +METHOD|com.thoughtworks.qdox.model.JavaSource.addImport(Ljava/lang/String;)V +METHOD|com.thoughtworks.qdox.model.JavaSource.getImports()[Ljava/lang/String; +METHOD|com.thoughtworks.qdox.model.JavaSource.addClass(Lcom/thoughtworks/qdox/model/JavaClass;)V +METHOD|com.thoughtworks.qdox.model.JavaSource.getClasses()[Lcom/thoughtworks/qdox/model/JavaClass; +METHOD|com.thoughtworks.qdox.model.JavaSource.getClassLibrary()Lcom/thoughtworks/qdox/model/ClassLibrary; +METHOD|com.thoughtworks.qdox.model.JavaSource.setClassLibrary(Lcom/thoughtworks/qdox/model/ClassLibrary;)V +METHOD|com.thoughtworks.qdox.model.JavaSource.toString()Ljava/lang/String; +METHOD|com.thoughtworks.qdox.model.JavaSource.resolveType(Ljava/lang/String;)Ljava/lang/String; +METHOD|com.thoughtworks.qdox.model.JavaSource.resolveTypeInternal(Ljava/lang/String;)Ljava/lang/String; +METHOD|com.thoughtworks.qdox.model.JavaSource.getClassNamePrefix()Ljava/lang/String; +METHOD|com.thoughtworks.qdox.model.JavaSource.getParentSource()Lcom/thoughtworks/qdox/model/JavaSource; +METHOD|com.thoughtworks.qdox.model.JavaSource.()V +METHOD|com.thoughtworks.qdox.model.Member.getDeclarationSignature(Z)Ljava/lang/String; +METHOD|com.thoughtworks.qdox.model.Member.getCallSignature()Ljava/lang/String; +METHOD|com.thoughtworks.qdox.model.ModelBuilder.()V +METHOD|com.thoughtworks.qdox.model.ModelBuilder.(Lcom/thoughtworks/qdox/model/ClassLibrary;Lcom/thoughtworks/qdox/model/DocletTagFactory;)V +METHOD|com.thoughtworks.qdox.model.ModelBuilder.addPackage(Ljava/lang/String;)V +METHOD|com.thoughtworks.qdox.model.ModelBuilder.addImport(Ljava/lang/String;)V +METHOD|com.thoughtworks.qdox.model.ModelBuilder.addJavaDoc(Ljava/lang/String;)V +METHOD|com.thoughtworks.qdox.model.ModelBuilder.addJavaDocTag(Lcom/thoughtworks/qdox/parser/structs/TagDef;)V +METHOD|com.thoughtworks.qdox.model.ModelBuilder.beginClass(Lcom/thoughtworks/qdox/parser/structs/ClassDef;)V +METHOD|com.thoughtworks.qdox.model.ModelBuilder.endClass()V +METHOD|com.thoughtworks.qdox.model.ModelBuilder.createType(Ljava/lang/String;I)Lcom/thoughtworks/qdox/model/Type; +METHOD|com.thoughtworks.qdox.model.ModelBuilder.addJavaDoc(Lcom/thoughtworks/qdox/model/AbstractJavaEntity;)V +METHOD|com.thoughtworks.qdox.model.ModelBuilder.addMethod(Lcom/thoughtworks/qdox/parser/structs/MethodDef;)V +METHOD|com.thoughtworks.qdox.model.ModelBuilder.addField(Lcom/thoughtworks/qdox/parser/structs/FieldDef;)V +METHOD|com.thoughtworks.qdox.model.ModelBuilder.getSource()Lcom/thoughtworks/qdox/model/JavaSource; +METHOD|com.thoughtworks.qdox.model.Type.(Ljava/lang/String;Ljava/lang/String;ILcom/thoughtworks/qdox/model/JavaClassParent;)V +METHOD|com.thoughtworks.qdox.model.Type.(Ljava/lang/String;ILcom/thoughtworks/qdox/model/JavaClassParent;)V +METHOD|com.thoughtworks.qdox.model.Type.(Ljava/lang/String;I)V +METHOD|com.thoughtworks.qdox.model.Type.(Ljava/lang/String;)V +METHOD|com.thoughtworks.qdox.model.Type.createUnresolved(Ljava/lang/String;ILcom/thoughtworks/qdox/model/JavaClassParent;)Lcom/thoughtworks/qdox/model/Type; +METHOD|com.thoughtworks.qdox.model.Type.getJavaClassParent()Lcom/thoughtworks/qdox/model/JavaClassParent; +METHOD|com.thoughtworks.qdox.model.Type.getValue()Ljava/lang/String; +METHOD|com.thoughtworks.qdox.model.Type.isResolved()Z +METHOD|com.thoughtworks.qdox.model.Type.compareTo(Ljava/lang/Object;)I +METHOD|com.thoughtworks.qdox.model.Type.isArray()Z +METHOD|com.thoughtworks.qdox.model.Type.getDimensions()I +METHOD|com.thoughtworks.qdox.model.Type.toString()Ljava/lang/String; +METHOD|com.thoughtworks.qdox.model.Type.equals(Ljava/lang/Object;)Z +METHOD|com.thoughtworks.qdox.model.Type.hashCode()I +METHOD|com.thoughtworks.qdox.model.Type.getJavaClass()Lcom/thoughtworks/qdox/model/JavaClass; +METHOD|com.thoughtworks.qdox.model.Type.isA(Lcom/thoughtworks/qdox/model/Type;)Z +METHOD|com.thoughtworks.qdox.model.Type.()V +METHOD|com.thoughtworks.qdox.model.util.TagParser.()V +METHOD|com.thoughtworks.qdox.model.util.TagParser.makeTokenizer(Ljava/lang/String;)Ljava/io/StreamTokenizer; +METHOD|com.thoughtworks.qdox.model.util.TagParser.parseNamedParameters(Ljava/lang/String;)Ljava/util/Map; +METHOD|com.thoughtworks.qdox.model.util.TagParser.parseWords(Ljava/lang/String;)[Ljava/lang/String; +METHOD|com.thoughtworks.qdox.parser.Builder.addPackage(Ljava/lang/String;)V +METHOD|com.thoughtworks.qdox.parser.Builder.addImport(Ljava/lang/String;)V +METHOD|com.thoughtworks.qdox.parser.Builder.addJavaDoc(Ljava/lang/String;)V +METHOD|com.thoughtworks.qdox.parser.Builder.addJavaDocTag(Lcom/thoughtworks/qdox/parser/structs/TagDef;)V +METHOD|com.thoughtworks.qdox.parser.Builder.beginClass(Lcom/thoughtworks/qdox/parser/structs/ClassDef;)V +METHOD|com.thoughtworks.qdox.parser.Builder.endClass()V +METHOD|com.thoughtworks.qdox.parser.Builder.addMethod(Lcom/thoughtworks/qdox/parser/structs/MethodDef;)V +METHOD|com.thoughtworks.qdox.parser.Builder.addField(Lcom/thoughtworks/qdox/parser/structs/FieldDef;)V +METHOD|com.thoughtworks.qdox.parser.Lexer.lex()I +METHOD|com.thoughtworks.qdox.parser.Lexer.text()Ljava/lang/String; +METHOD|com.thoughtworks.qdox.parser.Lexer.getLine()I +METHOD|com.thoughtworks.qdox.parser.Lexer.getColumn()I +METHOD|com.thoughtworks.qdox.parser.ParseException.(Ljava/lang/String;II)V +METHOD|com.thoughtworks.qdox.parser.ParseException.getLine()I +METHOD|com.thoughtworks.qdox.parser.ParseException.getColumn()I +METHOD|com.thoughtworks.qdox.parser.ParseException.setSourceInfo(Ljava/lang/String;)V +METHOD|com.thoughtworks.qdox.parser.ParseException.getMessage()Ljava/lang/String; +METHOD|com.thoughtworks.qdox.parser.impl.JFlexLexer.text()Ljava/lang/String; +METHOD|com.thoughtworks.qdox.parser.impl.JFlexLexer.lex()I +METHOD|com.thoughtworks.qdox.parser.impl.JFlexLexer.getLine()I +METHOD|com.thoughtworks.qdox.parser.impl.JFlexLexer.getColumn()I +METHOD|com.thoughtworks.qdox.parser.impl.JFlexLexer.pushState(I)V +METHOD|com.thoughtworks.qdox.parser.impl.JFlexLexer.popState()V +METHOD|com.thoughtworks.qdox.parser.impl.JFlexLexer.(Ljava/io/Reader;)V +METHOD|com.thoughtworks.qdox.parser.impl.JFlexLexer.(Ljava/io/InputStream;)V +METHOD|com.thoughtworks.qdox.parser.impl.JFlexLexer.yy_unpack()[I +METHOD|com.thoughtworks.qdox.parser.impl.JFlexLexer.yy_unpack(Ljava/lang/String;I[I)I +METHOD|com.thoughtworks.qdox.parser.impl.JFlexLexer.yy_unpack_cmap(Ljava/lang/String;)[C +METHOD|com.thoughtworks.qdox.parser.impl.JFlexLexer.yy_refill()Z +METHOD|com.thoughtworks.qdox.parser.impl.JFlexLexer.yyclose()V +METHOD|com.thoughtworks.qdox.parser.impl.JFlexLexer.yyreset(Ljava/io/Reader;)V +METHOD|com.thoughtworks.qdox.parser.impl.JFlexLexer.yystate()I +METHOD|com.thoughtworks.qdox.parser.impl.JFlexLexer.yybegin(I)V +METHOD|com.thoughtworks.qdox.parser.impl.JFlexLexer.yytext()Ljava/lang/String; +METHOD|com.thoughtworks.qdox.parser.impl.JFlexLexer.yycharat(I)C +METHOD|com.thoughtworks.qdox.parser.impl.JFlexLexer.yylength()I +METHOD|com.thoughtworks.qdox.parser.impl.JFlexLexer.yy_ScanError(I)V +METHOD|com.thoughtworks.qdox.parser.impl.JFlexLexer.yypushback(I)V +METHOD|com.thoughtworks.qdox.parser.impl.JFlexLexer.yy_do_eof()V +METHOD|com.thoughtworks.qdox.parser.impl.JFlexLexer.yylex()I +METHOD|com.thoughtworks.qdox.parser.impl.JFlexLexer.()V +METHOD|com.thoughtworks.qdox.parser.impl.Parser$Value.(Lcom/thoughtworks/qdox/parser/impl/Parser;)V +METHOD|com.thoughtworks.qdox.parser.impl.Parser$Value.(Lcom/thoughtworks/qdox/parser/impl/Parser;Lcom/thoughtworks/qdox/parser/impl/Parser$1;)V +METHOD|com.thoughtworks.qdox.parser.impl.Parser.debug(Ljava/lang/String;)V +METHOD|com.thoughtworks.qdox.parser.impl.Parser.state_push(I)V +METHOD|com.thoughtworks.qdox.parser.impl.Parser.state_pop()I +METHOD|com.thoughtworks.qdox.parser.impl.Parser.state_drop(I)V +METHOD|com.thoughtworks.qdox.parser.impl.Parser.state_peek(I)I +METHOD|com.thoughtworks.qdox.parser.impl.Parser.init_stacks()Z +METHOD|com.thoughtworks.qdox.parser.impl.Parser.dump_stacks(I)V +METHOD|com.thoughtworks.qdox.parser.impl.Parser.val_init()V +METHOD|com.thoughtworks.qdox.parser.impl.Parser.val_push(Lcom/thoughtworks/qdox/parser/impl/Parser$Value;)V +METHOD|com.thoughtworks.qdox.parser.impl.Parser.val_pop()Lcom/thoughtworks/qdox/parser/impl/Parser$Value; +METHOD|com.thoughtworks.qdox.parser.impl.Parser.val_drop(I)V +METHOD|com.thoughtworks.qdox.parser.impl.Parser.val_peek(I)Lcom/thoughtworks/qdox/parser/impl/Parser$Value; +METHOD|com.thoughtworks.qdox.parser.impl.Parser.buffer()Ljava/lang/String; +METHOD|com.thoughtworks.qdox.parser.impl.Parser.(Lcom/thoughtworks/qdox/parser/Lexer;Lcom/thoughtworks/qdox/parser/Builder;)V +METHOD|com.thoughtworks.qdox.parser.impl.Parser.parse()Z +METHOD|com.thoughtworks.qdox.parser.impl.Parser.yylex()I +METHOD|com.thoughtworks.qdox.parser.impl.Parser.yyerror(Ljava/lang/String;)V +METHOD|com.thoughtworks.qdox.parser.impl.Parser.makeField(Lcom/thoughtworks/qdox/parser/structs/TypeDef;)V +METHOD|com.thoughtworks.qdox.parser.impl.Parser.yylexdebug(II)V +METHOD|com.thoughtworks.qdox.parser.impl.Parser.yyparse()I +METHOD|com.thoughtworks.qdox.parser.impl.Parser.()V +METHOD|com.thoughtworks.qdox.parser.structs.ClassDef.()V +METHOD|com.thoughtworks.qdox.parser.structs.ClassDef.equals(Ljava/lang/Object;)Z +METHOD|com.thoughtworks.qdox.parser.structs.ClassDef.hashCode()I +METHOD|com.thoughtworks.qdox.parser.structs.ClassDef.toString()Ljava/lang/String; +METHOD|com.thoughtworks.qdox.parser.structs.FieldDef.()V +METHOD|com.thoughtworks.qdox.parser.structs.FieldDef.equals(Ljava/lang/Object;)Z +METHOD|com.thoughtworks.qdox.parser.structs.FieldDef.hashCode()I +METHOD|com.thoughtworks.qdox.parser.structs.FieldDef.toString()Ljava/lang/String; +METHOD|com.thoughtworks.qdox.parser.structs.LocatedDef.()V +METHOD|com.thoughtworks.qdox.parser.structs.MethodDef.()V +METHOD|com.thoughtworks.qdox.parser.structs.MethodDef.equals(Ljava/lang/Object;)Z +METHOD|com.thoughtworks.qdox.parser.structs.MethodDef.hashCode()I +METHOD|com.thoughtworks.qdox.parser.structs.MethodDef.toString()Ljava/lang/String; +METHOD|com.thoughtworks.qdox.parser.structs.TagDef.(Ljava/lang/String;Ljava/lang/String;I)V +METHOD|com.thoughtworks.qdox.parser.structs.TagDef.(Ljava/lang/String;Ljava/lang/String;)V +METHOD|com.thoughtworks.qdox.parser.structs.TagDef.equals(Ljava/lang/Object;)Z +METHOD|com.thoughtworks.qdox.parser.structs.TagDef.hashCode()I +METHOD|com.thoughtworks.qdox.parser.structs.TagDef.toString()Ljava/lang/String; +METHOD|com.thoughtworks.qdox.parser.structs.TypeDef.(Ljava/lang/String;I)V +METHOD|org.testng.Assert.()V +METHOD|org.testng.Assert.assertTrue(ZLjava/lang/String;)V +METHOD|org.testng.Assert.assertTrue(Z)V +METHOD|org.testng.Assert.assertFalse(ZLjava/lang/String;)V +METHOD|org.testng.Assert.assertFalse(Z)V +METHOD|org.testng.Assert.fail(Ljava/lang/String;Ljava/lang/Throwable;)V +METHOD|org.testng.Assert.fail(Ljava/lang/String;)V +METHOD|org.testng.Assert.fail()V +METHOD|org.testng.Assert.assertEquals(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/String;)V +METHOD|org.testng.Assert.assertEquals(Ljava/lang/Object;Ljava/lang/Object;)V +METHOD|org.testng.Assert.assertEquals(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V +METHOD|org.testng.Assert.assertEquals(Ljava/lang/String;Ljava/lang/String;)V +METHOD|org.testng.Assert.assertEquals(DDDLjava/lang/String;)V +METHOD|org.testng.Assert.assertEquals(DDD)V +METHOD|org.testng.Assert.assertEquals(FFFLjava/lang/String;)V +METHOD|org.testng.Assert.assertEquals(FFF)V +METHOD|org.testng.Assert.assertEquals(JJLjava/lang/String;)V +METHOD|org.testng.Assert.assertEquals(JJ)V +METHOD|org.testng.Assert.assertEquals(ZZLjava/lang/String;)V +METHOD|org.testng.Assert.assertEquals(ZZ)V +METHOD|org.testng.Assert.assertEquals(BBLjava/lang/String;)V +METHOD|org.testng.Assert.assertEquals(BB)V +METHOD|org.testng.Assert.assertEquals(CCLjava/lang/String;)V +METHOD|org.testng.Assert.assertEquals(CC)V +METHOD|org.testng.Assert.assertEquals(SSLjava/lang/String;)V +METHOD|org.testng.Assert.assertEquals(SS)V +METHOD|org.testng.Assert.assertEquals(IILjava/lang/String;)V +METHOD|org.testng.Assert.assertEquals(II)V +METHOD|org.testng.Assert.assertNotNull(Ljava/lang/Object;)V +METHOD|org.testng.Assert.assertNotNull(Ljava/lang/Object;Ljava/lang/String;)V +METHOD|org.testng.Assert.assertNull(Ljava/lang/Object;)V +METHOD|org.testng.Assert.assertNull(Ljava/lang/Object;Ljava/lang/String;)V +METHOD|org.testng.Assert.assertSame(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/String;)V +METHOD|org.testng.Assert.assertSame(Ljava/lang/Object;Ljava/lang/Object;)V +METHOD|org.testng.Assert.assertNotSame(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/String;)V +METHOD|org.testng.Assert.assertNotSame(Ljava/lang/Object;Ljava/lang/Object;)V +METHOD|org.testng.Assert.failSame(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/String;)V +METHOD|org.testng.Assert.failNotSame(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/String;)V +METHOD|org.testng.Assert.failNotEquals(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/String;)V +METHOD|org.testng.Assert.format(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/String; +METHOD|org.testng.Assert.assertEquals(Ljava/util/Collection;Ljava/util/Collection;)V +METHOD|org.testng.Assert.assertEquals(Ljava/util/Collection;Ljava/util/Collection;Ljava/lang/String;)V +METHOD|org.testng.Assert.assertEquals([Ljava/lang/Object;[Ljava/lang/Object;Ljava/lang/String;)V +METHOD|org.testng.Assert.assertEqualsNoOrder([Ljava/lang/Object;[Ljava/lang/Object;Ljava/lang/String;)V +METHOD|org.testng.Assert.assertEquals([Ljava/lang/Object;[Ljava/lang/Object;)V +METHOD|org.testng.Assert.assertEqualsNoOrder([Ljava/lang/Object;[Ljava/lang/Object;)V +METHOD|org.testng.Assert.assertEquals([B[B)V +METHOD|org.testng.Assert.assertEquals([B[BLjava/lang/String;)V +METHOD|org.testng.AssertJUnit.()V +METHOD|org.testng.AssertJUnit.assertTrue(Ljava/lang/String;Z)V +METHOD|org.testng.AssertJUnit.assertTrue(Z)V +METHOD|org.testng.AssertJUnit.assertFalse(Ljava/lang/String;Z)V +METHOD|org.testng.AssertJUnit.assertFalse(Z)V +METHOD|org.testng.AssertJUnit.fail(Ljava/lang/String;)V +METHOD|org.testng.AssertJUnit.fail()V +METHOD|org.testng.AssertJUnit.assertEquals(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V +METHOD|org.testng.AssertJUnit.assertEquals(Ljava/lang/Object;Ljava/lang/Object;)V +METHOD|org.testng.AssertJUnit.assertEquals(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V +METHOD|org.testng.AssertJUnit.assertEquals(Ljava/lang/String;Ljava/lang/String;)V +METHOD|org.testng.AssertJUnit.assertEquals(Ljava/lang/String;DDD)V +METHOD|org.testng.AssertJUnit.assertEquals(DDD)V +METHOD|org.testng.AssertJUnit.assertEquals(Ljava/lang/String;FFF)V +METHOD|org.testng.AssertJUnit.assertEquals(FFF)V +METHOD|org.testng.AssertJUnit.assertEquals(Ljava/lang/String;JJ)V +METHOD|org.testng.AssertJUnit.assertEquals(JJ)V +METHOD|org.testng.AssertJUnit.assertEquals(Ljava/lang/String;ZZ)V +METHOD|org.testng.AssertJUnit.assertEquals(ZZ)V +METHOD|org.testng.AssertJUnit.assertEquals(Ljava/lang/String;BB)V +METHOD|org.testng.AssertJUnit.assertEquals(BB)V +METHOD|org.testng.AssertJUnit.assertEquals(Ljava/lang/String;CC)V +METHOD|org.testng.AssertJUnit.assertEquals(CC)V +METHOD|org.testng.AssertJUnit.assertEquals(Ljava/lang/String;SS)V +METHOD|org.testng.AssertJUnit.assertEquals(SS)V +METHOD|org.testng.AssertJUnit.assertEquals(Ljava/lang/String;II)V +METHOD|org.testng.AssertJUnit.assertEquals(II)V +METHOD|org.testng.AssertJUnit.assertNotNull(Ljava/lang/Object;)V +METHOD|org.testng.AssertJUnit.assertNotNull(Ljava/lang/String;Ljava/lang/Object;)V +METHOD|org.testng.AssertJUnit.assertNull(Ljava/lang/Object;)V +METHOD|org.testng.AssertJUnit.assertNull(Ljava/lang/String;Ljava/lang/Object;)V +METHOD|org.testng.AssertJUnit.assertSame(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V +METHOD|org.testng.AssertJUnit.assertSame(Ljava/lang/Object;Ljava/lang/Object;)V +METHOD|org.testng.AssertJUnit.assertNotSame(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V +METHOD|org.testng.AssertJUnit.assertNotSame(Ljava/lang/Object;Ljava/lang/Object;)V +METHOD|org.testng.AssertJUnit.assertEquals([B[B)V +METHOD|org.testng.AssertJUnit.assertEquals(Ljava/lang/String;[B[B)V +METHOD|org.testng.AssertJUnit.failSame(Ljava/lang/String;)V +METHOD|org.testng.AssertJUnit.failNotSame(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V +METHOD|org.testng.AssertJUnit.failNotEquals(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V +METHOD|org.testng.AssertJUnit.format(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/String; +METHOD|org.testng.ClassMethodMap.([Lorg/testng/ITestNGMethod;)V +METHOD|org.testng.ClassMethodMap.removeAndCheckIfLast(Lorg/testng/ITestNGMethod;)Z +METHOD|org.testng.ClassMethodMap.getMethodClass(Lorg/testng/ITestNGMethod;)Ljava/lang/Class; +METHOD|org.testng.IClass.getName()Ljava/lang/String; +METHOD|org.testng.IClass.getRealClass()Ljava/lang/Class; +METHOD|org.testng.IClass.getInstances(Z)[Ljava/lang/Object; +METHOD|org.testng.IClass.getInstanceCount()I +METHOD|org.testng.IClass.getInstanceHashCodes()[J +METHOD|org.testng.IClass.addInstance(Ljava/lang/Object;)V +METHOD|org.testng.IExtraOutput.getParameterOutput()Ljava/util/List; +METHOD|org.testng.IHookCallBack.runTestMethod(Lorg/testng/ITestResult;)V +METHOD|org.testng.IHookable.run(Lorg/testng/IHookCallBack;Lorg/testng/ITestResult;)V +METHOD|org.testng.IInstanceInfo.getInstance()Ljava/lang/Object; +METHOD|org.testng.IInstanceInfo.getInstanceClass()Ljava/lang/Class; +METHOD|org.testng.IMethodSelector.includeMethod(Lorg/testng/ITestNGMethod;Z)Z +METHOD|org.testng.IMethodSelector.setTestMethods(Ljava/util/List;)V +METHOD|org.testng.IReporter.generateReport(Ljava/util/List;Ljava/util/List;Ljava/lang/String;)V +METHOD|org.testng.IResultMap.addResult(Lorg/testng/ITestResult;Lorg/testng/ITestNGMethod;)V +METHOD|org.testng.IResultMap.getResults(Lorg/testng/ITestNGMethod;)Ljava/util/Set; +METHOD|org.testng.IResultMap.getAllResults()Ljava/util/Set; +METHOD|org.testng.IResultMap.getAllMethods()Ljava/util/Collection; +METHOD|org.testng.IResultMap.size()I +METHOD|org.testng.ISuite.getName()Ljava/lang/String; +METHOD|org.testng.ISuite.getResults()Ljava/util/Map; +METHOD|org.testng.ISuite.getOutputDirectory()Ljava/lang/String; +METHOD|org.testng.ISuite.isParallel()Z +METHOD|org.testng.ISuite.getParameter(Ljava/lang/String;)Ljava/lang/String; +METHOD|org.testng.ISuite.getMethodsByGroups()Ljava/util/Map; +METHOD|org.testng.ISuite.getInvokedMethods()Ljava/util/Collection; +METHOD|org.testng.ISuite.getExcludedMethods()Ljava/util/Collection; +METHOD|org.testng.ISuite.run()V +METHOD|org.testng.ISuite.getHost()Ljava/lang/String; +METHOD|org.testng.ISuiteListener.onStart(Lorg/testng/ISuite;)V +METHOD|org.testng.ISuiteListener.onFinish(Lorg/testng/ISuite;)V +METHOD|org.testng.ISuiteResult.getPropertyFileName()Ljava/lang/String; +METHOD|org.testng.ISuiteResult.getTestContext()Lorg/testng/ITestContext; +METHOD|org.testng.ITest.getTestName()Ljava/lang/String; +METHOD|org.testng.ITestClass.getInstances(Z)[Ljava/lang/Object; +METHOD|org.testng.ITestClass.getInstanceHashCodes()[J +METHOD|org.testng.ITestClass.getInstanceCount()I +METHOD|org.testng.ITestClass.getTestMethods()[Lorg/testng/ITestNGMethod; +METHOD|org.testng.ITestClass.getBeforeTestMethods()[Lorg/testng/ITestNGMethod; +METHOD|org.testng.ITestClass.getAfterTestMethods()[Lorg/testng/ITestNGMethod; +METHOD|org.testng.ITestClass.getBeforeClassMethods()[Lorg/testng/ITestNGMethod; +METHOD|org.testng.ITestClass.getAfterClassMethods()[Lorg/testng/ITestNGMethod; +METHOD|org.testng.ITestClass.getBeforeSuiteMethods()[Lorg/testng/ITestNGMethod; +METHOD|org.testng.ITestClass.getAfterSuiteMethods()[Lorg/testng/ITestNGMethod; +METHOD|org.testng.ITestClass.getBeforeTestConfigurationMethods()[Lorg/testng/ITestNGMethod; +METHOD|org.testng.ITestClass.getAfterTestConfigurationMethods()[Lorg/testng/ITestNGMethod; +METHOD|org.testng.ITestClass.getBeforeGroupsMethods()[Lorg/testng/ITestNGMethod; +METHOD|org.testng.ITestClass.getAfterGroupsMethods()[Lorg/testng/ITestNGMethod; +METHOD|org.testng.ITestClassFinder.findTestClasses()[Lorg/testng/IClass; +METHOD|org.testng.ITestClassFinder.getIClass(Ljava/lang/Class;)Lorg/testng/IClass; +METHOD|org.testng.ITestContext.getName()Ljava/lang/String; +METHOD|org.testng.ITestContext.getStartDate()Ljava/util/Date; +METHOD|org.testng.ITestContext.getEndDate()Ljava/util/Date; +METHOD|org.testng.ITestContext.getPassedTests()Lorg/testng/IResultMap; +METHOD|org.testng.ITestContext.getSkippedTests()Lorg/testng/IResultMap; +METHOD|org.testng.ITestContext.getFailedButWithinSuccessPercentageTests()Lorg/testng/IResultMap; +METHOD|org.testng.ITestContext.getFailedTests()Lorg/testng/IResultMap; +METHOD|org.testng.ITestContext.getIncludedGroups()[Ljava/lang/String; +METHOD|org.testng.ITestContext.getExcludedGroups()[Ljava/lang/String; +METHOD|org.testng.ITestContext.getOutputDirectory()Ljava/lang/String; +METHOD|org.testng.ITestContext.getSuite()Lorg/testng/ISuite; +METHOD|org.testng.ITestContext.getAllTestMethods()[Lorg/testng/ITestNGMethod; +METHOD|org.testng.ITestContext.getHost()Ljava/lang/String; +METHOD|org.testng.ITestContext.getExcludedMethods()Ljava/util/Collection; +METHOD|org.testng.ITestListener.onTestStart(Lorg/testng/ITestResult;)V +METHOD|org.testng.ITestListener.onTestSuccess(Lorg/testng/ITestResult;)V +METHOD|org.testng.ITestListener.onTestFailure(Lorg/testng/ITestResult;)V +METHOD|org.testng.ITestListener.onTestSkipped(Lorg/testng/ITestResult;)V +METHOD|org.testng.ITestListener.onTestFailedButWithinSuccessPercentage(Lorg/testng/ITestResult;)V +METHOD|org.testng.ITestListener.onStart(Lorg/testng/ITestContext;)V +METHOD|org.testng.ITestListener.onFinish(Lorg/testng/ITestContext;)V +METHOD|org.testng.ITestMethodFinder.getTestMethods(Ljava/lang/Class;)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.ITestMethodFinder.getBeforeTestMethods(Ljava/lang/Class;)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.ITestMethodFinder.getAfterTestMethods(Ljava/lang/Class;)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.ITestMethodFinder.getBeforeClassMethods(Ljava/lang/Class;)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.ITestMethodFinder.getAfterClassMethods(Ljava/lang/Class;)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.ITestMethodFinder.getBeforeSuiteMethods(Ljava/lang/Class;)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.ITestMethodFinder.getAfterSuiteMethods(Ljava/lang/Class;)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.ITestMethodFinder.getBeforeTestConfigurationMethods(Ljava/lang/Class;)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.ITestMethodFinder.getAfterTestConfigurationMethods(Ljava/lang/Class;)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.ITestMethodFinder.getBeforeGroupsConfigurationMethods(Ljava/lang/Class;)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.ITestMethodFinder.getAfterGroupsConfigurationMethods(Ljava/lang/Class;)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.ITestNGMethod.getRealClass()Ljava/lang/Class; +METHOD|org.testng.ITestNGMethod.getTestClass()Lorg/testng/ITestClass; +METHOD|org.testng.ITestNGMethod.setTestClass(Lorg/testng/ITestClass;)V +METHOD|org.testng.ITestNGMethod.getMethod()Ljava/lang/reflect/Method; +METHOD|org.testng.ITestNGMethod.getMethodName()Ljava/lang/String; +METHOD|org.testng.ITestNGMethod.getInstances()[Ljava/lang/Object; +METHOD|org.testng.ITestNGMethod.getInstanceHashCodes()[J +METHOD|org.testng.ITestNGMethod.getGroups()[Ljava/lang/String; +METHOD|org.testng.ITestNGMethod.getGroupsDependedUpon()[Ljava/lang/String; +METHOD|org.testng.ITestNGMethod.getMissingGroup()Ljava/lang/String; +METHOD|org.testng.ITestNGMethod.setMissingGroup(Ljava/lang/String;)V +METHOD|org.testng.ITestNGMethod.getBeforeGroups()[Ljava/lang/String; +METHOD|org.testng.ITestNGMethod.getAfterGroups()[Ljava/lang/String; +METHOD|org.testng.ITestNGMethod.getMethodsDependedUpon()[Ljava/lang/String; +METHOD|org.testng.ITestNGMethod.addMethodDependedUpon(Ljava/lang/String;)V +METHOD|org.testng.ITestNGMethod.isTest()Z +METHOD|org.testng.ITestNGMethod.isBeforeMethodConfiguration()Z +METHOD|org.testng.ITestNGMethod.isAfterMethodConfiguration()Z +METHOD|org.testng.ITestNGMethod.isBeforeClassConfiguration()Z +METHOD|org.testng.ITestNGMethod.isAfterClassConfiguration()Z +METHOD|org.testng.ITestNGMethod.isBeforeSuiteConfiguration()Z +METHOD|org.testng.ITestNGMethod.isAfterSuiteConfiguration()Z +METHOD|org.testng.ITestNGMethod.isBeforeTestConfiguration()Z +METHOD|org.testng.ITestNGMethod.isAfterTestConfiguration()Z +METHOD|org.testng.ITestNGMethod.getTimeOut()J +METHOD|org.testng.ITestNGMethod.getInvocationCount()I +METHOD|org.testng.ITestNGMethod.getSuccessPercentage()I +METHOD|org.testng.ITestNGMethod.getId()J +METHOD|org.testng.ITestNGMethod.setId(J)V +METHOD|org.testng.ITestNGMethod.getDate()J +METHOD|org.testng.ITestNGMethod.setDate(J)V +METHOD|org.testng.ITestNGMethod.canRunFromClass(Lorg/testng/IClass;)Z +METHOD|org.testng.ITestNGMethod.isAlwaysRun()Z +METHOD|org.testng.ITestNGMethod.getThreadPoolSize()I +METHOD|org.testng.ITestNGMethod.getDescription()Ljava/lang/String; +METHOD|org.testng.ITestNGMethod.isBeforeGroupsConfiguration()Z +METHOD|org.testng.ITestNGMethod.isAfterGroupsConfiguration()Z +METHOD|org.testng.ITestResult.getStatus()I +METHOD|org.testng.ITestResult.setStatus(I)V +METHOD|org.testng.ITestResult.getMethod()Lorg/testng/ITestNGMethod; +METHOD|org.testng.ITestResult.getParameters()[Ljava/lang/Object; +METHOD|org.testng.ITestResult.setParameters([Ljava/lang/Object;)V +METHOD|org.testng.ITestResult.getTestClass()Lorg/testng/IClass; +METHOD|org.testng.ITestResult.setThrowable(Ljava/lang/Throwable;)V +METHOD|org.testng.ITestResult.getThrowable()Ljava/lang/Throwable; +METHOD|org.testng.ITestResult.getStartMillis()J +METHOD|org.testng.ITestResult.getEndMillis()J +METHOD|org.testng.ITestResult.setEndMillis(J)V +METHOD|org.testng.ITestResult.getName()Ljava/lang/String; +METHOD|org.testng.ITestResult.isSuccess()Z +METHOD|org.testng.ITestResult.getHost()Ljava/lang/String; +METHOD|org.testng.ITestRunnerFactory.newTestRunner(Lorg/testng/ISuite;Lorg/testng/xml/XmlTest;)Lorg/testng/TestRunner; +METHOD|org.testng.JUnitConverter.()V +METHOD|org.testng.JUnitConverter.main([Ljava/lang/String;)V +METHOD|org.testng.JUnitConverter.extractOptions([Ljava/lang/String;)Ljava/util/Map; +METHOD|org.testng.JUnitConverter.usage()V +METHOD|org.testng.JUnitConverter.log(Ljava/lang/String;)V +METHOD|org.testng.JUnitConverter.getLogLevel()I +METHOD|org.testng.JUnitConverter.ppp(Ljava/lang/String;)V +METHOD|org.testng.JUnitConverter.()V +METHOD|org.testng.JUnitConverterTask.()V +METHOD|org.testng.JUnitConverterTask.execute()V +METHOD|org.testng.JUnitConverterTask.validate()V +METHOD|org.testng.JUnitConverterTask.init()V +METHOD|org.testng.JUnitConverterTask.setOutputDir(Ljava/io/File;)V +METHOD|org.testng.JUnitConverterTask.setSourceDir(Ljava/io/File;)V +METHOD|org.testng.JUnitConverterTask.setAnnotations(Z)V +METHOD|org.testng.Reporter.()V +METHOD|org.testng.Reporter.setCurrentTestResult(Lorg/testng/ITestResult;)V +METHOD|org.testng.Reporter.getOutput()Ljava/util/List; +METHOD|org.testng.Reporter.log(Ljava/lang/String;Lorg/testng/ITestResult;)V +METHOD|org.testng.Reporter.log(Ljava/lang/String;)V +METHOD|org.testng.Reporter.log(Ljava/lang/String;IZ)V +METHOD|org.testng.Reporter.log(Ljava/lang/String;Z)V +METHOD|org.testng.Reporter.log(Ljava/lang/String;I)V +METHOD|org.testng.Reporter.getCurrentTestResult()Lorg/testng/ITestResult; +METHOD|org.testng.Reporter.ppp(Ljava/lang/String;)V +METHOD|org.testng.Reporter.getOutput(Lorg/testng/ITestResult;)Ljava/util/List; +METHOD|org.testng.Reporter.()V +METHOD|org.testng.SuiteResult$1.()V +METHOD|org.testng.SuiteResult$1.compare(Lorg/testng/SuiteResult;Lorg/testng/SuiteResult;)I +METHOD|org.testng.SuiteResult$1.equals(Ljava/lang/Object;)Z +METHOD|org.testng.SuiteResult$1.compare(Ljava/lang/Object;Ljava/lang/Object;)I +METHOD|org.testng.SuiteResult.(Ljava/lang/String;Lorg/testng/ITestContext;)V +METHOD|org.testng.SuiteResult.(Lorg/testng/xml/XmlSuite;Lorg/testng/ITestContext;)V +METHOD|org.testng.SuiteResult.getPropertyFileName()Ljava/lang/String; +METHOD|org.testng.SuiteResult.getTestContext()Lorg/testng/ITestContext; +METHOD|org.testng.SuiteResult.getSuite()Lorg/testng/xml/XmlSuite; +METHOD|org.testng.SuiteResult.compareTo(Ljava/lang/Object;)I +METHOD|org.testng.SuiteResult.toString()Ljava/lang/String; +METHOD|org.testng.SuiteResult.()V +METHOD|org.testng.SuiteRunner$DefaultTestRunnerFactory.([Lorg/testng/ITestListener;Z)V +METHOD|org.testng.SuiteRunner$DefaultTestRunnerFactory.newTestRunner(Lorg/testng/ISuite;Lorg/testng/xml/XmlTest;)Lorg/testng/TestRunner; +METHOD|org.testng.SuiteRunner$ProxyTestRunnerFactory.([Lorg/testng/ITestListener;Lorg/testng/ITestRunnerFactory;)V +METHOD|org.testng.SuiteRunner$ProxyTestRunnerFactory.newTestRunner(Lorg/testng/ISuite;Lorg/testng/xml/XmlTest;)Lorg/testng/TestRunner; +METHOD|org.testng.SuiteRunner.(Lorg/testng/xml/XmlSuite;Ljava/lang/String;)V +METHOD|org.testng.SuiteRunner.(Lorg/testng/xml/XmlSuite;Ljava/lang/String;Z)V +METHOD|org.testng.SuiteRunner.(Lorg/testng/xml/XmlSuite;Ljava/lang/String;Lorg/testng/ITestRunnerFactory;)V +METHOD|org.testng.SuiteRunner.(Lorg/testng/xml/XmlSuite;Ljava/lang/String;Lorg/testng/ITestRunnerFactory;Z)V +METHOD|org.testng.SuiteRunner.getName()Ljava/lang/String; +METHOD|org.testng.SuiteRunner.setTestListeners(Ljava/util/List;)V +METHOD|org.testng.SuiteRunner.setReportResults(Z)V +METHOD|org.testng.SuiteRunner.invokeListeners(Z)V +METHOD|org.testng.SuiteRunner.setOutputDir(Ljava/lang/String;)V +METHOD|org.testng.SuiteRunner.lazyInit()V +METHOD|org.testng.SuiteRunner.buildRunnerFactory(Ljava/util/List;)Lorg/testng/ITestRunnerFactory; +METHOD|org.testng.SuiteRunner.isParallel()Z +METHOD|org.testng.SuiteRunner.run()V +METHOD|org.testng.SuiteRunner.privateRun()V +METHOD|org.testng.SuiteRunner.addListener(Lorg/testng/ISuiteListener;)V +METHOD|org.testng.SuiteRunner.getOutputDirectory()Ljava/lang/String; +METHOD|org.testng.SuiteRunner.getResults()Ljava/util/Map; +METHOD|org.testng.SuiteRunner.getParameter(Ljava/lang/String;)Ljava/lang/String; +METHOD|org.testng.SuiteRunner.getMethodsByGroups()Ljava/util/Map; +METHOD|org.testng.SuiteRunner.getInvokedMethods()Ljava/util/Collection; +METHOD|org.testng.SuiteRunner.getExcludedMethods()Ljava/util/Collection; +METHOD|org.testng.SuiteRunner.getIncludedOrExcludedMethods(Z)Ljava/util/Collection; +METHOD|org.testng.SuiteRunner.getAnnotationFinder(Lorg/testng/xml/XmlTest;)Lorg/testng/internal/annotations/IAnnotationFinder; +METHOD|org.testng.SuiteRunner.getAnnotationFinder(I)Lorg/testng/internal/annotations/IAnnotationFinder; +METHOD|org.testng.SuiteRunner.ppp(Ljava/lang/String;)V +METHOD|org.testng.SuiteRunner.setHost(Ljava/lang/String;)V +METHOD|org.testng.SuiteRunner.getHost()Ljava/lang/String; +METHOD|org.testng.TestClass.(Lorg/testng/IClass;Ljava/lang/String;Lorg/testng/ITestMethodFinder;Lorg/testng/internal/annotations/IAnnotationFinder;Lorg/testng/internal/RunInfo;Lorg/testng/TestRunner;)V +METHOD|org.testng.TestClass.(Lorg/testng/IClass;Lorg/testng/TestClass;)V +METHOD|org.testng.TestClass.getTestName()Ljava/lang/String; +METHOD|org.testng.TestClass.getAnnotationFinder()Lorg/testng/internal/annotations/IAnnotationFinder; +METHOD|org.testng.TestClass.init(Lorg/testng/IClass;Ljava/lang/String;Lorg/testng/ITestMethodFinder;Lorg/testng/internal/annotations/IAnnotationFinder;Lorg/testng/internal/RunInfo;Lorg/testng/TestRunner;)V +METHOD|org.testng.TestClass.initTestClassesAndInstances()V +METHOD|org.testng.TestClass.getInstances(Z)[Ljava/lang/Object; +METHOD|org.testng.TestClass.getInstanceHashCodes()[J +METHOD|org.testng.TestClass.getInstanceCount()I +METHOD|org.testng.TestClass.addInstance(Ljava/lang/Object;)V +METHOD|org.testng.TestClass.initMethods()V +METHOD|org.testng.TestClass.createTestMethods([Lorg/testng/ITestNGMethod;)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.TestClass.getTestRunner()Lorg/testng/TestRunner; +METHOD|org.testng.TestClass.getRunInfo()Lorg/testng/internal/RunInfo; +METHOD|org.testng.TestClass.getTestMethodFinder()Lorg/testng/ITestMethodFinder; +METHOD|org.testng.TestClass.log(ILjava/lang/String;)V +METHOD|org.testng.TestClass.ppp(Ljava/lang/String;)V +METHOD|org.testng.TestClass.getName()Ljava/lang/String; +METHOD|org.testng.TestClass.getRealClass()Ljava/lang/Class; +METHOD|org.testng.TestClass.getTestClasses()[Ljava/lang/Class; +METHOD|org.testng.TestClass.dump()V +METHOD|org.testng.TestClass.getAfterClassMethods()[Lorg/testng/ITestNGMethod; +METHOD|org.testng.TestClass.getAfterTestMethods()[Lorg/testng/ITestNGMethod; +METHOD|org.testng.TestClass.getBeforeClassMethods()[Lorg/testng/ITestNGMethod; +METHOD|org.testng.TestClass.getBeforeTestMethods()[Lorg/testng/ITestNGMethod; +METHOD|org.testng.TestClass.getTestMethods()[Lorg/testng/ITestNGMethod; +METHOD|org.testng.TestClass.getBeforeSuiteMethods()[Lorg/testng/ITestNGMethod; +METHOD|org.testng.TestClass.getAfterSuiteMethods()[Lorg/testng/ITestNGMethod; +METHOD|org.testng.TestClass.getBeforeTestConfigurationMethods()[Lorg/testng/ITestNGMethod; +METHOD|org.testng.TestClass.getAfterTestConfigurationMethods()[Lorg/testng/ITestNGMethod; +METHOD|org.testng.TestClass.getBeforeGroupsMethods()[Lorg/testng/ITestNGMethod; +METHOD|org.testng.TestClass.getAfterGroupsMethods()[Lorg/testng/ITestNGMethod; +METHOD|org.testng.TestClass.toString()Ljava/lang/String; +METHOD|org.testng.TestException.(Ljava/lang/String;)V +METHOD|org.testng.TestException.(Ljava/lang/Throwable;)V +METHOD|org.testng.TestListenerAdapter.()V +METHOD|org.testng.TestListenerAdapter.onTestSuccess(Lorg/testng/ITestResult;)V +METHOD|org.testng.TestListenerAdapter.onTestFailure(Lorg/testng/ITestResult;)V +METHOD|org.testng.TestListenerAdapter.onTestSkipped(Lorg/testng/ITestResult;)V +METHOD|org.testng.TestListenerAdapter.onTestFailedButWithinSuccessPercentage(Lorg/testng/ITestResult;)V +METHOD|org.testng.TestListenerAdapter.getAllTestMethods()[Lorg/testng/ITestNGMethod; +METHOD|org.testng.TestListenerAdapter.onStart(Lorg/testng/ITestContext;)V +METHOD|org.testng.TestListenerAdapter.onFinish(Lorg/testng/ITestContext;)V +METHOD|org.testng.TestListenerAdapter.getFailedButWithinSuccessPercentageTests()Ljava/util/List; +METHOD|org.testng.TestListenerAdapter.getFailedTests()Ljava/util/List; +METHOD|org.testng.TestListenerAdapter.getPassedTests()Ljava/util/List; +METHOD|org.testng.TestListenerAdapter.getSkippedTests()Ljava/util/List; +METHOD|org.testng.TestListenerAdapter.ppp(Ljava/lang/String;)V +METHOD|org.testng.TestListenerAdapter.setAllTestMethods(Ljava/util/List;)V +METHOD|org.testng.TestListenerAdapter.setFailedButWithinSuccessPercentageTests(Ljava/util/List;)V +METHOD|org.testng.TestListenerAdapter.setFailedTests(Ljava/util/List;)V +METHOD|org.testng.TestListenerAdapter.setPassedTests(Ljava/util/List;)V +METHOD|org.testng.TestListenerAdapter.setSkippedTests(Ljava/util/List;)V +METHOD|org.testng.TestListenerAdapter.onTestStart(Lorg/testng/ITestResult;)V +METHOD|org.testng.TestNG.()V +METHOD|org.testng.TestNG.(Z)V +METHOD|org.testng.TestNG.init(Z)V +METHOD|org.testng.TestNG.getDefault()Lorg/testng/TestNG; +METHOD|org.testng.TestNG.getStatus()I +METHOD|org.testng.TestNG.setStatus(I)V +METHOD|org.testng.TestNG.setOutputDirectory(Ljava/lang/String;)V +METHOD|org.testng.TestNG.setUseDefaultListeners(Z)V +METHOD|org.testng.TestNG.setTarget(Ljava/lang/String;)V +METHOD|org.testng.TestNG.setSourcePath(Ljava/lang/String;)V +METHOD|org.testng.TestNG.setTestJar(Ljava/lang/String;)V +METHOD|org.testng.TestNG.setThreadCount(I)V +METHOD|org.testng.TestNG.setParallel(Z)V +METHOD|org.testng.TestNG.setCommandLineSuite(Lorg/testng/xml/XmlSuite;)V +METHOD|org.testng.TestNG.setTestClasses([Ljava/lang/Class;)V +METHOD|org.testng.TestNG.createCommandLineSuites([Ljava/lang/Class;)[Lorg/testng/xml/XmlSuite; +METHOD|org.testng.TestNG.setTestSuites(Ljava/util/List;)V +METHOD|org.testng.TestNG.setXmlSuites(Ljava/util/List;)V +METHOD|org.testng.TestNG.setExcludedGroups(Ljava/lang/String;)V +METHOD|org.testng.TestNG.setGroups(Ljava/lang/String;)V +METHOD|org.testng.TestNG.setTestRunnerFactoryClass(Ljava/lang/Class;)V +METHOD|org.testng.TestNG.setTestRunnerFactory(Lorg/testng/ITestRunnerFactory;)V +METHOD|org.testng.TestNG.setListenerClasses(Ljava/util/List;)V +METHOD|org.testng.TestNG.setListeners(Ljava/util/List;)V +METHOD|org.testng.TestNG.addListener(Ljava/lang/Object;)V +METHOD|org.testng.TestNG.addListener(Lorg/testng/ISuiteListener;)V +METHOD|org.testng.TestNG.addListener(Lorg/testng/ITestListener;)V +METHOD|org.testng.TestNG.addListener(Lorg/testng/IReporter;)V +METHOD|org.testng.TestNG.getReporters()Ljava/util/List; +METHOD|org.testng.TestNG.getTestListeners()Ljava/util/List; +METHOD|org.testng.TestNG.getSuiteListeners()Ljava/util/List; +METHOD|org.testng.TestNG.setVerbose(I)V +METHOD|org.testng.TestNG.run()V +METHOD|org.testng.TestNG.resetSocket(ILorg/testng/remote/ConnectionInfo;)Lorg/testng/remote/ConnectionInfo; +METHOD|org.testng.TestNG.waitForSuites()V +METHOD|org.testng.TestNG.log(Ljava/lang/String;)V +METHOD|org.testng.TestNG.runSuitesRemotely()Ljava/util/List; +METHOD|org.testng.TestNG.runSuitesLocally()Ljava/util/List; +METHOD|org.testng.TestNG.createAndRunSuiteRunners(Lorg/testng/xml/XmlSuite;)Lorg/testng/SuiteRunner; +METHOD|org.testng.TestNG.newInstance(Ljava/lang/Class;)Ljava/lang/Object; +METHOD|org.testng.TestNG.main([Ljava/lang/String;)V +METHOD|org.testng.TestNG.privateMain([Ljava/lang/String;Lorg/testng/ITestListener;)Lorg/testng/TestNG; +METHOD|org.testng.TestNG.setClientPort(I)V +METHOD|org.testng.TestNG.setHostFile(Ljava/lang/String;)V +METHOD|org.testng.TestNG.setJUnit(Ljava/lang/Boolean;)V +METHOD|org.testng.TestNG.setTestNGVersion()V +METHOD|org.testng.TestNG.isJdk14()Z +METHOD|org.testng.TestNG.checkConditions(Ljava/util/Map;)V +METHOD|org.testng.TestNG.ppp(Ljava/lang/String;)V +METHOD|org.testng.TestNG.hasFailure()Z +METHOD|org.testng.TestNG.setHasFailure(Z)V +METHOD|org.testng.TestNG.hasFailureWithinSuccessPercentage()Z +METHOD|org.testng.TestNG.setHasFailureWithinSuccessPercentage(Z)V +METHOD|org.testng.TestNG.hasSkip()Z +METHOD|org.testng.TestNG.setHasSkip(Z)V +METHOD|org.testng.TestNG.usage()V +METHOD|org.testng.TestNG.exitWithError(Ljava/lang/String;)V +METHOD|org.testng.TestNG.getOutputDirectory()Ljava/lang/String; +METHOD|org.testng.TestNGAntTask.()V +METHOD|org.testng.TestNGAntTask.setHaltonfailure(Z)V +METHOD|org.testng.TestNGAntTask.setFailureProperty(Ljava/lang/String;)V +METHOD|org.testng.TestNGAntTask.setHaltonskipped(Z)V +METHOD|org.testng.TestNGAntTask.setSkippedProperty(Ljava/lang/String;)V +METHOD|org.testng.TestNGAntTask.setHaltonFSP(Z)V +METHOD|org.testng.TestNGAntTask.setFSPProperty(Ljava/lang/String;)V +METHOD|org.testng.TestNGAntTask.setDumpCommand(Z)V +METHOD|org.testng.TestNGAntTask.setEnableAssert(Z)V +METHOD|org.testng.TestNGAntTask.setWorkingDir(Ljava/io/File;)V +METHOD|org.testng.TestNGAntTask.setJvm(Ljava/lang/String;)V +METHOD|org.testng.TestNGAntTask.setTimeout(Ljava/lang/Integer;)V +METHOD|org.testng.TestNGAntTask.createJvmarg()Lorg/apache/tools/ant/types/Commandline$Argument; +METHOD|org.testng.TestNGAntTask.addSysproperty(Lorg/apache/tools/ant/types/Environment$Variable;)V +METHOD|org.testng.TestNGAntTask.addEnv(Lorg/apache/tools/ant/types/Environment$Variable;)V +METHOD|org.testng.TestNGAntTask.createClasspath()Lorg/apache/tools/ant/types/Path; +METHOD|org.testng.TestNGAntTask.createBootclasspath()Lorg/apache/tools/ant/types/Path; +METHOD|org.testng.TestNGAntTask.setClasspath(Lorg/apache/tools/ant/types/Path;)V +METHOD|org.testng.TestNGAntTask.setClasspathRef(Lorg/apache/tools/ant/types/Reference;)V +METHOD|org.testng.TestNGAntTask.addXmlfileset(Lorg/apache/tools/ant/types/FileSet;)V +METHOD|org.testng.TestNGAntTask.setXmlfilesetRef(Lorg/apache/tools/ant/types/Reference;)V +METHOD|org.testng.TestNGAntTask.addClassfileset(Lorg/apache/tools/ant/types/FileSet;)V +METHOD|org.testng.TestNGAntTask.setClassfilesetRef(Lorg/apache/tools/ant/types/Reference;)V +METHOD|org.testng.TestNGAntTask.setSourcedir(Lorg/apache/tools/ant/types/Path;)V +METHOD|org.testng.TestNGAntTask.createSourceDir()Lorg/apache/tools/ant/types/Path; +METHOD|org.testng.TestNGAntTask.setSourceDirRef(Lorg/apache/tools/ant/types/Reference;)V +METHOD|org.testng.TestNGAntTask.setSuiteRunnerClass(Ljava/lang/String;)V +METHOD|org.testng.TestNGAntTask.setJUnit(Z)V +METHOD|org.testng.TestNGAntTask.setTarget(Ljava/lang/String;)V +METHOD|org.testng.TestNGAntTask.setOutputDir(Ljava/io/File;)V +METHOD|org.testng.TestNGAntTask.setTestJar(Ljava/io/File;)V +METHOD|org.testng.TestNGAntTask.setGroups(Ljava/lang/String;)V +METHOD|org.testng.TestNGAntTask.setExcludedGroups(Ljava/lang/String;)V +METHOD|org.testng.TestNGAntTask.setVerbose(Ljava/lang/Integer;)V +METHOD|org.testng.TestNGAntTask.setReporter(Ljava/lang/String;)V +METHOD|org.testng.TestNGAntTask.setListener(Ljava/lang/String;)V +METHOD|org.testng.TestNGAntTask.execute()V +METHOD|org.testng.TestNGAntTask.actOnResult(IZ)V +METHOD|org.testng.TestNGAntTask.executeAsForked(Lorg/apache/tools/ant/types/CommandlineJava;Lorg/apache/tools/ant/taskdefs/ExecuteWatchdog;)I +METHOD|org.testng.TestNGAntTask.getJavaCommand()Lorg/apache/tools/ant/types/CommandlineJava; +METHOD|org.testng.TestNGAntTask.createWatchdog()Lorg/apache/tools/ant/taskdefs/ExecuteWatchdog; +METHOD|org.testng.TestNGAntTask.validateOptions()V +METHOD|org.testng.TestNGAntTask.usesJavadocAnnotations()Z +METHOD|org.testng.TestNGAntTask.createFileSet(Lorg/apache/tools/ant/types/Reference;)Lorg/apache/tools/ant/types/FileSet; +METHOD|org.testng.TestNGAntTask.findJar()Ljava/io/File; +METHOD|org.testng.TestNGAntTask.fromURI(Ljava/lang/String;)Ljava/lang/String; +METHOD|org.testng.TestNGAntTask.fileset(Ljava/util/List;)Ljava/util/List; +METHOD|org.testng.TestNGAntTask.createPathString(Lorg/apache/tools/ant/types/Path;Ljava/lang/String;)Ljava/lang/String; +METHOD|org.testng.TestNGAntTask.dumpCommand()V +METHOD|org.testng.TestNGCommandLineArgs.()V +METHOD|org.testng.TestNGCommandLineArgs.parseCommandLine([Ljava/lang/String;)Ljava/util/Map; +METHOD|org.testng.TestNGCommandLineArgs.fileToClass(Ljava/lang/String;)Ljava/lang/Class; +METHOD|org.testng.TestNGCommandLineArgs.usage()V +METHOD|org.testng.TestNGCommandLineArgs.()V +METHOD|org.testng.TestNGException.(Ljava/lang/Throwable;)V +METHOD|org.testng.TestNGException.(Ljava/lang/String;)V +METHOD|org.testng.TestNGException.(Ljava/lang/String;Ljava/lang/Throwable;)V +METHOD|org.testng.TestRunner.(Lorg/testng/ISuite;Lorg/testng/xml/XmlTest;Ljava/lang/String;Lorg/testng/internal/annotations/IAnnotationFinder;)V +METHOD|org.testng.TestRunner.(Lorg/testng/ISuite;Lorg/testng/xml/XmlTest;Lorg/testng/internal/annotations/IAnnotationFinder;)V +METHOD|org.testng.TestRunner.(Lorg/testng/ISuite;Lorg/testng/xml/XmlTest;)V +METHOD|org.testng.TestRunner.init(Lorg/testng/ISuite;Lorg/testng/xml/XmlTest;Ljava/lang/String;Lorg/testng/internal/annotations/IAnnotationFinder;)V +METHOD|org.testng.TestRunner.getInvoker()Lorg/testng/internal/IInvoker; +METHOD|org.testng.TestRunner.getBeforeSuiteMethods()[Lorg/testng/ITestNGMethod; +METHOD|org.testng.TestRunner.getAfterSuiteMethods()[Lorg/testng/ITestNGMethod; +METHOD|org.testng.TestRunner.getBeforeTestConfigurationMethods()[Lorg/testng/ITestNGMethod; +METHOD|org.testng.TestRunner.getAfterTestConfigurationMethods()[Lorg/testng/ITestNGMethod; +METHOD|org.testng.TestRunner.init()V +METHOD|org.testng.TestRunner.initMetaGroups(Lorg/testng/xml/XmlTest;)V +METHOD|org.testng.TestRunner.initRunInfo(Lorg/testng/xml/XmlTest;)V +METHOD|org.testng.TestRunner.initMethods()V +METHOD|org.testng.TestRunner.findGroupMethods(Ljava/util/Collection;)Lorg/testng/internal/ConfigurationGroupMethods; +METHOD|org.testng.TestRunner.fillGroupMethods(Ljava/util/Collection;Ljava/util/Map;Z)V +METHOD|org.testng.TestRunner.ppp(Ljava/lang/String;)V +METHOD|org.testng.TestRunner.fixMethodsWithClass([Lorg/testng/ITestNGMethod;Lorg/testng/ITestClass;Ljava/util/List;)V +METHOD|org.testng.TestRunner.getIClass()Ljava/util/Collection; +METHOD|org.testng.TestRunner.findIClass([Lorg/testng/IClass;Ljava/lang/Class;)Lorg/testng/IClass; +METHOD|org.testng.TestRunner.getName()Ljava/lang/String; +METHOD|org.testng.TestRunner.getIncludedGroups()[Ljava/lang/String; +METHOD|org.testng.TestRunner.getExcludedGroups()[Ljava/lang/String; +METHOD|org.testng.TestRunner.setTestName(Ljava/lang/String;)V +METHOD|org.testng.TestRunner.setOutputDirectory(Ljava/lang/String;)V +METHOD|org.testng.TestRunner.getOutputDirectory()Ljava/lang/String; +METHOD|org.testng.TestRunner.getEndDate()Ljava/util/Date; +METHOD|org.testng.TestRunner.getStartDate()Ljava/util/Date; +METHOD|org.testng.TestRunner.addMetaGroup(Ljava/lang/String;Ljava/util/List;)V +METHOD|org.testng.TestRunner.collectGroups([Ljava/lang/String;Ljava/util/List;Ljava/util/Map;)V +METHOD|org.testng.TestRunner.createGroups(Ljava/util/List;)Ljava/util/Map; +METHOD|org.testng.TestRunner.createGroups([Ljava/lang/String;)Ljava/util/Map; +METHOD|org.testng.TestRunner.collectAndOrderTestMethods([Lorg/testng/ITestNGMethod;)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.TestRunner.run()V +METHOD|org.testng.TestRunner.beforeRun()V +METHOD|org.testng.TestRunner.privateRun(Lorg/testng/xml/XmlTest;)V +METHOD|org.testng.TestRunner.afterRun()V +METHOD|org.testng.TestRunner.containsString(Ljava/util/Map;Ljava/lang/String;)Z +METHOD|org.testng.TestRunner.computeTestLists(Ljava/util/List;Ljava/util/List;)V +METHOD|org.testng.TestRunner.invokeClassConfigurations([Lorg/testng/ITestNGMethod;Lorg/testng/xml/XmlTest;Z)V +METHOD|org.testng.TestRunner.logStart()V +METHOD|org.testng.TestRunner.fireEvent(Z)V +METHOD|org.testng.TestRunner.addPassedTest(Lorg/testng/ITestNGMethod;Lorg/testng/ITestResult;)V +METHOD|org.testng.TestRunner.getPassedTests(Lorg/testng/ITestNGMethod;)Ljava/util/Set; +METHOD|org.testng.TestRunner.addSkippedTest(Lorg/testng/ITestNGMethod;Lorg/testng/ITestResult;)V +METHOD|org.testng.TestRunner.addInvokedMethod(Lorg/testng/internal/InvokedMethod;)V +METHOD|org.testng.TestRunner.addFailedTest(Lorg/testng/ITestNGMethod;Lorg/testng/ITestResult;)V +METHOD|org.testng.TestRunner.addFailedButWithinSuccessPercentageTest(Lorg/testng/ITestNGMethod;Lorg/testng/ITestResult;)V +METHOD|org.testng.TestRunner.getTest()Lorg/testng/xml/XmlTest; +METHOD|org.testng.TestRunner.getTestListeners()Ljava/util/List; +METHOD|org.testng.TestRunner.findTestClass(Ljava/lang/Class;)Lorg/testng/IClass; +METHOD|org.testng.TestRunner.getTestMethods()[Lorg/testng/ITestNGMethod; +METHOD|org.testng.TestRunner.logFailedTest(Lorg/testng/ITestNGMethod;Lorg/testng/ITestResult;Z)V +METHOD|org.testng.TestRunner.mapToString(Ljava/util/Map;)Ljava/lang/String; +METHOD|org.testng.TestRunner.log(ILjava/lang/String;)V +METHOD|org.testng.TestRunner.getVerbose()I +METHOD|org.testng.TestRunner.setVerbose(I)V +METHOD|org.testng.TestRunner.log(Ljava/lang/String;)V +METHOD|org.testng.TestRunner.getPassedTests()Lorg/testng/IResultMap; +METHOD|org.testng.TestRunner.getSkippedTests()Lorg/testng/IResultMap; +METHOD|org.testng.TestRunner.getFailedTests()Lorg/testng/IResultMap; +METHOD|org.testng.TestRunner.getFailedButWithinSuccessPercentageTests()Lorg/testng/IResultMap; +METHOD|org.testng.TestRunner.addTestListener(Lorg/testng/ITestListener;)V +METHOD|org.testng.TestRunner.getSuite()Lorg/testng/ISuite; +METHOD|org.testng.TestRunner.getAllTestMethods()[Lorg/testng/ITestNGMethod; +METHOD|org.testng.TestRunner.dumpInvokedMethods()V +METHOD|org.testng.TestRunner.getInvokedMethods()Ljava/util/List; +METHOD|org.testng.TestRunner.getHost()Ljava/lang/String; +METHOD|org.testng.TestRunner.getExcludedMethods()Ljava/util/Collection; +METHOD|org.testng.TestRunner.()V +METHOD|org.testng.annotations.AfterClass.enabled()Z +METHOD|org.testng.annotations.AfterClass.groups()[Ljava/lang/String; +METHOD|org.testng.annotations.AfterClass.dependsOnGroups()[Ljava/lang/String; +METHOD|org.testng.annotations.AfterClass.dependsOnMethods()[Ljava/lang/String; +METHOD|org.testng.annotations.AfterClass.alwaysRun()Z +METHOD|org.testng.annotations.AfterClass.inheritGroups()Z +METHOD|org.testng.annotations.AfterClass.description()Ljava/lang/String; +METHOD|org.testng.annotations.AfterGroups.value()[Ljava/lang/String; +METHOD|org.testng.annotations.AfterGroups.enabled()Z +METHOD|org.testng.annotations.AfterGroups.groups()[Ljava/lang/String; +METHOD|org.testng.annotations.AfterGroups.dependsOnGroups()[Ljava/lang/String; +METHOD|org.testng.annotations.AfterGroups.dependsOnMethods()[Ljava/lang/String; +METHOD|org.testng.annotations.AfterGroups.alwaysRun()Z +METHOD|org.testng.annotations.AfterGroups.inheritGroups()Z +METHOD|org.testng.annotations.AfterGroups.description()Ljava/lang/String; +METHOD|org.testng.annotations.AfterMethod.enabled()Z +METHOD|org.testng.annotations.AfterMethod.groups()[Ljava/lang/String; +METHOD|org.testng.annotations.AfterMethod.dependsOnGroups()[Ljava/lang/String; +METHOD|org.testng.annotations.AfterMethod.dependsOnMethods()[Ljava/lang/String; +METHOD|org.testng.annotations.AfterMethod.alwaysRun()Z +METHOD|org.testng.annotations.AfterMethod.inheritGroups()Z +METHOD|org.testng.annotations.AfterMethod.description()Ljava/lang/String; +METHOD|org.testng.annotations.AfterSuite.enabled()Z +METHOD|org.testng.annotations.AfterSuite.groups()[Ljava/lang/String; +METHOD|org.testng.annotations.AfterSuite.dependsOnGroups()[Ljava/lang/String; +METHOD|org.testng.annotations.AfterSuite.dependsOnMethods()[Ljava/lang/String; +METHOD|org.testng.annotations.AfterSuite.alwaysRun()Z +METHOD|org.testng.annotations.AfterSuite.inheritGroups()Z +METHOD|org.testng.annotations.AfterSuite.description()Ljava/lang/String; +METHOD|org.testng.annotations.AfterTest.enabled()Z +METHOD|org.testng.annotations.AfterTest.groups()[Ljava/lang/String; +METHOD|org.testng.annotations.AfterTest.dependsOnGroups()[Ljava/lang/String; +METHOD|org.testng.annotations.AfterTest.dependsOnMethods()[Ljava/lang/String; +METHOD|org.testng.annotations.AfterTest.alwaysRun()Z +METHOD|org.testng.annotations.AfterTest.inheritGroups()Z +METHOD|org.testng.annotations.AfterTest.description()Ljava/lang/String; +METHOD|org.testng.annotations.BeforeClass.enabled()Z +METHOD|org.testng.annotations.BeforeClass.groups()[Ljava/lang/String; +METHOD|org.testng.annotations.BeforeClass.dependsOnGroups()[Ljava/lang/String; +METHOD|org.testng.annotations.BeforeClass.dependsOnMethods()[Ljava/lang/String; +METHOD|org.testng.annotations.BeforeClass.alwaysRun()Z +METHOD|org.testng.annotations.BeforeClass.inheritGroups()Z +METHOD|org.testng.annotations.BeforeClass.description()Ljava/lang/String; +METHOD|org.testng.annotations.BeforeGroups.value()[Ljava/lang/String; +METHOD|org.testng.annotations.BeforeGroups.enabled()Z +METHOD|org.testng.annotations.BeforeGroups.groups()[Ljava/lang/String; +METHOD|org.testng.annotations.BeforeGroups.dependsOnGroups()[Ljava/lang/String; +METHOD|org.testng.annotations.BeforeGroups.dependsOnMethods()[Ljava/lang/String; +METHOD|org.testng.annotations.BeforeGroups.alwaysRun()Z +METHOD|org.testng.annotations.BeforeGroups.inheritGroups()Z +METHOD|org.testng.annotations.BeforeGroups.description()Ljava/lang/String; +METHOD|org.testng.annotations.BeforeMethod.enabled()Z +METHOD|org.testng.annotations.BeforeMethod.groups()[Ljava/lang/String; +METHOD|org.testng.annotations.BeforeMethod.dependsOnGroups()[Ljava/lang/String; +METHOD|org.testng.annotations.BeforeMethod.dependsOnMethods()[Ljava/lang/String; +METHOD|org.testng.annotations.BeforeMethod.alwaysRun()Z +METHOD|org.testng.annotations.BeforeMethod.inheritGroups()Z +METHOD|org.testng.annotations.BeforeMethod.description()Ljava/lang/String; +METHOD|org.testng.annotations.BeforeSuite.enabled()Z +METHOD|org.testng.annotations.BeforeSuite.groups()[Ljava/lang/String; +METHOD|org.testng.annotations.BeforeSuite.dependsOnGroups()[Ljava/lang/String; +METHOD|org.testng.annotations.BeforeSuite.dependsOnMethods()[Ljava/lang/String; +METHOD|org.testng.annotations.BeforeSuite.alwaysRun()Z +METHOD|org.testng.annotations.BeforeSuite.inheritGroups()Z +METHOD|org.testng.annotations.BeforeSuite.description()Ljava/lang/String; +METHOD|org.testng.annotations.BeforeTest.enabled()Z +METHOD|org.testng.annotations.BeforeTest.groups()[Ljava/lang/String; +METHOD|org.testng.annotations.BeforeTest.dependsOnGroups()[Ljava/lang/String; +METHOD|org.testng.annotations.BeforeTest.dependsOnMethods()[Ljava/lang/String; +METHOD|org.testng.annotations.BeforeTest.alwaysRun()Z +METHOD|org.testng.annotations.BeforeTest.inheritGroups()Z +METHOD|org.testng.annotations.BeforeTest.description()Ljava/lang/String; +METHOD|org.testng.annotations.Configuration.beforeTestClass()Z +METHOD|org.testng.annotations.Configuration.afterTestClass()Z +METHOD|org.testng.annotations.Configuration.beforeTestMethod()Z +METHOD|org.testng.annotations.Configuration.afterTestMethod()Z +METHOD|org.testng.annotations.Configuration.beforeSuite()Z +METHOD|org.testng.annotations.Configuration.afterSuite()Z +METHOD|org.testng.annotations.Configuration.beforeTest()Z +METHOD|org.testng.annotations.Configuration.afterTest()Z +METHOD|org.testng.annotations.Configuration.beforeGroups()[Ljava/lang/String; +METHOD|org.testng.annotations.Configuration.afterGroups()[Ljava/lang/String; +METHOD|org.testng.annotations.Configuration.parameters()[Ljava/lang/String; +METHOD|org.testng.annotations.Configuration.enabled()Z +METHOD|org.testng.annotations.Configuration.groups()[Ljava/lang/String; +METHOD|org.testng.annotations.Configuration.dependsOnGroups()[Ljava/lang/String; +METHOD|org.testng.annotations.Configuration.dependsOnMethods()[Ljava/lang/String; +METHOD|org.testng.annotations.Configuration.alwaysRun()Z +METHOD|org.testng.annotations.Configuration.inheritGroups()Z +METHOD|org.testng.annotations.Configuration.description()Ljava/lang/String; +METHOD|org.testng.annotations.DataProvider.name()Ljava/lang/String; +METHOD|org.testng.annotations.ExpectedExceptions.value()[Ljava/lang/Class; +METHOD|org.testng.annotations.Factory.parameters()[Ljava/lang/String; +METHOD|org.testng.annotations.Parameters.value()[Ljava/lang/String; +METHOD|org.testng.annotations.Test.groups()[Ljava/lang/String; +METHOD|org.testng.annotations.Test.enabled()Z +METHOD|org.testng.annotations.Test.parameters()[Ljava/lang/String; +METHOD|org.testng.annotations.Test.dependsOnGroups()[Ljava/lang/String; +METHOD|org.testng.annotations.Test.dependsOnMethods()[Ljava/lang/String; +METHOD|org.testng.annotations.Test.timeOut()J +METHOD|org.testng.annotations.Test.invocationCount()I +METHOD|org.testng.annotations.Test.threadPoolSize()I +METHOD|org.testng.annotations.Test.successPercentage()I +METHOD|org.testng.annotations.Test.dataProvider()Ljava/lang/String; +METHOD|org.testng.annotations.Test.alwaysRun()Z +METHOD|org.testng.annotations.Test.description()Ljava/lang/String; +METHOD|org.testng.annotations.Test.expectedExceptions()[Ljava/lang/Class; +METHOD|org.testng.annotations.Test.suiteName()Ljava/lang/String; +METHOD|org.testng.annotations.Test.testName()Ljava/lang/String; +METHOD|org.testng.annotations.Test.sequential()Z +METHOD|org.testng.internal.ArrayIterator.([[Ljava/lang/Object;)V +METHOD|org.testng.internal.ArrayIterator.hasNext()Z +METHOD|org.testng.internal.ArrayIterator.next()Ljava/lang/Object; +METHOD|org.testng.internal.ArrayIterator.remove()V +METHOD|org.testng.internal.BaseClassFinder.()V +METHOD|org.testng.internal.BaseClassFinder.getIClass(Ljava/lang/Class;)Lorg/testng/IClass; +METHOD|org.testng.internal.BaseClassFinder.putIClass(Ljava/lang/Class;Lorg/testng/IClass;)V +METHOD|org.testng.internal.BaseClassFinder.ppp(Ljava/lang/String;)V +METHOD|org.testng.internal.BaseClassFinder.findOrCreateIClass(Ljava/lang/Class;Ljava/lang/Object;Lorg/testng/xml/XmlTest;Lorg/testng/internal/annotations/IAnnotationFinder;)Lorg/testng/IClass; +METHOD|org.testng.internal.BaseClassFinder.getExistingClasses()Ljava/util/Map; +METHOD|org.testng.internal.BaseClassFinder.classExists(Ljava/lang/Class;)Z +METHOD|org.testng.internal.BaseClassFinder.findTestClasses()[Lorg/testng/IClass; +METHOD|org.testng.internal.BaseTestMethod$1.()V +METHOD|org.testng.internal.BaseTestMethod$1.compare(Ljava/lang/Object;Ljava/lang/Object;)I +METHOD|org.testng.internal.BaseTestMethod.(Ljava/lang/reflect/Method;Lorg/testng/internal/annotations/IAnnotationFinder;)V +METHOD|org.testng.internal.BaseTestMethod.isAlwaysRun()Z +METHOD|org.testng.internal.BaseTestMethod.setAlwaysRun(Z)V +METHOD|org.testng.internal.BaseTestMethod.getRealClass()Ljava/lang/Class; +METHOD|org.testng.internal.BaseTestMethod.getTestClass()Lorg/testng/ITestClass; +METHOD|org.testng.internal.BaseTestMethod.setTestClass(Lorg/testng/ITestClass;)V +METHOD|org.testng.internal.BaseTestMethod.compareTo(Ljava/lang/Object;)I +METHOD|org.testng.internal.BaseTestMethod.getMethod()Ljava/lang/reflect/Method; +METHOD|org.testng.internal.BaseTestMethod.getMethodName()Ljava/lang/String; +METHOD|org.testng.internal.BaseTestMethod.getInstances()[Ljava/lang/Object; +METHOD|org.testng.internal.BaseTestMethod.getInstanceHashCodes()[J +METHOD|org.testng.internal.BaseTestMethod.getGroups()[Ljava/lang/String; +METHOD|org.testng.internal.BaseTestMethod.getGroupsDependedUpon()[Ljava/lang/String; +METHOD|org.testng.internal.BaseTestMethod.getMethodsDependedUpon()[Ljava/lang/String; +METHOD|org.testng.internal.BaseTestMethod.isTest()Z +METHOD|org.testng.internal.BaseTestMethod.isBeforeSuiteConfiguration()Z +METHOD|org.testng.internal.BaseTestMethod.isAfterSuiteConfiguration()Z +METHOD|org.testng.internal.BaseTestMethod.isBeforeTestConfiguration()Z +METHOD|org.testng.internal.BaseTestMethod.isAfterTestConfiguration()Z +METHOD|org.testng.internal.BaseTestMethod.isBeforeGroupsConfiguration()Z +METHOD|org.testng.internal.BaseTestMethod.isAfterGroupsConfiguration()Z +METHOD|org.testng.internal.BaseTestMethod.isBeforeClassConfiguration()Z +METHOD|org.testng.internal.BaseTestMethod.isAfterClassConfiguration()Z +METHOD|org.testng.internal.BaseTestMethod.isBeforeMethodConfiguration()Z +METHOD|org.testng.internal.BaseTestMethod.isAfterMethodConfiguration()Z +METHOD|org.testng.internal.BaseTestMethod.getTimeOut()J +METHOD|org.testng.internal.BaseTestMethod.getInvocationCount()I +METHOD|org.testng.internal.BaseTestMethod.getSuccessPercentage()I +METHOD|org.testng.internal.BaseTestMethod.getId()J +METHOD|org.testng.internal.BaseTestMethod.setId(J)V +METHOD|org.testng.internal.BaseTestMethod.getDate()J +METHOD|org.testng.internal.BaseTestMethod.setDate(J)V +METHOD|org.testng.internal.BaseTestMethod.canRunFromClass(Lorg/testng/IClass;)Z +METHOD|org.testng.internal.BaseTestMethod.equals(Ljava/lang/Object;)Z +METHOD|org.testng.internal.BaseTestMethod.hashCode()I +METHOD|org.testng.internal.BaseTestMethod.initGroups(Ljava/lang/Class;)V +METHOD|org.testng.internal.BaseTestMethod.getAnnotationFinder()Lorg/testng/internal/annotations/IAnnotationFinder; +METHOD|org.testng.internal.BaseTestMethod.getIClass()Lorg/testng/IClass; +METHOD|org.testng.internal.BaseTestMethod.getSignature()Ljava/lang/String; +METHOD|org.testng.internal.BaseTestMethod.initSignature()Ljava/lang/String; +METHOD|org.testng.internal.BaseTestMethod.toString()Ljava/lang/String; +METHOD|org.testng.internal.BaseTestMethod.getStringArray([Ljava/lang/String;[Ljava/lang/String;)[Ljava/lang/String; +METHOD|org.testng.internal.BaseTestMethod.setGroups([Ljava/lang/String;)V +METHOD|org.testng.internal.BaseTestMethod.setGroupsDependedUpon([Ljava/lang/String;)V +METHOD|org.testng.internal.BaseTestMethod.setMethodsDependedUpon([Ljava/lang/String;)V +METHOD|org.testng.internal.BaseTestMethod.addMethodDependedUpon(Ljava/lang/String;)V +METHOD|org.testng.internal.BaseTestMethod.ppp(Ljava/lang/String;)V +METHOD|org.testng.internal.BaseTestMethod.getMissingGroup()Ljava/lang/String; +METHOD|org.testng.internal.BaseTestMethod.setMissingGroup(Ljava/lang/String;)V +METHOD|org.testng.internal.BaseTestMethod.getThreadPoolSize()I +METHOD|org.testng.internal.BaseTestMethod.setThreadPoolSize(Ljava/lang/Integer;)V +METHOD|org.testng.internal.BaseTestMethod.setDescription(Ljava/lang/String;)V +METHOD|org.testng.internal.BaseTestMethod.getDescription()Ljava/lang/String; +METHOD|org.testng.internal.BaseTestMethod.getBeforeGroups()[Ljava/lang/String; +METHOD|org.testng.internal.BaseTestMethod.getAfterGroups()[Ljava/lang/String; +METHOD|org.testng.internal.BaseTestMethod.()V +METHOD|org.testng.internal.ClassHelper.()V +METHOD|org.testng.internal.ClassHelper.forName(Ljava/lang/String;)Ljava/lang/Class; +METHOD|org.testng.internal.ClassHelper.findFactoryMethod(Ljava/lang/Class;Lorg/testng/internal/annotations/IAnnotationFinder;)Ljava/lang/reflect/Method; +METHOD|org.testng.internal.ClassHelper.getAvailableMethods(Ljava/lang/Class;)Ljava/util/Set; +METHOD|org.testng.internal.ClassHelper.extractMethods(Ljava/lang/Class;Ljava/lang/Class;Ljava/util/Set;)Ljava/util/Set; +METHOD|org.testng.internal.ClassHelper.isOverridden(Ljava/lang/reflect/Method;Ljava/util/Set;)Z +METHOD|org.testng.internal.ClassHelper.createSelector(Lorg/testng/xml/XmlMethodSelector;)Lorg/testng/IMethodSelector; +METHOD|org.testng.internal.ClassImpl.(Ljava/lang/Class;Ljava/lang/Object;Ljava/util/Map;Lorg/testng/xml/XmlTest;Lorg/testng/internal/annotations/IAnnotationFinder;)V +METHOD|org.testng.internal.ClassImpl.ppp(Ljava/lang/String;)V +METHOD|org.testng.internal.ClassImpl.getName()Ljava/lang/String; +METHOD|org.testng.internal.ClassImpl.getRealClass()Ljava/lang/Class; +METHOD|org.testng.internal.ClassImpl.getInstanceCount()I +METHOD|org.testng.internal.ClassImpl.getInstanceHashCodes()[J +METHOD|org.testng.internal.ClassImpl.getDefaultInstance()Ljava/lang/Object; +METHOD|org.testng.internal.ClassImpl.getInstances(Z)[Ljava/lang/Object; +METHOD|org.testng.internal.ClassImpl.toString()Ljava/lang/String; +METHOD|org.testng.internal.ClassImpl.addInstance(Ljava/lang/Object;)V +METHOD|org.testng.internal.ConfigurationGroupMethods.([Lorg/testng/ITestNGMethod;)V +METHOD|org.testng.internal.ConfigurationGroupMethods.isLastMethodForGroup(Ljava/lang/String;Lorg/testng/ITestNGMethod;)Z +METHOD|org.testng.internal.ConfigurationGroupMethods.removeBeforeMethod(Ljava/lang/String;Lorg/testng/ITestNGMethod;)V +METHOD|org.testng.internal.ConfigurationGroupMethods.log(Ljava/lang/String;)V +METHOD|org.testng.internal.ConfigurationGroupMethods.getBeforeGroupsMap()Ljava/util/Map; +METHOD|org.testng.internal.ConfigurationGroupMethods.getAfterGroupsMap()Ljava/util/Map; +METHOD|org.testng.internal.ConfigurationGroupMethods.getBeforeGroupsMethods()Ljava/util/List; +METHOD|org.testng.internal.ConfigurationGroupMethods.getAfterGroupsMethods()Ljava/util/List; +METHOD|org.testng.internal.ConfigurationGroupMethods.unique(Ljava/util/Collection;)Ljava/util/List; +METHOD|org.testng.internal.ConfigurationGroupMethods.removeBeforeGroups([Ljava/lang/String;)V +METHOD|org.testng.internal.ConfigurationGroupMethods.removeAfterGroups(Ljava/util/Collection;)V +METHOD|org.testng.internal.ConfigurationMethod.(Ljava/lang/reflect/Method;Lorg/testng/internal/annotations/IAnnotationFinder;ZZZZZZZZ[Ljava/lang/String;[Ljava/lang/String;)V +METHOD|org.testng.internal.ConfigurationMethod.createSuiteConfigurationMethods([Lorg/testng/ITestNGMethod;Lorg/testng/internal/annotations/IAnnotationFinder;Z)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.internal.ConfigurationMethod.createTestConfigurationMethods([Lorg/testng/ITestNGMethod;Lorg/testng/internal/annotations/IAnnotationFinder;Z)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.internal.ConfigurationMethod.createClassConfigurationMethods([Lorg/testng/ITestNGMethod;Lorg/testng/internal/annotations/IAnnotationFinder;Z)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.internal.ConfigurationMethod.createBeforeConfigurationMethods([Lorg/testng/ITestNGMethod;Lorg/testng/internal/annotations/IAnnotationFinder;Z)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.internal.ConfigurationMethod.createAfterConfigurationMethods([Lorg/testng/ITestNGMethod;Lorg/testng/internal/annotations/IAnnotationFinder;Z)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.internal.ConfigurationMethod.createTestMethodConfigurationMethods([Lorg/testng/ITestNGMethod;Lorg/testng/internal/annotations/IAnnotationFinder;Z)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.internal.ConfigurationMethod.isAfterClassConfiguration()Z +METHOD|org.testng.internal.ConfigurationMethod.isAfterMethodConfiguration()Z +METHOD|org.testng.internal.ConfigurationMethod.isBeforeClassConfiguration()Z +METHOD|org.testng.internal.ConfigurationMethod.isBeforeMethodConfiguration()Z +METHOD|org.testng.internal.ConfigurationMethod.isAfterSuiteConfiguration()Z +METHOD|org.testng.internal.ConfigurationMethod.isBeforeSuiteConfiguration()Z +METHOD|org.testng.internal.ConfigurationMethod.isBeforeTestConfiguration()Z +METHOD|org.testng.internal.ConfigurationMethod.isAfterTestConfiguration()Z +METHOD|org.testng.internal.ConfigurationMethod.isBeforeGroupsConfiguration()Z +METHOD|org.testng.internal.ConfigurationMethod.isAfterGroupsConfiguration()Z +METHOD|org.testng.internal.ConfigurationMethod.inheritGroupsFromTestClass()Z +METHOD|org.testng.internal.ConfigurationMethod.init()V +METHOD|org.testng.internal.ConfigurationMethod.ppp(Ljava/lang/String;)V +METHOD|org.testng.internal.Constants.()V +METHOD|org.testng.internal.Constants.getProperty(Ljava/lang/String;)Lorg/testng/internal/TestNGProperty; +METHOD|org.testng.internal.Constants.getPropertyValue(Ljava/util/Properties;Ljava/lang/String;)Ljava/lang/String; +METHOD|org.testng.internal.Constants.getBooleanPropertyValue(Ljava/util/Properties;Ljava/lang/String;)Z +METHOD|org.testng.internal.Constants.getIntegerPropertyValue(Ljava/util/Properties;Ljava/lang/String;)I +METHOD|org.testng.internal.Constants.getDefaultValueFor(Ljava/lang/String;)Ljava/lang/String; +METHOD|org.testng.internal.Constants.displayStatus(I)Ljava/lang/String; +METHOD|org.testng.internal.Constants.()V +METHOD|org.testng.internal.ExtraOutput.()V +METHOD|org.testng.internal.ExtraOutput.getParameterOutput()Ljava/util/List; +METHOD|org.testng.internal.FactoryMethod.(Ljava/lang/reflect/Method;Ljava/lang/Object;Lorg/testng/xml/XmlTest;Lorg/testng/internal/annotations/IAnnotationFinder;)V +METHOD|org.testng.internal.FactoryMethod.invoke()[Ljava/lang/Object; +METHOD|org.testng.internal.Graph$Node.(Ljava/lang/Object;)V +METHOD|org.testng.internal.Graph$Node.clone()Lorg/testng/internal/Graph$Node; +METHOD|org.testng.internal.Graph$Node.getObject()Ljava/lang/Object; +METHOD|org.testng.internal.Graph$Node.getPredecessors()Ljava/util/Map; +METHOD|org.testng.internal.Graph$Node.removePredecessor(Ljava/lang/Object;)Z +METHOD|org.testng.internal.Graph$Node.dump()V +METHOD|org.testng.internal.Graph$Node.toString()Ljava/lang/String; +METHOD|org.testng.internal.Graph$Node.addPredecessor(Ljava/lang/Object;)V +METHOD|org.testng.internal.Graph$Node.hasPredecessors()Z +METHOD|org.testng.internal.Graph$Node.hasPredecessor(Ljava/lang/Object;)Z +METHOD|org.testng.internal.Graph$Node.clone()Ljava/lang/Object; +METHOD|org.testng.internal.Graph.()V +METHOD|org.testng.internal.Graph.addNode(Ljava/lang/Object;)V +METHOD|org.testng.internal.Graph.hasBeenSorted()Z +METHOD|org.testng.internal.Graph.isIndependent(Ljava/lang/Object;)Z +METHOD|org.testng.internal.Graph.findNode(Ljava/lang/Object;)Lorg/testng/internal/Graph$Node; +METHOD|org.testng.internal.Graph.addPredecessor(Ljava/lang/Object;Ljava/lang/Object;)V +METHOD|org.testng.internal.Graph.getNodes()Ljava/util/Collection; +METHOD|org.testng.internal.Graph.getIndependentNodes()Ljava/util/Set; +METHOD|org.testng.internal.Graph.getStrictlySortedNodes()Ljava/util/List; +METHOD|org.testng.internal.Graph.topologicalSort()V +METHOD|org.testng.internal.Graph.dumpSortedNodes()V +METHOD|org.testng.internal.Graph.dumpGraph()V +METHOD|org.testng.internal.Graph.removeFromNodes(Ljava/util/List;Lorg/testng/internal/Graph$Node;)V +METHOD|org.testng.internal.Graph.ppp(Ljava/lang/String;)V +METHOD|org.testng.internal.Graph.findNodeWithNoPredecessors(Ljava/util/List;)Lorg/testng/internal/Graph$Node; +METHOD|org.testng.internal.Graph.findPredecessors(Ljava/lang/Object;)Ljava/util/List; +METHOD|org.testng.internal.Graph.toString()Ljava/lang/String; +METHOD|org.testng.internal.Graph.main([Ljava/lang/String;)V +METHOD|org.testng.internal.Graph.access$000(Ljava/lang/String;)V +METHOD|org.testng.internal.Graph.()V +METHOD|org.testng.internal.HostFile.(Ljava/lang/String;)V +METHOD|org.testng.internal.HostFile.getHosts()[Ljava/lang/String; +METHOD|org.testng.internal.HostFile.isStrategyTest()Z +METHOD|org.testng.internal.HostFile.getVerbose()I +METHOD|org.testng.internal.IInvoker.invokeConfigurations(Lorg/testng/IClass;[Lorg/testng/ITestNGMethod;Lorg/testng/xml/XmlSuite;Ljava/util/Map;Ljava/lang/Object;)V +METHOD|org.testng.internal.IInvoker.invokeTestMethods(Lorg/testng/ITestNGMethod;Lorg/testng/xml/XmlSuite;Ljava/util/Map;[Lorg/testng/ITestNGMethod;ILorg/testng/internal/ConfigurationGroupMethods;)Ljava/util/List; +METHOD|org.testng.internal.IInvoker.runTestListeners(Lorg/testng/ITestResult;)V +METHOD|org.testng.internal.ITestResultNotifier.getPassedTests(Lorg/testng/ITestNGMethod;)Ljava/util/Set; +METHOD|org.testng.internal.ITestResultNotifier.addPassedTest(Lorg/testng/ITestNGMethod;Lorg/testng/ITestResult;)V +METHOD|org.testng.internal.ITestResultNotifier.addSkippedTest(Lorg/testng/ITestNGMethod;Lorg/testng/ITestResult;)V +METHOD|org.testng.internal.ITestResultNotifier.addFailedTest(Lorg/testng/ITestNGMethod;Lorg/testng/ITestResult;)V +METHOD|org.testng.internal.ITestResultNotifier.addFailedButWithinSuccessPercentageTest(Lorg/testng/ITestNGMethod;Lorg/testng/ITestResult;)V +METHOD|org.testng.internal.ITestResultNotifier.addInvokedMethod(Lorg/testng/internal/InvokedMethod;)V +METHOD|org.testng.internal.ITestResultNotifier.getTest()Lorg/testng/xml/XmlTest; +METHOD|org.testng.internal.ITestResultNotifier.getTestListeners()Ljava/util/List; +METHOD|org.testng.internal.InstanceInfo.(Ljava/lang/Class;Ljava/lang/Object;)V +METHOD|org.testng.internal.InstanceInfo.getInstance()Ljava/lang/Object; +METHOD|org.testng.internal.InstanceInfo.getInstanceClass()Ljava/lang/Class; +METHOD|org.testng.internal.InvokeMethodRunnable$TestNGRuntimeException.(Ljava/lang/Throwable;)V +METHOD|org.testng.internal.InvokeMethodRunnable.(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;Lorg/testng/internal/thread/ICountDown;)V +METHOD|org.testng.internal.InvokeMethodRunnable.run()V +METHOD|org.testng.internal.InvokedMethod.(Ljava/lang/Object;Lorg/testng/ITestNGMethod;[Ljava/lang/Object;ZZJ)V +METHOD|org.testng.internal.InvokedMethod.isTestMethod()Z +METHOD|org.testng.internal.InvokedMethod.toString()Ljava/lang/String; +METHOD|org.testng.internal.InvokedMethod.isConfigurationMethod()Z +METHOD|org.testng.internal.InvokedMethod.getTestMethod()Lorg/testng/ITestNGMethod; +METHOD|org.testng.internal.InvokedMethod.getDate()J +METHOD|org.testng.internal.Invoker$1.(Lorg/testng/internal/Invoker;Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;[Ljava/lang/Throwable;)V +METHOD|org.testng.internal.Invoker$1.runTestMethod(Lorg/testng/ITestResult;)V +METHOD|org.testng.internal.Invoker.(Lorg/testng/ITestContext;Lorg/testng/internal/ITestResultNotifier;Lorg/testng/internal/annotations/IAnnotationFinder;)V +METHOD|org.testng.internal.Invoker.invokeConfigurations(Lorg/testng/IClass;[Lorg/testng/ITestNGMethod;Lorg/testng/xml/XmlSuite;Ljava/util/Map;Ljava/lang/Object;)V +METHOD|org.testng.internal.Invoker.handleConfigurationFailure(Ljava/lang/Throwable;Lorg/testng/ITestNGMethod;Lorg/testng/ITestResult;Lorg/testng/internal/annotations/IConfiguration;Lorg/testng/xml/XmlSuite;)V +METHOD|org.testng.internal.Invoker.findClassesInSameTest(Ljava/lang/Class;Lorg/testng/xml/XmlSuite;)[Lorg/testng/xml/XmlClass; +METHOD|org.testng.internal.Invoker.confInvocationPassed(Ljava/lang/Class;)Z +METHOD|org.testng.internal.Invoker.setClassInvocationFailure(Ljava/lang/Class;Z)V +METHOD|org.testng.internal.Invoker.invokeConfigurationMethod([Ljava/lang/Object;Lorg/testng/ITestNGMethod;[Ljava/lang/Object;ZLorg/testng/ITestResult;)V +METHOD|org.testng.internal.Invoker.invokeMethod([Ljava/lang/Object;Lorg/testng/ITestNGMethod;[Ljava/lang/Object;Lorg/testng/xml/XmlSuite;Ljava/util/Map;Lorg/testng/ITestClass;[Lorg/testng/ITestNGMethod;[Lorg/testng/ITestNGMethod;Lorg/testng/internal/ConfigurationGroupMethods;)Ljava/util/List; +METHOD|org.testng.internal.Invoker.invokeBeforeGroupsConfigurations(Lorg/testng/ITestClass;Lorg/testng/ITestNGMethod;Lorg/testng/internal/ConfigurationGroupMethods;Lorg/testng/xml/XmlSuite;Ljava/util/Map;Ljava/lang/Object;)V +METHOD|org.testng.internal.Invoker.invokeAfterGroupsConfigurations(Lorg/testng/ITestClass;Lorg/testng/ITestNGMethod;Lorg/testng/internal/ConfigurationGroupMethods;Lorg/testng/xml/XmlSuite;Ljava/util/Map;Ljava/lang/Object;)V +METHOD|org.testng.internal.Invoker.invokeHookable([Ljava/lang/Object;[Ljava/lang/Object;Lorg/testng/ITestClass;Ljava/lang/reflect/Method;ILorg/testng/internal/TestResult;)V +METHOD|org.testng.internal.Invoker.handleParameters(Lorg/testng/ITestNGMethod;Ljava/util/Map;Lorg/testng/ITestClass;Ljava/util/Map;Lorg/testng/xml/XmlSuite;)Ljava/util/Iterator; +METHOD|org.testng.internal.Invoker.invokeTestMethods(Lorg/testng/ITestNGMethod;Lorg/testng/xml/XmlSuite;Ljava/util/Map;[Lorg/testng/ITestNGMethod;ILorg/testng/internal/ConfigurationGroupMethods;)Ljava/util/List; +METHOD|org.testng.internal.Invoker.findExpectedExceptions(Lorg/testng/internal/annotations/IAnnotationFinder;Ljava/lang/reflect/Method;)[Ljava/lang/Class; +METHOD|org.testng.internal.Invoker.isWithinThreadedMethod()Z +METHOD|org.testng.internal.Invoker.setWithinThreadedMethod(Z)V +METHOD|org.testng.internal.Invoker.runWorkers(Lorg/testng/ITestNGMethod;Ljava/util/List;I)Ljava/util/List; +METHOD|org.testng.internal.Invoker.checkDependencies(Lorg/testng/ITestNGMethod;Lorg/testng/ITestClass;[Lorg/testng/ITestNGMethod;)Z +METHOD|org.testng.internal.Invoker.haveBeenRunSuccessfully([Lorg/testng/ITestNGMethod;)Z +METHOD|org.testng.internal.Invoker.handleException(Ljava/lang/Throwable;Lorg/testng/ITestNGMethod;Lorg/testng/ITestResult;I)V +METHOD|org.testng.internal.Invoker.isExpectedException(Ljava/lang/Throwable;[Ljava/lang/Class;)Z +METHOD|org.testng.internal.Invoker.filterMethods(Lorg/testng/IClass;[Lorg/testng/ITestNGMethod;)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.internal.Invoker.filterMethodsUnique(Lorg/testng/IClass;[Lorg/testng/ITestNGMethod;)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.internal.Invoker.dependsOnGroups(Lorg/testng/ITestNGMethod;)Z +METHOD|org.testng.internal.Invoker.dependsOnMethods(Lorg/testng/ITestNGMethod;)Z +METHOD|org.testng.internal.Invoker.runTestListeners(Lorg/testng/ITestResult;)V +METHOD|org.testng.internal.Invoker.runTestListeners(Lorg/testng/ITestResult;Ljava/util/List;)V +METHOD|org.testng.internal.Invoker.ppp(Ljava/lang/String;)V +METHOD|org.testng.internal.Invoker.log(ILjava/lang/String;)V +METHOD|org.testng.internal.Invoker.()V +METHOD|org.testng.internal.JUnitUtils.()V +METHOD|org.testng.internal.JUnitUtils.isJUnitClass(Ljava/lang/Class;)Z +METHOD|org.testng.internal.JUnitUtils.isAssignableFromTestCase(Ljava/lang/Class;)Z +METHOD|org.testng.internal.JUnitUtils.isAssignableFromTest(Ljava/lang/Class;)Z +METHOD|org.testng.internal.MethodHelper.()V +METHOD|org.testng.internal.MethodHelper.collectAndOrderMethods(Ljava/util/List;ZLorg/testng/internal/RunInfo;Lorg/testng/internal/annotations/IAnnotationFinder;Ljava/util/List;)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.internal.MethodHelper.collectAndOrderMethods(Ljava/util/List;ZLorg/testng/internal/RunInfo;Lorg/testng/internal/annotations/IAnnotationFinder;ZLjava/util/List;)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.internal.MethodHelper.collectAndOrderMethods([Lorg/testng/ITestNGMethod;ZLorg/testng/internal/RunInfo;Lorg/testng/internal/annotations/IAnnotationFinder;Ljava/util/List;)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.internal.MethodHelper.collectAndOrderMethods([Lorg/testng/ITestNGMethod;ZLorg/testng/internal/RunInfo;Lorg/testng/internal/annotations/IAnnotationFinder;ZLjava/util/List;)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.internal.MethodHelper.collectAndOrderConfigurationMethods([Lorg/testng/ITestNGMethod;Lorg/testng/internal/RunInfo;Lorg/testng/internal/annotations/IAnnotationFinder;ZLjava/util/List;)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.internal.MethodHelper.findMethodsThatBelongToGroup(Lorg/testng/ITestNGMethod;[Lorg/testng/ITestNGMethod;Ljava/lang/String;)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.internal.MethodHelper.findMethodsNamed(Ljava/lang/String;[Lorg/testng/ITestNGMethod;[Ljava/lang/String;)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.internal.MethodHelper.isEnabled(Ljava/lang/Class;Lorg/testng/internal/annotations/IAnnotationFinder;)Z +METHOD|org.testng.internal.MethodHelper.isEnabled(Ljava/lang/reflect/Method;Lorg/testng/internal/annotations/IAnnotationFinder;)Z +METHOD|org.testng.internal.MethodHelper.isEnabled(Lorg/testng/internal/annotations/ITestOrConfiguration;)Z +METHOD|org.testng.internal.MethodHelper.findMethodsThatBelongToGroup(Lorg/testng/ITestNGMethod;Ljava/util/List;Ljava/lang/String;)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.internal.MethodHelper.findGroupTransitiveClosure(Lorg/testng/internal/XmlMethodSelector;Ljava/util/List;Ljava/util/List;[Ljava/lang/String;Ljava/util/Set;Ljava/util/Set;)V +METHOD|org.testng.internal.MethodHelper.findMethodNamed(Ljava/lang/String;Ljava/util/List;)Lorg/testng/ITestNGMethod; +METHOD|org.testng.internal.MethodHelper.includeMethod(Lorg/testng/internal/annotations/ITestOrConfiguration;Lorg/testng/internal/RunInfo;Lorg/testng/ITestNGMethod;ZZLjava/util/List;)Z +METHOD|org.testng.internal.MethodHelper.collectMethodsByGroup([Lorg/testng/ITestNGMethod;ZLjava/util/List;Ljava/util/List;Lorg/testng/internal/RunInfo;Lorg/testng/internal/annotations/IAnnotationFinder;Z)V +METHOD|org.testng.internal.MethodHelper.isMethodAlreadyPresent(Ljava/util/List;Lorg/testng/ITestNGMethod;)Z +METHOD|org.testng.internal.MethodHelper.topologicalSort([Lorg/testng/ITestNGMethod;Ljava/util/List;Ljava/util/List;)Lorg/testng/internal/Graph; +METHOD|org.testng.internal.MethodHelper.calculateMethodCanonicalName(Lorg/testng/ITestNGMethod;)Ljava/lang/String; +METHOD|org.testng.internal.MethodHelper.calculateMethodCanonicalName(Ljava/lang/reflect/Method;)Ljava/lang/String; +METHOD|org.testng.internal.MethodHelper.sortMethods(ZLjava/util/List;Lorg/testng/internal/annotations/IAnnotationFinder;)Ljava/util/List; +METHOD|org.testng.internal.MethodHelper.log(ILjava/lang/String;)V +METHOD|org.testng.internal.MethodHelper.ppp(Ljava/lang/String;)V +METHOD|org.testng.internal.MethodHelper.getMethodsDependedUpon(Lorg/testng/ITestNGMethod;[Lorg/testng/ITestNGMethod;)Ljava/util/List; +METHOD|org.testng.internal.MethodHelper.invokeMethod(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; +METHOD|org.testng.internal.MethodHelper.createArrayIterator([[Ljava/lang/Object;)Ljava/util/Iterator; +METHOD|org.testng.internal.MethodHelper.invokeDataProvider(Ljava/lang/Object;Ljava/lang/reflect/Method;Ljava/lang/reflect/Method;)Ljava/util/Iterator; +METHOD|org.testng.internal.MethodHelper.calculateMethodCanonicalName(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/String; +METHOD|org.testng.internal.MethodHelper.()V +METHOD|org.testng.internal.MethodInheritance.()V +METHOD|org.testng.internal.MethodInheritance.findMethodListSuperClass(Ljava/util/Map;Ljava/lang/Class;)Ljava/util/List; +METHOD|org.testng.internal.MethodInheritance.findSubClass(Ljava/util/Map;Ljava/lang/Class;)Ljava/lang/Class; +METHOD|org.testng.internal.MethodInheritance.fixMethodInheritance([Lorg/testng/ITestNGMethod;Z)V +METHOD|org.testng.internal.MethodInheritance.equalsEffectiveClass(Lorg/testng/ITestNGMethod;Lorg/testng/ITestNGMethod;)Z +METHOD|org.testng.internal.MethodInheritance.sortMethodsByInheritance(Ljava/util/List;Z)V +METHOD|org.testng.internal.MethodInheritance.ppp(Ljava/lang/String;)V +METHOD|org.testng.internal.MethodSelectorDescriptor.getPriority()I +METHOD|org.testng.internal.MethodSelectorDescriptor.getMethodSelector()Lorg/testng/IMethodSelector; +METHOD|org.testng.internal.MethodSelectorDescriptor.(Lorg/testng/IMethodSelector;I)V +METHOD|org.testng.internal.MethodSelectorDescriptor.compareTo(Ljava/lang/Object;)I +METHOD|org.testng.internal.MethodSelectorDescriptor.setTestMethods(Ljava/util/List;)V +METHOD|org.testng.internal.PackageUtils$1.(Z)V +METHOD|org.testng.internal.PackageUtils$1.accept(Ljava/io/File;)Z +METHOD|org.testng.internal.PackageUtils.()V +METHOD|org.testng.internal.PackageUtils.findClassesInPackage(Ljava/lang/String;Ljava/util/List;Ljava/util/List;)[Ljava/lang/String; +METHOD|org.testng.internal.PackageUtils.getTestClasspath()[Ljava/lang/String; +METHOD|org.testng.internal.PackageUtils.matchTestClasspath(Ljava/net/URL;Ljava/lang/String;Z)Z +METHOD|org.testng.internal.PackageUtils.findClassesInDirPackage(Ljava/lang/String;Ljava/util/List;Ljava/util/List;Ljava/lang/String;ZLjava/util/List;)V +METHOD|org.testng.internal.PackageUtils.includeOrExcludeClass(Ljava/lang/String;Ljava/lang/String;Ljava/util/List;Ljava/util/List;Ljava/util/List;)V +METHOD|org.testng.internal.PackageUtils.isIncluded(Ljava/lang/String;Ljava/util/List;Ljava/util/List;)Z +METHOD|org.testng.internal.PackageUtils.find(Ljava/lang/String;Ljava/util/List;)Z +METHOD|org.testng.internal.Parameters.()V +METHOD|org.testng.internal.Parameters.createParameters(Ljava/lang/reflect/Constructor;Ljava/lang/String;[Ljava/lang/String;Ljava/util/Map;Lorg/testng/xml/XmlSuite;)[Ljava/lang/Object; +METHOD|org.testng.internal.Parameters.createTestParameters(Ljava/lang/reflect/Method;Ljava/util/Map;Lorg/testng/internal/annotations/IAnnotationFinder;Lorg/testng/xml/XmlSuite;)[Ljava/lang/Object; +METHOD|org.testng.internal.Parameters.createConfigurationParameters(Ljava/lang/reflect/Method;Ljava/util/Map;Lorg/testng/internal/annotations/IAnnotationFinder;Lorg/testng/xml/XmlSuite;)[Ljava/lang/Object; +METHOD|org.testng.internal.Parameters.createFactoryParameters(Ljava/lang/reflect/Method;Ljava/util/Map;Lorg/testng/internal/annotations/IAnnotationFinder;Lorg/testng/xml/XmlSuite;)[Ljava/lang/Object; +METHOD|org.testng.internal.Parameters.createParameters(Ljava/lang/reflect/Method;Ljava/lang/String;[Ljava/lang/String;Ljava/util/Map;Lorg/testng/xml/XmlSuite;)[Ljava/lang/Object; +METHOD|org.testng.internal.Parameters.createParameters(Ljava/lang/String;[Ljava/lang/Class;Ljava/lang/String;[Ljava/lang/String;Ljava/util/Map;Lorg/testng/xml/XmlSuite;)[Ljava/lang/Object; +METHOD|org.testng.internal.Parameters.convertType(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/Object; +METHOD|org.testng.internal.Parameters.findDataProvider(Ljava/lang/Class;Ljava/lang/reflect/Method;Lorg/testng/internal/annotations/IAnnotationFinder;)Ljava/lang/reflect/Method; +METHOD|org.testng.internal.Parameters.findDataProvider(Ljava/lang/Class;Lorg/testng/internal/annotations/IAnnotationFinder;Ljava/lang/String;)Ljava/lang/reflect/Method; +METHOD|org.testng.internal.Parameters.createParameters(Ljava/lang/reflect/Method;Ljava/util/Map;Lorg/testng/internal/annotations/IAnnotationFinder;Lorg/testng/xml/XmlSuite;Ljava/lang/Class;Ljava/lang/String;)[Ljava/lang/Object; +METHOD|org.testng.internal.Parameters.()V +METHOD|org.testng.internal.ResultMap.()V +METHOD|org.testng.internal.ResultMap.addResult(Lorg/testng/ITestResult;Lorg/testng/ITestNGMethod;)V +METHOD|org.testng.internal.ResultMap.getResults(Lorg/testng/ITestNGMethod;)Ljava/util/Set; +METHOD|org.testng.internal.ResultMap.getAllResults()Ljava/util/Set; +METHOD|org.testng.internal.ResultMap.size()I +METHOD|org.testng.internal.ResultMap.getAllMethods()Ljava/util/Collection; +METHOD|org.testng.internal.RunInfo.()V +METHOD|org.testng.internal.RunInfo.addMethodSelector(Lorg/testng/IMethodSelector;I)V +METHOD|org.testng.internal.RunInfo.includeMethod(Lorg/testng/ITestNGMethod;Z)Z +METHOD|org.testng.internal.RunInfo.ppp(Ljava/lang/String;)V +METHOD|org.testng.internal.RunInfo.setTestMethods(Ljava/util/List;)V +METHOD|org.testng.internal.TestMethodWorker.(Lorg/testng/internal/IInvoker;[Lorg/testng/ITestNGMethod;Lorg/testng/xml/XmlSuite;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;[Lorg/testng/ITestNGMethod;Lorg/testng/internal/ConfigurationGroupMethods;Lorg/testng/ClassMethodMap;)V +METHOD|org.testng.internal.TestMethodWorker.getMaxTimeOut()J +METHOD|org.testng.internal.TestMethodWorker.toString()Ljava/lang/String; +METHOD|org.testng.internal.TestMethodWorker.run()V +METHOD|org.testng.internal.TestMethodWorker.indexOf(Lorg/testng/ITestNGMethod;[Lorg/testng/ITestNGMethod;)I +METHOD|org.testng.internal.TestMethodWorker.getTestResults()Ljava/util/List; +METHOD|org.testng.internal.TestMethodWorker.isLastTestMethodForClass(Lorg/testng/ITestNGMethod;[Lorg/testng/ITestNGMethod;)Z +METHOD|org.testng.internal.TestMethodWorker.ppp(Ljava/lang/String;)V +METHOD|org.testng.internal.TestMethodWorker.setAllTestMethods([Lorg/testng/ITestNGMethod;)V +METHOD|org.testng.internal.TestNGClassFinder.([Ljava/lang/Class;Ljava/util/Map;Lorg/testng/xml/XmlTest;Lorg/testng/internal/annotations/IAnnotationFinder;)V +METHOD|org.testng.internal.TestNGClassFinder.isTestNGClass(Ljava/lang/Class;Lorg/testng/internal/annotations/IAnnotationFinder;)Z +METHOD|org.testng.internal.TestNGClassFinder.addInstance(Ljava/lang/Class;Ljava/lang/Object;)V +METHOD|org.testng.internal.TestNGClassFinder.ppp(Ljava/lang/String;)V +METHOD|org.testng.internal.TestNGMethod$1.()V +METHOD|org.testng.internal.TestNGMethod$1.compare(Lorg/testng/ITestNGMethod;Lorg/testng/ITestNGMethod;)I +METHOD|org.testng.internal.TestNGMethod$1.compare(Ljava/lang/Object;Ljava/lang/Object;)I +METHOD|org.testng.internal.TestNGMethod.(Ljava/lang/reflect/Method;Lorg/testng/internal/annotations/IAnnotationFinder;)V +METHOD|org.testng.internal.TestNGMethod.getTimeOut()J +METHOD|org.testng.internal.TestNGMethod.getInvocationCount()I +METHOD|org.testng.internal.TestNGMethod.getSuccessPercentage()I +METHOD|org.testng.internal.TestNGMethod.isTest()Z +METHOD|org.testng.internal.TestNGMethod.init()V +METHOD|org.testng.internal.TestNGMethod.()V +METHOD|org.testng.internal.TestNGMethodFinder.(Lorg/testng/internal/RunInfo;Lorg/testng/internal/annotations/IAnnotationFinder;)V +METHOD|org.testng.internal.TestNGMethodFinder.getTestMethods(Ljava/lang/Class;)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.internal.TestNGMethodFinder.getBeforeClassMethods(Ljava/lang/Class;)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.internal.TestNGMethodFinder.getAfterClassMethods(Ljava/lang/Class;)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.internal.TestNGMethodFinder.getBeforeTestMethods(Ljava/lang/Class;)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.internal.TestNGMethodFinder.getAfterTestMethods(Ljava/lang/Class;)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.internal.TestNGMethodFinder.getBeforeSuiteMethods(Ljava/lang/Class;)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.internal.TestNGMethodFinder.getAfterSuiteMethods(Ljava/lang/Class;)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.internal.TestNGMethodFinder.getBeforeTestConfigurationMethods(Ljava/lang/Class;)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.internal.TestNGMethodFinder.getAfterTestConfigurationMethods(Ljava/lang/Class;)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.internal.TestNGMethodFinder.getBeforeGroupsConfigurationMethods(Ljava/lang/Class;)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.internal.TestNGMethodFinder.getAfterGroupsConfigurationMethods(Ljava/lang/Class;)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.internal.TestNGMethodFinder.findConfiguration(Ljava/lang/Class;I)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.internal.TestNGMethodFinder.addConfigurationMethod(Ljava/lang/Class;Ljava/util/List;Ljava/lang/reflect/Method;ZZZZZZZZ[Ljava/lang/String;[Ljava/lang/String;)V +METHOD|org.testng.internal.TestNGMethodFinder.ppp(Ljava/lang/String;)V +METHOD|org.testng.internal.TestNGProperty.(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V +METHOD|org.testng.internal.TestNGProperty.(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V +METHOD|org.testng.internal.TestNGProperty.init(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V +METHOD|org.testng.internal.TestNGProperty.getDefault()Ljava/lang/String; +METHOD|org.testng.internal.TestNGProperty.getDocumentation()Ljava/lang/String; +METHOD|org.testng.internal.TestNGProperty.getName()Ljava/lang/String; +METHOD|org.testng.internal.TestNGProperty.getCommandLineName()Ljava/lang/String; +METHOD|org.testng.internal.TestResult.(Lorg/testng/IClass;Ljava/lang/Object;Lorg/testng/ITestNGMethod;Ljava/lang/Throwable;JJ)V +METHOD|org.testng.internal.TestResult.ppp(Ljava/lang/String;)V +METHOD|org.testng.internal.TestResult.setEndMillis(J)V +METHOD|org.testng.internal.TestResult.getName()Ljava/lang/String; +METHOD|org.testng.internal.TestResult.getMethod()Lorg/testng/ITestNGMethod; +METHOD|org.testng.internal.TestResult.setMethod(Lorg/testng/ITestNGMethod;)V +METHOD|org.testng.internal.TestResult.getStatus()I +METHOD|org.testng.internal.TestResult.setStatus(I)V +METHOD|org.testng.internal.TestResult.isSuccess()Z +METHOD|org.testng.internal.TestResult.getTestClass()Lorg/testng/IClass; +METHOD|org.testng.internal.TestResult.setTestClass(Lorg/testng/IClass;)V +METHOD|org.testng.internal.TestResult.getThrowable()Ljava/lang/Throwable; +METHOD|org.testng.internal.TestResult.setThrowable(Ljava/lang/Throwable;)V +METHOD|org.testng.internal.TestResult.getEndMillis()J +METHOD|org.testng.internal.TestResult.getStartMillis()J +METHOD|org.testng.internal.TestResult.toString()Ljava/lang/String; +METHOD|org.testng.internal.TestResult.getHost()Ljava/lang/String; +METHOD|org.testng.internal.TestResult.setHost(Ljava/lang/String;)V +METHOD|org.testng.internal.TestResult.getParameters()[Ljava/lang/Object; +METHOD|org.testng.internal.TestResult.setParameters([Ljava/lang/Object;)V +METHOD|org.testng.internal.Utils.()V +METHOD|org.testng.internal.Utils.stringToArray(Ljava/lang/String;)[Ljava/lang/String; +METHOD|org.testng.internal.Utils.xmlClassesToClasses(Ljava/util/List;)[Ljava/lang/Class; +METHOD|org.testng.internal.Utils.classesToXmlClasses([Ljava/lang/Class;)[Lorg/testng/xml/XmlClass; +METHOD|org.testng.internal.Utils.findAllClasses([Ljava/lang/Class;Ljava/util/Map;)V +METHOD|org.testng.internal.Utils.parseMultiLine(Ljava/lang/String;)[Ljava/lang/String; +METHOD|org.testng.internal.Utils.writeFile(Ljava/lang/String;Ljava/lang/String;Ljava/lang/StringBuffer;)V +METHOD|org.testng.internal.Utils.writeFile(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V +METHOD|org.testng.internal.Utils.writeFile(Ljava/io/File;Ljava/lang/String;Ljava/lang/String;)V +METHOD|org.testng.internal.Utils.writeFile(Ljava/io/File;Ljava/lang/String;)V +METHOD|org.testng.internal.Utils.ppp(Ljava/lang/String;)V +METHOD|org.testng.internal.Utils.dumpMap(Ljava/util/Map;)V +METHOD|org.testng.internal.Utils.dumpMethods(Ljava/util/List;)V +METHOD|org.testng.internal.Utils.dependentGroupsForThisMethodForTest(Ljava/lang/reflect/Method;Lorg/testng/internal/annotations/IAnnotationFinder;)[Ljava/lang/String; +METHOD|org.testng.internal.Utils.groupsForThisMethodForTest(Ljava/lang/reflect/Method;Lorg/testng/internal/annotations/IAnnotationFinder;)[Ljava/lang/String; +METHOD|org.testng.internal.Utils.groupsForThisMethodForConfiguration(Ljava/lang/reflect/Method;Lorg/testng/internal/annotations/IAnnotationFinder;)[Ljava/lang/String; +METHOD|org.testng.internal.Utils.dependentGroupsForThisMethodForConfiguration(Ljava/lang/reflect/Method;Lorg/testng/internal/annotations/IAnnotationFinder;)[Ljava/lang/String; +METHOD|org.testng.internal.Utils.log(Ljava/lang/String;)V +METHOD|org.testng.internal.Utils.log(Ljava/lang/String;ILjava/lang/String;)V +METHOD|org.testng.internal.Utils.error(Ljava/lang/String;)V +METHOD|org.testng.internal.Utils.calculateInvokedMethodCount(Lorg/testng/IResultMap;)I +METHOD|org.testng.internal.Utils.calculateInvokedMethodCount([Lorg/testng/ITestNGMethod;)I +METHOD|org.testng.internal.Utils.createInstance(Ljava/lang/Class;Ljava/util/Map;Lorg/testng/xml/XmlTest;Lorg/testng/internal/annotations/IAnnotationFinder;)Ljava/lang/Object; +METHOD|org.testng.internal.Utils.getEnclosingClass(Ljava/lang/Class;)Ljava/lang/Class; +METHOD|org.testng.internal.Utils.tryOtherConstructor(Ljava/lang/Class;)Ljava/lang/Object; +METHOD|org.testng.internal.Utils.findAnnotatedConstructor(Lorg/testng/internal/annotations/IAnnotationFinder;Ljava/lang/Class;)Ljava/lang/reflect/Constructor; +METHOD|org.testng.internal.Utils.split(Ljava/lang/String;Ljava/lang/String;)[Ljava/lang/String; +METHOD|org.testng.internal.Utils.initLogger(Ljava/util/logging/Logger;Ljava/lang/String;)V +METHOD|org.testng.internal.Utils.logInvocation(Ljava/lang/String;Ljava/lang/reflect/Method;[Ljava/lang/Object;)V +METHOD|org.testng.internal.Utils.writeResourceToFile(Ljava/io/File;Ljava/lang/String;Ljava/lang/Class;)V +METHOD|org.testng.internal.Utils.isStringEmpty(Ljava/lang/String;)Z +METHOD|org.testng.internal.Utils.stackTrace(Ljava/lang/Throwable;Z)[Ljava/lang/String; +METHOD|org.testng.internal.Utils.filterTrace(Ljava/lang/String;)Ljava/lang/String; +METHOD|org.testng.internal.Utils.()V +METHOD|org.testng.internal.XmlMethodSelector.()V +METHOD|org.testng.internal.XmlMethodSelector.includeMethod(Lorg/testng/ITestNGMethod;Z)Z +METHOD|org.testng.internal.XmlMethodSelector.includeMethodFromExpression(Lorg/testng/ITestNGMethod;Z)Z +METHOD|org.testng.internal.XmlMethodSelector.includeMethodFromIncludeExclude(Lorg/testng/ITestNGMethod;Z)Z +METHOD|org.testng.internal.XmlMethodSelector.logInclusion(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V +METHOD|org.testng.internal.XmlMethodSelector.hasIncludedMethods()Z +METHOD|org.testng.internal.XmlMethodSelector.hasExcludedMethods()Z +METHOD|org.testng.internal.XmlMethodSelector.createQualifiedMethodNames(Lorg/testng/xml/XmlClass;Ljava/util/List;)Ljava/util/List; +METHOD|org.testng.internal.XmlMethodSelector.setXmlClasses(Ljava/util/List;)V +METHOD|org.testng.internal.XmlMethodSelector.getExcludedGroups()Ljava/util/Map; +METHOD|org.testng.internal.XmlMethodSelector.getIncludedGroups()Ljava/util/Map; +METHOD|org.testng.internal.XmlMethodSelector.setExcludedGroups(Ljava/util/Map;)V +METHOD|org.testng.internal.XmlMethodSelector.setIncludedGroups(Ljava/util/Map;)V +METHOD|org.testng.internal.XmlMethodSelector.isIncluded([Ljava/lang/String;Ljava/util/Collection;)Z +METHOD|org.testng.internal.XmlMethodSelector.isExcluded([Ljava/lang/String;Ljava/util/Collection;)Z +METHOD|org.testng.internal.XmlMethodSelector.isMemberOf([Ljava/lang/String;Ljava/util/Collection;)Z +METHOD|org.testng.internal.XmlMethodSelector.log(ILjava/lang/String;)V +METHOD|org.testng.internal.XmlMethodSelector.ppp(Ljava/lang/String;)V +METHOD|org.testng.internal.XmlMethodSelector.setExpression(Ljava/lang/String;)V +METHOD|org.testng.internal.XmlMethodSelector.setTestMethods(Ljava/util/List;)V +METHOD|org.testng.internal.XmlMethodSelector.filterTestMethods(Ljava/util/List;)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.internal.XmlMethodSelector.setVerbose(Z)V +METHOD|org.testng.internal.annotations.AfterSuiteAnnotation.()V +METHOD|org.testng.internal.annotations.AnnotationConfiguration.()V +METHOD|org.testng.internal.annotations.AnnotationConfiguration.getInstance()Lorg/testng/internal/annotations/AnnotationConfiguration; +METHOD|org.testng.internal.annotations.AnnotationConfiguration.getAnnotationFinder()Lorg/testng/internal/annotations/IAnnotationFinder; +METHOD|org.testng.internal.annotations.AnnotationConfiguration.getJavadocAnnotationFinder()Lorg/testng/internal/annotations/IAnnotationFinder; +METHOD|org.testng.internal.annotations.AnnotationConfiguration.initialize(I)V +METHOD|org.testng.internal.annotations.AnnotationConfiguration.()V +METHOD|org.testng.internal.annotations.AnnotationHelper.()V +METHOD|org.testng.internal.annotations.AnnotationHelper.findTest(Lorg/testng/internal/annotations/IAnnotationFinder;Ljava/lang/Class;)Lorg/testng/internal/annotations/ITest; +METHOD|org.testng.internal.annotations.AnnotationHelper.findTest(Lorg/testng/internal/annotations/IAnnotationFinder;Ljava/lang/reflect/Method;)Lorg/testng/internal/annotations/ITest; +METHOD|org.testng.internal.annotations.AnnotationHelper.findTest(Lorg/testng/internal/annotations/IAnnotationFinder;Ljava/lang/reflect/Constructor;)Lorg/testng/internal/annotations/ITest; +METHOD|org.testng.internal.annotations.AnnotationHelper.findConfiguration(Lorg/testng/internal/annotations/IAnnotationFinder;Ljava/lang/reflect/Constructor;)Lorg/testng/internal/annotations/IConfiguration; +METHOD|org.testng.internal.annotations.AnnotationHelper.findConfiguration(Lorg/testng/internal/annotations/IAnnotationFinder;Ljava/lang/reflect/Method;)Lorg/testng/internal/annotations/IConfiguration; +METHOD|org.testng.internal.annotations.AnnotationHelper.createConfiguration(Lorg/testng/internal/annotations/IConfiguration;Lorg/testng/internal/annotations/IConfiguration;Lorg/testng/internal/annotations/IConfiguration;Lorg/testng/internal/annotations/IConfiguration;Lorg/testng/internal/annotations/IConfiguration;Lorg/testng/internal/annotations/IConfiguration;Lorg/testng/internal/annotations/IConfiguration;Lorg/testng/internal/annotations/IConfiguration;Lorg/testng/internal/annotations/IConfiguration;Lorg/testng/internal/annotations/IConfiguration;)Lorg/testng/internal/annotations/IConfiguration; +METHOD|org.testng.internal.annotations.AnnotationHelper.finishInitialize(Lorg/testng/internal/annotations/ConfigurationAnnotation;Lorg/testng/internal/annotations/IConfiguration;)V +METHOD|org.testng.internal.annotations.AnnotationHelper.getAllAnnotations()[Ljava/lang/Class; +METHOD|org.testng.internal.annotations.AnnotationHelper.findMethodsWithAnnotation(Ljava/lang/Class;Ljava/lang/Class;Lorg/testng/internal/annotations/IAnnotationFinder;)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.internal.annotations.AnnotationHelper.isAnnotationPresent(Lorg/testng/internal/annotations/IAnnotationFinder;Ljava/lang/reflect/Method;[Ljava/lang/Class;)Z +METHOD|org.testng.internal.annotations.AnnotationHelper.isAnnotationPresent(Lorg/testng/internal/annotations/IAnnotationFinder;Ljava/lang/reflect/Method;Ljava/lang/Class;)Z +METHOD|org.testng.internal.annotations.AnnotationHelper.isAnnotationPresent(Lorg/testng/internal/annotations/IAnnotationFinder;Ljava/lang/Class;Ljava/lang/Class;)Z +METHOD|org.testng.internal.annotations.AnnotationHelper.createMethodKey(Ljava/lang/reflect/Method;)Ljava/lang/String; +METHOD|org.testng.internal.annotations.AnnotationHelper.()V +METHOD|org.testng.internal.annotations.BaseBeforeAfter.()V +METHOD|org.testng.internal.annotations.BaseBeforeAfter.getDescription()Ljava/lang/String; +METHOD|org.testng.internal.annotations.BaseBeforeAfter.setDescription(Ljava/lang/String;)V +METHOD|org.testng.internal.annotations.BaseBeforeAfter.setAlwaysRun(Z)V +METHOD|org.testng.internal.annotations.BaseBeforeAfter.setInheritGroups(Z)V +METHOD|org.testng.internal.annotations.BaseBeforeAfter.setParameters([Ljava/lang/String;)V +METHOD|org.testng.internal.annotations.BaseBeforeAfter.getParameters()[Ljava/lang/String; +METHOD|org.testng.internal.annotations.BaseBeforeAfter.getAlwaysRun()Z +METHOD|org.testng.internal.annotations.BaseBeforeAfter.getInheritGroups()Z +METHOD|org.testng.internal.annotations.BaseBeforeAfter.getAfterGroups()[Ljava/lang/String; +METHOD|org.testng.internal.annotations.BaseBeforeAfter.setAfterGroups([Ljava/lang/String;)V +METHOD|org.testng.internal.annotations.BaseBeforeAfter.getBeforeGroups()[Ljava/lang/String; +METHOD|org.testng.internal.annotations.BaseBeforeAfter.setBeforeGroups([Ljava/lang/String;)V +METHOD|org.testng.internal.annotations.BeforeSuiteAnnotation.()V +METHOD|org.testng.internal.annotations.ConfigurationAnnotation.()V +METHOD|org.testng.internal.annotations.ConfigurationAnnotation.setAfterSuite(Z)V +METHOD|org.testng.internal.annotations.ConfigurationAnnotation.setAfterTest(Z)V +METHOD|org.testng.internal.annotations.ConfigurationAnnotation.setAfterTestClass(Z)V +METHOD|org.testng.internal.annotations.ConfigurationAnnotation.setAfterTestMethod(Z)V +METHOD|org.testng.internal.annotations.ConfigurationAnnotation.setAlwaysRun(Z)V +METHOD|org.testng.internal.annotations.ConfigurationAnnotation.setBeforeSuite(Z)V +METHOD|org.testng.internal.annotations.ConfigurationAnnotation.setBeforeTest(Z)V +METHOD|org.testng.internal.annotations.ConfigurationAnnotation.setBeforeTestClass(Z)V +METHOD|org.testng.internal.annotations.ConfigurationAnnotation.setBeforeTestMethod(Z)V +METHOD|org.testng.internal.annotations.ConfigurationAnnotation.setInheritGroups(Z)V +METHOD|org.testng.internal.annotations.ConfigurationAnnotation.setParameters([Ljava/lang/String;)V +METHOD|org.testng.internal.annotations.ConfigurationAnnotation.getBeforeTestClass()Z +METHOD|org.testng.internal.annotations.ConfigurationAnnotation.getAfterTestClass()Z +METHOD|org.testng.internal.annotations.ConfigurationAnnotation.getBeforeTestMethod()Z +METHOD|org.testng.internal.annotations.ConfigurationAnnotation.getAfterTestMethod()Z +METHOD|org.testng.internal.annotations.ConfigurationAnnotation.getBeforeSuite()Z +METHOD|org.testng.internal.annotations.ConfigurationAnnotation.getAfterSuite()Z +METHOD|org.testng.internal.annotations.ConfigurationAnnotation.getBeforeTest()Z +METHOD|org.testng.internal.annotations.ConfigurationAnnotation.getAfterTest()Z +METHOD|org.testng.internal.annotations.ConfigurationAnnotation.getParameters()[Ljava/lang/String; +METHOD|org.testng.internal.annotations.ConfigurationAnnotation.getAlwaysRun()Z +METHOD|org.testng.internal.annotations.ConfigurationAnnotation.getInheritGroups()Z +METHOD|org.testng.internal.annotations.ConfigurationAnnotation.getAfterGroups()[Ljava/lang/String; +METHOD|org.testng.internal.annotations.ConfigurationAnnotation.setAfterGroups([Ljava/lang/String;)V +METHOD|org.testng.internal.annotations.ConfigurationAnnotation.getBeforeGroups()[Ljava/lang/String; +METHOD|org.testng.internal.annotations.ConfigurationAnnotation.setBeforeGroups([Ljava/lang/String;)V +METHOD|org.testng.internal.annotations.ConfigurationAnnotation.setFakeConfiguration(Z)V +METHOD|org.testng.internal.annotations.ConfigurationAnnotation.isFakeConfiguration()Z +METHOD|org.testng.internal.annotations.Converter.()V +METHOD|org.testng.internal.annotations.Converter.getBoolean(Ljava/lang/String;Z)Z +METHOD|org.testng.internal.annotations.Converter.getInt(Ljava/lang/String;I)I +METHOD|org.testng.internal.annotations.Converter.getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; +METHOD|org.testng.internal.annotations.Converter.getLong(Ljava/lang/String;J)J +METHOD|org.testng.internal.annotations.Converter.getStringArray(Ljava/lang/String;[Ljava/lang/String;)[Ljava/lang/String; +METHOD|org.testng.internal.annotations.Converter.getClassArray(Ljava/lang/String;[Ljava/lang/Class;)[Ljava/lang/Class; +METHOD|org.testng.internal.annotations.DataProviderAnnotation.()V +METHOD|org.testng.internal.annotations.DataProviderAnnotation.getName()Ljava/lang/String; +METHOD|org.testng.internal.annotations.DataProviderAnnotation.setName(Ljava/lang/String;)V +METHOD|org.testng.internal.annotations.ExpectedExceptionsAnnotation.()V +METHOD|org.testng.internal.annotations.ExpectedExceptionsAnnotation.getValue()[Ljava/lang/Class; +METHOD|org.testng.internal.annotations.ExpectedExceptionsAnnotation.setValue([Ljava/lang/Class;)V +METHOD|org.testng.internal.annotations.FactoryAnnotation.()V +METHOD|org.testng.internal.annotations.FactoryAnnotation.getParameters()[Ljava/lang/String; +METHOD|org.testng.internal.annotations.FactoryAnnotation.setParameters([Ljava/lang/String;)V +METHOD|org.testng.internal.annotations.IAnnotationFinder.findAnnotation(Ljava/lang/Class;Ljava/lang/Class;)Lorg/testng/internal/annotations/IAnnotation; +METHOD|org.testng.internal.annotations.IAnnotationFinder.findAnnotation(Ljava/lang/reflect/Method;Ljava/lang/Class;)Lorg/testng/internal/annotations/IAnnotation; +METHOD|org.testng.internal.annotations.IAnnotationFinder.findAnnotation(Ljava/lang/reflect/Constructor;Ljava/lang/Class;)Lorg/testng/internal/annotations/IAnnotation; +METHOD|org.testng.internal.annotations.IAnnotationFinder.addSourceDirs([Ljava/lang/String;)V +METHOD|org.testng.internal.annotations.IBaseBeforeAfter.getEnabled()Z +METHOD|org.testng.internal.annotations.IBaseBeforeAfter.getGroups()[Ljava/lang/String; +METHOD|org.testng.internal.annotations.IBaseBeforeAfter.getDependsOnGroups()[Ljava/lang/String; +METHOD|org.testng.internal.annotations.IBaseBeforeAfter.getDependsOnMethods()[Ljava/lang/String; +METHOD|org.testng.internal.annotations.IBaseBeforeAfter.getAlwaysRun()Z +METHOD|org.testng.internal.annotations.IBaseBeforeAfter.getInheritGroups()Z +METHOD|org.testng.internal.annotations.IBaseBeforeAfter.getDescription()Ljava/lang/String; +METHOD|org.testng.internal.annotations.IConfiguration.getBeforeTestClass()Z +METHOD|org.testng.internal.annotations.IConfiguration.getAfterTestClass()Z +METHOD|org.testng.internal.annotations.IConfiguration.getBeforeTestMethod()Z +METHOD|org.testng.internal.annotations.IConfiguration.getAfterTestMethod()Z +METHOD|org.testng.internal.annotations.IConfiguration.getBeforeSuite()Z +METHOD|org.testng.internal.annotations.IConfiguration.getAfterSuite()Z +METHOD|org.testng.internal.annotations.IConfiguration.getBeforeTest()Z +METHOD|org.testng.internal.annotations.IConfiguration.getAfterTest()Z +METHOD|org.testng.internal.annotations.IConfiguration.getAlwaysRun()Z +METHOD|org.testng.internal.annotations.IConfiguration.getInheritGroups()Z +METHOD|org.testng.internal.annotations.IConfiguration.getBeforeGroups()[Ljava/lang/String; +METHOD|org.testng.internal.annotations.IConfiguration.getAfterGroups()[Ljava/lang/String; +METHOD|org.testng.internal.annotations.IConfiguration.isFakeConfiguration()Z +METHOD|org.testng.internal.annotations.IDataProvider.getName()Ljava/lang/String; +METHOD|org.testng.internal.annotations.IExpectedExceptions.getValue()[Ljava/lang/Class; +METHOD|org.testng.internal.annotations.IParameterizable.getParameters()[Ljava/lang/String; +METHOD|org.testng.internal.annotations.IParameters.getValue()[Ljava/lang/String; +METHOD|org.testng.internal.annotations.ITest.getTimeOut()J +METHOD|org.testng.internal.annotations.ITest.getInvocationCount()I +METHOD|org.testng.internal.annotations.ITest.getThreadPoolSize()I +METHOD|org.testng.internal.annotations.ITest.getSuccessPercentage()I +METHOD|org.testng.internal.annotations.ITest.getDataProvider()Ljava/lang/String; +METHOD|org.testng.internal.annotations.ITest.getAlwaysRun()Z +METHOD|org.testng.internal.annotations.ITest.getGroups()[Ljava/lang/String; +METHOD|org.testng.internal.annotations.ITest.getEnabled()Z +METHOD|org.testng.internal.annotations.ITest.setDependsOnGroups([Ljava/lang/String;)V +METHOD|org.testng.internal.annotations.ITest.setDependsOnMethods([Ljava/lang/String;)V +METHOD|org.testng.internal.annotations.ITest.setEnabled(Z)V +METHOD|org.testng.internal.annotations.ITest.setGroups([Ljava/lang/String;)V +METHOD|org.testng.internal.annotations.ITest.getDependsOnGroups()[Ljava/lang/String; +METHOD|org.testng.internal.annotations.ITest.getDependsOnMethods()[Ljava/lang/String; +METHOD|org.testng.internal.annotations.ITest.getDescription()Ljava/lang/String; +METHOD|org.testng.internal.annotations.ITest.getExpectedExceptions()[Ljava/lang/Class; +METHOD|org.testng.internal.annotations.ITest.getSuiteName()Ljava/lang/String; +METHOD|org.testng.internal.annotations.ITest.getTestName()Ljava/lang/String; +METHOD|org.testng.internal.annotations.ITest.getSequential()Z +METHOD|org.testng.internal.annotations.ITestOrConfiguration.getGroups()[Ljava/lang/String; +METHOD|org.testng.internal.annotations.ITestOrConfiguration.getDependsOnGroups()[Ljava/lang/String; +METHOD|org.testng.internal.annotations.ITestOrConfiguration.getDependsOnMethods()[Ljava/lang/String; +METHOD|org.testng.internal.annotations.ITestOrConfiguration.getEnabled()Z +METHOD|org.testng.internal.annotations.ITestOrConfiguration.getDescription()Ljava/lang/String; +METHOD|org.testng.internal.annotations.JDK14AnnotationFinder$1.(Lorg/testng/internal/annotations/JDK14AnnotationFinder;)V +METHOD|org.testng.internal.annotations.JDK14AnnotationFinder$1.visitFile(Ljava/io/File;)V +METHOD|org.testng.internal.annotations.JDK14AnnotationFinder.()V +METHOD|org.testng.internal.annotations.JDK14AnnotationFinder.addSources([Ljava/lang/String;)V +METHOD|org.testng.internal.annotations.JDK14AnnotationFinder.addSourceDirs([Ljava/lang/String;)V +METHOD|org.testng.internal.annotations.JDK14AnnotationFinder.findAnnotation(Ljava/lang/Class;Ljava/lang/Class;)Lorg/testng/internal/annotations/IAnnotation; +METHOD|org.testng.internal.annotations.JDK14AnnotationFinder.findAnnotation(Ljava/lang/reflect/Method;Ljava/lang/Class;)Lorg/testng/internal/annotations/IAnnotation; +METHOD|org.testng.internal.annotations.JDK14AnnotationFinder.findAnnotation(Ljava/lang/reflect/Constructor;Ljava/lang/Class;)Lorg/testng/internal/annotations/IAnnotation; +METHOD|org.testng.internal.annotations.JDK14AnnotationFinder.stripPackage(Ljava/lang/String;)Ljava/lang/String; +METHOD|org.testng.internal.annotations.JDK14AnnotationFinder.findMethodAnnotation(Ljava/lang/String;[Ljava/lang/Class;Ljava/lang/Class;Ljava/lang/Class;)Lorg/testng/internal/annotations/IAnnotation; +METHOD|org.testng.internal.annotations.JDK14AnnotationFinder.methodsAreEqual(Lcom/thoughtworks/qdox/model/JavaMethod;Ljava/lang/String;[Ljava/lang/Class;)Z +METHOD|org.testng.internal.annotations.JDK14AnnotationFinder.findTag(Ljava/lang/Class;Lorg/testng/internal/annotations/IAnnotation;Lcom/thoughtworks/qdox/model/AbstractInheritableJavaEntity;)Lorg/testng/internal/annotations/IAnnotation; +METHOD|org.testng.internal.annotations.JDK14AnnotationFinder.ppp(Ljava/lang/String;)V +METHOD|org.testng.internal.annotations.JDK14TagFactory.()V +METHOD|org.testng.internal.annotations.JDK14TagFactory.createTag(Ljava/lang/Class;Lcom/thoughtworks/qdox/model/AbstractInheritableJavaEntity;)Lorg/testng/internal/annotations/IAnnotation; +METHOD|org.testng.internal.annotations.JDK14TagFactory.getTagName(Ljava/lang/Class;)Ljava/lang/String; +METHOD|org.testng.internal.annotations.JDK14TagFactory.createTag(Ljava/lang/Class;Lcom/thoughtworks/qdox/model/DocletTag;)Lorg/testng/internal/annotations/IAnnotation; +METHOD|org.testng.internal.annotations.JDK14TagFactory.maybeCreateNewConfigurationTag(Ljava/lang/Class;Lcom/thoughtworks/qdox/model/DocletTag;)Lorg/testng/internal/annotations/IAnnotation; +METHOD|org.testng.internal.annotations.JDK14TagFactory.createConfigurationTag(Ljava/lang/Class;Lcom/thoughtworks/qdox/model/DocletTag;ZZZZ[Ljava/lang/String;[Ljava/lang/String;ZZZZZ[Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Z[Ljava/lang/String;Z[Ljava/lang/String;)Lorg/testng/internal/annotations/IConfiguration; +METHOD|org.testng.internal.annotations.JDK14TagFactory.createTestTag(Lcom/thoughtworks/qdox/model/DocletTag;)Lorg/testng/internal/annotations/IAnnotation; +METHOD|org.testng.internal.annotations.JDK14TagFactory.createConfigurationTag(Lcom/thoughtworks/qdox/model/DocletTag;)Lorg/testng/internal/annotations/IAnnotation; +METHOD|org.testng.internal.annotations.JDK14TagFactory.createDataProviderTag(Lcom/thoughtworks/qdox/model/DocletTag;)Lorg/testng/internal/annotations/IAnnotation; +METHOD|org.testng.internal.annotations.JDK14TagFactory.createExpectedExceptionsTag(Lcom/thoughtworks/qdox/model/DocletTag;)Lorg/testng/internal/annotations/IAnnotation; +METHOD|org.testng.internal.annotations.JDK14TagFactory.createParametersTag(Lcom/thoughtworks/qdox/model/DocletTag;)Lorg/testng/internal/annotations/IAnnotation; +METHOD|org.testng.internal.annotations.JDK14TagFactory.createFactoryTag(Lcom/thoughtworks/qdox/model/DocletTag;)Lorg/testng/internal/annotations/IAnnotation; +METHOD|org.testng.internal.annotations.JDK14TagFactory.ppp(Ljava/lang/String;)V +METHOD|org.testng.internal.annotations.JDK14TagFactory.()V +METHOD|org.testng.internal.annotations.JDK15AnnotationFinder.()V +METHOD|org.testng.internal.annotations.JDK15AnnotationFinder.findAnnotation(Ljava/lang/Class;Ljava/lang/Class;)Lorg/testng/internal/annotations/IAnnotation; +METHOD|org.testng.internal.annotations.JDK15AnnotationFinder.findAnnotationInSuperClasses(Ljava/lang/Class;Ljava/lang/Class;)Ljava/lang/annotation/Annotation; +METHOD|org.testng.internal.annotations.JDK15AnnotationFinder.findAnnotation(Ljava/lang/reflect/Method;Ljava/lang/Class;)Lorg/testng/internal/annotations/IAnnotation; +METHOD|org.testng.internal.annotations.JDK15AnnotationFinder.ppp(Ljava/lang/String;)V +METHOD|org.testng.internal.annotations.JDK15AnnotationFinder.findAnnotation(Ljava/lang/reflect/Constructor;Ljava/lang/Class;)Lorg/testng/internal/annotations/IAnnotation; +METHOD|org.testng.internal.annotations.JDK15AnnotationFinder.findAnnotation(Ljava/lang/Class;Ljava/lang/annotation/Annotation;Ljava/lang/Class;)Lorg/testng/internal/annotations/IAnnotation; +METHOD|org.testng.internal.annotations.JDK15AnnotationFinder.addSourceDirs([Ljava/lang/String;)V +METHOD|org.testng.internal.annotations.JDK15AnnotationFinder.()V +METHOD|org.testng.internal.annotations.JDK15TagFactory.()V +METHOD|org.testng.internal.annotations.JDK15TagFactory.createTag(Ljava/lang/Class;Ljava/lang/annotation/Annotation;Ljava/lang/Class;)Lorg/testng/internal/annotations/IAnnotation; +METHOD|org.testng.internal.annotations.JDK15TagFactory.maybeCreateNewConfigurationTag(Ljava/lang/Class;Ljava/lang/annotation/Annotation;Ljava/lang/Class;)Lorg/testng/internal/annotations/IAnnotation; +METHOD|org.testng.internal.annotations.JDK15TagFactory.createConfigurationTag(Ljava/lang/Class;Ljava/lang/annotation/Annotation;)Lorg/testng/internal/annotations/IAnnotation; +METHOD|org.testng.internal.annotations.JDK15TagFactory.createConfigurationTag(Ljava/lang/Class;Ljava/lang/annotation/Annotation;ZZZZ[Ljava/lang/String;[Ljava/lang/String;ZZZZZ[Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Z[Ljava/lang/String;Z[Ljava/lang/String;)Lorg/testng/internal/annotations/IAnnotation; +METHOD|org.testng.internal.annotations.JDK15TagFactory.createDataProviderTag(Ljava/lang/annotation/Annotation;)Lorg/testng/internal/annotations/IAnnotation; +METHOD|org.testng.internal.annotations.JDK15TagFactory.createExpectedExceptionsTag(Ljava/lang/annotation/Annotation;)Lorg/testng/internal/annotations/IAnnotation; +METHOD|org.testng.internal.annotations.JDK15TagFactory.createFactoryTag(Ljava/lang/annotation/Annotation;)Lorg/testng/internal/annotations/IAnnotation; +METHOD|org.testng.internal.annotations.JDK15TagFactory.createParametersTag(Ljava/lang/annotation/Annotation;)Lorg/testng/internal/annotations/IAnnotation; +METHOD|org.testng.internal.annotations.JDK15TagFactory.createTestTag(Ljava/lang/Class;Ljava/lang/annotation/Annotation;)Lorg/testng/internal/annotations/IAnnotation; +METHOD|org.testng.internal.annotations.JDK15TagFactory.join([Ljava/lang/String;[Ljava/lang/String;)[Ljava/lang/String; +METHOD|org.testng.internal.annotations.JDK15TagFactory.findInheritedStringArray(Ljava/lang/Class;Ljava/lang/Class;Ljava/lang/String;)[Ljava/lang/String; +METHOD|org.testng.internal.annotations.JDK15TagFactory.invokeMethod(Ljava/lang/annotation/Annotation;Ljava/lang/String;)Ljava/lang/Object; +METHOD|org.testng.internal.annotations.JDK15TagFactory.ppp(Ljava/lang/String;)V +METHOD|org.testng.internal.annotations.ParametersAnnotation.()V +METHOD|org.testng.internal.annotations.ParametersAnnotation.getValue()[Ljava/lang/String; +METHOD|org.testng.internal.annotations.ParametersAnnotation.setValue([Ljava/lang/String;)V +METHOD|org.testng.internal.annotations.TestAnnotation.()V +METHOD|org.testng.internal.annotations.TestAnnotation.getExpectedExceptions()[Ljava/lang/Class; +METHOD|org.testng.internal.annotations.TestAnnotation.setExpectedExceptions([Ljava/lang/Class;)V +METHOD|org.testng.internal.annotations.TestAnnotation.setAlwaysRun(Z)V +METHOD|org.testng.internal.annotations.TestAnnotation.setDataProvider(Ljava/lang/String;)V +METHOD|org.testng.internal.annotations.TestAnnotation.setInvocationCount(I)V +METHOD|org.testng.internal.annotations.TestAnnotation.setSuccessPercentage(I)V +METHOD|org.testng.internal.annotations.TestAnnotation.setTimeOut(J)V +METHOD|org.testng.internal.annotations.TestAnnotation.getTimeOut()J +METHOD|org.testng.internal.annotations.TestAnnotation.getInvocationCount()I +METHOD|org.testng.internal.annotations.TestAnnotation.getSuccessPercentage()I +METHOD|org.testng.internal.annotations.TestAnnotation.getDataProvider()Ljava/lang/String; +METHOD|org.testng.internal.annotations.TestAnnotation.getAlwaysRun()Z +METHOD|org.testng.internal.annotations.TestAnnotation.getThreadPoolSize()I +METHOD|org.testng.internal.annotations.TestAnnotation.setThreadPoolSize(I)V +METHOD|org.testng.internal.annotations.TestAnnotation.getSuiteName()Ljava/lang/String; +METHOD|org.testng.internal.annotations.TestAnnotation.setSuiteName(Ljava/lang/String;)V +METHOD|org.testng.internal.annotations.TestAnnotation.getTestName()Ljava/lang/String; +METHOD|org.testng.internal.annotations.TestAnnotation.setTestName(Ljava/lang/String;)V +METHOD|org.testng.internal.annotations.TestAnnotation.getSequential()Z +METHOD|org.testng.internal.annotations.TestAnnotation.setSequential(Z)V +METHOD|org.testng.internal.annotations.TestOrConfiguration.()V +METHOD|org.testng.internal.annotations.TestOrConfiguration.getGroups()[Ljava/lang/String; +METHOD|org.testng.internal.annotations.TestOrConfiguration.getEnabled()Z +METHOD|org.testng.internal.annotations.TestOrConfiguration.setDependsOnGroups([Ljava/lang/String;)V +METHOD|org.testng.internal.annotations.TestOrConfiguration.setDependsOnMethods([Ljava/lang/String;)V +METHOD|org.testng.internal.annotations.TestOrConfiguration.setGroups([Ljava/lang/String;)V +METHOD|org.testng.internal.annotations.TestOrConfiguration.getDescription()Ljava/lang/String; +METHOD|org.testng.internal.annotations.TestOrConfiguration.setEnabled(Z)V +METHOD|org.testng.internal.annotations.TestOrConfiguration.getDependsOnGroups()[Ljava/lang/String; +METHOD|org.testng.internal.annotations.TestOrConfiguration.getDependsOnMethods()[Ljava/lang/String; +METHOD|org.testng.internal.annotations.TestOrConfiguration.getParameters()[Ljava/lang/String; +METHOD|org.testng.internal.annotations.TestOrConfiguration.setParameters([Ljava/lang/String;)V +METHOD|org.testng.internal.annotations.TestOrConfiguration.setDescription(Ljava/lang/String;)V +METHOD|org.testng.internal.remote.SlavePool.()V +METHOD|org.testng.internal.remote.SlavePool.addSlaves([Ljava/net/Socket;)V +METHOD|org.testng.internal.remote.SlavePool.addSlave(Ljava/net/Socket;)V +METHOD|org.testng.internal.remote.SlavePool.addSlave(Ljava/net/Socket;Lorg/testng/remote/ConnectionInfo;)V +METHOD|org.testng.internal.remote.SlavePool.getSlave()Lorg/testng/remote/ConnectionInfo; +METHOD|org.testng.internal.remote.SlavePool.returnSlave(Lorg/testng/remote/ConnectionInfo;)V +METHOD|org.testng.internal.thread.CountDownAdapter.(I)V +METHOD|org.testng.internal.thread.CountDownAdapter.await()V +METHOD|org.testng.internal.thread.CountDownAdapter.await(J)Z +METHOD|org.testng.internal.thread.CountDownAdapter.countDown()V +METHOD|org.testng.internal.thread.ExecutorAdapter.(ILorg/testng/internal/thread/IThreadFactory;)V +METHOD|org.testng.internal.thread.ExecutorAdapter.submitRunnable(Ljava/lang/Runnable;)Lorg/testng/internal/thread/IFutureResult; +METHOD|org.testng.internal.thread.ExecutorAdapter.stopNow()V +METHOD|org.testng.internal.thread.ExecutorAdapter.awaitTermination(J)Z +METHOD|org.testng.internal.thread.FutureResultAdapter.(Ljava/util/concurrent/Future;)V +METHOD|org.testng.internal.thread.FutureResultAdapter.get()Ljava/lang/Object; +METHOD|org.testng.internal.thread.ICountDown.await()V +METHOD|org.testng.internal.thread.ICountDown.await(J)Z +METHOD|org.testng.internal.thread.ICountDown.countDown()V +METHOD|org.testng.internal.thread.IExecutor.submitRunnable(Ljava/lang/Runnable;)Lorg/testng/internal/thread/IFutureResult; +METHOD|org.testng.internal.thread.IExecutor.shutdown()V +METHOD|org.testng.internal.thread.IExecutor.awaitTermination(J)Z +METHOD|org.testng.internal.thread.IExecutor.stopNow()V +METHOD|org.testng.internal.thread.IFutureResult.get()Ljava/lang/Object; +METHOD|org.testng.internal.thread.IPooledExecutor.execute(Ljava/lang/Runnable;)V +METHOD|org.testng.internal.thread.IPooledExecutor.shutdown()V +METHOD|org.testng.internal.thread.IPooledExecutor.awaitTermination(J)V +METHOD|org.testng.internal.thread.IThreadFactory.newThread(Ljava/lang/Runnable;)Ljava/lang/Thread; +METHOD|org.testng.internal.thread.IThreadFactory.getThreadFactory()Ljava/lang/Object; +METHOD|org.testng.internal.thread.PooledExecutorAdapter.(I)V +METHOD|org.testng.internal.thread.PooledExecutorAdapter.awaitTermination(J)V +METHOD|org.testng.internal.thread.TestNGThread.(Ljava/lang/String;)V +METHOD|org.testng.internal.thread.TestNGThread.(Ljava/lang/Runnable;Ljava/lang/String;)V +METHOD|org.testng.internal.thread.ThreadExecutionException.(Ljava/lang/Throwable;)V +METHOD|org.testng.internal.thread.ThreadTimeoutException.(Ljava/lang/String;)V +METHOD|org.testng.internal.thread.ThreadTimeoutException.(Ljava/lang/Throwable;)V +METHOD|org.testng.internal.thread.ThreadTimeoutException.(Ljava/lang/String;Ljava/lang/Throwable;)V +METHOD|org.testng.internal.thread.ThreadUtil$ThreadFactoryImpl.(Ljava/lang/String;)V +METHOD|org.testng.internal.thread.ThreadUtil$ThreadFactoryImpl.newThread(Ljava/lang/Runnable;)Ljava/lang/Thread; +METHOD|org.testng.internal.thread.ThreadUtil$ThreadFactoryImpl.getThreadFactory()Ljava/lang/Object; +METHOD|org.testng.internal.thread.ThreadUtil.()V +METHOD|org.testng.internal.thread.ThreadUtil.currentThreadInfo()Ljava/lang/String; +METHOD|org.testng.internal.thread.ThreadUtil.createCountDown(I)Lorg/testng/internal/thread/ICountDown; +METHOD|org.testng.internal.thread.ThreadUtil.createExecutor(ILorg/testng/internal/thread/IThreadFactory;)Lorg/testng/internal/thread/IExecutor; +METHOD|org.testng.internal.thread.ThreadUtil.createPooledExecutor(I)Lorg/testng/internal/thread/IPooledExecutor; +METHOD|org.testng.internal.thread.ThreadUtil.createFactory(Ljava/lang/String;)Lorg/testng/internal/thread/IThreadFactory; +METHOD|org.testng.junit.INameFilter.accept(Ljava/lang/reflect/Method;)Z +METHOD|org.testng.junit.JUnitClassFinder.([Ljava/lang/Class;Lorg/testng/xml/XmlTest;Lorg/testng/internal/annotations/IAnnotationFinder;)V +METHOD|org.testng.junit.JUnitClassFinder.invokeSuite([Ljava/lang/Class;)Ljava/util/Collection; +METHOD|org.testng.junit.JUnitClassFinder.invokeSuite(Ljava/lang/Class;)[Ljava/lang/Class; +METHOD|org.testng.junit.JUnitClassFinder.getTestClass(Ljava/lang/Object;)Ljava/lang/Class; +METHOD|org.testng.junit.JUnitClassFinder.findClassFinder(Ljava/lang/Class;[Ljava/lang/Class;Lorg/testng/xml/XmlTest;Lorg/testng/internal/annotations/IAnnotationFinder;)Lorg/testng/junit/JUnitClassFinder; +METHOD|org.testng.junit.JUnitClassFinder.ppp(Ljava/lang/String;)V +METHOD|org.testng.junit.JUnitDirectoryConverter.(Ljava/io/File;Ljava/io/File;Ljava/lang/String;Z)V +METHOD|org.testng.junit.JUnitDirectoryConverter.convert()I +METHOD|org.testng.junit.JUnitDirectoryConverter.generateConfiguration([Ljava/lang/String;)V +METHOD|org.testng.junit.JUnitDirectoryConverter.isTestFile(Ljava/io/File;)Z +METHOD|org.testng.junit.JUnitDirectoryConverter.convert(Ljava/io/File;)Ljava/util/Map; +METHOD|org.testng.junit.JUnitDirectoryConverter.ppp(Ljava/lang/String;)V +METHOD|org.testng.junit.JUnitMethodFinder$1.(Lorg/testng/junit/JUnitMethodFinder;)V +METHOD|org.testng.junit.JUnitMethodFinder$1.accept(Ljava/lang/reflect/Method;)Z +METHOD|org.testng.junit.JUnitMethodFinder$2.(Lorg/testng/junit/JUnitMethodFinder;)V +METHOD|org.testng.junit.JUnitMethodFinder$2.accept(Ljava/lang/reflect/Method;)Z +METHOD|org.testng.junit.JUnitMethodFinder$3.(Lorg/testng/junit/JUnitMethodFinder;)V +METHOD|org.testng.junit.JUnitMethodFinder$3.accept(Ljava/lang/reflect/Method;)Z +METHOD|org.testng.junit.JUnitMethodFinder.(Ljava/lang/String;Lorg/testng/internal/annotations/IAnnotationFinder;)V +METHOD|org.testng.junit.JUnitMethodFinder.findConstructor(Ljava/lang/Class;[Ljava/lang/Class;)Ljava/lang/reflect/Constructor; +METHOD|org.testng.junit.JUnitMethodFinder.getTestMethods(Ljava/lang/Class;)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.junit.JUnitMethodFinder.privateFindTestMethods(Lorg/testng/junit/INameFilter;Ljava/lang/Class;)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.junit.JUnitMethodFinder.ppp(Ljava/lang/String;)V +METHOD|org.testng.junit.JUnitMethodFinder.instantiate(Ljava/lang/Class;)Ljava/lang/Object; +METHOD|org.testng.junit.JUnitMethodFinder.getBeforeTestMethods(Ljava/lang/Class;)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.junit.JUnitMethodFinder.getAfterTestMethods(Ljava/lang/Class;)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.junit.JUnitMethodFinder.getAfterClassMethods(Ljava/lang/Class;)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.junit.JUnitMethodFinder.getBeforeClassMethods(Ljava/lang/Class;)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.junit.JUnitMethodFinder.getBeforeSuiteMethods(Ljava/lang/Class;)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.junit.JUnitMethodFinder.getAfterSuiteMethods(Ljava/lang/Class;)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.junit.JUnitMethodFinder.getBeforeTestConfigurationMethods(Ljava/lang/Class;)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.junit.JUnitMethodFinder.getAfterTestConfigurationMethods(Ljava/lang/Class;)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.junit.JUnitMethodFinder.getBeforeGroupsConfigurationMethods(Ljava/lang/Class;)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.junit.JUnitMethodFinder.getAfterGroupsConfigurationMethods(Ljava/lang/Class;)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.junit.JUnitTestConverter.([Ljava/io/File;Ljava/io/File;Ljava/lang/String;Z)V +METHOD|org.testng.junit.JUnitTestConverter.findFileName(Lcom/sun/javadoc/ClassDoc;)Ljava/io/File; +METHOD|org.testng.junit.JUnitTestConverter.start(Lcom/sun/javadoc/RootDoc;)Z +METHOD|org.testng.junit.JUnitTestConverter.isJUnitTest(Lcom/sun/javadoc/ClassDoc;)Z +METHOD|org.testng.junit.JUnitTestConverter.isTest(Lcom/sun/javadoc/MethodDoc;)Z +METHOD|org.testng.junit.JUnitTestConverter.isSetUp(Lcom/sun/javadoc/MethodDoc;)Z +METHOD|org.testng.junit.JUnitTestConverter.isTearDown(Lcom/sun/javadoc/MethodDoc;)Z +METHOD|org.testng.junit.JUnitTestConverter.convert()I +METHOD|org.testng.junit.JUnitTestConverter.writeFile(Ljava/io/File;)V +METHOD|org.testng.junit.JUnitTestConverter.insertAnnotations(Ljava/util/List;Ljava/util/List;)Ljava/util/List; +METHOD|org.testng.junit.JUnitTestConverter.insertJavadoc(Ljava/io/File;Ljava/util/List;Ljava/util/List;)Ljava/util/List; +METHOD|org.testng.junit.JUnitTestConverter.getPackageOutputDir(Ljava/io/File;Ljava/lang/String;)Ljava/io/File; +METHOD|org.testng.junit.JUnitTestConverter.findCommentLine(Ljava/util/List;Lcom/sun/javadoc/MethodDoc;I)I +METHOD|org.testng.junit.JUnitTestConverter.fileToLines(Ljava/io/File;)Ljava/util/List; +METHOD|org.testng.junit.JUnitTestConverter.ppp(Ljava/lang/String;)V +METHOD|org.testng.junit.JUnitTestConverter.getClassNames()[Ljava/lang/String; +METHOD|org.testng.junit.JUnitTestConverter.()V +METHOD|org.testng.log.TextFormatter.()V +METHOD|org.testng.log.TextFormatter.format(Ljava/util/logging/LogRecord;)Ljava/lang/String; +METHOD|org.testng.log4testng.Logger.getLogger(Ljava/lang/Class;)Lorg/testng/log4testng/Logger; +METHOD|org.testng.log4testng.Logger.isTraceEnabled()Z +METHOD|org.testng.log4testng.Logger.trace(Ljava/lang/Object;)V +METHOD|org.testng.log4testng.Logger.trace(Ljava/lang/Object;Ljava/lang/Throwable;)V +METHOD|org.testng.log4testng.Logger.isDebugEnabled()Z +METHOD|org.testng.log4testng.Logger.debug(Ljava/lang/Object;)V +METHOD|org.testng.log4testng.Logger.debug(Ljava/lang/Object;Ljava/lang/Throwable;)V +METHOD|org.testng.log4testng.Logger.isInfoEnabled()Z +METHOD|org.testng.log4testng.Logger.info(Ljava/lang/Object;)V +METHOD|org.testng.log4testng.Logger.info(Ljava/lang/Object;Ljava/lang/Throwable;)V +METHOD|org.testng.log4testng.Logger.warn(Ljava/lang/Object;)V +METHOD|org.testng.log4testng.Logger.warn(Ljava/lang/Object;Ljava/lang/Throwable;)V +METHOD|org.testng.log4testng.Logger.error(Ljava/lang/Object;)V +METHOD|org.testng.log4testng.Logger.error(Ljava/lang/Object;Ljava/lang/Throwable;)V +METHOD|org.testng.log4testng.Logger.fatal(Ljava/lang/Object;)V +METHOD|org.testng.log4testng.Logger.fatal(Ljava/lang/Object;Ljava/lang/Throwable;)V +METHOD|org.testng.log4testng.Logger.(Ljava/lang/Class;I)V +METHOD|org.testng.log4testng.Logger.initialize()V +METHOD|org.testng.log4testng.Logger.getLevel(Ljava/lang/Class;)I +METHOD|org.testng.log4testng.Logger.isLevelEnabled(I)Z +METHOD|org.testng.log4testng.Logger.log(ILjava/lang/Object;Ljava/lang/Throwable;)V +METHOD|org.testng.log4testng.Logger.()V +METHOD|org.testng.remote.ConnectionInfo.()V +METHOD|org.testng.remote.ConnectionInfo.getOis()Ljava/io/ObjectInputStream; +METHOD|org.testng.remote.ConnectionInfo.getOos()Ljava/io/ObjectOutputStream; +METHOD|org.testng.remote.ConnectionInfo.setSocket(Ljava/net/Socket;)V +METHOD|org.testng.remote.ConnectionInfo.getSocket()Ljava/net/Socket; +METHOD|org.testng.remote.RemoteSuiteWorker.(Lorg/testng/xml/XmlSuite;Lorg/testng/internal/remote/SlavePool;Ljava/util/List;)V +METHOD|org.testng.remote.RemoteSuiteWorker.run()V +METHOD|org.testng.remote.RemoteTestWorker.(Lorg/testng/xml/XmlSuite;Lorg/testng/internal/remote/SlavePool;Lorg/testng/SuiteRunner;Ljava/util/List;)V +METHOD|org.testng.remote.RemoteTestWorker.run()V +METHOD|org.testng.remote.RemoteTestWorker.ppp(Ljava/lang/String;)V +METHOD|org.testng.remote.RemoteWorker.(Ljava/util/List;Lorg/testng/internal/remote/SlavePool;)V +METHOD|org.testng.remote.RemoteWorker.getSlavePool()Lorg/testng/internal/remote/SlavePool; +METHOD|org.testng.remote.RemoteWorker.sendSuite(Lorg/testng/remote/ConnectionInfo;Lorg/testng/xml/XmlSuite;)Lorg/testng/SuiteRunner; +METHOD|org.testng.remote.RemoteWorker.log(Ljava/lang/String;)V +METHOD|org.testng.remote.strprotocol.AbstractRemoteTestRunnerClient$ServerConnection.(Lorg/testng/remote/strprotocol/AbstractRemoteTestRunnerClient;I)V +METHOD|org.testng.remote.strprotocol.AbstractRemoteTestRunnerClient$ServerConnection.run()V +METHOD|org.testng.remote.strprotocol.AbstractRemoteTestRunnerClient$ServerConnection.handleThrowable(Ljava/lang/Throwable;)V +METHOD|org.testng.remote.strprotocol.AbstractRemoteTestRunnerClient.()V +METHOD|org.testng.remote.strprotocol.AbstractRemoteTestRunnerClient.startListening([Lorg/testng/remote/strprotocol/IRemoteSuiteListener;[Lorg/testng/remote/strprotocol/IRemoteTestListener;Lorg/testng/remote/strprotocol/AbstractRemoteTestRunnerClient$ServerConnection;)V +METHOD|org.testng.remote.strprotocol.AbstractRemoteTestRunnerClient.getSuiteListeners()[Lorg/testng/remote/strprotocol/IRemoteSuiteListener; +METHOD|org.testng.remote.strprotocol.AbstractRemoteTestRunnerClient.getTestListeners()[Lorg/testng/remote/strprotocol/IRemoteTestListener; +METHOD|org.testng.remote.strprotocol.AbstractRemoteTestRunnerClient.shutdown()V +METHOD|org.testng.remote.strprotocol.AbstractRemoteTestRunnerClient.isRunning()Z +METHOD|org.testng.remote.strprotocol.AbstractRemoteTestRunnerClient.stopTest()V +METHOD|org.testng.remote.strprotocol.AbstractRemoteTestRunnerClient.readMessage(Ljava/io/BufferedReader;)Ljava/lang/String; +METHOD|org.testng.remote.strprotocol.AbstractRemoteTestRunnerClient.receiveMessage(Ljava/lang/String;)V +METHOD|org.testng.remote.strprotocol.AbstractRemoteTestRunnerClient.notifyStart(Lorg/testng/remote/strprotocol/GenericMessage;)V +METHOD|org.testng.remote.strprotocol.AbstractRemoteTestRunnerClient.notifySuiteEvents(Lorg/testng/remote/strprotocol/SuiteMessage;)V +METHOD|org.testng.remote.strprotocol.AbstractRemoteTestRunnerClient.notifyTestEvents(Lorg/testng/remote/strprotocol/TestMessage;)V +METHOD|org.testng.remote.strprotocol.AbstractRemoteTestRunnerClient.notifyResultEvents(Lorg/testng/remote/strprotocol/TestResultMessage;)V +METHOD|org.testng.remote.strprotocol.AbstractRemoteTestRunnerClient.access$002(Lorg/testng/remote/strprotocol/AbstractRemoteTestRunnerClient;Ljava/net/ServerSocket;)Ljava/net/ServerSocket; +METHOD|org.testng.remote.strprotocol.AbstractRemoteTestRunnerClient.access$102(Lorg/testng/remote/strprotocol/AbstractRemoteTestRunnerClient;Ljava/net/Socket;)Ljava/net/Socket; +METHOD|org.testng.remote.strprotocol.AbstractRemoteTestRunnerClient.access$000(Lorg/testng/remote/strprotocol/AbstractRemoteTestRunnerClient;)Ljava/net/ServerSocket; +METHOD|org.testng.remote.strprotocol.AbstractRemoteTestRunnerClient.access$202(Lorg/testng/remote/strprotocol/AbstractRemoteTestRunnerClient;Ljava/io/BufferedReader;)Ljava/io/BufferedReader; +METHOD|org.testng.remote.strprotocol.AbstractRemoteTestRunnerClient.access$100(Lorg/testng/remote/strprotocol/AbstractRemoteTestRunnerClient;)Ljava/net/Socket; +METHOD|org.testng.remote.strprotocol.AbstractRemoteTestRunnerClient.access$302(Lorg/testng/remote/strprotocol/AbstractRemoteTestRunnerClient;Ljava/io/PrintWriter;)Ljava/io/PrintWriter; +METHOD|org.testng.remote.strprotocol.AbstractRemoteTestRunnerClient.access$200(Lorg/testng/remote/strprotocol/AbstractRemoteTestRunnerClient;)Ljava/io/BufferedReader; +METHOD|org.testng.remote.strprotocol.AbstractRemoteTestRunnerClient.access$400(Lorg/testng/remote/strprotocol/AbstractRemoteTestRunnerClient;Ljava/io/BufferedReader;)Ljava/lang/String; +METHOD|org.testng.remote.strprotocol.AbstractRemoteTestRunnerClient.access$500(Lorg/testng/remote/strprotocol/AbstractRemoteTestRunnerClient;Ljava/lang/String;)V +METHOD|org.testng.remote.strprotocol.AbstractRemoteTestRunnerClient.access$600(Lorg/testng/remote/strprotocol/AbstractRemoteTestRunnerClient;)V +METHOD|org.testng.remote.strprotocol.GenericMessage.(I)V +METHOD|org.testng.remote.strprotocol.GenericMessage.(ILjava/util/Map;)V +METHOD|org.testng.remote.strprotocol.GenericMessage.addProperty(Ljava/lang/String;Ljava/lang/Object;)Lorg/testng/remote/strprotocol/GenericMessage; +METHOD|org.testng.remote.strprotocol.GenericMessage.addProperty(Ljava/lang/String;I)Lorg/testng/remote/strprotocol/GenericMessage; +METHOD|org.testng.remote.strprotocol.GenericMessage.getProperty(Ljava/lang/String;)Ljava/lang/String; +METHOD|org.testng.remote.strprotocol.GenericMessage.getMessageAsString()Ljava/lang/String; +METHOD|org.testng.remote.strprotocol.IRemoteSuiteListener.onInitialization(Lorg/testng/remote/strprotocol/GenericMessage;)V +METHOD|org.testng.remote.strprotocol.IRemoteSuiteListener.onStart(Lorg/testng/remote/strprotocol/SuiteMessage;)V +METHOD|org.testng.remote.strprotocol.IRemoteSuiteListener.onFinish(Lorg/testng/remote/strprotocol/SuiteMessage;)V +METHOD|org.testng.remote.strprotocol.IRemoteTestListener.onStart(Lorg/testng/remote/strprotocol/TestMessage;)V +METHOD|org.testng.remote.strprotocol.IRemoteTestListener.onFinish(Lorg/testng/remote/strprotocol/TestMessage;)V +METHOD|org.testng.remote.strprotocol.IRemoteTestListener.onTestStart(Lorg/testng/remote/strprotocol/TestResultMessage;)V +METHOD|org.testng.remote.strprotocol.IRemoteTestListener.onTestSuccess(Lorg/testng/remote/strprotocol/TestResultMessage;)V +METHOD|org.testng.remote.strprotocol.IRemoteTestListener.onTestFailure(Lorg/testng/remote/strprotocol/TestResultMessage;)V +METHOD|org.testng.remote.strprotocol.IRemoteTestListener.onTestSkipped(Lorg/testng/remote/strprotocol/TestResultMessage;)V +METHOD|org.testng.remote.strprotocol.IRemoteTestListener.onTestFailedButWithinSuccessPercentage(Lorg/testng/remote/strprotocol/TestResultMessage;)V +METHOD|org.testng.remote.strprotocol.IStringMessage.getMessageAsString()Ljava/lang/String; +METHOD|org.testng.remote.strprotocol.MessageHelper.()V +METHOD|org.testng.remote.strprotocol.MessageHelper.getMessageType(Ljava/lang/String;)I +METHOD|org.testng.remote.strprotocol.MessageHelper.unmarshallGenericMessage(Ljava/lang/String;)Lorg/testng/remote/strprotocol/GenericMessage; +METHOD|org.testng.remote.strprotocol.MessageHelper.createSuiteMessage(Ljava/lang/String;)Lorg/testng/remote/strprotocol/SuiteMessage; +METHOD|org.testng.remote.strprotocol.MessageHelper.createTestMessage(Ljava/lang/String;)Lorg/testng/remote/strprotocol/TestMessage; +METHOD|org.testng.remote.strprotocol.MessageHelper.unmarshallTestResultMessage(Ljava/lang/String;)Lorg/testng/remote/strprotocol/TestResultMessage; +METHOD|org.testng.remote.strprotocol.MessageHelper.replaceNewLine(Ljava/lang/String;)Ljava/lang/String; +METHOD|org.testng.remote.strprotocol.MessageHelper.replaceNewLineReplacer(Ljava/lang/String;)Ljava/lang/String; +METHOD|org.testng.remote.strprotocol.MessageHelper.parseMessage(Ljava/lang/String;)[Ljava/lang/String; +METHOD|org.testng.remote.strprotocol.RemoteMessageSenderTestListener.(Lorg/testng/ISuite;Lorg/testng/xml/XmlTest;Lorg/testng/remote/strprotocol/StringMessageSenderHelper;)V +METHOD|org.testng.remote.strprotocol.RemoteMessageSenderTestListener.onStart(Lorg/testng/ITestContext;)V +METHOD|org.testng.remote.strprotocol.RemoteMessageSenderTestListener.onFinish(Lorg/testng/ITestContext;)V +METHOD|org.testng.remote.strprotocol.RemoteMessageSenderTestListener.onTestStart(Lorg/testng/ITestResult;)V +METHOD|org.testng.remote.strprotocol.RemoteMessageSenderTestListener.onTestFailedButWithinSuccessPercentage(Lorg/testng/ITestResult;)V +METHOD|org.testng.remote.strprotocol.RemoteMessageSenderTestListener.onTestFailure(Lorg/testng/ITestResult;)V +METHOD|org.testng.remote.strprotocol.RemoteMessageSenderTestListener.onTestSkipped(Lorg/testng/ITestResult;)V +METHOD|org.testng.remote.strprotocol.RemoteMessageSenderTestListener.onTestSuccess(Lorg/testng/ITestResult;)V +METHOD|org.testng.remote.strprotocol.StringMessageSenderHelper$ReaderThread.(Lorg/testng/remote/strprotocol/StringMessageSenderHelper;)V +METHOD|org.testng.remote.strprotocol.StringMessageSenderHelper$ReaderThread.run()V +METHOD|org.testng.remote.strprotocol.StringMessageSenderHelper.(Ljava/lang/String;I)V +METHOD|org.testng.remote.strprotocol.StringMessageSenderHelper.connect()Z +METHOD|org.testng.remote.strprotocol.StringMessageSenderHelper.shutDown()V +METHOD|org.testng.remote.strprotocol.StringMessageSenderHelper.sendMessage(Lorg/testng/remote/strprotocol/IMessage;)V +METHOD|org.testng.remote.strprotocol.StringMessageSenderHelper.sendMessage(Lorg/testng/remote/strprotocol/IStringMessage;)V +METHOD|org.testng.remote.strprotocol.StringMessageSenderHelper.sendMessage(Ljava/lang/String;)V +METHOD|org.testng.remote.strprotocol.StringMessageSenderHelper.ppp(Ljava/lang/String;)V +METHOD|org.testng.remote.strprotocol.StringMessageSenderHelper.access$000(Lorg/testng/remote/strprotocol/StringMessageSenderHelper;)Ljava/io/BufferedReader; +METHOD|org.testng.remote.strprotocol.StringMessageSenderHelper.access$100(Lorg/testng/remote/strprotocol/StringMessageSenderHelper;)Z +METHOD|org.testng.remote.strprotocol.StringMessageSenderHelper.access$200(Ljava/lang/String;)V +METHOD|org.testng.remote.strprotocol.StringMessageSenderHelper.access$300(Lorg/testng/remote/strprotocol/StringMessageSenderHelper;)Ljava/lang/Object; +METHOD|org.testng.remote.strprotocol.SuiteMessage.(Ljava/lang/String;ZI)V +METHOD|org.testng.remote.strprotocol.SuiteMessage.(Lorg/testng/ISuite;Z)V +METHOD|org.testng.remote.strprotocol.SuiteMessage.isMessageOnStart()Z +METHOD|org.testng.remote.strprotocol.SuiteMessage.getSuiteName()Ljava/lang/String; +METHOD|org.testng.remote.strprotocol.SuiteMessage.getTestMethodCount()I +METHOD|org.testng.remote.strprotocol.SuiteMessage.getMessageAsString()Ljava/lang/String; +METHOD|org.testng.remote.strprotocol.TestMessage.(ZLjava/lang/String;Ljava/lang/String;IIIII)V +METHOD|org.testng.remote.strprotocol.TestMessage.(Lorg/testng/ITestContext;Z)V +METHOD|org.testng.remote.strprotocol.TestMessage.isMessageOnStart()Z +METHOD|org.testng.remote.strprotocol.TestMessage.getMessageAsString()Ljava/lang/String; +METHOD|org.testng.remote.strprotocol.TestMessage.getSuiteName()Ljava/lang/String; +METHOD|org.testng.remote.strprotocol.TestMessage.getTestName()Ljava/lang/String; +METHOD|org.testng.remote.strprotocol.TestMessage.isTestStart()Z +METHOD|org.testng.remote.strprotocol.TestMessage.getTestMethodCount()I +METHOD|org.testng.remote.strprotocol.TestMessage.getSuccessPercentageFailedTestCount()I +METHOD|org.testng.remote.strprotocol.TestMessage.getFailedTestCount()I +METHOD|org.testng.remote.strprotocol.TestMessage.getPassedTestCount()I +METHOD|org.testng.remote.strprotocol.TestMessage.getSkippedTestCount()I +METHOD|org.testng.remote.strprotocol.TestResultMessage.(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;JJLjava/lang/String;)V +METHOD|org.testng.remote.strprotocol.TestResultMessage.(Ljava/lang/String;Ljava/lang/String;Lorg/testng/ITestResult;)V +METHOD|org.testng.remote.strprotocol.TestResultMessage.(Lorg/testng/ITestContext;Lorg/testng/ITestResult;)V +METHOD|org.testng.remote.strprotocol.TestResultMessage.init(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;JJ)V +METHOD|org.testng.remote.strprotocol.TestResultMessage.getResult()I +METHOD|org.testng.remote.strprotocol.TestResultMessage.getMessageAsString()Ljava/lang/String; +METHOD|org.testng.remote.strprotocol.TestResultMessage.getSuiteName()Ljava/lang/String; +METHOD|org.testng.remote.strprotocol.TestResultMessage.getTestClass()Ljava/lang/String; +METHOD|org.testng.remote.strprotocol.TestResultMessage.getMethod()Ljava/lang/String; +METHOD|org.testng.remote.strprotocol.TestResultMessage.getName()Ljava/lang/String; +METHOD|org.testng.remote.strprotocol.TestResultMessage.getStackTrace()Ljava/lang/String; +METHOD|org.testng.remote.strprotocol.TestResultMessage.getEndMillis()J +METHOD|org.testng.remote.strprotocol.TestResultMessage.getStartMillis()J +METHOD|org.testng.remote.strprotocol.TestResultMessage.equals(Ljava/lang/Object;)Z +METHOD|org.testng.remote.strprotocol.TestResultMessage.hashCode()I +METHOD|org.testng.reporters.DotTestListener.()V +METHOD|org.testng.reporters.DotTestListener.onTestFailure(Lorg/testng/ITestResult;)V +METHOD|org.testng.reporters.DotTestListener.onTestSkipped(Lorg/testng/ITestResult;)V +METHOD|org.testng.reporters.DotTestListener.onTestSuccess(Lorg/testng/ITestResult;)V +METHOD|org.testng.reporters.DotTestListener.log(Ljava/lang/String;)V +METHOD|org.testng.reporters.ExitCodeListener.()V +METHOD|org.testng.reporters.ExitCodeListener.onTestFailure(Lorg/testng/ITestResult;)V +METHOD|org.testng.reporters.ExitCodeListener.onTestSkipped(Lorg/testng/ITestResult;)V +METHOD|org.testng.reporters.ExitCodeListener.onTestFailedButWithinSuccessPercentage(Lorg/testng/ITestResult;)V +METHOD|org.testng.reporters.ExitCodeListener.onTestSuccess(Lorg/testng/ITestResult;)V +METHOD|org.testng.reporters.ExitCodeListener.onStart(Lorg/testng/ITestContext;)V +METHOD|org.testng.reporters.ExitCodeListener.onFinish(Lorg/testng/ITestContext;)V +METHOD|org.testng.reporters.ExitCodeListener.onTestStart(Lorg/testng/ITestResult;)V +METHOD|org.testng.reporters.FailedReporter.()V +METHOD|org.testng.reporters.FailedReporter.(Lorg/testng/xml/XmlSuite;)V +METHOD|org.testng.reporters.FailedReporter.generateReport(Ljava/util/List;Ljava/util/List;Ljava/lang/String;)V +METHOD|org.testng.reporters.FailedReporter.generateFailureSuite(Lorg/testng/xml/XmlSuite;Lorg/testng/ISuite;Ljava/lang/String;)V +METHOD|org.testng.reporters.FailedReporter.onFinish(Lorg/testng/ITestContext;)V +METHOD|org.testng.reporters.FailedReporter.generateXmlTest(Lorg/testng/ISuite;Lorg/testng/xml/XmlTest;Lorg/testng/ITestContext;Ljava/util/Collection;Ljava/util/Collection;)V +METHOD|org.testng.reporters.FailedReporter.addMethods(Ljava/util/Map;[Lorg/testng/ITestNGMethod;)V +METHOD|org.testng.reporters.FailedReporter.createXmlTest(Lorg/testng/ITestContext;Ljava/util/List;Lorg/testng/xml/XmlTest;)V +METHOD|org.testng.reporters.FailedReporter.createXmlClasses(Ljava/util/List;)Ljava/util/List; +METHOD|org.testng.reporters.FailedReporter.getFileName(Lorg/testng/ITestContext;)Ljava/lang/String; +METHOD|org.testng.reporters.FailedReporter.ppp(Ljava/lang/String;)V +METHOD|org.testng.reporters.HtmlHelper.()V +METHOD|org.testng.reporters.HtmlHelper.getCssString()Ljava/lang/String; +METHOD|org.testng.reporters.HtmlHelper.getCssString(Ljava/lang/String;)Ljava/lang/String; +METHOD|org.testng.reporters.HtmlHelper.generateStylesheet(Ljava/lang/String;)Ljava/io/File; +METHOD|org.testng.reporters.JUnitXMLReporter.()V +METHOD|org.testng.reporters.JUnitXMLReporter.onTestStart(Lorg/testng/ITestResult;)V +METHOD|org.testng.reporters.JUnitXMLReporter.onTestSuccess(Lorg/testng/ITestResult;)V +METHOD|org.testng.reporters.JUnitXMLReporter.onTestFailedButWithinSuccessPercentage(Lorg/testng/ITestResult;)V +METHOD|org.testng.reporters.JUnitXMLReporter.onTestFailure(Lorg/testng/ITestResult;)V +METHOD|org.testng.reporters.JUnitXMLReporter.onTestSkipped(Lorg/testng/ITestResult;)V +METHOD|org.testng.reporters.JUnitXMLReporter.onStart(Lorg/testng/ITestContext;)V +METHOD|org.testng.reporters.JUnitXMLReporter.onFinish(Lorg/testng/ITestContext;)V +METHOD|org.testng.reporters.JUnitXMLReporter.generateReport()V +METHOD|org.testng.reporters.SuiteHTMLReporter$1.(Lorg/testng/reporters/SuiteHTMLReporter;)V +METHOD|org.testng.reporters.SuiteHTMLReporter$1.compare(Ljava/lang/Object;Ljava/lang/Object;)I +METHOD|org.testng.reporters.SuiteHTMLReporter.()V +METHOD|org.testng.reporters.SuiteHTMLReporter.generateReport(Ljava/util/List;Ljava/util/List;Ljava/lang/String;)V +METHOD|org.testng.reporters.SuiteHTMLReporter.generateXmlFile(Lorg/testng/xml/XmlSuite;Lorg/testng/ISuite;)V +METHOD|org.testng.reporters.SuiteHTMLReporter.generateIndex(Ljava/util/List;)V +METHOD|org.testng.reporters.SuiteHTMLReporter.generateExcludedMethodsReport(Lorg/testng/xml/XmlSuite;Lorg/testng/ISuite;)V +METHOD|org.testng.reporters.SuiteHTMLReporter.generateReporterOutput(Lorg/testng/xml/XmlSuite;Lorg/testng/ISuite;)V +METHOD|org.testng.reporters.SuiteHTMLReporter.generateClasses(Lorg/testng/xml/XmlSuite;Lorg/testng/ISuite;)V +METHOD|org.testng.reporters.SuiteHTMLReporter.generateClass(Lorg/testng/ITestClass;)Ljava/lang/String; +METHOD|org.testng.reporters.SuiteHTMLReporter.dumpMethods([Lorg/testng/ITestNGMethod;)Ljava/lang/String; +METHOD|org.testng.reporters.SuiteHTMLReporter.dumpGroups([Ljava/lang/String;)Ljava/lang/String; +METHOD|org.testng.reporters.SuiteHTMLReporter.generateMethodsChronologically(Lorg/testng/xml/XmlSuite;Lorg/testng/ISuite;Ljava/lang/String;Z)V +METHOD|org.testng.reporters.SuiteHTMLReporter.toHex(I)Ljava/lang/String; +METHOD|org.testng.reporters.SuiteHTMLReporter.createColor(Lorg/testng/ITestNGMethod;)Ljava/lang/String; +METHOD|org.testng.reporters.SuiteHTMLReporter.td(Ljava/lang/String;)Ljava/lang/String; +METHOD|org.testng.reporters.SuiteHTMLReporter.ppp(Ljava/lang/String;)V +METHOD|org.testng.reporters.SuiteHTMLReporter.generateMethodsAndGroups(Lorg/testng/xml/XmlSuite;Lorg/testng/ISuite;)V +METHOD|org.testng.reporters.SuiteHTMLReporter.generateIndex(Lorg/testng/xml/XmlSuite;Lorg/testng/ISuite;)V +METHOD|org.testng.reporters.SuiteHTMLReporter.makeTitle(Lorg/testng/ISuite;)Ljava/lang/String; +METHOD|org.testng.reporters.SuiteHTMLReporter.generateMain(Lorg/testng/xml/XmlSuite;Lorg/testng/ISuite;)V +METHOD|org.testng.reporters.SuiteHTMLReporter.generateTableOfContents(Lorg/testng/xml/XmlSuite;Lorg/testng/ISuite;)V +METHOD|org.testng.reporters.SuiteHTMLReporter.pluralize(ILjava/lang/String;)Ljava/lang/String; +METHOD|org.testng.reporters.SuiteHTMLReporter.getOutputDirectory(Lorg/testng/xml/XmlSuite;)Ljava/lang/String; +METHOD|org.testng.reporters.SuiteHTMLReporter.sortResults(Ljava/util/Collection;)[Lorg/testng/ISuiteResult; +METHOD|org.testng.reporters.SuiteHTMLReporter.generateSuiteResult(Ljava/lang/String;Lorg/testng/ISuiteResult;Ljava/lang/String;Ljava/lang/StringBuffer;Ljava/lang/String;)V +METHOD|org.testng.reporters.SuiteHTMLReporter.generateSuites(Lorg/testng/xml/XmlSuite;Lorg/testng/ISuite;)V +METHOD|org.testng.reporters.Tag.(Ljava/lang/String;Ljava/lang/String;)V +METHOD|org.testng.reporters.TestHTMLReporter$1.()V +METHOD|org.testng.reporters.TestHTMLReporter$1.compare(Lorg/testng/ITestResult;Lorg/testng/ITestResult;)I +METHOD|org.testng.reporters.TestHTMLReporter$1.compare(Ljava/lang/Object;Ljava/lang/Object;)I +METHOD|org.testng.reporters.TestHTMLReporter.()V +METHOD|org.testng.reporters.TestHTMLReporter.onStart(Lorg/testng/ITestContext;)V +METHOD|org.testng.reporters.TestHTMLReporter.onFinish(Lorg/testng/ITestContext;)V +METHOD|org.testng.reporters.TestHTMLReporter.getOutputFile(Ljava/lang/String;Lorg/testng/ITestContext;)Ljava/io/File; +METHOD|org.testng.reporters.TestHTMLReporter.generateTable(Ljava/lang/StringBuffer;Ljava/lang/String;Ljava/util/Collection;Ljava/lang/String;)V +METHOD|org.testng.reporters.TestHTMLReporter.arrayToString([Ljava/lang/String;)Ljava/lang/String; +METHOD|org.testng.reporters.TestHTMLReporter.generateLog(Lorg/testng/ITestContext;Ljava/lang/String;Ljava/lang/String;Ljava/util/Collection;Ljava/util/Collection;Ljava/util/Collection;Ljava/util/Collection;)V +METHOD|org.testng.reporters.TestHTMLReporter.ppp(Ljava/lang/String;)V +METHOD|org.testng.reporters.TestHTMLReporter.()V +METHOD|org.testng.reporters.TextReporter.(Ljava/lang/String;I)V +METHOD|org.testng.reporters.TextReporter.onFinish(Lorg/testng/ITestContext;)V +METHOD|org.testng.reporters.TextReporter.resultsToMethods(Ljava/util/List;)[Lorg/testng/ITestNGMethod; +METHOD|org.testng.reporters.TextReporter.logResults()V +METHOD|org.testng.reporters.TextReporter.getName()Ljava/lang/String; +METHOD|org.testng.reporters.TextReporter.logResult(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V +METHOD|org.testng.reporters.TextReporter.logResult(Ljava/lang/Throwable;)V +METHOD|org.testng.reporters.TextReporter.ppp(Ljava/lang/String;)V +METHOD|org.testng.reporters.XMLReporter.()V +METHOD|org.testng.reporters.XMLReporter.onStart(Lorg/testng/ISuite;)V +METHOD|org.testng.reporters.XMLReporter.onFinish(Lorg/testng/ISuite;)V +METHOD|org.testng.reporters.XMLReporter.ppp(Ljava/lang/String;)V +METHOD|org.testng.reporters.XMLStringBuffer.(Ljava/lang/String;)V +METHOD|org.testng.reporters.XMLStringBuffer.setDocType(Ljava/lang/String;)V +METHOD|org.testng.reporters.XMLStringBuffer.(Ljava/lang/StringBuffer;Ljava/lang/String;)V +METHOD|org.testng.reporters.XMLStringBuffer.init(Ljava/lang/StringBuffer;Ljava/lang/String;)V +METHOD|org.testng.reporters.XMLStringBuffer.push(Ljava/lang/String;Ljava/lang/String;Ljava/util/Properties;)V +METHOD|org.testng.reporters.XMLStringBuffer.push(Ljava/lang/String;Ljava/lang/String;)V +METHOD|org.testng.reporters.XMLStringBuffer.push(Ljava/lang/String;Ljava/util/Properties;)V +METHOD|org.testng.reporters.XMLStringBuffer.push(Ljava/lang/String;)V +METHOD|org.testng.reporters.XMLStringBuffer.pop()V +METHOD|org.testng.reporters.XMLStringBuffer.pop(Ljava/lang/String;)V +METHOD|org.testng.reporters.XMLStringBuffer.addRequired(Ljava/lang/String;Ljava/lang/String;)V +METHOD|org.testng.reporters.XMLStringBuffer.addRequired(Ljava/lang/String;Ljava/lang/String;Ljava/util/Properties;)V +METHOD|org.testng.reporters.XMLStringBuffer.addOptional(Ljava/lang/String;Ljava/lang/String;Ljava/util/Properties;)V +METHOD|org.testng.reporters.XMLStringBuffer.addOptional(Ljava/lang/String;Ljava/lang/String;)V +METHOD|org.testng.reporters.XMLStringBuffer.addOptional(Ljava/lang/String;Ljava/lang/Boolean;Ljava/util/Properties;)V +METHOD|org.testng.reporters.XMLStringBuffer.addOptional(Ljava/lang/String;Ljava/lang/Boolean;)V +METHOD|org.testng.reporters.XMLStringBuffer.addEmptyElement(Ljava/lang/String;)V +METHOD|org.testng.reporters.XMLStringBuffer.addEmptyElement(Ljava/lang/String;Ljava/util/Properties;)V +METHOD|org.testng.reporters.XMLStringBuffer.ppp(Ljava/lang/String;)V +METHOD|org.testng.reporters.XMLStringBuffer.addCDATA(Ljava/lang/String;)V +METHOD|org.testng.reporters.XMLStringBuffer.getStringBuffer()Ljava/lang/StringBuffer; +METHOD|org.testng.reporters.XMLStringBuffer.toXML()Ljava/lang/String; +METHOD|org.testng.reporters.XMLStringBuffer.main([Ljava/lang/String;)V +METHOD|org.testng.reporters.XMLStringBuffer.()V +METHOD|org.testng.reporters.XMLUtils.()V +METHOD|org.testng.reporters.XMLUtils.xml(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/Properties;)Ljava/lang/String; +METHOD|org.testng.reporters.XMLUtils.xmlOptional(Ljava/lang/StringBuffer;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/util/Properties;)V +METHOD|org.testng.reporters.XMLUtils.xmlOptional(Ljava/lang/StringBuffer;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/Properties;)V +METHOD|org.testng.reporters.XMLUtils.xmlRequired(Ljava/lang/StringBuffer;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/Properties;)V +METHOD|org.testng.reporters.XMLUtils.xmlOpen(Ljava/lang/StringBuffer;Ljava/lang/String;Ljava/lang/String;Ljava/util/Properties;)V +METHOD|org.testng.reporters.XMLUtils.appendAttributes(Ljava/lang/StringBuffer;Ljava/util/Properties;)V +METHOD|org.testng.reporters.XMLUtils.xmlOpen(Ljava/lang/StringBuffer;Ljava/lang/String;Ljava/lang/String;Ljava/util/Properties;Z)V +METHOD|org.testng.reporters.XMLUtils.xmlClose(Ljava/lang/StringBuffer;Ljava/lang/String;Ljava/lang/String;)V +METHOD|org.testng.xml.ClassSuite.(Ljava/lang/String;[Ljava/lang/Class;)V +METHOD|org.testng.xml.LaunchSuite$ClassListSuite.(Ljava/lang/String;Ljava/util/Collection;Ljava/util/Collection;Ljava/util/Collection;Ljava/util/Map;Ljava/lang/String;I)V +METHOD|org.testng.xml.LaunchSuite$ClassListSuite.initContentBuffer(Lorg/testng/reporters/XMLStringBuffer;)V +METHOD|org.testng.xml.LaunchSuite$CustomizedSuite.(Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;Ljava/lang/String;)V +METHOD|org.testng.xml.LaunchSuite$CustomizedSuite.createContentBuffer()Lorg/testng/reporters/XMLStringBuffer; +METHOD|org.testng.xml.LaunchSuite$CustomizedSuite.getSuiteBuffer()Lorg/testng/reporters/XMLStringBuffer; +METHOD|org.testng.xml.LaunchSuite$CustomizedSuite.initContentBuffer(Lorg/testng/reporters/XMLStringBuffer;)V +METHOD|org.testng.xml.LaunchSuite$CustomizedSuite.save(Ljava/io/File;)Ljava/io/File; +METHOD|org.testng.xml.LaunchSuite$CustomizedSuite.saveSuiteContent(Ljava/io/File;Lorg/testng/reporters/XMLStringBuffer;)V +METHOD|org.testng.xml.LaunchSuite$CustomizedSuite.(Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;Ljava/lang/String;Lorg/testng/xml/LaunchSuite$1;)V +METHOD|org.testng.xml.LaunchSuite$ExistingSuite.(Ljava/io/File;)V +METHOD|org.testng.xml.LaunchSuite$ExistingSuite.save(Ljava/io/File;)Ljava/io/File; +METHOD|org.testng.xml.LaunchSuite$MethodsSuite.(Ljava/lang/String;Ljava/lang/String;Ljava/util/Collection;Ljava/util/Map;Ljava/lang/String;I)V +METHOD|org.testng.xml.LaunchSuite$MethodsSuite.initContentBuffer(Lorg/testng/reporters/XMLStringBuffer;)V +METHOD|org.testng.xml.LaunchSuite.(Z)V +METHOD|org.testng.xml.LaunchSuite.isTemporary()Z +METHOD|org.testng.xml.LaunchSuite.save(Ljava/io/File;)Ljava/io/File; +METHOD|org.testng.xml.Parser.(Ljava/lang/String;Ljava/io/InputStream;)V +METHOD|org.testng.xml.Parser.(Ljava/lang/String;)V +METHOD|org.testng.xml.Parser.(Ljava/io/InputStream;)V +METHOD|org.testng.xml.Parser.()V +METHOD|org.testng.xml.Parser.getDefault()Ljava/io/InputStream; +METHOD|org.testng.xml.Parser.parse()Lorg/testng/xml/XmlSuite; +METHOD|org.testng.xml.SuiteGenerator.()V +METHOD|org.testng.xml.SuiteGenerator.createProxiedXmlSuite(Ljava/io/File;)Lorg/testng/xml/LaunchSuite; +METHOD|org.testng.xml.SuiteGenerator.createCustomizedSuite(Ljava/lang/String;Ljava/util/Collection;Ljava/util/Collection;Ljava/util/Collection;Ljava/util/Collection;Ljava/util/Map;Ljava/lang/String;I)Lorg/testng/xml/LaunchSuite; +METHOD|org.testng.xml.TestNGContentHandler.(Ljava/lang/String;)V +METHOD|org.testng.xml.TestNGContentHandler.ppp(Ljava/lang/String;)V +METHOD|org.testng.xml.TestNGContentHandler.resolveEntity(Ljava/lang/String;Ljava/lang/String;)Lorg/xml/sax/InputSource; +METHOD|org.testng.xml.TestNGContentHandler.xmlSuite(ZLorg/xml/sax/Attributes;)V +METHOD|org.testng.xml.TestNGContentHandler.xmlDefine(ZLorg/xml/sax/Attributes;)V +METHOD|org.testng.xml.TestNGContentHandler.xmlScript(ZLorg/xml/sax/Attributes;)V +METHOD|org.testng.xml.TestNGContentHandler.xmlTest(ZLorg/xml/sax/Attributes;)V +METHOD|org.testng.xml.TestNGContentHandler.xmlClasses(ZLorg/xml/sax/Attributes;)V +METHOD|org.testng.xml.TestNGContentHandler.xmlPackages(ZLorg/xml/sax/Attributes;)V +METHOD|org.testng.xml.TestNGContentHandler.xmlMethodSelectors(ZLorg/xml/sax/Attributes;)V +METHOD|org.testng.xml.TestNGContentHandler.xmlSelectorClass(ZLorg/xml/sax/Attributes;)V +METHOD|org.testng.xml.TestNGContentHandler.xmlMethodSelector(ZLorg/xml/sax/Attributes;)V +METHOD|org.testng.xml.TestNGContentHandler.xmlMethod(ZLorg/xml/sax/Attributes;)V +METHOD|org.testng.xml.TestNGContentHandler.xmlRun(ZLorg/xml/sax/Attributes;)V +METHOD|org.testng.xml.TestNGContentHandler.startElement(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lorg/xml/sax/Attributes;)V +METHOD|org.testng.xml.TestNGContentHandler.endElement(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V +METHOD|org.testng.xml.TestNGContentHandler.error(Lorg/xml/sax/SAXParseException;)V +METHOD|org.testng.xml.TestNGContentHandler.areWhiteSpaces([CII)Z +METHOD|org.testng.xml.TestNGContentHandler.characters([CII)V +METHOD|org.testng.xml.TestNGContentHandler.getSuite()Lorg/testng/xml/XmlSuite; +METHOD|org.testng.xml.XmlClass.(Ljava/lang/String;)V +METHOD|org.testng.xml.XmlClass.(Ljava/lang/Class;)V +METHOD|org.testng.xml.XmlClass.init(Ljava/lang/String;Ljava/lang/Class;)V +METHOD|org.testng.xml.XmlClass.getSupportClass()Ljava/lang/Class; +METHOD|org.testng.xml.XmlClass.setClass(Ljava/lang/Class;)V +METHOD|org.testng.xml.XmlClass.getExcludedMethods()Ljava/util/List; +METHOD|org.testng.xml.XmlClass.setExcludedMethods(Ljava/util/List;)V +METHOD|org.testng.xml.XmlClass.getIncludedMethods()Ljava/util/List; +METHOD|org.testng.xml.XmlClass.setIncludedMethods(Ljava/util/List;)V +METHOD|org.testng.xml.XmlClass.getName()Ljava/lang/String; +METHOD|org.testng.xml.XmlClass.setName(Ljava/lang/String;)V +METHOD|org.testng.xml.XmlClass.toString()Ljava/lang/String; +METHOD|org.testng.xml.XmlClass.toXml(Ljava/lang/String;)Ljava/lang/String; +METHOD|org.testng.xml.XmlClass.clone()Ljava/lang/Object; +METHOD|org.testng.xml.XmlMethodSelector.()V +METHOD|org.testng.xml.XmlMethodSelector.getClassName()Ljava/lang/String; +METHOD|org.testng.xml.XmlMethodSelector.setName(Ljava/lang/String;)V +METHOD|org.testng.xml.XmlMethodSelector.getExpression()Ljava/lang/String; +METHOD|org.testng.xml.XmlMethodSelector.setExpression(Ljava/lang/String;)V +METHOD|org.testng.xml.XmlMethodSelector.getLanguage()Ljava/lang/String; +METHOD|org.testng.xml.XmlMethodSelector.setLanguage(Ljava/lang/String;)V +METHOD|org.testng.xml.XmlMethodSelector.getPriority()I +METHOD|org.testng.xml.XmlMethodSelector.setPriority(I)V +METHOD|org.testng.xml.XmlMethodSelector.toXml(Ljava/lang/String;)Ljava/lang/String; +METHOD|org.testng.xml.XmlPackage.()V +METHOD|org.testng.xml.XmlPackage.getExclude()Ljava/util/List; +METHOD|org.testng.xml.XmlPackage.setExclude(Ljava/util/List;)V +METHOD|org.testng.xml.XmlPackage.getInclude()Ljava/util/List; +METHOD|org.testng.xml.XmlPackage.setInclude(Ljava/util/List;)V +METHOD|org.testng.xml.XmlPackage.getName()Ljava/lang/String; +METHOD|org.testng.xml.XmlPackage.setName(Ljava/lang/String;)V +METHOD|org.testng.xml.XmlPackage.getXmlClasses()Ljava/util/List; +METHOD|org.testng.xml.XmlPackage.initializeXmlClasses()Ljava/util/List; +METHOD|org.testng.xml.XmlPackage.toXml(Ljava/lang/String;)Ljava/lang/Object; +METHOD|org.testng.xml.XmlSuite.()V +METHOD|org.testng.xml.XmlSuite.getFileName()Ljava/lang/String; +METHOD|org.testng.xml.XmlSuite.setFileName(Ljava/lang/String;)V +METHOD|org.testng.xml.XmlSuite.isParallel()Z +METHOD|org.testng.xml.XmlSuite.setParallel(Z)V +METHOD|org.testng.xml.XmlSuite.getVerbose()Ljava/lang/Integer; +METHOD|org.testng.xml.XmlSuite.setVerbose(Ljava/lang/Integer;)V +METHOD|org.testng.xml.XmlSuite.getName()Ljava/lang/String; +METHOD|org.testng.xml.XmlSuite.setName(Ljava/lang/String;)V +METHOD|org.testng.xml.XmlSuite.getTest()Ljava/lang/String; +METHOD|org.testng.xml.XmlSuite.getTests()Ljava/util/List; +METHOD|org.testng.xml.XmlSuite.getMethodSelectors()Ljava/util/List; +METHOD|org.testng.xml.XmlSuite.setMethodSelectors(Ljava/util/List;)V +METHOD|org.testng.xml.XmlSuite.setBeanShellExpression(Ljava/lang/String;)V +METHOD|org.testng.xml.XmlSuite.getExpression()Ljava/lang/String; +METHOD|org.testng.xml.XmlSuite.getBeanShellExpression()Ljava/lang/String; +METHOD|org.testng.xml.XmlSuite.setParameters(Ljava/util/Map;)V +METHOD|org.testng.xml.XmlSuite.getParameters()Ljava/util/Map; +METHOD|org.testng.xml.XmlSuite.getAllParameters()Ljava/util/Map; +METHOD|org.testng.xml.XmlSuite.getParameter(Ljava/lang/String;)Ljava/lang/String; +METHOD|org.testng.xml.XmlSuite.getThreadCount()I +METHOD|org.testng.xml.XmlSuite.setThreadCount(I)V +METHOD|org.testng.xml.XmlSuite.getAnnotations()Ljava/lang/String; +METHOD|org.testng.xml.XmlSuite.setAnnotations(Ljava/lang/String;)V +METHOD|org.testng.xml.XmlSuite.isJUnit()Ljava/lang/Boolean; +METHOD|org.testng.xml.XmlSuite.setJUnit(Ljava/lang/Boolean;)V +METHOD|org.testng.xml.XmlSuite.setXmlPackages(Ljava/util/List;)V +METHOD|org.testng.xml.XmlSuite.getXmlPackages()Ljava/util/List; +METHOD|org.testng.xml.XmlSuite.toXml()Ljava/lang/String; +METHOD|org.testng.xml.XmlSuite.toString()Ljava/lang/String; +METHOD|org.testng.xml.XmlSuite.ppp(Ljava/lang/String;)V +METHOD|org.testng.xml.XmlSuite.clone()Ljava/lang/Object; +METHOD|org.testng.xml.XmlTest.(Lorg/testng/xml/XmlSuite;)V +METHOD|org.testng.xml.XmlTest.setXmlPackages(Ljava/util/List;)V +METHOD|org.testng.xml.XmlTest.getXmlPackages()Ljava/util/List; +METHOD|org.testng.xml.XmlTest.getMethodSelectors()Ljava/util/List; +METHOD|org.testng.xml.XmlTest.setMethodSelectors(Ljava/util/List;)V +METHOD|org.testng.xml.XmlTest.getSuite()Lorg/testng/xml/XmlSuite; +METHOD|org.testng.xml.XmlTest.getIncludedGroups()Ljava/util/List; +METHOD|org.testng.xml.XmlTest.setClassNames(Ljava/util/List;)V +METHOD|org.testng.xml.XmlTest.getXmlClasses()Ljava/util/List; +METHOD|org.testng.xml.XmlTest.setXmlClasses(Ljava/util/List;)V +METHOD|org.testng.xml.XmlTest.getName()Ljava/lang/String; +METHOD|org.testng.xml.XmlTest.setName(Ljava/lang/String;)V +METHOD|org.testng.xml.XmlTest.setVerbose(I)V +METHOD|org.testng.xml.XmlTest.setIncludedGroups(Ljava/util/List;)V +METHOD|org.testng.xml.XmlTest.setExcludedGroups(Ljava/util/List;)V +METHOD|org.testng.xml.XmlTest.getExcludedGroups()Ljava/util/List; +METHOD|org.testng.xml.XmlTest.getVerbose()I +METHOD|org.testng.xml.XmlTest.isJUnit()Z +METHOD|org.testng.xml.XmlTest.setJUnit(Z)V +METHOD|org.testng.xml.XmlTest.addMetaGroup(Ljava/lang/String;Ljava/util/List;)V +METHOD|org.testng.xml.XmlTest.getMetaGroups()Ljava/util/Map; +METHOD|org.testng.xml.XmlTest.setParameters(Ljava/util/Map;)V +METHOD|org.testng.xml.XmlTest.addParameter(Ljava/lang/String;Ljava/lang/String;)V +METHOD|org.testng.xml.XmlTest.getParameter(Ljava/lang/String;)Ljava/lang/String; +METHOD|org.testng.xml.XmlTest.getParameters()Ljava/util/Map; +METHOD|org.testng.xml.XmlTest.setParallel(Z)V +METHOD|org.testng.xml.XmlTest.isParallel()Z +METHOD|org.testng.xml.XmlTest.getAnnotations()Ljava/lang/String; +METHOD|org.testng.xml.XmlTest.setAnnotations(Ljava/lang/String;)V +METHOD|org.testng.xml.XmlTest.setBeanShellExpression(Ljava/lang/String;)V +METHOD|org.testng.xml.XmlTest.getExpression()Ljava/lang/String; +METHOD|org.testng.xml.XmlTest.toXml(Ljava/lang/String;)Ljava/lang/String; +METHOD|org.testng.xml.XmlTest.toString()Ljava/lang/String; +METHOD|org.testng.xml.XmlTest.ppp(Ljava/lang/String;)V +METHOD|org.testng.xml.XmlTest.clone()Ljava/lang/Object; +FILE|META-INF/ +FILE|META-INF/LICENSE.txt +FILE|META-INF/MANIFEST.MF +FILE|bsh/ +FILE|bsh/BSHAllocationExpression.class +FILE|bsh/BSHAmbiguousName.class +FILE|bsh/BSHArguments.class +FILE|bsh/BSHArrayDimensions.class +FILE|bsh/BSHArrayInitializer.class +FILE|bsh/BSHAssignment.class +FILE|bsh/BSHBinaryExpression.class +FILE|bsh/BSHBlock$NodeFilter.class +FILE|bsh/BSHBlock.class +FILE|bsh/BSHCastExpression.class +FILE|bsh/BSHClassDeclaration.class +FILE|bsh/BSHEnhancedForStatement.class +FILE|bsh/BSHForStatement.class +FILE|bsh/BSHFormalComment.class +FILE|bsh/BSHFormalParameter.class +FILE|bsh/BSHFormalParameters.class +FILE|bsh/BSHIfStatement.class +FILE|bsh/BSHImportDeclaration.class +FILE|bsh/BSHLiteral.class +FILE|bsh/BSHMethodDeclaration.class +FILE|bsh/BSHMethodInvocation.class +FILE|bsh/BSHPackageDeclaration.class +FILE|bsh/BSHPrimaryExpression.class +FILE|bsh/BSHPrimarySuffix.class +FILE|bsh/BSHPrimitiveType.class +FILE|bsh/BSHReturnStatement.class +FILE|bsh/BSHReturnType.class +FILE|bsh/BSHStatementExpressionList.class +FILE|bsh/BSHSwitchLabel.class +FILE|bsh/BSHSwitchStatement.class +FILE|bsh/BSHTernaryExpression.class +FILE|bsh/BSHThrowStatement.class +FILE|bsh/BSHTryStatement.class +FILE|bsh/BSHType.class +FILE|bsh/BSHTypedVariableDeclaration.class +FILE|bsh/BSHUnaryExpression.class +FILE|bsh/BSHVariableDeclarator.class +FILE|bsh/BSHWhileStatement.class +FILE|bsh/BlockNameSpace.class +FILE|bsh/BshClassManager$Listener.class +FILE|bsh/BshClassManager$SignatureKey.class +FILE|bsh/BshClassManager.class +FILE|bsh/BshIterator.class +FILE|bsh/BshMethod.class +FILE|bsh/CallStack.class +FILE|bsh/Capabilities$Unavailable.class +FILE|bsh/Capabilities.class +FILE|bsh/ClassGenerator.class +FILE|bsh/ClassGeneratorImpl$ClassNodeFilter.class +FILE|bsh/ClassGeneratorImpl.class +FILE|bsh/ClassGeneratorUtil$ConstructorArgs.class +FILE|bsh/ClassGeneratorUtil.class +FILE|bsh/ClassIdentifier.class +FILE|bsh/ClassPathException.class +FILE|bsh/CollectionManager$1.class +FILE|bsh/CollectionManager$BasicBshIterator.class +FILE|bsh/CollectionManager.class +FILE|bsh/CommandLineReader.class +FILE|bsh/Console.class +FILE|bsh/ConsoleInterface.class +FILE|bsh/DelayedEvalBshMethod.class +FILE|bsh/EvalError.class +FILE|bsh/ExternalNameSpace.class +FILE|bsh/Interpreter$1.class +FILE|bsh/Interpreter.class +FILE|bsh/InterpreterError.class +FILE|bsh/JJTParserState.class +FILE|bsh/JavaCharStream.class +FILE|bsh/LHS.class +FILE|bsh/Modifiers.class +FILE|bsh/Name.class +FILE|bsh/NameSource$Listener.class +FILE|bsh/NameSource.class +FILE|bsh/NameSpace.class +FILE|bsh/Node.class +FILE|bsh/ParseException.class +FILE|bsh/Parser$1.class +FILE|bsh/Parser$LookaheadSuccess.class +FILE|bsh/Parser.class +FILE|bsh/ParserConstants.class +FILE|bsh/ParserTokenManager.class +FILE|bsh/ParserTreeConstants.class +FILE|bsh/Primitive$Special.class +FILE|bsh/Primitive.class +FILE|bsh/Reflect.class +FILE|bsh/ReflectError.class +FILE|bsh/ReflectManager.class +FILE|bsh/Remote.class +FILE|bsh/ReturnControl.class +FILE|bsh/SimpleNode$1.class +FILE|bsh/SimpleNode.class +FILE|bsh/StringUtil.class +FILE|bsh/TargetError.class +FILE|bsh/This.class +FILE|bsh/Token.class +FILE|bsh/TokenMgrError.class +FILE|bsh/Types.class +FILE|bsh/UtilEvalError.class +FILE|bsh/UtilTargetError.class +FILE|bsh/Variable.class +FILE|bsh/XThis$Handler.class +FILE|bsh/XThis.class +FILE|bsh/classpath/ +FILE|bsh/classpath/BshClassLoader.class +FILE|bsh/classpath/BshClassPath$AmbiguousName.class +FILE|bsh/classpath/BshClassPath$ClassSource.class +FILE|bsh/classpath/BshClassPath$DirClassSource.class +FILE|bsh/classpath/BshClassPath$GeneratedClassSource.class +FILE|bsh/classpath/BshClassPath$JarClassSource.class +FILE|bsh/classpath/BshClassPath$MappingFeedback.class +FILE|bsh/classpath/BshClassPath$UnqualifiedNameTable.class +FILE|bsh/classpath/BshClassPath.class +FILE|bsh/classpath/ClassManagerImpl.class +FILE|bsh/classpath/ClassPathListener.class +FILE|bsh/classpath/DiscreteFilesClassLoader$ClassSourceMap.class +FILE|bsh/classpath/DiscreteFilesClassLoader.class +FILE|bsh/collection/ +FILE|bsh/collection/CollectionIterator.class +FILE|bsh/collection/CollectionManagerImpl.class +FILE|bsh/commands/ +FILE|bsh/commands/addClassPath.bsh +FILE|bsh/commands/bg.bsh +FILE|bsh/commands/bind.bsh +FILE|bsh/commands/browseClass.bsh +FILE|bsh/commands/cat.bsh +FILE|bsh/commands/cd.bsh +FILE|bsh/commands/classBrowser.bsh +FILE|bsh/commands/clear.bsh +FILE|bsh/commands/cp.bsh +FILE|bsh/commands/debug.bsh +FILE|bsh/commands/desktop.bsh +FILE|bsh/commands/dir.class +FILE|bsh/commands/dirname.bsh +FILE|bsh/commands/editor.bsh +FILE|bsh/commands/error.bsh +FILE|bsh/commands/eval.bsh +FILE|bsh/commands/exec.bsh +FILE|bsh/commands/exit.bsh +FILE|bsh/commands/extend.bsh +FILE|bsh/commands/fontMenu.bsh +FILE|bsh/commands/frame.bsh +FILE|bsh/commands/getBshPrompt.bsh +FILE|bsh/commands/getClass.bsh +FILE|bsh/commands/getClassPath.bsh +FILE|bsh/commands/getResource.bsh +FILE|bsh/commands/getSourceFileInfo.bsh +FILE|bsh/commands/importCommands.bsh +FILE|bsh/commands/importObject.bsh +FILE|bsh/commands/javap.bsh +FILE|bsh/commands/load.bsh +FILE|bsh/commands/makeWorkspace.bsh +FILE|bsh/commands/mv.bsh +FILE|bsh/commands/object.bsh +FILE|bsh/commands/pathToFile.bsh +FILE|bsh/commands/print.bsh +FILE|bsh/commands/printBanner.bsh +FILE|bsh/commands/pwd.bsh +FILE|bsh/commands/reloadClasses.bsh +FILE|bsh/commands/rm.bsh +FILE|bsh/commands/run.bsh +FILE|bsh/commands/save.bsh +FILE|bsh/commands/server.bsh +FILE|bsh/commands/setAccessibility.bsh +FILE|bsh/commands/setClassPath.bsh +FILE|bsh/commands/setFont.bsh +FILE|bsh/commands/setNameCompletion.bsh +FILE|bsh/commands/setNameSpace.bsh +FILE|bsh/commands/setStrictJava.bsh +FILE|bsh/commands/show.bsh +FILE|bsh/commands/source.bsh +FILE|bsh/commands/sourceRelative.bsh +FILE|bsh/commands/thinBorder.bsh +FILE|bsh/commands/unset.bsh +FILE|bsh/commands/which.bsh +FILE|bsh/commands/workspaceEditor.bsh +FILE|bsh/org/ +FILE|bsh/org/objectweb/ +FILE|bsh/org/objectweb/asm/ +FILE|bsh/org/objectweb/asm/ByteVector.class +FILE|bsh/org/objectweb/asm/ClassVisitor.class +FILE|bsh/org/objectweb/asm/ClassWriter.class +FILE|bsh/org/objectweb/asm/CodeVisitor.class +FILE|bsh/org/objectweb/asm/CodeWriter.class +FILE|bsh/org/objectweb/asm/Constants.class +FILE|bsh/org/objectweb/asm/Edge.class +FILE|bsh/org/objectweb/asm/Item.class +FILE|bsh/org/objectweb/asm/Label.class +FILE|bsh/org/objectweb/asm/Type.class +FILE|bsh/reflect/ +FILE|bsh/reflect/ReflectManagerImpl.class +FILE|bsh/servlet/ +FILE|bsh/servlet/BshServlet.class +FILE|bsh/servlet/SimpleTemplate.class +FILE|bsh/servlet/error.template +FILE|bsh/servlet/getVersion.bsh +FILE|bsh/servlet/page.template +FILE|bsh/servlet/result.template +FILE|bsh/util/ +FILE|bsh/util/AWTConsole$1.class +FILE|bsh/util/AWTConsole.class +FILE|bsh/util/AWTDemoApplet.class +FILE|bsh/util/AWTRemoteApplet.class +FILE|bsh/util/BeanShellBSFEngine.class +FILE|bsh/util/BshCanvas.class +FILE|bsh/util/ClassBrowser$1.class +FILE|bsh/util/ClassBrowser$2.class +FILE|bsh/util/ClassBrowser$PackageTree.class +FILE|bsh/util/ClassBrowser.class +FILE|bsh/util/GUIConsoleInterface.class +FILE|bsh/util/Httpd.class +FILE|bsh/util/HttpdConnection.class +FILE|bsh/util/JConsole$1.class +FILE|bsh/util/JConsole$2.class +FILE|bsh/util/JConsole$3.class +FILE|bsh/util/JConsole$4.class +FILE|bsh/util/JConsole$5.class +FILE|bsh/util/JConsole$BlockingPipedInputStream.class +FILE|bsh/util/JConsole.class +FILE|bsh/util/JDemoApplet.class +FILE|bsh/util/JRemoteApplet.class +FILE|bsh/util/NameCompletion.class +FILE|bsh/util/NameCompletionTable.class +FILE|bsh/util/Sessiond.class +FILE|bsh/util/SessiondConnection.class +FILE|bsh/util/Util.class +FILE|bsh/util/lib/ +FILE|bsh/util/lib/awtconsole.html +FILE|bsh/util/lib/eye.jpg +FILE|bsh/util/lib/icon.gif +FILE|bsh/util/lib/jconsole.html +FILE|bsh/util/lib/remote.html +FILE|bsh/util/lib/script.gif +FILE|bsh/util/lib/small_bean_shell.gif +FILE|bsh/util/lib/splash.gif +FILE|bsh/util/lib/workspace.gif +FILE|com/ +FILE|com/beust/ +FILE|com/beust/testng/ +FILE|com/beust/testng/TestNG.class +FILE|com/beust/testng/TestNGAntTask.class +FILE|com/thoughtworks/ +FILE|com/thoughtworks/qdox/ +FILE|com/thoughtworks/qdox/JavaDocBuilder$1.class +FILE|com/thoughtworks/qdox/JavaDocBuilder.class +FILE|com/thoughtworks/qdox/Searcher.class +FILE|com/thoughtworks/qdox/ant/ +FILE|com/thoughtworks/qdox/ant/AbstractQdoxTask.class +FILE|com/thoughtworks/qdox/directorywalker/ +FILE|com/thoughtworks/qdox/directorywalker/DirectoryScanner$1.class +FILE|com/thoughtworks/qdox/directorywalker/DirectoryScanner.class +FILE|com/thoughtworks/qdox/directorywalker/FileVisitor.class +FILE|com/thoughtworks/qdox/directorywalker/Filter.class +FILE|com/thoughtworks/qdox/directorywalker/SuffixFilter.class +FILE|com/thoughtworks/qdox/junit/ +FILE|com/thoughtworks/qdox/junit/APITestCase$1.class +FILE|com/thoughtworks/qdox/junit/APITestCase.class +FILE|com/thoughtworks/qdox/model/ +FILE|com/thoughtworks/qdox/model/AbstractInheritableJavaEntity.class +FILE|com/thoughtworks/qdox/model/AbstractJavaEntity.class +FILE|com/thoughtworks/qdox/model/BeanProperty.class +FILE|com/thoughtworks/qdox/model/ClassLibrary.class +FILE|com/thoughtworks/qdox/model/DefaultDocletTag.class +FILE|com/thoughtworks/qdox/model/DefaultDocletTagFactory.class +FILE|com/thoughtworks/qdox/model/DocletTag.class +FILE|com/thoughtworks/qdox/model/DocletTagFactory.class +FILE|com/thoughtworks/qdox/model/IndentBuffer.class +FILE|com/thoughtworks/qdox/model/JavaClass.class +FILE|com/thoughtworks/qdox/model/JavaClassCache.class +FILE|com/thoughtworks/qdox/model/JavaClassParent.class +FILE|com/thoughtworks/qdox/model/JavaField.class +FILE|com/thoughtworks/qdox/model/JavaMethod.class +FILE|com/thoughtworks/qdox/model/JavaParameter.class +FILE|com/thoughtworks/qdox/model/JavaSource.class +FILE|com/thoughtworks/qdox/model/Member.class +FILE|com/thoughtworks/qdox/model/ModelBuilder.class +FILE|com/thoughtworks/qdox/model/Type.class +FILE|com/thoughtworks/qdox/model/util/ +FILE|com/thoughtworks/qdox/model/util/TagParser.class +FILE|com/thoughtworks/qdox/parser/ +FILE|com/thoughtworks/qdox/parser/Builder.class +FILE|com/thoughtworks/qdox/parser/Lexer.class +FILE|com/thoughtworks/qdox/parser/ParseException.class +FILE|com/thoughtworks/qdox/parser/impl/ +FILE|com/thoughtworks/qdox/parser/impl/JFlexLexer.class +FILE|com/thoughtworks/qdox/parser/impl/Parser$1.class +FILE|com/thoughtworks/qdox/parser/impl/Parser$Value.class +FILE|com/thoughtworks/qdox/parser/impl/Parser.class +FILE|com/thoughtworks/qdox/parser/structs/ +FILE|com/thoughtworks/qdox/parser/structs/ClassDef.class +FILE|com/thoughtworks/qdox/parser/structs/FieldDef.class +FILE|com/thoughtworks/qdox/parser/structs/LocatedDef.class +FILE|com/thoughtworks/qdox/parser/structs/MethodDef.class +FILE|com/thoughtworks/qdox/parser/structs/TagDef.class +FILE|com/thoughtworks/qdox/parser/structs/TypeDef.class +FILE|org/ +FILE|org/testng/ +FILE|org/testng/Assert.class +FILE|org/testng/AssertJUnit.class +FILE|org/testng/ClassMethodMap.class +FILE|org/testng/IClass.class +FILE|org/testng/IExtraOutput.class +FILE|org/testng/IHookCallBack.class +FILE|org/testng/IHookable.class +FILE|org/testng/IInstanceInfo.class +FILE|org/testng/IMethodSelector.class +FILE|org/testng/IReporter.class +FILE|org/testng/IResultMap.class +FILE|org/testng/ISuite.class +FILE|org/testng/ISuiteListener.class +FILE|org/testng/ISuiteResult.class +FILE|org/testng/ITest.class +FILE|org/testng/ITestClass.class +FILE|org/testng/ITestClassFinder.class +FILE|org/testng/ITestContext.class +FILE|org/testng/ITestListener.class +FILE|org/testng/ITestMethodFinder.class +FILE|org/testng/ITestNGMethod.class +FILE|org/testng/ITestResult.class +FILE|org/testng/ITestRunnerFactory.class +FILE|org/testng/JUnitConverter.class +FILE|org/testng/JUnitConverterTask.class +FILE|org/testng/Reporter.class +FILE|org/testng/SuiteResult$1.class +FILE|org/testng/SuiteResult.class +FILE|org/testng/SuiteRunner$DefaultTestRunnerFactory.class +FILE|org/testng/SuiteRunner$ProxyTestRunnerFactory.class +FILE|org/testng/SuiteRunner.class +FILE|org/testng/TestClass.class +FILE|org/testng/TestException.class +FILE|org/testng/TestListenerAdapter.class +FILE|org/testng/TestNG.class +FILE|org/testng/TestNGAntTask.class +FILE|org/testng/TestNGCommandLineArgs.class +FILE|org/testng/TestNGException.class +FILE|org/testng/TestRunner.class +FILE|org/testng/annotations/ +FILE|org/testng/annotations/AfterClass.class +FILE|org/testng/annotations/AfterGroups.class +FILE|org/testng/annotations/AfterMethod.class +FILE|org/testng/annotations/AfterSuite.class +FILE|org/testng/annotations/AfterTest.class +FILE|org/testng/annotations/BeforeClass.class +FILE|org/testng/annotations/BeforeGroups.class +FILE|org/testng/annotations/BeforeMethod.class +FILE|org/testng/annotations/BeforeSuite.class +FILE|org/testng/annotations/BeforeTest.class +FILE|org/testng/annotations/Configuration.class +FILE|org/testng/annotations/DataProvider.class +FILE|org/testng/annotations/ExpectedExceptions.class +FILE|org/testng/annotations/Factory.class +FILE|org/testng/annotations/Parameters.class +FILE|org/testng/annotations/Test.class +FILE|org/testng/internal/ +FILE|org/testng/internal/ArrayIterator.class +FILE|org/testng/internal/BaseClassFinder.class +FILE|org/testng/internal/BaseTestMethod$1.class +FILE|org/testng/internal/BaseTestMethod.class +FILE|org/testng/internal/ClassHelper.class +FILE|org/testng/internal/ClassImpl.class +FILE|org/testng/internal/ConfigurationGroupMethods.class +FILE|org/testng/internal/ConfigurationMethod.class +FILE|org/testng/internal/Constants.class +FILE|org/testng/internal/ExtraOutput.class +FILE|org/testng/internal/FactoryMethod.class +FILE|org/testng/internal/Graph$Node.class +FILE|org/testng/internal/Graph.class +FILE|org/testng/internal/HostFile.class +FILE|org/testng/internal/IInvoker.class +FILE|org/testng/internal/ITestResultNotifier.class +FILE|org/testng/internal/InstanceInfo.class +FILE|org/testng/internal/InvokeMethodRunnable$TestNGRuntimeException.class +FILE|org/testng/internal/InvokeMethodRunnable.class +FILE|org/testng/internal/InvokedMethod.class +FILE|org/testng/internal/Invoker$1.class +FILE|org/testng/internal/Invoker.class +FILE|org/testng/internal/JUnitUtils.class +FILE|org/testng/internal/MethodHelper.class +FILE|org/testng/internal/MethodInheritance.class +FILE|org/testng/internal/MethodSelectorDescriptor.class +FILE|org/testng/internal/PackageUtils$1.class +FILE|org/testng/internal/PackageUtils.class +FILE|org/testng/internal/Parameters.class +FILE|org/testng/internal/ResultMap.class +FILE|org/testng/internal/RunInfo.class +FILE|org/testng/internal/TestMethodWorker.class +FILE|org/testng/internal/TestNGClassFinder.class +FILE|org/testng/internal/TestNGMethod$1.class +FILE|org/testng/internal/TestNGMethod.class +FILE|org/testng/internal/TestNGMethodFinder.class +FILE|org/testng/internal/TestNGProperty.class +FILE|org/testng/internal/TestResult.class +FILE|org/testng/internal/Utils.class +FILE|org/testng/internal/XmlMethodSelector.class +FILE|org/testng/internal/annotations/ +FILE|org/testng/internal/annotations/AfterSuiteAnnotation.class +FILE|org/testng/internal/annotations/AnnotationConfiguration.class +FILE|org/testng/internal/annotations/AnnotationHelper.class +FILE|org/testng/internal/annotations/BaseBeforeAfter.class +FILE|org/testng/internal/annotations/BeforeSuiteAnnotation.class +FILE|org/testng/internal/annotations/ConfigurationAnnotation.class +FILE|org/testng/internal/annotations/Converter.class +FILE|org/testng/internal/annotations/DataProviderAnnotation.class +FILE|org/testng/internal/annotations/ExpectedExceptionsAnnotation.class +FILE|org/testng/internal/annotations/FactoryAnnotation.class +FILE|org/testng/internal/annotations/IAfterClass.class +FILE|org/testng/internal/annotations/IAfterGroups.class +FILE|org/testng/internal/annotations/IAfterMethod.class +FILE|org/testng/internal/annotations/IAfterSuite.class +FILE|org/testng/internal/annotations/IAfterTest.class +FILE|org/testng/internal/annotations/IAfterTests.class +FILE|org/testng/internal/annotations/IAnnotation.class +FILE|org/testng/internal/annotations/IAnnotationFinder.class +FILE|org/testng/internal/annotations/IBaseBeforeAfter.class +FILE|org/testng/internal/annotations/IBeforeClass.class +FILE|org/testng/internal/annotations/IBeforeGroups.class +FILE|org/testng/internal/annotations/IBeforeMethod.class +FILE|org/testng/internal/annotations/IBeforeSuite.class +FILE|org/testng/internal/annotations/IBeforeTest.class +FILE|org/testng/internal/annotations/IConfiguration.class +FILE|org/testng/internal/annotations/IDataProvider.class +FILE|org/testng/internal/annotations/IExpectedExceptions.class +FILE|org/testng/internal/annotations/IFactory.class +FILE|org/testng/internal/annotations/IParameterizable.class +FILE|org/testng/internal/annotations/IParameters.class +FILE|org/testng/internal/annotations/ITest.class +FILE|org/testng/internal/annotations/ITestOrConfiguration.class +FILE|org/testng/internal/annotations/JDK14AnnotationFinder$1.class +FILE|org/testng/internal/annotations/JDK14AnnotationFinder.class +FILE|org/testng/internal/annotations/JDK14TagFactory.class +FILE|org/testng/internal/annotations/JDK15AnnotationFinder.class +FILE|org/testng/internal/annotations/JDK15TagFactory.class +FILE|org/testng/internal/annotations/ParametersAnnotation.class +FILE|org/testng/internal/annotations/TestAnnotation.class +FILE|org/testng/internal/annotations/TestOrConfiguration.class +FILE|org/testng/internal/remote/ +FILE|org/testng/internal/remote/SlavePool.class +FILE|org/testng/internal/thread/ +FILE|org/testng/internal/thread/CountDownAdapter.class +FILE|org/testng/internal/thread/ExecutorAdapter.class +FILE|org/testng/internal/thread/FutureResultAdapter.class +FILE|org/testng/internal/thread/ICountDown.class +FILE|org/testng/internal/thread/IExecutor.class +FILE|org/testng/internal/thread/IFutureResult.class +FILE|org/testng/internal/thread/IPooledExecutor.class +FILE|org/testng/internal/thread/IThreadFactory.class +FILE|org/testng/internal/thread/PooledExecutorAdapter.class +FILE|org/testng/internal/thread/TestNGThread.class +FILE|org/testng/internal/thread/ThreadExecutionException.class +FILE|org/testng/internal/thread/ThreadTimeoutException.class +FILE|org/testng/internal/thread/ThreadUtil$ThreadFactoryImpl.class +FILE|org/testng/internal/thread/ThreadUtil.class +FILE|org/testng/junit/ +FILE|org/testng/junit/INameFilter.class +FILE|org/testng/junit/JUnitClassFinder.class +FILE|org/testng/junit/JUnitDirectoryConverter.class +FILE|org/testng/junit/JUnitMethodFinder$1.class +FILE|org/testng/junit/JUnitMethodFinder$2.class +FILE|org/testng/junit/JUnitMethodFinder$3.class +FILE|org/testng/junit/JUnitMethodFinder.class +FILE|org/testng/junit/JUnitTestConverter.class +FILE|org/testng/log/ +FILE|org/testng/log/TextFormatter.class +FILE|org/testng/log4testng/ +FILE|org/testng/log4testng/Logger.class +FILE|org/testng/remote/ +FILE|org/testng/remote/ConnectionInfo.class +FILE|org/testng/remote/RemoteSuiteWorker.class +FILE|org/testng/remote/RemoteTestWorker.class +FILE|org/testng/remote/RemoteWorker.class +FILE|org/testng/remote/strprotocol/ +FILE|org/testng/remote/strprotocol/AbstractRemoteTestRunnerClient$ServerConnection.class +FILE|org/testng/remote/strprotocol/AbstractRemoteTestRunnerClient.class +FILE|org/testng/remote/strprotocol/GenericMessage.class +FILE|org/testng/remote/strprotocol/IMessage.class +FILE|org/testng/remote/strprotocol/IRemoteSuiteListener.class +FILE|org/testng/remote/strprotocol/IRemoteTestListener.class +FILE|org/testng/remote/strprotocol/IStringMessage.class +FILE|org/testng/remote/strprotocol/MessageHelper.class +FILE|org/testng/remote/strprotocol/RemoteMessageSenderTestListener.class +FILE|org/testng/remote/strprotocol/StringMessageSenderHelper$ReaderThread.class +FILE|org/testng/remote/strprotocol/StringMessageSenderHelper.class +FILE|org/testng/remote/strprotocol/SuiteMessage.class +FILE|org/testng/remote/strprotocol/TestMessage.class +FILE|org/testng/remote/strprotocol/TestResultMessage.class +FILE|org/testng/reporters/ +FILE|org/testng/reporters/DotTestListener.class +FILE|org/testng/reporters/ExitCodeListener.class +FILE|org/testng/reporters/FailedReporter.class +FILE|org/testng/reporters/HtmlHelper.class +FILE|org/testng/reporters/JUnitXMLReporter.class +FILE|org/testng/reporters/SuiteHTMLReporter$1.class +FILE|org/testng/reporters/SuiteHTMLReporter.class +FILE|org/testng/reporters/Tag.class +FILE|org/testng/reporters/TestHTMLReporter$1.class +FILE|org/testng/reporters/TestHTMLReporter.class +FILE|org/testng/reporters/TextReporter.class +FILE|org/testng/reporters/XMLConstants.class +FILE|org/testng/reporters/XMLReporter.class +FILE|org/testng/reporters/XMLStringBuffer.class +FILE|org/testng/reporters/XMLUtils.class +FILE|org/testng/xml/ +FILE|org/testng/xml/ClassSuite.class +FILE|org/testng/xml/LaunchSuite$1.class +FILE|org/testng/xml/LaunchSuite$ClassListSuite.class +FILE|org/testng/xml/LaunchSuite$CustomizedSuite.class +FILE|org/testng/xml/LaunchSuite$ExistingSuite.class +FILE|org/testng/xml/LaunchSuite$MethodsSuite.class +FILE|org/testng/xml/LaunchSuite.class +FILE|org/testng/xml/Parser.class +FILE|org/testng/xml/SuiteGenerator.class +FILE|org/testng/xml/TestNGContentHandler.class +FILE|org/testng/xml/XmlClass.class +FILE|org/testng/xml/XmlMethodSelector.class +FILE|org/testng/xml/XmlPackage.class +FILE|org/testng/xml/XmlSuite.class +FILE|org/testng/xml/XmlTest.class +FILE|testng-1.0.dtd +FILE|testng.css +FILE|testngtasks diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/artifact-dumps/wagon-provider-api-1.0-beta-3-20070209.213958-2.jar.txt b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/artifact-dumps/wagon-provider-api-1.0-beta-3-20070209.213958-2.jar.txt new file mode 100644 index 000000000..5365b6637 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/artifact-dumps/wagon-provider-api-1.0-beta-3-20070209.213958-2.jar.txt @@ -0,0 +1,435 @@ +FILENAME|wagon-provider-api-1.0-beta-3-20070209.213958-2.jar +SIZE|43527 +HASH_MD5|51e8109f78e663f11310f7df2790dbce +HASH_SHA1|7a8322eff673ed8f8d79b4676aca0d7d2004241d +HASH_BYTECODE|edde91be8d27eef6ee0da42147bb313af891871a +JDK|1.1 +CLASS|org.apache.maven.wagon.AbstractWagon +CLASS|org.apache.maven.wagon.CommandExecutionException +CLASS|org.apache.maven.wagon.CommandExecutor$1 +CLASS|org.apache.maven.wagon.CommandExecutor +CLASS|org.apache.maven.wagon.ConnectionException +CLASS|org.apache.maven.wagon.InputData +CLASS|org.apache.maven.wagon.LazyFileOutputStream +CLASS|org.apache.maven.wagon.OutputData +CLASS|org.apache.maven.wagon.PathUtils +CLASS|org.apache.maven.wagon.PermissionModeUtils +CLASS|org.apache.maven.wagon.ResourceDoesNotExistException +CLASS|org.apache.maven.wagon.StreamWagon +CLASS|org.apache.maven.wagon.Streams +CLASS|org.apache.maven.wagon.TransferFailedException +CLASS|org.apache.maven.wagon.UnsupportedProtocolException +CLASS|org.apache.maven.wagon.Wagon$1 +CLASS|org.apache.maven.wagon.Wagon +CLASS|org.apache.maven.wagon.WagonConstants +CLASS|org.apache.maven.wagon.WagonException +CLASS|org.apache.maven.wagon.WagonUtils +CLASS|org.apache.maven.wagon.authentication.AuthenticationException +CLASS|org.apache.maven.wagon.authentication.AuthenticationInfo +CLASS|org.apache.maven.wagon.authorization.AuthorizationException +CLASS|org.apache.maven.wagon.events.SessionEvent +CLASS|org.apache.maven.wagon.events.SessionEventSupport +CLASS|org.apache.maven.wagon.events.SessionListener +CLASS|org.apache.maven.wagon.events.TransferEvent +CLASS|org.apache.maven.wagon.events.TransferEventSupport +CLASS|org.apache.maven.wagon.events.TransferListener +CLASS|org.apache.maven.wagon.events.WagonEvent +CLASS|org.apache.maven.wagon.observers.AbstractTransferListener +CLASS|org.apache.maven.wagon.observers.ChecksumObserver +CLASS|org.apache.maven.wagon.observers.Debug +CLASS|org.apache.maven.wagon.proxy.ProxyInfo +CLASS|org.apache.maven.wagon.repository.Repository +CLASS|org.apache.maven.wagon.repository.RepositoryPermissions +CLASS|org.apache.maven.wagon.resource.Resource +METHOD|org.apache.maven.wagon.AbstractWagon.()V +METHOD|org.apache.maven.wagon.AbstractWagon.getRepository()Lorg/apache/maven/wagon/repository/Repository; +METHOD|org.apache.maven.wagon.AbstractWagon.setRepository(Lorg/apache/maven/wagon/repository/Repository;)V +METHOD|org.apache.maven.wagon.AbstractWagon.getProxyInfo()Lorg/apache/maven/wagon/proxy/ProxyInfo; +METHOD|org.apache.maven.wagon.AbstractWagon.setProxyInfo(Lorg/apache/maven/wagon/proxy/ProxyInfo;)V +METHOD|org.apache.maven.wagon.AbstractWagon.getAuthenticationInfo()Lorg/apache/maven/wagon/authentication/AuthenticationInfo; +METHOD|org.apache.maven.wagon.AbstractWagon.setAuthenticationInfo(Lorg/apache/maven/wagon/authentication/AuthenticationInfo;)V +METHOD|org.apache.maven.wagon.AbstractWagon.isConnected()Z +METHOD|org.apache.maven.wagon.AbstractWagon.openConnection()V +METHOD|org.apache.maven.wagon.AbstractWagon.connect()V +METHOD|org.apache.maven.wagon.AbstractWagon.connect(Lorg/apache/maven/wagon/repository/Repository;)V +METHOD|org.apache.maven.wagon.AbstractWagon.connect(Lorg/apache/maven/wagon/repository/Repository;Lorg/apache/maven/wagon/proxy/ProxyInfo;)V +METHOD|org.apache.maven.wagon.AbstractWagon.connect(Lorg/apache/maven/wagon/repository/Repository;Lorg/apache/maven/wagon/authentication/AuthenticationInfo;)V +METHOD|org.apache.maven.wagon.AbstractWagon.connect(Lorg/apache/maven/wagon/repository/Repository;Lorg/apache/maven/wagon/authentication/AuthenticationInfo;Lorg/apache/maven/wagon/proxy/ProxyInfo;)V +METHOD|org.apache.maven.wagon.AbstractWagon.disconnect()V +METHOD|org.apache.maven.wagon.AbstractWagon.closeConnection()V +METHOD|org.apache.maven.wagon.AbstractWagon.createParentDirectories(Ljava/io/File;)V +METHOD|org.apache.maven.wagon.AbstractWagon.getTransfer(Lorg/apache/maven/wagon/resource/Resource;Ljava/io/File;Ljava/io/InputStream;)V +METHOD|org.apache.maven.wagon.AbstractWagon.getTransfer(Lorg/apache/maven/wagon/resource/Resource;Ljava/io/File;Ljava/io/InputStream;ZI)V +METHOD|org.apache.maven.wagon.AbstractWagon.putTransfer(Lorg/apache/maven/wagon/resource/Resource;Ljava/io/File;Ljava/io/OutputStream;Z)V +METHOD|org.apache.maven.wagon.AbstractWagon.transfer(Lorg/apache/maven/wagon/resource/Resource;Ljava/io/File;Ljava/io/OutputStream;Z)V +METHOD|org.apache.maven.wagon.AbstractWagon.transfer(Lorg/apache/maven/wagon/resource/Resource;Ljava/io/InputStream;Ljava/io/OutputStream;I)V +METHOD|org.apache.maven.wagon.AbstractWagon.transfer(Lorg/apache/maven/wagon/resource/Resource;Ljava/io/InputStream;Ljava/io/OutputStream;II)V +METHOD|org.apache.maven.wagon.AbstractWagon.fireTransferProgress(Lorg/apache/maven/wagon/events/TransferEvent;[BI)V +METHOD|org.apache.maven.wagon.AbstractWagon.fireGetCompleted(Lorg/apache/maven/wagon/resource/Resource;Ljava/io/File;)V +METHOD|org.apache.maven.wagon.AbstractWagon.fireGetStarted(Lorg/apache/maven/wagon/resource/Resource;Ljava/io/File;)V +METHOD|org.apache.maven.wagon.AbstractWagon.fireGetInitiated(Lorg/apache/maven/wagon/resource/Resource;Ljava/io/File;)V +METHOD|org.apache.maven.wagon.AbstractWagon.firePutInitiated(Lorg/apache/maven/wagon/resource/Resource;Ljava/io/File;)V +METHOD|org.apache.maven.wagon.AbstractWagon.firePutCompleted(Lorg/apache/maven/wagon/resource/Resource;Ljava/io/File;)V +METHOD|org.apache.maven.wagon.AbstractWagon.firePutStarted(Lorg/apache/maven/wagon/resource/Resource;Ljava/io/File;)V +METHOD|org.apache.maven.wagon.AbstractWagon.fireSessionDisconnected()V +METHOD|org.apache.maven.wagon.AbstractWagon.fireSessionDisconnecting()V +METHOD|org.apache.maven.wagon.AbstractWagon.fireSessionLoggedIn()V +METHOD|org.apache.maven.wagon.AbstractWagon.fireSessionLoggedOff()V +METHOD|org.apache.maven.wagon.AbstractWagon.fireSessionOpened()V +METHOD|org.apache.maven.wagon.AbstractWagon.fireSessionOpening()V +METHOD|org.apache.maven.wagon.AbstractWagon.fireSessionConnectionRefused()V +METHOD|org.apache.maven.wagon.AbstractWagon.fireSessionError(Ljava/lang/Exception;)V +METHOD|org.apache.maven.wagon.AbstractWagon.fireTransferDebug(Ljava/lang/String;)V +METHOD|org.apache.maven.wagon.AbstractWagon.fireSessionDebug(Ljava/lang/String;)V +METHOD|org.apache.maven.wagon.AbstractWagon.hasTransferListener(Lorg/apache/maven/wagon/events/TransferListener;)Z +METHOD|org.apache.maven.wagon.AbstractWagon.addTransferListener(Lorg/apache/maven/wagon/events/TransferListener;)V +METHOD|org.apache.maven.wagon.AbstractWagon.removeTransferListener(Lorg/apache/maven/wagon/events/TransferListener;)V +METHOD|org.apache.maven.wagon.AbstractWagon.addSessionListener(Lorg/apache/maven/wagon/events/SessionListener;)V +METHOD|org.apache.maven.wagon.AbstractWagon.hasSessionListener(Lorg/apache/maven/wagon/events/SessionListener;)Z +METHOD|org.apache.maven.wagon.AbstractWagon.removeSessionListener(Lorg/apache/maven/wagon/events/SessionListener;)V +METHOD|org.apache.maven.wagon.AbstractWagon.fireTransferError(Lorg/apache/maven/wagon/resource/Resource;Ljava/lang/Exception;I)V +METHOD|org.apache.maven.wagon.AbstractWagon.getSessionEventSupport()Lorg/apache/maven/wagon/events/SessionEventSupport; +METHOD|org.apache.maven.wagon.AbstractWagon.setSessionEventSupport(Lorg/apache/maven/wagon/events/SessionEventSupport;)V +METHOD|org.apache.maven.wagon.AbstractWagon.getTransferEventSupport()Lorg/apache/maven/wagon/events/TransferEventSupport; +METHOD|org.apache.maven.wagon.AbstractWagon.setTransferEventSupport(Lorg/apache/maven/wagon/events/TransferEventSupport;)V +METHOD|org.apache.maven.wagon.AbstractWagon.postProcessListeners(Lorg/apache/maven/wagon/resource/Resource;Ljava/io/File;I)V +METHOD|org.apache.maven.wagon.AbstractWagon.putDirectory(Ljava/io/File;Ljava/lang/String;)V +METHOD|org.apache.maven.wagon.AbstractWagon.supportsDirectoryCopy()Z +METHOD|org.apache.maven.wagon.AbstractWagon.createZip(Ljava/util/List;Ljava/io/File;Ljava/io/File;)V +METHOD|org.apache.maven.wagon.AbstractWagon.writeZipEntry(Ljava/util/zip/ZipOutputStream;Ljava/io/File;Ljava/lang/String;)V +METHOD|org.apache.maven.wagon.AbstractWagon.getPath(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; +METHOD|org.apache.maven.wagon.AbstractWagon.isInteractive()Z +METHOD|org.apache.maven.wagon.AbstractWagon.setInteractive(Z)V +METHOD|org.apache.maven.wagon.AbstractWagon.getFileList(Ljava/lang/String;)Ljava/util/List; +METHOD|org.apache.maven.wagon.AbstractWagon.resourceExists(Ljava/lang/String;)Z +METHOD|org.apache.maven.wagon.AbstractWagon.getProtocol()Ljava/lang/String; +METHOD|org.apache.maven.wagon.AbstractWagon.put(Ljava/io/File;Ljava/lang/String;)V +METHOD|org.apache.maven.wagon.AbstractWagon.getIfNewer(Ljava/lang/String;Ljava/io/File;J)Z +METHOD|org.apache.maven.wagon.AbstractWagon.get(Ljava/lang/String;Ljava/io/File;)V +METHOD|org.apache.maven.wagon.CommandExecutionException.(Ljava/lang/String;)V +METHOD|org.apache.maven.wagon.CommandExecutionException.(Ljava/lang/String;Ljava/lang/Throwable;)V +METHOD|org.apache.maven.wagon.CommandExecutor$1.class$(Ljava/lang/String;)Ljava/lang/Class; +METHOD|org.apache.maven.wagon.CommandExecutor.executeCommand(Ljava/lang/String;)V +METHOD|org.apache.maven.wagon.CommandExecutor.executeCommand(Ljava/lang/String;Z)Lorg/apache/maven/wagon/Streams; +METHOD|org.apache.maven.wagon.CommandExecutor.()V +METHOD|org.apache.maven.wagon.ConnectionException.(Ljava/lang/String;)V +METHOD|org.apache.maven.wagon.ConnectionException.(Ljava/lang/String;Ljava/lang/Throwable;)V +METHOD|org.apache.maven.wagon.InputData.()V +METHOD|org.apache.maven.wagon.InputData.getInputStream()Ljava/io/InputStream; +METHOD|org.apache.maven.wagon.InputData.setInputStream(Ljava/io/InputStream;)V +METHOD|org.apache.maven.wagon.InputData.getResource()Lorg/apache/maven/wagon/resource/Resource; +METHOD|org.apache.maven.wagon.InputData.setResource(Lorg/apache/maven/wagon/resource/Resource;)V +METHOD|org.apache.maven.wagon.LazyFileOutputStream.(Ljava/lang/String;)V +METHOD|org.apache.maven.wagon.LazyFileOutputStream.(Ljava/io/File;)V +METHOD|org.apache.maven.wagon.LazyFileOutputStream.close()V +METHOD|org.apache.maven.wagon.LazyFileOutputStream.equals(Ljava/lang/Object;)Z +METHOD|org.apache.maven.wagon.LazyFileOutputStream.flush()V +METHOD|org.apache.maven.wagon.LazyFileOutputStream.getChannel()Ljava/nio/channels/FileChannel; +METHOD|org.apache.maven.wagon.LazyFileOutputStream.getFD()Ljava/io/FileDescriptor; +METHOD|org.apache.maven.wagon.LazyFileOutputStream.hashCode()I +METHOD|org.apache.maven.wagon.LazyFileOutputStream.toString()Ljava/lang/String; +METHOD|org.apache.maven.wagon.LazyFileOutputStream.write([B)V +METHOD|org.apache.maven.wagon.LazyFileOutputStream.write([BII)V +METHOD|org.apache.maven.wagon.LazyFileOutputStream.write(I)V +METHOD|org.apache.maven.wagon.LazyFileOutputStream.initialize()V +METHOD|org.apache.maven.wagon.OutputData.()V +METHOD|org.apache.maven.wagon.OutputData.getOutputStream()Ljava/io/OutputStream; +METHOD|org.apache.maven.wagon.OutputData.setOutputStream(Ljava/io/OutputStream;)V +METHOD|org.apache.maven.wagon.OutputData.getResource()Lorg/apache/maven/wagon/resource/Resource; +METHOD|org.apache.maven.wagon.OutputData.setResource(Lorg/apache/maven/wagon/resource/Resource;)V +METHOD|org.apache.maven.wagon.PathUtils.()V +METHOD|org.apache.maven.wagon.PathUtils.dirname(Ljava/lang/String;)Ljava/lang/String; +METHOD|org.apache.maven.wagon.PathUtils.filename(Ljava/lang/String;)Ljava/lang/String; +METHOD|org.apache.maven.wagon.PathUtils.dirnames(Ljava/lang/String;)[Ljava/lang/String; +METHOD|org.apache.maven.wagon.PathUtils.split(Ljava/lang/String;Ljava/lang/String;I)[Ljava/lang/String; +METHOD|org.apache.maven.wagon.PathUtils.host(Ljava/lang/String;)Ljava/lang/String; +METHOD|org.apache.maven.wagon.PathUtils.authorization(Ljava/lang/String;)Ljava/lang/String; +METHOD|org.apache.maven.wagon.PathUtils.protocol(Ljava/lang/String;)Ljava/lang/String; +METHOD|org.apache.maven.wagon.PathUtils.port(Ljava/lang/String;)I +METHOD|org.apache.maven.wagon.PathUtils.basedir(Ljava/lang/String;)Ljava/lang/String; +METHOD|org.apache.maven.wagon.PathUtils.user(Ljava/lang/String;)Ljava/lang/String; +METHOD|org.apache.maven.wagon.PathUtils.password(Ljava/lang/String;)Ljava/lang/String; +METHOD|org.apache.maven.wagon.PathUtils.toRelative(Ljava/io/File;Ljava/lang/String;)Ljava/lang/String; +METHOD|org.apache.maven.wagon.PermissionModeUtils.()V +METHOD|org.apache.maven.wagon.PermissionModeUtils.getUserMaskFor(Ljava/lang/String;)Ljava/lang/String; +METHOD|org.apache.maven.wagon.ResourceDoesNotExistException.(Ljava/lang/String;)V +METHOD|org.apache.maven.wagon.ResourceDoesNotExistException.(Ljava/lang/String;Ljava/lang/Throwable;)V +METHOD|org.apache.maven.wagon.StreamWagon.()V +METHOD|org.apache.maven.wagon.StreamWagon.fillInputData(Lorg/apache/maven/wagon/InputData;)V +METHOD|org.apache.maven.wagon.StreamWagon.fillOutputData(Lorg/apache/maven/wagon/OutputData;)V +METHOD|org.apache.maven.wagon.StreamWagon.openConnection()V +METHOD|org.apache.maven.wagon.StreamWagon.closeConnection()V +METHOD|org.apache.maven.wagon.StreamWagon.get(Ljava/lang/String;Ljava/io/File;)V +METHOD|org.apache.maven.wagon.StreamWagon.getIfNewer(Ljava/lang/String;Ljava/io/File;J)Z +METHOD|org.apache.maven.wagon.StreamWagon.put(Ljava/io/File;Ljava/lang/String;)V +METHOD|org.apache.maven.wagon.Streams.()V +METHOD|org.apache.maven.wagon.Streams.getOut()Ljava/lang/String; +METHOD|org.apache.maven.wagon.Streams.setOut(Ljava/lang/String;)V +METHOD|org.apache.maven.wagon.Streams.getErr()Ljava/lang/String; +METHOD|org.apache.maven.wagon.Streams.setErr(Ljava/lang/String;)V +METHOD|org.apache.maven.wagon.TransferFailedException.(Ljava/lang/String;)V +METHOD|org.apache.maven.wagon.TransferFailedException.(Ljava/lang/String;Ljava/lang/Throwable;)V +METHOD|org.apache.maven.wagon.UnsupportedProtocolException.(Ljava/lang/String;)V +METHOD|org.apache.maven.wagon.UnsupportedProtocolException.(Ljava/lang/String;Ljava/lang/Throwable;)V +METHOD|org.apache.maven.wagon.Wagon$1.class$(Ljava/lang/String;)Ljava/lang/Class; +METHOD|org.apache.maven.wagon.Wagon.get(Ljava/lang/String;Ljava/io/File;)V +METHOD|org.apache.maven.wagon.Wagon.getIfNewer(Ljava/lang/String;Ljava/io/File;J)Z +METHOD|org.apache.maven.wagon.Wagon.put(Ljava/io/File;Ljava/lang/String;)V +METHOD|org.apache.maven.wagon.Wagon.putDirectory(Ljava/io/File;Ljava/lang/String;)V +METHOD|org.apache.maven.wagon.Wagon.resourceExists(Ljava/lang/String;)Z +METHOD|org.apache.maven.wagon.Wagon.getFileList(Ljava/lang/String;)Ljava/util/List; +METHOD|org.apache.maven.wagon.Wagon.getProtocol()Ljava/lang/String; +METHOD|org.apache.maven.wagon.Wagon.supportsDirectoryCopy()Z +METHOD|org.apache.maven.wagon.Wagon.isInteractive()Z +METHOD|org.apache.maven.wagon.Wagon.setInteractive(Z)V +METHOD|org.apache.maven.wagon.Wagon.getRepository()Lorg/apache/maven/wagon/repository/Repository; +METHOD|org.apache.maven.wagon.Wagon.setRepository(Lorg/apache/maven/wagon/repository/Repository;)V +METHOD|org.apache.maven.wagon.Wagon.getAuthenticationInfo()Lorg/apache/maven/wagon/authentication/AuthenticationInfo; +METHOD|org.apache.maven.wagon.Wagon.setAuthenticationInfo(Lorg/apache/maven/wagon/authentication/AuthenticationInfo;)V +METHOD|org.apache.maven.wagon.Wagon.getProxyInfo()Lorg/apache/maven/wagon/proxy/ProxyInfo; +METHOD|org.apache.maven.wagon.Wagon.setProxyInfo(Lorg/apache/maven/wagon/proxy/ProxyInfo;)V +METHOD|org.apache.maven.wagon.Wagon.connect()V +METHOD|org.apache.maven.wagon.Wagon.isConnected()Z +METHOD|org.apache.maven.wagon.Wagon.connect(Lorg/apache/maven/wagon/repository/Repository;)V +METHOD|org.apache.maven.wagon.Wagon.connect(Lorg/apache/maven/wagon/repository/Repository;Lorg/apache/maven/wagon/proxy/ProxyInfo;)V +METHOD|org.apache.maven.wagon.Wagon.connect(Lorg/apache/maven/wagon/repository/Repository;Lorg/apache/maven/wagon/authentication/AuthenticationInfo;)V +METHOD|org.apache.maven.wagon.Wagon.connect(Lorg/apache/maven/wagon/repository/Repository;Lorg/apache/maven/wagon/authentication/AuthenticationInfo;Lorg/apache/maven/wagon/proxy/ProxyInfo;)V +METHOD|org.apache.maven.wagon.Wagon.disconnect()V +METHOD|org.apache.maven.wagon.Wagon.addSessionListener(Lorg/apache/maven/wagon/events/SessionListener;)V +METHOD|org.apache.maven.wagon.Wagon.removeSessionListener(Lorg/apache/maven/wagon/events/SessionListener;)V +METHOD|org.apache.maven.wagon.Wagon.hasSessionListener(Lorg/apache/maven/wagon/events/SessionListener;)Z +METHOD|org.apache.maven.wagon.Wagon.addTransferListener(Lorg/apache/maven/wagon/events/TransferListener;)V +METHOD|org.apache.maven.wagon.Wagon.removeTransferListener(Lorg/apache/maven/wagon/events/TransferListener;)V +METHOD|org.apache.maven.wagon.Wagon.hasTransferListener(Lorg/apache/maven/wagon/events/TransferListener;)Z +METHOD|org.apache.maven.wagon.Wagon.()V +METHOD|org.apache.maven.wagon.WagonConstants.()V +METHOD|org.apache.maven.wagon.WagonException.(Ljava/lang/String;Ljava/lang/Throwable;)V +METHOD|org.apache.maven.wagon.WagonException.(Ljava/lang/String;)V +METHOD|org.apache.maven.wagon.WagonException.getCause()Ljava/lang/Throwable; +METHOD|org.apache.maven.wagon.WagonException.initCause(Ljava/lang/Throwable;)Ljava/lang/Throwable; +METHOD|org.apache.maven.wagon.WagonUtils.()V +METHOD|org.apache.maven.wagon.WagonUtils.toString(Ljava/lang/String;Lorg/apache/maven/wagon/Wagon;)Ljava/lang/String; +METHOD|org.apache.maven.wagon.WagonUtils.putDirectory(Ljava/io/File;Lorg/apache/maven/wagon/Wagon;Z)V +METHOD|org.apache.maven.wagon.WagonUtils.getAuthInfo()Lorg/apache/maven/wagon/authentication/AuthenticationInfo; +METHOD|org.apache.maven.wagon.WagonUtils.getUserGroup()Ljava/lang/String; +METHOD|org.apache.maven.wagon.WagonUtils.getUserName()Ljava/lang/String; +METHOD|org.apache.maven.wagon.authentication.AuthenticationException.(Ljava/lang/String;)V +METHOD|org.apache.maven.wagon.authentication.AuthenticationException.(Ljava/lang/String;Ljava/lang/Throwable;)V +METHOD|org.apache.maven.wagon.authentication.AuthenticationInfo.()V +METHOD|org.apache.maven.wagon.authentication.AuthenticationInfo.getPassphrase()Ljava/lang/String; +METHOD|org.apache.maven.wagon.authentication.AuthenticationInfo.setPassphrase(Ljava/lang/String;)V +METHOD|org.apache.maven.wagon.authentication.AuthenticationInfo.getPrivateKey()Ljava/lang/String; +METHOD|org.apache.maven.wagon.authentication.AuthenticationInfo.setPrivateKey(Ljava/lang/String;)V +METHOD|org.apache.maven.wagon.authentication.AuthenticationInfo.getPassword()Ljava/lang/String; +METHOD|org.apache.maven.wagon.authentication.AuthenticationInfo.setPassword(Ljava/lang/String;)V +METHOD|org.apache.maven.wagon.authentication.AuthenticationInfo.getUserName()Ljava/lang/String; +METHOD|org.apache.maven.wagon.authentication.AuthenticationInfo.setUserName(Ljava/lang/String;)V +METHOD|org.apache.maven.wagon.authorization.AuthorizationException.(Ljava/lang/String;)V +METHOD|org.apache.maven.wagon.authorization.AuthorizationException.(Ljava/lang/String;Ljava/lang/Throwable;)V +METHOD|org.apache.maven.wagon.events.SessionEvent.(Lorg/apache/maven/wagon/Wagon;Lorg/apache/maven/wagon/repository/Repository;I)V +METHOD|org.apache.maven.wagon.events.SessionEvent.(Lorg/apache/maven/wagon/Wagon;Lorg/apache/maven/wagon/repository/Repository;Ljava/lang/Exception;)V +METHOD|org.apache.maven.wagon.events.SessionEvent.getEventType()I +METHOD|org.apache.maven.wagon.events.SessionEvent.getException()Ljava/lang/Exception; +METHOD|org.apache.maven.wagon.events.SessionEvent.setEventType(I)V +METHOD|org.apache.maven.wagon.events.SessionEvent.setException(Ljava/lang/Exception;)V +METHOD|org.apache.maven.wagon.events.SessionEvent.toString()Ljava/lang/String; +METHOD|org.apache.maven.wagon.events.SessionEventSupport.()V +METHOD|org.apache.maven.wagon.events.SessionEventSupport.addSessionListener(Lorg/apache/maven/wagon/events/SessionListener;)V +METHOD|org.apache.maven.wagon.events.SessionEventSupport.removeSessionListener(Lorg/apache/maven/wagon/events/SessionListener;)V +METHOD|org.apache.maven.wagon.events.SessionEventSupport.hasSessionListener(Lorg/apache/maven/wagon/events/SessionListener;)Z +METHOD|org.apache.maven.wagon.events.SessionEventSupport.fireSessionDisconnected(Lorg/apache/maven/wagon/events/SessionEvent;)V +METHOD|org.apache.maven.wagon.events.SessionEventSupport.fireSessionDisconnecting(Lorg/apache/maven/wagon/events/SessionEvent;)V +METHOD|org.apache.maven.wagon.events.SessionEventSupport.fireSessionLoggedIn(Lorg/apache/maven/wagon/events/SessionEvent;)V +METHOD|org.apache.maven.wagon.events.SessionEventSupport.fireSessionLoggedOff(Lorg/apache/maven/wagon/events/SessionEvent;)V +METHOD|org.apache.maven.wagon.events.SessionEventSupport.fireSessionOpened(Lorg/apache/maven/wagon/events/SessionEvent;)V +METHOD|org.apache.maven.wagon.events.SessionEventSupport.fireSessionOpening(Lorg/apache/maven/wagon/events/SessionEvent;)V +METHOD|org.apache.maven.wagon.events.SessionEventSupport.fireSessionConnectionRefused(Lorg/apache/maven/wagon/events/SessionEvent;)V +METHOD|org.apache.maven.wagon.events.SessionEventSupport.fireDebug(Ljava/lang/String;)V +METHOD|org.apache.maven.wagon.events.SessionEventSupport.fireSessionError(Lorg/apache/maven/wagon/events/SessionEvent;)V +METHOD|org.apache.maven.wagon.events.SessionListener.sessionOpening(Lorg/apache/maven/wagon/events/SessionEvent;)V +METHOD|org.apache.maven.wagon.events.SessionListener.sessionOpened(Lorg/apache/maven/wagon/events/SessionEvent;)V +METHOD|org.apache.maven.wagon.events.SessionListener.sessionDisconnecting(Lorg/apache/maven/wagon/events/SessionEvent;)V +METHOD|org.apache.maven.wagon.events.SessionListener.sessionDisconnected(Lorg/apache/maven/wagon/events/SessionEvent;)V +METHOD|org.apache.maven.wagon.events.SessionListener.sessionConnectionRefused(Lorg/apache/maven/wagon/events/SessionEvent;)V +METHOD|org.apache.maven.wagon.events.SessionListener.sessionLoggedIn(Lorg/apache/maven/wagon/events/SessionEvent;)V +METHOD|org.apache.maven.wagon.events.SessionListener.sessionLoggedOff(Lorg/apache/maven/wagon/events/SessionEvent;)V +METHOD|org.apache.maven.wagon.events.SessionListener.sessionError(Lorg/apache/maven/wagon/events/SessionEvent;)V +METHOD|org.apache.maven.wagon.events.SessionListener.debug(Ljava/lang/String;)V +METHOD|org.apache.maven.wagon.events.TransferEvent.(Lorg/apache/maven/wagon/Wagon;Lorg/apache/maven/wagon/repository/Repository;Lorg/apache/maven/wagon/resource/Resource;Ljava/lang/Exception;I)V +METHOD|org.apache.maven.wagon.events.TransferEvent.(Lorg/apache/maven/wagon/Wagon;Lorg/apache/maven/wagon/repository/Repository;Lorg/apache/maven/wagon/resource/Resource;II)V +METHOD|org.apache.maven.wagon.events.TransferEvent.getResource()Lorg/apache/maven/wagon/resource/Resource; +METHOD|org.apache.maven.wagon.events.TransferEvent.getException()Ljava/lang/Exception; +METHOD|org.apache.maven.wagon.events.TransferEvent.getRequestType()I +METHOD|org.apache.maven.wagon.events.TransferEvent.setRequestType(I)V +METHOD|org.apache.maven.wagon.events.TransferEvent.getEventType()I +METHOD|org.apache.maven.wagon.events.TransferEvent.setEventType(I)V +METHOD|org.apache.maven.wagon.events.TransferEvent.setResource(Lorg/apache/maven/wagon/resource/Resource;)V +METHOD|org.apache.maven.wagon.events.TransferEvent.getLocalFile()Ljava/io/File; +METHOD|org.apache.maven.wagon.events.TransferEvent.setLocalFile(Ljava/io/File;)V +METHOD|org.apache.maven.wagon.events.TransferEvent.toString()Ljava/lang/String; +METHOD|org.apache.maven.wagon.events.TransferEventSupport.()V +METHOD|org.apache.maven.wagon.events.TransferEventSupport.addTransferListener(Lorg/apache/maven/wagon/events/TransferListener;)V +METHOD|org.apache.maven.wagon.events.TransferEventSupport.removeTransferListener(Lorg/apache/maven/wagon/events/TransferListener;)V +METHOD|org.apache.maven.wagon.events.TransferEventSupport.hasTransferListener(Lorg/apache/maven/wagon/events/TransferListener;)Z +METHOD|org.apache.maven.wagon.events.TransferEventSupport.fireTransferStarted(Lorg/apache/maven/wagon/events/TransferEvent;)V +METHOD|org.apache.maven.wagon.events.TransferEventSupport.fireTransferProgress(Lorg/apache/maven/wagon/events/TransferEvent;[BI)V +METHOD|org.apache.maven.wagon.events.TransferEventSupport.fireTransferCompleted(Lorg/apache/maven/wagon/events/TransferEvent;)V +METHOD|org.apache.maven.wagon.events.TransferEventSupport.fireTransferError(Lorg/apache/maven/wagon/events/TransferEvent;)V +METHOD|org.apache.maven.wagon.events.TransferEventSupport.fireDebug(Ljava/lang/String;)V +METHOD|org.apache.maven.wagon.events.TransferEventSupport.fireTransferInitiated(Lorg/apache/maven/wagon/events/TransferEvent;)V +METHOD|org.apache.maven.wagon.events.TransferListener.transferInitiated(Lorg/apache/maven/wagon/events/TransferEvent;)V +METHOD|org.apache.maven.wagon.events.TransferListener.transferStarted(Lorg/apache/maven/wagon/events/TransferEvent;)V +METHOD|org.apache.maven.wagon.events.TransferListener.transferProgress(Lorg/apache/maven/wagon/events/TransferEvent;[BI)V +METHOD|org.apache.maven.wagon.events.TransferListener.transferCompleted(Lorg/apache/maven/wagon/events/TransferEvent;)V +METHOD|org.apache.maven.wagon.events.TransferListener.transferError(Lorg/apache/maven/wagon/events/TransferEvent;)V +METHOD|org.apache.maven.wagon.events.TransferListener.debug(Ljava/lang/String;)V +METHOD|org.apache.maven.wagon.events.WagonEvent.(Lorg/apache/maven/wagon/Wagon;Lorg/apache/maven/wagon/repository/Repository;)V +METHOD|org.apache.maven.wagon.events.WagonEvent.getWagon()Lorg/apache/maven/wagon/Wagon; +METHOD|org.apache.maven.wagon.events.WagonEvent.getTimestamp()J +METHOD|org.apache.maven.wagon.events.WagonEvent.setTimestamp(J)V +METHOD|org.apache.maven.wagon.events.WagonEvent.getRepository()Lorg/apache/maven/wagon/repository/Repository; +METHOD|org.apache.maven.wagon.observers.AbstractTransferListener.()V +METHOD|org.apache.maven.wagon.observers.AbstractTransferListener.transferInitiated(Lorg/apache/maven/wagon/events/TransferEvent;)V +METHOD|org.apache.maven.wagon.observers.AbstractTransferListener.transferStarted(Lorg/apache/maven/wagon/events/TransferEvent;)V +METHOD|org.apache.maven.wagon.observers.AbstractTransferListener.transferProgress(Lorg/apache/maven/wagon/events/TransferEvent;[BI)V +METHOD|org.apache.maven.wagon.observers.AbstractTransferListener.transferCompleted(Lorg/apache/maven/wagon/events/TransferEvent;)V +METHOD|org.apache.maven.wagon.observers.AbstractTransferListener.transferError(Lorg/apache/maven/wagon/events/TransferEvent;)V +METHOD|org.apache.maven.wagon.observers.AbstractTransferListener.debug(Ljava/lang/String;)V +METHOD|org.apache.maven.wagon.observers.ChecksumObserver.()V +METHOD|org.apache.maven.wagon.observers.ChecksumObserver.(Ljava/lang/String;)V +METHOD|org.apache.maven.wagon.observers.ChecksumObserver.transferInitiated(Lorg/apache/maven/wagon/events/TransferEvent;)V +METHOD|org.apache.maven.wagon.observers.ChecksumObserver.transferStarted(Lorg/apache/maven/wagon/events/TransferEvent;)V +METHOD|org.apache.maven.wagon.observers.ChecksumObserver.transferProgress(Lorg/apache/maven/wagon/events/TransferEvent;[BI)V +METHOD|org.apache.maven.wagon.observers.ChecksumObserver.transferCompleted(Lorg/apache/maven/wagon/events/TransferEvent;)V +METHOD|org.apache.maven.wagon.observers.ChecksumObserver.transferError(Lorg/apache/maven/wagon/events/TransferEvent;)V +METHOD|org.apache.maven.wagon.observers.ChecksumObserver.debug(Ljava/lang/String;)V +METHOD|org.apache.maven.wagon.observers.ChecksumObserver.getActualChecksum()Ljava/lang/String; +METHOD|org.apache.maven.wagon.observers.ChecksumObserver.encode([B)Ljava/lang/String; +METHOD|org.apache.maven.wagon.observers.Debug.()V +METHOD|org.apache.maven.wagon.observers.Debug.(Ljava/io/PrintStream;)V +METHOD|org.apache.maven.wagon.observers.Debug.sessionOpening(Lorg/apache/maven/wagon/events/SessionEvent;)V +METHOD|org.apache.maven.wagon.observers.Debug.sessionOpened(Lorg/apache/maven/wagon/events/SessionEvent;)V +METHOD|org.apache.maven.wagon.observers.Debug.sessionDisconnecting(Lorg/apache/maven/wagon/events/SessionEvent;)V +METHOD|org.apache.maven.wagon.observers.Debug.sessionDisconnected(Lorg/apache/maven/wagon/events/SessionEvent;)V +METHOD|org.apache.maven.wagon.observers.Debug.sessionConnectionRefused(Lorg/apache/maven/wagon/events/SessionEvent;)V +METHOD|org.apache.maven.wagon.observers.Debug.sessionLoggedIn(Lorg/apache/maven/wagon/events/SessionEvent;)V +METHOD|org.apache.maven.wagon.observers.Debug.sessionLoggedOff(Lorg/apache/maven/wagon/events/SessionEvent;)V +METHOD|org.apache.maven.wagon.observers.Debug.debug(Ljava/lang/String;)V +METHOD|org.apache.maven.wagon.observers.Debug.transferInitiated(Lorg/apache/maven/wagon/events/TransferEvent;)V +METHOD|org.apache.maven.wagon.observers.Debug.transferStarted(Lorg/apache/maven/wagon/events/TransferEvent;)V +METHOD|org.apache.maven.wagon.observers.Debug.transferProgress(Lorg/apache/maven/wagon/events/TransferEvent;[BI)V +METHOD|org.apache.maven.wagon.observers.Debug.transferCompleted(Lorg/apache/maven/wagon/events/TransferEvent;)V +METHOD|org.apache.maven.wagon.observers.Debug.transferError(Lorg/apache/maven/wagon/events/TransferEvent;)V +METHOD|org.apache.maven.wagon.observers.Debug.sessionError(Lorg/apache/maven/wagon/events/SessionEvent;)V +METHOD|org.apache.maven.wagon.proxy.ProxyInfo.()V +METHOD|org.apache.maven.wagon.proxy.ProxyInfo.getHost()Ljava/lang/String; +METHOD|org.apache.maven.wagon.proxy.ProxyInfo.setHost(Ljava/lang/String;)V +METHOD|org.apache.maven.wagon.proxy.ProxyInfo.getPassword()Ljava/lang/String; +METHOD|org.apache.maven.wagon.proxy.ProxyInfo.setPassword(Ljava/lang/String;)V +METHOD|org.apache.maven.wagon.proxy.ProxyInfo.getPort()I +METHOD|org.apache.maven.wagon.proxy.ProxyInfo.setPort(I)V +METHOD|org.apache.maven.wagon.proxy.ProxyInfo.getUserName()Ljava/lang/String; +METHOD|org.apache.maven.wagon.proxy.ProxyInfo.setUserName(Ljava/lang/String;)V +METHOD|org.apache.maven.wagon.proxy.ProxyInfo.getType()Ljava/lang/String; +METHOD|org.apache.maven.wagon.proxy.ProxyInfo.setType(Ljava/lang/String;)V +METHOD|org.apache.maven.wagon.proxy.ProxyInfo.getNonProxyHosts()Ljava/lang/String; +METHOD|org.apache.maven.wagon.proxy.ProxyInfo.setNonProxyHosts(Ljava/lang/String;)V +METHOD|org.apache.maven.wagon.proxy.ProxyInfo.getNtlmHost()Ljava/lang/String; +METHOD|org.apache.maven.wagon.proxy.ProxyInfo.setNtlmHost(Ljava/lang/String;)V +METHOD|org.apache.maven.wagon.proxy.ProxyInfo.setNtlmDomain(Ljava/lang/String;)V +METHOD|org.apache.maven.wagon.proxy.ProxyInfo.getNtlmDomain()Ljava/lang/String; +METHOD|org.apache.maven.wagon.repository.Repository.()V +METHOD|org.apache.maven.wagon.repository.Repository.(Ljava/lang/String;Ljava/lang/String;)V +METHOD|org.apache.maven.wagon.repository.Repository.getId()Ljava/lang/String; +METHOD|org.apache.maven.wagon.repository.Repository.setId(Ljava/lang/String;)V +METHOD|org.apache.maven.wagon.repository.Repository.getBasedir()Ljava/lang/String; +METHOD|org.apache.maven.wagon.repository.Repository.setBasedir(Ljava/lang/String;)V +METHOD|org.apache.maven.wagon.repository.Repository.setName(Ljava/lang/String;)V +METHOD|org.apache.maven.wagon.repository.Repository.getPort()I +METHOD|org.apache.maven.wagon.repository.Repository.setPort(I)V +METHOD|org.apache.maven.wagon.repository.Repository.setUrl(Ljava/lang/String;)V +METHOD|org.apache.maven.wagon.repository.Repository.getUrl()Ljava/lang/String; +METHOD|org.apache.maven.wagon.repository.Repository.getHost()Ljava/lang/String; +METHOD|org.apache.maven.wagon.repository.Repository.getName()Ljava/lang/String; +METHOD|org.apache.maven.wagon.repository.Repository.toString()Ljava/lang/String; +METHOD|org.apache.maven.wagon.repository.Repository.getProtocol()Ljava/lang/String; +METHOD|org.apache.maven.wagon.repository.Repository.getPermissions()Lorg/apache/maven/wagon/repository/RepositoryPermissions; +METHOD|org.apache.maven.wagon.repository.Repository.setPermissions(Lorg/apache/maven/wagon/repository/RepositoryPermissions;)V +METHOD|org.apache.maven.wagon.repository.Repository.getParameter(Ljava/lang/String;)Ljava/lang/String; +METHOD|org.apache.maven.wagon.repository.Repository.setParameters(Ljava/util/Properties;)V +METHOD|org.apache.maven.wagon.repository.Repository.equals(Ljava/lang/Object;)Z +METHOD|org.apache.maven.wagon.repository.Repository.hashCode()I +METHOD|org.apache.maven.wagon.repository.Repository.getUsername()Ljava/lang/String; +METHOD|org.apache.maven.wagon.repository.Repository.getPassword()Ljava/lang/String; +METHOD|org.apache.maven.wagon.repository.Repository.setProtocol(Ljava/lang/String;)V +METHOD|org.apache.maven.wagon.repository.RepositoryPermissions.()V +METHOD|org.apache.maven.wagon.repository.RepositoryPermissions.getDirectoryMode()Ljava/lang/String; +METHOD|org.apache.maven.wagon.repository.RepositoryPermissions.setDirectoryMode(Ljava/lang/String;)V +METHOD|org.apache.maven.wagon.repository.RepositoryPermissions.getFileMode()Ljava/lang/String; +METHOD|org.apache.maven.wagon.repository.RepositoryPermissions.setFileMode(Ljava/lang/String;)V +METHOD|org.apache.maven.wagon.repository.RepositoryPermissions.getGroup()Ljava/lang/String; +METHOD|org.apache.maven.wagon.repository.RepositoryPermissions.setGroup(Ljava/lang/String;)V +METHOD|org.apache.maven.wagon.resource.Resource.()V +METHOD|org.apache.maven.wagon.resource.Resource.(Ljava/lang/String;)V +METHOD|org.apache.maven.wagon.resource.Resource.getName()Ljava/lang/String; +METHOD|org.apache.maven.wagon.resource.Resource.setName(Ljava/lang/String;)V +METHOD|org.apache.maven.wagon.resource.Resource.getLastModified()J +METHOD|org.apache.maven.wagon.resource.Resource.setLastModified(J)V +METHOD|org.apache.maven.wagon.resource.Resource.getContentLength()J +METHOD|org.apache.maven.wagon.resource.Resource.setContentLength(J)V +METHOD|org.apache.maven.wagon.resource.Resource.toString()Ljava/lang/String; +FILE|META-INF/ +FILE|META-INF/MANIFEST.MF +FILE|META-INF/maven/ +FILE|META-INF/maven/org.apache.maven.wagon/ +FILE|META-INF/maven/org.apache.maven.wagon/wagon-provider-api/ +FILE|META-INF/maven/org.apache.maven.wagon/wagon-provider-api/pom.properties +FILE|META-INF/maven/org.apache.maven.wagon/wagon-provider-api/pom.xml +FILE|org/ +FILE|org/apache/ +FILE|org/apache/maven/ +FILE|org/apache/maven/wagon/ +FILE|org/apache/maven/wagon/AbstractWagon.class +FILE|org/apache/maven/wagon/CommandExecutionException.class +FILE|org/apache/maven/wagon/CommandExecutor$1.class +FILE|org/apache/maven/wagon/CommandExecutor.class +FILE|org/apache/maven/wagon/ConnectionException.class +FILE|org/apache/maven/wagon/InputData.class +FILE|org/apache/maven/wagon/LazyFileOutputStream.class +FILE|org/apache/maven/wagon/OutputData.class +FILE|org/apache/maven/wagon/PathUtils.class +FILE|org/apache/maven/wagon/PermissionModeUtils.class +FILE|org/apache/maven/wagon/ResourceDoesNotExistException.class +FILE|org/apache/maven/wagon/StreamWagon.class +FILE|org/apache/maven/wagon/Streams.class +FILE|org/apache/maven/wagon/TransferFailedException.class +FILE|org/apache/maven/wagon/UnsupportedProtocolException.class +FILE|org/apache/maven/wagon/Wagon$1.class +FILE|org/apache/maven/wagon/Wagon.class +FILE|org/apache/maven/wagon/WagonConstants.class +FILE|org/apache/maven/wagon/WagonException.class +FILE|org/apache/maven/wagon/WagonUtils.class +FILE|org/apache/maven/wagon/authentication/ +FILE|org/apache/maven/wagon/authentication/AuthenticationException.class +FILE|org/apache/maven/wagon/authentication/AuthenticationInfo.class +FILE|org/apache/maven/wagon/authorization/ +FILE|org/apache/maven/wagon/authorization/AuthorizationException.class +FILE|org/apache/maven/wagon/events/ +FILE|org/apache/maven/wagon/events/SessionEvent.class +FILE|org/apache/maven/wagon/events/SessionEventSupport.class +FILE|org/apache/maven/wagon/events/SessionListener.class +FILE|org/apache/maven/wagon/events/TransferEvent.class +FILE|org/apache/maven/wagon/events/TransferEventSupport.class +FILE|org/apache/maven/wagon/events/TransferListener.class +FILE|org/apache/maven/wagon/events/WagonEvent.class +FILE|org/apache/maven/wagon/observers/ +FILE|org/apache/maven/wagon/observers/AbstractTransferListener.class +FILE|org/apache/maven/wagon/observers/ChecksumObserver.class +FILE|org/apache/maven/wagon/observers/Debug.class +FILE|org/apache/maven/wagon/proxy/ +FILE|org/apache/maven/wagon/proxy/ProxyInfo.class +FILE|org/apache/maven/wagon/repository/ +FILE|org/apache/maven/wagon/repository/Repository.class +FILE|org/apache/maven/wagon/repository/RepositoryPermissions.class +FILE|org/apache/maven/wagon/resource/ +FILE|org/apache/maven/wagon/resource/Resource.class diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/AbstractIndexCreationTestCase.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/AbstractIndexCreationTestCase.java new file mode 100644 index 000000000..ace9bd543 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/AbstractIndexCreationTestCase.java @@ -0,0 +1,191 @@ +package org.apache.maven.archiva.indexer; + +/* + * 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.io.FileUtils; +import org.apache.lucene.document.Document; +import org.apache.lucene.index.IndexReader; +import org.apache.maven.archiva.indexer.lucene.LuceneRepositoryContentRecord; + +import java.io.File; +import java.io.IOException; +import java.text.ParseException; +import java.util.Collections; + +/** + * AbstractIndexCreationTestCase + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public abstract class AbstractIndexCreationTestCase extends AbstractIndexerTestCase +{ + protected abstract LuceneRepositoryContentRecord createSimpleRecord(); + + public void testIndexExists() throws Exception + { + assertFalse( "check index doesn't exist", index.exists() ); + + File indexLocation = index.getIndexDirectory(); + + // create empty directory + indexLocation.mkdirs(); + assertFalse( "check index doesn't exist even if directory does", index.exists() ); + + // create index, with no records + createEmptyIndex(); + assertTrue( "check index is considered to exist", index.exists() ); + + // Test non-directory + FileUtils.deleteDirectory( indexLocation ); + indexLocation.createNewFile(); + try + { + index.exists(); + fail( "Index operation should fail as the location is not valid" ); + } + catch ( RepositoryIndexException e ) + { + // great + } + finally + { + indexLocation.delete(); + } + } + + public void testAddRecordNoIndex() throws IOException, RepositoryIndexException, ParseException + { + LuceneRepositoryContentRecord record = createSimpleRecord(); + + index.indexRecords( Collections.singletonList( record ) ); + + IndexReader reader = IndexReader.open( index.getIndexDirectory() ); + try + { + assertEquals( "Check index size", 1, reader.numDocs() ); + + Document document = reader.document( 0 ); + assertRecord( record, document ); + } + finally + { + reader.close(); + } + } + + public void testAddRecordExistingEmptyIndex() throws IOException, RepositoryIndexException, ParseException + { + createEmptyIndex(); + + LuceneRepositoryContentRecord record = createSimpleRecord(); + + index.indexRecords( Collections.singletonList( record ) ); + + IndexReader reader = IndexReader.open( index.getIndexDirectory() ); + try + { + assertEquals( "Check index size", 1, reader.numDocs() ); + + Document document = reader.document( 0 ); + assertRecord( record, document ); + } + finally + { + reader.close(); + } + } + + public void testAddRecordInIndex() throws IOException, RepositoryIndexException, ParseException + { + createEmptyIndex(); + + LuceneRepositoryContentRecord record = createSimpleRecord(); + + index.indexRecords( Collections.singletonList( record ) ); + + // Do it again + record = createSimpleRecord(); + + index.indexRecords( Collections.singletonList( record ) ); + + IndexReader reader = IndexReader.open( index.getIndexDirectory() ); + try + { + assertEquals( "Check index size", 1, reader.numDocs() ); + + Document document = reader.document( 0 ); + assertRecord( record, document ); + } + finally + { + reader.close(); + } + } + + public void testDeleteRecordInIndex() throws IOException, RepositoryIndexException + { + createEmptyIndex(); + + LuceneRepositoryContentRecord record = createSimpleRecord(); + + index.indexRecords( Collections.singletonList( record ) ); + + index.deleteRecords( Collections.singletonList( record ) ); + + IndexReader reader = IndexReader.open( index.getIndexDirectory() ); + try + { + assertEquals( "No documents", 0, reader.numDocs() ); + } + finally + { + reader.close(); + } + } + + public void testDeleteRecordNotInIndex() throws IOException, RepositoryIndexException + { + createEmptyIndex(); + + LuceneRepositoryContentRecord record = createSimpleRecord(); + + index.deleteRecords( Collections.singletonList( record ) ); + + IndexReader reader = IndexReader.open( index.getIndexDirectory() ); + try + { + assertEquals( "No documents", 0, reader.numDocs() ); + } + finally + { + reader.close(); + } + } + + public void testDeleteRecordNoIndex() throws IOException, RepositoryIndexException + { + LuceneRepositoryContentRecord record = createSimpleRecord(); + + index.deleteRecords( Collections.singleton( record ) ); + + assertFalse( index.exists() ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/AbstractIndexerTestCase.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/AbstractIndexerTestCase.java new file mode 100644 index 000000000..541b96e12 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/AbstractIndexerTestCase.java @@ -0,0 +1,236 @@ +package org.apache.maven.archiva.indexer; + +/* + * 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.io.FileUtils; +import org.apache.lucene.document.Document; +import org.apache.lucene.index.IndexWriter; +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.indexer.lucene.LuceneIndexHandlers; +import org.apache.maven.archiva.indexer.lucene.LuceneRepositoryContentRecord; +import org.apache.maven.archiva.model.ArchivaArtifact; +import org.codehaus.plexus.spring.PlexusInSpringTestCase; + +import java.io.File; +import java.io.IOException; +import java.text.ParseException; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +/** + * AbstractIndexerTestCase + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public abstract class AbstractIndexerTestCase + extends PlexusInSpringTestCase +{ + protected RepositoryContentIndex index; + + protected LuceneIndexHandlers indexHandlers; + + private static final String TEST_DEFAULT_REPOSITORY_NAME = "Test Default Repository"; + + private static final String TEST_DEFAULT_REPO_ID = "testDefaultRepo"; + + public abstract String getIndexName(); + + protected void assertRecord( LuceneRepositoryContentRecord expectedRecord, Document luceneDocument ) + throws ParseException + { + LuceneRepositoryContentRecord actualRecord = indexHandlers.getConverter().convert( luceneDocument ); + assertRecord( expectedRecord, actualRecord ); + } + + protected void assertRecord( LuceneRepositoryContentRecord expectedRecord, + LuceneRepositoryContentRecord actualRecord ) + { + assertEquals( expectedRecord, actualRecord ); + } + + public abstract RepositoryContentIndex createIndex( RepositoryContentIndexFactory indexFactory, + ManagedRepositoryConfiguration repository ); + + public abstract LuceneIndexHandlers getIndexHandler(); + + protected void setUp() + throws Exception + { + super.setUp(); + + RepositoryContentIndexFactory indexFactory = + (RepositoryContentIndexFactory) lookup( RepositoryContentIndexFactory.class + .getName(), "lucene" ); + + ManagedRepositoryConfiguration repository = createTestIndex( getIndexName() ); + + index = createIndex( indexFactory, repository ); + + indexHandlers = getIndexHandler(); + } + + private ManagedRepositoryConfiguration createTestIndex( String indexName ) + throws Exception + { + File repoDir = new File( getBasedir(), "src/test/managed-repository" ); + File testIndexesDir = new File( getBasedir(), "target/test-indexes" ); + + if ( !testIndexesDir.exists() ) + { + testIndexesDir.mkdirs(); + } + + assertTrue( "Default Test Repository should exist.", repoDir.exists() && repoDir.isDirectory() ); + + ManagedRepositoryConfiguration repository = createRepository( TEST_DEFAULT_REPO_ID, + TEST_DEFAULT_REPOSITORY_NAME, repoDir ); + + File indexLocation = new File( testIndexesDir, "/index-" + indexName + "-" + getName() + "/" ); + + MockConfiguration config = (MockConfiguration) lookup( ArchivaConfiguration.class.getName(), "mock" ); + + ManagedRepositoryConfiguration repoConfig = new ManagedRepositoryConfiguration(); + repoConfig.setId( TEST_DEFAULT_REPO_ID ); + repoConfig.setName( TEST_DEFAULT_REPOSITORY_NAME ); + repoConfig.setLocation( repoDir.getAbsolutePath() ); + repoConfig.setIndexDir( indexLocation.getAbsolutePath() ); + + if ( indexLocation.exists() ) + { + FileUtils.deleteDirectory( indexLocation ); + } + + config.getConfiguration().addManagedRepository( repoConfig ); + return repository; + } + + protected Map getArchivaArtifactDumpMap() + { + Map dumps = new HashMap(); + + // archiva-common-1.0.jar.txt + dumps.put( "archiva-common", + createArchivaArtifact( "org.apache.maven.archiva", "archiva-common", "1.0", "", "jar" ) ); + + // continuum-webapp-1.0.3-SNAPSHOT.war.txt + dumps.put( "continuum-webapp", createArchivaArtifact( "org.apache.maven.continuum", "continuum-webapp", + "1.0.3-SNAPSHOT", "", "war" ) ); + + // daytrader-ear-1.1.ear.txt + dumps.put( "daytrader-ear", createArchivaArtifact( "org.apache.geronimo", "daytrader-ear", "1.1", "", "ear" ) ); + + // maven-archetype-simple-1.0-alpha-4.jar.txt + dumps.put( "maven-archetype-simple", createArchivaArtifact( "org.apache.maven", "maven-archetype-simple", + "1.0-alpha-4", "", "maven-archetype" ) ); + + // maven-help-plugin-2.0.2-20070119.121239-2.jar.txt + dumps.put( "maven-help-plugin", createArchivaArtifact( "org.apache.maven.plugins", "maven-help-plugin", + "2.0.2-20070119.121239-2", "", "maven-plugin" ) ); + + // redback-authorization-open-1.0-alpha-1-SNAPSHOT.jar.txt + dumps.put( "redback-authorization-open", createArchivaArtifact( "org.codehaus.plexus.redback", + "redback-authorization-open", + "1.0-alpha-1-SNAPSHOT", "", "jar" ) ); + + // testng-5.1-jdk15.jar.txt + dumps.put( "testng", createArchivaArtifact( "org.testng", "testng", "5.1", "jdk15", "jar" ) ); + + // wagon-provider-api-1.0-beta-3-20070209.213958-2.jar.txt + dumps.put( "wagon-provider-api", createArchivaArtifact( "org.apache.maven.wagon", "wagon-provider-api", + "1.0-beta-3-20070209.213958-2", "", "jar" ) ); + + return dumps; + } + + protected File getDumpFile( ArchivaArtifact artifact ) + { + File dumpDir = new File( getBasedir(), "src/test/artifact-dumps" ); + StringBuffer filename = new StringBuffer(); + + filename.append( artifact.getArtifactId() ).append( "-" ).append( artifact.getVersion() ); + + if ( artifact.hasClassifier() ) + { + filename.append( "-" ).append( artifact.getClassifier() ); + } + + filename.append( "." ); + + // TODO: use the ArtifactExtensionMapping object + if ( "maven-plugin".equals( artifact.getType() ) || "maven-archetype".equals( artifact.getType() ) ) + { + filename.append( "jar" ); + } + else + { + filename.append( artifact.getType() ); + } + filename.append( ".txt" ); + + File dumpFile = new File( dumpDir, filename.toString() ); + + if ( !dumpFile.exists() ) + { + fail( "Dump file " + dumpFile.getAbsolutePath() + " does not exist (should it?)." ); + } + + return dumpFile; + } + + private ArchivaArtifact createArchivaArtifact( String groupId, String artifactId, String version, String classifier, + String type ) + { + ArchivaArtifact artifact = new ArchivaArtifact( groupId, artifactId, version, classifier, type ); + return artifact; + } + + protected void createEmptyIndex() + throws IOException + { + createIndex( Collections.EMPTY_LIST ); + } + + protected void createIndex( List documents ) + throws IOException + { + IndexWriter writer = new IndexWriter( index.getIndexDirectory(), indexHandlers.getAnalyzer(), true ); + for ( Iterator i = documents.iterator(); i.hasNext(); ) + { + Document document = (Document) i.next(); + writer.addDocument( document ); + } + writer.optimize(); + writer.close(); + } + + protected ManagedRepositoryConfiguration createRepository( String id, String name, File location ) + { + ManagedRepositoryConfiguration repo = new ManagedRepositoryConfiguration(); + repo.setId( id ); + repo.setName( name ); + repo.setLocation( location.getAbsolutePath() ); + return repo; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/AbstractSearchTestCase.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/AbstractSearchTestCase.java new file mode 100644 index 000000000..58aeafdbf --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/AbstractSearchTestCase.java @@ -0,0 +1,195 @@ +package org.apache.maven.archiva.indexer; + +/* + * 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.lucene.document.Document; +import org.apache.lucene.index.Term; +import org.apache.lucene.queryParser.ParseException; +import org.apache.lucene.queryParser.QueryParser; +import org.apache.lucene.search.Hit; +import org.apache.lucene.search.Hits; +import org.apache.lucene.search.Query; +import org.apache.lucene.search.Searcher; +import org.apache.lucene.search.TermQuery; +import org.apache.maven.archiva.indexer.lucene.LuceneRepositoryContentRecord; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import junit.framework.ComparisonFailure; + +/** + * AbstractSearchTestCase + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public abstract class AbstractSearchTestCase + extends AbstractIndexerTestCase +{ + protected Map records; + + protected abstract Map createSampleRecordsMap(); + + protected void setUp() + throws Exception + { + super.setUp(); + + records = createSampleRecordsMap(); + + index.indexRecords( records.values() ); + } + + protected Query createExactMatchQuery( String field, String value ) + { + return new TermQuery( new Term( field, value ) ); + } + + protected Query createMatchQuery( String field, String value ) + throws ParseException + { + QueryParser queryParser = new QueryParser( field, indexHandlers.getAnalyzer() ); + queryParser.setLowercaseExpandedTerms( true ); + return queryParser.parse( value ); + } + + protected void assertResults( String expectedKeys[], List actualResults ) + { + if ( actualResults == null ) + { + fail( "Got null results, expected <" + expectedKeys.length + "> results." ); + } + + if ( actualResults.isEmpty() ) + { + fail( "Got empty results, expected <" + expectedKeys.length + "> results." ); + } + + if ( expectedKeys.length != actualResults.size() ) + { + dumpResults( actualResults ); + throw new ComparisonFailure( "Results count", String.valueOf( expectedKeys.length ), String + .valueOf( actualResults.size() ) ); + } + + assertEquals( "Results count", expectedKeys.length, actualResults.size() ); + + for ( int i = 0; i < expectedKeys.length; i++ ) + { + String key = expectedKeys[i]; + LuceneRepositoryContentRecord record = (LuceneRepositoryContentRecord) records.get( key ); + + if ( record == null ) + { + dumpResults( actualResults ); + fail( "Expected record <" + key + + "> not in records map (smack the unit test developer, tell them to fix method " + getName() + ")" ); + } + + if ( !actualResults.contains( record ) ) + { + dumpResults( actualResults ); + fail( "Results should contain expected record: " + record ); + } + } + } + + protected void dumpResults( List results ) + { + System.out.println( "Results <" + results.size() + "> - " + getName() ); + int i = 1; + for ( Iterator iter = results.iterator(); iter.hasNext(); ) + { + Object result = (Object) iter.next(); + System.out.println( "Result [" + ( i++ ) + "] : " + result ); + } + } + + protected void assertNoResults( List results ) + { + if ( results == null ) + { + return; + } + + if ( !results.isEmpty() ) + { + dumpResults( results ); + fail( "Expected no results, but actually got <" + results.size() + "> entries." ); + } + } + + protected void assertQueryExactMatchNoResults( String key, String term ) + throws Exception + { + Query query = createExactMatchQuery( key, term ); + List results = search( query ); + assertNoResults( results ); + } + + protected void assertQueryExactMatch( String key, String names[], String term ) + throws Exception + { + Query query = createExactMatchQuery( key, term ); + List results = search( query ); + assertResults( names, results ); + } + + protected void assertQueryMatch( String key, String names[], String term ) + throws Exception + { + Query query = createMatchQuery( key, term ); + List results = search( query ); + assertResults( names, results ); + } + + protected void assertQueryMatchNoResults( String key, String term ) + throws Exception + { + Query query = createMatchQuery( key, term ); + + List results = search( query ); + + assertNoResults( results ); + } + + protected List search( Query query ) + throws RepositoryIndexSearchException, IOException, java.text.ParseException + { + Searcher searcher = (Searcher) index.getSearchable();; // this shouldn't cause a problem. + + Hits hits = searcher.search( query ); + + List results = new ArrayList(); + Iterator it = hits.iterator(); + while ( it.hasNext() ) + { + Hit hit = (Hit) it.next(); + Document doc = hit.getDocument(); + LuceneRepositoryContentRecord record = index.getEntryConverter().convert( doc ); + results.add( record ); + } + return results; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/MockConfiguration.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/MockConfiguration.java new file mode 100644 index 000000000..89f19599c --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/MockConfiguration.java @@ -0,0 +1,104 @@ +package org.apache.maven.archiva.indexer; + +/* + * 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.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.Configuration; +import org.apache.maven.archiva.configuration.ConfigurationListener; +import org.codehaus.plexus.registry.Registry; +import org.codehaus.plexus.registry.RegistryException; +import org.codehaus.plexus.registry.RegistryListener; +import org.easymock.MockControl; + +import java.util.HashSet; +import java.util.Set; + +/** + * MockConfiguration + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component role="org.apache.maven.archiva.configuration.ArchivaConfiguration" + * role-hint="mock" + */ +public class MockConfiguration implements ArchivaConfiguration +{ + private Configuration configuration = new Configuration(); + + private Set registryListeners = new HashSet(); + private Set configListeners = new HashSet(); + + private MockControl registryControl; + + private Registry registryMock; + + public MockConfiguration() + { + registryControl = MockControl.createNiceControl( Registry.class ); + registryMock = (Registry) registryControl.getMock(); + } + + public void addChangeListener( RegistryListener listener ) + { + registryListeners.add( listener ); + } + + public Configuration getConfiguration() + { + return configuration; + } + + public void save( Configuration configuration ) + throws RegistryException + { + /* do nothing */ + } + + public void triggerChange( String name, String value ) + { + for(RegistryListener listener: registryListeners) + { + try + { + listener.afterConfigurationChange( registryMock, name, value ); + } + catch ( Exception e ) + { + e.printStackTrace(); + } + } + } + + public void addListener( ConfigurationListener listener ) + { + configListeners.add(listener); + } + + public void removeListener( ConfigurationListener listener ) + { + configListeners.remove( listener ); + } + + public boolean isDefaulted() + { + return false; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/bytecode/AllTests.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/bytecode/AllTests.java new file mode 100644 index 000000000..e9a1e6eda --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/bytecode/AllTests.java @@ -0,0 +1,44 @@ +package org.apache.maven.archiva.indexer.bytecode; + +/* + * 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.Test; +import junit.framework.TestSuite; + +/** + * AllTests - conveinence test suite for IDE users. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class AllTests +{ + + public static Test suite() + { + TestSuite suite = new TestSuite( "Test for org.apache.maven.archiva.indexer.bytecode" ); + //$JUnit-BEGIN$ + suite.addTestSuite( BytecodeSearchTest.class ); + suite.addTestSuite( BytecodeIndexTest.class ); + //$JUnit-END$ + return suite; + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/bytecode/BytecodeIndexTest.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/bytecode/BytecodeIndexTest.java new file mode 100644 index 000000000..2fbef172c --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/bytecode/BytecodeIndexTest.java @@ -0,0 +1,66 @@ +package org.apache.maven.archiva.indexer.bytecode; + +/* + * 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.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.indexer.AbstractIndexCreationTestCase; +import org.apache.maven.archiva.indexer.RepositoryContentIndex; +import org.apache.maven.archiva.indexer.RepositoryContentIndexFactory; +import org.apache.maven.archiva.indexer.lucene.LuceneIndexHandlers; +import org.apache.maven.archiva.indexer.lucene.LuceneRepositoryContentRecord; +import org.apache.maven.archiva.model.ArchivaArtifact; + +import java.io.File; +import java.util.Map; + +/** + * BytecodeIndexTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class BytecodeIndexTest extends AbstractIndexCreationTestCase +{ + public String getIndexName() + { + return "bytecode"; + } + + public LuceneIndexHandlers getIndexHandler() + { + return new BytecodeHandlers(); + } + + public RepositoryContentIndex createIndex( RepositoryContentIndexFactory indexFactory, ManagedRepositoryConfiguration repository ) + { + return indexFactory.createBytecodeIndex( repository ); + } + + protected LuceneRepositoryContentRecord createSimpleRecord() + { + Map dumps = getArchivaArtifactDumpMap(); + ArchivaArtifact artifact = (ArchivaArtifact) dumps.get( "archiva-common" ); + + File dumpFile = getDumpFile( artifact ); + BytecodeRecord record = BytecodeRecordLoader.loadRecord( dumpFile, artifact ); + record.setRepositoryId( "test-repo" ); + return record; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/bytecode/BytecodeRecordLoader.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/bytecode/BytecodeRecordLoader.java new file mode 100644 index 000000000..9795215e1 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/bytecode/BytecodeRecordLoader.java @@ -0,0 +1,137 @@ +package org.apache.maven.archiva.indexer.bytecode; + +/* + * 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.AssertionFailedError; + +import org.apache.commons.io.IOUtils; +import org.apache.maven.archiva.model.ArchivaArtifact; +import org.apache.maven.archiva.model.ArchivaArtifactJavaDetails; +import org.apache.maven.archiva.model.platform.JavaArtifactHelper; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; +import java.util.ArrayList; + +/** + * BytecodeRecordLoader - Utility method for loading dump files into BytecordRecords. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class BytecodeRecordLoader +{ +// private static Map cache = new HashMap(); + + public static BytecodeRecord loadRecord( File dumpFile, ArchivaArtifact artifact ) + { + BytecodeRecord record; +// record = (BytecodeRecord) cache.get( artifact ); +// if ( record != null ) +// { +// return record; +// } + + record = new BytecodeRecord(); + record.setArtifact( artifact ); + + record.setClasses( new ArrayList() ); + record.setMethods( new ArrayList() ); + record.setFiles( new ArrayList() ); + + FileReader freader = null; + BufferedReader reader = null; + + try + { + freader = new FileReader( dumpFile ); + reader = new BufferedReader( freader ); + + String line = reader.readLine(); + while ( line != null ) + { + if ( line.startsWith( "FILENAME|" ) ) + { + String filename = line.substring( "FILENAME|".length() ); + record.setFilename( filename ); + } + else if ( line.startsWith( "SIZE|" ) ) + { + String size = line.substring( "SIZE|".length() ); + record.getArtifact().getModel().setSize( Long.parseLong( size ) ); + } + else if ( line.startsWith( "HASH_MD5|" ) ) + { + String md5 = line.substring( "HASH_MD5|".length() ); + record.getArtifact().getModel().setChecksumMD5( md5 ); + } + else if ( line.startsWith( "HASH_SHA1|" ) ) + { + String sha1 = line.substring( "HASH_SHA1|".length() ); + record.getArtifact().getModel().setChecksumSHA1( sha1 ); + } + else if ( line.startsWith( "HASH_BYTECODE|" ) ) + { + String hash = line.substring( "HASH_BYTECODE|".length() ); + ArchivaArtifactJavaDetails javaDetails = JavaArtifactHelper.getJavaDetails( record.getArtifact() ); + javaDetails.setChecksumBytecode( hash ); + } + else if ( line.startsWith( "JDK|" ) ) + { + String jdk = line.substring( "JDK|".length() ); + ArchivaArtifactJavaDetails javaDetails = JavaArtifactHelper.getJavaDetails( record.getArtifact() ); + javaDetails.setJdk( jdk ); + } + else if ( line.startsWith( "CLASS|" ) ) + { + String classname = line.substring( "CLASS|".length() ); + record.getClasses().add( classname ); + } + else if ( line.startsWith( "METHOD|" ) ) + { + String methodName = line.substring( "METHOD|".length() ); + record.getMethods().add( methodName ); + } + else if ( line.startsWith( "FILE|" ) ) + { + String fileentry = line.substring( "FILE|".length() ); + record.getFiles().add( fileentry ); + } + + line = reader.readLine(); + } + } + catch ( IOException e ) + { + throw new AssertionFailedError( "Unable to load record " + dumpFile + " from disk: " + e.getMessage() ); + } + finally + { + IOUtils.closeQuietly( reader ); + IOUtils.closeQuietly( freader ); + } + +// cache.put( artifact, record ); + + return record; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/bytecode/BytecodeSearchTest.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/bytecode/BytecodeSearchTest.java new file mode 100644 index 000000000..2dba5a4b2 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/bytecode/BytecodeSearchTest.java @@ -0,0 +1,329 @@ +package org.apache.maven.archiva.indexer.bytecode; + +/* + * 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.lucene.search.BooleanClause; +import org.apache.lucene.search.BooleanQuery; +import org.apache.lucene.search.MatchAllDocsQuery; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.indexer.AbstractSearchTestCase; +import org.apache.maven.archiva.indexer.ArtifactKeys; +import org.apache.maven.archiva.indexer.RepositoryContentIndex; +import org.apache.maven.archiva.indexer.RepositoryContentIndexFactory; +import org.apache.maven.archiva.indexer.lucene.LuceneIndexHandlers; +import org.apache.maven.archiva.model.ArchivaArtifact; + +import java.io.File; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +/** + * BytecodeSearchTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class BytecodeSearchTest extends AbstractSearchTestCase +{ + public String getIndexName() + { + return "bytecode"; + } + + public LuceneIndexHandlers getIndexHandler() + { + return new BytecodeHandlers(); + } + + public RepositoryContentIndex createIndex( RepositoryContentIndexFactory indexFactory, ManagedRepositoryConfiguration repository ) + { + return indexFactory.createBytecodeIndex( repository ); + } + + protected Map createSampleRecordsMap() + { + Map records = new HashMap(); + + Map artifactDumps = getArchivaArtifactDumpMap(); + for ( Iterator iter = artifactDumps.entrySet().iterator(); iter.hasNext(); ) + { + Map.Entry entry = (Map.Entry) iter.next(); + ArchivaArtifact artifact = (ArchivaArtifact) entry.getValue(); + File dumpFile = getDumpFile( artifact ); + BytecodeRecord record = BytecodeRecordLoader.loadRecord( dumpFile, artifact ); + record.setRepositoryId( "test-repo" ); + records.put( entry.getKey(), record ); + } + + return records; + } + + public void testExactMatchVersionSimple() throws Exception + { + assertQueryExactMatch( ArtifactKeys.VERSION_EXACT, new String[] { "archiva-common" }, "1.0" ); + } + + public void testExactMatchVersionSnapshot() throws Exception + { + assertQueryExactMatch( ArtifactKeys.VERSION_EXACT, new String[] { "continuum-webapp" }, "1.0.3-SNAPSHOT" ); + } + + public void testExactMatchVersionAlphaSnapshot() throws Exception + { + assertQueryExactMatch( ArtifactKeys.VERSION_EXACT, new String[] { "redback-authorization-open" }, + "1.0-alpha-1-SNAPSHOT" ); + } + + public void testExactMatchVersionTimestampedSnapshot() throws Exception + { + assertQueryExactMatch( ArtifactKeys.VERSION_EXACT, new String[] { "wagon-provider-api" }, + "1.0-beta-3-20070209.213958-2" ); + } + + public void testExactMatchVersionInvalid() throws Exception + { + assertQueryExactMatchNoResults( ArtifactKeys.VERSION_EXACT, "foo" ); + } + + public void testExactMatchGroupIdOrgApacheMavenArchiva() throws Exception + { + assertQueryExactMatch( ArtifactKeys.GROUPID_EXACT, new String[] { "archiva-common" }, + "org.apache.maven.archiva" ); + } + + public void testExactMatchGroupIdOrgApacheMaven() throws Exception + { + assertQueryExactMatch( ArtifactKeys.GROUPID_EXACT, new String[] { "maven-archetype-simple" }, + "org.apache.maven" ); + } + + public void testExactMatchGroupIdInvalid() throws Exception + { + assertQueryExactMatchNoResults( ArtifactKeys.GROUPID_EXACT, "foo" ); + } + + public void testExactMatchArtifactIdArchivaCommon() throws Exception + { + assertQueryExactMatch( ArtifactKeys.ARTIFACTID_EXACT, new String[] { "archiva-common" }, "archiva-common" ); + } + + public void testExactMatchArtifactIdTestNg() throws Exception + { + assertQueryExactMatch( ArtifactKeys.ARTIFACTID_EXACT, new String[] { "testng" }, "testng" ); + } + + public void testExactMatchArtifactIdInvalid() throws Exception + { + assertQueryExactMatchNoResults( ArtifactKeys.ARTIFACTID_EXACT, "foo" ); + } + + public void testExactMatchTypeJar() throws Exception + { + assertQueryExactMatch( ArtifactKeys.TYPE, ( new String[] { "archiva-common", "redback-authorization-open", + "testng", "wagon-provider-api" } ), "jar" ); + } + + public void testExactMatchTypeWar() throws Exception + { + assertQueryExactMatch( ArtifactKeys.TYPE, ( new String[] { "continuum-webapp" } ), "war" ); + } + + /* TODO: Fix 'maven-plugin' type + public void testExactMatchTypePlugin() throws Exception + { + assertQueryExactMatch( ArtifactKeys.TYPE, ( new String[] { "maven-help-plugin" } ), "maven-plugin" ); + } */ + + /* TODO: Fix 'maven-archetype' type + public void testExactMatchTypeArchetype() throws Exception + { + assertQueryExactMatch( ArtifactKeys.TYPE, ( new String[] { "maven-archetype-simple" } ), "maven-archetype" ); + } + */ + + public void testExactMatchTypeInvalid() throws Exception + { + assertQueryExactMatchNoResults( ArtifactKeys.TYPE, "foo" ); + } + + public void testMatchGroupIdOrgApacheMaven() throws Exception + { + assertQueryMatch( ArtifactKeys.GROUPID, new String[] { "archiva-common", "continuum-webapp", + "maven-archetype-simple", "maven-help-plugin", "wagon-provider-api" }, "org.apache.maven" ); + } + + public void testMatchGroupIdMaven() throws Exception + { + assertQueryMatch( ArtifactKeys.GROUPID, new String[] { "archiva-common", "continuum-webapp", + "maven-archetype-simple", "maven-help-plugin", "wagon-provider-api" }, "maven" ); + } + + public void testMatchGroupIdMavenMixed() throws Exception + { + assertQueryMatch( ArtifactKeys.GROUPID, new String[] { "archiva-common", "continuum-webapp", + "maven-archetype-simple", "maven-help-plugin", "wagon-provider-api" }, "Maven" ); + } + + public void testMatchGroupIdInvalid() throws Exception + { + assertQueryMatchNoResults( ArtifactKeys.GROUPID, "foo" ); + } + + public void testMatchArtifactIdPlugin() throws Exception + { + assertQueryMatch( ArtifactKeys.ARTIFACTID, new String[] { "maven-help-plugin" }, "plugin" ); + } + + public void testMatchArtifactIdMaven() throws Exception + { + assertQueryMatch( ArtifactKeys.ARTIFACTID, new String[] { "maven-help-plugin", "maven-archetype-simple" }, + "maven" ); + } + + public void testMatchArtifactIdHelp() throws Exception + { + assertQueryMatch( ArtifactKeys.ARTIFACTID, new String[] { "maven-help-plugin" }, "help" ); + } + + public void testMatchVersionOne() throws Exception + { + assertQueryMatch( ArtifactKeys.VERSION, new String[] { "daytrader-ear", "testng", "archiva-common", + "redback-authorization-open", "maven-archetype-simple", "continuum-webapp", "wagon-provider-api" }, "1" ); + } + + public void testMatchVersionOneOh() throws Exception + { + assertQueryMatch( ArtifactKeys.VERSION, new String[] { "archiva-common", "continuum-webapp", + "maven-archetype-simple", "redback-authorization-open", "wagon-provider-api" }, "1.0" ); + } + + public void testMatchVersionSnapshotLower() throws Exception + { + assertQueryMatch( ArtifactKeys.VERSION, new String[] { "continuum-webapp", "redback-authorization-open" }, + "snapshot" ); + } + + public void testMatchVersionSnapshotUpper() throws Exception + { + assertQueryMatch( ArtifactKeys.VERSION, new String[] { "continuum-webapp", "redback-authorization-open" }, + "SNAPSHOT" ); + } + + public void testMatchVersionAlpha() throws Exception + { + assertQueryMatch( ArtifactKeys.VERSION, + new String[] { "maven-archetype-simple", "redback-authorization-open" }, "alpha" ); + } + + public void testMatchVersionOneAlpha() throws Exception + { + assertQueryMatch( ArtifactKeys.VERSION, new String[] { "redback-authorization-open" }, "1.0-alpha-1" ); + } + + public void testMatchVersionInvalid() throws Exception + { + assertQueryMatchNoResults( ArtifactKeys.VERSION, "255" ); + } + + public void testMatchClassifierNotJdk15() throws Exception + { + BooleanQuery bQuery = new BooleanQuery(); + bQuery.add( new MatchAllDocsQuery(), BooleanClause.Occur.MUST ); + bQuery.add( createMatchQuery( ArtifactKeys.CLASSIFIER, "jdk15" ), BooleanClause.Occur.MUST_NOT ); + List results = search( bQuery ); + + assertResults( new String[] { "archiva-common", "continuum-webapp", "redback-authorization-open", + "daytrader-ear", "maven-archetype-simple", "maven-help-plugin", "wagon-provider-api" }, results ); + } + + public void testMatchClassifierJdk15() throws Exception + { + assertQueryMatch( ArtifactKeys.CLASSIFIER, new String[] { "testng" }, "jdk15" ); + } + + public void testMatchClassifierInvalid() throws Exception + { + assertQueryMatchNoResults( ArtifactKeys.CLASSIFIER, "redo" ); + } + + public void testMatchClassSessionListener() throws Exception + { + assertQueryMatch( BytecodeKeys.CLASSES, new String[] { "wagon-provider-api" }, "wagon.events.SessionListener" ); + } + + /* TODO: Suffix searching does not seem to work. + public void testMatchClassUtil() throws Exception + { + assertQueryMatch( BytecodeKeys.CLASSES, new String[] { "archiva-common", "continuum-webapp", "testng", + "wagon-provider-api" }, "Util" ); + } + */ + + public void testMatchClassWagon() throws Exception + { + assertQueryMatch( BytecodeKeys.CLASSES, new String[] { "wagon-provider-api" }, "Wagon" ); + } + + /* TODO: Suffix searching does not seem to work. + public void testMatchClassMojoAllUpper() throws Exception + { + assertQueryMatch( BytecodeKeys.CLASSES, new String[] { "maven-help-plugin" }, "MOJO" ); + } + */ + + /* TODO: Suffix searching does not seem to work. + public void testMatchClassMojo() throws Exception + { + assertQueryMatch( BytecodeKeys.CLASSES, new String[] { "maven-help-plugin" }, "Mojo" ); + } + */ + + public void testMatchClassInvalid() throws Exception + { + assertQueryMatchNoResults( BytecodeKeys.CLASSES, "Destruct|Button" ); + } + + public void testMatchFilesManifestMf() throws Exception + { + assertQueryMatch( BytecodeKeys.FILES, new String[] { "daytrader-ear", "maven-archetype-simple", + "redback-authorization-open", "maven-help-plugin", "archiva-common", "wagon-provider-api", + "continuum-webapp", "testng" }, "MANIFEST.MF" ); + } + + public void testMatchFilesMetaInf() throws Exception + { + assertQueryMatch( BytecodeKeys.FILES, new String[] { "daytrader-ear", "maven-archetype-simple", + "redback-authorization-open", "maven-help-plugin", "archiva-common", "wagon-provider-api", + "continuum-webapp", "testng" }, "META-INF" ); + } + + public void testMatchFilesPluginXml() throws Exception + { + assertQueryMatch( BytecodeKeys.FILES, new String[] { "maven-help-plugin" }, "plugin.xml" ); + } + + public void testMatchFilesInvalid() throws Exception + { + assertQueryMatchNoResults( BytecodeKeys.FILES, "Veni Vidi Castratavi Illegitimos" ); + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/hashcodes/AllTests.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/hashcodes/AllTests.java new file mode 100644 index 000000000..aa9dbcae2 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/hashcodes/AllTests.java @@ -0,0 +1,44 @@ +package org.apache.maven.archiva.indexer.hashcodes; + +/* + * 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.Test; +import junit.framework.TestSuite; + +/** + * AllTests - conveinence test suite for IDE users. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class AllTests +{ + + public static Test suite() + { + TestSuite suite = new TestSuite( "Test for org.apache.maven.archiva.indexer.hashcodes" ); + //$JUnit-BEGIN$ + suite.addTestSuite( HashcodesIndexTest.class ); + suite.addTestSuite( HashcodesSearchTest.class ); + //$JUnit-END$ + return suite; + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/hashcodes/HashcodesIndexTest.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/hashcodes/HashcodesIndexTest.java new file mode 100644 index 000000000..6f03d560d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/hashcodes/HashcodesIndexTest.java @@ -0,0 +1,66 @@ +package org.apache.maven.archiva.indexer.hashcodes; + +/* + * 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.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.indexer.AbstractIndexCreationTestCase; +import org.apache.maven.archiva.indexer.RepositoryContentIndex; +import org.apache.maven.archiva.indexer.RepositoryContentIndexFactory; +import org.apache.maven.archiva.indexer.lucene.LuceneIndexHandlers; +import org.apache.maven.archiva.indexer.lucene.LuceneRepositoryContentRecord; +import org.apache.maven.archiva.model.ArchivaArtifact; + +/** + * HashcodesIndexTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class HashcodesIndexTest extends AbstractIndexCreationTestCase +{ + public String getIndexName() + { + return "hashcodes"; + } + + public LuceneIndexHandlers getIndexHandler() + { + return new HashcodesHandlers(); + } + + public RepositoryContentIndex createIndex( RepositoryContentIndexFactory indexFactory, ManagedRepositoryConfiguration repository ) + { + return indexFactory.createHashcodeIndex( repository ); + } + + protected LuceneRepositoryContentRecord createSimpleRecord() + { + ArchivaArtifact artifact = new ArchivaArtifact( "com.foo", "projfoo", "1.0", "", "jar" ); + + HashcodesRecord record = new HashcodesRecord(); + record.setRepositoryId( "test-repo" ); + record.setArtifact( artifact ); + + artifact.getModel().setChecksumSHA1( "c66f18bf192cb613fc2febb4da541a34133eedc2" ); + artifact.getModel().setChecksumMD5( "3a0adc365f849366cd8b633cad155cb7" ); + + return record; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/hashcodes/HashcodesRecordLoader.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/hashcodes/HashcodesRecordLoader.java new file mode 100644 index 000000000..4d9e0f74d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/hashcodes/HashcodesRecordLoader.java @@ -0,0 +1,106 @@ +package org.apache.maven.archiva.indexer.hashcodes; + +/* + * 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.io.IOUtils; +import org.apache.maven.archiva.model.ArchivaArtifact; +import org.apache.maven.archiva.model.ArchivaArtifactJavaDetails; +import org.apache.maven.archiva.model.platform.JavaArtifactHelper; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; + +import junit.framework.AssertionFailedError; + +/** + * HashcodesRecordLoader + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class HashcodesRecordLoader +{ + public static HashcodesRecord loadRecord( File dumpFile, ArchivaArtifact artifact ) + { + HashcodesRecord record = new HashcodesRecord(); + record.setArtifact( artifact ); + + FileReader freader = null; + BufferedReader reader = null; + + try + { + freader = new FileReader( dumpFile ); + reader = new BufferedReader( freader ); + + String line = reader.readLine(); + while ( line != null ) + { + if ( line.startsWith( "FILENAME|" ) ) + { + String filename = line.substring( "FILENAME|".length() ); + record.setFilename( filename ); + } + else if ( line.startsWith( "SIZE|" ) ) + { + String size = line.substring( "SIZE|".length() ); + record.getArtifact().getModel().setSize( Long.parseLong( size ) ); + } + else if ( line.startsWith( "HASH_MD5|" ) ) + { + String md5 = line.substring( "HASH_MD5|".length() ); + record.getArtifact().getModel().setChecksumMD5( md5 ); + } + else if ( line.startsWith( "HASH_SHA1|" ) ) + { + String sha1 = line.substring( "HASH_SHA1|".length() ); + record.getArtifact().getModel().setChecksumSHA1( sha1 ); + } + else if ( line.startsWith( "HASH_BYTECODE|" ) ) + { + String hash = line.substring( "HASH_BYTECODE|".length() ); + ArchivaArtifactJavaDetails javaDetails = JavaArtifactHelper.getJavaDetails( record.getArtifact() ); + javaDetails.setChecksumBytecode( hash ); + } + else if ( line.startsWith( "JDK|" ) ) + { + String jdk = line.substring( "JDK|".length() ); + ArchivaArtifactJavaDetails javaDetails = JavaArtifactHelper.getJavaDetails( record.getArtifact() ); + javaDetails.setJdk( jdk ); + } + + line = reader.readLine(); + } + } + catch ( IOException e ) + { + throw new AssertionFailedError( "Unable to load record " + dumpFile + " from disk: " + e.getMessage() ); + } + finally + { + IOUtils.closeQuietly( reader ); + IOUtils.closeQuietly( freader ); + } + + return record; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/hashcodes/HashcodesSearchTest.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/hashcodes/HashcodesSearchTest.java new file mode 100644 index 000000000..b0d7b71ab --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/hashcodes/HashcodesSearchTest.java @@ -0,0 +1,289 @@ +package org.apache.maven.archiva.indexer.hashcodes; + +/* + * 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.lucene.search.BooleanClause; +import org.apache.lucene.search.BooleanQuery; +import org.apache.lucene.search.MatchAllDocsQuery; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.indexer.AbstractSearchTestCase; +import org.apache.maven.archiva.indexer.ArtifactKeys; +import org.apache.maven.archiva.indexer.RepositoryContentIndex; +import org.apache.maven.archiva.indexer.RepositoryContentIndexFactory; +import org.apache.maven.archiva.indexer.lucene.LuceneIndexHandlers; +import org.apache.maven.archiva.model.ArchivaArtifact; + +import java.io.File; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +/** + * HashcodesSearchTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class HashcodesSearchTest extends AbstractSearchTestCase +{ + public String getIndexName() + { + return "hashcodes"; + } + + public LuceneIndexHandlers getIndexHandler() + { + return new HashcodesHandlers(); + } + + public RepositoryContentIndex createIndex( RepositoryContentIndexFactory indexFactory, ManagedRepositoryConfiguration repository ) + { + return indexFactory.createHashcodeIndex( repository ); + } + + protected Map createSampleRecordsMap() + { + Map records = new HashMap(); + + Map artifactDumps = getArchivaArtifactDumpMap(); + for ( Iterator iter = artifactDumps.entrySet().iterator(); iter.hasNext(); ) + { + Map.Entry entry = (Map.Entry) iter.next(); + ArchivaArtifact artifact = (ArchivaArtifact) entry.getValue(); + File dumpFile = getDumpFile( artifact ); + HashcodesRecord record = HashcodesRecordLoader.loadRecord( dumpFile, artifact ); + record.setRepositoryId( "test-repo" ); + records.put( entry.getKey(), record ); + } + + return records; + } + + public void testExactMatchVersionSimple() throws Exception + { + assertQueryExactMatch( ArtifactKeys.VERSION_EXACT, new String[] { "archiva-common" }, "1.0" ); + } + + public void testExactMatchVersionSnapshot() throws Exception + { + assertQueryExactMatch( ArtifactKeys.VERSION_EXACT, new String[] { "continuum-webapp" }, "1.0.3-SNAPSHOT" ); + } + + public void testExactMatchVersionAlphaSnapshot() throws Exception + { + assertQueryExactMatch( ArtifactKeys.VERSION_EXACT, new String[] { "redback-authorization-open" }, + "1.0-alpha-1-SNAPSHOT" ); + } + + public void testExactMatchVersionTimestampedSnapshot() throws Exception + { + assertQueryExactMatch( ArtifactKeys.VERSION_EXACT, new String[] { "wagon-provider-api" }, + "1.0-beta-3-20070209.213958-2" ); + } + + public void testExactMatchVersionInvalid() throws Exception + { + assertQueryExactMatchNoResults( ArtifactKeys.VERSION_EXACT, "foo" ); + } + + public void testExactMatchGroupIdOrgApacheMavenArchiva() throws Exception + { + assertQueryExactMatch( ArtifactKeys.GROUPID_EXACT, new String[] { "archiva-common" }, + "org.apache.maven.archiva" ); + } + + public void testExactMatchGroupIdOrgApacheMaven() throws Exception + { + assertQueryExactMatch( ArtifactKeys.GROUPID_EXACT, new String[] { "maven-archetype-simple" }, + "org.apache.maven" ); + } + + public void testExactMatchGroupIdInvalid() throws Exception + { + assertQueryExactMatchNoResults( ArtifactKeys.GROUPID_EXACT, "foo" ); + } + + public void testExactMatchArtifactIdArchivaCommon() throws Exception + { + assertQueryExactMatch( ArtifactKeys.ARTIFACTID_EXACT, new String[] { "archiva-common" }, "archiva-common" ); + } + + public void testExactMatchArtifactIdTestNg() throws Exception + { + assertQueryExactMatch( ArtifactKeys.ARTIFACTID_EXACT, new String[] { "testng" }, "testng" ); + } + + public void testExactMatchArtifactIdInvalid() throws Exception + { + assertQueryExactMatchNoResults( ArtifactKeys.ARTIFACTID_EXACT, "foo" ); + } + + public void testExactMatchTypeJar() throws Exception + { + assertQueryExactMatch( ArtifactKeys.TYPE, ( new String[] { "archiva-common", "redback-authorization-open", + "testng", "wagon-provider-api" } ), "jar" ); + } + + public void testExactMatchTypeWar() throws Exception + { + assertQueryExactMatch( ArtifactKeys.TYPE, ( new String[] { "continuum-webapp" } ), "war" ); + } + + /* TODO: Fix 'maven-plugin' type + public void testExactMatchTypePlugin() throws Exception + { + assertQueryExactMatch( ArtifactKeys.TYPE, ( new String[] { "maven-help-plugin" } ), "maven-plugin" ); + } */ + + /* TODO: Fix 'maven-archetype' type + public void testExactMatchTypeArchetype() throws Exception + { + assertQueryExactMatch( ArtifactKeys.TYPE, ( new String[] { "maven-archetype-simple" } ), "maven-archetype" ); + } + */ + + public void testExactMatchTypeInvalid() throws Exception + { + assertQueryExactMatchNoResults( ArtifactKeys.TYPE, "foo" ); + } + + public void testExactMatchMd5() throws Exception + { + assertQueryExactMatch( HashcodesKeys.MD5, ( new String[] { "redback-authorization-open" } ), + "f42047fe2e177ac04d0df7aa44d408be" ); + } + + public void testExactMatchMd5Invalid() throws Exception + { + assertQueryExactMatchNoResults( HashcodesKeys.MD5, "foo" ); + } + + public void testExactMatchSha1() throws Exception + { + assertQueryExactMatch( HashcodesKeys.SHA1, ( new String[] { "archiva-common" } ), + "c2635a1b38bd4520a6604664c04b2b3c32330864" ); + } + + public void testExactMatchSha1Invalid() throws Exception + { + assertQueryExactMatchNoResults( HashcodesKeys.SHA1, "foo" ); + } + + public void testMatchGroupIdOrgApacheMaven() throws Exception + { + assertQueryMatch( ArtifactKeys.GROUPID, new String[] { "archiva-common", "continuum-webapp", + "maven-archetype-simple", "maven-help-plugin", "wagon-provider-api" }, "org.apache.maven" ); + } + + public void testMatchGroupIdMaven() throws Exception + { + assertQueryMatch( ArtifactKeys.GROUPID, new String[] { "archiva-common", "continuum-webapp", + "maven-archetype-simple", "maven-help-plugin", "wagon-provider-api" }, "maven" ); + } + + public void testMatchGroupIdMavenMixed() throws Exception + { + assertQueryMatch( ArtifactKeys.GROUPID, new String[] { "archiva-common", "continuum-webapp", + "maven-archetype-simple", "maven-help-plugin", "wagon-provider-api" }, "Maven" ); + } + + public void testMatchGroupIdInvalid() throws Exception + { + assertQueryMatchNoResults( ArtifactKeys.GROUPID, "foo" ); + } + + public void testMatchArtifactIdPlugin() throws Exception + { + assertQueryMatch( ArtifactKeys.ARTIFACTID, new String[] { "maven-help-plugin" }, "plugin" ); + } + + public void testMatchArtifactIdMaven() throws Exception + { + assertQueryMatch( ArtifactKeys.ARTIFACTID, new String[] { "maven-help-plugin", "maven-archetype-simple" }, + "maven" ); + } + + public void testMatchArtifactIdHelp() throws Exception + { + assertQueryMatch( ArtifactKeys.ARTIFACTID, new String[] { "maven-help-plugin" }, "help" ); + } + + public void testMatchVersionOne() throws Exception + { + assertQueryMatch( ArtifactKeys.VERSION, new String[] { "daytrader-ear", "testng", "archiva-common", + "redback-authorization-open", "maven-archetype-simple", "continuum-webapp", "wagon-provider-api" }, "1" ); + } + + public void testMatchVersionOneOh() throws Exception + { + assertQueryMatch( ArtifactKeys.VERSION, new String[] { "archiva-common", "continuum-webapp", + "maven-archetype-simple", "redback-authorization-open", "wagon-provider-api" }, "1.0" ); + } + + public void testMatchVersionSnapshotLower() throws Exception + { + assertQueryMatch( ArtifactKeys.VERSION, new String[] { "continuum-webapp", "redback-authorization-open" }, + "snapshot" ); + } + + public void testMatchVersionSnapshotUpper() throws Exception + { + assertQueryMatch( ArtifactKeys.VERSION, new String[] { "continuum-webapp", "redback-authorization-open" }, + "SNAPSHOT" ); + } + + public void testMatchVersionAlpha() throws Exception + { + assertQueryMatch( ArtifactKeys.VERSION, + new String[] { "maven-archetype-simple", "redback-authorization-open" }, "alpha" ); + } + + public void testMatchVersionOneAlpha() throws Exception + { + assertQueryMatch( ArtifactKeys.VERSION, new String[] { "redback-authorization-open" }, "1.0-alpha-1" ); + } + + public void testMatchVersionInvalid() throws Exception + { + assertQueryMatchNoResults( ArtifactKeys.VERSION, "255" ); + } + + public void testMatchClassifierNotJdk15() throws Exception + { + BooleanQuery bQuery = new BooleanQuery(); + bQuery.add( new MatchAllDocsQuery(), BooleanClause.Occur.MUST ); + bQuery.add( createMatchQuery( ArtifactKeys.CLASSIFIER, "jdk15" ), BooleanClause.Occur.MUST_NOT ); + List results = search( bQuery ); + + assertResults( new String[] { "archiva-common", "continuum-webapp", "redback-authorization-open", + "daytrader-ear", "maven-archetype-simple", "maven-help-plugin", "wagon-provider-api" }, results ); + } + + public void testMatchClassifierJdk15() throws Exception + { + assertQueryMatch( ArtifactKeys.CLASSIFIER, new String[] { "testng" }, "jdk15" ); + } + + public void testMatchClassifierInvalid() throws Exception + { + assertQueryMatchNoResults( ArtifactKeys.CLASSIFIER, "redo" ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/query/AllTests.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/query/AllTests.java new file mode 100644 index 000000000..fb848fdf2 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/query/AllTests.java @@ -0,0 +1,43 @@ +package org.apache.maven.archiva.indexer.query; + +/* + * 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.Test; +import junit.framework.TestSuite; + +/** + * AllTests - conveinence test suite for IDE users. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class AllTests +{ + + public static Test suite() + { + TestSuite suite = new TestSuite( "Test for org.apache.maven.archiva.indexer.query" ); + //$JUnit-BEGIN$ + suite.addTestSuite( QueryTest.class ); + //$JUnit-END$ + return suite; + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/query/QueryTest.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/query/QueryTest.java new file mode 100644 index 000000000..b0cc88e98 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/query/QueryTest.java @@ -0,0 +1,159 @@ +package org.apache.maven.archiva.indexer.query; + +/* + * 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; + +import java.util.Iterator; + +/** + * @author Brett Porter + */ +public class QueryTest + extends TestCase +{ + private QueryTerm term1 = new QueryTerm( "field1", "value1" ); + + private QueryTerm term2 = new QueryTerm( "field2", "value2" ); + + private QueryTerm term3 = new QueryTerm( "field3", "value3" ); + + public void testQueryTerm() + { + QueryTerm query = new QueryTerm( "Field", "Value" ); + assertEquals( "check field setting", "Field", query.getField() ); + assertEquals( "check value setting", "Value", query.getValue() ); + } + + public void testSingleTermQuery() + { + SingleTermQuery query = new SingleTermQuery( "Field", "Value" ); + assertEquals( "check field setting", "Field", query.getField() ); + assertEquals( "check value setting", "Value", query.getValue() ); + + query = new SingleTermQuery( term1 ); + assertEquals( "check field setting", "field1", query.getField() ); + assertEquals( "check value setting", "value1", query.getValue() ); + } + + public void testRangeQueryOpen() + { + RangeQuery rangeQuery = RangeQuery.createOpenRange(); + assertNull( "Check range has no start", rangeQuery.getBegin() ); + assertNull( "Check range has no end", rangeQuery.getEnd() ); + } + + public void testRangeQueryExclusive() + { + RangeQuery rangeQuery = RangeQuery.createExclusiveRange( term1, term2 ); + assertEquals( "Check range start", term1, rangeQuery.getBegin() ); + assertEquals( "Check range end", term2, rangeQuery.getEnd() ); + assertFalse( "Check exclusive", rangeQuery.isInclusive() ); + } + + public void testRangeQueryInclusive() + { + RangeQuery rangeQuery = RangeQuery.createInclusiveRange( term1, term2 ); + assertEquals( "Check range start", term1, rangeQuery.getBegin() ); + assertEquals( "Check range end", term2, rangeQuery.getEnd() ); + assertTrue( "Check inclusive", rangeQuery.isInclusive() ); + } + + public void testRangeQueryOpenEnded() + { + RangeQuery rangeQuery = RangeQuery.createGreaterThanOrEqualToRange( term1 ); + assertEquals( "Check range start", term1, rangeQuery.getBegin() ); + assertNull( "Check range end", rangeQuery.getEnd() ); + assertTrue( "Check inclusive", rangeQuery.isInclusive() ); + + rangeQuery = RangeQuery.createGreaterThanRange( term1 ); + assertEquals( "Check range start", term1, rangeQuery.getBegin() ); + assertNull( "Check range end", rangeQuery.getEnd() ); + assertFalse( "Check exclusive", rangeQuery.isInclusive() ); + + rangeQuery = RangeQuery.createLessThanOrEqualToRange( term1 ); + assertNull( "Check range start", rangeQuery.getBegin() ); + assertEquals( "Check range end", term1, rangeQuery.getEnd() ); + assertTrue( "Check inclusive", rangeQuery.isInclusive() ); + + rangeQuery = RangeQuery.createLessThanRange( term1 ); + assertNull( "Check range start", rangeQuery.getBegin() ); + assertEquals( "Check range end", term1, rangeQuery.getEnd() ); + assertFalse( "Check exclusive", rangeQuery.isInclusive() ); + } + + public void testCompundQuery() + { + CompoundQuery query = new CompoundQuery(); + assertTrue( "check query is empty", query.getCompoundQueryTerms().isEmpty() ); + + query.and( term1 ); + query.or( term2 ); + query.not( term3 ); + + Iterator i = query.getCompoundQueryTerms().iterator(); + CompoundQueryTerm term = (CompoundQueryTerm) i.next(); + assertEquals( "Check first term", "field1", getQuery( term ).getField() ); + assertEquals( "Check first term", "value1", getQuery( term ).getValue() ); + assertTrue( "Check first term", term.isRequired() ); + assertFalse( "Check first term", term.isProhibited() ); + + term = (CompoundQueryTerm) i.next(); + assertEquals( "Check second term", "field2", getQuery( term ).getField() ); + assertEquals( "Check second term", "value2", getQuery( term ).getValue() ); + assertFalse( "Check second term", term.isRequired() ); + assertFalse( "Check second term", term.isProhibited() ); + + term = (CompoundQueryTerm) i.next(); + assertEquals( "Check third term", "field3", getQuery( term ).getField() ); + assertEquals( "Check third term", "value3", getQuery( term ).getValue() ); + assertFalse( "Check third term", term.isRequired() ); + assertTrue( "Check third term", term.isProhibited() ); + + CompoundQuery query2 = new CompoundQuery(); + query2.and( query ); + query2.or( new SingleTermQuery( term2 ) ); + query2.not( new SingleTermQuery( term3 ) ); + + i = query2.getCompoundQueryTerms().iterator(); + term = (CompoundQueryTerm) i.next(); + assertEquals( "Check first term", query, term.getQuery() ); + assertTrue( "Check first term", term.isRequired() ); + assertFalse( "Check first term", term.isProhibited() ); + + term = (CompoundQueryTerm) i.next(); + assertEquals( "Check second term", "field2", getQuery( term ).getField() ); + assertEquals( "Check second term", "value2", getQuery( term ).getValue() ); + assertFalse( "Check second term", term.isRequired() ); + assertFalse( "Check second term", term.isProhibited() ); + + term = (CompoundQueryTerm) i.next(); + assertEquals( "Check third term", "field3", getQuery( term ).getField() ); + assertEquals( "Check third term", "value3", getQuery( term ).getValue() ); + assertFalse( "Check third term", term.isRequired() ); + assertTrue( "Check third term", term.isProhibited() ); + } + + private static SingleTermQuery getQuery( CompoundQueryTerm term ) + { + return (SingleTermQuery) term.getQuery(); + } +} + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/search/BytecodeIndexPopulator.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/search/BytecodeIndexPopulator.java new file mode 100644 index 000000000..4587ef7a7 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/search/BytecodeIndexPopulator.java @@ -0,0 +1,141 @@ +package org.apache.maven.archiva.indexer.search; + +/* + * 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.archiva.indexer.bytecode.BytecodeRecord; +import org.apache.maven.archiva.indexer.bytecode.BytecodeRecordLoader; +import org.apache.maven.archiva.model.ArchivaArtifact; + +import java.io.File; +import java.util.HashMap; +import java.util.Map; +import java.util.Map.Entry; + +import junit.framework.AssertionFailedError; + +/** + * BytecodeIndexPopulator + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class BytecodeIndexPopulator + implements IndexPopulator +{ + + public Map getObjectMap() + { + + Map dumps = new HashMap(); + + // archiva-common-1.0.jar.txt + dumps.put( "archiva-common", + createArchivaArtifact( "org.apache.maven.archiva", "archiva-common", "1.0", "", "jar" ) ); + + // continuum-webapp-1.0.3-SNAPSHOT.war.txt + dumps.put( "continuum-webapp", createArchivaArtifact( "org.apache.maven.continuum", "continuum-webapp", + "1.0.3-SNAPSHOT", "", "war" ) ); + + // daytrader-ear-1.1.ear.txt + dumps.put( "daytrader-ear", createArchivaArtifact( "org.apache.geronimo", "daytrader-ear", "1.1", "", "ear" ) ); + + // maven-archetype-simple-1.0-alpha-4.jar.txt + dumps.put( "maven-archetype-simple", createArchivaArtifact( "org.apache.maven", "maven-archetype-simple", + "1.0-alpha-4", "", "maven-archetype" ) ); + + // maven-help-plugin-2.0.2-20070119.121239-2.jar.txt + dumps.put( "maven-help-plugin", createArchivaArtifact( "org.apache.maven.plugins", "maven-help-plugin", + "2.0.2-20070119.121239-2", "", "maven-plugin" ) ); + + // redback-authorization-open-1.0-alpha-1-SNAPSHOT.jar.txt + dumps.put( "redback-authorization-open", createArchivaArtifact( "org.codehaus.plexus.redback", + "redback-authorization-open", + "1.0-alpha-1-SNAPSHOT", "", "jar" ) ); + + // testng-5.1-jdk15.jar.txt + dumps.put( "testng", createArchivaArtifact( "org.testng", "testng", "5.1", "jdk15", "jar" ) ); + + // wagon-provider-api-1.0-beta-3-20070209.213958-2.jar.txt + dumps.put( "wagon-provider-api", createArchivaArtifact( "org.apache.maven.wagon", "wagon-provider-api", + "1.0-beta-3-20070209.213958-2", "", "jar" ) ); + + return dumps; + + } + + private ArchivaArtifact createArchivaArtifact( String groupId, String artifactId, String version, String classifier, + String type ) + { + ArchivaArtifact artifact = new ArchivaArtifact( groupId, artifactId, version, classifier, type ); + return artifact; + } + + public Map populate( File basedir ) + { + Map records = new HashMap(); + + for ( Entry entry : getObjectMap().entrySet() ) + { + ArchivaArtifact artifact = entry.getValue(); + File dumpFile = getDumpFile( basedir, artifact ); + BytecodeRecord record = BytecodeRecordLoader.loadRecord( dumpFile, artifact ); + record.setRepositoryId( "test-repo" ); + records.put( entry.getKey(), record ); + } + + return records; + } + + protected File getDumpFile( File basedir, ArchivaArtifact artifact ) + { + File dumpDir = new File( basedir, "src/test/artifact-dumps" ); + StringBuffer filename = new StringBuffer(); + + filename.append( artifact.getArtifactId() ).append( "-" ).append( artifact.getVersion() ); + + if ( artifact.hasClassifier() ) + { + filename.append( "-" ).append( artifact.getClassifier() ); + } + + filename.append( "." ); + + // TODO: use the ArtifactExtensionMapping object + if ( "maven-plugin".equals( artifact.getType() ) || "maven-archetype".equals( artifact.getType() ) ) + { + filename.append( "jar" ); + } + else + { + filename.append( artifact.getType() ); + } + filename.append( ".txt" ); + + File dumpFile = new File( dumpDir, filename.toString() ); + + if ( !dumpFile.exists() ) + { + throw new AssertionFailedError( + "Dump file " + dumpFile.getAbsolutePath() + " does not exist (should it?)." ); + } + + return dumpFile; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/search/DefaultCrossRepositorySearchTest.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/search/DefaultCrossRepositorySearchTest.java new file mode 100644 index 000000000..71c872d67 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/search/DefaultCrossRepositorySearchTest.java @@ -0,0 +1,289 @@ +package org.apache.maven.archiva.indexer.search; + +/* + * 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.io.FileUtils; +import org.apache.lucene.search.Hits; +import org.apache.lucene.search.MatchAllDocsQuery; +import org.apache.lucene.search.Query; +import org.apache.lucene.search.Searcher; +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.indexer.MockConfiguration; +import org.apache.maven.archiva.indexer.RepositoryContentIndex; +import org.apache.maven.archiva.indexer.RepositoryContentIndexFactory; +import org.apache.maven.archiva.indexer.bytecode.BytecodeRecord; +import org.apache.maven.archiva.indexer.filecontent.FileContentRecord; +import org.apache.maven.archiva.indexer.hashcodes.HashcodesRecord; +import org.codehaus.plexus.spring.PlexusInSpringTestCase; + +import java.io.File; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * DefaultCrossRepositorySearchTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class DefaultCrossRepositorySearchTest + extends PlexusInSpringTestCase +{ + private static final String TEST_DEFAULT_REPOSITORY_NAME = "Test Default Repository"; + + private static final String TEST_DEFAULT_REPO_ID = "testDefaultRepo"; + + @Override + protected void setUp() + throws Exception + { + super.setUp(); + + RepositoryContentIndexFactory indexFactory = + (RepositoryContentIndexFactory) lookup( RepositoryContentIndexFactory.class + .getName(), "lucene" ); + + File repoDir = new File( getBasedir(), "src/test/managed-repository" ); + + assertTrue( "Default Test Repository should exist.", repoDir.exists() && repoDir.isDirectory() ); + + ManagedRepositoryConfiguration repository = createRepository( TEST_DEFAULT_REPO_ID, TEST_DEFAULT_REPOSITORY_NAME, repoDir ); + + File indexLocation = new File( "target/index-crossrepo-" + getName() + "/" ); + + MockConfiguration config = (MockConfiguration) lookup( ArchivaConfiguration.class.getName(), "mock" ); + + ManagedRepositoryConfiguration repoConfig = new ManagedRepositoryConfiguration(); + repoConfig.setId( TEST_DEFAULT_REPO_ID ); + repoConfig.setName( TEST_DEFAULT_REPOSITORY_NAME ); + repoConfig.setLocation( repoDir.getAbsolutePath() ); + repoConfig.setIndexDir( indexLocation.getAbsolutePath() ); + repoConfig.setScanned( true ); + + if ( indexLocation.exists() ) + { + FileUtils.deleteDirectory( indexLocation ); + } + + config.getConfiguration().addManagedRepository( repoConfig ); + + // Create the (empty) indexes. + RepositoryContentIndex indexHashcode = indexFactory.createHashcodeIndex( repository ); + RepositoryContentIndex indexBytecode = indexFactory.createBytecodeIndex( repository ); + RepositoryContentIndex indexContents = indexFactory.createFileContentIndex( repository ); + + // Now populate them. + Map hashcodesMap = new HashcodesIndexPopulator().populate( new File( getBasedir() ) ); + indexHashcode.indexRecords( hashcodesMap.values() ); + assertEquals( "Hashcode Key Count", hashcodesMap.size(), indexHashcode.getAllRecordKeys().size() ); + assertRecordCount( indexHashcode, hashcodesMap.size() ); + + Map bytecodeMap = new BytecodeIndexPopulator().populate( new File( getBasedir() ) ); + indexBytecode.indexRecords( bytecodeMap.values() ); + assertEquals( "Bytecode Key Count", bytecodeMap.size(), indexBytecode.getAllRecordKeys().size() ); + assertRecordCount( indexBytecode, bytecodeMap.size() ); + + Map contentMap = new FileContentIndexPopulator().populate( new File( getBasedir() ) ); + indexContents.indexRecords( contentMap.values() ); + assertEquals( "File Content Key Count", contentMap.size(), indexContents.getAllRecordKeys().size() ); + assertRecordCount( indexContents, contentMap.size() ); + } + + private void assertRecordCount( RepositoryContentIndex index, int expectedCount ) + throws Exception + { + Query query = new MatchAllDocsQuery(); + Searcher searcher = (Searcher) index.getSearchable(); + Hits hits = searcher.search( query ); + assertEquals( "Expected Record Count for " + index.getId(), expectedCount, hits.length() ); + } + + private CrossRepositorySearch lookupCrossRepositorySearch() + throws Exception + { + CrossRepositorySearch search = + (CrossRepositorySearch) lookup( CrossRepositorySearch.class.getName(), "default" ); + assertNotNull( "CrossRepositorySearch:default should not be null.", search ); + return search; + } + + public void testSearchTerm_Org() + throws Exception + { + CrossRepositorySearch search = lookupCrossRepositorySearch(); + + String expectedRepos[] = new String[] { + TEST_DEFAULT_REPO_ID + }; + + String expectedResults[] = new String[] { + "org","org2","org3","org4","org5","org6","org7" + }; + + assertSearchResults( expectedRepos, expectedResults, search, "org", null, false ); + } + + public void testSearchTerm_Junit() + throws Exception + { + CrossRepositorySearch search = lookupCrossRepositorySearch(); + + String expectedRepos[] = new String[] { + TEST_DEFAULT_REPO_ID + }; + + String expectedResults[] = new String[] { + "junit","junit2","junit3" + }; + + assertSearchResults( expectedRepos, expectedResults, search, "junit", null, false ); + } + + public void testSearchInvalidTerm() + throws Exception + { + CrossRepositorySearch search = lookupCrossRepositorySearch(); + + String expectedRepos[] = new String[] { + TEST_DEFAULT_REPO_ID + }; + + String expectedResults[] = new String[] { + // Nothing. + }; + + assertSearchResults( expectedRepos, expectedResults, search, "monosodium", null, false ); + } + + public void testSearchWithinSearchResults() + throws Exception + { + CrossRepositorySearch search = lookupCrossRepositorySearch(); + + String expectedRepos[] = new String[] { + TEST_DEFAULT_REPO_ID + }; + + String expectedResults[] = new String[] { + "org","org2","org3","org4","org5","org6","org7" + }; + + // first search + assertSearchResults( expectedRepos, expectedResults, search, "org", null, false ); + + List previousSearchTerms = new ArrayList(); + previousSearchTerms.add( "org" ); + String secondSearchExpectedResults[] = new String[] { + "org.apache.maven.archiva.record", "org.apache.maven.archiva.record2", + "org.apache.maven.archiva.record3", "org.apache.maven.archiva.record4", + "org.apache.maven.archiva.record5", "org.apache.maven.archiva.record6", + "org.apache.maven.archiva.record7" + }; + + //second search + assertSearchResults( expectedRepos, secondSearchExpectedResults, search, "org.apache.maven.archiva.record", + previousSearchTerms, false ); + + previousSearchTerms.add( "org.apache.maven.archiva.record" ); + String thirdSearchExpectedResults[] = new String[] { + "junit", "junit2", "junit3" + }; + + //third search + assertSearchResults( expectedRepos, thirdSearchExpectedResults, search, "junit", previousSearchTerms, false ); + } + + public void testSearchForClassesAndPackages() + throws Exception + { + CrossRepositorySearch search = lookupCrossRepositorySearch(); + + String expectedRepos[] = new String[] { + TEST_DEFAULT_REPO_ID + }; + + String expectedResults[] = new String[] { + "archiva-common-1.0.jar" + }; + + // class with packagename search + assertSearchResults( expectedRepos, expectedResults, search, + "org.apache.maven.archiva.common.utils.BaseFile", null, true ); + // class name search + assertSearchResults( expectedRepos, expectedResults, search, + "BaseFile", null, true ); + + String expectedMethodSearchResults[] = new String[] { + "continuum-webapp-1.0.3-SNAPSHOT.war" + }; + + // method search + assertSearchResults( expectedRepos, expectedMethodSearchResults, search, + "org.apache.maven.continuum.web.action.BuildDefinitionAction.isBuildFresh", null, true ); + } + + private void assertSearchResults( String expectedRepos[], String expectedResults[], CrossRepositorySearch search, + String term, List previousSearchTerms, boolean bytecode ) + throws Exception + { + SearchResultLimits limits = new SearchResultLimits( 0 ); + limits.setPageSize( 20 ); + + List selectedRepos = new ArrayList(); + selectedRepos.addAll( Arrays.asList( expectedRepos ) ); + + SearchResults results = null; + if( previousSearchTerms == null ) + { + if( bytecode ) + { + results = search.searchForBytecode( "guest", selectedRepos, term, limits ); + } + else + { + results = search.searchForTerm( "guest", selectedRepos, term, limits ); + } + } + else + { + results = search.searchForTerm( "guest", selectedRepos, term, limits, previousSearchTerms ); + } + + assertNotNull( "Search Results should not be null.", results ); + assertEquals( "Repository Hits", expectedRepos.length, results.getRepositories().size() ); + // TODO: test the repository ids returned. + + assertEquals( "Search Result Hits", expectedResults.length, results.getHits().size() ); + // TODO: test the order of hits. + // TODO: test the value of the hits. + } + + protected ManagedRepositoryConfiguration createRepository( String id, String name, File location ) + { + ManagedRepositoryConfiguration repo = new ManagedRepositoryConfiguration(); + repo.setId( id ); + repo.setName( name ); + repo.setLocation( location.getAbsolutePath() ); + return repo; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/search/FileContentIndexPopulator.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/search/FileContentIndexPopulator.java new file mode 100644 index 000000000..326061d56 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/search/FileContentIndexPopulator.java @@ -0,0 +1,94 @@ +package org.apache.maven.archiva.indexer.search; + +/* + * 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.io.FileUtils; +import org.apache.maven.archiva.indexer.filecontent.FileContentRecord; +import org.apache.maven.archiva.model.ArchivaArtifact; + +import java.io.File; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +import junit.framework.AssertionFailedError; + +/** + * FileContentIndexPopulator + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class FileContentIndexPopulator + implements IndexPopulator +{ + public Map getObjectMap() + { + return null; + } + + public Map populate( File basedir ) + { + Map map = new HashMap(); + + File repoDir = new File( basedir, "src/test/managed-repository" ); + + String prefix = "org/apache/maven/archiva/record/"; + + map.put( "parent-pom-1", createFileContentRecord( repoDir, prefix + "parent-pom/1/parent-pom-1.pom" ) ); + map.put( "child-pom-1.0-SNAPSHOT", createFileContentRecord( repoDir, prefix + + "test-child-pom/1.0-SNAPSHOT/test-child-pom-1.0-20060728.121314-1.pom" ) ); + map.put( "test-archetype-1.0", createFileContentRecord( repoDir, prefix + + "test-archetype/1.0/test-archetype-1.0.pom" ) ); + map.put( "test-jar-and-pom-1.0-alpha-1", createFileContentRecord( repoDir, prefix + + "test-jar-and-pom/1.0-alpha-1/test-jar-and-pom-1.0-alpha-1.pom" ) ); + map.put( "test-plugin-1.0", createFileContentRecord( repoDir, prefix + "test-plugin/1.0/test-plugin-1.0.pom" ) ); + map.put( "test-pom-1.0", createFileContentRecord( repoDir, prefix + "test-pom/1.0/test-pom-1.0.pom" ) ); + map.put( "test-skin-1.0", createFileContentRecord( repoDir, prefix + "test-skin/1.0/test-skin-1.0.pom" ) ); + + return map; + } + + private FileContentRecord createFileContentRecord( File repoDir, String path ) + { + File pathToFile = new File( repoDir, path ); + + if ( !pathToFile.exists() ) + { + throw new AssertionFailedError( "Can't find test file: " + pathToFile.getAbsolutePath() ); + } + + FileContentRecord record = new FileContentRecord(); + record.setRepositoryId( "test-repo" ); + record.setFilename( path ); + + try + { + record.setContents( FileUtils.readFileToString( pathToFile, null ) ); + } + catch ( IOException e ) + { + e.printStackTrace(); + throw new AssertionFailedError( "Can't load test file contents: " + pathToFile.getAbsolutePath() ); + } + + return record; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/search/HashcodesIndexPopulator.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/search/HashcodesIndexPopulator.java new file mode 100644 index 000000000..ad2c7dc41 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/search/HashcodesIndexPopulator.java @@ -0,0 +1,139 @@ +package org.apache.maven.archiva.indexer.search; + +/* + * 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.archiva.indexer.hashcodes.HashcodesRecord; +import org.apache.maven.archiva.indexer.hashcodes.HashcodesRecordLoader; +import org.apache.maven.archiva.model.ArchivaArtifact; + +import java.io.File; +import java.util.HashMap; +import java.util.Map; +import java.util.Map.Entry; + +import junit.framework.AssertionFailedError; + +/** + * HashcodesIndexPopulator + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class HashcodesIndexPopulator + implements IndexPopulator +{ + + public Map getObjectMap() + { + Map dumps = new HashMap(); + + // archiva-common-1.0.jar.txt + dumps.put( "archiva-common", + createArchivaArtifact( "org.apache.maven.archiva", "archiva-common", "1.0", "", "jar" ) ); + + // continuum-webapp-1.0.3-SNAPSHOT.war.txt + dumps.put( "continuum-webapp", createArchivaArtifact( "org.apache.maven.continuum", "continuum-webapp", + "1.0.3-SNAPSHOT", "", "war" ) ); + + // daytrader-ear-1.1.ear.txt + dumps.put( "daytrader-ear", createArchivaArtifact( "org.apache.geronimo", "daytrader-ear", "1.1", "", "ear" ) ); + + // maven-archetype-simple-1.0-alpha-4.jar.txt + dumps.put( "maven-archetype-simple", createArchivaArtifact( "org.apache.maven", "maven-archetype-simple", + "1.0-alpha-4", "", "maven-archetype" ) ); + + // maven-help-plugin-2.0.2-20070119.121239-2.jar.txt + dumps.put( "maven-help-plugin", createArchivaArtifact( "org.apache.maven.plugins", "maven-help-plugin", + "2.0.2-20070119.121239-2", "", "maven-plugin" ) ); + + // redback-authorization-open-1.0-alpha-1-SNAPSHOT.jar.txt + dumps.put( "redback-authorization-open", createArchivaArtifact( "org.codehaus.plexus.redback", + "redback-authorization-open", + "1.0-alpha-1-SNAPSHOT", "", "jar" ) ); + + // testng-5.1-jdk15.jar.txt + dumps.put( "testng", createArchivaArtifact( "org.testng", "testng", "5.1", "jdk15", "jar" ) ); + + // wagon-provider-api-1.0-beta-3-20070209.213958-2.jar.txt + dumps.put( "wagon-provider-api", createArchivaArtifact( "org.apache.maven.wagon", "wagon-provider-api", + "1.0-beta-3-20070209.213958-2", "", "jar" ) ); + + return dumps; + } + + public Map populate( File basedir ) + { + Map records = new HashMap(); + + for ( Entry entry : getObjectMap().entrySet() ) + { + ArchivaArtifact artifact = entry.getValue(); + File dumpFile = getDumpFile( basedir, artifact ); + HashcodesRecord record = HashcodesRecordLoader.loadRecord( dumpFile, artifact ); + record.setRepositoryId( "test-repo" ); + records.put( entry.getKey(), record ); + } + + return records; + } + + protected File getDumpFile( File basedir, ArchivaArtifact artifact ) + { + File dumpDir = new File( basedir, "src/test/artifact-dumps" ); + StringBuffer filename = new StringBuffer(); + + filename.append( artifact.getArtifactId() ).append( "-" ).append( artifact.getVersion() ); + + if ( artifact.hasClassifier() ) + { + filename.append( "-" ).append( artifact.getClassifier() ); + } + + filename.append( "." ); + + // TODO: use the ArtifactExtensionMapping object + if ( "maven-plugin".equals( artifact.getType() ) || "maven-archetype".equals( artifact.getType() ) ) + { + filename.append( "jar" ); + } + else + { + filename.append( artifact.getType() ); + } + filename.append( ".txt" ); + + File dumpFile = new File( dumpDir, filename.toString() ); + + if ( !dumpFile.exists() ) + { + throw new AssertionFailedError( + "Dump file " + dumpFile.getAbsolutePath() + " does not exist (should it?)." ); + } + + return dumpFile; + } + + private ArchivaArtifact createArchivaArtifact( String groupId, String artifactId, String version, String classifier, + String type ) + { + ArchivaArtifact artifact = new ArchivaArtifact( groupId, artifactId, version, classifier, type ); + return artifact; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/search/IndexPopulator.java b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/search/IndexPopulator.java new file mode 100644 index 000000000..6f4892dac --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/search/IndexPopulator.java @@ -0,0 +1,39 @@ +package org.apache.maven.archiva.indexer.search; + +/* + * 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.archiva.indexer.lucene.LuceneRepositoryContentRecord; +import org.apache.maven.archiva.model.ArchivaArtifact; + +import java.io.File; +import java.util.Map; + +/** + * IndexPopulator + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public interface IndexPopulator +{ + public Map getObjectMap(); + + public Map populate( File basedir ); +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/managed-repository/org/apache/maven/archiva/record/parent-pom/1/parent-pom-1.pom b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/managed-repository/org/apache/maven/archiva/record/parent-pom/1/parent-pom-1.pom new file mode 100644 index 000000000..b4d864fdb --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/managed-repository/org/apache/maven/archiva/record/parent-pom/1/parent-pom-1.pom @@ -0,0 +1,41 @@ + + + 4.0.0 + org.apache.maven.archiva.record + parent-pom + 1 + pom + Test Parent POM + Description + 2005 + + + junit + junit + 3.8.1 + test + + + + test-child-pom + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/managed-repository/org/apache/maven/archiva/record/test-archetype/1.0/test-archetype-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/managed-repository/org/apache/maven/archiva/record/test-archetype/1.0/test-archetype-1.0.jar new file mode 100644 index 000000000..6b5db4295 Binary files /dev/null and b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/managed-repository/org/apache/maven/archiva/record/test-archetype/1.0/test-archetype-1.0.jar differ diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/managed-repository/org/apache/maven/archiva/record/test-archetype/1.0/test-archetype-1.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/managed-repository/org/apache/maven/archiva/record/test-archetype/1.0/test-archetype-1.0.pom new file mode 100644 index 000000000..d2492aaf3 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/managed-repository/org/apache/maven/archiva/record/test-archetype/1.0/test-archetype-1.0.pom @@ -0,0 +1,27 @@ + + + + 4.0.0 + org.apache.maven.archiva.record + test-archetype + 1.0 + Archetype - test-archetype + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/managed-repository/org/apache/maven/archiva/record/test-child-pom/1.0-SNAPSHOT/test-child-pom-1.0-20060728.121314-1.jar b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/managed-repository/org/apache/maven/archiva/record/test-child-pom/1.0-SNAPSHOT/test-child-pom-1.0-20060728.121314-1.jar new file mode 100644 index 000000000..b78be2eb8 Binary files /dev/null and b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/managed-repository/org/apache/maven/archiva/record/test-child-pom/1.0-SNAPSHOT/test-child-pom-1.0-20060728.121314-1.jar differ diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/managed-repository/org/apache/maven/archiva/record/test-child-pom/1.0-SNAPSHOT/test-child-pom-1.0-20060728.121314-1.pom b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/managed-repository/org/apache/maven/archiva/record/test-child-pom/1.0-SNAPSHOT/test-child-pom-1.0-20060728.121314-1.pom new file mode 100644 index 000000000..7c2b68f67 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/managed-repository/org/apache/maven/archiva/record/test-child-pom/1.0-SNAPSHOT/test-child-pom-1.0-20060728.121314-1.pom @@ -0,0 +1,31 @@ + + + + 4.0.0 + + org.apache.maven.archiva.record + parent-pom + 1 + + test-child-pom + 1.0-20060731-121314-1 + Child Project + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/managed-repository/org/apache/maven/archiva/record/test-corrupt-jar/1.0/test-corrupt-jar-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/managed-repository/org/apache/maven/archiva/record/test-corrupt-jar/1.0/test-corrupt-jar-1.0.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/managed-repository/org/apache/maven/archiva/record/test-dll/1.0.1.34/test-dll-1.0.1.34.dll b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/managed-repository/org/apache/maven/archiva/record/test-dll/1.0.1.34/test-dll-1.0.1.34.dll new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/managed-repository/org/apache/maven/archiva/record/test-jar-and-pom/1.0-alpha-1/test-jar-and-pom-1.0-alpha-1-jdk14.jar b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/managed-repository/org/apache/maven/archiva/record/test-jar-and-pom/1.0-alpha-1/test-jar-and-pom-1.0-alpha-1-jdk14.jar new file mode 100644 index 000000000..b78be2eb8 Binary files /dev/null and b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/managed-repository/org/apache/maven/archiva/record/test-jar-and-pom/1.0-alpha-1/test-jar-and-pom-1.0-alpha-1-jdk14.jar differ diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/managed-repository/org/apache/maven/archiva/record/test-jar-and-pom/1.0-alpha-1/test-jar-and-pom-1.0-alpha-1.jar b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/managed-repository/org/apache/maven/archiva/record/test-jar-and-pom/1.0-alpha-1/test-jar-and-pom-1.0-alpha-1.jar new file mode 100644 index 000000000..b78be2eb8 Binary files /dev/null and b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/managed-repository/org/apache/maven/archiva/record/test-jar-and-pom/1.0-alpha-1/test-jar-and-pom-1.0-alpha-1.jar differ diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/managed-repository/org/apache/maven/archiva/record/test-jar-and-pom/1.0-alpha-1/test-jar-and-pom-1.0-alpha-1.pom b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/managed-repository/org/apache/maven/archiva/record/test-jar-and-pom/1.0-alpha-1/test-jar-and-pom-1.0-alpha-1.pom new file mode 100644 index 000000000..4585fe6dd --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/managed-repository/org/apache/maven/archiva/record/test-jar-and-pom/1.0-alpha-1/test-jar-and-pom-1.0-alpha-1.pom @@ -0,0 +1,50 @@ + + + + 4.0.0 + org.apache.maven.archiva.record + test-jar-and-pom + 1.0-alpha-1 + Test JAR and POM + + + org.apache.maven + maven-project + 2.0 + + + junit + junit + 3.8.1 + test + + + + + brett + Brett Porter + brett@apache.org + + Developer + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/managed-repository/org/apache/maven/archiva/record/test-jar/1.0/test-jar-1.0-jdk14.jar b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/managed-repository/org/apache/maven/archiva/record/test-jar/1.0/test-jar-1.0-jdk14.jar new file mode 100644 index 000000000..b78be2eb8 Binary files /dev/null and b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/managed-repository/org/apache/maven/archiva/record/test-jar/1.0/test-jar-1.0-jdk14.jar differ diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/managed-repository/org/apache/maven/archiva/record/test-jar/1.0/test-jar-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/managed-repository/org/apache/maven/archiva/record/test-jar/1.0/test-jar-1.0.jar new file mode 100644 index 000000000..b78be2eb8 Binary files /dev/null and b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/managed-repository/org/apache/maven/archiva/record/test-jar/1.0/test-jar-1.0.jar differ diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/managed-repository/org/apache/maven/archiva/record/test-plugin/1.0/test-plugin-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/managed-repository/org/apache/maven/archiva/record/test-plugin/1.0/test-plugin-1.0.jar new file mode 100644 index 000000000..1c0b105fe Binary files /dev/null and b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/managed-repository/org/apache/maven/archiva/record/test-plugin/1.0/test-plugin-1.0.jar differ diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/managed-repository/org/apache/maven/archiva/record/test-plugin/1.0/test-plugin-1.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/managed-repository/org/apache/maven/archiva/record/test-plugin/1.0/test-plugin-1.0.pom new file mode 100644 index 000000000..a5d4a9043 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/managed-repository/org/apache/maven/archiva/record/test-plugin/1.0/test-plugin-1.0.pom @@ -0,0 +1,41 @@ + + + + 4.0.0 + org.apache.maven.archiva.record + test-plugin + maven-plugin + 1.0 + Maven Mojo Archetype + + + org.apache.maven + maven-plugin-api + 2.0 + + + junit + junit + 3.8.1 + test + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/managed-repository/org/apache/maven/archiva/record/test-pom/1.0/test-pom-1.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/managed-repository/org/apache/maven/archiva/record/test-pom/1.0/test-pom-1.0.pom new file mode 100644 index 000000000..bff7d34cd --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/managed-repository/org/apache/maven/archiva/record/test-pom/1.0/test-pom-1.0.pom @@ -0,0 +1,30 @@ + + + + 4.0.0 + org.apache.maven.archiva.record + test-pom + 1.0 + Maven Repository Manager Test POM + 2005 + Description + pom + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/managed-repository/org/apache/maven/archiva/record/test-skin/1.0/test-skin-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/managed-repository/org/apache/maven/archiva/record/test-skin/1.0/test-skin-1.0.jar new file mode 100644 index 000000000..99bd1e78b Binary files /dev/null and b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/managed-repository/org/apache/maven/archiva/record/test-skin/1.0/test-skin-1.0.jar differ diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/managed-repository/org/apache/maven/archiva/record/test-skin/1.0/test-skin-1.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/managed-repository/org/apache/maven/archiva/record/test-skin/1.0/test-skin-1.0.pom new file mode 100644 index 000000000..48a67d622 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/managed-repository/org/apache/maven/archiva/record/test-skin/1.0/test-skin-1.0.pom @@ -0,0 +1,27 @@ + + + + 4.0.0 + org.apache.maven.archiva.record + test-skin + 1.0 + Skin - test-skin + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/repository/org/apache/maven/maven-artifact/2.0.1/maven-artifact-2.0.1.jar b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/repository/org/apache/maven/maven-artifact/2.0.1/maven-artifact-2.0.1.jar new file mode 100644 index 000000000..14fa95ab9 Binary files /dev/null and b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/repository/org/apache/maven/maven-artifact/2.0.1/maven-artifact-2.0.1.jar differ diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/repository/org/apache/maven/maven-artifact/2.0.1/maven-artifact-2.0.1.pom b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/repository/org/apache/maven/maven-artifact/2.0.1/maven-artifact-2.0.1.pom new file mode 100644 index 000000000..726c01830 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/repository/org/apache/maven/maven-artifact/2.0.1/maven-artifact-2.0.1.pom @@ -0,0 +1,64 @@ + + + + + + maven + org.apache.maven + 2.0.1 + + 4.0.0 + org.apache.maven + maven-artifact + Maven Artifact + 2.0.1 + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + + org.codehaus.plexus + plexus-utils + 1.0.5 + + + org.codehaus.plexus + plexus-container-default + 1.0-alpha-9 + test + + + + deployed + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + 2.0 + + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/repository/org/apache/maven/maven-artifact/2.0.1/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/repository/org/apache/maven/maven-artifact/2.0.1/maven-metadata.xml new file mode 100644 index 000000000..c66d54e12 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/repository/org/apache/maven/maven-artifact/2.0.1/maven-metadata.xml @@ -0,0 +1,25 @@ + + + + + org.apache.maven + maven-artifact + 2.0.1 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/repository/org/apache/maven/maven-artifact/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/repository/org/apache/maven/maven-artifact/maven-metadata.xml new file mode 100644 index 000000000..da270169f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/repository/org/apache/maven/maven-artifact/maven-metadata.xml @@ -0,0 +1,32 @@ + + + + + org.apache.maven + maven-artifact + 2.0.1 + + 2.0.1 + + 2.0.1 + + 20051212044643 + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/repository/org/apache/maven/maven-corrupt-jar/2.0/maven-corrupt-jar-2.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/repository/org/apache/maven/maven-corrupt-jar/2.0/maven-corrupt-jar-2.0.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/repository/org/apache/maven/maven-corrupt-jar/2.0/maven-corrupt-jar-2.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/repository/org/apache/maven/maven-corrupt-jar/2.0/maven-corrupt-jar-2.0.pom new file mode 100644 index 000000000..75e761b8c --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/repository/org/apache/maven/maven-corrupt-jar/2.0/maven-corrupt-jar-2.0.pom @@ -0,0 +1,114 @@ + + + + + maven + org.apache.maven + 2.0 + + 4.0.0 + org.apache.maven + maven-corrupt-jar + Maven Model + 2.0 + Maven Model + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + + + org.codehaus.modello + modello-maven-plugin + 2.0 + + + + xpp3-writer + java + xpp3-reader + xsd + + + + + 4.0.0 + maven.mdo + + + + + + + all-models + + + + org.codehaus.modello + modello-maven-plugin + + + v3 + + xpp3-writer + java + xpp3-reader + xsd + + + 3.0.0 + true + + + + + + maven-jar-plugin + + + package + + jar + + + all + + + + + + + + + + + org.codehaus.plexus + plexus-utils + 1.0.5 + + + + deployed + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/repository/org/apache/maven/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/repository/org/apache/maven/maven-metadata.xml new file mode 100644 index 000000000..fc9de9c04 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/repository/org/apache/maven/maven-metadata.xml @@ -0,0 +1,29 @@ + + + + + org.apache.maven + + + org.apache.maven + org.apache.maven-maven-plugin + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/repository/org/apache/maven/maven-model/2.0/maven-model-2.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/repository/org/apache/maven/maven-model/2.0/maven-model-2.0.jar new file mode 100644 index 000000000..d6820d6fe Binary files /dev/null and b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/repository/org/apache/maven/maven-model/2.0/maven-model-2.0.jar differ diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/repository/org/apache/maven/maven-model/2.0/maven-model-2.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/repository/org/apache/maven/maven-model/2.0/maven-model-2.0.pom new file mode 100644 index 000000000..8579fd492 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/repository/org/apache/maven/maven-model/2.0/maven-model-2.0.pom @@ -0,0 +1,114 @@ + + + + + maven + org.apache.maven + 2.0 + + 4.0.0 + org.apache.maven + maven-model + Maven Model + 2.0 + Maven Model + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + + + org.codehaus.modello + modello-maven-plugin + 2.0 + + + + xpp3-writer + java + xpp3-reader + xsd + + + + + 4.0.0 + maven.mdo + + + + + + + all-models + + + + org.codehaus.modello + modello-maven-plugin + + + v3 + + xpp3-writer + java + xpp3-reader + xsd + + + 3.0.0 + true + + + + + + maven-jar-plugin + + + package + + jar + + + all + + + + + + + + + + + org.codehaus.plexus + plexus-utils + 1.0.5 + + + + deployed + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/repository/test/inherited/test-inherited/1.0.15/test-inherited-1.0.15.pom b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/repository/test/inherited/test-inherited/1.0.15/test-inherited-1.0.15.pom new file mode 100644 index 000000000..20419b61a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/repository/test/inherited/test-inherited/1.0.15/test-inherited-1.0.15.pom @@ -0,0 +1,30 @@ + + + + 4.0.0 + + test.inherited + 1.0.15 + test-inherited-parent + + + test-inherited + pom + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/repository/test/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/repository/test/maven-metadata.xml new file mode 100644 index 000000000..6846739d3 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/repository/test/maven-metadata.xml @@ -0,0 +1,29 @@ + + + + + test + + + + test-test-plugin + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/repository/test/test-artifactId/1.0/test-artifactId-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/repository/test/test-artifactId/1.0/test-artifactId-1.0.jar new file mode 100644 index 000000000..00eb58b70 Binary files /dev/null and b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/repository/test/test-artifactId/1.0/test-artifactId-1.0.jar differ diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/repository/test/test-artifactId/1.0/test-artifactId-1.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/repository/test/test-artifactId/1.0/test-artifactId-1.0.pom new file mode 100644 index 000000000..f92a25607 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/repository/test/test-artifactId/1.0/test-artifactId-1.0.pom @@ -0,0 +1,25 @@ + + + + 4.0.0 + test + test-artifactId + 1.0 + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/resources/META-INF/plexus/components.xml b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/resources/META-INF/plexus/components.xml new file mode 100644 index 000000000..af15697a1 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/resources/META-INF/plexus/components.xml @@ -0,0 +1,22 @@ + + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + mock + org.apache.maven.archiva.indexer.MockConfiguration + + + org.apache.maven.archiva.indexer.RepositoryContentIndexFactory + lucene + org.apache.maven.archiva.indexer.lucene.LuceneRepositoryContentIndexFactory + Factory for Lucene repository content index instances. + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + mock + configuration + + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/resources/log4j.xml b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/resources/log4j.xml new file mode 100644 index 000000000..a11494a31 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/resources/log4j.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/resources/org/apache/maven/archiva/indexer/bytecode/BytecodeIndexTest.xml b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/resources/org/apache/maven/archiva/indexer/bytecode/BytecodeIndexTest.xml new file mode 100644 index 000000000..af15697a1 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/resources/org/apache/maven/archiva/indexer/bytecode/BytecodeIndexTest.xml @@ -0,0 +1,22 @@ + + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + mock + org.apache.maven.archiva.indexer.MockConfiguration + + + org.apache.maven.archiva.indexer.RepositoryContentIndexFactory + lucene + org.apache.maven.archiva.indexer.lucene.LuceneRepositoryContentIndexFactory + Factory for Lucene repository content index instances. + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + mock + configuration + + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/resources/org/apache/maven/archiva/indexer/bytecode/BytecodeSearchTest.xml b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/resources/org/apache/maven/archiva/indexer/bytecode/BytecodeSearchTest.xml new file mode 100644 index 000000000..af15697a1 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/resources/org/apache/maven/archiva/indexer/bytecode/BytecodeSearchTest.xml @@ -0,0 +1,22 @@ + + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + mock + org.apache.maven.archiva.indexer.MockConfiguration + + + org.apache.maven.archiva.indexer.RepositoryContentIndexFactory + lucene + org.apache.maven.archiva.indexer.lucene.LuceneRepositoryContentIndexFactory + Factory for Lucene repository content index instances. + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + mock + configuration + + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/resources/org/apache/maven/archiva/indexer/hashcodes/HashcodesIndexTest.xml b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/resources/org/apache/maven/archiva/indexer/hashcodes/HashcodesIndexTest.xml new file mode 100644 index 000000000..af15697a1 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/resources/org/apache/maven/archiva/indexer/hashcodes/HashcodesIndexTest.xml @@ -0,0 +1,22 @@ + + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + mock + org.apache.maven.archiva.indexer.MockConfiguration + + + org.apache.maven.archiva.indexer.RepositoryContentIndexFactory + lucene + org.apache.maven.archiva.indexer.lucene.LuceneRepositoryContentIndexFactory + Factory for Lucene repository content index instances. + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + mock + configuration + + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/resources/org/apache/maven/archiva/indexer/hashcodes/HashcodesSearchTest.xml b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/resources/org/apache/maven/archiva/indexer/hashcodes/HashcodesSearchTest.xml new file mode 100644 index 000000000..af15697a1 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/resources/org/apache/maven/archiva/indexer/hashcodes/HashcodesSearchTest.xml @@ -0,0 +1,22 @@ + + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + mock + org.apache.maven.archiva.indexer.MockConfiguration + + + org.apache.maven.archiva.indexer.RepositoryContentIndexFactory + lucene + org.apache.maven.archiva.indexer.lucene.LuceneRepositoryContentIndexFactory + Factory for Lucene repository content index instances. + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + mock + configuration + + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/resources/org/apache/maven/archiva/indexer/search/DefaultCrossRepositorySearchTest.xml b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/resources/org/apache/maven/archiva/indexer/search/DefaultCrossRepositorySearchTest.xml new file mode 100644 index 000000000..61a859c7a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-indexer/src/test/resources/org/apache/maven/archiva/indexer/search/DefaultCrossRepositorySearchTest.xml @@ -0,0 +1,40 @@ + + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + mock + org.apache.maven.archiva.indexer.MockConfiguration + + + org.apache.maven.archiva.indexer.RepositoryContentIndexFactory + lucene + org.apache.maven.archiva.indexer.lucene.LuceneRepositoryContentIndexFactory + Factory for Lucene repository content index instances. + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + mock + configuration + + + + + org.apache.maven.archiva.indexer.search.CrossRepositorySearch + default + org.apache.maven.archiva.indexer.search.DefaultCrossRepositorySearch + DefaultCrossRepositorySearch + + + org.apache.maven.archiva.indexer.RepositoryContentIndexFactory + lucene + indexFactory + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + mock + configuration + + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-model/pom.xml b/MRM-541/archiva-modules/archiva-base/archiva-model/pom.xml new file mode 100755 index 000000000..1318d53a2 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-model/pom.xml @@ -0,0 +1,156 @@ + + + + + + org.apache.archiva + archiva-base + 1.2-SNAPSHOT + + 4.0.0 + archiva-model + Archiva Base :: Model + + + commons-lang + commons-lang + + + commons-collections + commons-collections + + + org.apache.archiva + archiva-common + + + org.codehaus.plexus + plexus-spring + test + + + javax.jdo + jdo2-api + + + + + + org.codehaus.plexus + plexus-maven-plugin + + + org.codehaus.modello + modello-maven-plugin + 1.0-alpha-17 + + 1.0.0 + false + src/main/mdo/archiva-base.xml + + + + archiva-base + + java + xsd + jpox-jdo-mapping + jpox-metadata-class + + + + + + + org.codehaus.mojo + jpox-maven-plugin + 1.1.7 + + + org.apache.derby + derby + 10.2.1.6 + + + + + + enhance + + enhance + + + + + + org.codehaus.mojo + cobertura-maven-plugin + + + + + org/apache/maven/archiva/reporting/model/** + + + + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/AbstractArtifactKey.java b/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/AbstractArtifactKey.java new file mode 100644 index 000000000..7c6e2c9b5 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/AbstractArtifactKey.java @@ -0,0 +1,290 @@ +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 java.io.Serializable; + +/** + *

+ * AbstractArtifactKey - a artifact reference to a versioned project. + * This refers to all artifacts of a specific version of a project. + * This type of reference is typically used by {@link ArchivaProjectModel} objects. + *

+ * + *

+ * If you don't require things like "Version" or "Type", consider the other keys below. + *

+ * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Key TypeGroup IDArtifact IDVersionClassifierType
{@link AbstractProjectKey}YesYes   
{@link AbstractVersionedKey}YesYesYes  
{@link AbstractArtifactKey}YesYesYesYesYes
+ * + *

+ * NOTE: This is a jpox required compound key handler class. + *

+ * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class AbstractArtifactKey + implements CompoundKey, Serializable +{ + private static final long serialVersionUID = 1084250769223555422L; + + /** + * The Group ID. (JPOX Requires this remain public) + */ + public String groupId = ""; + + /** + * The Artifact ID. (JPOX Requires this remain public) + */ + public String artifactId = ""; + + /** + * The Version. (JPOX Requires this remain public) + */ + public String version = ""; + + /** + * The Classifier. (JPOX Requires this remain public) + */ + public String classifier = ""; + + /** + * The Type. (JPOX Requires this remain public) + */ + public String type = ""; + + /** + * Default Constructor. Required by JPOX. + */ + public AbstractArtifactKey() + { + /* do nothing */ + } + + /** + * Key Based Constructor. Required by JPOX. + * + * @param key the String representing this object's values. + */ + public AbstractArtifactKey( String key ) + { + String parts[] = StringUtils.splitPreserveAllTokens( key, ":" ); + groupId = parts[0]; + artifactId = parts[1]; + version = parts[2]; + classifier = parts[3]; + type = parts[4]; + } + + /** + * Get the String representation of this object. - Required by JPOX. + */ + public String toString() + { + return StringUtils.join( new String[] { groupId, artifactId, version, classifier, type }, ':' ); + } + + /** + * Get the hashcode for this object's values - Required by JPOX. + */ + public int hashCode() + { + final int PRIME = 31; + int result = super.hashCode(); + result = PRIME * result + ( ( groupId == null ) ? 0 : groupId.hashCode() ); + result = PRIME * result + ( ( artifactId == null ) ? 0 : artifactId.hashCode() ); + result = PRIME * result + ( ( version == null ) ? 0 : version.hashCode() ); + result = PRIME * result + ( ( classifier == null ) ? 0 : classifier.hashCode() ); + result = PRIME * result + ( ( type == null ) ? 0 : type.hashCode() ); + return result; + } + + /** + * Get the equals for this object's values - Required by JPOX. + */ + public boolean equals( Object obj ) + { + if ( this == obj ) + { + return true; + } + + if ( !super.equals( obj ) ) + { + return false; + } + + if ( getClass() != obj.getClass() ) + { + return false; + } + + final AbstractArtifactKey other = (AbstractArtifactKey) obj; + + if ( groupId == null ) + { + if ( other.groupId != null ) + { + return false; + } + } + else if ( !groupId.equals( other.groupId ) ) + { + return false; + } + + if ( artifactId == null ) + { + if ( other.artifactId != null ) + { + return false; + } + } + else if ( !artifactId.equals( other.artifactId ) ) + { + return false; + } + + if ( version == null ) + { + if ( other.version != null ) + { + return false; + } + } + else if ( !version.equals( other.version ) ) + { + return false; + } + + if ( classifier == null ) + { + if ( other.classifier != null ) + { + return false; + } + } + else if ( !classifier.equals( other.classifier ) ) + { + return false; + } + + if ( type == null ) + { + if ( other.type != null ) + { + return false; + } + } + else if ( !type.equals( other.type ) ) + { + return false; + } + + return true; + } + + public void setGroupId( String groupId ) + { + if ( StringUtils.isBlank( groupId ) ) + { + throw new IllegalArgumentException( "A blank Group ID is not allowed." ); + } + + this.groupId = groupId; + } + + public void setArtifactId( String artifactId ) + { + if ( StringUtils.isBlank( artifactId ) ) + { + throw new IllegalArgumentException( "A blank Artifact ID is not allowed." ); + } + + this.artifactId = artifactId; + } + + public void setVersion( String version ) + { + if ( StringUtils.isBlank( artifactId ) ) + { + throw new IllegalArgumentException( "A blank version is not allowed." ); + } + + this.version = version; + } + + public void setClassifier( String classifier ) + { + this.classifier = ""; + + if ( StringUtils.isNotBlank( classifier ) ) + { + this.classifier = classifier; + } + } + + public void setType( String type ) + { + this.type = ""; + + if ( StringUtils.isNotBlank( type ) ) + { + this.type = type; + } + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/AbstractProjectKey.java b/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/AbstractProjectKey.java new file mode 100644 index 000000000..982fba9de --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/AbstractProjectKey.java @@ -0,0 +1,182 @@ +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 java.io.Serializable; + +/** + *

+ * AbstractProjectKey - A versionless reference to a Project. + * This refers to all versions, and all artifacts of a project. + * This type of reference is typically used by {@link ArchivaRepositoryMetadata} objects. + *

+ * + *

+ * If you require things like "Version" or "Type", consider the other keys below. + *

+ * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Key TypeGroup IDArtifact IDVersionClassifierType
{@link AbstractProjectKey}YesYes   
{@link AbstractVersionedKey}YesYesYes  
{@link AbstractArtifactKey}YesYesYesYesYes
+ * + *

+ * NOTE: This is a jpox required compound key handler class. + *

+ * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class AbstractProjectKey + implements CompoundKey, Serializable +{ + private static final long serialVersionUID = 4949927971768396064L; + + /** + * The Group ID. (JPOX Requires this remain public) + */ + public String groupId = ""; + + /** + * The Artifact ID. (JPOX Requires this remain public) + */ + public String artifactId = ""; + + /** + * Default Constructor. Required by JPOX. + */ + public AbstractProjectKey() + { + /* do nothing */ + } + + /** + * Key Based Constructor. Required by JPOX. + * + * @param key the String representing this object's values. + */ + public AbstractProjectKey( String key ) + { + String parts[] = StringUtils.splitPreserveAllTokens( key, ":" ); + groupId = parts[0]; + artifactId = parts[1]; + } + + /** + * Get the String representation of this object. - Required by JPOX. + */ + public String toString() + { + return StringUtils.join( new String[] { groupId, artifactId } ); + } + + /** + * Get the hashcode for this object's values - Required by JPOX. + */ + public int hashCode() + { + final int PRIME = 31; + int result = super.hashCode(); + result = PRIME * result + ( ( groupId == null ) ? 0 : groupId.hashCode() ); + result = PRIME * result + ( ( artifactId == null ) ? 0 : artifactId.hashCode() ); + return result; + } + + /** + * Get the equals for this object's values - Required by JPOX. + */ + public boolean equals( Object obj ) + { + if ( this == obj ) + { + return true; + } + + if ( !super.equals( obj ) ) + { + return false; + } + + if ( getClass() != obj.getClass() ) + { + return false; + } + + final AbstractProjectKey other = (AbstractProjectKey) obj; + + if ( groupId == null ) + { + if ( other.groupId != null ) + { + return false; + } + } + else if ( !groupId.equals( other.groupId ) ) + { + return false; + } + + if ( artifactId == null ) + { + if ( other.artifactId != null ) + { + return false; + } + } + else if ( !artifactId.equals( other.artifactId ) ) + { + return false; + } + + return true; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/AbstractVersionedKey.java b/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/AbstractVersionedKey.java new file mode 100644 index 000000000..f536b4506 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/AbstractVersionedKey.java @@ -0,0 +1,201 @@ +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 java.io.Serializable; + +/** + *

+ * AbstractVersionedKey - a versioned reference to a Project. + * This refers to all artifacts of a specific version of a project. + * This type of reference is typically used by {@link ArchivaProjectModel} objects. + *

+ * + *

+ * If you require things like "Version" or "Type", consider the other keys below. + *

+ * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Key TypeGroup IDArtifact IDVersionClassifierType
{@link AbstractProjectKey}YesYes   
{@link AbstractVersionedKey}YesYesYes  
{@link AbstractArtifactKey}YesYesYesYesYes
+ * + *

+ * NOTE: This is a jpox required compound key handler class. + *

+ * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class AbstractVersionedKey + implements CompoundKey, Serializable +{ + private static final long serialVersionUID = -5389698374243146150L; + + /** + * The Group ID. (JPOX Requires this remain public) + */ + public String groupId = ""; + + /** + * The Artifact ID. (JPOX Requires this remain public) + */ + public String artifactId = ""; + + /** + * The Version. (JPOX Requires this remain public) + */ + public String version = ""; + + /** + * Default Constructor. Required by JPOX. + */ + public AbstractVersionedKey() + { + /* do nothing */ + } + + /** + * Key Based Constructor. Required by JPOX. + * + * @param key the String representing this object's values. + */ + public AbstractVersionedKey( String key ) + { + String parts[] = StringUtils.splitPreserveAllTokens( key, ":" ); + groupId = parts[0]; + artifactId = parts[1]; + version = parts[2]; + } + + /** + * Get the String representation of this object. - Required by JPOX. + */ + public String toString() + { + return StringUtils.join( new String[] { groupId, artifactId, version }, ':' ); + } + + /** + * Get the hashcode for this object's values - Required by JPOX. + */ + public int hashCode() + { + final int PRIME = 31; + int result = super.hashCode(); + result = PRIME * result + ( ( groupId == null ) ? 0 : groupId.hashCode() ); + result = PRIME * result + ( ( artifactId == null ) ? 0 : artifactId.hashCode() ); + result = PRIME * result + ( ( version == null ) ? 0 : version.hashCode() ); + return result; + } + + /** + * Get the equals for this object's values - Required by JPOX. + */ + public boolean equals( Object obj ) + { + if ( this == obj ) + { + return true; + } + + if ( !super.equals( obj ) ) + { + return false; + } + + if ( getClass() != obj.getClass() ) + { + return false; + } + + final AbstractVersionedKey other = (AbstractVersionedKey) obj; + + if ( groupId == null ) + { + if ( other.groupId != null ) + { + return false; + } + } + else if ( !groupId.equals( other.groupId ) ) + { + return false; + } + + if ( artifactId == null ) + { + if ( other.artifactId != null ) + { + return false; + } + } + else if ( !artifactId.equals( other.artifactId ) ) + { + return false; + } + + if ( version == null ) + { + if ( other.version != null ) + { + return false; + } + } + else if ( !version.equals( other.version ) ) + { + return false; + } + + return true; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/ArchivaArtifact.java b/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/ArchivaArtifact.java new file mode 100644 index 000000000..d7ce2a155 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/ArchivaArtifact.java @@ -0,0 +1,228 @@ +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.maven.archiva.common.utils.VersionUtil; + +/** + * ArchivaArtifact - Mutable artifact object. + * + * @author Joakim Erdfelt + * @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 ) + { + 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 ) + "]" ); + } + + 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 ) ); + + 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 ) + { + this( ref.getGroupId(), ref.getArtifactId(), ref.getVersion(), ref.getClassifier(), ref.getType() ); + } + + 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 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; + } + + 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; + } + + 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; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/ArchivaArtifactPlatformDetails.java b/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/ArchivaArtifactPlatformDetails.java new file mode 100644 index 000000000..f124ce873 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/ArchivaArtifactPlatformDetails.java @@ -0,0 +1,31 @@ +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. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public interface ArchivaArtifactPlatformDetails +{ + public String getPlatform(); +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/ArchivaModelCloner.java b/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/ArchivaModelCloner.java new file mode 100644 index 000000000..796353f02 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/ArchivaModelCloner.java @@ -0,0 +1,472 @@ +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.Iterator; +import java.util.List; +import java.util.Properties; + +/** + * Utility methods for cloning various Archiva Model objects. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ArchivaModelCloner +{ + public static ArchivaProjectModel clone( ArchivaProjectModel model ) + { + if ( model == null ) + { + return null; + } + + ArchivaProjectModel cloned = new ArchivaProjectModel(); + + cloned.setGroupId( model.getGroupId() ); + cloned.setArtifactId( model.getArtifactId() ); + cloned.setVersion( model.getVersion() ); + + cloned.setParentProject( clone( model.getParentProject() ) ); + + cloned.setName( model.getName() ); + cloned.setDescription( model.getDescription() ); + cloned.setUrl( model.getUrl() ); + cloned.setPackaging( model.getPackaging() ); + cloned.setOrigin( model.getOrigin() ); + + cloned.setMailingLists( cloneMailingLists( model.getMailingLists() ) ); + cloned.setCiManagement( clone( model.getCiManagement() ) ); + cloned.setIndividuals( cloneIndividuals( model.getIndividuals() ) ); + cloned.setIssueManagement( clone( model.getIssueManagement() ) ); + cloned.setLicenses( cloneLicenses( model.getLicenses() ) ); + cloned.setOrganization( clone( model.getOrganization() ) ); + cloned.setScm( clone( model.getScm() ) ); + cloned.setRepositories( cloneRepositories( model.getRepositories() ) ); + cloned.setDependencies( cloneDependencies( model.getDependencies() ) ); + cloned.setPlugins( clonePlugins( model.getPlugins() ) ); + cloned.setReports( cloneReports( model.getReports() ) ); + cloned.setDependencyManagement( cloneDependencies( model.getDependencyManagement() ) ); + + return cloned; + } + + 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; + } + + public static CiManagement clone( CiManagement ciManagement ) + { + if ( ciManagement == null ) + { + return null; + } + + CiManagement cloned = new CiManagement(); + + cloned.setSystem( ciManagement.getSystem() ); + cloned.setUrl( ciManagement.getUrl() ); + + return cloned; + } + + public static Dependency clone( Dependency dependency ) + { + if ( dependency == null ) + { + return null; + } + + Dependency cloned = new Dependency(); + + // Identification + cloned.setGroupId( dependency.getGroupId() ); + cloned.setArtifactId( dependency.getArtifactId() ); + cloned.setVersion( dependency.getVersion() ); + cloned.setClassifier( dependency.getClassifier() ); + cloned.setType( dependency.getType() ); + + // The rest. + cloned.setTransitive( dependency.isTransitive() ); + cloned.setScope( dependency.getScope() ); + cloned.setOptional( dependency.isOptional() ); + cloned.setSystemPath( dependency.getSystemPath() ); + cloned.setUrl( dependency.getUrl() ); + cloned.setExclusions( cloneExclusions( dependency.getExclusions() ) ); + + return cloned; + } + + public static IssueManagement clone( IssueManagement issueManagement ) + { + if ( issueManagement == null ) + { + return null; + } + + IssueManagement cloned = new IssueManagement(); + + cloned.setSystem( issueManagement.getSystem() ); + cloned.setUrl( issueManagement.getUrl() ); + + return cloned; + } + + public static MailingList clone( MailingList mailingList ) + { + if ( mailingList == null ) + { + return null; + } + + MailingList cloned = new MailingList(); + + cloned.setName( mailingList.getName() ); + cloned.setSubscribeAddress( mailingList.getSubscribeAddress() ); + cloned.setUnsubscribeAddress( mailingList.getUnsubscribeAddress() ); + cloned.setPostAddress( mailingList.getPostAddress() ); + cloned.setMainArchiveUrl( mailingList.getMainArchiveUrl() ); + cloned.setOtherArchives( cloneSimpleStringList( mailingList.getOtherArchives() ) ); + + return cloned; + } + + public static Organization clone( Organization organization ) + { + if ( organization == null ) + { + return null; + } + + Organization cloned = new Organization(); + + cloned.setFavicon( organization.getFavicon() ); + cloned.setName( organization.getName() ); + cloned.setUrl( organization.getUrl() ); + + return cloned; + } + + public static Properties clone( Properties properties ) + { + if ( properties == null ) + { + return null; + } + + Properties cloned = new Properties(); + + Enumeration keys = properties.propertyNames(); + while ( keys.hasMoreElements() ) + { + String key = (String) keys.nextElement(); + String value = properties.getProperty( key ); + cloned.setProperty( key, value ); + } + + return cloned; + } + + public static Scm clone( Scm scm ) + { + if ( scm == null ) + { + return null; + } + + Scm cloned = new Scm(); + + cloned.setConnection( scm.getConnection() ); + cloned.setDeveloperConnection( scm.getDeveloperConnection() ); + cloned.setUrl( scm.getUrl() ); + + 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 cloneArtifactReferences( List artifactReferenceList ) + { + if ( artifactReferenceList == null ) + { + return null; + } + + List ret = new ArrayList(); + + Iterator it = artifactReferenceList.iterator(); + while ( it.hasNext() ) + { + ArtifactReference artifactReference = (ArtifactReference) it.next(); + ret.add( clone( artifactReference ) ); + } + + return ret; + } + + public static List cloneDependencies( List dependencies ) + { + if ( dependencies == null ) + { + return null; + } + + List ret = new ArrayList(); + + Iterator it = dependencies.iterator(); + while ( it.hasNext() ) + { + Dependency dep = (Dependency) it.next(); + + if ( dep == null ) + { + // Skip null dependency. + continue; + } + + ret.add( clone( dep ) ); + } + + return ret; + } + + public static List cloneExclusions( List exclusions ) + { + if ( exclusions == null ) + { + return null; + } + + List ret = new ArrayList(); + + Iterator it = exclusions.iterator(); + while ( it.hasNext() ) + { + Exclusion exclusion = (Exclusion) it.next(); + Exclusion cloned = new Exclusion(); + + cloned.setGroupId( exclusion.getGroupId() ); + cloned.setArtifactId( exclusion.getArtifactId() ); + + ret.add( cloned ); + } + + return ret; + } + + public static List cloneIndividuals( List individuals ) + { + if ( individuals == null ) + { + return individuals; + } + + List ret = new ArrayList(); + + Iterator it = individuals.iterator(); + while ( it.hasNext() ) + { + Individual individual = (Individual) it.next(); + Individual cloned = new Individual(); + + cloned.setPrincipal( individual.getPrincipal() ); + + cloned.setEmail( individual.getEmail() ); + cloned.setName( individual.getName() ); + cloned.setOrganization( individual.getOrganization() ); + cloned.setOrganizationUrl( individual.getOrganizationUrl() ); + cloned.setUrl( individual.getUrl() ); + cloned.setTimezone( individual.getTimezone() ); + + cloned.setRoles( cloneRoles( individual.getRoles() ) ); + cloned.setProperties( clone( individual.getProperties() ) ); + + ret.add( cloned ); + } + + return ret; + } + + public static List cloneLicenses( List licenses ) + { + if ( licenses == null ) + { + return null; + } + + List ret = new ArrayList(); + + Iterator it = licenses.iterator(); + while ( it.hasNext() ) + { + License license = (License) it.next(); + License cloned = new License(); + + cloned.setId( license.getId() ); + cloned.setName( license.getName() ); + cloned.setUrl( license.getUrl() ); + cloned.setComments( license.getComments() ); + + ret.add( cloned ); + } + + return ret; + } + + public static List cloneMailingLists( List mailingLists ) + { + if ( mailingLists == null ) + { + return null; + } + + List ret = new ArrayList(); + + Iterator it = mailingLists.iterator(); + while ( it.hasNext() ) + { + MailingList mailingList = (MailingList) it.next(); + + if ( mailingList == null ) + { + // Skip null mailing list. + continue; + } + + ret.add( clone( mailingList ) ); + } + + return ret; + } + + public static List clonePlugins( List plugins ) + { + return cloneArtifactReferences( plugins ); + } + + public static List cloneReports( List reports ) + { + return cloneArtifactReferences( reports ); + } + + public static List cloneRepositories( List repositories ) + { + if ( repositories == null ) + { + return null; + } + + List ret = new ArrayList(); + + Iterator it = repositories.iterator(); + while ( it.hasNext() ) + { + ProjectRepository repository = (ProjectRepository) it.next(); + ProjectRepository cloned = new ProjectRepository(); + + cloned.setId( repository.getId() ); + cloned.setName( repository.getName() ); + cloned.setUrl( repository.getUrl() ); + cloned.setLayout( repository.getLayout() ); + cloned.setPlugins( repository.isPlugins() ); + cloned.setReleases( repository.isReleases() ); + cloned.setSnapshots( repository.isSnapshots() ); + + ret.add( cloned ); + } + + return ret; + } + + public static List cloneRoles( List roles ) + { + return cloneSimpleStringList( roles ); + } + + private static List cloneSimpleStringList( List simple ) + { + if ( simple == null ) + { + return null; + } + + List ret = new ArrayList(); + + Iterator it = simple.iterator(); + + while ( it.hasNext() ) + { + String txt = (String) it.next(); + ret.add( txt ); + } + + return ret; + } + + public static List cloneAvailableVersions( List availableVersions ) + { + return cloneSimpleStringList( availableVersions ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/CompoundKey.java b/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/CompoundKey.java new file mode 100644 index 000000000..b09230d37 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/CompoundKey.java @@ -0,0 +1,31 @@ +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 + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public interface CompoundKey +{ + public String toString(); +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/DependencyScope.java b/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/DependencyScope.java new file mode 100644 index 000000000..7cda4f8ac --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/DependencyScope.java @@ -0,0 +1,103 @@ +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.collections.map.MultiValueMap; +import org.apache.commons.lang.StringUtils; + +/** + * DependencyScope - utility methods and constants for working with scopes. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class DependencyScope +{ + public static final String SYSTEM = "system"; + + public static final String COMPILE = "compile"; + + public static final String PROVIDED = "provided"; + + public static final String RUNTIME = "runtime"; + + public static final String TEST = "test"; + + private static final MultiValueMap scopeMap; + + static + { + // Store the map of scopes to what other scopes are 'within' that scope. + scopeMap = new MultiValueMap(); + + scopeMap.put( COMPILE, COMPILE ); + scopeMap.put( COMPILE, RUNTIME ); + scopeMap.put( COMPILE, PROVIDED ); + scopeMap.put( COMPILE, SYSTEM ); + + scopeMap.put( TEST, COMPILE ); + scopeMap.put( TEST, RUNTIME ); + scopeMap.put( TEST, PROVIDED ); + scopeMap.put( TEST, SYSTEM ); + scopeMap.put( TEST, TEST ); + + scopeMap.put( RUNTIME, RUNTIME ); + scopeMap.put( RUNTIME, PROVIDED ); + scopeMap.put( RUNTIME, SYSTEM ); + + scopeMap.put( PROVIDED, RUNTIME ); + scopeMap.put( PROVIDED, PROVIDED ); + scopeMap.put( PROVIDED, SYSTEM ); + + scopeMap.put( SYSTEM, SYSTEM ); + } + + public static boolean isSystemScoped( Dependency dep ) + { + return StringUtils.equals( SYSTEM, dep.getScope() ); + } + + /** + * Test the provided scope against the desired scope to see if it is + * within that scope's pervue. + * + * Examples: + * actual:compile, desired:test = true + * actual:compile, desired:compile = true + * actual:test, desired:compile = false + * actual:provided, desired:compile = false + * + * @param actualScope + * @param desiredScope + * @return + */ + public static boolean isWithinScope( String actualScope, String desiredScope ) + { + if ( StringUtils.isBlank( desiredScope ) ) + { + // nothing desired? everything should fail. + return false; + } + + String scope = StringUtils.defaultIfEmpty( actualScope, COMPILE ); + + return scopeMap.containsValue( desiredScope, scope ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/Keys.java b/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/Keys.java new file mode 100644 index 000000000..db8277492 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/Keys.java @@ -0,0 +1,80 @@ +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. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class Keys +{ + public static String toKey( ArchivaProjectModel model ) + { + return toKey( model.getGroupId(), model.getArtifactId(), model.getVersion() ); + } + + 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() ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/RepositoryProblemReport.java b/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/RepositoryProblemReport.java new file mode 100644 index 000000000..e34665e38 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/RepositoryProblemReport.java @@ -0,0 +1,80 @@ +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. + */ + +/** + * RepositoryProblemReport + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class RepositoryProblemReport + extends RepositoryProblem +{ + private static final long serialVersionUID = 4990893576717148324L; + + protected String groupURL; + + protected String artifactURL; + + protected String versionURL; + + public RepositoryProblemReport( RepositoryProblem repositoryProblem ) + { + setGroupId( repositoryProblem.getGroupId() ); + setArtifactId( repositoryProblem.getArtifactId() ); + setVersion( repositoryProblem.getVersion() ); + setMessage( repositoryProblem.getMessage() ); + setOrigin( repositoryProblem.getOrigin() ); + setPath( repositoryProblem.getPath() ); + setType( repositoryProblem.getType() ); + setRepositoryId( repositoryProblem.getRepositoryId() ); + } + + public void setGroupURL( String groupURL ) + { + this.groupURL = groupURL; + } + + public String getGroupURL() + { + return groupURL; + } + + public void setArtifactURL( String artifactURL ) + { + this.artifactURL = artifactURL; + } + + public String getArtifactURL() + { + return artifactURL; + } + + public void setVersionURL( String versionURL ) + { + this.versionURL = versionURL; + } + + public String getVersionURL() + { + return versionURL; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/RepositoryURL.java b/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/RepositoryURL.java new file mode 100644 index 000000000..e0ddde87c --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/RepositoryURL.java @@ -0,0 +1,170 @@ +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. + * + * @author Joakim Erdfelt + * @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; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/functors/UnprocessedArtifactPredicate.java b/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/functors/UnprocessedArtifactPredicate.java new file mode 100644 index 000000000..b535b6bd8 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/functors/UnprocessedArtifactPredicate.java @@ -0,0 +1,59 @@ +package org.apache.maven.archiva.model.functors; + +/* + * 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.collections.Predicate; +import org.apache.maven.archiva.model.ArchivaArtifact; +import org.apache.maven.archiva.model.ArchivaArtifactModel; + +/** + * Allows for selection of unprocessed artifacts. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class UnprocessedArtifactPredicate + implements Predicate +{ + private static UnprocessedArtifactPredicate INSTANCE = new UnprocessedArtifactPredicate(); + + public static UnprocessedArtifactPredicate getInstance() + { + return INSTANCE; + } + + public boolean evaluate( Object object ) + { + boolean satisfies = false; + + if ( object instanceof ArchivaArtifact ) + { + ArchivaArtifact artifact = (ArchivaArtifact) object; + satisfies = !artifact.getModel().isProcessed(); + } + else if ( object instanceof ArchivaArtifactModel ) + { + ArchivaArtifactModel model = (ArchivaArtifactModel) object; + satisfies = !model.isProcessed(); + } + + return satisfies; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/ArchivaArtifactJavaDetailsKey.java b/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/ArchivaArtifactJavaDetailsKey.java new file mode 100644 index 000000000..6ad012f44 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/ArchivaArtifactJavaDetailsKey.java @@ -0,0 +1,47 @@ +package org.apache.maven.archiva.model.jpox; + +/* + * 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.archiva.model.AbstractArtifactKey; + +import java.io.Serializable; + +/** + * ArchivaArtifactJavaDetailsKey - unique classid-key for JPOX. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ArchivaArtifactJavaDetailsKey + extends AbstractArtifactKey + implements Serializable +{ + private static final long serialVersionUID = -2565748477203220905L; + + public ArchivaArtifactJavaDetailsKey() + { + } + + public ArchivaArtifactJavaDetailsKey( String key ) + { + super( key ); + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/ArchivaArtifactModelKey.java b/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/ArchivaArtifactModelKey.java new file mode 100644 index 000000000..8988d4967 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/ArchivaArtifactModelKey.java @@ -0,0 +1,47 @@ +package org.apache.maven.archiva.model.jpox; + +/* + * 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.archiva.model.AbstractArtifactKey; + +import java.io.Serializable; + +/** + * ArchivaArtifactModelKey - unique classid-key for JPOX. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ArchivaArtifactModelKey + extends AbstractArtifactKey + implements Serializable +{ + private static final long serialVersionUID = -6381910527697704289L; + + public ArchivaArtifactModelKey() + { + super(); + } + + public ArchivaArtifactModelKey( String key ) + { + super( key ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/ArchivaProjectModelKey.java b/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/ArchivaProjectModelKey.java new file mode 100644 index 000000000..0d9614e2e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/ArchivaProjectModelKey.java @@ -0,0 +1,47 @@ +package org.apache.maven.archiva.model.jpox; + +/* + * 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.archiva.model.AbstractVersionedKey; + +import java.io.Serializable; + +/** + * ArchivaProjectModelKey - unique classid-key for JPOX. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ArchivaProjectModelKey + extends AbstractVersionedKey + implements Serializable +{ + private static final long serialVersionUID = 7789859208617327581L; + + public ArchivaProjectModelKey() + { + } + + public ArchivaProjectModelKey( String key ) + { + super( key ); + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/ArchivaRepositoryMetadataKey.java b/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/ArchivaRepositoryMetadataKey.java new file mode 100644 index 000000000..1542f5381 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/ArchivaRepositoryMetadataKey.java @@ -0,0 +1,47 @@ +package org.apache.maven.archiva.model.jpox; + +/* + * 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.archiva.model.AbstractVersionedKey; + +import java.io.Serializable; + +/** + * ArchivaRepositoryMetadataKey - unique classid-key for JPOX. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ArchivaRepositoryMetadataKey + extends AbstractVersionedKey + implements Serializable +{ + private static final long serialVersionUID = -7288079965200698253L; + + public ArchivaRepositoryMetadataKey() + { + } + + public ArchivaRepositoryMetadataKey( String key ) + { + super( key ); + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/ArtifactReferenceKey.java b/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/ArtifactReferenceKey.java new file mode 100644 index 000000000..121ebc7d0 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/ArtifactReferenceKey.java @@ -0,0 +1,47 @@ +package org.apache.maven.archiva.model.jpox; + +/* + * 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.archiva.model.AbstractArtifactKey; + +import java.io.Serializable; + +/** + * ArtifactReferenceKey - unique classid-key for JPOX. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ArtifactReferenceKey + extends AbstractArtifactKey + implements Serializable +{ + private static final long serialVersionUID = 2107985498806534183L; + + public ArtifactReferenceKey() + { + } + + public ArtifactReferenceKey( String key ) + { + super( key ); + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/ProjectReferenceKey.java b/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/ProjectReferenceKey.java new file mode 100644 index 000000000..85156ffb5 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/ProjectReferenceKey.java @@ -0,0 +1,47 @@ +package org.apache.maven.archiva.model.jpox; + +/* + * 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.archiva.model.AbstractProjectKey; + +import java.io.Serializable; + +/** + * ProjectReferenceKey - unique classid-key for JPOX. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ProjectReferenceKey + extends AbstractProjectKey + implements Serializable +{ + private static final long serialVersionUID = 7803774484166902823L; + + public ProjectReferenceKey() + { + super(); + } + + public ProjectReferenceKey( String key ) + { + super( key ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/VersionedReferenceKey.java b/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/VersionedReferenceKey.java new file mode 100644 index 000000000..f002f61d6 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/jpox/VersionedReferenceKey.java @@ -0,0 +1,48 @@ +package org.apache.maven.archiva.model.jpox; + +/* + * 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.archiva.model.AbstractVersionedKey; + +import java.io.Serializable; + +/** + * VersionedReferenceKey - unique classid-key for JPOX. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class VersionedReferenceKey + extends AbstractVersionedKey + implements Serializable +{ + private static final long serialVersionUID = -5040195285240958302L; + + public VersionedReferenceKey() + { + + } + + public VersionedReferenceKey( String key ) + { + super( key ); + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/platform/JavaArtifactHelper.java b/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/platform/JavaArtifactHelper.java new file mode 100644 index 000000000..2b021b63a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/maven/archiva/model/platform/JavaArtifactHelper.java @@ -0,0 +1,44 @@ +package org.apache.maven.archiva.model.platform; + +/* + * 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.archiva.model.ArchivaArtifact; +import org.apache.maven.archiva.model.ArchivaArtifactJavaDetails; + +/** + * Utility methods for working with java platform specific ArchivaArtifacts. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class JavaArtifactHelper +{ + public static ArchivaArtifactJavaDetails getJavaDetails( ArchivaArtifact artifact ) + { + ArchivaArtifactJavaDetails javaDetails = (ArchivaArtifactJavaDetails) artifact.getPlatformDetails(); + if ( javaDetails == null ) + { + javaDetails = new ArchivaArtifactJavaDetails(); + artifact.setPlatformDetails( javaDetails ); + } + + return javaDetails; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/mdo/archiva-base.xml b/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/mdo/archiva-base.xml new file mode 100644 index 000000000..9bf4c2017 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-model/src/main/mdo/archiva-base.xml @@ -0,0 +1,2360 @@ + + + archiva-base-model + ArchivaBaseModel + 1.0.0 + Archiva Model + + + package + org.apache.maven.archiva.model + + + + + + ArchivaAll + 1.0.0+ + + This object is only used for the XML backup / restore features of Archiva. + This object is not serialized to the Database. + + + + + artifacts + 1.0.0+ + + ArchivaArtifactModel + * + + + + repositoryMetadata + 1.0.0+ + + ArchivaRepositoryMetadata + * + + + + projects + 1.0.0+ + + ArchivaProjectModel + * + + + + repositoryProblems + 1.0.0+ + + RepositoryProblem + * + + + + repositoryContentStatistics + 1.0.0+ + + RepositoryContentStatistics + * + + + + + + 1.0.0+ + + + + + + + + + + + + ArchivaArtifactModel + 1.0.0+ + + + + groupId + true + 1.0.0+ + String + true + + The Group ID of the repository content. + + + + artifactId + true + 1.0.0+ + String + true + + The Artifact ID of the repository content. + + + + version + true + 1.0.0+ + String + true + + The version of the repository content. + + + + classifier + true + 1.0.0+ + String + true + + The classifier for this artifact. + + + + type + true + 1.0.0+ + String + true + + The type of artifact. + + + + repositoryId + false + 1.0.0+ + false + String + + The repository associated with this content. + + + + snapshot + false + 1.0.0+ + boolean + true + + True if this is a snapshot. + + false + + + checksumMD5 + false + 1.0.0+ + String + false + + The MD5 checksum for the artifact file. + + + + checksumSHA1 + false + 1.0.0+ + String + false + + The SHA1 checksum for the artifact file. + + + + lastModified + false + 1.0.0+ + Date + true + + The Last Modified Timestamp of this artifact. + + + + size + false + 1.0.0+ + long + true + + The size of the artifact on disk. + + + + platform + false + 1.0.0+ + String + true + + The platform of this artifact. (default: "java") + + java + + + whenIndexed + false + 1.0.0+ + Date + false + + The timestamp when this artifact was indexed. + + + + whenProcessed + false + 1.0.0+ + Date + false + + When this artifact's contents was processed. + + + + origin + false + 1.0.0+ + String + false + + The origin of this artifact. (Filesystem, Proxy, Deploy) + + + + whenGathered + false + 1.0.0+ + Date + false + + When this artifact was gathered or disovered from the repository. + + + + + + 1.0.0+ + + + + 1.0.0+ + + + + + + ArchivaArtifactJavaDetails + + org.apache.maven.archiva.model.ArchivaArtifactPlatformDetails + + 1.0.0+ + + + groupId + true + 1.0.0+ + String + true + + The Group ID of the repository content. + + + + artifactId + true + 1.0.0+ + String + true + + The Artifact ID of the repository content. + + + + version + true + 1.0.0+ + String + true + + The version of the repository content. + + + + classifier + true + 1.0.0+ + String + true + + The classifier for this artifact. + + + + type + true + 1.0.0+ + String + true + + The type of artifact. + + + + checksumBytecode + false + 1.0.0+ + String + false + + The SHA1 checksum for the bytecode in the artifact file. (Can be empty if + the artifact contains no bytecode) + + + + jdk + false + 1.0.0+ + String + false + + The JDK revision of the bytecode. (Can be empty if the artifact contains no bytecode) + + + + + + 1.0.0+ + + + + 1.0.0+ + + + + + + + + + ArchivaRepositoryMetadata + 1.0.0+ + + + groupId + true + 1.0.0+ + String + true + + The Group ID of the metadata. + + + + artifactId + true + 1.0.0+ + String + true + + The Artifact ID of the metadata. + + + + version + true + 1.0.0+ + String + true + + The Version of the metadata. + + + + latestVersion + false + 1.0.0+ + false + String + + The latest version id. + + + + releasedVersion + false + 1.0.0+ + false + String + + The released version id. + + + + snapshotVersion + false + 1.0.0+ + false + + The snapshot version id. + + + SnapshotVersion + 1 + + + + plugins + false + 1.0.0+ + false + + The available plugins. + + + Plugin + * + + + + availableVersions + false + 1.0.0+ + false + + String + * + + + The list of available version ids. + + + + lastUpdated + false + 1.0.0+ + String + true + + When the metadata was last updated. + + + + fileLastModified + false + 1.0.0+ + Date + true + + The Last Modified Timestamp of this file. + + + + fileSize + false + 1.0.0+ + long + true + + The size of the artifact on disk. + + + + whenIndexed + false + 1.0.0+ + Date + false + + The timestamp when this artifact was indexed. + + + + origin + false + 1.0.0+ + String + false + + The origin of this artifact. (Filesystem, Proxy, Deploy) + + + + + + 1.0.0+ + + + + 1.0.0 + + public void updateTimestamp() + { + setLastUpdatedTimestamp( new java.util.Date() ); + } + + public void setLastUpdatedTimestamp( java.util.Date date ) + { + java.util.TimeZone timezone = java.util.TimeZone.getTimeZone( "UTC" ); + java.text.DateFormat fmt = new java.text.SimpleDateFormat( "yyyyMMddHHmmss" ); + fmt.setTimeZone( timezone ); + setLastUpdated( fmt.format( date ) ); + } + + + + + + + SnapshotVersion + The Snapshot Version + 1.0.0+ + + + timestamp + String + false + true + + The unique timestamp for the snapshot version. + + + + buildNumber + int + false + true + The incremental build number of the snapshot. + + + + + 1.0.0+ + + + + + + + Plugin + The Plugin + 1.0.0+ + + + prefix + String + false + true + + The prefix for a plugin + + + + artifactId + String + true + true + + The artifactId for a plugin + + + + name + String + false + true + + The name for a plugin + + + + + + + + + + ProjectReference + A reference to another (unversioned) Project + 1.0.0+ + + + groupId + false + 1.0.0+ + String + true + + The Group ID of the project reference. + + + + artifactId + false + 1.0.0+ + String + true + + The Artifact ID of the project reference. + + + + + + 1.0.0+ + + + + 1.0.0+ + + + + + + + VersionedReference + A reference to another Versioned Project + 1.0.0+ + + + groupId + false + 1.0.0+ + String + true + + The Group ID of the repository content. + + + + artifactId + false + 1.0.0+ + String + true + + The Artifact ID of the repository content. + + + + version + false + 1.0.0+ + String + false + + The version of the repository content. + + + + + + 1.0.0+ + + + + 1.0.0+ + + + + + + + ArtifactReference + 1.0.0+ + + + groupId + false + 1.0.0+ + String + true + + The Group ID of the repository content. + + + + artifactId + false + 1.0.0+ + String + true + + The Artifact ID of the repository content. + + + + version + false + 1.0.0+ + String + false + + The version of the repository content. + + + + classifier + false + 1.0.0+ + String + true + + The classifier for this artifact. + + + + type + false + 1.0.0+ + String + true + + The type of artifact. + + + + + + 1.0.0+ + + + + 1.0.0+ + + + + 1.0.0+ + + + + + + + + + ArchivaProjectModel + 1.0.0+ + + + groupId + true + 1.0.0+ + String + true + + The Group ID of the repository content. + + + + artifactId + true + 1.0.0+ + String + true + + The Artifact ID of the repository content. + + + + version + true + 1.0.0+ + String + true + + The version of the repository content. + + + + parentProject + false + 1.0.0+ + false + + VersionedReference + 1 + + + The content key for a parent reference. + + + + packaging + false + 1.0.0+ + true + String + + The declared packaging for this project model. + + + + name + false + 1.0.0+ + false + String + + The name of this project. + + + + description + false + 1.0.0+ + false + String + + The description of this project. + + + + origin + false + 1.0.0+ + true + String + + The Origin of this Model. (Filesystem, Proxy, or Deploy) + + + + whenIndexed + false + 1.0.0+ + false + Date + + The timestamp when this model was indexed. + + + + url + false + 1.0.0+ + false + String + + The URL for the project's homepage. + + + + organization + false + 1.0.0+ + false + + Organization + + + + licenses + false + 1.0.0+ + false + + License + * + + + + mailingLists + 1.0.0+ + The mailing lists. + false + + MailingList + * + + + + issueManagement + 1.0.0+ + + + IssueManagement + + + + ciManagement + 1.0.0+ + + + CiManagement + + + + scm + 1.0.0+ + + + + Scm + + + + individuals + 1.0.0+ + + The list of individuals around this project. + + + Individual + * + + + + dependencies + 1.0.0+ + + + Dependency + * + + + + dependencyManagement + 1.0.0+ + + The list of dependency management settings. + + + Dependency + * + + + + repositories + 1.0.0+ + + The list project repositories in use by this project. + + + ProjectRepository + * + + + + plugins + 1.0.0+ + + The list of plugins that this project uses. + + + ArtifactReference + * + + + + reports + 1.0.0+ + + The list of reports that this project uses. + + + ArtifactReference + * + + + + buildExtensions + 1.0.0+ + + The list of build extensions that this project uses. + + + ArtifactReference + * + + + + properties + 1.0.0+ + + Properties + + String + * + + + + relocation + 1.0.0+ + If relocated, this is the new location reference + + VersionedReference + 1 + + + + + + 1.0.0+ + + + + 1.0.0+ + + + + + + + MailingList + A Mailing List + 1.0.0+ + + + name + 1.0.0+ + The name of the mailing list. + String + + + subscribeAddress + 1.0.0+ + The email address to subscribe to this mailing list. + String + + + unsubscribeAddress + 1.0.0+ + The email address to unsubscribe to this mailing list. + String + + + postAddress + 1.0.0+ + The email address to post to this mailing list. + String + + + mainArchiveUrl + 1.0.0+ + The url to the archive for this mailing list. + String + + + otherArchives + 1.0.0+ + The email address to subscribe to this mailing list. + + String + * + + + + + + 1.0.0+ + + + + + + + Organization + Specifies the organization that produces this project. + 1.0.0+ + + + name + true + 1.0.0+ + + String + + + url + 1.0.0+ + + String + + + favicon + 1.0.0+ + /images/org-logo.png) or an absolute URL + (e.g., http://my.corp/logo.png). This value is used + when generating the project documentation. + ]]> + String + + + + + 1.0.0+ + + + + + + + License + + 1.0.0+ + + + id + true + 1.0.0+ + int + + The type of license. + + + + name + 1.0.0+ + + String + + + url + 1.0.0+ + + String + + + comments + + Addendum information pertaining to this license. + + 1.0.0+ + String + + + + + 1.0.0+ + + + + + + + IssueManagement + + Information about the issue tracking (or bug tracking) system used to manage this project. + + 1.0.0+ + + + url + true + 1.0.0+ + + String + + + system + 1.0.0+ + + String + + + + + 1.0.0+ + + + + + + + CiManagement + 1.0.0+ + + + url + true + 1.0.0+ + + + String + + + system + 1.0.0+ + + continuum.]]> + String + + + + + 1.0.0+ + + + + + + + Individual + + Description of a person who has contributed to the project. + This includes contributors and commitors. + + 1.0.0+ + + + email + true + 1.0.0+ + + String + + + name + 1.0.0+ + + String + + + principal + 1.0.0+ + + The RedBack (plexus security) principal associated with this Invididual. + + String + + + commitor + 1.0.0+ + + The flag if this user is a developer and/or commitor. + + boolean + + + url + 1.0.0+ + + String + + + + organization + organisation + 1.0.0+ + + String + + + organizationUrl + organisationUrl + 1.0.0+ + + String + + + roles + 1.0.0+ + role element, the body of which is a + role name. This can also be used to describe the contribution. + ]]> + + String + * + + + + timezone + 1.0.0+ + + String + + + properties + 1.0.0+ + + Properties + + String + * + + + + + + 1.0.0+ + + + + + + + Dependency + 1.0.0+ + + + groupId + 1.0.0+ + String + true + + The Group ID of the repository content. + + + + artifactId + 1.0.0+ + String + true + + The Artifact ID of the repository content. + + + + version + 1.0.0+ + String + false + + The version of the repository content. + + + + classifier + 1.0.0+ + String + false + + jdk14 and jdk15. + ]]> + + + type + 1.0.0+ + String + true + jar. While it usually represents the extension on + the filename of the dependency, that is not always the case. A type can be mapped to a different + extension and a classifier. + The type often correspongs to the packaging used, though this is also not always the case. + Some examples are jar, war, ejb-client and test-jar. + New types can be defined by plugins that set + extensions to true, so this is not a complete list. + ]]> + jar + + + transitive + 1.0.0+ + false + True if the dependency is only here due a transitive resolution + boolean + + + + fromParent + 1.0.0+ + false + True if the dependency is only here due a parent pom + boolean + + + + url + 1.0.0+ + + String + + + scope + 1.0.0+ + compile, runtime, test, + system, and provided. Used to + calculate the various classpaths used for compilation, testing, and so on. It also assists in determining + which artifacts to include in a distribution of this project. For more information, see + the + dependency mechanism. + ]]> + + String + + + systemPath + 1.0.0+ + discouraged and may be replaced in later + versions. This specifies the path on the filesystem for this dependency. + Requires an absolute path for the value, not relative. + Use a property that gives the machine specific absolute path, + e.g. ${java.home}. + ]]> + String + + + exclusions + 1.0.0+ + + Lists a set of artifacts that should be excluded from this dependency's artifact list when it comes to + calculating transitive dependencies. + + + Exclusion + * + + + + optional + 1.0.0+ + + Indicates the dependency is optional for use of this library. While the version of the dependency will be + taken into account for dependency calculation if the library is used elsewhere, it will not be passed on + transitively. + + boolean + false + + + + + 1.0.0+ + + + + 1.0.0+ + + + + + + + Exclusion + 1.0.0+ + + + groupId + 1.0.0+ + + String + true + + + artifactId + 1.0.0+ + + String + true + + + + + 1.0.0+ + + + + + + + Scm + 1.0.0+ + + + connection + 1.0.0+ + URL format + and list of supported SCMs. + This connection is read-only. + ]]> + String + + + developerConnection + 1.0.0+ + connection, but for developers, i.e. this scm connection + will not be read only. + ]]> + String + + + url + 1.0.0+ + + + String + + + + + 1.0.0+ + + + + + + + ProjectRepository + 1.0.0+ + + + id + 1.0.0+ + settings.xml file, for example. + ]]> + String + + + name + 1.0.0+ + + String + + + url + 1.0.0+ + protocol://hostname/path. + ]]> + String + + + layout + 1.0.0+ + legacy or + default. + ]]> + String + default + + + plugins + 1.0.0+ + + Flag indicating if this repository is for plugin resolution. + + boolean + + + releases + 1.0.0+ + + Flag indicating if this repository has release versioned artifacts. + + boolean + + + snapshots + 1.0.0+ + + Flag indicating if this repository has snapshot versioned artifacts. + + boolean + + + + + 1.0.0+ + + + + + + + + + RepositoryProblem + 1.0.0+ + + + repositoryId + 1.0.0+ + true + String + + The repository associated with this path and problem. + + + + path + 1.0.0+ + String + true + + The path into the repository for the problem. + + + + groupId + 1.0.0+ + String + false + + The Group ID of the repository content with the problem. + + + + artifactId + 1.0.0+ + String + false + + The Artifact ID of the repository content with the problem. + + + + version + 1.0.0+ + String + false + + The version of the repository content with the problem. + + + + type + false + 1.0.0+ + true + String + + The type of health problem. + + + + origin + false + 1.0.0+ + true + String + + The origin of the health problem. + + + + message + false + 1.0.0+ + true + String + + The origin of the health problem. + + + + + + 1.0.0+ + + + + + + + + + RepositoryContentStatistics + 1.0.0+ + + + repositoryId + 1.0.0+ + false + true + String + + The repository id the statistics belong to. + + + + whenGathered + 1.0.0+ + false + true + Date + + The timestamp on when this set of statistics was gathered. + + + + duration + 1.0.0+ + false + true + long + + The duration (in milliseconds) for the gathering of the statistics. + + + + totalFileCount + 1.0.0+ + false + true + long + + The total number of files in the repository. + + + + newFileCount + 1.0.0+ + false + true + long + + The number of new files discovered. + + + + + + 1.0.0+ + + + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-model/src/test/java/org/apache/maven/archiva/model/ArchivaArtifactTest.java b/MRM-541/archiva-modules/archiva-base/archiva-model/src/test/java/org/apache/maven/archiva/model/ArchivaArtifactTest.java new file mode 100644 index 000000000..a3564207c --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-model/src/test/java/org/apache/maven/archiva/model/ArchivaArtifactTest.java @@ -0,0 +1,47 @@ +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.Date; + +import org.codehaus.plexus.spring.PlexusInSpringTestCase; + +/** + * ArchivaModelClonerTest + * + * @author Joakim Erdfelt + * @version $Id: ArchivaModelClonerTest.java 525951 2007-04-05 20:11:19Z joakime $ + */ +public class ArchivaArtifactTest + extends PlexusInSpringTestCase +{ + public void testArtifactModelProcessed() + { + ArchivaArtifactModel model = new ArchivaArtifactModel(); + + assertNull( "whenProcessed", model.getWhenProcessed() ); + assertFalse( "isProcessed", model.isProcessed() ); + + model.setWhenProcessed( new Date() ); + + assertTrue( "isProcessed", model.isProcessed() ); + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-model/src/test/java/org/apache/maven/archiva/model/ArchivaModelClonerTest.java b/MRM-541/archiva-modules/archiva-base/archiva-model/src/test/java/org/apache/maven/archiva/model/ArchivaModelClonerTest.java new file mode 100644 index 000000000..79225aa97 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-model/src/test/java/org/apache/maven/archiva/model/ArchivaModelClonerTest.java @@ -0,0 +1,60 @@ +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.codehaus.plexus.spring.PlexusInSpringTestCase; + +/** + * ArchivaModelClonerTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ArchivaModelClonerTest + extends PlexusInSpringTestCase +{ + public void testCloneProjectModelWithParent() + { + ArchivaProjectModel actualModel = new ArchivaProjectModel(); + actualModel.setGroupId( null ); + actualModel.setArtifactId( "archiva-common" ); + actualModel.setVersion( null ); + actualModel.setParentProject( new VersionedReference() ); + actualModel.getParentProject().setGroupId( "org.apache.maven.archiva" ); + actualModel.getParentProject().setArtifactId( "archiva-parent" ); + actualModel.getParentProject().setVersion( "1.0" ); + + ArchivaProjectModel clonedModel = ArchivaModelCloner.clone( actualModel ); + + // Should not be the same object (in memory) + assertNotSame( clonedModel, actualModel ); + + // Should be equal in value. + assertEquals( clonedModel, actualModel ); + + // Test specific fields. + assertNull( "Group Id", clonedModel.getGroupId() ); + assertNull( "Version", clonedModel.getVersion() ); + assertNotNull( "Parent Reference", clonedModel.getParentProject() ); + assertEquals( "Parent Group Id", "org.apache.maven.archiva", clonedModel.getParentProject().getGroupId() ); + assertEquals( "Parent Artifact Id", "archiva-parent", clonedModel.getParentProject().getArtifactId() ); + assertEquals( "Parent Version", "1.0", clonedModel.getParentProject().getVersion() ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-model/src/test/java/org/apache/maven/archiva/model/DependencyScopeTest.java b/MRM-541/archiva-modules/archiva-base/archiva-model/src/test/java/org/apache/maven/archiva/model/DependencyScopeTest.java new file mode 100644 index 000000000..9bf308dd4 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-model/src/test/java/org/apache/maven/archiva/model/DependencyScopeTest.java @@ -0,0 +1,73 @@ +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; + +/** + * DependencyScopeTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class DependencyScopeTest + extends TestCase +{ + public void testIsWithinScope() + { + // Test on blank / empty desired scopes. + assertFalse( DependencyScope.isWithinScope( "compile", null ) ); + assertFalse( DependencyScope.isWithinScope( "test", null ) ); + assertFalse( DependencyScope.isWithinScope( "runtime", null ) ); + assertFalse( DependencyScope.isWithinScope( "provided", null ) ); + assertFalse( DependencyScope.isWithinScope( "compile", "" ) ); + assertFalse( DependencyScope.isWithinScope( "test", "" ) ); + assertFalse( DependencyScope.isWithinScope( "runtime", "" ) ); + assertFalse( DependencyScope.isWithinScope( "provided", "" ) ); + + // Tests on blank / empty actual scopes. + assertTrue( DependencyScope.isWithinScope( "", DependencyScope.COMPILE ) ); + assertTrue( DependencyScope.isWithinScope( null, DependencyScope.COMPILE ) ); + assertTrue( DependencyScope.isWithinScope( "", DependencyScope.TEST ) ); + assertTrue( DependencyScope.isWithinScope( null, DependencyScope.TEST ) ); + assertFalse( DependencyScope.isWithinScope( "", DependencyScope.PROVIDED ) ); + assertFalse( DependencyScope.isWithinScope( null, DependencyScope.PROVIDED ) ); + assertFalse( DependencyScope.isWithinScope( "", DependencyScope.RUNTIME ) ); + assertFalse( DependencyScope.isWithinScope( null, DependencyScope.RUNTIME ) ); + + // Tests on compile desired scopes. + assertTrue( DependencyScope.isWithinScope( "compile", DependencyScope.COMPILE ) ); + assertFalse( DependencyScope.isWithinScope( "test", DependencyScope.COMPILE ) ); + + // Tests on test desired scopes. + assertTrue( DependencyScope.isWithinScope( "compile", DependencyScope.TEST ) ); + assertTrue( DependencyScope.isWithinScope( "test", DependencyScope.TEST ) ); + + // Tests on oddball scopes. + assertFalse( DependencyScope.isWithinScope( "compile", DependencyScope.PROVIDED ) ); + assertFalse( DependencyScope.isWithinScope( "test", DependencyScope.PROVIDED ) ); + assertTrue( DependencyScope.isWithinScope( "provided", DependencyScope.PROVIDED ) ); + + assertFalse( DependencyScope.isWithinScope( "compile", DependencyScope.RUNTIME ) ); + assertFalse( DependencyScope.isWithinScope( "test", DependencyScope.RUNTIME ) ); + assertTrue( DependencyScope.isWithinScope( "provided", DependencyScope.RUNTIME ) ); + assertTrue( DependencyScope.isWithinScope( "runtime", DependencyScope.RUNTIME ) ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-model/src/test/java/org/apache/maven/archiva/model/RepositoryURLTest.java b/MRM-541/archiva-modules/archiva-base/archiva-model/src/test/java/org/apache/maven/archiva/model/RepositoryURLTest.java new file mode 100644 index 000000000..8c7a2dfc0 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-model/src/test/java/org/apache/maven/archiva/model/RepositoryURLTest.java @@ -0,0 +1,97 @@ +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 + * + * @author Joakim Erdfelt + * @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 ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-model/src/test/resources/log4j.xml b/MRM-541/archiva-modules/archiva-base/archiva-model/src/test/resources/log4j.xml new file mode 100644 index 000000000..395941ac3 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-model/src/test/resources/log4j.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-policies/pom.xml b/MRM-541/archiva-modules/archiva-base/archiva-policies/pom.xml new file mode 100644 index 000000000..7489f08bc --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-policies/pom.xml @@ -0,0 +1,76 @@ + + + + + + org.apache.archiva + archiva-base + 1.2-SNAPSHOT + + 4.0.0 + archiva-policies + Archiva Base :: Policies + + + org.apache.archiva + archiva-common + + + org.apache.archiva + archiva-checksum + + + org.codehaus.plexus + plexus-spring + test + + + commons-lang + commons-lang + + + org.codehaus.plexus.cache + plexus-cache-ehcache + + + + + + org.codehaus.plexus + plexus-maven-plugin + + + merge + + merge-descriptors + + + ${project.build.directory}/generated-resources/plexus/META-INF/plexus/components.xml + + ${basedir}/src/main/resources/META-INF/plexus/components-fragment.xml + ${project.build.directory}/generated-resources/plexus/META-INF/plexus/components.xml + + + + + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/AbstractUpdatePolicy.java b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/AbstractUpdatePolicy.java new file mode 100644 index 000000000..0b44c7c67 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/AbstractUpdatePolicy.java @@ -0,0 +1,209 @@ +package org.apache.maven.archiva.policies; + +/* + * 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; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.List; +import java.util.Properties; + +import org.apache.commons.lang.StringUtils; +import org.apache.maven.archiva.common.utils.VersionUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * AbstractUpdatePolicy + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public abstract class AbstractUpdatePolicy + implements PreDownloadPolicy +{ + private Logger log = LoggerFactory.getLogger( AbstractUpdatePolicy.class ); + + /** + * The ALWAYS policy setting means that the artifact is always uipdated from the remote repo. + */ + public static final String ALWAYS = "always"; + + /** + * The NEVER policy setting means that the artifact is never updated from the remote repo. + */ + public static final String NEVER = "never"; + + /** + *

+ * The DAILY policy means that the artifact retrieval occurs only if one of + * the following conditions are met... + *

+ *
    + *
  • The local artifact is not present.
  • + *
  • The local artifact has a last modified timestamp older than (now - 1 day).
  • + *
+ */ + public static final String DAILY = "daily"; + + /** + *

+ * The HOURLY policy means that the artifact retrieval occurs only if one of + * the following conditions are met... + *

+ *
    + *
  • The local artifact is not present.
  • + *
  • The local artifact has a last modified timestamp older than (now - 1 hour).
  • + *
+ */ + public static final String HOURLY = "hourly"; + + /** + * The ONCE policy means that the artifact retrieval occurs only if the + * local artifact is not present. This means that the retreival can only + * occur once. + */ + public static final String ONCE = "once"; + + private List options = new ArrayList(); + + public AbstractUpdatePolicy() + { + options.add( ALWAYS ); + options.add( HOURLY ); + options.add( DAILY ); + options.add( ONCE ); + options.add( NEVER ); + } + + protected abstract boolean isSnapshotPolicy(); + + protected abstract String getUpdateMode(); + + public List getOptions() + { + return options; + } + + public void applyPolicy( String policySetting, Properties request, File localFile ) + throws PolicyViolationException, PolicyConfigurationException + { + if ( !StringUtils.equals( request.getProperty( "filetype" ), "artifact" ) ) + { + // Only process artifact file types. + return; + } + + String version = request.getProperty( "version", "" ); + boolean isSnapshotVersion = false; + + if ( StringUtils.isNotBlank( version ) ) + { + isSnapshotVersion = VersionUtil.isSnapshot( version ); + } + + if ( !options.contains( policySetting ) ) + { + // Not a valid code. + throw new PolicyConfigurationException( "Unknown " + getUpdateMode() + " policy setting [" + policySetting + + "], valid settings are [" + StringUtils.join( options.iterator(), "," ) + "]" ); + } + + if ( ALWAYS.equals( policySetting ) ) + { + // Skip means ok to update. + log.debug( "OK to update, " + getUpdateMode() + " policy set to ALWAYS." ); + return; + } + + // Test for mismatches. + if ( !isSnapshotVersion && isSnapshotPolicy() ) + { + log.debug( "OK to update, snapshot policy does not apply for non-snapshot versions." ); + return; + } + + if ( isSnapshotVersion && !isSnapshotPolicy() ) + { + log.debug( "OK to update, release policy does not apply for snapshot versions." ); + return; + } + + if ( NEVER.equals( policySetting ) ) + { + // Reject means no. + throw new PolicyViolationException( "NO to update, " + getUpdateMode() + " policy set to NEVER." ); + } + + if ( !localFile.exists() ) + { + // No file means it's ok. + log.debug( "OK to update " + getUpdateMode() + ", local file does not exist." ); + return; + } + + if ( ONCE.equals( policySetting ) ) + { + // File exists, but policy is once. + throw new PolicyViolationException( "NO to update " + getUpdateMode() + ", policy is ONCE, and local file exist." ); + } + + if ( DAILY.equals( policySetting ) ) + { + Calendar cal = Calendar.getInstance(); + cal.add( Calendar.DAY_OF_MONTH, -1 ); + Calendar fileCal = Calendar.getInstance(); + fileCal.setTimeInMillis( localFile.lastModified() ); + + if( cal.after( fileCal ) ) + { + // Its ok. + return; + } + else + { + throw new PolicyViolationException( "NO to update " + getUpdateMode() + + ", policy is DAILY, local file exist, and has been updated within the last day." ); + } + } + + if ( HOURLY.equals( policySetting ) ) + { + Calendar cal = Calendar.getInstance(); + cal.add( Calendar.HOUR, -1 ); + Calendar fileCal = Calendar.getInstance(); + fileCal.setTimeInMillis( localFile.lastModified() ); + + if( cal.after( fileCal ) ) + { + // Its ok. + return; + } + else + { + throw new PolicyViolationException( "NO to update " + getUpdateMode() + + ", policy is HOURLY, local file exist, and has been updated within the last hour." ); + } + } + + throw new PolicyConfigurationException( "Unable to process " + getUpdateMode() + + " policy of [" + policySetting + "], please file a bug report." ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/CachedFailuresPolicy.java b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/CachedFailuresPolicy.java new file mode 100644 index 000000000..a69227ce9 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/CachedFailuresPolicy.java @@ -0,0 +1,120 @@ +package org.apache.maven.archiva.policies; + +/* + * 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; +import java.util.ArrayList; +import java.util.List; +import java.util.Properties; + +import org.apache.commons.lang.StringUtils; +import org.apache.maven.archiva.policies.urlcache.UrlFailureCache; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * {@link PreDownloadPolicy} to check if the requested url has failed before. + * + * @author Joakim Erdfelt + * @version $Id$ + * @plexus.component role="org.apache.maven.archiva.policies.PreDownloadPolicy" + * role-hint="cache-failures" + */ +public class CachedFailuresPolicy + implements PreDownloadPolicy +{ + private Logger log = LoggerFactory.getLogger( CachedFailuresPolicy.class ); + + /** + * The NO policy setting means that the the existence of old failures is not checked. + * All resource requests are allowed thru to the remote repo. + */ + public static final String NO = "no"; + + /** + * The YES policy setting means that the existence of old failures is checked, and will + * prevent the request from being performed against the remote repo. + */ + public static final String YES = "yes"; + + /** + * @plexus.requirement + */ + private UrlFailureCache urlFailureCache; + + private List options = new ArrayList(); + + public CachedFailuresPolicy() + { + options.add( NO ); + options.add( YES ); + } + + public void applyPolicy( String policySetting, Properties request, File localFile ) + throws PolicyViolationException, PolicyConfigurationException + { + if ( !options.contains( policySetting ) ) + { + // Not a valid code. + throw new PolicyConfigurationException( "Unknown cache-failues policy setting [" + policySetting + + "], valid settings are [" + StringUtils.join( options.iterator(), "," ) + "]" ); + } + + if ( NO.equals( policySetting ) ) + { + // Skip. + log.debug( "OK to fetch, check-failures policy set to NO." ); + return; + } + + String url = request.getProperty( "url" ); + + if ( StringUtils.isNotBlank( url ) ) + { + if ( urlFailureCache.hasFailedBefore( url ) ) + { + throw new PolicyViolationException( + "NO to fetch, check-failures detected previous failure on url: " + url ); + } + } + + log.debug( "OK to fetch, check-failures detected no issues." ); + } + + public String getDefaultOption() + { + return NO; + } + + public String getId() + { + return "cache-failures"; + } + + public String getName() + { + return "Cache failures"; + } + + public List getOptions() + { + return options; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/ChecksumPolicy.java b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/ChecksumPolicy.java new file mode 100644 index 000000000..fe89822fe --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/ChecksumPolicy.java @@ -0,0 +1,169 @@ +package org.apache.maven.archiva.policies; + +/* + * 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; +import java.util.ArrayList; +import java.util.List; +import java.util.Properties; + +import org.apache.archiva.checksum.ChecksumAlgorithm; +import org.apache.archiva.checksum.ChecksummedFile; +import org.apache.commons.lang.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * ChecksumPolicy - a policy applied after the download to see if the file has been downloaded + * successfully and completely (or not). + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component role="org.apache.maven.archiva.policies.PostDownloadPolicy" + * role-hint="checksum" + */ +public class ChecksumPolicy + implements PostDownloadPolicy +{ + private Logger log = LoggerFactory.getLogger( ChecksumPolicy.class ); + + /** + * The IGNORE policy indicates that if the checksum policy is ignored, and + * the state of, contents of, or validity of the checksum files are not + * checked. + */ + public static final String IGNORE = "ignore"; + + /** + * The FAIL policy indicates that if the checksum does not match the + * downloaded file, then remove the downloaded artifact, and checksum + * files, and fail the transfer to the client side. + */ + public static final String FAIL = "fail"; + + /** + * The FIX policy indicates that if the checksum does not match the + * downloaded file, then fix the checksum file locally, and return + * to the client side the corrected checksum. + */ + public static final String FIX = "fix"; + + private ChecksumAlgorithm[] algorithms = new ChecksumAlgorithm[] { ChecksumAlgorithm.SHA1, ChecksumAlgorithm.MD5 }; + + private List options = new ArrayList(); + + public ChecksumPolicy() + { + options.add( FAIL ); + options.add( FIX ); + options.add( IGNORE ); + } + + public void applyPolicy( String policySetting, Properties request, File localFile ) + throws PolicyViolationException, PolicyConfigurationException + { + if ( "resource".equals( request.getProperty( "filetype" ) ) ) + { + return; + } + + if ( !options.contains( policySetting ) ) + { + // Not a valid code. + throw new PolicyConfigurationException( "Unknown checksum policy setting [" + policySetting + + "], valid settings are [" + StringUtils.join( options.iterator(), "," ) + "]" ); + } + + if ( IGNORE.equals( policySetting ) ) + { + // Ignore. + log.debug( "Checksum policy set to IGNORE." ); + return; + } + + if ( !localFile.exists() ) + { + // Local File does not exist. + throw new PolicyViolationException( "Checksum policy failure, local file " + localFile.getAbsolutePath() + + " does not exist to check." ); + } + + if ( FAIL.equals( policySetting ) ) + { + ChecksummedFile checksum = new ChecksummedFile( localFile ); + if ( checksum.isValidChecksums( algorithms ) ) + { + return; + } + + for ( ChecksumAlgorithm algorithm : algorithms ) + { + File file = new File( localFile.getAbsolutePath() + "." + algorithm.getExt() ); + if ( file.exists() ) + { + file.delete(); + } + } + + localFile.delete(); + throw new PolicyViolationException( "Checksums do not match, policy set to FAIL, " + + "deleting checksum files and local file " + localFile.getAbsolutePath() + "." ); + } + + if ( FIX.equals( policySetting ) ) + { + ChecksummedFile checksum = new ChecksummedFile( localFile ); + if( checksum.fixChecksums( algorithms ) ) + { + log.debug( "Checksum policy set to FIX, checksum files have been updated." ); + return; + } + else + { + throw new PolicyViolationException( "Checksum policy set to FIX, " + + "yet unable to update checksums for local file " + localFile.getAbsolutePath() + "." ); + } + } + + throw new PolicyConfigurationException( "Unable to process checksum policy of [" + policySetting + + "], please file a bug report." ); + } + + public String getDefaultOption() + { + return FIX; + } + + public String getId() + { + return "checksum"; + } + + public String getName() + { + return "Checksum"; + } + + public List getOptions() + { + return options; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/DownloadErrorPolicy.java b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/DownloadErrorPolicy.java new file mode 100644 index 000000000..b5c209c6c --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/DownloadErrorPolicy.java @@ -0,0 +1,50 @@ +package org.apache.maven.archiva.policies; + +/* + * 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; +import java.util.Map; +import java.util.Properties; + +/** + * Policy to apply after the download has completed, but before the + * resource is made available to the calling client. + * + * @author Brett Porter + * @version $Id$ + */ +public interface DownloadErrorPolicy + extends Policy +{ + /** + * Apply the download error policy. + * + * @param policySetting the policy setting. + * @param request the list of request properties that the policy might use. + * @param localFile + * @param exception the exception that triggered the error + * @param previousExceptions any previously triggered exceptions + * @return whether to process the exception or not + * @throws PolicyConfigurationException if the policy is improperly configured + */ + public boolean applyPolicy( String policySetting, Properties request, File localFile, Exception exception, + Map previousExceptions ) + throws PolicyConfigurationException; +} \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/DownloadPolicy.java b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/DownloadPolicy.java new file mode 100644 index 000000000..68036d9e8 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/DownloadPolicy.java @@ -0,0 +1,46 @@ +package org.apache.maven.archiva.policies; + +/* + * 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; +import java.util.Properties; + +/** + * DownloadPolicy + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public interface DownloadPolicy + extends Policy +{ + + /** + * Apply the download policy. + * + * @param policySetting the policy setting. + * @param request the list of request properties that the policy might use. + * @param localFile + * + * @throws PolicyViolationException if the policy has been violated. + */ + public void applyPolicy( String policySetting, Properties request, File localFile ) + throws PolicyViolationException, PolicyConfigurationException; +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/Policy.java b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/Policy.java new file mode 100644 index 000000000..f7add1b73 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/Policy.java @@ -0,0 +1,55 @@ +package org.apache.maven.archiva.policies; + +/* + * 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; + +public interface Policy +{ + /** + * Get the list of options for this policy. + * + * @return the list of options for this policy. + */ + List getOptions(); + + /** + * Get the default option for this policy. + * + * @return the default policy for this policy. + */ + String getDefaultOption(); + + /** + * Get the id for this policy. + * + * @return the id for this policy. + */ + String getId(); + + /** + * Get the display name for this policy. + * + * @todo i18n + * + * @return the name for this policy + */ + String getName(); +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/PolicyConfigurationException.java b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/PolicyConfigurationException.java new file mode 100644 index 000000000..0d705e1db --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/PolicyConfigurationException.java @@ -0,0 +1,44 @@ +package org.apache.maven.archiva.policies; + +/* + * 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.archiva.common.ArchivaException; + +/** + * PolicyConfigurationException is thrown when a policy cannot be executed due to a + * configuration issue. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class PolicyConfigurationException + extends ArchivaException +{ + + public PolicyConfigurationException( String message, Throwable cause ) + { + super( message, cause ); + } + + public PolicyConfigurationException( String message ) + { + super( message ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/PolicyViolationException.java b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/PolicyViolationException.java new file mode 100644 index 000000000..0de36ec76 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/PolicyViolationException.java @@ -0,0 +1,42 @@ +package org.apache.maven.archiva.policies; + +/* + * 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.archiva.common.ArchivaException; + +/** + * PolicyViolationException + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class PolicyViolationException + extends ArchivaException +{ + public PolicyViolationException( String message, Throwable cause ) + { + super( message, cause ); + } + + public PolicyViolationException( String message ) + { + super( message ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/PostDownloadPolicy.java b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/PostDownloadPolicy.java new file mode 100644 index 000000000..12bb6b416 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/PostDownloadPolicy.java @@ -0,0 +1,32 @@ +package org.apache.maven.archiva.policies; + +/* + * 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. + */ + +/** + * Policy to apply after the download has completed, but before the + * resource is made available to the calling client. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public interface PostDownloadPolicy + extends DownloadPolicy +{ +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/PreDownloadPolicy.java b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/PreDownloadPolicy.java new file mode 100644 index 000000000..1faf52025 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/PreDownloadPolicy.java @@ -0,0 +1,31 @@ +package org.apache.maven.archiva.policies; + +/* + * 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. + */ + + +/** + * Policy to apply before the download is attempted. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public interface PreDownloadPolicy extends DownloadPolicy +{ +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/PropagateErrorsDownloadPolicy.java b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/PropagateErrorsDownloadPolicy.java new file mode 100644 index 000000000..cca1c6750 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/PropagateErrorsDownloadPolicy.java @@ -0,0 +1,118 @@ +package org.apache.maven.archiva.policies; + +/* + * 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.codehaus.plexus.logging.AbstractLogEnabled; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Properties; + +/** + * PropagateErrorsPolicy - a policy applied on error to determine how to treat the error. + * + * @plexus.component role="org.apache.maven.archiva.policies.DownloadErrorPolicy" + * role-hint="propagate-errors" + */ +public class PropagateErrorsDownloadPolicy + extends AbstractLogEnabled + implements DownloadErrorPolicy +{ + /** + * Signifies any error should stop searching for other proxies. + */ + public static final String STOP = "stop"; + + /** + * Propagate errors at the end after all are gathered, if there was no successful download from other proxies. + */ + public static final String QUEUE = "queue error"; + + /** + * Ignore errors and treat as if it were not found. + */ + public static final String IGNORE = "ignore"; + + private List options = new ArrayList(); + + public PropagateErrorsDownloadPolicy() + { + options.add( STOP ); + options.add( QUEUE ); + options.add( IGNORE ); + } + + public boolean applyPolicy( String policySetting, Properties request, File localFile, Exception exception, + Map previousExceptions ) + throws PolicyConfigurationException + { + if ( !options.contains( policySetting ) ) + { + // Not a valid code. + throw new PolicyConfigurationException( "Unknown error policy setting [" + policySetting + + "], valid settings are [" + StringUtils.join( options.iterator(), "," ) + "]" ); + } + + if ( IGNORE.equals( policySetting ) ) + { + // Ignore. + getLogger().debug( "Error policy set to IGNORE." ); + return false; + } + + String repositoryId = request.getProperty( "remoteRepositoryId" ); + if ( STOP.equals( policySetting ) ) + { + return true; + } + + if ( QUEUE.equals( policySetting ) ) + { + previousExceptions.put( repositoryId, exception ); + return true; + } + + throw new PolicyConfigurationException( + "Unable to process checksum policy of [" + policySetting + "], please file a bug report." ); + } + + public String getDefaultOption() + { + return QUEUE; + } + + public String getId() + { + return "propagate-errors"; + } + + public String getName() + { + return "On remote error"; + } + + public List getOptions() + { + return options; + } +} \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/PropagateErrorsOnUpdateDownloadPolicy.java b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/PropagateErrorsOnUpdateDownloadPolicy.java new file mode 100644 index 000000000..d2b471af3 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/PropagateErrorsOnUpdateDownloadPolicy.java @@ -0,0 +1,105 @@ +package org.apache.maven.archiva.policies; + +/* + * 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.codehaus.plexus.logging.AbstractLogEnabled; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Properties; + +/** + * PropagateErrorsPolicy - a policy applied on error to determine how to treat the error. + * + * @plexus.component role="org.apache.maven.archiva.policies.DownloadErrorPolicy" + * role-hint="propagate-errors-on-update" + */ +public class PropagateErrorsOnUpdateDownloadPolicy + extends AbstractLogEnabled + implements DownloadErrorPolicy +{ + /** + * Signifies any error should cause a failure whether the artifact is already present or not. + */ + public static final String ALWAYS = "always"; + + /** + * Signifies any error should cause a failure only if the artifact is not already present. + */ + public static final String NOT_PRESENT = "artifact not already present"; + + private List options = new ArrayList(); + + public PropagateErrorsOnUpdateDownloadPolicy() + { + options.add( ALWAYS ); + options.add( NOT_PRESENT ); + } + + public boolean applyPolicy( String policySetting, Properties request, File localFile, Exception exception, + Map previousExceptions ) + throws PolicyConfigurationException + { + if ( !options.contains( policySetting ) ) + { + // Not a valid code. + throw new PolicyConfigurationException( "Unknown error policy setting [" + policySetting + + "], valid settings are [" + StringUtils.join( options.iterator(), "," ) + "]" ); + } + + if ( ALWAYS.equals( policySetting ) ) + { + // throw ther exception regardless + return true; + } + + if ( NOT_PRESENT.equals( policySetting ) ) + { + // cancel the exception if the file exists + return !localFile.exists(); + } + + throw new PolicyConfigurationException( "Unable to process checksum policy of [" + policySetting + + "], please file a bug report." ); + } + + public String getDefaultOption() + { + return NOT_PRESENT; + } + + public String getId() + { + return "propagate-errors-on-update"; + } + + public String getName() + { + return "Return error when"; + } + + public List getOptions() + { + return options; + } +} \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/ProxyDownloadException.java b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/ProxyDownloadException.java new file mode 100644 index 000000000..9d328c6b7 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/ProxyDownloadException.java @@ -0,0 +1,66 @@ +package org.apache.maven.archiva.policies; + +/* + * 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.archiva.common.ArchivaException; + +import java.util.Collections; +import java.util.Map; + +/** + * One or more exceptions occurred downloading from a remote repository during the proxy phase. + */ +public class ProxyDownloadException + extends ArchivaException +{ + /** + * A list of failures keyed by repository ID. + */ + private final Map failures; + + public ProxyDownloadException( String message, String repositoryId, Exception cause ) + { + super( constructMessage( message, Collections.singletonMap( repositoryId, cause ) ), cause ); + + failures = Collections.singletonMap( repositoryId, cause ); + } + + public ProxyDownloadException( String message, Map failures ) + { + super( constructMessage( message, failures ) ); + + this.failures = failures; + } + + private static String constructMessage( String message, Map failures ) + { + String msg = message + ":"; + for ( Map.Entry entry : failures.entrySet() ) + { + msg += "\n\t" + entry.getKey() + ": " + entry.getValue().getMessage(); + } + return msg; + } + + public Map getFailures() + { + return failures; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/ReleasesPolicy.java b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/ReleasesPolicy.java new file mode 100644 index 000000000..86ad7c3fc --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/ReleasesPolicy.java @@ -0,0 +1,63 @@ +package org.apache.maven.archiva.policies; + +/* + * 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. + */ + + +/** + * {@link PreDownloadPolicy} to apply for released versions. + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component role="org.apache.maven.archiva.policies.PreDownloadPolicy" + * role-hint="releases" + */ +public class ReleasesPolicy + extends AbstractUpdatePolicy + implements PreDownloadPolicy +{ + /** + * Defaults to {@link AbstractUpdatePolicy#HOURLY} + */ + public String getDefaultOption() + { + return AbstractUpdatePolicy.HOURLY; + } + + protected boolean isSnapshotPolicy() + { + return false; + } + + protected String getUpdateMode() + { + return "releases"; + } + + public String getId() + { + return "releases"; + } + + public String getName() + { + return "Releases"; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/SnapshotsPolicy.java b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/SnapshotsPolicy.java new file mode 100644 index 000000000..ea10023c3 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/SnapshotsPolicy.java @@ -0,0 +1,63 @@ +package org.apache.maven.archiva.policies; + +/* + * 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. + */ + + +/** + * {@link PreDownloadPolicy} to apply for snapshot versions. + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component role="org.apache.maven.archiva.policies.PreDownloadPolicy" + * role-hint="snapshots" + */ +public class SnapshotsPolicy + extends AbstractUpdatePolicy + implements PreDownloadPolicy +{ + /** + * Defaults to {@link AbstractUpdatePolicy#HOURLY} + */ + public String getDefaultOption() + { + return AbstractUpdatePolicy.HOURLY; + } + + protected boolean isSnapshotPolicy() + { + return true; + } + + protected String getUpdateMode() + { + return "snapshots"; + } + + public String getId() + { + return "snapshots"; + } + + public String getName() + { + return "Snapshots"; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/urlcache/DefaultUrlFailureCache.java b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/urlcache/DefaultUrlFailureCache.java new file mode 100644 index 000000000..cb2c66e71 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/urlcache/DefaultUrlFailureCache.java @@ -0,0 +1,60 @@ +package org.apache.maven.archiva.policies.urlcache; + +/* + * 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.codehaus.plexus.cache.Cache; + +import java.util.Date; + +/** + * DefaultUrlFailureCache + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class DefaultUrlFailureCache + implements UrlFailureCache +{ + /** + * @todo spring cache instead + */ + private Cache urlCache; + + public DefaultUrlFailureCache( Cache urlCache ) + { + this.urlCache = urlCache; + } + + public void cacheFailure( String url ) + { + urlCache.register( url, new Date() ); + } + + public boolean hasFailedBefore( String url ) + { + if ( urlCache.hasKey( url ) ) + { + urlCache.register( url, new Date() ); + return true; + } + + return false; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/urlcache/UrlFailureCache.java b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/urlcache/UrlFailureCache.java new file mode 100644 index 000000000..3a28da384 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/urlcache/UrlFailureCache.java @@ -0,0 +1,48 @@ +package org.apache.maven.archiva.policies.urlcache; + +/* + * 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. + */ + + +/** + * Cache for requested URLs that cannot be fetched. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public interface UrlFailureCache +{ + /** + * Store a URL in the cache as failed. + * + * @param url the url to store. + */ + public void cacheFailure( String url ); + + /** + * Test if a specified URL has failed before. + * + * NOTE: If the provided URL has failed, then making this call + * should refresh the expiration time on that URL entry. + * + * @param url the URL to test. + * @return true if it has failed before, false if not. + */ + public boolean hasFailedBefore( String url ); +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/resources/META-INF/plexus/components-fragment.xml b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/resources/META-INF/plexus/components-fragment.xml new file mode 100644 index 000000000..b66220612 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/resources/META-INF/plexus/components-fragment.xml @@ -0,0 +1,24 @@ + + + + org.codehaus.plexus.cache.Cache + url-failures-cache + org.codehaus.plexus.cache.ehcache.EhcacheCache + URL Failure Cache + + 600 + true + ${java.io.tmpdir}/archiva/urlcache + false + 1000 + LRU + url-failures-cache + false + + 2700 + + 1800 + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/resources/META-INF/spring-context.xml b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/resources/META-INF/spring-context.xml new file mode 100644 index 000000000..75a5d41c0 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/main/resources/META-INF/spring-context.xml @@ -0,0 +1,32 @@ + + + + + + + + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-policies/src/test/java/org/apache/maven/archiva/policies/CachedFailuresPolicyTest.java b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/test/java/org/apache/maven/archiva/policies/CachedFailuresPolicyTest.java new file mode 100644 index 000000000..c7083d93d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/test/java/org/apache/maven/archiva/policies/CachedFailuresPolicyTest.java @@ -0,0 +1,103 @@ +package org.apache.maven.archiva.policies; + +/* + * 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; +import java.util.Properties; + +import org.apache.maven.archiva.policies.urlcache.UrlFailureCache; +import org.codehaus.plexus.spring.PlexusInSpringTestCase; + +/** + * CachedFailuresPolicyTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class CachedFailuresPolicyTest + extends PlexusInSpringTestCase +{ + private DownloadPolicy lookupPolicy() + throws Exception + { + return (DownloadPolicy) lookup( PreDownloadPolicy.class, "cache-failures" ); + } + + private File getFile() + { + return new File( "target/cache-failures/" + getName() + ".txt" ); + } + + private Properties createRequest() + { + Properties request = new Properties(); + + return request; + } + + public void testPolicyNo() + throws Exception + { + DownloadPolicy policy = lookupPolicy(); + File localFile = getFile(); + Properties request = createRequest(); + + request.setProperty( "url", "http://a.bad.hostname.maven.org/path/to/resource.txt" ); + + policy.applyPolicy( CachedFailuresPolicy.NO, request, localFile ); + } + + public void testPolicyYesNotInCache() + throws Exception + { + DownloadPolicy policy = lookupPolicy(); + File localFile = getFile(); + Properties request = createRequest(); + + request.setProperty( "url", "http://a.bad.hostname.maven.org/path/to/resource.txt" ); + + policy.applyPolicy( CachedFailuresPolicy.YES, request, localFile ); + } + + public void testPolicyYesInCache() + throws Exception + { + DownloadPolicy policy = lookupPolicy(); + File localFile = getFile(); + Properties request = createRequest(); + + String url = "http://a.bad.hostname.maven.org/path/to/resource.txt"; + + UrlFailureCache urlFailureCache = (UrlFailureCache) lookup( "urlFailureCache" ); + urlFailureCache.cacheFailure( url ); + + request.setProperty( "url", url ); + + try + { + policy.applyPolicy( CachedFailuresPolicy.YES, request, localFile ); + fail( "Expected a PolicyViolationException." ); + } + catch ( PolicyViolationException e ) + { + // expected path. + } + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-policies/src/test/java/org/apache/maven/archiva/policies/ChecksumPolicyTest.java b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/test/java/org/apache/maven/archiva/policies/ChecksumPolicyTest.java new file mode 100644 index 000000000..81f140237 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/test/java/org/apache/maven/archiva/policies/ChecksumPolicyTest.java @@ -0,0 +1,332 @@ +package org.apache.maven.archiva.policies; + +/* + * 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.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.util.Properties; + +import org.apache.commons.io.FileUtils; +import org.codehaus.plexus.spring.PlexusInSpringTestCase; + +/** + * ChecksumPolicyTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ChecksumPolicyTest + extends PlexusInSpringTestCase +{ + private static final String GOOD = "good"; + + private static final String BAD = "bad"; + + public void testFailOnFileOnly() + throws Exception + { + assertFailSetting( false, null, null ); + } + + public void testFailOnFileWithBadMd5AndBadSha1() + throws Exception + { + assertFailSetting( false, BAD, BAD ); + } + + public void testFailOnFileWithBadMd5AndGoodSha1() + throws Exception + { + assertFailSetting( false, BAD, GOOD ); + } + + public void testFailOnFileWithBadMd5Only() + throws Exception + { + assertFailSetting( false, BAD, null ); + } + + public void testFailOnFileWithBadSha1Only() + throws Exception + { + assertFailSetting( false, null, BAD ); + } + + public void testFailOnFileWithGoodMd5AndBadSha1() + throws Exception + { + assertFailSetting( false, GOOD, BAD ); + } + + public void testFailOnFileWithGoodMd5AndGoodSha1() + throws Exception + { + assertFailSetting( true, GOOD, GOOD ); + } + + public void testFailOnFileWithGoodMd5Only() + throws Exception + { + assertFailSetting( true, GOOD, null ); + } + + public void testFailOnFileWithGoodSha1Only() + throws Exception + { + assertFailSetting( true, null, GOOD ); + } + + public void testFixOnFileOnly() + throws Exception + { + assertFixSetting( true, null, null ); + } + + public void testFixOnFileWithBadMd5AndBadSha1() + throws Exception + { + assertFixSetting( true, BAD, BAD ); + } + + public void testFixOnFileWithBadMd5AndGoodSha1() + throws Exception + { + assertFixSetting( true, BAD, GOOD ); + } + + public void testFixOnFileWithBadMd5Only() + throws Exception + { + assertFixSetting( true, BAD, null ); + } + + public void testFixOnFileWithBadSha1Only() + throws Exception + { + assertFixSetting( true, null, BAD ); + } + + public void testFixOnFileWithGoodMd5AndBadSha1() + throws Exception + { + assertFixSetting( true, GOOD, BAD ); + } + + public void testFixOnFileWithGoodMd5AndGoodSha1() + throws Exception + { + assertFixSetting( true, GOOD, GOOD ); + } + + public void testFixOnFileWithGoodMd5Only() + throws Exception + { + assertFixSetting( true, GOOD, null ); + } + + public void testFixOnFileWithGoodSha1Only() + throws Exception + { + assertFixSetting( true, null, GOOD ); + } + + public void testIgnore() + throws Exception + { + PostDownloadPolicy policy = lookupPolicy(); + File localFile = createTestableFiles( null, null ); + Properties request = createRequest(); + + policy.applyPolicy( ChecksumPolicy.IGNORE, request, localFile ); + } + + private void assertFailSetting( boolean expectedResult, String md5State, String sha1State ) + throws Exception + { + PostDownloadPolicy policy = lookupPolicy(); + File localFile = createTestableFiles( md5State, sha1State ); + Properties request = createRequest(); + + boolean actualResult; + + try + { + policy.applyPolicy( ChecksumPolicy.FAIL, request, localFile ); + actualResult = true; + } + catch ( PolicyViolationException e ) + { + actualResult = false; + String msg = createMessage( ChecksumPolicy.FAIL, md5State, sha1State ); + + assertFalse( msg + " local file should not exist:", localFile.exists() ); + File md5File = new File( localFile.getAbsolutePath() + ".sha1" ); + File sha1File = new File( localFile.getAbsolutePath() + ".md5" ); + assertFalse( msg + " local md5 file should not exist:", md5File.exists() ); + assertFalse( msg + " local sha1 file should not exist:", sha1File.exists() ); + } + + assertEquals( createMessage( ChecksumPolicy.FAIL, md5State, sha1State ), expectedResult, actualResult ); + } + + private void assertFixSetting( boolean expectedResult, String md5State, String sha1State ) + throws Exception + { + PostDownloadPolicy policy = lookupPolicy(); + File localFile = createTestableFiles( md5State, sha1State ); + Properties request = createRequest(); + + boolean actualResult; + + try + { + policy.applyPolicy( ChecksumPolicy.FIX, request, localFile ); + actualResult = true; + } + catch ( PolicyViolationException e ) + { + actualResult = false; + } + + assertEquals( createMessage( ChecksumPolicy.FIX, md5State, sha1State ), expectedResult, actualResult ); + + // End result should be legitimate SHA1 and MD5 files. + File md5File = new File( localFile.getAbsolutePath() + ".md5" ); + File sha1File = new File( localFile.getAbsolutePath() + ".sha1" ); + + assertTrue( "ChecksumPolicy.apply(FIX) md5 should exist.", md5File.exists() && md5File.isFile() ); + assertTrue( "ChecksumPolicy.apply(FIX) sha1 should exist.", sha1File.exists() && sha1File.isFile() ); + + String actualMd5Contents = readChecksumFile( md5File ); + String actualSha1Contents = readChecksumFile( sha1File ); + + String expectedMd5Contents = "360ccd01d8a0a2d94b86f9802c2fc548 artifact.jar"; + String expectedSha1Contents = "7dd8929150664f182db60ad15f20359d875f059f artifact.jar"; + + assertEquals( "ChecksumPolicy.apply(FIX) md5 contents:", expectedMd5Contents, actualMd5Contents ); + assertEquals( "ChecksumPolicy.apply(FIX) sha1 contents:", expectedSha1Contents, actualSha1Contents ); + } + + /** + * Read the first line from the checksum file, and return it (trimmed). + */ + private String readChecksumFile( File checksumFile ) + throws Exception + { + FileReader freader = null; + BufferedReader buf = null; + + try + { + freader = new FileReader( checksumFile ); + buf = new BufferedReader( freader ); + return buf.readLine(); + } + finally + { + if ( buf != null ) + { + buf.close(); + } + + if ( freader != null ) + { + freader.close(); + } + } + } + + private String createMessage( String settingType, String md5State, String sha1State ) + { + StringBuffer msg = new StringBuffer(); + msg.append( "Expected result of ChecksumPolicy.apply(" ); + msg.append( settingType.toUpperCase() ); + msg.append( ") when working with " ); + if ( md5State == null ) + { + msg.append( "NO" ); + } + else + { + msg.append( "a " ).append( md5State.toUpperCase() ); + } + + msg.append( " MD5 and " ); + + if ( sha1State == null ) + { + msg.append( "NO" ); + } + else + { + msg.append( "a " ).append( sha1State.toUpperCase() ); + } + msg.append( " SHA1:" ); + + return msg.toString(); + } + + private Properties createRequest() + { + Properties request = new Properties(); + + request.setProperty( "url", "http://a.bad.hostname.maven.org/path/to/resource.txt" ); + + return request; + } + + private File createTestableFiles( String md5State, String sha1State ) + throws Exception + { + File sourceDir = getTestFile( "src/test/resources/checksums/" ); + File destDir = getTestFile( "target/checksum-tests/" + getName() + "/" ); + + FileUtils.copyFileToDirectory( new File( sourceDir, "artifact.jar" ), destDir ); + + if ( md5State != null ) + { + File md5File = new File( sourceDir, "artifact.jar.md5-" + md5State ); + assertTrue( "Testable file exists: " + md5File.getName() + ":", md5File.exists() && md5File.isFile() ); + File destFile = new File( destDir, "artifact.jar.md5" ); + FileUtils.copyFile( md5File, destFile ); + } + + if ( sha1State != null ) + { + File sha1File = new File( sourceDir, "artifact.jar.sha1-" + sha1State ); + assertTrue( "Testable file exists: " + sha1File.getName() + ":", sha1File.exists() && sha1File.isFile() ); + File destFile = new File( destDir, "artifact.jar.sha1" ); + FileUtils.copyFile( sha1File, destFile ); + } + + File localFile = new File( destDir, "artifact.jar" ); + return localFile; + } + + private PostDownloadPolicy lookupPolicy() + throws Exception + { + PostDownloadPolicy policy = (PostDownloadPolicy) lookup( PostDownloadPolicy.class.getName(), "checksum" ); + assertNotNull( policy ); + return policy; + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-policies/src/test/java/org/apache/maven/archiva/policies/ReleasePolicyTest.java b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/test/java/org/apache/maven/archiva/policies/ReleasePolicyTest.java new file mode 100644 index 000000000..044c7220e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/test/java/org/apache/maven/archiva/policies/ReleasePolicyTest.java @@ -0,0 +1,347 @@ +package org.apache.maven.archiva.policies; + +/* + * 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.io.FileUtils; +import org.codehaus.plexus.spring.PlexusInSpringTestCase; + +import java.io.File; +import java.util.Properties; + +/** + * ReleasePolicyTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ReleasePolicyTest + extends PlexusInSpringTestCase +{ + private static final String PATH_VERSION_METADATA = "org/apache/archiva/archiva-testable/1.0-SNAPSHOT/maven-metadata.xml"; + + private static final String PATH_PROJECT_METADATA = "org/apache/archiva/archiva-testable/maven-metadata.xml"; + + private static final String PATH_SNAPSHOT_ARTIFACT = "org/apache/archiva/archiva-testable/1.0-SNAPSHOT/archiva-testable-1.0-SNAPSHOT.jar"; + + private static final String PATH_RELEASE_ARTIFACT = "org/apache/archiva/archiva-testable/2.0/archiva-testable-2.0.jar"; + + private static final boolean WITH_LOCAL = true; + + private static final boolean NO_LOCAL = false; + + protected static final long ONE_SECOND = ( 1000 /* milliseconds */); + + protected static final long ONE_MINUTE = ( ONE_SECOND * 60 ); + + protected static final long ONE_HOUR = ( ONE_MINUTE * 60 ); + + protected static final long ONE_DAY = ( ONE_HOUR * 24 ); + + protected static final long OVER_ONE_HOUR = ( ONE_HOUR + ONE_MINUTE ); + + protected static final long OVER_ONE_DAY = ( ONE_DAY + ONE_HOUR ); + + protected static final long OLDER = ( -1 ); + + protected static final long NEWER = 0; + + private long generatedLocalFileUpdateDelta = 0; + + public void testReleasePolicyDailyProjectMetadata() + throws Exception + { + // Pass the policy when working with metadata, no matter what. + assertReleasesPolicy( ReleasesPolicy.DAILY, PATH_PROJECT_METADATA, NO_LOCAL ); + assertReleasesPolicy( ReleasesPolicy.DAILY, PATH_PROJECT_METADATA, WITH_LOCAL ); + + generatedLocalFileUpdateDelta = OVER_ONE_DAY; + assertReleasesPolicy( ReleasesPolicy.DAILY, PATH_PROJECT_METADATA, NO_LOCAL ); + assertReleasesPolicy( ReleasesPolicy.DAILY, PATH_PROJECT_METADATA, WITH_LOCAL ); + + generatedLocalFileUpdateDelta = ( ONE_HOUR * 22 ); + assertReleasesPolicy( ReleasesPolicy.DAILY, PATH_PROJECT_METADATA, NO_LOCAL ); + assertReleasesPolicy( ReleasesPolicy.DAILY, PATH_PROJECT_METADATA, WITH_LOCAL ); + } + + public void testReleasePolicyDailyReleaseArtifact() + throws Exception + { + assertReleasesPolicy( ReleasesPolicy.DAILY, PATH_RELEASE_ARTIFACT, NO_LOCAL ); + assertReleasesPolicyViolation( ReleasesPolicy.DAILY, PATH_RELEASE_ARTIFACT, WITH_LOCAL ); + + generatedLocalFileUpdateDelta = OVER_ONE_DAY; + assertReleasesPolicy( ReleasesPolicy.DAILY, PATH_RELEASE_ARTIFACT, NO_LOCAL ); + assertReleasesPolicy( ReleasesPolicy.DAILY, PATH_RELEASE_ARTIFACT, WITH_LOCAL ); + + generatedLocalFileUpdateDelta = ( ONE_HOUR * 22 ); + assertReleasesPolicy( ReleasesPolicy.DAILY, PATH_RELEASE_ARTIFACT, NO_LOCAL ); + assertReleasesPolicyViolation( ReleasesPolicy.DAILY, PATH_RELEASE_ARTIFACT, WITH_LOCAL ); + } + + public void testReleasePolicyDailySnapshotArtifact() + throws Exception + { + assertReleasesPolicy( ReleasesPolicy.DAILY, PATH_SNAPSHOT_ARTIFACT, NO_LOCAL ); + assertReleasesPolicy( ReleasesPolicy.DAILY, PATH_SNAPSHOT_ARTIFACT, WITH_LOCAL ); + + generatedLocalFileUpdateDelta = OVER_ONE_DAY; + assertReleasesPolicy( ReleasesPolicy.DAILY, PATH_SNAPSHOT_ARTIFACT, NO_LOCAL ); + assertReleasesPolicy( ReleasesPolicy.DAILY, PATH_SNAPSHOT_ARTIFACT, WITH_LOCAL ); + + generatedLocalFileUpdateDelta = ( ONE_HOUR * 22 ); + assertReleasesPolicy( ReleasesPolicy.DAILY, PATH_SNAPSHOT_ARTIFACT, NO_LOCAL ); + assertReleasesPolicy( ReleasesPolicy.DAILY, PATH_SNAPSHOT_ARTIFACT, WITH_LOCAL ); + } + + public void testReleasePolicyDailyVersionedMetadata() + throws Exception + { + // Pass the policy when working with metadata, no matter what. + assertReleasesPolicy( ReleasesPolicy.DAILY, PATH_VERSION_METADATA, NO_LOCAL ); + assertReleasesPolicy( ReleasesPolicy.DAILY, PATH_VERSION_METADATA, WITH_LOCAL ); + + generatedLocalFileUpdateDelta = OVER_ONE_DAY; + assertReleasesPolicy( ReleasesPolicy.DAILY, PATH_VERSION_METADATA, NO_LOCAL ); + assertReleasesPolicy( ReleasesPolicy.DAILY, PATH_VERSION_METADATA, WITH_LOCAL ); + + generatedLocalFileUpdateDelta = ( ONE_HOUR * 22 ); + assertReleasesPolicy( ReleasesPolicy.DAILY, PATH_VERSION_METADATA, NO_LOCAL ); + assertReleasesPolicy( ReleasesPolicy.DAILY, PATH_VERSION_METADATA, WITH_LOCAL ); + } + + public void testReleasePolicyRejectProjectMetadata() + throws Exception + { + // Pass the policy when working with metadata, no matter what. + assertReleasesPolicy( ReleasesPolicy.NEVER, PATH_PROJECT_METADATA, NO_LOCAL ); + assertReleasesPolicy( ReleasesPolicy.NEVER, PATH_PROJECT_METADATA, WITH_LOCAL ); + } + + public void testReleasePolicyRejectReleaseArtifact() + throws Exception + { + assertReleasesPolicyViolation( ReleasesPolicy.NEVER, PATH_RELEASE_ARTIFACT, NO_LOCAL ); + assertReleasesPolicyViolation( ReleasesPolicy.NEVER, PATH_RELEASE_ARTIFACT, WITH_LOCAL ); + } + + public void testReleasePolicyRejectSnapshotArtifact() + throws Exception + { + assertReleasesPolicy( ReleasesPolicy.NEVER, PATH_SNAPSHOT_ARTIFACT, NO_LOCAL ); + assertReleasesPolicy( ReleasesPolicy.NEVER, PATH_SNAPSHOT_ARTIFACT, WITH_LOCAL ); + } + + public void testReleasePolicyRejectVersionedMetadata() + throws Exception + { + // Pass the policy when working with metadata, no matter what. + assertReleasesPolicy( ReleasesPolicy.NEVER, PATH_VERSION_METADATA, NO_LOCAL ); + assertReleasesPolicy( ReleasesPolicy.NEVER, PATH_VERSION_METADATA, WITH_LOCAL ); + } + + public void testReleasePolicyHourlyProjectMetadata() + throws Exception + { + // Pass the policy when working with metadata, no matter what. + assertReleasesPolicy( ReleasesPolicy.HOURLY, PATH_PROJECT_METADATA, NO_LOCAL ); + assertReleasesPolicy( ReleasesPolicy.HOURLY, PATH_PROJECT_METADATA, WITH_LOCAL ); + + generatedLocalFileUpdateDelta = OVER_ONE_HOUR; + assertReleasesPolicy( ReleasesPolicy.HOURLY, PATH_PROJECT_METADATA, NO_LOCAL ); + assertReleasesPolicy( ReleasesPolicy.HOURLY, PATH_PROJECT_METADATA, WITH_LOCAL ); + + generatedLocalFileUpdateDelta = ( ONE_MINUTE * 45 ); + assertReleasesPolicy( ReleasesPolicy.HOURLY, PATH_PROJECT_METADATA, NO_LOCAL ); + assertReleasesPolicy( ReleasesPolicy.HOURLY, PATH_PROJECT_METADATA, WITH_LOCAL ); + } + + public void testReleasePolicyHourlyReleaseArtifact() + throws Exception + { + assertReleasesPolicy( ReleasesPolicy.HOURLY, PATH_RELEASE_ARTIFACT, NO_LOCAL ); + assertReleasesPolicyViolation( ReleasesPolicy.HOURLY, PATH_RELEASE_ARTIFACT, WITH_LOCAL ); + + generatedLocalFileUpdateDelta = OVER_ONE_HOUR; + assertReleasesPolicy( ReleasesPolicy.HOURLY, PATH_RELEASE_ARTIFACT, NO_LOCAL ); + assertReleasesPolicy( ReleasesPolicy.HOURLY, PATH_RELEASE_ARTIFACT, WITH_LOCAL ); + + generatedLocalFileUpdateDelta = ( ONE_MINUTE * 45 ); + assertReleasesPolicy( ReleasesPolicy.HOURLY, PATH_RELEASE_ARTIFACT, NO_LOCAL ); + assertReleasesPolicyViolation( ReleasesPolicy.HOURLY, PATH_RELEASE_ARTIFACT, WITH_LOCAL ); + } + + public void testReleasePolicyHourlySnapshotArtifact() + throws Exception + { + assertReleasesPolicy( ReleasesPolicy.HOURLY, PATH_SNAPSHOT_ARTIFACT, NO_LOCAL ); + assertReleasesPolicy( ReleasesPolicy.HOURLY, PATH_SNAPSHOT_ARTIFACT, WITH_LOCAL ); + + generatedLocalFileUpdateDelta = OVER_ONE_HOUR; + assertReleasesPolicy( ReleasesPolicy.HOURLY, PATH_SNAPSHOT_ARTIFACT, NO_LOCAL ); + assertReleasesPolicy( ReleasesPolicy.HOURLY, PATH_SNAPSHOT_ARTIFACT, WITH_LOCAL ); + + generatedLocalFileUpdateDelta = ( ONE_MINUTE * 45 ); + assertReleasesPolicy( ReleasesPolicy.HOURLY, PATH_SNAPSHOT_ARTIFACT, NO_LOCAL ); + assertReleasesPolicy( ReleasesPolicy.HOURLY, PATH_SNAPSHOT_ARTIFACT, WITH_LOCAL ); + } + + public void testReleasePolicyHourlyVersionedMetadata() + throws Exception + { + // Pass the policy when working with metadata, no matter what. + assertReleasesPolicy( ReleasesPolicy.HOURLY, PATH_VERSION_METADATA, NO_LOCAL ); + assertReleasesPolicy( ReleasesPolicy.HOURLY, PATH_VERSION_METADATA, WITH_LOCAL ); + + generatedLocalFileUpdateDelta = OVER_ONE_HOUR; + assertReleasesPolicy( ReleasesPolicy.HOURLY, PATH_VERSION_METADATA, NO_LOCAL ); + assertReleasesPolicy( ReleasesPolicy.HOURLY, PATH_VERSION_METADATA, WITH_LOCAL ); + + generatedLocalFileUpdateDelta = ( ONE_MINUTE * 45 ); + assertReleasesPolicy( ReleasesPolicy.HOURLY, PATH_VERSION_METADATA, NO_LOCAL ); + assertReleasesPolicy( ReleasesPolicy.HOURLY, PATH_VERSION_METADATA, WITH_LOCAL ); + } + + public void testReleasePolicyAlwaysProjectMetadata() + throws Exception + { + // Pass the policy when working with metadata, no matter what. + assertReleasesPolicy( ReleasesPolicy.ALWAYS, PATH_PROJECT_METADATA, NO_LOCAL ); + assertReleasesPolicy( ReleasesPolicy.ALWAYS, PATH_PROJECT_METADATA, WITH_LOCAL ); + } + + public void testReleasePolicyAlwaysReleaseArtifact() + throws Exception + { + assertReleasesPolicy( ReleasesPolicy.ALWAYS, PATH_RELEASE_ARTIFACT, NO_LOCAL ); + assertReleasesPolicy( ReleasesPolicy.ALWAYS, PATH_RELEASE_ARTIFACT, WITH_LOCAL ); + } + + public void testReleasePolicyAlwaysSnapshotArtifact() + throws Exception + { + assertReleasesPolicy( ReleasesPolicy.ALWAYS, PATH_SNAPSHOT_ARTIFACT, NO_LOCAL ); + assertReleasesPolicy( ReleasesPolicy.ALWAYS, PATH_SNAPSHOT_ARTIFACT, WITH_LOCAL ); + } + + public void testReleasePolicyAlwaysVersionedMetadata() + throws Exception + { + // Pass the policy when working with metadata, no matter what. + assertReleasesPolicy( ReleasesPolicy.ALWAYS, PATH_VERSION_METADATA, NO_LOCAL ); + assertReleasesPolicy( ReleasesPolicy.ALWAYS, PATH_VERSION_METADATA, WITH_LOCAL ); + } + + public void testReleasePolicyOnceProjectMetadata() + throws Exception + { + // Pass the policy when working with metadata, no matter what. + assertReleasesPolicy( ReleasesPolicy.ONCE, PATH_PROJECT_METADATA, NO_LOCAL ); + assertReleasesPolicy( ReleasesPolicy.ONCE, PATH_PROJECT_METADATA, WITH_LOCAL ); + } + + public void testReleasePolicyOnceReleaseArtifact() + throws Exception + { + assertReleasesPolicy( ReleasesPolicy.ONCE, PATH_RELEASE_ARTIFACT, NO_LOCAL ); + assertReleasesPolicyViolation( ReleasesPolicy.ONCE, PATH_RELEASE_ARTIFACT, WITH_LOCAL ); + } + + public void testReleasePolicyOnceSnapshotArtifact() + throws Exception + { + assertReleasesPolicy( ReleasesPolicy.ONCE, PATH_SNAPSHOT_ARTIFACT, NO_LOCAL ); + assertReleasesPolicy( ReleasesPolicy.ONCE, PATH_SNAPSHOT_ARTIFACT, WITH_LOCAL ); + } + + public void testReleasePolicyOnceVersionedMetadata() + throws Exception + { + // Pass the policy when working with metadata, no matter what. + assertReleasesPolicy( ReleasesPolicy.ONCE, PATH_VERSION_METADATA, NO_LOCAL ); + assertReleasesPolicy( ReleasesPolicy.ONCE, PATH_VERSION_METADATA, WITH_LOCAL ); + } + + private void assertReleasesPolicy( String setting, String path, boolean createLocalFile ) + throws Exception + { + PreDownloadPolicy policy = lookupPolicy(); + Properties request = new Properties(); + request.setProperty( "filetype", path.endsWith( "/maven-metadata.xml" ) ? "metadata" : "artifact" ); + + if ( path.contains( "1.0-SNAPSHOT" ) ) + { + request.setProperty( "version", "1.0-SNAPSHOT" ); + } + + if ( path.contains( "2.0" ) ) + { + request.setProperty( "version", "2.0" ); + } + + File targetDir = getTestFile( "target/test-policy/" ); + File localFile = new File( targetDir, path ); + + if ( localFile.exists() ) + { + localFile.delete(); + } + + if ( createLocalFile ) + { + localFile.getParentFile().mkdirs(); + FileUtils.writeStringToFile( localFile, "random-junk" ); + localFile.setLastModified( localFile.lastModified() - generatedLocalFileUpdateDelta ); + } + + policy.applyPolicy( setting, request, localFile ); + } + + private void assertReleasesPolicyViolation( String setting, String path, boolean createLocalFile ) + throws Exception + { + try + { + assertReleasesPolicy( setting, path, createLocalFile ); + fail( "Expected a PolicyViolationException." ); + } + catch ( PolicyViolationException e ) + { + // expected path. + } + } + + private PreDownloadPolicy lookupPolicy() + throws Exception + { + PreDownloadPolicy policy = (PreDownloadPolicy) lookup( PreDownloadPolicy.class.getName(), "releases" ); + assertNotNull( policy ); + return policy; + } + + @Override + protected void setUp() + throws Exception + { + super.setUp(); + + // reset delta to 0. + generatedLocalFileUpdateDelta = 0; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-policies/src/test/java/org/apache/maven/archiva/policies/SnapshotsPolicyTest.java b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/test/java/org/apache/maven/archiva/policies/SnapshotsPolicyTest.java new file mode 100644 index 000000000..330db534b --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/test/java/org/apache/maven/archiva/policies/SnapshotsPolicyTest.java @@ -0,0 +1,347 @@ +package org.apache.maven.archiva.policies; + +/* + * 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; +import java.util.Properties; + +import org.apache.commons.io.FileUtils; +import org.codehaus.plexus.spring.PlexusInSpringTestCase; + +/** + * SnapshotsPolicyTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class SnapshotsPolicyTest + extends PlexusInSpringTestCase +{ + private static final String PATH_VERSION_METADATA = "org/apache/archiva/archiva-testable/1.0-SNAPSHOT/maven-metadata.xml"; + + private static final String PATH_PROJECT_METADATA = "org/apache/archiva/archiva-testable/maven-metadata.xml"; + + private static final String PATH_SNAPSHOT_ARTIFACT = "org/apache/archiva/archiva-testable/1.0-SNAPSHOT/archiva-testable-1.0-SNAPSHOT.jar"; + + private static final String PATH_RELEASE_ARTIFACT = "org/apache/archiva/archiva-testable/2.0/archiva-testable-2.0.jar"; + + private static final boolean WITH_LOCAL = true; + + private static final boolean NO_LOCAL = false; + + protected static final long ONE_SECOND = ( 1000 /* milliseconds */); + + protected static final long ONE_MINUTE = ( ONE_SECOND * 60 ); + + protected static final long ONE_HOUR = ( ONE_MINUTE * 60 ); + + protected static final long ONE_DAY = ( ONE_HOUR * 24 ); + + protected static final long OVER_ONE_HOUR = ( ONE_HOUR + ONE_MINUTE ); + + protected static final long OVER_ONE_DAY = ( ONE_DAY + ONE_HOUR ); + + protected static final long OLDER = ( -1 ); + + protected static final long NEWER = 0; + + private long generatedLocalFileUpdateDelta = 0; + + public void testSnapshotPolicyDailyProjectMetadata() + throws Exception + { + // Pass the policy when working with metadata, no matter what. + assertSnapshotPolicy( SnapshotsPolicy.DAILY, PATH_PROJECT_METADATA, NO_LOCAL ); + assertSnapshotPolicy( SnapshotsPolicy.DAILY, PATH_PROJECT_METADATA, WITH_LOCAL ); + + generatedLocalFileUpdateDelta = OVER_ONE_DAY; + assertSnapshotPolicy( SnapshotsPolicy.DAILY, PATH_PROJECT_METADATA, NO_LOCAL ); + assertSnapshotPolicy( SnapshotsPolicy.DAILY, PATH_PROJECT_METADATA, WITH_LOCAL ); + + generatedLocalFileUpdateDelta = ( ONE_HOUR * 22 ); + assertSnapshotPolicy( SnapshotsPolicy.DAILY, PATH_PROJECT_METADATA, NO_LOCAL ); + assertSnapshotPolicy( SnapshotsPolicy.DAILY, PATH_PROJECT_METADATA, WITH_LOCAL ); + } + + public void testSnapshotPolicyDailyReleaseArtifact() + throws Exception + { + assertSnapshotPolicy( SnapshotsPolicy.DAILY, PATH_RELEASE_ARTIFACT, NO_LOCAL ); + assertSnapshotPolicy( SnapshotsPolicy.DAILY, PATH_RELEASE_ARTIFACT, WITH_LOCAL ); + + generatedLocalFileUpdateDelta = OVER_ONE_DAY; + assertSnapshotPolicy( SnapshotsPolicy.DAILY, PATH_RELEASE_ARTIFACT, NO_LOCAL ); + assertSnapshotPolicy( SnapshotsPolicy.DAILY, PATH_RELEASE_ARTIFACT, WITH_LOCAL ); + + generatedLocalFileUpdateDelta = ( ONE_HOUR * 22 ); + assertSnapshotPolicy( SnapshotsPolicy.DAILY, PATH_RELEASE_ARTIFACT, NO_LOCAL ); + assertSnapshotPolicy( SnapshotsPolicy.DAILY, PATH_RELEASE_ARTIFACT, WITH_LOCAL ); + } + + public void testSnapshotPolicyDailySnapshotArtifact() + throws Exception + { + assertSnapshotPolicy( SnapshotsPolicy.DAILY, PATH_SNAPSHOT_ARTIFACT, NO_LOCAL ); + assertSnapshotPolicyViolation( SnapshotsPolicy.DAILY, PATH_SNAPSHOT_ARTIFACT, WITH_LOCAL ); + + generatedLocalFileUpdateDelta = OVER_ONE_DAY; + assertSnapshotPolicy( SnapshotsPolicy.DAILY, PATH_SNAPSHOT_ARTIFACT, NO_LOCAL ); + assertSnapshotPolicy( SnapshotsPolicy.DAILY, PATH_SNAPSHOT_ARTIFACT, WITH_LOCAL ); + + generatedLocalFileUpdateDelta = ( ONE_HOUR * 22 ); + assertSnapshotPolicy( SnapshotsPolicy.DAILY, PATH_SNAPSHOT_ARTIFACT, NO_LOCAL ); + assertSnapshotPolicyViolation( SnapshotsPolicy.DAILY, PATH_SNAPSHOT_ARTIFACT, WITH_LOCAL ); + } + + public void testSnapshotPolicyDailyVersionedMetadata() + throws Exception + { + // Pass the policy when working with metadata, no matter what. + assertSnapshotPolicy( SnapshotsPolicy.DAILY, PATH_VERSION_METADATA, NO_LOCAL ); + assertSnapshotPolicy( SnapshotsPolicy.DAILY, PATH_VERSION_METADATA, WITH_LOCAL ); + + generatedLocalFileUpdateDelta = OVER_ONE_DAY; + assertSnapshotPolicy( SnapshotsPolicy.DAILY, PATH_VERSION_METADATA, NO_LOCAL ); + assertSnapshotPolicy( SnapshotsPolicy.DAILY, PATH_VERSION_METADATA, WITH_LOCAL ); + + generatedLocalFileUpdateDelta = ( ONE_HOUR * 22 ); + assertSnapshotPolicy( SnapshotsPolicy.DAILY, PATH_VERSION_METADATA, NO_LOCAL ); + assertSnapshotPolicy( SnapshotsPolicy.DAILY, PATH_VERSION_METADATA, WITH_LOCAL ); + } + + public void testSnapshotPolicyRejectProjectMetadata() + throws Exception + { + // Pass the policy when working with metadata, no matter what. + assertSnapshotPolicy( SnapshotsPolicy.NEVER, PATH_PROJECT_METADATA, NO_LOCAL ); + assertSnapshotPolicy( SnapshotsPolicy.NEVER, PATH_PROJECT_METADATA, WITH_LOCAL ); + } + + public void testSnapshotPolicyRejectReleaseArtifact() + throws Exception + { + assertSnapshotPolicy( SnapshotsPolicy.NEVER, PATH_RELEASE_ARTIFACT, NO_LOCAL ); + assertSnapshotPolicy( SnapshotsPolicy.NEVER, PATH_RELEASE_ARTIFACT, WITH_LOCAL ); + } + + public void testSnapshotPolicyRejectSnapshotArtifact() + throws Exception + { + assertSnapshotPolicyViolation( SnapshotsPolicy.NEVER, PATH_SNAPSHOT_ARTIFACT, NO_LOCAL ); + assertSnapshotPolicyViolation( SnapshotsPolicy.NEVER, PATH_SNAPSHOT_ARTIFACT, WITH_LOCAL ); + } + + public void testSnapshotPolicyRejectVersionedMetadata() + throws Exception + { + // Pass the policy when working with metadata, no matter what. + assertSnapshotPolicy( SnapshotsPolicy.NEVER, PATH_VERSION_METADATA, NO_LOCAL ); + assertSnapshotPolicy( SnapshotsPolicy.NEVER, PATH_VERSION_METADATA, WITH_LOCAL ); + } + + public void testSnapshotPolicyHourlyProjectMetadata() + throws Exception + { + // Pass the policy when working with metadata, no matter what. + assertSnapshotPolicy( SnapshotsPolicy.HOURLY, PATH_PROJECT_METADATA, NO_LOCAL ); + assertSnapshotPolicy( SnapshotsPolicy.HOURLY, PATH_PROJECT_METADATA, WITH_LOCAL ); + + generatedLocalFileUpdateDelta = OVER_ONE_HOUR; + assertSnapshotPolicy( SnapshotsPolicy.HOURLY, PATH_PROJECT_METADATA, NO_LOCAL ); + assertSnapshotPolicy( SnapshotsPolicy.HOURLY, PATH_PROJECT_METADATA, WITH_LOCAL ); + + generatedLocalFileUpdateDelta = ( ONE_MINUTE * 45 ); + assertSnapshotPolicy( SnapshotsPolicy.HOURLY, PATH_PROJECT_METADATA, NO_LOCAL ); + assertSnapshotPolicy( SnapshotsPolicy.HOURLY, PATH_PROJECT_METADATA, WITH_LOCAL ); + } + + public void testSnapshotPolicyHourlyReleaseArtifact() + throws Exception + { + assertSnapshotPolicy( SnapshotsPolicy.HOURLY, PATH_RELEASE_ARTIFACT, NO_LOCAL ); + assertSnapshotPolicy( SnapshotsPolicy.HOURLY, PATH_RELEASE_ARTIFACT, WITH_LOCAL ); + + generatedLocalFileUpdateDelta = OVER_ONE_HOUR; + assertSnapshotPolicy( SnapshotsPolicy.HOURLY, PATH_RELEASE_ARTIFACT, NO_LOCAL ); + assertSnapshotPolicy( SnapshotsPolicy.HOURLY, PATH_RELEASE_ARTIFACT, WITH_LOCAL ); + + generatedLocalFileUpdateDelta = ( ONE_MINUTE * 45 ); + assertSnapshotPolicy( SnapshotsPolicy.HOURLY, PATH_RELEASE_ARTIFACT, NO_LOCAL ); + assertSnapshotPolicy( SnapshotsPolicy.HOURLY, PATH_RELEASE_ARTIFACT, WITH_LOCAL ); + } + + public void testSnapshotPolicyHourlySnapshotArtifact() + throws Exception + { + assertSnapshotPolicy( SnapshotsPolicy.HOURLY, PATH_SNAPSHOT_ARTIFACT, NO_LOCAL ); + assertSnapshotPolicyViolation( SnapshotsPolicy.HOURLY, PATH_SNAPSHOT_ARTIFACT, WITH_LOCAL ); + + generatedLocalFileUpdateDelta = OVER_ONE_HOUR; + assertSnapshotPolicy( SnapshotsPolicy.HOURLY, PATH_SNAPSHOT_ARTIFACT, NO_LOCAL ); + assertSnapshotPolicy( SnapshotsPolicy.HOURLY, PATH_SNAPSHOT_ARTIFACT, WITH_LOCAL ); + + generatedLocalFileUpdateDelta = ( ONE_MINUTE * 45 ); + assertSnapshotPolicy( SnapshotsPolicy.HOURLY, PATH_SNAPSHOT_ARTIFACT, NO_LOCAL ); + assertSnapshotPolicyViolation( SnapshotsPolicy.HOURLY, PATH_SNAPSHOT_ARTIFACT, WITH_LOCAL ); + } + + public void testSnapshotPolicyHourlyVersionedMetadata() + throws Exception + { + // Pass the policy when working with metadata, no matter what. + assertSnapshotPolicy( SnapshotsPolicy.HOURLY, PATH_VERSION_METADATA, NO_LOCAL ); + assertSnapshotPolicy( SnapshotsPolicy.HOURLY, PATH_VERSION_METADATA, WITH_LOCAL ); + + generatedLocalFileUpdateDelta = OVER_ONE_HOUR; + assertSnapshotPolicy( SnapshotsPolicy.HOURLY, PATH_VERSION_METADATA, NO_LOCAL ); + assertSnapshotPolicy( SnapshotsPolicy.HOURLY, PATH_VERSION_METADATA, WITH_LOCAL ); + + generatedLocalFileUpdateDelta = ( ONE_MINUTE * 45 ); + assertSnapshotPolicy( SnapshotsPolicy.HOURLY, PATH_VERSION_METADATA, NO_LOCAL ); + assertSnapshotPolicy( SnapshotsPolicy.HOURLY, PATH_VERSION_METADATA, WITH_LOCAL ); + } + + public void testSnapshotPolicyAlwaysProjectMetadata() + throws Exception + { + // Pass the policy when working with metadata, no matter what. + assertSnapshotPolicy( SnapshotsPolicy.ALWAYS, PATH_PROJECT_METADATA, NO_LOCAL ); + assertSnapshotPolicy( SnapshotsPolicy.ALWAYS, PATH_PROJECT_METADATA, WITH_LOCAL ); + } + + public void testSnapshotPolicyAlwaysReleaseArtifact() + throws Exception + { + assertSnapshotPolicy( SnapshotsPolicy.ALWAYS, PATH_RELEASE_ARTIFACT, NO_LOCAL ); + assertSnapshotPolicy( SnapshotsPolicy.ALWAYS, PATH_RELEASE_ARTIFACT, WITH_LOCAL ); + } + + public void testSnapshotPolicyAlwaysSnapshotArtifact() + throws Exception + { + assertSnapshotPolicy( SnapshotsPolicy.ALWAYS, PATH_SNAPSHOT_ARTIFACT, NO_LOCAL ); + assertSnapshotPolicy( SnapshotsPolicy.ALWAYS, PATH_SNAPSHOT_ARTIFACT, WITH_LOCAL ); + } + + public void testSnapshotPolicyAlwaysVersionedMetadata() + throws Exception + { + // Pass the policy when working with metadata, no matter what. + assertSnapshotPolicy( SnapshotsPolicy.ALWAYS, PATH_VERSION_METADATA, NO_LOCAL ); + assertSnapshotPolicy( SnapshotsPolicy.ALWAYS, PATH_VERSION_METADATA, WITH_LOCAL ); + } + + public void testSnapshotPolicyOnceProjectMetadata() + throws Exception + { + // Pass the policy when working with metadata, no matter what. + assertSnapshotPolicy( SnapshotsPolicy.ONCE, PATH_PROJECT_METADATA, NO_LOCAL ); + assertSnapshotPolicy( SnapshotsPolicy.ONCE, PATH_PROJECT_METADATA, WITH_LOCAL ); + } + + public void testSnapshotPolicyOnceReleaseArtifact() + throws Exception + { + assertSnapshotPolicy( SnapshotsPolicy.ONCE, PATH_RELEASE_ARTIFACT, NO_LOCAL ); + assertSnapshotPolicy( SnapshotsPolicy.ONCE, PATH_RELEASE_ARTIFACT, WITH_LOCAL ); + } + + public void testSnapshotPolicyOnceSnapshotArtifact() + throws Exception + { + assertSnapshotPolicy( SnapshotsPolicy.ONCE, PATH_SNAPSHOT_ARTIFACT, NO_LOCAL ); + assertSnapshotPolicyViolation( SnapshotsPolicy.ONCE, PATH_SNAPSHOT_ARTIFACT, WITH_LOCAL ); + } + + public void testSnapshotPolicyOnceVersionedMetadata() + throws Exception + { + // Pass the policy when working with metadata, no matter what. + assertSnapshotPolicy( SnapshotsPolicy.ONCE, PATH_VERSION_METADATA, NO_LOCAL ); + assertSnapshotPolicy( SnapshotsPolicy.ONCE, PATH_VERSION_METADATA, WITH_LOCAL ); + } + + private void assertSnapshotPolicy( String setting, String path, boolean createLocalFile ) + throws Exception + { + PreDownloadPolicy policy = lookupPolicy(); + Properties request = new Properties(); + request.setProperty( "filetype", path.endsWith( "/maven-metadata.xml" ) ? "metadata" : "artifact" ); + + if ( path.contains( "1.0-SNAPSHOT" ) ) + { + request.setProperty( "version", "1.0-SNAPSHOT" ); + } + + if ( path.contains( "2.0" ) ) + { + request.setProperty( "version", "2.0" ); + } + + File targetDir = getTestFile( "target/test-policy/" ); + File localFile = new File( targetDir, path ); + + if ( localFile.exists() ) + { + localFile.delete(); + } + + if ( createLocalFile ) + { + localFile.getParentFile().mkdirs(); + FileUtils.writeStringToFile( localFile, "random-junk" ); + localFile.setLastModified( localFile.lastModified() - generatedLocalFileUpdateDelta ); + } + + policy.applyPolicy( setting, request, localFile ); + } + + private void assertSnapshotPolicyViolation( String setting, String path, boolean createLocalFile ) + throws Exception + { + try + { + assertSnapshotPolicy( setting, path, createLocalFile ); + fail( "Expected a PolicyViolationException." ); + } + catch ( PolicyViolationException e ) + { + // expected path. + } + } + + private PreDownloadPolicy lookupPolicy() + throws Exception + { + PreDownloadPolicy policy = (PreDownloadPolicy) lookup( PreDownloadPolicy.class.getName(), "snapshots" ); + assertNotNull( policy ); + return policy; + } + + @Override + protected void setUp() + throws Exception + { + super.setUp(); + + // reset delta to 0. + generatedLocalFileUpdateDelta = 0; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-policies/src/test/resources/checksums/artifact.jar b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/test/resources/checksums/artifact.jar new file mode 100644 index 000000000..d1b610e5e Binary files /dev/null and b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/test/resources/checksums/artifact.jar differ diff --git a/MRM-541/archiva-modules/archiva-base/archiva-policies/src/test/resources/checksums/artifact.jar.md5-bad b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/test/resources/checksums/artifact.jar.md5-bad new file mode 100644 index 000000000..aafbb1c77 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/test/resources/checksums/artifact.jar.md5-bad @@ -0,0 +1 @@ +444ccc111aaa222999888eee222fff00 artifact.jar diff --git a/MRM-541/archiva-modules/archiva-base/archiva-policies/src/test/resources/checksums/artifact.jar.md5-good b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/test/resources/checksums/artifact.jar.md5-good new file mode 100644 index 000000000..1c8465238 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/test/resources/checksums/artifact.jar.md5-good @@ -0,0 +1 @@ +360ccd01d8a0a2d94b86f9802c2fc548 artifact.jar diff --git a/MRM-541/archiva-modules/archiva-base/archiva-policies/src/test/resources/checksums/artifact.jar.sha1-bad b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/test/resources/checksums/artifact.jar.sha1-bad new file mode 100644 index 000000000..2d809c29b --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/test/resources/checksums/artifact.jar.sha1-bad @@ -0,0 +1 @@ +ddd888999000444888bbbaaa555333999777eee0 artifact.jar diff --git a/MRM-541/archiva-modules/archiva-base/archiva-policies/src/test/resources/checksums/artifact.jar.sha1-good b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/test/resources/checksums/artifact.jar.sha1-good new file mode 100644 index 000000000..0f10d257e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/test/resources/checksums/artifact.jar.sha1-good @@ -0,0 +1 @@ +7dd8929150664f182db60ad15f20359d875f059f artifact.jar diff --git a/MRM-541/archiva-modules/archiva-base/archiva-policies/src/test/resources/log4j.xml b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/test/resources/log4j.xml new file mode 100644 index 000000000..9bb5e1e5a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/test/resources/log4j.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-policies/src/test/resources/org/apache/maven/archiva/policies/CachedFailuresPolicyTest.xml b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/test/resources/org/apache/maven/archiva/policies/CachedFailuresPolicyTest.xml new file mode 100644 index 000000000..a42cdec07 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/test/resources/org/apache/maven/archiva/policies/CachedFailuresPolicyTest.xml @@ -0,0 +1,24 @@ + + + + org.codehaus.plexus.cache.Cache + url-failures-cache + org.codehaus.plexus.cache.ehcache.EhcacheCache + URL Failure Cache + + 600 + false + ${java.io.tmpdir}/archiva/urlcache + false + 1000 + LRU + cache + false + + 2700 + + 1800 + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-policies/src/test/resources/org/apache/maven/archiva/policies/ChecksumPolicyTest.xml b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/test/resources/org/apache/maven/archiva/policies/ChecksumPolicyTest.xml new file mode 100644 index 000000000..a42cdec07 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/test/resources/org/apache/maven/archiva/policies/ChecksumPolicyTest.xml @@ -0,0 +1,24 @@ + + + + org.codehaus.plexus.cache.Cache + url-failures-cache + org.codehaus.plexus.cache.ehcache.EhcacheCache + URL Failure Cache + + 600 + false + ${java.io.tmpdir}/archiva/urlcache + false + 1000 + LRU + cache + false + + 2700 + + 1800 + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-policies/src/test/resources/org/apache/maven/archiva/policies/ReleasePolicyTest.xml b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/test/resources/org/apache/maven/archiva/policies/ReleasePolicyTest.xml new file mode 100644 index 000000000..a42cdec07 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/test/resources/org/apache/maven/archiva/policies/ReleasePolicyTest.xml @@ -0,0 +1,24 @@ + + + + org.codehaus.plexus.cache.Cache + url-failures-cache + org.codehaus.plexus.cache.ehcache.EhcacheCache + URL Failure Cache + + 600 + false + ${java.io.tmpdir}/archiva/urlcache + false + 1000 + LRU + cache + false + + 2700 + + 1800 + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-policies/src/test/resources/org/apache/maven/archiva/policies/SnapshotsPolicyTest.xml b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/test/resources/org/apache/maven/archiva/policies/SnapshotsPolicyTest.xml new file mode 100644 index 000000000..a42cdec07 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-policies/src/test/resources/org/apache/maven/archiva/policies/SnapshotsPolicyTest.xml @@ -0,0 +1,24 @@ + + + + org.codehaus.plexus.cache.Cache + url-failures-cache + org.codehaus.plexus.cache.ehcache.EhcacheCache + URL Failure Cache + + 600 + false + ${java.io.tmpdir}/archiva/urlcache + false + 1000 + LRU + cache + false + + 2700 + + 1800 + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/pom.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/pom.xml new file mode 100644 index 000000000..f4b39942a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/pom.xml @@ -0,0 +1,106 @@ + + + + + + org.apache.archiva + archiva-base + 1.2-SNAPSHOT + + 4.0.0 + archiva-proxy + Archiva Base :: Proxy + + + org.codehaus.plexus + plexus-spring + test + + + org.apache.archiva + archiva-configuration + + + org.apache.archiva + archiva-repository-layer + + + commons-io + commons-io + + + org.apache.maven.wagon + wagon-file + test + + + org.apache.maven.wagon + wagon-provider-api + + + org.codehaus.plexus + plexus-digest + + + org.codehaus.plexus + plexus-component-api + + + org.codehaus.plexus.registry + plexus-registry-commons + test + + + xmlunit + xmlunit + test + + + org.mortbay.jetty + jetty + 6.1.11 + test + + + org.apache.maven.wagon + wagon-http-lightweight + ${wagon.version} + test + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + **/Abstract* + **/*TestCase.java + **/*Tests.java + **/*TestSuite.java + **/RelocateTransfer* + + + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java new file mode 100644 index 000000000..2c5da3ebf --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java @@ -0,0 +1,1138 @@ +package org.apache.maven.archiva.proxy; + +/* + * 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; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.Map.Entry; + +import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.io.FileUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +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.maven.archiva.policies.DownloadErrorPolicy; +import org.apache.maven.archiva.policies.DownloadPolicy; +import org.apache.maven.archiva.policies.PolicyConfigurationException; +import org.apache.maven.archiva.policies.PolicyViolationException; +import org.apache.maven.archiva.policies.PostDownloadPolicy; +import org.apache.maven.archiva.policies.PreDownloadPolicy; +import org.apache.maven.archiva.policies.ProxyDownloadException; +import org.apache.maven.archiva.policies.urlcache.UrlFailureCache; +import org.apache.maven.archiva.repository.ManagedRepositoryContent; +import org.apache.maven.archiva.repository.RemoteRepositoryContent; +import org.apache.maven.archiva.repository.RepositoryContentFactory; +import org.apache.maven.archiva.repository.RepositoryException; +import org.apache.maven.archiva.repository.RepositoryNotFoundException; +import org.apache.maven.archiva.repository.metadata.MetadataTools; +import org.apache.maven.archiva.repository.metadata.RepositoryMetadataException; +import org.apache.maven.archiva.repository.scanner.RepositoryContentConsumers; +import org.apache.maven.wagon.ConnectionException; +import org.apache.maven.wagon.ResourceDoesNotExistException; +import org.apache.maven.wagon.Wagon; +import org.apache.maven.wagon.WagonException; +import org.apache.maven.wagon.authentication.AuthenticationException; +import org.apache.maven.wagon.authentication.AuthenticationInfo; +import org.apache.maven.wagon.proxy.ProxyInfo; +import org.apache.maven.wagon.repository.Repository; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException; +import org.codehaus.plexus.registry.Registry; +import org.codehaus.plexus.registry.RegistryListener; +import org.codehaus.plexus.util.SelectorUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * DefaultRepositoryProxyConnectors + * + * @author Joakim Erdfelt + * @version $Id$ + * @todo exception handling needs work - "not modified" is not really an exceptional case, and it has more layers than your average brown onion + * @plexus.component role-hint="default" + */ +public class DefaultRepositoryProxyConnectors + implements RepositoryProxyConnectors, RegistryListener, Initializable +{ + private Logger log = LoggerFactory.getLogger( DefaultRepositoryProxyConnectors.class ); + + /** + * @plexus.requirement + */ + private ArchivaConfiguration archivaConfiguration; + + /** + * @plexus.requirement + */ + private RepositoryContentFactory repositoryFactory; + + /** + * @plexus.requirement + */ + private MetadataTools metadataTools; + + /** + * @plexus.requirement role="org.apache.maven.archiva.policies.PreDownloadPolicy" + */ + private Map preDownloadPolicies; + + /** + * @plexus.requirement role="org.apache.maven.archiva.policies.PostDownloadPolicy" + */ + private Map postDownloadPolicies; + + /** + * @plexus.requirement role="org.apache.maven.archiva.policies.DownloadErrorPolicy" + */ + private Map downloadErrorPolicies; + + /** + * @plexus.requirement role-hint="default" + */ + private UrlFailureCache urlFailureCache; + + private Map> proxyConnectorMap = new HashMap>(); + + private Map networkProxyMap = new HashMap(); + + /** + * @plexus.requirement + */ + private RepositoryContentConsumers consumers; + + /** + * @plexus.requirement + */ + private WagonFactory wagonFactory; + + public File fetchFromProxies( ManagedRepositoryContent repository, ArtifactReference artifact ) + throws ProxyDownloadException + { + File workingDirectory = createWorkingDirectory(repository); + try + { + File localFile = toLocalFile( repository, artifact ); + + Properties requestProperties = new Properties(); + requestProperties.setProperty( "filetype", "artifact" ); + requestProperties.setProperty( "version", artifact.getVersion() ); + requestProperties.setProperty( "managedRepositoryId", repository.getId() ); + + List connectors = getProxyConnectors( repository ); + Map previousExceptions = new LinkedHashMap(); + for ( ProxyConnector connector : connectors ) + { + RemoteRepositoryContent targetRepository = connector.getTargetRepository(); + requestProperties.setProperty( "remoteRepositoryId", targetRepository.getId() ); + + String targetPath = targetRepository.toPath( artifact ); + + try + { + File downloadedFile = + transferFile( connector, targetRepository, targetPath, repository, workingDirectory, localFile, requestProperties, + true ); + + if ( fileExists( downloadedFile ) ) + { + log.debug( "Successfully transferred: " + downloadedFile.getAbsolutePath() ); + return downloadedFile; + } + } + catch ( NotFoundException e ) + { + log.debug( "Artifact " + Keys.toKey( artifact ) + " not found on repository \"" + + targetRepository.getRepository().getId() + "\"." ); + } + catch ( NotModifiedException e ) + { + log.debug( "Artifact " + Keys.toKey( artifact ) + " not updated on repository \"" + + targetRepository.getRepository().getId() + "\"." ); + } + catch ( ProxyException e ) + { + validatePolicies( this.downloadErrorPolicies, connector.getPolicies(), requestProperties, artifact, + targetRepository, localFile, e, previousExceptions ); + } + } + + if ( !previousExceptions.isEmpty() ) + { + throw new ProxyDownloadException( "Failures occurred downloading from some remote repositories", + previousExceptions ); + } + + log.debug( "Exhausted all target repositories, artifact " + Keys.toKey( artifact ) + " not found." ); + } + finally + { + FileUtils.deleteQuietly(workingDirectory); + } + + return null; + } + + public File fetchFromProxies( ManagedRepositoryContent repository, String path ) + { + File workingDir = createWorkingDirectory(repository); + try + { + File localFile = new File( repository.getRepoRoot(), path ); + + // no update policies for these paths + if ( localFile.exists() ) + { + return null; + } + + Properties requestProperties = new Properties(); + requestProperties.setProperty( "filetype", "resource" ); + requestProperties.setProperty( "managedRepositoryId", repository.getId() ); + + List connectors = getProxyConnectors( repository ); + for ( ProxyConnector connector : connectors ) + { + RemoteRepositoryContent targetRepository = connector.getTargetRepository(); + requestProperties.setProperty( "remoteRepositoryId", targetRepository.getId() ); + + String targetPath = path; + + try + { + File downloadedFile = + transferFile( connector, targetRepository, targetPath, repository, workingDir, localFile, requestProperties, false ); + + if ( fileExists( downloadedFile ) ) + { + log.debug( "Successfully transferred: " + downloadedFile.getAbsolutePath() ); + return downloadedFile; + } + } + catch ( NotFoundException e ) + { + log.debug( "Resource " + path + " not found on repository \"" + + targetRepository.getRepository().getId() + "\"." ); + } + catch ( NotModifiedException e ) + { + log.debug( "Resource " + path + " not updated on repository \"" + + targetRepository.getRepository().getId() + "\"." ); + } + catch ( ProxyException e ) + { + log.warn( "Transfer error from repository \"" + targetRepository.getRepository().getId() + + "\" for resource " + path + ", continuing to next repository. Error message: " + e.getMessage() ); + log.debug( "Full stack trace", e ); + } + } + + log.debug( "Exhausted all target repositories, resource " + path + " not found." ); + } + finally + { + FileUtils.deleteQuietly(workingDir); + } + + return null; + } + + public File fetchMetatadaFromProxies(ManagedRepositoryContent repository, String logicalPath) + { + File workingDir = createWorkingDirectory(repository); + try + { + File localFile = new File(repository.getRepoRoot(), logicalPath); + + Properties requestProperties = new Properties(); + requestProperties.setProperty( "filetype", "metadata" ); + boolean metadataNeedsUpdating = false; + long originalTimestamp = getLastModified( localFile ); + + List connectors = getProxyConnectors( repository ); + for ( ProxyConnector connector : connectors ) + { + RemoteRepositoryContent targetRepository = connector.getTargetRepository(); + + File localRepoFile = toLocalRepoFile( repository, targetRepository, logicalPath ); + long originalMetadataTimestamp = getLastModified( localRepoFile ); + + try + { + transferFile( connector, targetRepository, logicalPath, repository, workingDir, localRepoFile, requestProperties, true ); + + if ( hasBeenUpdated( localRepoFile, originalMetadataTimestamp ) ) + { + metadataNeedsUpdating = true; + } + } + catch ( NotFoundException e ) + { + log.debug( "Metadata " + logicalPath + + " not found on remote repository \"" + + targetRepository.getRepository().getId() + "\".", e ); + } + catch ( NotModifiedException e ) + { + log.debug( "Metadata " + logicalPath + + " not updated on remote repository \"" + + targetRepository.getRepository().getId() + "\".", e ); + } + catch ( ProxyException e ) + { + log.warn( "Transfer error from repository \"" + targetRepository.getRepository().getId() + + "\" for versioned Metadata " + logicalPath + + ", continuing to next repository. Error message: " + e.getMessage() ); + log.debug( "Full stack trace", e ); + } + } + + if ( hasBeenUpdated( localFile, originalTimestamp ) ) + { + metadataNeedsUpdating = true; + } + + if ( metadataNeedsUpdating || !localFile.exists()) + { + try + { + metadataTools.updateMetadata( repository, logicalPath ); + } + catch ( RepositoryMetadataException e ) + { + log.warn( "Unable to update metadata " + localFile.getAbsolutePath() + ": " + e.getMessage(), e ); + } + } + + if ( fileExists( localFile ) ) + { + return localFile; + } + } + finally + { + FileUtils.deleteQuietly(workingDir); + } + + return null; + } + + private long getLastModified( File file ) + { + if ( !file.exists() || !file.isFile() ) + { + return 0; + } + + return file.lastModified(); + } + + private boolean hasBeenUpdated( File file, long originalLastModified ) + { + if ( !file.exists() || !file.isFile() ) + { + return false; + } + + long currentLastModified = getLastModified( file ); + return ( currentLastModified > originalLastModified ); + } + + private File toLocalRepoFile( ManagedRepositoryContent repository, RemoteRepositoryContent targetRepository, + String targetPath ) + { + String repoPath = metadataTools.getRepositorySpecificName( targetRepository, targetPath ); + return new File( repository.getRepoRoot(), repoPath ); + } + + /** + * Test if the provided ManagedRepositoryContent has any proxies configured for it. + */ + public boolean hasProxies( ManagedRepositoryContent repository ) + { + synchronized ( this.proxyConnectorMap ) + { + return this.proxyConnectorMap.containsKey( repository.getId() ); + } + } + + private File toLocalFile( ManagedRepositoryContent repository, ArtifactReference artifact ) + { + return repository.toFile( artifact ); + } + + /** + * Simple method to test if the file exists on the local disk. + * + * @param file the file to test. (may be null) + * @return true if file exists. false if the file param is null, doesn't exist, or is not of type File. + */ + private boolean fileExists( File file ) + { + if ( file == null ) + { + return false; + } + + if ( !file.exists() ) + { + return false; + } + + if ( !file.isFile() ) + { + return false; + } + + return true; + } + + /** + * Perform the transfer of the file. + * + * @param connector the connector configuration to use. + * @param remoteRepository the remote repository get the resource from. + * @param remotePath the path in the remote repository to the resource to get. + * @param repository the managed repository that will hold the file + * @param resource the local file to place the downloaded resource into + * @param requestProperties the request properties to utilize for policy handling. + * @param executeConsumers whether to execute the consumers after proxying + * @return the local file that was downloaded, or null if not downloaded. + * @throws NotFoundException if the file was not found on the remote repository. + * @throws NotModifiedException if the localFile was present, and the resource was present on remote repository, + * but the remote resource is not newer than the local File. + * @throws ProxyException if transfer was unsuccessful. + */ + private File transferFile( ProxyConnector connector, RemoteRepositoryContent remoteRepository, String remotePath, + ManagedRepositoryContent repository, File workingDirectory, File resource, Properties requestProperties, + boolean executeConsumers ) + throws ProxyException, NotModifiedException + { + String url = remoteRepository.getURL().getUrl(); + if ( !url.endsWith( "/" ) ) + { + url = url + "/"; + } + url = url + remotePath; + requestProperties.setProperty( "url", url ); + + // Is a whitelist defined? + if ( CollectionUtils.isNotEmpty( connector.getWhitelist() ) ) + { + // Path must belong to whitelist. + if ( !matchesPattern( remotePath, connector.getWhitelist() ) ) + { + log.debug( "Path [" + remotePath + + "] is not part of defined whitelist (skipping transfer from repository [" + + remoteRepository.getRepository().getName() + "])." ); + return null; + } + } + + // Is target path part of blacklist? + if ( matchesPattern( remotePath, connector.getBlacklist() ) ) + { + log.debug( "Path [" + remotePath + "] is part of blacklist (skipping transfer from repository [" + + remoteRepository.getRepository().getName() + "])." ); + return null; + } + + // Handle pre-download policy + try + { + validatePolicies( this.preDownloadPolicies, connector.getPolicies(), requestProperties, resource ); + } + catch ( PolicyViolationException e ) + { + String emsg = "Transfer not attempted on " + url + " : " + e.getMessage(); + if ( fileExists( resource ) ) + { + log.info( emsg + ": using already present local file." ); + return resource; + } + + log.info( emsg ); + return null; + } + + // MRM-631 - the lightweight wagon does not reset these - remove if we switch to httpclient based wagon + String previousHttpProxyHost = System.getProperty( "http.proxyHost" ); + String previousHttpProxyPort = System.getProperty( "http.proxyPort" ); + String previousProxyExclusions = System.getProperty( "http.nonProxyHosts" ); + + File tmpMd5 = null; + File tmpSha1 = null; + File tmpResource = null; + + Wagon wagon = null; + try + { + RepositoryURL repoUrl = remoteRepository.getURL(); + String protocol = repoUrl.getProtocol(); + wagon = (Wagon) wagonFactory.getWagon( "wagon#" + protocol ); + if ( wagon == null ) + { + throw new ProxyException( "Unsupported target repository protocol: " + protocol ); + } + + boolean connected = connectToRepository( connector, wagon, remoteRepository ); + if ( connected ) + { + tmpResource = transferSimpleFile( wagon, remoteRepository, remotePath, repository, workingDirectory, resource ); + + // TODO: these should be used to validate the download based on the policies, not always downloaded to + // save on connections since md5 is rarely used + tmpSha1 = transferChecksum( wagon, remoteRepository, remotePath, repository, workingDirectory, resource, ".sha1" ); + tmpMd5 = transferChecksum( wagon, remoteRepository, remotePath, repository, workingDirectory, resource, ".md5" ); + } + } + catch ( NotFoundException e ) + { + urlFailureCache.cacheFailure( url ); + throw e; + } + catch ( NotModifiedException e ) + { + // Do not cache url here. + throw e; + } + catch ( ProxyException e ) + { + urlFailureCache.cacheFailure( url ); + throw e; + } + finally + { + if ( wagon != null ) + { + try + { + wagon.disconnect(); + + // MRM-631 - the lightweight wagon does not reset these - remove if we switch to httpclient based wagon + if ( previousHttpProxyHost != null ) + { + System.setProperty( "http.proxyHost", previousHttpProxyHost ); + } + else + { + System.getProperties().remove( "http.proxyHost" ); + } + if ( previousHttpProxyPort != null ) + { + System.setProperty( "http.proxyPort", previousHttpProxyPort ); + } + else + { + System.getProperties().remove( "http.proxyPort" ); + } + if ( previousProxyExclusions != null ) + { + System.setProperty( "http.nonProxyHosts", previousProxyExclusions ); + } + else + { + System.getProperties().remove( "http.nonProxyHosts" ); + } + } + catch ( ConnectionException e ) + { + log.warn( "Unable to disconnect wagon.", e ); + } + } + } + + // Handle post-download policies. + try + { + validatePolicies( this.postDownloadPolicies, connector.getPolicies(), requestProperties, tmpResource ); + } + catch ( PolicyViolationException e ) + { + log.info( "Transfer invalidated from " + url + " : " + e.getMessage() ); + executeConsumers = false; + if ( !fileExists( tmpResource ) ) + { + resource = null; + } + } + + if (resource != null) + { + synchronized (resource.getAbsolutePath().intern()) + { + File directory = resource.getParentFile(); + moveFileIfExists(tmpMd5, directory); + moveFileIfExists(tmpSha1, directory); + moveFileIfExists(tmpResource, directory); + } + } + + if ( executeConsumers ) + { + // Just-in-time update of the index and database by executing the consumers for this artifact + consumers.executeConsumers( connector.getSourceRepository().getRepository(), resource ); + } + + return resource; + } + + + + /** + * Moves the file into repository location if it exists + * + * @param fileToMove this could be either the main artifact, sha1 or md5 checksum file. + * @param directory directory to write files to + */ + private void moveFileIfExists(File fileToMove, File directory) throws ProxyException + { + if (fileToMove != null && fileToMove.exists()) + { + File newLocation = new File(directory, fileToMove.getName()); + moveTempToTarget(fileToMove, newLocation); + } + } + + /** + *

+ * Quietly transfer the checksum file from the remote repository to the local file. + *

+ * + * @param wagon the wagon instance (should already be connected) to use. + * @param remoteRepository the remote repository to transfer from. + * @param remotePath the remote path to the resource to get. + * @param repository the managed repository that will hold the file + * @param localFile the local file that should contain the downloaded contents + * @param type the type of checksum to transfer (example: ".md5" or ".sha1") + * @throws ProxyException if copying the downloaded file into place did not succeed. + */ + private File transferChecksum( Wagon wagon, RemoteRepositoryContent remoteRepository, String remotePath, + ManagedRepositoryContent repository, File workingDirectory, File localFile, String type ) + throws ProxyException + { + File hashFile = new File( localFile.getAbsolutePath() + type ); + File tmpChecksum = new File(workingDirectory, hashFile.getName()); + String url = remoteRepository.getURL().getUrl() + remotePath; + + // Transfer checksum does not use the policy. + if ( urlFailureCache.hasFailedBefore( url + type ) ) + { + return null; + } + + try + { + transferSimpleFile( wagon, remoteRepository, remotePath + type, repository, workingDirectory, hashFile ); + log.debug( "Checksum" + type + " Downloaded: " + hashFile ); + } + catch ( NotFoundException e ) + { + urlFailureCache.cacheFailure( url + type ); + log.debug( "Transfer failed, checksum not found: " + url ); + // Consume it, do not pass this on. + } + catch ( NotModifiedException e ) + { + log.debug( "Transfer skipped, checksum not modified: " + url ); + // Consume it, do not pass this on. + } + catch ( ProxyException e ) + { + urlFailureCache.cacheFailure( url + type ); + log.warn( "Transfer failed on checksum: " + url + " : " + e.getMessage(), e ); + // Critical issue, pass it on. + throw e; + } + return tmpChecksum; + } + + /** + * Perform the transfer of the remote file to the local file specified. + * + * @param wagon the wagon instance to use. + * @param remoteRepository the remote repository to use + * @param remotePath the remote path to attempt to get + * @param repository the managed repository that will hold the file + * @param localFile the local file to save to + * @return The local file that was transfered. + * @throws ProxyException if there was a problem moving the downloaded file into place. + * @throws WagonException if there was a problem tranfering the file. + */ + private File transferSimpleFile( Wagon wagon, RemoteRepositoryContent remoteRepository, String remotePath, + ManagedRepositoryContent repository, File workingDirectory, File localFile ) + throws ProxyException + { + assert ( remotePath != null ); + + // Transfer the file. + File temp = null; + + try + { + temp = new File(workingDirectory, localFile.getName()); + + boolean success = false; + + if ( !localFile.exists() ) + { + log.debug( "Retrieving " + remotePath + " from " + remoteRepository.getRepository().getName() ); + wagon.get( remotePath, temp ); + success = true; + + // You wouldn't get here on failure, a WagonException would have been thrown. + log.debug( "Downloaded successfully." ); + } + else + { + log.debug( "Retrieving " + remotePath + " from " + remoteRepository.getRepository().getName() + + " if updated" ); + success = wagon.getIfNewer( remotePath, temp, localFile.lastModified() ); + if ( !success ) + { + throw new NotModifiedException( + "Not downloaded, as local file is newer than remote side: " + localFile.getAbsolutePath() ); + } + + if ( temp.exists() ) + { + log.debug( "Downloaded successfully." ); + } + } + + return temp; + } + catch ( ResourceDoesNotExistException e ) + { + throw new NotFoundException( + "Resource [" + remoteRepository.getURL() + "/" + remotePath + "] does not exist: " + e.getMessage(), + e ); + } + catch ( WagonException e ) + { + // TODO: shouldn't have to drill into the cause, but TransferFailedException is often not descriptive enough + + String msg = + "Download failure on resource [" + remoteRepository.getURL() + "/" + remotePath + "]:" + e.getMessage(); + if ( e.getCause() != null ) + { + msg += " (cause: " + e.getCause() + ")"; + } + throw new ProxyException( msg, e ); + } + } + + /** + * Apply the policies. + * + * @param policies the map of policies to execute. (Map of String policy keys, to {@link DownloadPolicy} objects) + * @param settings the map of settings for the policies to execute. (Map of String policy keys, to String policy setting) + * @param request the request properties (utilized by the {@link DownloadPolicy#applyPolicy(String,Properties,File)}) + * @param localFile the local file (utilized by the {@link DownloadPolicy#applyPolicy(String,Properties,File)}) + */ + private void validatePolicies( Map policies, Map settings, + Properties request, File localFile ) + throws PolicyViolationException + { + for ( Entry entry : policies.entrySet() ) + { + String key = entry.getKey(); + DownloadPolicy policy = entry.getValue(); + String defaultSetting = policy.getDefaultOption(); + String setting = StringUtils.defaultString( settings.get( key ), defaultSetting ); + + log.debug( "Applying [" + key + "] policy with [" + setting + "]" ); + try + { + policy.applyPolicy( setting, request, localFile ); + } + catch ( PolicyConfigurationException e ) + { + log.error( e.getMessage(), e ); + } + } + } + + private void validatePolicies( Map policies, Map settings, + Properties request, ArtifactReference artifact, RemoteRepositoryContent content, + File localFile, ProxyException exception, Map previousExceptions ) + throws ProxyDownloadException + { + boolean process = true; + for ( Entry entry : policies.entrySet() ) + { + String key = entry.getKey(); + DownloadErrorPolicy policy = entry.getValue(); + String defaultSetting = policy.getDefaultOption(); + String setting = StringUtils.defaultString( settings.get( key ), defaultSetting ); + + log.debug( "Applying [" + key + "] policy with [" + setting + "]" ); + try + { + // all policies must approve the exception, any can cancel + process = policy.applyPolicy( setting, request, localFile, exception, previousExceptions ); + if ( !process ) + { + break; + } + } + catch ( PolicyConfigurationException e ) + { + log.error( e.getMessage(), e ); + } + } + + if ( process ) + { + // if the exception was queued, don't throw it + if ( !previousExceptions.containsKey( content.getId() ) ) + { + throw new ProxyDownloadException( + "An error occurred in downloading from the remote repository, and the policy is to fail immediately", + content.getId(), exception ); + } + } + else + { + // if the exception was queued, but cancelled, remove it + previousExceptions.remove( content.getId() ); + } + + log.warn( "Transfer error from repository \"" + content.getRepository().getId() + "\" for artifact " + + Keys.toKey( artifact ) + ", continuing to next repository. Error message: " + exception.getMessage() ); + log.debug( "Full stack trace", exception ); + } + + /** + * Creates a working directory in the repository root for this request + * @param repository + * @return file location of working directory + */ + private File createWorkingDirectory(ManagedRepositoryContent repository) + { + //TODO: This is ugly - lets actually clean this up when we get the new repository api + try + { + File tmpDir = File.createTempFile(".workingdirectory", null, new File(repository.getRepoRoot())); + tmpDir.delete(); + tmpDir.mkdirs(); + return tmpDir; + } + catch (IOException e) + { + throw new RuntimeException("Could not create working directory for this request", e); + } + } + + /** + * Used to move the temporary file to its real destination. This is patterned from the way WagonManager handles + * its downloaded files. + * + * @param temp The completed download file + * @param target The final location of the downloaded file + * @throws ProxyException when the temp file cannot replace the target file + */ + private void moveTempToTarget( File temp, File target ) + throws ProxyException + { + if ( target.exists() && !target.delete() ) + { + throw new ProxyException( "Unable to overwrite existing target file: " + target.getAbsolutePath() ); + } + + target.getParentFile().mkdirs(); + if ( !temp.renameTo( target ) ) + { + log.warn( "Unable to rename tmp file to its final name... resorting to copy command." ); + + try + { + FileUtils.copyFile( temp, target ); + } + catch ( IOException e ) + { + if (target.exists()) + { + log.debug("Tried to copy file " + temp.getName() + " to " + target.getAbsolutePath() + " but file with this name already exists."); + } + else + { + throw new ProxyException( "Cannot copy tmp file " + temp.getAbsolutePath() + " to its final location", e ); + } + } + finally + { + FileUtils.deleteQuietly(temp); + } + } + } + + /** + * Using wagon, connect to the remote repository. + * + * @param connector the connector configuration to utilize (for obtaining network proxy configuration from) + * @param wagon the wagon instance to establish the connection on. + * @param remoteRepository the remote repository to connect to. + * @return true if the connection was successful. false if not connected. + */ + private boolean connectToRepository( ProxyConnector connector, Wagon wagon, + RemoteRepositoryContent remoteRepository ) + { + boolean connected = false; + + final ProxyInfo networkProxy; + synchronized ( this.networkProxyMap ) + { + networkProxy = (ProxyInfo) this.networkProxyMap.get( connector.getProxyId() ); + } + + if ( log.isDebugEnabled() ) + { + if ( networkProxy != null ) + { + // TODO: move to proxyInfo.toString() + String msg = + "Using network proxy " + networkProxy.getHost() + ":" + networkProxy.getPort() + + " to connect to remote repository " + remoteRepository.getURL(); + if ( networkProxy.getNonProxyHosts() != null ) + { + msg += "; excluding hosts: " + networkProxy.getNonProxyHosts(); + } + if ( StringUtils.isNotBlank( networkProxy.getUserName() ) ) + { + msg += "; as user: " + networkProxy.getUserName(); + } + log.debug( msg ); + } + } + + AuthenticationInfo authInfo = null; + String username = remoteRepository.getRepository().getUsername(); + String password = remoteRepository.getRepository().getPassword(); + + if ( StringUtils.isNotBlank( username ) && StringUtils.isNotBlank( password ) ) + { + log.debug( "Using username " + username + " to connect to remote repository " + + remoteRepository.getURL() ); + authInfo = new AuthenticationInfo(); + authInfo.setUserName( username ); + authInfo.setPassword( password ); + } + + //Convert seconds to milliseconds + int timeoutInMilliseconds = remoteRepository.getRepository().getTimeout() * 1000; + + //Set timeout + wagon.setTimeout(timeoutInMilliseconds); + + try + { + Repository wagonRepository = new Repository( remoteRepository.getId(), remoteRepository.getURL().toString() ); + wagon.connect( wagonRepository, authInfo, networkProxy ); + connected = true; + } + catch ( ConnectionException e ) + { + log.warn( + "Could not connect to " + remoteRepository.getRepository().getName() + ": " + e.getMessage() ); + connected = false; + } + catch ( AuthenticationException e ) + { + log.warn( + "Could not connect to " + remoteRepository.getRepository().getName() + ": " + e.getMessage() ); + connected = false; + } + + return connected; + } + + /** + * Tests whitelist and blacklist patterns against path. + * + * @param path the path to test. + * @param patterns the list of patterns to check. + * @return true if the path matches at least 1 pattern in the provided patterns list. + */ + private boolean matchesPattern( String path, List patterns ) + { + if ( CollectionUtils.isEmpty( patterns ) ) + { + return false; + } + + for ( String pattern : patterns ) + { + if ( SelectorUtils.matchPath( pattern, path, false ) ) + { + return true; + } + } + + return false; + } + + /** + * TODO: Ensure that list is correctly ordered based on configuration. See MRM-477 + */ + public List getProxyConnectors( ManagedRepositoryContent repository ) + { + synchronized ( this.proxyConnectorMap ) + { + List ret = (List) this.proxyConnectorMap.get( repository.getId() ); + if ( ret == null ) + { + return Collections.emptyList(); + } + + Collections.sort( ret, ProxyConnectorOrderComparator.getInstance() ); + return ret; + } + } + + public void afterConfigurationChange( Registry registry, String propertyName, Object propertyValue ) + { + if ( ConfigurationNames.isNetworkProxy( propertyName ) || + ConfigurationNames.isManagedRepositories( propertyName ) || + ConfigurationNames.isRemoteRepositories( propertyName ) || + ConfigurationNames.isProxyConnector( propertyName ) ) + { + initConnectorsAndNetworkProxies(); + } + } + + public void beforeConfigurationChange( Registry registry, String propertyName, Object propertyValue ) + { + /* do nothing */ + } + + @SuppressWarnings("unchecked") + private void initConnectorsAndNetworkProxies() + { + synchronized ( this.proxyConnectorMap ) + { + ProxyConnectorOrderComparator proxyOrderSorter = new ProxyConnectorOrderComparator(); + this.proxyConnectorMap.clear(); + + List proxyConfigs = archivaConfiguration.getConfiguration() + .getProxyConnectors(); + for ( ProxyConnectorConfiguration proxyConfig : proxyConfigs ) + { + String key = proxyConfig.getSourceRepoId(); + + try + { + // Create connector object. + ProxyConnector connector = new ProxyConnector(); + + connector.setSourceRepository( repositoryFactory.getManagedRepositoryContent( proxyConfig + .getSourceRepoId() ) ); + connector.setTargetRepository( repositoryFactory.getRemoteRepositoryContent( proxyConfig + .getTargetRepoId() ) ); + + connector.setProxyId( proxyConfig.getProxyId() ); + connector.setPolicies( proxyConfig.getPolicies() ); + connector.setOrder( proxyConfig.getOrder() ); + + // Copy any blacklist patterns. + List blacklist = new ArrayList(); + if ( CollectionUtils.isNotEmpty( proxyConfig.getBlackListPatterns() ) ) + { + blacklist.addAll( proxyConfig.getBlackListPatterns() ); + } + connector.setBlacklist( blacklist ); + + // Copy any whitelist patterns. + List whitelist = new ArrayList(); + if ( CollectionUtils.isNotEmpty( proxyConfig.getWhiteListPatterns() ) ) + { + whitelist.addAll( proxyConfig.getWhiteListPatterns() ); + } + connector.setWhitelist( whitelist ); + + // Get other connectors + List connectors = this.proxyConnectorMap.get( key ); + if ( connectors == null ) + { + // Create if we are the first. + connectors = new ArrayList(); + } + + // Add the connector. + connectors.add( connector ); + + // Ensure the list is sorted. + Collections.sort( connectors, proxyOrderSorter ); + + // Set the key to the list of connectors. + this.proxyConnectorMap.put( key, connectors ); + } + catch ( RepositoryNotFoundException e ) + { + log.warn( "Unable to use proxy connector: " + e.getMessage(), e ); + } + catch ( RepositoryException e ) + { + log.warn( "Unable to use proxy connector: " + e.getMessage(), e ); + } + } + + } + + synchronized ( this.networkProxyMap ) + { + this.networkProxyMap.clear(); + + List networkProxies = archivaConfiguration.getConfiguration().getNetworkProxies(); + for ( NetworkProxyConfiguration networkProxyConfig : networkProxies ) + { + String key = networkProxyConfig.getId(); + + ProxyInfo proxy = new ProxyInfo(); + + proxy.setType( networkProxyConfig.getProtocol() ); + proxy.setHost( networkProxyConfig.getHost() ); + proxy.setPort( networkProxyConfig.getPort() ); + proxy.setUserName( networkProxyConfig.getUsername() ); + proxy.setPassword( networkProxyConfig.getPassword() ); + + this.networkProxyMap.put( key, proxy ); + } + } + } + + public void initialize() + throws InitializationException + { + initConnectorsAndNetworkProxies(); + archivaConfiguration.addChangeListener( this ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/NotFoundException.java b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/NotFoundException.java new file mode 100644 index 000000000..c4ab4c9cd --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/NotFoundException.java @@ -0,0 +1,40 @@ +package org.apache.maven.archiva.proxy; + +/* + * 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. + */ + +/** + * NotFoundException - thrown when the resource requested was not found on the remote repository. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class NotFoundException + extends ProxyException +{ + public NotFoundException( String message, Throwable t ) + { + super( message, t ); + } + + public NotFoundException( String message ) + { + super( message ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/NotModifiedException.java b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/NotModifiedException.java new file mode 100644 index 000000000..06dd3e79a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/NotModifiedException.java @@ -0,0 +1,48 @@ +package org.apache.maven.archiva.proxy; + +/* + * 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. + */ + +/** + *

+ * NotModifiedException - thrown when the resource requested was found on the remote repository, but + * the remote repository reported that the copy we have in our managed repository is newer than + * the one present on the remote repository. + *

+ *

+ * Similar in scope to the HTTP 304 Not Modified response code. + *

+ * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class NotModifiedException + extends ProxyException +{ + + public NotModifiedException( String message ) + { + super( message ); + } + + public NotModifiedException( String message, Throwable t ) + { + super( message, t ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/ProxyConnector.java b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/ProxyConnector.java new file mode 100644 index 000000000..8d59d7d6b --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/ProxyConnector.java @@ -0,0 +1,149 @@ +package org.apache.maven.archiva.proxy; + +/* + * 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.archiva.repository.ManagedRepositoryContent; +import org.apache.maven.archiva.repository.RemoteRepositoryContent; +import org.apache.maven.archiva.repository.connector.RepositoryConnector; + +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +/** + * This represents a connector for a repository to repository proxy. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ProxyConnector + implements RepositoryConnector +{ + private ManagedRepositoryContent sourceRepository; + + private RemoteRepositoryContent targetRepository; + + private List blacklist; + + private List whitelist; + + private String proxyId; + + private int order; + + private Map policies; + + public List getBlacklist() + { + return blacklist; + } + + public void setBlacklist( List blacklist ) + { + this.blacklist = blacklist; + } + + public ManagedRepositoryContent getSourceRepository() + { + return sourceRepository; + } + + public void setSourceRepository( ManagedRepositoryContent sourceRepository ) + { + this.sourceRepository = sourceRepository; + } + + public RemoteRepositoryContent getTargetRepository() + { + return targetRepository; + } + + public void setTargetRepository( RemoteRepositoryContent targetRepository ) + { + this.targetRepository = targetRepository; + } + + public List getWhitelist() + { + return whitelist; + } + + public void setWhitelist( List whitelist ) + { + this.whitelist = whitelist; + } + + public Map getPolicies() + { + return policies; + } + + public void setPolicies( Map policies ) + { + this.policies = policies; + } + + public String getProxyId() + { + return proxyId; + } + + public void setProxyId( String proxyId ) + { + this.proxyId = proxyId; + } + + public String toString() + { + StringBuffer sb = new StringBuffer(); + + sb.append( "ProxyConnector[\n" ); + sb.append( " source: [managed] " ).append( this.sourceRepository.getRepoRoot() ).append( "\n" ); + sb.append( " target: [remote] " ).append( this.targetRepository.getRepository().getUrl() ).append( "\n" ); + sb.append( " proxyId:" ).append( this.proxyId ).append( "\n" ); + + Iterator keys = this.policies.keySet().iterator(); + while ( keys.hasNext() ) + { + String name = keys.next(); + sb.append( " policy[" ).append( name ).append( "]:" ); + sb.append( this.policies.get( name ) ).append( "\n" ); + } + + sb.append( "]" ); + + return sb.toString(); + } + + public void setPolicy( String policyId, String policySetting ) + { + this.policies.put( policyId, policySetting ); + } + + public int getOrder() + { + return order; + } + + public void setOrder( int order ) + { + this.order = order; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/ProxyConnectorOrderComparator.java b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/ProxyConnectorOrderComparator.java new file mode 100644 index 000000000..05c8e9aa0 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/ProxyConnectorOrderComparator.java @@ -0,0 +1,71 @@ +package org.apache.maven.archiva.proxy; + +/* + * 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.Comparator; + +/** + * ProxyConnectorOrderComparator + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ProxyConnectorOrderComparator + implements Comparator +{ + private static ProxyConnectorOrderComparator INSTANCE = new ProxyConnectorOrderComparator(); + + public static ProxyConnectorOrderComparator getInstance() + { + return INSTANCE; + } + + public int compare( ProxyConnector o1, ProxyConnector o2 ) + { + if ( o1 == null && o2 == null ) + { + return 0; + } + + // Ensure null goes to end of list. + if ( o1 == null && o2 != null ) + { + return 1; + } + + if ( o1 != null && o2 == null ) + { + return -1; + } + + // Ensure 0 (unordered) goes to end of list. + if ( o1.getOrder() == 0 && o2.getOrder() != 0 ) + { + return 1; + } + + if ( o1.getOrder() != 0 && o2.getOrder() == 0 ) + { + return -1; + } + + return o1.getOrder() - o2.getOrder(); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/ProxyException.java b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/ProxyException.java new file mode 100644 index 000000000..1704bd326 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/ProxyException.java @@ -0,0 +1,37 @@ +package org.apache.maven.archiva.proxy; + +/* + * 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 Edwin Punzalan + */ +public class ProxyException + extends Exception +{ + public ProxyException( String message ) + { + super( message ); + } + + public ProxyException( String message, Throwable t ) + { + super( message, t ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/RepositoryProxyConnectors.java b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/RepositoryProxyConnectors.java new file mode 100644 index 000000000..760688db0 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/RepositoryProxyConnectors.java @@ -0,0 +1,92 @@ +package org.apache.maven.archiva.proxy; + +/* + * 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.archiva.model.ArtifactReference; +import org.apache.maven.archiva.policies.ProxyDownloadException; +import org.apache.maven.archiva.repository.ManagedRepositoryContent; + +import java.io.File; +import java.util.List; + +/** + * Handler for potential repository proxy connectors. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public interface RepositoryProxyConnectors +{ + /** + * Performs the artifact fetch operation against the target repositories + * of the provided source repository. + * + * If the artifact is found, it is downloaded and placed into the source repository + * filesystem. + * + * @param repository the source repository to use. (must be a managed repository) + * @param artifact the artifact to fetch. + * @return the file that was obtained, or null if no content was obtained + * @throws ProxyDownloadException if there was a problem fetching the content from the target repositories. + */ + public File fetchFromProxies( ManagedRepositoryContent repository, ArtifactReference artifact ) + throws ProxyDownloadException; + + /** + * Performs the metadata fetch operation against the target repositories + * of the provided source repository. + * + * If the metadata is found, it is downloaded and placed into the source repository + * filesystem. + * + * @param repository the source repository to use. (must be a managed repository) + * @param metadata the metadata to fetch. + * @return the file that was obtained, or null if no content was obtained + */ + public File fetchMetatadaFromProxies( ManagedRepositoryContent repository, String logicalPath ); + + /** + * Performs the fetch operation against the target repositories + * of the provided source repository. + * + * @param repository the source repository to use. (must be a managed repository) + * @param path the path of the resource to fetch + * @return the file that was obtained, or null if no content was obtained + */ + public File fetchFromProxies( ManagedRepositoryContent managedRepository, String path ); + + /** + * Get the List of {@link ProxyConnector} objects of the source repository. + * + * @param repository the source repository to look for. + * @return the List of {@link ProxyConnector} objects. + */ + public List getProxyConnectors( ManagedRepositoryContent repository ); + + /** + * Tests to see if the provided repository is a source repository for + * any {@link ProxyConnector} objects. + * + * @param repository the source repository to look for. + * @return true if there are proxy connectors that use the provided + * repository as a source repository. + */ + public boolean hasProxies( ManagedRepositoryContent repository ); +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/WagonFactory.java b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/WagonFactory.java new file mode 100644 index 000000000..a32d1550d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/WagonFactory.java @@ -0,0 +1,39 @@ +package org.apache.maven.archiva.proxy; + +/* + * 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.wagon.Wagon; + +/** + * Create a Wagon instance for the given protocol. Implementation will be provided by a Spring service locator. + * + * @author Brett Porter + */ +public interface WagonFactory +{ + /** + * Create a new Wagon instance for the given protocol. + * + * @param protocol the protocol to find the Wagon for, which must be prefixed with wagon#, for example + * wagon#http. + * @return the Wagon instance + */ + Wagon getWagon( String protocol ); +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/main/resources/META-INF/spring-context.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/main/resources/META-INF/spring-context.xml new file mode 100644 index 000000000..baae58725 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/main/resources/META-INF/spring-context.xml @@ -0,0 +1,30 @@ + + + + + + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/AbstractProxyTestCase.java b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/AbstractProxyTestCase.java new file mode 100644 index 000000000..344e5fc10 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/AbstractProxyTestCase.java @@ -0,0 +1,628 @@ +package org.apache.maven.archiva.proxy; + +/* + * 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.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Collection; +import java.util.Date; +import java.util.Locale; + +import org.apache.commons.io.FileUtils; +import org.apache.commons.lang.ArrayUtils; +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.configuration.ProxyConnectorConfiguration; +import org.apache.maven.archiva.configuration.RemoteRepositoryConfiguration; +import org.apache.maven.archiva.policies.CachedFailuresPolicy; +import org.apache.maven.archiva.policies.ChecksumPolicy; +import org.apache.maven.archiva.policies.PropagateErrorsDownloadPolicy; +import org.apache.maven.archiva.policies.PropagateErrorsOnUpdateDownloadPolicy; +import org.apache.maven.archiva.policies.ReleasesPolicy; +import org.apache.maven.archiva.policies.SnapshotsPolicy; +import org.apache.maven.archiva.repository.ManagedRepositoryContent; +import org.apache.maven.wagon.Wagon; +import org.codehaus.plexus.spring.PlexusInSpringTestCase; +import org.easymock.ArgumentsMatcher; +import org.easymock.MockControl; + +/** + * AbstractProxyTestCase + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public abstract class AbstractProxyTestCase + extends PlexusInSpringTestCase +{ + protected static final String ID_LEGACY_PROXIED = "legacy-proxied"; + + protected static final String ID_PROXIED1 = "proxied1"; + + protected static final String ID_PROXIED1_TARGET = "proxied1-target"; + + protected static final String ID_PROXIED2 = "proxied2"; + + protected static final String ID_PROXIED2_TARGET = "proxied2-target"; + + protected static final String ID_DEFAULT_MANAGED = "default-managed-repository"; + + protected static final String ID_LEGACY_MANAGED = "legacy-managed-repository"; + + protected static final String REPOPATH_PROXIED_LEGACY = "src/test/repositories/legacy-proxied"; + + protected static final String REPOPATH_PROXIED1 = "src/test/repositories/proxied1"; + + protected static final String REPOPATH_PROXIED1_TARGET = "target/test-repository/proxied1"; + + protected static final String REPOPATH_PROXIED2 = "src/test/repositories/proxied2"; + + protected static final String REPOPATH_PROXIED2_TARGET = "target/test-repository/proxied2"; + + protected static final String REPOPATH_DEFAULT_MANAGED = "src/test/repositories/managed"; + + // protected static final String REPOPATH_DEFAULT_MANAGED_TARGET = "target/test-repository/managed"; + + protected static final String REPOPATH_LEGACY_MANAGED = "src/test/repositories/legacy-managed"; + + protected static final String REPOPATH_LEGACY_MANAGED_TARGET = "target/test-repository/legacy-managed"; + + protected static final ArgumentsMatcher customWagonGetIfNewerMatcher = new ArgumentsMatcher() { + + public boolean matches(Object[] expected, Object[] actual) { + if (expected.length < 1 || actual.length < 1) + { + return false; + } + return MockControl.ARRAY_MATCHER.matches(ArrayUtils.remove(expected, 1), ArrayUtils.remove(actual, 1)); + } + + public String toString(Object[] arguments) { + return ArrayUtils.toString(arguments); + } + }; + + protected static final ArgumentsMatcher customWagonGetMatcher = new ArgumentsMatcher() { + + public boolean matches(Object[] expected, Object[] actual) + { + if (expected.length == 2 && actual.length == 2) + { + if (expected[0] == null && actual[0] == null) + { + return true; + } + + if (expected[0] == null) + { + return actual[0] == null; + } + + if (actual[0] == null) + { + return expected[0] == null; + } + + return expected[0].equals(actual[0]); + } + return false; + } + + public String toString(Object[] arguments) + { + return ArrayUtils.toString(arguments); + } + }; + + protected MockControl wagonMockControl; + + protected Wagon wagonMock; + + protected RepositoryProxyConnectors proxyHandler; + + protected ManagedRepositoryContent managedDefaultRepository; + + protected File managedDefaultDir; + + protected ManagedRepositoryContent managedLegacyRepository; + + protected File managedLegacyDir; + + protected MockConfiguration config; + + protected void assertChecksums( File expectedFile, String expectedSha1Contents, String expectedMd5Contents ) + throws Exception + { + File sha1File = new File( expectedFile.getAbsolutePath() + ".sha1" ); + File md5File = new File( expectedFile.getAbsolutePath() + ".md5" ); + + if ( expectedSha1Contents == null ) + { + assertFalse( "SHA1 File should NOT exist: " + sha1File.getPath(), sha1File.exists() ); + } + else + { + assertTrue( "SHA1 File should exist: " + sha1File.getPath(), sha1File.exists() ); + String actualSha1Contents = readChecksumFile( sha1File ); + assertEquals( "SHA1 File contents: " + sha1File.getPath(), expectedSha1Contents, actualSha1Contents ); + } + + if ( expectedMd5Contents == null ) + { + assertFalse( "MD5 File should NOT exist: " + md5File.getPath(), md5File.exists() ); + } + else + { + assertTrue( "MD5 File should exist: " + md5File.getPath(), md5File.exists() ); + String actualMd5Contents = readChecksumFile( md5File ); + assertEquals( "MD5 File contents: " + md5File.getPath(), expectedMd5Contents, actualMd5Contents ); + } + } + + protected void assertFileEquals( File expectedFile, File actualFile, File sourceFile ) + throws Exception + { + assertNotNull( "Expected File should not be null.", expectedFile ); + assertNotNull( "Actual File should not be null.", actualFile ); + + assertTrue( "Check actual file exists.", actualFile.exists() ); + assertEquals( "Check filename path is appropriate.", expectedFile.getCanonicalPath(), actualFile.getCanonicalPath() ); + assertEquals( "Check file path matches.", expectedFile.getAbsolutePath(), actualFile.getAbsolutePath() ); + + String expectedContents = FileUtils.readFileToString( sourceFile, null ); + String actualContents = FileUtils.readFileToString( actualFile, null ); + assertEquals( "Check file contents.", expectedContents, actualContents ); + } + + protected void assertNotDownloaded( File downloadedFile ) + { + assertNull( "Found file: " + downloadedFile + "; but was expecting a failure", downloadedFile ); + } + + protected void assertNoTempFiles( File expectedFile ) + { + File workingDir = expectedFile.getParentFile(); + if ( ( workingDir == null ) || !workingDir.isDirectory() ) + { + return; + } + + Collection tmpFiles = FileUtils.listFiles( workingDir, new String[] { "tmp" }, false ); + if ( !tmpFiles.isEmpty() ) + { + StringBuffer emsg = new StringBuffer(); + emsg.append( "Found Temp Files in dir: " ).append( workingDir.getPath() ); + for ( File tfile : tmpFiles ) + { + emsg.append( "\n " ).append( tfile.getName() ); + } + fail( emsg.toString() ); + } + } + + /** + * A faster recursive copy that omits .svn directories. + * + * @param sourceDirectory the source directory to copy + * @param destDirectory the target location + * @throws java.io.IOException if there is a copying problem + * @todo get back into plexus-utils, share with converter module + */ + protected void copyDirectoryStructure( File sourceDirectory, File destDirectory ) + throws IOException + { + if ( !sourceDirectory.exists() ) + { + throw new IOException( "Source directory doesn't exists (" + sourceDirectory.getAbsolutePath() + ")." ); + } + + File[] files = sourceDirectory.listFiles(); + + String sourcePath = sourceDirectory.getAbsolutePath(); + + for ( int i = 0; i < files.length; i++ ) + { + File file = files[i]; + + String dest = file.getAbsolutePath(); + + dest = dest.substring( sourcePath.length() + 1 ); + + File destination = new File( destDirectory, dest ); + + if ( file.isFile() ) + { + destination = destination.getParentFile(); + + FileUtils.copyFile( file, new File( destination, file.getName() ), false ); + // TODO: Change when there is a FileUtils.copyFileToDirectory(file, destination, boolean) option + //FileUtils.copyFileToDirectory( file, destination ); + } + else if ( file.isDirectory() ) + { + if ( !".svn".equals( file.getName() ) ) + { + if ( !destination.exists() && !destination.mkdirs() ) + { + throw new IOException( "Could not create destination directory '" + + destination.getAbsolutePath() + "'." ); + } + + copyDirectoryStructure( file, destination ); + } + } + else + { + throw new IOException( "Unknown file type: " + file.getAbsolutePath() ); + } + } + } + + protected ManagedRepositoryContent createManagedLegacyRepository() + throws Exception + { + return createRepository( "testManagedLegacyRepo", "Test Managed (Legacy) Repository", + "src/test/repositories/legacy-managed", "legacy" ); + } + + protected ManagedRepositoryContent createProxiedLegacyRepository() + throws Exception + { + return createRepository( "testProxiedLegacyRepo", "Test Proxied (Legacy) Repository", + "src/test/repositories/legacy-proxied", "legacy" ); + } + + protected ManagedRepositoryContent createRepository( String id, String name, String path, String layout ) + throws Exception + { + ManagedRepositoryConfiguration repo = new ManagedRepositoryConfiguration(); + repo.setId( id ); + repo.setName( name ); + repo.setLocation( path ); + repo.setLayout( layout ); + + ManagedRepositoryContent repoContent = (ManagedRepositoryContent) lookup( ManagedRepositoryContent.class, + layout ); + repoContent.setRepository( repo ); + return repoContent; + } + + /** + * Read the first line from the checksum file, and return it (trimmed). + */ + protected String readChecksumFile( File checksumFile ) + throws Exception + { + FileReader freader = null; + BufferedReader buf = null; + + try + { + freader = new FileReader( checksumFile ); + buf = new BufferedReader( freader ); + return buf.readLine(); + } + finally + { + if ( buf != null ) + { + buf.close(); + } + + if ( freader != null ) + { + freader.close(); + } + } + } + + protected void saveConnector( String sourceRepoId, String targetRepoId ) + { + saveConnector( sourceRepoId, targetRepoId, ChecksumPolicy.IGNORE, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + } + + protected void saveConnector( String sourceRepoId, String targetRepoId, String checksumPolicy, String releasePolicy, + String snapshotPolicy, String cacheFailuresPolicy ) + { + saveConnector( sourceRepoId, targetRepoId, checksumPolicy, releasePolicy, snapshotPolicy, cacheFailuresPolicy, + PropagateErrorsDownloadPolicy.QUEUE ); + } + + protected void saveConnector( String sourceRepoId, String targetRepoId, String checksumPolicy, String releasePolicy, + String snapshotPolicy, String cacheFailuresPolicy, String errorPolicy ) + { + saveConnector( sourceRepoId, targetRepoId, checksumPolicy, releasePolicy, snapshotPolicy, cacheFailuresPolicy, + errorPolicy, PropagateErrorsOnUpdateDownloadPolicy.NOT_PRESENT ); + } + + protected void saveConnector( String sourceRepoId, String targetRepoId, String checksumPolicy, String releasePolicy, + String snapshotPolicy, String cacheFailuresPolicy, String errorPolicy, + String errorOnUpdatePolicy ) + { + ProxyConnectorConfiguration connectorConfig = new ProxyConnectorConfiguration(); + connectorConfig.setSourceRepoId( sourceRepoId ); + connectorConfig.setTargetRepoId( targetRepoId ); + connectorConfig.addPolicy( ProxyConnectorConfiguration.POLICY_CHECKSUM, checksumPolicy ); + connectorConfig.addPolicy( ProxyConnectorConfiguration.POLICY_RELEASES, releasePolicy ); + connectorConfig.addPolicy( ProxyConnectorConfiguration.POLICY_SNAPSHOTS, snapshotPolicy ); + connectorConfig.addPolicy( ProxyConnectorConfiguration.POLICY_CACHE_FAILURES, cacheFailuresPolicy ); + connectorConfig.addPolicy( ProxyConnectorConfiguration.POLICY_PROPAGATE_ERRORS, errorPolicy ); + connectorConfig.addPolicy( ProxyConnectorConfiguration.POLICY_PROPAGATE_ERRORS_ON_UPDATE, errorOnUpdatePolicy ); + + int count = config.getConfiguration().getProxyConnectors().size(); + config.getConfiguration().addProxyConnector( connectorConfig ); + + // Proper Triggering ... + String prefix = "proxyConnectors.proxyConnector(" + count + ")"; + config.triggerChange( prefix + ".sourceRepoId", connectorConfig.getSourceRepoId() ); + config.triggerChange( prefix + ".targetRepoId", connectorConfig.getTargetRepoId() ); + config.triggerChange( prefix + ".proxyId", connectorConfig.getProxyId() ); + config.triggerChange( prefix + ".policies.releases", connectorConfig.getPolicy( "releases", "" ) ); + config.triggerChange( prefix + ".policies.checksum", connectorConfig.getPolicy( "checksum", "" ) ); + config.triggerChange( prefix + ".policies.snapshots", connectorConfig.getPolicy( "snapshots", "" ) ); + config.triggerChange( prefix + ".policies.cache-failures", connectorConfig.getPolicy( "cache-failures", "" ) ); + config.triggerChange( prefix + ".policies.propagate-errors", + connectorConfig.getPolicy( "propagate-errors", "" ) ); + config.triggerChange( prefix + ".policies.propagate-errors-on-update", + connectorConfig.getPolicy( "propagate-errors-on-update", "" ) ); + } + + protected void saveManagedRepositoryConfig( String id, String name, String path, String layout ) + { + ManagedRepositoryConfiguration repoConfig = new ManagedRepositoryConfiguration(); + + repoConfig.setId( id ); + repoConfig.setName( name ); + repoConfig.setLayout( layout ); + + repoConfig.setLocation( path ); + + int count = config.getConfiguration().getManagedRepositories().size(); + config.getConfiguration().addManagedRepository( repoConfig ); + + String prefix = "managedRepositories.managedRepository(" + count + ")"; + config.triggerChange( prefix + ".id", repoConfig.getId() ); + config.triggerChange( prefix + ".name", repoConfig.getName() ); + config.triggerChange( prefix + ".location", repoConfig.getLocation() ); + config.triggerChange( prefix + ".layout", repoConfig.getLayout() ); + } + + protected void saveRemoteRepositoryConfig( String id, String name, String url, String layout ) + { + RemoteRepositoryConfiguration repoConfig = new RemoteRepositoryConfiguration(); + + repoConfig.setId( id ); + repoConfig.setName( name ); + repoConfig.setLayout( layout ); + repoConfig.setUrl( url ); + + int count = config.getConfiguration().getRemoteRepositories().size(); + config.getConfiguration().addRemoteRepository( repoConfig ); + + String prefix = "remoteRepositories.remoteRepository(" + count + ")"; + config.triggerChange( prefix + ".id", repoConfig.getId() ); + config.triggerChange( prefix + ".name", repoConfig.getName() ); + config.triggerChange( prefix + ".url", repoConfig.getUrl() ); + config.triggerChange( prefix + ".layout", repoConfig.getLayout() ); + } + + protected File saveTargetedRepositoryConfig( String id, String originalPath, String targetPath, String layout ) + throws IOException + { + File repoLocation = getTestFile( targetPath ); + FileUtils.deleteDirectory( repoLocation ); + copyDirectoryStructure( getTestFile( originalPath ), repoLocation ); + + saveRemoteRepositoryConfig( id, "Target Repo-" + id, targetPath, layout ); + + return repoLocation; + } + + /** + * {@inheritDoc} + * @see org.codehaus.plexus.spring.PlexusInSpringTestCase#getConfigLocation() + */ + @Override + protected String getSpringConfigLocation() + { + return "org/apache/maven/archiva/proxy/spring-context.xml"; + } + + @Override + protected void setUp() + throws Exception + { + super.setUp(); + + config = (MockConfiguration) lookup( ArchivaConfiguration.class.getName(), "mock" ); + + // Setup source repository (using default layout) + String repoPath = "target/test-repository/managed/" + getName(); + File repoLocation = getTestFile( repoPath ); + + managedDefaultRepository = createRepository( ID_DEFAULT_MANAGED, "Default Managed Repository", repoPath, + "default" ); + + managedDefaultDir = new File( managedDefaultRepository.getRepoRoot() ); + + ManagedRepositoryConfiguration repoConfig = managedDefaultRepository.getRepository(); + + config.getConfiguration().addManagedRepository( repoConfig ); + + // Setup source repository (using legacy layout) + repoLocation = getTestFile( REPOPATH_LEGACY_MANAGED_TARGET ); + FileUtils.deleteDirectory( repoLocation ); + copyDirectoryStructure( getTestFile( REPOPATH_LEGACY_MANAGED ), repoLocation ); + + managedLegacyRepository = createRepository( ID_LEGACY_MANAGED, "Legacy Managed Repository", + REPOPATH_LEGACY_MANAGED_TARGET, "legacy" ); + + managedLegacyDir = new File( managedLegacyRepository.getRepoRoot() ); + + repoConfig = managedLegacyRepository.getRepository(); + + config.getConfiguration().addManagedRepository( repoConfig ); + + // Setup target (proxied to) repository. + saveRemoteRepositoryConfig( ID_PROXIED1, "Proxied Repository 1", new File( REPOPATH_PROXIED1 ).toURL() + .toExternalForm(), "default" ); + + // Setup target (proxied to) repository. + saveRemoteRepositoryConfig( ID_PROXIED2, "Proxied Repository 2", new File( REPOPATH_PROXIED2 ).toURL() + .toExternalForm(), "default" ); + + // Setup target (proxied to) repository using legacy layout. + saveRemoteRepositoryConfig( ID_LEGACY_PROXIED, "Proxied Legacy Repository", new File( REPOPATH_PROXIED_LEGACY ) + .toURL().toExternalForm(), "legacy" ); + + // Setup the proxy handler. + proxyHandler = (RepositoryProxyConnectors) lookup( RepositoryProxyConnectors.class.getName() ); + + // Setup the wagon mock. + wagonMockControl = MockControl.createNiceControl( Wagon.class ); + wagonMock = (Wagon) wagonMockControl.getMock(); + WagonDelegate delegate = (WagonDelegate) lookup( Wagon.ROLE, "test" ); + delegate.setDelegate( wagonMock ); + + System.out.println( "\n.\\ " + getName() + "() \\._________________________________________\n" ); + } + + /** + * Copy the specified resource directory from the src/test/repository/managed/ to + * the testable directory under target/test-repository/managed/${testName}/ + * + * @param resourceDir + * @throws IOException + */ + protected void setupTestableManagedRepository( String resourcePath ) + throws IOException + { + String resourceDir = resourcePath; + + if ( !resourcePath.endsWith( "/" ) ) + { + int idx = resourcePath.lastIndexOf( '/' ); + resourceDir = resourcePath.substring( 0, idx ); + } + + File sourceRepoDir = new File( REPOPATH_DEFAULT_MANAGED ); + File sourceDir = new File( sourceRepoDir, resourceDir ); + + File destRepoDir = managedDefaultDir; + File destDir = new File( destRepoDir, resourceDir ); + + // Cleanout destination dirs. + if ( destDir.exists() ) + { + FileUtils.deleteDirectory( destDir ); + } + + // Make the destination dir. + destDir.mkdirs(); + + // Test the source dir. + if ( !sourceDir.exists() ) + { + // This is just a warning. + System.err.println( "[WARN] Skipping setup of testable managed repository, source dir does not exist: " + + sourceDir ); + } + else + { + + // Test that the source is a dir. + if ( !sourceDir.isDirectory() ) + { + fail( "Unable to setup testable managed repository, source is not a directory: " + sourceDir ); + } + + // Copy directory structure. + copyDirectoryStructure( sourceDir, destDir ); + } + } + + protected void setManagedNewerThanRemote( File managedFile, File remoteFile ) + { + assertTrue( "Managed File should exist: ", managedFile.exists() ); + assertTrue( "Remote File should exist: ", remoteFile.exists() ); + + managedFile.setLastModified( remoteFile.lastModified() + 55000 ); + } + + protected void setManagedOlderThanRemote( File managedFile, File remoteFile ) + { + assertTrue( "Managed File should exist: ", managedFile.exists() ); + assertTrue( "Remote File should exist: ", remoteFile.exists() ); + + managedFile.setLastModified( remoteFile.lastModified() - 55000 ); + } + + protected void assertNotModified( File file, long expectedModificationTime ) + { + assertEquals( "File <" + file.getAbsolutePath() + "> not have been modified.", + expectedModificationTime, file.lastModified() ); + } + + protected void assertNotExistsInManagedLegacyRepo( File file ) + throws Exception + { + String managedLegacyPath = managedLegacyDir.getCanonicalPath(); + String testFile = file.getCanonicalPath(); + + assertTrue( "Unit Test Failure: File <" + testFile + + "> should be have been defined within the legacy managed path of <" + managedLegacyPath + ">", testFile + .startsWith( managedLegacyPath ) ); + + assertFalse( "File < " + testFile + "> should not exist in managed legacy repository.", file.exists() ); + } + + protected void assertNotExistsInManagedDefaultRepo( File file ) + throws Exception + { + String managedDefaultPath = managedDefaultDir.getCanonicalPath(); + String testFile = file.getCanonicalPath(); + + assertTrue( "Unit Test Failure: File <" + testFile + + "> should be have been defined within the managed default path of <" + managedDefaultPath + ">", testFile + .startsWith( managedDefaultPath ) ); + + assertFalse( "File < " + testFile + "> should not exist in managed default repository.", file.exists() ); + } + + protected static Date getFutureDate() + throws ParseException + { + Calendar cal = Calendar.getInstance(); + cal.add( Calendar.YEAR, 1 ); + return cal.getTime(); + } + + protected static Date getPastDate() + throws ParseException + { + return new SimpleDateFormat( "yyyy-MM-dd", Locale.US ).parse( "2000-01-01" ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/CacheFailuresTransferTest.java b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/CacheFailuresTransferTest.java new file mode 100644 index 000000000..119211d6c --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/CacheFailuresTransferTest.java @@ -0,0 +1,175 @@ +package org.apache.maven.archiva.proxy; + +/* + * 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.archiva.common.utils.PathUtil; +import org.apache.maven.archiva.model.ArtifactReference; +import org.apache.maven.archiva.policies.CachedFailuresPolicy; +import org.apache.maven.archiva.policies.ChecksumPolicy; +import org.apache.maven.archiva.policies.ReleasesPolicy; +import org.apache.maven.archiva.policies.SnapshotsPolicy; +import org.apache.maven.archiva.policies.urlcache.UrlFailureCache; +import org.apache.maven.wagon.ResourceDoesNotExistException; + +import java.io.File; + +/** + * CacheFailuresTransferTest + * + * @author Brett Porter + * @author Joakim Erdfelt + * @version $Id$ + */ +public class CacheFailuresTransferTest + extends AbstractProxyTestCase +{ + // TODO: test some hard failures (eg TransferFailedException) + // TODO: test the various combinations of fetchFrom* (note: need only test when caching is enabled) + + public void testGetWithCacheFailuresOn() + throws Exception + { + String path = "org/apache/maven/test/get-in-second-proxy/1.0/get-in-second-proxy-1.0.jar"; + File expectedFile = new File( managedDefaultDir.getAbsoluteFile(), path ); + setupTestableManagedRepository( path ); + + assertNotExistsInManagedDefaultRepo( expectedFile ); + + ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + + // Configure Repository (usually done within archiva.xml configuration) + saveRemoteRepositoryConfig( "badproxied1", "Bad Proxied 1", "test://bad.machine.com/repo/", "default" ); + saveRemoteRepositoryConfig( "badproxied2", "Bad Proxied 2", "test://bad.machine.com/anotherrepo/", "default" ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, "badproxied1", ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.YES ); + saveConnector( ID_DEFAULT_MANAGED, "badproxied2", ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.YES ); + + wagonMock.get( path, new File( expectedFile.getParentFile(), expectedFile.getName() + ".tmp" ) ); + + wagonMockControl.setMatcher(customWagonGetMatcher); + + wagonMockControl.setThrowable( new ResourceDoesNotExistException( "resource does not exist." ), 2 ); + + wagonMockControl.replay(); + + File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact ); + + wagonMockControl.verify(); + + // Second attempt to download same artifact use cache + wagonMockControl.reset(); + wagonMockControl.replay(); + downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact ); + wagonMockControl.verify(); + + assertNotDownloaded( downloadedFile ); + assertNoTempFiles( expectedFile ); + } + + public void testGetWithCacheFailuresOff() + throws Exception + { + String path = "org/apache/maven/test/get-in-second-proxy/1.0/get-in-second-proxy-1.0.jar"; + File expectedFile = new File( managedDefaultDir.getAbsoluteFile(), path ); + setupTestableManagedRepository( path ); + + assertNotExistsInManagedDefaultRepo( expectedFile ); + + ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + + // Configure Repository (usually done within archiva.xml configuration) + saveRemoteRepositoryConfig( "badproxied1", "Bad Proxied 1", "test://bad.machine.com/repo/", "default" ); + saveRemoteRepositoryConfig( "badproxied2", "Bad Proxied 2", "test://bad.machine.com/anotherrepo/", "default" ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, "badproxied1", ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + saveConnector( ID_DEFAULT_MANAGED, "badproxied2", ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + + wagonMock.get( path, new File( expectedFile.getParentFile(), expectedFile.getName() + ".tmp" ) ); + + wagonMockControl.setMatcher(customWagonGetMatcher); + wagonMockControl.setThrowable( new ResourceDoesNotExistException( "resource does not exist." ), 2 ); + + wagonMockControl.replay(); + + File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact ); + + wagonMockControl.verify(); + + // Second attempt to download same artifact DOES NOT use cache + wagonMockControl.reset(); + wagonMock.get( path, new File( expectedFile.getParentFile(), expectedFile.getName() + ".tmp" ) ); + + wagonMockControl.setMatcher(customWagonGetMatcher); + wagonMockControl.setThrowable( new ResourceDoesNotExistException( "resource does not exist." ), 2 ); + wagonMockControl.replay(); + + downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact ); + + wagonMockControl.verify(); + + assertNotDownloaded( downloadedFile ); + assertNoTempFiles( expectedFile ); + } + + public void testGetWhenInBothProxiedButFirstCacheFailure() + throws Exception + { + String path = "org/apache/maven/test/get-in-second-proxy/1.0/get-in-second-proxy-1.0.jar"; + setupTestableManagedRepository( path ); + File expectedFile = new File( managedDefaultDir, path ); + ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + + expectedFile.delete(); + assertFalse( expectedFile.exists() ); + + String url = PathUtil.toUrl( REPOPATH_PROXIED1 + "/" + path ); + + // Intentionally set failure on url in proxied1 (for test) + UrlFailureCache failurlCache = lookupUrlFailureCache(); + failurlCache.cacheFailure( url ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.YES ); + saveConnector( ID_DEFAULT_MANAGED, "proxied2", ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.YES ); + + File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact ); + + // Validate that file actually came from proxied2 (as intended). + File proxied2File = new File( REPOPATH_PROXIED2, path ); + assertFileEquals( expectedFile, downloadedFile, proxied2File ); + assertNoTempFiles( expectedFile ); + } + + protected UrlFailureCache lookupUrlFailureCache() + throws Exception + { + UrlFailureCache urlFailureCache = (UrlFailureCache) lookup( "urlFailureCache" ); + assertNotNull( "URL Failure Cache cannot be null.", urlFailureCache ); + return urlFailureCache; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/ChecksumTransferTest.java b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/ChecksumTransferTest.java new file mode 100644 index 000000000..784787987 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/ChecksumTransferTest.java @@ -0,0 +1,506 @@ +package org.apache.maven.archiva.proxy; + +/* + * 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.io.FileUtils; +import org.apache.maven.archiva.model.ArtifactReference; +import org.apache.maven.archiva.policies.CachedFailuresPolicy; +import org.apache.maven.archiva.policies.ChecksumPolicy; +import org.apache.maven.archiva.policies.ReleasesPolicy; +import org.apache.maven.archiva.policies.SnapshotsPolicy; +import org.apache.maven.wagon.ResourceDoesNotExistException; + +import java.io.File; + +/** + * ChecksumTransferTest + * + * @author Brett Porter + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ChecksumTransferTest + extends AbstractProxyTestCase +{ + public void testGetChecksumBothCorrect() + throws Exception + { + String path = "org/apache/maven/test/get-checksum-both-right/1.0/get-checksum-both-right-1.0.jar"; + setupTestableManagedRepository( path ); + + File expectedFile = new File( managedDefaultDir, path ); + ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + + FileUtils.deleteDirectory( expectedFile.getParentFile() ); + assertFalse( expectedFile.exists() ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.IGNORE, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + + File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact ); + + File proxied1File = new File( REPOPATH_PROXIED1, path ); + assertFileEquals( expectedFile, downloadedFile, proxied1File ); + assertNoTempFiles( expectedFile ); + assertChecksums( expectedFile, "066d76e459f7782c312c31e8a11b3c0f1e3e43a7 *get-checksum-both-right-1.0.jar", + "e58f30c6a150a2e843552438d18e15cb *get-checksum-both-right-1.0.jar" ); + } + + public void testGetChecksumCorrectSha1NoMd5() + throws Exception + { + String path = "org/apache/maven/test/get-checksum-sha1-only/1.0/get-checksum-sha1-only-1.0.jar"; + setupTestableManagedRepository( path ); + + File expectedFile = new File( managedDefaultDir, path ); + ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + + FileUtils.deleteDirectory( expectedFile.getParentFile() ); + assertFalse( expectedFile.exists() ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.IGNORE, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + + File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact ); + + File proxied1File = new File( REPOPATH_PROXIED1, path ); + assertFileEquals( expectedFile, downloadedFile, proxied1File ); + assertNoTempFiles( expectedFile ); + assertChecksums( expectedFile, "748a3a013bf5eacf2bbb40a2ac7d37889b728837 *get-checksum-sha1-only-1.0.jar", + null ); + } + + public void testGetChecksumNoSha1CorrectMd5() + throws Exception + { + String path = "org/apache/maven/test/get-checksum-md5-only/1.0/get-checksum-md5-only-1.0.jar"; + setupTestableManagedRepository( path ); + + File expectedFile = new File( managedDefaultDir, path ); + ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + + FileUtils.deleteDirectory( expectedFile.getParentFile() ); + assertFalse( expectedFile.exists() ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.IGNORE, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + + File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact ); + + File proxied1File = new File( REPOPATH_PROXIED1, path ); + assertFileEquals( expectedFile, downloadedFile, proxied1File ); + assertNoTempFiles( expectedFile ); + assertChecksums( expectedFile, null, "f3af5201bf8da801da37db8842846e1c *get-checksum-md5-only-1.0.jar" ); + } + + public void testGetWithNoChecksumsUsingIgnoredSetting() + throws Exception + { + String path = "org/apache/maven/test/get-default-layout/1.0/get-default-layout-1.0.jar"; + setupTestableManagedRepository( path ); + + File expectedFile = new File( managedDefaultDir, path ); + ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + + FileUtils.deleteDirectory( expectedFile.getParentFile() ); + assertFalse( expectedFile.exists() ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.IGNORE, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + + File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact ); + + File proxied1File = new File( REPOPATH_PROXIED1, path ); + assertFileEquals( expectedFile, downloadedFile, proxied1File ); + assertNoTempFiles( expectedFile ); + assertChecksums( expectedFile, null, null ); + } + + public void testGetChecksumBadSha1BadMd5IgnoredSetting() + throws Exception + { + String path = "org/apache/maven/test/get-checksum-both-bad/1.0/get-checksum-both-bad-1.0.jar"; + setupTestableManagedRepository( path ); + + File expectedFile = new File( managedDefaultDir, path ); + ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + + FileUtils.deleteDirectory( expectedFile.getParentFile() ); + assertFalse( expectedFile.exists() ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.IGNORE, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + + File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact ); + + File proxied1File = new File( REPOPATH_PROXIED1, path ); + assertFileEquals( expectedFile, downloadedFile, proxied1File ); + assertNoTempFiles( expectedFile ); + assertChecksums( expectedFile, "invalid checksum file", "invalid checksum file" ); + } + + public void testGetChecksumBadSha1BadMd5FailSetting() + throws Exception + { + String path = "org/apache/maven/test/get-checksum-both-bad/1.0/get-checksum-both-bad-1.0.jar"; + setupTestableManagedRepository( path ); + + File expectedFile = new File( managedDefaultDir, path ); + ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + + FileUtils.deleteDirectory( expectedFile.getParentFile() ); + assertFalse( expectedFile.exists() ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.FAIL, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + + File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact ); + + assertNotDownloaded( downloadedFile ); + assertChecksums( expectedFile, null, null ); + } + + public void testGetChecksumBadSha1BadMd5FixSetting() + throws Exception + { + String path = "org/apache/maven/test/get-checksum-both-bad/1.0/get-checksum-both-bad-1.0.jar"; + setupTestableManagedRepository( path ); + + File expectedFile = new File( managedDefaultDir, path ); + ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + + FileUtils.deleteDirectory( expectedFile.getParentFile() ); + assertFalse( expectedFile.exists() ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + + File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact ); + + File proxied1File = new File( REPOPATH_PROXIED1, path ); + assertFileEquals( expectedFile, downloadedFile, proxied1File ); + assertNoTempFiles( expectedFile ); + assertChecksums( expectedFile, "4ec20a12dc91557330bd0b39d1805be5e329ae56 get-checksum-both-bad-1.0.jar", + "a292491a35925465e693a44809a078b5 get-checksum-both-bad-1.0.jar" ); + } + + public void testGetChecksumCorrectSha1BadMd5UsingFailSetting() + throws Exception + { + String path = "org/apache/maven/test/get-checksum-sha1-bad-md5/1.0/get-checksum-sha1-bad-md5-1.0.jar"; + setupTestableManagedRepository( path ); + + File expectedFile = new File( managedDefaultDir, path ); + ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + + FileUtils.deleteDirectory( expectedFile.getParentFile() ); + assertFalse( expectedFile.exists() ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.FAIL, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + + File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact ); + + assertNotDownloaded( downloadedFile ); + assertChecksums( expectedFile, null, null ); + } + + public void testGetChecksumNoSha1CorrectMd5UsingFailSetting() + throws Exception + { + String path = "org/apache/maven/test/get-checksum-md5-only/1.0/get-checksum-md5-only-1.0.jar"; + setupTestableManagedRepository( path ); + + File expectedFile = new File( managedDefaultDir, path ); + ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + + FileUtils.deleteDirectory( expectedFile.getParentFile() ); + assertFalse( expectedFile.exists() ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.FAIL, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + + File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact ); + + // This is a success situation. No SHA1 with a Good MD5. + File proxied1File = new File( REPOPATH_PROXIED1, path ); + assertFileEquals( expectedFile, downloadedFile, proxied1File ); + assertNoTempFiles( expectedFile ); + assertChecksums( expectedFile, null, "f3af5201bf8da801da37db8842846e1c *get-checksum-md5-only-1.0.jar" ); + } + + public void testGetWithNoChecksumsUsingFailSetting() + throws Exception + { + String path = "org/apache/maven/test/get-default-layout/1.0/get-default-layout-1.0.jar"; + setupTestableManagedRepository( path ); + + File expectedFile = new File( managedDefaultDir, path ); + ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + + FileUtils.deleteDirectory( expectedFile.getParentFile() ); + assertFalse( expectedFile.exists() ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.FAIL, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + + File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact ); + + assertNotDownloaded( downloadedFile ); + assertChecksums( expectedFile, null, null ); + } + + public void testGetChecksumCorrectSha1BadMd5UsingIgnoredSetting() + throws Exception + { + String path = "org/apache/maven/test/get-checksum-sha1-bad-md5/1.0/get-checksum-sha1-bad-md5-1.0.jar"; + setupTestableManagedRepository( path ); + + File expectedFile = new File( managedDefaultDir, path ); + ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + + FileUtils.deleteDirectory( expectedFile.getParentFile() ); + assertFalse( expectedFile.exists() ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.IGNORE, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + + File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact ); + + File proxied1File = new File( REPOPATH_PROXIED1, path ); + assertFileEquals( expectedFile, downloadedFile, proxied1File ); + assertNoTempFiles( expectedFile ); + assertChecksums( expectedFile, "3dd1a3a57b807d3ef3fbc6013d926c891cbb8670 *get-checksum-sha1-bad-md5-1.0.jar", + "invalid checksum file" ); + } + + public void testGetChecksumCorrectSha1BadMd5UsingFixSetting() + throws Exception + { + String path = "org/apache/maven/test/get-checksum-sha1-bad-md5/1.0/get-checksum-sha1-bad-md5-1.0.jar"; + setupTestableManagedRepository( path ); + + File expectedFile = new File( managedDefaultDir, path ); + ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + + FileUtils.deleteDirectory( expectedFile.getParentFile() ); + assertFalse( expectedFile.exists() ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + + File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact ); + + File proxied1File = new File( REPOPATH_PROXIED1, path ); + assertFileEquals( expectedFile, downloadedFile, proxied1File ); + assertNoTempFiles( expectedFile ); + assertChecksums( expectedFile, "3dd1a3a57b807d3ef3fbc6013d926c891cbb8670 *get-checksum-sha1-bad-md5-1.0.jar", + "c35f3b76268b73a4ba617f6f275c49ab get-checksum-sha1-bad-md5-1.0.jar" ); + } + + public void testGetChecksumNoSha1CorrectMd5UsingFixSetting() + throws Exception + { + String path = "org/apache/maven/test/get-checksum-md5-only/1.0/get-checksum-md5-only-1.0.jar"; + setupTestableManagedRepository( path ); + + File expectedFile = new File( managedDefaultDir, path ); + ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + + FileUtils.deleteDirectory( expectedFile.getParentFile() ); + assertFalse( expectedFile.exists() ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + + File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact ); + + File proxied1File = new File( REPOPATH_PROXIED1, path ); + assertFileEquals( expectedFile, downloadedFile, proxied1File ); + assertNoTempFiles( expectedFile ); + assertChecksums( expectedFile, "71f7dc3f72053a3f2d9fdd6fef9db055ef957ffb get-checksum-md5-only-1.0.jar", + "f3af5201bf8da801da37db8842846e1c *get-checksum-md5-only-1.0.jar" ); + } + + public void testGetWithNoChecksumsUsingFixSetting() + throws Exception + { + String path = "org/apache/maven/test/get-default-layout/1.0/get-default-layout-1.0.jar"; + setupTestableManagedRepository( path ); + + File expectedFile = new File( managedDefaultDir, path ); + ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + + FileUtils.deleteDirectory( expectedFile.getParentFile() ); + assertFalse( expectedFile.exists() ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + + File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact ); + + File proxied1File = new File( REPOPATH_PROXIED1, path ); + assertFileEquals( expectedFile, downloadedFile, proxied1File ); + assertNoTempFiles( expectedFile ); + assertChecksums( expectedFile, "1f12821c5e43e1a0b76b9564a6ddb0548ccb9486 get-default-layout-1.0.jar", + "3f7341545f21226b6f49a3c2704cb9be get-default-layout-1.0.jar" ); + } + + public void testGetChecksumNotFoundOnRemote() + throws Exception + { + String path = "org/apache/maven/test/get-checksum-sha1-only/1.0/get-checksum-sha1-only-1.0.jar"; + setupTestableManagedRepository( path ); + + File expectedFile = new File( managedDefaultDir, path ); + ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + + FileUtils.deleteDirectory( expectedFile.getParentFile() ); + assertFalse( expectedFile.getParentFile().exists() ); + assertFalse( expectedFile.exists() ); + + saveRemoteRepositoryConfig( "badproxied", "Bad Proxied", "test://bad.machine.com/repo/", "default" ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, "badproxied", ChecksumPolicy.IGNORE, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + + wagonMock.get( path, new File( expectedFile.getAbsolutePath() + ".tmp" ) ); + wagonMockControl.setMatcher(customWagonGetMatcher); + wagonMockControl.setVoidCallable(); + wagonMock.get( path + ".sha1", new File( expectedFile.getAbsolutePath() + ".sha1.tmp" ) ); + wagonMockControl.setMatcher(customWagonGetMatcher); + wagonMockControl.setVoidCallable(); + wagonMock.get( path + ".md5", new File( expectedFile.getAbsolutePath() + ".md5.tmp" ) ); + wagonMockControl.setMatcher(customWagonGetMatcher); + wagonMockControl.setThrowable( new ResourceDoesNotExistException( "Resource does not exist." ) ); + wagonMockControl.replay(); + + File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact ); + + wagonMockControl.verify(); + + // Do what the mock doesn't do. + String proxyPath = new File( REPOPATH_PROXIED1, path ).getAbsolutePath(); + String localPath = new File( managedDefaultDir, path ).getAbsolutePath(); + FileUtils.copyFile( new File( proxyPath ), new File( localPath ) ); + FileUtils.copyFile( new File( proxyPath + ".sha1" ), new File( localPath + ".sha1" ) ); + + // Test results. + File proxied1File = new File( REPOPATH_PROXIED1, path ); + assertFileEquals( expectedFile, downloadedFile, proxied1File ); + assertNoTempFiles( expectedFile ); + assertChecksums( expectedFile, "748a3a013bf5eacf2bbb40a2ac7d37889b728837 *get-checksum-sha1-only-1.0.jar", + null ); + } + + public void testGetAlwaysBadChecksumPresentLocallyAbsentRemoteUsingIgnoredSetting() + throws Exception + { + String path = "org/apache/maven/test/get-bad-local-checksum/1.0/get-bad-local-checksum-1.0.jar"; + setupTestableManagedRepository( path ); + + File expectedFile = new File( managedDefaultDir, path ); + File remoteFile = new File( REPOPATH_PROXIED1, path ); + + setManagedOlderThanRemote( expectedFile, remoteFile ); + + ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.IGNORE, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + + File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact ); + + File proxied1File = new File( REPOPATH_PROXIED1, path ); + assertFileEquals( expectedFile, downloadedFile, proxied1File ); + assertNoTempFiles( expectedFile ); + // There are no hashcodes on the proxy side to download, hence the local ones should remain invalid. + assertChecksums( expectedFile, "invalid checksum file", "invalid checksum file" ); + } + + public void testGetAlwaysBadChecksumPresentLocallyAbsentRemoteUsingFailSetting() + throws Exception + { + String path = "org/apache/maven/test/get-bad-local-checksum/1.0/get-bad-local-checksum-1.0.jar"; + setupTestableManagedRepository( path ); + + File expectedFile = new File( managedDefaultDir, path ); + File remoteFile = new File( REPOPATH_PROXIED1, path ); + + setManagedOlderThanRemote( expectedFile, remoteFile ); + + ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FAIL, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + + File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact ); + + assertNotDownloaded( downloadedFile ); + assertNoTempFiles( expectedFile ); + // There are no hashcodes on the proxy side to download. + // The FAIL policy will delete the checksums as bad. + + assertChecksums( expectedFile, "invalid checksum file", "invalid checksum file" ); + } + + public void testGetAlwaysBadChecksumPresentLocallyAbsentRemoteUsingFixSetting() + throws Exception + { + String path = "org/apache/maven/test/get-bad-local-checksum/1.0/get-bad-local-checksum-1.0.jar"; + setupTestableManagedRepository( path ); + + File expectedFile = new File( managedDefaultDir, path ); + File remoteFile = new File( REPOPATH_PROXIED1, path ); + + setManagedOlderThanRemote( expectedFile, remoteFile ); + + ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + + File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact ); + + File proxied1File = new File( REPOPATH_PROXIED1, path ); + assertFileEquals( expectedFile, downloadedFile, proxied1File ); + assertNoTempFiles( expectedFile ); + assertChecksums( expectedFile, "96a08dc80a108cba8efd3b20aec91b32a0b2cbd4 get-bad-local-checksum-1.0.jar", + "46fdd6ca55bf1d7a7eb0c858f41e0ccd get-bad-local-checksum-1.0.jar" ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/ErrorHandlingTest.java b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/ErrorHandlingTest.java new file mode 100644 index 000000000..4b96766c7 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/ErrorHandlingTest.java @@ -0,0 +1,629 @@ +package org.apache.maven.archiva.proxy; + +/* + * 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.archiva.policies.CachedFailuresPolicy; +import org.apache.maven.archiva.policies.ChecksumPolicy; +import org.apache.maven.archiva.policies.PropagateErrorsDownloadPolicy; +import org.apache.maven.archiva.policies.PropagateErrorsOnUpdateDownloadPolicy; +import org.apache.maven.archiva.policies.ProxyDownloadException; +import org.apache.maven.archiva.policies.ReleasesPolicy; +import org.apache.maven.archiva.policies.SnapshotsPolicy; +import org.apache.maven.archiva.repository.layout.LayoutException; +import org.apache.maven.wagon.ResourceDoesNotExistException; +import org.apache.maven.wagon.TransferFailedException; +import org.apache.maven.wagon.authorization.AuthorizationException; + +import java.io.File; + +/** + * ErrorHandlingTest + * + * @author Brett Porter + * @version $Id$ + */ +public class ErrorHandlingTest + extends AbstractProxyTestCase +{ + private static final String PATH_IN_BOTH_REMOTES_NOT_LOCAL = + "org/apache/maven/test/get-in-both-proxies/1.0/get-in-both-proxies-1.0.jar"; + + private static final String PATH_IN_BOTH_REMOTES_AND_LOCAL = + "org/apache/maven/test/get-on-multiple-repos/1.0/get-on-multiple-repos-1.0.pom"; + + private static final String ID_MOCKED_PROXIED1 = "badproxied1"; + + private static final String NAME_MOCKED_PROXIED1 = "Bad Proxied 1"; + + private static final String ID_MOCKED_PROXIED2 = "badproxied2"; + + private static final String NAME_MOCKED_PROXIED2 = "Bad Proxied 2"; + + public void testPropagateErrorImmediatelyWithErrorThenSuccess() + throws Exception + { + String path = PATH_IN_BOTH_REMOTES_NOT_LOCAL; + File expectedFile = setupRepositoriesWithLocalFileNotPresent( path ); + + createMockedProxyConnector( ID_MOCKED_PROXIED1, NAME_MOCKED_PROXIED1, PropagateErrorsDownloadPolicy.STOP ); + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2 ); + + simulateGetError( path, expectedFile, createTransferException() ); + + confirmSingleFailure( path, ID_MOCKED_PROXIED1 ); + } + + public void testPropagateErrorImmediatelyWithNotFoundThenError() + throws Exception + { + String path = PATH_IN_BOTH_REMOTES_NOT_LOCAL; + File expectedFile = setupRepositoriesWithLocalFileNotPresent( path ); + + createMockedProxyConnector( ID_MOCKED_PROXIED1, NAME_MOCKED_PROXIED1, PropagateErrorsDownloadPolicy.STOP ); + createMockedProxyConnector( ID_MOCKED_PROXIED2, NAME_MOCKED_PROXIED2, PropagateErrorsDownloadPolicy.STOP ); + + simulateGetError( path, expectedFile, createResourceNotFoundException() ); + + simulateGetError( path, expectedFile, createTransferException() ); + + confirmSingleFailure( path, ID_MOCKED_PROXIED2 ); + } + + public void testPropagateErrorImmediatelyWithSuccessThenError() + throws Exception + { + String path = PATH_IN_BOTH_REMOTES_NOT_LOCAL; + File expectedFile = setupRepositoriesWithLocalFileNotPresent( path ); + + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1 ); + + createMockedProxyConnector( ID_MOCKED_PROXIED2, NAME_MOCKED_PROXIED2, PropagateErrorsDownloadPolicy.STOP ); + + confirmSuccess( path, expectedFile, REPOPATH_PROXIED1 ); + } + + public void testPropagateErrorImmediatelyWithNotFoundThenSuccess() + throws Exception + { + String path = PATH_IN_BOTH_REMOTES_NOT_LOCAL; + File expectedFile = setupRepositoriesWithLocalFileNotPresent( path ); + + createMockedProxyConnector( ID_MOCKED_PROXIED1, NAME_MOCKED_PROXIED1, PropagateErrorsDownloadPolicy.STOP ); + + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2 ); + + simulateGetError( path, expectedFile, createResourceNotFoundException() ); + + confirmSuccess( path, expectedFile, REPOPATH_PROXIED2 ); + } + + public void testPropagateErrorAtEndWithErrorThenSuccess() + throws Exception + { + String path = PATH_IN_BOTH_REMOTES_NOT_LOCAL; + File expectedFile = setupRepositoriesWithLocalFileNotPresent( path ); + + createMockedProxyConnector( ID_MOCKED_PROXIED1, NAME_MOCKED_PROXIED1, PropagateErrorsDownloadPolicy.STOP ); + + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2 ); + + simulateGetError( path, expectedFile, createTransferException() ); + + confirmSingleFailure( path, ID_MOCKED_PROXIED1 ); + } + + public void testPropagateErrorAtEndWithSuccessThenError() + throws Exception + { + String path = PATH_IN_BOTH_REMOTES_NOT_LOCAL; + File expectedFile = setupRepositoriesWithLocalFileNotPresent( path ); + + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1 ); + + createMockedProxyConnector( ID_MOCKED_PROXIED2, NAME_MOCKED_PROXIED2, PropagateErrorsDownloadPolicy.QUEUE ); + + confirmSuccess( path, expectedFile, REPOPATH_PROXIED1 ); + } + + public void testPropagateErrorAtEndWithNotFoundThenError() + throws Exception + { + String path = PATH_IN_BOTH_REMOTES_NOT_LOCAL; + File expectedFile = setupRepositoriesWithLocalFileNotPresent( path ); + + createMockedProxyConnector( ID_MOCKED_PROXIED1, NAME_MOCKED_PROXIED1, PropagateErrorsDownloadPolicy.QUEUE ); + + createMockedProxyConnector( ID_MOCKED_PROXIED2, NAME_MOCKED_PROXIED2, PropagateErrorsDownloadPolicy.QUEUE ); + + simulateGetError( path, expectedFile, createResourceNotFoundException() ); + + simulateGetError( path, expectedFile, createTransferException() ); + + confirmSingleFailure( path, ID_MOCKED_PROXIED2 ); + } + + public void testPropagateErrorAtEndWithErrorThenNotFound() + throws Exception + { + String path = PATH_IN_BOTH_REMOTES_NOT_LOCAL; + File expectedFile = setupRepositoriesWithLocalFileNotPresent( path ); + + createMockedProxyConnector( ID_MOCKED_PROXIED1, NAME_MOCKED_PROXIED1, PropagateErrorsDownloadPolicy.QUEUE ); + + createMockedProxyConnector( ID_MOCKED_PROXIED2, NAME_MOCKED_PROXIED2, PropagateErrorsDownloadPolicy.QUEUE ); + + simulateGetError( path, expectedFile, createTransferException() ); + + simulateGetError( path, expectedFile, createResourceNotFoundException() ); + + confirmSingleFailure( path, ID_MOCKED_PROXIED1 ); + } + + public void testPropagateErrorAtEndWithErrorThenError() + throws Exception + { + String path = PATH_IN_BOTH_REMOTES_NOT_LOCAL; + File expectedFile = setupRepositoriesWithLocalFileNotPresent( path ); + + createMockedProxyConnector( ID_MOCKED_PROXIED1, NAME_MOCKED_PROXIED1, PropagateErrorsDownloadPolicy.QUEUE ); + + createMockedProxyConnector( ID_MOCKED_PROXIED2, NAME_MOCKED_PROXIED2, PropagateErrorsDownloadPolicy.QUEUE ); + + simulateGetError( path, expectedFile, createTransferException() ); + + simulateGetError( path, expectedFile, createTransferException() ); + + confirmFailures( path, new String[]{ID_MOCKED_PROXIED1, ID_MOCKED_PROXIED2} ); + } + + public void testPropagateErrorAtEndWithNotFoundThenSuccess() + throws Exception + { + String path = PATH_IN_BOTH_REMOTES_NOT_LOCAL; + File expectedFile = setupRepositoriesWithLocalFileNotPresent( path ); + + createMockedProxyConnector( ID_MOCKED_PROXIED1, NAME_MOCKED_PROXIED1, PropagateErrorsDownloadPolicy.QUEUE ); + + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2 ); + + simulateGetError( path, expectedFile, createResourceNotFoundException() ); + + confirmSuccess( path, expectedFile, REPOPATH_PROXIED2 ); + } + + public void testIgnoreErrorWithErrorThenSuccess() + throws Exception + { + String path = PATH_IN_BOTH_REMOTES_NOT_LOCAL; + File expectedFile = setupRepositoriesWithLocalFileNotPresent( path ); + + createMockedProxyConnector( ID_MOCKED_PROXIED1, NAME_MOCKED_PROXIED1, PropagateErrorsDownloadPolicy.IGNORE ); + + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2 ); + + simulateGetError( path, expectedFile, createTransferException() ); + + confirmSuccess( path, expectedFile, REPOPATH_PROXIED2 ); + } + + public void testIgnoreErrorWithSuccessThenError() + throws Exception + { + String path = PATH_IN_BOTH_REMOTES_NOT_LOCAL; + File expectedFile = setupRepositoriesWithLocalFileNotPresent( path ); + + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1 ); + + createMockedProxyConnector( ID_MOCKED_PROXIED2, NAME_MOCKED_PROXIED2, PropagateErrorsDownloadPolicy.IGNORE ); + + confirmSuccess( path, expectedFile, REPOPATH_PROXIED1 ); + } + + public void testIgnoreErrorWithNotFoundThenError() + throws Exception + { + String path = PATH_IN_BOTH_REMOTES_NOT_LOCAL; + File expectedFile = setupRepositoriesWithLocalFileNotPresent( path ); + + createMockedProxyConnector( ID_MOCKED_PROXIED1, NAME_MOCKED_PROXIED1, PropagateErrorsDownloadPolicy.IGNORE ); + + createMockedProxyConnector( ID_MOCKED_PROXIED2, NAME_MOCKED_PROXIED2, PropagateErrorsDownloadPolicy.IGNORE ); + + simulateGetError( path, expectedFile, createResourceNotFoundException() ); + + simulateGetError( path, expectedFile, createTransferException() ); + + confirmNotDownloadedNoError( path ); + } + + public void testIgnoreErrorWithErrorThenNotFound() + throws Exception + { + String path = PATH_IN_BOTH_REMOTES_NOT_LOCAL; + File expectedFile = setupRepositoriesWithLocalFileNotPresent( path ); + + createMockedProxyConnector( ID_MOCKED_PROXIED1, NAME_MOCKED_PROXIED1, PropagateErrorsDownloadPolicy.IGNORE ); + + createMockedProxyConnector( ID_MOCKED_PROXIED2, NAME_MOCKED_PROXIED2, PropagateErrorsDownloadPolicy.IGNORE ); + + simulateGetError( path, expectedFile, createTransferException() ); + + simulateGetError( path, expectedFile, createResourceNotFoundException() ); + + confirmNotDownloadedNoError( path ); + } + + public void testIgnoreErrorWithErrorThenError() + throws Exception + { + String path = PATH_IN_BOTH_REMOTES_NOT_LOCAL; + File expectedFile = setupRepositoriesWithLocalFileNotPresent( path ); + + createMockedProxyConnector( ID_MOCKED_PROXIED1, NAME_MOCKED_PROXIED1, PropagateErrorsDownloadPolicy.IGNORE ); + + createMockedProxyConnector( ID_MOCKED_PROXIED2, NAME_MOCKED_PROXIED2, PropagateErrorsDownloadPolicy.IGNORE ); + + simulateGetError( path, expectedFile, createTransferException() ); + + simulateGetError( path, expectedFile, createTransferException() ); + + confirmNotDownloadedNoError( path ); + } + + public void testPropagateOnUpdateAlwaysArtifactNotPresent() + throws Exception + { + String path = PATH_IN_BOTH_REMOTES_NOT_LOCAL; + File expectedFile = setupRepositoriesWithLocalFileNotPresent( path ); + + createMockedProxyConnector( ID_MOCKED_PROXIED1, NAME_MOCKED_PROXIED1, PropagateErrorsDownloadPolicy.STOP, + PropagateErrorsOnUpdateDownloadPolicy.ALWAYS ); + createMockedProxyConnector( ID_MOCKED_PROXIED2, NAME_MOCKED_PROXIED2, PropagateErrorsDownloadPolicy.STOP, + PropagateErrorsOnUpdateDownloadPolicy.ALWAYS ); + + simulateGetError( path, expectedFile, createTransferException() ); + + confirmSingleFailure( path, ID_MOCKED_PROXIED1 ); + } + + public void testPropagateOnUpdateAlwaysArtifactPresent() + throws Exception + { + String path = PATH_IN_BOTH_REMOTES_AND_LOCAL; + File expectedFile = setupRepositoriesWithLocalFilePresent( path ); + + createMockedProxyConnector( ID_MOCKED_PROXIED1, NAME_MOCKED_PROXIED1, PropagateErrorsDownloadPolicy.STOP, + PropagateErrorsOnUpdateDownloadPolicy.ALWAYS ); + createMockedProxyConnector( ID_MOCKED_PROXIED2, NAME_MOCKED_PROXIED2, PropagateErrorsDownloadPolicy.STOP, + PropagateErrorsOnUpdateDownloadPolicy.ALWAYS ); + + simulateGetIfNewerError( path, expectedFile, createTransferException() ); + + confirmSingleFailure( path, ID_MOCKED_PROXIED1 ); + } + + public void testPropagateOnUpdateAlwaysQueueArtifactNotPresent() + throws Exception + { + String path = PATH_IN_BOTH_REMOTES_NOT_LOCAL; + File expectedFile = setupRepositoriesWithLocalFileNotPresent( path ); + + createMockedProxyConnector( ID_MOCKED_PROXIED1, NAME_MOCKED_PROXIED1, PropagateErrorsDownloadPolicy.QUEUE, + PropagateErrorsOnUpdateDownloadPolicy.ALWAYS ); + createMockedProxyConnector( ID_MOCKED_PROXIED2, NAME_MOCKED_PROXIED2, PropagateErrorsDownloadPolicy.QUEUE, + PropagateErrorsOnUpdateDownloadPolicy.ALWAYS ); + + simulateGetError( path, expectedFile, createTransferException() ); + simulateGetError( path, expectedFile, createTransferException() ); + + confirmFailures( path, new String[] { ID_MOCKED_PROXIED1, ID_MOCKED_PROXIED2 } ); + } + + public void testPropagateOnUpdateAlwaysQueueArtifactPresent() + throws Exception + { + String path = PATH_IN_BOTH_REMOTES_AND_LOCAL; + File expectedFile = setupRepositoriesWithLocalFilePresent( path ); + + createMockedProxyConnector( ID_MOCKED_PROXIED1, NAME_MOCKED_PROXIED1, PropagateErrorsDownloadPolicy.QUEUE, + PropagateErrorsOnUpdateDownloadPolicy.ALWAYS ); + createMockedProxyConnector( ID_MOCKED_PROXIED2, NAME_MOCKED_PROXIED2, PropagateErrorsDownloadPolicy.QUEUE, + PropagateErrorsOnUpdateDownloadPolicy.ALWAYS ); + + simulateGetIfNewerError( path, expectedFile, createTransferException() ); + simulateGetIfNewerError( path, expectedFile, createTransferException() ); + + confirmFailures( path, new String[] { ID_MOCKED_PROXIED1, ID_MOCKED_PROXIED2 } ); + } + + public void testPropagateOnUpdateAlwaysIgnoreArtifactNotPresent() + throws Exception + { + String path = PATH_IN_BOTH_REMOTES_NOT_LOCAL; + File expectedFile = setupRepositoriesWithLocalFileNotPresent( path ); + + createMockedProxyConnector( ID_MOCKED_PROXIED1, NAME_MOCKED_PROXIED1, PropagateErrorsDownloadPolicy.IGNORE, + PropagateErrorsOnUpdateDownloadPolicy.ALWAYS ); + createMockedProxyConnector( ID_MOCKED_PROXIED2, NAME_MOCKED_PROXIED2, PropagateErrorsDownloadPolicy.IGNORE, + PropagateErrorsOnUpdateDownloadPolicy.ALWAYS ); + + simulateGetError( path, expectedFile, createTransferException() ); + simulateGetError( path, expectedFile, createTransferException() ); + + confirmNotDownloadedNoError( path ); + } + + public void testPropagateOnUpdateAlwaysIgnoreArtifactPresent() + throws Exception + { + String path = PATH_IN_BOTH_REMOTES_AND_LOCAL; + File expectedFile = setupRepositoriesWithLocalFilePresent( path ); + + createMockedProxyConnector( ID_MOCKED_PROXIED1, NAME_MOCKED_PROXIED1, PropagateErrorsDownloadPolicy.IGNORE, + PropagateErrorsOnUpdateDownloadPolicy.ALWAYS ); + createMockedProxyConnector( ID_MOCKED_PROXIED2, NAME_MOCKED_PROXIED2, PropagateErrorsDownloadPolicy.IGNORE, + PropagateErrorsOnUpdateDownloadPolicy.ALWAYS ); + + simulateGetIfNewerError( path, expectedFile, createTransferException() ); + simulateGetIfNewerError( path, expectedFile, createTransferException() ); + + confirmNotDownloadedNoError( path ); + assertTrue( expectedFile.exists() ); + } + + public void testPropagateOnUpdateNotPresentArtifactNotPresent() + throws Exception + { + String path = PATH_IN_BOTH_REMOTES_NOT_LOCAL; + File expectedFile = setupRepositoriesWithLocalFileNotPresent( path ); + + createMockedProxyConnector( ID_MOCKED_PROXIED1, NAME_MOCKED_PROXIED1, PropagateErrorsDownloadPolicy.STOP, + PropagateErrorsOnUpdateDownloadPolicy.NOT_PRESENT ); + createMockedProxyConnector( ID_MOCKED_PROXIED2, NAME_MOCKED_PROXIED2, PropagateErrorsDownloadPolicy.STOP, + PropagateErrorsOnUpdateDownloadPolicy.NOT_PRESENT ); + + simulateGetError( path, expectedFile, createTransferException() ); + + confirmSingleFailure( path, ID_MOCKED_PROXIED1 ); + } + + public void testPropagateOnUpdateNotPresentArtifactPresent() + throws Exception + { + String path = PATH_IN_BOTH_REMOTES_AND_LOCAL; + File expectedFile = setupRepositoriesWithLocalFilePresent( path ); + + createMockedProxyConnector( ID_MOCKED_PROXIED1, NAME_MOCKED_PROXIED1, PropagateErrorsDownloadPolicy.STOP, + PropagateErrorsOnUpdateDownloadPolicy.NOT_PRESENT ); + createMockedProxyConnector( ID_MOCKED_PROXIED2, NAME_MOCKED_PROXIED2, PropagateErrorsDownloadPolicy.STOP, + PropagateErrorsOnUpdateDownloadPolicy.NOT_PRESENT ); + + simulateGetIfNewerError( path, expectedFile, createTransferException() ); + + confirmNotDownloadedNoError( path ); + assertTrue( expectedFile.exists() ); + } + + public void testPropagateOnUpdateNotPresentQueueArtifactNotPresent() + throws Exception + { + String path = PATH_IN_BOTH_REMOTES_NOT_LOCAL; + File expectedFile = setupRepositoriesWithLocalFileNotPresent( path ); + + createMockedProxyConnector( ID_MOCKED_PROXIED1, NAME_MOCKED_PROXIED1, PropagateErrorsDownloadPolicy.QUEUE, + PropagateErrorsOnUpdateDownloadPolicy.NOT_PRESENT ); + createMockedProxyConnector( ID_MOCKED_PROXIED2, NAME_MOCKED_PROXIED2, PropagateErrorsDownloadPolicy.QUEUE, + PropagateErrorsOnUpdateDownloadPolicy.NOT_PRESENT ); + + simulateGetError( path, expectedFile, createTransferException() ); + simulateGetError( path, expectedFile, createTransferException() ); + + confirmFailures( path, new String[] { ID_MOCKED_PROXIED1, ID_MOCKED_PROXIED2 } ); + } + + public void testPropagateOnUpdateNotPresentQueueArtifactPresent() + throws Exception + { + String path = PATH_IN_BOTH_REMOTES_AND_LOCAL; + File expectedFile = setupRepositoriesWithLocalFilePresent( path ); + + createMockedProxyConnector( ID_MOCKED_PROXIED1, NAME_MOCKED_PROXIED1, PropagateErrorsDownloadPolicy.QUEUE, + PropagateErrorsOnUpdateDownloadPolicy.NOT_PRESENT ); + createMockedProxyConnector( ID_MOCKED_PROXIED2, NAME_MOCKED_PROXIED2, PropagateErrorsDownloadPolicy.QUEUE, + PropagateErrorsOnUpdateDownloadPolicy.NOT_PRESENT ); + + simulateGetIfNewerError( path, expectedFile, createTransferException() ); + simulateGetIfNewerError( path, expectedFile, createTransferException() ); + + confirmNotDownloadedNoError( path ); + assertTrue( expectedFile.exists() ); + } + + public void testPropagateOnUpdateNotPresentIgnoreArtifactNotPresent() + throws Exception + { + String path = PATH_IN_BOTH_REMOTES_NOT_LOCAL; + File expectedFile = setupRepositoriesWithLocalFileNotPresent( path ); + + createMockedProxyConnector( ID_MOCKED_PROXIED1, NAME_MOCKED_PROXIED1, PropagateErrorsDownloadPolicy.IGNORE, + PropagateErrorsOnUpdateDownloadPolicy.NOT_PRESENT ); + createMockedProxyConnector( ID_MOCKED_PROXIED2, NAME_MOCKED_PROXIED2, PropagateErrorsDownloadPolicy.IGNORE, + PropagateErrorsOnUpdateDownloadPolicy.NOT_PRESENT ); + + simulateGetError( path, expectedFile, createTransferException() ); + simulateGetError( path, expectedFile, createTransferException() ); + + confirmNotDownloadedNoError( path ); + } + + public void testPropagateOnUpdateNotPresentIgnoreArtifactPresent() + throws Exception + { + String path = PATH_IN_BOTH_REMOTES_AND_LOCAL; + File expectedFile = setupRepositoriesWithLocalFilePresent( path ); + + createMockedProxyConnector( ID_MOCKED_PROXIED1, NAME_MOCKED_PROXIED1, PropagateErrorsDownloadPolicy.IGNORE, + PropagateErrorsOnUpdateDownloadPolicy.NOT_PRESENT ); + createMockedProxyConnector( ID_MOCKED_PROXIED2, NAME_MOCKED_PROXIED2, PropagateErrorsDownloadPolicy.IGNORE, + PropagateErrorsOnUpdateDownloadPolicy.NOT_PRESENT ); + + simulateGetIfNewerError( path, expectedFile, createTransferException() ); + simulateGetIfNewerError( path, expectedFile, createTransferException() ); + + confirmNotDownloadedNoError( path ); + assertTrue( expectedFile.exists() ); + } + + // ------------------------------------------ + // HELPER METHODS + // ------------------------------------------ + + private void createMockedProxyConnector( String id, String name, String errorPolicy ) + { + saveRemoteRepositoryConfig( id, name, "test://bad.machine.com/repo/", "default" ); + saveConnector( ID_DEFAULT_MANAGED, id, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, SnapshotsPolicy.ALWAYS, + CachedFailuresPolicy.NO, errorPolicy ); + } + + private void createMockedProxyConnector( String id, String name, String errorPolicy, String errorOnUpdatePolicy ) + { + saveRemoteRepositoryConfig( id, name, "test://bad.machine.com/repo/", "default" ); + saveConnector( ID_DEFAULT_MANAGED, id, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, SnapshotsPolicy.ALWAYS, + CachedFailuresPolicy.NO, errorPolicy, errorOnUpdatePolicy ); + } + + private File setupRepositoriesWithLocalFileNotPresent( String path ) + throws Exception + { + setupTestableManagedRepository( path ); + + File file = new File( managedDefaultDir, path ); + + assertNotExistsInManagedDefaultRepo( file ); + + return file; + } + + private File setupRepositoriesWithLocalFilePresent( String path ) + throws Exception + { + setupTestableManagedRepository( path ); + + File file = new File( managedDefaultDir, path ); + + assertTrue( file.exists() ); + + return file; + } + + private void simulateGetError( String path, File expectedFile, Exception throwable ) + throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException + { + wagonMock.get( path, createExpectedTempFile( expectedFile ) ); + wagonMockControl.setMatcher(customWagonGetMatcher); + wagonMockControl.setThrowable( throwable, 1 ); + } + + private void simulateGetIfNewerError( String path, File expectedFile, TransferFailedException exception ) + throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException + { + wagonMock.getIfNewer( path, createExpectedTempFile( expectedFile ), expectedFile.lastModified() ); + wagonMockControl.setMatcher(customWagonGetIfNewerMatcher); + wagonMockControl.setThrowable( exception, 1 ); + } + + private File createExpectedTempFile( File expectedFile ) + { + return new File( managedDefaultDir, expectedFile.getName() + ".tmp" ).getAbsoluteFile(); + } + + private void confirmSingleFailure( String path, String id ) + throws LayoutException + { + confirmFailures( path, new String[]{id} ); + } + + private void confirmFailures( String path, String[] ids ) + throws LayoutException + { + wagonMockControl.replay(); + + // Attempt the proxy fetch. + File downloadedFile = null; + try + { + downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, + managedDefaultRepository.toArtifactReference( path ) ); + fail( "Proxy should not have succeeded" ); + } + catch ( ProxyDownloadException e ) + { + assertEquals( ids.length, e.getFailures().size() ); + for ( String id : ids ) + { + assertTrue( e.getFailures().keySet().contains( id ) ); + } + } + + wagonMockControl.verify(); + + assertNotDownloaded( downloadedFile ); + } + + private void confirmSuccess( String path, File expectedFile, String basedir ) + throws Exception + { + File downloadedFile = performDownload( path ); + + File proxied1File = new File( basedir, path ); + assertFileEquals( expectedFile, downloadedFile, proxied1File ); + } + + private void confirmNotDownloadedNoError( String path ) + throws Exception + { + File downloadedFile = performDownload( path ); + + assertNotDownloaded( downloadedFile ); + } + + private File performDownload( String path ) + throws ProxyDownloadException, LayoutException + { + wagonMockControl.replay(); + + // Attempt the proxy fetch. + File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, + managedDefaultRepository.toArtifactReference( path ) ); + + wagonMockControl.verify(); + return downloadedFile; + } + + private static TransferFailedException createTransferException() + { + return new TransferFailedException( "test download exception" ); + } + + private static ResourceDoesNotExistException createResourceNotFoundException() + { + return new ResourceDoesNotExistException( "test download not found" ); + } +} \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/HttpProxyTransferTest.java b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/HttpProxyTransferTest.java new file mode 100644 index 000000000..1c2aa9a20 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/HttpProxyTransferTest.java @@ -0,0 +1,215 @@ +package org.apache.maven.archiva.proxy; + +/* + * 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; +import java.io.IOException; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.commons.io.FileUtils; +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +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.maven.archiva.policies.CachedFailuresPolicy; +import org.apache.maven.archiva.policies.ChecksumPolicy; +import org.apache.maven.archiva.policies.PropagateErrorsDownloadPolicy; +import org.apache.maven.archiva.policies.PropagateErrorsOnUpdateDownloadPolicy; +import org.apache.maven.archiva.policies.ReleasesPolicy; +import org.apache.maven.archiva.policies.SnapshotsPolicy; +import org.apache.maven.archiva.repository.ManagedRepositoryContent; +import org.codehaus.plexus.spring.PlexusInSpringTestCase; +import org.mortbay.jetty.Handler; +import org.mortbay.jetty.Request; +import org.mortbay.jetty.Server; +import org.mortbay.jetty.handler.AbstractHandler; + +/** + * Integration test for connecting over a HTTP proxy. + * + * @author Brett Porter + * @version $Id: ManagedDefaultTransferTest.java 677852 2008-07-18 08:16:24Z brett $ + */ +public class HttpProxyTransferTest + extends PlexusInSpringTestCase +{ + private static final String PROXY_ID = "proxy"; + + private static final String MANAGED_ID = "default-managed-repository"; + + private static final String PROXIED_ID = "proxied1"; + + private static final String PROXIED_BASEDIR = "src/test/repositories/proxied1"; + + private RepositoryProxyConnectors proxyHandler; + + private ArchivaConfiguration config; + + private ManagedRepositoryContent managedDefaultRepository; + + private Server server; + + @Override + protected void setUp() + throws Exception + { + super.setUp(); + + // Setup source repository (using default layout) + String repoPath = "target/test-repository/managed/" + getName(); + + File destRepoDir = new File( repoPath ); + + // Cleanout destination dirs. + if ( destRepoDir.exists() ) + { + FileUtils.deleteDirectory( destRepoDir ); + } + + // Make the destination dir. + destRepoDir.mkdirs(); + + ManagedRepositoryConfiguration repo = new ManagedRepositoryConfiguration(); + repo.setId( MANAGED_ID ); + repo.setName( "Default Managed Repository" ); + repo.setLocation( repoPath ); + repo.setLayout( "default" ); + + ManagedRepositoryContent repoContent = + (ManagedRepositoryContent) lookup( ManagedRepositoryContent.class, "default" ); + repoContent.setRepository( repo ); + managedDefaultRepository = repoContent; + + config = (MockConfiguration) lookup( ArchivaConfiguration.class.getName(), "mock" ); + config.getConfiguration().addManagedRepository( repo ); + + Handler handler = new AbstractHandler() + { + public void handle( String target, HttpServletRequest request, HttpServletResponse response, int dispatch ) + throws IOException, ServletException + { + response.setContentType( "text/plain" ); + response.setStatus( HttpServletResponse.SC_OK ); + response.getWriter().println( "get-default-layout-1.0.jar" ); + response.getWriter().println(); + assertNotNull( request.getHeader( "Proxy-Connection" ) ); + + ( (Request) request ).setHandled( true ); + } + }; + + server = new Server( 0 ); + server.setHandler( handler ); + server.start(); + + int port = server.getConnectors()[0].getLocalPort(); + + NetworkProxyConfiguration proxyConfig = new NetworkProxyConfiguration(); + proxyConfig.setHost( "localhost" ); + proxyConfig.setPort( port ); + proxyConfig.setProtocol( "http" ); + proxyConfig.setId( PROXY_ID ); + config.getConfiguration().addNetworkProxy( proxyConfig ); + + // Setup target (proxied to) repository. + RemoteRepositoryConfiguration repoConfig = new RemoteRepositoryConfiguration(); + + repoConfig.setId( PROXIED_ID ); + repoConfig.setName( "Proxied Repository 1" ); + repoConfig.setLayout( "default" ); + repoConfig.setUrl( "http://www.example.com/" ); + + config.getConfiguration().addRemoteRepository( repoConfig ); + + // Setup the proxy handler. + proxyHandler = (RepositoryProxyConnectors) lookup( RepositoryProxyConnectors.class.getName() ); + } + + @Override + protected void tearDown() + throws Exception + { + super.tearDown(); + + server.stop(); + } + + public void testGetOverHttpProxy() + throws Exception + { + assertNull( System.getProperty( "http.proxyHost" ) ); + assertNull( System.getProperty( "http.proxyPort" ) ); + + String path = "org/apache/maven/test/get-default-layout/1.0/get-default-layout-1.0.jar"; + + // Configure Connector (usually done within archiva.xml configuration) + addConnector(); + + File expectedFile = new File( new File( managedDefaultRepository.getRepoRoot() ), path ); + ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + + // Attempt the proxy fetch. + File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact ); + + File sourceFile = new File( PROXIED_BASEDIR, path ); + assertNotNull( "Expected File should not be null.", expectedFile ); + assertNotNull( "Actual File should not be null.", downloadedFile ); + + assertTrue( "Check actual file exists.", downloadedFile.exists() ); + assertEquals( "Check filename path is appropriate.", expectedFile.getCanonicalPath(), + downloadedFile.getCanonicalPath() ); + assertEquals( "Check file path matches.", expectedFile.getAbsolutePath(), downloadedFile.getAbsolutePath() ); + + String expectedContents = FileUtils.readFileToString( sourceFile, null ); + String actualContents = FileUtils.readFileToString( downloadedFile, null ); + assertEquals( "Check file contents.", expectedContents, actualContents ); + + assertNull( System.getProperty( "http.proxyHost" ) ); + assertNull( System.getProperty( "http.proxyPort" ) ); + } + + private void addConnector() + { + ProxyConnectorConfiguration connectorConfig = new ProxyConnectorConfiguration(); + connectorConfig.setProxyId( PROXY_ID ); + connectorConfig.setSourceRepoId( MANAGED_ID ); + connectorConfig.setTargetRepoId( PROXIED_ID ); + connectorConfig.addPolicy( ProxyConnectorConfiguration.POLICY_CHECKSUM, ChecksumPolicy.FIX ); + connectorConfig.addPolicy( ProxyConnectorConfiguration.POLICY_RELEASES, ReleasesPolicy.ONCE ); + connectorConfig.addPolicy( ProxyConnectorConfiguration.POLICY_SNAPSHOTS, SnapshotsPolicy.ONCE ); + connectorConfig.addPolicy( ProxyConnectorConfiguration.POLICY_CACHE_FAILURES, CachedFailuresPolicy.NO ); + connectorConfig.addPolicy( ProxyConnectorConfiguration.POLICY_PROPAGATE_ERRORS, + PropagateErrorsDownloadPolicy.QUEUE ); + connectorConfig.addPolicy( ProxyConnectorConfiguration.POLICY_PROPAGATE_ERRORS_ON_UPDATE, + PropagateErrorsOnUpdateDownloadPolicy.NOT_PRESENT ); + + int count = config.getConfiguration().getProxyConnectors().size(); + config.getConfiguration().addProxyConnector( connectorConfig ); + + // Proper Triggering ... + String prefix = "proxyConnectors.proxyConnector(" + count + ")"; + ( (MockConfiguration) config ).triggerChange( prefix + ".sourceRepoId", connectorConfig.getSourceRepoId() ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/ManagedDefaultTransferTest.java b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/ManagedDefaultTransferTest.java new file mode 100644 index 000000000..878e96d50 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/ManagedDefaultTransferTest.java @@ -0,0 +1,528 @@ +package org.apache.maven.archiva.proxy; + +/* + * 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.io.FileUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.maven.archiva.model.ArtifactReference; +import org.apache.maven.archiva.policies.CachedFailuresPolicy; +import org.apache.maven.archiva.policies.ChecksumPolicy; +import org.apache.maven.archiva.policies.ReleasesPolicy; +import org.apache.maven.archiva.policies.SnapshotsPolicy; +import org.apache.maven.wagon.ResourceDoesNotExistException; + +import java.io.File; + +/** + * ManagedDefaultTransferTest + * + * @author Brett Porter + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ManagedDefaultTransferTest + extends AbstractProxyTestCase +{ + public void testGetDefaultLayoutNotPresent() + throws Exception + { + String path = "org/apache/maven/test/get-default-layout/1.0/get-default-layout-1.0.jar"; + setupTestableManagedRepository( path ); + + File expectedFile = new File( managedDefaultDir, path ); + ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + + // Ensure file isn't present first. + assertNotExistsInManagedDefaultRepo( expectedFile ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ONCE, SnapshotsPolicy.ONCE, + CachedFailuresPolicy.NO ); + + // Attempt the proxy fetch. + File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact ); + + File sourceFile = new File( REPOPATH_PROXIED1, path ); + assertFileEquals( expectedFile, downloadedFile, sourceFile ); + assertNoTempFiles( expectedFile ); + } + + public void testGetDefaultLayoutNotPresentPassthrough() + throws Exception + { + String path = "org/apache/maven/test/get-default-layout/1.0/get-default-layout-1.0.jar.asc"; + setupTestableManagedRepository( path ); + + File expectedFile = new File( managedDefaultDir, path ); + + // Ensure file isn't present first. + assertNotExistsInManagedDefaultRepo( expectedFile ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ONCE, SnapshotsPolicy.ONCE, + CachedFailuresPolicy.NO ); + + // Attempt the proxy fetch. + File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, path ); + + File sourceFile = new File( REPOPATH_PROXIED1, path ); + assertFileEquals( expectedFile, downloadedFile, sourceFile ); + assertFalse( new File( downloadedFile.getParentFile(), downloadedFile.getName() + ".sha1" ).exists() ); + assertFalse( new File( downloadedFile.getParentFile(), downloadedFile.getName() + ".md5" ).exists() ); + assertFalse( new File( downloadedFile.getParentFile(), downloadedFile.getName() + ".asc" ).exists() ); + assertNoTempFiles( expectedFile ); + } + + /** + * The attempt here should result in no file being transferred. + *

+ * The file exists locally, and the policy is ONCE. + * + * @throws Exception + */ + public void testGetDefaultLayoutAlreadyPresentPolicyOnce() + throws Exception + { + String path = "org/apache/maven/test/get-default-layout-present/1.0/get-default-layout-present-1.0.jar"; + setupTestableManagedRepository( path ); + + File expectedFile = new File( managedDefaultDir, path ); + + ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + + assertTrue( expectedFile.exists() ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ONCE, SnapshotsPolicy.ONCE, + CachedFailuresPolicy.NO ); + + // Attempt the proxy fetch. + File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact ); + + assertFileEquals( expectedFile, downloadedFile, expectedFile ); + assertNoTempFiles( expectedFile ); + } + + /** + * The attempt here should result in no file being transferred. + *

+ * The file exists locally, and the policy is ONCE. + * + * @throws Exception + */ + public void testGetDefaultLayoutAlreadyPresentPassthrough() + throws Exception + { + String path = "org/apache/maven/test/get-default-layout-present/1.0/get-default-layout-present-1.0.jar.asc"; + setupTestableManagedRepository( path ); + + File expectedFile = new File( managedDefaultDir, path ); + File remoteFile = new File( REPOPATH_PROXIED1, path ); + + assertTrue( expectedFile.exists() ); + + // Set the managed File to be newer than local. + setManagedOlderThanRemote( expectedFile, remoteFile ); + long originalModificationTime = expectedFile.lastModified(); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ONCE, SnapshotsPolicy.ONCE, + CachedFailuresPolicy.NO ); + + // Attempt the proxy fetch. + File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, path ); + + assertNotDownloaded( downloadedFile ); + assertNotModified( expectedFile, originalModificationTime ); + assertNoTempFiles( expectedFile ); + } + + /** + *

+ * Request a file, that exists locally, and remotely. + *

+ *

+ * All policies are set to IGNORE. + *

+ *

+ * Managed file is newer than remote file. + *

+ *

+ * Transfer should not have occured, as managed file is newer. + *

+ * + * @throws Exception + */ + public void testGetDefaultLayoutAlreadyPresentNewerThanRemotePolicyIgnored() + throws Exception + { + String path = "org/apache/maven/test/get-default-layout-present/1.0/get-default-layout-present-1.0.jar"; + setupTestableManagedRepository( path ); + + File expectedFile = new File( managedDefaultDir, path ); + File remoteFile = new File( REPOPATH_PROXIED1, path ); + + // Set the managed File to be newer than local. + setManagedNewerThanRemote( expectedFile, remoteFile ); + + long originalModificationTime = expectedFile.lastModified(); + ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + + assertTrue( expectedFile.exists() ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + + // Attempt the proxy fetch. + File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact ); + + assertNotDownloaded( downloadedFile ); + assertNotModified( expectedFile, originalModificationTime ); + assertNoTempFiles( expectedFile ); + } + + /** + *

+ * Request a file, that exists locally, and remotely. + *

+ *

+ * All policies are set to IGNORE. + *

+ *

+ * Managed file is older than Remote file. + *

+ *

+ * Transfer should have occured, as managed file is older than remote. + *

+ * + * @throws Exception + */ + public void testGetDefaultLayoutAlreadyPresentOlderThanRemotePolicyIgnored() + throws Exception + { + String path = "org/apache/maven/test/get-default-layout-present/1.0/get-default-layout-present-1.0.jar"; + setupTestableManagedRepository( path ); + + File expectedFile = new File( managedDefaultDir, path ); + File remoteFile = new File( REPOPATH_PROXIED1, path ); + + // Set the managed file to be newer than remote file. + setManagedOlderThanRemote( expectedFile, remoteFile ); + + ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + + assertTrue( expectedFile.exists() ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + + // Attempt the proxy fetch. + File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact ); + + File proxiedFile = new File( REPOPATH_PROXIED1, path ); + assertFileEquals( expectedFile, downloadedFile, proxiedFile ); + assertNoTempFiles( expectedFile ); + } + + /** + * The attempt here should result in file being transferred. + *

+ * The file exists locally, is over 6 years old, and the policy is DAILY. + * + * @throws Exception + */ + public void testGetDefaultLayoutRemoteUpdate() + throws Exception + { + String path = "org/apache/maven/test/get-default-layout-present/1.0/get-default-layout-present-1.0.jar"; + setupTestableManagedRepository( path ); + + File expectedFile = new File( managedDefaultDir, path ); + ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + + assertTrue( expectedFile.exists() ); + expectedFile.setLastModified( getPastDate().getTime() ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.DAILY, SnapshotsPolicy.DAILY, + CachedFailuresPolicy.NO ); + + // Attempt the proxy fetch. + File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact ); + + File proxiedFile = new File( REPOPATH_PROXIED1, path ); + assertFileEquals( expectedFile, downloadedFile, proxiedFile ); + assertNoTempFiles( expectedFile ); + } + + public void testGetWhenInBothProxiedRepos() + throws Exception + { + String path = "org/apache/maven/test/get-in-both-proxies/1.0/get-in-both-proxies-1.0.jar"; + setupTestableManagedRepository( path ); + + File expectedFile = new File( managedDefaultDir, path ); + ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + + assertNotExistsInManagedDefaultRepo( expectedFile ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1 ); + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2 ); + + // Attempt the proxy fetch. + File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact ); + + File proxied1File = new File( REPOPATH_PROXIED1, path ); + File proxied2File = new File( REPOPATH_PROXIED2, path ); + assertFileEquals( expectedFile, downloadedFile, proxied1File ); + assertNoTempFiles( expectedFile ); + + // TODO: is this check even needed if it passes above? + String actualContents = FileUtils.readFileToString( downloadedFile, null ); + String badContents = FileUtils.readFileToString( proxied2File, null ); + assertFalse( "Downloaded file contents should not be that of proxy 2", + StringUtils.equals( actualContents, badContents ) ); + } + + public void testGetInSecondProxiedRepo() + throws Exception + { + String path = "org/apache/maven/test/get-in-second-proxy/1.0/get-in-second-proxy-1.0.jar"; + setupTestableManagedRepository( path ); + + File expectedFile = new File( managedDefaultDir, path ); + ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + + assertNotExistsInManagedDefaultRepo( expectedFile ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1 ); + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2 ); + + // Attempt the proxy fetch. + File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact ); + + File proxied2File = new File( REPOPATH_PROXIED2, path ); + assertFileEquals( expectedFile, downloadedFile, proxied2File ); + assertNoTempFiles( expectedFile ); + } + + public void testNotFoundInAnyProxies() + throws Exception + { + String path = "org/apache/maven/test/does-not-exist/1.0/does-not-exist-1.0.jar"; + setupTestableManagedRepository( path ); + + File expectedFile = new File( managedDefaultDir, path ); + ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + + assertNotExistsInManagedDefaultRepo( expectedFile ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1 ); + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2 ); + saveConnector( ID_DEFAULT_MANAGED, ID_LEGACY_PROXIED ); + + // Attempt the proxy fetch. + File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact ); + + assertNull( "File returned was: " + downloadedFile + "; should have got a not found exception", + downloadedFile ); + assertNoTempFiles( expectedFile ); + } + + public void testGetInSecondProxiedRepoFirstFails() + throws Exception + { + String path = "org/apache/maven/test/get-in-second-proxy/1.0/get-in-second-proxy-1.0.jar"; + setupTestableManagedRepository( path ); + + File expectedFile = new File( managedDefaultDir, path ); + ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + + assertNotExistsInManagedDefaultRepo( expectedFile ); + + // Configure Repository (usually done within archiva.xml configuration) + saveRemoteRepositoryConfig( "badproxied", "Bad Proxied", "test://bad.machine.com/repo/", "default" ); + + wagonMock.get( path, new File( expectedFile.getAbsolutePath() + ".tmp" ) ); + wagonMockControl.setMatcher(customWagonGetMatcher); + wagonMockControl.setThrowable( new ResourceDoesNotExistException( "transfer failed" ) ); + wagonMockControl.replay(); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, "badproxied" ); + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2 ); + + // Attempt the proxy fetch. + File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact ); + + wagonMockControl.verify(); + + File proxied2File = new File( REPOPATH_PROXIED2, path ); + assertFileEquals( expectedFile, downloadedFile, proxied2File ); + assertNoTempFiles( expectedFile ); + } + + public void testGetAllRepositoriesFail() + throws Exception + { + String path = "org/apache/maven/test/get-in-second-proxy/1.0/get-in-second-proxy-1.0.jar"; + setupTestableManagedRepository( path ); + + File expectedFile = new File( managedDefaultDir.getAbsoluteFile(), path ); + ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + + assertNotExistsInManagedDefaultRepo( expectedFile ); + + // Configure Repository (usually done within archiva.xml configuration) + saveRemoteRepositoryConfig( "badproxied1", "Bad Proxied 1", "test://bad.machine.com/repo/", "default" ); + saveRemoteRepositoryConfig( "badproxied2", "Bad Proxied 2", "test://dead.machine.com/repo/", "default" ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, "badproxied1" ); + saveConnector( ID_DEFAULT_MANAGED, "badproxied2" ); + + File tmpFile = new File( expectedFile.getParentFile(), expectedFile.getName() + ".tmp" ); + wagonMock.get( path, tmpFile ); + + wagonMockControl.setMatcher(customWagonGetMatcher); + wagonMockControl.setThrowable( new ResourceDoesNotExistException( "Can't find resource." ) ); + + wagonMock.get( path, tmpFile ); + + wagonMockControl.setMatcher(customWagonGetMatcher); + wagonMockControl.setThrowable( new ResourceDoesNotExistException( "Can't find resource." ) ); + + wagonMockControl.replay(); + + File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact ); + + assertNotDownloaded( downloadedFile ); + + wagonMockControl.verify(); + assertNoTempFiles( expectedFile ); + + // TODO: do not want failures to present as a not found [MRM-492] + // TODO: How much information on each failure should we pass back to the user vs. logging in the proxy? + } + + public void testGetFromLegacyProxyAlreadyPresentInManaged_NewerThanRemote() + throws Exception + { + String legacyPath = "org.apache.maven.test/jars/get-default-layout-present-1.0.jar"; + String path = "org/apache/maven/test/get-default-layout-present/1.0/get-default-layout-present-1.0.jar"; + setupTestableManagedRepository( path ); + + File expectedFile = new File( managedDefaultDir, path ); + File remoteFile = new File( REPOPATH_PROXIED_LEGACY, legacyPath ); + + // Set the managed file to be newer than remote. + setManagedNewerThanRemote( expectedFile, remoteFile ); + long expectedTimestamp = expectedFile.lastModified(); + + ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + + assertTrue( expectedFile.exists() ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, ID_LEGACY_PROXIED ); + + File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact ); + + assertNotDownloaded( downloadedFile ); + assertNotModified( expectedFile, expectedTimestamp ); + assertNoTempFiles( expectedFile ); + } + + public void testGetFromLegacyProxyAlreadyPresentInManaged_OlderThanRemote() + throws Exception + { + String legacyPath = "org.apache.maven.test/jars/get-default-layout-present-1.0.jar"; + String path = "org/apache/maven/test/get-default-layout-present/1.0/get-default-layout-present-1.0.jar"; + setupTestableManagedRepository( path ); + + File expectedFile = new File( managedDefaultDir, path ); + File remoteFile = new File( REPOPATH_PROXIED_LEGACY, legacyPath ); + + // Set the managed file to be older than remote. + setManagedOlderThanRemote( expectedFile, remoteFile ); + + ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + + assertTrue( expectedFile.exists() ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, ID_LEGACY_PROXIED ); + + File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact ); + + File proxiedFile = new File( REPOPATH_PROXIED_LEGACY, legacyPath ); + assertFileEquals( expectedFile, downloadedFile, proxiedFile ); + assertNoTempFiles( expectedFile ); + } + + public void testGetFromLegacyProxyNotPresentInManaged() + throws Exception + { + String legacyPath = "org.apache.maven.test/jars/example-lib-2.2.jar"; + String path = "org/apache/maven/test/example-lib/2.2/example-lib-2.2.jar"; + setupTestableManagedRepository( path ); + + File expectedFile = new File( managedDefaultDir, path ); + ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + + assertNotExistsInManagedDefaultRepo( expectedFile ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, ID_LEGACY_PROXIED ); + + File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact ); + + File proxiedFile = new File( REPOPATH_PROXIED_LEGACY, legacyPath ); + assertFileEquals( expectedFile, downloadedFile, proxiedFile ); + assertNoTempFiles( expectedFile ); + } + + public void testGetFromLegacyProxyPluginNotPresentInManaged() + throws Exception + { + String legacyPath = "org.apache.maven.test/maven-plugins/example-maven-plugin-0.42.jar"; + String path = "org/apache/maven/test/example-maven-plugin/0.42/example-maven-plugin-0.42.jar"; + setupTestableManagedRepository( path ); + + File expectedFile = new File( managedDefaultDir, path ); + ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + + assertNotExistsInManagedDefaultRepo( expectedFile ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, ID_LEGACY_PROXIED ); + + File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact ); + + File proxiedFile = new File( REPOPATH_PROXIED_LEGACY, legacyPath ); + assertFileEquals( expectedFile, downloadedFile, proxiedFile ); + assertNoTempFiles( expectedFile ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/ManagedLegacyTransferTest.java b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/ManagedLegacyTransferTest.java new file mode 100644 index 000000000..662897857 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/ManagedLegacyTransferTest.java @@ -0,0 +1,225 @@ +package org.apache.maven.archiva.proxy; + +/* + * 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.archiva.model.ArtifactReference; +import org.apache.maven.archiva.policies.CachedFailuresPolicy; +import org.apache.maven.archiva.policies.ChecksumPolicy; +import org.apache.maven.archiva.policies.ReleasesPolicy; +import org.apache.maven.archiva.policies.SnapshotsPolicy; + +import java.io.File; + +/** + * ManagedLegacyTransferTest + * + * @author Brett Porter + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ManagedLegacyTransferTest + extends AbstractProxyTestCase +{ + /** + * Incoming request on a Managed Legacy repository, for content that does not + * exist in the managed legacy repository, but does exist on a remote default layout repository. + */ + public void testManagedLegacyNotPresentRemoteDefaultPresent() + throws Exception + { + String path = "org.apache.maven.test/jars/get-default-layout-1.0.jar"; + File expectedFile = new File( managedLegacyDir, path ); + ArtifactReference artifact = managedLegacyRepository.toArtifactReference( path ); + + assertNotExistsInManagedLegacyRepo( expectedFile ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_LEGACY_MANAGED, ID_PROXIED1 ); + + File downloadedFile = proxyHandler.fetchFromProxies( managedLegacyRepository, artifact ); + + File proxied2File = new File( REPOPATH_PROXIED1, + "org/apache/maven/test/get-default-layout/1.0/get-default-layout-1.0.jar" ); + assertFileEquals( expectedFile, downloadedFile, proxied2File ); + assertNoTempFiles( expectedFile ); + } + + /** + * Incoming request on a Managed Legacy repository, for content that already + * exist in the managed legacy repository, and also exist on a remote default layout repository. + */ + public void testManagedLegacyPresentRemoteDefaultPresent() + throws Exception + { + String path = "org.apache.maven.test/jars/get-default-layout-present-1.0.jar"; + String remotePath = "org/apache/maven/test/get-default-layout-present/1.0/get-default-layout-present-1.0.jar"; + + File expectedFile = new File( managedLegacyDir, path ); + File remoteFile = new File( REPOPATH_PROXIED1, remotePath ); + + setManagedOlderThanRemote( expectedFile, remoteFile ); + + ArtifactReference artifact = managedLegacyRepository.toArtifactReference( path ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_LEGACY_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + + File downloadedFile = proxyHandler.fetchFromProxies( managedLegacyRepository, artifact ); + + assertFileEquals( expectedFile, downloadedFile, remoteFile ); + assertNoTempFiles( expectedFile ); + } + + /** + * Incoming request on a Managed Legacy repository, for content that does not + * exist in the managed legacy repository, and does not exist on a remote legacy layout repository. + */ + public void testManagedLegacyNotPresentRemoteLegacyPresent() + throws Exception + { + String path = "org.apache.maven.test/plugins/get-legacy-plugin-1.0.jar"; + File expectedFile = new File( managedLegacyDir, path ); + ArtifactReference artifact = managedLegacyRepository.toArtifactReference( path ); + + assertNotExistsInManagedLegacyRepo( expectedFile ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_LEGACY_MANAGED, ID_LEGACY_PROXIED ); + + File downloadedFile = proxyHandler.fetchFromProxies( managedLegacyRepository, artifact ); + + File proxiedFile = new File( REPOPATH_PROXIED_LEGACY, path ); + assertFileEquals( expectedFile, downloadedFile, proxiedFile ); + assertNoTempFiles( expectedFile ); + } + + /** + * Incoming request on a Managed Legacy repository, for content that does exist in the + * managed legacy repository, and also exists on a remote legacy layout repository. + */ + public void testManagedLegacyPresentRemoteLegacyPresent() + throws Exception + { + String path = "org.apache.maven.test/jars/get-default-layout-present-1.0.jar"; + File expectedFile = new File( managedLegacyDir, path ); + File remoteFile = new File( REPOPATH_PROXIED_LEGACY, path ); + + setManagedOlderThanRemote( expectedFile, remoteFile ); + + ArtifactReference artifact = managedLegacyRepository.toArtifactReference( path ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_LEGACY_MANAGED, ID_LEGACY_PROXIED ); + + File downloadedFile = proxyHandler.fetchFromProxies( managedLegacyRepository, artifact ); + + assertFileEquals( expectedFile, downloadedFile, remoteFile ); + assertNoTempFiles( expectedFile ); + } + + /** + * Incoming request on a Managed Legacy repository, for content that does exist in the + * managed legacy repository, and does not exist on a remote legacy layout repository. + */ + public void testManagedLegacyPresentRemoteLegacyNotPresent() + throws Exception + { + String path = "org.apache.maven.test/jars/managed-only-lib-2.1.jar"; + File expectedFile = new File( managedLegacyDir, path ); + ArtifactReference artifact = managedLegacyRepository.toArtifactReference( path ); + + assertTrue( expectedFile.exists() ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_LEGACY_MANAGED, ID_LEGACY_PROXIED ); + + File downloadedFile = proxyHandler.fetchFromProxies( managedLegacyRepository, artifact ); + + assertNotDownloaded( downloadedFile ); + assertNoTempFiles( expectedFile ); + } + + /** + * Incoming request on a Managed Legacy repository, for content that does exist in the + * managed legacy repository, and does not exists on a remote default layout repository. + */ + public void testManagedLegacyPresentRemoteDefaultNotPresent() + throws Exception + { + String path = "org.apache.maven.test/jars/managed-only-lib-2.1.jar"; + File expectedFile = new File( managedLegacyDir, path ); + ArtifactReference artifact = managedLegacyRepository.toArtifactReference( path ); + + assertTrue( expectedFile.exists() ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_LEGACY_MANAGED, ID_PROXIED1 ); + + File downloadedFile = proxyHandler.fetchFromProxies( managedLegacyRepository, artifact ); + + assertNotDownloaded( downloadedFile ); + assertNoTempFiles( expectedFile ); + } + + /** + * Incoming request on a Managed Legacy repository, for content that does not exist in the + * managed legacy repository, and does not exists on a remote legacy layout repository. + */ + public void testManagedLegacyNotPresentRemoteLegacyNotPresent() + throws Exception + { + String path = "org.apache.archiva.test/jars/mystery-lib-1.0.jar"; + File expectedFile = new File( managedLegacyDir, path ); + ArtifactReference artifact = managedLegacyRepository.toArtifactReference( path ); + + assertNotExistsInManagedLegacyRepo( expectedFile ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_LEGACY_MANAGED, ID_LEGACY_PROXIED ); + + File downloadedFile = proxyHandler.fetchFromProxies( managedLegacyRepository, artifact ); + + assertNotDownloaded( downloadedFile ); + assertNoTempFiles( expectedFile ); + } + + /** + * Incoming request on a Managed Legacy repository, for content that does not exist in the + * managed legacy repository, and does not exists on a remote default layout repository. + */ + public void testManagedLegacyNotPresentRemoteDefaultNotPresent() + throws Exception + { + String path = "org.apache.archiva.test/jars/mystery-lib-2.1.jar"; + File expectedFile = new File( managedLegacyDir, path ); + ArtifactReference artifact = managedLegacyRepository.toArtifactReference( path ); + + assertNotExistsInManagedLegacyRepo( expectedFile ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_LEGACY_MANAGED, ID_PROXIED1 ); + + File downloadedFile = proxyHandler.fetchFromProxies( managedLegacyRepository, artifact ); + + assertNotDownloaded( downloadedFile ); + assertNoTempFiles( expectedFile ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/MetadataTransferTest.java b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/MetadataTransferTest.java new file mode 100644 index 000000000..8e7d20d68 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/MetadataTransferTest.java @@ -0,0 +1,1328 @@ +package org.apache.maven.archiva.proxy; + +/* + * 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.maven.archiva.common.utils.VersionUtil; +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.maven.archiva.policies.CachedFailuresPolicy; +import org.apache.maven.archiva.policies.ChecksumPolicy; +import org.apache.maven.archiva.policies.ReleasesPolicy; +import org.apache.maven.archiva.policies.SnapshotsPolicy; +import org.apache.maven.archiva.repository.metadata.MetadataTools; +import org.apache.maven.archiva.repository.metadata.RepositoryMetadataException; +import org.apache.maven.archiva.repository.metadata.RepositoryMetadataReader; +import org.apache.maven.archiva.repository.metadata.RepositoryMetadataWriter; +import org.apache.maven.wagon.TransferFailedException; +import org.custommonkey.xmlunit.DetailedDiff; +import org.custommonkey.xmlunit.Diff; + +import java.io.File; +import java.io.StringWriter; +import java.util.Arrays; + +/** + * MetadataTransferTest - Tests the various fetching / merging concepts surrounding the maven-metadata.xml files + * present in the repository. + * + * Test Case Naming is as follows. + * + * + * public void testGet[Release|Snapshot|Project]Metadata[Not]Proxied[Not|On]Local[Not|On|Multiple]Remote + * + * + *

+ * Which should leave the following matrix of test cases.
+ *
+ *   Metadata  | Proxied  | Local | Remote
+ *   ----------+----------+-------+---------
+ *   Release   | Not      | Not   | n/a (1)
+ *   Release   | Not      | On    | n/a (1)
+ *   Release   |          | Not   | Not
+ *   Release   |          | Not   | On
+ *   Release   |          | Not   | Multiple
+ *   Release   |          | On    | Not
+ *   Release   |          | On    | On
+ *   Release   |          | On    | Multiple
+ *   Snapshot  | Not      | Not   | n/a (1)
+ *   Snapshot  | Not      | On    | n/a (1)
+ *   Snapshot  |          | Not   | Not
+ *   Snapshot  |          | Not   | On
+ *   Snapshot  |          | Not   | Multiple
+ *   Snapshot  |          | On    | Not
+ *   Snapshot  |          | On    | On
+ *   Snapshot  |          | On    | Multiple
+ *   Project   | Not      | Not   | n/a (1)
+ *   Project   | Not      | On    | n/a (1)
+ *   Project   |          | Not   | Not
+ *   Project   |          | Not   | On
+ *   Project   |          | Not   | Multiple
+ *   Project   |          | On    | Not
+ *   Project   |          | On    | On
+ *   Project   |          | On    | Multiple
+ *
+ * (1) If it isn't proxied, no point in having a remote.
+ * 
+ * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class MetadataTransferTest + extends AbstractProxyTestCase +{ + /** + * @plexus.requirement + */ + private MetadataTools metadataTools; + + // TODO: same test for other fetch* methods + public void testFetchFromTwoProxiesWhenFirstConnectionFails() + throws Exception + { + // Project metadata that does not exist locally, but has multiple versions in remote repos + String requestedResource = "org/apache/maven/test/get-default-layout/maven-metadata.xml"; + setupTestableManagedRepository( requestedResource ); + + saveRemoteRepositoryConfig( "badproxied1", "Bad Proxied 1", "test://bad.machine.com/repo/", "default" ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, "badproxied1", ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + + assertResourceNotFound( requestedResource ); + assertNoRepoMetadata( "badproxied1", requestedResource ); + assertNoRepoMetadata( ID_PROXIED2, requestedResource ); + + // ensure that a hard failure in the first proxy connector is skipped and the second repository checked + File expectedFile = new File( managedDefaultDir.getAbsoluteFile(), + metadataTools.getRepositorySpecificName( "badproxied1", requestedResource ) ); + wagonMock.get( requestedResource, new File( expectedFile.getParentFile(), expectedFile.getName() + ".tmp" ) ); + + wagonMockControl.setMatcher(customWagonGetMatcher); + + wagonMockControl.setThrowable( new TransferFailedException( "can't connect" ) ); + + wagonMockControl.replay(); + + assertFetchProjectOrGroup( requestedResource ); + + wagonMockControl.verify(); + + assertProjectMetadataContents( requestedResource, new String[] { "1.0.1" }, "1.0.1", "1.0.1" ); + assertNoRepoMetadata( "badproxied1", requestedResource ); + assertRepoProjectMetadata( ID_PROXIED2, requestedResource, new String[] { "1.0.1" } ); + } + + /** + * Attempt to get the project metadata for non-existant artifact. + * + * Expected result: the maven-metadata.xml file is not created on the managed repository, nor returned + * to the requesting client. + */ + public void testGetProjectMetadataNotProxiedNotLocal() + throws Exception + { + // The artifactId "get-default-metadata-nonexistant" does not exist (intentionally). + String requestedResource = "org/apache/maven/test/get-default-metadata-nonexistant/maven-metadata.xml"; + setupTestableManagedRepository( requestedResource ); + + assertResourceNotFound( requestedResource ); + + // No proxy setup, nothing fetched, failure expected. + assertFetchProjectOrGroupFailed( requestedResource ); + + // No local artifactId, and no fetch, should equal no metadata file downloaded / created / updated. + assertResourceNotFound( requestedResource ); + } + + public void testGetProjectMetadataNotProxiedOnLocal() + throws Exception + { + // Project metadata that exists and has multiple versions + String requestedResource = "org/apache/maven/test/get-project-metadata/maven-metadata.xml"; + setupTestableManagedRepository( requestedResource ); + + assertResourceExists( requestedResource ); + + // No proxy setup, nothing fetched from remote, but local exists. + assertFetchProjectOrGroup( requestedResource ); + + // Nothing fetched. Should only contain contents of what is in the repository. + // A metadata update is not performed in this use case. Local metadata content is only + // updated via the metadata updater consumer. + assertProjectMetadataContents( requestedResource, new String[] { "1.0" }, null, null ); + } + + public void testGetProjectMetadataProxiedNotLocalMultipleRemotes() + throws Exception + { + // Project metadata that does not exist locally, but has multiple versions in remote repos + String requestedResource = "org/apache/maven/test/get-default-layout/maven-metadata.xml"; + setupTestableManagedRepository( requestedResource ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + + assertResourceNotFound( requestedResource ); + assertNoRepoMetadata( ID_PROXIED1, requestedResource ); + assertNoRepoMetadata( ID_PROXIED2, requestedResource ); + + // Two proxies setup, metadata fetched from both remotes. + assertFetchProjectOrGroup( requestedResource ); + + // Nothing fetched. Should only contain contents of what is in the repository. + assertProjectMetadataContents( requestedResource, new String[] { "1.0", "1.0.1" }, "1.0.1", "1.0.1" ); + assertRepoProjectMetadata( ID_PROXIED1, requestedResource, new String[] { "1.0" } ); + assertRepoProjectMetadata( ID_PROXIED2, requestedResource, new String[] { "1.0.1" } ); + } + + public void testGetProjectMetadataProxiedNotLocalNotRemote() + throws Exception + { + // Non-existant project metadata that does not exist locally and doesn't exist on remotes. + String requestedResource = "org/apache/maven/test/get-bogus-artifact/maven-metadata.xml"; + setupTestableManagedRepository( requestedResource ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + + assertResourceNotFound( requestedResource ); + assertNoRepoMetadata( ID_PROXIED1, requestedResource ); + assertNoRepoMetadata( ID_PROXIED2, requestedResource ); + + // Two proxies setup, nothing fetched from remotes, local does not exist. + assertFetchProjectOrGroupFailed( requestedResource ); + + // Nothing fetched. Nothing should exist. + assertResourceNotFound( requestedResource ); + assertNoRepoMetadata( ID_PROXIED1, requestedResource ); + assertNoRepoMetadata( ID_PROXIED2, requestedResource ); + } + + public void testGetProjectMetadataProxiedNotLocalOnRemote() + throws Exception + { + // New project metadata that does not exist locally but exists on remote. + String requestedResource = "org/apache/maven/test/get-found-in-proxy/maven-metadata.xml"; + setupTestableManagedRepository( requestedResource ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + + assertResourceNotFound( requestedResource ); + assertNoRepoMetadata( ID_PROXIED1, requestedResource ); + + // One proxy setup, metadata fetched from remote, local does not exist. + assertFetchProjectOrGroup( requestedResource ); + + // Remote fetched. Local created/updated. + assertProjectMetadataContents( requestedResource, new String[] { "1.0.5" }, "1.0.5", "1.0.5" ); + assertRepoProjectMetadata( ID_PROXIED1, requestedResource, new String[] { "1.0.5" } ); + } + + public void testGetProjectMetadataProxiedOnLocalMultipleRemote() + throws Exception + { + // Project metadata that exist locally, and has multiple versions in remote repos + String requestedResource = "org/apache/maven/test/get-on-multiple-repos/maven-metadata.xml"; + setupTestableManagedRepository( requestedResource ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + + assertProjectMetadataContents( requestedResource, new String[] { "1.0" }, null, null ); + assertNoRepoMetadata( ID_PROXIED1, requestedResource ); + assertNoRepoMetadata( ID_PROXIED2, requestedResource ); + + // Two proxies setup, metadata fetched from both remotes. + assertFetchProjectOrGroup( requestedResource ); + + // metadata fetched from both repos, and merged with local version. + assertProjectMetadataContents( requestedResource, new String[] { "1.0", "1.0.1", "2.0" }, "2.0", "2.0" ); + assertRepoProjectMetadata( ID_PROXIED1, requestedResource, new String[] { "1.0", "2.0" } ); + assertRepoProjectMetadata( ID_PROXIED2, requestedResource, new String[] { "1.0", "1.0.1" } ); + } + + public void testGetProjectMetadataProxiedOnLocalNotRemote() + throws Exception + { + // Project metadata that exist locally, and does not exist in remote repos. + String requestedResource = "org/apache/maven/test/get-not-on-remotes/maven-metadata.xml"; + setupTestableManagedRepository( requestedResource ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + + assertProjectMetadataContents( requestedResource, new String[] { "1.0-beta-2" }, null, null ); + assertNoRepoMetadata( ID_PROXIED1, requestedResource ); + assertNoRepoMetadata( ID_PROXIED2, requestedResource ); + + // Two proxies setup, metadata fetch from remotes fail (because they dont exist). + assertFetchProjectOrGroup( requestedResource ); + + // metadata not fetched from both repos, and local version exists. + // Since there was no updated metadata content from a remote/proxy, a metadata update on + // the local file never ran. Local only updates are performed via the metadata updater consumer. + assertProjectMetadataContents( requestedResource, new String[] { "1.0-beta-2" }, null, null ); + assertNoRepoMetadata( ID_PROXIED1, requestedResource ); + assertNoRepoMetadata( ID_PROXIED2, requestedResource ); + } + + public void testGetProjectMetadataProxiedOnLocalOnRemote() + throws Exception + { + // Project metadata that exist locally and exists on remote. + String requestedResource = "org/apache/maven/test/get-on-local-on-remote/maven-metadata.xml"; + setupTestableManagedRepository( requestedResource ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + + assertProjectMetadataContents( requestedResource, new String[] { "1.0.8", "1.0.22" }, null, null ); + assertNoRepoMetadata( ID_PROXIED1, requestedResource ); + + // One proxy setup, metadata fetched from remote, local exists. + assertFetchProjectOrGroup( requestedResource ); + + // Remote fetched. Local updated. + assertProjectMetadataContents( requestedResource, new String[] { "1.0.8", "1.0.22", "2.0" }, "2.0", "2.0" ); + assertRepoProjectMetadata( ID_PROXIED1, requestedResource, new String[] { "1.0.22", "2.0" } ); + } + + /** + * A request for a release maven-metadata.xml file that does not exist locally, and the managed + * repository has no proxied repositories set up. + * + * Expected result: the maven-metadata.xml file is not created on the managed repository, nor returned + * to the requesting client. + */ + public void testGetReleaseMetadataNotProxiedNotLocal() + throws Exception + { + // The artifactId "get-default-metadata-nonexistant" does not exist (intentionally). + String requestedResource = "org/apache/maven/test/get-default-metadata-nonexistant/1.0/maven-metadata.xml"; + setupTestableManagedRepository( requestedResource ); + + assertNoMetadata( requestedResource ); + + // No proxy setup, nothing fetched, failure expected. + assertFetchVersionedFailed( requestedResource ); + + // No local artifactId, and no fetch, should equal no metadata file downloaded / created / updated. + assertNoMetadata( requestedResource ); + } + + /** + * A request for a maven-metadata.xml file that does exist locally, and the managed + * repository has no proxied repositories set up. + * + * Expected result: the maven-metadata.xml file is updated locally, based off of the managed repository + * information, and then returned to the client. + */ + public void testGetReleaseMetadataNotProxiedOnLocal() + throws Exception + { + String requestedResource = "org/apache/maven/test/get-default-metadata/1.0/maven-metadata.xml"; + setupTestableManagedRepository( requestedResource ); + + assertResourceExists( requestedResource ); + + assertFetchVersioned( requestedResource ); + + assertReleaseMetadataContents( requestedResource ); + } + + /** + * A request for a release maven-metadata.xml file that does not exist on the managed repository, but + * exists on multiple remote repositories. + * + * Expected result: the maven-metadata.xml file is downloaded from the remote into the repository specific + * file location on the managed repository, a merge of the contents to the requested + * maven-metadata.xml is performed, and then the merged maven-metadata.xml file is + * returned to the client. + */ + public void testGetReleaseMetadataProxiedNotLocalMultipleRemotes() + throws Exception + { + String requestedResource = "org/apache/maven/test/get-default-layout/1.0/maven-metadata.xml"; + setupTestableManagedRepository( requestedResource ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + + assertResourceNotFound( requestedResource ); + assertNoRepoMetadata( ID_PROXIED1, requestedResource ); + assertNoRepoMetadata( ID_PROXIED2, requestedResource ); + + assertFetchVersioned( requestedResource ); + + assertReleaseMetadataContents( requestedResource ); + assertRepoReleaseMetadataContents( ID_PROXIED1, requestedResource ); + assertRepoReleaseMetadataContents( ID_PROXIED2, requestedResource ); + } + + /** + * A request for a maven-metadata.xml file that does not exist locally, nor does it exist in a remote + * proxied repository. + * + * Expected result: the maven-metadata.xml file is created locally, based off of managed repository + * information, and then return to the client. + */ + public void testGetReleaseMetadataProxiedNotLocalNotRemote() + throws Exception + { + String requestedResource = "org/apache/maven/test/get-bad-metadata/1.0/maven-metadata.xml"; + setupTestableManagedRepository( requestedResource ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + + assertResourceNotFound( requestedResource ); + + assertFetchProjectOrGroupFailed( requestedResource ); + + assertResourceNotFound( requestedResource ); + assertNoRepoMetadata( ID_PROXIED1, requestedResource ); + } + + /** + * A request for a maven-metadata.xml file that does not exist on the managed repository, but + * exists on 1 remote repository. + * + * Expected result: the maven-metadata.xml file is downloaded from the remote into the repository specific + * file location on the managed repository, a merge of the contents to the requested + * maven-metadata.xml is performed, and then the merged maven-metadata.xml file is + * returned to the client. + */ + public void testGetReleaseMetadataProxiedNotLocalOnRemote() + throws Exception + { + String requestedResource = "org/apache/maven/test/get-default-layout/1.0/maven-metadata.xml"; + setupTestableManagedRepository( requestedResource ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + + assertNoRepoMetadata( ID_PROXIED1, requestedResource ); + + assertFetchVersioned( requestedResource ); + + assertReleaseMetadataContents( requestedResource ); + assertRepoReleaseMetadataContents( ID_PROXIED1, requestedResource ); + } + + /** + * A request for a maven-metadata.xml file that exists in the managed repository, but + * not on any remote repository. + * + * Expected result: the maven-metadata.xml file does not exist on the remote proxied repository and + * is not downloaded. There is no repository specific metadata file on the managed + * repository. The managed repository maven-metadata.xml is returned to the + * client as-is. + */ + public void testGetReleaseMetadataProxiedOnLocalNotRemote() + throws Exception + { + String requestedResource = "org/apache/maven/test/get-not-on-remotes/1.0-beta-2/maven-metadata.xml"; + setupTestableManagedRepository( requestedResource ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + + assertReleaseMetadataContents( requestedResource ); + + assertFetchVersioned( requestedResource ); + + assertReleaseMetadataContents( requestedResource ); + assertNoRepoMetadata( ID_PROXIED1, requestedResource ); + } + + /** + * A request for a maven-metadata.xml file that exists in the managed repository, and on multiple + * remote repositories. + * + * Expected result: the maven-metadata.xml file on the remote proxied repository is downloaded + * and merged into the contents of the existing managed repository copy of + * the maven-metadata.xml file. + */ + public void testGetReleaseMetadataProxiedOnLocalMultipleRemote() + throws Exception + { + String requestedResource = "org/apache/maven/test/get-on-multiple-repos/1.0/maven-metadata.xml"; + setupTestableManagedRepository( requestedResource ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + + assertReleaseMetadataContents( requestedResource ); + assertNoRepoMetadata( ID_PROXIED1, requestedResource ); + assertNoRepoMetadata( ID_PROXIED2, requestedResource ); + + assertFetchVersioned( requestedResource ); + + assertReleaseMetadataContents( requestedResource ); + assertRepoReleaseMetadataContents( ID_PROXIED1, requestedResource ); + assertRepoReleaseMetadataContents( ID_PROXIED2, requestedResource ); + } + + /** + * A request for a maven-metadata.xml file that exists in the managed repository, and on one + * remote repository. + * + * Expected result: the maven-metadata.xml file on the remote proxied repository is downloaded + * and merged into the contents of the existing managed repository copy of + * the maven-metadata.xml file. + */ + public void testGetReleaseMetadataProxiedOnLocalOnRemote() + throws Exception + { + String requestedResource = "org/apache/maven/test/get-on-local-on-remote/1.0.22/maven-metadata.xml"; + setupTestableManagedRepository( requestedResource ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + + assertReleaseMetadataContents( requestedResource ); + assertNoRepoMetadata( ID_PROXIED1, requestedResource ); + + assertFetchVersioned( requestedResource ); + + assertReleaseMetadataContents( requestedResource ); + assertRepoReleaseMetadataContents( ID_PROXIED1, requestedResource ); + } + + public void testGetSnapshotMetadataNotProxiedNotLocal() + throws Exception + { + // The artifactId "get-default-metadata-nonexistant" does not exist (intentionally). + String requestedResource = "org/apache/maven/test/get-default-metadata-nonexistant/1.0-SNAPSHOT/maven-metadata.xml"; + setupTestableManagedRepository( requestedResource ); + + assertNoMetadata( requestedResource ); + + // No proxy setup, nothing fetched, no local file, failure expected. + assertFetchVersionedFailed( requestedResource ); + + // No local artifactId, and no fetch, should equal no metadata file downloaded / created / updated. + assertNoMetadata( requestedResource ); + } + + public void testGetSnapshotMetadataNotProxiedOnLocal() + throws Exception + { + // The artifactId exists locally (but not on a remote repo) + String requestedResource = "org/apache/maven/test/get-snapshot-on-local-not-remote/2.0-alpha-2-SNAPSHOT/maven-metadata.xml"; + setupTestableManagedRepository( requestedResource ); + + assertResourceExists( requestedResource ); + + // No proxy setup, nothing fetched from remote, local file exists, fetch should succeed. + assertFetchVersioned( requestedResource ); + + // Local metadata exists, should be updated to reflect the latest release. + assertSnapshotMetadataContents( requestedResource, "20070821", "220304", 2 ); + } + + public void testGetSnapshotMetadataProxiedNotLocalMultipleRemotes() + throws Exception + { + String requestedResource = "org/apache/maven/test/get-timestamped-snapshot-in-both/1.0-SNAPSHOT/maven-metadata.xml"; + setupTestableManagedRepository( requestedResource ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + + assertResourceNotFound( requestedResource ); + assertNoRepoMetadata( ID_PROXIED1, requestedResource ); + assertNoRepoMetadata( ID_PROXIED2, requestedResource ); + + // Proxying 2 repos, both have content, local file updated. + assertFetchVersioned( requestedResource ); + + assertSnapshotMetadataContents( requestedResource, "20070101", "000103", 2 ); + assertRepoSnapshotMetadataContents( ID_PROXIED1, requestedResource, "20061227", "112101", 2 ); + assertRepoSnapshotMetadataContents( ID_PROXIED2, requestedResource, "20070101", "000103", 2 ); + } + + public void testGetSnapshotMetadataProxiedNotLocalNotRemote() + throws Exception + { + // The artifactId "get-default-metadata-nonexistant" does not exist (intentionally). + String requestedResource = "org/apache/maven/test/get-default-metadata-nonexistant/1.0-SNAPSHOT/maven-metadata.xml"; + setupTestableManagedRepository( requestedResource ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + + assertNoMetadata( requestedResource ); + + // One proxy setup, nothing fetched, no local file, failure expected. + assertFetchVersionedFailed( requestedResource ); + + // No local artifactId, and no fetch, should equal no metadata file downloaded / created / updated. + assertNoMetadata( requestedResource ); + assertNoRepoMetadata( ID_PROXIED1, requestedResource ); + } + + public void testGetSnapshotMetadataProxiedNotLocalOnRemote() + throws Exception + { + // Artifact exists only in the proxied1 location. + String requestedResource = "org/apache/maven/test/get-metadata-snapshot/1.0-SNAPSHOT/maven-metadata.xml"; + setupTestableManagedRepository( requestedResource ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + + assertResourceNotFound( requestedResource ); + + // One proxy setup, one metadata fetched, local file created/updated. + assertFetchVersioned( requestedResource ); + + // Local artifact Id should contain latest (which in this case is from proxied download) + assertSnapshotMetadataContents( requestedResource, "20050831", "101112", 1 ); + assertRepoSnapshotMetadataContents( ID_PROXIED1, requestedResource, "20050831", "101112", 1 ); + } + + public void testGetSnapshotMetadataProxiedOnLocalMultipleRemote() + throws Exception + { + String requestedResource = "org/apache/maven/test/get-snapshot-popular/2.0-SNAPSHOT/maven-metadata.xml"; + setupTestableManagedRepository( requestedResource ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + + assertSnapshotMetadataContents( requestedResource, "20070822", "021008", 3 ); + assertNoRepoMetadata( ID_PROXIED1, requestedResource ); + assertNoRepoMetadata( ID_PROXIED2, requestedResource ); + + // Proxying 2 repos, both have content, local file updated. + assertFetchVersioned( requestedResource ); + + assertSnapshotMetadataContents( requestedResource, "20070823", "212711", 6 ); + assertRepoSnapshotMetadataContents( ID_PROXIED1, requestedResource, "20070822", "145534", 9 ); + assertRepoSnapshotMetadataContents( ID_PROXIED2, requestedResource, "20070823", "212711", 6 ); + } + + public void testGetSnapshotMetadataProxiedOnLocalNotRemote() + throws Exception + { + // The artifactId exists locally (but not on a remote repo) + String requestedResource = "org/apache/maven/test/get-snapshot-on-local-not-remote/2.0-alpha-2-SNAPSHOT/maven-metadata.xml"; + setupTestableManagedRepository( requestedResource ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + + assertResourceExists( requestedResource ); + assertNoRepoMetadata( ID_PROXIED1, requestedResource ); + assertNoRepoMetadata( ID_PROXIED2, requestedResource ); + + // two proxies setup, nothing fetched from either remote, local file exists, fetch should succeed. + assertFetchVersioned( requestedResource ); + + // Local metadata exists, repo metadatas should not exist, local file updated. + assertSnapshotMetadataContents( requestedResource, "20070821", "220304", 2 ); + assertNoRepoMetadata( ID_PROXIED1, requestedResource ); + assertNoRepoMetadata( ID_PROXIED2, requestedResource ); + } + + public void testGetSnapshotMetadataProxiedOnLocalOnRemote() + throws Exception + { + // The artifactId exists locally (but not on a remote repo) + String requestedResource = "org/apache/maven/test/get-present-metadata-snapshot/1.0-SNAPSHOT/maven-metadata.xml"; + setupTestableManagedRepository( requestedResource ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + + assertSnapshotMetadataContents( requestedResource, "20050831", "101112", 1 ); + assertNoRepoMetadata( ID_PROXIED1, requestedResource ); + + // two proxies setup, nothing fetched from either remote, local file exists, fetch should succeed. + assertFetchVersioned( requestedResource ); + + // Local metadata exists, repo metadata exists, local file updated. + assertSnapshotMetadataContents( requestedResource, "20050831", "101112", 1 ); + assertRepoSnapshotMetadataContents( ID_PROXIED1, requestedResource, "20050831", "101112", 1 ); + } + + public void testGetGroupMetadataNotProxiedNotLocal() + throws Exception + { + // The artifactId "get-default-metadata-nonexistant" does not exist (intentionally). + String requestedResource = "org/apache/maven/test/groups/get-default-metadata-nonexistant/maven-metadata.xml"; + setupTestableManagedRepository( requestedResource ); + + assertResourceNotFound( requestedResource ); + + // No proxy setup, nothing fetched, failure expected. + assertFetchProjectOrGroupFailed( requestedResource ); + + // No local artifactId, and no fetch, should equal no metadata file downloaded / created / updated. + assertResourceNotFound( requestedResource ); + } + + public void testGetGroupMetadataNotProxiedOnLocal() + throws Exception + { + // Project metadata that exists and has multiple versions + String requestedResource = "org/apache/maven/test/groups/get-project-metadata/maven-metadata.xml"; + setupTestableManagedRepository( requestedResource ); + + assertResourceExists( requestedResource ); + + // No proxy setup, nothing fetched from remote, but local exists. + assertFetchProjectOrGroup( requestedResource ); + + // Nothing fetched. Should only contain contents of what is in the repository. + // A metadata update is not performed in this use case. Local metadata content is only + // updated via the metadata updater consumer. + assertGroupMetadataContents( requestedResource, new String[] { "plugin1" } ); + } + + public void testGetGroupMetadataProxiedNotLocalMultipleRemotes() + throws Exception + { + // Project metadata that does not exist locally, but has multiple versions in remote repos + String requestedResource = "org/apache/maven/test/groups/get-default-layout/maven-metadata.xml"; + setupTestableManagedRepository( requestedResource ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + + assertResourceNotFound( requestedResource ); + assertNoRepoMetadata( ID_PROXIED1, requestedResource ); + assertNoRepoMetadata( ID_PROXIED2, requestedResource ); + + // Two proxies setup, metadata fetched from both remotes. + assertFetchProjectOrGroup( requestedResource ); + + // Nothing fetched. Should only contain contents of what is in the repository. + assertGroupMetadataContents( requestedResource, new String[] { "plugin2", "plugin1" } ); + assertRepoGroupMetadataContents( ID_PROXIED1, requestedResource, new String[] { "plugin1" } ); + assertRepoGroupMetadataContents( ID_PROXIED2, requestedResource, new String[] { "plugin2" } ); + } + + public void testGetGroupsMetadataProxiedNotLocalNotRemote() + throws Exception + { + // Non-existant project metadata that does not exist locally and doesn't exist on remotes. + String requestedResource = "org/apache/maven/test/groups/get-bogus-artifact/maven-metadata.xml"; + setupTestableManagedRepository( requestedResource ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + + assertResourceNotFound( requestedResource ); + assertNoRepoMetadata( ID_PROXIED1, requestedResource ); + assertNoRepoMetadata( ID_PROXIED2, requestedResource ); + + // Two proxies setup, nothing fetched from remotes, local does not exist. + assertFetchProjectOrGroupFailed( requestedResource ); + + // Nothing fetched. Nothing should exist. + assertResourceNotFound( requestedResource ); + assertNoRepoMetadata( ID_PROXIED1, requestedResource ); + assertNoRepoMetadata( ID_PROXIED2, requestedResource ); + } + + public void testGetGroupMetadataProxiedNotLocalOnRemote() + throws Exception + { + // New project metadata that does not exist locally but exists on remote. + String requestedResource = "org/apache/maven/test/groups/get-found-in-proxy/maven-metadata.xml"; + setupTestableManagedRepository( requestedResource ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + + assertResourceNotFound( requestedResource ); + assertNoRepoMetadata( ID_PROXIED1, requestedResource ); + + // One proxy setup, metadata fetched from remote, local does not exist. + assertFetchProjectOrGroup( requestedResource ); + + // Remote fetched. Local created/updated. + assertGroupMetadataContents( requestedResource, new String[] { "plugin3" } ); + assertRepoGroupMetadataContents( ID_PROXIED1, requestedResource, new String[] { "plugin3" } ); + } + + public void testGetGroupMetadataProxiedOnLocalMultipleRemote() + throws Exception + { + // Project metadata that exist locally, and has multiple versions in remote repos + String requestedResource = "org/apache/maven/test/groups/get-on-multiple-repos/maven-metadata.xml"; + setupTestableManagedRepository( requestedResource ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + + assertGroupMetadataContents( requestedResource, new String[] { "plugin1" } ); + assertNoRepoMetadata( ID_PROXIED1, requestedResource ); + assertNoRepoMetadata( ID_PROXIED2, requestedResource ); + + // Two proxies setup, metadata fetched from both remotes. + assertFetchProjectOrGroup( requestedResource ); + + // metadata fetched from both repos, and merged with local version. + assertGroupMetadataContents( requestedResource, new String[] { "plugin1", "plugin2", "plugin4" } ); + assertRepoGroupMetadataContents( ID_PROXIED1, requestedResource, new String[] { "plugin1", "plugin4" } ); + assertRepoGroupMetadataContents( ID_PROXIED2, requestedResource, new String[] { "plugin1", "plugin2" } ); + } + + public void testGetGroupMetadataProxiedOnLocalNotRemote() + throws Exception + { + // Project metadata that exist locally, and does not exist in remote repos. + String requestedResource = "org/apache/maven/test/groups/get-not-on-remotes/maven-metadata.xml"; + setupTestableManagedRepository( requestedResource ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + + assertGroupMetadataContents( requestedResource, new String[] { "plugin5" } ); + assertNoRepoMetadata( ID_PROXIED1, requestedResource ); + assertNoRepoMetadata( ID_PROXIED2, requestedResource ); + + // Two proxies setup, metadata fetch from remotes fail (because they dont exist). + assertFetchProjectOrGroup( requestedResource ); + + // metadata not fetched from both repos, and local version exists. + // Since there was no updated metadata content from a remote/proxy, a metadata update on + // the local file never ran. Local only updates are performed via the metadata updater consumer. + assertGroupMetadataContents( requestedResource, new String[] { "plugin5" } ); + assertNoRepoMetadata( ID_PROXIED1, requestedResource ); + assertNoRepoMetadata( ID_PROXIED2, requestedResource ); + } + + public void testGetGroupMetadataProxiedOnLocalOnRemote() + throws Exception + { + // Project metadata that exist locally and exists on remote. + String requestedResource = "org/apache/maven/test/groups/get-on-local-on-remote/maven-metadata.xml"; + setupTestableManagedRepository( requestedResource ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO ); + + assertGroupMetadataContents( requestedResource, new String[] { "plugin6", "plugin7" } ); + assertNoRepoMetadata( ID_PROXIED1, requestedResource ); + + // One proxy setup, metadata fetched from remote, local exists. + assertFetchProjectOrGroup( requestedResource ); + + // Remote fetched. Local updated. + assertGroupMetadataContents( requestedResource, new String[] { "plugin6", "plugin7", "plugin4" } ); + assertRepoGroupMetadataContents( ID_PROXIED1, requestedResource, new String[] { "plugin7", "plugin4" } ); + } + + /** + * Transfer the metadata file. + * + * @param requestedResource the requested resource + * @throws Exception + */ + private void assertFetchProjectOrGroup( String requestedResource ) + throws Exception + { + File expectedFile = new File( managedDefaultDir, requestedResource ); + + ProjectReference metadata = createProjectReference( requestedResource ); + + File downloadedFile = proxyHandler.fetchMetatadaFromProxies( managedDefaultRepository, managedDefaultRepository.toMetadataPath(metadata) ); + + assertNotNull( "Should have downloaded a file.", downloadedFile ); + assertNoTempFiles( expectedFile ); + } + + private ProjectReference createProjectReference( String path ) + throws RepositoryMetadataException + { + return metadataTools.toProjectReference( path ); + } + + /** + * Transfer the metadata file, not expected to succeed. + * + * @param requestedResource the requested resource + * @throws Exception + */ + private void assertFetchProjectOrGroupFailed( String requestedResource ) + throws Exception + { + File expectedFile = new File( managedDefaultDir, requestedResource ); + ProjectReference metadata = createProjectReference( requestedResource ); + + File downloadedFile = proxyHandler.fetchMetatadaFromProxies( managedDefaultRepository, managedDefaultRepository.toMetadataPath(metadata) ); + + assertNull( downloadedFile ); + assertNoTempFiles( expectedFile ); + } + + /** + * Transfer the metadata file. + * + * @param requestedResource the requested resource + * @throws Exception + */ + private void assertFetchVersioned( String requestedResource ) + throws Exception + { + File expectedFile = new File( managedDefaultDir, requestedResource ); + + VersionedReference metadata = createVersionedReference( requestedResource ); + + File downloadedFile = proxyHandler.fetchMetatadaFromProxies( managedDefaultRepository, managedDefaultRepository.toMetadataPath(metadata) ); + + assertNotNull( "Should have downloaded a file.", downloadedFile ); + assertNoTempFiles( expectedFile ); + } + + private VersionedReference createVersionedReference( String path ) + throws RepositoryMetadataException + { + return metadataTools.toVersionedReference( path ); + } + + /** + * Transfer the metadata file, not expected to succeed. + * + * @param requestedResource the requested resource + * @throws Exception + */ + private void assertFetchVersionedFailed( String requestedResource ) + throws Exception + { + File expectedFile = new File( managedDefaultDir, requestedResource ); + VersionedReference metadata = createVersionedReference( requestedResource ); + + File downloadedFile = proxyHandler.fetchMetatadaFromProxies( managedDefaultRepository, managedDefaultRepository.toMetadataPath(metadata) ); + + assertNull( downloadedFile ); + assertNoTempFiles( expectedFile ); + } + + /** + * Test for the existance of the requestedResource in the default managed repository. + * + * @param requestedResource the requested resource + * @throws Exception + */ + private void assertResourceExists( String requestedResource ) + throws Exception + { + File actualFile = new File( managedDefaultDir, requestedResource ); + assertTrue( "Resource should exist: " + requestedResource, actualFile.exists() ); + } + + private void assertMetadataEquals( String expectedMetadataXml, File actualFile ) + throws Exception + { + assertNotNull( "Actual File should not be null.", actualFile ); + + assertTrue( "Actual file exists.", actualFile.exists() ); + + StringWriter actualContents = new StringWriter(); + ArchivaRepositoryMetadata metadata = RepositoryMetadataReader.read( actualFile ); + RepositoryMetadataWriter.write( metadata, actualContents ); + + DetailedDiff detailedDiff = new DetailedDiff( new Diff( expectedMetadataXml, actualContents.toString() ) ); + if ( !detailedDiff.similar() ) + { + assertEquals( expectedMetadataXml, actualContents ); + } + + // assertEquals( "Check file contents.", expectedMetadataXml, actualContents ); + } + + /** + * Ensures that the requested resource is not present in the managed repository. + * + * @param requestedResource the requested resource + * @throws Exception + */ + private void assertNoMetadata( String requestedResource ) + throws Exception + { + File expectedFile = new File( managedDefaultDir, requestedResource ); + assertFalse( "metadata should not exist: " + expectedFile, expectedFile.exists() ); + } + + /** + * Ensures that the proxied repository specific maven metadata file does NOT exist in the + * managed repository. + * @param proxiedRepoId the proxied repository id to validate with. + * @param requestedResource the resource requested. + */ + private void assertNoRepoMetadata( String proxiedRepoId, String requestedResource ) + { + String proxiedFile = metadataTools.getRepositorySpecificName( proxiedRepoId, requestedResource ); + + File actualFile = new File( managedDefaultDir, proxiedFile ); + assertFalse( "Repo specific metadata should not exist: " + actualFile, actualFile.exists() ); + } + + private void assertGroupMetadataContents( String requestedResource, String expectedPlugins[] ) + throws Exception + { + File actualFile = new File( managedDefaultDir, requestedResource ); + assertTrue( "Snapshot Metadata should exist: " + requestedResource, actualFile.exists() ); + + ProjectReference actualMetadata = createGroupReference( requestedResource ); + + assertGroupMetadata( actualFile, actualMetadata, expectedPlugins ); + } + + private ProjectReference createGroupReference( String requestedResource ) + throws RepositoryMetadataException + { + ProjectReference projectReference = createProjectReference( requestedResource ); + projectReference.setGroupId( projectReference.getGroupId() + "." + projectReference.getArtifactId() ); + projectReference.setArtifactId( null ); + return projectReference; + } + + private void assertRepoGroupMetadataContents( String proxiedRepoId, String requestedResource, + String expectedPlugins[] ) + throws Exception + { + String proxiedFile = metadataTools.getRepositorySpecificName( proxiedRepoId, requestedResource ); + + File actualFile = new File( managedDefaultDir, proxiedFile ); + assertTrue( "Repo Specific Group Metadata should exist: " + requestedResource, actualFile.exists() ); + + ProjectReference actualMetadata = createGroupReference( requestedResource ); + + assertGroupMetadata( actualFile, actualMetadata, expectedPlugins ); + } + + private void assertGroupMetadata( File actualFile, ProjectReference actualMetadata, String expectedPlugins[] ) + throws Exception + { + // Build expected metadata XML + StringWriter expectedMetadataXml = new StringWriter(); + ArchivaRepositoryMetadata m = new ArchivaRepositoryMetadata(); + m.setGroupId( actualMetadata.getGroupId() ); + + for ( String pluginId : expectedPlugins ) + { + Plugin p = new Plugin(); + p.setPrefix( pluginId ); + p.setArtifactId( pluginId + "-maven-plugin" ); + p.setName( "The " + pluginId + " Plugin" ); + m.getPlugins().add( p ); + } + + m.setModelEncoding( null ); + RepositoryMetadataWriter.write( m, expectedMetadataXml ); + + // Compare the file to the actual contents. + assertMetadataEquals( expectedMetadataXml.toString(), actualFile ); + } + + /** + * Test for the existance of the requestedResource in the default managed repository, and if it exists, + * does it contain the specified list of expected versions? + * + * @param requestedResource the requested resource + * @throws Exception + */ + private void assertProjectMetadataContents( String requestedResource, String expectedVersions[], + String latestVersion, String releaseVersion ) + throws Exception + { + File actualFile = new File( managedDefaultDir, requestedResource ); + assertTrue( actualFile.exists() ); + + ProjectReference metadata = createProjectReference( requestedResource ); + + // Build expected metadata XML + StringWriter expectedMetadataXml = new StringWriter(); + ArchivaRepositoryMetadata m = new ArchivaRepositoryMetadata(); + m.setGroupId( metadata.getGroupId() ); + m.setArtifactId( metadata.getArtifactId() ); + m.setLatestVersion( latestVersion ); + m.setReleasedVersion( releaseVersion ); + + if ( expectedVersions != null ) + { + m.getAvailableVersions().addAll( Arrays.asList( expectedVersions ) ); + } + + m.setModelEncoding( null ); + RepositoryMetadataWriter.write( m, expectedMetadataXml ); + + // Compare the file to the actual contents. + assertMetadataEquals( expectedMetadataXml.toString(), actualFile ); + } + + /** + * Test for the existance of the requestedResource in the default managed repository, and if it exists, + * does it contain the expected release maven-metadata.xml contents? + * + * @param requestedResource the requested resource + * @throws Exception + */ + private void assertReleaseMetadataContents( String requestedResource ) + throws Exception + { + File actualFile = new File( managedDefaultDir, requestedResource ); + assertTrue( "Release Metadata should exist: " + requestedResource, actualFile.exists() ); + + VersionedReference metadata = createVersionedReference( requestedResource ); + + // Build expected metadata XML + StringWriter expectedMetadataXml = new StringWriter(); + ArchivaRepositoryMetadata m = new ArchivaRepositoryMetadata(); + m.setGroupId( metadata.getGroupId() ); + m.setArtifactId( metadata.getArtifactId() ); + m.setVersion( metadata.getVersion() ); + m.setModelEncoding( null ); + RepositoryMetadataWriter.write( m, expectedMetadataXml ); + + // Compare the file to the actual contents. + assertMetadataEquals( expectedMetadataXml.toString(), actualFile ); + } + + /** + * Test for the existance of the snapshot metadata in the default managed repository, and if it exists, + * does it contain the expected release maven-metadata.xml contents? + * + * @param requestedResource the requested resource + * @param expectedDate the date in "yyyyMMdd" format + * @param expectedTime the time in "hhmmss" format + * @param expectedBuildnumber the build number + * + * @throws Exception + */ + private void assertSnapshotMetadataContents( String requestedResource, String expectedDate, String expectedTime, + int expectedBuildnumber ) + throws Exception + { + File actualFile = new File( managedDefaultDir, requestedResource ); + assertTrue( "Snapshot Metadata should exist: " + requestedResource, actualFile.exists() ); + + VersionedReference actualMetadata = createVersionedReference( requestedResource ); + + assertSnapshotMetadata( actualFile, actualMetadata, expectedDate, expectedTime, expectedBuildnumber ); + } + + /** + * Test for the existance of the proxied repository specific snapshot metadata in the default managed + * repository, and if it exists, does it contain the expected release maven-metadata.xml contents? + * + * @param proxiedRepoId the repository id of the proxied repository. + * @param requestedResource the requested resource + * @param expectedDate the date in "yyyyMMdd" format + * @param expectedTime the time in "hhmmss" format + * @param expectedBuildnumber the build number + * + * @throws Exception + */ + private void assertRepoSnapshotMetadataContents( String proxiedRepoId, String requestedResource, + String expectedDate, String expectedTime, int expectedBuildnumber ) + throws Exception + { + String proxiedFile = metadataTools.getRepositorySpecificName( proxiedRepoId, requestedResource ); + + File actualFile = new File( managedDefaultDir, proxiedFile ); + assertTrue( "Repo Specific Snapshot Metadata should exist: " + requestedResource, actualFile.exists() ); + + VersionedReference actualMetadata = createVersionedReference( requestedResource ); + + assertSnapshotMetadata( actualFile, actualMetadata, expectedDate, expectedTime, expectedBuildnumber ); + } + + private void assertSnapshotMetadata( File actualFile, VersionedReference actualMetadata, String expectedDate, + String expectedTime, int expectedBuildnumber ) + throws RepositoryMetadataException, Exception + { + // Build expected metadata XML + StringWriter expectedMetadataXml = new StringWriter(); + ArchivaRepositoryMetadata m = new ArchivaRepositoryMetadata(); + m.setGroupId( actualMetadata.getGroupId() ); + m.setArtifactId( actualMetadata.getArtifactId() ); + m.setVersion( VersionUtil.getBaseVersion( actualMetadata.getVersion() ) ); + + m.setSnapshotVersion( new SnapshotVersion() ); + + if ( StringUtils.isNotBlank( expectedDate ) && StringUtils.isNotBlank( expectedTime ) ) + { + m.getSnapshotVersion().setTimestamp( expectedDate + "." + expectedTime ); + } + + m.getSnapshotVersion().setBuildNumber( expectedBuildnumber ); + + m.setLastUpdated( expectedDate + expectedTime ); + + m.setModelEncoding( null ); + RepositoryMetadataWriter.write( m, expectedMetadataXml ); + + // Compare the file to the actual contents. + assertMetadataEquals( expectedMetadataXml.toString(), actualFile ); + } + + /** + * Ensures that the repository specific maven metadata file exists, and contains the appropriate + * list of expected versions within. + * @param proxiedRepoId + * @param requestedResource + * @param expectedProxyVersions + */ + private void assertRepoProjectMetadata( String proxiedRepoId, String requestedResource, + String[] expectedProxyVersions ) + throws Exception + { + String proxiedFile = metadataTools.getRepositorySpecificName( proxiedRepoId, requestedResource ); + + File actualFile = new File( managedDefaultDir, proxiedFile ); + assertTrue( actualFile.exists() ); + + ProjectReference metadata = createProjectReference( requestedResource ); + + // Build expected metadata XML + StringWriter expectedMetadataXml = new StringWriter(); + ArchivaRepositoryMetadata m = new ArchivaRepositoryMetadata(); + m.setGroupId( metadata.getGroupId() ); + m.setArtifactId( metadata.getArtifactId() ); + + if ( expectedProxyVersions != null ) + { + m.getAvailableVersions().addAll( Arrays.asList( expectedProxyVersions ) ); + } + + m.setModelEncoding( null ); + RepositoryMetadataWriter.write( m, expectedMetadataXml ); + + // Compare the file to the actual contents. + assertMetadataEquals( expectedMetadataXml.toString(), actualFile ); + } + + /** + * Ensures that the repository specific maven metadata file exists, and contains the appropriate + * list of expected versions within. + * + * @param proxiedRepoId + * @param requestedResource + */ + private void assertRepoReleaseMetadataContents( String proxiedRepoId, String requestedResource ) + throws Exception + { + String proxiedFile = metadataTools.getRepositorySpecificName( proxiedRepoId, requestedResource ); + + File actualFile = new File( managedDefaultDir, proxiedFile ); + assertTrue( "Release metadata for repo should exist: " + actualFile, actualFile.exists() ); + + VersionedReference metadata = createVersionedReference( requestedResource ); + + // Build expected metadata XML + StringWriter expectedMetadataXml = new StringWriter(); + ArchivaRepositoryMetadata m = new ArchivaRepositoryMetadata(); + m.setGroupId( metadata.getGroupId() ); + m.setArtifactId( metadata.getArtifactId() ); + m.setVersion( metadata.getVersion() ); + m.setModelEncoding( null ); + RepositoryMetadataWriter.write( m, expectedMetadataXml ); + + // Compare the file to the actual contents. + assertMetadataEquals( expectedMetadataXml.toString(), actualFile ); + } + + /** + * Test for the non-existance of the requestedResource in the default managed repository. + * + * @param requestedResource the requested resource + * @throws Exception + */ + private void assertResourceNotFound( String requestedResource ) + throws Exception + { + File actualFile = new File( managedDefaultDir, requestedResource ); + assertFalse( "Resource should not exist: " + requestedResource, actualFile.exists() ); + } + + protected void setUp() + throws Exception + { + super.setUp(); + + metadataTools = (MetadataTools) lookup( MetadataTools.class ); + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/MockConfiguration.java b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/MockConfiguration.java new file mode 100644 index 000000000..32d3ee3a6 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/MockConfiguration.java @@ -0,0 +1,105 @@ +package org.apache.maven.archiva.proxy; + +/* + * 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.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.Configuration; +import org.apache.maven.archiva.configuration.ConfigurationListener; +import org.codehaus.plexus.registry.Registry; +import org.codehaus.plexus.registry.RegistryException; +import org.codehaus.plexus.registry.RegistryListener; +import org.easymock.MockControl; + +import java.util.HashSet; +import java.util.Set; + +/** + * MockConfiguration + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component role="org.apache.maven.archiva.configuration.ArchivaConfiguration" + * role-hint="mock" + */ +public class MockConfiguration + implements ArchivaConfiguration +{ + private Configuration configuration = new Configuration(); + + private Set registryListeners = new HashSet(); + private Set configListeners = new HashSet(); + + private MockControl registryControl; + + private Registry registryMock; + + public MockConfiguration() + { + registryControl = MockControl.createNiceControl( Registry.class ); + registryMock = (Registry) registryControl.getMock(); + } + + public void addChangeListener( RegistryListener listener ) + { + registryListeners.add( listener ); + } + + public Configuration getConfiguration() + { + return configuration; + } + + public void save( Configuration configuration ) + throws RegistryException + { + /* do nothing */ + } + + public void triggerChange( String name, String value ) + { + for(RegistryListener listener: registryListeners) + { + try + { + listener.afterConfigurationChange( registryMock, name, value ); + } + catch ( Exception e ) + { + e.printStackTrace(); + } + } + } + + public void addListener( ConfigurationListener listener ) + { + configListeners.add(listener); + } + + public void removeListener( ConfigurationListener listener ) + { + configListeners.remove( listener ); + } + + public boolean isDefaulted() + { + return false; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/SnapshotTransferTest.java b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/SnapshotTransferTest.java new file mode 100644 index 000000000..23a36e6c2 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/SnapshotTransferTest.java @@ -0,0 +1,314 @@ +package org.apache.maven.archiva.proxy; + +/* + * 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.archiva.model.ArtifactReference; +import org.apache.maven.archiva.policies.CachedFailuresPolicy; +import org.apache.maven.archiva.policies.ChecksumPolicy; +import org.apache.maven.archiva.policies.ReleasesPolicy; +import org.apache.maven.archiva.policies.SnapshotsPolicy; + +import java.io.File; + +/** + * SnapshotTransferTest + * + * @author Brett Porter + * @author Joakim Erdfelt + * @version $Id$ + */ +public class SnapshotTransferTest + extends AbstractProxyTestCase +{ + public void testSnapshotNonExistant() + throws Exception + { + String path = "org/apache/maven/test/does-not-exist/1.0-SNAPSHOT/does-not-exist-1.0-SNAPSHOT.jar"; + setupTestableManagedRepository( path ); + + File expectedFile = new File( managedDefaultDir, path ); + ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + + expectedFile.delete(); + assertFalse( expectedFile.exists() ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1); + + File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact ); + assertNotDownloaded( downloadedFile ); + assertNoTempFiles( expectedFile ); + } + + public void testTimestampDrivenSnapshotNotPresentAlready() + throws Exception + { + String path = "org/apache/maven/test/get-timestamped-snapshot/1.0-SNAPSHOT/get-timestamped-snapshot-1.0-SNAPSHOT.jar"; + setupTestableManagedRepository( path ); + + File expectedFile = new File( managedDefaultDir, path ); + ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + + expectedFile.delete(); + assertFalse( expectedFile.exists() ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1); + + File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact ); + + File proxiedFile = new File( REPOPATH_PROXIED1, path ); + assertFileEquals( expectedFile, downloadedFile, proxiedFile ); + assertNoTempFiles( expectedFile ); + } + + public void testNewerTimestampDrivenSnapshotOnFirstRepo() + throws Exception + { + String path = "org/apache/maven/test/get-present-timestamped-snapshot/1.0-SNAPSHOT/get-present-timestamped-snapshot-1.0-SNAPSHOT.jar"; + setupTestableManagedRepository( path ); + + File expectedFile = new File( managedDefaultDir, path ); + ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + + assertTrue( expectedFile.exists() ); + expectedFile.setLastModified( getPastDate().getTime() ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1); + + File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact ); + + File proxiedFile = new File( REPOPATH_PROXIED1, path ); + assertFileEquals( expectedFile, downloadedFile, proxiedFile ); + assertNoTempFiles( expectedFile ); + } + + public void testOlderTimestampDrivenSnapshotOnFirstRepo() + throws Exception + { + String path = "org/apache/maven/test/get-present-timestamped-snapshot/1.0-SNAPSHOT/get-present-timestamped-snapshot-1.0-SNAPSHOT.jar"; + setupTestableManagedRepository( path ); + + File expectedFile = new File( managedDefaultDir, path ); + File remoteFile = new File( REPOPATH_PROXIED1, path ); + + setManagedNewerThanRemote( expectedFile, remoteFile ); + + ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1 ); + + // Attempt to download. + File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact ); + + // Should not have downloaded as managed is newer than remote. + assertNotDownloaded( downloadedFile ); + assertNoTempFiles( expectedFile ); + } + + /** + * TODO: Has problems with wagon implementation not preserving timestamp. + */ + /* + public void testNewerTimestampDrivenSnapshotOnSecondRepoThanFirstNotPresentAlready() + throws Exception + { + String path = "org/apache/maven/test/get-timestamped-snapshot-in-both/1.0-SNAPSHOT/get-timestamped-snapshot-in-both-1.0-SNAPSHOT.jar"; + setupTestableManagedRepository( path ); + + File expectedFile = new File( managedDefaultDir, path ); + ArtifactReference artifact = createArtifactReference( "default", path ); + + expectedFile.delete(); + assertFalse( expectedFile.exists() ); + + // Create customized proxy / target repository + File targetProxyDir = saveTargetedRepositoryConfig( ID_PROXIED1_TARGET, REPOPATH_PROXIED1, + REPOPATH_PROXIED1_TARGET, "default" ); + + new File( targetProxyDir, path ).setLastModified( getPastDate().getTime() ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1_TARGET, ChecksumPolicy.IGNORED, ReleasesPolicy.IGNORED, + SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED ); + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.IGNORED, ReleasesPolicy.IGNORED, + SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED ); + + File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact ); + + // Should have downloaded the content from proxy2, as proxy1 has an old (by file.lastModified check) version. + File proxiedFile = new File( REPOPATH_PROXIED2, path ); + assertFileEquals( expectedFile, downloadedFile, proxiedFile ); + assertNoTempFiles( expectedFile ); + } + + public void testOlderTimestampDrivenSnapshotOnSecondRepoThanFirstNotPresentAlready() + throws Exception + { + String path = "org/apache/maven/test/get-timestamped-snapshot-in-both/1.0-SNAPSHOT/get-timestamped-snapshot-in-both-1.0-SNAPSHOT.jar"; + setupTestableManagedRepository( path ); + + File expectedFile = new File( managedDefaultDir, path ); + ArtifactReference artifact = createArtifactReference( "default", path ); + + expectedFile.delete(); + assertFalse( expectedFile.exists() ); + + // Create customized proxy / target repository + File targetProxyDir = saveTargetedRepositoryConfig( ID_PROXIED2_TARGET, REPOPATH_PROXIED2, + REPOPATH_PROXIED2_TARGET, "default" ); + + new File( targetProxyDir, path ).setLastModified( getPastDate().getTime() ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.IGNORED, ReleasesPolicy.IGNORED, + SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED ); + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2_TARGET, ChecksumPolicy.IGNORED, ReleasesPolicy.IGNORED, + SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED ); + + File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact ); + + File proxiedFile = new File( REPOPATH_PROXIED1_TARGET, path ); + assertFileEquals( expectedFile, downloadedFile, proxiedFile ); + assertNoTempFiles( expectedFile ); + } */ + + public void testTimestampDrivenSnapshotNotExpired() + throws Exception + { + String path = "org/apache/maven/test/get-present-timestamped-snapshot/1.0-SNAPSHOT/get-present-timestamped-snapshot-1.0-SNAPSHOT.jar"; + setupTestableManagedRepository( path ); + + File expectedFile = new File( managedDefaultDir, path ); + ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + + assertTrue( expectedFile.exists() ); + + File proxiedFile = new File( REPOPATH_PROXIED1, path ); + proxiedFile.setLastModified( getFutureDate().getTime() ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1); + + File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact ); + + assertFileEquals( expectedFile, downloadedFile, proxiedFile ); + assertNoTempFiles( expectedFile ); + } + + public void testTimestampDrivenSnapshotNotUpdated() + throws Exception + { + String path = "org/apache/maven/test/get-present-timestamped-snapshot/1.0-SNAPSHOT/get-present-timestamped-snapshot-1.0-SNAPSHOT.jar"; + setupTestableManagedRepository( path ); + + File expectedFile = new File( managedDefaultDir, path ); + File remoteFile = new File( REPOPATH_PROXIED1, path ); + + setManagedNewerThanRemote( expectedFile, remoteFile ); + long expectedTimestamp = expectedFile.lastModified(); + + ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1); + + File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact ); + + assertNotDownloaded( downloadedFile ); + assertNotModified( expectedFile, expectedTimestamp ); + assertNoTempFiles( expectedFile ); + } + + public void testTimestampDrivenSnapshotNotPresentAlreadyExpiredCacheFailure() + throws Exception + { + String path = "org/apache/maven/test/get-timestamped-snapshot/1.0-SNAPSHOT/get-timestamped-snapshot-1.0-SNAPSHOT.jar"; + setupTestableManagedRepository( path ); + + File expectedFile = new File( managedDefaultDir, path ); + ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + + expectedFile.delete(); + assertFalse( expectedFile.exists() ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.IGNORE, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.YES ); + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.IGNORE, ReleasesPolicy.ALWAYS, + SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.YES ); + + File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact ); + + File proxiedFile = new File( REPOPATH_PROXIED1, path ); + assertFileEquals( expectedFile, downloadedFile, proxiedFile ); + assertNoTempFiles( expectedFile ); + } + + public void testMetadataDrivenSnapshotNotPresentAlready() + throws Exception + { + String path = "org/apache/maven/test/get-metadata-snapshot/1.0-SNAPSHOT/get-metadata-snapshot-1.0-20050831.101112-1.jar"; + setupTestableManagedRepository( path ); + + File expectedFile = new File( managedDefaultDir, path ); + ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + + expectedFile.delete(); + assertFalse( expectedFile.exists() ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1); + + File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact ); + + File proxiedFile = new File( REPOPATH_PROXIED1, path ); + assertFileEquals( expectedFile, downloadedFile, proxiedFile ); + assertNoTempFiles( expectedFile ); + } + + public void testGetMetadataDrivenSnapshotRemoteUpdate() + throws Exception + { + // Metadata driven snapshots (using a full timestamp) are treated like a release. It is the timing of the + // updates to the metadata files that triggers which will be downloaded + + String path = "org/apache/maven/test/get-present-metadata-snapshot/1.0-SNAPSHOT/get-present-metadata-snapshot-1.0-20050831.101112-1.jar"; + setupTestableManagedRepository( path ); + + File expectedFile = new File( managedDefaultDir, path ); + ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path ); + + assertTrue( expectedFile.exists() ); + + expectedFile.setLastModified( getPastDate().getTime() ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1); + + File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact ); + + File proxiedFile = new File( REPOPATH_PROXIED1, path ); + assertFileEquals( expectedFile, downloadedFile, proxiedFile ); + assertNoTempFiles( expectedFile ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/WagonDelegate.java b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/WagonDelegate.java new file mode 100644 index 000000000..9f2c8d2ff --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/WagonDelegate.java @@ -0,0 +1,244 @@ +package org.apache.maven.archiva.proxy; + +/* + * 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; +import java.io.IOException; +import java.util.List; + +import org.apache.commons.io.FileUtils; +import org.apache.maven.wagon.ConnectionException; +import org.apache.maven.wagon.ResourceDoesNotExistException; +import org.apache.maven.wagon.TransferFailedException; +import org.apache.maven.wagon.Wagon; +import org.apache.maven.wagon.authentication.AuthenticationException; +import org.apache.maven.wagon.authentication.AuthenticationInfo; +import org.apache.maven.wagon.authorization.AuthorizationException; +import org.apache.maven.wagon.events.SessionListener; +import org.apache.maven.wagon.events.TransferListener; +import org.apache.maven.wagon.proxy.ProxyInfo; +import org.apache.maven.wagon.proxy.ProxyInfoProvider; +import org.apache.maven.wagon.repository.Repository; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * A dummy wagon implementation + * + * @author Brett Porter + */ +public class WagonDelegate + implements Wagon +{ + private Logger log = LoggerFactory.getLogger( WagonDelegate.class ); + + private Wagon delegate; + + private String contentToGet; + + public void get( String resourceName, File destination ) + throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException + { + log.debug( ".get(" + resourceName + ", " + destination + ")" ); + delegate.get( resourceName, destination ); + create( destination ); + } + + public boolean getIfNewer( String resourceName, File destination, long timestamp ) + throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException + { + log.info( ".getIfNewer(" + resourceName + ", " + destination + ", " + timestamp + ")" ); + + boolean result = delegate.getIfNewer( resourceName, destination, timestamp ); + createIfMissing( destination ); + return result; + } + + public void put( File source, String destination ) + throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException + { + delegate.put( source, destination ); + } + + public void putDirectory( File sourceDirectory, String destinationDirectory ) + throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException + { + delegate.putDirectory( sourceDirectory, destinationDirectory ); + } + + public boolean resourceExists( String resourceName ) + throws TransferFailedException, AuthorizationException + { + return delegate.resourceExists( resourceName ); + } + + public List getFileList( String destinationDirectory ) + throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException + { + return delegate.getFileList( destinationDirectory ); + } + + public boolean supportsDirectoryCopy() + { + return delegate.supportsDirectoryCopy(); + } + + public void setTimeout(int val) + { + // ignore + } + + public int getTimeout() + { + return 0; + } + + public Repository getRepository() + { + return delegate.getRepository(); + } + + public void connect( Repository source ) + throws ConnectionException, AuthenticationException + { + delegate.connect( source ); + } + + public void connect( Repository source, ProxyInfo proxyInfo ) + throws ConnectionException, AuthenticationException + { + delegate.connect( source, proxyInfo ); + } + + public void connect( Repository source, ProxyInfoProvider proxyInfoProvider ) + throws ConnectionException, AuthenticationException + { + delegate.connect( source, proxyInfoProvider ); + } + + public void connect( Repository source, AuthenticationInfo authenticationInfo ) + throws ConnectionException, AuthenticationException + { + delegate.connect( source, authenticationInfo ); + } + + public void connect( Repository source, AuthenticationInfo authenticationInfo, ProxyInfo proxyInfo ) + throws ConnectionException, AuthenticationException + { + delegate.connect( source, authenticationInfo, proxyInfo ); + } + + public void connect( Repository source, AuthenticationInfo authenticationInfo, ProxyInfoProvider proxyInfoProvider ) + throws ConnectionException, AuthenticationException + { + delegate.connect( source, authenticationInfo, proxyInfoProvider ); + } + + public void openConnection() + throws ConnectionException, AuthenticationException + { + delegate.openConnection(); + } + + public void disconnect() + throws ConnectionException + { + delegate.disconnect(); + } + + public void addSessionListener( SessionListener listener ) + { + delegate.addSessionListener( listener ); + } + + public void removeSessionListener( SessionListener listener ) + { + delegate.removeSessionListener( listener ); + } + + public boolean hasSessionListener( SessionListener listener ) + { + return delegate.hasSessionListener( listener ); + } + + public void addTransferListener( TransferListener listener ) + { + delegate.addTransferListener( listener ); + } + + public void removeTransferListener( TransferListener listener ) + { + delegate.removeTransferListener( listener ); + } + + public boolean hasTransferListener( TransferListener listener ) + { + return delegate.hasTransferListener( listener ); + } + + public boolean isInteractive() + { + return delegate.isInteractive(); + } + + public void setInteractive( boolean interactive ) + { + delegate.setInteractive( interactive ); + } + + public void setDelegate( Wagon delegate ) + { + this.delegate = delegate; + } + + void setContentToGet( String content ) + { + contentToGet = content; + } + + private void createIfMissing( File destination ) + { + // since the mock won't actually copy a file, create an empty one to simulate file existence + if ( !destination.exists() ) + { + create( destination ); + } + } + + private void create( File destination ) + { + try + { + destination.getParentFile().mkdirs(); + if ( contentToGet == null ) + { + destination.createNewFile(); + } + else + { + FileUtils.writeStringToFile( new File( destination.getAbsolutePath() ), contentToGet, null ); + } + } + catch ( IOException e ) + { + throw new RuntimeException( e.getMessage(), e ); + } + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/WagonFactoryTest.java b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/WagonFactoryTest.java new file mode 100644 index 000000000..3e31f9ae7 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/WagonFactoryTest.java @@ -0,0 +1,43 @@ +package org.apache.maven.archiva.proxy; + +/* + * 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.wagon.Wagon; +import org.codehaus.plexus.spring.PlexusInSpringTestCase; + +/** + * Test the WagonFactory works through Spring to be bound into the RepositoryProxyConnectors implementation. + * + * @author Brett Porter + */ +public class WagonFactoryTest + extends PlexusInSpringTestCase +{ + public void testLookupSuccessiveWagons() + { + WagonFactory factory = (WagonFactory) lookup( WagonFactory.class ); + + Wagon first = factory.getWagon( "wagon#file" ); + + Wagon second = factory.getWagon( "wagon#file" ); + + assertNotSame( first, second ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/create-managed-to-proxy-map.sh b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/create-managed-to-proxy-map.sh new file mode 100755 index 000000000..ffaaa584b --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/create-managed-to-proxy-map.sh @@ -0,0 +1,60 @@ +#!/bin/bash + + +MYWD=`pwd` + +function makeListing() +{ + LISTID=$1 + + cd $MYWD/$LISTID + find . -type f -not -wholename "*/\.*" | sort > $MYWD/$LISTID.tmp +} + +function isInRepo() +{ + LISTID=$1 + FILEID=$2 + + grep -q "$FILEID" $MYWD/$LISTID.tmp + RETCODE=$? + if [ $RETCODE -eq 0 ] ; then + LISTID=${LISTID/proxied/} + echo "[${LISTID:0:1}]" + else + echo " " + fi +} + +makeListing "managed" +makeListing "proxied1" +makeListing "proxied2" + +cd $MYWD + +TS=`date` + +echo "$0 - executed on $TS" +echo "" +echo "Determining location of files." +echo " Key: [m] == managed" +echo " [1] == proxy 1 (proxied1)" +echo " [2] == proxy 2 (proxied2)" +echo "" +echo " -m- -1- -2- | -------------------------------------------- " + +FILELIST=`cat managed.tmp proxied1.tmp proxied2.tmp | sort -u` + +for FF in $FILELIST +do + INMANAGED=`isInRepo "managed" "$FF"` + INPROXY1=`isInRepo "proxied1" "$FF"` + INPROXY2=`isInRepo "proxied2" "$FF"` + + echo " $INMANAGED $INPROXY1 $INPROXY2 | $FF" +done + +echo " --- --- --- | -------------------------------------------- " + +rm -f managed.tmp proxied1.tmp proxied2.tmp + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/legacy-managed/org.apache.maven.test/jars/get-default-layout-present-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/legacy-managed/org.apache.maven.test/jars/get-default-layout-present-1.0.jar new file mode 100644 index 000000000..bf26f6b57 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/legacy-managed/org.apache.maven.test/jars/get-default-layout-present-1.0.jar @@ -0,0 +1,2 @@ +get-default-layout-present-1.0.jar +(managed) diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/legacy-managed/org.apache.maven.test/jars/get-default-layout-present-1.0.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/legacy-managed/org.apache.maven.test/jars/get-default-layout-present-1.0.jar.md5 new file mode 100644 index 000000000..b597d8ce4 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/legacy-managed/org.apache.maven.test/jars/get-default-layout-present-1.0.jar.md5 @@ -0,0 +1 @@ +7dfb7ade9a8fa90bfbfac52d3090b8c2 *get-default-layout-present-1.0.jar diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/legacy-managed/org.apache.maven.test/jars/managed-only-lib-2.1.jar b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/legacy-managed/org.apache.maven.test/jars/managed-only-lib-2.1.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/legacy-managed/org.apache.maven.test/poms/get-relocated-artefact-1.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/legacy-managed/org.apache.maven.test/poms/get-relocated-artefact-1.0.pom new file mode 100644 index 000000000..ae50586ec --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/legacy-managed/org.apache.maven.test/poms/get-relocated-artefact-1.0.pom @@ -0,0 +1,32 @@ + + + + 4.0.0 + org.apache.maven.test + get-relocated-artefact + 1.0 + + + + get-default-layout-present + + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/legacy-proxied/org.apache.maven.test/jars/example-lib-2.2.jar b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/legacy-proxied/org.apache.maven.test/jars/example-lib-2.2.jar new file mode 100644 index 000000000..059fd2a70 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/legacy-proxied/org.apache.maven.test/jars/example-lib-2.2.jar @@ -0,0 +1 @@ +(example jar found only in legacy proxy) diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/legacy-proxied/org.apache.maven.test/jars/get-default-layout-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/legacy-proxied/org.apache.maven.test/jars/get-default-layout-1.0.jar new file mode 100644 index 000000000..77dbb7858 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/legacy-proxied/org.apache.maven.test/jars/get-default-layout-1.0.jar @@ -0,0 +1 @@ +get-default-layout-1.0.jar diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/legacy-proxied/org.apache.maven.test/jars/get-default-layout-present-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/legacy-proxied/org.apache.maven.test/jars/get-default-layout-present-1.0.jar new file mode 100644 index 000000000..9f4121a86 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/legacy-proxied/org.apache.maven.test/jars/get-default-layout-present-1.0.jar @@ -0,0 +1,2 @@ +get-default-layout-present-1.0.jar +(proxied) diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/legacy-proxied/org.apache.maven.test/maven-plugins/example-maven-plugin-0.42.jar b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/legacy-proxied/org.apache.maven.test/maven-plugins/example-maven-plugin-0.42.jar new file mode 100644 index 000000000..2b7e3c5a0 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/legacy-proxied/org.apache.maven.test/maven-plugins/example-maven-plugin-0.42.jar @@ -0,0 +1 @@ +(example maven plugin v0.42 found only in legacy proxy) diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/legacy-proxied/org.apache.maven.test/plugins/get-legacy-plugin-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/legacy-proxied/org.apache.maven.test/plugins/get-legacy-plugin-1.0.jar new file mode 100644 index 000000000..77dbb7858 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/legacy-proxied/org.apache.maven.test/plugins/get-legacy-plugin-1.0.jar @@ -0,0 +1 @@ +get-default-layout-1.0.jar diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed-to-proxy-map.txt b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed-to-proxy-map.txt new file mode 100644 index 000000000..3b4967824 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed-to-proxy-map.txt @@ -0,0 +1,89 @@ +./create-managed-to-proxy-map.sh - executed on Wed Aug 29 18:17:23 MST 2007 + +Determining location of files. + Key: [m] == managed + [1] == proxy 1 (proxied1) + [2] == proxy 2 (proxied2) + + -m- -1- -2- | -------------------------------------------- + [m] [1] | ./org/apache/maven/test/get-bad-local-checksum/1.0/get-bad-local-checksum-1.0.jar + [m] | ./org/apache/maven/test/get-bad-local-checksum/1.0/get-bad-local-checksum-1.0.jar.md5 + [m] | ./org/apache/maven/test/get-bad-local-checksum/1.0/get-bad-local-checksum-1.0.jar.sha1 + [1] | ./org/apache/maven/test/get-checksum-both-bad/1.0/get-checksum-both-bad-1.0.jar + [1] | ./org/apache/maven/test/get-checksum-both-bad/1.0/get-checksum-both-bad-1.0.jar.md5 + [1] | ./org/apache/maven/test/get-checksum-both-bad/1.0/get-checksum-both-bad-1.0.jar.sha1 + [1] | ./org/apache/maven/test/get-checksum-both-right/1.0/get-checksum-both-right-1.0.jar + [1] | ./org/apache/maven/test/get-checksum-both-right/1.0/get-checksum-both-right-1.0.jar.md5 + [1] | ./org/apache/maven/test/get-checksum-both-right/1.0/get-checksum-both-right-1.0.jar.sha1 + [m] [1] | ./org/apache/maven/test/get-checksum-from-managed-repo/1.0/get-checksum-from-managed-repo-1.0.jar.sha1 + [1] | ./org/apache/maven/test/get-checksum-md5-bad-sha1/1.0/get-checksum-md5-bad-sha1-1.0.jar + [1] | ./org/apache/maven/test/get-checksum-md5-bad-sha1/1.0/get-checksum-md5-bad-sha1-1.0.jar.md5 + [1] | ./org/apache/maven/test/get-checksum-md5-bad-sha1/1.0/get-checksum-md5-bad-sha1-1.0.jar.sha1 + [1] | ./org/apache/maven/test/get-checksum-md5-only/1.0/get-checksum-md5-only-1.0.jar + [1] | ./org/apache/maven/test/get-checksum-md5-only/1.0/get-checksum-md5-only-1.0.jar.md5 + [1] | ./org/apache/maven/test/get-checksum-sha1-bad-md5/1.0/get-checksum-sha1-bad-md5-1.0.jar + [1] | ./org/apache/maven/test/get-checksum-sha1-bad-md5/1.0/get-checksum-sha1-bad-md5-1.0.jar.md5 + [1] | ./org/apache/maven/test/get-checksum-sha1-bad-md5/1.0/get-checksum-sha1-bad-md5-1.0.jar.sha1 + [1] | ./org/apache/maven/test/get-checksum-sha1-only/1.0/get-checksum-sha1-only-1.0.jar + [1] | ./org/apache/maven/test/get-checksum-sha1-only/1.0/get-checksum-sha1-only-1.0.jar.sha1 + [2] | ./org/apache/maven/test/get-default-layout/1.0.1/get-default-layout-1.0.1.pom + [1] [2] | ./org/apache/maven/test/get-default-layout/1.0/get-default-layout-1.0.jar + [1] [2] | ./org/apache/maven/test/get-default-layout/1.0/maven-metadata.xml + [1] [2] | ./org/apache/maven/test/get-default-layout/maven-metadata.xml + [m] [1] | ./org/apache/maven/test/get-default-layout-present/1.0/get-default-layout-present-1.0.jar + [m] | ./org/apache/maven/test/get-default-layout-present/1.0/get-default-layout-present-1.0.jar.md5 + [m] | ./org/apache/maven/test/get-default-layout-present-with-pom/1.0/get-default-layout-present-with-pom-1.0.jar + [m] | ./org/apache/maven/test/get-default-layout-present-with-pom/1.0/get-default-layout-present-with-pom-1.0.pom + [m] | ./org/apache/maven/test/get-default-metadata/1.0/get-default-metadata-1.0.jar + [m] [1] | ./org/apache/maven/test/get-default-metadata/1.0/maven-metadata.xml + [m] | ./org/apache/maven/test/get-doubly-relocated-artefact/1.0/get-doubly-relocated-artefact-1.0.pom + [1] | ./org/apache/maven/test/get-found-in-proxy/1.0.5/get-found-in-proxy-1.0.5-javadoc.jar + [1] | ./org/apache/maven/test/get-found-in-proxy/maven-metadata.xml + [1] [2] | ./org/apache/maven/test/get-in-both-proxies/1.0/get-in-both-proxies-1.0.jar + [2] | ./org/apache/maven/test/get-in-second-proxy/1.0/get-in-second-proxy-1.0.jar + [m] [1] [2] | ./org/apache/maven/test/get-merged-metadata/maven-metadata.xml + [1] | ./org/apache/maven/test/get-metadata-snapshot/1.0-SNAPSHOT/get-metadata-snapshot-1.0-20050831.101112-1.jar + [1] | ./org/apache/maven/test/get-metadata-snapshot/1.0-SNAPSHOT/maven-metadata.xml + [m] | ./org/apache/maven/test/get-not-on-remotes/1.0-beta-2/get-not-on-remotes-1.0-beta-2.jar + [m] | ./org/apache/maven/test/get-not-on-remotes/1.0-beta-2/maven-metadata.xml + [m] | ./org/apache/maven/test/get-not-on-remotes/maven-metadata.xml + [m] | ./org/apache/maven/test/get-on-local-on-remote/1.0.22/get-on-local-on-remote-1.0.22.pom + [m] [1] | ./org/apache/maven/test/get-on-local-on-remote/1.0.22/maven-metadata.xml + [m] | ./org/apache/maven/test/get-on-local-on-remote/1.0.8/get-on-local-on-remote-1.0.8.pom + [m] [1] | ./org/apache/maven/test/get-on-local-on-remote/maven-metadata.xml + [m] | ./org/apache/maven/test/get-on-multiple-repos/1.0/get-on-multiple-repos-1.0.pom + [m] [1] [2] | ./org/apache/maven/test/get-on-multiple-repos/1.0/maven-metadata.xml + [m] [1] [2] | ./org/apache/maven/test/get-on-multiple-repos/maven-metadata.xml + [m] [1] | ./org/apache/maven/test/get-present-metadata-snapshot/1.0-SNAPSHOT/get-present-metadata-snapshot-1.0-20050831.101112-1.jar + [m] [1] | ./org/apache/maven/test/get-present-metadata-snapshot/1.0-SNAPSHOT/maven-metadata.xml + [m] [1] | ./org/apache/maven/test/get-present-timestamped-snapshot/1.0-SNAPSHOT/get-present-timestamped-snapshot-1.0-SNAPSHOT.jar + [m] | ./org/apache/maven/test/get-project-metadata/1.0/get-project-metadata-1.0.jar + [m] | ./org/apache/maven/test/get-project-metadata/1.1/get-project-metadata-1.1.jar + [m] | ./org/apache/maven/test/get-project-metadata/2.0/get-project-metadata-2.0.pom + [m] | ./org/apache/maven/test/get-project-metadata/maven-metadata.xml + [m] | ./org/apache/maven/test/get-release-metadata/2.2/get-release-metadata-2.2.jar + [m] | ./org/apache/maven/test/get-release-metadata/2.2/maven-metadata.xml + [m] | ./org/apache/maven/test/get-relocated-artefact/1.0/get-relocated-artefact-1.0.pom + [m] | ./org/apache/maven/test/get-relocated-artefact-with-pom/1.0/get-relocated-artefact-with-pom-1.0.pom + [m] | ./org/apache/maven/test/get-removed-from-proxies/1.0/get-removed-from-proxies-1.0.jar + [m] | ./org/apache/maven/test/get-removed-metadata/1.0/maven-metadata.xml + [m] | ./org/apache/maven/test/get-snapshot-on-local-not-remote/2.0-alpha-2-SNAPSHOT/get-snapshot-on-local-not-remote-2.0-alpha-2-20070821.123456-1.jar + [m] | ./org/apache/maven/test/get-snapshot-on-local-not-remote/2.0-alpha-2-SNAPSHOT/get-snapshot-on-local-not-remote-2.0-alpha-2-20070821.220304-2.jar + [m] | ./org/apache/maven/test/get-snapshot-on-local-not-remote/2.0-alpha-2-SNAPSHOT/maven-metadata.xml + [1] | ./org/apache/maven/test/get-snapshot-popular/2.0-SNAPSHOT/get-snapshot-popular-2.0-20070819.040004-1.jar + [m] [2] | ./org/apache/maven/test/get-snapshot-popular/2.0-SNAPSHOT/get-snapshot-popular-2.0-20070821.102030-1.jar + [m] | ./org/apache/maven/test/get-snapshot-popular/2.0-SNAPSHOT/get-snapshot-popular-2.0-20070821.185701-2.jar + [m] | ./org/apache/maven/test/get-snapshot-popular/2.0-SNAPSHOT/get-snapshot-popular-2.0-20070822.021008-3.jar + [1] | ./org/apache/maven/test/get-snapshot-popular/2.0-SNAPSHOT/get-snapshot-popular-2.0-20070822.145534-9.jar + [2] | ./org/apache/maven/test/get-snapshot-popular/2.0-SNAPSHOT/get-snapshot-popular-2.0-20070823.111741-5.jar + [2] | ./org/apache/maven/test/get-snapshot-popular/2.0-SNAPSHOT/get-snapshot-popular-2.0-20070823.212711-6.jar + [m] [1] [2] | ./org/apache/maven/test/get-snapshot-popular/2.0-SNAPSHOT/maven-metadata.xml + [1] | ./org/apache/maven/test/get-timestamped-snapshot/1.0-SNAPSHOT/get-timestamped-snapshot-1.0-SNAPSHOT.jar + [1] [2] | ./org/apache/maven/test/get-timestamped-snapshot-in-both/1.0-SNAPSHOT/get-timestamped-snapshot-in-both-1.0-20061222.034118-1.jar + [1] | ./org/apache/maven/test/get-timestamped-snapshot-in-both/1.0-SNAPSHOT/get-timestamped-snapshot-in-both-1.0-20061227.112101-2.jar + [2] | ./org/apache/maven/test/get-timestamped-snapshot-in-both/1.0-SNAPSHOT/get-timestamped-snapshot-in-both-1.0-20070101.000103-2.jar + [1] [2] | ./org/apache/maven/test/get-timestamped-snapshot-in-both/1.0-SNAPSHOT/get-timestamped-snapshot-in-both-1.0-SNAPSHOT.jar + [1] [2] | ./org/apache/maven/test/get-timestamped-snapshot-in-both/1.0-SNAPSHOT/maven-metadata.xml + [m] [1] | ./org/apache/maven/test/get-updated-metadata/1.0-SNAPSHOT/maven-metadata.xml + [m] [1] | ./org/apache/maven/test/get-updated-metadata/maven-metadata.xml + --- --- --- | -------------------------------------------- diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-bad-local-checksum/1.0/get-bad-local-checksum-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-bad-local-checksum/1.0/get-bad-local-checksum-1.0.jar new file mode 100644 index 000000000..62a1e1c71 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-bad-local-checksum/1.0/get-bad-local-checksum-1.0.jar @@ -0,0 +1,3 @@ +get-bad-local-checksum-1.0.jar +(managed) + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-bad-local-checksum/1.0/get-bad-local-checksum-1.0.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-bad-local-checksum/1.0/get-bad-local-checksum-1.0.jar.md5 new file mode 100644 index 000000000..5fd0ae2b7 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-bad-local-checksum/1.0/get-bad-local-checksum-1.0.jar.md5 @@ -0,0 +1 @@ +invalid checksum file \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-bad-local-checksum/1.0/get-bad-local-checksum-1.0.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-bad-local-checksum/1.0/get-bad-local-checksum-1.0.jar.sha1 new file mode 100644 index 000000000..5fd0ae2b7 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-bad-local-checksum/1.0/get-bad-local-checksum-1.0.jar.sha1 @@ -0,0 +1 @@ +invalid checksum file \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-checksum-from-managed-repo/1.0/get-checksum-from-managed-repo-1.0.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-checksum-from-managed-repo/1.0/get-checksum-from-managed-repo-1.0.jar.sha1 new file mode 100644 index 000000000..de9618d2f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-checksum-from-managed-repo/1.0/get-checksum-from-managed-repo-1.0.jar.sha1 @@ -0,0 +1 @@ +066d76e459f7782c312c31e8a11b3c0f1e3e43a7 *get-checksum-from-managed-repo-1.0.jar diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-default-layout-present-with-pom/1.0/get-default-layout-present-with-pom-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-default-layout-present-with-pom/1.0/get-default-layout-present-with-pom-1.0.jar new file mode 100644 index 000000000..a3b38382c --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-default-layout-present-with-pom/1.0/get-default-layout-present-with-pom-1.0.jar @@ -0,0 +1,3 @@ +get-default-layout-present-1.0.jar +(managed) + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-default-layout-present-with-pom/1.0/get-default-layout-present-with-pom-1.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-default-layout-present-with-pom/1.0/get-default-layout-present-with-pom-1.0.pom new file mode 100644 index 000000000..b2f94e307 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-default-layout-present-with-pom/1.0/get-default-layout-present-with-pom-1.0.pom @@ -0,0 +1,24 @@ + + + + org.apache.maven.test + get-default-layout-present-with-pom + 1.0 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-default-layout-present/1.0/get-default-layout-present-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-default-layout-present/1.0/get-default-layout-present-1.0.jar new file mode 100644 index 000000000..a3b38382c --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-default-layout-present/1.0/get-default-layout-present-1.0.jar @@ -0,0 +1,3 @@ +get-default-layout-present-1.0.jar +(managed) + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-default-layout-present/1.0/get-default-layout-present-1.0.jar.asc b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-default-layout-present/1.0/get-default-layout-present-1.0.jar.asc new file mode 100644 index 000000000..c3f4c234e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-default-layout-present/1.0/get-default-layout-present-1.0.jar.asc @@ -0,0 +1,7 @@ +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.8 (Darwin) + +iEYEABECAAYFAkiAQxIACgkQTusOMqfRa9T2xACfcvI2fjAXoAHGwJm0zXPJ2rWW +OPoAn23dSOEJhyNUY2hgUlH2wSQiADeP +=ZOwh +-----END PGP SIGNATURE----- diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-default-layout-present/1.0/get-default-layout-present-1.0.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-default-layout-present/1.0/get-default-layout-present-1.0.jar.md5 new file mode 100644 index 000000000..b597d8ce4 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-default-layout-present/1.0/get-default-layout-present-1.0.jar.md5 @@ -0,0 +1 @@ +7dfb7ade9a8fa90bfbfac52d3090b8c2 *get-default-layout-present-1.0.jar diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-default-metadata/1.0/get-default-metadata-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-default-metadata/1.0/get-default-metadata-1.0.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-default-metadata/1.0/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-default-metadata/1.0/maven-metadata.xml new file mode 100644 index 000000000..7f90f2a39 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-default-metadata/1.0/maven-metadata.xml @@ -0,0 +1,24 @@ + + + + org.apache.maven.test + get-default-metadata + 1.0 + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-doubly-relocated-artefact/1.0/get-doubly-relocated-artefact-1.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-doubly-relocated-artefact/1.0/get-doubly-relocated-artefact-1.0.pom new file mode 100644 index 000000000..f8c149eb6 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-doubly-relocated-artefact/1.0/get-doubly-relocated-artefact-1.0.pom @@ -0,0 +1,32 @@ + + + + 4.0.0 + org.apache.maven.test + get-doubly-relocated-artefact + 1.0 + + + + get-relocated-artefact + + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-merged-metadata/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-merged-metadata/maven-metadata.xml new file mode 100644 index 000000000..00af1a181 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-merged-metadata/maven-metadata.xml @@ -0,0 +1,33 @@ + + + + org.apache.maven.test + get-merged-metadata + + + 0.9 + + 1.0 + + 2.0 + + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-not-on-remotes/1.0-beta-2/get-not-on-remotes-1.0-beta-2.jar b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-not-on-remotes/1.0-beta-2/get-not-on-remotes-1.0-beta-2.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-not-on-remotes/1.0-beta-2/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-not-on-remotes/1.0-beta-2/maven-metadata.xml new file mode 100644 index 000000000..965b836c0 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-not-on-remotes/1.0-beta-2/maven-metadata.xml @@ -0,0 +1,24 @@ + + + + org.apache.maven.test + get-not-on-remotes + 1.0-beta-2 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-not-on-remotes/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-not-on-remotes/maven-metadata.xml new file mode 100644 index 000000000..4eef73fd4 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-not-on-remotes/maven-metadata.xml @@ -0,0 +1,28 @@ + + + + org.apache.maven.test + get-not-on-remotes + + + 1.0-beta-2 + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-on-local-on-remote/1.0.22/get-on-local-on-remote-1.0.22.pom b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-on-local-on-remote/1.0.22/get-on-local-on-remote-1.0.22.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-on-local-on-remote/1.0.22/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-on-local-on-remote/1.0.22/maven-metadata.xml new file mode 100644 index 000000000..6fece769d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-on-local-on-remote/1.0.22/maven-metadata.xml @@ -0,0 +1,24 @@ + + + + org.apache.maven.test + get-on-local-on-remote + 1.0.22 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-on-local-on-remote/1.0.8/get-on-local-on-remote-1.0.8.pom b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-on-local-on-remote/1.0.8/get-on-local-on-remote-1.0.8.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-on-local-on-remote/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-on-local-on-remote/maven-metadata.xml new file mode 100644 index 000000000..9ae11e4d7 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-on-local-on-remote/maven-metadata.xml @@ -0,0 +1,29 @@ + + + + org.apache.maven.test + get-on-local-on-remote + + + 1.0.8 + 1.0.22 + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-on-multiple-repos/1.0/get-on-multiple-repos-1.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-on-multiple-repos/1.0/get-on-multiple-repos-1.0.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-on-multiple-repos/1.0/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-on-multiple-repos/1.0/maven-metadata.xml new file mode 100644 index 000000000..6bfd5dd9a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-on-multiple-repos/1.0/maven-metadata.xml @@ -0,0 +1,24 @@ + + + + org.apache.maven.test + get-on-multiple-repos + 1.0 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-on-multiple-repos/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-on-multiple-repos/maven-metadata.xml new file mode 100644 index 000000000..04b49855d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-on-multiple-repos/maven-metadata.xml @@ -0,0 +1,28 @@ + + + + org.apache.maven.test + get-on-multiple-repos + + + 1.0 + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-present-metadata-snapshot/1.0-SNAPSHOT/get-present-metadata-snapshot-1.0-20050831.101112-1.jar b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-present-metadata-snapshot/1.0-SNAPSHOT/get-present-metadata-snapshot-1.0-20050831.101112-1.jar new file mode 100644 index 000000000..b71eb7b74 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-present-metadata-snapshot/1.0-SNAPSHOT/get-present-metadata-snapshot-1.0-20050831.101112-1.jar @@ -0,0 +1,2 @@ +get-present-metadata-snapshot-1.0-20050831.101112-1.jar +(managed) \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-present-metadata-snapshot/1.0-SNAPSHOT/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-present-metadata-snapshot/1.0-SNAPSHOT/maven-metadata.xml new file mode 100644 index 000000000..dd7496af5 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-present-metadata-snapshot/1.0-SNAPSHOT/maven-metadata.xml @@ -0,0 +1,31 @@ + + + + org.apache.maven.test + get-present-metadata-snapshot + 1.0-SNAPSHOT + + + 20050831.101112 + 1 + + 20050831101112 + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-present-timestamped-snapshot/1.0-SNAPSHOT/get-present-timestamped-snapshot-1.0-SNAPSHOT.jar b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-present-timestamped-snapshot/1.0-SNAPSHOT/get-present-timestamped-snapshot-1.0-SNAPSHOT.jar new file mode 100644 index 000000000..0c2d93e3c --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-present-timestamped-snapshot/1.0-SNAPSHOT/get-present-timestamped-snapshot-1.0-SNAPSHOT.jar @@ -0,0 +1,2 @@ +get-present-timestamped-snapshot-1.0-SNAPSHOT.jar +(managed) \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-project-metadata/1.0/get-project-metadata-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-project-metadata/1.0/get-project-metadata-1.0.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-project-metadata/1.1/get-project-metadata-1.1.jar b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-project-metadata/1.1/get-project-metadata-1.1.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-project-metadata/2.0/get-project-metadata-2.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-project-metadata/2.0/get-project-metadata-2.0.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-project-metadata/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-project-metadata/maven-metadata.xml new file mode 100644 index 000000000..a9fd6ef34 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-project-metadata/maven-metadata.xml @@ -0,0 +1,28 @@ + + + + org.apache.maven.test + get-project-metadata + + + 1.0 + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-release-metadata/2.2/get-release-metadata-2.2.jar b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-release-metadata/2.2/get-release-metadata-2.2.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-release-metadata/2.2/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-release-metadata/2.2/maven-metadata.xml new file mode 100644 index 000000000..8fc2a153f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-release-metadata/2.2/maven-metadata.xml @@ -0,0 +1,24 @@ + + + + org.apache.maven.test + get-release-metadata + 2.2 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-relocated-artefact-with-pom/1.0/get-relocated-artefact-with-pom-1.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-relocated-artefact-with-pom/1.0/get-relocated-artefact-with-pom-1.0.pom new file mode 100644 index 000000000..384f369f5 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-relocated-artefact-with-pom/1.0/get-relocated-artefact-with-pom-1.0.pom @@ -0,0 +1,32 @@ + + + + 4.0.0 + org.apache.maven.test + get-relocated-artefact-with-pom + 1.0 + + + + get-default-layout-present-with-pom + + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-relocated-artefact/1.0/get-relocated-artefact-1.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-relocated-artefact/1.0/get-relocated-artefact-1.0.pom new file mode 100644 index 000000000..ae50586ec --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-relocated-artefact/1.0/get-relocated-artefact-1.0.pom @@ -0,0 +1,32 @@ + + + + 4.0.0 + org.apache.maven.test + get-relocated-artefact + 1.0 + + + + get-default-layout-present + + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-removed-from-proxies/1.0/get-removed-from-proxies-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-removed-from-proxies/1.0/get-removed-from-proxies-1.0.jar new file mode 100644 index 000000000..54dc5ee86 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-removed-from-proxies/1.0/get-removed-from-proxies-1.0.jar @@ -0,0 +1,3 @@ +get-removed-from-proxies-1.0.jar +(managed) + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-removed-metadata/1.0/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-removed-metadata/1.0/maven-metadata.xml new file mode 100644 index 000000000..f2c41db2e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-removed-metadata/1.0/maven-metadata.xml @@ -0,0 +1,22 @@ + + + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-snapshot-on-local-not-remote/2.0-alpha-2-SNAPSHOT/get-snapshot-on-local-not-remote-2.0-alpha-2-20070821.123456-1.jar b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-snapshot-on-local-not-remote/2.0-alpha-2-SNAPSHOT/get-snapshot-on-local-not-remote-2.0-alpha-2-20070821.123456-1.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-snapshot-on-local-not-remote/2.0-alpha-2-SNAPSHOT/get-snapshot-on-local-not-remote-2.0-alpha-2-20070821.220304-2.jar b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-snapshot-on-local-not-remote/2.0-alpha-2-SNAPSHOT/get-snapshot-on-local-not-remote-2.0-alpha-2-20070821.220304-2.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-snapshot-on-local-not-remote/2.0-alpha-2-SNAPSHOT/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-snapshot-on-local-not-remote/2.0-alpha-2-SNAPSHOT/maven-metadata.xml new file mode 100644 index 000000000..55e1f3039 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-snapshot-on-local-not-remote/2.0-alpha-2-SNAPSHOT/maven-metadata.xml @@ -0,0 +1,31 @@ + + + + org.apache.maven.test + get-snapshot-on-local-not-remote + 2.0-alpha-2-SNAPSHOT + + + 20070821.220304 + 2 + + 20070821220304 + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-snapshot-popular/2.0-SNAPSHOT/get-snapshot-popular-2.0-20070821.102030-1.jar b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-snapshot-popular/2.0-SNAPSHOT/get-snapshot-popular-2.0-20070821.102030-1.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-snapshot-popular/2.0-SNAPSHOT/get-snapshot-popular-2.0-20070821.185701-2.jar b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-snapshot-popular/2.0-SNAPSHOT/get-snapshot-popular-2.0-20070821.185701-2.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-snapshot-popular/2.0-SNAPSHOT/get-snapshot-popular-2.0-20070822.021008-3.jar b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-snapshot-popular/2.0-SNAPSHOT/get-snapshot-popular-2.0-20070822.021008-3.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-snapshot-popular/2.0-SNAPSHOT/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-snapshot-popular/2.0-SNAPSHOT/maven-metadata.xml new file mode 100644 index 000000000..55e253e89 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-snapshot-popular/2.0-SNAPSHOT/maven-metadata.xml @@ -0,0 +1,31 @@ + + + + org.apache.maven.test + get-snapshot-popular + 2.0-SNAPSHOT + + + 20070822.021008 + 3 + + 20070822021008 + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-updated-metadata/.metadata-proxied1 b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-updated-metadata/.metadata-proxied1 new file mode 100644 index 000000000..76b43d62a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-updated-metadata/.metadata-proxied1 @@ -0,0 +1,25 @@ + + + + org.apache.maven.test + get-updated-metadata + + + 1.0 + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-updated-metadata/1.0-SNAPSHOT/.metadata-proxied1 b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-updated-metadata/1.0-SNAPSHOT/.metadata-proxied1 new file mode 100644 index 000000000..6354f21bc --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-updated-metadata/1.0-SNAPSHOT/.metadata-proxied1 @@ -0,0 +1,27 @@ + + + + org.apache.maven.test + get-updated-metadata + 1.0-SNAPSHOT + + + 20050831.1011112 + 1 + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-updated-metadata/1.0-SNAPSHOT/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-updated-metadata/1.0-SNAPSHOT/maven-metadata.xml new file mode 100644 index 000000000..e9830b0fb --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-updated-metadata/1.0-SNAPSHOT/maven-metadata.xml @@ -0,0 +1,30 @@ + + + + org.apache.maven.test + get-updated-metadata + 1.0-SNAPSHOT + + + 20050831.1011112 + 1 + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-updated-metadata/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-updated-metadata/maven-metadata.xml new file mode 100644 index 000000000..242873e10 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-updated-metadata/maven-metadata.xml @@ -0,0 +1,28 @@ + + + + org.apache.maven.test + get-updated-metadata + + + 1.0 + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/groups/get-not-on-remotes/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/groups/get-not-on-remotes/maven-metadata.xml new file mode 100644 index 000000000..6053adcf4 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/groups/get-not-on-remotes/maven-metadata.xml @@ -0,0 +1,29 @@ + + + + org.apache.maven.test.groups.get-not-on-remotes + + + plugin5 + plugin5-maven-plugin + The plugin5 Plugin + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/groups/get-on-local-on-remote/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/groups/get-on-local-on-remote/maven-metadata.xml new file mode 100644 index 000000000..14196bdc1 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/groups/get-on-local-on-remote/maven-metadata.xml @@ -0,0 +1,34 @@ + + + + org.apache.maven.test.groups.get-on-local-on-remote + + + plugin6 + plugin6-maven-plugin + The plugin6 Plugin + + + plugin7 + plugin7-maven-plugin + The plugin7 Plugin + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/groups/get-on-multiple-repos/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/groups/get-on-multiple-repos/maven-metadata.xml new file mode 100644 index 000000000..a04428913 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/groups/get-on-multiple-repos/maven-metadata.xml @@ -0,0 +1,29 @@ + + + + org.apache.maven.test.groups.get-on-multiple-repos + + + plugin1 + plugin1-maven-plugin + The plugin1 Plugin + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/groups/get-project-metadata/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/groups/get-project-metadata/maven-metadata.xml new file mode 100644 index 000000000..e0829c112 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/groups/get-project-metadata/maven-metadata.xml @@ -0,0 +1,29 @@ + + + + org.apache.maven.test.groups.get-project-metadata + + + plugin1 + plugin1-maven-plugin + The plugin1 Plugin + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-bad-local-checksum/1.0/get-bad-local-checksum-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-bad-local-checksum/1.0/get-bad-local-checksum-1.0.jar new file mode 100644 index 000000000..b5d8045c9 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-bad-local-checksum/1.0/get-bad-local-checksum-1.0.jar @@ -0,0 +1,3 @@ +get-bad-local-checksum-1.0.jar +(proxied 1) + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-checksum-both-bad/1.0/get-checksum-both-bad-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-checksum-both-bad/1.0/get-checksum-both-bad-1.0.jar new file mode 100644 index 000000000..98fae8093 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-checksum-both-bad/1.0/get-checksum-both-bad-1.0.jar @@ -0,0 +1,2 @@ +get-checksum-both-bad-1.0.jar + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-checksum-both-bad/1.0/get-checksum-both-bad-1.0.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-checksum-both-bad/1.0/get-checksum-both-bad-1.0.jar.md5 new file mode 100644 index 000000000..5fd0ae2b7 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-checksum-both-bad/1.0/get-checksum-both-bad-1.0.jar.md5 @@ -0,0 +1 @@ +invalid checksum file \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-checksum-both-bad/1.0/get-checksum-both-bad-1.0.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-checksum-both-bad/1.0/get-checksum-both-bad-1.0.jar.sha1 new file mode 100644 index 000000000..a2d3f29ea --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-checksum-both-bad/1.0/get-checksum-both-bad-1.0.jar.sha1 @@ -0,0 +1 @@ +invalid checksum file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-checksum-both-right/1.0/get-checksum-both-right-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-checksum-both-right/1.0/get-checksum-both-right-1.0.jar new file mode 100644 index 000000000..7fa9ec4a0 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-checksum-both-right/1.0/get-checksum-both-right-1.0.jar @@ -0,0 +1 @@ +get-checksum-both-right-1.0.jar diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-checksum-both-right/1.0/get-checksum-both-right-1.0.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-checksum-both-right/1.0/get-checksum-both-right-1.0.jar.md5 new file mode 100644 index 000000000..9b9e3374c --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-checksum-both-right/1.0/get-checksum-both-right-1.0.jar.md5 @@ -0,0 +1 @@ +e58f30c6a150a2e843552438d18e15cb *get-checksum-both-right-1.0.jar \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-checksum-both-right/1.0/get-checksum-both-right-1.0.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-checksum-both-right/1.0/get-checksum-both-right-1.0.jar.sha1 new file mode 100644 index 000000000..cdd9a336b --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-checksum-both-right/1.0/get-checksum-both-right-1.0.jar.sha1 @@ -0,0 +1 @@ +066d76e459f7782c312c31e8a11b3c0f1e3e43a7 *get-checksum-both-right-1.0.jar diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-checksum-from-managed-repo/1.0/get-checksum-from-managed-repo-1.0.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-checksum-from-managed-repo/1.0/get-checksum-from-managed-repo-1.0.jar.sha1 new file mode 100644 index 000000000..8fc645ca3 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-checksum-from-managed-repo/1.0/get-checksum-from-managed-repo-1.0.jar.sha1 @@ -0,0 +1,2 @@ +066d76e459f7782c312c31e8a11b3c0f1e3e43a7 *get-checksum-from-managed-repo-1.0.jar +(proxied 1) diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-checksum-md5-bad-sha1/1.0/get-checksum-md5-bad-sha1-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-checksum-md5-bad-sha1/1.0/get-checksum-md5-bad-sha1-1.0.jar new file mode 100644 index 000000000..68e3480fc --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-checksum-md5-bad-sha1/1.0/get-checksum-md5-bad-sha1-1.0.jar @@ -0,0 +1,2 @@ +get-checksum-md5-bad-sha1-1.0.jar + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-checksum-md5-bad-sha1/1.0/get-checksum-md5-bad-sha1-1.0.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-checksum-md5-bad-sha1/1.0/get-checksum-md5-bad-sha1-1.0.jar.md5 new file mode 100644 index 000000000..d785caa7f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-checksum-md5-bad-sha1/1.0/get-checksum-md5-bad-sha1-1.0.jar.md5 @@ -0,0 +1 @@ +8a02aa67549d27b2a03cd4547439c6d3 *get-checksum-md5-bad-sha1-1.0.jar \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-checksum-md5-bad-sha1/1.0/get-checksum-md5-bad-sha1-1.0.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-checksum-md5-bad-sha1/1.0/get-checksum-md5-bad-sha1-1.0.jar.sha1 new file mode 100644 index 000000000..a2d3f29ea --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-checksum-md5-bad-sha1/1.0/get-checksum-md5-bad-sha1-1.0.jar.sha1 @@ -0,0 +1 @@ +invalid checksum file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-checksum-md5-only/1.0/get-checksum-md5-only-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-checksum-md5-only/1.0/get-checksum-md5-only-1.0.jar new file mode 100644 index 000000000..915323d0e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-checksum-md5-only/1.0/get-checksum-md5-only-1.0.jar @@ -0,0 +1,2 @@ +get-checksum-md5-only-1.0.jar + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-checksum-md5-only/1.0/get-checksum-md5-only-1.0.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-checksum-md5-only/1.0/get-checksum-md5-only-1.0.jar.md5 new file mode 100644 index 000000000..f5ecac3db --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-checksum-md5-only/1.0/get-checksum-md5-only-1.0.jar.md5 @@ -0,0 +1 @@ +f3af5201bf8da801da37db8842846e1c *get-checksum-md5-only-1.0.jar diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-checksum-sha1-bad-md5/1.0/get-checksum-sha1-bad-md5-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-checksum-sha1-bad-md5/1.0/get-checksum-sha1-bad-md5-1.0.jar new file mode 100644 index 000000000..f02c91843 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-checksum-sha1-bad-md5/1.0/get-checksum-sha1-bad-md5-1.0.jar @@ -0,0 +1,2 @@ +get-checksum-sha1-bad-md5-1.0.jar + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-checksum-sha1-bad-md5/1.0/get-checksum-sha1-bad-md5-1.0.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-checksum-sha1-bad-md5/1.0/get-checksum-sha1-bad-md5-1.0.jar.md5 new file mode 100644 index 000000000..a2d3f29ea --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-checksum-sha1-bad-md5/1.0/get-checksum-sha1-bad-md5-1.0.jar.md5 @@ -0,0 +1 @@ +invalid checksum file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-checksum-sha1-bad-md5/1.0/get-checksum-sha1-bad-md5-1.0.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-checksum-sha1-bad-md5/1.0/get-checksum-sha1-bad-md5-1.0.jar.sha1 new file mode 100644 index 000000000..425623525 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-checksum-sha1-bad-md5/1.0/get-checksum-sha1-bad-md5-1.0.jar.sha1 @@ -0,0 +1 @@ +3dd1a3a57b807d3ef3fbc6013d926c891cbb8670 *get-checksum-sha1-bad-md5-1.0.jar diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-checksum-sha1-only/1.0/get-checksum-sha1-only-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-checksum-sha1-only/1.0/get-checksum-sha1-only-1.0.jar new file mode 100644 index 000000000..efd9ed015 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-checksum-sha1-only/1.0/get-checksum-sha1-only-1.0.jar @@ -0,0 +1,2 @@ +get-checksum-sha1-only-1.0.jar + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-checksum-sha1-only/1.0/get-checksum-sha1-only-1.0.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-checksum-sha1-only/1.0/get-checksum-sha1-only-1.0.jar.sha1 new file mode 100644 index 000000000..e64dccfd8 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-checksum-sha1-only/1.0/get-checksum-sha1-only-1.0.jar.sha1 @@ -0,0 +1 @@ +748a3a013bf5eacf2bbb40a2ac7d37889b728837 *get-checksum-sha1-only-1.0.jar diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-default-layout-present/1.0/get-default-layout-present-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-default-layout-present/1.0/get-default-layout-present-1.0.jar new file mode 100644 index 000000000..15fd36d5d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-default-layout-present/1.0/get-default-layout-present-1.0.jar @@ -0,0 +1,3 @@ +get-default-layout-present-1.0.jar +(proxied 1) + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-default-layout-present/1.0/get-default-layout-present-1.0.jar.asc b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-default-layout-present/1.0/get-default-layout-present-1.0.jar.asc new file mode 100644 index 000000000..07bf0cfd6 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-default-layout-present/1.0/get-default-layout-present-1.0.jar.asc @@ -0,0 +1 @@ +THIS IS THE WRONG CONTENT! diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-default-layout/1.0/get-default-layout-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-default-layout/1.0/get-default-layout-1.0.jar new file mode 100644 index 000000000..a129891a7 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-default-layout/1.0/get-default-layout-1.0.jar @@ -0,0 +1,2 @@ +get-default-layout-1.0.jar + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-default-layout/1.0/get-default-layout-1.0.jar.asc b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-default-layout/1.0/get-default-layout-1.0.jar.asc new file mode 100644 index 000000000..bf07c716d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-default-layout/1.0/get-default-layout-1.0.jar.asc @@ -0,0 +1,7 @@ +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.8 (Darwin) + +iEUEABECAAYFAkiAKPMACgkQTusOMqfRa9RpcQCfUsvdYGZ7P97TYXzQ0MclsV2r +ASkAmJNCpmKjersaTXmsCupNGAJu38c= +=/yRo +-----END PGP SIGNATURE----- diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-default-layout/1.0/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-default-layout/1.0/maven-metadata.xml new file mode 100644 index 000000000..22dc39c2d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-default-layout/1.0/maven-metadata.xml @@ -0,0 +1,24 @@ + + + + org.apache.maven.test + get-default-layout + 1.0 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-default-layout/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-default-layout/maven-metadata.xml new file mode 100644 index 000000000..65d343154 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-default-layout/maven-metadata.xml @@ -0,0 +1,28 @@ + + + + org.apache.maven.test + get-default-layout + + + 1.0 + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-default-metadata/1.0/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-default-metadata/1.0/maven-metadata.xml new file mode 100644 index 000000000..f53003c56 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-default-metadata/1.0/maven-metadata.xml @@ -0,0 +1,24 @@ + + + + org.apache.maven.test + get-default-metadata + 1.0 + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-found-in-proxy/1.0.5/get-found-in-proxy-1.0.5-javadoc.jar b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-found-in-proxy/1.0.5/get-found-in-proxy-1.0.5-javadoc.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-found-in-proxy/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-found-in-proxy/maven-metadata.xml new file mode 100644 index 000000000..10e06230c --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-found-in-proxy/maven-metadata.xml @@ -0,0 +1,28 @@ + + + + org.apache.maven.test + get-found-in-proxy + + + 1.0.5 + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-in-both-proxies/1.0/get-in-both-proxies-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-in-both-proxies/1.0/get-in-both-proxies-1.0.jar new file mode 100644 index 000000000..3cc35fa29 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-in-both-proxies/1.0/get-in-both-proxies-1.0.jar @@ -0,0 +1,3 @@ +get-in-both-proxies-1.0.jar +(proxied 1) + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-merged-metadata/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-merged-metadata/maven-metadata.xml new file mode 100644 index 000000000..6f9ac0f52 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-merged-metadata/maven-metadata.xml @@ -0,0 +1,33 @@ + + + + org.apache.maven.test + get-merged-metadata + + + 2.0 + + 3.0 + + 5.0 + + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-metadata-snapshot/1.0-SNAPSHOT/get-metadata-snapshot-1.0-20050831.101112-1.jar b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-metadata-snapshot/1.0-SNAPSHOT/get-metadata-snapshot-1.0-20050831.101112-1.jar new file mode 100644 index 000000000..139c17b97 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-metadata-snapshot/1.0-SNAPSHOT/get-metadata-snapshot-1.0-20050831.101112-1.jar @@ -0,0 +1 @@ +get-metadata-snapshot-1.0-SNAPSHOT.jar \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-metadata-snapshot/1.0-SNAPSHOT/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-metadata-snapshot/1.0-SNAPSHOT/maven-metadata.xml new file mode 100644 index 000000000..7ac63f44a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-metadata-snapshot/1.0-SNAPSHOT/maven-metadata.xml @@ -0,0 +1,31 @@ + + + + org.apache.maven.test + get-metadata-snapshot + 1.0-SNAPSHOT + + + 20050831.101112 + 1 + + 20050831101112 + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-on-local-on-remote/1.0.22/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-on-local-on-remote/1.0.22/maven-metadata.xml new file mode 100644 index 000000000..6fece769d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-on-local-on-remote/1.0.22/maven-metadata.xml @@ -0,0 +1,24 @@ + + + + org.apache.maven.test + get-on-local-on-remote + 1.0.22 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-on-local-on-remote/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-on-local-on-remote/maven-metadata.xml new file mode 100644 index 000000000..583a5e1cf --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-on-local-on-remote/maven-metadata.xml @@ -0,0 +1,29 @@ + + + + org.apache.maven.test + get-on-local-on-remote + + + 1.0.22 + 2.0 + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-on-multiple-repos/1.0/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-on-multiple-repos/1.0/maven-metadata.xml new file mode 100644 index 000000000..6bfd5dd9a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-on-multiple-repos/1.0/maven-metadata.xml @@ -0,0 +1,24 @@ + + + + org.apache.maven.test + get-on-multiple-repos + 1.0 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-on-multiple-repos/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-on-multiple-repos/maven-metadata.xml new file mode 100644 index 000000000..0f4e941e8 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-on-multiple-repos/maven-metadata.xml @@ -0,0 +1,29 @@ + + + + org.apache.maven.test + get-on-multiple-repos + + + 1.0 + 2.0 + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-present-metadata-snapshot/1.0-SNAPSHOT/get-present-metadata-snapshot-1.0-20050831.101112-1.jar b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-present-metadata-snapshot/1.0-SNAPSHOT/get-present-metadata-snapshot-1.0-20050831.101112-1.jar new file mode 100644 index 000000000..8bbffa00f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-present-metadata-snapshot/1.0-SNAPSHOT/get-present-metadata-snapshot-1.0-20050831.101112-1.jar @@ -0,0 +1,2 @@ +get-present-metadata-snapshot-1.0-20050831.101112-1.jar +(proxied 1) \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-present-metadata-snapshot/1.0-SNAPSHOT/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-present-metadata-snapshot/1.0-SNAPSHOT/maven-metadata.xml new file mode 100644 index 000000000..dd7496af5 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-present-metadata-snapshot/1.0-SNAPSHOT/maven-metadata.xml @@ -0,0 +1,31 @@ + + + + org.apache.maven.test + get-present-metadata-snapshot + 1.0-SNAPSHOT + + + 20050831.101112 + 1 + + 20050831101112 + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-present-timestamped-snapshot/1.0-SNAPSHOT/get-present-timestamped-snapshot-1.0-SNAPSHOT.jar b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-present-timestamped-snapshot/1.0-SNAPSHOT/get-present-timestamped-snapshot-1.0-SNAPSHOT.jar new file mode 100644 index 000000000..0bf178413 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-present-timestamped-snapshot/1.0-SNAPSHOT/get-present-timestamped-snapshot-1.0-SNAPSHOT.jar @@ -0,0 +1,2 @@ +get-present-timestamped-snapshot-1.0-SNAPSHOT.jar +(proxied 1) \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-snapshot-popular/2.0-SNAPSHOT/get-snapshot-popular-2.0-20070819.040004-1.jar b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-snapshot-popular/2.0-SNAPSHOT/get-snapshot-popular-2.0-20070819.040004-1.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-snapshot-popular/2.0-SNAPSHOT/get-snapshot-popular-2.0-20070822.145534-9.jar b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-snapshot-popular/2.0-SNAPSHOT/get-snapshot-popular-2.0-20070822.145534-9.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-snapshot-popular/2.0-SNAPSHOT/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-snapshot-popular/2.0-SNAPSHOT/maven-metadata.xml new file mode 100644 index 000000000..c2c6983a9 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-snapshot-popular/2.0-SNAPSHOT/maven-metadata.xml @@ -0,0 +1,31 @@ + + + + org.apache.maven.test + get-snapshot-popular + 2.0-SNAPSHOT + + + 20070822.145534 + 9 + + 20070822145534 + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-timestamped-snapshot-in-both/1.0-SNAPSHOT/get-timestamped-snapshot-in-both-1.0-20061222.034118-1.jar b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-timestamped-snapshot-in-both/1.0-SNAPSHOT/get-timestamped-snapshot-in-both-1.0-20061222.034118-1.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-timestamped-snapshot-in-both/1.0-SNAPSHOT/get-timestamped-snapshot-in-both-1.0-20061227.112101-2.jar b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-timestamped-snapshot-in-both/1.0-SNAPSHOT/get-timestamped-snapshot-in-both-1.0-20061227.112101-2.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-timestamped-snapshot-in-both/1.0-SNAPSHOT/get-timestamped-snapshot-in-both-1.0-SNAPSHOT.jar b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-timestamped-snapshot-in-both/1.0-SNAPSHOT/get-timestamped-snapshot-in-both-1.0-SNAPSHOT.jar new file mode 100644 index 000000000..dfacfaa15 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-timestamped-snapshot-in-both/1.0-SNAPSHOT/get-timestamped-snapshot-in-both-1.0-SNAPSHOT.jar @@ -0,0 +1,2 @@ +get-timestamped-snapshot-in-both-1.0-SNAPSHOT.jar +(proxied 1) \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-timestamped-snapshot-in-both/1.0-SNAPSHOT/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-timestamped-snapshot-in-both/1.0-SNAPSHOT/maven-metadata.xml new file mode 100644 index 000000000..55b9bd28a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-timestamped-snapshot-in-both/1.0-SNAPSHOT/maven-metadata.xml @@ -0,0 +1,31 @@ + + + + org.apache.maven.test + get-timestamped-snapshot-in-both + 1.0-SNAPSHOT + + + 20061227.112101 + 2 + + 20061227112101 + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-timestamped-snapshot/1.0-SNAPSHOT/get-timestamped-snapshot-1.0-SNAPSHOT.jar b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-timestamped-snapshot/1.0-SNAPSHOT/get-timestamped-snapshot-1.0-SNAPSHOT.jar new file mode 100644 index 000000000..af86df92f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-timestamped-snapshot/1.0-SNAPSHOT/get-timestamped-snapshot-1.0-SNAPSHOT.jar @@ -0,0 +1 @@ +get-timestamped-snapshot-1.0-SNAPSHOT.jar \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-updated-metadata/1.0-SNAPSHOT/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-updated-metadata/1.0-SNAPSHOT/maven-metadata.xml new file mode 100644 index 000000000..5005e6c0e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-updated-metadata/1.0-SNAPSHOT/maven-metadata.xml @@ -0,0 +1,30 @@ + + + + org.apache.maven.test + get-updated-metadata + 1.0-SNAPSHOT + + + 20050831.111213 + 2 + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-updated-metadata/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-updated-metadata/maven-metadata.xml new file mode 100644 index 000000000..085576ddb --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/get-updated-metadata/maven-metadata.xml @@ -0,0 +1,29 @@ + + + + org.apache.maven.test + get-updated-metadata + + + 1.0 + 2.0 + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/groups/get-default-layout/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/groups/get-default-layout/maven-metadata.xml new file mode 100644 index 000000000..9f6bf9239 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/groups/get-default-layout/maven-metadata.xml @@ -0,0 +1,29 @@ + + + + org.apache.maven.test.groups.get-default-layout + + + plugin1 + plugin1-maven-plugin + The plugin1 Plugin + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/groups/get-found-in-proxy/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/groups/get-found-in-proxy/maven-metadata.xml new file mode 100644 index 000000000..90102867a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/groups/get-found-in-proxy/maven-metadata.xml @@ -0,0 +1,29 @@ + + + + org.apache.maven.test.groups.get-found-in-proxy + + + plugin3 + plugin3-maven-plugin + The plugin3 Plugin + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/groups/get-on-local-on-remote/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/groups/get-on-local-on-remote/maven-metadata.xml new file mode 100644 index 000000000..23f12bbf1 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/groups/get-on-local-on-remote/maven-metadata.xml @@ -0,0 +1,34 @@ + + + + org.apache.maven.test.groups.get-on-local-on-remote + + + plugin7 + plugin7-maven-plugin + The plugin7 Plugin + + + plugin4 + plugin4-maven-plugin + The plugin4 Plugin + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/groups/get-on-multiple-repos/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/groups/get-on-multiple-repos/maven-metadata.xml new file mode 100644 index 000000000..3abe069e7 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied1/org/apache/maven/test/groups/get-on-multiple-repos/maven-metadata.xml @@ -0,0 +1,34 @@ + + + + org.apache.maven.test.groups.get-on-multiple-repos + + + plugin1 + plugin1-maven-plugin + The plugin1 Plugin + + + plugin4 + plugin4-maven-plugin + The plugin4 Plugin + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied2/org/apache/maven/test/get-default-layout/1.0.1/get-default-layout-1.0.1.pom b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied2/org/apache/maven/test/get-default-layout/1.0.1/get-default-layout-1.0.1.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied2/org/apache/maven/test/get-default-layout/1.0/get-default-layout-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied2/org/apache/maven/test/get-default-layout/1.0/get-default-layout-1.0.jar new file mode 100644 index 000000000..a129891a7 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied2/org/apache/maven/test/get-default-layout/1.0/get-default-layout-1.0.jar @@ -0,0 +1,2 @@ +get-default-layout-1.0.jar + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied2/org/apache/maven/test/get-default-layout/1.0/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied2/org/apache/maven/test/get-default-layout/1.0/maven-metadata.xml new file mode 100644 index 000000000..22dc39c2d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied2/org/apache/maven/test/get-default-layout/1.0/maven-metadata.xml @@ -0,0 +1,24 @@ + + + + org.apache.maven.test + get-default-layout + 1.0 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied2/org/apache/maven/test/get-default-layout/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied2/org/apache/maven/test/get-default-layout/maven-metadata.xml new file mode 100644 index 000000000..2d76cccb2 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied2/org/apache/maven/test/get-default-layout/maven-metadata.xml @@ -0,0 +1,28 @@ + + + + org.apache.maven.test + get-default-layout + + + 1.0.1 + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied2/org/apache/maven/test/get-in-both-proxies/1.0/get-in-both-proxies-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied2/org/apache/maven/test/get-in-both-proxies/1.0/get-in-both-proxies-1.0.jar new file mode 100644 index 000000000..e46d60ac3 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied2/org/apache/maven/test/get-in-both-proxies/1.0/get-in-both-proxies-1.0.jar @@ -0,0 +1,3 @@ +get-in-both-proxies-1.0.jar +(proxied 2) + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied2/org/apache/maven/test/get-in-second-proxy/1.0/get-in-second-proxy-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied2/org/apache/maven/test/get-in-second-proxy/1.0/get-in-second-proxy-1.0.jar new file mode 100644 index 000000000..3460f656d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied2/org/apache/maven/test/get-in-second-proxy/1.0/get-in-second-proxy-1.0.jar @@ -0,0 +1,2 @@ +get-in-second-proxy-1.0.jar + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied2/org/apache/maven/test/get-merged-metadata/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied2/org/apache/maven/test/get-merged-metadata/maven-metadata.xml new file mode 100644 index 000000000..a8d714f84 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied2/org/apache/maven/test/get-merged-metadata/maven-metadata.xml @@ -0,0 +1,33 @@ + + + + org.apache.maven.test + get-merged-metadata + + + 1.0 + + 3.0 + + 4.0 + + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied2/org/apache/maven/test/get-on-multiple-repos/1.0/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied2/org/apache/maven/test/get-on-multiple-repos/1.0/maven-metadata.xml new file mode 100644 index 000000000..6bfd5dd9a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied2/org/apache/maven/test/get-on-multiple-repos/1.0/maven-metadata.xml @@ -0,0 +1,24 @@ + + + + org.apache.maven.test + get-on-multiple-repos + 1.0 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied2/org/apache/maven/test/get-on-multiple-repos/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied2/org/apache/maven/test/get-on-multiple-repos/maven-metadata.xml new file mode 100644 index 000000000..db3a24f18 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied2/org/apache/maven/test/get-on-multiple-repos/maven-metadata.xml @@ -0,0 +1,29 @@ + + + + org.apache.maven.test + get-on-multiple-repos + + + 1.0 + 1.0.1 + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied2/org/apache/maven/test/get-snapshot-popular/2.0-SNAPSHOT/get-snapshot-popular-2.0-20070821.102030-1.jar b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied2/org/apache/maven/test/get-snapshot-popular/2.0-SNAPSHOT/get-snapshot-popular-2.0-20070821.102030-1.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied2/org/apache/maven/test/get-snapshot-popular/2.0-SNAPSHOT/get-snapshot-popular-2.0-20070823.111741-5.jar b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied2/org/apache/maven/test/get-snapshot-popular/2.0-SNAPSHOT/get-snapshot-popular-2.0-20070823.111741-5.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied2/org/apache/maven/test/get-snapshot-popular/2.0-SNAPSHOT/get-snapshot-popular-2.0-20070823.212711-6.jar b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied2/org/apache/maven/test/get-snapshot-popular/2.0-SNAPSHOT/get-snapshot-popular-2.0-20070823.212711-6.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied2/org/apache/maven/test/get-snapshot-popular/2.0-SNAPSHOT/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied2/org/apache/maven/test/get-snapshot-popular/2.0-SNAPSHOT/maven-metadata.xml new file mode 100644 index 000000000..6b4f5894b --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied2/org/apache/maven/test/get-snapshot-popular/2.0-SNAPSHOT/maven-metadata.xml @@ -0,0 +1,31 @@ + + + + org.apache.maven.test + get-snapshot-popular + 2.0-SNAPSHOT + + + 20070823.212711 + 6 + + 20070823212711 + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied2/org/apache/maven/test/get-timestamped-snapshot-in-both/1.0-SNAPSHOT/get-timestamped-snapshot-in-both-1.0-20061222.034118-1.jar b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied2/org/apache/maven/test/get-timestamped-snapshot-in-both/1.0-SNAPSHOT/get-timestamped-snapshot-in-both-1.0-20061222.034118-1.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied2/org/apache/maven/test/get-timestamped-snapshot-in-both/1.0-SNAPSHOT/get-timestamped-snapshot-in-both-1.0-20070101.000103-2.jar b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied2/org/apache/maven/test/get-timestamped-snapshot-in-both/1.0-SNAPSHOT/get-timestamped-snapshot-in-both-1.0-20070101.000103-2.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied2/org/apache/maven/test/get-timestamped-snapshot-in-both/1.0-SNAPSHOT/get-timestamped-snapshot-in-both-1.0-SNAPSHOT.jar b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied2/org/apache/maven/test/get-timestamped-snapshot-in-both/1.0-SNAPSHOT/get-timestamped-snapshot-in-both-1.0-SNAPSHOT.jar new file mode 100644 index 000000000..915b2b22c --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied2/org/apache/maven/test/get-timestamped-snapshot-in-both/1.0-SNAPSHOT/get-timestamped-snapshot-in-both-1.0-SNAPSHOT.jar @@ -0,0 +1,2 @@ +get-timestamped-snapshot-in-both-1.0-SNAPSHOT.jar +(proxied 2) \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied2/org/apache/maven/test/get-timestamped-snapshot-in-both/1.0-SNAPSHOT/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied2/org/apache/maven/test/get-timestamped-snapshot-in-both/1.0-SNAPSHOT/maven-metadata.xml new file mode 100644 index 000000000..78fbecc59 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied2/org/apache/maven/test/get-timestamped-snapshot-in-both/1.0-SNAPSHOT/maven-metadata.xml @@ -0,0 +1,31 @@ + + + + org.apache.maven.test + get-timestamped-snapshot-in-both + 1.0-SNAPSHOT + + + 20070101.000103 + 2 + + 20070101000103 + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied2/org/apache/maven/test/groups/get-default-layout/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied2/org/apache/maven/test/groups/get-default-layout/maven-metadata.xml new file mode 100644 index 000000000..41109859e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied2/org/apache/maven/test/groups/get-default-layout/maven-metadata.xml @@ -0,0 +1,29 @@ + + + + org.apache.maven.test.groups.get-default-layout + + + plugin2 + plugin2-maven-plugin + The plugin2 Plugin + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied2/org/apache/maven/test/groups/get-on-multiple-repos/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied2/org/apache/maven/test/groups/get-on-multiple-repos/maven-metadata.xml new file mode 100644 index 000000000..b7db006fe --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/repositories/proxied2/org/apache/maven/test/groups/get-on-multiple-repos/maven-metadata.xml @@ -0,0 +1,34 @@ + + + + org.apache.maven.test.groups.get-on-multiple-repos + + + plugin1 + plugin1-maven-plugin + The plugin1 Plugin + + + plugin2 + plugin2-maven-plugin + The plugin2 Plugin + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/resources/log4j.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/resources/log4j.xml new file mode 100644 index 000000000..901c99f33 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/resources/log4j.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/CacheFailuresTransferTest.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/CacheFailuresTransferTest.xml new file mode 100644 index 000000000..7ad475f57 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/CacheFailuresTransferTest.xml @@ -0,0 +1,108 @@ + + + + + + org.apache.maven.wagon.Wagon + test + org.apache.maven.archiva.proxy.WagonDelegate + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + mock + org.apache.maven.archiva.proxy.MockConfiguration + + + org.apache.maven.archiva.repository.RepositoryContentFactory + mocked + org.apache.maven.archiva.repository.RepositoryContentFactory + RepositoryContentRequest + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + mock + archivaConfiguration + + + + + org.apache.maven.archiva.proxy.RepositoryProxyConnectors + default + org.apache.maven.archiva.proxy.DefaultRepositoryProxyConnectors + DefaultRepositoryProxyConnectors + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + mock + archivaConfiguration + + + org.apache.maven.archiva.proxy.WagonFactory + + + org.apache.maven.archiva.repository.RepositoryContentFactory + mocked + repositoryFactory + + + org.apache.maven.archiva.repository.metadata.MetadataTools + metadataTools + + + org.apache.maven.archiva.policies.PreDownloadPolicy + preDownloadPolicies + + + org.apache.maven.archiva.policies.PostDownloadPolicy + postDownloadPolicies + + + org.apache.maven.archiva.repository.scanner.RepositoryContentConsumers + consumers + + + org.apache.maven.archiva.policies.urlcache.UrlFailureCache + urlFailureCache + + + + + + org.codehaus.plexus.cache.Cache + url-failures-cache + org.codehaus.plexus.cache.ehcache.EhcacheCache + URL Failure Cache + + 600 + false + ${java.io.tmpdir}/archiva/urlcache + false + 1000 + LRU + url-failures-cache + false + + 2700 + + 1800 + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/ChecksumTransferTest.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/ChecksumTransferTest.xml new file mode 100644 index 000000000..e9dfa4cc6 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/ChecksumTransferTest.xml @@ -0,0 +1,106 @@ + + + + + + org.apache.maven.wagon.Wagon + test + org.apache.maven.archiva.proxy.WagonDelegate + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + mock + org.apache.maven.archiva.proxy.MockConfiguration + + + org.apache.maven.archiva.repository.RepositoryContentFactory + mocked + org.apache.maven.archiva.repository.RepositoryContentFactory + RepositoryContentRequest + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + mock + archivaConfiguration + + + + + org.apache.maven.archiva.proxy.RepositoryProxyConnectors + default + org.apache.maven.archiva.proxy.DefaultRepositoryProxyConnectors + DefaultRepositoryProxyConnectors + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + mock + archivaConfiguration + + + org.apache.maven.archiva.proxy.WagonFactory + + + org.apache.maven.archiva.repository.RepositoryContentFactory + mocked + + + org.apache.maven.archiva.repository.metadata.MetadataTools + + + org.apache.maven.archiva.policies.PreDownloadPolicy + preDownloadPolicies + + + org.apache.maven.archiva.policies.PostDownloadPolicy + postDownloadPolicies + + + org.apache.maven.archiva.repository.scanner.RepositoryContentConsumers + consumers + + + org.apache.maven.archiva.policies.urlcache.UrlFailureCache + urlFailureCache + + + + + + org.codehaus.plexus.cache.Cache + url-failures-cache + org.codehaus.plexus.cache.ehcache.EhcacheCache + URL Failure Cache + + 600 + false + ${java.io.tmpdir}/archiva/urlcache + false + 1000 + LRU + url-failures-cache + false + + 2700 + + 1800 + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/ErrorHandlingTest.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/ErrorHandlingTest.xml new file mode 100644 index 000000000..fad392c50 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/ErrorHandlingTest.xml @@ -0,0 +1,111 @@ + + + + + + org.apache.maven.wagon.Wagon + test + org.apache.maven.archiva.proxy.WagonDelegate + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + mock + org.apache.maven.archiva.proxy.MockConfiguration + + + org.apache.maven.archiva.repository.RepositoryContentFactory + mocked + org.apache.maven.archiva.repository.RepositoryContentFactory + RepositoryContentRequest + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + mock + archivaConfiguration + + + + + org.apache.maven.archiva.proxy.RepositoryProxyConnectors + default + org.apache.maven.archiva.proxy.DefaultRepositoryProxyConnectors + DefaultRepositoryProxyConnectors + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + mock + archivaConfiguration + + + org.apache.maven.archiva.proxy.WagonFactory + + + org.apache.maven.archiva.repository.RepositoryContentFactory + mocked + + + org.apache.maven.archiva.repository.metadata.MetadataTools + + + org.apache.maven.archiva.policies.PreDownloadPolicy + preDownloadPolicies + + + org.apache.maven.archiva.policies.PostDownloadPolicy + postDownloadPolicies + + + org.apache.maven.archiva.policies.DownloadErrorPolicy + downloadErrorPolicies + + + org.apache.maven.archiva.policies.urlcache.UrlFailureCache + default + urlFailureCache + + + org.apache.maven.archiva.repository.scanner.RepositoryContentConsumers + consumers + + + + + + org.codehaus.plexus.cache.Cache + url-failures-cache + org.codehaus.plexus.cache.ehcache.EhcacheCache + URL Failure Cache + + 600 + false + ${java.io.tmpdir}/archiva/urlcache + false + 1000 + LRU + url-failures-cache + false + + 2700 + + 1800 + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/HttpProxyTransferTest.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/HttpProxyTransferTest.xml new file mode 100644 index 000000000..bc10178b5 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/HttpProxyTransferTest.xml @@ -0,0 +1,102 @@ + + + + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + mock + org.apache.maven.archiva.proxy.MockConfiguration + + + org.apache.maven.archiva.repository.RepositoryContentFactory + mocked + org.apache.maven.archiva.repository.RepositoryContentFactory + RepositoryContentRequest + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + mock + archivaConfiguration + + + + + org.apache.maven.archiva.proxy.RepositoryProxyConnectors + default + org.apache.maven.archiva.proxy.DefaultRepositoryProxyConnectors + DefaultRepositoryProxyConnectors + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + mock + archivaConfiguration + + + org.apache.maven.archiva.repository.RepositoryContentFactory + mocked + + + org.apache.maven.archiva.repository.metadata.MetadataTools + + + org.apache.maven.archiva.policies.PreDownloadPolicy + preDownloadPolicies + + + org.apache.maven.archiva.policies.PostDownloadPolicy + postDownloadPolicies + + + org.apache.maven.archiva.repository.scanner.RepositoryContentConsumers + consumers + + + org.apache.maven.archiva.policies.urlcache.UrlFailureCache + urlFailureCache + + + org.apache.maven.archiva.proxy.WagonFactory + default + + + + + + org.codehaus.plexus.cache.Cache + url-failures-cache + org.codehaus.plexus.cache.ehcache.EhcacheCache + URL Failure Cache + + 600 + false + ${java.io.tmpdir}/archiva/urlcache + false + 1000 + LRU + url-failures-cache + false + + 2700 + + 1800 + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/ManagedDefaultTransferTest.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/ManagedDefaultTransferTest.xml new file mode 100644 index 000000000..e9dfa4cc6 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/ManagedDefaultTransferTest.xml @@ -0,0 +1,106 @@ + + + + + + org.apache.maven.wagon.Wagon + test + org.apache.maven.archiva.proxy.WagonDelegate + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + mock + org.apache.maven.archiva.proxy.MockConfiguration + + + org.apache.maven.archiva.repository.RepositoryContentFactory + mocked + org.apache.maven.archiva.repository.RepositoryContentFactory + RepositoryContentRequest + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + mock + archivaConfiguration + + + + + org.apache.maven.archiva.proxy.RepositoryProxyConnectors + default + org.apache.maven.archiva.proxy.DefaultRepositoryProxyConnectors + DefaultRepositoryProxyConnectors + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + mock + archivaConfiguration + + + org.apache.maven.archiva.proxy.WagonFactory + + + org.apache.maven.archiva.repository.RepositoryContentFactory + mocked + + + org.apache.maven.archiva.repository.metadata.MetadataTools + + + org.apache.maven.archiva.policies.PreDownloadPolicy + preDownloadPolicies + + + org.apache.maven.archiva.policies.PostDownloadPolicy + postDownloadPolicies + + + org.apache.maven.archiva.repository.scanner.RepositoryContentConsumers + consumers + + + org.apache.maven.archiva.policies.urlcache.UrlFailureCache + urlFailureCache + + + + + + org.codehaus.plexus.cache.Cache + url-failures-cache + org.codehaus.plexus.cache.ehcache.EhcacheCache + URL Failure Cache + + 600 + false + ${java.io.tmpdir}/archiva/urlcache + false + 1000 + LRU + url-failures-cache + false + + 2700 + + 1800 + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/ManagedLegacyTransferTest.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/ManagedLegacyTransferTest.xml new file mode 100644 index 000000000..e9dfa4cc6 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/ManagedLegacyTransferTest.xml @@ -0,0 +1,106 @@ + + + + + + org.apache.maven.wagon.Wagon + test + org.apache.maven.archiva.proxy.WagonDelegate + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + mock + org.apache.maven.archiva.proxy.MockConfiguration + + + org.apache.maven.archiva.repository.RepositoryContentFactory + mocked + org.apache.maven.archiva.repository.RepositoryContentFactory + RepositoryContentRequest + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + mock + archivaConfiguration + + + + + org.apache.maven.archiva.proxy.RepositoryProxyConnectors + default + org.apache.maven.archiva.proxy.DefaultRepositoryProxyConnectors + DefaultRepositoryProxyConnectors + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + mock + archivaConfiguration + + + org.apache.maven.archiva.proxy.WagonFactory + + + org.apache.maven.archiva.repository.RepositoryContentFactory + mocked + + + org.apache.maven.archiva.repository.metadata.MetadataTools + + + org.apache.maven.archiva.policies.PreDownloadPolicy + preDownloadPolicies + + + org.apache.maven.archiva.policies.PostDownloadPolicy + postDownloadPolicies + + + org.apache.maven.archiva.repository.scanner.RepositoryContentConsumers + consumers + + + org.apache.maven.archiva.policies.urlcache.UrlFailureCache + urlFailureCache + + + + + + org.codehaus.plexus.cache.Cache + url-failures-cache + org.codehaus.plexus.cache.ehcache.EhcacheCache + URL Failure Cache + + 600 + false + ${java.io.tmpdir}/archiva/urlcache + false + 1000 + LRU + url-failures-cache + false + + 2700 + + 1800 + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/MetadataTransferTest.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/MetadataTransferTest.xml new file mode 100644 index 000000000..fe348d3f7 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/MetadataTransferTest.xml @@ -0,0 +1,125 @@ + + + + + + org.apache.maven.wagon.Wagon + test + org.apache.maven.archiva.proxy.WagonDelegate + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + mock + org.apache.maven.archiva.proxy.MockConfiguration + + + org.apache.maven.archiva.repository.RepositoryContentFactory + mocked + org.apache.maven.archiva.repository.RepositoryContentFactory + RepositoryContentRequest + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + mock + archivaConfiguration + + + + + + + org.apache.maven.archiva.repository.metadata.MetadataTools + org.apache.maven.archiva.repository.metadata.MetadataTools + MetadataTools + + + org.apache.maven.archiva.configuration.FileTypes + filetypes + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + mock + configuration + + + + + + org.apache.maven.archiva.proxy.RepositoryProxyConnectors + default + org.apache.maven.archiva.proxy.DefaultRepositoryProxyConnectors + DefaultRepositoryProxyConnectors + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + mock + archivaConfiguration + + + org.apache.maven.archiva.proxy.WagonFactory + + + org.apache.maven.archiva.repository.RepositoryContentFactory + mocked + + + org.apache.maven.archiva.repository.metadata.MetadataTools + + + org.apache.maven.archiva.policies.PreDownloadPolicy + preDownloadPolicies + + + org.apache.maven.archiva.policies.PostDownloadPolicy + postDownloadPolicies + + + org.apache.maven.archiva.repository.scanner.RepositoryContentConsumers + consumers + + + org.apache.maven.archiva.policies.urlcache.UrlFailureCache + urlFailureCache + + + + + + org.codehaus.plexus.cache.Cache + url-failures-cache + org.codehaus.plexus.cache.ehcache.EhcacheCache + URL Failure Cache + + 600 + false + ${java.io.tmpdir}/archiva/urlcache + false + 1000 + LRU + url-failures-cache + false + + 2700 + + 1800 + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/RelocateTransferTest.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/RelocateTransferTest.xml new file mode 100644 index 000000000..e9dfa4cc6 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/RelocateTransferTest.xml @@ -0,0 +1,106 @@ + + + + + + org.apache.maven.wagon.Wagon + test + org.apache.maven.archiva.proxy.WagonDelegate + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + mock + org.apache.maven.archiva.proxy.MockConfiguration + + + org.apache.maven.archiva.repository.RepositoryContentFactory + mocked + org.apache.maven.archiva.repository.RepositoryContentFactory + RepositoryContentRequest + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + mock + archivaConfiguration + + + + + org.apache.maven.archiva.proxy.RepositoryProxyConnectors + default + org.apache.maven.archiva.proxy.DefaultRepositoryProxyConnectors + DefaultRepositoryProxyConnectors + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + mock + archivaConfiguration + + + org.apache.maven.archiva.proxy.WagonFactory + + + org.apache.maven.archiva.repository.RepositoryContentFactory + mocked + + + org.apache.maven.archiva.repository.metadata.MetadataTools + + + org.apache.maven.archiva.policies.PreDownloadPolicy + preDownloadPolicies + + + org.apache.maven.archiva.policies.PostDownloadPolicy + postDownloadPolicies + + + org.apache.maven.archiva.repository.scanner.RepositoryContentConsumers + consumers + + + org.apache.maven.archiva.policies.urlcache.UrlFailureCache + urlFailureCache + + + + + + org.codehaus.plexus.cache.Cache + url-failures-cache + org.codehaus.plexus.cache.ehcache.EhcacheCache + URL Failure Cache + + 600 + false + ${java.io.tmpdir}/archiva/urlcache + false + 1000 + LRU + url-failures-cache + false + + 2700 + + 1800 + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/SnapshotTransferTest.xml b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/SnapshotTransferTest.xml new file mode 100644 index 000000000..e9dfa4cc6 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/SnapshotTransferTest.xml @@ -0,0 +1,106 @@ + + + + + + org.apache.maven.wagon.Wagon + test + org.apache.maven.archiva.proxy.WagonDelegate + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + mock + org.apache.maven.archiva.proxy.MockConfiguration + + + org.apache.maven.archiva.repository.RepositoryContentFactory + mocked + org.apache.maven.archiva.repository.RepositoryContentFactory + RepositoryContentRequest + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + mock + archivaConfiguration + + + + + org.apache.maven.archiva.proxy.RepositoryProxyConnectors + default + org.apache.maven.archiva.proxy.DefaultRepositoryProxyConnectors + DefaultRepositoryProxyConnectors + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + mock + archivaConfiguration + + + org.apache.maven.archiva.proxy.WagonFactory + + + org.apache.maven.archiva.repository.RepositoryContentFactory + mocked + + + org.apache.maven.archiva.repository.metadata.MetadataTools + + + org.apache.maven.archiva.policies.PreDownloadPolicy + preDownloadPolicies + + + org.apache.maven.archiva.policies.PostDownloadPolicy + postDownloadPolicies + + + org.apache.maven.archiva.repository.scanner.RepositoryContentConsumers + consumers + + + org.apache.maven.archiva.policies.urlcache.UrlFailureCache + urlFailureCache + + + + + + org.codehaus.plexus.cache.Cache + url-failures-cache + org.codehaus.plexus.cache.ehcache.EhcacheCache + URL Failure Cache + + 600 + false + ${java.io.tmpdir}/archiva/urlcache + false + 1000 + LRU + url-failures-cache + false + + 2700 + + 1800 + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/pom.xml b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/pom.xml new file mode 100644 index 000000000..998863313 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/pom.xml @@ -0,0 +1,99 @@ + + + + + + org.apache.archiva + archiva-base + 1.2-SNAPSHOT + + 4.0.0 + archiva-repository-layer + Archiva Repository Interface Layer + + + org.apache.archiva + archiva-xml-tools + + + org.apache.archiva + archiva-model + + + org.apache.archiva + archiva-consumer-api + + + org.apache.archiva + archiva-dependency-graph + + + org.apache.archiva + archiva-checksum + + + org.apache.archiva + archiva-configuration + + + org.apache.archiva + archiva-xml-tools + + + xmlunit + xmlunit + test + + + org.codehaus.plexus + plexus-spring + test + + + + + + org.codehaus.plexus + plexus-maven-plugin + + + descriptor + + descriptor + + + + merge + + merge-descriptors + + + ${project.build.directory}/generated-resources/plexus/META-INF/plexus/components.xml + + ${basedir}/src/main/resources/META-INF/plexus/components-fragment.xml + ${project.build.directory}/generated-resources/plexus/META-INF/plexus/components.xml + + + + + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/ContentNotFoundException.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/ContentNotFoundException.java new file mode 100644 index 000000000..993a7a095 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/ContentNotFoundException.java @@ -0,0 +1,51 @@ +package org.apache.maven.archiva.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. + */ + +/** + * ContentNotFoundException is thrown in response for requests for content that is not the repository. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ContentNotFoundException + extends RepositoryException +{ + + public ContentNotFoundException() + { + super(); + } + + public ContentNotFoundException( String message, Throwable cause ) + { + super( message, cause ); + } + + public ContentNotFoundException( String message ) + { + super( message ); + } + + public ContentNotFoundException( Throwable cause ) + { + super( cause ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/ManagedRepositoryContent.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/ManagedRepositoryContent.java new file mode 100644 index 000000000..ef1ff8d80 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/ManagedRepositoryContent.java @@ -0,0 +1,226 @@ +package org.apache.maven.archiva.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. + */ + +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +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.maven.archiva.repository.layout.LayoutException; + +import java.io.File; +import java.util.Set; + +/** + * ManagedRepositoryContent interface for interacting with a managed repository in an abstract way, + * without the need for processing based on filesystem paths, or working with the database. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public interface ManagedRepositoryContent +{ + /** + * Delete from the managed repository all files / directories associated with the + * provided version reference. + * + * @param reference the version reference to delete. + * @throws ContentNotFoundException + */ + public void deleteVersion( VersionedReference reference ) + throws ContentNotFoundException; + + /** + *

+ * Convenience method to get the repository id. + *

+ * + *

+ * Equivalent to calling .getRepository().getId() + *

+ * + * @return the repository id. + */ + public String getId(); + + /** + *

+ * Gather up the list of related artifacts to the ArtifactReference provided. + * This typically inclues the pom files, and those things with + * classifiers (such as doc, source code, test libs, etc...) + *

+ * + *

+ * NOTE: Some layouts (such as maven 1 "legacy") are not compatible with this query. + *

+ * + * @param reference the reference to work off of. + * @return the set of ArtifactReferences for related artifacts. + * @throws ContentNotFoundException if the initial artifact reference does not exist within the repository. + * @throws LayoutException + */ + public Set getRelatedArtifacts( ArtifactReference reference ) + throws ContentNotFoundException, LayoutException; + + /** + *

+ * Convenience method to get the repository (on disk) root directory. + *

+ * + *

+ * Equivalent to calling .getRepository().getLocation() + *

+ * + * @return the repository (on disk) root directory. + */ + public String getRepoRoot(); + + /** + * Get the repository configuration associated with this + * repository content. + * + * @return the repository that is associated with this repository content. + */ + public ManagedRepositoryConfiguration getRepository(); + + /** + * Given a specific {@link ProjectReference}, return the list of available versions for + * that project reference. + * + * @param reference the project reference to work off of. + * @return the list of versions found for that project reference. + * @throws ContentNotFoundException if the project reference does nto exist within the repository. + * @throws LayoutException + */ + public Set getVersions( ProjectReference reference ) + throws ContentNotFoundException, LayoutException; + + /** + *

+ * Given a specific {@link VersionedReference}, return the list of available versions for that + * versioned reference. + *

+ * + *

+ * NOTE: This is really only useful when working with SNAPSHOTs. + *

+ * + * @param reference the versioned reference to work off of. + * @return the set of versions found. + * @throws ContentNotFoundException if the versioned reference does not exist within the repository. + * @throws LayoutException + */ + public Set getVersions( VersionedReference reference ) + throws ContentNotFoundException, LayoutException; + + /** + * Determines if the artifact referenced exists in the repository. + * + * @param reference the artifact reference to check for. + * @return true if the artifact referenced exists. + */ + public boolean hasContent( ArtifactReference reference ); + + /** + * Determines if the project referenced exists in the repository. + * + * @param reference the project reference to check for. + * @return true it the project referenced exists. + */ + public boolean hasContent( ProjectReference reference ); + + /** + * Determines if the version reference exists in the repository. + * + * @param reference the version reference to check for. + * @return true if the version referenced exists. + */ + public boolean hasContent( VersionedReference reference ); + + /** + * Set the repository configuration to associate with this + * repository content. + * + * @param repo the repository to associate with this repository content. + */ + public void setRepository( ManagedRepositoryConfiguration repo ); + + /** + * Given a repository relative path to a filename, return the {@link VersionedReference} object suitable for the path. + * + * @param path the path relative to the repository base dir for the artifact. + * @return the {@link ArtifactReference} representing the path. (or null if path cannot be converted to + * a {@link ArtifactReference}) + * @throws LayoutException if there was a problem converting the path to an artifact. + */ + public ArtifactReference toArtifactReference( String path ) + throws LayoutException; + + /** + * Given an {@link ArtifactReference}, return the file reference to the artifact. + * + * @param reference the artifact reference to use. + * @return the relative path to the artifact. + */ + public File toFile( ArtifactReference reference ); + + /** + * Given an {@link ArchivaArtifact}, return the file reference to the artifact. + * + * @param reference the archiva artifact to use. + * @return the relative path to the artifact. + */ + public File toFile( ArchivaArtifact reference ); + + /** + * Given a {@link ProjectReference}, return the path to the metadata for + * the project. + * + * @param reference the reference to use. + * @return the path to the metadata file, or null if no metadata is appropriate. + */ + public String toMetadataPath( ProjectReference reference ); + + /** + * Given a {@link VersionedReference}, return the path to the metadata for + * the specific version of the project. + * + * @param reference the reference to use. + * @return the path to the metadata file, or null if no metadata is appropriate. + */ + public String toMetadataPath( VersionedReference reference ); + + /** + * Given an {@link ArtifactReference}, return the relative path to the artifact. + * + * @param reference the artifact reference to use. + * @return the relative path to the artifact. + */ + public String toPath( ArtifactReference reference ); + + /** + * Given an {@link ArchivaArtifact}, return the relative path to the artifact. + * + * @param reference the archiva artifact to use. + * @return the relative path to the artifact. + */ + public String toPath( ArchivaArtifact reference ); +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/RemoteRepositoryContent.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/RemoteRepositoryContent.java new file mode 100644 index 000000000..054107323 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/RemoteRepositoryContent.java @@ -0,0 +1,104 @@ +package org.apache.maven.archiva.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. + */ + +import org.apache.maven.archiva.configuration.RemoteRepositoryConfiguration; +import org.apache.maven.archiva.model.ArtifactReference; +import org.apache.maven.archiva.model.RepositoryURL; +import org.apache.maven.archiva.repository.layout.LayoutException; + +/** + * RemoteRepositoryContent interface for interacting with a remote repository in an abstract way, + * without the need for processing based on URLs, or working with the database. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public interface RemoteRepositoryContent +{ + /** + *

+ * Convenience method to get the repository id. + *

+ * + *

+ * Equivalent to calling .getRepository().getId() + *

+ * + * @return the repository id. + */ + public String getId(); + + /** + * Get the repository configuration associated with this + * repository content. + * + * @return the repository that is associated with this repository content. + */ + public RemoteRepositoryConfiguration getRepository(); + + /** + *

+ * Convenience method to get the repository url. + *

+ * + *

+ * Equivalent to calling new RepositoryURL( this.getRepository().getUrl() ) + *

+ * + * @return the repository url. + */ + public RepositoryURL getURL(); + + /** + * Set the repository configuration to associate with this + * repository content. + * + * @param repo the repository to associate with this repository content. + */ + public void setRepository( RemoteRepositoryConfiguration repo ); + + /** + * Given a repository relative path to a filename, return the {@link VersionedReference} object suitable for the path. + * + * @param path the path relative to the repository base dir for the artifact. + * @return the {@link ArtifactReference} representing the path. (or null if path cannot be converted to + * a {@link ArtifactReference}) + * @throws LayoutException if there was a problem converting the path to an artifact. + */ + public ArtifactReference toArtifactReference( String path ) + throws LayoutException; + + /** + * Given an ArtifactReference, return the relative path to the artifact. + * + * @param reference the artifact reference to use. + * @return the relative path to the artifact. + */ + public String toPath( ArtifactReference reference ); + + /** + * Given an ArtifactReference, return the url to the artifact. + * + * @param reference the artifact reference to use. + * @return the relative path to the artifact. + */ + public RepositoryURL toURL( ArtifactReference reference ); +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/RepositoryContentFactory.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/RepositoryContentFactory.java new file mode 100644 index 000000000..08807f474 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/RepositoryContentFactory.java @@ -0,0 +1,204 @@ +package org.apache.maven.archiva.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. + */ + +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.ConfigurationNames; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.configuration.RemoteRepositoryConfiguration; +import org.codehaus.plexus.PlexusContainer; +import org.codehaus.plexus.component.repository.exception.ComponentLifecycleException; +import org.codehaus.plexus.component.repository.exception.ComponentLookupException; +import org.codehaus.plexus.context.Context; +import org.codehaus.plexus.context.ContextException; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException; +import org.codehaus.plexus.registry.Registry; +import org.codehaus.plexus.registry.RegistryListener; + +import java.util.HashMap; +import java.util.Map; + +/** + * RepositoryContentRequest + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component + * role="org.apache.maven.archiva.repository.RepositoryContentFactory" + */ +public class RepositoryContentFactory + implements Contextualizable, RegistryListener, Initializable +{ + /** + * @plexus.requirement + */ + private ArchivaConfiguration archivaConfiguration; + + private Map managedContentMap; + + private Map remoteContentMap; + + private PlexusContainer container; + + /** + * Get the ManagedRepositoryContent object for the repository Id specified. + * + * @param repoId the repository id to fetch. + * @return the ManagedRepositoryContent object associated with the repository id. + * @throws RepositoryNotFoundException if the repository id does not exist within the configuration. + * @throws RepositoryException the repository content object cannot be loaded due to configuration issue. + */ + public ManagedRepositoryContent getManagedRepositoryContent( String repoId ) + throws RepositoryNotFoundException, RepositoryException + { + ManagedRepositoryContent repo = managedContentMap.get( repoId ); + + if ( repo != null ) + { + return repo; + } + + ManagedRepositoryConfiguration repoConfig = archivaConfiguration.getConfiguration() + .findManagedRepositoryById( repoId ); + if ( repoConfig == null ) + { + throw new RepositoryNotFoundException( "Unable to find managed repository configuration for id:" + repoId ); + } + + try + { + repo = (ManagedRepositoryContent) container.lookup( ManagedRepositoryContent.class, repoConfig.getLayout() ); + repo.setRepository( repoConfig ); + managedContentMap.put( repoId, repo ); + } + catch ( ComponentLookupException e ) + { + throw new RepositoryException( "Specified layout [" + repoConfig.getLayout() + + "] on managed repository id [" + repoId + "] is not valid.", e ); + } + + return repo; + } + + public RemoteRepositoryContent getRemoteRepositoryContent( String repoId ) + throws RepositoryNotFoundException, RepositoryException + { + RemoteRepositoryContent repo = remoteContentMap.get( repoId ); + + if ( repo != null ) + { + return repo; + } + + RemoteRepositoryConfiguration repoConfig = archivaConfiguration.getConfiguration() + .findRemoteRepositoryById( repoId ); + if ( repoConfig == null ) + { + throw new RepositoryNotFoundException( "Unable to find remote repository configuration for id:" + repoId ); + } + + try + { + repo = (RemoteRepositoryContent) container.lookup( RemoteRepositoryContent.class, repoConfig.getLayout() ); + repo.setRepository( repoConfig ); + remoteContentMap.put( repoId, repo ); + } + catch ( ComponentLookupException e ) + { + throw new RepositoryException( "Specified layout [" + repoConfig.getLayout() + + "] on remote repository id [" + repoId + "] is not valid.", e ); + } + + return repo; + } + + public void contextualize( Context context ) + throws ContextException + { + container = (PlexusContainer) context.get( "plexus" ); + } + + public void afterConfigurationChange( Registry registry, String propertyName, Object propertyValue ) + { + if ( ConfigurationNames.isManagedRepositories( propertyName ) + || ConfigurationNames.isRemoteRepositories( propertyName ) ) + { + initMaps(); + } + } + + public void beforeConfigurationChange( Registry registry, String propertyName, Object propertyValue ) + { + /* do nothing */ + } + + public void initialize() + throws InitializationException + { + managedContentMap = new HashMap(); + remoteContentMap = new HashMap(); + + archivaConfiguration.addChangeListener( this ); + } + + private void initMaps() + { + synchronized ( managedContentMap ) + { + // First, return any references to the container. + for ( ManagedRepositoryContent repo : managedContentMap.values() ) + { + try + { + container.release( repo ); + } + catch ( ComponentLifecycleException e ) + { + /* ignore */ + } + } + + // Next clear the map. + managedContentMap.clear(); + } + + synchronized ( remoteContentMap ) + { + // First, return any references to the container. + for ( RemoteRepositoryContent repo : remoteContentMap.values() ) + { + try + { + container.release( repo ); + } + catch ( ComponentLifecycleException e ) + { + /* ignore */ + } + } + + // Next clear the map. + remoteContentMap.clear(); + } + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/RepositoryException.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/RepositoryException.java new file mode 100644 index 000000000..07d9159cd --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/RepositoryException.java @@ -0,0 +1,52 @@ +package org.apache.maven.archiva.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. + */ + +/** + * RepositoryException + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class RepositoryException + extends Exception +{ + + public RepositoryException() + { + super(); + } + + public RepositoryException( String message, Throwable cause ) + { + super( message, cause ); + } + + public RepositoryException( String message ) + { + super( message ); + } + + public RepositoryException( Throwable cause ) + { + super( cause ); + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/RepositoryNotFoundException.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/RepositoryNotFoundException.java new file mode 100644 index 000000000..9fb7e1cca --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/RepositoryNotFoundException.java @@ -0,0 +1,50 @@ +package org.apache.maven.archiva.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. + */ + +/** + * RepositoryNotFoundException + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class RepositoryNotFoundException + extends RepositoryException +{ + + public RepositoryNotFoundException() + { + } + + public RepositoryNotFoundException( String message, Throwable cause ) + { + super( message, cause ); + } + + public RepositoryNotFoundException( String message ) + { + super( message ); + } + + public RepositoryNotFoundException( Throwable cause ) + { + super( cause ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/audit/AuditEvent.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/audit/AuditEvent.java new file mode 100644 index 000000000..78408592e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/audit/AuditEvent.java @@ -0,0 +1,122 @@ +package org.apache.maven.archiva.repository.audit; + +/* + * 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. + */ + +/** + * AuditEvent + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class AuditEvent +{ + public static final String CREATE_DIR = "Created Directory"; + + public static final String CREATE_FILE = "Created File"; + + public static final String REMOVE_DIR = "Removed Directory"; + + public static final String REMOVE_FILE = "Removed File"; + + public static final String MODIFY_FILE = "Modified File"; + + public static final String MOVE_FILE = "Moved File"; + + public static final String MOVE_DIRECTORY = "Moved Directory"; + + public static final String COPY_DIRECTORY = "Copied Directory"; + + public static final String COPY_FILE = "Copied File"; + + public static final String UPLOAD_FILE = "Uploaded File"; + + private String repositoryId; + + private String userId; + + private String remoteIP; + + private String resource; + + private String action; + + public AuditEvent() + { + /* do nothing */ + } + + public AuditEvent( String repoId, String user, String resource, String action ) + { + this.repositoryId = repoId; + this.userId = user; + this.resource = resource; + this.action = action; + } + + public String getRepositoryId() + { + return repositoryId; + } + + public void setRepositoryId( String repositoryId ) + { + this.repositoryId = repositoryId; + } + + public String getUserId() + { + return userId; + } + + public void setUserId( String userId ) + { + this.userId = userId; + } + + public String getResource() + { + return resource; + } + + public void setResource( String resource ) + { + this.resource = resource; + } + + public String getAction() + { + return action; + } + + public void setAction( String action ) + { + this.action = action; + } + + public String getRemoteIP() + { + return remoteIP; + } + + public void setRemoteIP( String remoteIP ) + { + this.remoteIP = remoteIP; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/audit/AuditListener.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/audit/AuditListener.java new file mode 100644 index 000000000..7335e9662 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/audit/AuditListener.java @@ -0,0 +1,36 @@ +package org.apache.maven.archiva.repository.audit; + +/* + * 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. + */ + +/** + * AuditListener + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public interface AuditListener +{ + /** + * Notification that an audit event occured. + * + * @param event the event details. + */ + public void auditEvent( AuditEvent event ); +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/audit/AuditLog.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/audit/AuditLog.java new file mode 100644 index 000000000..3118fe597 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/audit/AuditLog.java @@ -0,0 +1,57 @@ +package org.apache.maven.archiva.repository.audit; + +/* + * 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.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * AuditLog - Audit Log. + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component role="org.apache.maven.archiva.repository.audit.AuditListener" + * role-hint="logging" + */ +public class AuditLog + implements AuditListener +{ + public static final Logger logger = LoggerFactory.getLogger( "org.apache.archiva.AuditLog" ); + + private static final char DELIM = ' '; + + /** + * Creates a log message in the following format ... + * + * "{repository_id} {user_id} {remote_ip} \"{resource}\" \"{action}\"" + */ + public void auditEvent( AuditEvent event ) + { + StringBuffer msg = new StringBuffer(); + msg.append( event.getRepositoryId() ).append( DELIM ); + msg.append( event.getUserId() ).append( DELIM ); + msg.append( event.getRemoteIP() ).append( DELIM ); + msg.append( '\"' ).append( event.getResource() ).append( '\"' ).append( DELIM ); + msg.append( '\"' ).append( event.getAction() ).append( '\"' ); + + logger.info( msg.toString() ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/audit/Auditable.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/audit/Auditable.java new file mode 100644 index 000000000..949d2c394 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/audit/Auditable.java @@ -0,0 +1,48 @@ +package org.apache.maven.archiva.repository.audit; + +/* + * 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. + */ + +/** + * Auditable + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public interface Auditable +{ + /** + * Add an AuditListener. + * + * @param the listener to add. + */ + public void addAuditListener( AuditListener auditListener ); + + /** + * Remove an AuditListener. + * + * @param the listener to remove. + */ + public void removeAuditListener( AuditListener auditListener ); + + /** + * Remove all registered {@link AuditListener} objects. + */ + public void clearAuditListeners(); +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/connector/RepositoryConnector.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/connector/RepositoryConnector.java new file mode 100644 index 000000000..5aee6b2cc --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/connector/RepositoryConnector.java @@ -0,0 +1,42 @@ +package org.apache.maven.archiva.repository.connector; + +/* + * 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.archiva.repository.ManagedRepositoryContent; +import org.apache.maven.archiva.repository.RemoteRepositoryContent; + +import java.util.List; + +/** + * RepositoryConnector + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public interface RepositoryConnector +{ + public ManagedRepositoryContent getSourceRepository(); + + public RemoteRepositoryContent getTargetRepository(); + + public List getBlacklist(); + + public List getWhitelist(); +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/AbstractDefaultRepositoryContent.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/AbstractDefaultRepositoryContent.java new file mode 100644 index 000000000..7ee03d16a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/AbstractDefaultRepositoryContent.java @@ -0,0 +1,136 @@ +package org.apache.maven.archiva.repository.content; + +/* + * 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.maven.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.maven.archiva.repository.layout.LayoutException; + +/** + * AbstractDefaultRepositoryContent - common methods for working with default (maven 2) layout. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public abstract class AbstractDefaultRepositoryContent +{ + public static final String MAVEN_METADATA = "maven-metadata.xml"; + + protected static final char PATH_SEPARATOR = '/'; + + protected static final char GROUP_SEPARATOR = '.'; + + protected static final char ARTIFACT_SEPARATOR = '-'; + + private PathParser defaultPathParser = new DefaultPathParser(); + + public ArtifactReference toArtifactReference( String path ) + throws LayoutException + { + return defaultPathParser.toArtifactReference( path ); + } + + public String toMetadataPath( ProjectReference reference ) + { + StringBuffer path = new StringBuffer(); + + path.append( formatAsDirectory( reference.getGroupId() ) ).append( PATH_SEPARATOR ); + path.append( reference.getArtifactId() ).append( PATH_SEPARATOR ); + path.append( MAVEN_METADATA ); + + return path.toString(); + } + + public String toMetadataPath( VersionedReference reference ) + { + StringBuffer path = new StringBuffer(); + + path.append( formatAsDirectory( reference.getGroupId() ) ).append( PATH_SEPARATOR ); + path.append( reference.getArtifactId() ).append( PATH_SEPARATOR ); + if ( reference.getVersion() != null ) + { + // add the version only if it is present + path.append( VersionUtil.getBaseVersion( reference.getVersion() ) ).append( PATH_SEPARATOR ); + } + path.append( MAVEN_METADATA ); + + return path.toString(); + } + + public String toPath( ArchivaArtifact reference ) + { + if ( reference == null ) + { + throw new IllegalArgumentException( "ArchivaArtifact cannot be null" ); + } + + String baseVersion = VersionUtil.getBaseVersion( reference.getVersion() ); + return toPath( reference.getGroupId(), reference.getArtifactId(), baseVersion, reference.getVersion(), + reference.getClassifier(), reference.getType() ); + } + + public String toPath( ArtifactReference reference ) + { + if ( reference == null ) + { + throw new IllegalArgumentException( "Artifact reference cannot be null" ); + } + + String baseVersion = VersionUtil.getBaseVersion( reference.getVersion() ); + return toPath( reference.getGroupId(), reference.getArtifactId(), baseVersion, reference.getVersion(), + reference.getClassifier(), reference.getType() ); + } + + private String formatAsDirectory( String directory ) + { + return directory.replace( GROUP_SEPARATOR, PATH_SEPARATOR ); + } + + private String toPath( String groupId, String artifactId, String baseVersion, String version, String classifier, + String type ) + { + StringBuffer path = new StringBuffer(); + + path.append( formatAsDirectory( groupId ) ).append( PATH_SEPARATOR ); + path.append( artifactId ).append( PATH_SEPARATOR ); + + if ( baseVersion != null ) + { + path.append( baseVersion ).append( PATH_SEPARATOR ); + if ( ( version != null ) && ( type != null ) ) + { + path.append( artifactId ).append( ARTIFACT_SEPARATOR ).append( version ); + + if ( StringUtils.isNotBlank( classifier ) ) + { + path.append( ARTIFACT_SEPARATOR ).append( classifier ); + } + + path.append( GROUP_SEPARATOR ).append( ArtifactExtensionMapping.getExtension( type ) ); + } + } + + return path.toString(); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/AbstractLegacyRepositoryContent.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/AbstractLegacyRepositoryContent.java new file mode 100644 index 000000000..f135d5aad --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/AbstractLegacyRepositoryContent.java @@ -0,0 +1,120 @@ +package org.apache.maven.archiva.repository.content; + +/* + * 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.maven.archiva.model.ArchivaArtifact; +import org.apache.maven.archiva.model.ArtifactReference; +import org.apache.maven.archiva.repository.layout.LayoutException; + +import java.util.HashMap; +import java.util.Map; + +/** + * AbstractLegacyRepositoryContent + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public abstract class AbstractLegacyRepositoryContent +{ + private static final String PATH_SEPARATOR = "/"; + + private static final Map typeToDirectoryMap; + + static + { + typeToDirectoryMap = new HashMap(); + typeToDirectoryMap.put( "ejb-client", "ejb" ); + typeToDirectoryMap.put( ArtifactExtensionMapping.MAVEN_PLUGIN, "maven-plugin" ); + typeToDirectoryMap.put( ArtifactExtensionMapping.MAVEN_ONE_PLUGIN, "plugin" ); + typeToDirectoryMap.put( "distribution-tgz", "distribution" ); + typeToDirectoryMap.put( "distribution-zip", "distribution" ); + typeToDirectoryMap.put( "javadoc", "javadoc.jar" ); + } + + /** + * @plexus.requirement role-hint="legacy" + */ + private PathParser legacyPathParser; + + public ArtifactReference toArtifactReference( String path ) + throws LayoutException + { + return legacyPathParser.toArtifactReference( path ); + } + + public String toPath( ArchivaArtifact reference ) + { + if ( reference == null ) + { + throw new IllegalArgumentException( "Artifact reference cannot be null" ); + } + + return toPath( reference.getGroupId(), reference.getArtifactId(), reference.getVersion(), reference + .getClassifier(), reference.getType() ); + } + + public String toPath( ArtifactReference reference ) + { + if ( reference == null ) + { + throw new IllegalArgumentException( "Artifact reference cannot be null" ); + } + + return toPath( reference.getGroupId(), reference.getArtifactId(), reference.getVersion(), reference + .getClassifier(), reference.getType() ); + } + + private String toPath( String groupId, String artifactId, String version, String classifier, String type ) + { + StringBuffer path = new StringBuffer(); + + path.append( groupId ).append( PATH_SEPARATOR ); + path.append( getDirectory( classifier, type ) ).append( PATH_SEPARATOR ); + + if ( version != null ) + { + path.append( artifactId ).append( '-' ).append( version ); + + if ( StringUtils.isNotBlank( classifier ) ) + { + path.append( '-' ).append( classifier ); + } + + path.append( '.' ).append( ArtifactExtensionMapping.getExtension( type ) ); + } + + return path.toString(); + } + + private String getDirectory( String classifier, String type ) + { + String dirname = (String) typeToDirectoryMap.get( type ); + + if ( dirname != null ) + { + return dirname + "s"; + } + + // Default process. + return type + "s"; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/ArtifactClassifierMapping.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/ArtifactClassifierMapping.java new file mode 100644 index 000000000..3e2de1812 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/ArtifactClassifierMapping.java @@ -0,0 +1,54 @@ +package org.apache.maven.archiva.repository.content; + +/* + * 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.HashMap; +import java.util.Map; + +/** + * ArtifactExtensionMapping + * + * @since 1.1 + */ +public class ArtifactClassifierMapping +{ + private static final Map typeToClassifierMap; + + static + { + typeToClassifierMap = new HashMap(); + typeToClassifierMap.put( "java-sources", "sources" ); + typeToClassifierMap.put( "javadoc.jars", "javadoc" ); + typeToClassifierMap.put( "javadocs", "javadoc" ); + } + + public static String getClassifier( String type ) + { + // Try specialized types first. + if ( typeToClassifierMap.containsKey( type ) ) + { + return (String) typeToClassifierMap.get( type ); + } + + // No classifier + return null; + } +} + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/ArtifactExtensionMapping.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/ArtifactExtensionMapping.java new file mode 100644 index 000000000..e7cd021a8 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/ArtifactExtensionMapping.java @@ -0,0 +1,124 @@ +package org.apache.maven.archiva.repository.content; + +/* + * 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.HashMap; +import java.util.Map; +import java.util.regex.Pattern; + +/** + * ArtifactExtensionMapping + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ArtifactExtensionMapping +{ + public static final String MAVEN_ARCHETYPE = "maven-archetype"; + + public static final String MAVEN_PLUGIN = "maven-plugin"; + + public static final String MAVEN_ONE_PLUGIN = "maven-one-plugin"; + + private static final Map typeToExtensionMap; + + private static final Pattern mavenPluginPattern = Pattern.compile( "^(maven-.*-plugin)|(.*-maven-plugin)$" ); + + static + { + typeToExtensionMap = new HashMap(); + typeToExtensionMap.put( "ejb-client", "jar" ); + typeToExtensionMap.put( "ejb", "jar" ); + typeToExtensionMap.put( "distribution-tgz", "tar.gz" ); + typeToExtensionMap.put( "distribution-zip", "zip" ); + typeToExtensionMap.put( "java-source", "jar" ); + typeToExtensionMap.put( "javadoc.jar", "jar" ); + typeToExtensionMap.put( "javadoc", "jar" ); + typeToExtensionMap.put( "aspect", "jar" ); + typeToExtensionMap.put( "uberjar", "jar" ); + typeToExtensionMap.put( MAVEN_PLUGIN, "jar" ); + typeToExtensionMap.put( MAVEN_ONE_PLUGIN, "jar" ); + typeToExtensionMap.put( MAVEN_ARCHETYPE, "jar" ); + } + + public static String getExtension( String type ) + { + // Try specialized types first. + if ( typeToExtensionMap.containsKey( type ) ) + { + return (String) typeToExtensionMap.get( type ); + } + + // Return type + return type; + } + + /** + * Determine if a given artifact Id conforms to the naming scheme for a maven plugin. + * + * @param artifactId the artifactId to test. + * @return true if this artifactId conforms to the naming scheme for a maven plugin. + */ + public static boolean isMavenPlugin( String artifactId ) + { + return mavenPluginPattern.matcher( artifactId ).matches(); + } + + public static String mapExtensionAndClassifierToType( String classifier, String extension ) + { + return mapExtensionAndClassifierToType( classifier, extension, extension ); + } + + public static String mapExtensionAndClassifierToType( String classifier, String extension, + String defaultExtension ) + { + if ( "sources".equals( classifier ) ) + { + return "java-source"; + } + else if ( "javadoc".equals( classifier ) ) + { + return "javadoc"; + } + return mapExtensionToType( extension, defaultExtension ); + } + + public static String mapExtensionToType( String extension ) + { + return mapExtensionToType( extension, extension ); + } + + private static String mapExtensionToType( String extension, String defaultExtension ) + { + if ( "tar.gz".equals( extension ) ) + { + return "distribution-tgz"; + } + else if ( "tar.bz2".equals( extension ) ) + { + return "distribution-bzip"; + } + else if ( "zip".equals( extension ) ) + { + return "distribution-zip"; + } + return defaultExtension; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/DefaultPathParser.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/DefaultPathParser.java new file mode 100644 index 000000000..a6674c31e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/DefaultPathParser.java @@ -0,0 +1,205 @@ +package org.apache.maven.archiva.repository.content; + +/* + * 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.maven.archiva.common.utils.VersionUtil; +import org.apache.maven.archiva.model.ArtifactReference; +import org.apache.maven.archiva.repository.layout.LayoutException; + +/** + * DefaultPathParser is a parser for maven 2 (default layout) paths to ArtifactReference. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class DefaultPathParser implements PathParser +{ + private static final String INVALID_ARTIFACT_PATH = "Invalid path to Artifact: "; + + /** + * {@inheritDoc} + * @see org.apache.maven.archiva.repository.content.PathParser#toArtifactReference(java.lang.String) + */ + public ArtifactReference toArtifactReference( String path ) + throws LayoutException + { + if ( StringUtils.isBlank( path ) ) + { + throw new LayoutException( "Unable to convert blank path." ); + } + + ArtifactReference artifact = new ArtifactReference(); + + String normalizedPath = StringUtils.replace( path, "\\", "/" ); + String pathParts[] = StringUtils.split( normalizedPath, '/' ); + + /* Minimum parts. + * + * path = "commons-lang/commons-lang/2.1/commons-lang-2.1.jar" + * path[0] = "commons-lang"; // The Group ID + * path[1] = "commons-lang"; // The Artifact ID + * path[2] = "2.1"; // The Version + * path[3] = "commons-lang-2.1.jar" // The filename. + */ + + if ( pathParts.length < 4 ) + { + // Illegal Path Parts Length. + throw new LayoutException( "Not enough parts to the path [" + path + + "] to construct an ArchivaArtifact from. (Requires at least 4 parts)" ); + } + + // Maven 2.x path. + int partCount = pathParts.length; + int filenamePos = partCount - 1; + int baseVersionPos = partCount - 2; + int artifactIdPos = partCount - 3; + int groupIdPos = partCount - 4; + + // Second to last is the baseVersion (the directory version) + String baseVersion = pathParts[baseVersionPos]; + + // Third to last is the artifact Id. + artifact.setArtifactId( pathParts[artifactIdPos] ); + + // Remaining pieces are the groupId. + for ( int i = 0; i <= groupIdPos; i++ ) + { + if ( i == 0 ) + { + artifact.setGroupId( pathParts[i] ); + } + else + { + artifact.setGroupId( artifact.getGroupId() + "." + pathParts[i] ); + } + } + + try + { + // Last part is the filename + String filename = pathParts[filenamePos]; + + // Now we need to parse the filename to get the artifact version Id. + if ( StringUtils.isBlank( filename ) ) + { + throw new IllegalArgumentException( INVALID_ARTIFACT_PATH + "Unable to split blank filename." ); + } + + FilenameParser parser = new FilenameParser( filename ); + + // Expect the filename to start with the artifactId. + artifact.setArtifactId( parser.expect( artifact.getArtifactId() ) ); + + if ( artifact.getArtifactId() == null ) + { + throw new LayoutException( INVALID_ARTIFACT_PATH + "filename format is invalid, " + + "should start with artifactId as stated in path." ); + } + + // Process the version. + artifact.setVersion( parser.expect( baseVersion ) ); + + if ( artifact.getVersion() == null ) + { + // We working with a snapshot? + if ( VersionUtil.isSnapshot( baseVersion ) ) + { + artifact.setVersion( parser.nextVersion() ); + if ( !VersionUtil.isUniqueSnapshot( artifact.getVersion() ) ) + { + throw new LayoutException( INVALID_ARTIFACT_PATH + "filename format is invalid," + + "expected timestamp format in filename." ); + } + } + else + { + throw new LayoutException( INVALID_ARTIFACT_PATH + "filename format is invalid, " + + "expected version as stated in path." ); + } + } + + // Do we have a classifier? + switch(parser.seperator()) + { + case '-': + // Definately a classifier. + artifact.setClassifier( parser.remaining() ); + + // Set the type. + artifact.setType( ArtifactExtensionMapping.mapExtensionAndClassifierToType( artifact.getClassifier(), parser.getExtension() ) ); + break; + case '.': + // We have an dual extension possibility. + String extension = parser.remaining() + '.' + parser.getExtension(); + artifact.setType( extension ); + break; + case 0: + // End of the filename, only a simple extension left. - Set the type. + String type = ArtifactExtensionMapping.mapExtensionToType( parser.getExtension() ); + if ( type == null ) + { + throw new LayoutException( "Invalid artifact: no type was specified" ); + } + artifact.setType( type ); + break; + } + + // Special case for maven plugins + if ( StringUtils.equals( "jar", artifact.getType() ) && + ArtifactExtensionMapping.isMavenPlugin( artifact.getArtifactId() ) ) + { + artifact.setType( ArtifactExtensionMapping.MAVEN_PLUGIN ); + } + } + catch ( LayoutException e ) + { + throw e; + } + + // Sanity Checks. + + // Do we have a snapshot version? + if ( VersionUtil.isSnapshot( artifact.getVersion() ) ) + { + // Rules are different for SNAPSHOTS + if ( !VersionUtil.isGenericSnapshot( baseVersion ) ) + { + String filenameBaseVersion = VersionUtil.getBaseVersion( artifact.getVersion() ); + throw new LayoutException( "Invalid snapshot artifact location, version directory should be " + + filenameBaseVersion ); + } + } + else + { + // Non SNAPSHOT rules. + // Do we pass the simple test? + if ( !StringUtils.equals( baseVersion, artifact.getVersion() ) ) + { + throw new LayoutException( "Invalid artifact: version declared in directory path does" + + " not match what was found in the artifact filename." ); + } + } + + return artifact; + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/FilenameParser.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/FilenameParser.java new file mode 100644 index 000000000..fa49e5d14 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/FilenameParser.java @@ -0,0 +1,259 @@ +package org.apache.maven.archiva.repository.content; + +/* + * 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.archiva.common.utils.VersionUtil; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * Generic Filename Parser for use with layout routines. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class FilenameParser +{ + private String name; + + private String extension; + + private int offset; + + private static final Pattern mavenPluginPattern = Pattern.compile( "(maven-.*-plugin)|(.*-maven-plugin)" ); + + private static final Pattern extensionPattern = + Pattern.compile( "(\\.tar\\.gz$)|(\\.tar\\.bz2$)|(\\.[\\-a-z0-9]*$)", Pattern.CASE_INSENSITIVE ); + + private static final Pattern SNAPSHOT_PATTERN = Pattern.compile( "^([0-9]{8}\\.[0-9]{6}-[0-9]+)(.*)$" ); + + private static final Pattern section = Pattern.compile( "([^-]*)" ); + + private Matcher matcher; + + protected FilenameParser( String filename ) + { + this.name = filename; + + Matcher mat = extensionPattern.matcher( name ); + if ( mat.find() ) + { + extension = filename.substring( mat.start() + 1 ); + name = name.substring( 0, name.length() - extension.length() - 1 ); + } + + matcher = section.matcher( name ); + + reset(); + } + + protected void reset() + { + offset = 0; + } + + protected String next() + { + // Past the end of the string. + if ( offset > name.length() ) + { + return null; + } + + // Return the next section. + if ( matcher.find( offset ) ) + { + // Return found section. + offset = matcher.end() + 1; + return matcher.group(); + } + + // Nothing to return. + return null; + } + + protected String expect( String expected ) + { + String value = null; + + if ( name.startsWith( expected, offset ) ) + { + value = expected; + } + else if ( VersionUtil.isGenericSnapshot( expected ) ) + { + String version = name.substring( offset ); + + // check it starts with the same version up to the snapshot part + int leadingLength = expected.length() - 9; + if ( version.startsWith( expected.substring( 0, leadingLength ) ) && version.length() > leadingLength ) + { + // If we expect a non-generic snapshot - look for the timestamp + Matcher m = SNAPSHOT_PATTERN.matcher( version.substring( leadingLength + 1 ) ); + if ( m.matches() ) + { + value = version.substring( 0, leadingLength + 1 ) + m.group( 1 ); + } + } + } + + if ( value != null ) + { + // Potential hit. check for '.' or '-' at end of expected. + int seperatorOffset = offset + value.length(); + + // Test for "out of bounds" first. + if ( seperatorOffset >= name.length() ) + { + offset = name.length(); + return value; + } + + // Test for seperator char. + char seperatorChar = name.charAt( seperatorOffset ); + if ( ( seperatorChar == '-' ) || ( seperatorChar == '.' ) ) + { + offset = seperatorOffset + 1; + return value; + } + } + + return null; + } + + /** + * Get the current seperator character. + * + * @return the seperator character (either '.' or '-'), or 0 if no seperator character available. + */ + protected char seperator() + { + // Past the end of the string? + if ( offset >= name.length() ) + { + return 0; + } + + // Before the start of the string? + if ( offset <= 0 ) + { + return 0; + } + + return name.charAt( offset - 1 ); + } + + protected String getName() + { + return name; + } + + protected String getExtension() + { + return extension; + } + + protected String remaining() + { + if ( offset >= name.length() ) + { + return null; + } + + String end = name.substring( offset ); + offset = name.length(); + return end; + } + + protected String nextNonVersion() + { + boolean done = false; + + StringBuffer ver = new StringBuffer(); + + // Any text upto the end of a special case is considered non-version. + Matcher specialMat = mavenPluginPattern.matcher( name ); + if ( specialMat.find() ) + { + ver.append( name.substring( offset, specialMat.end() ) ); + offset = specialMat.end() + 1; + } + + while ( !done ) + { + int initialOffset = offset; + String section = next(); + if ( section == null ) + { + done = true; + } + else if ( !VersionUtil.isVersion( section ) ) + { + if ( ver.length() > 0 ) + { + ver.append( '-' ); + } + ver.append( section ); + } + else + { + offset = initialOffset; + done = true; + } + } + + return ver.toString(); + } + + protected String nextVersion() + { + boolean done = false; + + StringBuffer ver = new StringBuffer(); + + while ( !done ) + { + int initialOffset = offset; + String section = next(); + if ( section == null ) + { + done = true; + } + else if ( VersionUtil.isVersion( section ) ) + { + if ( ver.length() > 0 ) + { + ver.append( '-' ); + } + ver.append( section ); + } + else + { + offset = initialOffset; + done = true; + } + } + + return ver.toString(); + } + + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/LegacyPathParser.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/LegacyPathParser.java new file mode 100644 index 000000000..99a8de4d6 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/LegacyPathParser.java @@ -0,0 +1,212 @@ +package org.apache.maven.archiva.repository.content; + +/* + * 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.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.LegacyArtifactPath; +import org.apache.maven.archiva.model.ArtifactReference; +import org.apache.maven.archiva.repository.layout.LayoutException; + +import java.util.Collection; +import java.util.Iterator; + +/** + * LegacyPathParser is a parser for maven 1 (legacy layout) paths to + * ArtifactReference. + * + * @author Joakim Erdfelt + * @version $Id$ + * @plexus.component role="org.apache.maven.archiva.repository.content.PathParser" + * role-hint="legacy" + */ +public class LegacyPathParser + implements PathParser +{ + private static final String INVALID_ARTIFACT_PATH = "Invalid path to Artifact: "; + + /** + * @todo pass these in on construction instead, since this can't be long lived (no config listener), then no need to be a component + * @plexus.requirement + */ + protected ArchivaConfiguration configuration; + + /** + * {@inheritDoc} + * + * @see org.apache.maven.archiva.repository.content.PathParser#toArtifactReference(java.lang.String) + */ + public ArtifactReference toArtifactReference( String path ) + throws LayoutException + { + ArtifactReference artifact = new ArtifactReference(); + + // First, look if a custom resolution rule has been set for this artifact + Collection legacy = configuration.getConfiguration().getLegacyArtifactPaths(); + for ( Iterator iterator = legacy.iterator(); iterator.hasNext(); ) + { + LegacyArtifactPath legacyPath = (LegacyArtifactPath) iterator.next(); + if ( legacyPath.match( path ) ) + { + artifact.setGroupId( legacyPath.getGroupId() ); + artifact.setArtifactId( legacyPath.getArtifactId() ); + artifact.setClassifier( legacyPath.getClassifier() ); + artifact.setVersion( legacyPath.getVersion() ); + artifact.setType( legacyPath.getType() ); + return artifact; + } + } + + String normalizedPath = StringUtils.replace( path, "\\", "/" ); + + String pathParts[] = StringUtils.split( normalizedPath, '/' ); + + /* Always 3 parts. (Never more or less) + * + * path = "commons-lang/jars/commons-lang-2.1.jar" + * path[0] = "commons-lang"; // The Group ID + * path[1] = "jars"; // The Directory Type + * path[2] = "commons-lang-2.1.jar"; // The Filename. + */ + + if ( pathParts.length != 3 ) + { + // Illegal Path Parts Length. + throw new LayoutException( INVALID_ARTIFACT_PATH + + "legacy paths should only have 3 parts [groupId]/[type]s/[artifactId]-[version].[type], found " + + pathParts.length + " instead." ); + } + + // The Group ID. + artifact.setGroupId( pathParts[0] ); + + // The Expected Type. + String expectedType = pathParts[1]; + + // Sanity Check: expectedType should end in "s". + if ( !expectedType.endsWith( "s" ) ) + { + throw new LayoutException( INVALID_ARTIFACT_PATH + + "legacy paths should have an expected type ending in [s] in the second part of the path." ); + } + + // The Filename. + String filename = pathParts[2]; + + FilenameParser parser = new FilenameParser( filename ); + + artifact.setArtifactId( parser.nextNonVersion() ); + + // Sanity Check: does it have an artifact id? + if ( StringUtils.isEmpty( artifact.getArtifactId() ) ) + { + // Special Case: The filename might start with a version id (like "test-arch-1.0.jar"). + int idx = filename.indexOf( '-' ); + if ( idx > 0 ) + { + parser.reset(); + // Take the first section regardless of content. + String artifactId = parser.next(); + + // Is there anything more that is considered not a version id? + String moreArtifactId = parser.nextNonVersion(); + if ( StringUtils.isNotBlank( moreArtifactId ) ) + { + artifact.setArtifactId( artifactId + "-" + moreArtifactId ); + } + else + { + artifact.setArtifactId( artifactId ); + } + } + + // Sanity Check: still no artifact id? + if ( StringUtils.isEmpty( artifact.getArtifactId() ) ) + { + throw new LayoutException( INVALID_ARTIFACT_PATH + "no artifact id present." ); + } + } + + artifact.setVersion( parser.remaining() ); + + // Sanity Check: does it have a version? + if ( StringUtils.isEmpty( artifact.getVersion() ) ) + { + // Special Case: use last section of artifactId as version. + String artifactId = artifact.getArtifactId(); + int idx = artifactId.lastIndexOf( '-' ); + if ( idx > 0 ) + { + artifact.setVersion( artifactId.substring( idx + 1 ) ); + artifact.setArtifactId( artifactId.substring( 0, idx ) ); + } + else + { + throw new LayoutException( INVALID_ARTIFACT_PATH + "no version found." ); + } + } + + String classifier = ArtifactClassifierMapping.getClassifier( expectedType ); + if ( classifier != null ) + { + String version = artifact.getVersion(); + if ( ! version.endsWith( "-" + classifier ) ) + { + throw new LayoutException( INVALID_ARTIFACT_PATH + expectedType + " artifacts must use the classifier " + classifier ); + } + version = version.substring( 0, version.length() - classifier.length() - 1 ); + artifact.setVersion( version ); + artifact.setClassifier( classifier ); + } + + String extension = parser.getExtension(); + + // Set Type + String defaultExtension = expectedType.substring( 0, expectedType.length() - 1 ); + artifact.setType( + ArtifactExtensionMapping.mapExtensionAndClassifierToType( classifier, extension, defaultExtension ) ); + + // Sanity Check: does it have an extension? + if ( StringUtils.isEmpty( artifact.getType() ) ) + { + throw new LayoutException( INVALID_ARTIFACT_PATH + "no extension found." ); + } + + // Special Case with Maven Plugins + if ( StringUtils.equals( "jar", extension ) && StringUtils.equals( "plugins", expectedType ) ) + { + artifact.setType( ArtifactExtensionMapping.MAVEN_ONE_PLUGIN ); + } + else + { + // Sanity Check: does extension match pathType on path? + String expectedExtension = ArtifactExtensionMapping.getExtension( artifact.getType() ); + + if ( !expectedExtension.equals( extension ) ) + { + throw new LayoutException( INVALID_ARTIFACT_PATH + "mismatch on extension [" + extension + + "] and layout specified type [" + artifact.getType() + "] (which maps to extension: [" + + expectedExtension + "]) on path [" + path + "]" ); + } + } + + return artifact; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/ManagedDefaultRepositoryContent.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/ManagedDefaultRepositoryContent.java new file mode 100644 index 000000000..53bfc1bcb --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/ManagedDefaultRepositoryContent.java @@ -0,0 +1,406 @@ +package org.apache.maven.archiva.repository.content; + +/* + * 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.io.FileUtils; +import org.apache.maven.archiva.common.utils.PathUtil; +import org.apache.maven.archiva.configuration.FileTypes; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +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.maven.archiva.repository.ContentNotFoundException; +import org.apache.maven.archiva.repository.ManagedRepositoryContent; +import org.apache.maven.archiva.repository.layout.LayoutException; + +import java.io.File; +import java.io.IOException; +import java.util.HashSet; +import java.util.Set; + +/** + * ManagedDefaultRepositoryContent + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @todo no need to be a component when filetypes is not + * + * @plexus.component + * role="org.apache.maven.archiva.repository.ManagedRepositoryContent" + * role-hint="default" + * instantiation-strategy="per-lookup" + */ +public class ManagedDefaultRepositoryContent + extends AbstractDefaultRepositoryContent + implements ManagedRepositoryContent +{ + /** + * @plexus.requirement + */ + private FileTypes filetypes; + + private ManagedRepositoryConfiguration repository; + + public void deleteVersion( VersionedReference reference ) + throws ContentNotFoundException + { + String path = toMetadataPath( reference ); + File projectPath = new File( getRepoRoot(), path ); + + File projectDir = projectPath.getParentFile(); + if( projectDir.exists() && projectDir.isDirectory() ) + { + try + { + FileUtils.deleteDirectory( projectDir ); + } + catch ( IOException e ) + { + // TODO: log this somewhere? + } + } + } + + public String getId() + { + return repository.getId(); + } + + public Set getRelatedArtifacts( ArtifactReference reference ) + throws ContentNotFoundException, LayoutException + { + File artifactFile = toFile( reference ); + File repoDir = artifactFile.getParentFile(); + + if ( !repoDir.exists() ) + { + throw new ContentNotFoundException( "Unable to get related artifacts using a non-existant directory: " + + repoDir.getAbsolutePath() ); + } + + if ( !repoDir.isDirectory() ) + { + throw new ContentNotFoundException( "Unable to get related artifacts using a non-directory: " + + repoDir.getAbsolutePath() ); + } + + Set foundArtifacts = new HashSet(); + + // First gather up the versions found as artifacts in the managed repository. + File repoFiles[] = repoDir.listFiles(); + for ( int i = 0; i < repoFiles.length; i++ ) + { + if ( repoFiles[i].isDirectory() ) + { + // Skip it. it's a directory. + continue; + } + + String relativePath = PathUtil.getRelative( repository.getLocation(), repoFiles[i] ); + + if ( filetypes.matchesArtifactPattern( relativePath ) ) + { + ArtifactReference artifact = toArtifactReference( relativePath ); + + // Test for related, groupId / artifactId / version must match. + if ( artifact.getGroupId().equals( reference.getGroupId() ) + && artifact.getArtifactId().equals( reference.getArtifactId() ) + && artifact.getVersion().equals( reference.getVersion() ) ) + { + foundArtifacts.add( artifact ); + } + } + } + + return foundArtifacts; + } + + public String getRepoRoot() + { + return repository.getLocation(); + } + + public ManagedRepositoryConfiguration getRepository() + { + return repository; + } + + /** + * Gather the Available Versions (on disk) for a specific Project Reference, based on filesystem + * information. + * + * @return the Set of available versions, based on the project reference. + * @throws LayoutException + * @throws LayoutException + */ + public Set getVersions( ProjectReference reference ) + throws ContentNotFoundException, LayoutException + { + String path = toMetadataPath( reference ); + + int idx = path.lastIndexOf( '/' ); + if ( idx > 0 ) + { + path = path.substring( 0, idx ); + } + + File repoDir = new File( repository.getLocation(), path ); + + if ( !repoDir.exists() ) + { + throw new ContentNotFoundException( "Unable to get Versions on a non-existant directory: " + + repoDir.getAbsolutePath() ); + } + + if ( !repoDir.isDirectory() ) + { + throw new ContentNotFoundException( "Unable to get Versions on a non-directory: " + + repoDir.getAbsolutePath() ); + } + + Set foundVersions = new HashSet(); + VersionedReference versionRef = new VersionedReference(); + versionRef.setGroupId( reference.getGroupId() ); + versionRef.setArtifactId( reference.getArtifactId() ); + + File repoFiles[] = repoDir.listFiles(); + for ( int i = 0; i < repoFiles.length; i++ ) + { + if ( !repoFiles[i].isDirectory() ) + { + // Skip it. not a directory. + continue; + } + + // Test if dir has an artifact, which proves to us that it is a valid version directory. + String version = repoFiles[i].getName(); + versionRef.setVersion( version ); + + if ( hasArtifact( versionRef ) ) + { + // Found an artifact, must be a valid version. + foundVersions.add( version ); + } + } + + return foundVersions; + } + + public Set getVersions( VersionedReference reference ) + throws ContentNotFoundException, LayoutException + { + String path = toMetadataPath( reference ); + + int idx = path.lastIndexOf( '/' ); + if ( idx > 0 ) + { + path = path.substring( 0, idx ); + } + + File repoDir = new File( repository.getLocation(), path ); + + if ( !repoDir.exists() ) + { + throw new ContentNotFoundException( "Unable to get versions on a non-existant directory: " + + repoDir.getAbsolutePath() ); + } + + if ( !repoDir.isDirectory() ) + { + throw new ContentNotFoundException( "Unable to get versions on a non-directory: " + + repoDir.getAbsolutePath() ); + } + + Set foundVersions = new HashSet(); + + // First gather up the versions found as artifacts in the managed repository. + File repoFiles[] = repoDir.listFiles(); + for ( int i = 0; i < repoFiles.length; i++ ) + { + if ( repoFiles[i].isDirectory() ) + { + // Skip it. it's a directory. + continue; + } + + String relativePath = PathUtil.getRelative( repository.getLocation(), repoFiles[i] ); + + if ( filetypes.matchesDefaultExclusions( relativePath ) ) + { + // Skip it, it's metadata or similar + continue; + } + + if ( filetypes.matchesArtifactPattern( relativePath ) ) + { + ArtifactReference artifact = toArtifactReference( relativePath ); + + foundVersions.add( artifact.getVersion() ); + } + } + + return foundVersions; + } + + public boolean hasContent( ArtifactReference reference ) + { + File artifactFile = toFile( reference ); + return artifactFile.exists() && artifactFile.isFile(); + } + + public boolean hasContent( ProjectReference reference ) + { + try + { + Set versions = getVersions( reference ); + return !versions.isEmpty(); + } + catch ( ContentNotFoundException e ) + { + return false; + } + catch ( LayoutException e ) + { + return false; + } + } + + public boolean hasContent( VersionedReference reference ) + { + try + { + return ( getFirstArtifact( reference ) != null ); + } + catch ( IOException e ) + { + return false; + } + catch ( LayoutException e ) + { + return false; + } + } + + public void setRepository( ManagedRepositoryConfiguration repository ) + { + this.repository = repository; + } + + /** + * Convert a path to an artifact reference. + * + * @param path the path to convert. (relative or full location path) + * @throws LayoutException if the path cannot be converted to an artifact reference. + */ + @Override + public ArtifactReference toArtifactReference( String path ) + throws LayoutException + { + if ( ( path != null ) && path.startsWith( repository.getLocation() ) ) + { + return super.toArtifactReference( path.substring( repository.getLocation().length() ) ); + } + + return super.toArtifactReference( path ); + } + + public File toFile( ArtifactReference reference ) + { + return new File( repository.getLocation(), toPath( reference ) ); + } + + public File toFile( ArchivaArtifact reference ) + { + return new File( repository.getLocation(), toPath( reference ) ); + } + + /** + * Get the first Artifact found in the provided VersionedReference location. + * + * @param managedRepository the repository to search within. + * @param reference the reference to the versioned reference to search within + * @return the ArtifactReference to the first artifact located within the versioned reference. or null if + * no artifact was found within the versioned reference. + * @throws IOException if the versioned reference is invalid (example: doesn't exist, or isn't a directory) + * @throws LayoutException + */ + private ArtifactReference getFirstArtifact( VersionedReference reference ) + throws LayoutException, IOException + { + String path = toMetadataPath( reference ); + + int idx = path.lastIndexOf( '/' ); + if ( idx > 0 ) + { + path = path.substring( 0, idx ); + } + + File repoDir = new File( repository.getLocation(), path ); + + if ( !repoDir.exists() ) + { + throw new IOException( "Unable to gather the list of snapshot versions on a non-existant directory: " + + repoDir.getAbsolutePath() ); + } + + if ( !repoDir.isDirectory() ) + { + throw new IOException( "Unable to gather the list of snapshot versions on a non-directory: " + + repoDir.getAbsolutePath() ); + } + + File repoFiles[] = repoDir.listFiles(); + for ( int i = 0; i < repoFiles.length; i++ ) + { + if ( repoFiles[i].isDirectory() ) + { + // Skip it. it's a directory. + continue; + } + + String relativePath = PathUtil.getRelative( repository.getLocation(), repoFiles[i] ); + + if ( filetypes.matchesArtifactPattern( relativePath ) ) + { + ArtifactReference artifact = toArtifactReference( relativePath ); + + return artifact; + } + } + + // No artifact was found. + return null; + } + + private boolean hasArtifact( VersionedReference reference ) + throws LayoutException + { + try + { + return ( getFirstArtifact( reference ) != null ); + } + catch ( IOException e ) + { + return false; + } + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/ManagedLegacyRepositoryContent.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/ManagedLegacyRepositoryContent.java new file mode 100644 index 000000000..6b59d86f3 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/ManagedLegacyRepositoryContent.java @@ -0,0 +1,457 @@ +package org.apache.maven.archiva.repository.content; + +/* + * 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.collections.CollectionUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.maven.archiva.common.utils.PathUtil; +import org.apache.maven.archiva.configuration.FileTypes; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +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.maven.archiva.repository.ContentNotFoundException; +import org.apache.maven.archiva.repository.ManagedRepositoryContent; +import org.apache.maven.archiva.repository.layout.LayoutException; + +import java.io.File; +import java.util.HashSet; +import java.util.Set; + +/** + * ManagedLegacyRepositoryContent + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @todo no need to be a component when filetypes, legacy path parser is not + * + * @plexus.component + * role="org.apache.maven.archiva.repository.ManagedRepositoryContent" + * role-hint="legacy" + * instantiation-strategy="per-lookup" + */ +public class ManagedLegacyRepositoryContent + extends AbstractLegacyRepositoryContent + implements ManagedRepositoryContent +{ + /** + * @plexus.requirement + */ + private FileTypes filetypes; + + private ManagedRepositoryConfiguration repository; + + public void deleteVersion( VersionedReference reference ) + throws ContentNotFoundException + { + File groupDir = new File( repository.getLocation(), reference.getGroupId() ); + + if ( !groupDir.exists() ) + { + throw new ContentNotFoundException( "Unable to get versions using a non-existant groupId directory: " + + groupDir.getAbsolutePath() ); + } + + if ( !groupDir.isDirectory() ) + { + throw new ContentNotFoundException( "Unable to get versions using a non-directory: " + + groupDir.getAbsolutePath() ); + } + + // First gather up the versions found as artifacts in the managed repository. + File typeDirs[] = groupDir.listFiles(); + for ( File typeDir : typeDirs ) + { + if ( !typeDir.isDirectory() ) + { + // Skip it, we only care about directories. + continue; + } + + if ( !typeDir.getName().endsWith( "s" ) ) + { + // Skip it, we only care about directories that end in "s". + } + + deleteVersions( typeDir, reference ); + } + } + + private void deleteVersions( File typeDir, VersionedReference reference ) + { + File repoFiles[] = typeDir.listFiles(); + for ( File repoFile : repoFiles ) + { + if ( repoFile.isDirectory() ) + { + // Skip it. it's a directory. + continue; + } + + String relativePath = PathUtil.getRelative( repository.getLocation(), repoFile ); + + if ( filetypes.matchesArtifactPattern( relativePath ) ) + { + try + { + ArtifactReference artifact = toArtifactReference( relativePath ); + if ( StringUtils.equals( artifact.getArtifactId(), reference.getArtifactId() ) + && StringUtils.equals( artifact.getVersion(), reference.getVersion() ) ) + { + repoFile.delete(); + deleteSupportFiles( repoFile ); + } + } + catch ( LayoutException e ) + { + /* don't fail the process if there is a bad artifact within the directory. */ + } + } + } + } + + private void deleteSupportFiles( File repoFile ) + { + deleteSupportFile( repoFile, ".sha1" ); + deleteSupportFile( repoFile, ".md5" ); + deleteSupportFile( repoFile, ".asc" ); + deleteSupportFile( repoFile, ".gpg" ); + } + + private void deleteSupportFile( File repoFile, String supportExtension ) + { + File supportFile = new File( repoFile.getAbsolutePath() + supportExtension ); + if ( supportFile.exists() && supportFile.isFile() ) + { + supportFile.delete(); + } + } + + public String getId() + { + return repository.getId(); + } + + public Set getRelatedArtifacts( ArtifactReference reference ) + throws ContentNotFoundException, LayoutException + { + File artifactFile = toFile( reference ); + File repoDir = artifactFile.getParentFile(); + + if ( !repoDir.exists() ) + { + throw new ContentNotFoundException( "Unable to get related artifacts using a non-existant directory: " + + repoDir.getAbsolutePath() ); + } + + if ( !repoDir.isDirectory() ) + { + throw new ContentNotFoundException( "Unable to get related artifacts using a non-directory: " + + repoDir.getAbsolutePath() ); + } + + Set foundArtifacts = new HashSet(); + + // First gather up the versions found as artifacts in the managed repository. + File projectParentDir = repoDir.getParentFile(); + File typeDirs[] = projectParentDir.listFiles(); + for ( File typeDir : typeDirs ) + { + if ( !typeDir.isDirectory() ) + { + // Skip it, we only care about directories. + continue; + } + + if ( !typeDir.getName().endsWith( "s" ) ) + { + // Skip it, we only care about directories that end in "s". + } + + getRelatedArtifacts( typeDir, reference, foundArtifacts ); + } + + return foundArtifacts; + } + + public String getRepoRoot() + { + return repository.getLocation(); + } + + public ManagedRepositoryConfiguration getRepository() + { + return repository; + } + + public Set getVersions( ProjectReference reference ) + throws ContentNotFoundException + { + File groupDir = new File( repository.getLocation(), reference.getGroupId() ); + + if ( !groupDir.exists() ) + { + throw new ContentNotFoundException( "Unable to get versions using a non-existant groupId directory: " + + groupDir.getAbsolutePath() ); + } + + if ( !groupDir.isDirectory() ) + { + throw new ContentNotFoundException( "Unable to get versions using a non-directory: " + + groupDir.getAbsolutePath() ); + } + + Set foundVersions = new HashSet(); + + // First gather up the versions found as artifacts in the managed repository. + File typeDirs[] = groupDir.listFiles(); + for ( File typeDir : typeDirs ) + { + if ( !typeDir.isDirectory() ) + { + // Skip it, we only care about directories. + continue; + } + + if ( !typeDir.getName().endsWith( "s" ) ) + { + // Skip it, we only care about directories that end in "s". + } + + getProjectVersions( typeDir, reference, foundVersions ); + } + + return foundVersions; + } + + public Set getVersions( VersionedReference reference ) + throws ContentNotFoundException + { + File groupDir = new File( repository.getLocation(), reference.getGroupId() ); + + if ( !groupDir.exists() ) + { + throw new ContentNotFoundException( "Unable to get versions using a non-existant groupId directory: " + + groupDir.getAbsolutePath() ); + } + + if ( !groupDir.isDirectory() ) + { + throw new ContentNotFoundException( "Unable to get versions using a non-directory: " + + groupDir.getAbsolutePath() ); + } + + Set foundVersions = new HashSet(); + + // First gather up the versions found as artifacts in the managed repository. + File typeDirs[] = groupDir.listFiles(); + for ( File typeDir : typeDirs ) + { + if ( !typeDir.isDirectory() ) + { + // Skip it, we only care about directories. + continue; + } + + if ( !typeDir.getName().endsWith( "s" ) ) + { + // Skip it, we only care about directories that end in "s". + } + + getVersionedVersions( typeDir, reference, foundVersions ); + } + + return foundVersions; + } + + public boolean hasContent( ArtifactReference reference ) + { + File artifactFile = toFile( reference ); + return artifactFile.exists() && artifactFile.isFile(); + } + + public boolean hasContent( ProjectReference reference ) + { + try + { + Set versions = getVersions( reference ); + return CollectionUtils.isNotEmpty( versions ); + } + catch ( ContentNotFoundException e ) + { + return false; + } + } + + public boolean hasContent( VersionedReference reference ) + { + try + { + Set versions = getVersions( reference ); + return CollectionUtils.isNotEmpty( versions ); + } + catch ( ContentNotFoundException e ) + { + return false; + } + } + + public void setRepository( ManagedRepositoryConfiguration repository ) + { + this.repository = repository; + } + + /** + * Convert a path to an artifact reference. + * + * @param path the path to convert. (relative or full location path) + * @throws LayoutException if the path cannot be converted to an artifact reference. + */ + @Override + public ArtifactReference toArtifactReference( String path ) + throws LayoutException + { + if ( ( path != null ) && path.startsWith( repository.getLocation() ) ) + { + return super.toArtifactReference( path.substring( repository.getLocation().length() ) ); + } + + return super.toArtifactReference( path ); + } + + public File toFile( ArchivaArtifact reference ) + { + return new File( repository.getLocation(), toPath( reference ) ); + } + + public File toFile( ArtifactReference reference ) + { + return new File( repository.getLocation(), toPath( reference ) ); + } + + public String toMetadataPath( ProjectReference reference ) + { + // No metadata present in legacy repository. + return null; + } + + public String toMetadataPath( VersionedReference reference ) + { + // No metadata present in legacy repository. + return null; + } + + private void getProjectVersions( File typeDir, ProjectReference reference, Set foundVersions ) + { + File repoFiles[] = typeDir.listFiles(); + for ( File repoFile : repoFiles ) + { + if ( repoFile.isDirectory() ) + { + // Skip it. it's a directory. + continue; + } + + String relativePath = PathUtil.getRelative( repository.getLocation(), repoFile ); + + if ( filetypes.matchesArtifactPattern( relativePath ) ) + { + try + { + ArtifactReference artifact = toArtifactReference( relativePath ); + if ( StringUtils.equals( artifact.getArtifactId(), reference.getArtifactId() ) ) + { + foundVersions.add( artifact.getVersion() ); + } + } + catch ( LayoutException e ) + { + /* don't fail the process if there is a bad artifact within the directory. */ + } + } + } + } + + private void getRelatedArtifacts( File typeDir, ArtifactReference reference, Set foundArtifacts ) + { + File repoFiles[] = typeDir.listFiles(); + for ( int i = 0; i < repoFiles.length; i++ ) + { + if ( repoFiles[i].isDirectory() ) + { + // Skip it. it's a directory. + continue; + } + + String relativePath = PathUtil.getRelative( repository.getLocation(), repoFiles[i] ); + + if ( filetypes.matchesArtifactPattern( relativePath ) ) + { + try + { + ArtifactReference artifact = toArtifactReference( relativePath ); + if ( StringUtils.equals( artifact.getArtifactId(), reference.getArtifactId() ) + && artifact.getVersion().startsWith( reference.getVersion() ) ) + { + foundArtifacts.add( artifact ); + } + } + catch ( LayoutException e ) + { + /* don't fail the process if there is a bad artifact within the directory. */ + } + } + } + } + + private void getVersionedVersions( File typeDir, VersionedReference reference, Set foundVersions ) + { + File repoFiles[] = typeDir.listFiles(); + for ( int i = 0; i < repoFiles.length; i++ ) + { + if ( repoFiles[i].isDirectory() ) + { + // Skip it. it's a directory. + continue; + } + + String relativePath = PathUtil.getRelative( repository.getLocation(), repoFiles[i] ); + + if ( filetypes.matchesArtifactPattern( relativePath ) ) + { + try + { + ArtifactReference artifact = toArtifactReference( relativePath ); + if ( StringUtils.equals( artifact.getArtifactId(), reference.getArtifactId() ) + && artifact.getVersion().startsWith( reference.getVersion() ) ) + { + foundVersions.add( artifact.getVersion() ); + } + } + catch ( LayoutException e ) + { + /* don't fail the process if there is a bad artifact within the directory. */ + } + } + } + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/PathParser.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/PathParser.java new file mode 100644 index 000000000..08a7afc62 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/PathParser.java @@ -0,0 +1,44 @@ +package org.apache.maven.archiva.repository.content; + +/* + * 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.archiva.model.ArtifactReference; +import org.apache.maven.archiva.repository.layout.LayoutException; + +/** + * PathParser interface. + * + * @author nicolas de loof + * @version $Id$ + */ +public interface PathParser +{ + + /** + * Take a path and get the ArtifactReference associated with it. + * + * @param path the relative path to parse. + * @return the ArtifactReference for the provided path. (never null) + * @throws LayoutException if there was a problem parsing the path. + */ + public ArtifactReference toArtifactReference( String path ) + throws LayoutException; + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/RemoteDefaultRepositoryContent.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/RemoteDefaultRepositoryContent.java new file mode 100644 index 000000000..b8bbf725f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/RemoteDefaultRepositoryContent.java @@ -0,0 +1,88 @@ +package org.apache.maven.archiva.repository.content; + +/* + * 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.archiva.configuration.RemoteRepositoryConfiguration; +import org.apache.maven.archiva.model.ArtifactReference; +import org.apache.maven.archiva.model.RepositoryURL; +import org.apache.maven.archiva.repository.RemoteRepositoryContent; +import org.apache.maven.archiva.repository.layout.LayoutException; + +/** + * RemoteDefaultRepositoryContent + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component + * role="org.apache.maven.archiva.repository.RemoteRepositoryContent" + * role-hint="default" + * instantiation-strategy="per-lookup" + */ +public class RemoteDefaultRepositoryContent + extends AbstractDefaultRepositoryContent + implements RemoteRepositoryContent +{ + private RemoteRepositoryConfiguration repository; + + public String getId() + { + return repository.getId(); + } + + public RemoteRepositoryConfiguration getRepository() + { + return repository; + } + + public RepositoryURL getURL() + { + return new RepositoryURL( repository.getUrl() ); + } + + public void setRepository( RemoteRepositoryConfiguration repository ) + { + this.repository = repository; + } + + /** + * Convert a path to an artifact reference. + * + * @param path the path to convert. (relative or full url path) + * @throws LayoutException if the path cannot be converted to an artifact reference. + */ + @Override + public ArtifactReference toArtifactReference( String path ) + throws LayoutException + { + if ( ( path != null ) && path.startsWith( repository.getUrl() ) ) + { + return super.toArtifactReference( path.substring( repository.getUrl().length() ) ); + } + + return super.toArtifactReference( path ); + } + + public RepositoryURL toURL( ArtifactReference reference ) + { + String url = repository.getUrl() + toPath( reference ); + return new RepositoryURL( url ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/RemoteLegacyRepositoryContent.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/RemoteLegacyRepositoryContent.java new file mode 100644 index 000000000..13be1f0fe --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/RemoteLegacyRepositoryContent.java @@ -0,0 +1,90 @@ +package org.apache.maven.archiva.repository.content; + +/* + * 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.archiva.configuration.RemoteRepositoryConfiguration; +import org.apache.maven.archiva.model.ArtifactReference; +import org.apache.maven.archiva.model.RepositoryURL; +import org.apache.maven.archiva.repository.RemoteRepositoryContent; +import org.apache.maven.archiva.repository.layout.LayoutException; + +/** + * RemoteLegacyRepositoryContent + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @todo no need to be a component once legacy path parser is not + * + * @plexus.component + * role="org.apache.maven.archiva.repository.RemoteRepositoryContent" + * role-hint="legacy" + * instantiation-strategy="per-lookup" + */ +public class RemoteLegacyRepositoryContent + extends AbstractLegacyRepositoryContent + implements RemoteRepositoryContent +{ + private RemoteRepositoryConfiguration repository; + + public String getId() + { + return repository.getId(); + } + + public RemoteRepositoryConfiguration getRepository() + { + return repository; + } + + public RepositoryURL getURL() + { + return new RepositoryURL( repository.getUrl() ); + } + + public void setRepository( RemoteRepositoryConfiguration repository ) + { + this.repository = repository; + } + + /** + * Convert a path to an artifact reference. + * + * @param path the path to convert. (relative or full url path) + * @throws LayoutException if the path cannot be converted to an artifact reference. + */ + @Override + public ArtifactReference toArtifactReference( String path ) + throws LayoutException + { + if ( path.startsWith( repository.getUrl() ) ) + { + return super.toArtifactReference( path.substring( repository.getUrl().length() ) ); + } + + return super.toArtifactReference( path ); + } + + public RepositoryURL toURL( ArtifactReference reference ) + { + String url = repository.getUrl() + toPath( reference ); + return new RepositoryURL( url ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/RepositoryRequest.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/RepositoryRequest.java new file mode 100644 index 000000000..be97afde8 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/RepositoryRequest.java @@ -0,0 +1,233 @@ +package org.apache.maven.archiva.repository.content; + +/* + * 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.maven.archiva.model.ArtifactReference; +import org.apache.maven.archiva.repository.ManagedRepositoryContent; +import org.apache.maven.archiva.repository.layout.LayoutException; +import org.apache.maven.archiva.repository.metadata.MetadataTools; + +/** + * RepositoryRequest is used to determine the type of request that is incoming, and convert it to an appropriate + * ArtifactReference. + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @todo no need to be a component once legacy path parser is not + * + * @plexus.component + * role="org.apache.maven.archiva.repository.content.RepositoryRequest" + */ +public class RepositoryRequest +{ + private PathParser defaultPathParser = new DefaultPathParser(); + + /** + * @plexus.requirement role-hint="legacy" + */ + private PathParser legacyPathParser; + + /** + * Takes an incoming requested path (in "/" format) and gleans the layout + * and ArtifactReference appropriate for that content. + * + * @param requestedPath the relative path to the content. + * @return the ArtifactReference for the requestedPath. + * @throws LayoutException if the request path is not layout valid. + */ + public ArtifactReference toArtifactReference( String requestedPath ) + throws LayoutException + { + if ( StringUtils.isBlank( requestedPath ) ) + { + throw new LayoutException( "Blank request path is not a valid." ); + } + + String path = requestedPath; + while ( path.startsWith( "/" ) ) + { + path = path.substring( 1 ); + + // Only slash? that's bad, mmm-kay? + if ( "/".equals( path ) ) + { + throw new LayoutException( "Invalid request path: Slash only." ); + } + } + + if ( isDefault( path ) ) + { + return defaultPathParser.toArtifactReference( path ); + } + else if ( isLegacy( path ) ) + { + return legacyPathParser.toArtifactReference( path ); + } + else + { + throw new LayoutException( "Not a valid request path layout, too short." ); + } + } + + /** + *

+ * Tests the path to see if it conforms to the expectations of a metadata request. + *

+ *

+ * NOTE: This does a cursory check on the path's last element. A result of true + * from this method is not a guarantee that the metadata is in a valid format, or + * that it even contains data. + *

+ * + * @param requestedPath the path to test. + * @return true if the requestedPath is likely a metadata request. + */ + public boolean isMetadata( String requestedPath ) + { + return requestedPath.endsWith( "/" + MetadataTools.MAVEN_METADATA ); + } + + /** + *

+ * Tests the path to see if it conforms to the expectations of a support file request. + *

+ *

+ * Tests for .sha1, .md5, .asc, and .php. + *

+ *

+ * NOTE: This does a cursory check on the path's extension only. A result of true + * from this method is not a guarantee that the support resource is in a valid format, or + * that it even contains data. + *

+ * + * @param requestedPath the path to test. + * @return true if the requestedPath is likely that of a support file request. + */ + public boolean isSupportFile( String requestedPath ) + { + int idx = requestedPath.lastIndexOf( '.' ); + if ( idx <= 0 ) + { + return false; + } + + String ext = requestedPath.substring( idx ); + return ( ".sha1".equals( ext ) || ".md5".equals( ext ) || ".asc".equals( ext ) || ".pgp".equals( ext ) ); + } + + /** + *

+ * Tests the path to see if it conforms to the expectations of a default layout request. + *

+ *

+ * NOTE: This does a cursory check on the count of path elements only. A result of + * true from this method is not a guarantee that the path sections are valid and + * can be resolved to an artifact reference. use {@link #toArtifactReference(String)} + * if you want a more complete analysis of the validity of the path. + *

+ * + * @param requestedPath the path to test. + * @return true if the requestedPath is likely that of a default layout request. + */ + public boolean isDefault( String requestedPath ) + { + if ( StringUtils.isBlank( requestedPath ) ) + { + return false; + } + + String pathParts[] = StringUtils.splitPreserveAllTokens( requestedPath, '/' ); + return pathParts.length > 3; + } + + /** + *

+ * Tests the path to see if it conforms to the expectations of a legacy layout request. + *

+ *

+ * NOTE: This does a cursory check on the count of path elements only. A result of + * true from this method is not a guarantee that the path sections are valid and + * can be resolved to an artifact reference. use {@link #toArtifactReference(String)} + * if you want a more complete analysis of the validity of the path. + *

+ * + * @param requestedPath the path to test. + * @return true if the requestedPath is likely that of a legacy layout request. + */ + public boolean isLegacy( String requestedPath ) + { + if ( StringUtils.isBlank( requestedPath ) ) + { + return false; + } + + String pathParts[] = StringUtils.splitPreserveAllTokens( requestedPath, '/' ); + return pathParts.length == 3; + } + + /** + * Adjust the requestedPath to conform to the native layout of the provided {@link ManagedRepositoryContent}. + * + * @param requestedPath the incoming requested path. + * @param repository the repository to adjust to. + * @return the adjusted (to native) path. + * @throws LayoutException if the path cannot be parsed. + */ + public String toNativePath( String requestedPath, ManagedRepositoryContent repository ) throws LayoutException + { + if ( StringUtils.isBlank( requestedPath ) ) + { + throw new LayoutException( "Request Path is blank." ); + } + + String referencedResource = requestedPath; + // No checksum by default. + String supportfile = ""; + + // Figure out support file, and actual referencedResource. + if( isSupportFile( requestedPath ) ) + { + int idx = requestedPath.lastIndexOf( '.' ); + referencedResource = requestedPath.substring( 0, idx ); + supportfile = requestedPath.substring( idx ); + } + + if ( isMetadata( referencedResource ) ) + { + if ( repository instanceof ManagedLegacyRepositoryContent ) + { + throw new LayoutException( "Cannot translate metadata request to legacy layout." ); + } + + /* Nothing to translate. + * Default layout is the only layout that can contain maven-metadata.xml files, and + * if the managedRepository is layout legacy, this request would never occur. + */ + return requestedPath; + } + + // Treat as an artifact reference. + ArtifactReference ref = toArtifactReference( referencedResource ); + String adjustedPath = repository.toPath( ref ); + return adjustedPath + supportfile; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/layout/LayoutException.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/layout/LayoutException.java new file mode 100644 index 000000000..e5c7c2cee --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/layout/LayoutException.java @@ -0,0 +1,41 @@ +package org.apache.maven.archiva.repository.layout; + +/* + * 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.archiva.common.ArchivaException; + +/** + * LayoutException + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class LayoutException extends ArchivaException +{ + public LayoutException( String message, Throwable cause ) + { + super( message, cause ); + } + + public LayoutException( String message ) + { + super( message ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/metadata/MetadataTools.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/metadata/MetadataTools.java new file mode 100644 index 000000000..06e387416 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/metadata/MetadataTools.java @@ -0,0 +1,952 @@ +package org.apache.maven.archiva.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.archiva.checksum.ChecksumAlgorithm; +import org.apache.archiva.checksum.ChecksummedFile; +import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang.math.NumberUtils; +import org.apache.commons.lang.time.DateUtils; +import org.apache.maven.archiva.common.utils.PathUtil; +import org.apache.maven.archiva.common.utils.VersionComparator; +import org.apache.maven.archiva.common.utils.VersionUtil; +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +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.maven.archiva.repository.ContentNotFoundException; +import org.apache.maven.archiva.repository.ManagedRepositoryContent; +import org.apache.maven.archiva.repository.RemoteRepositoryContent; +import org.apache.maven.archiva.repository.layout.LayoutException; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException; +import org.codehaus.plexus.registry.Registry; +import org.codehaus.plexus.registry.RegistryListener; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.io.IOException; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Collection; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.regex.Matcher; +import org.apache.commons.io.FileUtils; + +/** + * MetadataTools + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component role="org.apache.maven.archiva.repository.metadata.MetadataTools" + */ +public class MetadataTools + implements RegistryListener, Initializable +{ + private static Logger log = LoggerFactory.getLogger( MetadataTools.class ); + + public static final String MAVEN_METADATA = "maven-metadata.xml"; + + private static final char PATH_SEPARATOR = '/'; + + private static final char GROUP_SEPARATOR = '.'; + + /** + * @plexus.requirement + */ + private ArchivaConfiguration configuration; + + /** + * @plexus.requirement + */ + private FileTypes filetypes; + + private ChecksumAlgorithm[] algorithms = new ChecksumAlgorithm[] { ChecksumAlgorithm.SHA1, ChecksumAlgorithm.MD5 }; + + private List artifactPatterns; + + private Map> proxies; + + private static final char NUMS[] = new char[] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' }; + + private SimpleDateFormat lastUpdatedFormat; + + public MetadataTools() + { + lastUpdatedFormat = new SimpleDateFormat( "yyyyMMddHHmmss" ); + lastUpdatedFormat.setTimeZone( DateUtils.UTC_TIME_ZONE ); + } + + public void afterConfigurationChange( Registry registry, String propertyName, Object propertyValue ) + { + if ( ConfigurationNames.isProxyConnector( propertyName ) ) + { + initConfigVariables(); + } + } + + public void beforeConfigurationChange( Registry registry, String propertyName, Object propertyValue ) + { + /* nothing to do */ + } + + /** + * Gather the set of snapshot versions found in a particular versioned reference. + * + * @return the Set of snapshot artifact versions found. + * @throws LayoutException + * @throws ContentNotFoundException + */ + public Set gatherSnapshotVersions( ManagedRepositoryContent managedRepository, VersionedReference reference ) + throws LayoutException, IOException, ContentNotFoundException + { + Set foundVersions = managedRepository.getVersions( reference ); + + // Next gather up the referenced 'latest' versions found in any proxied repositories + // maven-metadata-${proxyId}.xml files that may be present. + + // Does this repository have a set of remote proxied repositories? + Set proxiedRepoIds = this.proxies.get( managedRepository.getId() ); + + if ( CollectionUtils.isNotEmpty( proxiedRepoIds ) ) + { + String baseVersion = VersionUtil.getBaseVersion( reference.getVersion() ); + baseVersion = baseVersion.substring( 0, baseVersion.indexOf( VersionUtil.SNAPSHOT ) - 1 ); + + // Add in the proxied repo version ids too. + Iterator it = proxiedRepoIds.iterator(); + while ( it.hasNext() ) + { + String proxyId = it.next(); + + ArchivaRepositoryMetadata proxyMetadata = readProxyMetadata( managedRepository, reference, proxyId ); + if ( proxyMetadata == null ) + { + // There is no proxy metadata, skip it. + continue; + } + + // Is there some snapshot info? + SnapshotVersion snapshot = proxyMetadata.getSnapshotVersion(); + if ( snapshot != null ) + { + String timestamp = snapshot.getTimestamp(); + int buildNumber = snapshot.getBuildNumber(); + + // Only interested in the timestamp + buildnumber. + if ( StringUtils.isNotBlank( timestamp ) && ( buildNumber > 0 ) ) + { + foundVersions.add( baseVersion + "-" + timestamp + "-" + buildNumber ); + } + } + } + } + + return foundVersions; + } + + /** + * Take a path to a maven-metadata.xml, and attempt to translate it to a VersionedReference. + * + * @param path + * @return + */ + public VersionedReference toVersionedReference( String path ) + throws RepositoryMetadataException + { + if ( !path.endsWith( "/" + MAVEN_METADATA ) ) + { + throw new RepositoryMetadataException( "Cannot convert to versioned reference, not a metadata file. " ); + } + + VersionedReference reference = new VersionedReference(); + + String normalizedPath = StringUtils.replace( path, "\\", "/" ); + String pathParts[] = StringUtils.split( normalizedPath, '/' ); + + int versionOffset = pathParts.length - 2; + int artifactIdOffset = versionOffset - 1; + int groupIdEnd = artifactIdOffset - 1; + + reference.setVersion( pathParts[versionOffset] ); + + if ( !hasNumberAnywhere( reference.getVersion() ) ) + { + // Scary check, but without it, all paths are version references; + throw new RepositoryMetadataException( + "Not a versioned reference, as version id on path has no number in it." ); + } + + reference.setArtifactId( pathParts[artifactIdOffset] ); + + StringBuffer gid = new StringBuffer(); + for ( int i = 0; i <= groupIdEnd; i++ ) + { + if ( i > 0 ) + { + gid.append( "." ); + } + gid.append( pathParts[i] ); + } + + reference.setGroupId( gid.toString() ); + + return reference; + } + + private boolean hasNumberAnywhere( String version ) + { + return StringUtils.indexOfAny( version, NUMS ) != ( -1 ); + } + + public ProjectReference toProjectReference( String path ) + throws RepositoryMetadataException + { + if ( !path.endsWith( "/" + MAVEN_METADATA ) ) + { + throw new RepositoryMetadataException( "Cannot convert to versioned reference, not a metadata file. " ); + } + + ProjectReference reference = new ProjectReference(); + + String normalizedPath = StringUtils.replace( path, "\\", "/" ); + String pathParts[] = StringUtils.split( normalizedPath, '/' ); + + // Assume last part of the path is the version. + + int artifactIdOffset = pathParts.length - 2; + int groupIdEnd = artifactIdOffset - 1; + + reference.setArtifactId( pathParts[artifactIdOffset] ); + + StringBuffer gid = new StringBuffer(); + for ( int i = 0; i <= groupIdEnd; i++ ) + { + if ( i > 0 ) + { + gid.append( "." ); + } + gid.append( pathParts[i] ); + } + + reference.setGroupId( gid.toString() ); + + return reference; + } + + public String toPath( ProjectReference reference ) + { + StringBuffer path = new StringBuffer(); + + path.append( formatAsDirectory( reference.getGroupId() ) ).append( PATH_SEPARATOR ); + path.append( reference.getArtifactId() ).append( PATH_SEPARATOR ); + path.append( MAVEN_METADATA ); + + return path.toString(); + } + + public String toPath( VersionedReference reference ) + { + StringBuffer path = new StringBuffer(); + + path.append( formatAsDirectory( reference.getGroupId() ) ).append( PATH_SEPARATOR ); + path.append( reference.getArtifactId() ).append( PATH_SEPARATOR ); + if ( reference.getVersion() != null ) + { + // add the version only if it is present + path.append( VersionUtil.getBaseVersion( reference.getVersion() ) ).append( PATH_SEPARATOR ); + } + path.append( MAVEN_METADATA ); + + return path.toString(); + } + + private String formatAsDirectory( String directory ) + { + return directory.replace( GROUP_SEPARATOR, PATH_SEPARATOR ); + } + + /** + * Adjusts a path for a metadata.xml file to its repository specific path. + * + * @param repository the repository to base new path off of. + * @param path the path to the metadata.xml file to adjust the name of. + * @return the newly adjusted path reference to the repository specific metadata path. + */ + public String getRepositorySpecificName( RemoteRepositoryContent repository, String path ) + { + return getRepositorySpecificName( repository.getId(), path ); + } + + /** + * Adjusts a path for a metadata.xml file to its repository specific path. + * + * @param proxyId the repository id to base new path off of. + * @param path the path to the metadata.xml file to adjust the name of. + * @return the newly adjusted path reference to the repository specific metadata path. + */ + public String getRepositorySpecificName( String proxyId, String path ) + { + StringBuffer ret = new StringBuffer(); + + int idx = path.lastIndexOf( "/" ); + if ( idx > 0 ) + { + ret.append( path.substring( 0, idx + 1 ) ); + } + + // TODO: need to filter out 'bad' characters from the proxy id. + ret.append( "maven-metadata-" ).append( proxyId ).append( ".xml" ); + + return ret.toString(); + } + + public void initialize() + throws InitializationException + { + this.artifactPatterns = new ArrayList(); + this.proxies = new HashMap>(); + initConfigVariables(); + + configuration.addChangeListener( this ); + } + + public ArchivaRepositoryMetadata readProxyMetadata( ManagedRepositoryContent managedRepository, + ProjectReference reference, String proxyId ) + { + String metadataPath = getRepositorySpecificName( proxyId, toPath( reference ) ); + File metadataFile = new File( managedRepository.getRepoRoot(), metadataPath ); + + if ( !metadataFile.exists() || !metadataFile.isFile() ) + { + // Nothing to do. return null. + return null; + } + + try + { + return RepositoryMetadataReader.read( metadataFile ); + } + catch ( RepositoryMetadataException e ) + { + // TODO: [monitor] consider a monitor for this event. + // TODO: consider a read-redo on monitor return code? + log.warn( "Unable to read metadata: " + metadataFile.getAbsolutePath(), e ); + return null; + } + } + + public ArchivaRepositoryMetadata readProxyMetadata( ManagedRepositoryContent managedRepository, + String logicalResource, String proxyId ) + { + String metadataPath = getRepositorySpecificName( proxyId, logicalResource ); + File metadataFile = new File( managedRepository.getRepoRoot(), metadataPath ); + + if ( !metadataFile.exists() || !metadataFile.isFile() ) + { + // Nothing to do. return null. + return null; + } + + try + { + return RepositoryMetadataReader.read( metadataFile ); + } + catch ( RepositoryMetadataException e ) + { + // TODO: [monitor] consider a monitor for this event. + // TODO: consider a read-redo on monitor return code? + log.warn( "Unable to read metadata: " + metadataFile.getAbsolutePath(), e ); + return null; + } + } + + public ArchivaRepositoryMetadata readProxyMetadata( ManagedRepositoryContent managedRepository, + VersionedReference reference, String proxyId ) + { + String metadataPath = getRepositorySpecificName( proxyId, toPath( reference ) ); + File metadataFile = new File( managedRepository.getRepoRoot(), metadataPath ); + + if ( !metadataFile.exists() || !metadataFile.isFile() ) + { + // Nothing to do. return null. + return null; + } + + try + { + return RepositoryMetadataReader.read( metadataFile ); + } + catch ( RepositoryMetadataException e ) + { + // TODO: [monitor] consider a monitor for this event. + // TODO: consider a read-redo on monitor return code? + log.warn( "Unable to read metadata: " + metadataFile.getAbsolutePath(), e ); + return null; + } + } + + public void updateMetadata( ManagedRepositoryContent managedRepository, String logicalResource) throws RepositoryMetadataException + { + final File metadataFile = new File(managedRepository.getRepoRoot(), logicalResource); + ArchivaRepositoryMetadata metadata = null; + + //Gather and merge all metadata available + List metadatas = getMetadatasForManagedRepository(managedRepository, logicalResource); + for (ArchivaRepositoryMetadata proxiedMetadata : metadatas) + { + if (metadata == null) + { + metadata = proxiedMetadata; + continue; + } + metadata = RepositoryMetadataMerge.merge(metadata, proxiedMetadata); + } + + if (metadata == null) + { + log.debug("No metadata to update for " + logicalResource); + return; + } + + Set availableVersions = new HashSet(); + List metadataAvailableVersions = metadata.getAvailableVersions(); + if (metadataAvailableVersions != null) + { + availableVersions.addAll(metadataAvailableVersions); + } + availableVersions = findPossibleVersions(availableVersions, metadataFile.getParentFile()); + + if (availableVersions.size() > 0) + { + updateMetadataVersions(availableVersions, metadata); + } + + RepositoryMetadataWriter.write(metadata, metadataFile); + + ChecksummedFile checksum = new ChecksummedFile( metadataFile ); + checksum.fixChecksums( algorithms ); + } + + /** + * Skims the parent directory of a metadata in vain hope of finding + * subdirectories that contain poms. + * + * @param metadataParentDirectory + * @return origional set plus newley found versions + */ + private Set findPossibleVersions(Set versions, File metadataParentDirectory) + { + Set result = new HashSet(versions); + for (File directory : metadataParentDirectory.listFiles()) + { + if (directory.isDirectory()) + { + for (File possiblePom : directory.listFiles()) + { + if (possiblePom.getName().endsWith(".pom")) + { + result.add(directory.getName()); + } + } + } + } + return result; + } + + private List getMetadatasForManagedRepository( ManagedRepositoryContent managedRepository, String logicalResource ) + { + List metadatas = new ArrayList(); + File file = new File(managedRepository.getRepoRoot(), logicalResource); + if (file.exists()) + { + try + { + ArchivaRepositoryMetadata existingMetadata = RepositoryMetadataReader.read(file); + if (existingMetadata != null) + { + metadatas.add(existingMetadata); + } + } + catch (RepositoryMetadataException e) + { + log.debug("Could not read metadata at " + file.getAbsolutePath() + ". Metadata will be removed."); + FileUtils.deleteQuietly(file); + } + } + + Set proxyIds = proxies.get(managedRepository.getId()); + if (proxyIds != null) + { + for (String proxyId : proxyIds) + { + ArchivaRepositoryMetadata proxyMetadata = readProxyMetadata( managedRepository, logicalResource, proxyId ); + if (proxyMetadata != null) + { + metadatas.add(proxyMetadata); + } + } + } + + return metadatas; + } + + + /** + * Update the metadata to represent the all versions/plugins of + * the provided groupId:artifactId project or group reference, + * based off of information present in the repository, + * the maven-metadata.xml files, and the proxy/repository specific + * metadata file contents. + * + * We must treat this as a group or a project metadata file as there is no way to know in advance + * + * @deprecated + * @param managedRepository the managed repository where the metadata is kept. + * @param reference the reference to update. + * @throws LayoutException + * @throws RepositoryMetadataException + * @throws IOException + * @throws ContentNotFoundException + */ + public void updateMetadata( ManagedRepositoryContent managedRepository, ProjectReference reference ) + throws LayoutException, RepositoryMetadataException, IOException, ContentNotFoundException + { + File metadataFile = new File( managedRepository.getRepoRoot(), toPath( reference ) ); + + long lastUpdated = getExistingLastUpdated( metadataFile ); + + ArchivaRepositoryMetadata metadata = new ArchivaRepositoryMetadata(); + metadata.setGroupId( reference.getGroupId() ); + metadata.setArtifactId( reference.getArtifactId() ); + + // Gather up all versions found in the managed repository. + Set allVersions = managedRepository.getVersions( reference ); + + // Gather up all plugins found in the managed repository. + // TODO: do we know this information instead? +// Set allPlugins = managedRepository.getPlugins( reference ); + Set allPlugins; + if ( metadataFile.exists() ) + { + allPlugins = new LinkedHashSet( RepositoryMetadataReader.read( metadataFile ).getPlugins() ); + } + else + { + allPlugins = new LinkedHashSet(); + } + + // Does this repository have a set of remote proxied repositories? + Set proxiedRepoIds = this.proxies.get( managedRepository.getId() ); + + if ( CollectionUtils.isNotEmpty( proxiedRepoIds ) ) + { + // Add in the proxied repo version ids too. + Iterator it = proxiedRepoIds.iterator(); + while ( it.hasNext() ) + { + String proxyId = it.next(); + + ArchivaRepositoryMetadata proxyMetadata = readProxyMetadata( managedRepository, reference, proxyId ); + if ( proxyMetadata != null ) + { + allVersions.addAll( proxyMetadata.getAvailableVersions() ); + allPlugins.addAll( proxyMetadata.getPlugins() ); + long proxyLastUpdated = getLastUpdated( proxyMetadata ); + + lastUpdated = Math.max( lastUpdated, proxyLastUpdated ); + } + } + } + + if ( !allVersions.isEmpty() ) + { + updateMetadataVersions( allVersions ,metadata ); + } + else + { + // Add the plugins to the metadata model. + metadata.setPlugins( new ArrayList( allPlugins ) ); + + // artifact ID was actually the last part of the group + metadata.setGroupId( metadata.getGroupId() + "." + metadata.getArtifactId() ); + metadata.setArtifactId( null ); + } + + if ( lastUpdated > 0 ) + { + metadata.setLastUpdatedTimestamp( toLastUpdatedDate( lastUpdated ) ); + } + + // Save the metadata model to disk. + RepositoryMetadataWriter.write( metadata, metadataFile ); + ChecksummedFile checksum = new ChecksummedFile( metadataFile ); + checksum.fixChecksums( algorithms ); + } + + private void updateMetadataVersions(Collection allVersions, ArchivaRepositoryMetadata metadata) + { + // Sort the versions + List sortedVersions = new ArrayList(allVersions); + Collections.sort(sortedVersions, VersionComparator.getInstance()); + + // Split the versions into released and snapshots. + List releasedVersions = new ArrayList(); + List snapshotVersions = new ArrayList(); + + for (String version : sortedVersions) + { + if (VersionUtil.isSnapshot(version)) + { + snapshotVersions.add(version); + } + else + { + releasedVersions.add(version); + } + } + + Collections.sort(releasedVersions, VersionComparator.getInstance()); + Collections.sort(snapshotVersions, VersionComparator.getInstance()); + + String latestVersion = sortedVersions.get(sortedVersions.size() - 1); + String releaseVersion = null; + + if (CollectionUtils.isNotEmpty(releasedVersions)) + { + releaseVersion = releasedVersions.get(releasedVersions.size() - 1); + } + + // Add the versions to the metadata model. + metadata.setAvailableVersions(sortedVersions); + + metadata.setLatestVersion(latestVersion); + metadata.setReleasedVersion(releaseVersion); + } + + private Date toLastUpdatedDate( long lastUpdated ) + { + Calendar cal = Calendar.getInstance( DateUtils.UTC_TIME_ZONE ); + cal.setTimeInMillis( lastUpdated ); + + return cal.getTime(); + } + + private long toLastUpdatedLong( String timestampString ) + { + try + { + Date date = lastUpdatedFormat.parse( timestampString ); + Calendar cal = Calendar.getInstance( DateUtils.UTC_TIME_ZONE ); + cal.setTime( date ); + + return cal.getTimeInMillis(); + } + catch ( ParseException e ) + { + return 0; + } + } + + private long getLastUpdated( ArchivaRepositoryMetadata metadata ) + { + if ( metadata == null ) + { + // Doesn't exist. + return 0; + } + + try + { + String lastUpdated = metadata.getLastUpdated(); + if ( StringUtils.isBlank( lastUpdated ) ) + { + // Not set. + return 0; + } + + Date lastUpdatedDate = lastUpdatedFormat.parse( lastUpdated ); + return lastUpdatedDate.getTime(); + } + catch ( ParseException e ) + { + // Bad format on the last updated string. + return 0; + } + } + + private long getExistingLastUpdated( File metadataFile ) + { + if ( !metadataFile.exists() ) + { + // Doesn't exist. + return 0; + } + + try + { + ArchivaRepositoryMetadata metadata = RepositoryMetadataReader.read( metadataFile ); + + return getLastUpdated( metadata ); + } + catch ( RepositoryMetadataException e ) + { + // Error. + return 0; + } + } + + /** + * Update the metadata based on the following rules. + *

+ * 1) If this is a SNAPSHOT reference, then utilize the proxy/repository specific + * metadata files to represent the current / latest SNAPSHOT available. + * 2) If this is a RELEASE reference, and the metadata file does not exist, then + * create the metadata file with contents required of the VersionedReference + * + * @deprecated + * @param managedRepository the managed repository where the metadata is kept. + * @param reference the versioned reference to update + * @throws LayoutException + * @throws RepositoryMetadataException + * @throws IOException + * @throws ContentNotFoundException + */ + public void updateMetadata( ManagedRepositoryContent managedRepository, VersionedReference reference ) + throws LayoutException, RepositoryMetadataException, IOException, ContentNotFoundException + { + File metadataFile = new File( managedRepository.getRepoRoot(), toPath( reference ) ); + + long lastUpdated = getExistingLastUpdated( metadataFile ); + + ArchivaRepositoryMetadata metadata = new ArchivaRepositoryMetadata(); + metadata.setGroupId( reference.getGroupId() ); + metadata.setArtifactId( reference.getArtifactId() ); + + if ( VersionUtil.isSnapshot( reference.getVersion() ) ) + { + // Do SNAPSHOT handling. + metadata.setVersion( VersionUtil.getBaseVersion( reference.getVersion() ) ); + + // Gather up all of the versions found in the reference dir, and any + // proxied maven-metadata.xml files. + Set snapshotVersions = gatherSnapshotVersions( managedRepository, reference ); + + if ( snapshotVersions.isEmpty() ) + { + throw new ContentNotFoundException( "No snapshot versions found on reference [" + + VersionedReference.toKey( reference ) + "]." ); + } + + // sort the list to determine to aide in determining the Latest version. + List sortedVersions = new ArrayList(); + sortedVersions.addAll( snapshotVersions ); + Collections.sort( sortedVersions, new VersionComparator() ); + + String latestVersion = sortedVersions.get( sortedVersions.size() - 1 ); + + if ( VersionUtil.isUniqueSnapshot( latestVersion ) ) + { + // The latestVersion will contain the full version string "1.0-alpha-5-20070821.213044-8" + // This needs to be broken down into ${base}-${timestamp}-${build_number} + + Matcher m = VersionUtil.UNIQUE_SNAPSHOT_PATTERN.matcher( latestVersion ); + if ( m.matches() ) + { + metadata.setSnapshotVersion( new SnapshotVersion() ); + int buildNumber = NumberUtils.toInt( m.group( 3 ), -1 ); + metadata.getSnapshotVersion().setBuildNumber( buildNumber ); + + Matcher mtimestamp = VersionUtil.TIMESTAMP_PATTERN.matcher( m.group( 2 ) ); + if ( mtimestamp.matches() ) + { + String tsDate = mtimestamp.group( 1 ); + String tsTime = mtimestamp.group( 2 ); + + long snapshotLastUpdated = toLastUpdatedLong( tsDate + tsTime ); + + lastUpdated = Math.max( lastUpdated, snapshotLastUpdated ); + + metadata.getSnapshotVersion().setTimestamp( m.group( 2 ) ); + } + } + } + else if ( VersionUtil.isGenericSnapshot( latestVersion ) ) + { + // The latestVersion ends with the generic version string. + // Example: 1.0-alpha-5-SNAPSHOT + + metadata.setSnapshotVersion( new SnapshotVersion() ); + + /* Disabled due to decision in [MRM-535]. + * Do not set metadata.lastUpdated to file.lastModified. + * + * Should this be the last updated timestamp of the file, or in the case of an + * archive, the most recent timestamp in the archive? + * + ArtifactReference artifact = getFirstArtifact( managedRepository, reference ); + + if ( artifact == null ) + { + throw new IOException( "Not snapshot artifact found to reference in " + reference ); + } + + File artifactFile = managedRepository.toFile( artifact ); + + if ( artifactFile.exists() ) + { + Date lastModified = new Date( artifactFile.lastModified() ); + metadata.setLastUpdatedTimestamp( lastModified ); + } + */ + } + else + { + throw new RepositoryMetadataException( "Unable to process snapshot version <" + latestVersion + + "> reference <" + reference + ">" ); + } + } + else + { + // Do RELEASE handling. + metadata.setVersion( reference.getVersion() ); + } + + // Set last updated + if ( lastUpdated > 0 ) + { + metadata.setLastUpdatedTimestamp( toLastUpdatedDate( lastUpdated ) ); + } + + // Save the metadata model to disk. + RepositoryMetadataWriter.write( metadata, metadataFile ); + ChecksummedFile checksum = new ChecksummedFile( metadataFile ); + checksum.fixChecksums( algorithms ); + } + + private void initConfigVariables() + { + synchronized ( this.artifactPatterns ) + { + this.artifactPatterns.clear(); + + this.artifactPatterns.addAll( filetypes.getFileTypePatterns( FileTypes.ARTIFACTS ) ); + } + + synchronized ( proxies ) + { + this.proxies.clear(); + + List proxyConfigs = configuration.getConfiguration().getProxyConnectors(); + for( ProxyConnectorConfiguration proxyConfig: proxyConfigs ) + { + String key = proxyConfig.getSourceRepoId(); + + Set remoteRepoIds = this.proxies.get( key ); + + if ( remoteRepoIds == null ) + { + remoteRepoIds = new HashSet(); + } + + remoteRepoIds.add( proxyConfig.getTargetRepoId() ); + + this.proxies.put( key, remoteRepoIds ); + } + } + } + + /** + * Get the first Artifact found in the provided VersionedReference location. + * + * @param managedRepository the repository to search within. + * @param reference the reference to the versioned reference to search within + * @return the ArtifactReference to the first artifact located within the versioned reference. or null if + * no artifact was found within the versioned reference. + * @throws IOException if the versioned reference is invalid (example: doesn't exist, or isn't a directory) + * @throws LayoutException + */ + public ArtifactReference getFirstArtifact( ManagedRepositoryContent managedRepository, VersionedReference reference ) + throws LayoutException, IOException + { + String path = toPath( reference ); + + int idx = path.lastIndexOf( '/' ); + if ( idx > 0 ) + { + path = path.substring( 0, idx ); + } + + File repoDir = new File( managedRepository.getRepoRoot(), path ); + + if ( !repoDir.exists() ) + { + throw new IOException( "Unable to gather the list of snapshot versions on a non-existant directory: " + + repoDir.getAbsolutePath() ); + } + + if ( !repoDir.isDirectory() ) + { + throw new IOException( "Unable to gather the list of snapshot versions on a non-directory: " + + repoDir.getAbsolutePath() ); + } + + File repoFiles[] = repoDir.listFiles(); + for ( int i = 0; i < repoFiles.length; i++ ) + { + if ( repoFiles[i].isDirectory() ) + { + // Skip it. it's a directory. + continue; + } + + String relativePath = PathUtil.getRelative( managedRepository.getRepoRoot(), repoFiles[i] ); + + if ( filetypes.matchesArtifactPattern( relativePath ) ) + { + ArtifactReference artifact = managedRepository.toArtifactReference( relativePath ); + + return artifact; + } + } + + // No artifact was found. + return null; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/metadata/RepositoryMetadataException.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/metadata/RepositoryMetadataException.java new file mode 100644 index 000000000..aa3d4923d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/metadata/RepositoryMetadataException.java @@ -0,0 +1,52 @@ +package org.apache.maven.archiva.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.archiva.repository.RepositoryException; + +/** + * RepositoryMetadataException + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class RepositoryMetadataException extends RepositoryException +{ + + public RepositoryMetadataException() + { + super(); + } + + public RepositoryMetadataException( String message, Throwable cause ) + { + super( message, cause ); + } + + public RepositoryMetadataException( String message ) + { + super( message ); + } + + public RepositoryMetadataException( Throwable cause ) + { + super( cause ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/metadata/RepositoryMetadataMerge.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/metadata/RepositoryMetadataMerge.java new file mode 100644 index 000000000..bf717d38b --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/metadata/RepositoryMetadataMerge.java @@ -0,0 +1,258 @@ +package org.apache.maven.archiva.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.ArrayList; +import org.apache.maven.archiva.model.ArchivaModelCloner; +import org.apache.maven.archiva.model.ArchivaRepositoryMetadata; +import org.apache.maven.archiva.model.SnapshotVersion; + +import java.util.Iterator; +import java.util.List; +import org.apache.commons.lang.StringUtils; +import org.apache.maven.archiva.model.Plugin; + +/** + * RepositoryMetadataMerge + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class RepositoryMetadataMerge +{ + public static ArchivaRepositoryMetadata merge( final ArchivaRepositoryMetadata mainMetadata, + final ArchivaRepositoryMetadata sourceMetadata ) + throws RepositoryMetadataException + { + if ( mainMetadata == null ) + { + throw new RepositoryMetadataException( "Cannot merge a null main project." ); + } + + if ( sourceMetadata == null ) + { + throw new RepositoryMetadataException( "Cannot copy to a null parent project." ); + } + + ArchivaRepositoryMetadata merged = new ArchivaRepositoryMetadata(); + + merged.setGroupId( merge( mainMetadata.getGroupId(), sourceMetadata.getGroupId() ) ); + merged.setArtifactId( merge(mainMetadata.getArtifactId(), sourceMetadata.getArtifactId())); + merged.setVersion( merge(mainMetadata.getVersion(), sourceMetadata.getVersion()) ); + merged.setReleasedVersion( merge( mainMetadata.getReleasedVersion(), sourceMetadata.getReleasedVersion() ) ); + merged.setSnapshotVersion( merge( mainMetadata.getSnapshotVersion(), sourceMetadata.getSnapshotVersion() ) ); + merged.setAvailableVersions( mergeAvailableVersions( mainMetadata.getAvailableVersions(), sourceMetadata.getAvailableVersions() ) ); + merged.setPlugins( mergePlugins( mainMetadata.getPlugins(), sourceMetadata.getPlugins() ) ); + + //Don't set if merge was not possible + long lastUpdated = mergeTimestamp( mainMetadata.getLastUpdated(), sourceMetadata.getLastUpdated()); + if (lastUpdated > -1) + { + merged.setLastUpdated( Long.toString(lastUpdated) ); + } + + return merged; + } + + private static boolean empty( String val ) + { + if ( val == null ) + { + return true; + } + + return ( val.trim().length() <= 0 ); + } + + private static long mergeTimestamp(String mainTimestamp, String sourceTimestamp) + { + if (sourceTimestamp == null && mainTimestamp != null) + { + return convertTimestampToLong(mainTimestamp); + } + + if (mainTimestamp == null && sourceTimestamp != null) + { + return convertTimestampToLong(sourceTimestamp); + } + + if (sourceTimestamp == null && mainTimestamp == null) + { + return -1; + } + + return mergeTimestamp(convertTimestampToLong(mainTimestamp), convertTimestampToLong(sourceTimestamp)); + } + + private static long mergeTimestamp(long mainTimestamp, long sourceTimestamp) + { + return Math.max( mainTimestamp, sourceTimestamp ); + } + + private static SnapshotVersion merge( SnapshotVersion mainSnapshotVersion, SnapshotVersion sourceSnapshotVersion ) + { + if ( sourceSnapshotVersion == null ) + { + return mainSnapshotVersion; + } + + if ( mainSnapshotVersion == null ) + { + return ArchivaModelCloner.clone( sourceSnapshotVersion ); + } + + SnapshotVersion merged = new SnapshotVersion(); + + long mainSnapshotLastUpdated = convertTimestampToLong(mainSnapshotVersion.getTimestamp()); + long sourceSnapshotLastUpdated = convertTimestampToLong(sourceSnapshotVersion.getTimestamp()); + + long lastUpdated = mergeTimestamp(mainSnapshotLastUpdated, sourceSnapshotLastUpdated); + + if (lastUpdated == mainSnapshotLastUpdated) + { + merged.setTimestamp(mainSnapshotVersion.getTimestamp()); + merged.setBuildNumber(mainSnapshotVersion.getBuildNumber()); + } + else + { + merged.setTimestamp(sourceSnapshotVersion.getTimestamp()); + merged.setBuildNumber(sourceSnapshotVersion.getBuildNumber()); + } + + return merged; + } + + private static long convertTimestampToLong(String timestamp) + { + if (timestamp == null) + { + return -1; + } + + return getLongFromTimestampSafely(StringUtils.replace(timestamp, ".", "")); + } + + private static long getLongFromTimestampSafely( String timestampString ) + { + try + { + return Long.parseLong(timestampString); + } + catch (NumberFormatException e) + { + return -1; + } + } + + private static String merge( String main, String source ) + { + if ( empty( main ) && !empty( source ) ) + { + return source; + } + + return main; + } + + private static List mergePlugins(List mainPlugins, List sourcePlugins) + { + if ( sourcePlugins == null ) + { + return mainPlugins; + } + + if ( mainPlugins == null ) + { + return clonePlugins( sourcePlugins ); + } + + List merged = clonePlugins( mainPlugins ); + + Iterator it = sourcePlugins.iterator(); + while ( it.hasNext() ) + { + Plugin plugin = (Plugin) it.next(); + if ( !merged.contains( plugin ) ) + { + merged.add( plugin ); + } + } + + return merged; + } + + /** + * Clones a list of plugins. + * + * This method exists because ArchivaModelCloner.clonePlugins() + * only works with artifact references. + * + * @param plugins + * @return list of cloned plugins + */ + private static List clonePlugins(List plugins) + { + if (plugins == null) + { + return null; + } + + ArrayList result = new ArrayList(); + + for (Plugin plugin : plugins) + { + Plugin clonedPlugin = new Plugin(); + clonedPlugin.setArtifactId(plugin.getArtifactId()); + clonedPlugin.setModelEncoding(plugin.getModelEncoding()); + clonedPlugin.setName(plugin.getName()); + clonedPlugin.setPrefix(plugin.getPrefix()); + result.add(plugin); + } + + return result; + } + + private static List mergeAvailableVersions( List mainAvailableVersions, List sourceAvailableVersions ) + { + if ( sourceAvailableVersions == null ) + { + return mainAvailableVersions; + } + + if ( mainAvailableVersions == null ) + { + return ArchivaModelCloner.cloneAvailableVersions( sourceAvailableVersions ); + } + + List merged = ArchivaModelCloner.cloneAvailableVersions( mainAvailableVersions ); + + Iterator it = sourceAvailableVersions.iterator(); + while ( it.hasNext() ) + { + String sourceVersion = (String) it.next(); + if ( !merged.contains( sourceVersion ) ) + { + merged.add( sourceVersion ); + } + } + + return merged; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/metadata/RepositoryMetadataReader.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/metadata/RepositoryMetadataReader.java new file mode 100644 index 000000000..1e18caf86 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/metadata/RepositoryMetadataReader.java @@ -0,0 +1,98 @@ +package org.apache.maven.archiva.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.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.maven.archiva.xml.XMLException; +import org.apache.maven.archiva.xml.XMLReader; +import org.dom4j.Element; + +import java.io.File; +import java.util.Date; + +/** + * RepositoryMetadataReader - read maven-metadata.xml files. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class RepositoryMetadataReader +{ + /** + * Read and return the {@link ArchivaRepositoryMetadata} object from the provided xml file. + * + * @param metadataFile the maven-metadata.xml file to read. + * @return the archiva repository metadata object that represents the provided file contents. + * @throws RepositoryMetadataException + */ + public static ArchivaRepositoryMetadata read( File metadataFile ) + throws RepositoryMetadataException + { + try + { + XMLReader xml = new XMLReader( "metadata", metadataFile ); + + ArchivaRepositoryMetadata metadata = new ArchivaRepositoryMetadata(); + + metadata.setGroupId( xml.getElementText( "//metadata/groupId" ) ); + metadata.setArtifactId( xml.getElementText( "//metadata/artifactId" ) ); + metadata.setVersion( xml.getElementText( "//metadata/version" ) ); + metadata.setFileLastModified( new Date( metadataFile.lastModified() ) ); + metadata.setFileSize( metadataFile.length() ); + metadata.setWhenIndexed( null ); + + metadata.setLastUpdated( xml.getElementText( "//metadata/versioning/lastUpdated" ) ); + metadata.setLatestVersion( xml.getElementText( "//metadata/versioning/latest" ) ); + metadata.setReleasedVersion( xml.getElementText( "//metadata/versioning/release" ) ); + metadata.setAvailableVersions( xml.getElementListText( "//metadata/versioning/versions/version" ) ); + + Element snapshotElem = xml.getElement( "//metadata/versioning/snapshot" ); + if ( snapshotElem != null ) + { + SnapshotVersion snapshot = new SnapshotVersion(); + snapshot.setTimestamp( snapshotElem.elementTextTrim( "timestamp" ) ); + String tmp = snapshotElem.elementTextTrim( "buildNumber" ); + if( NumberUtils.isNumber( tmp )) + { + snapshot.setBuildNumber( NumberUtils.toInt( tmp ) ); + } + metadata.setSnapshotVersion( snapshot ); + } + + for ( Element plugin : xml.getElementList( "//metadata/plugins/plugin" ) ) + { + Plugin p = new Plugin(); + p.setPrefix( plugin.elementTextTrim( "prefix" ) ); + p.setArtifactId( plugin.elementTextTrim( "artifactId" ) ); + p.setName( plugin.elementTextTrim( "name" ) ); + metadata.addPlugin( p ); + } + + return metadata; + } + catch ( XMLException e ) + { + throw new RepositoryMetadataException( e.getMessage(), e ); + } + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/metadata/RepositoryMetadataWriter.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/metadata/RepositoryMetadataWriter.java new file mode 100644 index 000000000..ba4ae0e4f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/metadata/RepositoryMetadataWriter.java @@ -0,0 +1,151 @@ +package org.apache.maven.archiva.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.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.maven.archiva.xml.XMLException; +import org.apache.maven.archiva.xml.XMLWriter; +import org.dom4j.Document; +import org.dom4j.DocumentHelper; +import org.dom4j.Element; + +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.io.Writer; +import java.util.Iterator; +import java.util.List; +import org.apache.commons.io.FileUtils; + +/** + * RepositoryMetadataWriter + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class RepositoryMetadataWriter +{ + public static void write( ArchivaRepositoryMetadata metadata, File outputFile ) + throws RepositoryMetadataException + { + boolean thrown = false; + FileWriter writer = null; + try + { + writer = new FileWriter( outputFile ); + write( metadata, writer ); + writer.flush(); + } + catch ( IOException e ) + { + thrown = true; + throw new RepositoryMetadataException( "Unable to write metadata file: " + outputFile.getAbsolutePath() + + " - " + e.getMessage(), e ); + } + finally + { + IOUtils.closeQuietly( writer ); + if (thrown) + { + FileUtils.deleteQuietly(outputFile); + } + } + } + + public static void write( ArchivaRepositoryMetadata metadata, Writer writer ) + throws RepositoryMetadataException + { + Document doc = DocumentHelper.createDocument(); + + Element root = DocumentHelper.createElement( "metadata" ); + doc.setRootElement( root ); + + addOptionalElementText( root, "groupId", metadata.getGroupId()); + addOptionalElementText( root, "artifactId", metadata.getArtifactId() ); + addOptionalElementText( root, "version", metadata.getVersion() ); + + if ( CollectionUtils.isNotEmpty( metadata.getPlugins() ) ) + { + Element plugins = root.addElement( "plugins" ); + for ( Plugin plugin : (List)metadata.getPlugins() ) + { + Element p = plugins.addElement( "plugin" ); + p.addElement( "prefix" ).setText( plugin.getPrefix() ); + p.addElement( "artifactId" ).setText( plugin.getArtifactId() ); + addOptionalElementText( p, "name", plugin.getName() ); + } + } + + if ( CollectionUtils.isNotEmpty( metadata.getAvailableVersions() ) + || StringUtils.isNotBlank( metadata.getReleasedVersion() ) + || StringUtils.isNotBlank( metadata.getLatestVersion() ) + || StringUtils.isNotBlank( metadata.getLastUpdated() ) || ( metadata.getSnapshotVersion() != null ) ) + { + Element versioning = root.addElement( "versioning" ); + + addOptionalElementText( versioning, "latest", metadata.getLatestVersion() ); + addOptionalElementText( versioning, "release", metadata.getReleasedVersion() ); + + if ( metadata.getSnapshotVersion() != null ) + { + Element snapshot = versioning.addElement( "snapshot" ); + String bnum = String.valueOf( metadata.getSnapshotVersion().getBuildNumber() ); + addOptionalElementText( snapshot, "buildNumber", bnum ); + addOptionalElementText( snapshot, "timestamp", metadata.getSnapshotVersion().getTimestamp() ); + } + + if ( CollectionUtils.isNotEmpty( metadata.getAvailableVersions() ) ) + { + Element versions = versioning.addElement( "versions" ); + Iterator it = metadata.getAvailableVersions().iterator(); + while ( it.hasNext() ) + { + String version = (String) it.next(); + versions.addElement( "version" ).setText( version ); + } + } + + addOptionalElementText( versioning, "lastUpdated", metadata.getLastUpdated() ); + } + + try + { + XMLWriter.write( doc, writer ); + } + catch ( XMLException e ) + { + throw new RepositoryMetadataException( "Unable to write xml contents to writer: " + e.getMessage(), e ); + } + } + + private static void addOptionalElementText( Element elem, String elemName, String text ) + { + if ( StringUtils.isBlank( text ) ) + { + return; + } + + elem.addElement( elemName ).setText( text ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/ProjectModelException.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/ProjectModelException.java new file mode 100644 index 000000000..add04a542 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/ProjectModelException.java @@ -0,0 +1,41 @@ +package org.apache.maven.archiva.repository.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. + */ + +import org.apache.maven.archiva.common.ArchivaException; + +/** + * ProjectModelException + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ProjectModelException extends ArchivaException +{ + public ProjectModelException( String message, Throwable cause ) + { + super( message, cause ); + } + + public ProjectModelException( String message ) + { + super( message ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/ProjectModelFilter.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/ProjectModelFilter.java new file mode 100644 index 000000000..12140161e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/ProjectModelFilter.java @@ -0,0 +1,40 @@ +package org.apache.maven.archiva.repository.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. + */ + +import org.apache.maven.archiva.model.ArchivaProjectModel; + +/** + * Generic Filtering interface for {@link ArchivaProjectModel} objects. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public interface ProjectModelFilter +{ + /** + * Filter a model and return the results of the filtering. + * + * @param model the model to filter. + * @return a new model representing the filtered state of the model. + * @throws ProjectModelException if there was a problem executing the filter. + */ + public ArchivaProjectModel filter( final ArchivaProjectModel model ) throws ProjectModelException; +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/ProjectModelMerge.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/ProjectModelMerge.java new file mode 100644 index 000000000..b14b52a04 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/ProjectModelMerge.java @@ -0,0 +1,693 @@ +package org.apache.maven.archiva.repository.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. + */ + +import org.apache.commons.lang.StringUtils; +import org.apache.maven.archiva.model.ArchivaModelCloner; +import org.apache.maven.archiva.model.ArchivaProjectModel; +import org.apache.maven.archiva.model.ArtifactReference; +import org.apache.maven.archiva.model.CiManagement; +import org.apache.maven.archiva.model.Dependency; +import org.apache.maven.archiva.model.Exclusion; +import org.apache.maven.archiva.model.Individual; +import org.apache.maven.archiva.model.IssueManagement; +import org.apache.maven.archiva.model.License; +import org.apache.maven.archiva.model.Organization; +import org.apache.maven.archiva.model.ProjectRepository; +import org.apache.maven.archiva.model.Scm; + +import java.util.ArrayList; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.Set; +import java.util.Map.Entry; + +/** + * ProjectModelMerge + * + * TODO: Should call this ProjectModelAncestry as it deals with the current project and its parent. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ProjectModelMerge +{ + /** + * Merge the contents of a project with it's parent project. + * + * @param mainProject the main project. + * @param parentProject the parent project to merge. + * @throws ProjectModelException if there was a problem merging the model. + */ + public static ArchivaProjectModel merge( ArchivaProjectModel mainProject, ArchivaProjectModel parentProject ) + throws ProjectModelException + { + if ( mainProject == null ) + { + throw new ProjectModelException( "Cannot merge with a null main project." ); + } + + if ( parentProject == null ) + { + throw new ProjectModelException( "Cannot merge with a null parent project." ); + } + + ArchivaProjectModel merged = new ArchivaProjectModel(); + + // Unmerged. + merged.setArtifactId( mainProject.getArtifactId() ); + merged.setPackaging( StringUtils.defaultIfEmpty( mainProject.getPackaging(), "jar" ) ); + merged.setRelocation( mainProject.getRelocation() ); + + // Merged + merged.setGroupId( merge( mainProject.getGroupId(), parentProject.getGroupId() ) ); + merged.setVersion( merge( mainProject.getVersion(), parentProject.getVersion() ) ); + merged.setName( merge( mainProject.getName(), parentProject.getName() ) ); + merged.setUrl( merge( mainProject.getUrl(), parentProject.getUrl() ) ); + merged.setDescription( merge( mainProject.getDescription(), parentProject.getDescription() ) ); + + merged.setOrigin( "merged" ); + + merged.setCiManagement( merge( mainProject.getCiManagement(), parentProject.getCiManagement() ) ); + merged.setIndividuals( mergeIndividuals( mainProject.getIndividuals(), parentProject.getIndividuals() ) ); + merged.setIssueManagement( merge( mainProject.getIssueManagement(), parentProject.getIssueManagement() ) ); + merged.setLicenses( mergeLicenses( mainProject.getLicenses(), parentProject.getLicenses() ) ); + merged.setOrganization( merge( mainProject.getOrganization(), parentProject.getOrganization() ) ); + merged.setScm( merge( mainProject.getScm(), parentProject.getScm() ) ); + merged.setRepositories( mergeRepositories( mainProject.getRepositories(), parentProject.getRepositories() ) ); + merged.setDependencies( mergeDependencies( mainProject.getDependencies(), parentProject.getDependencies() ) ); + merged.setDependencyManagement( mergeDependencyManagement( mainProject.getDependencyManagement(), parentProject + .getDependencyManagement() ) ); + merged.setPlugins( mergePlugins( mainProject.getPlugins(), parentProject.getPlugins() ) ); + merged.setReports( mergeReports( mainProject.getReports(), parentProject.getReports() ) ); + merged.setProperties( merge( mainProject.getProperties(), parentProject.getProperties() ) ); + + return merged; + } + + private static Map createArtifactReferenceMap( List artifactReferences ) + { + Map ret = new HashMap(); + + Iterator it = artifactReferences.iterator(); + while ( it.hasNext() ) + { + ArtifactReference artifactReference = (ArtifactReference) it.next(); + String key = toVersionlessArtifactKey( artifactReference ); + ret.put( key, artifactReference ); + } + + return ret; + } + + private static Map createDependencyMap( List dependencies ) + { + Map ret = new HashMap(); + + Iterator it = dependencies.iterator(); + while ( it.hasNext() ) + { + Dependency dep = (Dependency) it.next(); + String key = toVersionlessDependencyKey( dep ); + ret.put( key, dep ); + } + + return ret; + } + + private static Map createExclusionMap( List exclusions ) + { + Map ret = new HashMap(); + + Iterator it = exclusions.iterator(); + while ( it.hasNext() ) + { + Exclusion exclusion = (Exclusion) it.next(); + String key = exclusion.getGroupId() + ":" + exclusion.getArtifactId(); + ret.put( key, exclusion ); + } + + return ret; + } + + private static Map createLicensesMap( List licenses ) + { + Map ret = new HashMap(); + + Iterator it = licenses.iterator(); + while ( it.hasNext() ) + { + License license = (License) it.next(); + // TODO: Change to 'id' when LicenseTypeMapper is created. + String key = license.getName(); + ret.put( key, license ); + } + + return ret; + } + + private static Map createRepositoriesMap( List repositories ) + { + Map ret = new HashMap(); + + Iterator it = repositories.iterator(); + while ( it.hasNext() ) + { + ProjectRepository repo = (ProjectRepository) it.next(); + // Should this really be using repo.id ? + String key = repo.getUrl(); + ret.put( key, repo ); + } + + return ret; + } + + private static boolean empty( String val ) + { + if ( val == null ) + { + return true; + } + + return ( val.trim().length() <= 0 ); + } + + private static ArtifactReference merge( ArtifactReference mainArtifactReference, + ArtifactReference parentArtifactReference ) + { + if ( parentArtifactReference == null ) + { + return mainArtifactReference; + } + + if ( mainArtifactReference == null ) + { + return ArchivaModelCloner.clone( parentArtifactReference ); + } + + ArtifactReference merged = new ArtifactReference(); + + // Unmerged. + merged.setGroupId( mainArtifactReference.getGroupId() ); + merged.setArtifactId( mainArtifactReference.getArtifactId() ); + + // Merged. + merged.setVersion( merge( mainArtifactReference.getVersion(), parentArtifactReference.getVersion() ) ); + merged.setClassifier( merge( mainArtifactReference.getClassifier(), parentArtifactReference.getClassifier() ) ); + merged.setType( merge( mainArtifactReference.getType(), parentArtifactReference.getType() ) ); + + return merged; + } + + private static CiManagement merge( CiManagement mainCim, CiManagement parentCim ) + { + if ( parentCim == null ) + { + return mainCim; + } + + if ( mainCim == null ) + { + return ArchivaModelCloner.clone( parentCim ); + } + + CiManagement merged = new CiManagement(); + + merged.setSystem( merge( mainCim.getSystem(), parentCim.getSystem() ) ); + merged.setUrl( merge( mainCim.getUrl(), parentCim.getUrl() ) ); + + return merged; + } + + private static Dependency merge( Dependency mainDep, Dependency parentDep ) + { + if ( parentDep == null ) + { + return mainDep; + } + + if ( mainDep == null ) + { + Dependency dep = ArchivaModelCloner.clone( parentDep ); + dep.setFromParent( true ); + return dep; + } + + Dependency merged = new Dependency(); + + merged.setFromParent( true ); + + // Unmerged. + merged.setGroupId( mainDep.getGroupId() ); + merged.setArtifactId( mainDep.getArtifactId() ); + + // Merged. + merged.setVersion( merge( mainDep.getVersion(), parentDep.getVersion() ) ); + merged.setClassifier( merge( mainDep.getClassifier(), parentDep.getClassifier() ) ); + merged.setType( merge( mainDep.getType(), parentDep.getType() ) ); + merged.setScope( merge( mainDep.getScope(), parentDep.getScope() ) ); + if ( parentDep.isOptional() ) + { + merged.setOptional( true ); + } + + merged.setSystemPath( merge( mainDep.getSystemPath(), parentDep.getSystemPath() ) ); + merged.setUrl( merge( mainDep.getUrl(), parentDep.getUrl() ) ); + merged.setExclusions( mergeExclusions( mainDep.getExclusions(), parentDep.getExclusions() ) ); + + return merged; + } + + private static IssueManagement merge( IssueManagement mainIssueManagement, IssueManagement parentIssueManagement ) + { + if ( parentIssueManagement == null ) + { + return mainIssueManagement; + } + + if ( mainIssueManagement == null ) + { + return ArchivaModelCloner.clone( parentIssueManagement ); + } + + IssueManagement merged = new IssueManagement(); + + merged.setSystem( merge( mainIssueManagement.getSystem(), parentIssueManagement.getSystem() ) ); + merged.setUrl( merge( mainIssueManagement.getUrl(), parentIssueManagement.getUrl() ) ); + + return merged; + } + + private static Organization merge( Organization mainOrganization, Organization parentOrganization ) + { + if ( parentOrganization == null ) + { + return mainOrganization; + } + + if ( mainOrganization == null ) + { + return ArchivaModelCloner.clone( parentOrganization ); + } + + Organization merged = new Organization(); + + merged.setFavicon( merge( mainOrganization.getFavicon(), parentOrganization.getFavicon() ) ); + merged.setName( merge( mainOrganization.getName(), parentOrganization.getName() ) ); + merged.setUrl( merge( mainOrganization.getUrl(), parentOrganization.getUrl() ) ); + + return merged; + } + + private static Properties merge( Properties mainProperties, Properties parentProperties ) + { + if ( parentProperties == null ) + { + return mainProperties; + } + + if ( mainProperties == null ) + { + return ArchivaModelCloner.clone( parentProperties ); + } + + Properties merged = new Properties(); + + Enumeration keys = parentProperties.propertyNames(); + while ( keys.hasMoreElements() ) + { + String key = (String) keys.nextElement(); + merged.put( key, merge( mainProperties.getProperty( key ), parentProperties.getProperty( key ) ) ); + } + + return merged; + } + + private static Scm merge( Scm mainScm, Scm parentScm ) + { + if ( parentScm == null ) + { + return mainScm; + } + + if ( mainScm == null ) + { + return ArchivaModelCloner.clone( parentScm ); + } + + Scm merged = new Scm(); + + merged.setConnection( merge( mainScm.getConnection(), parentScm.getConnection() ) ); + merged.setDeveloperConnection( merge( mainScm.getDeveloperConnection(), parentScm.getDeveloperConnection() ) ); + merged.setUrl( merge( mainScm.getUrl(), parentScm.getUrl() ) ); + + return merged; + } + + private static String merge( String main, String parent ) + { + if ( empty( main ) && !empty( parent ) ) + { + return parent; + } + + return main; + } + + private static List mergeArtifactReferences( List mainArtifactReferences, List parentArtifactReferences ) + { + if ( parentArtifactReferences == null ) + { + return mainArtifactReferences; + } + + if ( mainArtifactReferences == null ) + { + return ArchivaModelCloner.cloneLicenses( parentArtifactReferences ); + } + + List merged = new ArrayList(); + + Map mainArtifactReferenceMap = createArtifactReferenceMap( mainArtifactReferences ); + Map parentArtifactReferenceMap = createArtifactReferenceMap( parentArtifactReferences ); + + Iterator it = mainArtifactReferenceMap.entrySet().iterator(); + while ( it.hasNext() ) + { + Map.Entry entry = (Entry) it.next(); + String key = (String) entry.getKey(); + ArtifactReference mainArtifactReference = (ArtifactReference) entry.getValue(); + ArtifactReference parentArtifactReference = (ArtifactReference) parentArtifactReferenceMap.get( key ); + + if ( parentArtifactReference == null ) + { + merged.add( mainArtifactReference ); + } + else + { + // Not merging. Local wins. + merged.add( merge( mainArtifactReference, parentArtifactReference ) ); + } + } + + return merged; + } + + private static List mergeDependencies( List mainDependencies, List parentDependencies ) + { + if ( parentDependencies == null ) + { + return mainDependencies; + } + + if ( mainDependencies == null ) + { + List merged = ArchivaModelCloner.cloneDependencies( parentDependencies ); + Iterator it = merged.iterator(); + while ( it.hasNext() ) + { + Dependency dep = (Dependency) it.next(); + dep.setFromParent( true ); + } + return merged; + } + + List merged = new ArrayList(); + + Map mainDepMap = createDependencyMap( mainDependencies ); + Map parentDepMap = createDependencyMap( parentDependencies ); + Set uniqueKeys = new HashSet(); + uniqueKeys.addAll( mainDepMap.keySet() ); + uniqueKeys.addAll( parentDepMap.keySet() ); + + Iterator it = uniqueKeys.iterator(); + while ( it.hasNext() ) + { + String key = (String) it.next(); + Dependency parentDep = (Dependency) parentDepMap.get( key ); + Dependency mainDep = (Dependency) mainDepMap.get( key ); + + if ( parentDep == null ) + { + // Means there is no parent dep to override main dep. + merged.add( mainDep ); + } + else + { + // Parent dep exists (main doesn't have to). + // Merge the parent over the main dep. + merged.add( merge( mainDep, parentDep ) ); + } + } + + return merged; + } + + private static List mergeDependencyManagement( List mainDepMgmt, List parentDepMgmt ) + { + if ( parentDepMgmt == null ) + { + return mainDepMgmt; + } + + if ( mainDepMgmt == null ) + { + List merged = ArchivaModelCloner.cloneDependencies( parentDepMgmt ); + Iterator it = merged.iterator(); + while ( it.hasNext() ) + { + Dependency dep = (Dependency) it.next(); + dep.setFromParent( true ); + } + return merged; + } + + List merged = new ArrayList(); + + Map mainDepMap = createDependencyMap( mainDepMgmt ); + Map parentDepMap = createDependencyMap( parentDepMgmt ); + Set uniqueKeys = new HashSet(); + uniqueKeys.addAll( mainDepMap.keySet() ); + uniqueKeys.addAll( parentDepMap.keySet() ); + + Iterator it = uniqueKeys.iterator(); + while ( it.hasNext() ) + { + String key = (String) it.next(); + Dependency parentDep = (Dependency) parentDepMap.get( key ); + Dependency mainDep = (Dependency) mainDepMap.get( key ); + + if ( parentDep == null ) + { + // Means there is no parent depMan entry to override main depMan. + merged.add( mainDep ); + } + else + { + // Parent depMan entry exists (main doesn't have to). + // Merge the parent over the main depMan entry. + merged.add( merge( mainDep, parentDep ) ); + } + } + + return merged; + } + + public static List mergeExclusions( List mainExclusions, List parentExclusions ) + { + if ( parentExclusions == null ) + { + return mainExclusions; + } + + if ( mainExclusions == null ) + { + return ArchivaModelCloner.cloneExclusions( parentExclusions ); + } + + List merged = new ArrayList(); + + Map mainExclusionMap = createExclusionMap( mainExclusions ); + Map parentExclusionMap = createExclusionMap( parentExclusions ); + + Iterator it = mainExclusionMap.entrySet().iterator(); + while ( it.hasNext() ) + { + Map.Entry entry = (Entry) it.next(); + String key = (String) entry.getKey(); + Exclusion mainExclusion = (Exclusion) entry.getValue(); + Exclusion parentExclusion = (Exclusion) parentExclusionMap.get( key ); + + if ( parentExclusion == null ) + { + merged.add( mainExclusion ); + } + else + { + merged.add( parentExclusion ); + } + } + + return merged; + } + + private static List mergeIndividuals( List mainIndividuals, List parentIndividuals ) + { + if ( parentIndividuals == null ) + { + return mainIndividuals; + } + + if ( mainIndividuals == null ) + { + return ArchivaModelCloner.cloneIndividuals( parentIndividuals ); + } + + List merged = ArchivaModelCloner.cloneIndividuals( mainIndividuals ); + + Iterator it = parentIndividuals.iterator(); + while ( it.hasNext() ) + { + Individual parentIndividual = (Individual) it.next(); + + if ( !mainIndividuals.contains( parentIndividual ) ) + { + merged.add( parentIndividual ); + } + } + + return merged; + } + + private static List mergeLicenses( List mainLicenses, List parentLicenses ) + { + if ( parentLicenses == null ) + { + return mainLicenses; + } + + if ( mainLicenses == null ) + { + return ArchivaModelCloner.cloneLicenses( parentLicenses ); + } + + List merged = new ArrayList(); + + Map mainLicensesMap = createLicensesMap( mainLicenses ); + Map parentLicensesMap = createLicensesMap( parentLicenses ); + + Iterator it = mainLicensesMap.entrySet().iterator(); + while ( it.hasNext() ) + { + Map.Entry entry = (Entry) it.next(); + String key = (String) entry.getKey(); + License mainLicense = (License) entry.getValue(); + License parentLicense = (License) parentLicensesMap.get( key ); + + if ( parentLicense == null ) + { + merged.add( mainLicense ); + } + else + { + // Not merging. Local wins. + merged.add( parentLicense ); + } + } + + return merged; + } + + private static List mergePlugins( List mainPlugins, List parentPlugins ) + { + return mergeArtifactReferences( mainPlugins, parentPlugins ); + } + + private static List mergeReports( List mainReports, List parentReports ) + { + return mergeArtifactReferences( mainReports, parentReports ); + } + + private static List mergeRepositories( List mainRepositories, List parentRepositories ) + { + if ( parentRepositories == null ) + { + return mainRepositories; + } + + if ( mainRepositories == null ) + { + return ArchivaModelCloner.cloneLicenses( parentRepositories ); + } + + List merged = new ArrayList(); + + Map mainRepositoriesMap = createRepositoriesMap( mainRepositories ); + Map parentRepositoriesMap = createRepositoriesMap( parentRepositories ); + + Iterator it = mainRepositoriesMap.entrySet().iterator(); + while ( it.hasNext() ) + { + Map.Entry entry = (Entry) it.next(); + String key = (String) entry.getKey(); + ProjectRepository mainProjectRepository = (ProjectRepository) entry.getValue(); + ProjectRepository parentProjectRepository = (ProjectRepository) parentRepositoriesMap.get( key ); + + if ( parentProjectRepository == null ) + { + merged.add( mainProjectRepository ); + } + else + { + // Not merging. Local wins. + merged.add( parentProjectRepository ); + } + } + + return merged; + } + + private static String toVersionlessArtifactKey( ArtifactReference artifactReference ) + { + StringBuffer key = new StringBuffer(); + + key.append( artifactReference.getGroupId() ).append( ":" ).append( artifactReference.getArtifactId() ); + key.append( StringUtils.defaultString( artifactReference.getClassifier() ) ).append( ":" ); + key.append( artifactReference.getType() ); + + return key.toString(); + } + + private static String toVersionlessDependencyKey( Dependency dep ) + { + StringBuffer key = new StringBuffer(); + + key.append( dep.getGroupId() ).append( ":" ).append( dep.getArtifactId() ); + key.append( StringUtils.defaultString( dep.getClassifier() ) ).append( ":" ); + key.append( dep.getType() ); + + return key.toString(); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/ProjectModelMonitor.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/ProjectModelMonitor.java new file mode 100644 index 000000000..ed6a63da7 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/ProjectModelMonitor.java @@ -0,0 +1,40 @@ +package org.apache.maven.archiva.repository.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. + */ + +import org.apache.maven.archiva.model.ArchivaProjectModel; + +/** + * ProjectModelMonitor + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public interface ProjectModelMonitor +{ + /** + * Report a problem encountered with a model. + * + * @param model the model that caused the problem. + * @param type the type of problem. + * @param problem the problem description. + */ + public void modelProblem( ArchivaProjectModel model, String type, String problem ); +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/ProjectModelReader.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/ProjectModelReader.java new file mode 100644 index 000000000..004588321 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/ProjectModelReader.java @@ -0,0 +1,35 @@ +package org.apache.maven.archiva.repository.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. + */ + +import org.apache.maven.archiva.model.ArchivaProjectModel; + +import java.io.File; + +/** + * ProjectModelReader + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public interface ProjectModelReader +{ + public ArchivaProjectModel read( File pomFile ) throws ProjectModelException; +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/ProjectModelResolver.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/ProjectModelResolver.java new file mode 100644 index 000000000..c513349c4 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/ProjectModelResolver.java @@ -0,0 +1,42 @@ +package org.apache.maven.archiva.repository.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. + */ + +import org.apache.maven.archiva.model.ArchivaProjectModel; +import org.apache.maven.archiva.model.VersionedReference; + +/** + * Interface for ProjectModel resolution. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public interface ProjectModelResolver +{ + /** + * Get the ProjectModel given a specific {@link RepositoryContent} key. + * + * @param reference the reference to the other project. + * @return the ArchivaProjectModel representing the provided {@link RepositoryContent} key. + * @throws ProjectModelException if the project model cannot be resolved. + */ + public ArchivaProjectModel resolveProjectModel( VersionedReference reference ) + throws ProjectModelException; +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/ProjectModelResolverFactory.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/ProjectModelResolverFactory.java new file mode 100644 index 000000000..870cbcbbe --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/ProjectModelResolverFactory.java @@ -0,0 +1,137 @@ +package org.apache.maven.archiva.repository.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. + */ + +import java.util.List; + +import org.apache.commons.lang.StringUtils; +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.ConfigurationNames; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.repository.ManagedRepositoryContent; +import org.apache.maven.archiva.repository.RepositoryContentFactory; +import org.apache.maven.archiva.repository.RepositoryException; +import org.apache.maven.archiva.repository.project.readers.ProjectModel300Reader; +import org.apache.maven.archiva.repository.project.readers.ProjectModel400Reader; +import org.apache.maven.archiva.repository.project.resolvers.ManagedRepositoryProjectResolver; +import org.apache.maven.archiva.repository.project.resolvers.NopProjectResolver; +import org.apache.maven.archiva.repository.project.resolvers.ProjectModelResolverStack; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException; +import org.codehaus.plexus.registry.Registry; +import org.codehaus.plexus.registry.RegistryListener; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Factory for ProjectModelResolver objects + * + * @author Joakim Erdfelt + * @version $Id$ + * @plexus.component role="org.apache.maven.archiva.repository.project.ProjectModelResolverFactory" + */ +public class ProjectModelResolverFactory + implements RegistryListener, Initializable +{ + private Logger log = LoggerFactory.getLogger( ProjectModelResolverFactory.class ); + + /** + * @plexus.requirement + */ + private ArchivaConfiguration archivaConfiguration; + + /** + * @plexus.requirement + */ + private RepositoryContentFactory repositoryFactory; + + private ProjectModelResolverStack currentResolverStack = new ProjectModelResolverStack(); + + public void afterConfigurationChange( Registry registry, String propertyName, Object propertyValue ) + { + if ( ConfigurationNames.isManagedRepositories( propertyName ) ) + { + update(); + } + } + + public void beforeConfigurationChange( Registry registry, String propertyName, Object propertyValue ) + { + /* do nothing */ + } + + public ProjectModelResolverStack getCurrentResolverStack() + { + return currentResolverStack; + } + + public void initialize() + throws InitializationException + { + update(); + archivaConfiguration.addChangeListener( this ); + } + + private ManagedRepositoryProjectResolver toResolver( ManagedRepositoryConfiguration repo ) + throws RepositoryException + { + ManagedRepositoryContent repoContent = repositoryFactory.getManagedRepositoryContent( repo.getId() ); + + ProjectModelReader reader; + if ( StringUtils.equals( "legacy", repo.getLayout() ) ) + { + reader = new ProjectModel300Reader(); + } + else + { + reader = new ProjectModel400Reader(); + } + + return new ManagedRepositoryProjectResolver( repoContent, reader ); + } + + private void update() + { + synchronized ( currentResolverStack ) + { + this.currentResolverStack.clearResolvers(); + + List list = + archivaConfiguration.getConfiguration().getManagedRepositories(); + for ( ManagedRepositoryConfiguration repo : list ) + { + try + { + ManagedRepositoryProjectResolver resolver = toResolver( repo ); + + // Add filesystem based resolver. + this.currentResolverStack.addProjectModelResolver( resolver ); + } + catch ( RepositoryException e ) + { + log.warn( e.getMessage(), e ); + } + } + + // Add no-op resolver. + this.currentResolverStack.addProjectModelResolver( NopProjectResolver.getInstance() ); + } + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/ProjectModelWriter.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/ProjectModelWriter.java new file mode 100644 index 000000000..06edbb67e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/ProjectModelWriter.java @@ -0,0 +1,57 @@ +package org.apache.maven.archiva.repository.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. + */ + +import org.apache.maven.archiva.model.ArchivaProjectModel; + +import java.io.File; +import java.io.IOException; +import java.io.Writer; + +/** + * ProjectModelWriter + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public interface ProjectModelWriter +{ + /** + * Write a project model out to disk. + * + * @param model the model to write. + * @param pomFile the (pom) file on disk to write to. + * @throws ProjectModelException if there was a problem with the model itself. + * @throws IOException if there was a problem writing the pom file. + */ + public void write( ArchivaProjectModel model, File pomFile ) + throws ProjectModelException, IOException; + + /** + * Write a project model out to a {@link Writer}. + * + * @param model the model to write. + * @param writer the writer (stream) to write to. + * @throws ProjectModelException if there was a problem with the model itself. + * @throws IOException if there was a problem writing the pom file. + */ + public void write( ArchivaProjectModel model, Writer writer ) + throws ProjectModelException, IOException; +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/dependencies/ProjectModelBasedGraphBuilder.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/dependencies/ProjectModelBasedGraphBuilder.java new file mode 100644 index 000000000..f6e6eabc7 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/dependencies/ProjectModelBasedGraphBuilder.java @@ -0,0 +1,116 @@ +package org.apache.maven.archiva.repository.project.dependencies; + +/* + * 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.archiva.dependency.graph.DependencyGraph; +import org.apache.maven.archiva.dependency.graph.DependencyGraphBuilder; +import org.apache.maven.archiva.dependency.graph.DependencyGraphNode; +import org.apache.maven.archiva.dependency.graph.DependencyGraphUtils; +import org.apache.maven.archiva.model.ArchivaProjectModel; +import org.apache.maven.archiva.model.ArtifactReference; +import org.apache.maven.archiva.model.VersionedReference; +import org.apache.maven.archiva.repository.project.ProjectModelException; +import org.apache.maven.archiva.repository.project.ProjectModelResolverFactory; +import org.apache.maven.archiva.repository.project.filters.EffectiveProjectModelFilter; + +/** + * ProjectModelBasedGraphBuilder + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component + * role="org.apache.maven.archiva.dependency.graph.DependencyGraphBuilder" + * role-hint="project-model" + */ +public class ProjectModelBasedGraphBuilder + implements DependencyGraphBuilder +{ + /** + * @plexus.requirement + */ + private ProjectModelResolverFactory resolverFactory; + + /** + * @plexus.requirement + * role="org.apache.maven.archiva.repository.project.ProjectModelFilter" + * role-hint="effective" + */ + private EffectiveProjectModelFilter effectiveFilter = new EffectiveProjectModelFilter(); + + public DependencyGraph createGraph( VersionedReference versionedProjectReference ) + { + String groupId = versionedProjectReference.getGroupId(); + String artifactId = versionedProjectReference.getArtifactId(); + String version = versionedProjectReference.getVersion(); + + DependencyGraph graph = new DependencyGraph( groupId, artifactId, version ); + return graph; + } + + public void resolveNode( DependencyGraph graph, DependencyGraphNode fromNode, + VersionedReference versionedProjectReference ) + { + ArchivaProjectModel model = resolveModel( fromNode.getArtifact() ); + + DependencyGraphUtils.addNodeFromModel( model, graph, fromNode ); + } + + private ArchivaProjectModel resolveModel( ArtifactReference reference ) + { + VersionedReference projectRef = new VersionedReference(); + + projectRef.setGroupId( reference.getGroupId() ); + projectRef.setArtifactId( reference.getArtifactId() ); + projectRef.setVersion( reference.getVersion() ); + + ArchivaProjectModel model = resolverFactory.getCurrentResolverStack().findProject( projectRef ); + + if ( model == null ) + { + return createDefaultModel( reference ); + } + + try + { + ArchivaProjectModel processedModel = effectiveFilter.filter( model ); + + return processedModel; + } + catch ( ProjectModelException e ) + { + e.printStackTrace( System.err ); + return createDefaultModel( reference ); + } + } + + private ArchivaProjectModel createDefaultModel( ArtifactReference reference ) + { + ArchivaProjectModel model = new ArchivaProjectModel(); + + // Create default (dummy) model + model = new ArchivaProjectModel(); + model.setGroupId( reference.getGroupId() ); + model.setArtifactId( reference.getArtifactId() ); + model.setVersion( reference.getVersion() ); + model.setPackaging( reference.getType() ); + return model; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/filters/EffectiveProjectModelFilter.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/filters/EffectiveProjectModelFilter.java new file mode 100644 index 000000000..24a22f90c --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/filters/EffectiveProjectModelFilter.java @@ -0,0 +1,309 @@ +package org.apache.maven.archiva.repository.project.filters; + +/* + * 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.collections.CollectionUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.maven.archiva.model.ArchivaModelCloner; +import org.apache.maven.archiva.model.ArchivaProjectModel; +import org.apache.maven.archiva.model.Dependency; +import org.apache.maven.archiva.model.VersionedReference; +import org.apache.maven.archiva.repository.project.ProjectModelException; +import org.apache.maven.archiva.repository.project.ProjectModelFilter; +import org.apache.maven.archiva.repository.project.ProjectModelMerge; +import org.apache.maven.archiva.repository.project.ProjectModelResolverFactory; +import org.codehaus.plexus.cache.Cache; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +/** + * Builder for the Effective Project Model. + * + * @author Joakim Erdfelt + * @version $Id$ + * @plexus.component role="org.apache.maven.archiva.repository.project.ProjectModelFilter" + * role-hint="effective" + */ +public class EffectiveProjectModelFilter + implements ProjectModelFilter +{ + private ProjectModelFilter expressionFilter = new ProjectModelExpressionFilter(); + + /** + * @plexus.requirement + */ + private ProjectModelResolverFactory resolverFactory; + + /** + * @plexus.requirement role-hint="effective-project-cache" + */ + private Cache effectiveProjectCache; + + /** + * Take the provided {@link ArchivaProjectModel} and build the effective {@link ArchivaProjectModel}. + * + * Steps: + * 1) Expand any expressions / properties. + * 2) Walk the parent project references and merge. + * 3) Apply dependency management settings. + * + * @param project the project to create the effective {@link ArchivaProjectModel} from. + * @return a the effective {@link ArchivaProjectModel}. + * @throws ProjectModelException if there was a problem building the effective pom. + */ + public ArchivaProjectModel filter( final ArchivaProjectModel project ) + throws ProjectModelException + { + if ( project == null ) + { + return null; + } + + if ( resolverFactory.getCurrentResolverStack().isEmpty() ) + { + throw new IllegalStateException( "Unable to build effective pom with no project model resolvers defined." ); + } + + ArchivaProjectModel effectiveProject; + String projectKey = toProjectKey( project ); + + synchronized ( effectiveProjectCache ) + { + if ( effectiveProjectCache.hasKey( projectKey ) ) + { + DEBUG( "Fetching (from cache/projectKey): " + projectKey ); + effectiveProject = (ArchivaProjectModel) effectiveProjectCache.get( projectKey ); + return effectiveProject; + } + } + + // Clone submitted project (so that we don't mess with it) + effectiveProject = ArchivaModelCloner.clone( project ); + + // Setup Expression Evaluation pieces. + effectiveProject = expressionFilter.filter( effectiveProject ); + + DEBUG( "Starting build of effective with: " + effectiveProject ); + + // Merge in all the parent poms. + effectiveProject = mergeParent( effectiveProject ); + + // Resolve dependency versions from dependency management. + applyDependencyManagement( effectiveProject ); + + // Do not add project into cache if it contains no groupId and + // version information + if ( project.getGroupId() != null && project.getVersion() != null ) + { + synchronized ( effectiveProjectCache ) + { + DEBUG( "Putting (to cache/projectKey): " + projectKey ); + effectiveProjectCache.put( projectKey, effectiveProject ); + } + } + + // Return what we got. + return effectiveProject; + } + + private void applyDependencyManagement( ArchivaProjectModel pom ) + { + if ( CollectionUtils.isEmpty( pom.getDependencyManagement() ) + || CollectionUtils.isEmpty( pom.getDependencies() ) ) + { + // Nothing to do. All done! + return; + } + + Map managedDependencies = createDependencyMap( pom.getDependencyManagement() ); + Iterator it = pom.getDependencies().iterator(); + while ( it.hasNext() ) + { + Dependency dep = it.next(); + String key = toVersionlessDependencyKey( dep ); + + // Do we need to do anything? + if ( managedDependencies.containsKey( key ) ) + { + Dependency mgmtDep = (Dependency) managedDependencies.get( key ); + + dep.setVersion( mgmtDep.getVersion() ); + dep.setScope( mgmtDep.getScope() ); + dep.setExclusions( ProjectModelMerge.mergeExclusions( dep.getExclusions(), mgmtDep.getExclusions() ) ); + } + } + } + + private ArchivaProjectModel mergeParent( ArchivaProjectModel pom ) + throws ProjectModelException + { + ArchivaProjectModel mixedProject; + + DEBUG( "Project: " + toProjectKey( pom ) ); + + if ( pom.getParentProject() != null ) + { + // Use parent reference. + VersionedReference parentRef = pom.getParentProject(); + + String parentKey = VersionedReference.toKey( parentRef ); + + DEBUG( "Has parent: " + parentKey ); + + ArchivaProjectModel parentProject; + + synchronized ( effectiveProjectCache ) + { + // is the pre-merged parent in the cache? + if ( effectiveProjectCache.hasKey( parentKey ) ) + { + DEBUG( "Fetching (from cache/parentKey): " + parentKey ); + // Use the one from the cache. + parentProject = (ArchivaProjectModel) effectiveProjectCache.get( parentKey ); + } + else + { + // Look it up, using resolvers. + parentProject = this.resolverFactory.getCurrentResolverStack().findProject( parentRef ); + } + } + + if ( parentProject != null ) + { + // Merge the pom with the parent pom. + parentProject = expressionFilter.filter( parentProject ); + parentProject = mergeParent( parentProject ); + + // Cache the pre-merged parent. + synchronized ( effectiveProjectCache ) + { + DEBUG( "Putting (to cache/parentKey/merged): " + parentKey ); + // Add the merged parent pom to the cache. + effectiveProjectCache.put( parentKey, parentProject ); + } + + // Now merge the parent with the current + mixedProject = ProjectModelMerge.merge( pom, parentProject ); + } + else + { + // Shortcircuit due to missing parent pom. + // TODO: Document this via a monitor. + mixedProject = mixinSuperPom( pom ); + + // Cache the non-existant parent. + synchronized ( effectiveProjectCache ) + { + DEBUG( "Putting (to cache/parentKey/basicPom): " + parentKey ); + // Add the basic pom to cache. + effectiveProjectCache.put( parentKey, createBasicPom( parentRef ) ); + } + } + } + else + { + DEBUG( "No parent found" ); + + /* Mix in the super-pom. + * + * Super POM from maven/components contains many things. + * However, for purposes of archiva, only the + * and sections are of any value. + */ + + mixedProject = mixinSuperPom( pom ); + } + + return mixedProject; + } + + private ArchivaProjectModel createBasicPom( VersionedReference ref ) + { + ArchivaProjectModel model = new ArchivaProjectModel(); + model.setGroupId( ref.getGroupId() ); + model.setArtifactId( ref.getArtifactId() ); + model.setVersion( ref.getVersion() ); + model.setPackaging( "jar" ); + + return model; + } + + /** + * Super POM from maven/components contains many things. + * However, for purposes of archiva, only the + * and sections are of any value. + * + * @param pom + * @return + */ + private ArchivaProjectModel mixinSuperPom( ArchivaProjectModel pom ) + { + // TODO: add super pom repositories. + DEBUG( "Mix in Super POM: " + pom ); + + return pom; + } + + private static Map createDependencyMap( List dependencies ) + { + Map ret = new HashMap(); + + Iterator it = dependencies.iterator(); + while ( it.hasNext() ) + { + Dependency dep = it.next(); + String key = toVersionlessDependencyKey( dep ); + ret.put( key, dep ); + } + + return ret; + } + + private static String toVersionlessDependencyKey( Dependency dep ) + { + StringBuffer key = new StringBuffer(); + + key.append( dep.getGroupId() ).append( ":" ).append( dep.getArtifactId() ); + key.append( StringUtils.defaultString( dep.getClassifier() ) ).append( ":" ); + key.append( dep.getType() ); + + return key.toString(); + } + + private String toProjectKey( ArchivaProjectModel project ) + { + StringBuffer key = new StringBuffer(); + + key.append( project.getGroupId() ).append( ":" ); + key.append( project.getArtifactId() ).append( ":" ); + key.append( project.getVersion() ); + + return key.toString(); + } + + private void DEBUG( String msg ) + { + // Used in debugging of this object. + // System.out.println( "[EffectiveProjectModelFilter] " + msg ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/filters/ProjectModelExpressionFilter.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/filters/ProjectModelExpressionFilter.java new file mode 100644 index 000000000..1c2f989ba --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/filters/ProjectModelExpressionFilter.java @@ -0,0 +1,441 @@ +package org.apache.maven.archiva.repository.project.filters; + +/* + * 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.collections.CollectionUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.maven.archiva.model.ArchivaModelCloner; +import org.apache.maven.archiva.model.ArchivaProjectModel; +import org.apache.maven.archiva.model.ArtifactReference; +import org.apache.maven.archiva.model.CiManagement; +import org.apache.maven.archiva.model.Dependency; +import org.apache.maven.archiva.model.Exclusion; +import org.apache.maven.archiva.model.Individual; +import org.apache.maven.archiva.model.IssueManagement; +import org.apache.maven.archiva.model.License; +import org.apache.maven.archiva.model.MailingList; +import org.apache.maven.archiva.model.Organization; +import org.apache.maven.archiva.model.ProjectRepository; +import org.apache.maven.archiva.model.Scm; +import org.apache.maven.archiva.model.VersionedReference; +import org.apache.maven.archiva.repository.project.ProjectModelException; +import org.apache.maven.archiva.repository.project.ProjectModelFilter; +import org.codehaus.plexus.evaluator.DefaultExpressionEvaluator; +import org.codehaus.plexus.evaluator.EvaluatorException; +import org.codehaus.plexus.evaluator.ExpressionEvaluator; +import org.codehaus.plexus.evaluator.ExpressionSource; +import org.codehaus.plexus.evaluator.sources.PropertiesExpressionSource; +import org.codehaus.plexus.evaluator.sources.SystemPropertyExpressionSource; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Properties; +import java.util.Set; + +/** + * ProjectModelExpressionFilter + * + * @author Joakim Erdfelt + * @version $Id$ + * @plexus.component role="org.apache.maven.archiva.repository.project.ProjectModelFilter" + * role-hint="expression" + * instantiation-strategy="per-lookup" + */ +public class ProjectModelExpressionFilter + implements ProjectModelFilter +{ + private ExpressionEvaluator evaluator = new DefaultExpressionEvaluator(); + + /** + * Find and Evaluate the Expressions present in the model. + * + * @param model the model to correct. + */ + public ArchivaProjectModel filter( final ArchivaProjectModel model ) + throws ProjectModelException + { + Properties props = new Properties(); + + if ( model.getProperties() != null ) + { + props.putAll( model.getProperties() ); + } + + ArchivaProjectModel ret = ArchivaModelCloner.clone( model ); + + // TODO: should probably clone evaluator to prevent threading issues. + synchronized ( evaluator ) + { + // TODO: create .resetSources() method in ExpressionEvaluator project on plexus side. + // Remove previous expression sources. + List oldSources = new ArrayList(); + oldSources.addAll( evaluator.getExpressionSourceList() ); + for ( ExpressionSource exprSrc : oldSources ) + { + evaluator.removeExpressionSource( exprSrc ); + } + + // Setup new sources (based on current model) + PropertiesExpressionSource propsSource = new PropertiesExpressionSource(); + propsSource.setProperties( props ); + evaluator.addExpressionSource( propsSource ); + + // Add system properties to the mix. + evaluator.addExpressionSource( new SystemPropertyExpressionSource() ); + + try + { + // Setup some common properties. + String groupId = StringUtils.defaultString( evaluator.expand( model.getGroupId() ) ); + String artifactId = StringUtils.defaultString( evaluator.expand( model.getArtifactId() ) ); + String version = StringUtils.defaultString( evaluator.expand( model.getVersion() ) ); + String name = StringUtils.defaultString( evaluator.expand( model.getName() ) ); + + /* Archiva doesn't need to handle a full expression language with object tree walking + * as the requirements within Archiva are much smaller, a quick replacement of the + * important fields (groupId, artifactId, version, name) are handled specifically. + */ + props.setProperty( "pom.groupId", groupId ); + props.setProperty( "pom.artifactId", artifactId ); + props.setProperty( "pom.version", version ); + props.setProperty( "pom.name", name ); + props.setProperty( "project.groupId", groupId ); + props.setProperty( "project.artifactId", artifactId ); + props.setProperty( "project.version", version ); + props.setProperty( "project.name", name ); + + // Evaluate everything. + ret.setVersion( evaluator.expand( ret.getVersion() ) ); + ret.setGroupId( evaluator.expand( ret.getGroupId() ) ); + ret.setName( evaluator.expand( ret.getName() ) ); + ret.setDescription( evaluator.expand( ret.getDescription() ) ); + ret.setPackaging( evaluator.expand( ret.getPackaging() ) ); + ret.setUrl( evaluator.expand( ret.getUrl() ) ); + + evaluateParentProject( evaluator, ret.getParentProject() ); + + evaluateBuildExtensions( evaluator, ret.getBuildExtensions() ); + evaluateCiManagement( evaluator, ret.getCiManagement() ); + evaluateDependencyList( evaluator, ret.getDependencies() ); + evaluateDependencyList( evaluator, ret.getDependencyManagement() ); + evaluateIndividuals( evaluator, ret.getIndividuals() ); + evaluateIssueManagement( evaluator, ret.getIssueManagement() ); + evaluateLicenses( evaluator, ret.getLicenses() ); + evaluateMailingLists( evaluator, ret.getMailingLists() ); + evaluateOrganization( evaluator, ret.getOrganization() ); + evaluatePlugins( evaluator, ret.getPlugins() ); + evaluateRelocation( evaluator, ret.getRelocation() ); + evaluateReports( evaluator, ret.getReports() ); + evaluateRepositories( evaluator, ret.getRepositories() ); + evaluateScm( evaluator, ret.getScm() ); + } + catch ( EvaluatorException e ) + { + throw new ProjectModelException( "Unable to evaluate expression in model: " + e.getMessage(), e ); + } + } + + return ret; + } + + private void evaluateArtifactReferenceList( ExpressionEvaluator eval, List refs ) + throws EvaluatorException + { + if ( CollectionUtils.isEmpty( refs ) ) + { + return; + } + + for ( ArtifactReference ref : refs ) + { + ref.setGroupId( eval.expand( ref.getGroupId() ) ); + ref.setArtifactId( eval.expand( ref.getArtifactId() ) ); + ref.setVersion( eval.expand( ref.getVersion() ) ); + ref.setClassifier( eval.expand( ref.getClassifier() ) ); + ref.setType( eval.expand( ref.getType() ) ); + } + } + + private void evaluateBuildExtensions( ExpressionEvaluator eval, List buildExtensions ) + throws EvaluatorException + { + if ( CollectionUtils.isEmpty( buildExtensions ) ) + { + return; + } + + for ( ArtifactReference ref : buildExtensions ) + { + ref.setGroupId( eval.expand( ref.getGroupId() ) ); + ref.setArtifactId( eval.expand( ref.getArtifactId() ) ); + ref.setVersion( eval.expand( ref.getVersion() ) ); + ref.setClassifier( eval.expand( ref.getClassifier() ) ); + ref.setType( eval.expand( ref.getType() ) ); + } + } + + private void evaluateCiManagement( ExpressionEvaluator eval, CiManagement ciManagement ) + throws EvaluatorException + { + if ( ciManagement == null ) + { + return; + } + + ciManagement.setSystem( eval.expand( ciManagement.getSystem() ) ); + ciManagement.setUrl( eval.expand( ciManagement.getUrl() ) ); + } + + private void evaluateDependencyList( ExpressionEvaluator eval, List dependencies ) + throws EvaluatorException + { + if ( CollectionUtils.isEmpty( dependencies ) ) + { + return; + } + + for ( Dependency dependency : dependencies ) + { + dependency.setGroupId( eval.expand( dependency.getGroupId() ) ); + dependency.setArtifactId( eval.expand( dependency.getArtifactId() ) ); + dependency.setVersion( eval.expand( dependency.getVersion() ) ); + dependency.setScope( eval.expand( dependency.getScope() ) ); + dependency.setType( eval.expand( dependency.getType() ) ); + dependency.setUrl( eval.expand( dependency.getUrl() ) ); + + evaluateExclusions( eval, dependency.getExclusions() ); + } + } + + private void evaluateExclusions( ExpressionEvaluator eval, List exclusions ) + throws EvaluatorException + { + if ( CollectionUtils.isEmpty( exclusions ) ) + { + return; + } + + for ( Exclusion exclusion : exclusions ) + { + exclusion.setGroupId( eval.expand( exclusion.getGroupId() ) ); + exclusion.setArtifactId( eval.expand( exclusion.getArtifactId() ) ); + } + } + + private void evaluateIndividuals( ExpressionEvaluator eval, List individuals ) + throws EvaluatorException + { + if ( CollectionUtils.isEmpty( individuals ) ) + { + return; + } + + for ( Individual individual : individuals ) + { + individual.setPrincipal( eval.expand( individual.getPrincipal() ) ); + individual.setName( eval.expand( individual.getName() ) ); + individual.setEmail( eval.expand( individual.getEmail() ) ); + individual.setTimezone( eval.expand( individual.getTimezone() ) ); + individual.setOrganization( eval.expand( individual.getOrganization() ) ); + individual.setOrganizationUrl( eval.expand( individual.getOrganizationUrl() ) ); + individual.setUrl( eval.expand( individual.getUrl() ) ); + + evaluateProperties( eval, individual.getProperties() ); + evaluateStringList( eval, individual.getRoles() ); + } + } + + private void evaluateIssueManagement( ExpressionEvaluator eval, IssueManagement issueManagement ) + throws EvaluatorException + { + if ( issueManagement == null ) + { + return; + } + + issueManagement.setSystem( eval.expand( issueManagement.getSystem() ) ); + issueManagement.setUrl( eval.expand( issueManagement.getUrl() ) ); + } + + private void evaluateLicenses( ExpressionEvaluator eval, List licenses ) + throws EvaluatorException + { + if ( CollectionUtils.isEmpty( licenses ) ) + { + return; + } + + for ( License license : licenses ) + { + license.setName( eval.expand( license.getName() ) ); + license.setUrl( eval.expand( license.getUrl() ) ); + license.setComments( eval.expand( license.getComments() ) ); + } + } + + private void evaluateMailingLists( ExpressionEvaluator eval, List mailingLists ) + throws EvaluatorException + { + if ( CollectionUtils.isEmpty( mailingLists ) ) + { + return; + } + + for ( MailingList mlist : mailingLists ) + { + mlist.setName( eval.expand( mlist.getName() ) ); + mlist.setSubscribeAddress( eval.expand( mlist.getSubscribeAddress() ) ); + mlist.setUnsubscribeAddress( eval.expand( mlist.getUnsubscribeAddress() ) ); + mlist.setPostAddress( eval.expand( mlist.getPostAddress() ) ); + mlist.setMainArchiveUrl( eval.expand( mlist.getMainArchiveUrl() ) ); + + evaluateStringList( eval, mlist.getOtherArchives() ); + } + } + + private void evaluateOrganization( ExpressionEvaluator eval, Organization organization ) + throws EvaluatorException + { + if ( organization == null ) + { + return; + } + + organization.setName( eval.expand( organization.getName() ) ); + organization.setUrl( eval.expand( organization.getUrl() ) ); + organization.setFavicon( eval.expand( organization.getFavicon() ) ); + } + + private void evaluateParentProject( ExpressionEvaluator eval, VersionedReference parentProject ) + throws EvaluatorException + { + if ( parentProject == null ) + { + return; + } + + parentProject.setGroupId( eval.expand( parentProject.getGroupId() ) ); + parentProject.setArtifactId( eval.expand( parentProject.getArtifactId() ) ); + parentProject.setVersion( eval.expand( parentProject.getVersion() ) ); + } + + private void evaluatePlugins( ExpressionEvaluator eval, List plugins ) + throws EvaluatorException + { + evaluateArtifactReferenceList( eval, plugins ); + } + + private void evaluateProperties( ExpressionEvaluator eval, Properties props ) + throws EvaluatorException + { + if ( props == null ) + { + return; + } + + // Only evaluate the values, not the keys. + + // Collect the key names. (Done ahead of time to prevent iteration / concurrent modification exceptions) + Set keys = new HashSet(); + for ( Object obj : props.keySet() ) + { + keys.add( (String) obj ); + } + + // Evaluate all of the values. + for ( String key : keys ) + { + String value = props.getProperty( key ); + props.setProperty( key, eval.expand( value ) ); + } + } + + private void evaluateRelocation( ExpressionEvaluator eval, VersionedReference relocation ) + throws EvaluatorException + { + if ( relocation == null ) + { + return; + } + + relocation.setGroupId( eval.expand( relocation.getGroupId() ) ); + relocation.setArtifactId( eval.expand( relocation.getArtifactId() ) ); + relocation.setVersion( eval.expand( relocation.getVersion() ) ); + } + + private void evaluateReports( ExpressionEvaluator eval, List reports ) + throws EvaluatorException + { + evaluateArtifactReferenceList( eval, reports ); + } + + private void evaluateRepositories( ExpressionEvaluator eval, List repositories ) + throws EvaluatorException + { + if ( CollectionUtils.isEmpty( repositories ) ) + { + return; + } + + for ( ProjectRepository repository : repositories ) + { + repository.setId( eval.expand( repository.getId() ) ); + repository.setLayout( eval.expand( repository.getLayout() ) ); + repository.setName( eval.expand( repository.getName() ) ); + repository.setUrl( eval.expand( repository.getUrl() ) ); + } + } + + private void evaluateScm( ExpressionEvaluator eval, Scm scm ) + throws EvaluatorException + { + if ( scm == null ) + { + return; + } + + scm.setConnection( eval.expand( scm.getConnection() ) ); + scm.setDeveloperConnection( eval.expand( scm.getDeveloperConnection() ) ); + scm.setUrl( eval.expand( scm.getUrl() ) ); + } + + private void evaluateStringList( ExpressionEvaluator eval, List strings ) + throws EvaluatorException + { + if ( CollectionUtils.isEmpty( strings ) ) + { + return; + } + + // Create new list to hold post-evaluated strings. + List evaluated = new ArrayList(); + + // Evaluate them all + for ( String str : strings ) + { + evaluated.add( eval.expand( str ) ); + } + + // Populate the original list with the post-evaluated list. + strings.clear(); + strings.addAll( evaluated ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/readers/ProjectModel300Reader.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/readers/ProjectModel300Reader.java new file mode 100644 index 000000000..95aa27c6c --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/readers/ProjectModel300Reader.java @@ -0,0 +1,419 @@ +package org.apache.maven.archiva.repository.project.readers; + +/* + * 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.maven.archiva.model.ArchivaProjectModel; +import org.apache.maven.archiva.model.ArtifactReference; +import org.apache.maven.archiva.model.Dependency; +import org.apache.maven.archiva.model.Individual; +import org.apache.maven.archiva.model.IssueManagement; +import org.apache.maven.archiva.model.License; +import org.apache.maven.archiva.model.MailingList; +import org.apache.maven.archiva.model.Organization; +import org.apache.maven.archiva.model.ProjectRepository; +import org.apache.maven.archiva.model.Scm; +import org.apache.maven.archiva.repository.project.ProjectModelException; +import org.apache.maven.archiva.repository.project.ProjectModelReader; +import org.apache.maven.archiva.xml.XMLException; +import org.apache.maven.archiva.xml.XMLReader; +import org.dom4j.Element; + +import java.io.File; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Properties; + +/** + * ProjectModel300Reader + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ProjectModel300Reader + implements ProjectModelReader +{ + + public ArchivaProjectModel read( File pomFile ) + throws ProjectModelException + { + try + { + XMLReader xml = new XMLReader( "project", pomFile ); + + ArchivaProjectModel model = new ArchivaProjectModel(); + + xml.removeNamespaces(); + + Element project = xml.getElement( "//project" ); + + // TODO: Handle ?? (is this even possible?) + + model.setGroupId( project.elementTextTrim( "groupId" ) ); + model.setArtifactId( project.elementTextTrim( "artifactId" ) ); + // TODO: Handle + model.setVersion( project.elementTextTrim( "currentVersion" ) ); + model.setName( project.elementTextTrim( "name" ) ); + model.setDescription( project.elementTextTrim( "description" ) ); + // TODO: what to do with ? + model.setUrl( project.elementTextTrim( "url" ) ); + // TODO: Handle + // TODO: Handle + + model.setIssueManagement( getIssueManagement( xml ) ); + // TODO: What to do with ? + // TODO: Handle + // TODO: Handle ? + // TODO: Handle + // TODO: Handle + model.setMailingLists( getMailingLists( xml ) ); + model.setIndividuals( getIndividuals( xml ) ); + model.setLicenses( getLicenses( xml ) ); + model.setReports( getReports( xml ) ); + model.setRepositories( getRepositories( xml ) ); + model.setScm( getSCM( xml ) ); + model.setOrganization( getOrganization( xml ) ); + model.setProperties( getProperties( xml.getElement( "//project/properties" ) ) ); + model.setDependencies( getDependencies( xml ) ); + + /* Following are not valid for 3 / Maven 1 pom files. + * + * model.setDependencyManagement() + * model.setPlugins() + * model.setParentProject() + * model.setPackaging() + * model.setCiManagement() + * model.setBuildExtensions() + * model.setRelocation() + */ + + return model; + } + catch ( XMLException e ) + { + throw new ProjectModelException( e.getMessage(), e ); + } + } + + private ArtifactReference getArtifactReference( Element elemPlugin, String defaultType ) + { + ArtifactReference reference = new ArtifactReference(); + + reference.setGroupId( StringUtils.defaultString( elemPlugin.elementTextTrim( "groupId" ) ) ); + reference.setArtifactId( elemPlugin.elementTextTrim( "artifactId" ) ); + reference.setVersion( StringUtils.defaultString( elemPlugin.elementTextTrim( "version" ) ) ); + reference.setClassifier( StringUtils.defaultString( elemPlugin.elementTextTrim( "classifier" ) ) ); + reference.setType( StringUtils.defaultIfEmpty( elemPlugin.elementTextTrim( "type" ), defaultType ) ); + + return reference; + } + + /** + * Get List of {@link ArtifactReference} objects from xpath expr. + */ + private List getArtifactReferenceList( XMLReader xml, String xpathExpr, String defaultType ) + throws XMLException + { + List refs = new ArrayList(); + + Iterator it = xml.getElementList( xpathExpr ).iterator(); + while ( it.hasNext() ) + { + Element elemPlugin = it.next(); + + refs.add( getArtifactReference( elemPlugin, defaultType ) ); + } + + return refs; + } + + private List getDependencies( XMLReader xml ) + throws XMLException + { + return getDependencyList( xml, new String[] { "dependencies" } ); + } + + private List getDependencyList( XMLReader xml, String parts[] ) + throws XMLException + { + List dependencyList = new ArrayList(); + + Element project = xml.getElement( "//project" ); + + Element depsParent = project; + + for ( String part : parts ) + { + depsParent = depsParent.element( part ); + if ( depsParent == null ) + { + return dependencyList; + } + } + + Iterator it = depsParent.elementIterator( "dependency" ); + while ( it.hasNext() ) + { + Element elemDependency = it.next(); + Dependency dependency = new Dependency(); + + dependency.setGroupId( elemDependency.elementTextTrim( "groupId" ) ); + dependency.setArtifactId( elemDependency.elementTextTrim( "artifactId" ) ); + dependency.setVersion( elemDependency.elementTextTrim( "version" ) ); + + dependency.setType( StringUtils.defaultIfEmpty( elemDependency.elementTextTrim( "type" ), "jar" ) ); + dependency.setUrl( elemDependency.elementTextTrim( "url" ) ); + /* Following are not valid for 3 / Maven 1 pom files. + * + * dependency.setClassifier( StringUtils.defaultString( elemDependency.elementTextTrim( "classifier" ) ) ); + * dependency.setScope( StringUtils.defaultIfEmpty( elemDependency.elementTextTrim( "scope" ), "compile" ) ); + * dependency.setOptional( toBoolean( elemDependency.elementTextTrim( "optional" ), false ) ); + */ + + dependency.setSystemPath( elemDependency.elementTextTrim( "jar" ) ); + + if ( dependencyList.contains( dependency ) ) + { + // TODO: throw into monitor as "duplicate dependency" issue. + } + + dependencyList.add( dependency ); + } + + return dependencyList; + } + + private List getIndividuals( XMLReader xml ) + throws XMLException + { + List individuals = new ArrayList(); + + individuals.addAll( getIndividuals( xml, true, "//project/developers/developer" ) ); + individuals.addAll( getIndividuals( xml, false, "//project/contributors/contributor" ) ); + + return individuals; + } + + private List getIndividuals( XMLReader xml, boolean isCommitor, String xpathExpr ) + throws XMLException + { + List ret = new ArrayList(); + + List modelPersonList = xml.getElementList( xpathExpr ); + + Iterator iter = modelPersonList.iterator(); + while ( iter.hasNext() ) + { + Element elemPerson = iter.next(); + Individual individual = new Individual(); + + if ( isCommitor ) + { + individual.setPrincipal( elemPerson.elementTextTrim( "id" ) ); + } + + individual.setCommitor( isCommitor ); + individual.setEmail( elemPerson.elementTextTrim( "email" ) ); + individual.setName( elemPerson.elementTextTrim( "name" ) ); + individual.setOrganization( elemPerson.elementTextTrim( "organization" ) ); + individual.setOrganizationUrl( elemPerson.elementTextTrim( "organizationUrl" ) ); + individual.setUrl( elemPerson.elementTextTrim( "url" ) ); + individual.setTimezone( elemPerson.elementTextTrim( "timezone" ) ); + + // Roles + Element elemRoles = elemPerson.element( "roles" ); + if ( elemRoles != null ) + { + List roleNames = elemRoles.elements( "role" ); + Iterator itRole = roleNames.iterator(); + while ( itRole.hasNext() ) + { + Element role = itRole.next(); + individual.addRole( role.getTextTrim() ); + } + } + + // Properties + individual.setProperties( getProperties( elemPerson.element( "properties" ) ) ); + + ret.add( individual ); + } + + return ret; + } + + private IssueManagement getIssueManagement( XMLReader xml ) + throws XMLException + { + Element issueTrackingUrlElem = xml.getElement( "//project/issueTrackingUrl" ); + + if ( issueTrackingUrlElem == null ) + { + return null; + } + + String issueTrackingUrl = issueTrackingUrlElem.getTextTrim(); + if ( StringUtils.isBlank( issueTrackingUrl ) ) + { + return null; + } + + IssueManagement issueMgmt = new IssueManagement(); + issueMgmt.setUrl( issueTrackingUrl ); + + return issueMgmt; + } + + private List getLicenses( XMLReader xml ) + throws XMLException + { + List licenses = new ArrayList(); + + Element elemLicenses = xml.getElement( "//project/licenses" ); + + if ( elemLicenses != null ) + { + List licenseList = elemLicenses.elements( "license" ); + for ( Element elemLicense : licenseList ) + { + License license = new License(); + + // TODO: Create LicenseIdentity class to managed license ids. + // license.setId( elemLicense.elementTextTrim("id") ); + license.setName( elemLicense.elementTextTrim( "name" ) ); + license.setUrl( elemLicense.elementTextTrim( "url" ) ); + license.setComments( elemLicense.elementTextTrim( "comments" ) ); + + licenses.add( license ); + } + } + + return licenses; + } + + private List getMailingLists( XMLReader xml ) + throws XMLException + { + List mailingLists = new ArrayList(); + + List mailingListElems = xml.getElementList( "//project/mailingLists/mailingList" ); + for ( Element elemMailingList : mailingListElems ) + { + MailingList mlist = new MailingList(); + + mlist.setName( elemMailingList.elementTextTrim( "name" ) ); + mlist.setSubscribeAddress( elemMailingList.elementTextTrim( "subscribe" ) ); + mlist.setUnsubscribeAddress( elemMailingList.elementTextTrim( "unsubscribe" ) ); + mlist.setPostAddress( elemMailingList.elementTextTrim( "post" ) ); + mlist.setMainArchiveUrl( elemMailingList.elementTextTrim( "archive" ) ); + + Element elemOtherArchives = elemMailingList.element( "otherArchives" ); + if ( elemOtherArchives != null ) + { + List otherArchives = new ArrayList(); + List others = elemOtherArchives.elements( "otherArchive" ); + for ( Element other : others ) + { + String otherArchive = other.getTextTrim(); + otherArchives.add( otherArchive ); + } + + mlist.setOtherArchives( otherArchives ); + } + + mailingLists.add( mlist ); + } + + return mailingLists; + } + + private Organization getOrganization( XMLReader xml ) + throws XMLException + { + Element elemOrg = xml.getElement( "//project/organization" ); + if ( elemOrg != null ) + { + Organization org = new Organization(); + + org.setName( elemOrg.elementTextTrim( "name" ) ); + org.setUrl( elemOrg.elementTextTrim( "url" ) ); + // TODO: Handle + + return org; + } + + return null; + } + + private Properties getProperties( Element elemProperties ) + { + if ( elemProperties == null ) + { + return null; + } + + Properties ret = new Properties(); + + Iterator itProps = elemProperties.elements().iterator(); + while ( itProps.hasNext() ) + { + Element elemProp = (Element) itProps.next(); + ret.setProperty( elemProp.getName(), elemProp.getText() ); + } + + return ret; + } + + private List getReports( XMLReader xml ) + throws XMLException + { + return getArtifactReferenceList( xml, "//project/reports/plugins/plugin", "maven-plugin" ); + } + + private List getRepositories( XMLReader xml ) + throws XMLException + { + List repos = new ArrayList(); + + // Repositories are not stored within the maven 1 pom. + + return repos; + } + + private Scm getSCM( XMLReader xml ) + throws XMLException + { + Element elemScm = xml.getElement( "//project/repository" ); + + if ( elemScm != null ) + { + Scm scm = new Scm(); + + scm.setConnection( elemScm.elementTextTrim( "connection" ) ); + scm.setDeveloperConnection( elemScm.elementTextTrim( "developerConnection" ) ); + scm.setUrl( elemScm.elementTextTrim( "url" ) ); + + return scm; + } + + return null; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/readers/ProjectModel400Reader.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/readers/ProjectModel400Reader.java new file mode 100644 index 000000000..38509be26 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/readers/ProjectModel400Reader.java @@ -0,0 +1,552 @@ +package org.apache.maven.archiva.repository.project.readers; + +/* + * 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.maven.archiva.model.ArchivaProjectModel; +import org.apache.maven.archiva.model.ArtifactReference; +import org.apache.maven.archiva.model.CiManagement; +import org.apache.maven.archiva.model.Dependency; +import org.apache.maven.archiva.model.DependencyScope; +import org.apache.maven.archiva.model.Exclusion; +import org.apache.maven.archiva.model.Individual; +import org.apache.maven.archiva.model.IssueManagement; +import org.apache.maven.archiva.model.License; +import org.apache.maven.archiva.model.MailingList; +import org.apache.maven.archiva.model.Organization; +import org.apache.maven.archiva.model.ProjectRepository; +import org.apache.maven.archiva.model.Scm; +import org.apache.maven.archiva.model.VersionedReference; +import org.apache.maven.archiva.repository.project.ProjectModelException; +import org.apache.maven.archiva.repository.project.ProjectModelReader; +import org.apache.maven.archiva.xml.XMLException; +import org.apache.maven.archiva.xml.XMLReader; +import org.dom4j.Element; + +import java.io.File; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Properties; + +/** + * ProjectModel400Reader - read in modelVersion 4.0.0 pom files into archiva-model structures. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ProjectModel400Reader + implements ProjectModelReader +{ + + public ArchivaProjectModel read( File pomFile ) + throws ProjectModelException + { + try + { + XMLReader xml = new XMLReader( "project", pomFile ); + + ArchivaProjectModel model = new ArchivaProjectModel(); + + if ( !"http://maven.apache.org/POM/4.0.0".equals( xml.getDefaultNamespaceURI() ) ) + { + // No namespace defined + // TODO: Output to monitor the problem with the Namespace. + } + + xml.removeNamespaces(); + + Element project = xml.getElement( "//project" ); + + model.setGroupId( project.elementTextTrim( "groupId" ) ); + model.setArtifactId( project.elementTextTrim( "artifactId" ) ); + model.setVersion( project.elementTextTrim( "version" ) ); + model.setName( project.elementTextTrim( "name" ) ); + model.setDescription( project.elementTextTrim( "description" ) ); + model.setUrl( project.elementTextTrim( "url" ) ); + + model.setPackaging( StringUtils.defaultIfEmpty( project.elementTextTrim( "packaging" ), "jar" ) ); + + model.setParentProject( getParentProject( xml ) ); + + model.setMailingLists( getMailingLists( xml ) ); + model.setCiManagement( getCiManagement( xml ) ); + model.setIndividuals( getIndividuals( xml ) ); + model.setIssueManagement( getIssueManagement( xml ) ); + model.setLicenses( getLicenses( xml ) ); + model.setOrganization( getOrganization( xml ) ); + model.setScm( getSCM( xml ) ); + model.setRepositories( getRepositories( xml ) ); + + model.setDependencies( getDependencies( xml ) ); + model.setDependencyManagement( getDependencyManagement( xml ) ); + model.setPlugins( getPlugins( xml ) ); + model.setReports( getReports( xml ) ); + model.setProperties( getProperties( xml.getElement( "//project/properties" ) ) ); + + model.setBuildExtensions( getBuildExtensions( xml ) ); + + model.setRelocation( getRelocation( xml ) ); + + return model; + } + catch ( XMLException e ) + { + throw new ProjectModelException( e.getMessage(), e ); + } + } + + private ArtifactReference getArtifactReference( Element elemPlugin, String defaultType ) + { + ArtifactReference reference = new ArtifactReference(); + + reference.setGroupId( StringUtils.defaultString( elemPlugin.elementTextTrim( "groupId" ) ) ); + reference.setArtifactId( elemPlugin.elementTextTrim( "artifactId" ) ); + reference.setVersion( StringUtils.defaultString( elemPlugin.elementTextTrim( "version" ) ) ); + reference.setClassifier( StringUtils.defaultString( elemPlugin.elementTextTrim( "classifier" ) ) ); + reference.setType( StringUtils.defaultIfEmpty( elemPlugin.elementTextTrim( "type" ), defaultType ) ); + + return reference; + } + + /** + * Get List of {@link ArtifactReference} objects from xpath expr. + */ + private List getArtifactReferenceList( XMLReader xml, String xpathExpr, String defaultType ) + throws XMLException + { + List refs = new ArrayList(); + + Iterator it = xml.getElementList( xpathExpr ).iterator(); + while ( it.hasNext() ) + { + Element elemPlugin = it.next(); + + refs.add( getArtifactReference( elemPlugin, defaultType ) ); + } + + return refs; + } + + private List getBuildExtensions( XMLReader xml ) + throws XMLException + { + return getArtifactReferenceList( xml, "//project/build/extensions/extension", "jar" ); + } + + private CiManagement getCiManagement( XMLReader xml ) + throws XMLException + { + Element elemCiMgmt = xml.getElement( "//project/ciManagement" ); + if ( elemCiMgmt != null ) + { + CiManagement ciManagement = new CiManagement(); + ciManagement.setSystem( elemCiMgmt.elementTextTrim( "system" ) ); + ciManagement.setUrl( elemCiMgmt.elementTextTrim( "url" ) ); + return ciManagement; + } + + return null; + } + + private List getDependencies( XMLReader xml ) + throws XMLException + { + return getDependencyList( xml, new String[] { "dependencies" } ); + } + + private List getDependencyList( XMLReader xml, String parts[] ) + throws XMLException + { + List dependencyList = new ArrayList(); + + Element project = xml.getElement( "//project" ); + + Element depsParent = project; + + for ( String part : parts ) + { + depsParent = depsParent.element( part ); + if ( depsParent == null ) + { + return dependencyList; + } + } + + Iterator it = depsParent.elementIterator( "dependency" ); + while ( it.hasNext() ) + { + Element elemDependency = it.next(); + Dependency dependency = new Dependency(); + + dependency.setGroupId( elemDependency.elementTextTrim( "groupId" ) ); + dependency.setArtifactId( elemDependency.elementTextTrim( "artifactId" ) ); + dependency.setVersion( elemDependency.elementTextTrim( "version" ) ); + + dependency.setClassifier( StringUtils.defaultString( elemDependency.elementTextTrim( "classifier" ) ) ); + dependency.setType( StringUtils.defaultIfEmpty( elemDependency.elementTextTrim( "type" ), "jar" ) ); + dependency.setScope( StringUtils.defaultIfEmpty( elemDependency.elementTextTrim( "scope" ), "compile" ) ); + // Not for v4.0.0 -> dependency.setUrl( elemDependency.elementTextTrim("url") ); + dependency.setOptional( toBoolean( elemDependency.elementTextTrim( "optional" ), false ) ); + if ( DependencyScope.isSystemScoped( dependency ) ) + { + dependency.setSystemPath( elemDependency.elementTextTrim( "systemPath" ) ); + } + + dependency.setExclusions( getExclusions( elemDependency ) ); + + if ( dependencyList.contains( dependency ) ) + { + // TODO: throw into monitor as "duplicate dependency" issue. + } + + dependencyList.add( dependency ); + } + + return dependencyList; + } + + private List getDependencyManagement( XMLReader xml ) + throws XMLException + { + return getDependencyList( xml, new String[] { "dependencyManagement", "dependencies" } ); + } + + private List getExclusions( Element elemDependency ) + { + List exclusions = new ArrayList(); + + Element elemExclusions = elemDependency.element( "exclusions" ); + + if ( elemExclusions != null ) + { + Iterator it = elemExclusions.elementIterator( "exclusion" ); + while ( it.hasNext() ) + { + Element elemExclusion = it.next(); + Exclusion exclusion = new Exclusion(); + + exclusion.setGroupId( elemExclusion.elementTextTrim( "groupId" ) ); + exclusion.setArtifactId( elemExclusion.elementTextTrim( "artifactId" ) ); + + exclusions.add( exclusion ); + } + } + + return exclusions; + } + + private List getIndividuals( XMLReader xml ) + throws XMLException + { + List individuals = new ArrayList(); + + individuals.addAll( getIndividuals( xml, true, "//project/developers/developer" ) ); + individuals.addAll( getIndividuals( xml, false, "//project/contributors/contributor" ) ); + + return individuals; + } + + private List getIndividuals( XMLReader xml, boolean isCommitor, String xpathExpr ) + throws XMLException + { + List ret = new ArrayList(); + + List modelPersonList = xml.getElementList( xpathExpr ); + + Iterator iter = modelPersonList.iterator(); + while ( iter.hasNext() ) + { + Element elemPerson = iter.next(); + Individual individual = new Individual(); + + if ( isCommitor ) + { + individual.setPrincipal( elemPerson.elementTextTrim( "id" ) ); + } + + individual.setCommitor( isCommitor ); + individual.setEmail( elemPerson.elementTextTrim( "email" ) ); + individual.setName( elemPerson.elementTextTrim( "name" ) ); + individual.setOrganization( elemPerson.elementTextTrim( "organization" ) ); + individual.setOrganizationUrl( elemPerson.elementTextTrim( "organizationUrl" ) ); + individual.setUrl( elemPerson.elementTextTrim( "url" ) ); + individual.setTimezone( elemPerson.elementTextTrim( "timezone" ) ); + + // Roles + Element elemRoles = elemPerson.element( "roles" ); + if ( elemRoles != null ) + { + List roleNames = elemRoles.elements( "role" ); + Iterator itRole = roleNames.iterator(); + while ( itRole.hasNext() ) + { + Element role = itRole.next(); + individual.addRole( role.getTextTrim() ); + } + } + + // Properties + individual.setProperties( getProperties( elemPerson.element( "properties" ) ) ); + + ret.add( individual ); + } + + return ret; + } + + private IssueManagement getIssueManagement( XMLReader xml ) + throws XMLException + { + Element elemIssueMgmt = xml.getElement( "//project/issueManagement" ); + if ( elemIssueMgmt != null ) + { + IssueManagement issueMgmt = new IssueManagement(); + + issueMgmt.setSystem( elemIssueMgmt.elementTextTrim( "system" ) ); + issueMgmt.setUrl( elemIssueMgmt.elementTextTrim( "url" ) ); + + return issueMgmt; + } + + return null; + } + + private List getLicenses( XMLReader xml ) + throws XMLException + { + List licenses = new ArrayList(); + + Element elemLicenses = xml.getElement( "//project/licenses" ); + + if ( elemLicenses != null ) + { + List licenseList = elemLicenses.elements( "license" ); + for ( Element elemLicense : licenseList ) + { + License license = new License(); + + // TODO: Create LicenseIdentity class to managed license ids. + // license.setId( elemLicense.elementTextTrim("id") ); + license.setName( elemLicense.elementTextTrim( "name" ) ); + license.setUrl( elemLicense.elementTextTrim( "url" ) ); + license.setComments( elemLicense.elementTextTrim( "comments" ) ); + + licenses.add( license ); + } + } + + return licenses; + } + + private List getMailingLists( XMLReader xml ) + throws XMLException + { + List mailingLists = new ArrayList(); + + List mailingListElems = xml.getElementList( "//project/mailingLists/mailingList" ); + for ( Element elemMailingList : mailingListElems ) + { + MailingList mlist = new MailingList(); + + mlist.setName( elemMailingList.elementTextTrim( "name" ) ); + mlist.setSubscribeAddress( elemMailingList.elementTextTrim( "subscribe" ) ); + mlist.setUnsubscribeAddress( elemMailingList.elementTextTrim( "unsubscribe" ) ); + mlist.setPostAddress( elemMailingList.elementTextTrim( "post" ) ); + mlist.setMainArchiveUrl( elemMailingList.elementTextTrim( "archive" ) ); + + Element elemOtherArchives = elemMailingList.element( "otherArchives" ); + if ( elemOtherArchives != null ) + { + List otherArchives = new ArrayList(); + List others = elemOtherArchives.elements( "otherArchive" ); + for ( Element other : others ) + { + String otherArchive = other.getTextTrim(); + otherArchives.add( otherArchive ); + } + + mlist.setOtherArchives( otherArchives ); + } + + mailingLists.add( mlist ); + } + + return mailingLists; + } + + private Organization getOrganization( XMLReader xml ) + throws XMLException + { + Element elemOrg = xml.getElement( "//project/organization" ); + if ( elemOrg != null ) + { + Organization org = new Organization(); + + org.setName( elemOrg.elementTextTrim( "name" ) ); + org.setUrl( elemOrg.elementTextTrim( "url" ) ); + + return org; + } + + return null; + } + + private VersionedReference getParentProject( XMLReader xml ) + throws XMLException + { + Element elemParent = xml.getElement( "//project/parent" ); + + if ( elemParent != null ) + { + return getVersionedReference( elemParent ); + } + + return null; + } + + private List getPlugins( XMLReader xml ) + throws XMLException + { + return getArtifactReferenceList( xml, "//project/build/plugins/plugin", "maven-plugin" ); + } + + private Properties getProperties( Element elemProperties ) + { + if ( elemProperties == null ) + { + return null; + } + + Properties ret = new Properties(); + + Iterator itProps = elemProperties.elements().iterator(); + while ( itProps.hasNext() ) + { + Element elemProp = (Element) itProps.next(); + ret.setProperty( elemProp.getName(), elemProp.getText() ); + } + + return ret; + } + + private VersionedReference getRelocation( XMLReader xml ) + throws XMLException + { + Element elemRelocation = xml.getElement( "//project/distributionManagement/relocation" ); + + if ( elemRelocation != null ) + { + return getVersionedReference( elemRelocation ); + } + + return null; + } + + private List getReports( XMLReader xml ) + throws XMLException + { + return getArtifactReferenceList( xml, "//project/reporting/plugins/plugin", "maven-plugin" ); + } + + private List getRepositories( XMLReader xml ) + throws XMLException + { + List repos = new ArrayList(); + + repos.addAll( getRepositories( xml, false, "//project/repositories/repository" ) ); + repos.addAll( getRepositories( xml, true, "//project/pluginRepositories/pluginRepository" ) ); + + return repos; + } + + private List getRepositories( XMLReader xml, boolean isPluginRepo, String xpathExpr ) + throws XMLException + { + List ret = new ArrayList(); + + List repositoriesList = xml.getElementList( xpathExpr ); + + for ( Element elemRepo : repositoriesList ) + { + ProjectRepository repo = new ProjectRepository(); + + repo.setId( elemRepo.elementTextTrim( "id" ) ); + repo.setName( elemRepo.elementTextTrim( "name" ) ); + repo.setUrl( elemRepo.elementTextTrim( "url" ) ); + repo.setLayout( StringUtils.defaultIfEmpty( elemRepo.elementTextTrim( "layout" ), "default" ) ); + repo.setPlugins( isPluginRepo ); + + repo.setReleases( toBoolean( xml.getElementText( elemRepo, "releases/enabled" ), true ) ); + repo.setSnapshots( toBoolean( xml.getElementText( elemRepo, "snapshots/enabled" ), false ) ); + + ret.add( repo ); + } + + return ret; + } + + private Scm getSCM( XMLReader xml ) + throws XMLException + { + Element elemScm = xml.getElement( "//project/scm" ); + + if ( elemScm != null ) + { + Scm scm = new Scm(); + + scm.setConnection( elemScm.elementTextTrim( "connection" ) ); + scm.setDeveloperConnection( elemScm.elementTextTrim( "developerConnection" ) ); + scm.setUrl( elemScm.elementTextTrim( "url" ) ); + + return scm; + } + + return null; + } + + private VersionedReference getVersionedReference( Element elem ) + { + VersionedReference reference = new VersionedReference(); + + reference.setGroupId( elem.elementTextTrim( "groupId" ) ); + reference.setArtifactId( elem.elementTextTrim( "artifactId" ) ); + reference.setVersion( elem.elementTextTrim( "version" ) ); + + return reference; + } + + private boolean toBoolean( String value, boolean defaultValue ) + { + if ( StringUtils.equalsIgnoreCase( value, "true" ) ) + { + return true; + } + else if ( StringUtils.equalsIgnoreCase( value, "false" ) ) + { + return false; + } + else + { + // If unset, or not "true" or "false". + return defaultValue; + } + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/resolvers/FalseProjectResolver.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/resolvers/FalseProjectResolver.java new file mode 100644 index 000000000..aa2d97cb9 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/resolvers/FalseProjectResolver.java @@ -0,0 +1,41 @@ +package org.apache.maven.archiva.repository.project.resolvers; + +/* + * 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.archiva.model.ArchivaProjectModel; +import org.apache.maven.archiva.model.VersionedReference; +import org.apache.maven.archiva.repository.project.ProjectModelException; +import org.apache.maven.archiva.repository.project.ProjectModelResolver; + +/** + * FalseProjectResolver will never resolver a model. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class FalseProjectResolver + implements ProjectModelResolver +{ + public ArchivaProjectModel resolveProjectModel( VersionedReference reference ) + throws ProjectModelException + { + throw new ProjectModelException( "Cannot resolve model in FalseProjectResolver." ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/resolvers/FilesystemBasedResolver.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/resolvers/FilesystemBasedResolver.java new file mode 100644 index 000000000..37e5e8ab2 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/resolvers/FilesystemBasedResolver.java @@ -0,0 +1,32 @@ +package org.apache.maven.archiva.repository.project.resolvers; + +/* + * 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 RepositoryProjectResolver's to indicate that it is basing + * it's resolution from the Filesystem. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public interface FilesystemBasedResolver +{ + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/resolvers/ManagedRepositoryProjectResolver.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/resolvers/ManagedRepositoryProjectResolver.java new file mode 100644 index 000000000..c604249ed --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/resolvers/ManagedRepositoryProjectResolver.java @@ -0,0 +1,62 @@ +package org.apache.maven.archiva.repository.project.resolvers; + +/* + * 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.archiva.model.ArchivaArtifact; +import org.apache.maven.archiva.model.ArchivaProjectModel; +import org.apache.maven.archiva.model.VersionedReference; +import org.apache.maven.archiva.repository.ManagedRepositoryContent; +import org.apache.maven.archiva.repository.project.ProjectModelException; +import org.apache.maven.archiva.repository.project.ProjectModelReader; +import org.apache.maven.archiva.repository.project.ProjectModelResolver; + +import java.io.File; + +/** + * Resolve Project from managed repository. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ManagedRepositoryProjectResolver + implements ProjectModelResolver, FilesystemBasedResolver +{ + private ManagedRepositoryContent repository; + + private ProjectModelReader reader; + + public ManagedRepositoryProjectResolver( ManagedRepositoryContent repository, ProjectModelReader reader ) + { + this.repository = repository; + this.reader = reader; + } + + public ArchivaProjectModel resolveProjectModel( VersionedReference reference ) + throws ProjectModelException + { + ArchivaArtifact artifact = new ArchivaArtifact( reference.getGroupId(), reference.getArtifactId(), reference + .getVersion(), "", "pom" ); + + File repoFile = repository.toFile( artifact ); + + return reader.read( repoFile ); + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/resolvers/NopProjectResolver.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/resolvers/NopProjectResolver.java new file mode 100644 index 000000000..5d70c2cc0 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/resolvers/NopProjectResolver.java @@ -0,0 +1,59 @@ +package org.apache.maven.archiva.repository.project.resolvers; + +/* + * 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.archiva.model.ArchivaProjectModel; +import org.apache.maven.archiva.model.VersionedReference; +import org.apache.maven.archiva.repository.project.ProjectModelException; +import org.apache.maven.archiva.repository.project.ProjectModelResolver; + +/** + * A No-op Project Resolver, perform no lookup, just returns the requested + * information in the form of a simple ArchviaProjectModel. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class NopProjectResolver + implements ProjectModelResolver +{ + private static NopProjectResolver INSTANCE = new NopProjectResolver(); + + public static NopProjectResolver getInstance() + { + return INSTANCE; + } + + public ArchivaProjectModel resolveProjectModel( VersionedReference reference ) + throws ProjectModelException + { + ArchivaProjectModel model = new ArchivaProjectModel(); + + model.setGroupId( reference.getGroupId() ); + model.setArtifactId( reference.getArtifactId() ); + model.setVersion( reference.getVersion() ); + model.setPackaging( "pom" ); + + model.setOrigin( "nop" ); + + return model; + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/resolvers/ProjectModelResolutionListener.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/resolvers/ProjectModelResolutionListener.java new file mode 100644 index 000000000..30a5ab050 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/resolvers/ProjectModelResolutionListener.java @@ -0,0 +1,97 @@ +package org.apache.maven.archiva.repository.project.resolvers; + +/* + * 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.archiva.model.ArchivaProjectModel; +import org.apache.maven.archiva.model.VersionedReference; +import org.apache.maven.archiva.repository.project.ProjectModelResolver; + +import java.util.List; + +/** + * ProjectModelResolutionListener + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public interface ProjectModelResolutionListener +{ + /** + * Indicates that the resolution process has started for a specific project. + * + * @param projectRef the project reference. + * @param resolverList the {@link List} of {@link ProjectModelResolver}'s that will be searched. + * @see #resolutionSuccess(VersionedReference, ProjectModelResolver, ArchivaProjectModel) + * @see #resolutionNotFound(VersionedReference, List) + */ + public void resolutionStart( VersionedReference projectRef, List resolverList ); + + /** + * Indicates that a resolution against a specific resolver is about + * to occur. + * + * @param projectRef the project reference. + * @param resolver the resolver to attempt resolution on. + */ + public void resolutionAttempting( VersionedReference projectRef, ProjectModelResolver resolver ); + + /** + * Indicates that a resolution against a specific resolver resulted + * in in a missed resolution. + * + * "Miss" in this case refers to an attempt against a resolver, and that + * resolver essentially responds with a "not found here" response. + * + * @param projectRef the project reference. + * @param resolver the resolver the attempt was made on. + */ + public void resolutionMiss( VersionedReference projectRef, ProjectModelResolver resolver ); + + /** + * Indicates that a resolution against the specific resolver has + * caused an error. + * + * @param projectRef the project reference. + * @param resolver the (optional) resolver on which the error occured. + * @param cause the cause of the error. + */ + public void resolutionError( VersionedReference projectRef, ProjectModelResolver resolver, Exception cause ); + + /** + * Indicates that a resolution process has finished, and the requested + * projectRef has been found. + * + * @param projectRef the project reference. + * @param resolver the resolver on which success occured. + * @param model the resolved model. + * @see #resolutionStart(VersionedReference, List) + */ + public void resolutionSuccess( VersionedReference projectRef, ProjectModelResolver resolver, ArchivaProjectModel model ); + + /** + * Indicates that the resolution process has finished, and the requested + * projectRef could not be found. + * + * @param projectRef the project reference. + * @param resolverList the {@link List} of {@link ProjectModelResolver}'s that was be searched. + * @see #resolutionStart(VersionedReference, List) + */ + public void resolutionNotFound( VersionedReference projectRef, List resolverList ); +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/resolvers/ProjectModelResolverStack.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/resolvers/ProjectModelResolverStack.java new file mode 100644 index 000000000..f7da1c9fb --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/resolvers/ProjectModelResolverStack.java @@ -0,0 +1,259 @@ +package org.apache.maven.archiva.repository.project.resolvers; + +/* + * 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.collections.CollectionUtils; +import org.apache.maven.archiva.model.ArchivaProjectModel; +import org.apache.maven.archiva.model.VersionedReference; +import org.apache.maven.archiva.repository.project.ProjectModelException; +import org.apache.maven.archiva.repository.project.ProjectModelResolver; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +/** + * Represents a stack of {@link ProjectModelResolver} resolvers for + * finding/resolving an ArchivaProjectModel from multiple sources. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ProjectModelResolverStack +{ + private List resolvers; + + private List listeners; + + public ProjectModelResolverStack() + { + this.resolvers = new ArrayList(); + this.listeners = new ArrayList(); + } + + public void addListener( ProjectModelResolutionListener listener ) + { + if ( listener == null ) + { + return; + } + + this.listeners.add( listener ); + } + + public void addProjectModelResolver( ProjectModelResolver resolver ) + { + if ( resolver == null ) + { + return; + } + + this.resolvers.add( resolver ); + } + + public void clearResolvers() + { + this.resolvers.clear(); + } + + public ArchivaProjectModel findProject( VersionedReference projectRef ) + { + if ( CollectionUtils.isEmpty( this.resolvers ) ) + { + throw new IllegalStateException( "No resolvers have been defined." ); + } + + triggerResolutionStart( projectRef, this.resolvers ); + + Iterator it = this.resolvers.iterator(); + + while ( it.hasNext() ) + { + ProjectModelResolver resolver = (ProjectModelResolver) it.next(); + + try + { + triggerResolutionAttempting( projectRef, resolver ); + ArchivaProjectModel model = resolver.resolveProjectModel( projectRef ); + + if ( model != null ) + { + // Project was found. + triggerResolutionSuccess( projectRef, resolver, model ); + return model; + } + triggerResolutionMiss( projectRef, resolver ); + } + catch ( ProjectModelException e ) + { + triggerResolutionError( projectRef, resolver, e ); + } + } + + // Project was not found in entire resolver list. + triggerResolutionNotFound( projectRef, this.resolvers ); + + return null; + } + + public boolean hasResolver( ProjectModelResolver resolver ) + { + return this.resolvers.contains( resolver ); + } + + public boolean isEmpty() + { + return this.resolvers.isEmpty(); + } + + public void prependProjectModelResolver( ProjectModelResolver resolver ) + { + if ( resolver == null ) + { + return; + } + + this.resolvers.add( 0, resolver ); + } + + public void removeListener( ProjectModelResolutionListener listener ) + { + if ( listener == null ) + { + return; + } + + this.listeners.add( listener ); + } + + public void removeResolver( ProjectModelResolver resolver ) + { + this.resolvers.remove( resolver ); + } + + private void triggerResolutionAttempting( VersionedReference projectRef, ProjectModelResolver resolver ) + { + Iterator it = this.listeners.iterator(); + while ( it.hasNext() ) + { + ProjectModelResolutionListener listener = (ProjectModelResolutionListener) it.next(); + + try + { + listener.resolutionAttempting( projectRef, resolver ); + } + catch ( Exception e ) + { + // do nothing with exception. + } + } + } + + private void triggerResolutionError( VersionedReference projectRef, ProjectModelResolver resolver, Exception cause ) + { + Iterator it = this.listeners.iterator(); + while ( it.hasNext() ) + { + ProjectModelResolutionListener listener = (ProjectModelResolutionListener) it.next(); + + try + { + listener.resolutionError( projectRef, resolver, cause ); + } + catch ( Exception e ) + { + // do nothing with exception. + } + } + } + + private void triggerResolutionMiss( VersionedReference projectRef, ProjectModelResolver resolver ) + { + Iterator it = this.listeners.iterator(); + while ( it.hasNext() ) + { + ProjectModelResolutionListener listener = (ProjectModelResolutionListener) it.next(); + + try + { + listener.resolutionMiss( projectRef, resolver ); + } + catch ( Exception e ) + { + // do nothing with exception. + } + } + } + + private void triggerResolutionNotFound( VersionedReference projectRef, List resolvers ) + { + Iterator it = this.listeners.iterator(); + while ( it.hasNext() ) + { + ProjectModelResolutionListener listener = (ProjectModelResolutionListener) it.next(); + + try + { + listener.resolutionNotFound( projectRef, resolvers ); + } + catch ( Exception e ) + { + // do nothing with exception. + } + } + } + + private void triggerResolutionStart( VersionedReference projectRef, List resolvers ) + { + Iterator it = this.listeners.iterator(); + while ( it.hasNext() ) + { + ProjectModelResolutionListener listener = (ProjectModelResolutionListener) it.next(); + + try + { + listener.resolutionStart( projectRef, resolvers ); + } + catch ( Exception e ) + { + // do nothing with exception. + } + } + } + + private void triggerResolutionSuccess( VersionedReference projectRef, ProjectModelResolver resolver, + ArchivaProjectModel model ) + { + Iterator it = this.listeners.iterator(); + while ( it.hasNext() ) + { + ProjectModelResolutionListener listener = (ProjectModelResolutionListener) it.next(); + + try + { + listener.resolutionSuccess( projectRef, resolver, model ); + } + catch ( Exception e ) + { + // do nothing with exception. + } + } + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/writers/ProjectModel400Writer.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/writers/ProjectModel400Writer.java new file mode 100644 index 000000000..a5955e346 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/project/writers/ProjectModel400Writer.java @@ -0,0 +1,539 @@ +package org.apache.maven.archiva.repository.project.writers; + +/* + * 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.collections.CollectionUtils; +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.maven.archiva.model.ArchivaProjectModel; +import org.apache.maven.archiva.model.ArtifactReference; +import org.apache.maven.archiva.model.CiManagement; +import org.apache.maven.archiva.model.Dependency; +import org.apache.maven.archiva.model.Exclusion; +import org.apache.maven.archiva.model.Individual; +import org.apache.maven.archiva.model.IssueManagement; +import org.apache.maven.archiva.model.License; +import org.apache.maven.archiva.model.MailingList; +import org.apache.maven.archiva.model.Organization; +import org.apache.maven.archiva.model.ProjectRepository; +import org.apache.maven.archiva.model.Scm; +import org.apache.maven.archiva.model.VersionedReference; +import org.apache.maven.archiva.repository.project.ProjectModelException; +import org.apache.maven.archiva.repository.project.ProjectModelWriter; +import org.apache.maven.archiva.xml.XMLException; +import org.apache.maven.archiva.xml.XMLWriter; +import org.dom4j.Document; +import org.dom4j.DocumentHelper; +import org.dom4j.Element; +import org.dom4j.Namespace; +import org.dom4j.Node; +import org.dom4j.QName; + +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.io.Writer; +import java.util.Iterator; +import java.util.List; + +/** + * ProjectModel400Writer for Maven 2 project model v4.0.0 pom files. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ProjectModel400Writer + implements ProjectModelWriter +{ + private static final Namespace DEFAULT_NAMESPACE = Namespace.get( "", "http://maven.apache.org/POM/4.0.0" ); + + public void write( ArchivaProjectModel model, File pomFile ) + throws ProjectModelException, IOException + { + FileWriter writer = null; + try + { + writer = new FileWriter( pomFile ); + write( model, writer ); + writer.flush(); + } + finally + { + IOUtils.closeQuietly( writer ); + } + } + + public void write( ArchivaProjectModel model, Writer writer ) + throws ProjectModelException, IOException + { + Document doc = DocumentHelper.createDocument(); + + Element root = DocumentHelper.createElement( "project" ); + + root.add( DEFAULT_NAMESPACE ); + root.addNamespace( "xsi", "http://www.w3.org/2001/XMLSchema-instance" ); + root.addAttribute( "xsi:schemaLocation", + "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd" ); + + doc.setRootElement( root ); + + root.addElement( "modelVersion" ).setText( "4.0.0" ); + + addParent( root, model.getParentProject() ); + + addChildElement( root, "groupId", model.getGroupId() ); + root.addElement( "artifactId" ).setText( model.getArtifactId() ); + + addChildElement( root, "version", model.getVersion() ); + + addChildElement( root, "packaging", model.getPackaging() ); + addChildElement( root, "name", model.getName() ); + addChildElement( root, "description", model.getDescription() ); + addChildElement( root, "url", model.getUrl() ); + // TODO: add inceptionYear to ArchivaProjectModel + + addOrganization( root, model.getOrganization() ); + + addIssueManagement( root, model.getIssueManagement() ); + addCiManagement( root, model.getCiManagement() ); + addMailingLists( root, model.getMailingLists() ); + addDevelopersAndContributors( root, model.getIndividuals() ); + // TODO: add distribution management to ArchivaProjectModel + + addLicenses( root, model.getLicenses() ); + addRepositories( root, model.getRepositories() ); + addDependencyManagement( root, model.getDependencyManagement() ); + addDependencies( root, model.getDependencies() ); + + addReporting( root, model.getReports() ); + addScm( root, model.getScm() ); + + // element + addPlugins( root, model.getPlugins() ); + addBuildExtensions( root, model.getBuildExtensions() ); + + // + addRelocation( root, model.getRelocation() ); + + fixDefaultNamespace( root ); + + try + { + XMLWriter.write( doc, writer ); + } + catch ( XMLException e ) + { + throw new ProjectModelException( "Unable to write xml contents to writer: " + e.getMessage(), e ); + } + } + + private void addArtifactReference( Element elem, ArtifactReference ref, String defaultType ) + { + addChildElement( elem, "groupId", ref.getGroupId() ); + addChildElement( elem, "artifactId", ref.getArtifactId() ); + addChildElement( elem, "version", ref.getVersion() ); + addChildElement( elem, "classifier", ref.getClassifier() ); + + if ( !StringUtils.equals( defaultType, ref.getType() ) ) + { + addChildElement( elem, "type", ref.getType() ); + } + } + + private void addBuildExtensions( Element root, List buildExtensions ) + { + if ( CollectionUtils.isEmpty( buildExtensions ) ) + { + return; + } + + Element build = root.element( "build" ); + if ( build == null ) + { + build = root.addElement( "build" ); + } + + Element elemExtensions = build.addElement( "extensions" ); + + for ( ArtifactReference extension : buildExtensions ) + { + Element elem = elemExtensions.addElement( "extension" ); + + addArtifactReference( elem, extension, "jar" ); + } + } + + private void addCiManagement( Element root, CiManagement ciManagement ) + { + if ( ciManagement == null ) + { + return; + } + + Element elem = root.addElement( "ciManagement" ); + addChildElement( elem, "system", ciManagement.getSystem() ); + addChildElement( elem, "url", ciManagement.getUrl() ); + // TODO: Add notifiers into ArchivaProjectModel + } + + private void addDependencies( Element root, List dependencies ) + { + if ( CollectionUtils.isEmpty( dependencies ) ) + { + return; + } + + addDependencyList( root, dependencies ); + } + + private void addDependencyList( Element elemParent, List dependencies ) + { + if ( CollectionUtils.isEmpty( dependencies ) ) + { + return; + } + + Element elemDeps = elemParent.addElement( "dependencies" ); + + for ( Dependency dep : dependencies ) + { + Element elem = elemDeps.addElement( "dependency" ); + + addChildElement( elem, "groupId", dep.getGroupId() ); + addChildElement( elem, "artifactId", dep.getArtifactId() ); + addChildElement( elem, "version", dep.getVersion() ); + addChildElement( elem, "classifier", dep.getClassifier() ); + addChildElement( elem, "type", dep.getType() ); + addChildElement( elem, "scope", dep.getScope() ); + addChildElement( elem, "systemPath", dep.getSystemPath() ); + + addExclusions( elem, dep.getExclusions() ); + } + } + + private void addDependencyManagement( Element root, List dependencyManagement ) + { + if ( CollectionUtils.isEmpty( dependencyManagement ) ) + { + return; + } + + Element elemDepMgmt = root.addElement( "dependencyManagement" ); + addDependencyList( elemDepMgmt, dependencyManagement ); + } + + private void addDevelopersAndContributors( Element root, List individuals ) + { + if ( CollectionUtils.isEmpty( individuals ) ) + { + return; + } + + Element developers = null; + Element contributors = null; + + for ( Individual individual : individuals ) + { + if ( individual.isCommitor() ) + { + if ( developers == null ) + { + developers = root.addElement( "developers" ); + } + + Element developer = developers.addElement( "developer" ); + addChildElement( developer, "id", individual.getPrincipal() ); + addIndividual( developer, individual ); + } + else + { + if ( contributors == null ) + { + contributors = root.addElement( "contributors" ); + } + + Element contributor = contributors.addElement( "contributor" ); + addIndividual( contributor, individual ); + } + } + } + + private void addExclusions( Element elemParent, List exclusions ) + { + if ( CollectionUtils.isEmpty( exclusions ) ) + { + return; + } + + Element elemExclusions = elemParent.addElement( "exclusions" ); + + for ( Exclusion exclusion : exclusions ) + { + Element elem = elemExclusions.addElement( "exclusion" ); + + addChildElement( elem, "groupId", exclusion.getGroupId() ); + addChildElement( elem, "artifactId", exclusion.getArtifactId() ); + } + } + + private void addIndividual( Element elem, Individual individual ) + { + addChildElement( elem, "name", individual.getName() ); + addChildElement( elem, "email", individual.getEmail() ); + addChildElement( elem, "organization", individual.getOrganization() ); + addChildElement( elem, "organizationUrl", individual.getOrganizationUrl() ); + addChildElement( elem, "timezone", individual.getTimezone() ); + + if ( CollectionUtils.isNotEmpty( individual.getRoles() ) ) + { + Element roles = elem.addElement( "roles" ); + List roleList = individual.getRoles(); + for ( String roleName : roleList ) + { + addChildElement( roles, "role", roleName ); + } + } + } + + private void addIssueManagement( Element root, IssueManagement issueManagement ) + { + if ( issueManagement == null ) + { + return; + } + + Element elem = root.addElement( "issueManagement" ); + addChildElement( elem, "system", issueManagement.getSystem() ); + addChildElement( elem, "url", issueManagement.getUrl() ); + } + + private void addLicenses( Element root, List licenses ) + { + if ( CollectionUtils.isEmpty( licenses ) ) + { + return; + } + + Element elemLicenses = root.addElement( "licenses" ); + + for ( License license : licenses ) + { + Element elem = elemLicenses.addElement( "license" ); + addChildElement( elem, "name", license.getName() ); + addChildElement( elem, "url", license.getUrl() ); + // TODO: research if we need subelement. + } + } + + private void addMailingLists( Element root, List mailingLists ) + { + if ( CollectionUtils.isEmpty( mailingLists ) ) + { + return; + } + + Element mlists = root.addElement( "mailingLists" ); + + for ( MailingList mailingList : mailingLists ) + { + Element mlist = mlists.addElement( "mailingList" ); + addChildElement( mlist, "name", mailingList.getName() ); + addChildElement( mlist, "post", mailingList.getPostAddress() ); + addChildElement( mlist, "subscribe", mailingList.getSubscribeAddress() ); + addChildElement( mlist, "unsubscribe", mailingList.getUnsubscribeAddress() ); + addChildElement( mlist, "archive", mailingList.getMainArchiveUrl() ); + + addOtherArchives( mlist, mailingList.getOtherArchives() ); + } + } + + private void addOtherArchives( Element mlist, List otherArchives ) + { + if ( CollectionUtils.isEmpty( otherArchives ) ) + { + return; + } + + Element elemOtherArchives = mlist.addElement( "otherArchives" ); + + for ( String archive : otherArchives ) + { + addChildElement( elemOtherArchives, "otherArchive", archive ); + } + } + + private void addOrganization( Element root, Organization organization ) + { + if ( organization == null ) + { + return; + } + + Element elem = root.addElement( "organization" ); + + addChildElement( elem, "name", organization.getName() ); + addChildElement( elem, "url", organization.getUrl() ); + } + + private void addParent( Element root, VersionedReference parentProject ) + { + if ( parentProject == null ) + { + return; + } + + Element parent = root.addElement( "parent" ); + parent.addElement( "groupId" ).setText( parentProject.getGroupId() ); + parent.addElement( "artifactId" ).setText( parentProject.getArtifactId() ); + parent.addElement( "version" ).setText( parentProject.getVersion() ); + } + + private void addPlugins( Element root, List plugins ) + { + if ( CollectionUtils.isEmpty( plugins ) ) + { + return; + } + + Element build = root.element( "build" ); + if ( build == null ) + { + build = root.addElement( "build" ); + } + + Element elemPlugins = build.addElement( "plugins" ); + + for ( ArtifactReference plugin : plugins ) + { + Element elem = elemPlugins.addElement( "plugin" ); + + addArtifactReference( elem, plugin, "maven-plugin" ); + } + } + + private void addRelocation( Element root, VersionedReference relocation ) + { + if ( relocation == null ) + { + return; + } + + Element distribManagement = root.element( "distributionManagement" ); + + if ( distribManagement == null ) + { + distribManagement = root.addElement( "distributionManagement" ); + } + + Element elem = distribManagement.addElement( "relocation" ); + addChildElement( elem, "groupId", relocation.getGroupId() ); + addChildElement( elem, "artifactId", relocation.getArtifactId() ); + addChildElement( elem, "version", relocation.getVersion() ); + } + + private void addReporting( Element root, List reports ) + { + if ( CollectionUtils.isEmpty( reports ) ) + { + return; + } + + Element reporting = root.addElement( "reporting" ); + Element plugins = reporting.addElement( "plugins" ); + + for ( ArtifactReference reference : reports ) + { + Element plugin = plugins.addElement( "plugin" ); + addChildElement( plugin, "groupId", reference.getGroupId() ); + addChildElement( plugin, "artifactId", reference.getArtifactId() ); + addChildElement( plugin, "version", reference.getVersion() ); + } + } + + private void addRepositories( Element root, List repositories ) + { + if ( CollectionUtils.isEmpty( repositories ) ) + { + return; + } + + Element elemRepos = root.addElement( "repositories" ); + for ( ProjectRepository repository : repositories ) + { + Element elem = elemRepos.addElement( "repository" ); + addChildElement( elem, "id", repository.getId() ); + addChildElement( elem, "name", repository.getName() ); + addChildElement( elem, "url", repository.getUrl() ); + + if ( !StringUtils.equals( "default", repository.getLayout() ) ) + { + addChildElement( elem, "layout", repository.getLayout() ); + } + } + } + + private void addScm( Element root, Scm scm ) + { + if ( scm == null ) + { + return; + } + + Element elem = root.addElement( "scm" ); + + addChildElement( elem, "connection", scm.getConnection() ); + addChildElement( elem, "developerConnection", scm.getDeveloperConnection() ); + addChildElement( elem, "url", scm.getUrl() ); + } + + /** + * Fix the default namespace on all elements recursively. + */ + private void fixDefaultNamespace( Element elem ) + { + elem.remove( elem.getNamespace() ); + elem.setQName( QName.get( elem.getName(), DEFAULT_NAMESPACE, elem.getQualifiedName() ) ); + + Node n; + + Iterator it = elem.elementIterator(); + while ( it.hasNext() ) + { + n = it.next(); + + switch ( n.getNodeType() ) + { + case Node.ELEMENT_NODE: + fixDefaultNamespace( (Element) n ); + break; + } + } + } + + private static void addChildElement( Element elem, String elemName, String text ) + { + if ( StringUtils.isBlank( text ) ) + { + return; + } + + elem.addElement( elemName ).setText( text ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/DefaultRepositoryScanner.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/DefaultRepositoryScanner.java new file mode 100644 index 000000000..55ee37ca1 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/DefaultRepositoryScanner.java @@ -0,0 +1,141 @@ +package org.apache.maven.archiva.repository.scanner; + +/* + * 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; +import java.util.ArrayList; +import java.util.List; + +import org.apache.commons.collections.CollectionUtils; +import org.apache.maven.archiva.configuration.FileTypes; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.consumers.InvalidRepositoryContentConsumer; +import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer; +import org.apache.maven.archiva.consumers.RepositoryContentConsumer; +import org.apache.maven.archiva.repository.RepositoryException; +import org.codehaus.plexus.util.DirectoryWalker; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * DefaultRepositoryScanner + * + * @author Joakim Erdfelt + * @version $Id$ + * @plexus.component role="org.apache.maven.archiva.repository.scanner.RepositoryScanner" + */ +public class DefaultRepositoryScanner + implements RepositoryScanner +{ + private Logger log = LoggerFactory.getLogger( DefaultRepositoryScanner.class ); + + /** + * @plexus.requirement + */ + private FileTypes filetypes; + + /** + * @plexus.requirement + */ + private RepositoryContentConsumers consumerUtil; + + public RepositoryScanStatistics scan( ManagedRepositoryConfiguration repository, long changesSince ) + throws RepositoryException + { + List knownContentConsumers = consumerUtil.getSelectedKnownConsumers(); + List invalidContentConsumers = consumerUtil.getSelectedInvalidConsumers(); + List ignoredPatterns = filetypes.getFileTypePatterns( FileTypes.IGNORED ); + + return scan( repository, knownContentConsumers, invalidContentConsumers, ignoredPatterns, changesSince ); + } + + public RepositoryScanStatistics scan( ManagedRepositoryConfiguration repository, + List knownContentConsumers, + List invalidContentConsumers, + List ignoredContentPatterns, long changesSince ) + throws RepositoryException + { + if ( repository == null ) + { + throw new IllegalArgumentException( "Unable to operate on a null repository." ); + } + + File repositoryBase = new File( repository.getLocation() ); + + if ( !repositoryBase.exists() ) + { + throw new UnsupportedOperationException( "Unable to scan a repository, directory " + + repositoryBase.getAbsolutePath() + " does not exist." ); + } + + if ( !repositoryBase.isDirectory() ) + { + throw new UnsupportedOperationException( "Unable to scan a repository, path " + + repositoryBase.getAbsolutePath() + " is not a directory." ); + } + + // Setup Includes / Excludes. + + List allExcludes = new ArrayList(); + List allIncludes = new ArrayList(); + + if ( CollectionUtils.isNotEmpty( ignoredContentPatterns ) ) + { + allExcludes.addAll( ignoredContentPatterns ); + } + + // Scan All Content. (intentional) + allIncludes.add( "**/*" ); + + // Setup Directory Walker + DirectoryWalker dirWalker = new DirectoryWalker(); + + dirWalker.setBaseDir( repositoryBase ); + + dirWalker.setIncludes( allIncludes ); + dirWalker.setExcludes( allExcludes ); + + // Setup the Scan Instance + RepositoryScannerInstance scannerInstance = new RepositoryScannerInstance( repository, knownContentConsumers, + invalidContentConsumers, changesSince ); + + dirWalker.addDirectoryWalkListener( scannerInstance ); + + // Execute scan. + dirWalker.scan(); + + RepositoryScanStatistics stats = scannerInstance.getStatistics(); + + stats.setKnownConsumers( gatherIds( knownContentConsumers ) ); + stats.setInvalidConsumers( gatherIds( invalidContentConsumers ) ); + + return stats; + } + + private List gatherIds( List consumers ) + { + List ids = new ArrayList(); + for ( RepositoryContentConsumer consumer : consumers ) + { + ids.add( consumer.getId() ); + } + return ids; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumers.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumers.java new file mode 100644 index 000000000..c952475ba --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumers.java @@ -0,0 +1,320 @@ +package org.apache.maven.archiva.repository.scanner; + +/* + * 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; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.commons.collections.Closure; +import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections.functors.IfClosure; +import org.apache.maven.archiva.common.utils.BaseFile; +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.configuration.RepositoryScanningConfiguration; +import org.apache.maven.archiva.consumers.InvalidRepositoryContentConsumer; +import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer; +import org.apache.maven.archiva.repository.scanner.functors.ConsumerProcessFileClosure; +import org.apache.maven.archiva.repository.scanner.functors.ConsumerWantsFilePredicate; +import org.apache.maven.archiva.repository.scanner.functors.TriggerBeginScanClosure; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * RepositoryContentConsumerUtil + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component role="org.apache.maven.archiva.repository.scanner.RepositoryContentConsumers" + */ +public class RepositoryContentConsumers +{ + private Logger log = LoggerFactory.getLogger( RepositoryContentConsumers.class ); + + /** + * @plexus.requirement + */ + private ArchivaConfiguration archivaConfiguration; + + /** + * @plexus.requirement role="org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer" + */ + private List availableKnownConsumers; + + /** + * @plexus.requirement role="org.apache.maven.archiva.consumers.InvalidRepositoryContentConsumer" + */ + private List availableInvalidConsumers; + + private List selectedKnownConsumers; + + private List selectedInvalidConsumers; + + /** + *

+ * Get the list of Ids associated with those {@link KnownRepositoryContentConsumer} that have + * been selected in the configuration to execute. + *

+ * + *

+ * NOTE: This list can be larger and contain entries that might not exist or be available + * in the classpath, or as a component. + *

+ * + * @return the list of consumer ids that have been selected by the configuration. + */ + public List getSelectedKnownConsumerIds() + { + RepositoryScanningConfiguration scanning = archivaConfiguration.getConfiguration().getRepositoryScanning(); + return scanning.getKnownContentConsumers(); + } + + /** + *

+ * Get the list of Ids associated with those {@link InvalidRepositoryContentConsumer} that have + * been selected in the configuration to execute. + *

+ * + *

+ * NOTE: This list can be larger and contain entries that might not exist or be available + * in the classpath, or as a component. + *

+ * + * @return the list of consumer ids that have been selected by the configuration. + */ + public List getSelectedInvalidConsumerIds() + { + RepositoryScanningConfiguration scanning = archivaConfiguration.getConfiguration().getRepositoryScanning(); + return scanning.getInvalidContentConsumers(); + } + + /** + * Get the map of {@link String} ids to {@link KnownRepositoryContentConsumer} implementations, + * for those consumers that have been selected according to the active configuration. + * + * @return the map of String ids to {@link KnownRepositoryContentConsumer} objects. + */ + public Map getSelectedKnownConsumersMap() + { + Map consumerMap = new HashMap(); + + for ( KnownRepositoryContentConsumer consumer : getSelectedKnownConsumers() ) + { + consumerMap.put( consumer.getId(), consumer ); + } + + return consumerMap; + } + + /** + * Get the map of {@link String} ids to {@link InvalidRepositoryContentConsumer} implementations, + * for those consumers that have been selected according to the active configuration. + * + * @return the map of String ids to {@link InvalidRepositoryContentConsumer} objects. + */ + public Map getSelectedInvalidConsumersMap() + { + Map consumerMap = new HashMap(); + + for ( InvalidRepositoryContentConsumer consumer : getSelectedInvalidConsumers() ) + { + consumerMap.put( consumer.getId(), consumer ); + } + + return consumerMap; + } + + /** + * Get the list of {@link KnownRepositoryContentConsumer} objects that are + * selected according to the active configuration. + * + * @return the list of {@link KnownRepositoryContentConsumer} that have been selected + * by the active configuration. + */ + public synchronized List getSelectedKnownConsumers() + { + if ( selectedKnownConsumers == null ) + { + List ret = new ArrayList(); + + List knownSelected = getSelectedKnownConsumerIds(); + + for ( KnownRepositoryContentConsumer consumer : availableKnownConsumers ) + { + if ( knownSelected.contains( consumer.getId() ) || consumer.isPermanent() ) + { + ret.add( consumer ); + } + } + this.selectedKnownConsumers = ret; + } + return selectedKnownConsumers; + } + + /** + * Get the list of {@link InvalidRepositoryContentConsumer} objects that are + * selected according to the active configuration. + * + * @return the list of {@link InvalidRepositoryContentConsumer} that have been selected + * by the active configuration. + */ + public synchronized List getSelectedInvalidConsumers() + { + if ( selectedInvalidConsumers == null ) + { + List ret = new ArrayList(); + + List invalidSelected = getSelectedInvalidConsumerIds(); + + for ( InvalidRepositoryContentConsumer consumer : availableInvalidConsumers ) + { + if ( invalidSelected.contains( consumer.getId() ) || consumer.isPermanent() ) + { + ret.add( consumer ); + } + } + selectedInvalidConsumers = ret; + } + return selectedInvalidConsumers; + } + + /** + * Get the list of {@link KnownRepositoryContentConsumer} objects that are + * available and present in the classpath and as components in the IoC. + * + * @return the list of all available {@link KnownRepositoryContentConsumer} present in the classpath + * and as a component in the IoC. + */ + public List getAvailableKnownConsumers() + { + return availableKnownConsumers; + } + + /** + * Get the list of {@link InvalidRepositoryContentConsumer} objects that are + * available and present in the classpath and as components in the IoC. + * + * @return the list of all available {@link InvalidRepositoryContentConsumer} present in the classpath + * and as a component in the IoC. + */ + public List getAvailableInvalidConsumers() + { + return availableInvalidConsumers; + } + + /** + * Set the list of {@link KnownRepositoryContentConsumer} objects that are + * available. + * + * NOTE: This is an override for the base functionality as a component, this + * is used by archiva-cli and the unit testing framework. + * + * @return the list of available {@link KnownRepositoryContentConsumer}. + */ + public void setAvailableKnownConsumers( List availableKnownConsumers ) + { + this.availableKnownConsumers = availableKnownConsumers; + } + + /** + * Set the list of {@link InvalidRepositoryContentConsumer} objects that are + * available. + * + * NOTE: This is an override for the base functionality as a component, this + * is used by archiva-cli and the unit testing framework. + * + * @return the list of available {@link InvalidRepositoryContentConsumer}. + */ + public void setAvailableInvalidConsumers( List availableInvalidConsumers ) + { + this.availableInvalidConsumers = availableInvalidConsumers; + } + + /** + * A convienence method to execute all of the active selected consumers for a + * particular arbitrary file. + * + * @param repository the repository configuration to use. + * @param localFile the local file to execute the consumers against. + */ + public void executeConsumers( ManagedRepositoryConfiguration repository, File localFile ) + { + // Run the repository consumers + try + { + Closure triggerBeginScan = new TriggerBeginScanClosure( repository, getStartTime() ); + + List selectedKnownConsumers = getSelectedKnownConsumers(); + List selectedInvalidConsumers = getSelectedInvalidConsumers(); + CollectionUtils.forAllDo( selectedKnownConsumers, triggerBeginScan ); + CollectionUtils.forAllDo( selectedInvalidConsumers, triggerBeginScan ); + + // yuck. In case you can't read this, it says + // "process the file if the consumer has it in the includes list, and not in the excludes list" + BaseFile baseFile = new BaseFile( repository.getLocation(), localFile ); + ConsumerWantsFilePredicate predicate = new ConsumerWantsFilePredicate(); + predicate.setBasefile( baseFile ); + ConsumerProcessFileClosure closure = new ConsumerProcessFileClosure(); + closure.setBasefile( baseFile ); + predicate.setCaseSensitive( false ); + Closure processIfWanted = IfClosure.getInstance( predicate, closure ); + + CollectionUtils.forAllDo( selectedKnownConsumers, processIfWanted ); + + if ( predicate.getWantedFileCount() <= 0 ) + { + // Nothing known processed this file. It is invalid! + CollectionUtils.forAllDo( selectedInvalidConsumers, closure ); + } + } + finally + { + /* TODO: This is never called by the repository scanner instance, so not calling here either - but it probably should be? + CollectionUtils.forAllDo( availableKnownConsumers, triggerCompleteScan ); + CollectionUtils.forAllDo( availableInvalidConsumers, triggerCompleteScan ); + */ + } + } + + public void setSelectedKnownConsumers( List selectedKnownConsumers ) + { + this.selectedKnownConsumers = selectedKnownConsumers; + } + + public void setSelectedInvalidConsumers( List selectedInvalidConsumers ) + { + this.selectedInvalidConsumers = selectedInvalidConsumers; + } + + protected Date getStartTime() + { + return new Date( System.currentTimeMillis() ); + } + + public void setArchivaConfiguration( ArchivaConfiguration archivaConfiguration ) + { + this.archivaConfiguration = archivaConfiguration; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/RepositoryScanStatistics.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/RepositoryScanStatistics.java new file mode 100644 index 000000000..d7023b444 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/RepositoryScanStatistics.java @@ -0,0 +1,146 @@ +package org.apache.maven.archiva.repository.scanner; + +/* + * 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.collections.CollectionUtils; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.model.RepositoryContentStatistics; + +import java.text.SimpleDateFormat; +import java.util.List; + +/** + * RepositoryScanStatistics - extension to the RepositoryContentStatistics model. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class RepositoryScanStatistics + extends RepositoryContentStatistics +{ + private transient List knownConsumers; + + private transient List invalidConsumers; + + private transient long startTimestamp; + + private SimpleDateFormat df = new SimpleDateFormat(); + + public void triggerStart() + { + startTimestamp = System.currentTimeMillis(); + } + + public void triggerFinished() + { + long finished = System.currentTimeMillis(); + setDuration( finished - startTimestamp ); + setWhenGathered( new java.util.Date( finished ) ); + } + + public void increaseFileCount() + { + long count = getTotalFileCount(); + setTotalFileCount( ++count ); + } + + public void increaseNewFileCount() + { + long count = getNewFileCount(); + setNewFileCount( ++count ); + } + + public void setKnownConsumers( List consumers ) + { + knownConsumers = consumers; + } + + public void setInvalidConsumers( List consumers ) + { + invalidConsumers = consumers; + } + + public String toDump( ManagedRepositoryConfiguration repo ) + { + StringBuffer buf = new StringBuffer(); + + buf.append( "\n.\\ Scan of " ).append( this.getRepositoryId() ); + buf.append( " \\.__________________________________________" ); + + buf.append( "\n Repository Dir : " ).append( repo.getLocation() ); + buf.append( "\n Repository Name : " ).append( repo.getName() ); + buf.append( "\n Repository Layout : " ).append( repo.getLayout() ); + + buf.append( "\n Known Consumers : " ); + if ( CollectionUtils.isNotEmpty( knownConsumers ) ) + { + buf.append( "(" ).append( knownConsumers.size() ).append( " configured)" ); + for ( String id : knownConsumers ) + { + buf.append( "\n " ).append( id ); + } + } + else + { + buf.append( "" ); + } + + buf.append( "\n Invalid Consumers : " ); + if ( CollectionUtils.isNotEmpty( invalidConsumers ) ) + { + buf.append( "(" ).append( invalidConsumers.size() ).append( " configured)" ); + for ( String id : invalidConsumers ) + { + buf.append( "\n " ).append( id ); + } + } + else + { + buf.append( "" ); + } + + buf.append( "\n Duration : " ); + buf.append( org.apache.maven.archiva.common.utils.DateUtil.getDuration( this.getDuration() ) ); + buf.append( "\n When Gathered : " ); + if ( this.getWhenGathered() == null ) + { + buf.append( "" ); + } + else + { + buf.append( df.format( this.getWhenGathered() ) ); + } + + buf.append( "\n Total File Count : " ).append( this.getTotalFileCount() ); + + long averageMsPerFile = 0; + + if ( getTotalFileCount() != 0 ) + { + averageMsPerFile = ( this.getDuration() / this.getTotalFileCount() ); + } + + buf.append( "\n Avg Time Per File : " ); + buf.append( org.apache.maven.archiva.common.utils.DateUtil.getDuration( averageMsPerFile ) ); + buf.append( "\n______________________________________________________________" ); + + return buf.toString(); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/RepositoryScanner.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/RepositoryScanner.java new file mode 100644 index 000000000..dae6ef575 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/RepositoryScanner.java @@ -0,0 +1,111 @@ +package org.apache.maven.archiva.repository.scanner; + +/* + * 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.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.consumers.InvalidRepositoryContentConsumer; +import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer; +import org.apache.maven.archiva.repository.RepositoryException; + +import java.util.List; + +/** + * RepositoryScanner + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public interface RepositoryScanner +{ + /** + * The value to pass to {@link #scan(ManagedRepositoryConfiguration, long)} to have the scan + * operate in a fresh fashion, with no check on changes based on timestamp. + */ + public static final long FRESH_SCAN = 0; + + /** + *

+ * Typical Ignorable Content patterns. + *

+ * + *

+ * NOTE: Do not use for normal webapp or task driven repository scanning. + *

+ * + *

+ * These patterns are only valid for archiva-cli and archiva-converter use. + *

+ */ + public static final String[] IGNORABLE_CONTENT = { + "bin/**", + "reports/**", + ".index", + ".reports/**", + ".maven/**", + "**/.svn/**", + "**/*snapshot-version", + "*/website/**", + "*/licences/**", + "**/.htaccess", + "**/*.html", + "**/*.txt", + "**/README*", + "**/CHANGELOG*", + "**/KEYS*" }; + + /** + * Scan the repository for content changes. + * + * Internally, this will use the as-configured known and invalid consumer lists. + * + * @param repository the repository to change. + * @param changesSince the timestamp to use as a threshold on what is considered new or changed. + * (To have all content be taken into consideration regardless of timestamp, + * use the {@link #FRESH_SCAN} constant) + * @return the statistics for this scan. + * @throws RepositoryException if there was a fundamental problem with getting the discoverer started. + */ + public RepositoryScanStatistics scan( ManagedRepositoryConfiguration repository, long changesSince ) + throws RepositoryException; + + /** + * Scan the repository for content changes. + * + * Internally, this will use the as-configured known and invalid consumer lists. + * + * @param repository the repository to change. + * @param knownContentConsumers the list of consumers that follow the {@link KnownRepositoryContentConsumer} + * interface that should be used for this scan. + * @param invalidContentConsumers the list of consumers that follow the {@link InvalidRepositoryContentConsumer} + * interface that should be used for this scan. + * @param ignoredContentPatterns list of patterns that should be ignored and not sent to any consumer. + * @param changesSince the timestamp to use as a threshold on what is considered new or changed. + * (To have all content be taken into consideration regardless of timestamp, + * use the {@link #FRESH_SCAN} constant) + * @return the statistics for this scan. + * @throws RepositoryException if there was a fundamental problem with getting the discoverer started. + */ + public RepositoryScanStatistics scan( ManagedRepositoryConfiguration repository, + List knownContentConsumers, + List invalidContentConsumers, + List ignoredContentPatterns, long changesSince ) + throws RepositoryException; + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/RepositoryScannerInstance.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/RepositoryScannerInstance.java new file mode 100644 index 000000000..e24ed9fe5 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/RepositoryScannerInstance.java @@ -0,0 +1,160 @@ +package org.apache.maven.archiva.repository.scanner; + +/* + * 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; +import java.util.Date; +import java.util.List; + +import org.apache.commons.collections.Closure; +import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections.functors.IfClosure; +import org.apache.commons.lang.SystemUtils; +import org.apache.maven.archiva.common.utils.BaseFile; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.consumers.InvalidRepositoryContentConsumer; +import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer; +import org.apache.maven.archiva.repository.scanner.functors.ConsumerProcessFileClosure; +import org.apache.maven.archiva.repository.scanner.functors.ConsumerWantsFilePredicate; +import org.apache.maven.archiva.repository.scanner.functors.TriggerBeginScanClosure; +import org.codehaus.plexus.util.DirectoryWalkListener; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +/** + * RepositoryScannerInstance + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class RepositoryScannerInstance + implements DirectoryWalkListener +{ + private Logger log = LoggerFactory.getLogger( RepositoryScannerInstance.class ); + + /** + * Consumers that process known content. + */ + private List knownConsumers; + + /** + * Consumers that process unknown/invalid content. + */ + private List invalidConsumers; + + private ManagedRepositoryConfiguration repository; + + private RepositoryScanStatistics stats; + + private long changesSince = 0; + + private ConsumerProcessFileClosure consumerProcessFile; + + private ConsumerWantsFilePredicate consumerWantsFile; + + public RepositoryScannerInstance( ManagedRepositoryConfiguration repository, + List knownConsumerList, + List invalidConsumerList ) + { + this.repository = repository; + this.knownConsumers = knownConsumerList; + this.invalidConsumers = invalidConsumerList; + + this.consumerProcessFile = new ConsumerProcessFileClosure(); + this.consumerWantsFile = new ConsumerWantsFilePredicate(); + + stats = new RepositoryScanStatistics(); + stats.setRepositoryId( repository.getId() ); + + Closure triggerBeginScan = new TriggerBeginScanClosure( repository, new Date( System.currentTimeMillis() ) ); + + CollectionUtils.forAllDo( knownConsumerList, triggerBeginScan ); + CollectionUtils.forAllDo( invalidConsumerList, triggerBeginScan ); + + if ( SystemUtils.IS_OS_WINDOWS ) + { + consumerWantsFile.setCaseSensitive( false ); + } + } + + public RepositoryScannerInstance( ManagedRepositoryConfiguration repository, + List knownContentConsumers, + List invalidContentConsumers, long changesSince ) + { + this( repository, knownContentConsumers, invalidContentConsumers ); + + consumerWantsFile.setChangesSince( changesSince ); + + this.changesSince = changesSince; + } + + public RepositoryScanStatistics getStatistics() + { + return stats; + } + + public void directoryWalkStarting( File basedir ) + { + log.info( "Walk Started: [" + this.repository.getId() + "] " + this.repository.getLocation() ); + stats.triggerStart(); + } + + public void directoryWalkStep( int percentage, File file ) + { + log.debug( "Walk Step: " + percentage + ", " + file ); + + stats.increaseFileCount(); + + // consume files regardless - the predicate will check the timestamp + BaseFile basefile = new BaseFile( repository.getLocation(), file ); + + // Timestamp finished points to the last successful scan, not this current one. + if ( file.lastModified() >= changesSince ) + { + stats.increaseNewFileCount(); + } + + consumerProcessFile.setBasefile( basefile ); + consumerWantsFile.setBasefile( basefile ); + + Closure processIfWanted = IfClosure.getInstance( consumerWantsFile, consumerProcessFile ); + CollectionUtils.forAllDo( this.knownConsumers, processIfWanted ); + + if ( consumerWantsFile.getWantedFileCount() <= 0 ) + { + // Nothing known processed this file. It is invalid! + CollectionUtils.forAllDo( this.invalidConsumers, consumerProcessFile ); + } + } + + public void directoryWalkFinished() + { + log.info( "Walk Finished: [" + this.repository.getId() + "] " + this.repository.getLocation() ); + stats.triggerFinished(); + } + + /** + * Debug method from DirectoryWalker. + */ + public void debug( String message ) + { + log.debug( "Repository Scanner: " + message ); + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/functors/ConsumerProcessFileClosure.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/functors/ConsumerProcessFileClosure.java new file mode 100644 index 000000000..e9342d8b6 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/functors/ConsumerProcessFileClosure.java @@ -0,0 +1,83 @@ +package org.apache.maven.archiva.repository.scanner.functors; + +/* + * 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.collections.Closure; +import org.apache.maven.archiva.common.utils.BaseFile; +import org.apache.maven.archiva.consumers.RepositoryContentConsumer; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * ConsumerProcessFileClosure + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ConsumerProcessFileClosure + implements Closure +{ + private Logger log = LoggerFactory.getLogger( ConsumerProcessFileClosure.class ); + + private BaseFile basefile; + + public void execute( Object input ) + { + if ( input instanceof RepositoryContentConsumer ) + { + RepositoryContentConsumer consumer = (RepositoryContentConsumer) input; + + try + { + log.debug( "Sending to consumer: " + consumer.getId() ); + + consumer.processFile( basefile.getRelativePath() ); + } + catch ( Exception e ) + { + /* Intentionally Catch all exceptions. + * So that the discoverer processing can continue. + */ + log.error( "Consumer [" + consumer.getId() + "] had an error when processing file [" + + basefile.getAbsolutePath() + "]: " + e.getMessage(), e ); + } + } + } + + public BaseFile getBasefile() + { + return basefile; + } + + public void setBasefile( BaseFile basefile ) + { + this.basefile = basefile; + } + + public Logger getLogger() + { + return log; + } + + public void setLogger( Logger logger ) + { + this.log = logger; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/functors/ConsumerWantsFilePredicate.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/functors/ConsumerWantsFilePredicate.java new file mode 100644 index 000000000..97e97b407 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/functors/ConsumerWantsFilePredicate.java @@ -0,0 +1,136 @@ +package org.apache.maven.archiva.repository.scanner.functors; + +/* + * 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.collections.Predicate; +import org.apache.commons.io.FilenameUtils; +import org.apache.maven.archiva.common.utils.BaseFile; +import org.apache.maven.archiva.consumers.RepositoryContentConsumer; +import org.codehaus.plexus.util.SelectorUtils; + +import java.util.List; + +/** + * ConsumerWantsFilePredicate + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ConsumerWantsFilePredicate + implements Predicate +{ + private BaseFile basefile; + + private boolean isCaseSensitive = true; + + private int wantedFileCount = 0; + + private long changesSince = 0; + + public boolean evaluate( Object object ) + { + boolean satisfies = false; + + if ( object instanceof RepositoryContentConsumer ) + { + RepositoryContentConsumer consumer = (RepositoryContentConsumer) object; + if ( wantsFile( consumer, FilenameUtils.separatorsToUnix( basefile.getRelativePath() ) ) ) + { + satisfies = true; + + // regardless of the timestamp, we record that it was wanted so it doesn't get counted as invalid + wantedFileCount++; + + if ( !consumer.isProcessUnmodified() ) + { + // Timestamp finished points to the last successful scan, not this current one. + if ( basefile.lastModified() < changesSince ) + { + // Skip file as no change has occured. + satisfies = false; + } + } + } + } + + return satisfies; + } + + public BaseFile getBasefile() + { + return basefile; + } + + public int getWantedFileCount() + { + return wantedFileCount; + } + + public boolean isCaseSensitive() + { + return isCaseSensitive; + } + + public void setBasefile( BaseFile basefile ) + { + this.basefile = basefile; + this.wantedFileCount = 0; + } + + public void setCaseSensitive( boolean isCaseSensitive ) + { + this.isCaseSensitive = isCaseSensitive; + } + + private boolean wantsFile( RepositoryContentConsumer consumer, String relativePath ) + { + // Test excludes first. + List excludes = consumer.getExcludes(); + if ( excludes != null ) + { + for ( String pattern : excludes ) + { + if ( SelectorUtils.matchPath( pattern, relativePath, isCaseSensitive ) ) + { + // Definately does NOT WANT FILE. + return false; + } + } + } + + // Now test includes. + for ( String pattern : consumer.getIncludes() ) + { + if ( SelectorUtils.matchPath( pattern, relativePath, isCaseSensitive ) ) + { + // Specifically WANTS FILE. + return true; + } + } + + // Not included, and Not excluded? Default to EXCLUDE. + return false; + } + + public void setChangesSince( long changesSince ) + { + this.changesSince = changesSince; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/functors/TriggerBeginScanClosure.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/functors/TriggerBeginScanClosure.java new file mode 100644 index 000000000..cde504fde --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/functors/TriggerBeginScanClosure.java @@ -0,0 +1,73 @@ +package org.apache.maven.archiva.repository.scanner.functors; + +/* + * 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.Date; + +import org.apache.commons.collections.Closure; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.consumers.ConsumerException; +import org.apache.maven.archiva.consumers.RepositoryContentConsumer; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * TriggerBeginScanClosure + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class TriggerBeginScanClosure + implements Closure +{ + private Logger log = LoggerFactory.getLogger( TriggerBeginScanClosure.class ); + + private ManagedRepositoryConfiguration repository; + + private Date whenGathered; + + public TriggerBeginScanClosure( ManagedRepositoryConfiguration repository ) + { + this.repository = repository; + } + + public TriggerBeginScanClosure( ManagedRepositoryConfiguration repository, Date whenGathered ) + { + this( repository ); + this.whenGathered = whenGathered; + } + + public void execute( Object input ) + { + if ( input instanceof RepositoryContentConsumer ) + { + RepositoryContentConsumer consumer = (RepositoryContentConsumer) input; + + try + { + consumer.beginScan( repository, whenGathered ); + } + catch ( ConsumerException e ) + { + log.warn( "Consumer [" + consumer.getId() + "] cannot begin: " + e.getMessage(), e ); + } + } + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/resources/META-INF/plexus/components-fragment.xml b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/resources/META-INF/plexus/components-fragment.xml new file mode 100644 index 000000000..ed63a3b82 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/main/resources/META-INF/plexus/components-fragment.xml @@ -0,0 +1,25 @@ + + + + org.codehaus.plexus.cache.Cache + effective-project-cache + org.codehaus.plexus.cache.ehcache.EhcacheCache + Effective Project Cache + + 600 + true + ${java.io.tmpdir}/archiva/effectiveproject + true + 1000 + LRU + effective-project-cache + false + + + 2700 + + 1800 + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/expected-poms/archiva-model-effective.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/expected-poms/archiva-model-effective.pom new file mode 100644 index 000000000..9129a9db4 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/expected-poms/archiva-model-effective.pom @@ -0,0 +1,794 @@ + + + + archiva-base + org.apache.maven.archiva + 1.0-SNAPSHOT + + 4.0.0 + org.apache.maven.archiva + archiva-model + Archiva Base :: Model + 1.0-SNAPSHOT + Archiva is an application for managing one or more remote repositories, including + administration, artifact handling, + browsing and searching. + http://maven.apache.org/archiva/archiva-base/archiva-model + + jira + http://jira.codehaus.org/browse/MRM + + + continuum + http://maven.zones.apache.org:8080/continuum + + + +
notifications@maven.apache.org
+
+
+
+
+ 2002 + + + Maven Archiva User List + archiva-users-subscribe@maven.apache.org + archiva-users-unsubscribe@maven.apache.org + archiva-users@maven.apache.org + http://mail-archives.apache.org/mod_mbox/maven-archiva-users + + + Maven Archiva Developer List + archiva-dev-subscribe@maven.apache.org + archiva-dev-unsubscribe@maven.apache.org + archiva-dev@maven.apache.org + http://mail-archives.apache.org/mod_mbox/maven-archiva-dev + + + Maven Archiva Commits List + archiva-commits-subscribe@maven.apache.org + archiva-commits-unsubscribe@maven.apache.org + archiva-commits@maven.apache.org + http://mail-archives.apache.org/mod_mbox/maven-archiva-commits + + + + + jvanzyl + Jason van Zyl + jason@maven.org + ASF + + PMC Chair + + -5 + + + brett + Brett Porter + brett@apache.org + ASF + + PMC Member + + +10 + + + evenisse + Emmanuel Venisse + evenisse@apache.org + ASF + + PMC Member + + +1 + + + kenney + Kenney Westerhof + kenney@apache.org + Neonics + + PMC Member + + + + snicoll + Stephane Nicoll + snicoll@apache.org + ASF + + PMC Member + + +1 + + + vmassol + Vincent Massol + vmassol@apache.org + ASF + + PMC Member + + +1 + + + fgiust + Fabrizio Giustina + fgiust@apache.org + openmind + + PMC Member + + +1 + + + epunzalan + Edwin Punzalan + epunzalan@mergere.com + Mergere + + Committer + + +8 + + + mperham + Mike Perham + mperham@gmail.com + IBM + + PMC Member + + -6 + + + jdcasey + John Casey + jdcasey@apache.org + ASF + + PMC Member + + -5 + + + trygvis + Trygve Laugstol + trygvis@apache.org + ASF + + PMC Member + + +1 + + + vsiveton + Vincent Siveton + vsiveton@apache.org + ASF + + PMC Member + + -5 + + + carlos + Carlos Sanchez + carlos@apache.org + ASF + + PMC Member + + +1 + + + dennisl + Dennis Lundberg + dennisl@apache.org + ASF + + PMC Member + + +1 + + + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + scm:svn:http://svn.apache.org/repos/asf/maven/archiva/trunk/archiva-base/archiva-model + scm:svn:https://svn.apache.org/repos/asf/maven/archiva/trunk/archiva-base/archiva-model + http://svn.apache.org/viewcvs.cgi/maven/archiva/trunk/archiva-base/archiva-model + + + Apache Software Foundation + http://www.apache.org/ + + + /home/joakim/code/maven/branches/archiva-jpox-database-refactor/archiva-base/archiva-model/src/main/java + src/main/scripts + /home/joakim/code/maven/branches/archiva-jpox-database-refactor/archiva-base/archiva-model/src/test/java + /home/joakim/code/maven/branches/archiva-jpox-database-refactor/archiva-base/archiva-model/target/classes + /home/joakim/code/maven/branches/archiva-jpox-database-refactor/archiva-base/archiva-model/target/test-classes + + + /home/joakim/code/maven/branches/archiva-jpox-database-refactor/archiva-base/archiva-model/src/main/resources + + + + + /home/joakim/code/maven/branches/archiva-jpox-database-refactor/archiva-base/archiva-model/src/test/resources + + + /home/joakim/code/maven/branches/archiva-jpox-database-refactor/archiva-base/archiva-model/target + archiva-model-1.0-SNAPSHOT + + + + maven-idea-plugin + + 1.4 + + + + maven-release-plugin + + https://svn.apache.org/repos/asf/maven/archiva/tags + + + + + + + org.codehaus.plexus + plexus-maven-plugin + 1.3.3 + + + generate + + descriptor + + + + + + maven-compiler-plugin + + 1.4 + 1.4 + + + + maven-surefire-plugin + 2.2 + + + org.codehaus.modello + modello-maven-plugin + 1.0-alpha-15-SNAPSHOT + + + archiva-base + + java + xsd + jpox-jdo-mapping + jpox-metadata-class + + + + + 1.0.0 + false + src/main/mdo/archiva-base.xml + + + + org.codehaus.mojo + jpox-maven-plugin + 1.1.6 + + + create-ddl + generate-test-resources + + schema-create + + + /home/joakim/code/maven/branches/archiva-jpox-database-refactor/archiva-base/archiva-model/target/classes/org/apache/maven/archiva/model/schema.ddl + + + javax.jdo.option.ConnectionDriverName + org.apache.derby.jdbc.EmbeddedDriver + + + javax.jdo.option.ConnectionURL + jdbc:derby:target/jdo-schema-create;create=true + + + javax.jdo.option.ConnectionUserName + sa + + + javax.jdo.option.ConnectionPassword + + + + log4j.configuration + /home/joakim/code/maven/branches/archiva-jpox-database-refactor/archiva-base/archiva-model/src/test/resources/log4j.xml + + + org.jpox.autoCreateTables + true + + + + + + enhance + + enhance + + + + + + org.apache.derby + derby + 10.2.1.6 + + + + + org.codehaus.mojo + cobertura-maven-plugin + + + + org/apache/maven/archiva/reporting/model/** + + + + + + maven-help-plugin + 2.0.1 + + + + + + + + false + + codehaus.org + http://repository.codehaus.org + + + + false + + + snapshots.codehaus.org + http://snapshots.repository.codehaus.org + + + + false + + apache.snapshots + Apache Snapshot Repository + http://people.apache.org/repo/m2-snapshot-repository + + + + false + + central + Maven Repository Switchboard + http://repo1.maven.org/maven2 + + + + + + false + + + snapshots.codehaus.org + http://snapshots.repository.codehaus.org + + + + never + + + false + + central + Maven Plugin Repository + http://repo1.maven.org/maven2 + + + + + junit + junit + 3.8.1 + test + + + org.apache.maven.archiva + archiva-common + 1.0-SNAPSHOT + + + org.codehaus.plexus + plexus-utils + 1.4 + + + javax.jdo + jdo2-api + 2.0 + + + org.codehaus.plexus + plexus-container-default + 1.0-alpha-18 + + + commons-lang + commons-lang + 2.2 + + + commons-io + commons-io + 1.2 + + + + target/site + + + maven-checkstyle-plugin + + config/maven_checks.xml + + + + maven-javadoc-plugin + + 1.4 + true + + + + maven-jxr-plugin + + true + + + + maven-pmd-plugin + + + maven-surefire-report-plugin + + + org.codehaus.mojo + changelog-maven-plugin + + + org.codehaus.mojo + cobertura-maven-plugin + + + org.codehaus.mojo + taglist-maven-plugin + + + + + + + org.apache.maven.shared + maven-app-configuration-model + 1.0-SNAPSHOT + + + org.apache.maven.shared + maven-app-configuration-web + 1.0-SNAPSHOT + + + org.codehaus.plexus + plexus-container-default + 1.0-alpha-18 + + + org.codehaus.plexus + plexus-component-api + 1.0-alpha-18 + + + org.codehaus.plexus + plexus-utils + 1.4 + + + org.slf4j + slf4j-log4j12 + 1.2 + + + org.apache.maven + maven-repository-metadata + 2.0.5 + + + org.apache.maven + maven-model + 2.0.5 + + + org.apache.maven + maven-artifact + 2.0.5 + + + org.apache.maven + maven-artifact-manager + 2.0.5 + + + org.apache.maven + maven-project + 2.0.5 + + + org.apache.maven.shared + maven-model-converter + 2.0.5-SNAPSHOT + + + org.apache.maven.wagon + wagon-provider-api + 1.0-beta-2 + + + org.apache.maven.wagon + wagon-ssh + 1.0-beta-2 + + + org.apache.maven.wagon + wagon-file + 1.0-beta-2 + + + org.apache.maven.wagon + wagon-http-lightweight + 1.0-beta-2 + + + org.apache.maven.archiva + archiva-common + 1.0-SNAPSHOT + + + org.apache.maven.archiva + archiva-core + 1.0-SNAPSHOT + + + org.apache.maven.archiva + archiva-reports-standard + 1.0-SNAPSHOT + + + org.apache.maven.archiva + archiva-model + 1.0-SNAPSHOT + + + org.apache.maven.archiva + archiva-database + 1.0-SNAPSHOT + + + org.apache.maven.archiva + archiva-consumer-api + 1.0-SNAPSHOT + + + org.apache.maven.archiva + archiva-model + 1.0-SNAPSHOT + + + org.apache.maven.archiva + archiva-database + 1.0-SNAPSHOT + + + org.apache.maven.archiva + archiva-discoverer + 1.0-SNAPSHOT + + + org.apache.maven.archiva + archiva-repository-layer + 1.0-SNAPSHOT + + + org.apache.maven.archiva + archiva-indexer + 1.0-SNAPSHOT + + + org.apache.maven.archiva + archiva-proxy + 1.0-SNAPSHOT + + + org.apache.maven.archiva + archiva-applet + 1.0-SNAPSHOT + + + org.apache.maven.archiva + archiva-security + 1.0-SNAPSHOT + + + org.apache.maven.archiva + archiva-configuration + 1.0-SNAPSHOT + + + org.apache.maven.archiva + archiva-converter + 1.0-SNAPSHOT + + + org.apache.maven.archiva + archiva-utils + 1.0-SNAPSHOT + + + org.apache.maven.archiva + archiva-webapp + 1.0-SNAPSHOT + war + + + org.codehaus.plexus + plexus-digest + 1.1-SNAPSHOT + + + org.codehaus.plexus.security + plexus-security-rbac-profile + 1.0-alpha-11-SNAPSHOT + + + org.codehaus.plexus.security + plexus-security-system + 1.0-alpha-11-SNAPSHOT + + + org.codehaus.plexus.security + plexus-security-system + 1.0-alpha-11-SNAPSHOT + + + org.codehaus.plexus.security + plexus-security-ui-web + 1.0-alpha-11-SNAPSHOT + war + + + org.codehaus.plexus.security + plexus-security-ui-web-integration + 1.0-alpha-11-SNAPSHOT + + + org.codehaus.plexus.security + plexus-security-ui-web-taglib + 1.0-alpha-11-SNAPSHOT + + + org.codehaus.plexus.security + plexus-security-authentication-provider-user-manager + 1.0-alpha-11-SNAPSHOT + + + org.codehaus.plexus.security + plexus-security-authentication-provider-keystore + 1.0-alpha-11-SNAPSHOT + + + org.codehaus.plexus.security + plexus-security-user-management-api + 1.0-alpha-11-SNAPSHOT + + + org.codehaus.plexus.security + plexus-security-user-management-provider-jdo + 1.0-alpha-11-SNAPSHOT + + + org.codehaus.plexus.security + plexus-security-authorization-rbac-store-cached + 1.0-alpha-11-SNAPSHOT + + + org.codehaus.plexus.security + plexus-security-authorization-rbac-store-jdo + 1.0-alpha-11-SNAPSHOT + + + org.codehaus.plexus.security + plexus-security-authorization-api + 1.0-alpha-11-SNAPSHOT + + + org.codehaus.plexus.security + plexus-security-authorization-rbac-authorizer + 1.0-alpha-11-SNAPSHOT + + + org.codehaus.plexus.security + plexus-security-keys-jdo + 1.0-alpha-11-SNAPSHOT + + + commons-lang + commons-lang + 2.2 + + + commons-io + commons-io + 1.2 + + + org.apache.derby + derby + 10.1.3.1 + + + + + + apache.releases + Apache Release Distribution Repository + scp://people.apache.org/www/people.apache.org/repo/m2-ibiblio-rsync-repository + + + apache.snapshots + Apache Development Snapshot Repository + scp://people.apache.org/www/people.apache.org/repo/m2-snapshot-repository + + + apache.website + scpexe://people.apache.org/www/maven.apache.org/archiva/archiva-base/archiva-model + + + + 1.0-alpha-11-SNAPSHOT + 1.0-beta-2 + 2.0.5 + 1.0-SNAPSHOT + +
diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/expected-poms/cocoon-1.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/expected-poms/cocoon-1.pom new file mode 100644 index 000000000..dba957e59 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/expected-poms/cocoon-1.pom @@ -0,0 +1,284 @@ + + + + 4.0.0 + + org.apache + apache + 1 + + org.apache.cocoon + cocoon + 1 + pom + Apache Cocoon + http://cocoon.apache.org + + The Apache Software Foundation + http://www.apache.org/ + + + jira + https://issues.apache.org/jira/browse/COCOON + + + continuum + http://cocoon.zones.apache.org:12000/continuum/servlet/continuum + + + + Cocoon User List + users@cocoon.apache.org + users-subscribe@cocoon.apache.org + users-unsubscribe@cocoon.apache.org + http://mail-archives.apache.org/mod_mbox/cocoon-users + + http://www.mail-archive.com/users@cocoon.apache.org/ + http://marc.theaimsgroup.com/?l=xml-cocoon-user + http://news.gmane.org/gmane.text.xml.cocoon.user + + + + Cocoon Developer List + dev@cocoon.apache.org + dev-subscribe@cocoon.apache.org + dev-unsubscribe@cocoon.apache.org + http://mail-archives.apache.org/mod_mbox/cocoon-dev + + http://www.mail-archive.com/dev@cocoon.apache.org/ + http://marc.theaimsgroup.com/?l=xml-cocoon-dev + http://news.gmane.org/gmane.text.xml.cocoon.dev + + + + Cocoon Documentation List + docs@cocoon.apache.org + docs-subscribe@cocoon.apache.org + docs-unsubscribe@cocoon.apache.org + http://mail-archives.apache.org/mod_mbox/cocoon-docs + + http://www.mail-archive.com/dev@cocoon.apache.org/ + http://marc.theaimsgroup.com/?l=xml-cocoon-docs + http://news.gmane.org/gmane.text.xml.cocoon.docs + + + + Cocoon Subversion Repository List + cvs-subscribe@cocoon.apache.org + cvs-unsubscribe@cocoon.apache.org + http://mail-archives.apache.org/mod_mbox/cocoon-cvs + + http://www.mail-archive.com/cvs@cocoon.apache.org/ + http://marc.theaimsgroup.com/?l=xml-cocoon-cvs + http://news.gmane.org/gmane.text.xml.cocoon.cvs + + + + + + crossley + David Crossley + crossley@apache.org + ASF + http://www.apache.org/ + +10 + + Committer + + + + bdelacretaz + Bertrand Delacretaz + bdelacretaz@apache.org + ASF + http://www.apache.org + +1 + + Committer + + + + danielf + Daniel Fagerstrom + danielf@apache.org + ASF + http://www.apache.org + +1 + + Committer + + + + antonio + Antonio Gallardo + antonio@apache.org + ASF + http://www.apache.org + -6 + + Committer + + + + lgawron + Leszek Gawron + lgawron@apache.org + ASF + http://www.apache.org + +1 + + Committer + + + + joerg + Jorg Heinicke + joerg@apache.org + ASF + http://www.apache.org + +1 + + Committer + + + + jheymans + Jorg Heymans + jheymans@apache.org + ASF + http://www.apache.org + +1 + + Committer + + + + anathaniel + Alfred Nathaniel + anathaniel@apache.org + ASF + http://www.apache.org + +1 + + Committer + + + + giacomo + Giacomo Pati + giacomo@apache.org + ASF + http://www.apache.org + +1 + + Committer + + + + reinhard + Reinhard Poetz + reinhard@apache.org + ASF + http://www.apache.org + +1 + + Committer + + + + jbq + Jean-Baptiste Quenot + jbq@apache.org + ASF + http://www.apache.org + +1 + + Committer + + + + gianugo + Gianugo Rabellino + gianugo@apache.org + ASF + http://www.apache.org + +1 + + Committer + + + + cziegeler + Carsten Ziegeler + cziegeler@apache.org + ASF + http://www.apache.org + +1 + + Committer + + + + vgritsenko + Vadim Gritsenko + vgritsenko@apache.org + ASF + http://www.apache.org + -5 + + Committer + + + + + + Apache License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + + + + + central + Maven central repository + http://ibiblio.org/maven2 + + + apache.snapshot + Apache Snapshot Repository + http://svn.apache.org/maven-snapshot-repository + + + apache-cvs + Apache Maven Repository + http://svn.apache.org/repository + legacy + + + + + + org.apache.maven.plugins + maven-project-info-reports-plugin + + + + + scm:svn:https://svn.apache.org/repos/asf/cocoon/tags/cocoon-1 + scm:svn:https://svn.apache.org/repos/asf/cocoon/tags/cocoon-1 + https://svn.apache.org/repos/asf/cocoon/tags/cocoon-1 + + + + + maven-release-plugin + + + + + org.apache.maven.wagon + wagon-ssh-external + 1.0-alpha-6 + + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/expected-poms/maven-parent-4.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/expected-poms/maven-parent-4.pom new file mode 100644 index 000000000..c0ba6ed00 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/expected-poms/maven-parent-4.pom @@ -0,0 +1,227 @@ + + + + 4.0.0 + + org.apache + apache + 3 + + org.apache.maven + maven-parent + 4 + pom + Apache Maven + Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information. + http://maven.apache.org/ + + jira + http://jira.codehaus.org/browse/MPA + + + continuum + http://maven.zones.apache.org:8080/continuum + + + + Maven Announcements List + announce@maven.apache.org + announce-subscribe@maven.apache.org + announce-unsubscribe@maven.apache.org + http://mail-archives.apache.org/mod_mbox/maven-announce/ + + + Maven Issues List + issues@maven.apache.org + issues-subscribe@maven.apache.org + issues-unsubscribe@maven.apache.org + http://mail-archives.apache.org/mod_mbox/maven-issues/ + + + Maven Notifications List + notifications@maven.apache.org + notifications-subscribe@maven.apache.org + notifications-unsubscribe@maven.apache.org + http://mail-archives.apache.org/mod_mbox/maven-notifications/ + + + + + jvanzyl + Jason van Zyl + jason@maven.org + ASF + -5 + + PMC Chair + + + + brett + Brett Porter + brett@apache.org + ASF + +10 + + PMC Member + + + + evenisse + Emmanuel Venisse + evenisse@apache.org + ASF + +1 + + PMC Member + + + + kenney + Kenney Westerhof + kenney@apache.org + Neonics + + PMC Member + + + + snicoll + Stephane Nicoll + snicoll@apache.org + ASF + +1 + + PMC Member + + + + vmassol + Vincent Massol + vmassol@apache.org + ASF + +1 + + PMC Member + + + + fgiust + Fabrizio Giustina + fgiust@apache.org + openmind + +1 + + PMC Member + + + + epunzalan + Edwin Punzalan + epunzalan@mergere.com + Mergere + +8 + + Committer + + + + mperham + Mike Perham + mperham@gmail.com + IBM + -6 + + PMC Member + + + + jdcasey + John Casey + jdcasey@apache.org + ASF + -5 + + PMC Member + + + + trygvis + Trygve Laugstol + trygvis@apache.org + ASF + +1 + + PMC Member + + + + vsiveton + Vincent Siveton + vsiveton@apache.org + ASF + -5 + + PMC Member + + + + carlos + Carlos Sanchez + carlos@apache.org + ASF + +1 + + PMC Member + + + + dennisl + Dennis Lundberg + dennisl@apache.org + ASF + +1 + + PMC Member + + + + + + + org.apache.maven.plugins + maven-surefire-report-plugin + + + org.apache.maven.plugins + maven-checkstyle-plugin + + + org.apache.maven.plugins + maven-pmd-plugin + + + org.codehaus.mojo + cobertura-maven-plugin + + + org.codehaus.mojo + taglist-maven-plugin + + + org.apache.maven.plugins + maven-jxr-plugin + + + org.apache.maven.plugins + maven-javadoc-plugin + + + + + scm:svn:http://svn.apache.org/repos/asf/maven/pom/maven/tags/maven-parent-4 + scm:svn:https://svn.apache.org/repos/asf/maven/pom/maven/tags/maven-parent-4 + http://svn.apache.org/viewvc/maven/pom/maven/tags/maven-parent-4 + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/expected-poms/model-write-400-simple.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/expected-poms/model-write-400-simple.pom new file mode 100644 index 000000000..213765a92 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/expected-poms/model-write-400-simple.pom @@ -0,0 +1,9 @@ + + + + 4.0.0 + org.apache.archiva.test + simple-model-write + 1.0 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/AbstractRepositoryLayerTestCase.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/AbstractRepositoryLayerTestCase.java new file mode 100644 index 000000000..624f50d01 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/AbstractRepositoryLayerTestCase.java @@ -0,0 +1,94 @@ +package org.apache.maven.archiva.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. + */ + +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.configuration.RemoteRepositoryConfiguration; +import org.codehaus.plexus.spring.PlexusInSpringTestCase; + +import java.io.File; + +/** + * AbstractRepositoryLayerTestCase + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public abstract class AbstractRepositoryLayerTestCase + extends PlexusInSpringTestCase +{ + /** + * {@inheritDoc} + * @see org.codehaus.plexus.spring.PlexusInSpringTestCase#getSpringConfigLocation() + */ + @Override + protected String getSpringConfigLocation() + { + return "org/apache/maven/archiva/repository/spring-context.xml"; + } + + protected ManagedRepositoryConfiguration createRepository( String id, String name, File location ) + { + ManagedRepositoryConfiguration repo = new ManagedRepositoryConfiguration(); + repo.setId( id ); + repo.setName( name ); + repo.setLocation( location.getAbsolutePath() ); + return repo; + } + + protected RemoteRepositoryConfiguration createRemoteRepository( String id, String name, String url ) + { + RemoteRepositoryConfiguration repo = new RemoteRepositoryConfiguration(); + repo.setId( id ); + repo.setName( name ); + repo.setUrl( url ); + return repo; + } + + protected ManagedRepositoryContent createManagedRepositoryContent( String id, String name, File location, String layout ) + throws Exception + { + ManagedRepositoryConfiguration repo = new ManagedRepositoryConfiguration(); + repo.setId( id ); + repo.setName( name ); + repo.setLocation( location.getAbsolutePath() ); + repo.setLayout( layout ); + + ManagedRepositoryContent repoContent = (ManagedRepositoryContent) lookup( ManagedRepositoryContent.class, layout ); + repoContent.setRepository( repo ); + + return repoContent; + } + + protected RemoteRepositoryContent createRemoteRepositoryContent( String id, String name, String url, String layout ) + throws Exception + { + RemoteRepositoryConfiguration repo = new RemoteRepositoryConfiguration(); + repo.setId( id ); + repo.setName( name ); + repo.setUrl( url ); + repo.setLayout( layout ); + + RemoteRepositoryContent repoContent = (RemoteRepositoryContent) lookup( RemoteRepositoryContent.class, layout ); + repoContent.setRepository( repo ); + + return repoContent; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/MockConfiguration.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/MockConfiguration.java new file mode 100755 index 000000000..c68298c5a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/MockConfiguration.java @@ -0,0 +1,105 @@ +package org.apache.maven.archiva.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. + */ + +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.Configuration; +import org.apache.maven.archiva.configuration.ConfigurationListener; +import org.codehaus.plexus.registry.Registry; +import org.codehaus.plexus.registry.RegistryException; +import org.codehaus.plexus.registry.RegistryListener; +import org.easymock.MockControl; + +import java.util.HashSet; +import java.util.Set; + +/** + * MockConfiguration + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component role="org.apache.maven.archiva.configuration.ArchivaConfiguration" + * role-hint="mock" + */ +public class MockConfiguration + implements ArchivaConfiguration +{ + private Configuration configuration = new Configuration(); + + private Set registryListeners = new HashSet(); + private Set configListeners = new HashSet(); + + private MockControl registryControl; + + private Registry registryMock; + + public MockConfiguration() + { + registryControl = MockControl.createNiceControl( Registry.class ); + registryMock = (Registry) registryControl.getMock(); + } + + public void addChangeListener( RegistryListener listener ) + { + registryListeners.add( listener ); + } + + public Configuration getConfiguration() + { + return configuration; + } + + public void save( Configuration configuration ) + throws RegistryException + { + /* do nothing */ + } + + public void triggerChange( String name, String value ) + { + for(RegistryListener listener: registryListeners) + { + try + { + listener.afterConfigurationChange( registryMock, name, value ); + } + catch ( Exception e ) + { + e.printStackTrace(); + } + } + } + + public void addListener( ConfigurationListener listener ) + { + configListeners.add(listener); + } + + public void removeListener( ConfigurationListener listener ) + { + configListeners.remove( listener ); + } + + public boolean isDefaulted() + { + return false; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/RepositoryURLTest.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/RepositoryURLTest.java new file mode 100644 index 000000000..6248f2d18 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/RepositoryURLTest.java @@ -0,0 +1,92 @@ +package org.apache.maven.archiva.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. + */ + + +import org.apache.maven.archiva.model.RepositoryURL; + +import java.net.MalformedURLException; + +import junit.framework.TestCase; + +/** + * RepositoryURLTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class RepositoryURLTest + extends TestCase +{ + private void assertURL( String actualURL, String protocol, String username, String password, String hostname, + String port, String path ) + { + RepositoryURL url = new RepositoryURL( actualURL ); + + assertEquals( protocol, url.getProtocol() ); + assertEquals( username, url.getUsername() ); + assertEquals( password, url.getPassword() ); + assertEquals( hostname, url.getHost() ); + assertEquals( port, url.getPort() ); + assertEquals( path, url.getPath() ); + } + + public void testProtocolHttp() + throws MalformedURLException + { + assertURL( "http://localhost/path/to/resource.txt", "http", null, null, "localhost", null, + "/path/to/resource.txt" ); + } + + public void testProtocolWagonWebdav() + throws MalformedURLException + { + assertURL( "dav:http://localhost/path/to/resource.txt", "dav:http", null, null, "localhost", null, + "/path/to/resource.txt" ); + } + + public void testProtocolHttpWithPort() + throws MalformedURLException + { + assertURL( "http://localhost:9090/path/to/resource.txt", "http", null, null, "localhost", "9090", + "/path/to/resource.txt" ); + } + + public void testProtocolHttpWithUsername() + throws MalformedURLException + { + assertURL( "http://user@localhost/path/to/resource.txt", "http", "user", null, "localhost", null, + "/path/to/resource.txt" ); + } + + public void testProtocolHttpWithUsernamePassword() + throws MalformedURLException + { + assertURL( "http://user:pass@localhost/path/to/resource.txt", "http", "user", "pass", "localhost", null, + "/path/to/resource.txt" ); + } + + public void testProtocolHttpWithUsernamePasswordPort() + throws MalformedURLException + { + assertURL( "http://user:pass@localhost:9090/path/to/resource.txt", "http", "user", "pass", "localhost", "9090", + "/path/to/resource.txt" ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/AbstractDefaultRepositoryContentTestCase.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/AbstractDefaultRepositoryContentTestCase.java new file mode 100644 index 000000000..88020521e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/AbstractDefaultRepositoryContentTestCase.java @@ -0,0 +1,452 @@ +package org.apache.maven.archiva.repository.content; + +/* + * 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.maven.archiva.model.ArtifactReference; +import org.apache.maven.archiva.repository.AbstractRepositoryLayerTestCase; +import org.apache.maven.archiva.repository.layout.LayoutException; + +/** + * AbstractDefaultRepositoryContentTestCase + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public abstract class AbstractDefaultRepositoryContentTestCase + extends AbstractRepositoryLayerTestCase +{ + public void testBadPathMissingType() + { + assertBadPath( "invalid/invalid/1/invalid-1", "missing type" ); + } + + public void testBadPathReleaseInSnapshotDir() + { + assertBadPath( "invalid/invalid/1.0-SNAPSHOT/invalid-1.0.jar", "non snapshot artifact inside of a snapshot dir" ); + } + + public void testBadPathTimestampedSnapshotNotInSnapshotDir() + { + assertBadPath( "invalid/invalid/1.0-20050611.123456-1/invalid-1.0-20050611.123456-1.jar", + "Timestamped Snapshot artifact not inside of an Snapshot dir" ); + } + + public void testBadPathTooShort() + { + assertBadPath( "invalid/invalid-1.0.jar", "path is too short" ); + } + + public void testBadPathVersionMismatchA() + { + assertBadPath( "invalid/invalid/1.0/invalid-2.0.jar", "version mismatch between path and artifact" ); + } + + public void testBadPathVersionMismatchB() + { + assertBadPath( "invalid/invalid/1.0/invalid-1.0b.jar", "version mismatch between path and artifact" ); + } + + public void testBadPathWrongArtifactId() + { + assertBadPath( "org/apache/maven/test/1.0-SNAPSHOT/wrong-artifactId-1.0-20050611.112233-1.jar", + "wrong artifact id" ); + } + + /** + * [MRM-432] Oddball version spec. + * Example of an oddball / unusual version spec. + * @throws LayoutException + */ + public void testGoodButOddVersionSpecGanymedSsh2() + throws LayoutException + { + String groupId = "ch.ethz.ganymed"; + String artifactId = "ganymed-ssh2"; + String version = "build210"; + String classifier = null; + String type = "jar"; + String path = "ch/ethz/ganymed/ganymed-ssh2/build210/ganymed-ssh2-build210.jar"; + + assertLayout( path, groupId, artifactId, version, classifier, type ); + } + + /** + * [MRM-432] Oddball version spec. + * Example of an oddball / unusual version spec. + * @throws LayoutException + */ + public void testGoodButOddVersionSpecJavaxComm() + throws LayoutException + { + String groupId = "javax"; + String artifactId = "comm"; + String version = "3.0-u1"; + String classifier = null; + String type = "jar"; + String path = "javax/comm/3.0-u1/comm-3.0-u1.jar"; + + assertLayout( path, groupId, artifactId, version, classifier, type ); + } + + /** + * Test the ejb-client type spec. + * Type specs are not a 1 to 1 map to the extension. + * This tests that effect. + * @throws LayoutException + */ + /* TODO: Re-enabled in the future. + public void testGoodFooEjbClient() + throws LayoutException + { + String groupId = "com.foo"; + String artifactId = "foo-client"; + String version = "1.0"; + String classifier = null; + String type = "ejb-client"; // oddball type-spec (should result in jar extension) + String path = "com/foo/foo-client/1.0/foo-client-1.0.jar"; + + assertLayout( path, groupId, artifactId, version, classifier, type ); + } + */ + + /** + * [MRM-432] Oddball version spec. + * Example of an oddball / unusual version spec. + * @throws LayoutException + */ + public void testGoodButOddVersionSpecJavaxPersistence() + throws LayoutException + { + String groupId = "javax.persistence"; + String artifactId = "ejb"; + String version = "3.0-public_review"; + String classifier = null; + String type = "jar"; + String path = "javax/persistence/ejb/3.0-public_review/ejb-3.0-public_review.jar"; + + /* + * The version id of "public_review" can cause problems. is it part of + * the version spec? or the classifier? + * Since the path spec below shows it in the path, then it is really + * part of the version spec. + */ + + assertLayout( path, groupId, artifactId, version, classifier, type ); + } + + public void testGoodComFooTool() + throws LayoutException + { + String groupId = "com.foo"; + String artifactId = "foo-tool"; + String version = "1.0"; + String classifier = null; + String type = "jar"; + String path = "com/foo/foo-tool/1.0/foo-tool-1.0.jar"; + + assertLayout( path, groupId, artifactId, version, classifier, type ); + } + + public void testGoodCommonsLang() + throws LayoutException + { + String groupId = "commons-lang"; + String artifactId = "commons-lang"; + String version = "2.1"; + String classifier = null; + String type = "jar"; + String path = "commons-lang/commons-lang/2.1/commons-lang-2.1.jar"; + + assertLayout( path, groupId, artifactId, version, classifier, type ); + } + + /** + * [MRM-486] Can not deploy artifact test.maven-arch:test-arch due to "No ArtifactID Detected" + */ + public void testGoodDashedArtifactId() + throws LayoutException + { + String groupId = "test.maven-arch"; + String artifactId = "test-arch"; + String version = "2.0.3-SNAPSHOT"; + String classifier = null; + String type = "pom"; + String path = "test/maven-arch/test-arch/2.0.3-SNAPSHOT/test-arch-2.0.3-SNAPSHOT.pom"; + + assertLayout( path, groupId, artifactId, version, classifier, type ); + } + + /** + * It may seem odd, but this is a valid artifact. + */ + public void testGoodDotNotationArtifactId() + throws LayoutException + { + String groupId = "com.company.department"; + String artifactId = "com.company.department"; + String version = "0.2"; + String classifier = null; + String type = "pom"; + String path = "com/company/department/com.company.department/0.2/com.company.department-0.2.pom"; + + assertLayout( path, groupId, artifactId, version, classifier, type ); + } + + /** + * It may seem odd, but this is a valid artifact. + */ + public void testGoodDotNotationSameGroupIdAndArtifactId() + throws LayoutException + { + String groupId = "com.company.department"; + String artifactId = "com.company.department.project"; + String version = "0.3"; + String classifier = null; + String type = "pom"; + String path = "com/company/department/com.company.department.project/0.3/com.company.department.project-0.3.pom"; + + assertLayout( path, groupId, artifactId, version, classifier, type ); + } + + /** + * Test the classifier, and java-source type spec. + * @throws LayoutException + */ + public void testGoodFooLibSources() + throws LayoutException + { + String groupId = "com.foo.lib"; + String artifactId = "foo-lib"; + String version = "2.1-alpha-1"; + String classifier = "sources"; + String type = "java-source"; // oddball type-spec (should result in jar extension) + String path = "com/foo/lib/foo-lib/2.1-alpha-1/foo-lib-2.1-alpha-1-sources.jar"; + + assertLayout( path, groupId, artifactId, version, classifier, type ); + } + + /** + * A timestamped versioned artifact, should reside in a SNAPSHOT baseversion directory. + * @throws LayoutException + */ + public void testGoodSnapshotMavenTest() + throws LayoutException + { + String groupId = "org.apache.archiva.test"; + String artifactId = "redonkulous"; + String version = "3.1-beta-1-20050831.101112-42"; + String classifier = null; + String type = "jar"; + String path = "org/apache/archiva/test/redonkulous/3.1-beta-1-SNAPSHOT/redonkulous-3.1-beta-1-20050831.101112-42.jar"; + + assertLayout( path, groupId, artifactId, version, classifier, type ); + } + + /** + * [MRM-519] version identifiers within filename cause misidentification of version. + * Example uses "test" in artifact Id, which is also part of the versionKeyword list. + */ + public void testGoodVersionKeywordInArtifactId() + throws LayoutException + { + String groupId = "maven"; + String artifactId = "maven-test-plugin"; + String version = "1.8.2"; + String classifier = null; + String type = "pom"; + String path = "maven/maven-test-plugin/1.8.2/maven-test-plugin-1.8.2.pom"; + + assertLayout( path, groupId, artifactId, version, classifier, type ); + } + + /** + * [MRM-562] Artifact type "maven-plugin" is not detected correctly in .toArtifactReference() methods. + * Example uses "test" in artifact Id, which is also part of the versionKeyword list. + */ + public void testGoodDetectMavenTestPlugin() + throws LayoutException + { + String groupId = "maven"; + String artifactId = "maven-test-plugin"; + String version = "1.8.2"; + String classifier = null; + String type = "maven-plugin"; + String path = "maven/maven-test-plugin/1.8.2/maven-test-plugin-1.8.2.jar"; + + assertLayout( path, groupId, artifactId, version, classifier, type ); + } + + /** + * [MRM-562] Artifact type "maven-plugin" is not detected correctly in .toArtifactReference() methods. + */ + public void testGoodDetectCoberturaMavenPlugin() + throws LayoutException + { + String groupId = "org.codehaus.mojo"; + String artifactId = "cobertura-maven-plugin"; + String version = "2.1"; + String classifier = null; + String type = "maven-plugin"; + String path = "org/codehaus/mojo/cobertura-maven-plugin/2.1/cobertura-maven-plugin-2.1.jar"; + + assertLayout( path, groupId, artifactId, version, classifier, type ); + } + + public void testToArtifactOnEmptyPath() + { + try + { + toArtifactReference( "" ); + fail( "Should have failed due to empty path." ); + } + catch ( LayoutException e ) + { + /* expected path */ + } + } + + public void testToArtifactOnNullPath() + { + try + { + toArtifactReference( null ); + fail( "Should have failed due to null path." ); + } + catch ( LayoutException e ) + { + /* expected path */ + } + } + + public void testToArtifactReferenceOnEmptyPath() + { + try + { + toArtifactReference( "" ); + fail( "Should have failed due to empty path." ); + } + catch ( LayoutException e ) + { + /* expected path */ + } + } + + public void testToArtifactReferenceOnNullPath() + { + try + { + toArtifactReference( null ); + fail( "Should have failed due to null path." ); + } + catch ( LayoutException e ) + { + /* expected path */ + } + } + + public void testToPathOnNullArtifactReference() + + { + try + { + ArtifactReference reference = null; + toPath( reference ); + fail( "Should have failed due to null artifact reference." ); + } + catch ( IllegalArgumentException e ) + { + /* expected path */ + } + } + + private void assertArtifactReference( ArtifactReference actualReference, String groupId, String artifactId, + String version, String classifier, String type ) + { + String expectedId = "ArtifactReference - " + groupId + ":" + artifactId + ":" + version + ":" + classifier + + ":" + type; + + assertNotNull( expectedId + " - Should not be null.", actualReference ); + + assertEquals( expectedId + " - Group ID", groupId, actualReference.getGroupId() ); + assertEquals( expectedId + " - Artifact ID", artifactId, actualReference.getArtifactId() ); + if ( StringUtils.isNotBlank( classifier ) ) + { + assertEquals( expectedId + " - Classifier", classifier, actualReference.getClassifier() ); + } + assertEquals( expectedId + " - Version ID", version, actualReference.getVersion() ); + assertEquals( expectedId + " - Type", type, actualReference.getType() ); + } + + private void assertBadPath( String path, String reason ) + { + try + { + toArtifactReference( path ); + fail( "Should have thrown a LayoutException on the invalid path [" + path + "] because of [" + reason + "]" ); + } + catch ( LayoutException e ) + { + /* expected path */ + } + } + + /** + * Perform a roundtrip through the layout routines to determine success. + */ + private void assertLayout( String path, String groupId, String artifactId, String version, String classifier, + String type ) + throws LayoutException + { + ArtifactReference expectedArtifact = createArtifact( groupId, artifactId, version, classifier, type ); + + // --- Artifact Tests. + + // Artifact to Path + assertEquals( "Artifact <" + expectedArtifact + "> to path:", path, toPath( expectedArtifact ) ); + + // --- Artifact Reference Tests + + // Path to Artifact Reference. + ArtifactReference testReference = toArtifactReference( path ); + assertArtifactReference( testReference, groupId, artifactId, version, classifier, type ); + + // And back again, using test Reference from previous step. + assertEquals( "Artifact <" + expectedArtifact + "> to path:", path, toPath( testReference ) ); + } + + private ArtifactReference createArtifact( String groupId, String artifactId, String version, String classifier, + String type ) + { + ArtifactReference artifact = new ArtifactReference(); + artifact.setGroupId( groupId ); + artifact.setArtifactId( artifactId ); + artifact.setVersion( version ); + artifact.setClassifier( classifier ); + artifact.setType( type ); + assertNotNull( artifact ); + return artifact; + } + + protected abstract ArtifactReference toArtifactReference( String path ) + throws LayoutException; + + protected abstract String toPath( ArtifactReference reference ); +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/AbstractLegacyRepositoryContentTestCase.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/AbstractLegacyRepositoryContentTestCase.java new file mode 100644 index 000000000..4fddac331 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/AbstractLegacyRepositoryContentTestCase.java @@ -0,0 +1,409 @@ +package org.apache.maven.archiva.repository.content; + +/* + * 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.archiva.model.ArtifactReference; +import org.apache.maven.archiva.repository.AbstractRepositoryLayerTestCase; +import org.apache.maven.archiva.repository.layout.LayoutException; + +/** + * AbstractLegacyRepositoryContentTestCase + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public abstract class AbstractLegacyRepositoryContentTestCase + extends AbstractRepositoryLayerTestCase +{ + public void testBadPathArtifactIdMissingA() + { + assertBadPath( "groupId/jars/-1.0.jar", "artifactId is missing" ); + } + + public void testBadPathArtifactIdMissingB() + { + assertBadPath( "groupId/jars/1.0.jar", "artifactId is missing" ); + } + + public void testBadPathMissingType() + { + assertBadPath( "invalid/invalid/1/invalid-1", "missing type" ); + } + + public void testBadPathTooShort() + { + // NEW + assertBadPath( "invalid/invalid-1.0.jar", "path is too short" ); + } + + public void testBadPathWrongPackageExtension() + { + assertBadPath( "org.apache.maven.test/jars/artifactId-1.0.war", "wrong package extension" ); + } + + /** + * [MRM-432] Oddball version spec. + * Example of an oddball / unusual version spec. + * @throws LayoutException + */ + public void testGoodButOddVersionSpecGanymedSsh2() + throws LayoutException + { + String groupId = "ch.ethz.ganymed"; + String artifactId = "ganymed-ssh2"; + String version = "build210"; + String type = "jar"; + String path = "ch.ethz.ganymed/jars/ganymed-ssh2-build210.jar"; + + assertLayout( path, groupId, artifactId, version, null, type ); + } + + /** + * [MRM-432] Oddball version spec. + * Example of an oddball / unusual version spec. + * @throws LayoutException + */ + public void testGoodButOddVersionSpecJavaxComm() + throws LayoutException + { + String groupId = "javax"; + String artifactId = "comm"; + String version = "3.0-u1"; + String type = "jar"; + String path = "javax/jars/comm-3.0-u1.jar"; + + assertLayout( path, groupId, artifactId, version, null, type ); + } + + /** + * [MRM-432] Oddball version spec. + * Example of an oddball / unusual version spec. + * @throws LayoutException + */ + public void testGoodButOddVersionSpecJavaxPersistence() + throws LayoutException + { + String groupId = "javax.persistence"; + String artifactId = "ejb"; + String version = "3.0-public_review"; + String type = "jar"; + String path = "javax.persistence/jars/ejb-3.0-public_review.jar"; + + /* + * The version id of "public_review" can cause problems. is it part of + * the version spec? or the classifier? + */ + + assertLayout( path, groupId, artifactId, version, null, type ); + } + + public void testGoodCommonsLang() + throws LayoutException + { + String groupId = "commons-lang"; + String artifactId = "commons-lang"; + String version = "2.1"; + String type = "jar"; + String path = "commons-lang/jars/commons-lang-2.1.jar"; + + assertLayout( path, groupId, artifactId, version, null, type ); + } + + public void testGoodDerby() + throws LayoutException + { + String groupId = "org.apache.derby"; + String artifactId = "derby"; + String version = "10.2.2.0"; + String type = "jar"; + String path = "org.apache.derby/jars/derby-10.2.2.0.jar"; + + assertLayout( path, groupId, artifactId, version, null, type ); + } + + /** + * Test the ejb-client type spec. + * Type specs are not a 1 to 1 map to the extension. + * This tests that effect. + * @throws LayoutException + */ + /* TODO: Re-enabled in the future. + public void testGoodFooEjbClient() + throws LayoutException + { + String groupId = "com.foo"; + String artifactId = "foo-client"; + String version = "1.0"; + String type = "ejb"; // oddball type-spec (should result in jar extension) + String path = "com.foo/ejbs/foo-client-1.0.jar"; + + assertLayout( path, groupId, artifactId, version, classifier, type ); + } + */ + + /** + * Test the classifier. + * @throws LayoutException + */ + public void testGoodFooLibJavadoc() + throws LayoutException + { + String groupId = "com.foo.lib"; + String artifactId = "foo-lib"; + String version = "2.1-alpha-1"; + String type = "javadoc"; + String classifier = "javadoc"; + String path = "com.foo.lib/javadoc.jars/foo-lib-2.1-alpha-1-javadoc.jar"; + + assertLayout( path, groupId, artifactId, version, classifier, type ); + } + + /** + * Test the classifier, and java-source type spec. + * @throws LayoutException + */ + public void testGoodFooLibSources() + throws LayoutException + { + String groupId = "com.foo.lib"; + String artifactId = "foo-lib"; + String version = "2.1-alpha-1"; + String type = "java-source"; // oddball type-spec (should result in jar extension) + String classifier = "sources"; + String path = "com.foo.lib/java-sources/foo-lib-2.1-alpha-1-sources.jar"; + + assertLayout( path, groupId, artifactId, version, classifier, type ); + } + + public void testGoodFooTool() + throws LayoutException + { + String groupId = "com.foo"; + String artifactId = "foo-tool"; + String version = "1.0"; + String type = "jar"; + String path = "com.foo/jars/foo-tool-1.0.jar"; + + assertLayout( path, groupId, artifactId, version, null, type ); + } + + public void testGoodGeronimoEjbSpec() + throws LayoutException + { + String groupId = "org.apache.geronimo.specs"; + String artifactId = "geronimo-ejb_2.1_spec"; + String version = "1.0.1"; + String type = "jar"; + String path = "org.apache.geronimo.specs/jars/geronimo-ejb_2.1_spec-1.0.1.jar"; + + assertLayout( path, groupId, artifactId, version, null, type ); + } + + public void testGoodLdapClientsPom() + throws LayoutException + { + String groupId = "directory-clients"; + String artifactId = "ldap-clients"; + String version = "0.9.1-SNAPSHOT"; + String type = "pom"; + String path = "directory-clients/poms/ldap-clients-0.9.1-SNAPSHOT.pom"; + + assertLayout( path, groupId, artifactId, version, null, type ); + } + + /** + * A timestamped versioned artifact, should reside in a SNAPSHOT baseversion directory. + * @throws LayoutException + */ + public void testGoodSnapshotMavenTest() + throws LayoutException + { + String groupId = "org.apache.archiva.test"; + String artifactId = "redonkulous"; + String version = "3.1-beta-1-20050831.101112-42"; + String type = "jar"; + String path = "org.apache.archiva.test/jars/redonkulous-3.1-beta-1-20050831.101112-42.jar"; + + assertLayout( path, groupId, artifactId, version, null, type ); + } + + /** + * [MRM-519] version identifiers within filename cause misidentification of version. + * Example uses "test" in artifact Id, which is also part of the versionKeyword list. + */ + public void testGoodVersionKeywordInArtifactId() + throws LayoutException + { + String groupId = "maven"; + String artifactId = "maven-test-plugin"; + String version = "1.8.2"; + String type = "pom"; + + String path = "maven/poms/maven-test-plugin-1.8.2.pom"; + + assertLayout( path, groupId, artifactId, version, null, type ); + } + + /** + * [MRM-562] Artifact type "maven-plugin" is not detected correctly in .toArtifactReference() methods. + * Example uses "test" in artifact Id, which is also part of the versionKeyword list. + */ + public void testGoodDetectPluginMavenTest() + throws LayoutException + { + String groupId = "maven"; + String artifactId = "maven-test-plugin"; + String version = "1.8.2"; + String type = "maven-one-plugin"; + String path = "maven/plugins/maven-test-plugin-1.8.2.jar"; + + assertLayout( path, groupId, artifactId, version, null, type ); + } + + /** + * [MRM-562] Artifact type "maven-plugin" is not detected correctly in .toArtifactReference() methods. + */ + public void testGoodDetectPluginAvalonMeta() + throws LayoutException + { + String groupId = "avalon-meta"; + String artifactId = "avalon-meta-plugin"; + String version = "1.1"; + String type = "maven-one-plugin"; + String path = "avalon-meta/plugins/avalon-meta-plugin-1.1.jar"; + + assertLayout( path, groupId, artifactId, version, null, type ); + } + + /** + * [MRM-562] Artifact type "maven-plugin" is not detected correctly in .toArtifactReference() methods. + */ + public void testGoodDetectPluginCactusMaven() + throws LayoutException + { + String groupId = "cactus"; + String artifactId = "cactus-maven"; + String version = "1.7dev-20040815"; + String type = "maven-one-plugin"; + String path = "cactus/plugins/cactus-maven-1.7dev-20040815.jar"; + + assertLayout( path, groupId, artifactId, version, null, type ); + } + + /** + * [MRM-562] Artifact type "maven-plugin" is not detected correctly in .toArtifactReference() methods. + */ + public void testGoodDetectPluginGeronimoPackaging() + throws LayoutException + { + String groupId = "geronimo"; + String artifactId = "geronimo-packaging-plugin"; + String version = "1.0.1"; + String type = "maven-one-plugin"; + String path = "geronimo/plugins/geronimo-packaging-plugin-1.0.1.jar"; + + assertLayout( path, groupId, artifactId, version, null, type ); + } + + /** + * [MRM-768] Artifact type "maven-plugin" does not distinguish maven1 and maven2 plugins. + * This produces conflicts when m2 plugins are stored in legacy-layout repository + */ + public void testMaven1Maven2PluginTypeDistinc() + throws Exception + { + String groupId = "com.sun.tools.xjc.maven2"; + String artifactId = "maven-jaxb-plugin"; + String version = "1.1"; + String type = "maven-plugin"; + String path = "com.sun.tools.xjc.maven2/maven-plugins/maven-jaxb-plugin-1.1.jar"; + + assertLayout( path, groupId, artifactId, version, null, type ); + } + + /** + * Perform a roundtrip through the layout routines to determine success. + * @param classifier TODO + */ + private void assertLayout( String path, String groupId, String artifactId, String version, String classifier, String type ) + throws LayoutException + { + ArtifactReference expectedArtifact = createArtifact( groupId, artifactId, version, classifier, type ); + + // --- Artifact Tests. + // Artifact to Path + assertEquals( "Artifact <" + expectedArtifact + "> to path:", path, toPath( expectedArtifact ) ); + + // --- Artifact Reference Tests + + // Path to Artifact Reference. + ArtifactReference testReference = toArtifactReference( path ); + assertArtifactReference( testReference, groupId, artifactId, version, classifier, type ); + + // And back again, using test Reference from previous step. + assertEquals( "Artifact <" + expectedArtifact + "> to path:", path, toPath( testReference ) ); + } + + private void assertArtifactReference( ArtifactReference actualReference, String groupId, String artifactId, + String version, String classifier, String type ) + { + String expectedId = "ArtifactReference - " + groupId + ":" + artifactId + ":" + version + ":" + type; + + assertNotNull( expectedId + " - Should not be null.", actualReference ); + + assertEquals( expectedId + " - Group ID", groupId, actualReference.getGroupId() ); + assertEquals( expectedId + " - Artifact ID", artifactId, actualReference.getArtifactId() ); + assertEquals( expectedId + " - Version ID", version, actualReference.getVersion() ); + assertEquals( expectedId + " - classifier", classifier, actualReference.getClassifier() ); + assertEquals( expectedId + " - Type", type, actualReference.getType() ); + } + + protected ArtifactReference createArtifact( String groupId, String artifactId, String version, String classifier, String type ) + { + ArtifactReference artifact = new ArtifactReference(); + artifact.setGroupId( groupId ); + artifact.setArtifactId( artifactId ); + artifact.setVersion( version ); + artifact.setClassifier( classifier ); + artifact.setType( type ); + assertNotNull( artifact ); + return artifact; + } + + private void assertBadPath( String path, String reason ) + { + try + { + toArtifactReference( path ); + fail( "Should have thrown a LayoutException on the invalid path [" + path + "] because of [" + reason + "]" ); + } + catch ( LayoutException e ) + { + /* expected path */ + } + } + + + protected abstract ArtifactReference toArtifactReference( String path ) + throws LayoutException; + + protected abstract String toPath( ArtifactReference reference ); + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/ArtifactExtensionMappingTest.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/ArtifactExtensionMappingTest.java new file mode 100644 index 000000000..7390728f7 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/ArtifactExtensionMappingTest.java @@ -0,0 +1,58 @@ +package org.apache.maven.archiva.repository.content; + +/* + * 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.archiva.repository.AbstractRepositoryLayerTestCase; + +/** + * ArtifactExtensionMappingTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ArtifactExtensionMappingTest +extends AbstractRepositoryLayerTestCase +{ + public void testIsMavenPlugin() + { + assertMavenPlugin( "maven-test-plugin" ); + assertMavenPlugin( "maven-clean-plugin" ); + assertMavenPlugin( "cobertura-maven-plugin" ); + assertMavenPlugin( "maven-project-info-reports-plugin" ); + assertMavenPlugin( "silly-name-for-a-maven-plugin" ); + + assertNotMavenPlugin( "maven-plugin-api" ); + assertNotMavenPlugin( "foo-lib" ); + assertNotMavenPlugin( "another-maven-plugin-api" ); + assertNotMavenPlugin( "secret-maven-plugin-2" ); + } + + private void assertMavenPlugin( String artifactId ) + { + assertTrue( "Should be detected as maven plugin: <" + artifactId + ">", + ArtifactExtensionMapping.isMavenPlugin( artifactId ) ); + } + + private void assertNotMavenPlugin( String artifactId ) + { + assertFalse( "Should NOT be detected as maven plugin: <" + artifactId + ">", + ArtifactExtensionMapping.isMavenPlugin( artifactId ) ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/DefaultPathParserTest.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/DefaultPathParserTest.java new file mode 100644 index 000000000..6da1ce21e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/DefaultPathParserTest.java @@ -0,0 +1,459 @@ +package org.apache.maven.archiva.repository.content; + +/* + * 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.maven.archiva.model.ArtifactReference; +import org.apache.maven.archiva.repository.AbstractRepositoryLayerTestCase; +import org.apache.maven.archiva.repository.layout.LayoutException; + +/** + * DefaultPathParserTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class DefaultPathParserTest + extends AbstractRepositoryLayerTestCase +{ + private PathParser parser = new DefaultPathParser(); + + public void testBadPathMissingType() + { + assertBadPath( "invalid/invalid/1/invalid-1", "missing type" ); + } + + public void testBadPathReleaseInSnapshotDir() + { + assertBadPath( "invalid/invalid/1.0-SNAPSHOT/invalid-1.0.jar", "non snapshot artifact inside of a snapshot dir" ); + } + + public void testBadPathTimestampedSnapshotNotInSnapshotDir() + { + assertBadPath( "invalid/invalid/1.0-20050611.123456-1/invalid-1.0-20050611.123456-1.jar", + "Timestamped Snapshot artifact not inside of an Snapshot dir" ); + } + + public void testBadPathTooShort() + { + assertBadPath( "invalid/invalid-1.0.jar", "path is too short" ); + } + + public void testBadPathVersionMismatchA() + { + assertBadPath( "invalid/invalid/1.0/invalid-2.0.jar", "version mismatch between path and artifact" ); + } + + public void testBadPathVersionMismatchB() + { + assertBadPath( "invalid/invalid/1.0/invalid-1.0b.jar", "version mismatch between path and artifact" ); + } + + public void testBadPathWrongArtifactId() + { + assertBadPath( "org/apache/maven/test/1.0-SNAPSHOT/wrong-artifactId-1.0-20050611.112233-1.jar", + "wrong artifact id" ); + } + + /** + * [MRM-481] Artifact requests with a .xml.zip extension fail with a 404 Error + */ + public void testGoodButDualExtensions() + throws LayoutException + { + String groupId = "org.project"; + String artifactId = "example-presentation"; + String version = "3.2"; + String classifier = null; + String type = "xml.zip"; + String path = "org/project/example-presentation/3.2/example-presentation-3.2.xml.zip"; + + assertLayout( path, groupId, artifactId, version, classifier, type ); + } + + /** + * [MRM-432] Oddball version spec. + * Example of an oddball / unusual version spec. + * @throws LayoutException + */ + public void testGoodButOddVersionSpecGanymedSsh2() + throws LayoutException + { + String groupId = "ch.ethz.ganymed"; + String artifactId = "ganymed-ssh2"; + String version = "build210"; + String classifier = null; + String type = "jar"; + String path = "ch/ethz/ganymed/ganymed-ssh2/build210/ganymed-ssh2-build210.jar"; + + assertLayout( path, groupId, artifactId, version, classifier, type ); + } + + /** + * [MRM-432] Oddball version spec. + * Example of an oddball / unusual version spec. + * @throws LayoutException + */ + public void testGoodButOddVersionSpecJavaxComm() + throws LayoutException + { + String groupId = "javax"; + String artifactId = "comm"; + String version = "3.0-u1"; + String classifier = null; + String type = "jar"; + String path = "javax/comm/3.0-u1/comm-3.0-u1.jar"; + + assertLayout( path, groupId, artifactId, version, classifier, type ); + } + + /** + * Test the ejb-client type spec. + * Type specs are not a 1 to 1 map to the extension. + * This tests that effect. + * @throws LayoutException + */ + /* TODO: Re-enabled in the future. + public void testGoodFooEjbClient() + throws LayoutException + { + String groupId = "com.foo"; + String artifactId = "foo-client"; + String version = "1.0"; + String classifier = null; + String type = "ejb-client"; // oddball type-spec (should result in jar extension) + String path = "com/foo/foo-client/1.0/foo-client-1.0.jar"; + + assertLayout( path, groupId, artifactId, version, classifier, type ); + } + */ + + /** + * [MRM-432] Oddball version spec. + * Example of an oddball / unusual version spec. + * @throws LayoutException + */ + public void testGoodButOddVersionSpecJavaxPersistence() + throws LayoutException + { + String groupId = "javax.persistence"; + String artifactId = "ejb"; + String version = "3.0-public_review"; + String classifier = null; + String type = "jar"; + String path = "javax/persistence/ejb/3.0-public_review/ejb-3.0-public_review.jar"; + + /* + * The version id of "public_review" can cause problems. is it part of + * the version spec? or the classifier? + * Since the path spec below shows it in the path, then it is really + * part of the version spec. + */ + + assertLayout( path, groupId, artifactId, version, classifier, type ); + } + + public void testGoodComFooTool() + throws LayoutException + { + String groupId = "com.foo"; + String artifactId = "foo-tool"; + String version = "1.0"; + String classifier = null; + String type = "jar"; + String path = "com/foo/foo-tool/1.0/foo-tool-1.0.jar"; + + assertLayout( path, groupId, artifactId, version, classifier, type ); + } + + public void testGoodCommonsLang() + throws LayoutException + { + String groupId = "commons-lang"; + String artifactId = "commons-lang"; + String version = "2.1"; + String classifier = null; + String type = "jar"; + String path = "commons-lang/commons-lang/2.1/commons-lang-2.1.jar"; + + assertLayout( path, groupId, artifactId, version, classifier, type ); + } + + /** + * [MRM-486] Can not deploy artifact test.maven-arch:test-arch due to "No ArtifactID Detected" + */ + public void testGoodDashedArtifactId() + throws LayoutException + { + String groupId = "test.maven-arch"; + String artifactId = "test-arch"; + String version = "2.0.3-SNAPSHOT"; + String classifier = null; + String type = "pom"; + String path = "test/maven-arch/test-arch/2.0.3-SNAPSHOT/test-arch-2.0.3-SNAPSHOT.pom"; + + assertLayout( path, groupId, artifactId, version, classifier, type ); + } + + /** + * It may seem odd, but this is a valid artifact. + */ + public void testGoodDotNotationArtifactId() + throws LayoutException + { + String groupId = "com.company.department"; + String artifactId = "com.company.department"; + String version = "0.2"; + String classifier = null; + String type = "pom"; + String path = "com/company/department/com.company.department/0.2/com.company.department-0.2.pom"; + + assertLayout( path, groupId, artifactId, version, classifier, type ); + } + + /** + * It may seem odd, but this is a valid artifact. + */ + public void testGoodDotNotationSameGroupIdAndArtifactId() + throws LayoutException + { + String groupId = "com.company.department"; + String artifactId = "com.company.department.project"; + String version = "0.3"; + String classifier = null; + String type = "pom"; + String path = "com/company/department/com.company.department.project/0.3/com.company.department.project-0.3.pom"; + + assertLayout( path, groupId, artifactId, version, classifier, type ); + } + + /** + * Test the classifier, and java-source type spec. + * @throws LayoutException + */ + public void testGoodFooLibSources() + throws LayoutException + { + String groupId = "com.foo.lib"; + String artifactId = "foo-lib"; + String version = "2.1-alpha-1"; + String classifier = "sources"; + String type = "java-source"; // oddball type-spec (should result in jar extension) + String path = "com/foo/lib/foo-lib/2.1-alpha-1/foo-lib-2.1-alpha-1-sources.jar"; + + assertLayout( path, groupId, artifactId, version, classifier, type ); + } + + /** + * A timestamped versioned artifact, should reside in a SNAPSHOT baseversion directory. + * @throws LayoutException + */ + public void testGoodSnapshotMavenTest() + throws LayoutException + { + String groupId = "org.apache.archiva.test"; + String artifactId = "redonkulous"; + String version = "3.1-beta-1-20050831.101112-42"; + String classifier = null; + String type = "jar"; + String path = "org/apache/archiva/test/redonkulous/3.1-beta-1-SNAPSHOT/redonkulous-3.1-beta-1-20050831.101112-42.jar"; + + assertLayout( path, groupId, artifactId, version, classifier, type ); + } + + /** + * A timestamped versioned artifact, should reside in a SNAPSHOT baseversion directory. + * @throws LayoutException + */ + public void testGoodLongSnapshotMavenTest() + throws LayoutException + { + String groupId = "a.group.id"; + String artifactId = "artifact-id"; + String version = "1.0-abc-1.1-20080221.062205-9"; + String classifier = null; + String type = "pom"; + String path = "a/group/id/artifact-id/1.0-abc-1.1-SNAPSHOT/artifact-id-1.0-abc-1.1-20080221.062205-9.pom"; + + assertLayout( path, groupId, artifactId, version, classifier, type ); + } + + /** + * A timestamped versioned artifact, should reside in a SNAPSHOT baseversion directory. + * @throws LayoutException + */ + public void testClassifiedSnapshotMavenTest() + throws LayoutException + { + String groupId = "a.group.id"; + String artifactId = "artifact-id"; + String version = "1.0-20070219.171202-34"; + String classifier = "test-sources"; + String type = "jar"; + String path = "a/group/id/artifact-id/1.0-SNAPSHOT/artifact-id-1.0-20070219.171202-34-test-sources.jar"; + + assertLayout( path, groupId, artifactId, version, classifier, type ); + } + + /** + * [MRM-519] version identifiers within filename cause misidentification of version. + * Example uses "test" in artifact Id, which is also part of the versionKeyword list. + */ + public void testGoodVersionKeywordInArtifactId() + throws LayoutException + { + String groupId = "maven"; + String artifactId = "maven-test-plugin"; + String version = "1.8.2"; + String classifier = null; + String type = "pom"; + String path = "maven/maven-test-plugin/1.8.2/maven-test-plugin-1.8.2.pom"; + + assertLayout( path, groupId, artifactId, version, classifier, type ); + } + + /** + * [MRM-562] Artifact type "maven-plugin" is not detected correctly in .toArtifactReference() methods. + * Example uses "test" in artifact Id, which is also part of the versionKeyword list. + */ + public void testGoodDetectMavenTestPlugin() + throws LayoutException + { + String groupId = "maven"; + String artifactId = "maven-test-plugin"; + String version = "1.8.2"; + String classifier = null; + String type = "maven-plugin"; + String path = "maven/maven-test-plugin/1.8.2/maven-test-plugin-1.8.2.jar"; + + assertLayout( path, groupId, artifactId, version, classifier, type ); + } + + /** + * [MRM-562] Artifact type "maven-plugin" is not detected correctly in .toArtifactReference() methods. + */ + public void testGoodDetectCoberturaMavenPlugin() + throws LayoutException + { + String groupId = "org.codehaus.mojo"; + String artifactId = "cobertura-maven-plugin"; + String version = "2.1"; + String classifier = null; + String type = "maven-plugin"; + String path = "org/codehaus/mojo/cobertura-maven-plugin/2.1/cobertura-maven-plugin-2.1.jar"; + + assertLayout( path, groupId, artifactId, version, classifier, type ); + } + + public void testToArtifactOnEmptyPath() + { + try + { + parser.toArtifactReference( "" ); + fail( "Should have failed due to empty path." ); + } + catch ( LayoutException e ) + { + /* expected path */ + } + } + + public void testToArtifactOnNullPath() + { + try + { + parser.toArtifactReference( null ); + fail( "Should have failed due to null path." ); + } + catch ( LayoutException e ) + { + /* expected path */ + } + } + + public void testToArtifactReferenceOnEmptyPath() + { + try + { + parser.toArtifactReference( "" ); + fail( "Should have failed due to empty path." ); + } + catch ( LayoutException e ) + { + /* expected path */ + } + } + + public void testToArtifactReferenceOnNullPath() + { + try + { + parser.toArtifactReference( null ); + fail( "Should have failed due to null path." ); + } + catch ( LayoutException e ) + { + /* expected path */ + } + } + + /** + * Perform a path to artifact reference lookup, and verify the results. + */ + private void assertLayout( String path, String groupId, String artifactId, String version, String classifier, + String type ) + throws LayoutException + { + // Path to Artifact Reference. + ArtifactReference testReference = parser.toArtifactReference( path ); + assertArtifactReference( testReference, groupId, artifactId, version, classifier, type ); + } + + private void assertArtifactReference( ArtifactReference actualReference, String groupId, String artifactId, + String version, String classifier, String type ) + { + String expectedId = "ArtifactReference - " + groupId + ":" + artifactId + ":" + version + ":" + classifier + + ":" + type; + + assertNotNull( expectedId + " - Should not be null.", actualReference ); + + assertEquals( expectedId + " - Group ID", groupId, actualReference.getGroupId() ); + assertEquals( expectedId + " - Artifact ID", artifactId, actualReference.getArtifactId() ); + if ( StringUtils.isNotBlank( classifier ) ) + { + assertEquals( expectedId + " - Classifier", classifier, actualReference.getClassifier() ); + } + assertEquals( expectedId + " - Version ID", version, actualReference.getVersion() ); + assertEquals( expectedId + " - Type", type, actualReference.getType() ); + } + + private void assertBadPath( String path, String reason ) + { + try + { + parser.toArtifactReference( path ); + fail( "Should have thrown a LayoutException on the invalid path [" + path + "] because of [" + reason + "]" ); + } + catch ( LayoutException e ) + { + /* expected path */ + } + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/FilenameParserTest.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/FilenameParserTest.java new file mode 100644 index 000000000..9b31da631 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/FilenameParserTest.java @@ -0,0 +1,188 @@ +package org.apache.maven.archiva.repository.content; + +/* + * 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; + +/** + * FilenameParserTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class FilenameParserTest + extends TestCase +{ + public void testNameExtensionJar() + { + FilenameParser parser = new FilenameParser( "maven-test-plugin-1.8.3.jar" ); + + assertEquals( "maven-test-plugin-1.8.3", parser.getName() ); + assertEquals( "jar", parser.getExtension() ); + } + + public void testNameExtensionTarGz() + { + FilenameParser parser = new FilenameParser( "archiva-1.0-beta-2-bin.tar.gz" ); + + assertEquals( "archiva-1.0-beta-2-bin", parser.getName() ); + assertEquals( "tar.gz", parser.getExtension() ); + } + + public void testNameExtensionTarBz2() + { + FilenameParser parser = new FilenameParser( "archiva-1.0-SNAPSHOT-src.tar.bz2" ); + + assertEquals( "archiva-1.0-SNAPSHOT-src", parser.getName() ); + assertEquals( "tar.bz2", parser.getExtension() ); + } + + public void testNameExtensionCapitolizedTarGz() + { + FilenameParser parser = new FilenameParser( "ARCHIVA-1.0-BETA-2-BIN.TAR.GZ" ); + + assertEquals( "ARCHIVA-1.0-BETA-2-BIN", parser.getName() ); + assertEquals( "TAR.GZ", parser.getExtension() ); + } + + public void testNext() + { + FilenameParser parser = new FilenameParser( "maven-test-plugin-1.8.3.jar" ); + + assertEquals( "maven-test-plugin-1.8.3", parser.getName() ); + assertEquals( "jar", parser.getExtension() ); + + assertEquals( "maven", parser.next() ); + assertEquals( "test", parser.next() ); + assertEquals( "plugin", parser.next() ); + assertEquals( "1.8.3", parser.next() ); + assertNull( parser.next() ); + } + + public void testExpect() + { + FilenameParser parser = new FilenameParser( "maven-test-plugin-1.8.3.jar" ); + + assertEquals( "maven-test-plugin-1.8.3", parser.getName() ); + assertEquals( "jar", parser.getExtension() ); + + assertEquals( "maven-test-plugin", parser.expect( "maven-test-plugin" ) ); + assertEquals( "1.8.3", parser.expect( "1.8.3" ) ); + assertNull( parser.expect( "jar" ) ); + } + + public void testExpectWithRemaining() + { + FilenameParser parser = new FilenameParser( "ganymede-ssh2-build250-sources.jar" ); + + assertEquals( "ganymede-ssh2-build250-sources", parser.getName() ); + assertEquals( "jar", parser.getExtension() ); + + assertEquals( "ganymede-ssh2", parser.expect( "ganymede-ssh2" ) ); + assertEquals( "build250", parser.expect( "build250" ) ); + assertEquals( '-', parser.seperator() ); + assertEquals( "sources", parser.remaining() ); + + assertNull( parser.expect( "jar" ) ); + } + + public void testExpectWithRemainingDualExtensions() + { + FilenameParser parser = new FilenameParser( "example-presentation-3.2.xml.zip" ); + + assertEquals( "example-presentation-3.2.xml", parser.getName() ); + assertEquals( "zip", parser.getExtension() ); + + assertEquals( "example-presentation", parser.expect( "example-presentation" ) ); + assertEquals( "3.2", parser.expect( "3.2" ) ); + assertEquals( '.', parser.seperator() ); + assertEquals( "xml", parser.remaining() ); + + } + + public void testNextNonVersion() + { + FilenameParser parser = new FilenameParser( "maven-test-plugin-1.8.3.jar" ); + + assertEquals( "maven-test-plugin", parser.nextNonVersion() ); + assertEquals( "1.8.3", parser.remaining() ); + } + + public void testNextArbitraryNonVersion() + { + FilenameParser parser = new FilenameParser( "maven-jdk-1.4-plugin-1.0-20070828.123456-42.jar" ); + + assertEquals( "maven-jdk-1.4-plugin", parser.nextNonVersion() ); + assertEquals( "1.0-20070828.123456-42", parser.remaining() ); + } + + public void testNextJython() + { + FilenameParser parser = new FilenameParser( "jython-20020827-no-oro.jar" ); + + assertEquals( "jython", parser.nextNonVersion() ); + assertEquals( "20020827", parser.nextVersion() ); + assertEquals( "no-oro", parser.remaining() ); + } + + public void testLongExtension() + { + FilenameParser parser = new FilenameParser( "libfobs4jmf-0.4.1.4-20080217.211715-4.jnilib" ); + + assertEquals( "libfobs4jmf-0.4.1.4-20080217.211715-4", parser.getName() ); + assertEquals( "jnilib", parser.getExtension() ); + } + + public void testInterveningVersion() + { + FilenameParser parser = new FilenameParser( "artifact-id-1.0-abc-1.1-20080221.062205-9.pom" ); + + assertEquals( "artifact-id", parser.nextNonVersion() ); + assertEquals( "1.0-abc-1.1-20080221.062205-9", parser.expect( "1.0-abc-1.1-SNAPSHOT" ) ); + assertNull( null, parser.remaining() ); + assertEquals( "artifact-id-1.0-abc-1.1-20080221.062205-9", parser.getName() ); + assertEquals( "pom", parser.getExtension() ); + } + + public void testExpectWrongSnapshot() + { + FilenameParser parser = new FilenameParser( "artifact-id-1.0-20080221.062205-9.pom" ); + + assertEquals( "artifact-id", parser.nextNonVersion() ); + assertNull( parser.expect( "2.0-SNAPSHOT" ) ); + } + + public void testClassifier() + { + FilenameParser parser = new FilenameParser( "artifact-id-1.0-20070219.171202-34-test-sources.jar" ); + + assertEquals( "artifact-id", parser.nextNonVersion() ); + assertEquals( "1.0-20070219.171202-34", parser.nextVersion() ); + assertEquals( "test-sources", parser.remaining() ); + assertEquals( "artifact-id-1.0-20070219.171202-34-test-sources", parser.getName() ); + assertEquals( "jar", parser.getExtension() ); + } + + public void testNoExtension() + { + FilenameParser parser = new FilenameParser( "foo_bar" ); + assertNull( parser.getExtension() ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/LegacyPathParserTest.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/LegacyPathParserTest.java new file mode 100644 index 000000000..cb1d3544c --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/LegacyPathParserTest.java @@ -0,0 +1,448 @@ +package org.apache.maven.archiva.repository.content; + +/* + * 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.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.LegacyArtifactPath; +import org.apache.maven.archiva.model.ArtifactReference; +import org.apache.maven.archiva.repository.AbstractRepositoryLayerTestCase; +import org.apache.maven.archiva.repository.layout.LayoutException; + +/** + * LegacyPathParserTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class LegacyPathParserTest + extends AbstractRepositoryLayerTestCase +{ + private LegacyPathParser parser = new LegacyPathParser(); + + /** + * Configure the ArchivaConfiguration + * {@inheritDoc} + * @see org.codehaus.plexus.PlexusTestCase#setUp() + */ + protected void setUp() + throws Exception + { + super.setUp(); + ArchivaConfiguration config = (ArchivaConfiguration) lookup( ArchivaConfiguration.class ); + LegacyArtifactPath jaxen = new LegacyArtifactPath(); + jaxen.setPath( "jaxen/jars/jaxen-1.0-FCS-full.jar" ); + jaxen.setArtifact( "jaxen:jaxen:1.0-FCS:full:jar" ); + config.getConfiguration().addLegacyArtifactPath( jaxen ); + parser.configuration = config; + } + + + public void testBadPathArtifactIdMissingA() + { + assertBadPath( "groupId/jars/-1.0.jar", "artifactId is missing" ); + } + + public void testBadPathArtifactIdMissingB() + { + assertBadPath( "groupId/jars/1.0.jar", "artifactId is missing" ); + } + + public void testBadPathMissingType() + { + assertBadPath( "invalid/invalid/1/invalid-1", "missing type" ); + } + + public void testBadPathTooShort() + { + // NEW + assertBadPath( "invalid/invalid-1.0.jar", "path is too short" ); + } + + public void testBadPathWrongPackageExtension() + { + assertBadPath( "org.apache.maven.test/jars/artifactId-1.0.war", "wrong package extension" ); + } + + /** + * [MRM-481] Artifact requests with a .xml.zip extension fail with a 404 Error + */ + public void testGoodButDualExtensions() + throws LayoutException + { + String groupId = "org.project"; + String artifactId = "example-presentation"; + String version = "3.2.xml"; + String type = "distribution-zip"; + String path = "org.project/zips/example-presentation-3.2.xml.zip"; + + assertLayout( path, groupId, artifactId, version, null, type ); + } + + /** + * [MRM-432] Oddball version spec. + * Example of an oddball / unusual version spec. + * @throws LayoutException + */ + public void testGoodButOddVersionSpecGanymedSsh2() + throws LayoutException + { + String groupId = "ch.ethz.ganymed"; + String artifactId = "ganymed-ssh2"; + String version = "build210"; + String type = "jar"; + String path = "ch.ethz.ganymed/jars/ganymed-ssh2-build210.jar"; + + assertLayout( path, groupId, artifactId, version, null, type ); + } + + /** + * [MRM-432] Oddball version spec. + * Example of an oddball / unusual version spec. + * @throws LayoutException + */ + public void testGoodButOddVersionSpecJavaxComm() + throws LayoutException + { + String groupId = "javax"; + String artifactId = "comm"; + String version = "3.0-u1"; + String type = "jar"; + String path = "javax/jars/comm-3.0-u1.jar"; + + assertLayout( path, groupId, artifactId, version, null, type ); + } + + /** + * [MRM-432] Oddball version spec. + * Example of an oddball / unusual version spec. + * @throws LayoutException + */ + public void testGoodButOddVersionSpecJavaxPersistence() + throws LayoutException + { + String groupId = "javax.persistence"; + String artifactId = "ejb"; + String version = "3.0-public_review"; + String type = "jar"; + String path = "javax.persistence/jars/ejb-3.0-public_review.jar"; + + /* + * The version id of "public_review" can cause problems. is it part of + * the version spec? or the classifier? + */ + + assertLayout( path, groupId, artifactId, version, null, type ); + } + + public void testGoodCommonsLang() + throws LayoutException + { + String groupId = "commons-lang"; + String artifactId = "commons-lang"; + String version = "2.1"; + String type = "jar"; + String path = "commons-lang/jars/commons-lang-2.1.jar"; + + assertLayout( path, groupId, artifactId, version, null, type ); + } + + public void testGoodDerby() + throws LayoutException + { + String groupId = "org.apache.derby"; + String artifactId = "derby"; + String version = "10.2.2.0"; + String type = "jar"; + String path = "org.apache.derby/jars/derby-10.2.2.0.jar"; + + assertLayout( path, groupId, artifactId, version, null, type ); + } + + /** + * Test the ejb-client type spec. + * Type specs are not a 1 to 1 map to the extension. + * This tests that effect. + * @throws LayoutException + */ + /* TODO: Re-enabled in the future. + public void testGoodFooEjbClient() + throws LayoutException + { + String groupId = "com.foo"; + String artifactId = "foo-client"; + String version = "1.0"; + String type = "ejb"; // oddball type-spec (should result in jar extension) + String path = "com.foo/ejbs/foo-client-1.0.jar"; + + assertLayout( path, groupId, artifactId, version, classifier, type ); + } + */ + + /** + * Test the classifier. + * @throws LayoutException + */ + public void testGoodFooLibJavadoc() + throws LayoutException + { + String groupId = "com.foo.lib"; + String artifactId = "foo-lib"; + String version = "2.1-alpha-1"; + String type = "javadoc"; + String classifier = "javadoc"; + String path = "com.foo.lib/javadoc.jars/foo-lib-2.1-alpha-1-javadoc.jar"; + + assertLayout( path, groupId, artifactId, version, classifier, type ); + + assertLayout( "com.foo.lib/javadocs/foo-lib-2.1-alpha-1-javadoc.jar", "com.foo.lib", "foo-lib", "2.1-alpha-1", "javadoc", "javadoc" ); + } + + /** + * Test the classifier, and java-source type spec. + * @throws LayoutException + */ + public void testGoodFooLibSources() + throws LayoutException + { + String groupId = "com.foo.lib"; + String artifactId = "foo-lib"; + String version = "2.1-alpha-1"; + String type = "java-source"; // oddball type-spec (should result in jar extension) + String classifier= "sources"; + String path = "com.foo.lib/java-sources/foo-lib-2.1-alpha-1-sources.jar"; + + assertLayout( path, groupId, artifactId, version, classifier, type ); + } + + /** + * Test the classifier, and java-source type spec. + * @throws LayoutException + */ + public void testBadClassifierFooLibSources() + throws LayoutException + { + assertBadPath( "com.foo.lib/java-sources/foo-lib-2.1-alpha-1.jar", "missing required classifier" ); + assertBadPath( "com.foo.lib/java-sources/foo-lib-2.1-alpha-1-javadoc.jar", "incorrect classifier" ); + assertBadPath( "com.foo.lib/java-sources/foo-lib-2.1-alpha-1-other.jar", "incorrect classifier" ); + } + + /** + * Test the classifier, and java-source type spec. + * @throws LayoutException + */ + public void testGoodFooLibTestSources() + throws LayoutException + { + String groupId = "com.foo.lib"; + String artifactId = "foo-lib"; + String version = "2.1-alpha-1-test-sources"; + String type = "jar"; + String classifier = null; // we can't parse this type of classifier in legacy format + String path = "com.foo.lib/jars/foo-lib-2.1-alpha-1-test-sources.jar"; + + assertLayout( path, groupId, artifactId, version, classifier, type ); + } + + public void testGoodFooTool() + throws LayoutException + { + String groupId = "com.foo"; + String artifactId = "foo-tool"; + String version = "1.0"; + String type = "jar"; + String path = "com.foo/jars/foo-tool-1.0.jar"; + + assertLayout( path, groupId, artifactId, version, null, type ); + } + + public void testGoodGeronimoEjbSpec() + throws LayoutException + { + String groupId = "org.apache.geronimo.specs"; + String artifactId = "geronimo-ejb_2.1_spec"; + String version = "1.0.1"; + String type = "jar"; + String path = "org.apache.geronimo.specs/jars/geronimo-ejb_2.1_spec-1.0.1.jar"; + + assertLayout( path, groupId, artifactId, version, null, type ); + } + + public void testGoodLdapClientsPom() + throws LayoutException + { + String groupId = "directory-clients"; + String artifactId = "ldap-clients"; + String version = "0.9.1-SNAPSHOT"; + String type = "pom"; + String path = "directory-clients/poms/ldap-clients-0.9.1-SNAPSHOT.pom"; + + assertLayout( path, groupId, artifactId, version, null, type ); + } + + /** + * A timestamped versioned artifact, should reside in a SNAPSHOT baseversion directory. + * @throws LayoutException + */ + public void testGoodSnapshotMavenTest() + throws LayoutException + { + String groupId = "org.apache.archiva.test"; + String artifactId = "redonkulous"; + String version = "3.1-beta-1-20050831.101112-42"; + String type = "jar"; + String path = "org.apache.archiva.test/jars/redonkulous-3.1-beta-1-20050831.101112-42.jar"; + + assertLayout( path, groupId, artifactId, version, null, type ); + } + + /** + * [MRM-519] version identifiers within filename cause misidentification of version. + * Example uses "test" in artifact Id, which is also part of the versionKeyword list. + */ + public void testGoodVersionKeywordInArtifactId() + throws LayoutException + { + String groupId = "maven"; + String artifactId = "maven-test-plugin"; + String version = "1.8.2"; + String type = "pom"; + + String path = "maven/poms/maven-test-plugin-1.8.2.pom"; + + assertLayout( path, groupId, artifactId, version, null, type ); + } + + /** + * [MRM-562] Artifact type "maven-plugin" is not detected correctly in .toArtifactReference() methods. + * Example uses "test" in artifact Id, which is also part of the versionKeyword list. + */ + public void testGoodDetectPluginMavenTest() + throws LayoutException + { + String groupId = "maven"; + String artifactId = "maven-test-plugin"; + String version = "1.8.2"; + String type = "maven-one-plugin"; + String path = "maven/plugins/maven-test-plugin-1.8.2.jar"; + + assertLayout( path, groupId, artifactId, version, null, type ); + } + + /** + * [MRM-562] Artifact type "maven-plugin" is not detected correctly in .toArtifactReference() methods. + */ + public void testGoodDetectPluginAvalonMeta() + throws LayoutException + { + String groupId = "avalon-meta"; + String artifactId = "avalon-meta-plugin"; + String version = "1.1"; + String type = "maven-one-plugin"; + String path = "avalon-meta/plugins/avalon-meta-plugin-1.1.jar"; + + assertLayout( path, groupId, artifactId, version, null, type ); + } + + /** + * [MRM-562] Artifact type "maven-plugin" is not detected correctly in .toArtifactReference() methods. + */ + public void testGoodDetectPluginCactusMaven() + throws LayoutException + { + String groupId = "cactus"; + String artifactId = "cactus-maven"; + String version = "1.7dev-20040815"; + String type = "maven-one-plugin"; + String path = "cactus/plugins/cactus-maven-1.7dev-20040815.jar"; + + assertLayout( path, groupId, artifactId, version, null, type ); + } + + /** + * [MRM-562] Artifact type "maven-plugin" is not detected correctly in .toArtifactReference() methods. + */ + public void testGoodDetectPluginGeronimoPackaging() + throws LayoutException + { + String groupId = "geronimo"; + String artifactId = "geronimo-packaging-plugin"; + String version = "1.0.1"; + String type = "maven-one-plugin"; + String path = "geronimo/plugins/geronimo-packaging-plugin-1.0.1.jar"; + + assertLayout( path, groupId, artifactId, version, null, type ); + } + + /** + * [MRM-594] add some hook in LegacyPathParser to allow exceptions in artifact resolution + * @since 1.1 + */ + public void testCustomExceptionsInArtifactResolution() + throws LayoutException + { + String groupId = "jaxen"; + String artifactId = "jaxen"; + String version = "1.0-FCS"; + String type = "jar"; + String classifier = "full"; + String path = "jaxen/jars/jaxen-1.0-FCS-full.jar"; + + assertLayout( path, groupId, artifactId, version, classifier, type ); + } + + /** + * Perform a path to artifact reference lookup, and verify the results. + */ + private void assertLayout( String path, String groupId, String artifactId, String version, String classifier, String type ) + throws LayoutException + { + // Path to Artifact Reference. + ArtifactReference testReference = parser.toArtifactReference( path ); + assertArtifactReference( testReference, groupId, artifactId, version, classifier, type ); + } + + private void assertArtifactReference( ArtifactReference actualReference, String groupId, String artifactId, + String version, String classifier, String type ) + { + String expectedId = "ArtifactReference - " + groupId + ":" + artifactId + ":" + version + ":" + classifier + ":" + type; + + assertNotNull( expectedId + " - Should not be null.", actualReference ); + + assertEquals( expectedId + " - Group ID", groupId, actualReference.getGroupId() ); + assertEquals( expectedId + " - Artifact ID", artifactId, actualReference.getArtifactId() ); + assertEquals( expectedId + " - Version ID", version, actualReference.getVersion() ); + assertEquals( expectedId + " - classifier", classifier, actualReference.getClassifier() ); + assertEquals( expectedId + " - Type", type, actualReference.getType() ); + } + + protected void assertBadPath( String path, String reason ) + { + try + { + parser.toArtifactReference( path ); + fail( "Should have thrown a LayoutException on the invalid path [" + path + "] because of [" + reason + "]" ); + } + catch ( LayoutException e ) + { + /* expected path */ + } + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/ManagedDefaultRepositoryContentTest.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/ManagedDefaultRepositoryContentTest.java new file mode 100644 index 000000000..3a0a77abb --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/ManagedDefaultRepositoryContentTest.java @@ -0,0 +1,223 @@ +package org.apache.maven.archiva.repository.content; + +/* + * 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.archiva.common.utils.VersionComparator; +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.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.model.ArtifactReference; +import org.apache.maven.archiva.model.ProjectReference; +import org.apache.maven.archiva.model.VersionedReference; +import org.apache.maven.archiva.repository.ManagedRepositoryContent; +import org.apache.maven.archiva.repository.layout.LayoutException; + +import java.io.File; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Set; + +/** + * ManagedDefaultRepositoryContentTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ManagedDefaultRepositoryContentTest + extends AbstractDefaultRepositoryContentTestCase +{ + private ManagedRepositoryContent repoContent; + + public void testGetVersionsBadArtifact() + throws Exception + { + assertGetVersions( "bad_artifact", Collections.EMPTY_LIST ); + } + + public void testGetVersionsMissingMultipleVersions() + throws Exception + { + assertGetVersions( "missing_metadata_b", Arrays.asList( "1.0", "1.0.1", "2.0", "2.0.1", "2.0-20070821-dev" ) ); + } + + public void testGetVersionsSimple() + throws Exception + { + assertVersions( "proxied_multi", "2.1", new String[] { "2.1" } ); + } + + public void testGetVersionsSimpleYetIncomplete() + throws Exception + { + assertGetVersions( "incomplete_metadata_a", Collections.singletonList( "1.0" ) ); + } + + public void testGetVersionsSimpleYetMissing() + throws Exception + { + assertGetVersions( "missing_metadata_a", Collections.singletonList( "1.0" ) ); + } + + public void testGetVersionsSnapshotA() + throws Exception + { + assertVersions( "snap_shots_a", "1.0-alpha-11-SNAPSHOT", new String[] { + "1.0-alpha-11-SNAPSHOT", + "1.0-alpha-11-20070221.194724-2", + "1.0-alpha-11-20070302.212723-3", + "1.0-alpha-11-20070303.152828-4", + "1.0-alpha-11-20070305.215149-5", + "1.0-alpha-11-20070307.170909-6", + "1.0-alpha-11-20070314.211405-9", + "1.0-alpha-11-20070316.175232-11" } ); + } + + public void testToMetadataPathFromProjectReference() + { + ProjectReference reference = new ProjectReference(); + reference.setGroupId( "com.foo" ); + reference.setArtifactId( "foo-tool" ); + + assertEquals( "com/foo/foo-tool/maven-metadata.xml", repoContent.toMetadataPath( reference ) ); + } + + public void testToMetadataPathFromVersionReference() + { + VersionedReference reference = new VersionedReference(); + reference.setGroupId( "com.foo" ); + reference.setArtifactId( "foo-tool" ); + reference.setVersion( "1.0" ); + + assertEquals( "com/foo/foo-tool/1.0/maven-metadata.xml", repoContent.toMetadataPath( reference ) ); + } + + public void testToPathOnNullArtifactReference() + { + try + { + ArtifactReference reference = null; + repoContent.toPath( reference ); + fail( "Should have failed due to null artifact reference." ); + } + catch ( IllegalArgumentException e ) + { + /* expected path */ + } + } + + public void testExcludeMetadataFile() + throws Exception + { + assertVersions( "include_xml", "1.0", new String[] { "1.0" } ); + } + + private void assertGetVersions( String artifactId, List expectedVersions ) + throws Exception + { + ProjectReference reference = new ProjectReference(); + reference.setGroupId( "org.apache.archiva.metadata.tests" ); + reference.setArtifactId( artifactId ); + + // Use the test metadata-repository, which is already setup for + // These kind of version tests. + File repoDir = getTestFile( "src/test/repositories/metadata-repository" ); + repoContent.getRepository().setLocation( repoDir.getAbsolutePath() ); + + // Request the versions. + Set testedVersionSet = repoContent.getVersions( reference ); + + // Sort the list (for asserts) + List testedVersions = new ArrayList(); + testedVersions.addAll( testedVersionSet ); + Collections.sort( testedVersions, new VersionComparator() ); + + // Test the expected array of versions, to the actual tested versions + assertEquals( "available versions", expectedVersions, testedVersions ); + } + + private void assertVersions( String artifactId, String version, String[] expectedVersions ) + throws Exception + { + VersionedReference reference = new VersionedReference(); + reference.setGroupId( "org.apache.archiva.metadata.tests" ); + reference.setArtifactId( artifactId ); + reference.setVersion( version ); + + // Use the test metadata-repository, which is already setup for + // These kind of version tests. + File repoDir = getTestFile( "src/test/repositories/metadata-repository" ); + repoContent.getRepository().setLocation( repoDir.getAbsolutePath() ); + + // Request the versions. + Set testedVersionSet = repoContent.getVersions( reference ); + + // Sort the list (for asserts later) + List testedVersions = new ArrayList(); + testedVersions.addAll( testedVersionSet ); + Collections.sort( testedVersions, new VersionComparator() ); + + // Test the expected array of versions, to the actual tested versions + assertEquals( "Assert Versions: length/size", expectedVersions.length, testedVersions.size() ); + + for ( int i = 0; i < expectedVersions.length; i++ ) + { + String actualVersion = testedVersions.get( i ); + assertEquals( "Versions[" + i + "]", expectedVersions[i], actualVersion ); + } + } + + @Override + protected void setUp() + throws Exception + { + super.setUp(); + + File repoDir = getTestFile( "src/test/repositories/default-repository" ); + + ManagedRepositoryConfiguration repository = createRepository( "testRepo", "Unit Test Repo", repoDir ); + + ArchivaConfiguration archivaConfiguration = (ArchivaConfiguration) lookup( ArchivaConfiguration.ROLE ); + FileType fileType = (FileType) archivaConfiguration.getConfiguration().getRepositoryScanning().getFileTypes().get( 0 ); + fileType.addPattern( "**/*.xml" ); + assertEquals( FileTypes.ARTIFACTS, fileType.getId() ); + + FileTypes fileTypes = (FileTypes) lookup( FileTypes.class ); + fileTypes.afterConfigurationChange( null, "fileType", null ); + + repoContent = (ManagedRepositoryContent) lookup( ManagedRepositoryContent.class, "default" ); + repoContent.setRepository( repository ); + } + + @Override + protected ArtifactReference toArtifactReference( String path ) + throws LayoutException + { + return repoContent.toArtifactReference( path ); + } + + @Override + protected String toPath( ArtifactReference reference ) + { + return repoContent.toPath( reference ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/ManagedLegacyRepositoryContentTest.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/ManagedLegacyRepositoryContentTest.java new file mode 100644 index 000000000..2991832b5 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/ManagedLegacyRepositoryContentTest.java @@ -0,0 +1,193 @@ +package org.apache.maven.archiva.repository.content; + +/* + * 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.archiva.common.utils.VersionComparator; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.model.ArtifactReference; +import org.apache.maven.archiva.model.ProjectReference; +import org.apache.maven.archiva.model.VersionedReference; +import org.apache.maven.archiva.repository.ManagedRepositoryContent; +import org.apache.maven.archiva.repository.layout.LayoutException; + +import java.io.File; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Set; + +/** + * ManagedLegacyRepositoryContentTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ManagedLegacyRepositoryContentTest + extends AbstractLegacyRepositoryContentTestCase +{ + private ManagedRepositoryContent repoContent; + + public void testGetVersionsFromProjectReference() + throws Exception + { + assertVersions( "org.apache.maven", "testing", new String[] { + "UNKNOWN", +// "1.0-javadoc", +// "1.0-sources", + "1.0", + "1.0-20050611.112233-1" } ); + } + + public void testGetVersionsFromVersionedReference() + throws Exception + { + assertVersions( "org.apache.maven", "testing", "1.0", new String[] { +// "1.0-javadoc", +// "1.0-sources", + "1.0", + "1.0-20050611.112233-1" } ); + } + + private void assertVersions( String groupId, String artifactId, String[] expectedVersions ) + throws Exception + { + ProjectReference reference = new ProjectReference(); + reference.setGroupId( groupId ); + reference.setArtifactId( artifactId ); + + // Request the versions. + Set testedVersionSet = repoContent.getVersions( reference ); + + // Sort the list (for asserts later) + List testedVersions = new ArrayList(); + testedVersions.addAll( testedVersionSet ); + Collections.sort( testedVersions, new VersionComparator() ); + + // Test the expected array of versions, to the actual tested versions + assertEquals( "Assert (Project) Versions: length/size", expectedVersions.length, testedVersions.size() ); + + for ( int i = 0; i < expectedVersions.length; i++ ) + { + String actualVersion = testedVersions.get( i ); + assertEquals( "(Project) Versions[" + i + "]", expectedVersions[i], actualVersion ); + } + } + + private void assertVersions( String groupId, String artifactId, String version, String[] expectedVersions ) + throws Exception + { + VersionedReference reference = new VersionedReference(); + reference.setGroupId( groupId ); + reference.setArtifactId( artifactId ); + reference.setVersion( version ); + + // Request the versions. + Set testedVersionSet = repoContent.getVersions( reference ); + + // Sort the list (for asserts later) + List testedVersions = new ArrayList(); + testedVersions.addAll( testedVersionSet ); + Collections.sort( testedVersions, new VersionComparator() ); + + // Test the expected array of versions, to the actual tested versions + assertEquals( "Assert (Project) Versions: length/size", expectedVersions.length, testedVersions.size() ); + + for ( int i = 0; i < expectedVersions.length; i++ ) + { + String actualVersion = testedVersions.get( i ); + assertEquals( "(Project) Versions[" + i + "]", expectedVersions[i], actualVersion ); + } + } + + public void testGetRelatedArtifacts() + throws Exception + { + ArtifactReference reference = createArtifact( "org.apache.maven", "testing", "1.0", null, "jar" ); + + Set related = repoContent.getRelatedArtifacts( reference ); + assertNotNull( related ); + + String expected[] = new String[] { + "org.apache.maven/jars/testing-1.0.jar", + "org.apache.maven/java-sources/testing-1.0-sources.jar", + "org.apache.maven/jars/testing-1.0-20050611.112233-1.jar", + "org.apache.maven/poms/testing-1.0.pom", + "org.apache.maven/distributions/testing-1.0.tar.gz", + "org.apache.maven/distributions/testing-1.0.zip", + "org.apache.maven/javadoc.jars/testing-1.0-javadoc.jar" }; + + StringBuffer relatedDebugString = new StringBuffer(); + relatedDebugString.append( "[" ); + for ( ArtifactReference ref : related ) + { + String actualPath = repoContent.toPath( ref ); + relatedDebugString.append( actualPath ).append( ":" ); + } + relatedDebugString.append( "]" ); + + for ( String expectedPath : expected ) + { + boolean found = false; + for ( ArtifactReference actualRef : related ) + { + String actualPath = repoContent.toPath( actualRef ); + if ( actualPath.endsWith( expectedPath ) ) + { + found = true; + break; + } + } + if ( !found ) + { + fail( "Unable to find expected artifact [" + expectedPath + "] in list of related artifacts. " + + "Related <" + relatedDebugString + ">" ); + } + } + assertEquals( "Related <" + relatedDebugString + ">:", expected.length, related.size() ); + } + + @Override + protected void setUp() + throws Exception + { + super.setUp(); + + File repoDir = getTestFile( "src/test/repositories/legacy-repository" ); + + ManagedRepositoryConfiguration repository = createRepository( "testRepo", "Unit Test Repo", repoDir ); + repository.setLayout( "legacy" ); + + repoContent = (ManagedRepositoryContent) lookup( ManagedRepositoryContent.class, "legacy" ); + repoContent.setRepository( repository ); + } + + @Override + protected ArtifactReference toArtifactReference( String path ) + throws LayoutException + { + return repoContent.toArtifactReference( path ); + } + + @Override + protected String toPath( ArtifactReference reference ) + { + return repoContent.toPath( reference ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/RemoteDefaultRepositoryContentTest.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/RemoteDefaultRepositoryContentTest.java new file mode 100644 index 000000000..2a3384899 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/RemoteDefaultRepositoryContentTest.java @@ -0,0 +1,63 @@ +package org.apache.maven.archiva.repository.content; + +/* + * 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.archiva.configuration.RemoteRepositoryConfiguration; +import org.apache.maven.archiva.model.ArtifactReference; +import org.apache.maven.archiva.repository.RemoteRepositoryContent; +import org.apache.maven.archiva.repository.layout.LayoutException; + +/** + * RemoteDefaultRepositoryContentTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class RemoteDefaultRepositoryContentTest + extends AbstractDefaultRepositoryContentTestCase +{ + private RemoteRepositoryContent repoContent; + + @Override + protected void setUp() + throws Exception + { + super.setUp(); + + RemoteRepositoryConfiguration repository = createRemoteRepository( "testRemoteRepo", "Unit Test Remote Repo", + "http://repo1.maven.org/maven2/" ); + + repoContent = (RemoteRepositoryContent) lookup( RemoteRepositoryContent.class, "default" ); + repoContent.setRepository( repository ); + } + + @Override + protected ArtifactReference toArtifactReference( String path ) + throws LayoutException + { + return repoContent.toArtifactReference( path ); + } + + @Override + protected String toPath( ArtifactReference reference ) + { + return repoContent.toPath( reference ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/RemoteLegacyRepositoryContentTest.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/RemoteLegacyRepositoryContentTest.java new file mode 100644 index 000000000..f976c2fdb --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/RemoteLegacyRepositoryContentTest.java @@ -0,0 +1,65 @@ +package org.apache.maven.archiva.repository.content; + +/* + * 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.archiva.configuration.RemoteRepositoryConfiguration; +import org.apache.maven.archiva.model.ArtifactReference; +import org.apache.maven.archiva.repository.RemoteRepositoryContent; +import org.apache.maven.archiva.repository.layout.LayoutException; + +/** + * RemoteLegacyRepositoryContentTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class RemoteLegacyRepositoryContentTest + extends AbstractLegacyRepositoryContentTestCase +{ + private RemoteRepositoryContent repoContent; + + @Override + protected void setUp() + throws Exception + { + super.setUp(); + + RemoteRepositoryConfiguration repository = createRemoteRepository( "testRemoteLegacyRepo", + "Unit Test Remote Legacy Repo", + "http://repo1.maven.org/maven/" ); + repository.setLayout( "legacy" ); + + repoContent = (RemoteRepositoryContent) lookup( RemoteRepositoryContent.class, "legacy" ); + repoContent.setRepository( repository ); + } + + @Override + protected ArtifactReference toArtifactReference( String path ) + throws LayoutException + { + return repoContent.toArtifactReference( path ); + } + + @Override + protected String toPath( ArtifactReference reference ) + { + return repoContent.toPath( reference ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/RepositoryRequestTest.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/RepositoryRequestTest.java new file mode 100644 index 000000000..f911f4e8c --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/RepositoryRequestTest.java @@ -0,0 +1,532 @@ +package org.apache.maven.archiva.repository.content; + +/* + * 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.maven.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 java.io.File; + +/** + * RepositoryRequestTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class RepositoryRequestTest + extends AbstractRepositoryLayerTestCase +{ + public void testInvalidRequestNoArtifactId() + { + assertInvalidRequest( "groupId/jars/-1.0.jar" ); + } + + public void testInvalidLegacyRequestBadLocation() + { + assertInvalidRequest( "org.apache.maven.test/jars/artifactId-1.0.war" ); + } + + public void testInvalidRequestTooShort() + { + assertInvalidRequest( "org.apache.maven.test/artifactId-2.0.jar" ); + } + + public void testInvalidDefaultRequestBadLocation() + { + assertInvalidRequest( "invalid/invalid/1.0-20050611.123456-1/invalid-1.0-20050611.123456-1.jar" ); + } + + public void testValidLegacyGanymed() + throws Exception + { + assertValid( "ch.ethz.ganymed/jars/ganymed-ssh2-build210.jar", "ch.ethz.ganymed", "ganymed-ssh2", "build210", + null, "jar" ); + } + + public void testValidDefaultGanymed() + throws Exception + { + assertValid( "ch/ethz/ganymed/ganymed-ssh2/build210/ganymed-ssh2-build210.jar", "ch.ethz.ganymed", + "ganymed-ssh2", "build210", null, "jar" ); + } + + public void testValidLegacyJavaxComm() + throws Exception + { + assertValid( "javax/jars/comm-3.0-u1.jar", "javax", "comm", "3.0-u1", null, "jar" ); + } + + public void testValidDefaultJavaxComm() + throws Exception + { + assertValid( "javax/comm/3.0-u1/comm-3.0-u1.jar", "javax", "comm", "3.0-u1", null, "jar" ); + } + + public void testValidLegacyJavaxPersistence() + throws Exception + { + assertValid( "javax.persistence/jars/ejb-3.0-public_review.jar", "javax.persistence", "ejb", + "3.0-public_review", null, "jar" ); + } + + public void testValidDefaultJavaxPersistence() + throws Exception + { + assertValid( "javax/persistence/ejb/3.0-public_review/ejb-3.0-public_review.jar", "javax.persistence", "ejb", + "3.0-public_review", null, "jar" ); + } + + public void testValidLegacyMavenTestPlugin() + throws Exception + { + assertValid( "maven/jars/maven-test-plugin-1.8.2.jar", "maven", "maven-test-plugin", "1.8.2", null, "jar" ); + } + + public void testValidDefaultMavenTestPlugin() + throws Exception + { + assertValid( "maven/maven-test-plugin/1.8.2/maven-test-plugin-1.8.2.pom", "maven", "maven-test-plugin", + "1.8.2", null, "pom" ); + } + + public void testValidLegacyCommonsLangJavadoc() + throws Exception + { + assertValid( "commons-lang/javadoc.jars/commons-lang-2.1-javadoc.jar", "commons-lang", "commons-lang", "2.1", + "javadoc", "javadoc" ); + } + + public void testValidDefaultCommonsLangJavadoc() + throws Exception + { + assertValid( "commons-lang/commons-lang/2.1/commons-lang-2.1-javadoc.jar", "commons-lang", "commons-lang", + "2.1", "javadoc", "javadoc" ); + } + + public void testValidLegacyDerbyPom() + throws Exception + { + assertValid( "org.apache.derby/poms/derby-10.2.2.0.pom", "org.apache.derby", "derby", "10.2.2.0", null, "pom" ); + // Starting slash should not prevent detection. + assertValid( "/org.apache.derby/poms/derby-10.2.2.0.pom", "org.apache.derby", "derby", "10.2.2.0", null, "pom" ); + } + + public void testValidDefaultDerbyPom() + throws Exception + { + assertValid( "org/apache/derby/derby/10.2.2.0/derby-10.2.2.0.pom", "org.apache.derby", "derby", "10.2.2.0", + null, "pom" ); + } + + public void testValidLegacyGeronimoEjbSpec() + throws Exception + { + assertValid( "org.apache.geronimo.specs/jars/geronimo-ejb_2.1_spec-1.0.1.jar", "org.apache.geronimo.specs", + "geronimo-ejb_2.1_spec", "1.0.1", null, "jar" ); + } + + public void testValidDefaultGeronimoEjbSpec() + throws Exception + { + assertValid( "org/apache/geronimo/specs/geronimo-ejb_2.1_spec/1.0.1/geronimo-ejb_2.1_spec-1.0.1.jar", + "org.apache.geronimo.specs", "geronimo-ejb_2.1_spec", "1.0.1", null, "jar" ); + } + + public void testValidLegacyLdapSnapshot() + throws Exception + { + assertValid( "directory-clients/poms/ldap-clients-0.9.1-SNAPSHOT.pom", "directory-clients", "ldap-clients", + "0.9.1-SNAPSHOT", null, "pom" ); + } + + public void testValidDefaultLdapSnapshot() + throws Exception + { + assertValid( "directory-clients/ldap-clients/0.9.1-SNAPSHOT/ldap-clients-0.9.1-SNAPSHOT.pom", + "directory-clients", "ldap-clients", "0.9.1-SNAPSHOT", null, "pom" ); + } + + public void testValidLegacyTestArchSnapshot() + throws Exception + { + assertValid( "test.maven-arch/poms/test-arch-2.0.3-SNAPSHOT.pom", "test.maven-arch", "test-arch", + "2.0.3-SNAPSHOT", null, "pom" ); + } + + public void testValidDefaultTestArchSnapshot() + throws Exception + { + assertValid( "test/maven-arch/test-arch/2.0.3-SNAPSHOT/test-arch-2.0.3-SNAPSHOT.pom", "test.maven-arch", + "test-arch", "2.0.3-SNAPSHOT", null, "pom" ); + } + + public void testValidLegacyOddDottedArtifactId() + throws Exception + { + assertValid( "com.company.department/poms/com.company.department.project-0.2.pom", "com.company.department", + "com.company.department.project", "0.2", null, "pom" ); + } + + public void testValidDefaultOddDottedArtifactId() + throws Exception + { + assertValid( "com/company/department/com.company.department.project/0.2/com.company.department.project-0.2.pom", + "com.company.department", "com.company.department.project", "0.2", null, "pom" ); + } + + public void testValidLegacyTimestampedSnapshot() + throws Exception + { + assertValid( "org.apache.archiva.test/jars/redonkulous-3.1-beta-1-20050831.101112-42.jar", + "org.apache.archiva.test", "redonkulous", "3.1-beta-1-20050831.101112-42", null, "jar" ); + } + + public void testValidDefaultTimestampedSnapshot() + throws Exception + { + assertValid( + "org/apache/archiva/test/redonkulous/3.1-beta-1-SNAPSHOT/redonkulous-3.1-beta-1-20050831.101112-42.jar", + "org.apache.archiva.test", "redonkulous", "3.1-beta-1-20050831.101112-42", null, "jar" ); + } + + public void testIsSupportFile() + { + assertTrue( repoRequest.isSupportFile( "org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.tar.gz.sha1" ) ); + assertTrue( repoRequest.isSupportFile( "org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.tar.gz.md5" ) ); + assertTrue( repoRequest.isSupportFile( "org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.tar.gz.asc" ) ); + assertTrue( repoRequest.isSupportFile( "org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.tar.gz.pgp" ) ); + assertTrue( repoRequest.isSupportFile( "org/apache/derby/derby/10.2.2.0/maven-metadata.xml.sha1" ) ); + assertTrue( repoRequest.isSupportFile( "org/apache/derby/derby/10.2.2.0/maven-metadata.xml.md5" ) ); + + assertFalse( repoRequest.isSupportFile( "test.maven-arch/poms/test-arch-2.0.3-SNAPSHOT.pom" ) ); + assertFalse( repoRequest.isSupportFile( "test/maven-arch/test-arch/2.0.3-SNAPSHOT/test-arch-2.0.3-SNAPSHOT.jar" ) ); + assertFalse( repoRequest.isSupportFile( "org/apache/archiva/archiva-api/1.0/archiva-api-1.0.xml.zip" ) ); + assertFalse( repoRequest.isSupportFile( "org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.tar.gz" ) ); + assertFalse( repoRequest.isSupportFile( "org/apache/derby/derby/10.2.2.0/maven-metadata.xml" ) ); + assertFalse( repoRequest.isSupportFile( "org/apache/derby/derby/maven-metadata.xml" ) ); + } + + public void testIsMetadata() + { + assertTrue( repoRequest.isMetadata( "org/apache/derby/derby/10.2.2.0/maven-metadata.xml" )); + assertTrue( repoRequest.isMetadata( "org/apache/derby/derby/maven-metadata.xml" )); + + assertFalse( repoRequest.isMetadata( "test.maven-arch/poms/test-arch-2.0.3-SNAPSHOT.pom" ) ); + assertFalse( repoRequest.isMetadata( "test/maven-arch/test-arch/2.0.3-SNAPSHOT/test-arch-2.0.3-SNAPSHOT.jar" ) ); + assertFalse( repoRequest.isMetadata( "org/apache/archiva/archiva-api/1.0/archiva-api-1.0.xml.zip" ) ); + assertFalse( repoRequest.isMetadata( "org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.tar.gz" ) ); + assertFalse( repoRequest.isMetadata( "org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.tar.gz.pgp" ) ); + assertFalse( repoRequest.isMetadata( "org/apache/derby/derby/10.2.2.0/maven-metadata.xml.sha1" ) ); + } + + public void testIsDefault() + { + assertFalse( repoRequest.isDefault( "test.maven-arch/poms/test-arch-2.0.3-SNAPSHOT.pom" ) ); + assertFalse( repoRequest.isDefault( "directory-clients/poms/ldap-clients-0.9.1-SNAPSHOT.pom" ) ); + assertFalse( repoRequest.isDefault( "commons-lang/jars/commons-lang-2.1-javadoc.jar" ) ); + + assertTrue( repoRequest.isDefault( "test/maven-arch/test-arch/2.0.3-SNAPSHOT/test-arch-2.0.3-SNAPSHOT.jar" ) ); + assertTrue( repoRequest.isDefault( "org/apache/archiva/archiva-api/1.0/archiva-api-1.0.xml.zip" ) ); + assertTrue( repoRequest.isDefault( "org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.tar.gz" ) ); + assertTrue( repoRequest.isDefault( "org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.tar.gz.pgp" ) ); + assertTrue( repoRequest.isDefault( "org/apache/derby/derby/10.2.2.0/maven-metadata.xml.sha1" ) ); + + assertFalse( repoRequest.isDefault( null ) ); + assertFalse( repoRequest.isDefault( "" ) ); + assertFalse( repoRequest.isDefault( "foo" ) ); + assertFalse( repoRequest.isDefault( "some.short/path" ) ); + } + + public void testIsLegacy() + { + assertTrue( repoRequest.isLegacy( "test.maven-arch/poms/test-arch-2.0.3-SNAPSHOT.pom" ) ); + assertTrue( repoRequest.isLegacy( "directory-clients/poms/ldap-clients-0.9.1-SNAPSHOT.pom" ) ); + assertTrue( repoRequest.isLegacy( "commons-lang/jars/commons-lang-2.1-javadoc.jar" ) ); + + assertFalse( repoRequest.isLegacy( "test/maven-arch/test-arch/2.0.3-SNAPSHOT/test-arch-2.0.3-SNAPSHOT.jar" ) ); + assertFalse( repoRequest.isLegacy( "org/apache/archiva/archiva-api/1.0/archiva-api-1.0.xml.zip" ) ); + assertFalse( repoRequest.isLegacy( "org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.tar.gz" ) ); + assertFalse( repoRequest.isLegacy( "org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.tar.gz.pgp" ) ); + assertFalse( repoRequest.isLegacy( "org/apache/derby/derby/10.2.2.0/maven-metadata.xml.sha1" ) ); + + assertFalse( repoRequest.isLegacy( null ) ); + assertFalse( repoRequest.isLegacy( "" ) ); + assertFalse( repoRequest.isLegacy( "some.short/path" ) ); + } + + private ManagedRepositoryContent createManagedRepo( String layout ) + throws Exception + { + File repoRoot = getTestFile( "target/test-repo" ); + return createManagedRepositoryContent( "test-internal", "Internal Test Repo", repoRoot, layout ); + } + + /** + * [MRM-481] Artifact requests with a .xml.zip extension fail with a 404 Error + */ + public void testToNativePathArtifactDefaultToDefaultDualExtension() + throws Exception + { + ManagedRepositoryContent repository = createManagedRepo( "default" ); + + // Test (artifact) default to default - dual extension + assertEquals( "org/project/example-presentation/3.2/example-presentation-3.2.xml.zip", repoRequest + .toNativePath( "org/project/example-presentation/3.2/example-presentation-3.2.xml.zip", repository ) ); + } + + /** + * [MRM-481] Artifact requests with a .xml.zip extension fail with a 404 Error + */ + public void testToNativePathArtifactLegacyToDefaultDualExtension() + throws Exception + { + ManagedRepositoryContent repository = createManagedRepo( "default" ); + + // Test (artifact) legacy to default - dual extension + // NOTE: The detection of a dual extension is flawed. + assertEquals( "org/project/example-presentation/3.2.xml/example-presentation-3.2.xml.zip", repoRequest + .toNativePath( "org.project/zips/example-presentation-3.2.xml.zip", repository ) ); + } + + public void testToNativePathMetadataDefaultToDefault() + throws Exception + { + ManagedRepositoryContent repository = createManagedRepo( "default" ); + + // Test (metadata) default to default + assertEquals( "org/apache/derby/derby/10.2.2.0/maven-metadata.xml.sha1", repoRequest + .toNativePath( "org/apache/derby/derby/10.2.2.0/maven-metadata.xml.sha1", repository ) ); + } + + public void testNativePathPomLegacyToDefault() + throws Exception + { + ManagedRepositoryContent repository = createManagedRepo( "default" ); + + // Test (pom) legacy to default + assertEquals( "org/apache/derby/derby/10.2.2.0/derby-10.2.2.0.pom", + repoRequest.toNativePath( "org.apache.derby/poms/derby-10.2.2.0.pom", repository ) ); + } + + public void testNativePathPomLegacyToLegacy() + throws Exception + { + ManagedRepositoryContent repository = createManagedRepo( "legacy" ); + + // Test (pom) legacy to default + assertEquals( "org.apache.derby/poms/derby-10.2.2.0.pom", + repoRequest.toNativePath( "org.apache.derby/poms/derby-10.2.2.0.pom", repository ) ); + } + + public void testNativePathPomLegacyToDefaultEjb() + throws Exception + { + ManagedRepositoryContent repository = createManagedRepo( "default" ); + + // Test (pom) legacy to default + assertEquals( "mygroup/myejb/1.0/myejb-1.0.jar", + repoRequest.toNativePath( "mygroup/ejbs/myejb-1.0.jar", repository ) ); + } + + public void testNativePathPomLegacyToLegacyEjb() + throws Exception + { + ManagedRepositoryContent repository = createManagedRepo( "legacy" ); + + // Test (pom) legacy to default + assertEquals( "mygroup/ejbs/myejb-1.0.jar", + repoRequest.toNativePath( "mygroup/ejbs/myejb-1.0.jar", repository ) ); + } + + public void testNativePathPomLegacyToLegacyStrutsModule() + throws Exception + { + ManagedRepositoryContent repository = createManagedRepo( "legacy" ); + + // Test (pom) legacy to default + assertEquals( "WebPortal/struts-modules/eventsDB-1.2.3.struts-module", + repoRequest.toNativePath( "WebPortal/struts-modules/eventsDB-1.2.3.struts-module", repository ) ); + } + + public void testNativePathSupportFileLegacyToDefault() + throws Exception + { + ManagedRepositoryContent repository = createManagedRepo( "default" ); + + // Test (supportfile) legacy to default + assertEquals( "org/apache/derby/derby/10.2.2.0/derby-10.2.2.0.jar.sha1", repoRequest + .toNativePath( "org.apache.derby/jars/derby-10.2.2.0.jar.sha1", repository ) ); + } + + public void testNativePathBadRequestTooShort() + throws Exception + { + ManagedRepositoryContent repository = createManagedRepo( "default" ); + + // Test bad request path (too short) + try + { + repoRequest.toNativePath( "org.apache.derby/license.txt", repository ); + fail( "Should have thrown an exception about a too short path." ); + } + catch ( LayoutException e ) + { + // expected path. + } + } + + public void testNativePathBadRequestBlank() + throws Exception + { + ManagedRepositoryContent repository = createManagedRepo( "default" ); + + // Test bad request path (too short) + try + { + repoRequest.toNativePath( "", repository ); + fail( "Should have thrown an exception about an blank request." ); + } + catch ( LayoutException e ) + { + // expected path. + } + } + + public void testNativePathBadRequestNull() + throws Exception + { + ManagedRepositoryContent repository = createManagedRepo( "default" ); + + // Test bad request path (too short) + try + { + repoRequest.toNativePath( null, repository ); + fail( "Should have thrown an exception about an null request." ); + } + catch ( LayoutException e ) + { + // expected path. + } + } + + public void testNativePathBadRequestUnknownType() + throws Exception + { + ManagedRepositoryContent repository = createManagedRepo( "default" ); + + // Test bad request path (too short) + try + { + repoRequest.toNativePath( "org/apache/derby/derby/10.2.2.0/license.txt", repository ); + fail( "Should have thrown an exception about an invalid type." ); + } + catch ( LayoutException e ) + { + // expected path. + } + } + + public void testToNativePathLegacyMetadataDefaultToLegacy() + throws Exception + { + ManagedRepositoryContent repository = createManagedRepo( "legacy" ); + + // Test (metadata) default to legacy + + // Special Case: This direction is not supported, should throw a LayoutException. + try + { + repoRequest.toNativePath( "org/apache/derby/derby/10.2.2.0/maven-metadata.xml", repository ); + fail("Should have thrown a LayoutException, can't translate a maven-metadata.xml to a legacy layout."); + } + catch(LayoutException e) + { + // expected path. + } + } + + public void testNativePathPomDefaultToLegacy() + throws Exception + { + ManagedRepositoryContent repository = createManagedRepo( "legacy" ); + + // Test (pom) default to legacy + assertEquals( "org.apache.derby/poms/derby-10.2.2.0.pom", repoRequest + .toNativePath( "org/apache/derby/derby/10.2.2.0/derby-10.2.2.0.pom", repository ) ); + } + + public void testNativePathSupportFileDefaultToLegacy() + throws Exception + { + ManagedRepositoryContent repository = createManagedRepo( "legacy" ); + + // Test (supportfile) default to legacy + assertEquals( "org.apache.derby/jars/derby-10.2.2.0.jar.sha1", repoRequest + .toNativePath( "org/apache/derby/derby/10.2.2.0/derby-10.2.2.0.jar.sha1", repository ) ); + } + + private void assertValid( String path, String groupId, String artifactId, String version, String classifier, + String type ) + throws Exception + { + String expectedId = "ArtifactReference - " + groupId + ":" + artifactId + ":" + version + ":" + + ( classifier != null ? classifier + ":" : "" ) + type; + + ArtifactReference reference = repoRequest.toArtifactReference( path ); + + assertNotNull( expectedId + " - Should not be null.", reference ); + + assertEquals( expectedId + " - Group ID", groupId, reference.getGroupId() ); + assertEquals( expectedId + " - Artifact ID", artifactId, reference.getArtifactId() ); + if ( StringUtils.isNotBlank( classifier ) ) + { + assertEquals( expectedId + " - Classifier", classifier, reference.getClassifier() ); + } + assertEquals( expectedId + " - Version ID", version, reference.getVersion() ); + assertEquals( expectedId + " - Type", type, reference.getType() ); + } + + private void assertInvalidRequest( String path ) + { + try + { + repoRequest.toArtifactReference( path ); + fail( "Expected a LayoutException on an invalid path [" + path + "]" ); + } + catch ( LayoutException e ) + { + /* expected path */ + } + } + + private RepositoryRequest repoRequest; + + @Override + protected void setUp() + throws Exception + { + super.setUp(); + + repoRequest = (RepositoryRequest) lookup( RepositoryRequest.class ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/metadata/MetadataToolsTest.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/metadata/MetadataToolsTest.java new file mode 100644 index 000000000..c539f52b5 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/metadata/MetadataToolsTest.java @@ -0,0 +1,566 @@ +package org.apache.maven.archiva.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.commons.io.FileUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.maven.archiva.common.utils.VersionComparator; +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.configuration.ProxyConnectorConfiguration; +import org.apache.maven.archiva.model.ProjectReference; +import org.apache.maven.archiva.model.VersionedReference; +import org.apache.maven.archiva.policies.CachedFailuresPolicy; +import org.apache.maven.archiva.policies.ChecksumPolicy; +import org.apache.maven.archiva.policies.ReleasesPolicy; +import org.apache.maven.archiva.policies.SnapshotsPolicy; +import org.apache.maven.archiva.repository.AbstractRepositoryLayerTestCase; +import org.apache.maven.archiva.repository.ManagedRepositoryContent; +import org.apache.maven.archiva.repository.MockConfiguration; +import org.apache.maven.archiva.repository.RemoteRepositoryContent; +import org.apache.maven.archiva.repository.layout.LayoutException; +import org.custommonkey.xmlunit.DetailedDiff; +import org.custommonkey.xmlunit.Diff; +import org.xml.sax.SAXException; + +import javax.xml.parsers.ParserConfigurationException; +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Set; + +/** + * MetadataToolsTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class MetadataToolsTest + extends AbstractRepositoryLayerTestCase +{ + private MetadataTools tools; + + protected MockConfiguration config; + + public void testGatherSnapshotVersionsA() + throws Exception + { + assertSnapshotVersions( "snap_shots_a", "1.0-alpha-11-SNAPSHOT", new String[] { + "1.0-alpha-11-SNAPSHOT", + "1.0-alpha-11-20070221.194724-2", + "1.0-alpha-11-20070302.212723-3", + "1.0-alpha-11-20070303.152828-4", + "1.0-alpha-11-20070305.215149-5", + "1.0-alpha-11-20070307.170909-6", + "1.0-alpha-11-20070314.211405-9", + "1.0-alpha-11-20070316.175232-11" } ); + } + + public void testGatherSnapshotVersionsAWithProxies() + throws Exception + { + // These proxied repositories do not need to exist for the purposes of this unit test, + // just the repository ids are important. + createProxyConnector( "test-repo", "apache-snapshots" ); + createProxyConnector( "test-repo", "internal-snapshots" ); + createProxyConnector( "test-repo", "snapshots.codehaus.org" ); + + assertSnapshotVersions( "snap_shots_a", "1.0-alpha-11-SNAPSHOT", new String[] { + "1.0-alpha-11-SNAPSHOT", + "1.0-alpha-11-20070221.194724-2", + "1.0-alpha-11-20070302.212723-3", + "1.0-alpha-11-20070303.152828-4", + "1.0-alpha-11-20070305.215149-5", + "1.0-alpha-11-20070307.170909-6", + "1.0-alpha-11-20070314.211405-9", + "1.0-alpha-11-20070315.033030-10" /* Arrives in via snapshots.codehaus.org proxy */, + "1.0-alpha-11-20070316.175232-11" } ); + } + + public void testGetRepositorySpecificName() + throws Exception + { + RemoteRepositoryContent repoJavaNet = createRemoteRepositoryContent( "maven2-repository.dev.java.net", + "Java.net Repository for Maven 2", + "http://download.java.net/maven/2/", + "default" ); + RemoteRepositoryContent repoCentral = createRemoteRepositoryContent( "central", "Central Global Repository", + "http://repo1.maven.org/maven2/", + "default" ); + + String convertedName = tools.getRepositorySpecificName( repoJavaNet, + "commons-lang/commons-lang/maven-metadata.xml" ); + assertMetadataPath( "commons-lang/commons-lang/maven-metadata-maven2-repository.dev.java.net.xml", + convertedName ); + + convertedName = tools.getRepositorySpecificName( repoCentral, "commons-lang/commons-lang/maven-metadata.xml" ); + assertMetadataPath( "commons-lang/commons-lang/maven-metadata-central.xml", convertedName ); + } + + // TODO: replace with group tests +// public void testUpdateProjectBadArtifact() +// throws Exception +// { +// try +// { +// assertUpdatedProjectMetadata( "bad_artifact", null ); +// fail( "Should have thrown an IOException on a bad artifact." ); +// } +// catch ( IOException e ) +// { +// // Expected path +// } +// } + + public void testUpdateProjectMissingMultipleVersions() + throws Exception + { + assertUpdatedProjectMetadata( "missing_metadata_b", new String[] { + "1.0", + "1.0.1", + "2.0", + "2.0.1", + "2.0-20070821-dev" }, "2.0-20070821-dev" , "2.0-20070821-dev" ); + } + + public void testUpdateProjectMissingMultipleVersionsWithProxies() + throws Exception + { + // Attach the (bogus) proxies to the managed repo. + // These proxied repositories do not need to exist for the purposes of this unit test, + // just the repository ids are important. + createProxyConnector( "test-repo", "central" ); + createProxyConnector( "test-repo", "java.net" ); + + assertUpdatedProjectMetadata( "proxied_multi", new String[] { + "1.0-spec" /* in java.net */, + "1.0" /* in managed, and central */, + "1.0.1" /* in central */, + "1.1" /* in managed */, + "2.0-proposal-beta" /* in java.net */, + "2.0-spec" /* in java.net */, + "2.0" /* in central, and java.net */, + "2.0.1" /* in java.net */, + "2.1" /* in managed */, + "3.0" /* in central */, + "3.1" /* in central */}, "3.1", "3.1" ); + } + + public void testUpdateProjectSimpleYetIncomplete() + throws Exception + { + assertUpdatedProjectMetadata( "incomplete_metadata_a", new String[] { "1.0" }, "1.0", "1.0" ); + } + + public void testUpdateProjectSimpleYetMissing() + throws Exception + { + assertUpdatedProjectMetadata( "missing_metadata_a", new String[] { "1.0" }, "1.0", "1.0" ); + } + + public void testUpdateVersionSimple10() + throws Exception + { + assertUpdatedReleaseVersionMetadata( "missing_metadata_a", "1.0" ); + } + + public void testUpdateVersionSimple20() + throws Exception + { + assertUpdatedReleaseVersionMetadata( "missing_metadata_b", "2.0" ); + } + + public void testUpdateVersionSimple20NotSnapshot() + throws Exception + { + assertUpdatedReleaseVersionMetadata( "missing_metadata_b", "2.0-20070821-dev" ); + } + + public void testUpdateVersionSnapshotA() + throws Exception + { + assertUpdatedSnapshotVersionMetadata( "snap_shots_a", "1.0-alpha-11-SNAPSHOT", "20070316", "175232", "11" ); + } + + public void testToPathFromVersionReference() + { + VersionedReference reference = new VersionedReference(); + reference.setGroupId( "com.foo" ); + reference.setArtifactId( "foo-tool" ); + reference.setVersion( "1.0" ); + + assertEquals( "com/foo/foo-tool/1.0/maven-metadata.xml", tools.toPath( reference ) ); + } + + public void testToPathFromProjectReference() + { + ProjectReference reference = new ProjectReference(); + reference.setGroupId( "com.foo" ); + reference.setArtifactId( "foo-tool" ); + + assertEquals( "com/foo/foo-tool/maven-metadata.xml", tools.toPath( reference ) ); + } + + public void testToProjectReferenceFooTools() + throws RepositoryMetadataException + { + assertProjectReference( "com.foo", "foo-tools", "com/foo/foo-tools/maven-metadata.xml" ); + } + + public void testToProjectReferenceAReallyLongPath() + throws RepositoryMetadataException + { + String groupId = "net.i.have.a.really.long.path.just.for.the.hell.of.it"; + String artifactId = "a"; + String path = "net/i/have/a/really/long/path/just/for/the/hell/of/it/a/maven-metadata.xml"; + + assertProjectReference( groupId, artifactId, path ); + } + + public void testToProjectReferenceCommonsLang() + throws RepositoryMetadataException + { + String groupId = "commons-lang"; + String artifactId = "commons-lang"; + String path = "commons-lang/commons-lang/maven-metadata.xml"; + + assertProjectReference( groupId, artifactId, path ); + } + + private void assertProjectReference( String groupId, String artifactId, String path ) + throws RepositoryMetadataException + { + ProjectReference reference = tools.toProjectReference( path ); + + assertNotNull( "Reference should not be null.", reference ); + assertEquals( "ProjectReference.groupId", groupId, reference.getGroupId() ); + assertEquals( "ProjectReference.artifactId", artifactId, reference.getArtifactId() ); + } + + public void testToVersionedReferenceFooTool() + throws RepositoryMetadataException + { + String groupId = "com.foo"; + String artifactId = "foo-tool"; + String version = "1.0"; + String path = "com/foo/foo-tool/1.0/maven-metadata.xml"; + + assertVersionedReference( groupId, artifactId, version, path ); + } + + public void testToVersionedReferenceAReallyLongPath() + throws RepositoryMetadataException + { + String groupId = "net.i.have.a.really.long.path.just.for.the.hell.of.it"; + String artifactId = "a"; + String version = "1.1-alpha-1"; + String path = "net/i/have/a/really/long/path/just/for/the/hell/of/it/a/1.1-alpha-1/maven-metadata.xml"; + + assertVersionedReference( groupId, artifactId, version, path ); + } + + public void testToVersionedReferenceCommonsLang() + throws RepositoryMetadataException + { + String groupId = "commons-lang"; + String artifactId = "commons-lang"; + String version = "2.1"; + String path = "commons-lang/commons-lang/2.1/maven-metadata.xml"; + + assertVersionedReference( groupId, artifactId, version, path ); + } + + public void testToVersionedReferenceSnapshot() + throws RepositoryMetadataException + { + String groupId = "com.foo"; + String artifactId = "foo-connector"; + String version = "2.1-SNAPSHOT"; + String path = "com/foo/foo-connector/2.1-SNAPSHOT/maven-metadata.xml"; + + assertVersionedReference( groupId, artifactId, version, path ); + } + + private void assertVersionedReference( String groupId, String artifactId, String version, String path ) + throws RepositoryMetadataException + { + VersionedReference reference = tools.toVersionedReference( path ); + assertNotNull( "Reference should not be null.", reference ); + + assertEquals( "VersionedReference.groupId", groupId, reference.getGroupId() ); + assertEquals( "VersionedReference.artifactId", artifactId, reference.getArtifactId() ); + assertEquals( "VersionedReference.version", version, reference.getVersion() ); + } + + private void assertSnapshotVersions( String artifactId, String version, String[] expectedVersions ) + throws Exception + { + File repoRootDir = new File( "src/test/repositories/metadata-repository" ); + + VersionedReference reference = new VersionedReference(); + reference.setGroupId( "org.apache.archiva.metadata.tests" ); + reference.setArtifactId( artifactId ); + reference.setVersion( version ); + + ManagedRepositoryConfiguration repo = createRepository( "test-repo", "Test Repository: " + getName(), + repoRootDir ); + ManagedRepositoryContent repoContent = (ManagedRepositoryContent) lookup( ManagedRepositoryContent.class, + "default" ); + repoContent.setRepository( repo ); + + Set testedVersionSet = tools.gatherSnapshotVersions( repoContent, reference ); + + // Sort the list (for asserts) + List testedVersions = new ArrayList(); + testedVersions.addAll( testedVersionSet ); + Collections.sort( testedVersions, new VersionComparator() ); + + // Test the expected array of versions, to the actual tested versions + assertEquals( "Assert Snapshot Versions: length/size", expectedVersions.length, testedVersions.size() ); + + for ( int i = 0; i < expectedVersions.length; i++ ) + { + String actualVersion = testedVersions.get( i ); + assertEquals( "Snapshot Versions[" + i + "]", expectedVersions[i], actualVersion ); + } + } + + private void assertMetadata( String expectedMetadata, ManagedRepositoryContent repository, + ProjectReference reference ) + throws LayoutException, IOException, SAXException, ParserConfigurationException + { + File metadataFile = new File( repository.getRepoRoot(), tools.toPath( reference ) ); + String actualMetadata = FileUtils.readFileToString( metadataFile, null ); + + DetailedDiff detailedDiff = new DetailedDiff( new Diff( expectedMetadata, actualMetadata ) ); + if ( !detailedDiff.similar() ) + { + // If it isn't similar, dump the difference. + assertEquals( expectedMetadata, actualMetadata ); + } + } + + private void assertMetadata( String expectedMetadata, ManagedRepositoryContent repository, + VersionedReference reference ) + throws LayoutException, IOException, SAXException, ParserConfigurationException + { + File metadataFile = new File( repository.getRepoRoot(), tools.toPath( reference ) ); + String actualMetadata = FileUtils.readFileToString( metadataFile, null ); + + DetailedDiff detailedDiff = new DetailedDiff( new Diff( expectedMetadata, actualMetadata ) ); + if ( !detailedDiff.similar() ) + { + // If it isn't similar, dump the difference. + assertEquals( expectedMetadata, actualMetadata ); + } + } + + private void assertMetadataPath( String expected, String actual ) + { + assertEquals( "Repository Specific Metadata Path", expected, actual ); + } + + private void assertUpdatedProjectMetadata( String artifactId, String[] expectedVersions ) + throws Exception + { + assertUpdatedProjectMetadata( artifactId, expectedVersions, null, null ); + } + + private void assertUpdatedProjectMetadata( String artifactId, String[] expectedVersions, String latestVersion, + String releaseVersion ) + throws Exception + { + ManagedRepositoryContent testRepo = createTestRepoContent(); + ProjectReference reference = new ProjectReference(); + reference.setGroupId( "org.apache.archiva.metadata.tests" ); + reference.setArtifactId( artifactId ); + + prepTestRepo( testRepo, reference ); + + tools.updateMetadata( testRepo, reference ); + + StringBuilder buf = new StringBuilder(); + buf.append( "\n" ); + buf.append( " " ).append( reference.getGroupId() ).append( "\n" ); + buf.append( " " ).append( reference.getArtifactId() ).append( "\n" ); + // buf.append( " 1.0\n" ); + + if ( expectedVersions != null ) + { + buf.append( " \n" ); + if ( latestVersion != null ) + { + buf.append( " " ).append( latestVersion ).append( "\n" ); + } + if ( releaseVersion != null ) + { + buf.append( " " ).append( releaseVersion ).append( "\n" ); + } + + buf.append( " \n" ); + for ( int i = 0; i < expectedVersions.length; i++ ) + { + buf.append( " " ).append( expectedVersions[i] ).append( "\n" ); + } + buf.append( " \n" ); + buf.append( " \n" ); + } + buf.append( "" ); + + assertMetadata( buf.toString(), testRepo, reference ); + } + + private void assertUpdatedReleaseVersionMetadata( String artifactId, String version ) + throws Exception + { + ManagedRepositoryContent testRepo = createTestRepoContent(); + VersionedReference reference = new VersionedReference(); + reference.setGroupId( "org.apache.archiva.metadata.tests" ); + reference.setArtifactId( artifactId ); + reference.setVersion( version ); + + prepTestRepo( testRepo, reference ); + + tools.updateMetadata( testRepo, reference ); + + StringBuilder buf = new StringBuilder(); + buf.append( "\n" ); + buf.append( " " ).append( reference.getGroupId() ).append( "\n" ); + buf.append( " " ).append( reference.getArtifactId() ).append( "\n" ); + buf.append( " " ).append( reference.getVersion() ).append( "\n" ); + buf.append( "" ); + + assertMetadata( buf.toString(), testRepo, reference ); + } + + private void assertUpdatedSnapshotVersionMetadata( String artifactId, String version, String expectedDate, + String expectedTime, String expectedBuildNumber ) + throws Exception + { + ManagedRepositoryContent testRepo = createTestRepoContent(); + VersionedReference reference = new VersionedReference(); + reference.setGroupId( "org.apache.archiva.metadata.tests" ); + reference.setArtifactId( artifactId ); + reference.setVersion( version ); + + prepTestRepo( testRepo, reference ); + + tools.updateMetadata( testRepo, reference ); + + StringBuilder buf = new StringBuilder(); + buf.append( "\n" ); + buf.append( " " ).append( reference.getGroupId() ).append( "\n" ); + buf.append( " " ).append( reference.getArtifactId() ).append( "\n" ); + buf.append( " " ).append( reference.getVersion() ).append( "\n" ); + buf.append( " \n" ); + buf.append( " \n" ); + buf.append( " " ).append( expectedBuildNumber ).append( "\n" ); + buf.append( " " ); + buf.append( expectedDate ).append( "." ).append( expectedTime ); + buf.append( "\n" ); + buf.append( " \n" ); + buf.append( " " ).append( expectedDate ).append( expectedTime ).append( "\n" ); + buf.append( " \n" ); + buf.append( "" ); + + assertMetadata( buf.toString(), testRepo, reference ); + } + + private void createProxyConnector( String sourceRepoId, String targetRepoId ) + { + ProxyConnectorConfiguration connectorConfig = new ProxyConnectorConfiguration(); + connectorConfig.setSourceRepoId( sourceRepoId ); + connectorConfig.setTargetRepoId( targetRepoId ); + connectorConfig.addPolicy( ProxyConnectorConfiguration.POLICY_CHECKSUM, ChecksumPolicy.IGNORE ); + connectorConfig.addPolicy( ProxyConnectorConfiguration.POLICY_RELEASES, ReleasesPolicy.ALWAYS ); + connectorConfig.addPolicy( ProxyConnectorConfiguration.POLICY_SNAPSHOTS, SnapshotsPolicy.ALWAYS ); + connectorConfig.addPolicy( ProxyConnectorConfiguration.POLICY_CACHE_FAILURES, CachedFailuresPolicy.NO ); + + int count = config.getConfiguration().getProxyConnectors().size(); + config.getConfiguration().addProxyConnector( connectorConfig ); + + // Proper Triggering ... + String prefix = "proxyConnectors.proxyConnector(" + count + ")"; + config.triggerChange( prefix + ".sourceRepoId", connectorConfig.getSourceRepoId() ); + config.triggerChange( prefix + ".targetRepoId", connectorConfig.getTargetRepoId() ); + config.triggerChange( prefix + ".proxyId", connectorConfig.getProxyId() ); + config.triggerChange( prefix + ".policies.releases", connectorConfig.getPolicy( "releases", "" ) ); + config.triggerChange( prefix + ".policies.checksum", connectorConfig.getPolicy( "checksum", "" ) ); + config.triggerChange( prefix + ".policies.snapshots", connectorConfig.getPolicy( "snapshots", "" ) ); + config.triggerChange( prefix + ".policies.cache-failures", connectorConfig.getPolicy( "cache-failures", "" ) ); + } + + private ManagedRepositoryContent createTestRepoContent() + throws Exception + { + File repoRoot = new File( "target/metadata-tests/" + getName() ); + if ( repoRoot.exists() ) + { + FileUtils.deleteDirectory( repoRoot ); + } + + repoRoot.mkdirs(); + + ManagedRepositoryConfiguration repoConfig = createRepository( "test-repo", "Test Repository: " + getName(), + repoRoot ); + + ManagedRepositoryContent repoContent = (ManagedRepositoryContent) lookup( ManagedRepositoryContent.class, + "default" ); + repoContent.setRepository( repoConfig ); + return repoContent; + } + + private void prepTestRepo( ManagedRepositoryContent repo, ProjectReference reference ) + throws IOException + { + String groupDir = StringUtils.replaceChars( reference.getGroupId(), '.', '/' ); + String path = groupDir + "/" + reference.getArtifactId(); + + File srcRepoDir = new File( "src/test/repositories/metadata-repository" ); + File srcDir = new File( srcRepoDir, path ); + File destDir = new File( repo.getRepoRoot(), path ); + + assertTrue( "Source Dir exists: " + srcDir, srcDir.exists() ); + destDir.mkdirs(); + + FileUtils.copyDirectory( srcDir, destDir ); + } + + private void prepTestRepo( ManagedRepositoryContent repo, VersionedReference reference ) + throws IOException + { + ProjectReference projectRef = new ProjectReference(); + projectRef.setGroupId( reference.getGroupId() ); + projectRef.setArtifactId( reference.getArtifactId() ); + + prepTestRepo( repo, projectRef ); + } + + protected void setUp() + throws Exception + { + super.setUp(); + + config = (MockConfiguration) lookup( ArchivaConfiguration.class.getName(), "mock" ); + tools = (MetadataTools) lookup( MetadataTools.class ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/metadata/RepositoryMetadataReaderTest.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/metadata/RepositoryMetadataReaderTest.java new file mode 100644 index 000000000..aabcc43fe --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/metadata/RepositoryMetadataReaderTest.java @@ -0,0 +1,67 @@ +package org.apache.maven.archiva.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.archiva.model.ArchivaRepositoryMetadata; +import org.codehaus.plexus.spring.PlexusInSpringTestCase; + +import java.io.File; + +/** + * RepositoryMetadataReaderTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class RepositoryMetadataReaderTest extends PlexusInSpringTestCase +{ + public void testLoadSimple() throws RepositoryMetadataException + { + File defaultRepoDir = new File( getBasedir(), "src/test/repositories/default-repository" ); + File metadataFile = new File( defaultRepoDir, "org/apache/maven/shared/maven-downloader/maven-metadata.xml" ); + + ArchivaRepositoryMetadata metadata = RepositoryMetadataReader.read( metadataFile ); + + assertNotNull( metadata ); + assertEquals( "Group Id", "org.apache.maven.shared", metadata.getGroupId() ); + assertEquals( "Artifact Id", "maven-downloader", metadata.getArtifactId() ); + assertEquals( "Released Version", "1.1", metadata.getReleasedVersion() ); + assertEquals( "List of Available Versions", 2, metadata.getAvailableVersions().size() ); + assertTrue( "Available version 1.0", metadata.getAvailableVersions().contains( "1.0" ) ); + assertTrue( "Available version 1.1", metadata.getAvailableVersions().contains( "1.1" ) ); + } + + public void testLoadComplex() throws RepositoryMetadataException + { + File defaultRepoDir = new File( getBasedir(), "src/test/repositories/default-repository" ); + File metadataFile = new File( defaultRepoDir, "org/apache/maven/samplejar/maven-metadata.xml" ); + + ArchivaRepositoryMetadata metadata = RepositoryMetadataReader.read( metadataFile ); + + assertNotNull( metadata ); + assertEquals( "Group Id", "org.apache.maven", metadata.getGroupId() ); + assertEquals( "Artifact Id", "samplejar", metadata.getArtifactId() ); + assertEquals( "Released Version", "2.0", metadata.getReleasedVersion() ); + assertEquals( "Latest Version", "6.0-SNAPSHOT", metadata.getLatestVersion() ); + assertEquals( "List of Available Versions", 18, metadata.getAvailableVersions().size() ); + assertTrue( "Available version 6.0-20060311.183228-10", metadata.getAvailableVersions().contains( "6.0-20060311.183228-10" ) ); + assertTrue( "Available version 6.0-SNAPSHOT", metadata.getAvailableVersions().contains( "6.0-SNAPSHOT" ) ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/metadata/RepositoryMetadataWriterTest.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/metadata/RepositoryMetadataWriterTest.java new file mode 100644 index 000000000..9fa2affc3 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/metadata/RepositoryMetadataWriterTest.java @@ -0,0 +1,61 @@ +package org.apache.maven.archiva.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.commons.io.FileUtils; +import org.apache.maven.archiva.model.ArchivaRepositoryMetadata; +import org.codehaus.plexus.spring.PlexusInSpringTestCase; +import org.custommonkey.xmlunit.XMLAssert; + +import java.io.File; +import java.io.StringWriter; + +/** + * RepositoryMetadataWriterTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class RepositoryMetadataWriterTest + extends PlexusInSpringTestCase +{ + public void testWriteSimple() + throws Exception + { + File defaultRepoDir = new File( getBasedir(), "src/test/repositories/default-repository" ); + File expectedFile = new File( defaultRepoDir, "org/apache/maven/shared/maven-downloader/maven-metadata.xml" ); + String expectedContent = FileUtils.readFileToString( expectedFile, null ); + + ArchivaRepositoryMetadata metadata = new ArchivaRepositoryMetadata(); + + metadata.setGroupId( "org.apache.maven.shared" ); + metadata.setArtifactId( "maven-downloader" ); + metadata.setVersion( "1.0" ); + metadata.setReleasedVersion( "1.1" ); + metadata.getAvailableVersions().add( "1.0" ); + metadata.getAvailableVersions().add( "1.1" ); + metadata.setLastUpdated( "20061212214311" ); + + StringWriter actual = new StringWriter(); + RepositoryMetadataWriter.write( metadata, actual ); + + XMLAssert.assertXMLEqual( "XML Contents", expectedContent, actual.toString() ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/filters/EffectiveProjectModelFilterTest.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/filters/EffectiveProjectModelFilterTest.java new file mode 100644 index 000000000..c4f04182b --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/filters/EffectiveProjectModelFilterTest.java @@ -0,0 +1,280 @@ +package org.apache.maven.archiva.repository.project.filters; + +/* + * 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.archiva.common.utils.VersionUtil; +import org.apache.maven.archiva.model.ArchivaProjectModel; +import org.apache.maven.archiva.model.Dependency; +import org.apache.maven.archiva.model.Individual; +import org.apache.maven.archiva.repository.AbstractRepositoryLayerTestCase; +import org.apache.maven.archiva.repository.ManagedRepositoryContent; +import org.apache.maven.archiva.repository.project.ProjectModelException; +import org.apache.maven.archiva.repository.project.ProjectModelFilter; +import org.apache.maven.archiva.repository.project.ProjectModelReader; +import org.apache.maven.archiva.repository.project.ProjectModelResolver; +import org.apache.maven.archiva.repository.project.ProjectModelResolverFactory; +import org.apache.maven.archiva.repository.project.readers.ProjectModel400Reader; +import org.apache.maven.archiva.repository.project.resolvers.ManagedRepositoryProjectResolver; + +import java.io.File; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +/** + * EffectiveProjectModelFilterTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class EffectiveProjectModelFilterTest + extends AbstractRepositoryLayerTestCase +{ + private static final String DEFAULT_REPOSITORY = "src/test/repositories/default-repository"; + + private EffectiveProjectModelFilter lookupEffective() + throws Exception + { + return (EffectiveProjectModelFilter) lookup( ProjectModelFilter.class, "effective" ); + } + + private ArchivaProjectModel createArchivaProjectModel( String path ) + throws ProjectModelException + { + ProjectModelReader reader = new ProjectModel400Reader(); + + File pomFile = new File( getBasedir(), path ); + + return reader.read( pomFile ); + } + + private ProjectModelResolver createDefaultRepositoryResolver() throws Exception + { + File defaultRepoDir = new File( getBasedir(), DEFAULT_REPOSITORY ); + + ManagedRepositoryContent repo = createManagedRepositoryContent( "defaultTestRepo", "Default Test Repo", defaultRepoDir, "default" ); + + ProjectModelReader reader = new ProjectModel400Reader(); + ManagedRepositoryProjectResolver resolver = new ManagedRepositoryProjectResolver( repo, reader ); + + return resolver; + } + + public void testBuildEffectiveProject() + throws Exception + { + initTestResolverFactory(); + EffectiveProjectModelFilter filter = lookupEffective(); + + ArchivaProjectModel startModel = createArchivaProjectModel( DEFAULT_REPOSITORY + + "/org/apache/maven/archiva/archiva-model/1.0-SNAPSHOT/archiva-model-1.0-SNAPSHOT.pom" ); + + ArchivaProjectModel effectiveModel = filter.filter( startModel ); + + ArchivaProjectModel expectedModel = createArchivaProjectModel( "src/test/expected-poms/" + + "/archiva-model-effective.pom" ); + + assertModel( expectedModel, effectiveModel ); + } + + /** + * [MRM-510] In Repository Browse, the first unique snapshot version clicked is getting persisted in the + * request resulting to 'version does not match' error + * + * The purpose of this test is ensure that timestamped SNAPSHOTS do not cache improperly, and each timestamped + * pom can be loaded through the effective project filter correctly. + */ + public void testBuildEffectiveSnapshotProject() + throws Exception + { + initTestResolverFactory(); + EffectiveProjectModelFilter filter = lookupEffective(); + + String axisVersions[] = new String[] { + "1.3-20070725.210059-1", + "1.3-20070725.232304-2", + "1.3-20070726.053327-3", + "1.3-20070726.173653-5", + "1.3-20070727.113106-7", + "1.3-20070728.053229-10", + "1.3-20070728.112043-11", + "1.3-20070729.171937-16", + "1.3-20070730.232112-20", + "1.3-20070731.113304-21", + "1.3-20070731.172936-22", + "1.3-20070802.113139-29" }; + + for ( int i = 0; i < axisVersions.length; i++ ) + { + assertTrue( "Version should be a unique snapshot.", VersionUtil.isUniqueSnapshot( axisVersions[i] ) ); + + ArchivaProjectModel initialModel = createArchivaProjectModel( DEFAULT_REPOSITORY + + "/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-" + axisVersions[i] + ".pom" ); + + // This is the process that ProjectModelToDatabaseConsumer uses, so we mimic it here. + // This logic is related to the MRM-510 jira. + String baseVersion = VersionUtil.getBaseVersion( axisVersions[i] ); + + assertEquals( "Base Version <" + baseVersion + "> of filename <" + axisVersions[i] + + "> should be equal to what is in model.", initialModel.getVersion(), baseVersion ); + + initialModel.setVersion( axisVersions[i] ); + + assertEquals( "Unique snapshot versions of initial model should be equal.", axisVersions[i], initialModel + .getVersion() ); + + ArchivaProjectModel effectiveModel = filter.filter( initialModel ); + + assertEquals( "Unique snapshot versions of initial model should be equal.", axisVersions[i], initialModel + .getVersion() ); + assertEquals( "Unique snapshot versions of filtered/effective model should be equal.", axisVersions[i], + effectiveModel.getVersion() ); + } + } + + private ProjectModelResolverFactory initTestResolverFactory() + throws Exception + { + ProjectModelResolverFactory resolverFactory = (ProjectModelResolverFactory) lookup( ProjectModelResolverFactory.class ); + + resolverFactory.getCurrentResolverStack().clearResolvers(); + resolverFactory.getCurrentResolverStack().addProjectModelResolver( createDefaultRepositoryResolver() ); + + return resolverFactory; + } + + private void assertModel( ArchivaProjectModel expectedModel, ArchivaProjectModel effectiveModel ) + { + assertEquals( "Equivalent Models", expectedModel, effectiveModel ); + + assertContainsSameIndividuals( "Individuals", expectedModel.getIndividuals(), effectiveModel.getIndividuals() ); + dumpDependencyList( "Expected", expectedModel.getDependencies() ); + dumpDependencyList( "Effective", effectiveModel.getDependencies() ); + assertContainsSameDependencies( "Dependencies", expectedModel.getDependencies(), effectiveModel + .getDependencies() ); + assertContainsSameDependencies( "DependencyManagement", expectedModel.getDependencyManagement(), effectiveModel + .getDependencyManagement() ); + } + + private void dumpDependencyList( String type, List deps ) + { + if ( deps == null ) + { + System.out.println( " Dependencies [" + type + "] is null." ); + return; + } + + if ( deps.isEmpty() ) + { + System.out.println( " Dependencies [" + type + "] dependency list is empty." ); + return; + } + + System.out.println( ".\\ [" + type + "] Dependency List (size:" + deps.size() + ") \\.________________" ); + Iterator it = deps.iterator(); + while ( it.hasNext() ) + { + Dependency dep = it.next(); + System.out.println( " " + Dependency.toKey( dep ) ); + } + System.out.println( "" ); + } + + private void assertEquivalentLists( String listId, List expectedList, List effectiveList ) + { + if ( ( expectedList == null ) && ( effectiveList == null ) ) + { + return; + } + + if ( ( expectedList == null ) && ( effectiveList != null ) ) + { + fail( "Effective [" + listId + "] List is instantiated, while expected List is null." ); + } + + if ( ( expectedList != null ) && ( effectiveList == null ) ) + { + fail( "Effective [" + listId + "] List is null, while expected List is instantiated." ); + } + + assertEquals( "[" + listId + "] List Size", expectedList.size(), expectedList.size() ); + } + + private void assertContainsSameIndividuals( String listId, List expectedList, + List effectiveList ) + { + assertEquivalentLists( listId, expectedList, effectiveList ); + + Map expectedMap = getIndividualsMap( expectedList ); + Map effectiveMap = getIndividualsMap( effectiveList ); + + Iterator it = expectedMap.keySet().iterator(); + while ( it.hasNext() ) + { + String key = (String) it.next(); + + assertTrue( "Should exist in Effective [" + listId + "] list: " + key, effectiveMap.containsKey( key ) ); + } + } + + private void assertContainsSameDependencies( String listId, List expectedList, + List effectiveList ) + { + assertEquivalentLists( listId, expectedList, effectiveList ); + + Map expectedMap = getDependencyMap( expectedList ); + Map effectiveMap = getDependencyMap( effectiveList ); + + Iterator it = expectedMap.keySet().iterator(); + while ( it.hasNext() ) + { + String key = it.next(); + + assertTrue( "Should exist in Effective [" + listId + "] list: " + key, effectiveMap.containsKey( key ) ); + } + } + + private Map getIndividualsMap( List individuals ) + { + Map map = new HashMap(); + Iterator it = individuals.iterator(); + while ( it.hasNext() ) + { + Individual individual = it.next(); + String key = individual.getEmail(); + map.put( key, individual ); + } + return map; + } + + private Map getDependencyMap( List deps ) + { + Map map = new HashMap(); + Iterator it = deps.iterator(); + while ( it.hasNext() ) + { + Dependency dep = it.next(); + String key = Dependency.toVersionlessKey( dep ); + map.put( key, dep ); + } + return map; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/filters/ProjectModelExpressionExpanderTest.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/filters/ProjectModelExpressionExpanderTest.java new file mode 100644 index 000000000..abb27d9fd --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/filters/ProjectModelExpressionExpanderTest.java @@ -0,0 +1,161 @@ +package org.apache.maven.archiva.repository.project.filters; + +/* + * 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.archiva.model.ArchivaProjectModel; +import org.apache.maven.archiva.model.Dependency; +import org.apache.maven.archiva.repository.project.ProjectModelException; +import org.apache.maven.archiva.repository.project.ProjectModelFilter; +import org.apache.maven.archiva.repository.project.ProjectModelReader; +import org.apache.maven.archiva.repository.project.ProjectModelWriter; +import org.apache.maven.archiva.repository.project.readers.ProjectModel400Reader; +import org.apache.maven.archiva.repository.project.writers.ProjectModel400Writer; +import org.codehaus.plexus.spring.PlexusInSpringTestCase; + +import java.io.File; +import java.io.IOException; +import java.io.StringWriter; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +/** + * ProjectModelExpressionExpanderTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ProjectModelExpressionExpanderTest + extends PlexusInSpringTestCase +{ + private static final String DEFAULT_REPOSITORY = "src/test/repositories/default-repository"; + + private ProjectModelExpressionFilter lookupExpression() + throws Exception + { + return (ProjectModelExpressionFilter) lookup( ProjectModelFilter.class, "expression" ); + } + + public void testExpressionEvaluation() + throws Exception + { + ArchivaProjectModel model = new ArchivaProjectModel(); + model.setGroupId( "org.apache.maven.archiva" ); + model.setArtifactId( "archiva-test-project" ); + model.setVersion( "1.0-SNAPSHOT" ); + + List deps = new ArrayList(); + + deps.add( createDependency( "org.apache.maven.archiva", "archiva-model", "${archiva.version}" ) ); + deps.add( createDependency( "org.apache.maven.archiva", "archiva-common", "${archiva.version}" ) ); + deps.add( createDependency( "org.apache.maven.archiva", "archiva-indexer", "${archiva.version}" ) ); + + model.setDependencies( deps ); + + model.addProperty( "archiva.version", "1.0-SNAPSHOT" ); + + ProjectModelExpressionFilter filter = lookupExpression(); + + model = filter.filter( model ); + + assertNotNull( model ); + assertEquals( "Group ID", "org.apache.maven.archiva", model.getGroupId() ); + assertEquals( "Artifact ID", "archiva-test-project", model.getArtifactId() ); + assertEquals( "Version", "1.0-SNAPSHOT", model.getVersion() ); + assertNotNull( "Dependencies", model.getDependencies() ); + assertEquals( "Dependencies Size", 3, model.getDependencies().size() ); + + Iterator it = model.getDependencies().iterator(); + while ( it.hasNext() ) + { + Dependency dep = it.next(); + assertEquals( "Dependency [" + dep.getArtifactId() + "] Group ID", "org.apache.maven.archiva", dep + .getGroupId() ); + assertEquals( "Dependency [" + dep.getArtifactId() + "] Version", "1.0-SNAPSHOT", dep.getVersion() ); + } + } + + /** + * [MRM-487] pom version is not resolved + * [MRM-488] properties in pom are not resolved (at least while browsing) + * + * This is to ensure that any expression within the pom is evaluated properly. + */ + public void testExpressionHell() + throws Exception + { + ProjectModelExpressionFilter filter = lookupExpression(); + + ArchivaProjectModel initialModel = createArchivaProjectModel( DEFAULT_REPOSITORY + + "/org/apache/maven/test/2.0.4-SNAPSHOT/test-2.0.4-SNAPSHOT.pom" ); + + ArchivaProjectModel filteredModel = filter.filter( initialModel ); + + // Dump the evaluated model to xml + String evaluatedModelText = toModelText( filteredModel ); + + // Test xml buffer for the existance of an unevaluated expression. + boolean foundUnevaluated = false; + if ( evaluatedModelText.indexOf( "${" ) != ( -1 ) ) + { + System.err.println( "Found Expression:\n" + evaluatedModelText ); + foundUnevaluated = true; + } + + if ( foundUnevaluated ) + { + fail( "Found Unevaluated Expression. (see System.err for details)" ); + } + } + + private String toModelText( ArchivaProjectModel model ) + throws ProjectModelException, IOException + { + StringWriter strWriter = new StringWriter(); + + ProjectModelWriter modelWriter = new ProjectModel400Writer(); + modelWriter.write( model, strWriter ); + + return strWriter.toString(); + } + + private ArchivaProjectModel createArchivaProjectModel( String path ) + throws ProjectModelException + { + ProjectModelReader reader = new ProjectModel400Reader(); + + File pomFile = new File( getBasedir(), path ); + + return reader.read( pomFile ); + } + + private Dependency createDependency( String groupId, String artifactId, String version ) + { + Dependency dep = new Dependency(); + + dep.setGroupId( groupId ); + dep.setArtifactId( artifactId ); + dep.setVersion( version ); + dep.setTransitive( false ); + + return dep; + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/readers/ProjectModel300ReaderTest.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/readers/ProjectModel300ReaderTest.java new file mode 100644 index 000000000..89453219f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/readers/ProjectModel300ReaderTest.java @@ -0,0 +1,67 @@ +package org.apache.maven.archiva.repository.project.readers; + +/* + * 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.archiva.model.ArchivaProjectModel; +import org.apache.maven.archiva.model.Dependency; +import org.apache.maven.archiva.repository.project.ProjectModelException; +import org.apache.maven.archiva.repository.project.ProjectModelReader; +import org.codehaus.plexus.spring.PlexusInSpringTestCase; + +import java.io.File; + +/** + * ProjectModel300ReaderTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ProjectModel300ReaderTest + extends PlexusInSpringTestCase +{ + public void testLoadSimple() + throws ProjectModelException + { + File defaultRepoDir = new File( getBasedir(), "src/test/repositories/legacy-repository" ); + File pomFile = new File( defaultRepoDir, "org.apache.maven/poms/maven-model-v3-2.0.pom" ); + + ProjectModelReader reader = new ProjectModel300Reader(); + + ArchivaProjectModel project = reader.read( pomFile ); + + assertNotNull( project ); + assertEquals( "Group Id", "org.apache.maven", project.getGroupId() ); + assertEquals( "Artifact Id", "maven-model-v3", project.getArtifactId() ); + assertEquals( "Version", "2.0", project.getVersion() ); + assertEquals( "Name", "Maven Model v3", project.getName() ); + assertEquals( "Description", "Maven Model v3", project.getDescription() ); + + assertNull( "Has no parent project.", project.getParentProject() ); + + assertNotNull( "Dependencies", project.getDependencies() ); + assertEquals( "Dependencies.size", 1, project.getDependencies().size() ); + + Dependency dep = (Dependency) project.getDependencies().get( 0 ); + assertNotNull( dep ); + assertEquals( "dep.groupId", "org.codehaus.plexus", dep.getGroupId() ); + assertEquals( "dep.artifactId", "plexus-utils", dep.getArtifactId() ); + assertEquals( "dep.version", "1.0.4", dep.getVersion() ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/readers/ProjectModel400ReaderTest.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/readers/ProjectModel400ReaderTest.java new file mode 100644 index 000000000..5d6d0c3b7 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/readers/ProjectModel400ReaderTest.java @@ -0,0 +1,97 @@ +package org.apache.maven.archiva.repository.project.readers; + +/* + * 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.archiva.model.ArchivaProjectModel; +import org.apache.maven.archiva.model.VersionedReference; +import org.apache.maven.archiva.repository.project.ProjectModelException; +import org.apache.maven.archiva.repository.project.ProjectModelReader; +import org.codehaus.plexus.spring.PlexusInSpringTestCase; + +import java.io.File; + +/** + * ProjectModel400ReaderTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ProjectModel400ReaderTest + extends PlexusInSpringTestCase +{ + public void testLoadSimple() + throws ProjectModelException + { + File defaultRepoDir = new File( getBasedir(), "src/test/repositories/default-repository" ); + File pomFile = new File( defaultRepoDir, + "org/apache/maven/shared/maven-downloader/1.0/maven-downloader-1.0.pom" ); + + ProjectModelReader reader = new ProjectModel400Reader(); + + ArchivaProjectModel project = reader.read( pomFile ); + + assertNotNull( project ); + assertEquals( "Group Id", "org.apache.maven.shared", project.getGroupId() ); + assertEquals( "Artifact Id", "maven-downloader", project.getArtifactId() ); + assertEquals( "Version", "1.0", project.getVersion() ); + assertEquals( "Name", "Maven Downloader", project.getName() ); + assertEquals( "Description", "Provide a super simple interface for downloading a single artifact.", project + .getDescription() ); + + // Test for parent + VersionedReference parentRef = project.getParentProject(); + assertNotNull( "Parent Reference", parentRef ); + assertEquals( "Parent Group ID", "org.apache.maven.shared", parentRef.getGroupId() ); + assertEquals( "Parent Artifact ID", "maven-shared-components", parentRef.getArtifactId() ); + assertEquals( "Parent Version", "4", parentRef.getVersion() ); + + assertNotNull( "Dependencies", project.getDependencies() ); + assertEquals( "Dependencies.size", 3, project.getDependencies().size() ); + } + + public void testLoadWithNamespace() + throws ProjectModelException + { + File defaultRepoDir = new File( getBasedir(), "src/test/repositories/default-repository" ); + File pomFile = new File( defaultRepoDir, + "org/apache/maven/archiva/archiva-model/1.0-SNAPSHOT/archiva-model-1.0-SNAPSHOT.pom" ); + + ProjectModelReader reader = new ProjectModel400Reader(); + + ArchivaProjectModel project = reader.read( pomFile ); + + assertNotNull( project ); + assertEquals( "Group Id", null, project.getGroupId() ); + assertEquals( "Artifact Id", "archiva-model", project.getArtifactId() ); + assertEquals( "Version", null, project.getVersion() ); + assertEquals( "Name", "Archiva Base :: Model", project.getName() ); + assertEquals( "Description", null, project.getDescription() ); + + // Test for parent + VersionedReference parentRef = project.getParentProject(); + assertNotNull( "Parent Reference", parentRef ); + assertEquals( "Parent Group ID", "org.apache.maven.archiva", parentRef.getGroupId() ); + assertEquals( "Parent Artifact ID", "archiva-base", parentRef.getArtifactId() ); + assertEquals( "Parent Version", "1.0-SNAPSHOT", parentRef.getVersion() ); + + assertNotNull( "Dependencies", project.getDependencies() ); + assertEquals( "Dependencies.size", 6, project.getDependencies().size() ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/writers/ProjectModel400WriterTest.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/writers/ProjectModel400WriterTest.java new file mode 100644 index 000000000..55b38e70e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/writers/ProjectModel400WriterTest.java @@ -0,0 +1,150 @@ +package org.apache.maven.archiva.repository.project.writers; + +/* + * 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.io.FileUtils; +import org.apache.maven.archiva.model.ArchivaProjectModel; +import org.apache.maven.archiva.repository.project.ProjectModelException; +import org.apache.maven.archiva.repository.project.ProjectModelReader; +import org.apache.maven.archiva.repository.project.ProjectModelWriter; +import org.apache.maven.archiva.repository.project.readers.ProjectModel400Reader; +import org.codehaus.plexus.spring.PlexusInSpringTestCase; +import org.custommonkey.xmlunit.DetailedDiff; +import org.custommonkey.xmlunit.Diff; + +import java.io.File; +import java.io.IOException; +import java.io.StringWriter; + +/** + * ProjectModel400WriterTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ProjectModel400WriterTest + extends PlexusInSpringTestCase +{ + private static final String DEFAULT_REPOSITORY = "src/test/repositories/default-repository"; + + private ProjectModelWriter modelWriter; + + @Override + protected void setUp() + throws Exception + { + super.setUp(); + + modelWriter = new ProjectModel400Writer(); + } + + public void testSimpleWrite() + throws Exception + { + ArchivaProjectModel model = new ArchivaProjectModel(); + model.setGroupId( "org.apache.archiva.test" ); + model.setArtifactId( "simple-model-write" ); + model.setVersion( "1.0" ); + + String actualModel = writeToString( model ); + String expectedModel = getExpectedModelString( "model-write-400-simple.pom" ); + + assertModelSimilar( expectedModel, actualModel ); + } + + public void testReadWriteSimple() + throws Exception + { + String pathToModel = DEFAULT_REPOSITORY + "/org/apache/maven/A/1.0/A-1.0.pom"; + ArchivaProjectModel model = createArchivaProjectModel( pathToModel ); + + String actualModel = writeToString( model ); + String expectedModel = FileUtils.readFileToString( new File( pathToModel ), null ); + + assertModelSimilar( expectedModel, actualModel ); + } + + public void testReadWriteMavenParent() + throws Exception + { + ArchivaProjectModel model = createArchivaProjectModel( DEFAULT_REPOSITORY + + "/org/apache/maven/maven-parent/4/maven-parent-4.pom" ); + + String actualModel = writeToString( model ); + String expectedModel = getExpectedModelString( "maven-parent-4.pom" ); + + assertModelSimilar( expectedModel, actualModel ); + } + + public void testReadWriteCocoon() + throws Exception + { + ArchivaProjectModel model = createArchivaProjectModel( DEFAULT_REPOSITORY + + "/org/apache/cocoon/cocoon/1/cocoon-1.pom" ); + + String actualModel = writeToString( model ); + String expectedModel = getExpectedModelString( "cocoon-1.pom" ); + + assertModelSimilar( expectedModel, actualModel ); + } + + private void assertModelSimilar( String expectedModel, String actualModel ) + throws Exception + { + Diff diff = new Diff( expectedModel, actualModel ); + DetailedDiff detailedDiff = new DetailedDiff( diff ); + if ( !detailedDiff.similar() ) + { + // If it isn't similar, dump the difference. + System.out.println( detailedDiff.toString() ); + System.out.println( "-- Actual Model --\n" + actualModel + "\n---------------\n\n" ); + System.out.println( "-- Expected Model --\n" + expectedModel + "\n---------------\n\n" ); + + assertEquals( expectedModel, actualModel ); + } + } + + private String getExpectedModelString( String pomfilename ) + throws IOException + { + File pomFile = getTestFile( "src/test/expected-poms/" + pomfilename ); + return FileUtils.readFileToString( pomFile, null ); + } + + private ArchivaProjectModel createArchivaProjectModel( String path ) + throws ProjectModelException + { + ProjectModelReader reader = new ProjectModel400Reader(); + + File pomFile = new File( getBasedir(), path ); + + return reader.read( pomFile ); + } + + private String writeToString( ArchivaProjectModel model ) + throws ProjectModelException, IOException + { + StringWriter writer = new StringWriter(); + + modelWriter.write( model, writer ); + + return writer.toString(); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/InvalidScanConsumer.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/InvalidScanConsumer.java new file mode 100644 index 000000000..3a6e45ec0 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/InvalidScanConsumer.java @@ -0,0 +1,98 @@ +package org.apache.maven.archiva.repository.scanner; + +/* + * 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.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer; +import org.apache.maven.archiva.consumers.ConsumerException; +import org.apache.maven.archiva.consumers.InvalidRepositoryContentConsumer; + +import java.util.Date; +import java.util.List; + +/** + * InvalidScanConsumer + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class InvalidScanConsumer + extends AbstractMonitoredConsumer + implements InvalidRepositoryContentConsumer +{ + /** + * @plexus.configuration default-value="unset-id" + */ + private String id = "unset-id"; + + private int processCount = 0; + + public void beginScan( ManagedRepositoryConfiguration repository, Date whenGathered ) + throws ConsumerException + { + /* do nothing */ + } + + public void completeScan() + { + /* do nothing */ + } + + public List getExcludes() + { + return null; + } + + public List getIncludes() + { + return null; + } + + public void processFile( String path ) + throws ConsumerException + { + processCount++; + } + + public String getDescription() + { + return "Bad Content Scan Consumer (for testing)"; + } + + public String getId() + { + return id; + } + + public boolean isPermanent() + { + return false; + } + + public int getProcessCount() + { + return processCount; + } + + public void setProcessCount( int processCount ) + { + this.processCount = processCount; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/KnownScanConsumer.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/KnownScanConsumer.java new file mode 100644 index 000000000..ba0cf6677 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/KnownScanConsumer.java @@ -0,0 +1,115 @@ +package org.apache.maven.archiva.repository.scanner; + +/* + * 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.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer; +import org.apache.maven.archiva.consumers.ConsumerException; +import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.List; + +/** + * ScanConsumer + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class KnownScanConsumer + extends AbstractMonitoredConsumer + implements KnownRepositoryContentConsumer +{ + private int processCount = 0; + + private List includes = new ArrayList(); + + private boolean processUnmodified = false; + + public List getExcludes() + { + return null; + } + + public void setIncludes( String includesArray[] ) + { + this.includes.clear(); + this.includes.addAll( Arrays.asList( includesArray ) ); + } + + public List getIncludes() + { + return includes; + } + + public String getId() + { + return "test-scan-consumer"; + } + + public String getDescription() + { + return "Scan Consumer (for testing)"; + } + + public void beginScan( ManagedRepositoryConfiguration repository, Date whenGathered ) + throws ConsumerException + { + /* do nothing */ + } + + public void processFile( String path ) + throws ConsumerException + { + this.processCount++; + } + + public void completeScan() + { + /* do nothing */ + } + + public int getProcessCount() + { + return processCount; + } + + public void setProcessCount( int processCount ) + { + this.processCount = processCount; + } + + public boolean isPermanent() + { + return false; + } + + public boolean isProcessUnmodified() + { + return processUnmodified; + } + + public void setProcessUnmodified( boolean processUnmodified ) + { + this.processUnmodified = processUnmodified; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumersStub.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumersStub.java new file mode 100644 index 000000000..8d3780c26 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumersStub.java @@ -0,0 +1,15 @@ +package org.apache.maven.archiva.repository.scanner; + +import java.util.Date; + +public class RepositoryContentConsumersStub + extends RepositoryContentConsumers +{ + public Date getStartTime() + { + Date startTimeForTest = new Date( System.currentTimeMillis() ); + startTimeForTest.setTime( 12345678 ); + + return startTimeForTest; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumersTest.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumersTest.java new file mode 100644 index 000000000..b2bfa7215 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumersTest.java @@ -0,0 +1,307 @@ +package org.apache.maven.archiva.repository.scanner; + +/* + * 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.SystemUtils; +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.consumers.InvalidRepositoryContentConsumer; +import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer; +import org.apache.maven.archiva.repository.AbstractRepositoryLayerTestCase; +import org.easymock.MockControl; + +import java.io.File; +import java.util.Arrays; +import java.util.Collections; +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * RepositoryContentConsumersTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class RepositoryContentConsumersTest + extends AbstractRepositoryLayerTestCase +{ + private RepositoryContentConsumers lookupRepositoryConsumers() + throws Exception + { + RepositoryContentConsumers consumerUtilStub = (RepositoryContentConsumers) lookup( RepositoryContentConsumers.class + .getName(), "test" ); + ArchivaConfiguration archivaConfiguration = (ArchivaConfiguration) lookup( ArchivaConfiguration.ROLE ); + RepositoryContentConsumers consumerUtil = (RepositoryContentConsumers) lookup( RepositoryContentConsumers.class + .getName() ); + + consumerUtilStub.setAvailableKnownConsumers( consumerUtil.getAvailableKnownConsumers() ); + consumerUtilStub.setAvailableInvalidConsumers( consumerUtil.getAvailableInvalidConsumers() ); + consumerUtilStub.setSelectedInvalidConsumers( consumerUtil.getSelectedInvalidConsumers() ); + consumerUtilStub.setSelectedKnownConsumers( consumerUtil.getSelectedKnownConsumers() ); + consumerUtilStub.setArchivaConfiguration( archivaConfiguration ); + + assertNotNull( "RepositoryContentConsumers should not be null.", consumerUtilStub ); + + return consumerUtilStub; + } + + public void testGetSelectedKnownIds() + throws Exception + { + RepositoryContentConsumers consumerutil = lookupRepositoryConsumers(); + + String expectedKnownIds[] = new String[] { + "update-db-artifact", + "create-missing-checksums", + "update-db-repository-metadata", + "validate-checksum", + "validate-signature", + "index-content", + "auto-remove", + "auto-rename" }; + + List knownConsumers = consumerutil.getSelectedKnownConsumerIds(); + assertNotNull( "Known Consumer IDs should not be null", knownConsumers ); + assertEquals( "Known Consumer IDs.size", expectedKnownIds.length, knownConsumers.size() ); + + for ( String expectedId : expectedKnownIds ) + { + assertTrue( "Known id [" + expectedId + "] exists.", knownConsumers.contains( expectedId ) ); + } + } + + public void testGetSelectedInvalidIds() + throws Exception + { + RepositoryContentConsumers consumerutil = lookupRepositoryConsumers(); + + String expectedInvalidIds[] = new String[] { "update-db-bad-content" }; + + List invalidConsumers = consumerutil.getSelectedInvalidConsumerIds(); + assertNotNull( "Invalid Consumer IDs should not be null", invalidConsumers ); + assertEquals( "Invalid Consumer IDs.size", expectedInvalidIds.length, invalidConsumers.size() ); + + for ( String expectedId : expectedInvalidIds ) + { + assertTrue( "Invalid id [" + expectedId + "] exists.", invalidConsumers.contains( expectedId ) ); + } + } + + public void testGetSelectedKnownConsumerMap() + throws Exception + { + RepositoryContentConsumers consumerutil = lookupRepositoryConsumers(); + + String expectedSelectedKnownIds[] = new String[] { + "update-db-artifact", + "create-missing-checksums", + "update-db-repository-metadata", + "validate-checksum", + "index-content", + "auto-remove", + "auto-rename" }; + + Map knownConsumerMap = consumerutil.getSelectedKnownConsumersMap(); + assertNotNull( "Known Consumer Map should not be null", knownConsumerMap ); + assertEquals( "Known Consumer Map.size", expectedSelectedKnownIds.length, knownConsumerMap.size() ); + + for ( String expectedId : expectedSelectedKnownIds ) + { + KnownRepositoryContentConsumer consumer = knownConsumerMap.get( expectedId ); + assertNotNull( "Known[" + expectedId + "] should not be null.", consumer ); + assertEquals( "Known[" + expectedId + "].id", expectedId, consumer.getId() ); + } + } + + public void testGetSelectedInvalidConsumerMap() + throws Exception + { + RepositoryContentConsumers consumerutil = lookupRepositoryConsumers(); + + String expectedSelectedInvalidIds[] = new String[] { "update-db-bad-content" }; + + Map invalidConsumerMap = consumerutil + .getSelectedInvalidConsumersMap(); + assertNotNull( "Invalid Consumer Map should not be null", invalidConsumerMap ); + assertEquals( "Invalid Consumer Map.size", expectedSelectedInvalidIds.length, invalidConsumerMap.size() ); + + for ( String expectedId : expectedSelectedInvalidIds ) + { + InvalidRepositoryContentConsumer consumer = invalidConsumerMap.get( expectedId ); + assertNotNull( "Known[" + expectedId + "] should not be null.", consumer ); + assertEquals( "Known[" + expectedId + "].id", expectedId, consumer.getId() ); + } + } + + public void testGetAvailableKnownList() + throws Exception + { + RepositoryContentConsumers consumerutil = lookupRepositoryConsumers(); + + String expectedKnownIds[] = new String[] { + "update-db-artifact", + "create-missing-checksums", + "update-db-repository-metadata", + "validate-checksum", + "index-content", + "auto-remove", + "auto-rename", + "available-but-unselected" }; + + List knownConsumers = consumerutil.getAvailableKnownConsumers(); + assertNotNull( "known consumers should not be null.", knownConsumers ); + assertEquals( "known consumers", expectedKnownIds.length, knownConsumers.size() ); + + List expectedIds = Arrays.asList( expectedKnownIds ); + for ( KnownRepositoryContentConsumer consumer : knownConsumers ) + { + assertTrue( "Consumer [" + consumer.getId() + "] returned by .getAvailableKnownConsumers() is unexpected.", + expectedIds.contains( consumer.getId() ) ); + } + } + + public void testGetAvailableInvalidList() + throws Exception + { + RepositoryContentConsumers consumerutil = lookupRepositoryConsumers(); + + String expectedInvalidIds[] = new String[] { "update-db-bad-content", "move-to-trash-then-notify" }; + + List invalidConsumers = consumerutil.getAvailableInvalidConsumers(); + assertNotNull( "invalid consumers should not be null.", invalidConsumers ); + assertEquals( "invalid consumers", expectedInvalidIds.length, invalidConsumers.size() ); + + List expectedIds = Arrays.asList( expectedInvalidIds ); + for ( InvalidRepositoryContentConsumer consumer : invalidConsumers ) + { + assertTrue( "Consumer [" + consumer.getId() + + "] returned by .getAvailableInvalidConsumers() is unexpected.", expectedIds.contains( consumer + .getId() ) ); + } + } + + public void testExecution() + throws Exception + { + MockControl knownControl = MockControl.createNiceControl( KnownRepositoryContentConsumer.class ); + RepositoryContentConsumers consumers = lookupRepositoryConsumers(); + KnownRepositoryContentConsumer selectedKnownConsumer = (KnownRepositoryContentConsumer) knownControl.getMock(); + KnownRepositoryContentConsumer unselectedKnownConsumer = + (KnownRepositoryContentConsumer) MockControl.createNiceControl( + KnownRepositoryContentConsumer.class ).getMock(); + consumers.setAvailableKnownConsumers( Arrays.asList( selectedKnownConsumer, unselectedKnownConsumer ) ); + consumers.setSelectedKnownConsumers( Collections.singletonList( selectedKnownConsumer ) ); + + MockControl invalidControl = MockControl.createControl( InvalidRepositoryContentConsumer.class ); + InvalidRepositoryContentConsumer selectedInvalidConsumer = + (InvalidRepositoryContentConsumer) invalidControl.getMock(); + InvalidRepositoryContentConsumer unselectedInvalidConsumer = + (InvalidRepositoryContentConsumer) MockControl.createControl( + InvalidRepositoryContentConsumer.class ).getMock(); + consumers.setAvailableInvalidConsumers( Arrays.asList( selectedInvalidConsumer, unselectedInvalidConsumer ) ); + consumers.setSelectedInvalidConsumers( Collections.singletonList( selectedInvalidConsumer ) ); + + ManagedRepositoryConfiguration repo = createRepository( "id", "name", getTestFile( "target/test-repo" ) ); + File testFile = getTestFile( "target/test-repo/path/to/test-file.txt" ); + + Date startTime = new Date( System.currentTimeMillis() ); + startTime.setTime( 12345678 ); + + selectedKnownConsumer.beginScan( repo, startTime ); + selectedKnownConsumer.getExcludes(); + knownControl.setReturnValue( Collections.EMPTY_LIST ); + selectedKnownConsumer.getIncludes(); + knownControl.setReturnValue( Collections.singletonList( "**/*.txt" ) ); + selectedKnownConsumer.processFile( _OS( "path/to/test-file.txt" ) ); + // knownConsumer.completeScan(); + knownControl.replay(); + + selectedInvalidConsumer.beginScan( repo, startTime ); + // invalidConsumer.completeScan(); + invalidControl.replay(); + + consumers.executeConsumers( repo, testFile ); + + knownControl.verify(); + invalidControl.verify(); + + knownControl.reset(); + invalidControl.reset(); + + File notIncludedTestFile = getTestFile( "target/test-repo/path/to/test-file.xml" ); + + selectedKnownConsumer.beginScan( repo, startTime ); + selectedKnownConsumer.getExcludes(); + knownControl.setReturnValue( Collections.EMPTY_LIST ); + selectedKnownConsumer.getIncludes(); + knownControl.setReturnValue( Collections.singletonList( "**/*.txt" ) ); + // knownConsumer.completeScan(); + knownControl.replay(); + + selectedInvalidConsumer.beginScan( repo, startTime ); + selectedInvalidConsumer.processFile( _OS( "path/to/test-file.xml" ) ); + selectedInvalidConsumer.getId(); + invalidControl.setReturnValue( "invalid" ); + // invalidConsumer.completeScan(); + invalidControl.replay(); + + consumers.executeConsumers( repo, notIncludedTestFile ); + + knownControl.verify(); + invalidControl.verify(); + + knownControl.reset(); + invalidControl.reset(); + + File excludedTestFile = getTestFile( "target/test-repo/path/to/test-file.txt" ); + + selectedKnownConsumer.beginScan( repo, startTime ); + selectedKnownConsumer.getExcludes(); + knownControl.setReturnValue( Collections.singletonList( "**/test-file.txt" ) ); + // knownConsumer.completeScan(); + knownControl.replay(); + + selectedInvalidConsumer.beginScan( repo, startTime ); + selectedInvalidConsumer.processFile( _OS( "path/to/test-file.txt" ) ); + selectedInvalidConsumer.getId(); + invalidControl.setReturnValue( "invalid" ); + // invalidConsumer.completeScan(); + invalidControl.replay(); + + consumers.executeConsumers( repo, excludedTestFile ); + + knownControl.verify(); + invalidControl.verify(); + } + + /** + * Create an OS specific version of the filepath. + * Provide path in unix "/" format. + */ + private String _OS( String path ) + { + if ( SystemUtils.IS_OS_WINDOWS ) + { + return path.replace( '/', '\\' ); + } + return path; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/RepositoryScannerTest.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/RepositoryScannerTest.java new file mode 100644 index 000000000..871925766 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/RepositoryScannerTest.java @@ -0,0 +1,390 @@ +package org.apache.maven.archiva.repository.scanner; + +/* + * 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.io.FileUtils; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.model.RepositoryContentStatistics; +import org.apache.maven.archiva.repository.AbstractRepositoryLayerTestCase; + +import java.io.File; +import java.io.IOException; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Locale; +import java.util.TimeZone; + +/** + * RepositoryScannerTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class RepositoryScannerTest + extends AbstractRepositoryLayerTestCase +{ + private static final String[] ARTIFACT_PATTERNS = + new String[]{"**/*.jar", "**/*.pom", "**/*.rar", "**/*.zip", "**/*.war", "**/*.tar.gz"}; + + private ManagedRepositoryConfiguration createDefaultRepository() + { + File repoDir = new File( getBasedir(), "src/test/repositories/default-repository" ); + + assertTrue( "Default Test Repository should exist.", repoDir.exists() && repoDir.isDirectory() ); + + return createRepository( "testDefaultRepo", "Test Default Repository", repoDir ); + } + + private ManagedRepositoryConfiguration createSimpleRepository() + throws IOException, ParseException + { + File srcDir = new File( getBasedir(), "src/test/repositories/simple-repository" ); + + File repoDir = getTestFile( "target/test-repos/simple-repository" ); + + FileUtils.deleteDirectory( repoDir ); + + FileUtils.copyDirectory( srcDir, repoDir ); + + File repoFile = new File( repoDir, + "groupId/snapshot-artifact/1.0-alpha-1-SNAPSHOT/snapshot-artifact-1.0-alpha-1-20050611.202024-1.pom" ); + repoFile.setLastModified( getTimestampAsMillis( "20050611.202024" ) ); + + assertTrue( "Simple Test Repository should exist.", repoDir.exists() && repoDir.isDirectory() ); + + return createRepository( "testSimpleRepo", "Test Simple Repository", repoDir ); + } + + private static long getTimestampAsMillis( String timestamp ) + throws ParseException + { + SimpleDateFormat fmt = new SimpleDateFormat( "yyyyMMdd.HHmmss", Locale.US ); + fmt.setTimeZone( TimeZone.getTimeZone( "UTC" ) ); + return fmt.parse( timestamp ).getTime(); + } + + private ManagedRepositoryConfiguration createLegacyRepository() + { + File repoDir = new File( getBasedir(), "src/test/repositories/legacy-repository" ); + + assertTrue( "Legacy Test Repository should exist.", repoDir.exists() && repoDir.isDirectory() ); + + ManagedRepositoryConfiguration repo = createRepository( "testLegacyRepo", "Test Legacy Repository", repoDir ); + repo.setLayout( "legacy" ); + + return repo; + } + + private void assertMinimumHits( String msg, int minimumHitCount, long actualCount ) + { + if ( actualCount < minimumHitCount ) + { + fail( "Minimum hit count on " + msg + " not satisfied. Expected more than <" + minimumHitCount + + ">, but actually got <" + actualCount + ">." ); + } + } + + private RepositoryScanner lookupRepositoryScanner() + throws Exception + { + return (RepositoryScanner) lookup( RepositoryScanner.class ); + } + + private List getIgnoreList() + { + List ignores = new ArrayList(); + ignores.addAll( Arrays.asList( RepositoryScanner.IGNORABLE_CONTENT ) ); + return ignores; + } + + public void testTimestampRepositoryScanner() + throws Exception + { + ManagedRepositoryConfiguration repository = createSimpleRepository(); + + List knownConsumers = new ArrayList(); + KnownScanConsumer consumer = new KnownScanConsumer(); + consumer.setIncludes( ARTIFACT_PATTERNS ); + knownConsumers.add( consumer ); + + List invalidConsumers = new ArrayList(); + InvalidScanConsumer badconsumer = new InvalidScanConsumer(); + invalidConsumers.add( badconsumer ); + + RepositoryScanner scanner = lookupRepositoryScanner(); + + RepositoryContentStatistics stats = scanner.scan( repository, knownConsumers, invalidConsumers, getIgnoreList(), + getTimestampAsMillis( "20061101.000000" ) ); + + assertNotNull( "Stats should not be null.", stats ); + assertEquals( "Stats.totalFileCount", 4, stats.getTotalFileCount() ); + assertEquals( "Stats.newFileCount", 3, stats.getNewFileCount() ); + assertEquals( "Processed Count", 2, consumer.getProcessCount() ); + assertEquals( "Processed Count (of invalid items)", 1, badconsumer.getProcessCount() ); + } + + public void testTimestampRepositoryScannerFreshScan() + throws Exception + { + ManagedRepositoryConfiguration repository = createSimpleRepository(); + + List knownConsumers = new ArrayList(); + KnownScanConsumer consumer = new KnownScanConsumer(); + consumer.setIncludes( ARTIFACT_PATTERNS ); + knownConsumers.add( consumer ); + + List invalidConsumers = new ArrayList(); + InvalidScanConsumer badconsumer = new InvalidScanConsumer(); + invalidConsumers.add( badconsumer ); + + RepositoryScanner scanner = lookupRepositoryScanner(); + RepositoryContentStatistics stats = + scanner.scan( repository, knownConsumers, invalidConsumers, getIgnoreList(), RepositoryScanner.FRESH_SCAN ); + + assertNotNull( "Stats should not be null.", stats ); + assertEquals( "Stats.totalFileCount", 4, stats.getTotalFileCount() ); + assertEquals( "Stats.newFileCount", 4, stats.getNewFileCount() ); + assertEquals( "Processed Count", 3, consumer.getProcessCount() ); + assertEquals( "Processed Count (of invalid items)", 1, badconsumer.getProcessCount() ); + } + + public void testTimestampRepositoryScannerProcessUnmodified() + throws Exception + { + ManagedRepositoryConfiguration repository = createSimpleRepository(); + + List knownConsumers = new ArrayList(); + KnownScanConsumer consumer = new KnownScanConsumer(); + consumer.setProcessUnmodified( true ); + consumer.setIncludes( ARTIFACT_PATTERNS ); + knownConsumers.add( consumer ); + + List invalidConsumers = new ArrayList(); + InvalidScanConsumer badconsumer = new InvalidScanConsumer(); + invalidConsumers.add( badconsumer ); + + RepositoryScanner scanner = lookupRepositoryScanner(); + RepositoryContentStatistics stats = scanner.scan( repository, knownConsumers, invalidConsumers, getIgnoreList(), + getTimestampAsMillis( "20061101.000000" ) ); + + assertNotNull( "Stats should not be null.", stats ); + assertEquals( "Stats.totalFileCount", 4, stats.getTotalFileCount() ); + assertEquals( "Stats.newFileCount", 3, stats.getNewFileCount() ); + assertEquals( "Processed Count", 3, consumer.getProcessCount() ); + assertEquals( "Processed Count (of invalid items)", 1, badconsumer.getProcessCount() ); + } + + public void testDefaultRepositoryScanner() + throws Exception + { + ManagedRepositoryConfiguration repository = createDefaultRepository(); + + List knownConsumers = new ArrayList(); + KnownScanConsumer consumer = new KnownScanConsumer(); + consumer.setIncludes( new String[]{"**/*.jar", "**/*.war", "**/*.pom", "**/maven-metadata.xml", "**/*-site.xml", + "**/*.zip", "**/*.tar.gz", "**/*.sha1", "**/*.md5"} ); + knownConsumers.add( consumer ); + + List invalidConsumers = new ArrayList(); + InvalidScanConsumer badconsumer = new InvalidScanConsumer(); + invalidConsumers.add( badconsumer ); + + RepositoryScanner scanner = lookupRepositoryScanner(); + RepositoryContentStatistics stats = + scanner.scan( repository, knownConsumers, invalidConsumers, getIgnoreList(), RepositoryScanner.FRESH_SCAN ); + + assertNotNull( "Stats should not be null.", stats ); + assertMinimumHits( "Stats.totalFileCount", 17, stats.getTotalFileCount() ); + assertMinimumHits( "Processed Count", 17, consumer.getProcessCount() ); + assertEquals( "Processed Count (of invalid items)", 6, badconsumer.getProcessCount() ); + } + + public void testDefaultRepositoryArtifactScanner() + throws Exception + { + List actualArtifactPaths = new ArrayList(); + + actualArtifactPaths.add( "invalid/invalid/1.0-20050611.123456-1/invalid-1.0-20050611.123456-1.jar" ); + actualArtifactPaths.add( "invalid/invalid/1.0-SNAPSHOT/invalid-1.0.jar" ); + actualArtifactPaths.add( "invalid/invalid/1.0/invalid-1.0b.jar" ); + actualArtifactPaths.add( "invalid/invalid/1.0/invalid-2.0.jar" ); + actualArtifactPaths.add( "invalid/invalid-1.0.jar" ); + actualArtifactPaths.add( "org/apache/maven/test/1.0-SNAPSHOT/wrong-artifactId-1.0-20050611.112233-1.jar" ); + actualArtifactPaths.add( "org/apache/maven/test/1.0-SNAPSHOT/test-1.0-20050611.112233-1-javadoc.jar" ); + actualArtifactPaths.add( "org/apache/maven/test/1.0-SNAPSHOT/test-1.0-20050611.112233-1.jar" ); + actualArtifactPaths.add( "org/apache/maven/A/1.0/A-1.0.war" ); + actualArtifactPaths.add( "org/apache/maven/A/1.0/A-1.0.pom" ); + actualArtifactPaths.add( "org/apache/maven/B/2.0/B-2.0.pom" ); + actualArtifactPaths.add( "org/apache/maven/B/1.0/B-1.0.pom" ); + actualArtifactPaths.add( "org/apache/maven/some-ejb/1.0/some-ejb-1.0-client.jar" ); + actualArtifactPaths.add( "org/apache/maven/C/1.0/C-1.0.war" ); + actualArtifactPaths.add( "org/apache/maven/C/1.0/C-1.0.pom" ); + actualArtifactPaths.add( "org/apache/maven/update/test-not-updated/1.0/test-not-updated-1.0.pom" ); + actualArtifactPaths.add( "org/apache/maven/update/test-not-updated/1.0/test-not-updated-1.0.jar" ); + actualArtifactPaths.add( "org/apache/maven/update/test-updated/1.0/test-updated-1.0.pom" ); + actualArtifactPaths.add( "org/apache/maven/update/test-updated/1.0/test-updated-1.0.jar" ); + actualArtifactPaths.add( "org/apache/maven/discovery/1.0/discovery-1.0.pom" ); + actualArtifactPaths.add( "org/apache/maven/testing/1.0/testing-1.0-test-sources.jar" ); + actualArtifactPaths.add( "org/apache/maven/testing/1.0/testing-1.0.jar" ); + actualArtifactPaths.add( "org/apache/maven/testing/1.0/testing-1.0-sources.jar" ); + actualArtifactPaths.add( "org/apache/maven/testing/1.0/testing-1.0.zip" ); + actualArtifactPaths.add( "org/apache/maven/testing/1.0/testing-1.0.tar.gz" ); + actualArtifactPaths.add( "org/apache/maven/samplejar/2.0/samplejar-2.0.pom" ); + actualArtifactPaths.add( "org/apache/maven/samplejar/2.0/samplejar-2.0.jar" ); + actualArtifactPaths.add( "org/apache/maven/samplejar/1.0/samplejar-1.0.pom" ); + actualArtifactPaths.add( "org/apache/maven/samplejar/1.0/samplejar-1.0.jar" ); + actualArtifactPaths.add( "org/apache/testgroup/discovery/1.0/discovery-1.0.pom" ); + actualArtifactPaths.add( "javax/sql/jdbc/2.0/jdbc-2.0.jar" ); + + ManagedRepositoryConfiguration repository = createDefaultRepository(); + + List knownConsumers = new ArrayList(); + KnownScanConsumer consumer = new KnownScanConsumer(); + consumer.setIncludes( ARTIFACT_PATTERNS ); + knownConsumers.add( consumer ); + + List invalidConsumers = new ArrayList(); + InvalidScanConsumer badconsumer = new InvalidScanConsumer(); + invalidConsumers.add( badconsumer ); + + RepositoryScanner scanner = lookupRepositoryScanner(); + RepositoryContentStatistics stats = + scanner.scan( repository, knownConsumers, invalidConsumers, getIgnoreList(), RepositoryScanner.FRESH_SCAN ); + + assertNotNull( "Stats should not be null.", stats ); + assertMinimumHits( "Stats.totalFileCount", actualArtifactPaths.size(), stats.getTotalFileCount() ); + assertMinimumHits( "Processed Count", actualArtifactPaths.size(), consumer.getProcessCount() ); + } + + public void testDefaultRepositoryMetadataScanner() + throws Exception + { + List actualMetadataPaths = new ArrayList(); + + actualMetadataPaths.add( "org/apache/maven/some-ejb/1.0/maven-metadata.xml" ); + actualMetadataPaths.add( "org/apache/maven/update/test-not-updated/maven-metadata.xml" ); + actualMetadataPaths.add( "org/apache/maven/update/test-updated/maven-metadata.xml" ); + actualMetadataPaths.add( "org/apache/maven/maven-metadata.xml" ); + actualMetadataPaths.add( "org/apache/testgroup/discovery/1.0/maven-metadata.xml" ); + actualMetadataPaths.add( "org/apache/testgroup/discovery/maven-metadata.xml" ); + actualMetadataPaths.add( "javax/sql/jdbc/2.0/maven-metadata-repository.xml" ); + actualMetadataPaths.add( "javax/sql/jdbc/maven-metadata-repository.xml" ); + actualMetadataPaths.add( "javax/sql/maven-metadata-repository.xml" ); + actualMetadataPaths.add( "javax/maven-metadata.xml" ); + + ManagedRepositoryConfiguration repository = createDefaultRepository(); + + List knownConsumers = new ArrayList(); + KnownScanConsumer knownConsumer = new KnownScanConsumer(); + knownConsumer.setIncludes( new String[]{"**/maven-metadata*.xml"} ); + knownConsumers.add( knownConsumer ); + + List invalidConsumers = new ArrayList(); + InvalidScanConsumer badconsumer = new InvalidScanConsumer(); + invalidConsumers.add( badconsumer ); + + RepositoryScanner scanner = lookupRepositoryScanner(); + RepositoryContentStatistics stats = + scanner.scan( repository, knownConsumers, invalidConsumers, getIgnoreList(), RepositoryScanner.FRESH_SCAN ); + + assertNotNull( "Stats should not be null.", stats ); + assertMinimumHits( "Stats.totalFileCount", actualMetadataPaths.size(), stats.getTotalFileCount() ); + assertMinimumHits( "Processed Count", actualMetadataPaths.size(), knownConsumer.getProcessCount() ); + } + + public void testDefaultRepositoryProjectScanner() + throws Exception + { + List actualProjectPaths = new ArrayList(); + + actualProjectPaths.add( "org/apache/maven/A/1.0/A-1.0.pom" ); + actualProjectPaths.add( "org/apache/maven/B/2.0/B-2.0.pom" ); + actualProjectPaths.add( "org/apache/maven/B/1.0/B-1.0.pom" ); + actualProjectPaths.add( "org/apache/maven/C/1.0/C-1.0.pom" ); + actualProjectPaths.add( "org/apache/maven/update/test-not-updated/1.0/test-not-updated-1.0.pom" ); + actualProjectPaths.add( "org/apache/maven/update/test-updated/1.0/test-updated-1.0.pom" ); + actualProjectPaths.add( "org/apache/maven/discovery/1.0/discovery-1.0.pom" ); + actualProjectPaths.add( "org/apache/maven/samplejar/2.0/samplejar-2.0.pom" ); + actualProjectPaths.add( "org/apache/maven/samplejar/1.0/samplejar-1.0.pom" ); + actualProjectPaths.add( "org/apache/testgroup/discovery/1.0/discovery-1.0.pom" ); + + ManagedRepositoryConfiguration repository = createDefaultRepository(); + + List knownConsumers = new ArrayList(); + KnownScanConsumer consumer = new KnownScanConsumer(); + consumer.setIncludes( new String[]{"**/*.pom"} ); + knownConsumers.add( consumer ); + + List invalidConsumers = new ArrayList(); + InvalidScanConsumer badconsumer = new InvalidScanConsumer(); + invalidConsumers.add( badconsumer ); + + RepositoryScanner scanner = lookupRepositoryScanner(); + RepositoryContentStatistics stats = + scanner.scan( repository, knownConsumers, invalidConsumers, getIgnoreList(), RepositoryScanner.FRESH_SCAN ); + + assertNotNull( "Stats should not be null.", stats ); + assertMinimumHits( "Stats.totalFileCount", actualProjectPaths.size(), stats.getTotalFileCount() ); + assertMinimumHits( "Processed Count", actualProjectPaths.size(), consumer.getProcessCount() ); + } + + public void testLegacyRepositoryArtifactScanner() + throws Exception + { + List actualArtifactPaths = new ArrayList(); + + actualArtifactPaths.add( "invalid/jars/1.0/invalid-1.0.jar" ); + actualArtifactPaths.add( "invalid/jars/invalid-1.0.rar" ); + actualArtifactPaths.add( "invalid/jars/invalid.jar" ); + actualArtifactPaths.add( "invalid/invalid-1.0.jar" ); + actualArtifactPaths.add( "javax.sql/jars/jdbc-2.0.jar" ); + actualArtifactPaths.add( "org.apache.maven/jars/some-ejb-1.0-client.jar" ); + actualArtifactPaths.add( "org.apache.maven/jars/testing-1.0.jar" ); + actualArtifactPaths.add( "org.apache.maven/jars/testing-1.0-sources.jar" ); + actualArtifactPaths.add( "org.apache.maven/jars/testing-UNKNOWN.jar" ); + actualArtifactPaths.add( "org.apache.maven/jars/testing-1.0.zip" ); + actualArtifactPaths.add( "org.apache.maven/jars/testing-1.0-20050611.112233-1.jar" ); + actualArtifactPaths.add( "org.apache.maven/jars/testing-1.0.tar.gz" ); + actualArtifactPaths.add( "org.apache.maven.update/jars/test-not-updated-1.0.jar" ); + actualArtifactPaths.add( "org.apache.maven.update/jars/test-updated-1.0.jar" ); + + ManagedRepositoryConfiguration repository = createLegacyRepository(); + + List knownConsumers = new ArrayList(); + KnownScanConsumer consumer = new KnownScanConsumer(); + consumer.setIncludes( ARTIFACT_PATTERNS ); + knownConsumers.add( consumer ); + + List invalidConsumers = new ArrayList(); + InvalidScanConsumer badconsumer = new InvalidScanConsumer(); + invalidConsumers.add( badconsumer ); + + RepositoryScanner scanner = lookupRepositoryScanner(); + RepositoryContentStatistics stats = + scanner.scan( repository, knownConsumers, invalidConsumers, getIgnoreList(), RepositoryScanner.FRESH_SCAN ); + + assertNotNull( "Stats should not be null.", stats ); + assertMinimumHits( "Stats.totalFileCount", actualArtifactPaths.size(), stats.getTotalFileCount() ); + assertMinimumHits( "Processed Count", actualArtifactPaths.size(), consumer.getProcessCount() ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/SampleKnownConsumer.java b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/SampleKnownConsumer.java new file mode 100644 index 000000000..e1f374c3a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/SampleKnownConsumer.java @@ -0,0 +1,89 @@ +package org.apache.maven.archiva.repository.scanner; + +/* + * 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.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer; +import org.apache.maven.archiva.consumers.ConsumerException; +import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer; + +import java.util.Date; +import java.util.List; + +/** + * SampleKnownConsumer + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component role="org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer" + * role-hint="sample-known" + */ +public class SampleKnownConsumer + extends AbstractMonitoredConsumer + implements KnownRepositoryContentConsumer +{ + /** + * @plexus.configuration default-value="unset-id" + */ + private String id = "unset-id"; + + public void beginScan( ManagedRepositoryConfiguration repository, Date whenGathered ) + throws ConsumerException + { + /* nothing to do */ + } + + public void completeScan() + { + /* nothing to do */ + } + + public List getExcludes() + { + return null; + } + + public List getIncludes() + { + return null; + } + + public void processFile( String path ) + throws ConsumerException + { + /* nothing to do */ + } + + public String getDescription() + { + return "Sample Known Consumer"; + } + + public String getId() + { + return id; + } + + public boolean isPermanent() + { + return false; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/CVS/Root b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/CVS/Root new file mode 100644 index 000000000..2e65f24a6 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/CVS/Root @@ -0,0 +1 @@ +not a real CVS root - for testing exclusions diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/KEYS b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/KEYS new file mode 100644 index 000000000..d3b34d5ad --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/KEYS @@ -0,0 +1 @@ +test KEYS file \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/invalid/invalid-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/invalid/invalid-1.0.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/invalid/invalid/1.0-20050611.123456-1/invalid-1.0-20050611.123456-1.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/invalid/invalid/1.0-20050611.123456-1/invalid-1.0-20050611.123456-1.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/invalid/invalid/1.0-SNAPSHOT/invalid-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/invalid/invalid/1.0-SNAPSHOT/invalid-1.0.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/invalid/invalid/1.0/invalid-1.0b.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/invalid/invalid/1.0/invalid-1.0b.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/invalid/invalid/1.0/invalid-2.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/invalid/invalid/1.0/invalid-2.0.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/invalid/invalid/1/invalid-1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/invalid/invalid/1/invalid-1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/javax/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/javax/maven-metadata.xml new file mode 100644 index 000000000..b3baf545d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/javax/maven-metadata.xml @@ -0,0 +1,26 @@ + + + + + + javax.sql + jdbc + 2.0 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/javax/sql/jdbc/2.0/jdbc-2.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/javax/sql/jdbc/2.0/jdbc-2.0.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/javax/sql/jdbc/2.0/maven-metadata-repository.xml b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/javax/sql/jdbc/2.0/maven-metadata-repository.xml new file mode 100644 index 000000000..caf5b6697 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/javax/sql/jdbc/2.0/maven-metadata-repository.xml @@ -0,0 +1,25 @@ + + + + + javax.sql + jdbc + 2.0 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/javax/sql/jdbc/maven-metadata-repository.xml b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/javax/sql/jdbc/maven-metadata-repository.xml new file mode 100644 index 000000000..bb7570891 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/javax/sql/jdbc/maven-metadata-repository.xml @@ -0,0 +1,30 @@ + + + + + javax.sql + jdbc + 2.0 + + + 2.0 + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/javax/sql/maven-metadata-repository.xml b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/javax/sql/maven-metadata-repository.xml new file mode 100644 index 000000000..caf5b6697 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/javax/sql/maven-metadata-repository.xml @@ -0,0 +1,25 @@ + + + + + javax.sql + jdbc + 2.0 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070725.210059-1.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070725.210059-1.pom new file mode 100644 index 000000000..372560004 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070725.210059-1.pom @@ -0,0 +1,300 @@ + + + + + org.apache + apache + 3 + + 4.0.0 + org.apache.axis2 + axis2 + 1.3-SNAPSHOT + pom + Apache Axis 2.0 - Root + + modules/adb + modules/adb-codegen + modules/addressing + modules/codegen + modules/fastinfoset + modules/integration + modules/java2wsdl + modules/jibx + modules/json + modules/kernel + modules/mex + modules/mex-mar + modules/mtompolicy + modules/parent + modules/ping + modules/samples/version + modules/soapmonitor + modules/spring + modules/tool/axis2-aar-maven-plugin + modules/tool/axis2-ant-plugin + modules/tool/axis2-eclipse-codegen-plugin + modules/tool/axis2-eclipse-service-plugin + modules/tool/axis2-idea-plugin + modules/tool/axis2-java2wsdl-maven-plugin + modules/tool/axis2-mar-maven-plugin + modules/tool/axis2-wsdl2code-maven-plugin + modules/webapp + modules/xmlbeans + modules/samples + modules/scripting + + + + + + release + + + + modules/distribution + + + + java14 + + 1.4 + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + axis2-jar + package + + + + + + + + + + + + + + + + run + + + + + + + + + java15 + + 1.5 + + + modules/jaxbri + modules/metadata + modules/saaj-api + modules/saaj + modules/jws-api + modules/jaxws-api + modules/jaxws + modules/clustering + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + axis2-jar + package + + + + + + + + + + + + + + + + + run + + + + + + + + + java16 + + 1.6 + + + modules/jaxbri + modules/metadata + modules/saaj-api + modules/saaj + modules/jws-api + modules/jaxws-api + modules/jaxws + modules/clustering + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + axis2-jar + package + + + + + + + + + + + + + + + + + run + + + + + + + + + + continuum + http://vmbuild.apache.org/continuum + + + +
axis2-cvs@ws.apache.org
+
+
+
+
+ + + scm:svn:http://svn.apache.org/repos/asf/webservices/axis2/trunk/java/ + + + scm:svn:https://svn.apache.org/repos/asf/webservices/axis2/trunk/java/ + + http://svn.apache.org/viewvc/webservices/webservices/axis2/trunk/java/ + + + + apache-repo + Maven Central Repository + + scpexe://people.apache.org//www/people.apache.org/repo/m2-ibiblio-rsync-repository + + + apache-snapshots + Apache Development Repository + scpexe://people.apache.org//www/people.apache.org/repo/m2-snapshot-repository + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + axis2-jar-package + package + + attach-artifact + + + + + target/lib/axis2-${pom.version}.jar + jar + + + + + + + + + + + + org.apache.maven.plugins + maven-site-plugin + + ${basedir}/xdocs + ${basedir}/xdocs/resources + + + + org.apache.maven.plugins + maven-javadoc-plugin + + true + + http://java.sun.com/j2ee/1.4/docs/api + http://java.sun.com/j2se/1.5.0/docs/api + http://jakarta.apache.org/commons/collections/apidocs-COLLECTIONS_3_0/ + http://jakarta.apache.org/commons/dbcp/apidocs/ + http://jakarta.apache.org/commons/fileupload/apidocs/ + http://jakarta.apache.org/commons/httpclient/apidocs/ + http://jakarta.apache.org/commons/logging/apidocs/ + http://jakarta.apache.org/commons/pool/apidocs/ + http://www.junit.org/junit/javadoc/ + http://logging.apache.org/log4j/docs/api/ + http://jakarta.apache.org/regexp/apidocs/ + http://jakarta.apache.org/velocity/api/ + + + + + +
diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070725.210059-1.pom.md5 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070725.210059-1.pom.md5 new file mode 100644 index 000000000..7e4a5cfdd --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070725.210059-1.pom.md5 @@ -0,0 +1 @@ +69add9b3e2b7d27ae5c92de61acb2d23 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070725.210059-1.pom.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070725.210059-1.pom.sha1 new file mode 100644 index 000000000..b0a35015d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070725.210059-1.pom.sha1 @@ -0,0 +1 @@ +e1b45d0a5c28f15e8b235a7b4b350513c790ef39 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070725.232304-2.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070725.232304-2.pom new file mode 100644 index 000000000..372560004 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070725.232304-2.pom @@ -0,0 +1,300 @@ + + + + + org.apache + apache + 3 + + 4.0.0 + org.apache.axis2 + axis2 + 1.3-SNAPSHOT + pom + Apache Axis 2.0 - Root + + modules/adb + modules/adb-codegen + modules/addressing + modules/codegen + modules/fastinfoset + modules/integration + modules/java2wsdl + modules/jibx + modules/json + modules/kernel + modules/mex + modules/mex-mar + modules/mtompolicy + modules/parent + modules/ping + modules/samples/version + modules/soapmonitor + modules/spring + modules/tool/axis2-aar-maven-plugin + modules/tool/axis2-ant-plugin + modules/tool/axis2-eclipse-codegen-plugin + modules/tool/axis2-eclipse-service-plugin + modules/tool/axis2-idea-plugin + modules/tool/axis2-java2wsdl-maven-plugin + modules/tool/axis2-mar-maven-plugin + modules/tool/axis2-wsdl2code-maven-plugin + modules/webapp + modules/xmlbeans + modules/samples + modules/scripting + + + + + + release + + + + modules/distribution + + + + java14 + + 1.4 + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + axis2-jar + package + + + + + + + + + + + + + + + + run + + + + + + + + + java15 + + 1.5 + + + modules/jaxbri + modules/metadata + modules/saaj-api + modules/saaj + modules/jws-api + modules/jaxws-api + modules/jaxws + modules/clustering + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + axis2-jar + package + + + + + + + + + + + + + + + + + run + + + + + + + + + java16 + + 1.6 + + + modules/jaxbri + modules/metadata + modules/saaj-api + modules/saaj + modules/jws-api + modules/jaxws-api + modules/jaxws + modules/clustering + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + axis2-jar + package + + + + + + + + + + + + + + + + + run + + + + + + + + + + continuum + http://vmbuild.apache.org/continuum + + + +
axis2-cvs@ws.apache.org
+
+
+
+
+ + + scm:svn:http://svn.apache.org/repos/asf/webservices/axis2/trunk/java/ + + + scm:svn:https://svn.apache.org/repos/asf/webservices/axis2/trunk/java/ + + http://svn.apache.org/viewvc/webservices/webservices/axis2/trunk/java/ + + + + apache-repo + Maven Central Repository + + scpexe://people.apache.org//www/people.apache.org/repo/m2-ibiblio-rsync-repository + + + apache-snapshots + Apache Development Repository + scpexe://people.apache.org//www/people.apache.org/repo/m2-snapshot-repository + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + axis2-jar-package + package + + attach-artifact + + + + + target/lib/axis2-${pom.version}.jar + jar + + + + + + + + + + + + org.apache.maven.plugins + maven-site-plugin + + ${basedir}/xdocs + ${basedir}/xdocs/resources + + + + org.apache.maven.plugins + maven-javadoc-plugin + + true + + http://java.sun.com/j2ee/1.4/docs/api + http://java.sun.com/j2se/1.5.0/docs/api + http://jakarta.apache.org/commons/collections/apidocs-COLLECTIONS_3_0/ + http://jakarta.apache.org/commons/dbcp/apidocs/ + http://jakarta.apache.org/commons/fileupload/apidocs/ + http://jakarta.apache.org/commons/httpclient/apidocs/ + http://jakarta.apache.org/commons/logging/apidocs/ + http://jakarta.apache.org/commons/pool/apidocs/ + http://www.junit.org/junit/javadoc/ + http://logging.apache.org/log4j/docs/api/ + http://jakarta.apache.org/regexp/apidocs/ + http://jakarta.apache.org/velocity/api/ + + + + + +
diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070725.232304-2.pom.md5 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070725.232304-2.pom.md5 new file mode 100644 index 000000000..7e4a5cfdd --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070725.232304-2.pom.md5 @@ -0,0 +1 @@ +69add9b3e2b7d27ae5c92de61acb2d23 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070725.232304-2.pom.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070725.232304-2.pom.sha1 new file mode 100644 index 000000000..b0a35015d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070725.232304-2.pom.sha1 @@ -0,0 +1 @@ +e1b45d0a5c28f15e8b235a7b4b350513c790ef39 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070726.053327-3.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070726.053327-3.pom new file mode 100644 index 000000000..372560004 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070726.053327-3.pom @@ -0,0 +1,300 @@ + + + + + org.apache + apache + 3 + + 4.0.0 + org.apache.axis2 + axis2 + 1.3-SNAPSHOT + pom + Apache Axis 2.0 - Root + + modules/adb + modules/adb-codegen + modules/addressing + modules/codegen + modules/fastinfoset + modules/integration + modules/java2wsdl + modules/jibx + modules/json + modules/kernel + modules/mex + modules/mex-mar + modules/mtompolicy + modules/parent + modules/ping + modules/samples/version + modules/soapmonitor + modules/spring + modules/tool/axis2-aar-maven-plugin + modules/tool/axis2-ant-plugin + modules/tool/axis2-eclipse-codegen-plugin + modules/tool/axis2-eclipse-service-plugin + modules/tool/axis2-idea-plugin + modules/tool/axis2-java2wsdl-maven-plugin + modules/tool/axis2-mar-maven-plugin + modules/tool/axis2-wsdl2code-maven-plugin + modules/webapp + modules/xmlbeans + modules/samples + modules/scripting + + + + + + release + + + + modules/distribution + + + + java14 + + 1.4 + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + axis2-jar + package + + + + + + + + + + + + + + + + run + + + + + + + + + java15 + + 1.5 + + + modules/jaxbri + modules/metadata + modules/saaj-api + modules/saaj + modules/jws-api + modules/jaxws-api + modules/jaxws + modules/clustering + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + axis2-jar + package + + + + + + + + + + + + + + + + + run + + + + + + + + + java16 + + 1.6 + + + modules/jaxbri + modules/metadata + modules/saaj-api + modules/saaj + modules/jws-api + modules/jaxws-api + modules/jaxws + modules/clustering + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + axis2-jar + package + + + + + + + + + + + + + + + + + run + + + + + + + + + + continuum + http://vmbuild.apache.org/continuum + + + +
axis2-cvs@ws.apache.org
+
+
+
+
+ + + scm:svn:http://svn.apache.org/repos/asf/webservices/axis2/trunk/java/ + + + scm:svn:https://svn.apache.org/repos/asf/webservices/axis2/trunk/java/ + + http://svn.apache.org/viewvc/webservices/webservices/axis2/trunk/java/ + + + + apache-repo + Maven Central Repository + + scpexe://people.apache.org//www/people.apache.org/repo/m2-ibiblio-rsync-repository + + + apache-snapshots + Apache Development Repository + scpexe://people.apache.org//www/people.apache.org/repo/m2-snapshot-repository + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + axis2-jar-package + package + + attach-artifact + + + + + target/lib/axis2-${pom.version}.jar + jar + + + + + + + + + + + + org.apache.maven.plugins + maven-site-plugin + + ${basedir}/xdocs + ${basedir}/xdocs/resources + + + + org.apache.maven.plugins + maven-javadoc-plugin + + true + + http://java.sun.com/j2ee/1.4/docs/api + http://java.sun.com/j2se/1.5.0/docs/api + http://jakarta.apache.org/commons/collections/apidocs-COLLECTIONS_3_0/ + http://jakarta.apache.org/commons/dbcp/apidocs/ + http://jakarta.apache.org/commons/fileupload/apidocs/ + http://jakarta.apache.org/commons/httpclient/apidocs/ + http://jakarta.apache.org/commons/logging/apidocs/ + http://jakarta.apache.org/commons/pool/apidocs/ + http://www.junit.org/junit/javadoc/ + http://logging.apache.org/log4j/docs/api/ + http://jakarta.apache.org/regexp/apidocs/ + http://jakarta.apache.org/velocity/api/ + + + + + +
diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070726.053327-3.pom.md5 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070726.053327-3.pom.md5 new file mode 100644 index 000000000..7e4a5cfdd --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070726.053327-3.pom.md5 @@ -0,0 +1 @@ +69add9b3e2b7d27ae5c92de61acb2d23 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070726.053327-3.pom.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070726.053327-3.pom.sha1 new file mode 100644 index 000000000..b0a35015d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070726.053327-3.pom.sha1 @@ -0,0 +1 @@ +e1b45d0a5c28f15e8b235a7b4b350513c790ef39 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070726.173653-5.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070726.173653-5.pom new file mode 100644 index 000000000..372560004 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070726.173653-5.pom @@ -0,0 +1,300 @@ + + + + + org.apache + apache + 3 + + 4.0.0 + org.apache.axis2 + axis2 + 1.3-SNAPSHOT + pom + Apache Axis 2.0 - Root + + modules/adb + modules/adb-codegen + modules/addressing + modules/codegen + modules/fastinfoset + modules/integration + modules/java2wsdl + modules/jibx + modules/json + modules/kernel + modules/mex + modules/mex-mar + modules/mtompolicy + modules/parent + modules/ping + modules/samples/version + modules/soapmonitor + modules/spring + modules/tool/axis2-aar-maven-plugin + modules/tool/axis2-ant-plugin + modules/tool/axis2-eclipse-codegen-plugin + modules/tool/axis2-eclipse-service-plugin + modules/tool/axis2-idea-plugin + modules/tool/axis2-java2wsdl-maven-plugin + modules/tool/axis2-mar-maven-plugin + modules/tool/axis2-wsdl2code-maven-plugin + modules/webapp + modules/xmlbeans + modules/samples + modules/scripting + + + + + + release + + + + modules/distribution + + + + java14 + + 1.4 + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + axis2-jar + package + + + + + + + + + + + + + + + + run + + + + + + + + + java15 + + 1.5 + + + modules/jaxbri + modules/metadata + modules/saaj-api + modules/saaj + modules/jws-api + modules/jaxws-api + modules/jaxws + modules/clustering + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + axis2-jar + package + + + + + + + + + + + + + + + + + run + + + + + + + + + java16 + + 1.6 + + + modules/jaxbri + modules/metadata + modules/saaj-api + modules/saaj + modules/jws-api + modules/jaxws-api + modules/jaxws + modules/clustering + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + axis2-jar + package + + + + + + + + + + + + + + + + + run + + + + + + + + + + continuum + http://vmbuild.apache.org/continuum + + + +
axis2-cvs@ws.apache.org
+
+
+
+
+ + + scm:svn:http://svn.apache.org/repos/asf/webservices/axis2/trunk/java/ + + + scm:svn:https://svn.apache.org/repos/asf/webservices/axis2/trunk/java/ + + http://svn.apache.org/viewvc/webservices/webservices/axis2/trunk/java/ + + + + apache-repo + Maven Central Repository + + scpexe://people.apache.org//www/people.apache.org/repo/m2-ibiblio-rsync-repository + + + apache-snapshots + Apache Development Repository + scpexe://people.apache.org//www/people.apache.org/repo/m2-snapshot-repository + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + axis2-jar-package + package + + attach-artifact + + + + + target/lib/axis2-${pom.version}.jar + jar + + + + + + + + + + + + org.apache.maven.plugins + maven-site-plugin + + ${basedir}/xdocs + ${basedir}/xdocs/resources + + + + org.apache.maven.plugins + maven-javadoc-plugin + + true + + http://java.sun.com/j2ee/1.4/docs/api + http://java.sun.com/j2se/1.5.0/docs/api + http://jakarta.apache.org/commons/collections/apidocs-COLLECTIONS_3_0/ + http://jakarta.apache.org/commons/dbcp/apidocs/ + http://jakarta.apache.org/commons/fileupload/apidocs/ + http://jakarta.apache.org/commons/httpclient/apidocs/ + http://jakarta.apache.org/commons/logging/apidocs/ + http://jakarta.apache.org/commons/pool/apidocs/ + http://www.junit.org/junit/javadoc/ + http://logging.apache.org/log4j/docs/api/ + http://jakarta.apache.org/regexp/apidocs/ + http://jakarta.apache.org/velocity/api/ + + + + + +
diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070726.173653-5.pom.md5 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070726.173653-5.pom.md5 new file mode 100644 index 000000000..7e4a5cfdd --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070726.173653-5.pom.md5 @@ -0,0 +1 @@ +69add9b3e2b7d27ae5c92de61acb2d23 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070726.173653-5.pom.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070726.173653-5.pom.sha1 new file mode 100644 index 000000000..b0a35015d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070726.173653-5.pom.sha1 @@ -0,0 +1 @@ +e1b45d0a5c28f15e8b235a7b4b350513c790ef39 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070727.113106-7.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070727.113106-7.pom new file mode 100644 index 000000000..372560004 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070727.113106-7.pom @@ -0,0 +1,300 @@ + + + + + org.apache + apache + 3 + + 4.0.0 + org.apache.axis2 + axis2 + 1.3-SNAPSHOT + pom + Apache Axis 2.0 - Root + + modules/adb + modules/adb-codegen + modules/addressing + modules/codegen + modules/fastinfoset + modules/integration + modules/java2wsdl + modules/jibx + modules/json + modules/kernel + modules/mex + modules/mex-mar + modules/mtompolicy + modules/parent + modules/ping + modules/samples/version + modules/soapmonitor + modules/spring + modules/tool/axis2-aar-maven-plugin + modules/tool/axis2-ant-plugin + modules/tool/axis2-eclipse-codegen-plugin + modules/tool/axis2-eclipse-service-plugin + modules/tool/axis2-idea-plugin + modules/tool/axis2-java2wsdl-maven-plugin + modules/tool/axis2-mar-maven-plugin + modules/tool/axis2-wsdl2code-maven-plugin + modules/webapp + modules/xmlbeans + modules/samples + modules/scripting + + + + + + release + + + + modules/distribution + + + + java14 + + 1.4 + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + axis2-jar + package + + + + + + + + + + + + + + + + run + + + + + + + + + java15 + + 1.5 + + + modules/jaxbri + modules/metadata + modules/saaj-api + modules/saaj + modules/jws-api + modules/jaxws-api + modules/jaxws + modules/clustering + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + axis2-jar + package + + + + + + + + + + + + + + + + + run + + + + + + + + + java16 + + 1.6 + + + modules/jaxbri + modules/metadata + modules/saaj-api + modules/saaj + modules/jws-api + modules/jaxws-api + modules/jaxws + modules/clustering + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + axis2-jar + package + + + + + + + + + + + + + + + + + run + + + + + + + + + + continuum + http://vmbuild.apache.org/continuum + + + +
axis2-cvs@ws.apache.org
+
+
+
+
+ + + scm:svn:http://svn.apache.org/repos/asf/webservices/axis2/trunk/java/ + + + scm:svn:https://svn.apache.org/repos/asf/webservices/axis2/trunk/java/ + + http://svn.apache.org/viewvc/webservices/webservices/axis2/trunk/java/ + + + + apache-repo + Maven Central Repository + + scpexe://people.apache.org//www/people.apache.org/repo/m2-ibiblio-rsync-repository + + + apache-snapshots + Apache Development Repository + scpexe://people.apache.org//www/people.apache.org/repo/m2-snapshot-repository + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + axis2-jar-package + package + + attach-artifact + + + + + target/lib/axis2-${pom.version}.jar + jar + + + + + + + + + + + + org.apache.maven.plugins + maven-site-plugin + + ${basedir}/xdocs + ${basedir}/xdocs/resources + + + + org.apache.maven.plugins + maven-javadoc-plugin + + true + + http://java.sun.com/j2ee/1.4/docs/api + http://java.sun.com/j2se/1.5.0/docs/api + http://jakarta.apache.org/commons/collections/apidocs-COLLECTIONS_3_0/ + http://jakarta.apache.org/commons/dbcp/apidocs/ + http://jakarta.apache.org/commons/fileupload/apidocs/ + http://jakarta.apache.org/commons/httpclient/apidocs/ + http://jakarta.apache.org/commons/logging/apidocs/ + http://jakarta.apache.org/commons/pool/apidocs/ + http://www.junit.org/junit/javadoc/ + http://logging.apache.org/log4j/docs/api/ + http://jakarta.apache.org/regexp/apidocs/ + http://jakarta.apache.org/velocity/api/ + + + + + +
diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070727.113106-7.pom.md5 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070727.113106-7.pom.md5 new file mode 100644 index 000000000..7e4a5cfdd --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070727.113106-7.pom.md5 @@ -0,0 +1 @@ +69add9b3e2b7d27ae5c92de61acb2d23 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070727.113106-7.pom.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070727.113106-7.pom.sha1 new file mode 100644 index 000000000..b0a35015d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070727.113106-7.pom.sha1 @@ -0,0 +1 @@ +e1b45d0a5c28f15e8b235a7b4b350513c790ef39 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070728.053229-10.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070728.053229-10.pom new file mode 100644 index 000000000..372560004 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070728.053229-10.pom @@ -0,0 +1,300 @@ + + + + + org.apache + apache + 3 + + 4.0.0 + org.apache.axis2 + axis2 + 1.3-SNAPSHOT + pom + Apache Axis 2.0 - Root + + modules/adb + modules/adb-codegen + modules/addressing + modules/codegen + modules/fastinfoset + modules/integration + modules/java2wsdl + modules/jibx + modules/json + modules/kernel + modules/mex + modules/mex-mar + modules/mtompolicy + modules/parent + modules/ping + modules/samples/version + modules/soapmonitor + modules/spring + modules/tool/axis2-aar-maven-plugin + modules/tool/axis2-ant-plugin + modules/tool/axis2-eclipse-codegen-plugin + modules/tool/axis2-eclipse-service-plugin + modules/tool/axis2-idea-plugin + modules/tool/axis2-java2wsdl-maven-plugin + modules/tool/axis2-mar-maven-plugin + modules/tool/axis2-wsdl2code-maven-plugin + modules/webapp + modules/xmlbeans + modules/samples + modules/scripting + + + + + + release + + + + modules/distribution + + + + java14 + + 1.4 + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + axis2-jar + package + + + + + + + + + + + + + + + + run + + + + + + + + + java15 + + 1.5 + + + modules/jaxbri + modules/metadata + modules/saaj-api + modules/saaj + modules/jws-api + modules/jaxws-api + modules/jaxws + modules/clustering + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + axis2-jar + package + + + + + + + + + + + + + + + + + run + + + + + + + + + java16 + + 1.6 + + + modules/jaxbri + modules/metadata + modules/saaj-api + modules/saaj + modules/jws-api + modules/jaxws-api + modules/jaxws + modules/clustering + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + axis2-jar + package + + + + + + + + + + + + + + + + + run + + + + + + + + + + continuum + http://vmbuild.apache.org/continuum + + + +
axis2-cvs@ws.apache.org
+
+
+
+
+ + + scm:svn:http://svn.apache.org/repos/asf/webservices/axis2/trunk/java/ + + + scm:svn:https://svn.apache.org/repos/asf/webservices/axis2/trunk/java/ + + http://svn.apache.org/viewvc/webservices/webservices/axis2/trunk/java/ + + + + apache-repo + Maven Central Repository + + scpexe://people.apache.org//www/people.apache.org/repo/m2-ibiblio-rsync-repository + + + apache-snapshots + Apache Development Repository + scpexe://people.apache.org//www/people.apache.org/repo/m2-snapshot-repository + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + axis2-jar-package + package + + attach-artifact + + + + + target/lib/axis2-${pom.version}.jar + jar + + + + + + + + + + + + org.apache.maven.plugins + maven-site-plugin + + ${basedir}/xdocs + ${basedir}/xdocs/resources + + + + org.apache.maven.plugins + maven-javadoc-plugin + + true + + http://java.sun.com/j2ee/1.4/docs/api + http://java.sun.com/j2se/1.5.0/docs/api + http://jakarta.apache.org/commons/collections/apidocs-COLLECTIONS_3_0/ + http://jakarta.apache.org/commons/dbcp/apidocs/ + http://jakarta.apache.org/commons/fileupload/apidocs/ + http://jakarta.apache.org/commons/httpclient/apidocs/ + http://jakarta.apache.org/commons/logging/apidocs/ + http://jakarta.apache.org/commons/pool/apidocs/ + http://www.junit.org/junit/javadoc/ + http://logging.apache.org/log4j/docs/api/ + http://jakarta.apache.org/regexp/apidocs/ + http://jakarta.apache.org/velocity/api/ + + + + + +
diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070728.053229-10.pom.md5 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070728.053229-10.pom.md5 new file mode 100644 index 000000000..7e4a5cfdd --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070728.053229-10.pom.md5 @@ -0,0 +1 @@ +69add9b3e2b7d27ae5c92de61acb2d23 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070728.053229-10.pom.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070728.053229-10.pom.sha1 new file mode 100644 index 000000000..b0a35015d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070728.053229-10.pom.sha1 @@ -0,0 +1 @@ +e1b45d0a5c28f15e8b235a7b4b350513c790ef39 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070728.112043-11.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070728.112043-11.pom new file mode 100644 index 000000000..372560004 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070728.112043-11.pom @@ -0,0 +1,300 @@ + + + + + org.apache + apache + 3 + + 4.0.0 + org.apache.axis2 + axis2 + 1.3-SNAPSHOT + pom + Apache Axis 2.0 - Root + + modules/adb + modules/adb-codegen + modules/addressing + modules/codegen + modules/fastinfoset + modules/integration + modules/java2wsdl + modules/jibx + modules/json + modules/kernel + modules/mex + modules/mex-mar + modules/mtompolicy + modules/parent + modules/ping + modules/samples/version + modules/soapmonitor + modules/spring + modules/tool/axis2-aar-maven-plugin + modules/tool/axis2-ant-plugin + modules/tool/axis2-eclipse-codegen-plugin + modules/tool/axis2-eclipse-service-plugin + modules/tool/axis2-idea-plugin + modules/tool/axis2-java2wsdl-maven-plugin + modules/tool/axis2-mar-maven-plugin + modules/tool/axis2-wsdl2code-maven-plugin + modules/webapp + modules/xmlbeans + modules/samples + modules/scripting + + + + + + release + + + + modules/distribution + + + + java14 + + 1.4 + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + axis2-jar + package + + + + + + + + + + + + + + + + run + + + + + + + + + java15 + + 1.5 + + + modules/jaxbri + modules/metadata + modules/saaj-api + modules/saaj + modules/jws-api + modules/jaxws-api + modules/jaxws + modules/clustering + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + axis2-jar + package + + + + + + + + + + + + + + + + + run + + + + + + + + + java16 + + 1.6 + + + modules/jaxbri + modules/metadata + modules/saaj-api + modules/saaj + modules/jws-api + modules/jaxws-api + modules/jaxws + modules/clustering + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + axis2-jar + package + + + + + + + + + + + + + + + + + run + + + + + + + + + + continuum + http://vmbuild.apache.org/continuum + + + +
axis2-cvs@ws.apache.org
+
+
+
+
+ + + scm:svn:http://svn.apache.org/repos/asf/webservices/axis2/trunk/java/ + + + scm:svn:https://svn.apache.org/repos/asf/webservices/axis2/trunk/java/ + + http://svn.apache.org/viewvc/webservices/webservices/axis2/trunk/java/ + + + + apache-repo + Maven Central Repository + + scpexe://people.apache.org//www/people.apache.org/repo/m2-ibiblio-rsync-repository + + + apache-snapshots + Apache Development Repository + scpexe://people.apache.org//www/people.apache.org/repo/m2-snapshot-repository + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + axis2-jar-package + package + + attach-artifact + + + + + target/lib/axis2-${pom.version}.jar + jar + + + + + + + + + + + + org.apache.maven.plugins + maven-site-plugin + + ${basedir}/xdocs + ${basedir}/xdocs/resources + + + + org.apache.maven.plugins + maven-javadoc-plugin + + true + + http://java.sun.com/j2ee/1.4/docs/api + http://java.sun.com/j2se/1.5.0/docs/api + http://jakarta.apache.org/commons/collections/apidocs-COLLECTIONS_3_0/ + http://jakarta.apache.org/commons/dbcp/apidocs/ + http://jakarta.apache.org/commons/fileupload/apidocs/ + http://jakarta.apache.org/commons/httpclient/apidocs/ + http://jakarta.apache.org/commons/logging/apidocs/ + http://jakarta.apache.org/commons/pool/apidocs/ + http://www.junit.org/junit/javadoc/ + http://logging.apache.org/log4j/docs/api/ + http://jakarta.apache.org/regexp/apidocs/ + http://jakarta.apache.org/velocity/api/ + + + + + +
diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070728.112043-11.pom.md5 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070728.112043-11.pom.md5 new file mode 100644 index 000000000..7e4a5cfdd --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070728.112043-11.pom.md5 @@ -0,0 +1 @@ +69add9b3e2b7d27ae5c92de61acb2d23 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070728.112043-11.pom.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070728.112043-11.pom.sha1 new file mode 100644 index 000000000..b0a35015d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070728.112043-11.pom.sha1 @@ -0,0 +1 @@ +e1b45d0a5c28f15e8b235a7b4b350513c790ef39 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070729.171937-16.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070729.171937-16.pom new file mode 100644 index 000000000..372560004 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070729.171937-16.pom @@ -0,0 +1,300 @@ + + + + + org.apache + apache + 3 + + 4.0.0 + org.apache.axis2 + axis2 + 1.3-SNAPSHOT + pom + Apache Axis 2.0 - Root + + modules/adb + modules/adb-codegen + modules/addressing + modules/codegen + modules/fastinfoset + modules/integration + modules/java2wsdl + modules/jibx + modules/json + modules/kernel + modules/mex + modules/mex-mar + modules/mtompolicy + modules/parent + modules/ping + modules/samples/version + modules/soapmonitor + modules/spring + modules/tool/axis2-aar-maven-plugin + modules/tool/axis2-ant-plugin + modules/tool/axis2-eclipse-codegen-plugin + modules/tool/axis2-eclipse-service-plugin + modules/tool/axis2-idea-plugin + modules/tool/axis2-java2wsdl-maven-plugin + modules/tool/axis2-mar-maven-plugin + modules/tool/axis2-wsdl2code-maven-plugin + modules/webapp + modules/xmlbeans + modules/samples + modules/scripting + + + + + + release + + + + modules/distribution + + + + java14 + + 1.4 + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + axis2-jar + package + + + + + + + + + + + + + + + + run + + + + + + + + + java15 + + 1.5 + + + modules/jaxbri + modules/metadata + modules/saaj-api + modules/saaj + modules/jws-api + modules/jaxws-api + modules/jaxws + modules/clustering + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + axis2-jar + package + + + + + + + + + + + + + + + + + run + + + + + + + + + java16 + + 1.6 + + + modules/jaxbri + modules/metadata + modules/saaj-api + modules/saaj + modules/jws-api + modules/jaxws-api + modules/jaxws + modules/clustering + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + axis2-jar + package + + + + + + + + + + + + + + + + + run + + + + + + + + + + continuum + http://vmbuild.apache.org/continuum + + + +
axis2-cvs@ws.apache.org
+
+
+
+
+ + + scm:svn:http://svn.apache.org/repos/asf/webservices/axis2/trunk/java/ + + + scm:svn:https://svn.apache.org/repos/asf/webservices/axis2/trunk/java/ + + http://svn.apache.org/viewvc/webservices/webservices/axis2/trunk/java/ + + + + apache-repo + Maven Central Repository + + scpexe://people.apache.org//www/people.apache.org/repo/m2-ibiblio-rsync-repository + + + apache-snapshots + Apache Development Repository + scpexe://people.apache.org//www/people.apache.org/repo/m2-snapshot-repository + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + axis2-jar-package + package + + attach-artifact + + + + + target/lib/axis2-${pom.version}.jar + jar + + + + + + + + + + + + org.apache.maven.plugins + maven-site-plugin + + ${basedir}/xdocs + ${basedir}/xdocs/resources + + + + org.apache.maven.plugins + maven-javadoc-plugin + + true + + http://java.sun.com/j2ee/1.4/docs/api + http://java.sun.com/j2se/1.5.0/docs/api + http://jakarta.apache.org/commons/collections/apidocs-COLLECTIONS_3_0/ + http://jakarta.apache.org/commons/dbcp/apidocs/ + http://jakarta.apache.org/commons/fileupload/apidocs/ + http://jakarta.apache.org/commons/httpclient/apidocs/ + http://jakarta.apache.org/commons/logging/apidocs/ + http://jakarta.apache.org/commons/pool/apidocs/ + http://www.junit.org/junit/javadoc/ + http://logging.apache.org/log4j/docs/api/ + http://jakarta.apache.org/regexp/apidocs/ + http://jakarta.apache.org/velocity/api/ + + + + + +
diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070729.171937-16.pom.md5 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070729.171937-16.pom.md5 new file mode 100644 index 000000000..7e4a5cfdd --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070729.171937-16.pom.md5 @@ -0,0 +1 @@ +69add9b3e2b7d27ae5c92de61acb2d23 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070729.171937-16.pom.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070729.171937-16.pom.sha1 new file mode 100644 index 000000000..b0a35015d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070729.171937-16.pom.sha1 @@ -0,0 +1 @@ +e1b45d0a5c28f15e8b235a7b4b350513c790ef39 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070730.232112-20.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070730.232112-20.pom new file mode 100644 index 000000000..372560004 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070730.232112-20.pom @@ -0,0 +1,300 @@ + + + + + org.apache + apache + 3 + + 4.0.0 + org.apache.axis2 + axis2 + 1.3-SNAPSHOT + pom + Apache Axis 2.0 - Root + + modules/adb + modules/adb-codegen + modules/addressing + modules/codegen + modules/fastinfoset + modules/integration + modules/java2wsdl + modules/jibx + modules/json + modules/kernel + modules/mex + modules/mex-mar + modules/mtompolicy + modules/parent + modules/ping + modules/samples/version + modules/soapmonitor + modules/spring + modules/tool/axis2-aar-maven-plugin + modules/tool/axis2-ant-plugin + modules/tool/axis2-eclipse-codegen-plugin + modules/tool/axis2-eclipse-service-plugin + modules/tool/axis2-idea-plugin + modules/tool/axis2-java2wsdl-maven-plugin + modules/tool/axis2-mar-maven-plugin + modules/tool/axis2-wsdl2code-maven-plugin + modules/webapp + modules/xmlbeans + modules/samples + modules/scripting + + + + + + release + + + + modules/distribution + + + + java14 + + 1.4 + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + axis2-jar + package + + + + + + + + + + + + + + + + run + + + + + + + + + java15 + + 1.5 + + + modules/jaxbri + modules/metadata + modules/saaj-api + modules/saaj + modules/jws-api + modules/jaxws-api + modules/jaxws + modules/clustering + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + axis2-jar + package + + + + + + + + + + + + + + + + + run + + + + + + + + + java16 + + 1.6 + + + modules/jaxbri + modules/metadata + modules/saaj-api + modules/saaj + modules/jws-api + modules/jaxws-api + modules/jaxws + modules/clustering + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + axis2-jar + package + + + + + + + + + + + + + + + + + run + + + + + + + + + + continuum + http://vmbuild.apache.org/continuum + + + +
axis2-cvs@ws.apache.org
+
+
+
+
+ + + scm:svn:http://svn.apache.org/repos/asf/webservices/axis2/trunk/java/ + + + scm:svn:https://svn.apache.org/repos/asf/webservices/axis2/trunk/java/ + + http://svn.apache.org/viewvc/webservices/webservices/axis2/trunk/java/ + + + + apache-repo + Maven Central Repository + + scpexe://people.apache.org//www/people.apache.org/repo/m2-ibiblio-rsync-repository + + + apache-snapshots + Apache Development Repository + scpexe://people.apache.org//www/people.apache.org/repo/m2-snapshot-repository + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + axis2-jar-package + package + + attach-artifact + + + + + target/lib/axis2-${pom.version}.jar + jar + + + + + + + + + + + + org.apache.maven.plugins + maven-site-plugin + + ${basedir}/xdocs + ${basedir}/xdocs/resources + + + + org.apache.maven.plugins + maven-javadoc-plugin + + true + + http://java.sun.com/j2ee/1.4/docs/api + http://java.sun.com/j2se/1.5.0/docs/api + http://jakarta.apache.org/commons/collections/apidocs-COLLECTIONS_3_0/ + http://jakarta.apache.org/commons/dbcp/apidocs/ + http://jakarta.apache.org/commons/fileupload/apidocs/ + http://jakarta.apache.org/commons/httpclient/apidocs/ + http://jakarta.apache.org/commons/logging/apidocs/ + http://jakarta.apache.org/commons/pool/apidocs/ + http://www.junit.org/junit/javadoc/ + http://logging.apache.org/log4j/docs/api/ + http://jakarta.apache.org/regexp/apidocs/ + http://jakarta.apache.org/velocity/api/ + + + + + +
diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070730.232112-20.pom.md5 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070730.232112-20.pom.md5 new file mode 100644 index 000000000..7e4a5cfdd --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070730.232112-20.pom.md5 @@ -0,0 +1 @@ +69add9b3e2b7d27ae5c92de61acb2d23 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070730.232112-20.pom.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070730.232112-20.pom.sha1 new file mode 100644 index 000000000..b0a35015d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070730.232112-20.pom.sha1 @@ -0,0 +1 @@ +e1b45d0a5c28f15e8b235a7b4b350513c790ef39 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070731.113304-21.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070731.113304-21.pom new file mode 100644 index 000000000..8d5931c0e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070731.113304-21.pom @@ -0,0 +1,268 @@ + + + + + org.apache + apache + 3 + + 4.0.0 + org.apache.axis2 + axis2 + 1.3-SNAPSHOT + pom + Apache Axis 2.0 - Root + + modules/adb + modules/adb-codegen + modules/addressing + modules/codegen + modules/fastinfoset + modules/integration + modules/java2wsdl + modules/jibx + modules/json + modules/kernel + modules/mex + modules/mex-mar + modules/mtompolicy + modules/parent + modules/ping + modules/samples/version + modules/soapmonitor + modules/spring + modules/tool/axis2-aar-maven-plugin + modules/tool/axis2-ant-plugin + modules/tool/axis2-eclipse-codegen-plugin + modules/tool/axis2-eclipse-service-plugin + modules/tool/axis2-idea-plugin + modules/tool/axis2-java2wsdl-maven-plugin + modules/tool/axis2-mar-maven-plugin + modules/tool/axis2-wsdl2code-maven-plugin + modules/webapp + modules/xmlbeans + modules/samples + modules/scripting + + + + + + release + + + + modules/documentation + modules/distribution + + + + java14 + + 1.4 + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + axis2-jar + package + + + + + + + + + + + + + + + + run + + + + + + + + + java15 + + 1.5 + + + modules/jaxbri + modules/metadata + modules/saaj-api + modules/saaj + modules/jws-api + modules/jaxws-api + modules/jaxws + modules/clustering + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + axis2-jar + package + + + + + + + + + + + + + + + + + run + + + + + + + + + java16 + + 1.6 + + + modules/jaxbri + modules/metadata + modules/saaj-api + modules/saaj + modules/jws-api + modules/jaxws-api + modules/jaxws + modules/clustering + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + axis2-jar + package + + + + + + + + + + + + + + + + + run + + + + + + + + + + continuum + http://vmbuild.apache.org/continuum + + + +
axis2-cvs@ws.apache.org
+
+
+
+
+ + + scm:svn:http://svn.apache.org/repos/asf/webservices/axis2/trunk/java/ + + + scm:svn:https://svn.apache.org/repos/asf/webservices/axis2/trunk/java/ + + http://svn.apache.org/viewvc/webservices/webservices/axis2/trunk/java/ + + + + apache-repo + Maven Central Repository + + scpexe://people.apache.org//www/people.apache.org/repo/m2-ibiblio-rsync-repository + + + apache-snapshots + Apache Development Repository + scpexe://people.apache.org//www/people.apache.org/repo/m2-snapshot-repository + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + axis2-jar-package + package + + attach-artifact + + + + + target/lib/axis2-${pom.version}.jar + jar + + + + + + + + +
diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070731.113304-21.pom.md5 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070731.113304-21.pom.md5 new file mode 100644 index 000000000..9cebfeecc --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070731.113304-21.pom.md5 @@ -0,0 +1 @@ +8530af16aa7f3e5268b96ff88dd703a8 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070731.113304-21.pom.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070731.113304-21.pom.sha1 new file mode 100644 index 000000000..45d7111f6 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070731.113304-21.pom.sha1 @@ -0,0 +1 @@ +d2a036ec537737153980aed1157bad133230f2c8 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070731.172936-22.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070731.172936-22.pom new file mode 100644 index 000000000..8d5931c0e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070731.172936-22.pom @@ -0,0 +1,268 @@ + + + + + org.apache + apache + 3 + + 4.0.0 + org.apache.axis2 + axis2 + 1.3-SNAPSHOT + pom + Apache Axis 2.0 - Root + + modules/adb + modules/adb-codegen + modules/addressing + modules/codegen + modules/fastinfoset + modules/integration + modules/java2wsdl + modules/jibx + modules/json + modules/kernel + modules/mex + modules/mex-mar + modules/mtompolicy + modules/parent + modules/ping + modules/samples/version + modules/soapmonitor + modules/spring + modules/tool/axis2-aar-maven-plugin + modules/tool/axis2-ant-plugin + modules/tool/axis2-eclipse-codegen-plugin + modules/tool/axis2-eclipse-service-plugin + modules/tool/axis2-idea-plugin + modules/tool/axis2-java2wsdl-maven-plugin + modules/tool/axis2-mar-maven-plugin + modules/tool/axis2-wsdl2code-maven-plugin + modules/webapp + modules/xmlbeans + modules/samples + modules/scripting + + + + + + release + + + + modules/documentation + modules/distribution + + + + java14 + + 1.4 + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + axis2-jar + package + + + + + + + + + + + + + + + + run + + + + + + + + + java15 + + 1.5 + + + modules/jaxbri + modules/metadata + modules/saaj-api + modules/saaj + modules/jws-api + modules/jaxws-api + modules/jaxws + modules/clustering + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + axis2-jar + package + + + + + + + + + + + + + + + + + run + + + + + + + + + java16 + + 1.6 + + + modules/jaxbri + modules/metadata + modules/saaj-api + modules/saaj + modules/jws-api + modules/jaxws-api + modules/jaxws + modules/clustering + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + axis2-jar + package + + + + + + + + + + + + + + + + + run + + + + + + + + + + continuum + http://vmbuild.apache.org/continuum + + + +
axis2-cvs@ws.apache.org
+
+
+
+
+ + + scm:svn:http://svn.apache.org/repos/asf/webservices/axis2/trunk/java/ + + + scm:svn:https://svn.apache.org/repos/asf/webservices/axis2/trunk/java/ + + http://svn.apache.org/viewvc/webservices/webservices/axis2/trunk/java/ + + + + apache-repo + Maven Central Repository + + scpexe://people.apache.org//www/people.apache.org/repo/m2-ibiblio-rsync-repository + + + apache-snapshots + Apache Development Repository + scpexe://people.apache.org//www/people.apache.org/repo/m2-snapshot-repository + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + axis2-jar-package + package + + attach-artifact + + + + + target/lib/axis2-${pom.version}.jar + jar + + + + + + + + +
diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070731.172936-22.pom.md5 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070731.172936-22.pom.md5 new file mode 100644 index 000000000..9cebfeecc --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070731.172936-22.pom.md5 @@ -0,0 +1 @@ +8530af16aa7f3e5268b96ff88dd703a8 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070731.172936-22.pom.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070731.172936-22.pom.sha1 new file mode 100644 index 000000000..45d7111f6 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070731.172936-22.pom.sha1 @@ -0,0 +1 @@ +d2a036ec537737153980aed1157bad133230f2c8 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070802.113139-29.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070802.113139-29.pom new file mode 100644 index 000000000..8d5931c0e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070802.113139-29.pom @@ -0,0 +1,268 @@ + + + + + org.apache + apache + 3 + + 4.0.0 + org.apache.axis2 + axis2 + 1.3-SNAPSHOT + pom + Apache Axis 2.0 - Root + + modules/adb + modules/adb-codegen + modules/addressing + modules/codegen + modules/fastinfoset + modules/integration + modules/java2wsdl + modules/jibx + modules/json + modules/kernel + modules/mex + modules/mex-mar + modules/mtompolicy + modules/parent + modules/ping + modules/samples/version + modules/soapmonitor + modules/spring + modules/tool/axis2-aar-maven-plugin + modules/tool/axis2-ant-plugin + modules/tool/axis2-eclipse-codegen-plugin + modules/tool/axis2-eclipse-service-plugin + modules/tool/axis2-idea-plugin + modules/tool/axis2-java2wsdl-maven-plugin + modules/tool/axis2-mar-maven-plugin + modules/tool/axis2-wsdl2code-maven-plugin + modules/webapp + modules/xmlbeans + modules/samples + modules/scripting + + + + + + release + + + + modules/documentation + modules/distribution + + + + java14 + + 1.4 + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + axis2-jar + package + + + + + + + + + + + + + + + + run + + + + + + + + + java15 + + 1.5 + + + modules/jaxbri + modules/metadata + modules/saaj-api + modules/saaj + modules/jws-api + modules/jaxws-api + modules/jaxws + modules/clustering + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + axis2-jar + package + + + + + + + + + + + + + + + + + run + + + + + + + + + java16 + + 1.6 + + + modules/jaxbri + modules/metadata + modules/saaj-api + modules/saaj + modules/jws-api + modules/jaxws-api + modules/jaxws + modules/clustering + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + axis2-jar + package + + + + + + + + + + + + + + + + + run + + + + + + + + + + continuum + http://vmbuild.apache.org/continuum + + + +
axis2-cvs@ws.apache.org
+
+
+
+
+ + + scm:svn:http://svn.apache.org/repos/asf/webservices/axis2/trunk/java/ + + + scm:svn:https://svn.apache.org/repos/asf/webservices/axis2/trunk/java/ + + http://svn.apache.org/viewvc/webservices/webservices/axis2/trunk/java/ + + + + apache-repo + Maven Central Repository + + scpexe://people.apache.org//www/people.apache.org/repo/m2-ibiblio-rsync-repository + + + apache-snapshots + Apache Development Repository + scpexe://people.apache.org//www/people.apache.org/repo/m2-snapshot-repository + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + axis2-jar-package + package + + attach-artifact + + + + + target/lib/axis2-${pom.version}.jar + jar + + + + + + + + +
diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070802.113139-29.pom.md5 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070802.113139-29.pom.md5 new file mode 100644 index 000000000..9cebfeecc --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070802.113139-29.pom.md5 @@ -0,0 +1 @@ +8530af16aa7f3e5268b96ff88dd703a8 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070802.113139-29.pom.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070802.113139-29.pom.sha1 new file mode 100644 index 000000000..45d7111f6 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/axis2-1.3-20070802.113139-29.pom.sha1 @@ -0,0 +1 @@ +d2a036ec537737153980aed1157bad133230f2c8 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/maven-metadata.xml new file mode 100644 index 000000000..3d2b170fc --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/maven-metadata.xml @@ -0,0 +1,12 @@ + + org.apache.axis2 + axis2 + 1.3-SNAPSHOT + + + 20070802.113139 + 29 + + 20070802113139 + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/maven-metadata.xml.md5 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/maven-metadata.xml.md5 new file mode 100644 index 000000000..f39e1f745 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/maven-metadata.xml.md5 @@ -0,0 +1 @@ +f68494b20d262a4974d61e2911f90291 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/maven-metadata.xml.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/maven-metadata.xml.sha1 new file mode 100644 index 000000000..ebf6c8ce2 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/axis2/axis2/1.3-SNAPSHOT/maven-metadata.xml.sha1 @@ -0,0 +1 @@ +6d0399f05e374923a3929683b4176fe67d8ed08f \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/cocoon/cocoon/1/cocoon-1.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/cocoon/cocoon/1/cocoon-1.pom new file mode 100644 index 000000000..31405768a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/cocoon/cocoon/1/cocoon-1.pom @@ -0,0 +1,379 @@ + + + + + + 4.0.0 + + + org.apache + apache + 1 + + + pom + + org.apache.cocoon + cocoon + 1 + + Apache Cocoon + http://cocoon.apache.org + + + Apache License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + + + central + Maven central repository + http://ibiblio.org/maven2 + + + apache.snapshot + Apache Snapshot Repository + http://svn.apache.org/maven-snapshot-repository + + + apache-cvs + Apache Maven Repository + http://svn.apache.org/repository + legacy + + + + + The Apache Software Foundation + http://www.apache.org/ + + + + crossley + David Crossley + crossley@apache.org + ASF + http://www.apache.org/ + + Committer + + +10 + + + bdelacretaz + Bertrand Delacretaz + bdelacretaz@apache.org + ASF + http://www.apache.org + + Committer + + +1 + + + danielf + Daniel Fagerstrom + danielf@apache.org + ASF + http://www.apache.org + + Committer + + +1 + + + antonio + Antonio Gallardo + antonio@apache.org + ASF + http://www.apache.org + + Committer + + -6 + + + lgawron + Leszek Gawron + lgawron@apache.org + ASF + http://www.apache.org + + Committer + + +1 + + + joerg + Jorg Heinicke + joerg@apache.org + ASF + http://www.apache.org + +1 + + Committer + + + + jheymans + Jorg Heymans + jheymans@apache.org + ASF + http://www.apache.org + + Committer + + +1 + + + anathaniel + Alfred Nathaniel + anathaniel@apache.org + ASF + http://www.apache.org + + Committer + + +1 + + + giacomo + Giacomo Pati + giacomo@apache.org + ASF + http://www.apache.org + + Committer + + +1 + + + reinhard + Reinhard Poetz + reinhard@apache.org + ASF + http://www.apache.org + + Committer + + +1 + + + jbq + Jean-Baptiste Quenot + jbq@apache.org + ASF + http://www.apache.org + + Committer + + +1 + + + gianugo + Gianugo Rabellino + gianugo@apache.org + ASF + http://www.apache.org + + Committer + + +1 + + + cziegeler + Carsten Ziegeler + cziegeler@apache.org + ASF + http://www.apache.org + + Committer + + +1 + + + vgritsenko + Vadim Gritsenko + vgritsenko@apache.org + ASF + http://www.apache.org + + Committer + + -5 + + + + jira + https://issues.apache.org/jira/browse/COCOON + + + continuum + http://cocoon.zones.apache.org:12000/continuum/servlet/continuum + + + mail + +
dev@cocoon.apache.org
+
+
+
+
+ + + Cocoon User List + users-subscribe@cocoon.apache.org + users-unsubscribe@cocoon.apache.org + users@cocoon.apache.org + http://mail-archives.apache.org/mod_mbox/cocoon-users + + http://www.mail-archive.com/users@cocoon.apache.org/ + http://marc.theaimsgroup.com/?l=xml-cocoon-user + http://news.gmane.org/gmane.text.xml.cocoon.user + + + + Cocoon Developer List + dev-subscribe@cocoon.apache.org + dev-unsubscribe@cocoon.apache.org + dev@cocoon.apache.org + http://mail-archives.apache.org/mod_mbox/cocoon-dev + + http://www.mail-archive.com/dev@cocoon.apache.org/ + http://marc.theaimsgroup.com/?l=xml-cocoon-dev + http://news.gmane.org/gmane.text.xml.cocoon.dev + + + + Cocoon Documentation List + docs-subscribe@cocoon.apache.org + docs-unsubscribe@cocoon.apache.org + docs@cocoon.apache.org + http://mail-archives.apache.org/mod_mbox/cocoon-docs + + http://www.mail-archive.com/dev@cocoon.apache.org/ + http://marc.theaimsgroup.com/?l=xml-cocoon-docs + http://news.gmane.org/gmane.text.xml.cocoon.docs + + + + Cocoon Subversion Repository List + cvs-subscribe@cocoon.apache.org + cvs-unsubscribe@cocoon.apache.org + http://mail-archives.apache.org/mod_mbox/cocoon-cvs + + http://www.mail-archive.com/cvs@cocoon.apache.org/ + http://marc.theaimsgroup.com/?l=xml-cocoon-cvs + http://news.gmane.org/gmane.text.xml.cocoon.cvs + + + + + scm:svn:https://svn.apache.org/repos/asf/cocoon/tags/cocoon-1 + scm:svn:https://svn.apache.org/repos/asf/cocoon/tags/cocoon-1 + https://svn.apache.org/repos/asf/cocoon/tags/cocoon-1 + + + + apache-maven + release repository + scpexe://people.apache.org/www/people.apache.org/repo/m2-ibiblio-rsync-repository + + + apache-maven-snapshot + snapshot repository + scpexe://people.apache.org/www/people.apache.org/repo/m2-snapshot-repository + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.2 + + + + + + org.apache.maven.wagon + wagon-ssh-external + 1.0-alpha-6 + + + + + + maven-release-plugin + + https://svn.apache.org/repos/asf/cocoon/tags + + + + + + + + org.apache.maven.plugins + maven-project-info-reports-plugin + + + + dependencies + project-team + mailing-list + cim + issue-tracking + license + scm + + + + + + +
\ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/A/1.0/A-1.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/A/1.0/A-1.0.pom new file mode 100644 index 000000000..202a0a448 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/A/1.0/A-1.0.pom @@ -0,0 +1,28 @@ + + + + 4.0.0 + org.apache.maven + A + 1.0 + Maven Test Repository Artifact Discovery + war + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/A/1.0/A-1.0.war b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/A/1.0/A-1.0.war new file mode 100644 index 000000000..54d190b23 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/A/1.0/A-1.0.war @@ -0,0 +1 @@ +dummy content. sample file only. diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/B/1.0/B-1.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/B/1.0/B-1.0.pom new file mode 100644 index 000000000..fa5f8f6c8 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/B/1.0/B-1.0.pom @@ -0,0 +1,28 @@ + + + + 4.0.0 + org.apache.maven + B + 1.0 + Maven Test Repository Artifact Discovery + pom + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/B/2.0/B-2.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/B/2.0/B-2.0.pom new file mode 100644 index 000000000..c3034e820 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/B/2.0/B-2.0.pom @@ -0,0 +1,28 @@ + + + + 4.0.0 + org.apache.maven + B + 2.0 + Maven Test Repository Artifact Discovery + pom + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/C/1.0/C-1.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/C/1.0/C-1.0.pom new file mode 100644 index 000000000..ae14cd7eb --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/C/1.0/C-1.0.pom @@ -0,0 +1,28 @@ + + + + 4.0.0 + org.apache.maven + C + 1.0 + Maven Test Repository Artifact Discovery + war + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/C/1.0/C-1.0.war b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/C/1.0/C-1.0.war new file mode 100644 index 000000000..54d190b23 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/C/1.0/C-1.0.war @@ -0,0 +1 @@ +dummy content. sample file only. diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-applet/1.0-SNAPSHOT/archiva-applet-1.0-SNAPSHOT.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-applet/1.0-SNAPSHOT/archiva-applet-1.0-SNAPSHOT.pom new file mode 100644 index 000000000..d48ebf7a8 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-applet/1.0-SNAPSHOT/archiva-applet-1.0-SNAPSHOT.pom @@ -0,0 +1,69 @@ + + + + + 4.0.0 + + org.apache.maven.archiva + archiva + 1.0-SNAPSHOT + + archiva-applet + Archiva Applet + + Applet for performing local operations on files such as creating a checksum of an artifact + before uploading it. + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.1 + + src/keystore/keystore + mykey + password + password + + + + + sign + + + + + + org.codehaus.mojo + cobertura-maven-plugin + + + + + **/** + + + + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-base/1.0-SNAPSHOT/archiva-base-1.0-SNAPSHOT.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-base/1.0-SNAPSHOT/archiva-base-1.0-SNAPSHOT.pom new file mode 100644 index 000000000..cd51f1edc --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-base/1.0-SNAPSHOT/archiva-base-1.0-SNAPSHOT.pom @@ -0,0 +1,42 @@ + + + + + 4.0.0 + + org.apache.maven.archiva + archiva-parent + 1.0-SNAPSHOT + ../pom.xml + + + archiva-base + Archiva Base + pom + + + archiva-common + archiva-configuration + archiva-consumers + archiva-indexer + archiva-model + + archiva-repository-layer + archiva-xml-tools + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-cli/1.0-SNAPSHOT/archiva-cli-1.0-SNAPSHOT.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-cli/1.0-SNAPSHOT/archiva-cli-1.0-SNAPSHOT.pom new file mode 100644 index 000000000..115bc99ea --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-cli/1.0-SNAPSHOT/archiva-cli-1.0-SNAPSHOT.pom @@ -0,0 +1,68 @@ + + + + + + org.apache.maven.archiva + archiva-parent + 1.0-SNAPSHOT + + 4.0.0 + archiva-cli + Archiva Command Line Client + + + org.apache.maven.archiva + archiva-converter + + + org.apache.maven.archiva + archiva-repository-layer + + + org.codehaus.plexus + plexus-component-api + + + org.codehaus.plexus + plexus-cli + 1.0 + + + commons-lang + commons-lang + + + + + + maven-assembly-plugin + + src/main/assembly/archiva-cli-assembly.xml + + + org.apache.maven.archiva.cli.ArchivaCli + + + + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-common/1.0-SNAPSHOT/archiva-common-1.0-SNAPSHOT.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-common/1.0-SNAPSHOT/archiva-common-1.0-SNAPSHOT.pom new file mode 100644 index 000000000..17a20abd5 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-common/1.0-SNAPSHOT/archiva-common-1.0-SNAPSHOT.pom @@ -0,0 +1,98 @@ + + + + + + org.apache.maven.archiva + archiva-base + 1.0-SNAPSHOT + + 4.0.0 + archiva-common + Archiva Base :: Common + + + + org.codehaus.plexus + plexus-component-api + + + + commons-lang + commons-lang + + + org.codehaus.plexus + plexus-container-default + + + + + + + org.codehaus.plexus + plexus-maven-plugin + + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-configuration/1.0-SNAPSHOT/archiva-configuration-1.0-SNAPSHOT.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-configuration/1.0-SNAPSHOT/archiva-configuration-1.0-SNAPSHOT.pom new file mode 100644 index 000000000..790d0cfa4 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-configuration/1.0-SNAPSHOT/archiva-configuration-1.0-SNAPSHOT.pom @@ -0,0 +1,109 @@ + + + + + + org.apache.maven.archiva + archiva-base + 1.0-SNAPSHOT + + 4.0.0 + archiva-configuration + Archiva Base :: Configuration + + + org.codehaus.plexus + plexus-component-api + + + org.codehaus.plexus + plexus-utils + + + commons-lang + commons-lang + + + commons-io + commons-io + + + org.codehaus.plexus.registry + plexus-registry-api + 1.0-alpha-2-SNAPSHOT + + + org.codehaus.plexus.registry + plexus-registry-commons + 1.0-alpha-2-SNAPSHOT + test + + + + easymock + easymock + 1.2_Java1.3 + test + + + org.codehaus.plexus + plexus-container-default + test + + + + + + org.codehaus.modello + modello-maven-plugin + 1.0-alpha-15-SNAPSHOT + + + + java + registry-reader + registry-writer + + + + + 1.0.0 + src/main/mdo/configuration.mdo + + + + org.codehaus.mojo + cobertura-maven-plugin + + + + + org/apache/maven/archiva/configuration/io/** + org/apache/maven/archiva/configuration/*RepositoryConfiguration.* + org/apache/maven/archiva/configuration/Configuration.* + org/apache/maven/archiva/configuration/Proxy.* + + + + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-consumer-api/1.0-SNAPSHOT/archiva-consumer-api-1.0-SNAPSHOT.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-consumer-api/1.0-SNAPSHOT/archiva-consumer-api-1.0-SNAPSHOT.pom new file mode 100644 index 000000000..f331ed074 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-consumer-api/1.0-SNAPSHOT/archiva-consumer-api-1.0-SNAPSHOT.pom @@ -0,0 +1,38 @@ + + + + + 4.0.0 + + org.apache.maven.archiva + archiva-consumers + 1.0-SNAPSHOT + ../pom.xml + + + archiva-consumer-api + Archiva Consumer API + jar + + + + org.apache.maven.archiva + archiva-model + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-consumers/1.0-SNAPSHOT/archiva-consumers-1.0-SNAPSHOT.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-consumers/1.0-SNAPSHOT/archiva-consumers-1.0-SNAPSHOT.pom new file mode 100644 index 000000000..8969b9ed3 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-consumers/1.0-SNAPSHOT/archiva-consumers-1.0-SNAPSHOT.pom @@ -0,0 +1,41 @@ + + + + + 4.0.0 + + org.apache.maven.archiva + archiva-base + 1.0-SNAPSHOT + ../pom.xml + + + archiva-consumers + Archiva Consumers + pom + + + archiva-consumer-api + archiva-core-consumers + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-converter/1.0-SNAPSHOT/archiva-converter-1.0-SNAPSHOT.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-converter/1.0-SNAPSHOT/archiva-converter-1.0-SNAPSHOT.pom new file mode 100644 index 000000000..49bde7bd2 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-converter/1.0-SNAPSHOT/archiva-converter-1.0-SNAPSHOT.pom @@ -0,0 +1,79 @@ + + + + + + org.apache.maven.archiva + archiva + 1.0-SNAPSHOT + + 4.0.0 + archiva-converter + Archiva Repository Converter + + + org.apache.maven.archiva + archiva-discoverer + + + org.codehaus.plexus + plexus-utils + + + org.codehaus.plexus + plexus-component-api + + + org.apache.maven + maven-artifact + + + org.apache.maven.shared + maven-model-converter + + + org.codehaus.plexus + plexus-digest + + + org.codehaus.plexus + plexus-i18n + 1.0-beta-6 + + + commons-io + commons-io + + + + hsqldb + hsqldb + 1.7.3.3 + test + + + + org.codehaus.plexus + plexus-container-default + test + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-core-consumers/1.0-SNAPSHOT/archiva-core-consumers-1.0-SNAPSHOT.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-core-consumers/1.0-SNAPSHOT/archiva-core-consumers-1.0-SNAPSHOT.pom new file mode 100644 index 000000000..182578f57 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-core-consumers/1.0-SNAPSHOT/archiva-core-consumers-1.0-SNAPSHOT.pom @@ -0,0 +1,50 @@ + + + + + 4.0.0 + + org.apache.maven.archiva + archiva-consumers + 1.0-SNAPSHOT + ../pom.xml + + + archiva-core-consumers + Archiva Consumers :: Core Consumers + jar + + + + org.apache.maven.archiva + archiva-configuration + + + org.apache.maven.archiva + archiva-consumer-api + + + org.apache.maven.archiva + archiva-repository-layer + + + org.codehaus.plexus + plexus-digest + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-core/1.0-SNAPSHOT/archiva-core-1.0-SNAPSHOT.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-core/1.0-SNAPSHOT/archiva-core-1.0-SNAPSHOT.pom new file mode 100644 index 000000000..18b98fc7b --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-core/1.0-SNAPSHOT/archiva-core-1.0-SNAPSHOT.pom @@ -0,0 +1,113 @@ + + + + + + archiva + org.apache.maven.archiva + 1.0-SNAPSHOT + + 4.0.0 + archiva-core + Archiva Core + + + org.apache.maven.archiva + archiva-configuration + + + org.apache.maven.archiva + archiva-discoverer + + + org.apache.maven.archiva + archiva-proxy + + + org.apache.maven.archiva + archiva-reports-standard + + + org.codehaus.plexus + plexus-component-api + + + org.codehaus.plexus + plexus-quartz + 1.0-alpha-3 + + + org.codehaus.plexus.cache + plexus-cache-ehcache + 1.0-alpha-1-SNAPSHOT + + + org.codehaus.plexus + plexus-taskqueue + 1.0-alpha-6 + + + commons-lang + commons-lang + + + org.codehaus.plexus.registry + plexus-registry-commons + 1.0-SNAPSHOT + test + + + + hsqldb + hsqldb + 1.7.3.3 + test + + + + org.codehaus.plexus + plexus-container-default + test + + + + + + org.codehaus.plexus + plexus-maven-plugin + + + merge + + merge-descriptors + + + + ${basedir}/src/main/resources/META-INF/plexus/components.xml + ${project.build.directory}/generated-resources/plexus/META-INF/plexus/components.xml + + + + + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-discoverer/1.0-SNAPSHOT/archiva-discoverer-1.0-SNAPSHOT.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-discoverer/1.0-SNAPSHOT/archiva-discoverer-1.0-SNAPSHOT.pom new file mode 100644 index 000000000..8a96e39c5 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-discoverer/1.0-SNAPSHOT/archiva-discoverer-1.0-SNAPSHOT.pom @@ -0,0 +1,65 @@ + + + + + + org.apache.maven.archiva + archiva + 1.0-SNAPSHOT + + 4.0.0 + archiva-discoverer + Archiva Discoverer + + + org.apache.maven.archiva + archiva-common + + + org.codehaus.plexus + plexus-utils + + + org.codehaus.plexus + plexus-container-default + + + org.apache.maven + maven-artifact + + + org.apache.maven + maven-repository-metadata + + + org.apache.maven + maven-artifact-manager + + + org.apache.maven + maven-model + + + commons-lang + commons-lang + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-indexer/1.0-SNAPSHOT/archiva-indexer-1.0-SNAPSHOT.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-indexer/1.0-SNAPSHOT/archiva-indexer-1.0-SNAPSHOT.pom new file mode 100644 index 000000000..7d77d445f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-indexer/1.0-SNAPSHOT/archiva-indexer-1.0-SNAPSHOT.pom @@ -0,0 +1,81 @@ + + + + + + org.apache.maven.archiva + archiva-base + 1.0-SNAPSHOT + + 4.0.0 + archiva-indexer + Archiva Base :: Indexer + + + org.apache.maven.archiva + archiva-configuration + + + org.apache.maven.archiva + archiva-model + + + org.apache.lucene + lucene-core + 2.0.0 + + + org.codehaus.plexus + plexus-utils + + + org.codehaus.plexus + plexus-container-default + + + org.codehaus.plexus + plexus-digest + + + commons-lang + commons-lang + + + commons-io + commons-io + + + + + + org.codehaus.mojo + cobertura-maven-plugin + + + + 80 + 80 + + + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-model/1.0-SNAPSHOT/archiva-model-1.0-SNAPSHOT.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-model/1.0-SNAPSHOT/archiva-model-1.0-SNAPSHOT.pom new file mode 100644 index 000000000..52c185ea7 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-model/1.0-SNAPSHOT/archiva-model-1.0-SNAPSHOT.pom @@ -0,0 +1,159 @@ + + + + + + org.apache.maven.archiva + archiva-base + 1.0-SNAPSHOT + + 4.0.0 + archiva-model + Archiva Base :: Model + + + org.apache.maven.archiva + archiva-common + + + org.codehaus.plexus + plexus-utils + + + javax.jdo + jdo2-api + 2.0 + + + org.codehaus.plexus + plexus-container-default + + + commons-lang + commons-lang + + + commons-io + commons-io + + + + + + org.codehaus.plexus + plexus-maven-plugin + + + org.codehaus.modello + modello-maven-plugin + 1.0-alpha-15-SNAPSHOT + + 1.0.0 + false + src/main/mdo/archiva-base.xml + + + + archiva-base + + java + xsd + jpox-jdo-mapping + jpox-metadata-class + + + + + + + org.codehaus.mojo + jpox-maven-plugin + 1.1.6 + + + org.apache.derby + derby + 10.2.1.6 + + + + + create-ddl + generate-test-resources + + schema-create + + + ${basedir}/target/classes/org/apache/maven/archiva/model/schema.ddl + + + javax.jdo.option.ConnectionDriverName + org.apache.derby.jdbc.EmbeddedDriver + + + javax.jdo.option.ConnectionURL + jdbc:derby:target/jdo-schema-create;create=true + + + javax.jdo.option.ConnectionUserName + sa + + + javax.jdo.option.ConnectionPassword + + + + log4j.configuration + ${basedir}/src/test/resources/log4j.xml + + + org.jpox.autoCreateTables + true + + + + + + enhance + + enhance + + + + + + org.codehaus.mojo + cobertura-maven-plugin + + + + + org/apache/maven/archiva/reporting/model/** + + + + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-parent/1.0-SNAPSHOT/archiva-parent-1.0-SNAPSHOT.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-parent/1.0-SNAPSHOT/archiva-parent-1.0-SNAPSHOT.pom new file mode 100644 index 000000000..970098384 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-parent/1.0-SNAPSHOT/archiva-parent-1.0-SNAPSHOT.pom @@ -0,0 +1,566 @@ + + + + + 4.0.0 + + org.apache.maven + maven-parent + 4 + ../pom/maven/pom.xml + + org.apache.maven.archiva + archiva-parent + pom + Archiva + 1.0-SNAPSHOT + + Archiva is an application for managing one or more remote repositories, including + administration, artifact handling, + browsing and searching. + + http://maven.apache.org/archiva + + jira + http://jira.codehaus.org/browse/MRM + + + + Maven Archiva User List + archiva-users-subscribe@maven.apache.org + archiva-users-unsubscribe@maven.apache.org + archiva-users@maven.apache.org + http://mail-archives.apache.org/mod_mbox/maven-archiva-users + + + Maven Archiva Developer List + archiva-dev-subscribe@maven.apache.org + archiva-dev-unsubscribe@maven.apache.org + archiva-dev@maven.apache.org + http://mail-archives.apache.org/mod_mbox/maven-archiva-dev + + + Maven Archiva Commits List + archiva-commits-subscribe@maven.apache.org + archiva-commits-unsubscribe@maven.apache.org + archiva-commits@maven.apache.org + http://mail-archives.apache.org/mod_mbox/maven-archiva-commits + + + + scm:svn:http://svn.apache.org/repos/asf/maven/archiva/trunk + scm:svn:https://svn.apache.org/repos/asf/maven/archiva/trunk + http://svn.apache.org/viewcvs.cgi/maven/archiva/trunk + + + + apache.website + scpexe://people.apache.org/www/maven.apache.org/archiva/ + + + + + + org.codehaus.plexus + plexus-maven-plugin + 1.3.3 + + + generate + + descriptor + + + + + + maven-compiler-plugin + + 1.4 + 1.4 + + + + maven-surefire-plugin + 2.2 + + + + + + maven-idea-plugin + + 1.4 + + + + maven-release-plugin + + https://svn.apache.org/repos/asf/maven/archiva/tags + + + + + + + archiva-api + archiva-base + archiva-database + archiva-reporting + archiva-web + archiva-cli + maven-meeper + + + + junit + junit + 3.8.1 + test + + + + + + org.apache.maven.shared + maven-app-configuration-model + 1.0-SNAPSHOT + + + org.apache.maven.shared + maven-app-configuration-web + 1.0-SNAPSHOT + + + org.codehaus.plexus + plexus-container-default + 1.0-alpha-18 + + + org.codehaus.plexus + plexus-component-api + 1.0-alpha-18 + + + org.codehaus.plexus + plexus-utils + 1.4 + + + org.slf4j + slf4j-log4j12 + 1.2 + + + org.apache.maven + maven-repository-metadata + ${maven.version} + + + org.apache.maven + maven-model + ${maven.version} + + + org.apache.maven + maven-artifact + ${maven.version} + + + org.apache.maven + maven-artifact-manager + ${maven.version} + + + org.apache.maven + maven-project + ${maven.version} + + + org.apache.maven.shared + maven-model-converter + 2.0.5-SNAPSHOT + + + org.apache.maven.wagon + wagon-provider-api + ${wagon.version} + + + org.apache.maven.wagon + wagon-ssh + ${wagon.version} + + + org.apache.maven.wagon + wagon-file + ${wagon.version} + + + org.apache.maven.wagon + wagon-http-lightweight + ${wagon.version} + + + org.apache.maven.archiva + archiva-common + ${archiva.version} + + + org.apache.maven.archiva + archiva-core + ${archiva.version} + + + org.apache.maven.archiva + archiva-reports-standard + ${archiva.version} + + + org.apache.maven.archiva + archiva-model + ${archiva.version} + + + org.apache.maven.archiva + archiva-database + ${archiva.version} + + + org.apache.maven.archiva + archiva-consumer-api + ${archiva.version} + + + org.apache.maven.archiva + archiva-model + ${archiva.version} + + + org.apache.maven.archiva + archiva-database + ${archiva.version} + + + org.apache.maven.archiva + archiva-discoverer + ${archiva.version} + + + org.apache.maven.archiva + archiva-repository-layer + ${archiva.version} + + + org.apache.maven.archiva + archiva-indexer + ${archiva.version} + + + org.apache.maven.archiva + archiva-proxy + ${archiva.version} + + + org.apache.maven.archiva + archiva-applet + ${archiva.version} + + + org.apache.maven.archiva + archiva-security + ${archiva.version} + + + org.apache.maven.archiva + archiva-configuration + ${archiva.version} + + + org.apache.maven.archiva + archiva-converter + ${archiva.version} + + + org.apache.maven.archiva + archiva-utils + ${archiva.version} + + + org.apache.maven.archiva + archiva-webapp + ${archiva.version} + war + + + org.codehaus.plexus + plexus-digest + 1.1-SNAPSHOT + + + org.codehaus.plexus.security + plexus-security-rbac-profile + ${plexus-security.version} + + + org.codehaus.plexus.security + plexus-security-system + ${plexus-security.version} + + + org.codehaus.plexus.security + plexus-security-system + ${plexus-security.version} + + + org.codehaus.plexus.security + plexus-security-ui-web + ${plexus-security.version} + war + + + org.codehaus.plexus.security + plexus-security-ui-web-integration + ${plexus-security.version} + + + org.codehaus.plexus.security + plexus-security-ui-web-taglib + ${plexus-security.version} + + + org.codehaus.plexus.security + plexus-security-authentication-provider-user-manager + ${plexus-security.version} + + + org.codehaus.plexus.security + plexus-security-authentication-provider-keystore + ${plexus-security.version} + + + org.codehaus.plexus.security + plexus-security-user-management-api + ${plexus-security.version} + + + org.codehaus.plexus.security + plexus-security-user-management-provider-jdo + ${plexus-security.version} + + + org.codehaus.plexus.security + plexus-security-authorization-rbac-store-cached + ${plexus-security.version} + + + org.codehaus.plexus.security + plexus-security-authorization-rbac-store-jdo + ${plexus-security.version} + + + org.codehaus.plexus.security + plexus-security-authorization-api + ${plexus-security.version} + + + org.codehaus.plexus.security + plexus-security-authorization-rbac-authorizer + ${plexus-security.version} + + + org.codehaus.plexus.security + plexus-security-keys-jdo + ${plexus-security.version} + + + commons-lang + commons-lang + 2.2 + + + commons-io + commons-io + 1.2 + + + org.apache.derby + derby + 10.1.3.1 + + + + + + + org.codehaus.mojo + cobertura-maven-plugin + + + maven-checkstyle-plugin + + config/maven_checks.xml + + + + org.codehaus.mojo + changelog-maven-plugin + + + org.codehaus.mojo + taglist-maven-plugin + + + maven-jxr-plugin + + true + + + + maven-surefire-report-plugin + + + maven-javadoc-plugin + + 1.4 + true + + + + maven-pmd-plugin + + + + + + + ci + + + enableCiProfile + true + + + + + + org.apache.maven.plugins + maven-pmd-plugin + + + process-sources + + + cpd-check + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + + + process-sources + + + + + + + + org.codehaus.mojo + cobertura-maven-plugin + + + 77 + 95 + + + + + **/*$* + + + + + + clean + + clean + + + + check + + check + + + + + + + + + + + codehaus.org + http://repository.codehaus.org + + true + + + false + + + + + snapshots.codehaus.org + http://snapshots.repository.codehaus.org + + false + + + true + + + + + + + snapshots.codehaus.org + http://snapshots.repository.codehaus.org + + false + + + true + + + + + 1.0-SNAPSHOT + 2.0.5 + 1.0-beta-2 + 1.0-alpha-11-SNAPSHOT + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-plexus-application/1.0-SNAPSHOT/archiva-plexus-application-1.0-SNAPSHOT.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-plexus-application/1.0-SNAPSHOT/archiva-plexus-application-1.0-SNAPSHOT.pom new file mode 100644 index 000000000..21edbff05 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-plexus-application/1.0-SNAPSHOT/archiva-plexus-application-1.0-SNAPSHOT.pom @@ -0,0 +1,62 @@ + + + + + + archiva + org.apache.maven.archiva + 1.0-SNAPSHOT + + 4.0.0 + archiva-plexus-application + plexus-application + Archiva Plexus Application + + + + org.codehaus.plexus + plexus-appserver-maven-plugin + 2.0-alpha-7 + true + + src/conf/application.xml + src/conf + src/plexus.properties + archiva + src/conf/plexus.xml + src/plexus.properties + target/plexus-archiva-runtime + + + + + + + org.apache.maven.archiva + archiva-webapp + war + + + + + ${project.version} + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-plexus-runtime/1.0-SNAPSHOT/archiva-plexus-runtime-1.0-SNAPSHOT.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-plexus-runtime/1.0-SNAPSHOT/archiva-plexus-runtime-1.0-SNAPSHOT.pom new file mode 100644 index 000000000..1c675dc62 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-plexus-runtime/1.0-SNAPSHOT/archiva-plexus-runtime-1.0-SNAPSHOT.pom @@ -0,0 +1,145 @@ + + + + + + org.apache.maven.archiva + archiva + 1.0-SNAPSHOT + + 4.0.0 + archiva-plexus-runtime + Archiva Runtime Generator + + + org.codehaus.plexus + plexus-container-default + + + org.codehaus.plexus + plexus-utils + + + org.codehaus.plexus + plexus-appserver-host + 2.0-alpha-7 + + + + org.codehaus.plexus + plexus-appserver-service-jetty + 2.0-alpha-7 + plexus-service + + + + org.apache.maven.archiva + archiva-plexus-application + ${project.version} + plexus-application + + + + + log4j + log4j + 1.2.8 + + + commons-logging + commons-logging-api + 1.0.4 + + + org.apache.derby + derby + runtime + + + org.codehaus.plexus + plexus-naming + 1.0-alpha-3-SNAPSHOT + runtime + + + javax.mail + mail + 1.4 + runtime + + + + + + org.codehaus.plexus + plexus-appserver-maven-plugin + 2.0-alpha-7 + true + + + process-resources + + assemble-runtime + add-services + add-apps + + + + + src/conf/plexus.xml + src/plexus.properties + target/plexus-archiva-runtime + + commons-logging:commons-logging-api + log4j:log4j + org.apache.derby:derby + org.codehaus.plexus:plexus-naming + commons-pool:commons-pool + commons-dbcp:commons-dbcp + commons-collections:commons-collections + directory-naming:naming-core + directory-naming:naming-factory + directory-naming:naming-java + directory-naming:naming-config + javax.mail:mail + javax.activation:activation + + + + + maven-assembly-plugin + 2.1 + + + package + + single + + + + + src/main/assembly/bin.xml + archiva + + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-proxy/1.0-SNAPSHOT/archiva-proxy-1.0-SNAPSHOT.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-proxy/1.0-SNAPSHOT/archiva-proxy-1.0-SNAPSHOT.pom new file mode 100644 index 000000000..23488ee0a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-proxy/1.0-SNAPSHOT/archiva-proxy-1.0-SNAPSHOT.pom @@ -0,0 +1,60 @@ + + + + + + org.apache.maven.archiva + archiva + 1.0-SNAPSHOT + + 4.0.0 + archiva-proxy + Archiva Proxy + + + org.apache.maven.archiva + archiva-common + + + org.apache.maven.wagon + wagon-file + test + + + org.apache.maven.wagon + wagon-provider-api + + + org.codehaus.plexus + plexus-digest + + + easymock + easymock + 1.2_Java1.3 + test + + + commons-io + commons-io + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-reports-standard/1.0-SNAPSHOT/archiva-reports-standard-1.0-SNAPSHOT.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-reports-standard/1.0-SNAPSHOT/archiva-reports-standard-1.0-SNAPSHOT.pom new file mode 100644 index 000000000..24eb19954 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-reports-standard/1.0-SNAPSHOT/archiva-reports-standard-1.0-SNAPSHOT.pom @@ -0,0 +1,176 @@ + + + + + + org.apache.maven.archiva + archiva + 1.0-SNAPSHOT + + 4.0.0 + archiva-reports-standard + Archiva Standard Reports + + + org.codehaus.plexus + plexus-utils + + + org.codehaus.plexus + plexus-container-default + + + org.apache.maven + maven-artifact + + + org.apache.maven + maven-artifact-manager + + + org.apache.maven + maven-model + + + org.apache.maven + maven-repository-metadata + + + org.apache.maven.wagon + wagon-provider-api + + + org.apache.maven.archiva + archiva-repository-layer + + + org.apache.maven.archiva + archiva-indexer + + + org.apache.maven.archiva + archiva-discoverer + + + commons-lang + commons-lang + + + commons-io + commons-io + + + org.codehaus.plexus + plexus-jdo2 + 1.0-alpha-8 + + + xerces + xercesImpl + + + xerces + xmlParserAPIs + + + + + jpox + jpox + 1.1.6 + compile + + + + javax.sql + jdbc-stdext + + + + + + hsqldb + hsqldb + 1.7.3.3 + test + + + + + + org.codehaus.modello + modello-maven-plugin + 1.0-alpha-14-SNAPSHOT + + 1.0.0 + false + src/main/mdo/reporting.mdo + + + + modello-java + + java + jpox-metadata-class + + + + + jpox-jdo-mapping + + jpox-jdo-mapping + + + ${basedir}/target/classes/org/apache/maven/archiva/reporting/model/ + + + + + + org.codehaus.mojo + jpox-maven-plugin + 1.1.6-SNAPSHOT + + + + enhance + + + + + + org.codehaus.mojo + cobertura-maven-plugin + + + + + org/apache/maven/archiva/reporting/model/** + + + + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-repository-layer/1.0-SNAPSHOT/archiva-repository-layer-1.0-SNAPSHOT.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-repository-layer/1.0-SNAPSHOT/archiva-repository-layer-1.0-SNAPSHOT.pom new file mode 100644 index 000000000..6ec87f431 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-repository-layer/1.0-SNAPSHOT/archiva-repository-layer-1.0-SNAPSHOT.pom @@ -0,0 +1,103 @@ + + + + + + org.apache.maven.archiva + archiva-base + 1.0-SNAPSHOT + + 4.0.0 + archiva-repository-layer + Archiva Repository Interface Layer + + + org.apache.maven.archiva + archiva-consumer-api + + + org.apache.maven.archiva + archiva-model + 1.0-SNAPSHOT + + + org.apache.maven.archiva + archiva-xml-tools + 1.0-SNAPSHOT + + + org.codehaus.plexus + plexus-utils + + + org.codehaus.plexus.cache + plexus-cache-api + 1.0-alpha-2-SNAPSHOT + compile + + + org.codehaus.plexus.cache + plexus-cache-ehcache + 1.0-alpha-2-SNAPSHOT + compile + + + + org.slf4j + slf4j-log4j12 + + + + + + org.codehaus.plexus + plexus-maven-plugin + + + merge + + merge-descriptors + + + + ${basedir}/src/main/resources/META-INF/plexus/components.xml + ${project.build.directory}/generated-resources/plexus/META-INF/plexus/components.xml + + + + + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-security/1.0-SNAPSHOT/archiva-security-1.0-SNAPSHOT.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-security/1.0-SNAPSHOT/archiva-security-1.0-SNAPSHOT.pom new file mode 100644 index 000000000..78cbd1282 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-security/1.0-SNAPSHOT/archiva-security-1.0-SNAPSHOT.pom @@ -0,0 +1,45 @@ + + + + + + archiva + org.apache.maven.archiva + 1.0-SNAPSHOT + + 4.0.0 + archiva-security + Archiva Security Configuration + + + org.codehaus.plexus.security + plexus-security-rbac-profile + + + org.codehaus.plexus.security + plexus-security-system + + + org.codehaus.plexus + plexus-component-api + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-webapp/1.0-SNAPSHOT/archiva-webapp-1.0-SNAPSHOT.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-webapp/1.0-SNAPSHOT/archiva-webapp-1.0-SNAPSHOT.pom new file mode 100644 index 000000000..8304d2dd0 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-webapp/1.0-SNAPSHOT/archiva-webapp-1.0-SNAPSHOT.pom @@ -0,0 +1,334 @@ + + + + + 4.0.0 + + org.apache.maven.archiva + archiva + 1.0-SNAPSHOT + + archiva-webapp + war + Archiva Web Application + + + javax.servlet + servlet-api + 2.4 + provided + + + javax.servlet + jsp-api + 2.0 + provided + + + opensymphony + sitemesh + 2.2.1 + + + taglibs + standard + 1.1.2 + + + javax.servlet + jstl + 1.1.2 + + + org.apache.maven.shared + maven-app-configuration-model + + + org.apache.maven.shared + maven-app-configuration-web + + + org.codehaus.plexus + plexus-log4j-logging + 1.1-alpha-2 + runtime + + + commons-logging + commons-logging + 1.0.4 + runtime + + + commons-lang + commons-lang + 2.2 + + + org.apache.maven.wagon + wagon-http-lightweight + runtime + + + org.apache.maven.wagon + wagon-file + runtime + + + opensymphony + webwork + 2.2.4 + + + org.codehaus.plexus.registry + plexus-registry-commons + 1.0-SNAPSHOT + + + org.codehaus.plexus + plexus-component-api + + + org.codehaus.plexus + plexus-container-default + + + org.apache.maven.archiva + archiva-proxy + + + org.apache.maven.archiva + archiva-core + + + org.apache.maven.archiva + archiva-common + + + org.apache.maven.archiva + archiva-security + + + org.apache.maven.archiva + archiva-applet + + provided + + + org.apache.maven + maven-project + + + org.apache.maven.shared + maven-dependency-tree + 1.0-alpha-2 + + + + org.codehaus.plexus.security + plexus-security-ui-web + war + runtime + + + org.codehaus.plexus.security + plexus-security-ui-web-taglib + + + + org.codehaus.plexus.webdav + plexus-webdav-simple + 1.0-alpha-1-SNAPSHOT + + + org.codehaus.plexus + plexus-xwork-integration + 1.0-alpha-5 + + + org.codehaus.plexus + plexus-utils + + + org.apache.derby + derby + 10.1.3.1 + provided + + + javax.mail + mail + 1.4 + provided + + + javax.activation + activation + 1.1 + provided + + + + + + org.apache.maven.plugins + maven-clean-plugin + 2.1.1 + + + + + ${basedir}/src/main/webapp + + + META-INF + images/pss + + template/pss + + WEB-INF/classes + + WEB-INF/lib + + WEB-INF/database + + WEB-INF/logs + + pss + + css/pss + WEB-INF/jsp/pss + + WEB-INF/template/pss + + WEB-INF/logs + + WEB-INF/temp + + + + + + + + org.apache.maven.plugins + maven-war-plugin + 2.0.1 + + + false + META-INF/**,WEB-INF/web.xml,WEB-INF/classes/xwork.xml + + + + + compile + + + inplace + + + + + + org.mortbay.jetty + maven-jetty-plugin + 6.1.1 + + 10 + / + src/jetty-env.xml + + + 9091 + 60000 + + + + + appserver.base + ${project.build.directory}/appserver-base + + + derby.system.home + ${project.build.directory}/appserver-base/logs + + + + + + org.apache.derby + derby + 10.1.3.1 + + + + + org.codehaus.mojo + dependency-maven-plugin + + + copy + process-resources + + copy + + + + + ${project.groupId} + archiva-applet + ${project.version} + src/main/webapp + archiva-applet.jar + + + + + + + + org.codehaus.plexus + plexus-maven-plugin + + + + com.opensymphony.xwork.Action + per-lookup + + + + + + org.codehaus.mojo + cobertura-maven-plugin + + + + **/** + + + + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-xml-tools/1.0-SNAPSHOT/archiva-xml-tools-1.0-SNAPSHOT.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-xml-tools/1.0-SNAPSHOT/archiva-xml-tools-1.0-SNAPSHOT.pom new file mode 100644 index 000000000..efa42d3f0 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva-xml-tools/1.0-SNAPSHOT/archiva-xml-tools-1.0-SNAPSHOT.pom @@ -0,0 +1,79 @@ + + + + + + org.apache.maven.archiva + archiva-base + 1.0-SNAPSHOT + + 4.0.0 + archiva-xml-tools + Archiva Base :: XML Tools + + + org.apache.maven.archiva + archiva-common + + + dom4j + dom4j + 1.6.1 + + + jaxen + jaxen + 1.1 + + + org.codehaus.plexus + plexus-utils + + + org.slf4j + slf4j-log4j12 + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva/1.0-SNAPSHOT/archiva-1.0-20061126.005254-2.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva/1.0-SNAPSHOT/archiva-1.0-20061126.005254-2.pom new file mode 100644 index 000000000..cf8e32963 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva/1.0-SNAPSHOT/archiva-1.0-20061126.005254-2.pom @@ -0,0 +1,505 @@ + + + + + 4.0.0 + + org.apache.maven + maven-parent + 4 + ../pom/maven/pom.xml + + org.apache.maven.archiva + archiva + pom + Archiva + 1.0-SNAPSHOT + + Archiva is an application for managing one or more remote repositories, including + administration, artifact handling, + browsing and searching. + + http://maven.apache.org/archiva + + jira + http://jira.codehaus.org/browse/MRM + + + + Maven Archiva User List + archiva-users-subscribe@maven.apache.org + archiva-users-unsubscribe@maven.apache.org + archiva-users@maven.apache.org + http://mail-archives.apache.org/mod_mbox/maven-archiva-users + + + Maven Archiva Developer List + archiva-dev-subscribe@maven.apache.org + archiva-dev-unsubscribe@maven.apache.org + archiva-dev@maven.apache.org + http://mail-archives.apache.org/mod_mbox/maven-archiva-dev + + + Maven Archiva Commits List + archiva-commits-subscribe@maven.apache.org + archiva-commits-unsubscribe@maven.apache.org + archiva-commits@maven.apache.org + http://mail-archives.apache.org/mod_mbox/maven-archiva-commits + + + + scm:svn:http://svn.apache.org/repos/asf/maven/archiva/trunk + scm:svn:https://svn.apache.org/repos/asf/maven/archiva/trunk + http://svn.apache.org/viewcvs.cgi/maven/archiva/trunk + + + + apache.website + scpexe://people.apache.org/www/maven.apache.org/archiva/ + + + + + + org.apache.maven.wagon + wagon-ssh-external + 1.0-alpha-5 + + + + + org.codehaus.plexus + plexus-maven-plugin + 1.3 + + + + descriptor + merge-descriptors + + + + + + maven-compiler-plugin + + 1.4 + 1.4 + + + + maven-surefire-plugin + 2.2 + + + + + + maven-idea-plugin + + 1.4 + + + + maven-release-plugin + + https://svn.apache.org/repos/asf/maven/archiva/tags + + + + + + + archiva-applet + archiva-converter + archiva-discoverer + archiva-reports-standard + archiva-indexer + archiva-webapp + archiva-proxy + archiva-core + archiva-configuration + maven-meeper + archiva-repository-layer + archiva-plexus-application + archiva-plexus-runtime + archiva-security + archiva-cli + + + + junit + junit + 3.8.1 + test + + + + + + org.codehaus.plexus + plexus-container-default + 1.0-alpha-10 + + + org.codehaus.plexus + plexus-utils + 1.3 + + + org.apache.maven + maven-repository-metadata + ${maven.version} + + + org.apache.maven + maven-model + ${maven.version} + + + org.apache.maven + maven-artifact + ${maven.version} + + + org.apache.maven + maven-artifact-manager + ${maven.version} + + + org.apache.maven + maven-project + ${maven.version} + + + org.apache.maven + maven-model-converter + 2.0.4 + + + org.apache.maven.wagon + wagon-provider-api + ${wagon.version} + + + org.apache.maven.wagon + wagon-ssh + ${wagon.version} + + + org.apache.maven.wagon + wagon-file + ${wagon.version} + + + org.apache.maven.wagon + wagon-http-lightweight + ${wagon.version} + + + org.apache.maven.archiva + archiva-core + ${pom.version} + + + org.apache.maven.archiva + archiva-reports-standard + ${pom.version} + + + org.apache.maven.archiva + archiva-discoverer + ${pom.version} + + + org.apache.maven.archiva + archiva-repository-layer + ${pom.version} + + + org.apache.maven.archiva + archiva-indexer + ${pom.version} + + + org.apache.maven.archiva + archiva-proxy + ${pom.version} + + + org.apache.maven.archiva + archiva-applet + ${pom.version} + + + org.apache.maven.archiva + archiva-security + ${pom.version} + + + org.apache.maven.archiva + archiva-configuration + ${pom.version} + + + org.apache.maven.archiva + archiva-converter + ${pom.version} + + + org.apache.maven.archiva + archiva-webapp + ${pom.version} + war + + + org.codehaus.plexus + plexus-digest + 1.0-SNAPSHOT + + + org.codehaus.plexus.security + plexus-security-rbac-profile + ${plexus-security.version} + + + org.codehaus.plexus.security + plexus-security-system + ${plexus-security.version} + + + org.codehaus.plexus.security + plexus-security-system + ${plexus-security.version} + + + org.codehaus.plexus.security + plexus-security-ui-web + ${plexus-security.version} + war + + + org.codehaus.plexus.security + plexus-security-ui-web-integration + ${plexus-security.version} + + + org.codehaus.plexus.security + plexus-security-ui-web-taglib + ${plexus-security.version} + + + org.codehaus.plexus.security + plexus-security-authentication-provider-user-manager + ${plexus-security.version} + + + org.codehaus.plexus.security + plexus-security-authentication-provider-keystore + ${plexus-security.version} + + + org.codehaus.plexus.security + plexus-security-user-management-api + ${plexus-security.version} + + + org.codehaus.plexus.security + plexus-security-user-management-provider-jdo + ${plexus-security.version} + + + org.codehaus.plexus.security + plexus-security-authorization-rbac-store-jdo + ${plexus-security.version} + + + org.codehaus.plexus.security + plexus-security-authorization-api + ${plexus-security.version} + + + org.codehaus.plexus.security + plexus-security-authorization-rbac-authorizer + ${plexus-security.version} + + + org.codehaus.plexus.security + plexus-security-keys-jdo + ${plexus-security.version} + + + + + + + org.codehaus.mojo + cobertura-maven-plugin + + + maven-checkstyle-plugin + + config/maven_checks.xml + + + + org.codehaus.mojo + changelog-maven-plugin + + + org.codehaus.mojo + taglist-maven-plugin + + + maven-jxr-plugin + + true + + + + maven-surefire-report-plugin + + + maven-javadoc-plugin + + true + + + + maven-pmd-plugin + + + + + + + ci + + + enableCiProfile + true + + + + + + org.apache.maven.plugins + maven-pmd-plugin + + + process-sources + + + cpd-check + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + + + process-sources + + + + + + + + org.codehaus.mojo + cobertura-maven-plugin + + + 77 + 95 + + + + + **/*$* + + + + + + clean + + clean + + + + check + + check + + + + + + + + + + + + codehaus.org + http://snapshots.repository.codehaus.org + + false + + + true + + + + + + codehaus.org + http://snapshots.repository.codehaus.org + + false + + + true + + + + + + apache.org + http://people.apache.org/repo/m2-snapshot-repository + + false + + + true + + + + + 2.0.4 + 1.0-beta-1 + 1.0-alpha-6-SNAPSHOT + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva/1.0-SNAPSHOT/archiva-1.0-SNAPSHOT-site.xml b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva/1.0-SNAPSHOT/archiva-1.0-SNAPSHOT-site.xml new file mode 100644 index 000000000..ac3c2e716 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva/1.0-SNAPSHOT/archiva-1.0-SNAPSHOT-site.xml @@ -0,0 +1,28 @@ + + + Maven + http://maven.apache.org/images/apache-maven-project-2.png + http://maven.apache.org/ + + + images/archiva-logo-banner.jpg + + + + org.apache.maven.skins + maven-stylus-skin + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva/1.0-SNAPSHOT/archiva-1.0-SNAPSHOT.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva/1.0-SNAPSHOT/archiva-1.0-SNAPSHOT.pom new file mode 100644 index 000000000..31df31eda --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/archiva/archiva/1.0-SNAPSHOT/archiva-1.0-SNAPSHOT.pom @@ -0,0 +1,556 @@ + + + + + 4.0.0 + + org.apache.maven + maven-parent + 4 + ../pom/maven/pom.xml + + + 2.0.5 + + org.apache.maven.archiva + archiva + pom + Archiva + 1.0-SNAPSHOT + + Archiva is an application for managing one or more remote repositories, including + administration, artifact handling, + browsing and searching. + + http://maven.apache.org/archiva + + jira + http://jira.codehaus.org/browse/MRM + + + + Maven Archiva User List + archiva-users-subscribe@maven.apache.org + archiva-users-unsubscribe@maven.apache.org + archiva-users@maven.apache.org + http://mail-archives.apache.org/mod_mbox/maven-archiva-users + + + Maven Archiva Developer List + archiva-dev-subscribe@maven.apache.org + archiva-dev-unsubscribe@maven.apache.org + archiva-dev@maven.apache.org + http://mail-archives.apache.org/mod_mbox/maven-archiva-dev + + + Maven Archiva Commits List + archiva-commits-subscribe@maven.apache.org + archiva-commits-unsubscribe@maven.apache.org + archiva-commits@maven.apache.org + http://mail-archives.apache.org/mod_mbox/maven-archiva-commits + + + + scm:svn:http://svn.apache.org/repos/asf/maven/archiva/trunk + scm:svn:https://svn.apache.org/repos/asf/maven/archiva/trunk + http://svn.apache.org/viewcvs.cgi/maven/archiva/trunk + + + + apache.website + scpexe://people.apache.org/www/maven.apache.org/archiva/ + + + + + + org.codehaus.plexus + plexus-maven-plugin + 1.3.3 + + + generate + + descriptor + + + + + + maven-compiler-plugin + + 1.4 + 1.4 + + + + maven-surefire-plugin + 2.2 + + + + + + maven-idea-plugin + + 1.4 + + + + maven-release-plugin + + https://svn.apache.org/repos/asf/maven/archiva/tags + + + + + + + archiva-applet + archiva-converter + archiva-common + archiva-discoverer + archiva-reports-standard + archiva-indexer + archiva-webapp + archiva-proxy + archiva-core + archiva-configuration + maven-meeper + archiva-repository-layer + archiva-plexus-application + archiva-plexus-runtime + archiva-security + archiva-cli + + + + junit + junit + 3.8.1 + test + + + + + + org.apache.maven.shared + maven-app-configuration-model + 1.0-SNAPSHOT + + + org.apache.maven.shared + maven-app-configuration-web + 1.0-SNAPSHOT + + + org.codehaus.plexus + plexus-container-default + 1.0-alpha-17 + + + org.codehaus.plexus + plexus-component-api + 1.0-alpha-17 + + + org.codehaus.plexus + plexus-utils + 1.4 + + + org.apache.maven + maven-repository-metadata + ${maven.version} + + + org.apache.maven + maven-model + ${maven.version} + + + org.apache.maven + maven-artifact + ${maven.version} + + + org.apache.maven + maven-artifact-manager + ${maven.version} + + + org.apache.maven + maven-project + ${maven.version} + + + org.apache.maven.shared + maven-model-converter + 2.0.5-SNAPSHOT + + + org.apache.maven.wagon + wagon-provider-api + ${wagon.version} + + + org.apache.maven.wagon + wagon-ssh + ${wagon.version} + + + org.apache.maven.wagon + wagon-file + ${wagon.version} + + + org.apache.maven.wagon + wagon-http-lightweight + ${wagon.version} + + + org.apache.maven.archiva + archiva-common + ${pom.version} + + + + org.apache.maven.archiva + archiva-core + ${pom.version} + + + org.apache.maven.archiva + archiva-reports-standard + ${pom.version} + + + org.apache.maven.archiva + archiva-discoverer + ${pom.version} + + + org.apache.maven.archiva + archiva-repository-layer + ${pom.version} + + + org.apache.maven.archiva + archiva-indexer + ${pom.version} + + + org.apache.maven.archiva + archiva-proxy + ${pom.version} + + + org.apache.maven.archiva + archiva-applet + ${pom.version} + + + org.apache.maven.archiva + archiva-security + ${pom.version} + + + org.apache.maven.archiva + archiva-configuration + ${pom.version} + + + org.apache.maven.archiva + archiva-converter + ${pom.version} + + + org.apache.maven.archiva + archiva-utils + ${pom.version} + + + org.apache.maven.archiva + archiva-webapp + ${pom.version} + war + + + org.codehaus.plexus + plexus-digest + 1.0 + + + org.codehaus.plexus.security + plexus-security-rbac-profile + ${plexus-security.version} + + + org.codehaus.plexus.security + plexus-security-system + ${plexus-security.version} + + + org.codehaus.plexus.security + plexus-security-system + ${plexus-security.version} + + + org.codehaus.plexus.security + plexus-security-ui-web + ${plexus-security.version} + war + + + org.codehaus.plexus.security + plexus-security-ui-web-integration + ${plexus-security.version} + + + org.codehaus.plexus.security + plexus-security-ui-web-taglib + ${plexus-security.version} + + + org.codehaus.plexus.security + plexus-security-authentication-provider-user-manager + ${plexus-security.version} + + + org.codehaus.plexus.security + plexus-security-authentication-provider-keystore + ${plexus-security.version} + + + org.codehaus.plexus.security + plexus-security-user-management-api + ${plexus-security.version} + + + org.codehaus.plexus.security + plexus-security-user-management-provider-jdo + ${plexus-security.version} + + + org.codehaus.plexus.security + plexus-security-authorization-rbac-store-cached + ${plexus-security.version} + + + org.codehaus.plexus.security + plexus-security-authorization-rbac-store-jdo + ${plexus-security.version} + + + org.codehaus.plexus.security + plexus-security-authorization-api + ${plexus-security.version} + + + org.codehaus.plexus.security + plexus-security-authorization-rbac-authorizer + ${plexus-security.version} + + + org.codehaus.plexus.security + plexus-security-keys-jdo + ${plexus-security.version} + + + commons-lang + commons-lang + 2.2 + + + commons-io + commons-io + 1.2 + + + org.apache.derby + derby + 10.1.3.1 + + + + + + + org.codehaus.mojo + cobertura-maven-plugin + + + maven-checkstyle-plugin + + config/maven_checks.xml + + + + org.codehaus.mojo + changelog-maven-plugin + + + org.codehaus.mojo + taglist-maven-plugin + + + maven-jxr-plugin + + true + + + + maven-surefire-report-plugin + + + maven-javadoc-plugin + + 1.4 + true + + + + maven-pmd-plugin + + + + + + + ci + + + enableCiProfile + true + + + + + + org.apache.maven.plugins + maven-pmd-plugin + + + process-sources + + + cpd-check + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + + + process-sources + + + + + + + + org.codehaus.mojo + cobertura-maven-plugin + + + 77 + 95 + + + + + **/*$* + + + + + + clean + + clean + + + + check + + check + + + + + + + + + + + codehaus.org + http://repository.codehaus.org + + true + + + false + + + + + codehaus.org + http://snapshots.repository.codehaus.org + + false + + + true + + + + + + + codehaus.org + http://snapshots.repository.codehaus.org + + false + + + true + + + + + 2.0.5 + 1.0-beta-2 + 1.0-alpha-10-SNAPSHOT + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/discovery/1.0/discovery-1.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/discovery/1.0/discovery-1.0.pom new file mode 100644 index 000000000..5a29f6117 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/discovery/1.0/discovery-1.0.pom @@ -0,0 +1,28 @@ + + + + 4.0.0 + org.apache.maven + discovery + 1.0 + Maven Test Repository Artifact Discovery + pom + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/maven-metadata.xml new file mode 100644 index 000000000..8ce7fc7bb --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/maven-metadata.xml @@ -0,0 +1,23 @@ + + + + + org.apache.maven + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/maven-parent/4/maven-parent-4-site.xml b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/maven-parent/4/maven-parent-4-site.xml new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/maven-parent/4/maven-parent-4-site_en.xml b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/maven-parent/4/maven-parent-4-site_en.xml new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/maven-parent/4/maven-parent-4.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/maven-parent/4/maven-parent-4.pom new file mode 100644 index 000000000..132d9d736 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/maven-parent/4/maven-parent-4.pom @@ -0,0 +1,304 @@ + + + + + + 4.0.0 + + org.apache + apache + 3 + ../asf/pom.xml + + org.apache.maven + maven-parent + 4 + pom + Apache Maven + + Maven is a software project management and comprehension tool. Based on the concept of a project object model + (POM), Maven can manage a project's build, reporting and documentation from a central piece of information. + + http://maven.apache.org/ + + jira + http://jira.codehaus.org/browse/MPA + + + continuum + http://maven.zones.apache.org:8080/continuum + + + mail + +
notifications@maven.apache.org
+
+
+
+
+ 2002 + + + Maven Announcements List + announce@maven.apache.org + announce-subscribe@maven.apache.org + announce-unsubscribe@maven.apache.org + http://mail-archives.apache.org/mod_mbox/maven-announce/ + + + Maven Issues List + issues@maven.apache.org + issues-subscribe@maven.apache.org + issues-unsubscribe@maven.apache.org + http://mail-archives.apache.org/mod_mbox/maven-issues/ + + + Maven Notifications List + notifications@maven.apache.org + notifications-subscribe@maven.apache.org + notifications-unsubscribe@maven.apache.org + http://mail-archives.apache.org/mod_mbox/maven-notifications/ + + + + + + jvanzyl + Jason van Zyl + jason@maven.org + ASF + + PMC Chair + + -5 + + + brett + Brett Porter + brett@apache.org + ASF + + PMC Member + + +10 + + + evenisse + Emmanuel Venisse + evenisse@apache.org + ASF + + PMC Member + + +1 + + + kenney + Kenney Westerhof + kenney@apache.org + Neonics + + PMC Member + + + + snicoll + Stephane Nicoll + snicoll@apache.org + ASF + + PMC Member + + +1 + + + vmassol + Vincent Massol + vmassol@apache.org + ASF + + PMC Member + + +1 + + + fgiust + Fabrizio Giustina + fgiust@apache.org + openmind + + PMC Member + + +1 + + + epunzalan + Edwin Punzalan + epunzalan@mergere.com + Mergere + + Committer + + +8 + + + mperham + Mike Perham + mperham@gmail.com + IBM + + PMC Member + + -6 + + + jdcasey + John Casey + jdcasey@apache.org + ASF + + PMC Member + + -5 + + + trygvis + Trygve Laugstol + trygvis@apache.org + ASF + + PMC Member + + +1 + + + vsiveton + Vincent Siveton + vsiveton@apache.org + ASF + + PMC Member + + -5 + + + carlos + Carlos Sanchez + carlos@apache.org + ASF + + PMC Member + + +1 + + + dennisl + Dennis Lundberg + dennisl@apache.org + ASF + + PMC Member + + +1 + + + + + + apache.website + scp://people.apache.org/www/maven.apache.org + + + + + + + + + org.apache.maven.plugins + maven-surefire-report-plugin + + + org.apache.maven.plugins + maven-checkstyle-plugin + + http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-checkstyle-plugin/src/main/resources/config/maven_checks.xml + http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-checkstyle-plugin/src/main/resources/config/maven-header.txt + + + + org.apache.maven.plugins + maven-pmd-plugin + + + org.codehaus.mojo + cobertura-maven-plugin + + + org.codehaus.mojo + taglist-maven-plugin + + + org.apache.maven.plugins + maven-jxr-plugin + + + org.apache.maven.plugins + maven-javadoc-plugin + + + http://java.sun.com/j2ee/1.4/docs/api + http://java.sun.com/j2se/1.5.0/docs/api + http://jakarta.apache.org/commons/collections/apidocs-COLLECTIONS_3_0/ + http://jakarta.apache.org/commons/dbcp/apidocs/ + http://jakarta.apache.org/commons/fileupload/apidocs/ + http://jakarta.apache.org/commons/httpclient/apidocs/ + http://jakarta.apache.org/commons/logging/apidocs/ + http://jakarta.apache.org/commons/pool/apidocs/ + http://www.junit.org/junit/javadoc/ + http://logging.apache.org/log4j/docs/api/ + http://jakarta.apache.org/regexp/apidocs/ + http://jakarta.apache.org/velocity/api/ + + + + + + + + scm:svn:http://svn.apache.org/repos/asf/maven/pom/maven/tags/maven-parent-4 + scm:svn:https://svn.apache.org/repos/asf/maven/pom/maven/tags/maven-parent-4 + http://svn.apache.org/viewvc/maven/pom/maven/tags/maven-parent-4 + +
+ diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/maven-parent/4/maven-parent-4.pom.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/maven-parent/4/maven-parent-4.pom.sha1 new file mode 100644 index 000000000..b6caacf5e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/maven-parent/4/maven-parent-4.pom.sha1 @@ -0,0 +1 @@ +0fc039b0bd4d17d7c147a30e1d83994629c5297c \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/samplejar/1.0/samplejar-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/samplejar/1.0/samplejar-1.0.jar new file mode 100644 index 000000000..54d190b23 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/samplejar/1.0/samplejar-1.0.jar @@ -0,0 +1 @@ +dummy content. sample file only. diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/samplejar/1.0/samplejar-1.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/samplejar/1.0/samplejar-1.0.pom new file mode 100644 index 000000000..6ab57d162 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/samplejar/1.0/samplejar-1.0.pom @@ -0,0 +1,29 @@ + + + + 4.0.0 + org.apache.maven + C + 1.0 + Maven Test Repository Artifact Discovery + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/samplejar/2.0/samplejar-2.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/samplejar/2.0/samplejar-2.0.jar new file mode 100644 index 000000000..54d190b23 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/samplejar/2.0/samplejar-2.0.jar @@ -0,0 +1 @@ +dummy content. sample file only. diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/samplejar/2.0/samplejar-2.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/samplejar/2.0/samplejar-2.0.pom new file mode 100644 index 000000000..a959980df --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/samplejar/2.0/samplejar-2.0.pom @@ -0,0 +1,29 @@ + + + + 4.0.0 + org.apache.maven + C + 1.0 + Maven Test Repository Artifact Discovery + + jar + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/samplejar/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/samplejar/maven-metadata.xml new file mode 100644 index 000000000..89de35f4e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/samplejar/maven-metadata.xml @@ -0,0 +1,35 @@ + + + + org.apache.maven + samplejar + 6.0-SNAPSHOT + + 2.0 + 6.0-SNAPSHOT + + 26 + + + 6.0-SNAPSHOT + 6.0-20060311.093250-41 + 6.0-20060311.183228-42 + 6.0-20060311.183228-40 + 6.0-20060311.183228-37 + 6.0-20060311.183228-30 + 6.0-20060311.183228-29 + 6.0-20060311.183228-6 + 6.0-20060311.183228-9 + 6.0-20060311.183228-10 + 6.0-20060313.001659-43 + 6.0-20060313.001659-41 + 6.0-20060313.001659-38 + 6.0-20060313.001659-31 + 6.0-20060313.001659-30 + 6.0-20060313.001659-7 + 6.0-20060313.001659-10 + 6.0-20060313.001659-11 + + 20060313010719 + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.0/maven-downloader-1.0-javadoc.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.0/maven-downloader-1.0-javadoc.jar new file mode 100644 index 000000000..ae0cb2e32 Binary files /dev/null and b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.0/maven-downloader-1.0-javadoc.jar differ diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.0/maven-downloader-1.0-javadoc.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.0/maven-downloader-1.0-javadoc.jar.md5 new file mode 100644 index 000000000..15a0630f6 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.0/maven-downloader-1.0-javadoc.jar.md5 @@ -0,0 +1 @@ +69af4ffaf5e65d02b6ca50467e79b42a \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.0/maven-downloader-1.0-javadoc.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.0/maven-downloader-1.0-javadoc.jar.sha1 new file mode 100644 index 000000000..107f46801 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.0/maven-downloader-1.0-javadoc.jar.sha1 @@ -0,0 +1 @@ +902005afa0e151d7750735180f692d32fa5d76e2 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.0/maven-downloader-1.0-sources.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.0/maven-downloader-1.0-sources.jar new file mode 100644 index 000000000..faa0d98cc Binary files /dev/null and b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.0/maven-downloader-1.0-sources.jar differ diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.0/maven-downloader-1.0-sources.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.0/maven-downloader-1.0-sources.jar.md5 new file mode 100644 index 000000000..3a84ad832 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.0/maven-downloader-1.0-sources.jar.md5 @@ -0,0 +1 @@ +f7d54f505b8affa8a8235e01fbc38219 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.0/maven-downloader-1.0-sources.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.0/maven-downloader-1.0-sources.jar.sha1 new file mode 100644 index 000000000..3a72dc7bb --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.0/maven-downloader-1.0-sources.jar.sha1 @@ -0,0 +1 @@ +821f8ec6e32c3fecd1b1fb85f83bfea148a86da8 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.0/maven-downloader-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.0/maven-downloader-1.0.jar new file mode 100644 index 000000000..712c664dd Binary files /dev/null and b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.0/maven-downloader-1.0.jar differ diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.0/maven-downloader-1.0.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.0/maven-downloader-1.0.jar.md5 new file mode 100644 index 000000000..04d4ce468 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.0/maven-downloader-1.0.jar.md5 @@ -0,0 +1 @@ +a2af4d8c1c00d8405ae2074fbcca87aa \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.0/maven-downloader-1.0.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.0/maven-downloader-1.0.jar.sha1 new file mode 100644 index 000000000..19ae195e0 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.0/maven-downloader-1.0.jar.sha1 @@ -0,0 +1 @@ +43dfd03d32f70b8b72cdbefa1678dbeacf9a1f8c \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.0/maven-downloader-1.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.0/maven-downloader-1.0.pom new file mode 100644 index 000000000..d3c136b8c --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.0/maven-downloader-1.0.pom @@ -0,0 +1,56 @@ + + + maven-shared-components + org.apache.maven.shared + 4 + + 4.0.0 + org.apache.maven.shared + maven-downloader + Maven Downloader + 1.0 + Provide a super simple interface for downloading a single artifact. + http://maven.apache.org + + scm:svn:https://svn.apache.org/repos/asf/maven/shared/tags/maven-downloader-1.0 + scm:svn:https://svn.apache.org/repos/asf/maven/shared/tags/maven-downloader-1.0 + https://svn.apache.org/repos/asf/maven/shared/tags/maven-downloader-1.0 + + + + + org.codehaus.plexus + plexus-maven-plugin + 1.1 + + + + descriptor + + + + + + + + + org.apache.maven + maven-artifact-manager + 2.0 + + + org.apache.maven + maven-artifact + 2.0 + + + junit + junit + 3.8.1 + test + + + + deployed + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.0/maven-downloader-1.0.pom.md5 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.0/maven-downloader-1.0.pom.md5 new file mode 100644 index 000000000..89e705b79 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.0/maven-downloader-1.0.pom.md5 @@ -0,0 +1 @@ +8ab3c303c12323c469be9beb591f3f12 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.0/maven-downloader-1.0.pom.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.0/maven-downloader-1.0.pom.sha1 new file mode 100644 index 000000000..1a75091fa --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.0/maven-downloader-1.0.pom.sha1 @@ -0,0 +1 @@ +e4484abb15526e31b8ea514d3ba68e31189c12b0 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.1/maven-downloader-1.1-javadoc.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.1/maven-downloader-1.1-javadoc.jar new file mode 100644 index 000000000..3114e1ae6 Binary files /dev/null and b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.1/maven-downloader-1.1-javadoc.jar differ diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.1/maven-downloader-1.1-javadoc.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.1/maven-downloader-1.1-javadoc.jar.md5 new file mode 100644 index 000000000..3f77b9093 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.1/maven-downloader-1.1-javadoc.jar.md5 @@ -0,0 +1 @@ +942c2a52f0e38b1e59b12837905d1f25 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.1/maven-downloader-1.1-javadoc.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.1/maven-downloader-1.1-javadoc.jar.sha1 new file mode 100644 index 000000000..1b0a186fc --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.1/maven-downloader-1.1-javadoc.jar.sha1 @@ -0,0 +1 @@ +738d6a8c195613ee689f0a7b8f0c6f194e909473 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.1/maven-downloader-1.1-sources.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.1/maven-downloader-1.1-sources.jar new file mode 100644 index 000000000..994054bb4 Binary files /dev/null and b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.1/maven-downloader-1.1-sources.jar differ diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.1/maven-downloader-1.1-sources.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.1/maven-downloader-1.1-sources.jar.md5 new file mode 100644 index 000000000..aada2770b --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.1/maven-downloader-1.1-sources.jar.md5 @@ -0,0 +1 @@ +c892f8533031750419c77dc87ed35a3b \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.1/maven-downloader-1.1-sources.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.1/maven-downloader-1.1-sources.jar.sha1 new file mode 100644 index 000000000..37af4fe89 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.1/maven-downloader-1.1-sources.jar.sha1 @@ -0,0 +1 @@ +8aa5027d2688c4540eec9c2b85bbee496f6d4e7c \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.1/maven-downloader-1.1.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.1/maven-downloader-1.1.jar new file mode 100644 index 000000000..ae6638b79 Binary files /dev/null and b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.1/maven-downloader-1.1.jar differ diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.1/maven-downloader-1.1.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.1/maven-downloader-1.1.jar.md5 new file mode 100644 index 000000000..f5c14a937 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.1/maven-downloader-1.1.jar.md5 @@ -0,0 +1 @@ +b8e59f5b162f8c0f6ef23d8d249cfed8 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.1/maven-downloader-1.1.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.1/maven-downloader-1.1.jar.sha1 new file mode 100644 index 000000000..1bcc406e0 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.1/maven-downloader-1.1.jar.sha1 @@ -0,0 +1 @@ +923bf441d4ab0d80d45e77576dff86e2b22d2ac4 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.1/maven-downloader-1.1.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.1/maven-downloader-1.1.pom new file mode 100644 index 000000000..db5fe99e7 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.1/maven-downloader-1.1.pom @@ -0,0 +1,56 @@ + + + maven-shared-components + org.apache.maven.shared + 4 + + 4.0.0 + org.apache.maven.shared + maven-downloader + Maven Downloader + 1.1 + Provide a super simple interface for downloading a single artifact. + http://maven.apache.org + + scm:svn:https://svn.apache.org/repos/asf/maven/shared/tags/maven-downloader-1.1 + scm:svn:https://svn.apache.org/repos/asf/maven/shared/tags/maven-downloader-1.1 + https://svn.apache.org/repos/asf/maven/shared/tags/maven-downloader-1.1 + + + + + org.codehaus.plexus + plexus-maven-plugin + 1.1 + + + + descriptor + + + + + + + + + org.apache.maven + maven-artifact-manager + 2.0 + + + org.apache.maven + maven-artifact + 2.0 + + + junit + junit + 3.8.1 + test + + + + deployed + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.1/maven-downloader-1.1.pom.md5 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.1/maven-downloader-1.1.pom.md5 new file mode 100644 index 000000000..bffe895ee --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.1/maven-downloader-1.1.pom.md5 @@ -0,0 +1 @@ +f4d26363c090391c0b8f5a1c4d5c946a \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.1/maven-downloader-1.1.pom.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.1/maven-downloader-1.1.pom.sha1 new file mode 100644 index 000000000..fb062b05f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/1.1/maven-downloader-1.1.pom.sha1 @@ -0,0 +1 @@ +59f81ef23c583f0dd8e7f432ba88595c645e1fc1 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/maven-metadata.xml new file mode 100644 index 000000000..6fbced025 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/maven-metadata.xml @@ -0,0 +1,15 @@ + + + + org.apache.maven.shared + maven-downloader + 1.0 + + 1.1 + + 1.0 + 1.1 + + 20061212214311 + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/maven-metadata.xml.md5 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/maven-metadata.xml.md5 new file mode 100644 index 000000000..354ec6c58 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/maven-metadata.xml.md5 @@ -0,0 +1 @@ +f18235bd6072aa77beb7e01f07905e53 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/maven-metadata.xml.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/maven-metadata.xml.sha1 new file mode 100644 index 000000000..0ff8edcaf --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/shared/maven-downloader/maven-metadata.xml.sha1 @@ -0,0 +1 @@ +7f87ddac6169d99fa54f29bc9a3f7af5a9c8741f \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/some-ejb/1.0/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/some-ejb/1.0/maven-metadata.xml new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/some-ejb/1.0/some-ejb-1.0-client.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/some-ejb/1.0/some-ejb-1.0-client.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/test/1.0-SNAPSHOT/test-1.0-20050611.112233-1-javadoc.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/test/1.0-SNAPSHOT/test-1.0-20050611.112233-1-javadoc.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/test/1.0-SNAPSHOT/test-1.0-20050611.112233-1.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/test/1.0-SNAPSHOT/test-1.0-20050611.112233-1.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/test/1.0-SNAPSHOT/wrong-artifactId-1.0-20050611.112233-1.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/test/1.0-SNAPSHOT/wrong-artifactId-1.0-20050611.112233-1.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/test/2.0.4-SNAPSHOT/test-2.0.4-SNAPSHOT.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/test/2.0.4-SNAPSHOT/test-2.0.4-SNAPSHOT.pom new file mode 100644 index 000000000..ca115b505 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/test/2.0.4-SNAPSHOT/test-2.0.4-SNAPSHOT.pom @@ -0,0 +1,143 @@ + + + + 4.0.0 + + org.apache.maven + test + pom + + ${prj.ver.maj}.${prj.ver.min}.${prj.ver.inc}${prj.ver.suf} + + + Test Archiva + + ${pom.name} [version ${pom.version}]. Confluence: + ${kb.confluence.url}/display/${prj.confluence.path} + + + + + + org.apache.maven.wagon + + wagon-webdav + 1.0-beta-2 + + + + + + jira + + ${kb.jira.url}/browse/${prj.jira.key} + + + hudson + + ${kb.hudson.url}/view/${prj.hudson.view.root} + -=${prj.svn.branch}=-/ + + + 2005 + + + + KB Internal License + repo + This is internal project of KB. + + + + + KB, a.s. + http://www.kb.cz/ + + + + + http://svn-server/renaissance + + http://svn-server/renaissance + http://tools-server/projects + + scp://tools-server/home/tools/var/maven-sites + + http://jira-server/jira + + http://confluence-server/confluence + + http://tools-server/hudson + + + ${pom.groupId} + ${pom.groupId} + ${kb.svn.url}/${prj.svn.path} + ${prj.svn}/tags + trunk + + 1.5 + UTF-8 + + + + 2 + 0 + 4 + -SNAPSHOT + + + + ${prj.url.root}/${prj.ver.maj}.${prj.ver.min}${prj.ver.suf} + + test/maven-arch/test-arch + TSTARCH + + TEST/Archiva + + + + http://j.random.server.com/docs/${project.groupId}/${project.artifactId}/${project.version} + + + scm:svn:${prj.svn}/${prj.svn.branch} + + scm:svn:${prj.svn}/${prj.svn.branch} + + + ${kb.svn.view.url}/${prj.svn.path}/${prj.svn.branch} + + + + + internal + Internal Release Repository + + dav:http://tools-server/archiva/repository/internal + + + false + + + snapshots + Internal Snapshot Repository + + dav:http://tools-server/archiva/repository/snapshots + + false + + + + website + Internal Maven Website + ${kb.site.dir}/${prj.url.relative} + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/testing/1.0/testing-1.0-sources.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/testing/1.0/testing-1.0-sources.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/testing/1.0/testing-1.0-test-sources.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/testing/1.0/testing-1.0-test-sources.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/testing/1.0/testing-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/testing/1.0/testing-1.0.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/testing/1.0/testing-1.0.tar.gz b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/testing/1.0/testing-1.0.tar.gz new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/testing/1.0/testing-1.0.zip b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/testing/1.0/testing-1.0.zip new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/update/test-not-updated/1.0/test-not-updated-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/update/test-not-updated/1.0/test-not-updated-1.0.jar new file mode 100644 index 000000000..54d190b23 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/update/test-not-updated/1.0/test-not-updated-1.0.jar @@ -0,0 +1 @@ +dummy content. sample file only. diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/update/test-not-updated/1.0/test-not-updated-1.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/update/test-not-updated/1.0/test-not-updated-1.0.pom new file mode 100644 index 000000000..452727f28 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/update/test-not-updated/1.0/test-not-updated-1.0.pom @@ -0,0 +1,29 @@ + + + + 4.0.0 + org.apache.maven.update + test-not-updated + 1.0 + Maven Test Repository Artifact Discovery + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/update/test-not-updated/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/update/test-not-updated/maven-metadata.xml new file mode 100644 index 000000000..bd56a21c1 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/update/test-not-updated/maven-metadata.xml @@ -0,0 +1,24 @@ + + + + + org.apache.maven.update + test-not-updated + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/update/test-updated/1.0/test-updated-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/update/test-updated/1.0/test-updated-1.0.jar new file mode 100644 index 000000000..54d190b23 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/update/test-updated/1.0/test-updated-1.0.jar @@ -0,0 +1 @@ +dummy content. sample file only. diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/update/test-updated/1.0/test-updated-1.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/update/test-updated/1.0/test-updated-1.0.pom new file mode 100644 index 000000000..edd7b6479 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/update/test-updated/1.0/test-updated-1.0.pom @@ -0,0 +1,29 @@ + + + + 4.0.0 + org.apache.maven.update + test-updated + 1.0 + Maven Test Repository Artifact Discovery + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/update/test-updated/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/update/test-updated/maven-metadata.xml new file mode 100644 index 000000000..86e063ca8 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/maven/update/test-updated/maven-metadata.xml @@ -0,0 +1,24 @@ + + + + + org.apache.maven.update + test-updated + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/testgroup/discovery/1.0/discovery-1.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/testgroup/discovery/1.0/discovery-1.0.pom new file mode 100644 index 000000000..12538e81a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/testgroup/discovery/1.0/discovery-1.0.pom @@ -0,0 +1,28 @@ + + + + 4.0.0 + org.apache.testgroup + discovery + 1.0 + Maven Test Repository Artifact Discovery + pom + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/testgroup/discovery/1.0/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/testgroup/discovery/1.0/maven-metadata.xml new file mode 100644 index 000000000..8ee18048c --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/testgroup/discovery/1.0/maven-metadata.xml @@ -0,0 +1,25 @@ + + + + + org.apache.testgroup + discovery + 1.0 + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/testgroup/discovery/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/testgroup/discovery/maven-metadata.xml new file mode 100644 index 000000000..b024ef7ef --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/default-repository/org/apache/testgroup/discovery/maven-metadata.xml @@ -0,0 +1,24 @@ + + + + + org.apache.testgroup + discovery + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/CVS/Root b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/CVS/Root new file mode 100644 index 000000000..2e65f24a6 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/CVS/Root @@ -0,0 +1 @@ +not a real CVS root - for testing exclusions diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/KEYS b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/KEYS new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/invalid/foo/invalid-1.0.foo b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/invalid/foo/invalid-1.0.foo new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/invalid/invalid-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/invalid/invalid-1.0.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/invalid/jars/1.0/invalid-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/invalid/jars/1.0/invalid-1.0.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/invalid/jars/invalid-1.0.rar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/invalid/jars/invalid-1.0.rar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/invalid/jars/invalid.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/invalid/jars/invalid.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/invalid/jars/no-extension b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/invalid/jars/no-extension new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/javax.sql/jars/jdbc-2.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/javax.sql/jars/jdbc-2.0.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/maven/poms/wagon-ssh-1.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/maven/poms/wagon-ssh-1.0.pom new file mode 100644 index 000000000..e6a72b9d6 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/maven/poms/wagon-ssh-1.0.pom @@ -0,0 +1,52 @@ + + + + ../../project.xml + 3 + maven + wagon-ssh + wagon-ssh + Wagon SSH provider + 1.0-SNAPSHOT + + Wagon Provider for protocols from SSH2 family based on JSCH + org.apache.maven.wagon.providers.ssh + 2003 + http://maven.apache.org/wagon/wagon-providers/ssh + http://jira.codehaus.org/BrowseProject.jspa?id=10319 + /www/maven.apache.org/wagon/wagon-providers/ssh + + scm:cvs:pserver:anoncvs@cvs.apache.org:/home/cvspublic:maven-wagon/wagon-providers/ssh + http://cvs.apache.org/viewcvs/maven-wagon/wagon-providers/ssh/ + + + + + Michal Maczka + michal + michal.maczka@dimatics.com + Dimatics + + Creator + Developer + Release Manager + + + + + + + maven + wagon-api + 0.9-SNAPSHOT + jar + + + jsch + jsch + 0.1.14 + jar + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven.update/jars/test-not-updated-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven.update/jars/test-not-updated-1.0.jar new file mode 100644 index 000000000..54d190b23 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven.update/jars/test-not-updated-1.0.jar @@ -0,0 +1 @@ +dummy content. sample file only. diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven.update/jars/test-updated-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven.update/jars/test-updated-1.0.jar new file mode 100644 index 000000000..54d190b23 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven.update/jars/test-updated-1.0.jar @@ -0,0 +1 @@ +dummy content. sample file only. diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven/jars/some-ejb-1.0-client.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven/jars/some-ejb-1.0-client.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven/jars/testing-1.0-20050611.112233-1.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven/jars/testing-1.0-20050611.112233-1.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven/jars/testing-1.0.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven/jars/testing-1.0.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven/jars/testing-1.0.tar.gz b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven/jars/testing-1.0.tar.gz new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven/jars/testing-1.0.zip b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven/jars/testing-1.0.zip new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven/jars/testing-UNKNOWN.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven/jars/testing-UNKNOWN.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven/java-sources/testing-1.0-sources.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven/java-sources/testing-1.0-sources.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven/javadoc.jars/testing-1.0-javadoc.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven/javadoc.jars/testing-1.0-javadoc.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven/poms/maven-model-v3-2.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven/poms/maven-model-v3-2.0.pom new file mode 100644 index 000000000..509552ef9 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven/poms/maven-model-v3-2.0.pom @@ -0,0 +1,15 @@ + + 3 + org.apache.maven + maven-model-v3 + Maven Model v3 + 2.0 + Maven Model v3 + + + org.codehaus.plexus + plexus-utils + 1.0.4 + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven/poms/testing-1.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven/poms/testing-1.0.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/include_xml/1.0/include_xml-1.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/include_xml/1.0/include_xml-1.0.pom new file mode 100644 index 000000000..18cd43943 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/include_xml/1.0/include_xml-1.0.pom @@ -0,0 +1,25 @@ + + + 4.0.0 + org.apache.archiva.metadata.tests + include_xml + 1.0 + xml + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/include_xml/1.0/include_xml-1.0.xml b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/include_xml/1.0/include_xml-1.0.xml new file mode 100644 index 000000000..176a50bcf --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/include_xml/1.0/include_xml-1.0.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/include_xml/1.0/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/include_xml/1.0/maven-metadata.xml new file mode 100644 index 000000000..624cbdace --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/include_xml/1.0/maven-metadata.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/incomplete_metadata_a/1.0/incomplete_metadata_a-1.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/incomplete_metadata_a/1.0/incomplete_metadata_a-1.0.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/incomplete_metadata_a/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/incomplete_metadata_a/maven-metadata.xml new file mode 100644 index 000000000..5ecf49673 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/incomplete_metadata_a/maven-metadata.xml @@ -0,0 +1,5 @@ + + org.apache.archiva.metadata.tests + incomplete_metadata_a + 1.0 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/missing_metadata_a/1.0/missing_metadata_a-1.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/missing_metadata_a/1.0/missing_metadata_a-1.0.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/missing_metadata_b/1.0.1/missing_metadata_b-1.0.1.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/missing_metadata_b/1.0.1/missing_metadata_b-1.0.1.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/missing_metadata_b/1.0/missing_metadata_b-1.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/missing_metadata_b/1.0/missing_metadata_b-1.0.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/missing_metadata_b/2.0-20070821-dev/missing_metadata_b-2.0-20070821-dev.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/missing_metadata_b/2.0-20070821-dev/missing_metadata_b-2.0-20070821-dev.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/missing_metadata_b/2.0.1/missing_metadata_b-2.0.1.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/missing_metadata_b/2.0.1/missing_metadata_b-2.0.1.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/missing_metadata_b/2.0/missing_metadata_b-2.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/missing_metadata_b/2.0/missing_metadata_b-2.0.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/proxied_multi/1.0/proxied_multi-1.0.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/proxied_multi/1.0/proxied_multi-1.0.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/proxied_multi/1.1/proxied_multi-1.1.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/proxied_multi/1.1/proxied_multi-1.1.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/proxied_multi/2.1/proxied_multi-2.1.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/proxied_multi/2.1/proxied_multi-2.1.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/proxied_multi/maven-metadata-central.xml b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/proxied_multi/maven-metadata-central.xml new file mode 100644 index 000000000..a8b764bd7 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/proxied_multi/maven-metadata-central.xml @@ -0,0 +1,16 @@ + + org.apache.archiva.metadata.tests + proxied_multi + 1.0 + + 3.1 + 3.1 + + 1.0 + 1.0.1 + 2.0 + 3.0 + 3.1 + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/proxied_multi/maven-metadata-java.net.xml b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/proxied_multi/maven-metadata-java.net.xml new file mode 100644 index 000000000..13024c74e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/proxied_multi/maven-metadata-java.net.xml @@ -0,0 +1,16 @@ + + org.apache.archiva.metadata.tests + proxied_multi + 1.0 + + 2.0.1 + 2.0.1 + + 1.0-spec + 2.0 + 2.0-proposal-beta + 2.0-spec + 2.0.1 + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/proxied_multi/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/proxied_multi/maven-metadata.xml new file mode 100644 index 000000000..a1e402c94 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/proxied_multi/maven-metadata.xml @@ -0,0 +1,14 @@ + + org.apache.archiva.metadata.tests + proxied_multi + 1.0 + + 2.1 + 2.1 + + 1.0 + 1.1 + 2.1 + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/maven-metadata-apache-snapshots.xml b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/maven-metadata-apache-snapshots.xml new file mode 100644 index 000000000..f3e0dbd0a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/maven-metadata-apache-snapshots.xml @@ -0,0 +1,5 @@ + + org.apache.archiva.metadata.tests + snap_shots_a + 1.0-alpha-11-SNAPSHOT + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/maven-metadata-internal-snapshots.xml b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/maven-metadata-internal-snapshots.xml new file mode 100644 index 000000000..f3e0dbd0a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/maven-metadata-internal-snapshots.xml @@ -0,0 +1,5 @@ + + org.apache.archiva.metadata.tests + snap_shots_a + 1.0-alpha-11-SNAPSHOT + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/maven-metadata-snapshots.codehaus.org.xml b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/maven-metadata-snapshots.codehaus.org.xml new file mode 100644 index 000000000..f62d4482f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/maven-metadata-snapshots.codehaus.org.xml @@ -0,0 +1,12 @@ + + org.apache.archiva.metadata.tests + snap_shots_a + 1.0-alpha-11-SNAPSHOT + + + 20070315.033030 + 10 + + 20070315.033030 + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/maven-metadata.xml new file mode 100644 index 000000000..3265734bd --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/maven-metadata.xml @@ -0,0 +1,9 @@ + + org.apache.archiva.metadata.tests + snap_shots_a + 1.0-alpha-11-SNAPSHOT + + + 20070314163205 + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-20070221.194724-2-javadoc.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-20070221.194724-2-javadoc.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-20070221.194724-2-sources.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-20070221.194724-2-sources.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-20070221.194724-2.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-20070221.194724-2.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-20070221.194724-2.war b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-20070221.194724-2.war new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-20070302.212723-3-sources.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-20070302.212723-3-sources.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-20070302.212723-3.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-20070302.212723-3.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-20070302.212723-3.war b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-20070302.212723-3.war new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-20070303.152828-4-sources.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-20070303.152828-4-sources.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-20070303.152828-4.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-20070303.152828-4.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-20070303.152828-4.war b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-20070303.152828-4.war new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-20070305.215149-5.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-20070305.215149-5.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-20070305.215149-5.pom.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-20070305.215149-5.pom.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-20070305.215149-5.war b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-20070305.215149-5.war new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-20070305.215149-5.war.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-20070305.215149-5.war.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-20070307.170909-6.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-20070307.170909-6.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-20070307.170909-6.pom.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-20070307.170909-6.pom.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-20070307.170909-6.war b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-20070307.170909-6.war new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-20070307.170909-6.war.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-20070307.170909-6.war.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-20070314.211405-9.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-20070314.211405-9.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-20070314.211405-9.pom.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-20070314.211405-9.pom.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-20070314.211405-9.war b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-20070314.211405-9.war new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-20070314.211405-9.war.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-20070314.211405-9.war.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-20070316.175232-11.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-20070316.175232-11.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-20070316.175232-11.pom.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-20070316.175232-11.pom.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-20070316.175232-11.war b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-20070316.175232-11.war new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-20070316.175232-11.war.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-20070316.175232-11.war.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-SNAPSHOT-sources.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-SNAPSHOT-sources.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-SNAPSHOT.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-SNAPSHOT.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-SNAPSHOT.war b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_a/1.0-alpha-11-SNAPSHOT/snap_shots_a-1.0-alpha-11-SNAPSHOT.war new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/maven-metadata.xml new file mode 100644 index 000000000..efda5def5 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/maven-metadata.xml @@ -0,0 +1,12 @@ + + org.apache.archiva.metadata.tests + snap_shots_b + 2.2-SNAPSHOT + + + 20070316.153953 + 10 + + 20070316153953 + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070221.172940-1.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070221.172940-1.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070221.172940-1.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070221.172940-1.jar.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070221.172940-1.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070221.172940-1.jar.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070221.172940-1.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070221.172940-1.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070221.172940-1.pom.md5 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070221.172940-1.pom.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070221.172940-1.pom.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070221.172940-1.pom.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070221.194724-2-sources.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070221.194724-2-sources.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070221.194724-2-sources.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070221.194724-2-sources.jar.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070221.194724-2-sources.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070221.194724-2-sources.jar.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070221.194724-2.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070221.194724-2.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070221.194724-2.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070221.194724-2.jar.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070221.194724-2.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070221.194724-2.jar.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070221.194724-2.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070221.194724-2.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070221.194724-2.pom.md5 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070221.194724-2.pom.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070221.194724-2.pom.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070221.194724-2.pom.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070302.212723-3-sources.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070302.212723-3-sources.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070302.212723-3-sources.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070302.212723-3-sources.jar.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070302.212723-3-sources.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070302.212723-3-sources.jar.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070302.212723-3.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070302.212723-3.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070302.212723-3.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070302.212723-3.jar.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070302.212723-3.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070302.212723-3.jar.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070302.212723-3.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070302.212723-3.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070302.212723-3.pom.md5 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070302.212723-3.pom.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070302.212723-3.pom.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070302.212723-3.pom.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070303.152828-4-sources.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070303.152828-4-sources.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070303.152828-4-sources.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070303.152828-4-sources.jar.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070303.152828-4-sources.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070303.152828-4-sources.jar.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070303.152828-4.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070303.152828-4.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070303.152828-4.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070303.152828-4.jar.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070303.152828-4.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070303.152828-4.jar.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070303.152828-4.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070303.152828-4.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070303.152828-4.pom.md5 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070303.152828-4.pom.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070303.152828-4.pom.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070303.152828-4.pom.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070305.215149-5.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070305.215149-5.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070305.215149-5.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070305.215149-5.jar.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070305.215149-5.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070305.215149-5.jar.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070305.215149-5.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070305.215149-5.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070305.215149-5.pom.md5 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070305.215149-5.pom.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070305.215149-5.pom.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070305.215149-5.pom.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070307.170909-6.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070307.170909-6.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070307.170909-6.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070307.170909-6.jar.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070307.170909-6.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070307.170909-6.jar.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070307.170909-6.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070307.170909-6.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070307.170909-6.pom.md5 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070307.170909-6.pom.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070307.170909-6.pom.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070307.170909-6.pom.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070314.190911-7.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070314.190911-7.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070314.190911-7.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070314.190911-7.jar.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070314.190911-7.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070314.190911-7.jar.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070314.190911-7.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070314.190911-7.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070314.190911-7.pom.md5 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070314.190911-7.pom.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070314.190911-7.pom.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070314.190911-7.pom.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070314.193642-8.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070314.193642-8.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070314.193642-8.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070314.193642-8.jar.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070314.193642-8.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070314.193642-8.jar.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070314.193642-8.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070314.193642-8.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070314.193642-8.pom.md5 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070314.193642-8.pom.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070314.193642-8.pom.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070314.193642-8.pom.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070314.211405-9-javadoc.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070314.211405-9-javadoc.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070314.211405-9-javadoc.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070314.211405-9-javadoc.jar.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070314.211405-9-javadoc.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070314.211405-9-javadoc.jar.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070314.211405-9-sources.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070314.211405-9-sources.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070314.211405-9-sources.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070314.211405-9-sources.jar.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070314.211405-9-sources.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070314.211405-9-sources.jar.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070314.211405-9.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070314.211405-9.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070314.211405-9.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070314.211405-9.jar.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070314.211405-9.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070314.211405-9.jar.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070314.211405-9.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070314.211405-9.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070314.211405-9.pom.md5 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070314.211405-9.pom.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070314.211405-9.pom.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070314.211405-9.pom.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070316.153953-10.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070316.153953-10.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070316.153953-10.jar.md5 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070316.153953-10.jar.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070316.153953-10.jar.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070316.153953-10.jar.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070316.153953-10.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070316.153953-10.pom new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070316.153953-10.pom.md5 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070316.153953-10.pom.md5 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070316.153953-10.pom.sha1 b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/metadata-repository/org/apache/archiva/metadata/tests/snap_shots_b/2.2-SNAPSHOT/snap_shots_b-2.2-20070316.153953-10.pom.sha1 new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/simple-repository/groupId/artifactId/1.0-alpha-1/artifactId-1.0-alpha-1.jar b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/simple-repository/groupId/artifactId/1.0-alpha-1/artifactId-1.0-alpha-1.jar new file mode 100644 index 000000000..c2ea777c1 Binary files /dev/null and b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/simple-repository/groupId/artifactId/1.0-alpha-1/artifactId-1.0-alpha-1.jar differ diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/simple-repository/groupId/artifactId/1.0-alpha-1/artifactId-1.0-alpha-1.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/simple-repository/groupId/artifactId/1.0-alpha-1/artifactId-1.0-alpha-1.pom new file mode 100644 index 000000000..a987f03ec --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/simple-repository/groupId/artifactId/1.0-alpha-1/artifactId-1.0-alpha-1.pom @@ -0,0 +1,25 @@ + + + + 4.0.0 + groupId + artifactId + 1.0-alpha-1 + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/simple-repository/groupId/artifactId/maven-metadata.xml b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/simple-repository/groupId/artifactId/maven-metadata.xml new file mode 100644 index 000000000..526cc825a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/simple-repository/groupId/artifactId/maven-metadata.xml @@ -0,0 +1,30 @@ + + + + + groupId + artifactId + 1.0-alpha-1 + + + 1.0-alpha-1 + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/simple-repository/groupId/snapshot-artifact/1.0-alpha-1-SNAPSHOT/snapshot-artifact-1.0-alpha-1-20050611.202024-1.pom b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/simple-repository/groupId/snapshot-artifact/1.0-alpha-1-SNAPSHOT/snapshot-artifact-1.0-alpha-1-20050611.202024-1.pom new file mode 100644 index 000000000..cf613e847 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/repositories/simple-repository/groupId/snapshot-artifact/1.0-alpha-1-SNAPSHOT/snapshot-artifact-1.0-alpha-1-20050611.202024-1.pom @@ -0,0 +1,19 @@ + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/resources/log4j.xml b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/resources/log4j.xml new file mode 100644 index 000000000..23d4d08d6 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/resources/log4j.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/resources/m1-repo-filelist.txt b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/resources/m1-repo-filelist.txt new file mode 100644 index 000000000..3ddb2c4ce --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/resources/m1-repo-filelist.txt @@ -0,0 +1,6230 @@ +# Directory listing from people.apache.org +# of path /www/people.apache.org/repo/m1-ibiblio-rsync-repository +# Taken September 9, 2007 +# +# File listing has been filtered using the following sed command. +# +# sed -e "/\.md5$/d" -e "/\.sha1$/d" -e "/\.asc$/d" -e "/\.meta$/d" \ +# -e "/LICENSE/d" -e "/\/licenses\//d" +# +# Any entries in here that are blatently wrong should be deleted. +# +ant/jars/ant-1.4.1.jar +ant/jars/ant-1.5.1.jar +ant/jars/ant-1.5.2.jar +ant/jars/ant-1.5.3-1.jar +ant/jars/ant-1.5.4.jar +ant/jars/ant-1.6.3.jar +ant/jars/ant-1.5.jar +ant/jars/ant-1.6.1.jar +ant/jars/ant-1.6.2.jar +ant/jars/ant-1.6.jar +ant/jars/ant-1.6.4.jar +ant/jars/ant-1.6.5.jar +ant/jars/ant-antlr-1.6.1.jar +ant/jars/ant-antlr-1.6.2.jar +ant/jars/ant-antlr-1.6.3.jar +ant/jars/ant-antlr-1.6.4.jar +ant/jars/ant-apache-oro-1.6.5.jar +ant/jars/ant-antlr-1.6.5.jar +ant/jars/ant-antlr-1.6.jar +ant/jars/ant-apache-bcel-1.6.2.jar +ant/jars/ant-apache-bcel-1.6.3.jar +ant/jars/ant-apache-bcel-1.6.4.jar +ant/jars/ant-apache-bcel-1.6.5.jar +ant/jars/ant-apache-bsf-1.6.1.jar +ant/jars/ant-apache-bsf-1.6.2.jar +ant/jars/ant-apache-bsf-1.6.3.jar +ant/jars/ant-apache-bsf-1.6.4.jar +ant/jars/ant-apache-bsf-1.6.5.jar +ant/jars/ant-apache-bsf-1.6.jar +ant/jars/ant-apache-log4j-1.6.2.jar +ant/jars/ant-apache-log4j-1.6.3.jar +ant/jars/ant-apache-log4j-1.6.4.jar +ant/jars/ant-apache-log4j-1.6.5.jar +ant/jars/ant-apache-oro-1.6.2.jar +ant/jars/ant-apache-oro-1.6.3.jar +ant/jars/ant-apache-oro-1.6.4.jar +ant/jars/ant-apache-regexp-1.6.2.jar +ant/jars/ant-apache-regexp-1.6.3.jar +ant/jars/ant-apache-regexp-1.6.4.jar +ant/jars/ant-apache-regexp-1.6.5.jar +ant/jars/ant-apache-resolver-1.6.jar +ant/jars/ant-apache-resolver-1.6.1.jar +ant/jars/ant-apache-resolver-1.6.2.jar +ant/jars/ant-apache-resolver-1.6.3.jar +ant/jars/ant-apache-resolver-1.6.4.jar +ant/jars/ant-apache-resolver-1.6.5.jar +ant/jars/ant-commons-logging-1.6.1.jar +ant/jars/ant-commons-logging-1.6.2.jar +ant/jars/ant-commons-logging-1.6.3.jar +ant/jars/ant-commons-logging-1.6.4.jar +ant/jars/ant-commons-logging-1.6.5.jar +ant/jars/ant-commons-logging-1.6.jar +ant/jars/ant-commons-net-1.6.1.jar +ant/jars/ant-commons-net-1.6.2.jar +ant/jars/ant-commons-net-1.6.3.jar +ant/jars/ant-commons-net-1.6.jar +ant/jars/ant-commons-net-1.6.4.jar +ant/jars/ant-commons-net-1.6.5.jar +ant/jars/ant-icontract-1.6.1.jar +ant/jars/ant-icontract-1.6.2.jar +ant/jars/ant-icontract-1.6.3.jar +ant/jars/ant-icontract-1.6.4.jar +ant/jars/ant-icontract-1.6.5.jar +ant/jars/ant-icontract-1.6.jar +ant/jars/ant-jai-1.6.1.jar +ant/jars/ant-jai-1.6.2.jar +ant/jars/ant-jai-1.6.3.jar +ant/jars/ant-jakarta-bcel-1.6.1.jar +ant/jars/ant-jai-1.6.4.jar +ant/jars/ant-jai-1.6.5.jar +ant/jars/ant-jai-1.6.jar +ant/jars/ant-jakarta-bcel-1.6.jar +ant/jars/ant-jakarta-log4j-1.6.1.jar +ant/jars/ant-jakarta-log4j-1.6.jar +ant/jars/ant-jakarta-oro-1.6.1.jar +ant/jars/ant-jakarta-oro-1.6.jar +ant/jars/ant-jakarta-regexp-1.6.1.jar +ant/jars/ant-jakarta-regexp-1.6.jar +ant/jars/ant-javamail-1.6.1.jar +ant/jars/ant-javamail-1.6.2.jar +ant/jars/ant-javamail-1.6.3.jar +ant/jars/ant-javamail-1.6.4.jar +ant/jars/ant-javamail-1.6.5.jar +ant/jars/ant-javamail-1.6.jar +ant/jars/ant-jdepend-1.6.1.jar +ant/jars/ant-jdepend-1.6.2.jar +ant/jars/ant-jdepend-1.6.jar +ant/jars/ant-jdepend-1.6.3.jar +ant/jars/ant-jdepend-1.6.4.jar +ant/jars/ant-jdepend-1.6.5.jar +ant/jars/ant-jmf-1.6.1.jar +ant/jars/ant-jmf-1.6.2.jar +ant/jars/ant-jmf-1.6.3.jar +ant/jars/ant-jmf-1.6.4.jar +ant/jars/ant-jmf-1.6.5.jar +ant/jars/ant-jmf-1.6.jar +ant/jars/ant-jsch-1.6.1.jar +ant/jars/ant-jsch-1.6.2.jar +ant/jars/ant-jsch-1.6.3.jar +ant/jars/ant-jsch-1.6.4.jar +ant/jars/ant-jsch-1.6.5.jar +ant/jars/ant-jsch-1.6.jar +ant/jars/ant-junit-1.6.1.jar +ant/jars/ant-junit-1.6.2.jar +ant/jars/ant-junit-1.6.3.jar +ant/jars/ant-junit-1.6.4.jar +ant/jars/ant-junit-1.6.5.jar +ant/jars/ant-junit-1.6.jar +ant/jars/ant-launcher-1.6.1.jar +ant/jars/ant-launcher-1.6.2.jar +ant/jars/ant-launcher-1.6.3.jar +ant/jars/ant-launcher-1.6.4.jar +ant/jars/ant-launcher-1.6.5.jar +ant/jars/ant-launcher-1.6.jar +ant/jars/ant-netrexx-1.6.1.jar +ant/jars/ant-netrexx-1.6.2.jar +ant/jars/ant-netrexx-1.6.3.jar +ant/jars/ant-netrexx-1.6.4.jar +ant/jars/ant-netrexx-1.6.5.jar +ant/jars/ant-netrexx-1.6.jar +ant/jars/ant-nodeps-1.6.1.jar +ant/jars/ant-nodeps-1.6.2.jar +ant/jars/ant-nodeps-1.6.3.jar +ant/jars/ant-nodeps-1.6.4.jar +ant/jars/ant-nodeps-1.6.5.jar +ant/jars/ant-nodeps-1.6.jar +ant/jars/ant-optional-1.4.1.jar +ant/jars/ant-optional-1.5.1.jar +ant/jars/ant-optional-1.5.2.jar +ant/jars/ant-optional-1.5.3-1.jar +ant/jars/ant-optional-1.5.jar +ant/jars/ant-starteam-1.6.1.jar +ant/jars/ant-starteam-1.6.2.jar +ant/jars/ant-starteam-1.6.3.jar +ant/jars/ant-starteam-1.6.4.jar +ant/jars/ant-starteam-1.6.5.jar +ant/jars/ant-swing-1.6.1.jar +ant/jars/ant-starteam-1.6.jar +ant/jars/ant-stylebook-1.6.1.jar +ant/jars/ant-stylebook-1.6.2.jar +ant/jars/ant-stylebook-1.6.3.jar +ant/jars/ant-stylebook-1.6.4.jar +ant/jars/ant-swing-1.6.5.jar +ant/jars/ant-stylebook-1.6.5.jar +ant/jars/ant-stylebook-1.6.jar +ant/jars/ant-swing-1.6.2.jar +ant/jars/ant-swing-1.6.3.jar +ant/jars/ant-swing-1.6.4.jar +ant/jars/ant-swing-1.6.jar +ant/jars/ant-trax-1.6.1.jar +ant/jars/ant-trax-1.6.2.jar +ant/jars/ant-trax-1.6.3.jar +ant/jars/ant-trax-1.6.4.jar +ant/jars/ant-trax-1.6.5.jar +ant/jars/ant-trax-1.6.jar +ant/jars/ant-vaj-1.6.1.jar +ant/jars/ant-vaj-1.6.2.jar +ant/jars/ant-vaj-1.6.3.jar +ant/jars/ant-vaj-1.6.4.jar +ant/jars/ant-vaj-1.6.5.jar +ant/jars/ant-vaj-1.6.jar +ant/jars/ant-weblogic-1.6.1.jar +ant/jars/ant-weblogic-1.6.2.jar +ant/jars/ant-weblogic-1.6.3.jar +ant/jars/ant-weblogic-1.6.4.jar +ant/jars/ant-weblogic-1.6.5.jar +ant/jars/ant-weblogic-1.6.jar +ant/jars/ant-xalan1-1.6.1.jar +ant/jars/ant-xalan1-1.6.2.jar +ant/jars/ant-xalan1-1.6.3.jar +ant/jars/ant-xalan1-1.6.4.jar +ant/jars/ant-xalan1-1.6.5.jar +ant/jars/ant-xalan1-1.6.jar +ant/jars/ant-xalan2-1.6.1.jar +ant/jars/ant-xalan2-1.6.jar +ant/jars/ant-xslp-1.6.1.jar +ant/jars/ant-xslp-1.6.2.jar +ant/jars/ant-xslp-1.6.3.jar +ant/jars/ant-xslp-1.6.4.jar +ant/jars/ant-xslp-1.6.5.jar +ant/jars/ant-xslp-1.6.jar +ant/jars/optional-1.5.4.jar +ant-contrib/jars/ant-contrib-20020829.jar +ant-contrib/jars/cpptasks-20030309.134440.jar +ant-doxygen/jars/ant-doxygen-1.2.jar +apache-jaxme/jars/jaxme-incubation-0.2.jar +apache-jaxme/jars/jaxme-rt-incubation-0.2.jar +apache-jaxme/jars/jaxmeapi-incubation-0.2.jar +apache-jaxme/jars/jaxmejs-incubation-0.2.jar +apache-jaxme/jars/jaxmepm-incubation-0.2.jar +apache-jaxme/jars/jaxmexs-incubation-0.2.jar +avalon/jars/avalon-activation-1.0.jar +avalon/jars/avalon-activation-spi-1.0.jar +avalon/jars/avalon-assembly-1.0.jar +avalon/jars/avalon-assembly-spi-1.0.jar +avalon/jars/avalon-composition-1.0.jar +avalon/jars/avalon-meta-1.0.jar +avalon/jars/avalon-composition-spi-1.0.jar +avalon/jars/avalon-framework-4.1.4.jar +avalon/jars/avalon-framework-api-4.1.4.jar +avalon/jars/avalon-logkit-1.2.2.jar +avalon/jars/avalon-logkit-1.2.jar +avalon/jars/avalon-meta-spi-1.0.jar +avalon/jars/avalon-meta-tools-1.0.jar +avalon-activation/jars/avalon-activation-api-1.0-beta-1-RC1.jar +avalon-activation/jars/avalon-activation-api-1.0b1.jar +avalon-activation/jars/avalon-activation-api-1.1-dev.jar +avalon-activation/jars/avalon-activation-api-1.2-dev.jar +avalon-activation/jars/avalon-activation-api-1.2.1-dev.jar +avalon-activation/jars/avalon-activation-api-1.2.1.jar +avalon-activation/jars/avalon-activation-api-1.2.2.jar +avalon-activation/jars/avalon-activation-api-2.0-DEV.jar +avalon-activation/jars/avalon-activation-api-2.0.0.jar +avalon-activation/jars/avalon-activation-impl-1.0-beta-1-RC1.jar +avalon-activation/jars/avalon-activation-impl-1.0b1.jar +avalon-activation/jars/avalon-activation-impl-1.0b2.jar +avalon-activation/jars/avalon-activation-impl-1.1-dev.jar +avalon-activation/jars/avalon-activation-impl-1.2-dev.jar +avalon-activation/jars/avalon-activation-impl-1.2.1-dev.jar +avalon-activation/jars/avalon-activation-impl-1.2.2-dev.jar +avalon-activation/jars/avalon-activation-impl-1.2.3-dev.jar +avalon-activation/jars/avalon-activation-impl-1.2.3.jar +avalon-activation/jars/avalon-activation-impl-1.2.4.jar +avalon-activation/jars/avalon-activation-impl-1.2.5.jar +avalon-activation/jars/avalon-activation-impl-1.2.6.jar +avalon-activation/jars/avalon-activation-impl-2.0-DEV.jar +avalon-activation/jars/avalon-activation-impl-2.0.0.jar +avalon-activation/jars/avalon-activation-spi-1.0-beta-1-RC1.jar +avalon-activation/jars/avalon-activation-spi-1.0b1.jar +avalon-activation/jars/avalon-activation-spi-1.1-dev.jar +avalon-activation/jars/avalon-activation-spi-1.2-dev.jar +avalon-activation/jars/avalon-activation-spi-1.2.1-dev.jar +avalon-activation/jars/avalon-activation-spi-1.2.2-dev.jar +avalon-activation/jars/avalon-activation-spi-1.2.2.jar +avalon-activation/jars/avalon-activation-spi-2.0-DEV.jar +avalon-apps/jars/avalon-apps-hsql-0.1.jar +avalon-apps/jars/avalon-apps-sevak-api-0.1.jar +avalon-apps/jars/avalon-apps-sevak-jo-0.1.jar +avalon-composition/jars/avalon-composition-api-1.0-beta-1-RC1.jar +avalon-composition/jars/avalon-composition-api-1.0b1.jar +avalon-composition/jars/avalon-composition-api-1.1-dev.jar +avalon-composition/jars/avalon-composition-api-1.2-dev.jar +avalon-composition/jars/avalon-composition-api-1.2.1-dev.jar +avalon-composition/jars/avalon-composition-api-1.2.1.jar +avalon-composition/jars/avalon-composition-api-1.2.2.jar +avalon-composition/jars/avalon-composition-api-1.2.3.jar +avalon-composition/jars/avalon-composition-api-2.0-DEV.jar +avalon-composition/jars/avalon-composition-api-2.0.0.jar +avalon-composition/jars/avalon-composition-impl-1.0-beta-1-RC1.jar +avalon-composition/jars/avalon-composition-impl-1.0b1.jar +avalon-composition/jars/avalon-composition-impl-1.1-dev.jar +avalon-composition/jars/avalon-composition-impl-1.2-dev.jar +avalon-composition/jars/avalon-composition-impl-1.2.1-dev.jar +avalon-composition/jars/avalon-composition-impl-1.2.2-dev.jar +avalon-composition/jars/avalon-composition-impl-1.2.2.jar +avalon-composition/jars/avalon-composition-impl-1.2.3.jar +avalon-composition/jars/avalon-composition-impl-1.2.4.jar +avalon-composition/jars/avalon-composition-impl-1.2.5.jar +avalon-composition/jars/avalon-composition-impl-2.0-DEV.jar +avalon-composition/jars/avalon-composition-impl-2.0.0.jar +avalon-composition/jars/avalon-composition-spi-1.0-beta-1-RC1.jar +avalon-composition/jars/avalon-composition-spi-1.0b1.jar +avalon-composition/jars/avalon-composition-spi-1.1-dev.jar +avalon-composition/jars/avalon-composition-spi-1.2-dev.jar +avalon-composition/jars/avalon-composition-spi-1.2.1-dev.jar +avalon-composition/jars/avalon-composition-spi-1.2.1.jar +avalon-composition/jars/avalon-composition-spi-2.0-DEV.jar +avalon-composition/jars/avalon-composition-spi-2.0.0.jar +avalon-cornerstone/jars/avalon-cornerstone-4.0.jar +avalon-extension/jars/avalon-extension-impl-1.0-RC1.jar +avalon-extension/jars/avalon-extension-impl-1.0.jar +avalon-extension/jars/avalon-extension-impl-1.1.jar +avalon-extension/jars/avalon-extension-spi-1.0-RC1.jar +avalon-extension/jars/avalon-extension-spi-1.0.jar +avalon-extension/jars/avalon-extension-spi-1.1.jar +avalon-framework/distributions/avalon-framework-4.1.5-RC3-src.tar.gz +avalon-framework/distributions/avalon-framework-4.1.5-RC3-src.zip +avalon-framework/distributions/avalon-framework-4.1.5-RC3.tar.gz +avalon-framework/distributions/avalon-framework-4.1.5-RC3.zip +avalon-framework/distributions/avalon-framework-4.1.5.src.tar.gz +avalon-framework/distributions/avalon-framework-4.1.5.src.zip +avalon-framework/distributions/avalon-framework-4.1.5.tar.gz +avalon-framework/distributions/avalon-framework-4.1.5.zip +avalon-framework/jars/avalon-framework-20020627.jar +avalon-framework/jars/avalon-framework-4.0.jar +avalon-framework/jars/avalon-framework-4.1.3.jar +avalon-framework/jars/avalon-framework-4.1.4.jar +avalon-framework/jars/avalon-framework-4.1.5-RC2.jar +avalon-framework/jars/avalon-framework-4.1.5-dev.jar +avalon-framework/jars/avalon-framework-4.1.5.jar +avalon-framework/jars/avalon-framework-api-4.1.5-RC2.jar +avalon-framework/jars/avalon-framework-api-4.1.5-RC3.jar +avalon-framework/jars/avalon-framework-api-4.1.5-dev.jar +avalon-framework/jars/avalon-framework-api-4.1.5.jar +avalon-framework/jars/avalon-framework-api-4.2.0.jar +avalon-framework/jars/avalon-framework-api-4.3.jar +avalon-framework/jars/avalon-framework-impl-4.1.5-RC2.jar +avalon-framework/jars/avalon-framework-impl-4.1.5-RC3.jar +avalon-framework/jars/avalon-framework-impl-4.1.5-dev.jar +avalon-framework/jars/avalon-framework-impl-4.1.5.jar +avalon-framework/jars/avalon-framework-impl-4.2.0.jar +avalon-framework/jars/avalon-framework-impl-4.3.jar +avalon-framework/poms/avalon-framework-api-4.3.pom +avalon-framework/poms/avalon-framework-impl-4.3.pom +avalon-http/blocks/avalon-http-1.3.block +avalon-http/jars/avalon-http-api-1.3.jar +avalon-http/jars/avalon-http-impl-1.3.jar +avalon-logging/jars/avalon-logging-api-1.0.0.jar +avalon-logging/jars/avalon-logging-impl-1.0.0.jar +avalon-logging/jars/avalon-logging-logkit-api-1.0.0.jar +avalon-logging/jars/avalon-logging-logkit-impl-1.0.0.jar +avalon-logging/jars/avalon-logging-spi-1.0.0.jar +avalon-logkit/jars/avalon-logkit-2.0.0.jar +avalon-logkit/jars/avalon-logkit-2.0.jar +avalon-logkit/jars/avalon-logkit-2.1.jar +avalon-logkit/poms/avalon-logkit-2.1.pom +avalon-meta/distributions/1.1/avalon-meta-1.1-src.tar.gz +avalon-meta/distributions/1.1/avalon-meta-1.1-src.zip +avalon-meta/distributions/1.1/avalon-meta-1.1.tar.gz +avalon-meta/distributions/1.1/avalon-meta-1.1.zip +avalon-meta/distributions/1.3/avalon-meta-1.3-src.tar.gz.MD5 +avalon-meta/distributions/1.3/avalon-meta-1.3-src.tar.gz +avalon-meta/distributions/1.3/avalon-meta-1.3-src.zip.MD5 +avalon-meta/distributions/1.3/avalon-meta-1.3-src.zip +avalon-meta/distributions/1.3/avalon-meta-1.3.tar.gz.MD5 +avalon-meta/distributions/1.3/avalon-meta-1.3.tar.gz +avalon-meta/distributions/1.3/avalon-meta-1.3.zip.MD5 +avalon-meta/distributions/1.3/avalon-meta-1.3.zip +avalon-meta/distributions/1.3.1/avalon-meta-1.3.1-src.tar.gz.MD5 +avalon-meta/distributions/1.3.1/avalon-meta-1.3.1-src.tar.gz +avalon-meta/distributions/1.3.1/avalon-meta-1.3.1-src.zip.MD5 +avalon-meta/distributions/1.3.1/avalon-meta-1.3.1-src.zip +avalon-meta/distributions/1.3.1/avalon-meta-1.3.1.tar.gz.MD5 +avalon-meta/distributions/1.3.1/avalon-meta-1.3.1.tar.gz +avalon-meta/distributions/1.3.1/avalon-meta-1.3.1.zip.MD5 +avalon-meta/distributions/1.3.1/avalon-meta-1.3.1.zip +avalon-meta/jars/avalon-meta-api-1.2.1-dev.jar +avalon-meta/jars/avalon-meta-api-1.1-RC1.jar +avalon-meta/jars/avalon-meta-api-1.1.jar +avalon-meta/jars/avalon-meta-api-1.2-dev.jar +avalon-meta/jars/avalon-meta-api-1.4.0.jar +avalon-meta/jars/avalon-meta-api-1.3.jar +avalon-meta/jars/avalon-meta-spi-1.2.1-dev.jar +avalon-meta/jars/avalon-meta-impl-1.1-RC1.jar +avalon-meta/jars/avalon-meta-impl-1.1.jar +avalon-meta/jars/avalon-meta-impl-1.2-dev.jar +avalon-meta/jars/avalon-meta-spi-1.2-dev.jar +avalon-meta/jars/avalon-meta-impl-1.2.1-dev.jar +avalon-meta/jars/avalon-meta-impl-1.3.1.jar +avalon-meta/jars/avalon-meta-impl-1.3.jar +avalon-meta/jars/avalon-meta-impl-1.4.0.jar +avalon-meta/jars/avalon-meta-plugin-1.1.jar +avalon-meta/jars/avalon-meta-plugin-1.2.jar +avalon-meta/jars/avalon-meta-plugin-1.3.1.jar +avalon-meta/jars/avalon-meta-plugin-1.3.2.jar +avalon-meta/jars/avalon-meta-plugin-1.3.jar +avalon-meta/jars/avalon-meta-spi-1.1-RC1.jar +avalon-meta/jars/avalon-meta-spi-1.1.jar +avalon-meta/jars/avalon-meta-spi-1.4.0.jar +avalon-meta/jars/avalon-meta-spi-1.3.jar +avalon-meta/jars/avalon-meta-tools-1.1-RC1.jar +avalon-meta/jars/avalon-meta-tools-1.1.jar +avalon-meta/jars/avalon-meta-tools-1.2-dev.jar +avalon-meta/jars/avalon-meta-tools-1.2.1-dev.jar +avalon-meta/jars/avalon-meta-tools-1.3.1.jar +avalon-meta/jars/avalon-meta-tools-1.3.jar +avalon-meta/jars/avalon-meta-tools-1.4.0.jar +avalon-meta/plugins/avalon-meta-plugin-1.3.1.jar +avalon-meta/plugins/avalon-meta-plugin-1.1.jar +avalon-meta/plugins/avalon-meta-plugin-1.2.jar +avalon-meta/plugins/avalon-meta-plugin-1.3.2.jar +avalon-meta/plugins/avalon-meta-plugin-1.3.jar +avalon-meta/plugins/avalon-meta-plugin-1.4.0.jar +avalon-phoenix/jars/avalon-phoenix-bsh-commands-4.0.4.jar +avalon-phoenix/jars/avalon-phoenix-client-4.0.4.jar +avalon-phoenix/jars/avalon-phoenix-client-4.0.jar +avalon-phoenix/jars/avalon-phoenix-engine-4.0.4.jar +avalon-phoenix/jars/avalon-phoenix-loader-4.0.4.jar +avalon-phoenix/jars/avalon-phoenix-metagenerate-4.0.jar +avalon-repository/distributions/1.2/avalon-repository-1.2-src.tar.gz.MD5 +avalon-repository/distributions/1.2/avalon-repository-1.2-src.tar.gz +avalon-repository/distributions/1.2/avalon-repository-1.2-src.zip.MD5 +avalon-repository/distributions/1.2/avalon-repository-1.2-src.zip +avalon-repository/distributions/1.2/avalon-repository-1.2.tar.gz.MD5 +avalon-repository/distributions/1.2/avalon-repository-1.2.tar.gz +avalon-repository/distributions/1.2/avalon-repository-1.2.zip.MD5 +avalon-repository/distributions/1.2/avalon-repository-1.2.zip +avalon-repository/jars/avalon-repository-api-1.2-dev.jar +avalon-repository/jars/avalon-repository-api-1.2.jar +avalon-repository/jars/avalon-repository-api-2.0.0.jar +avalon-repository/jars/avalon-repository-cli-2.0.0.jar +avalon-repository/jars/avalon-repository-impl-1.2.jar +avalon-repository/jars/avalon-repository-impl-1.0-beta-1-RC1.jar +avalon-repository/jars/avalon-repository-impl-1.0b1.jar +avalon-repository/jars/avalon-repository-impl-1.1-dev.jar +avalon-repository/jars/avalon-repository-impl-1.2-dev.jar +avalon-repository/jars/avalon-repository-impl-2.0.0.jar +avalon-repository/jars/avalon-repository-main-1.2-dev.jar +avalon-repository/jars/avalon-repository-main-1.2.jar +avalon-repository/jars/avalon-repository-main-2.0.0.jar +avalon-repository/jars/avalon-repository-spi-1.0-beta-1-RC1.jar +avalon-repository/jars/avalon-repository-spi-1.0b1.jar +avalon-repository/jars/avalon-repository-spi-1.1-dev.jar +avalon-repository/jars/avalon-repository-spi-1.2-dev.jar +avalon-repository/jars/avalon-repository-spi-1.2.jar +avalon-repository/jars/avalon-repository-spi-2.0.0.jar +avalon-repository/jars/avalon-repository-util-1.2-dev.jar +avalon-repository/jars/avalon-repository-util-1.2.jar +avalon-repository/jars/avalon-repository-util-2.0.0.jar +avalon-repository/propertiess/repository.properties +avalon-util/distributions/1.0/avalon-util-1.0-src.tar.gz.MD5 +avalon-util/distributions/1.0/avalon-util-1.0-src.tar.gz +avalon-util/distributions/1.0/avalon-util-1.0-src.zip.MD5 +avalon-util/distributions/1.0/avalon-util-1.0-src.zip +avalon-util/distributions/1.0/avalon-util-1.0.tar.gz.MD5 +avalon-util/distributions/1.0/avalon-util-1.0.tar.gz +avalon-util/distributions/1.0/avalon-util-1.0.zip.MD5 +avalon-util/distributions/1.0/avalon-util-1.0.zip +avalon-util/jars/avalon-util-criteria-1.0-dev.jar +avalon-util/jars/avalon-plugin-1.0-dev.jar +avalon-util/jars/avalon-plugin-1.0.jar +avalon-util/jars/avalon-util-criteria-1.0.jar +avalon-util/jars/avalon-util-criteria-1.1.0.jar +avalon-util/jars/avalon-util-defaults-1.0-dev.jar +avalon-util/jars/avalon-util-defaults-1.1-dev.jar +avalon-util/jars/avalon-util-defaults-1.1.jar +avalon-util/jars/avalon-util-defaults-1.2.1.jar +avalon-util/jars/avalon-util-env-1.0-dev.jar +avalon-util/jars/avalon-util-env-1.0.jar +avalon-util/jars/avalon-util-env-1.1.1.jar +avalon-util/jars/avalon-util-exception-1.0-dev.jar +avalon-util/jars/avalon-util-exception-1.0.0.jar +avalon-util/jars/avalon-util-exception-1.0.jar +avalon-util/jars/avalon-util-extension-api-1.2.0.jar +avalon-util/jars/avalon-util-extension-impl-1.2.0.jar +avalon-util/jars/avalon-util-i18n-1.0.0.jar +avalon-util/plugins/avalon-util-plugin-1.0.0.jar +avalon-util/plugins/avalon-plugin-1.0-dev.jar +avalon-util/plugins/avalon-plugin-1.0.jar +axis/jars/axis-1.0.jar +axis/jars/axis-1.1-beta.jar +axis/jars/axis-1.1.jar +axis/jars/axis-1.2-RC1.jar +axis/jars/axis-1.2-RC2.jar +axis/jars/axis-1.2-RC3.jar +axis/jars/axis-1.2-beta-2.jar +axis/jars/axis-1.2-alpha-1.jar +axis/jars/axis-1.2-beta-3.jar +axis/jars/axis-1.2.1.jar +axis/jars/axis-1.2.jar +axis/jars/axis-1.3.jar +axis/jars/axis-1.4.jar +axis/jars/axis-1.4.jar.sha +axis/jars/axis-ant-1.1.jar +axis/jars/axis-ant-1.2-RC1.jar +axis/jars/axis-ant-1.2.1.jar +axis/jars/axis-ant-1.2-RC2.jar +axis/jars/axis-ant-1.2-RC3.jar +axis/jars/axis-ant-1.2-beta-2.jar +axis/jars/axis-ant-1.2-beta-3.jar +axis/jars/axis-ant-1.2.jar +axis/jars/axis-ant-1.3.jar +axis/jars/axis-ant-1.4.jar +axis/jars/axis-jaxrpc-1.2.jar +axis/jars/axis-ant-1.4.jar.sha +axis/jars/axis-jaxrpc-1.2-RC1.jar +axis/jars/axis-jaxrpc-1.2-RC2.jar +axis/jars/axis-jaxrpc-1.2-RC3.jar +axis/jars/axis-jaxrpc-1.2-alpha-1.jar +axis/jars/axis-jaxrpc-1.2-beta-2.jar +axis/jars/axis-jaxrpc-1.2-beta-3.jar +axis/jars/axis-jaxrpc-1.2.1.jar +axis/jars/axis-jaxrpc-1.3.jar +axis/jars/axis-jaxrpc-1.4.jar +axis/jars/axis-jaxrpc-1.4.jar.sha +axis/jars/axis-saaj-1.2-RC1.jar +axis/jars/axis-saaj-1.2-RC2.jar +axis/jars/axis-saaj-1.2-RC3.jar +axis/jars/axis-saaj-1.2-alpha-1.jar +axis/jars/axis-saaj-1.2-beta-2.jar +axis/jars/axis-saaj-1.2-beta-3.jar +axis/jars/axis-saaj-1.2.1.jar +axis/jars/axis-saaj-1.2.jar +axis/jars/axis-saaj-1.3.jar +axis/jars/axis-saaj-1.4.jar +axis/jars/axis-saaj-1.4.jar.sha +axis/jars/axis-schema-1.3.jar +axis/jars/axis-wsdl4j-1.2-RC1.jar +axis/jars/axis-wsdl4j-1.2-RC2.jar +axis/jars/axis-wsdl4j-1.2-RC3.jar +axis/jars/axis-wsdl4j-1.2-beta-2.jar +axis/jars/axis-wsdl4j-1.2-beta-3.jar +axis/jars/axis-wsdl4j-1.2.1.jar +axis/jars/axis-wsdl4j-1.2.jar +axis/jars/axis-wsdl4j-1.3.jar +axis/poms/axis-1.2.1.pom +axis2/jars/addressing-0.94.mar +axis2/jars/axis2-0.9.jar +axis2/jars/axis2-0.95.jar +axis2/jars/axis2-1.0.jar +axis2/jars/axis2-adb-0.94.jar +axis2/jars/axis2-adb-0.95.jar +axis2/jars/axis2-adb-1.0.jar +axis2/jars/axis2-codegen-0.94.jar +axis2/jars/axis2-codegen-0.95.jar +axis2/jars/axis2-codegen-1.0.jar +axis2/jars/axis2-core-0.94.jar +axis2/jars/axis2-doom-0.94.jar +axis2/jars/axis2-doom-0.95.jar +axis2/jars/axis2-java2wsdl-1.0.jar +axis2/jars/axis2-jibx-1.0.jar +axis2/jars/axis2-kernel-0.95.jar +axis2/jars/axis2-kernel-1.0.jar +axis2/jars/axis2-xmlbeans-1.0.jar +axis2/mars/addressing-0.94.mar +axis2/mars/addressing-0.95.mar +axis2/mars/addressing-1.0.mar +axis2/mars/rampart-1.0.mar +axis2/mars/security-0.95.mar +axis2/mars/soapmonitor-1.0.mar +batik/jars/batik-1.1.1.jar +batik/jars/batik-1.5.jar +batik/jars/batik-awt-util-1.5.jar +batik/jars/batik-awt-util-1.6.jar +batik/jars/batik-bridge-1.5.jar +batik/jars/batik-bridge-1.6.jar +batik/jars/batik-css-1.5.jar +batik/jars/batik-css-1.6.jar +batik/jars/batik-dom-1.5.jar +batik/jars/batik-dom-1.6.jar +batik/jars/batik-ext-1.5.jar +batik/jars/batik-ext-1.6.jar +batik/jars/batik-extension-1.5.jar +batik/jars/batik-extension-1.6.jar +batik/jars/batik-gui-util-1.5.jar +batik/jars/batik-gui-util-1.6.jar +batik/jars/batik-gvt-1.5.jar +batik/jars/batik-gvt-1.6.jar +batik/jars/batik-parser-1.5.jar +batik/jars/batik-parser-1.6.jar +batik/jars/batik-rasterizer-1.5.jar +batik/jars/batik-rasterizer-1.6.jar +batik/jars/batik-script-1.5.jar +batik/jars/batik-rasterizer-ext-1.6.jar +batik/jars/batik-rasterizer-ext.jar +batik/jars/batik-script-1.6.jar +batik/jars/batik-slideshow-1.6.jar +batik/jars/batik-squiggle-1.6.jar +batik/jars/batik-squiggle-ext-1.6.jar +batik/jars/batik-squiggle-ext.jar +batik/jars/batik-svg-dom-1.5.jar +batik/jars/batik-svg-dom-1.6.jar +batik/jars/batik-svggen-1.5.jar +batik/jars/batik-svggen-1.6.jar +batik/jars/batik-svgpp-1.6.jar +batik/jars/batik-swing-1.5.jar +batik/jars/batik-swing-1.6.jar +batik/jars/batik-transcoder-1.5.jar +batik/jars/batik-transcoder-1.6.jar +batik/jars/batik-ttf2svg-1.6.jar +batik/jars/batik-util-1.5.jar +batik/jars/batik-util-1.6.jar +batik/jars/batik-xml-1.5.jar +batik/jars/batik-xml-1.6.jar +batik/poms/batik-awt-util-1.6.pom +batik/poms/batik-bridge-1.6.pom +batik/poms/batik-css-1.6.pom +batik/poms/batik-dom-1.6.pom +batik/poms/batik-ext-1.6.pom +batik/poms/batik-extension-1.6.pom +batik/poms/batik-gvt-1.6.pom +batik/poms/batik-gui-util-1.6.pom +batik/poms/batik-parser-1.6.pom +batik/poms/batik-rasterizer-1.6.pom +batik/poms/batik-rasterizer-ext-1.6.pom +batik/poms/batik-script-1.6.pom +batik/poms/batik-slideshow-1.6.pom +batik/poms/batik-squiggle-1.6.pom +batik/poms/batik-squiggle-ext-1.6.pom +batik/poms/batik-svg-dom-1.6.pom +batik/poms/batik-svggen-1.6.pom +batik/poms/batik-svgpp-1.6.pom +batik/poms/batik-swing-1.6.pom +batik/poms/batik-transcoder-1.6.pom +batik/poms/batik-ttf2svg-1.6.pom +batik/poms/batik-util-1.6.pom +batik/poms/batik-xml-1.6.pom +bsf/jars/bsf-2.2.jar +bsf/jars/bsf-2.3.0-rc1.jar +bcel/jars/bcel-5.0.jar +bcel/jars/bcel-5.1.jar +beehive/jars/apache-xbean-beehive-1.0-alpha.jar +beehive/jars/beehive-netui-compiler-1.0-alpha.jar +beehive/jars/beehive-netui-pageflow-1.0-alpha.jar +beehive/jars/beehive-netui-scoping-1.0-alpha.jar +beehive/jars/controls-1.0-alpha.jar +beehive/jars/beehive-netui-tags-databinding-1.0-alpha.jar +beehive/jars/beehive-netui-tags-html-1.0-alpha.jar +beehive/jars/beehive-netui-tags-template-1.0-alpha.jar +beehive/jars/beehive-netui-util-1.0-alpha.jar +beehive/jars/wsdltypes-beehive-1.0-alpha.jar +beehive/jars/wsm-1.0-alpha.jar +beehive/jars/wsm-axis-1.0-alpha.jar +beehive/poms/beehive-controls-1.0.pom +beehive/tlds/beehive-netui-tags-databinding-1.0-alpha.tld +beehive/tlds/beehive-netui-tags-html-1.0-alpha.tld +beehive/tlds/beehive-netui-tags-template-1.0-alpha.tld +beehive/xmls/buildWebappCore.xml +beehive/xmls/buildWebapp.xml +beehive/xmls/webappRuntimeCore.xml +beehive/xmls/runTomcatCore.xml +cactus/distributions/jakarta-cactus-1.5-beta1-src.zip +cactus/distributions/jakarta-cactus-12-1.5-beta1.zip +cactus/distributions/jakarta-cactus-13-1.5-beta1.zip +cactus/jars/cactus-1.4b1.jar +cactus/jars/cactus-12-1.4.1.jar +cactus/jars/cactus-12-1.5-beta1.jar +cactus/jars/cactus-12-1.7.1.jar +cactus/jars/cactus-12-1.7.2.jar +cactus/jars/cactus-13-1.4.1.jar +cactus/jars/cactus-13-1.5-beta1.jar +cactus/jars/cactus-13-1.5-rc1.jar +cactus/jars/cactus-13-1.5dev-20030522.jar +cactus/jars/cactus-13-1.5dev-20030607.jar +cactus/jars/cactus-13-1.5dev-20030619.jar +cactus/jars/cactus-13-1.6.1.jar +cactus/jars/cactus-13-1.6dev-20030807.jar +cactus/jars/cactus-13-1.6.jar +cactus/jars/cactus-13-1.6dev-20030809.jar +cactus/jars/cactus-13-1.6dev-20030829.jar +cactus/jars/cactus-13-1.6dev-20040115.jar +cactus/jars/cactus-13-1.7.1.jar +cactus/jars/cactus-13-1.7.2.jar +cactus/jars/cactus-ant-13-1.6.1.jar +cactus/jars/cactus-ant-13-1.6.jar +cactus/jars/cactus-13-1.7.jar +cactus/jars/cactus-13-1.7dev-20040815.jar +cactus/jars/cactus-ant-1.4.1.jar +cactus/jars/cactus-ant-12-1.5-beta1.jar +cactus/jars/cactus-ant-12-1.7.1.jar +cactus/jars/cactus-ant-12-1.7.2.jar +cactus/jars/cactus-ant-13-1.5-beta1.jar +cactus/jars/cactus-ant-13-1.5-rc1.jar +cactus/jars/cactus-ant-13-1.5dev-20030522.jar +cactus/jars/cactus-ant-13-1.5dev-20030607.jar +cactus/jars/cactus-ant-13-1.5dev-20030619.jar +cactus/jars/cactus-ant-13-1.6dev-20030807.jar +cactus/jars/cactus-ant-13-1.6dev-20030809.jar +cactus/jars/cactus-ant-13-1.6dev-20030829.jar +cactus/jars/cactus-ant-13-1.6dev-20040115.jar +cactus/jars/cactus-ant-13-1.7.1.jar +cactus/jars/cactus-ant-13-1.7dev-20040815.jar +cactus/jars/cactus-ant-13-1.7.2.jar +cactus/jars/cactus-ant-13-1.7.jar +cactus/jars/cactus-framework-13-1.5dev-20030322.jar +cactus/jars/cactus-framework-13-1.5dev-20030407.jar +cactus/jars/cactus-integration-ant-1.5dev-20030322.jar +cactus/jars/cactus-integration-ant-1.5dev-20030407.jar +cactus/plugins/cactus-maven-1.6.1.jar +cactus/plugins/cactus-maven-1.6.jar +cactus/plugins/cactus-maven-1.6dev-20031031.jar +cactus/plugins/cactus-maven-1.6dev-20040115.jar +cactus/plugins/cactus-maven-1.7.1.jar +cactus/plugins/cactus-maven-1.7dev-20040815.jar +cactus/plugins/cactus-maven-1.7.2.jar +cactus/plugins/cactus-maven-1.7.jar +cactus/poms/cactus-maven-1.7.1.pom +cactus/poms/cactus-maven-1.7.2.pom +cactus/zips/jakarta-cactus-integration-ant-13-1.5dev-20030325.zip +cactus/zips/jakarta-cactus-integration-ant-13-1.5dev-20030329.zip +cactus/zips/jakarta-cactus-integration-ant-13-1.5dev-20030407.zip +cactus/zips/jakarta-cactus-integration-ant-13-1.5dev-20030426.zip +cocoon/jars/cocoon-2.1.3.jar +cocoon/jars/cocoon-2.1.4.jar +cocoon/jars/cocoon-2.1.5.1-deprecated.jar +cocoon/jars/cocoon-2.1.5.1.jar +cocoon/jars/cocoon-2.1.6.jar +cocoon/jars/cocoon-2.1.7.jar +cocoon/jars/cocoon-2.1.8.jar +cocoon/jars/cocoon-2.1.9.jar +cocoon/jars/cocoon-ajax-2.1.8.jar +cocoon/jars/cocoon-ajax-2.1.9.jar +cocoon/jars/cocoon-apples-2.1.3.jar +cocoon/jars/cocoon-apples-2.1.4.jar +cocoon/jars/cocoon-apples-2.1.5.1.jar +cocoon/jars/cocoon-apples-2.1.6.jar +cocoon/jars/cocoon-apples-2.1.7.jar +cocoon/jars/cocoon-apples-2.1.8.jar +cocoon/jars/cocoon-apples-2.1.9.jar +cocoon/jars/cocoon-asciiart-2.1.3.jar +cocoon/jars/cocoon-asciiart-2.1.4.jar +cocoon/jars/cocoon-asciiart-2.1.5.1.jar +cocoon/jars/cocoon-asciiart-2.1.6.jar +cocoon/jars/cocoon-asciiart-2.1.7.jar +cocoon/jars/cocoon-asciiart-2.1.8.jar +cocoon/jars/cocoon-asciiart-2.1.9.jar +cocoon/jars/cocoon-authentication-fw-2.1.3.jar +cocoon/jars/cocoon-authentication-fw-2.1.4.jar +cocoon/jars/cocoon-authentication-fw-2.1.5.1.jar +cocoon/jars/cocoon-authentication-fw-2.1.6.jar +cocoon/jars/cocoon-authentication-fw-2.1.7.jar +cocoon/jars/cocoon-authentication-fw-2.1.8.jar +cocoon/jars/cocoon-authentication-fw-2.1.9.jar +cocoon/jars/cocoon-axis-2.1.3.jar +cocoon/jars/cocoon-axis-2.1.4.jar +cocoon/jars/cocoon-axis-2.1.5.1.jar +cocoon/jars/cocoon-axis-2.1.6.jar +cocoon/jars/cocoon-axis-2.1.7.jar +cocoon/jars/cocoon-axis-2.1.8.jar +cocoon/jars/cocoon-axis-2.1.9.jar +cocoon/jars/cocoon-batik-2.1.3.jar +cocoon/jars/cocoon-batik-2.1.4.jar +cocoon/jars/cocoon-batik-2.1.5.1.jar +cocoon/jars/cocoon-batik-2.1.6.jar +cocoon/jars/cocoon-batik-2.1.7.jar +cocoon/jars/cocoon-batik-2.1.8.jar +cocoon/jars/cocoon-batik-2.1.9.jar +cocoon/jars/cocoon-bsf-2.1.3.jar +cocoon/jars/cocoon-bsf-2.1.4.jar +cocoon/jars/cocoon-bsf-2.1.5.1.jar +cocoon/jars/cocoon-bsf-2.1.6.jar +cocoon/jars/cocoon-bsf-2.1.7.jar +cocoon/jars/cocoon-bsf-2.1.8.jar +cocoon/jars/cocoon-bsf-2.1.9.jar +cocoon/jars/cocoon-captcha-2.1.8.jar +cocoon/jars/cocoon-captcha-2.1.9.jar +cocoon/jars/cocoon-chaperon-2.1.3.jar +cocoon/jars/cocoon-chaperon-2.1.4.jar +cocoon/jars/cocoon-chaperon-2.1.5.1.jar +cocoon/jars/cocoon-chaperon-2.1.6.jar +cocoon/jars/cocoon-chaperon-2.1.7.jar +cocoon/jars/cocoon-chaperon-2.1.8.jar +cocoon/jars/cocoon-chaperon-2.1.9.jar +cocoon/jars/cocoon-cron-2.1.3.jar +cocoon/jars/cocoon-cron-2.1.4.jar +cocoon/jars/cocoon-cron-2.1.5.1.jar +cocoon/jars/cocoon-cron-2.1.6.jar +cocoon/jars/cocoon-cron-2.1.7.jar +cocoon/jars/cocoon-cron-2.1.8.jar +cocoon/jars/cocoon-cron-2.1.9.jar +cocoon/jars/cocoon-databases-2.1.3.jar +cocoon/jars/cocoon-databases-2.1.4.jar +cocoon/jars/cocoon-databases-2.1.5.1.jar +cocoon/jars/cocoon-databases-2.1.6.jar +cocoon/jars/cocoon-databases-2.1.7.jar +cocoon/jars/cocoon-deli-2.1.6.jar +cocoon/jars/cocoon-databases-2.1.8.jar +cocoon/jars/cocoon-databases-2.1.9.jar +cocoon/jars/cocoon-deli-2.1.3.jar +cocoon/jars/cocoon-deli-2.1.4.jar +cocoon/jars/cocoon-deli-2.1.5.1.jar +cocoon/jars/cocoon-deli-2.1.7.jar +cocoon/jars/cocoon-deli-2.1.8.jar +cocoon/jars/cocoon-deli-2.1.9.jar +cocoon/jars/cocoon-deprecated-2.1.3.jar +cocoon/jars/cocoon-deprecated-2.1.4.jar +cocoon/jars/cocoon-deprecated-2.1.6.jar +cocoon/jars/cocoon-deprecated-2.1.5.1.jar +cocoon/jars/cocoon-deprecated-2.1.7.jar +cocoon/jars/cocoon-deprecated-2.1.8.jar +cocoon/jars/cocoon-deprecated-2.1.9.jar +cocoon/jars/cocoon-eventcache-2.1.3.jar +cocoon/jars/cocoon-eventcache-2.1.4.jar +cocoon/jars/cocoon-eventcache-2.1.5.1.jar +cocoon/jars/cocoon-eventcache-2.1.6.jar +cocoon/jars/cocoon-eventcache-2.1.7.jar +cocoon/jars/cocoon-eventcache-2.1.8.jar +cocoon/jars/cocoon-eventcache-2.1.9.jar +cocoon/jars/cocoon-faces-2.1.6.jar +cocoon/jars/cocoon-faces-2.1.7.jar +cocoon/jars/cocoon-faces-2.1.8.jar +cocoon/jars/cocoon-faces-2.1.9.jar +cocoon/jars/cocoon-fop-2.1.3.jar +cocoon/jars/cocoon-fop-2.1.4.jar +cocoon/jars/cocoon-fop-2.1.5.1.jar +cocoon/jars/cocoon-fop-2.1.6.jar +cocoon/jars/cocoon-fop-2.1.7.jar +cocoon/jars/cocoon-fop-2.1.8.jar +cocoon/jars/cocoon-fop-2.1.9.jar +cocoon/jars/cocoon-forms-2.1.6.jar +cocoon/jars/cocoon-forms-2.1.5.1.jar +cocoon/jars/cocoon-forms-2.1.7.jar +cocoon/jars/cocoon-forms-2.1.8.jar +cocoon/jars/cocoon-forms-2.1.9.jar +cocoon/jars/cocoon-hsqldb-2.1.3.jar +cocoon/jars/cocoon-hsqldb-2.1.4.jar +cocoon/jars/cocoon-hsqldb-2.1.5.1.jar +cocoon/jars/cocoon-hsqldb-2.1.6.jar +cocoon/jars/cocoon-hsqldb-2.1.7.jar +cocoon/jars/cocoon-hsqldb-2.1.8.jar +cocoon/jars/cocoon-hsqldb-2.1.9.jar +cocoon/jars/cocoon-html-2.1.3.jar +cocoon/jars/cocoon-html-2.1.4.jar +cocoon/jars/cocoon-html-2.1.5.1.jar +cocoon/jars/cocoon-html-2.1.6.jar +cocoon/jars/cocoon-html-2.1.7.jar +cocoon/jars/cocoon-html-2.1.8.jar +cocoon/jars/cocoon-html-2.1.9.jar +cocoon/jars/cocoon-imageop-2.1.9.jar +cocoon/jars/cocoon-itext-2.1.3.jar +cocoon/jars/cocoon-itext-2.1.4.jar +cocoon/jars/cocoon-itext-2.1.5.1.jar +cocoon/jars/cocoon-itext-2.1.6.jar +cocoon/jars/cocoon-itext-2.1.7.jar +cocoon/jars/cocoon-itext-2.1.8.jar +cocoon/jars/cocoon-itext-2.1.9.jar +cocoon/jars/cocoon-javaflow-2.1.5.1.jar +cocoon/jars/cocoon-javaflow-2.1.6.jar +cocoon/jars/cocoon-javaflow-2.1.7.jar +cocoon/jars/cocoon-javaflow-2.1.8.jar +cocoon/jars/cocoon-javaflow-2.1.9.jar +cocoon/jars/cocoon-jcr-2.1.8.jar +cocoon/jars/cocoon-jcr-2.1.9.jar +cocoon/jars/cocoon-jfor-2.1.3.jar +cocoon/jars/cocoon-jfor-2.1.4.jar +cocoon/jars/cocoon-jfor-2.1.5.1.jar +cocoon/jars/cocoon-jfor-2.1.6.jar +cocoon/jars/cocoon-jfor-2.1.7.jar +cocoon/jars/cocoon-jfor-2.1.8.jar +cocoon/jars/cocoon-jfor-2.1.9.jar +cocoon/jars/cocoon-jms-2.1.4.jar +cocoon/jars/cocoon-jms-2.1.5.1.jar +cocoon/jars/cocoon-jms-2.1.6.jar +cocoon/jars/cocoon-jms-2.1.7.jar +cocoon/jars/cocoon-jms-2.1.8.jar +cocoon/jars/cocoon-jms-2.1.9.jar +cocoon/jars/cocoon-jsp-2.1.3.jar +cocoon/jars/cocoon-jsp-2.1.4.jar +cocoon/jars/cocoon-jsp-2.1.5.1.jar +cocoon/jars/cocoon-jsp-2.1.6.jar +cocoon/jars/cocoon-jsp-2.1.7.jar +cocoon/jars/cocoon-jsp-2.1.8.jar +cocoon/jars/cocoon-jsp-2.1.9.jar +cocoon/jars/cocoon-jxforms-2.1.3.jar +cocoon/jars/cocoon-jxforms-2.1.4.jar +cocoon/jars/cocoon-linkrewriter-2.1.3.jar +cocoon/jars/cocoon-linkrewriter-2.1.4.jar +cocoon/jars/cocoon-linkrewriter-2.1.5.1.jar +cocoon/jars/cocoon-linkrewriter-2.1.6.jar +cocoon/jars/cocoon-linkrewriter-2.1.7.jar +cocoon/jars/cocoon-linkrewriter-2.1.8.jar +cocoon/jars/cocoon-linkrewriter-2.1.9.jar +cocoon/jars/cocoon-linotype-2.1.3.jar +cocoon/jars/cocoon-linotype-2.1.4.jar +cocoon/jars/cocoon-linotype-2.1.5.1.jar +cocoon/jars/cocoon-linotype-2.1.6.jar +cocoon/jars/cocoon-linotype-2.1.7.jar +cocoon/jars/cocoon-linotype-2.1.8.jar +cocoon/jars/cocoon-linotype-2.1.9.jar +cocoon/jars/cocoon-lucene-2.1.3.jar +cocoon/jars/cocoon-lucene-2.1.4.jar +cocoon/jars/cocoon-lucene-2.1.5.1.jar +cocoon/jars/cocoon-mail-2.1.4.jar +cocoon/jars/cocoon-lucene-2.1.6.jar +cocoon/jars/cocoon-lucene-2.1.7.jar +cocoon/jars/cocoon-lucene-2.1.8.jar +cocoon/jars/cocoon-lucene-2.1.9.jar +cocoon/jars/cocoon-mail-2.1.3.jar +cocoon/jars/cocoon-mail-2.1.5.1.jar +cocoon/jars/cocoon-mail-2.1.6.jar +cocoon/jars/cocoon-mail-2.1.7.jar +cocoon/jars/cocoon-mail-2.1.8.jar +cocoon/jars/cocoon-mail-2.1.9.jar +cocoon/jars/cocoon-midi-2.1.3.jar +cocoon/jars/cocoon-midi-2.1.4.jar +cocoon/jars/cocoon-midi-2.1.5.1.jar +cocoon/jars/cocoon-midi-2.1.6.jar +cocoon/jars/cocoon-midi-2.1.7.jar +cocoon/jars/cocoon-midi-2.1.8.jar +cocoon/jars/cocoon-midi-2.1.9.jar +cocoon/jars/cocoon-naming-2.1.3.jar +cocoon/jars/cocoon-naming-2.1.4.jar +cocoon/jars/cocoon-naming-2.1.5.1.jar +cocoon/jars/cocoon-naming-2.1.6.jar +cocoon/jars/cocoon-naming-2.1.7.jar +cocoon/jars/cocoon-naming-2.1.8.jar +cocoon/jars/cocoon-naming-2.1.9.jar +cocoon/jars/cocoon-ojb-2.1.4.jar +cocoon/jars/cocoon-ojb-2.1.5.1.jar +cocoon/jars/cocoon-ojb-2.1.6.jar +cocoon/jars/cocoon-ojb-2.1.7.jar +cocoon/jars/cocoon-ojb-2.1.8.jar +cocoon/jars/cocoon-ojb-2.1.9.jar +cocoon/jars/cocoon-paranoid-2.1.4.jar +cocoon/jars/cocoon-paranoid-2.1.5.1.jar +cocoon/jars/cocoon-paranoid-2.1.6.jar +cocoon/jars/cocoon-paranoid-2.1.7.jar +cocoon/jars/cocoon-paranoid-2.1.8.jar +cocoon/jars/cocoon-paranoid-2.1.9.jar +cocoon/jars/cocoon-petstore-2.1.3.jar +cocoon/jars/cocoon-petstore-2.1.4.jar +cocoon/jars/cocoon-petstore-2.1.5.1.jar +cocoon/jars/cocoon-portal-2.1.6.jar +cocoon/jars/cocoon-petstore-2.1.6.jar +cocoon/jars/cocoon-petstore-2.1.7.jar +cocoon/jars/cocoon-petstore-2.1.8.jar +cocoon/jars/cocoon-petstore-2.1.9.jar +cocoon/jars/cocoon-php-2.1.3.jar +cocoon/jars/cocoon-php-2.1.4.jar +cocoon/jars/cocoon-php-2.1.5.1.jar +cocoon/jars/cocoon-poi-2.1.3.jar +cocoon/jars/cocoon-poi-2.1.4.jar +cocoon/jars/cocoon-poi-2.1.5.1.jar +cocoon/jars/cocoon-poi-2.1.6.jar +cocoon/jars/cocoon-poi-2.1.7.jar +cocoon/jars/cocoon-poi-2.1.8.jar +cocoon/jars/cocoon-poi-2.1.9.jar +cocoon/jars/cocoon-portal-2.1.3.jar +cocoon/jars/cocoon-portal-2.1.4.jar +cocoon/jars/cocoon-portal-2.1.5.1.jar +cocoon/jars/cocoon-portal-2.1.7.jar +cocoon/jars/cocoon-portal-2.1.8.jar +cocoon/jars/cocoon-portal-2.1.9.jar +cocoon/jars/cocoon-portal-fw-2.1.3.jar +cocoon/jars/cocoon-portal-fw-2.1.4.jar +cocoon/jars/cocoon-portal-fw-2.1.5.1.jar +cocoon/jars/cocoon-precept-2.1.3.jar +cocoon/jars/cocoon-precept-2.1.4.jar +cocoon/jars/cocoon-profiler-2.1.3.jar +cocoon/jars/cocoon-profiler-2.1.4.jar +cocoon/jars/cocoon-profiler-2.1.5.1.jar +cocoon/jars/cocoon-profiler-2.1.6.jar +cocoon/jars/cocoon-profiler-2.1.7.jar +cocoon/jars/cocoon-profiler-2.1.8.jar +cocoon/jars/cocoon-profiler-2.1.9.jar +cocoon/jars/cocoon-proxy-2.1.3.jar +cocoon/jars/cocoon-proxy-2.1.4.jar +cocoon/jars/cocoon-proxy-2.1.5.1.jar +cocoon/jars/cocoon-proxy-2.1.6.jar +cocoon/jars/cocoon-proxy-2.1.7.jar +cocoon/jars/cocoon-proxy-2.1.8.jar +cocoon/jars/cocoon-proxy-2.1.9.jar +cocoon/jars/cocoon-python-2.1.3.jar +cocoon/jars/cocoon-python-2.1.4.jar +cocoon/jars/cocoon-python-2.1.5.1.jar +cocoon/jars/cocoon-python-2.1.6.jar +cocoon/jars/cocoon-python-2.1.7.jar +cocoon/jars/cocoon-python-2.1.8.jar +cocoon/jars/cocoon-python-2.1.9.jar +cocoon/jars/cocoon-qdox-2.1.3.jar +cocoon/jars/cocoon-qdox-2.1.4.jar +cocoon/jars/cocoon-qdox-2.1.5.1.jar +cocoon/jars/cocoon-qdox-2.1.6.jar +cocoon/jars/cocoon-qdox-2.1.7.jar +cocoon/jars/cocoon-qdox-2.1.8.jar +cocoon/jars/cocoon-qdox-2.1.9.jar +cocoon/jars/cocoon-querybean-2.1.7.jar +cocoon/jars/cocoon-querybean-2.1.8.jar +cocoon/jars/cocoon-querybean-2.1.9.jar +cocoon/jars/cocoon-repository-2.1.3.jar +cocoon/jars/cocoon-repository-2.1.4.jar +cocoon/jars/cocoon-repository-2.1.5.1.jar +cocoon/jars/cocoon-repository-2.1.6.jar +cocoon/jars/cocoon-repository-2.1.7.jar +cocoon/jars/cocoon-repository-2.1.8.jar +cocoon/jars/cocoon-repository-2.1.9.jar +cocoon/jars/cocoon-scratchpad-2.1.3.jar +cocoon/jars/cocoon-scratchpad-2.1.4.jar +cocoon/jars/cocoon-scratchpad-2.1.5.1.jar +cocoon/jars/cocoon-scratchpad-2.1.6.jar +cocoon/jars/cocoon-serializers-2.1.9.jar +cocoon/jars/cocoon-serializers-2.1.5.1.jar +cocoon/jars/cocoon-serializers-2.1.6.jar +cocoon/jars/cocoon-serializers-2.1.7.jar +cocoon/jars/cocoon-serializers-2.1.8.jar +cocoon/jars/cocoon-session-fw-2.1.3.jar +cocoon/jars/cocoon-session-fw-2.1.4.jar +cocoon/jars/cocoon-session-fw-2.1.5.1.jar +cocoon/jars/cocoon-session-fw-2.1.6.jar +cocoon/jars/cocoon-session-fw-2.1.7.jar +cocoon/jars/cocoon-session-fw-2.1.8.jar +cocoon/jars/cocoon-session-fw-2.1.9.jar +cocoon/jars/cocoon-slide-2.1.3.jar +cocoon/jars/cocoon-slide-2.1.4.jar +cocoon/jars/cocoon-slide-2.1.5.1.jar +cocoon/jars/cocoon-slide-2.1.6.jar +cocoon/jars/cocoon-slide-2.1.7.jar +cocoon/jars/cocoon-slide-2.1.8.jar +cocoon/jars/cocoon-slide-2.1.9.jar +cocoon/jars/cocoon-slop-2.1.3.jar +cocoon/jars/cocoon-slop-2.1.4.jar +cocoon/jars/cocoon-slop-2.1.5.1.jar +cocoon/jars/cocoon-slop-2.1.6.jar +cocoon/jars/cocoon-slop-2.1.7.jar +cocoon/jars/cocoon-slop-2.1.8.jar +cocoon/jars/cocoon-slop-2.1.9.jar +cocoon/jars/cocoon-snapshot.version +cocoon/jars/cocoon-stx-2.1.3.jar +cocoon/jars/cocoon-stx-2.1.4.jar +cocoon/jars/cocoon-stx-2.1.5.1.jar +cocoon/jars/cocoon-stx-2.1.6.jar +cocoon/jars/cocoon-stx-2.1.7.jar +cocoon/jars/cocoon-stx-2.1.8.jar +cocoon/jars/cocoon-stx-2.1.9.jar +cocoon/jars/cocoon-swf-2.1.3.jar +cocoon/jars/cocoon-swf-2.1.4.jar +cocoon/jars/cocoon-swf-2.1.5.1.jar +cocoon/jars/cocoon-taglib-2.1.3.jar +cocoon/jars/cocoon-taglib-2.1.4.jar +cocoon/jars/cocoon-taglib-2.1.5.1.jar +cocoon/jars/cocoon-testcase-2.1.3.jar +cocoon/jars/cocoon-taglib-2.1.6.jar +cocoon/jars/cocoon-taglib-2.1.7.jar +cocoon/jars/cocoon-taglib-2.1.8.jar +cocoon/jars/cocoon-taglib-2.1.9.jar +cocoon/jars/cocoon-template-2.1.9.jar +cocoon/jars/cocoon-woody-2.1.3.jar +cocoon/jars/cocoon-testcase-2.1.4.jar +cocoon/jars/cocoon-testcase-2.1.6.jar +cocoon/jars/cocoon-testcase-2.1.7.jar +cocoon/jars/cocoon-testcase-2.1.9.jar +cocoon/jars/cocoon-tour-2.1.5.1.jar +cocoon/jars/cocoon-tour-2.1.6.jar +cocoon/jars/cocoon-tour-2.1.7.jar +cocoon/jars/cocoon-tour-2.1.8.jar +cocoon/jars/cocoon-tour-2.1.9.jar +cocoon/jars/cocoon-validation-2.1.8.jar +cocoon/jars/cocoon-validation-2.1.9.jar +cocoon/jars/cocoon-velocity-2.1.3.jar +cocoon/jars/cocoon-velocity-2.1.4.jar +cocoon/jars/cocoon-velocity-2.1.5.1.jar +cocoon/jars/cocoon-velocity-2.1.6.jar +cocoon/jars/cocoon-velocity-2.1.7.jar +cocoon/jars/cocoon-velocity-2.1.8.jar +cocoon/jars/cocoon-velocity-2.1.9.jar +cocoon/jars/cocoon-web3-2.1.3.jar +cocoon/jars/cocoon-web3-2.1.4.jar +cocoon/jars/cocoon-web3-2.1.5.1.jar +cocoon/jars/cocoon-web3-2.1.6.jar +cocoon/jars/cocoon-web3-2.1.7.jar +cocoon/jars/cocoon-web3-2.1.8.jar +cocoon/jars/cocoon-web3-2.1.9.jar +cocoon/jars/cocoon-webdav-2.1.3.jar +cocoon/jars/cocoon-webdav-2.1.4.jar +cocoon/jars/cocoon-webdav-2.1.6.jar +cocoon/jars/cocoon-webdav-2.1.5.1.jar +cocoon/jars/cocoon-webdav-2.1.7.jar +cocoon/jars/cocoon-webdav-2.1.8.jar +cocoon/jars/cocoon-webdav-2.1.9.jar +cocoon/jars/cocoon-woody-2.1.4.jar +cocoon/jars/cocoon-xmldb-2.1.3.jar +cocoon/jars/cocoon-xmldb-2.1.4.jar +cocoon/jars/cocoon-xmldb-2.1.5.1.jar +cocoon/jars/cocoon-xmldb-2.1.6.jar +cocoon/jars/cocoon-xmldb-2.1.7.jar +cocoon/jars/cocoon-xmldb-2.1.8.jar +cocoon/jars/cocoon-xmldb-2.1.9.jar +cocoon/jars/cocoon-xsltal-2.1.8.jar +cocoon/jars/cocoon-xsltal-2.1.9.jar +cocoon/jars/cocoon-xsp-2.1.5.1.jar +cocoon/jars/cocoon-xsp-2.1.6.jar +cocoon/jars/cocoon-xsp-2.1.7.jar +cocoon/jars/cocoon-xsp-2.1.8.jar +cocoon/jars/cocoon-xsp-2.1.9.jar +cocoon/wars/cocoon-2.1.8.war +cocoon/wars/cocoon-war-2.1.3.war +cocoon/wars/cocoon-war-2.1.4.war +cocoon/wars/cocoon-war-2.1.6.war +cocoon/wars/cocoon-war-2.1.7.war +commons-attributes/jars/commons-attributes-2.1-javadoc.jar +commons-attributes/jars/commons-attributes-api-2.1.jar +commons-attributes/jars/commons-attributes-api-2.2.jar +commons-attributes/jars/commons-attributes-compiler-2.1.jar +commons-attributes/jars/commons-attributes-compiler-2.2.jar +commons-attributes/plugins/commons-attributes-plugin-2.1.jar +commons-attributes/plugins/commons-attributes-plugin-2.2.jar +commons-attributes/poms/commons-attributes-api-2.2.pom +commons-attributes/poms/commons-attributes-compiler-2.2.pom +commons-beanutils/jars/commons-beanutils-1.0-dev.20020812.082103.jar +commons-beanutils/jars/commons-beanutils-1.0-dev.20020913.114846.jar +commons-beanutils/jars/commons-beanutils-1.0.jar +commons-beanutils/jars/commons-beanutils-1.3.jar +commons-beanutils/jars/commons-beanutils-1.4-dev.20020812.084325.jar +commons-beanutils/jars/commons-beanutils-1.4-dev.jar +commons-beanutils/jars/commons-beanutils-1.4.1.jar +commons-beanutils/jars/commons-beanutils-1.4.jar +commons-beanutils/jars/commons-beanutils-1.5-javadoc.jar +commons-beanutils/jars/commons-beanutils-1.5.jar +commons-beanutils/jars/commons-beanutils-1.6-dev.20021128.082114.jar +commons-beanutils/jars/commons-beanutils-1.6-javadoc.jar +commons-beanutils/jars/commons-beanutils-1.6.1-javadoc.jar +commons-beanutils/jars/commons-beanutils-1.6.1.jar +commons-beanutils/jars/commons-beanutils-1.6.jar +commons-beanutils/jars/commons-beanutils-1.7-dev.jar +commons-beanutils/jars/commons-beanutils-1.7.0-javadoc.jar +commons-beanutils/jars/commons-beanutils-1.7.0.jar +commons-beanutils/jars/commons-beanutils-20020520.jar +commons-beanutils/jars/commons-beanutils-20030211.134440.jar +commons-beanutils/jars/commons-beanutils-bean-collections-1.7.0.jar +commons-beanutils/jars/commons-beanutils-core-1.7.0.jar +commons-beanutils/jars/commons-beanutils-dev.jar +commons-beanutils/jars/commons-beanutils-1.8.0-BETA-javadoc.jar +commons-beanutils/jars/commons-beanutils-snapshot-version +commons-beanutils/jars/commons-beanutils-1.8.0-BETA.jar +commons-beanutils/jars/commons-beanutils-1.8.0-BETA-sources.jar +commons-beanutils/jars/commons-beanutils-core-1.8.0-BETA.jar +commons-beanutils/jars/commons-beanutils-bean-collections-1.8.0-BETA.jar +commons-beanutils/poms/commons-beanutils-1.4.1.pom +commons-beanutils/poms/commons-beanutils-1.4.pom +commons-beanutils/poms/commons-beanutils-1.5.pom +commons-beanutils/poms/commons-beanutils-1.6.1.pom +commons-beanutils/poms/commons-beanutils-1.6.pom +commons-beanutils/poms/commons-beanutils-1.8.0-BETA.pom +commons-betwixt/jars/commons-betwixt-0.5-javadoc.jar +commons-betwixt/jars/commons-betwixt-0.5.jar +commons-betwixt/jars/commons-betwixt-0.6-javadoc.jar +commons-betwixt/jars/commons-betwixt-1.0-alpha-1-javadoc.jar +commons-betwixt/jars/commons-betwixt-0.6.jar +commons-betwixt/jars/commons-betwixt-0.7-javadoc.jar +commons-betwixt/jars/commons-betwixt-0.7.jar +commons-betwixt/jars/commons-betwixt-1.0-beta-1.20020910.124754.jar +commons-betwixt/jars/commons-betwixt-1.0-alpha-1.jar +commons-betwixt/jars/commons-betwixt-0.8.jar.sha +commons-betwixt/jars/commons-betwixt-0.8.jar +commons-betwixt/jars/commons-betwixt-1.0-beta-1.jar +commons-betwixt/jars/commons-betwixt-1.0-beta-1.20020912.014405.jar +commons-betwixt/jars/commons-betwixt-1.0-beta-1.20020920.020057.jar +commons-betwixt/jars/commons-betwixt-1.0-beta-1.20030111.103454.jar +commons-betwixt/jars/commons-betwixt-1.0-dev.20020712.083337.jar +commons-betwixt/jars/commons-betwixt-1.0-dev.20020719.010630.jar +commons-betwixt/jars/commons-betwixt-1.0-dev.jar +commons-betwixt/jars/commons-betwixt-20030211.133854.jar +commons-betwixt/jars/commons-betwixt-snapshot-version +commons-betwixt/poms/commons-betwixt-0.8.pom +commons-betwixt/poms/commons-betwixt-0.6.pom +commons-betwixt/poms/commons-betwixt-0.7.pom +commons-chain/jars/commons-chain-1.0-javadoc.jar +commons-chain/jars/commons-chain-1.0.jar +commons-chain/jars/commons-chain-1.1.jar +commons-chain/poms/commons-chain-1.0.pom +commons-chain/poms/commons-chain-1.1.pom +commons-cli/jars/commons-cli-1.0-beta-1.jar +commons-cli/jars/commons-cli-1.0-beta-2-dev.20021004.111657.jar +commons-cli/jars/commons-cli-1.0-beta-2-dev.jar +commons-cli/jars/commons-cli-1.0-beta-2.jar +commons-cli/jars/commons-cli-1.0-dev.jar +commons-cli/jars/commons-cli-1.0-dev.20020710.025055.jar +commons-cli/jars/commons-cli-1.0-dev.20020727.104720.jar +commons-cli/jars/commons-cli-1.0-javadoc.jar +commons-cli/jars/commons-cli-1.0.jar +commons-cli/jars/commons-cli-1.1-javadoc.jar +commons-cli/jars/commons-cli-1.0.jar.sha +commons-cli/jars/commons-cli-1.1-sources.jar +commons-cli/jars/commons-cli-1.1.jar +commons-cli/poms/commons-cli-1.0.pom +commons-cli/poms/commons-cli-1.1.pom +commons-codec/jars/commons-codec-1.0-dev.jar +commons-codec/jars/commons-codec-1.1-javadoc.jar +commons-codec/jars/commons-codec-1.1.jar +commons-codec/jars/commons-codec-1.2-javadoc.jar +commons-codec/jars/commons-codec-1.2.jar +commons-codec/jars/commons-codec-1.3-javadoc.jar +commons-codec/jars/commons-codec-1.3.jar +commons-codec/jars/commons-codec-20041127.091804.jar +commons-codec/jars/commons-codec-snapshot-version +commons-codec/poms/commons-codec-1.1.pom +commons-codec/poms/commons-codec-1.2.pom +commons-codec/poms/commons-codec-1.3.pom +commons-codec/poms/commons-codec-20041127.091804.pom +commons-codec/poms/commons-codec-snapshot-version +commons-collections/jars/commons-collections-1.0-javadoc.jar +commons-collections/jars/commons-collections-1.0.jar +commons-collections/jars/commons-collections-2.0-javadoc.jar +commons-collections/jars/commons-collections-2.0.20020914.015953.jar +commons-collections/jars/commons-collections-3.1.jar +commons-collections/jars/commons-collections-snapshot-version +commons-collections/jars/commons-collections-2.0.20020914.020746.jar +commons-collections/jars/commons-collections-2.0.20020914.020858.jar +commons-collections/jars/commons-collections-2.0.jar +commons-collections/jars/commons-collections-2.1-dev.jar +commons-collections/jars/commons-collections-2.1-javadoc.jar +commons-collections/jars/commons-collections-2.1.jar +commons-collections/jars/commons-collections-2.1.1-javadoc.jar +commons-collections/jars/commons-collections-2.1.1.jar +commons-collections/jars/commons-collections-20030418.083655.jar +commons-collections/jars/commons-collections-20031027.000000.jar +commons-collections/jars/commons-collections-3.0-dev.jar +commons-collections/jars/commons-collections-20040102.233541.jar +commons-collections/jars/commons-collections-20040616.jar +commons-collections/jars/commons-collections-3.0-javadoc.jar +commons-collections/jars/commons-collections-3.0.jar +commons-collections/jars/commons-collections-3.1-javadoc.jar +commons-collections/jars/commons-collections-3.2.jar +commons-collections/jars/commons-collections-testframework-20031027.000000.jar +commons-collections/jars/commons-collections-testframework-20040102.233541.jar +commons-collections/jars/commons-collections-testframework-3.1.jar +commons-collections/jars/commons-collections-testframework-3.2.jar +commons-collections/poms/commons-collections-2.1.pom +commons-collections/poms/commons-collections-3.0.pom +commons-collections/poms/commons-collections-3.2.pom +commons-configuration/jars/commons-configuration-1.0-dev-2.20021231.045254.jar +commons-configuration/jars/commons-configuration-1.0-dev-3.20030603.101200.jar +commons-configuration/jars/commons-configuration-1.0-dev-3.20030607.194155.jar +commons-configuration/jars/commons-configuration-1.4-javadoc.jar +commons-configuration/jars/commons-configuration-1.0-dev.jar +commons-configuration/jars/commons-configuration-1.0-javadoc.jar +commons-configuration/jars/commons-configuration-1.0-rc1.jar +commons-configuration/jars/commons-configuration-1.0-rc2.jar +commons-configuration/jars/commons-configuration-1.0.jar +commons-configuration/jars/commons-configuration-1.1-javadoc.jar +commons-configuration/jars/commons-configuration-1.1.jar +commons-configuration/jars/commons-configuration-1.2.jar +commons-configuration/jars/commons-configuration-20030311.152757.jar +commons-configuration/jars/commons-configuration-20030620.073343.jar +commons-configuration/jars/commons-configuration-20030706.202021.jar +commons-configuration/jars/commons-configuration-20041012.002623.jar +commons-configuration/jars/commons-configuration-20041012.002804.jar +commons-configuration/jars/commons-configuration-snapshot-version +commons-configuration/jars/commons-configuration-1.4-sources.jar +commons-configuration/jars/commons-configuration-1.4.jar +commons-configuration/poms/commons-configuration-20041012.002623.pom +commons-configuration/poms/commons-configuration-1.0-rc1.pom +commons-configuration/poms/commons-configuration-1.0.pom +commons-configuration/poms/commons-configuration-1.1.pom +commons-configuration/poms/commons-configuration-1.2.pom +commons-configuration/poms/commons-configuration-20041012.002804.pom +commons-configuration/poms/commons-configuration-snapshot-version +commons-configuration/poms/commons-configuration-1.4.pom +commons-daemon/jars/commons-daemon-1.0-dev.20021002.084851.jar +commons-dbcp/jars/commons-dbcp-1.0-dev-20020806.jar +commons-dbcp/jars/commons-dbcp-1.0-dev.jar +commons-dbcp/jars/commons-dbcp-1.0-javadoc.jar +commons-dbcp/jars/commons-dbcp-1.0.jar +commons-dbcp/jars/commons-dbcp-1.1-RC1.jar +commons-dbcp/jars/commons-dbcp-1.1-RC2.jar +commons-dbcp/jars/commons-dbcp-1.1-dev.20021231.054941.jar +commons-dbcp/jars/commons-dbcp-1.1-dev.20021231.055112.jar +commons-dbcp/jars/commons-dbcp-1.1-javadoc.jar +commons-dbcp/jars/commons-dbcp-1.1.jar +commons-dbcp/jars/commons-dbcp-1.2-javadoc.jar +commons-dbcp/jars/commons-dbcp-1.2.1-javadoc.jar +commons-dbcp/jars/commons-dbcp-1.2.1.jar +commons-dbcp/jars/commons-dbcp-1.2.jar +commons-dbcp/jars/commons-dbcp-20030818.201141.jar +commons-dbcp/jars/commons-dbcp-20030821.193421.jar +commons-dbcp/jars/commons-dbcp-20030825.184428.jar +commons-dbcp/jars/commons-dbcp-snapshot-version +commons-dbcp/jars/commons-dbcp-1.2.2.jar +commons-dbcp/poms/commons-dbcp-1.0.pom +commons-dbcp/poms/commons-dbcp-1.1.pom +commons-dbcp/poms/commons-dbcp-1.2.1.pom +commons-dbcp/poms/commons-dbcp-1.2.pom +commons-dbcp/poms/commons-dbcp-1.2.2.pom +commons-dbutils/jars/commons-dbutils-1.0-javadoc.jar +commons-dbutils/jars/commons-dbutils-1.0.jar +commons-dbutils/jars/commons-dbutils-1.1.jar +commons-dbutils/jars/commons-dbutils-1.1-sources.jar +commons-dbutils/poms/commons-dbutils-1.0.pom +commons-dbutils/poms/commons-dbutils-1.1.pom +commons-digester/jars/commons-digester-1.0-dev.20020731.104901.jar +commons-digester/jars/commons-digester-1.2.jar +commons-digester/jars/commons-digester-1.3.jar +commons-digester/jars/commons-digester-1.4-javadoc.jar +commons-digester/jars/commons-digester-1.4.1-javadoc.jar +commons-digester/jars/commons-digester-1.4.1.jar +commons-digester/jars/commons-digester-1.5-javadoc.jar +commons-digester/jars/commons-digester-1.5.jar +commons-digester/jars/commons-digester-1.6-javadoc.jar +commons-digester/jars/commons-digester-1.6.jar +commons-digester/jars/commons-digester-1.7-javadoc.jar +commons-digester/jars/commons-digester-1.7.jar +commons-digester/jars/commons-digester-1.8.jar +commons-digester/jars/commons-digester-1.8-javadoc.jar +commons-digester/jars/commons-digester-1.8-sources.jar +commons-digester/poms/commons-digester-1.3.pom +commons-digester/poms/commons-digester-1.4.1.pom +commons-digester/poms/commons-digester-1.5.pom +commons-digester/poms/commons-digester-1.7.pom +commons-digester/poms/commons-digester-1.8.pom +commons-digester/distributions/commons-digester-1.8-src.zip +commons-digester/distributions/commons-digester-1.8-src.tar.gz +commons-digester/distributions/commons-digester-1.8.tar.gz +commons-digester/distributions/commons-digester-1.8.zip +commons-discovery/jars/commons-discovery-0.1-javadoc.jar +commons-discovery/jars/commons-discovery-0.1.jar +commons-discovery/jars/commons-discovery-0.2-javadoc.jar +commons-discovery/jars/commons-discovery-0.2-dev.jar +commons-discovery/jars/commons-discovery-0.2.jar +commons-discovery/jars/commons-discovery-1.0-dev.20021010.101254.jar +commons-discovery/jars/commons-discovery-20030211.213356.jar +commons-discovery/jars/commons-discovery-20040218.194635.jar +commons-discovery/jars/commons-discovery-snapshot-version +commons-discovery/jars/commons-discovery-0.4.jar +commons-discovery/poms/commons-discovery-0.1.pom +commons-discovery/poms/commons-discovery-0.2.pom +commons-discovery/poms/commons-discovery-0.4.pom +commons-el/jars/commons-el-1.0-javadoc.jar +commons-el/jars/commons-el-1.0.jar +commons-el/poms/commons-el-1.0.pom +commons-email/distributions/commons-email-1.0-src.tar.gz +commons-email/distributions/commons-email-1.0-src.zip +commons-email/distributions/commons-email-1.0.tar.gz +commons-email/distributions/commons-email-1.0.zip +commons-email/jars/commons-email-0.1-dev.jar +commons-email/jars/commons-email-1.0-javadoc.jar +commons-email/jars/commons-email-1.0.jar +commons-email/jars/commons-email-20030310.165926.jar +commons-email/jars/commons-email-snapshot-version +commons-email/poms/commons-email-1.0.pom +commons-fileupload/jars/commons-fileupload-1.0-beta-1-javadoc.jar +commons-fileupload/jars/commons-fileupload-1.0-beta-1.jar +commons-fileupload/jars/commons-fileupload-1.0-dev.jar +commons-fileupload/jars/commons-fileupload-1.0-javadoc.jar +commons-fileupload/jars/commons-fileupload-1.0-rc1-javadoc.jar +commons-fileupload/jars/commons-fileupload-1.0-rc1.jar +commons-fileupload/jars/commons-fileupload-1.0.jar +commons-fileupload/jars/commons-fileupload-1.1.1.jar +commons-fileupload/jars/commons-fileupload-1.1.jar +commons-fileupload/poms/commons-fileupload-1.0.pom +commons-fileupload/poms/commons-fileupload-1.1.1.pom +commons-fileupload/poms/commons-fileupload-1.1.pom +ecs/jars/ecs-1.4.1.jar +ecs/jars/ecs-1.4.2.jar +commons-grant/jars/commons-grant-1.0-b1.jar +commons-grant/jars/commons-grant-1.0-beta-2.jar +commons-grant/jars/commons-grant-1.0-beta-3.jar +commons-grant/jars/commons-grant-1.0-beta-4.jar +commons-grant/jars/commons-grant-1.0-beta-5.jar +commons-graph/jars/commons-graph-0.8.1.jar +commons-graph/jars/commons-graph-0.8.jar +commons-http/jars/commons-http-1.1.jar +commons-httpclient/jars/commons-httpclient-1.0.jar +commons-httpclient/jars/commons-httpclient-2.0-alpha1-javadoc.jar +commons-httpclient/jars/commons-httpclient-2.0-alpha2-javadoc.jar +commons-httpclient/jars/commons-httpclient-2.0.jar +commons-httpclient/jars/commons-httpclient-3.0.jar +commons-httpclient/jars/commons-httpclient-2.0-alpha2.20020903.070259.jar +commons-httpclient/jars/commons-httpclient-2.0-alpha2.20021115.044352.jar +commons-httpclient/jars/commons-httpclient-2.0-alpha2.jar +commons-httpclient/jars/commons-httpclient-2.0-alpha3-javadoc.jar +commons-httpclient/jars/commons-httpclient-2.0-alpha3.jar +commons-httpclient/jars/commons-httpclient-2.0-beta1-javadoc.jar +commons-httpclient/jars/commons-httpclient-2.0-beta1.jar +commons-httpclient/jars/commons-httpclient-2.0-beta2-javadoc.jar +commons-httpclient/jars/commons-httpclient-2.0-beta2.jar +commons-httpclient/jars/commons-httpclient-2.0-dev.20020705.071400.jar +commons-httpclient/jars/commons-httpclient-2.0-dev.jar +commons-httpclient/jars/commons-httpclient-2.0-javadoc.jar +commons-httpclient/jars/commons-httpclient-2.0-rc1-javadoc.jar +commons-httpclient/jars/commons-httpclient-2.0-rc1.jar +commons-httpclient/jars/commons-httpclient-2.0-rc2-javadoc.jar +commons-httpclient/jars/commons-httpclient-2.0-rc2.jar +commons-httpclient/jars/commons-httpclient-2.0-rc3-javadoc.jar +commons-httpclient/jars/commons-httpclient-2.0-rc3.jar +commons-httpclient/jars/commons-httpclient-2.0.1-javadoc.jar +commons-httpclient/jars/commons-httpclient-2.0.1.jar +commons-httpclient/jars/commons-httpclient-2.0.2-javadoc.jar +commons-httpclient/jars/commons-httpclient-2.0.2.jar +commons-httpclient/jars/commons-httpclient-2.0alpha1-20020606.jar +commons-httpclient/jars/commons-httpclient-2.0alpha1-20020829.jar +commons-httpclient/jars/commons-httpclient-2.0alpha1.jar +commons-httpclient/jars/commons-httpclient-20020423.jar +commons-httpclient/jars/commons-httpclient-3.0-alpha1-javadoc.jar +commons-httpclient/jars/commons-httpclient-3.0-beta1.jar +commons-httpclient/jars/commons-httpclient-3.1.jar +commons-httpclient/jars/commons-httpclient-3.0-alpha1.jar +commons-httpclient/jars/commons-httpclient-3.0-alpha2-javadoc.jar +commons-httpclient/jars/commons-httpclient-3.0-alpha2.jar +commons-httpclient/jars/commons-httpclient-3.0-beta1-javadoc.jar +commons-httpclient/jars/commons-httpclient-3.0-rc1-javadoc.jar +commons-httpclient/jars/commons-httpclient-3.0-rc1.jar +commons-httpclient/jars/commons-httpclient-3.0-rc2-javadoc.jar +commons-httpclient/jars/commons-httpclient-3.0-rc2.jar +commons-httpclient/jars/commons-httpclient-3.0-rc3-javadoc.jar +commons-httpclient/jars/commons-httpclient-3.0-rc3.jar +commons-httpclient/jars/commons-httpclient-3.0-rc4-javadoc.jar +commons-httpclient/jars/commons-httpclient-3.0-rc4.jar +commons-httpclient/jars/commons-httpclient-3.0.1.jar +commons-httpclient/jars/commons-httpclient-3.1-alpha1.jar +commons-httpclient/jars/commons-httpclient-3.1-beta1.jar +commons-httpclient/jars/commons-httpclient-3.1-rc1.jar +commons-httpclient/poms/commons-httpclient-3.0alpha2.pom +commons-httpclient/poms/commons-httpclient-2.0.2.pom +commons-httpclient/poms/commons-httpclient-3.0.1.pom +commons-httpclient/poms/commons-httpclient-3.0.pom +commons-httpclient/poms/commons-httpclient-3.1-alpha1.pom +commons-httpclient/poms/commons-httpclient-3.0beta1.pom +commons-httpclient/poms/commons-httpclient-3.0rc1.pom +commons-httpclient/poms/commons-httpclient-3.0rc2.pom +commons-httpclient/poms/commons-httpclient-3.0rc3.pom +commons-httpclient/poms/commons-httpclient-3.0rc4.pom +commons-httpclient/poms/commons-httpclient-3.1-beta1.pom +commons-httpclient/poms/commons-httpclient-3.1-rc1.pom +commons-httpclient/poms/commons-httpclient-3.1.pom +commons-i18n/distributions/commons-i18n-0.3-src.tar.gz +commons-i18n/distributions/commons-i18n-0.3-src.zip +commons-i18n/distributions/commons-i18n-0.3.tar.gz +commons-i18n/distributions/commons-i18n-0.3.zip +commons-i18n/distributions/commons-i18n-0.4-src.tar.gz +commons-i18n/distributions/commons-i18n-0.4-src.zip +commons-i18n/distributions/commons-i18n-0.4.tar.gz +commons-i18n/distributions/commons-i18n-0.4.zip +commons-i18n/distributions/commons-i18n-0.5-src.tar.gz +commons-i18n/distributions/commons-i18n-0.5-src.zip +commons-i18n/distributions/commons-i18n-0.5.tar.gz +commons-i18n/distributions/commons-i18n-0.5.zip +commons-i18n/jars/commons-i18n-0.4.jar +commons-i18n/jars/commons-i18n-0.5.jar +commons-i18n/poms/commons-i18n-0.3.pom +commons-i18n/poms/commons-i18n-0.4.pom +commons-i18n/poms/commons-i18n-0.5.pom +commons-io/jars/commons-io-0.1.jar +commons-io/jars/commons-io-0.2-dev.20020614.122300.jar +commons-io/jars/commons-io-0.2-dev.20020717.100545.jar +commons-io/jars/commons-io-1.0-javadoc.jar +commons-io/jars/commons-io-1.0.jar +commons-io/jars/commons-io-1.3.jar +commons-io/jars/commons-io-1.1-javadoc.jar +commons-io/jars/commons-io-1.1.jar +commons-io/jars/commons-io-1.2-javadoc.jar +commons-io/jars/commons-io-1.2.jar +commons-io/jars/commons-io-20030203.000550.jar +commons-io/jars/commons-io-1.3-javadoc.jar +commons-io/jars/commons-io-1.3-sources.jar +commons-io/jars/commons-io-1.3.1-javadoc.jar +commons-io/jars/commons-io-1.3.1.jar +commons-io/jars/commons-io-1.3.1-sources.jar +commons-io/poms/commons-io-1.0.pom +commons-io/poms/commons-io-1.1.pom +commons-io/poms/commons-io-1.2.pom +commons-io/poms/commons-io-1.3.pom +commons-io/poms/commons-io-1.3.1.pom +commons-jdbc2pool/jars/commons-jdbc2pool-1.0-dev.jar +commons-jelly/distributions/KEYS +commons-jelly/distributions/commons-jelly-1.0-beta-3-src.tar.gz +commons-jelly/distributions/commons-jelly-1.0-beta-3-src.zip +commons-jelly/distributions/commons-jelly-1.0-beta-3.tar.gz +commons-jelly/distributions/commons-jelly-1.0-beta-3.zip +commons-jelly/distributions/commons-jelly-1.0-beta-4-src.tar.gz +commons-jelly/distributions/commons-jelly-1.0-beta-4-src.zip +commons-jelly/distributions/commons-jelly-1.0-beta-4.tar.gz +commons-jelly/distributions/commons-jelly-1.0-beta-4.zip +commons-jelly/distributions/commons-jelly-1.0-dev-src.tar.gz +commons-jelly/distributions/commons-jelly-1.0-dev-src.zip +commons-jelly/distributions/commons-jelly-1.0-dev.tar.gz +commons-jelly/distributions/commons-jelly-1.0-dev.zip +commons-jelly/jars/commons-jelly-1.0-RC1-javadoc.jar +commons-jelly/jars/commons-jelly-1.0-RC1.jar +commons-jelly/jars/commons-jelly-1.0-beta-1.jar +commons-jelly/jars/commons-jelly-1.0-beta-2.jar +commons-jelly/jars/commons-jelly-1.0-dev.20020714.020704.jar +commons-jelly/jars/commons-jelly-1.0-beta-3.20020819.043231.jar +commons-jelly/jars/commons-jelly-1.0-beta-3.20020819.043406.jar +commons-jelly/jars/commons-jelly-1.0-beta-3.20020820.043616.jar +commons-jelly/jars/commons-jelly-1.0-beta-3.20020828.023547.jar +commons-jelly/jars/commons-jelly-1.0-beta-3.20020828.032644.jar +commons-jelly/jars/commons-jelly-1.0-beta-3.20020904.063114.jar +commons-jelly/jars/commons-jelly-1.0-beta-3.20020910.061420.jar +commons-jelly/jars/commons-jelly-1.0-beta-3.20020911.045717.jar +commons-jelly/jars/commons-jelly-1.0-beta-3.jar +commons-jelly/jars/commons-jelly-1.0-beta-3.20020913.010946.jar +commons-jelly/jars/commons-jelly-1.0-beta-3.20020913.120853.jar +commons-jelly/jars/commons-jelly-1.0-beta-4-javadoc.jar +commons-jelly/jars/commons-jelly-1.0-beta-4.20020923.123659.jar +commons-jelly/jars/commons-jelly-1.0-beta-4.20020924.123511.jar +commons-jelly/jars/commons-jelly-1.0-beta-4.20021002.050543.jar +commons-jelly/jars/commons-jelly-1.0-beta-4.20021002.113628.jar +commons-jelly/jars/commons-jelly-1.0-beta-4.20021005.025546.jar +commons-jelly/jars/commons-jelly-1.0-beta-4.20021005.070650.jar +commons-jelly/jars/commons-jelly-1.0-beta-4.20021008.094131.jar +commons-jelly/jars/commons-jelly-1.0-beta-4.20021008.112820.jar +commons-jelly/jars/commons-jelly-1.0-beta-4.20021012.035615.jar +commons-jelly/jars/commons-jelly-1.0-beta-4.jar +commons-jelly/jars/commons-jelly-1.0-beta-4.20021017.053011.jar +commons-jelly/jars/commons-jelly-1.0-beta-4.20021023.094006.jar +commons-jelly/jars/commons-jelly-1.0-beta-4.20021023.153932.jar +commons-jelly/jars/commons-jelly-1.0-beta-4.20021105.013628.jar +commons-jelly/jars/commons-jelly-1.0-beta-4.20021112.084337.jar +commons-jelly/jars/commons-jelly-1.0-beta-4.20021113.125954.jar +commons-jelly/jars/commons-jelly-1.0-beta-4.20021113.192421.jar +commons-jelly/jars/commons-jelly-1.0-beta-4.20021120.034859.jar +commons-jelly/jars/commons-jelly-1.0-javadoc.jar +commons-jelly/jars/commons-jelly-1.0-beta-4.20021210.123241.jar +commons-jelly/jars/commons-jelly-1.0-beta-4.20021222.042553.jar +commons-jelly/jars/commons-jelly-1.0-beta-4.20021231.013337.jar +commons-jelly/jars/commons-jelly-1.0-beta-4.20021231.034645.jar +commons-jelly/jars/commons-jelly-20030211.141339.jar +commons-jelly/jars/commons-jelly-1.0-beta-4.20030104.110205.jar +commons-jelly/jars/commons-jelly-1.0-dev.20020711.024953.jar +commons-jelly/jars/commons-jelly-1.0-dev.20020713.015328.jar +commons-jelly/jars/commons-jelly-1.0-dev.20020713.020804.jar +commons-jelly/jars/commons-jelly-1.0.jar +commons-jelly/jars/commons-jelly-1.0-dev.20020715.041648.jar +commons-jelly/jars/commons-jelly-1.0-dev.20020715.044906.jar +commons-jelly/jars/commons-jelly-1.0-dev.20020715.045302.jar +commons-jelly/jars/commons-jelly-1.0-dev.20020715.100851.jar +commons-jelly/jars/commons-jelly-1.0-dev.20020715.112252.jar +commons-jelly/jars/commons-jelly-1.0-dev.20020716.055015.jar +commons-jelly/jars/commons-jelly-1.0-dev.20020716.064746.jar +commons-jelly/jars/commons-jelly-1.0-dev.20020716.065225.jar +commons-jelly/jars/commons-jelly-1.0-dev.20020719.074608.jar +commons-jelly/jars/commons-jelly-1.0-dev.20020719.082922.jar +commons-jelly/jars/commons-jelly-1.0-dev.20020720.080105.jar +commons-jelly/jars/commons-jelly-1.0-dev.20020731.041103.jar +commons-jelly/jars/commons-jelly-1.0-dev.20020731.122236.jar +commons-jelly/jars/commons-jelly-1.0-dev.20020811.014845.jar +commons-jelly/jars/commons-jelly-1.0-dev.20021021.132700.jar +commons-jelly/jars/commons-jelly-20030303.054314.jar +commons-jelly/jars/commons-jelly-20030310.073407.jar +commons-jelly/jars/commons-jelly-snapshot-version +commons-jelly/jars/commons-jelly-20030303.180550.jar +commons-jelly/jars/commons-jelly-20030305.075341.jar +commons-jelly/jars/commons-jelly-20030307.121112.jar +commons-jelly/jars/commons-jelly-20030307.135732.jar +commons-jelly/jars/commons-jelly-20030308.101032.jar +commons-jelly/jars/commons-jelly-20030320.080622.jar +commons-jelly/jars/commons-jelly-20030320.080836.jar +commons-jelly/jars/commons-jelly-20030320.165458.jar +commons-jelly/jars/commons-jelly-20030522.212428.jar +commons-jelly/jars/commons-jelly-20030609.133047.jar +commons-jelly/jars/commons-jelly-20030711.034327.jar +commons-jelly/jars/commons-jelly-avalon-20030211.143621.jar +commons-jelly/jars/commons-jelly-20030724.033229.jar +commons-jelly/jars/commons-jelly-20030902.160215.jar +commons-jelly/jars/commons-jelly-20040902.064518.jar +commons-jelly/jars/commons-jelly-20040902.070806.jar +commons-jelly/jars/commons-jelly-avalon-snapshot-version +commons-jelly/jars/commons-jelly-tags-ant-1.0.jar +commons-jelly/jars/commons-jelly-tags-ant-1.1.jar +commons-jelly/jars/commons-jelly-tags-ant-20030211.142045.jar +commons-jelly/jars/commons-jelly-tags-ant-20040902.000000.jar +commons-jelly/jars/commons-jelly-tags-bean-1.0.jar +commons-jelly/jars/commons-jelly-tags-ant-20030310.080026.jar +commons-jelly/jars/commons-jelly-tags-ant-20030625.025346.jar +commons-jelly/jars/commons-jelly-tags-ant-20030625.025706.jar +commons-jelly/jars/commons-jelly-tags-ant-20030625.032346.jar +commons-jelly/jars/commons-jelly-tags-dynabean-snapshot-version +commons-jelly/jars/commons-jelly-tags-ant-20040902.071105.jar +commons-jelly/jars/commons-jelly-tags-ant-snapshot-version +commons-jelly/jars/commons-jelly-tags-antlr-1.0.jar +commons-jelly/jars/commons-jelly-tags-antlr-20030211.143720.jar +commons-jelly/jars/commons-jelly-tags-antlr-20040902.071159.jar +commons-jelly/jars/commons-jelly-tags-antlr-snapshot-version +commons-jelly/jars/commons-jelly-tags-avalon-1.0.jar +commons-jelly/jars/commons-jelly-tags-avalon-20040902.071300.jar +commons-jelly/jars/commons-jelly-tags-avalon-snapshot-version +commons-jelly/jars/commons-jelly-tags-bean-20030211.144357.jar +commons-jelly/jars/commons-jelly-tags-betwixt-1.0.jar +commons-jelly/jars/commons-jelly-tags-bean-20030320.165723.jar +commons-jelly/jars/commons-jelly-tags-bean-20040902.071526.jar +commons-jelly/jars/commons-jelly-tags-bean-snapshot-version +commons-jelly/jars/commons-jelly-tags-beanshell-1.0.jar +commons-jelly/jars/commons-jelly-tags-beanshell-20030211.141835.jar +commons-jelly/jars/commons-jelly-tags-beanshell-20040902.071629.jar +commons-jelly/jars/commons-jelly-tags-beanshell-snapshot-version +commons-jelly/jars/commons-jelly-tags-betwixt-1.0-beta-1.20030104.095958.jar +commons-jelly/jars/commons-jelly-tags-betwixt-20030211.144504.jar +commons-jelly/jars/commons-jelly-tags-betwixt-20040902.071752.jar +commons-jelly/jars/commons-jelly-tags-betwixt-snapshot-version +commons-jelly/jars/commons-jelly-tags-bsf-1.0.jar +commons-jelly/jars/commons-jelly-tags-bsf-20030211.142259.jar +commons-jelly/jars/commons-jelly-tags-bsf-20030305.080050.jar +commons-jelly/jars/commons-jelly-tags-fmt-1.0.jar +commons-jelly/jars/commons-jelly-tags-bsf-20040902.071900.jar +commons-jelly/jars/commons-jelly-tags-bsf-snapshot-version +commons-jelly/jars/commons-jelly-tags-define-1.0.jar +commons-jelly/jars/commons-jelly-tags-define-20030211.142932.jar +commons-jelly/jars/commons-jelly-tags-define-20040902.072141.jar +commons-jelly/jars/commons-jelly-tags-define-snapshot-version +commons-jelly/jars/commons-jelly-tags-dynabean-1.0.jar +commons-jelly/jars/commons-jelly-tags-dynabean-20030211.142601.jar +commons-jelly/jars/commons-jelly-tags-dynabean-20040902.071946.jar +commons-jelly/jars/commons-jelly-tags-email-1.0.jar +commons-jelly/jars/commons-jelly-tags-email-20030211.144034.jar +commons-jelly/jars/commons-jelly-tags-email-20040902.072224.jar +commons-jelly/jars/commons-jelly-tags-email-snapshot-version +commons-jelly/jars/commons-jelly-tags-fmt-20030211.142201.jar +commons-jelly/jars/commons-jelly-tags-html-1.0.jar +commons-jelly/jars/commons-jelly-tags-fmt-20040902.072321.jar +commons-jelly/jars/commons-jelly-tags-fmt-snapshot-version +commons-jelly/jars/commons-jelly-tags-html-1.0-beta-1.20030104.103227.jar +commons-jelly/jars/commons-jelly-tags-html-20030211.143308.jar +commons-jelly/jars/commons-jelly-tags-html-20030317.100924.jar +commons-jelly/jars/commons-jelly-tags-html-20040902.072530.jar +commons-jelly/jars/commons-jelly-tags-html-snapshot-version +commons-jelly/jars/commons-jelly-tags-http-1.0-beta-1.20030104.141847.jar +commons-jelly/jars/commons-jelly-tags-http-1.0.jar +commons-jelly/jars/commons-jelly-tags-jaxme-1.0.jar +commons-jelly/jars/commons-jelly-tags-http-20030211.143043.jar +commons-jelly/jars/commons-jelly-tags-http-20040902.072620.jar +commons-jelly/jars/commons-jelly-tags-http-snapshot-version +commons-jelly/jars/commons-jelly-tags-interaction-1.0.jar +commons-jelly/jars/commons-jelly-tags-interaction-1.1.jar +commons-jelly/jars/commons-jelly-tags-jetty-1.0.jar +commons-jelly/jars/commons-jelly-tags-interaction-20030211.143817.jar +commons-jelly/jars/commons-jelly-tags-interaction-20040902.072702.jar +commons-jelly/jars/commons-jelly-tags-interaction-snapshot-version +commons-jelly/jars/commons-jelly-tags-jaxme-20040902.072852.jar +commons-jelly/jars/commons-jelly-tags-jms-1.0.jar +commons-jelly/jars/commons-jelly-tags-jms-20030211.142459.jar +commons-jelly/jars/commons-jelly-tags-jaxme-snapshot-version +commons-jelly/jars/commons-jelly-tags-jetty-1.0-beta-1.20030104.151258.jar +commons-jelly/jars/commons-jelly-tags-jetty-20030211.144139.jar +commons-jelly/jars/commons-jelly-tags-jetty-20040902.072943.jar +commons-jelly/jars/commons-jelly-tags-jface-1.0.jar +commons-jelly/jars/commons-jelly-tags-jetty-snapshot-version +commons-jelly/jars/commons-jelly-tags-jface-20040902.073130.jar +commons-jelly/jars/commons-jelly-tags-jface-snapshot-version +commons-jelly/jars/commons-jelly-tags-jms-20040902.073216.jar +commons-jelly/jars/commons-jelly-tags-jmx-1.0.jar +commons-jelly/jars/commons-jelly-tags-jmx-20030320.165705.jar +commons-jelly/jars/commons-jelly-tags-jms-snapshot-version +commons-jelly/jars/commons-jelly-tags-jmx-20030320.165904.jar +commons-jelly/jars/commons-jelly-tags-jmx-20040902.073310.jar +commons-jelly/jars/commons-jelly-tags-jsl-1.0.jar +commons-jelly/jars/commons-jelly-tags-jsl-20030211.143151.jar +commons-jelly/jars/commons-jelly-tags-jmx-snapshot-version +commons-jelly/jars/commons-jelly-tags-jsl-20040902.072431.jar +commons-jelly/jars/commons-jelly-tags-jsl-snapshot-version +commons-jelly/jars/commons-jelly-tags-junit-1.0.jar +commons-jelly/jars/commons-jelly-tags-junit-snapshot-version +commons-jelly/jars/commons-jelly-tags-junit-20030211.141731.jar +commons-jelly/jars/commons-jelly-tags-junit-20040902.064627.jar +commons-jelly/jars/commons-jelly-tags-junit-20040902.070920.jar +commons-jelly/jars/commons-jelly-tags-log-1.0.jar +commons-jelly/jars/commons-jelly-tags-log-20030211.142821.jar +commons-jelly/jars/commons-jelly-tags-log-20040902.071410.jar +commons-jelly/jars/commons-jelly-tags-log-snapshot-version +commons-jelly/jars/commons-jelly-tags-ojb-1.0.jar +commons-jelly/jars/commons-jelly-tags-ojb-20030211.141630.jar +commons-jelly/jars/commons-jelly-tags-ojb-20040902.073352.jar +commons-jelly/jars/commons-jelly-tags-ojb-snapshot-version +commons-jelly/jars/commons-jelly-tags-quartz-1.0.jar +commons-jelly/jars/commons-jelly-tags-quartz-20030211.144716.jar +commons-jelly/jars/commons-jelly-tags-quartz-20040902.073433.jar +commons-jelly/jars/commons-jelly-tags-quartz-snapshot-version +commons-jelly/jars/commons-jelly-tags-regexp-1.0.jar +commons-jelly/jars/commons-jelly-tags-soap-20030211.142401.jar +commons-jelly/jars/commons-jelly-tags-soap-1.0.jar +commons-jelly/jars/commons-jelly-tags-soap-20040902.073516.jar +commons-jelly/jars/commons-jelly-tags-soap-snapshot-version +commons-jelly/jars/commons-jelly-tags-sql-1.0.jar +commons-jelly/jars/commons-jelly-tags-sql-20030211.144816.jar +commons-jelly/jars/commons-jelly-tags-sql-20040902.073600.jar +commons-jelly/jars/commons-jelly-tags-sql-snapshot-version +commons-jelly/jars/commons-jelly-tags-swing-1.0-beta-1.20030104.104105.jar +commons-jelly/jars/commons-jelly-tags-swing-1.0.jar +commons-jelly/jars/commons-jelly-tags-swing-20030211.143925.jar +commons-jelly/jars/commons-jelly-tags-swing-20040902.073656.jar +commons-jelly/jars/commons-jelly-tags-swing-snapshot-version +commons-jelly/jars/commons-jelly-tags-swt-1.0.jar +commons-jelly/jars/commons-jelly-tags-swt-20030211.144614.jar +commons-jelly/jars/commons-jelly-tags-swt-20030226.103913.jar +commons-jelly/jars/commons-jelly-tags-util-1.0.jar +commons-jelly/jars/commons-jelly-tags-swt-20030226.122214.jar +commons-jelly/jars/commons-jelly-tags-swt-20040902.073028.jar +commons-jelly/jars/commons-jelly-tags-swt-snapshot-version +commons-jelly/jars/commons-jelly-tags-threads-1.0.jar +commons-jelly/jars/commons-jelly-tags-threads-20030211.143515.jar +commons-jelly/jars/commons-jelly-tags-threads-20040902.073749.jar +commons-jelly/jars/commons-jelly-tags-threads-snapshot-version +commons-jelly/jars/commons-jelly-tags-util-1.1.1.jar +commons-jelly/jars/commons-jelly-tags-util-1.1.jar +commons-jelly/jars/commons-jelly-tags-util-20030211.141939.jar +commons-jelly/jars/commons-jelly-tags-util-20040902.071012.jar +commons-jelly/jars/commons-jelly-tags-util-snapshot-version +commons-jelly/jars/commons-jelly-tags-validate-1.0.jar +commons-jelly/jars/commons-jelly-tags-validate-20030211.143411.jar +commons-jelly/jars/commons-jelly-tags-validate-20030420.031608.jar +commons-jelly/jars/commons-jelly-tags-validate-20030420.041030.jar +commons-jelly/jars/commons-jelly-tags-validate-20040902.073836.jar +commons-jelly/jars/commons-jelly-tags-validate-snapshot-version +commons-jelly/jars/commons-jelly-tags-velocity-1.0.jar +commons-jelly/jars/commons-jelly-tags-velocity-20030211.144921.jar +commons-jelly/jars/commons-jelly-tags-velocity-20030303.205659.jar +commons-jelly/jars/commons-jelly-tags-velocity-20040902.073917.jar +commons-jelly/jars/commons-jelly-tags-velocity-snapshot-version +commons-jelly/jars/commons-jelly-tags-xml-1.0.jar +commons-jelly/jars/commons-jelly-tags-xml-1.1.jar +commons-jelly/jars/commons-jelly-tags-xml-20030211.142705.jar +commons-jelly/jars/commons-jelly-tags-xml-20040902.072037.jar +commons-jelly/jars/commons-jelly-tags-xml-snapshot-version +commons-jelly/jars/commons-jelly-tags-xmlunit-1.0.jar +commons-jelly/jars/commons-jelly-tags-xmlunit-20030211.144251.jar +commons-jelly/jars/commons-jelly-tags-xmlunit-20040902.072757.jar +commons-jelly/jars/commons-jelly-tags-xmlunit-snapshot-version +commons-jelly/poms/commons-jelly-1.0-RC1.pom +commons-jelly/poms/commons-jelly-1.0.pom +commons-jelly/poms/commons-jelly-20040902.064518.pom +commons-jelly/poms/commons-jelly-tags-ant-20040902.000000.pom +commons-jelly/poms/commons-jelly-20040902.070806.pom +commons-jelly/poms/commons-jelly-snapshot-version +commons-jelly/poms/commons-jelly-tags-ant-1.1.pom +commons-jelly/poms/commons-jelly-tags-ant-20040902.071105.pom +commons-jelly/poms/commons-jelly-tags-ant-snapshot-version +commons-jelly/poms/commons-jelly-tags-antlr-20040902.071159.pom +commons-jelly/poms/commons-jelly-tags-avalon-20040902.071300.pom +commons-jelly/poms/commons-jelly-tags-antlr-snapshot-version +commons-jelly/poms/commons-jelly-tags-avalon-snapshot-version +commons-jelly/poms/commons-jelly-tags-bean-20040902.071526.pom +commons-jelly/poms/commons-jelly-tags-bean-snapshot-version +commons-jelly/poms/commons-jelly-tags-beanshell-20040902.071629.pom +commons-jelly/poms/commons-jelly-tags-beanshell-snapshot-version +commons-jelly/poms/commons-jelly-tags-betwixt-20040902.071752.pom +commons-jelly/poms/commons-jelly-tags-betwixt-snapshot-version +commons-jelly/poms/commons-jelly-tags-bsf-20040902.071900.pom +commons-jelly/poms/commons-jelly-tags-define-20040902.072141.pom +commons-jelly/poms/commons-jelly-tags-bsf-snapshot-version +commons-jelly/poms/commons-jelly-tags-define-snapshot-version +commons-jelly/poms/commons-jelly-tags-dynabean-20040902.071946.pom +commons-jelly/poms/commons-jelly-tags-dynabean-snapshot-version +commons-jelly/poms/commons-jelly-tags-email-20040902.072224.pom +commons-jelly/poms/commons-jelly-tags-email-snapshot-version +commons-jelly/poms/commons-jelly-tags-fmt-20040902.072321.pom +commons-jelly/poms/commons-jelly-tags-fmt-snapshot-version +commons-jelly/poms/commons-jelly-tags-html-20040902.072530.pom +commons-jelly/poms/commons-jelly-tags-html-snapshot-version +commons-jelly/poms/commons-jelly-tags-http-20040902.072620.pom +commons-jelly/poms/commons-jelly-tags-http-snapshot-version +commons-jelly/poms/commons-jelly-tags-interaction-1.1.pom +commons-jelly/poms/commons-jelly-tags-interaction-20040902.072702.pom +commons-jelly/poms/commons-jelly-tags-interaction-snapshot-version +commons-jelly/poms/commons-jelly-tags-jaxme-20040902.072852.pom +commons-jelly/poms/commons-jelly-tags-jaxme-snapshot-version +commons-jelly/poms/commons-jelly-tags-jetty-20040902.072943.pom +commons-jelly/poms/commons-jelly-tags-jetty-snapshot-version +commons-jelly/poms/commons-jelly-tags-jface-20040902.073130.pom +commons-jelly/poms/commons-jelly-tags-jface-snapshot-version +commons-jelly/poms/commons-jelly-tags-jms-20040902.073216.pom +commons-jelly/poms/commons-jelly-tags-jms-snapshot-version +commons-jelly/poms/commons-jelly-tags-jmx-20040902.073310.pom +commons-jelly/poms/commons-jelly-tags-jmx-snapshot-version +commons-jelly/poms/commons-jelly-tags-jsl-20040902.072431.pom +commons-jelly/poms/commons-jelly-tags-xml-1.1.pom +commons-jelly/poms/commons-jelly-tags-jsl-snapshot-version +commons-jelly/poms/commons-jelly-tags-junit-20040902.064627.pom +commons-jelly/poms/commons-jelly-tags-junit-20040902.070920.pom +commons-jelly/poms/commons-jelly-tags-junit-snapshot-version +commons-jelly/poms/commons-jelly-tags-log-20040902.071410.pom +commons-jelly/poms/commons-jelly-tags-log-snapshot-version +commons-jelly/poms/commons-jelly-tags-ojb-20040902.073352.pom +commons-jelly/poms/commons-jelly-tags-ojb-snapshot-version +commons-jelly/poms/commons-jelly-tags-quartz-20040902.073433.pom +commons-jelly/poms/commons-jelly-tags-quartz-snapshot-version +commons-jelly/poms/commons-jelly-tags-soap-20040902.073516.pom +commons-jelly/poms/commons-jelly-tags-soap-snapshot-version +commons-jelly/poms/commons-jelly-tags-sql-20040902.073600.pom +commons-jelly/poms/commons-jelly-tags-sql-snapshot-version +commons-jelly/poms/commons-jelly-tags-swing-20040902.073656.pom +commons-jelly/poms/commons-jelly-tags-swing-snapshot-version +commons-jelly/poms/commons-jelly-tags-swt-20040902.073028.pom +commons-jelly/poms/commons-jelly-tags-swt-snapshot-version +commons-jelly/poms/commons-jelly-tags-threads-20040902.073749.pom +commons-jelly/poms/commons-jelly-tags-threads-snapshot-version +commons-jelly/poms/commons-jelly-tags-util-20040902.064720.pom +commons-jelly/poms/commons-jelly-tags-util-20040902.071012.pom +commons-jelly/poms/commons-jelly-tags-util-snapshot-version +commons-jelly/poms/commons-jelly-tags-validate-20040902.073836.pom +commons-jelly/poms/commons-jelly-tags-validate-snapshot-version +commons-jelly/poms/commons-jelly-tags-velocity-20040902.073917.pom +commons-jelly/poms/commons-jelly-tags-velocity-snapshot-version +commons-jelly/poms/commons-jelly-tags-xml-20040902.072037.pom +commons-jelly/poms/commons-jelly-tags-xml-snapshot-version +commons-jelly/poms/commons-jelly-tags-xmlunit-20040902.072757.pom +commons-jelly/poms/commons-jelly-tags-xmlunit-snapshot-version +commons-jexl/distributions/KEYS +commons-jexl/distributions/commons-jexl-1.0-RC1-src.tar.gz +commons-jexl/distributions/commons-jexl-1.0-RC1-src.zip +commons-jexl/distributions/commons-jexl-1.0-RC1.tar.gz +commons-jexl/distributions/commons-jexl-1.0-RC1.zip +commons-jexl/distributions/commons-jexl-1.0-src.tar.gz +commons-jexl/distributions/commons-jexl-1.0-src.zip +commons-jexl/distributions/commons-jexl-1.0.tar.gz +commons-jexl/distributions/commons-jexl-1.0.zip +commons-jexl/jars/commons-jexl-1.0-RC1.jar +commons-jexl/jars/commons-jexl-1.0-beta-1.jar +commons-jexl/jars/commons-jexl-1.0-beta-2.jar +commons-jexl/jars/commons-jexl-1.0-dev.20020731.122830.jar +commons-jexl/jars/commons-jexl-1.0-dev.jar +commons-jexl/jars/commons-jexl-1.0-javadoc.jar +commons-jexl/jars/commons-jexl-1.0.jar +commons-jexl/jars/commons-jexl-20030307.151331.jar +commons-jexl/jars/commons-jexl-20040901.055348.jar +commons-jexl/jars/commons-jexl-snapshot-version +commons-jexl/poms/commons-jexl-1.0-RC1.pom +commons-jexl/poms/commons-jexl-20040901.055348.pom +commons-jexl/poms/commons-jexl-snapshot-version +commons-jux/jars/commons-jux-20030306.065700.jar +commons-jux/jars/commons-jux-snapshot-version +commons-jxpath/jars/commons-jxpath-0.1-dev.jar +commons-jxpath/jars/commons-jxpath-1.0-javadoc.jar +commons-jxpath/jars/commons-jxpath-1.0.jar +commons-jxpath/jars/commons-jxpath-1.1-javadoc.jar +commons-jxpath/jars/commons-jxpath-1.1.jar +commons-jxpath/jars/commons-jxpath-1.2.jar +commons-jxpath/poms/commons-jxpath-1.0.pom +commons-jxpath/poms/commons-jxpath-1.1.pom +commons-jxpath/poms/commons-jxpath-1.2.pom +commons-lang/distributions/commons-lang-2.0.zip +commons-lang/jars/commons-lang-0.1-dev.jar +commons-lang/jars/commons-lang-1.0-b1.1.jar +commons-lang/jars/commons-lang-1.0-b1.jar +commons-lang/jars/commons-lang-2.3-javadoc.jar +commons-lang/jars/commons-lang-1.0-dev.20020910.034641.jar +commons-lang/jars/commons-lang-1.0-dev.jar +commons-lang/jars/commons-lang-1.0-javadoc.jar +commons-lang/jars/commons-lang-1.0.1-javadoc.jar +commons-lang/jars/commons-lang-1.0.1.jar +commons-lang/jars/commons-lang-1.0.jar +commons-lang/jars/commons-lang-1.1-dev.20021217.062015.jar +commons-lang/jars/commons-lang-2.0-dev.20030203.000129.jar +commons-lang/jars/commons-lang-2.0-javadoc.jar +commons-lang/jars/commons-lang-2.0.jar +commons-lang/jars/commons-lang-2.1-javadoc.jar +commons-lang/jars/commons-lang-2.1.jar +commons-lang/jars/commons-lang-snapshot-version +commons-lang/jars/commons-lang-2.3.jar +commons-lang/jars/commons-lang-2.3-sources.jar +commons-lang/poms/commons-lang-1.0.1.pom +commons-lang/poms/commons-lang-1.0.pom +commons-lang/poms/commons-lang-2.0.pom +commons-lang/poms/commons-lang-2.1.pom +commons-lang/poms/commons-lang-2.3.pom +commons-latka/jars/commons-latka-1.0-alpha1-javadoc.jar +commons-latka/jars/commons-latka-1.0-dev.20021208.082252.jar +commons-latka/jars/commons-latka-1.0-dev.20021208.125541.jar +commons-latka/jars/commons-latka-1.0-dev.20021208.130300.jar +commons-latka/jars/commons-latka-1.0-dev.20021217.141322.jar +commons-latka/jars/commons-latka-1.0-dev.20030107.163533.jar +commons-launcher/jars/commons-launcher-0.9-javadoc.jar +commons-launcher/jars/commons-launcher-1.1-javadoc.jar +commons-logging/jars/commons-logging-1.0-javadoc.jar +commons-logging/jars/commons-logging-1.0.1-javadoc.jar +commons-logging/jars/commons-logging-1.0.1.jar +commons-logging/jars/commons-logging-1.0.2-javadoc.jar +commons-logging/jars/commons-logging-1.0.2.jar +commons-logging/jars/commons-logging-1.0.3-javadoc.jar +commons-logging/jars/commons-logging-1.0.3.jar +commons-logging/jars/commons-logging-1.0.4-javadoc.jar +commons-logging/jars/commons-logging-1.0.4.jar +commons-logging/jars/commons-logging-1.0.jar +commons-logging/jars/commons-logging-1.1-dev.jar +commons-logging/jars/commons-logging-1.1.jar +commons-logging/jars/commons-logging-adapters-1.1.jar +commons-logging/jars/commons-logging-api-1.0.3.jar +commons-logging/jars/commons-logging-api-1.0.4.jar +commons-logging/jars/commons-logging-api-1.1.jar +commons-logging/jars/commons-logging-api-snapshot-version +commons-logging/jars/commons-logging-snapshot-version +commons-logging/poms/commons-logging-1.0.1.pom +commons-logging/poms/commons-logging-1.0.2.pom +commons-logging/poms/commons-logging-1.0.3.pom +commons-logging/poms/commons-logging-1.0.4.pom +commons-logging/poms/commons-logging-1.1.pom +commons-logging/poms/commons-logging-api-1.1.pom +commons-math/distributions/commons-math-20040118.003950-src.tar.gz +commons-math/distributions/commons-math-20040118.003950-src.zip +commons-math/distributions/commons-math-20040118.003950.tar.gz +commons-math/distributions/commons-math-20040118.003950.zip +commons-math/jars/commons-math-1.0-javadoc.jar +commons-math/jars/commons-math-1.0.jar +commons-math/jars/commons-math-1.1.jar +commons-math/jars/commons-math-20040118.003354.jar +commons-math/jars/commons-math-20040218.045431.jar +commons-math/jars/commons-math-snapshot-version +commons-math/poms/commons-math-1.0.pom +commons-math/poms/commons-math-1.1.pom +commons-messenger/jars/commons-messenger-1.0-dev-10.jar +commons-messenger/jars/commons-messenger-1.0-dev-11.jar +commons-messenger/jars/commons-messenger-1.0-dev-12.jar +commons-messenger/jars/commons-messenger-1.0-dev-13.jar +commons-messenger/jars/commons-messenger-1.0-dev-14.jar +commons-messenger/jars/commons-messenger-1.0-dev-2.jar +commons-messenger/jars/commons-messenger-1.0-dev-4.jar +commons-messenger/jars/commons-messenger-1.0-dev-5.jar +commons-messenger/jars/commons-messenger-1.0-dev-6.jar +commons-messenger/jars/commons-messenger-1.0-dev-8.jar +commons-messenger/jars/commons-messenger-1.0-dev.20020708.025623.jar +commons-messenger/jars/commons-messenger-1.0-dev.20020708.042042.jar +commons-messenger/jars/commons-messenger-1.0-dev.20020906.115547.jar +commons-messenger/jars/commons-messenger-1.0-dev.jar +commons-modeler/jars/commons-modeler-1.0-javadoc.jar +commons-modeler/jars/commons-modeler-1.1-dev.jar +commons-modeler/jars/commons-modeler-1.1-javadoc.jar +commons-modeler/jars/commons-modeler-1.1.jar +commons-modeler/jars/commons-modeler-2.0.1.jar +commons-modeler/jars/commons-modeler-1.1M1.jar +commons-modeler/jars/commons-modeler-2.0.jar +commons-modeler/jars/commons-modeler-2.0.1-javadoc.jar +commons-modeler/jars/commons-modeler-2.0.1-sources.jar +commons-modeler/poms/commons-modeler-1.1.pom +commons-modeler/poms/commons-modeler-2.0.pom +commons-modeler/poms/commons-modeler-2.0.1.pom +commons-naming/jars/commons-naming-core-20031116.223527.jar +commons-naming/jars/commons-naming-factory-20031116.223742.jar +commons-naming/jars/commons-naming-core-snapshot-version +commons-naming/jars/commons-naming-factory-20031201.015542.jar +commons-naming/jars/commons-naming-factory-snapshot-version +commons-net/jars/commons-net-1.0.0-javadoc.jar +commons-net/jars/commons-net-1.0.0.jar +commons-net/jars/commons-net-1.1.0-javadoc.jar +commons-net/jars/commons-net-1.1.0.jar +commons-net/jars/commons-net-1.2.0-javadoc.jar +commons-net/jars/commons-net-1.2.1-javadoc.jar +commons-net/jars/commons-net-1.2.1.jar +commons-net/jars/commons-net-1.2.2-javadoc.jar +commons-net/jars/commons-net-1.3.0-javadoc.jar +commons-net/jars/commons-net-1.3.0.jar +commons-net/jars/commons-net-1.4.0-javadoc.jar +commons-net/jars/commons-net-1.4.0.jar +commons-net/jars/commons-net-1.4.1-javadoc.jar +commons-net/jars/commons-net-1.4.1.jar +commons-net/jars/commons-net-20030211.160026.jar +commons-net/jars/commons-net-20030623.125255.jar +commons-net/jars/commons-net-20030805.205232.jar +commons-net/jars/commons-net-snapshot-version +commons-net/poms/commons-net-1.0.0.pom +commons-net/poms/commons-net-1.1.0.pom +commons-net/poms/commons-net-1.2.1.pom +commons-net/poms/commons-net-1.3.0.pom +commons-net/poms/commons-net-1.4.0.pom +commons-net/poms/commons-net-1.4.1.pom +commons-pool/jars/commons-pool-1.0-javadoc.jar +commons-pool/jars/commons-pool-1.0.1-javadoc.jar +commons-pool/jars/commons-pool-1.0.1.jar +commons-pool/jars/commons-pool-1.0.jar +commons-pool/jars/commons-pool-1.1-RC1.jar +commons-pool/jars/commons-pool-1.1-RC2.jar +commons-pool/jars/commons-pool-1.1-dev.jar +commons-pool/jars/commons-pool-1.1-javadoc.jar +commons-pool/jars/commons-pool-1.1.jar +commons-pool/jars/commons-pool-1.2-javadoc.jar +commons-pool/jars/commons-pool-1.2.jar +commons-pool/jars/commons-pool-1.3.jar +commons-pool/jars/commons-pool-20020501.jar +commons-pool/jars/commons-pool-20030623.172700.jar +commons-pool/jars/commons-pool-20030818.195203.jar +commons-pool/jars/commons-pool-20030821.192746.jar +commons-pool/jars/commons-pool-20030825.183949.jar +commons-pool/jars/commons-pool-snapshot-version +commons-pool/poms/commons-pool-1.0.1.pom +commons-pool/poms/commons-pool-1.1.pom +commons-pool/poms/commons-pool-1.2.pom +commons-pool/poms/commons-pool-1.3.pom +commons-primitives/jars/commons-primitives-1.0-javadoc.jar +commons-primitives/poms/commons-primitives.xml +commons-scxml/distributions/commons-scxml-0.5-src.tar.gz +commons-scxml/distributions/commons-scxml-0.5-src.zip +commons-scxml/distributions/commons-scxml-0.5.tar.gz +commons-scxml/distributions/commons-scxml-0.5.zip +commons-scxml/distributions/commons-scxml-0.6-src.zip +commons-scxml/distributions/commons-scxml-0.6-src.tar.gz +commons-scxml/distributions/commons-scxml-0.6.tar.gz +commons-scxml/distributions/commons-scxml-0.6.zip +commons-scxml/jars/commons-scxml-0.5.jar +commons-scxml/jars/commons-scxml-0.6.jar +commons-scxml/poms/commons-scxml-0.5.pom +commons-scxml/poms/commons-scxml-0.6.pom +commons-sql/jars/commons-sql-1.0-dev.jar +commons-sql/jars/commons-sql-20040118.000852.jar +commons-sql/jars/commons-sql-snapshot-version +commons-threadpool/jars/commons-threadpool-1.0-dev.20021010.081157.jar +commons-threadpool/jars/commons-threadpool-20030513.073905.jar +commons-threadpool/jars/commons-threadpool-snapshot-version +commons-transaction/jars/commons-transaction-1.0-javadoc.jar +commons-transaction/jars/commons-transaction-1.0.1-javadoc.jar +commons-transaction/jars/commons-transaction-1.1-javadoc.jar +commons-transaction/jars/commons-transaction-1.1.jar +commons-transaction/jars/commons-transaction-1.2.jar +commons-transaction/poms/commons-transaction-1.1.pom +commons-transaction/poms/commons-transaction-1.2.pom +commons-util/jars/commons-util-1.0-rc2-dev.20020814.103359.jar +commons-util/jars/commons-util-1.0-rc2-dev.20021217.063141.jar +commons-util/jars/commons-util-1.0-rc2-dev.jar +commons-util/jars/commons-utils-snapshot-version +commons-validator/distributions/commons-validator-1.1.3-src.tar.gz.MD5 +commons-validator/distributions/commons-validator-1.1.3-src.tar.gz +commons-validator/distributions/commons-validator-1.1.3-src.zip.MD5 +commons-validator/distributions/commons-validator-1.1.3-src.zip +commons-validator/distributions/commons-validator-1.1.3.tar.gz.MD5 +commons-validator/distributions/commons-validator-1.1.3.tar.gz +commons-validator/distributions/commons-validator-1.1.3.zip.MD5 +commons-validator/distributions/commons-validator-1.1.3.zip +commons-validator/jars/commons-validator-1.0-javadoc.jar +commons-validator/jars/commons-validator-1.0.1-javadoc.jar +commons-validator/jars/commons-validator-1.0.1.jar +commons-validator/jars/commons-validator-1.0.2-javadoc.jar +commons-validator/jars/commons-validator-1.3.1.jar +commons-validator/jars/commons-validator-1.0.2.jar +commons-validator/jars/commons-validator-1.0.jar +commons-validator/jars/commons-validator-1.1.3-javadoc.jar +commons-validator/jars/commons-validator-1.1.3-src.tar.gz +commons-validator/jars/commons-validator-1.1.3-src.tar.gz.MD5 +commons-validator/jars/commons-validator-1.1.3-src.zip +commons-validator/jars/commons-validator-1.1.3-src.zip.MD5 +commons-validator/jars/commons-validator-1.1.3.jar +commons-validator/jars/commons-validator-1.1.3.tar.gz +commons-validator/jars/commons-validator-1.1.3.tar.gz.MD5 +commons-validator/jars/commons-validator-1.1.3.zip +commons-validator/jars/commons-validator-1.1.3.zip.MD5 +commons-validator/jars/commons-validator-1.1.4-javadoc.jar +commons-validator/jars/commons-validator-1.1.4.jar +commons-validator/jars/commons-validator-1.2.0-javadoc.jar +commons-validator/jars/commons-validator-1.2.0.jar +commons-validator/jars/commons-validator-1.3.0.jar +commons-validator/jars/struts-help.html +commons-validator/jars/commons-validator-1.3.1-sources.jar +commons-validator/poms/commons-validator-1.0.1.pom +commons-validator/poms/commons-validator-1.0.2.pom +commons-validator/poms/commons-validator-1.0.pom +commons-validator/poms/commons-validator-1.2.0.pom +commons-validator/poms/commons-validator-1.3.1.pom +commons-validator/poms/commons-validator-1.3.0.pom +commons-vfs/jars/commons-vfs-1.0.jar +commons-vfs/poms/commons-vfs-1.0.pom +commons-xo/jars/commons-xo-0.8.jar +commons-xo/jars/commons-xo-1.0-20020507.jar +cornerstone-connection/jars/cornerstone-connection-api-1.0.jar +cornerstone-connection/jars/cornerstone-connection-api-2.1.jar +cornerstone-connection/jars/cornerstone-connection-impl-1.0.jar +cornerstone-connection/jars/cornerstone-connection-impl-2.1.jar +cornerstone-connection/poms/cornerstone-connection-api-2.1.pom +cornerstone-connection/poms/cornerstone-connection-impl-2.1.pom +cornerstone-datasources/jars/cornerstone-datasources-api-1.0.jar +cornerstone-datasources/jars/cornerstone-datasources-api-2.1.jar +cornerstone-datasources/jars/cornerstone-datasources-impl-1.0.jar +cornerstone-datasources/jars/cornerstone-datasources-impl-2.1.jar +cornerstone-datasources/poms/cornerstone-datasources-api-2.1.pom +cornerstone-datasources/poms/cornerstone-datasources-impl-2.1.pom +cornerstone-scheduler/jars/cornerstone-scheduler-api-1.0.jar +cornerstone-scheduler/jars/cornerstone-scheduler-api-2.1.jar +cornerstone-scheduler/jars/cornerstone-scheduler-impl-1.0.jar +cornerstone-scheduler/jars/cornerstone-scheduler-impl-2.1.jar +cornerstone-scheduler/poms/cornerstone-scheduler-api-2.1.pom +cornerstone-scheduler/poms/cornerstone-scheduler-impl-2.1.pom +cornerstone-sockets/jars/cornerstone-sockets-api-1.0.jar +cornerstone-sockets/jars/cornerstone-sockets-api-2.1.jar +cornerstone-sockets/jars/cornerstone-sockets-impl-1.0.jar +cornerstone-sockets/jars/cornerstone-sockets-impl-2.1.jar +cornerstone-sockets/poms/cornerstone-sockets-api-2.1.pom +cornerstone-sockets/poms/cornerstone-sockets-impl-2.1.pom +cornerstone-store/jars/cornerstone-store-api-1.0.jar +cornerstone-store/jars/cornerstone-store-api-2.1.jar +cornerstone-store/jars/cornerstone-store-impl-1.0.jar +cornerstone-store/jars/cornerstone-store-impl-1.1.jar +cornerstone-store/jars/cornerstone-store-impl-2.1.jar +cornerstone-store/poms/cornerstone-store-api-2.1.pom +cornerstone-store/poms/cornerstone-store-impl-2.1.pom +cornerstone-threads/jars/cornerstone-threads-api-1.0.jar +cornerstone-threads/jars/cornerstone-threads-api-2.1.jar +cornerstone-threads/jars/cornerstone-threads-impl-1.0.jar +cornerstone-threads/jars/cornerstone-threads-impl-2.1.jar +cornerstone-threads/jars/cornerstone-threads-tutorial-1.0.jar +cornerstone-threads/jars/cornerstone-threads-tutorial-2.1.jar +cornerstone-threads/poms/cornerstone-threads-api-2.1.pom +cornerstone-threads/poms/cornerstone-threads-impl-2.1.pom +cornerstone-threads/poms/cornerstone-threads-tutorial-2.1.pom +crimson/jars/crimson-1.1.3.jar +directory/distributions/apacheds-0.9-src.tar.gz +directory/distributions/apacheds-0.9-src.zip +directory/distributions/apacheds-0.9.2-src.tar.gz +directory/distributions/apacheds-0.9.2-src.zip +directory/distributions/apacheds-0.9.tar.gz +directory/distributions/apacheds-0.9.zip +directory/jars/apacheds-core-0.9.1.jar +directory/jars/apacheds-core-0.9.2.jar +directory/jars/apacheds-core-0.9.3.jar +directory/jars/apacheds-core-0.9.jar +directory/jars/apacheds-main-0.9.1.jar +directory/jars/apacheds-main-0.9.2.jar +directory/jars/apacheds-main-0.9.3.jar +directory/jars/apacheds-main-0.9.jar +directory/jars/apacheds-shared-0.9.1.jar +directory/jars/apacheds-shared-0.9.2.jar +directory/jars/apacheds-shared-0.9.3.jar +directory/jars/apacheds-shared-0.9.jar +directory/jars/ldap-common-20031205.013436.jar +directory/plugins/maven-directory-plugin-0.9.1.jar +directory/plugins/maven-directory-plugin-0.9.2.jar +directory/plugins/maven-directory-plugin-0.9.3.jar +directory/plugins/maven-directory-plugin-0.9.jar +directory/poms/apacheds-0.9.pom +directory/poms/apacheds-core-0.9.2.pom +directory/poms/apacheds-core-0.9.3.pom +directory/poms/apacheds-core-0.9.pom +directory/poms/apacheds-main-0.9.2.pom +directory/poms/apacheds-main-0.9.3.pom +directory/poms/apacheds-main-0.9.pom +directory/poms/apacheds-shared-0.9.2.pom +directory/poms/apacheds-shared-0.9.3.pom +directory/poms/maven-directory-plugin-0.9.2.pom +directory/poms/apacheds-shared-0.9.pom +directory/poms/maven-directory-plugin-0.9.3.pom +directory/poms/maven-directory-plugin-0.9.pom +directory-asn1/jars/asn1-ber-0.3.2.jar +directory-asn1/jars/asn1-ber-0.3.3.jar +directory-asn1/jars/asn1-ber-0.3.jar +directory-asn1/jars/asn1-codec-0.3.2.jar +directory-asn1/jars/asn1-codec-0.3.3.jar +directory-asn1/jars/asn1-codec-0.3.jar +directory-asn1/jars/asn1-der-0.3.2.jar +directory-asn1/jars/asn1-der-0.3.3.jar +directory-asn1/jars/asn1-der-0.3.jar +directory-asn1/jars/asn1-new-ber-0.3.3.jar +directory-asn1/jars/stub-compiler-0.3.2.jar +directory-asn1/jars/stub-compiler-0.3.jar +directory-asn1/poms/asn1-0.3.3.pom +directory-asn1/poms/asn1-ber-0.3.2.pom +directory-asn1/poms/asn1-ber-0.3.3.pom +directory-asn1/poms/asn1-ber-0.3.pom +directory-asn1/poms/asn1-codec-0.3.2.pom +directory-asn1/poms/asn1-codec-0.3.3.pom +directory-asn1/poms/asn1-codec-0.3.pom +directory-asn1/poms/asn1-der-0.3.2.pom +directory-asn1/poms/asn1-der-0.3.3.pom +directory-asn1/poms/asn1-der-0.3.pom +directory-asn1/poms/asn1-new-ber-0.3.3.pom +directory-asn1/poms/stub-compiler-0.3.2.pom +directory-asn1/poms/stub-compiler-0.3.pom +directory-clients/jars/ldap-clients-0.9.jar +directory-clients/poms/ldap-clients-0.9-SNAPSHOT.pom +directory-clients/poms/ldap-clients-0.9.1-SNAPSHOT.pom +directory-clients/poms/ldap-clients-0.9.pom +directory-naming/jars/naming-config-0.8.jar +directory-naming/jars/naming-core-0.8.jar +directory-naming/jars/naming-factory-0.8.jar +directory-naming/jars/naming-java-0.8.jar +directory-naming/jars/naming-management-0.8.jar +directory-naming/jars/naming-resources-0.8.jar +directory-naming/poms/naming-config-0.8.pom +directory-naming/poms/naming-core-0.8.pom +directory-naming/poms/naming-core-0.9-dev.pom +directory-naming/poms/naming-factory-0.8.pom +directory-naming/poms/naming-java-0.8.pom +directory-naming/poms/naming-management-0.8.pom +directory-naming/poms/naming-resources-0.8.pom +directory-network/jars/mina-0.7.1.jar +directory-network/jars/mina-0.7.2.jar +directory-network/jars/mina-0.7.3.jar +directory-network/jars/mina-0.7.4.jar +directory-network/jars/mina-0.7.jar +directory-network/jars/mina-0.8.0.jar +directory-network/jars/mina-0.8.1.jar +directory-network/jars/mina-0.8.2.jar +directory-network/jars/mina-0.9.0.jar +directory-network/poms/mina-0.7.1.pom +directory-network/poms/mina-0.7.2.pom +directory-network/poms/mina-0.7.3.pom +directory-network/poms/mina-0.7.4.pom +directory-network/poms/mina-0.7.pom +directory-network/poms/mina-0.8.0.pom +directory-network/poms/mina-0.8.1.pom +directory-network/poms/mina-0.8.2.pom +directory-network/poms/mina-0.9.0.pom +directory-network/KEYS +directory-protocols/jars/kerberos-protocol-0.4.jar +directory-protocols/jars/ldap-protocol-0.9.jar +directory-protocols/poms/kerberos-protocol-0.4.pom +directory-protocols/poms/ldap-protocol-0.9.pom +directory-shared/jars/apache-ldapber-provider-0.9.2.jar +directory-shared/jars/apache-ldapber-provider-0.9.3.jar +directory-shared/jars/apache-ldapber-provider-0.9.jar +directory-shared/jars/apache-new-ldapber-provider-0.9.3.jar +directory-shared/jars/kerberos-common-0.4.jar +directory-shared/jars/kerberos-common-0.5.jar +directory-shared/jars/ldap-common-0.9.2.jar +directory-shared/jars/ldap-common-0.9.3.jar +directory-shared/jars/ldap-common-0.9.jar +directory-shared/jars/ldap-snacc-provider-0.9.2.jar +directory-shared/jars/ldap-snacc-provider-0.9.3.jar +directory-shared/jars/ldap-snacc-provider-0.9.jar +directory-shared/poms/apache-ldapber-provider-0.9.2.pom +directory-shared/poms/apache-ldapber-provider-0.9.3.pom +directory-shared/poms/apache-ldapber-provider-0.9.pom +directory-shared/poms/apache-new-ldapber-provider-0.9.3.pom +directory-shared/poms/kerberos-common-0.4.pom +directory-shared/poms/kerberos-common-0.5.pom +directory-shared/poms/ldap-common-0.9.2.pom +directory-shared/poms/ldap-common-0.9.3.pom +directory-shared/poms/ldap-common-0.9.pom +directory-shared/poms/ldap-snacc-provider-0.9.2.pom +directory-shared/poms/ldap-snacc-provider-0.9.3.pom +directory-shared/poms/ldap-snacc-provider-0.9.pom +excalibur/jars/excalibur-collections-1.0.jar +excalibur/jars/excalibur-configuration-1.0.jar +excalibur/jars/excalibur-event-2.0.jar +excalibur/jars/excalibur-extension-1.0.jar +excalibur/jars/excalibur-i18n-1.0.jar +excalibur/jars/excalibur-instrument-0.3.jar +excalibur/jars/excalibur-testcase-1.0.jar +excalibur/jars/excalibur-thread-1.1.jar +excalibur/jars/excalibur-threadcontext-1.0.jar +excalibur/jars/excalibur-util-concurrent-1.3.1.jar +excalibur-altrmi/jars/excalibur-altrmi-client-impl-0.7.jar +excalibur-altrmi/jars/excalibur-altrmi-client-interfaces-0.7.jar +excalibur-altrmi/jars/excalibur-altrmi-common-0.7.jar +excalibur-altrmi/jars/excalibur-altrmi-generator-0.7.jar +excalibur-altrmi/jars/excalibur-altrmi-server-impl-0.7.jar +excalibur-altrmi/jars/excalibur-altrmi-server-interfaces-0.7.jar +excalibur-cli/jars/excalibur-cli-1.0.jar +excalibur-collections/jars/excalibur-collections-1.0.jar +excalibur-collections/jars/excalibur-collections-20020820.jar +excalibur-component/jars/excalibur-component-1.0.jar +excalibur-component/jars/excalibur-component-1.1.jar +excalibur-component/jars/excalibur-component-1.2.jar +excalibur-component/jars/excalibur-component-2.1.jar +excalibur-component/jars/excalibur-component-20020916.jar +excalibur-component/jars/excalibur-testcase-2.1.jar +excalibur-component/poms/excalibur-component-2.1.pom +excalibur-component/poms/excalibur-testcase-2.1.pom +excalibur-component-examples/jars/excalibur-component-examples-2.1.jar +excalibur-component-examples/poms/excalibur-component-examples-2.1.pom +excalibur-component-tests/jars/excalibur-component-tests-2.1.jar +excalibur-component-tests/poms/excalibur-component-tests-2.1.pom +excalibur-concurrent/jars/excalibur-concurrent-1.0.jar +excalibur-concurrent/jars/excalibur-concurrent-20020820.jar +excalibur-configuration/distributions/excalibur-configuration-1.1-RC1-src.tar.gz +excalibur-configuration/distributions/excalibur-configuration-1.1-RC1-src.zip +excalibur-configuration/distributions/excalibur-configuration-1.1-RC1.tar.gz +excalibur-configuration/distributions/excalibur-configuration-1.1-RC1.zip +excalibur-configuration/distributions/excalibur-configuration-1.1-src.tar.gz +excalibur-configuration/distributions/excalibur-configuration-1.1-src.zip +excalibur-configuration/distributions/excalibur-configuration-1.1.tar.gz +excalibur-configuration/distributions/excalibur-configuration-1.1.zip +excalibur-configuration/jars/excalibur-configuration-1.0.jar +excalibur-configuration/jars/excalibur-configuration-1.1-RC1.jar +excalibur-configuration/jars/excalibur-configuration-1.1-dev.jar +excalibur-configuration/jars/excalibur-configuration-1.1.jar +excalibur-configuration/jars/excalibur-configuration-1.2.jar +excalibur-containerkit/jars/excalibur-containerkit-1.0.jar +excalibur-datasource/jars/excalibur-datasource-1.1.1.jar +excalibur-datasource/jars/excalibur-datasource-1.2.0.jar +excalibur-datasource/jars/excalibur-datasource-cluster-1.1.1a.jar +excalibur-datasource/jars/excalibur-datasource-2.1.jar +excalibur-datasource/jars/excalibur-datasource-ids-1.1.1a.jar +excalibur-datasource/jars/excalibur-datasource-vm14-20021121.jar +excalibur-datasource/poms/excalibur-datasource-2.1.pom +fop/jars/fop-0.20.3.jar +fop/jars/fop-0.20.4.jar +fop/jars/fop-0.20.5-rc3-alpha.jar +fop/jars/fop-0.20.5.jar +fop/jars/fop-0.20.5rc2.jar +fop/jars/fop-0.93-jdk15.jar +fop/jars/fop-0.93-jdk14.jar +excalibur-event/distributions/excalibur-event-1.0.3.zip +excalibur-event/jars/excalibur-event-1.0.3.jar +excalibur-event/jars/excalibur-event-1.0a.jar +excalibur-event/jars/excalibur-event-20030217.000000.jar +excalibur-event/jars/excalibur-event-api-1.0.4-dev.jar +excalibur-event/jars/excalibur-event-api-2.1.jar +excalibur-event/jars/excalibur-event-impl-1.0.4-dev.jar +excalibur-event/jars/excalibur-event-impl-2.1.jar +excalibur-event/jars/excalibur-event-snapshot-version +excalibur-event/poms/excalibur-event-api-2.1.pom +excalibur-event/poms/excalibur-event-impl-2.1.pom +excalibur-extension/jars/excalibur-extension-1.0.jar +excalibur-fortress/jars/excalibur-fortress-1.0.jar +excalibur-fortress/jars/excalibur-fortress-bean-1.2.jar +excalibur-fortress/jars/excalibur-fortress-cli-1.2.jar +excalibur-fortress/jars/excalibur-fortress-complete-1.0.jar +excalibur-fortress/jars/excalibur-fortress-container-api-1.2.jar +excalibur-fortress/jars/excalibur-fortress-container-impl-1.2.jar +excalibur-fortress/jars/excalibur-fortress-container-test-1.2.jar +excalibur-fortress/jars/excalibur-fortress-examples-1.2.jar +excalibur-fortress/jars/excalibur-fortress-meta-1.2.jar +excalibur-fortress/jars/excalibur-fortress-migration-1.2.jar +excalibur-fortress/jars/excalibur-fortress-servlet-1.2.jar +excalibur-fortress/jars/excalibur-fortress-testcase-1.2.jar +excalibur-fortress/jars/excalibur-fortress-tools-1.0.jar +excalibur-fortress/poms/excalibur-fortress-bean-1.2.pom +excalibur-fortress/poms/excalibur-fortress-cli-1.2.pom +excalibur-fortress/poms/excalibur-fortress-container-api-1.2.pom +excalibur-fortress/poms/excalibur-fortress-container-impl-1.2.pom +excalibur-fortress/poms/excalibur-fortress-meta-1.2.pom +excalibur-fortress/poms/excalibur-fortress-container-test-1.2.pom +excalibur-fortress/poms/excalibur-fortress-examples-1.2.pom +excalibur-fortress/poms/excalibur-fortress-migration-1.2.pom +excalibur-fortress/poms/excalibur-fortress-platform-1.2.pom +excalibur-fortress/poms/excalibur-fortress-servlet-1.2.pom +excalibur-fortress/poms/excalibur-fortress-testcase-1.2.pom +excalibur-i18n/distributions/excalibur-i18n-1.1-RC1-src.tar.gz +excalibur-i18n/distributions/excalibur-i18n-1.1-RC1-src.zip +excalibur-i18n/distributions/excalibur-i18n-1.1-RC1.tar.gz +excalibur-i18n/distributions/excalibur-i18n-1.1-RC1.zip +excalibur-i18n/distributions/excalibur-i18n-1.1-src.tar.gz +excalibur-i18n/distributions/excalibur-i18n-1.1-src.zip +excalibur-i18n/distributions/excalibur-i18n-1.1-tar.gz +excalibur-i18n/distributions/excalibur-i18n-1.1.zip +excalibur-i18n/jars/excalibur-i18n-1.0.jar +excalibur-i18n/jars/excalibur-i18n-1.1-RC1.jar +excalibur-i18n/jars/excalibur-i18n-1.1.jar +excalibur-instrument/jars/excalibur-instrument-0.1.jar +excalibur-instrument/jars/excalibur-instrument-1.0.jar +excalibur-instrument/jars/excalibur-instrument-20021108.jar +excalibur-instrument/jars/excalibur-instrument-api-2.1.jar +excalibur-instrument/jars/excalibur-instrument-client-2.1.jar +excalibur-instrument/jars/excalibur-instrument-mgr-api-2.1.jar +excalibur-instrument/jars/excalibur-instrument-mgr-http-2.1.jar +excalibur-instrument/jars/excalibur-instrument-mgr-impl-2.1.jar +excalibur-instrument/poms/excalibur-instrument-api-2.1.pom +excalibur-instrument/poms/excalibur-instrument-client-2.1.pom +excalibur-instrument/poms/excalibur-instrument-mgr-api-2.1.pom +excalibur-instrument/poms/excalibur-instrument-mgr-http-2.1.pom +excalibur-instrument/poms/excalibur-instrument-mgr-impl-2.1.pom +excalibur-instrument-manager/jars/excalibur-instrument-manager-0.1.jar +excalibur-instrument-manager/jars/excalibur-instrument-manager-1.0.jar +excalibur-instrument-manager/jars/excalibur-instrument-manager-20021108.jar +excalibur-instrument-manager-interfaces/jars/excalibur-instrument-manager-interfaces-0.1.jar +excalibur-instrument-manager-interfaces/jars/excalibur-instrument-manager-interfaces-1.0.jar +excalibur-instrument-manager-interfaces/jars/excalibur-instrument-manager-interfaces-20021108.jar +excalibur-io/jars/excalibur-io-1.1.jar +excalibur-lifecycle/jars/excalibur-lifecycle-1.0.jar +excalibur-lifecycle/jars/excalibur-lifecycle-api-1.0.jar +excalibur-lifecycle/jars/excalibur-lifecycle-api-1.1.0.jar +excalibur-lifecycle/jars/excalibur-lifecycle-api-1.1.jar +excalibur-lifecycle/jars/excalibur-lifecycle-api-2.1.jar +excalibur-lifecycle/jars/excalibur-lifecycle-impl-1.0.jar +excalibur-lifecycle/jars/excalibur-lifecycle-impl-1.1.0.jar +excalibur-lifecycle/jars/excalibur-lifecycle-impl-1.1.jar +excalibur-lifecycle/jars/excalibur-lifecycle-impl-2.1.jar +excalibur-lifecycle/poms/excalibur-lifecycle-api-2.1.pom +excalibur-lifecycle/poms/excalibur-lifecycle-impl-2.1.pom +excalibur-logger/jars/excalibur-logger-1.0.1.jar +excalibur-logger/jars/excalibur-logger-1.0.jar +excalibur-logger/jars/excalibur-logger-1.1.jar +excalibur-logger/jars/excalibur-logger-2.1.jar +excalibur-logger/jars/excalibur-logger-20020820.jar +excalibur-logger/poms/excalibur-logger-2.1.pom +excalibur-monitor/jars/excalibur-monitor-1.0.jar +excalibur-monitor/jars/excalibur-monitor-2.1.jar +excalibur-monitor/jars/excalibur-monitor-20020820.jar +excalibur-monitor/poms/excalibur-monitor-2.1.pom +excalibur-mpool/jars/excalibur-mpool-1.0.jar +excalibur-naming/jars/excalibur-naming-1.0.jar +excalibur-pool/jars/excalibur-pool-1.0.jar +excalibur-pool/jars/excalibur-pool-1.2.jar +excalibur-pool/jars/excalibur-pool-20020820.jar +excalibur-pool/jars/excalibur-pool-api-2.0.0.jar +excalibur-pool/jars/excalibur-pool-instrumented-2.0.0.jar +excalibur-pool/jars/excalibur-pool-api-2.0.jar +excalibur-pool/jars/excalibur-pool-api-2.1.jar +excalibur-pool/jars/excalibur-pool-impl-2.0.0.jar +excalibur-pool/jars/excalibur-pool-impl-2.0.jar +excalibur-pool/jars/excalibur-pool-impl-2.1.jar +excalibur-pool/jars/excalibur-pool-instrumented-2.0.jar +excalibur-pool/jars/excalibur-pool-instrumented-2.1.jar +excalibur-pool/poms/excalibur-pool-api-2.1.pom +excalibur-pool/poms/excalibur-pool-impl-2.1.pom +excalibur-pool/poms/excalibur-pool-instrumented-2.1.pom +excalibur-sourceresolve/jars/excalibur-sourceresolve-1.0.1.jar +excalibur-sourceresolve/jars/excalibur-sourceresolve-1.0.jar +excalibur-sourceresolve/jars/excalibur-sourceresolve-1.1.jar +excalibur-sourceresolve/jars/excalibur-sourceresolve-2.0.jar +excalibur-sourceresolve/jars/excalibur-sourceresolve-2.1.jar +excalibur-sourceresolve/jars/excalibur-sourceresolve-20020820.jar +excalibur-sourceresolve/poms/excalibur-sourceresolve-2.1.pom +excalibur-store/jars/excalibur-store-1.0.jar +excalibur-store/jars/excalibur-store-2.1.jar +excalibur-store/jars/excalibur-store-20020820.jar +excalibur-store/poms/excalibur-store-2.1.pom +excalibur-thread/distributions/excalibur-thread-1.1.1.zip +excalibur-thread/jars/excalibur-thread-1.0.jar +excalibur-thread/jars/excalibur-thread-1.1.1.jar +excalibur-thread/jars/excalibur-thread-api-2.0.0.jar +excalibur-thread/jars/excalibur-thread-instrumented-2.0.0.jar +excalibur-thread/jars/excalibur-thread-api-2.0.jar +excalibur-thread/jars/excalibur-thread-api-2.1.jar +excalibur-thread/jars/excalibur-thread-impl-2.0.0.jar +excalibur-thread/jars/excalibur-thread-impl-2.0.jar +excalibur-thread/jars/excalibur-thread-impl-2.1.jar +excalibur-thread/jars/excalibur-thread-instrumented-2.0.jar +excalibur-thread/jars/excalibur-thread-instrumented-2.1.jar +excalibur-thread/poms/excalibur-thread-api-2.1.pom +excalibur-thread/poms/excalibur-thread-impl-2.1.pom +excalibur-thread/poms/excalibur-thread-instrumented-2.1.pom +fulcrum/jars/fulcrum-1.0.jar +fulcrum/jars/fulcrum-3.0-b1.jar +fulcrum/jars/fulcrum-3.0-b2-dev.jar +fulcrum/jars/fulcrum-crypto-1.0.5.jar +fulcrum/jars/fulcrum-bsf-1.0.2.jar +fulcrum/jars/fulcrum-cache-1.0.5.jar +fulcrum/jars/fulcrum-factory-1.0.3.jar +fulcrum/jars/fulcrum-dvsl-1.0.5.jar +fulcrum/jars/fulcrum-osworkflow-1.0.1.jar +fulcrum/jars/fulcrum-localization-1.0.5.jar +fulcrum/jars/fulcrum-mimetype-1.0.4.jar +fulcrum/jars/fulcrum-naming-1.0.2.jar +fulcrum/jars/fulcrum-security-api-1.0.7.jar +fulcrum/jars/fulcrum-pool-1.0.3.jar +fulcrum/jars/fulcrum-quartz-1.0.jar +fulcrum/jars/fulcrum-security-adapter-opensymphony-1.0.7.jar +fulcrum/jars/fulcrum-security-adapter-turbine-1.0.7.jar +fulcrum/jars/fulcrum-security-hibernate-1.0.7.jar +fulcrum/jars/fulcrum-security-memory-1.0.7.jar +fulcrum/jars/fulcrum-security-nt-1.0.7.jar +fulcrum/jars/fulcrum-testcontainer-1.0.4.jar +fulcrum/jars/fulcrum-upload-1.0.3.jar +fulcrum/jars/fulcrum-xmlrpc-1.0.5.jar +fulcrum/jars/fulcrum-xslt-1.0.3.jar +fulcrum/jars/fulcrum-yaafi-1.0.3.jar +excalibur-util/jars/excalibur-util-1.0.jar +excalibur-xmlutil/jars/excalibur-xmlutil-1.0.jar +excalibur-xmlutil/jars/excalibur-xmlutil-2.1.jar +excalibur-xmlutil/jars/excalibur-xmlutil-20020820.jar +excalibur-xmlutil/poms/excalibur-xmlutil-2.1.pom +geronimo/cars/activemq-1.0.car +geronimo/cars/activemq-broker-1.0.car +geronimo/cars/client-1.0.car +geronimo/cars/client-corba-1.0.car +geronimo/cars/client-security-1.0.car +geronimo/cars/javamail-1.0.car +geronimo/cars/client-system-1.0.car +geronimo/cars/daytrader-derby-jetty-1.0.car +geronimo/cars/daytrader-derby-tomcat-1.0.car +geronimo/cars/daytrader-derby-jetty-streamer-client-1.0.car +geronimo/cars/directory-1.0.car +geronimo/cars/daytrader-derby-tomcat-streamer-client-1.0.car +geronimo/cars/geronimo-gbean-deployer-1.0.car +geronimo/cars/hot-deployer-1.0.car +geronimo/cars/j2ee-system-experimental-1.0.car +geronimo/cars/j2ee-corba-1.0.car +geronimo/cars/j2ee-deployer-1.0.car +geronimo/cars/j2ee-security-1.0.car +geronimo/cars/j2ee-server-1.0.car +geronimo/cars/j2ee-system-1.0.car +geronimo/cars/jetty-1.0.car +geronimo/cars/jetty-deployer-1.0.car +geronimo/cars/jmxdebug-jetty-1.0.car +geronimo/cars/jmxdebug-tomcat-1.0.car +geronimo/cars/jsp-examples-jetty-1.0.car +geronimo/cars/tomcat-1.0.car +geronimo/cars/tomcat-deployer-1.0.car +geronimo/cars/jsp-examples-tomcat-1.0.car +geronimo/cars/ldap-demo-jetty-1.0.car +geronimo/cars/ldap-demo-tomcat-1.0.car +geronimo/cars/ldap-realm-1.0.car +geronimo/cars/rmi-naming-1.0.car +geronimo/cars/online-deployer-1.0.car +geronimo/cars/remote-deploy-jetty-1.0.car +geronimo/cars/remote-deploy-tomcat-1.0.car +geronimo/cars/servlets-examples-jetty-1.0.car +geronimo/cars/servlets-examples-tomcat-1.0.car +geronimo/cars/shutdown-1.0.car +geronimo/cars/system-database-1.0.car +geronimo/cars/uddi-jetty-1.0.car +geronimo/cars/uddi-tomcat-1.0.car +geronimo/cars/webconsole-jetty-1.0.car +geronimo/cars/webconsole-tomcat-1.0.car +geronimo/cars/welcome-jetty-1.0.car +geronimo/cars/welcome-tomcat-1.0.car +geronimo/distributions/geronimo-installer-1.0.jar.MD5 +geronimo/distributions/geronimo-installer-1.0.jar +geronimo/distributions/geronimo-installer-1.0.jar.SHA +geronimo/distributions/geronimo-jetty-j2ee-1.0.tar.gz +geronimo/distributions/geronimo-jetty-j2ee-1.0.zip +geronimo/distributions/geronimo-tomcat-j2ee-1.0.tar.gz +geronimo/distributions/geronimo-tomcat-j2ee-1.0.zip +geronimo/ears/daytrader-ear-1.0.ear +geronimo/ears/daytrader-ear-1.1.ear +geronimo/ears/geronimo-console-1.0.ear +geronimo/ejbs/daytrader-ejb-1.0.jar +geronimo/jars/daytrader-core-1.0.jar +geronimo/jars/daytrader-streamer-1.0.jar +geronimo/jars/daytrader-wsappclient-1.0.jar +geronimo/jars/geronimo-activation-1.0-M4.jar +geronimo/jars/geronimo-1.0-M5.jar +geronimo/jars/geronimo-activation-1.0-M5.jar +geronimo/jars/geronimo-activation-1.0.jar +geronimo/jars/geronimo-activation-1.1.jar +geronimo/jars/geronimo-assembly-1.0-M3.jar +geronimo/jars/geronimo-assembly-1.0-M4.jar +geronimo/jars/geronimo-assembly-plugin-1.0-M4.jar +geronimo/jars/geronimo-assembly-plugin-1.0-M5.jar +geronimo/jars/geronimo-axis-1.0-M2.jar +geronimo/jars/geronimo-axis-1.0-M3.jar +geronimo/jars/geronimo-axis-1.0-M4.jar +geronimo/jars/geronimo-axis-1.0-M5.jar +geronimo/jars/geronimo-axis-1.0.jar +geronimo/jars/geronimo-axis-1.1.jar +geronimo/jars/geronimo-axis-builder-1.0-M4.jar +geronimo/jars/geronimo-axis-builder-1.0-M5.jar +geronimo/jars/geronimo-axis-builder-1.0.jar +geronimo/jars/geronimo-axis-builder-1.1.jar +geronimo/jars/geronimo-client-1.0-M3.jar +geronimo/jars/geronimo-client-1.0-M4.jar +geronimo/jars/geronimo-client-1.0-M5.jar +geronimo/jars/geronimo-client-1.0.jar +geronimo/jars/geronimo-client-1.1.jar +geronimo/jars/geronimo-client-builder-1.0-M3.jar +geronimo/jars/geronimo-client-builder-1.0-M4.jar +geronimo/jars/geronimo-client-builder-1.0-M5.jar +geronimo/jars/geronimo-client-builder-1.0.jar +geronimo/jars/geronimo-client-builder-1.1.jar +geronimo/jars/geronimo-clustering-1.0-M1.jar +geronimo/jars/geronimo-clustering-1.0-M2.jar +geronimo/jars/geronimo-clustering-1.0-M3.jar +geronimo/jars/geronimo-clustering-1.0-M4.jar +geronimo/jars/geronimo-clustering-1.0-M5.jar +geronimo/jars/geronimo-common-1.0-M1.jar +geronimo/jars/geronimo-common-1.0-M2.jar +geronimo/jars/geronimo-common-1.0-M3.jar +geronimo/jars/geronimo-common-1.0-M4.jar +geronimo/jars/geronimo-common-1.0-M5.jar +geronimo/jars/geronimo-common-1.0.jar +geronimo/jars/geronimo-common-1.1.jar +geronimo/jars/geronimo-connector-1.0-M1.jar +geronimo/jars/geronimo-connector-1.0-M2.jar +geronimo/jars/geronimo-connector-1.0-M3.jar +geronimo/jars/geronimo-connector-1.0-M4.jar +geronimo/jars/geronimo-connector-1.0-M5.jar +geronimo/jars/geronimo-connector-1.0.jar +geronimo/jars/geronimo-connector-1.1.jar +geronimo/jars/geronimo-connector-builder-1.0-M3.jar +geronimo/jars/geronimo-connector-builder-1.0-M4.jar +geronimo/jars/geronimo-connector-builder-1.0-M5.jar +geronimo/jars/geronimo-connector-builder-1.0.jar +geronimo/jars/geronimo-connector-builder-1.1.jar +geronimo/jars/geronimo-console-1.0-M5.jar +geronimo/jars/geronimo-console-core-1.0-M5.jar +geronimo/jars/geronimo-console-core-1.0.jar +geronimo/jars/geronimo-console-core-1.1.jar +geronimo/jars/geronimo-converter-1.0.jar +geronimo/jars/geronimo-console-framework-1.0-M5.jar +geronimo/jars/geronimo-console-standard-1.0-M5.jar +geronimo/jars/geronimo-console-web-1.0-M2.jar +geronimo/jars/geronimo-console-web-1.0-M3.jar +geronimo/jars/geronimo-console-web-1.0-M4.jar +geronimo/jars/geronimo-console-web-1.0-M5.jar +geronimo/jars/geronimo-core-1.0-M1.jar +geronimo/jars/geronimo-console-web-1.0.jar +geronimo/jars/geronimo-console-web-1.1.jar +geronimo/jars/geronimo-converter-1.1.jar +geronimo/jars/geronimo-core-1.0-M2.jar +geronimo/jars/geronimo-core-1.0-M3.jar +geronimo/jars/geronimo-core-1.0-M4.jar +geronimo/jars/geronimo-core-1.0-M5.jar +geronimo/jars/geronimo-core-1.0.jar +geronimo/jars/geronimo-core-1.1.jar +geronimo/jars/geronimo-daytrader-derby-db-1.0.jar +geronimo/jars/geronimo-derby-1.0.jar +geronimo/jars/geronimo-daytrader-derby-db-1.1.jar +geronimo/jars/geronimo-demo-1.0-M2.jar +geronimo/jars/geronimo-deploy-config-1.0-M4.jar +geronimo/jars/geronimo-deploy-config-1.0-M5.jar +geronimo/jars/geronimo-deploy-config-1.0.jar +geronimo/jars/geronimo-installer-support-1.1.jar +geronimo/jars/geronimo-deploy-config-1.1.jar +geronimo/jars/geronimo-deploy-jsr88-1.0-M4.jar +geronimo/jars/geronimo-deploy-jsr88-1.0-M5.jar +geronimo/jars/geronimo-deploy-jsr88-1.0.jar +geronimo/jars/geronimo-deploy-jsr88-1.1.jar +geronimo/jars/geronimo-derby-1.1.jar +geronimo/jars/geronimo-deploy-tool-1.0-M4.jar +geronimo/jars/geronimo-deploy-tool-1.0-M5.jar +geronimo/jars/geronimo-deploy-tool-1.0.jar +geronimo/jars/geronimo-deploy-tool-1.1.jar +geronimo/jars/geronimo-deployment-1.0-M1.jar +geronimo/jars/geronimo-deployment-1.0-M2.jar +geronimo/jars/geronimo-deployment-1.0-M3.jar +geronimo/jars/geronimo-deployment-1.0-M4.jar +geronimo/jars/geronimo-deployment-1.0-M5.jar +geronimo/jars/geronimo-deployment-1.0.jar +geronimo/jars/geronimo-deployment-1.1.jar +geronimo/jars/geronimo-derby-1.0-M3.jar +geronimo/jars/geronimo-j2ee-1.0.jar +geronimo/jars/geronimo-derby-1.0-M4.jar +geronimo/jars/geronimo-derby-1.0-M5.jar +geronimo/jars/geronimo-derby-connector-1.0-M3.jar +geronimo/jars/geronimo-derby-connector-1.0-M4.jar +geronimo/jars/geronimo-directory-1.0-M5.jar +geronimo/jars/geronimo-directory-1.0.jar +geronimo/jars/geronimo-directory-1.1.jar +geronimo/jars/geronimo-hot-deploy-1.0.jar +geronimo/jars/geronimo-hot-deploy-1.1.jar +geronimo/jars/geronimo-installer-processing-1.1.jar +geronimo/jars/geronimo-interop-1.0-M4.jar +geronimo/jars/geronimo-interop-1.0-M5.jar +geronimo/jars/geronimo-j2ee-1.0-M1.jar +geronimo/jars/geronimo-j2ee-1.0-M2.jar +geronimo/jars/geronimo-j2ee-1.0-M3.jar +geronimo/jars/geronimo-j2ee-1.0-M4.jar +geronimo/jars/geronimo-j2ee-1.0-M5.jar +geronimo/jars/geronimo-j2ee-builder-1.0-M3.jar +geronimo/jars/geronimo-j2ee-1.1.jar +geronimo/jars/geronimo-j2ee-builder-1.0-M4.jar +geronimo/jars/geronimo-j2ee-builder-1.0-M5.jar +geronimo/jars/geronimo-j2ee-builder-1.0.jar +geronimo/jars/geronimo-j2ee-schema-1.1.jar +geronimo/jars/geronimo-j2ee-builder-1.1.jar +geronimo/jars/geronimo-j2ee-schema-1.0-M2.jar +geronimo/jars/geronimo-j2ee-schema-1.0-M3.jar +geronimo/jars/geronimo-j2ee-schema-1.0-M4.jar +geronimo/jars/geronimo-j2ee-schema-1.0-M5.jar +geronimo/jars/geronimo-j2ee-schema-1.0.jar +geronimo/jars/geronimo-javamail-transport-1.0.jar +geronimo/jars/geronimo-javamail-transport-1.1.jar +geronimo/jars/geronimo-jetty-1.0-M1.jar +geronimo/jars/geronimo-jetty-1.0-M2.jar +geronimo/jars/geronimo-jetty-1.0-M3.jar +geronimo/jars/geronimo-jetty-1.0-M4.jar +geronimo/jars/geronimo-jetty-1.0-M5.jar +geronimo/jars/geronimo-jetty-1.0.jar +geronimo/jars/geronimo-jetty-1.1.jar +geronimo/jars/geronimo-jetty-builder-1.0-M3.jar +geronimo/jars/geronimo-jetty-builder-1.0-M4.jar +geronimo/jars/geronimo-jetty-builder-1.0-M5.jar +geronimo/jars/geronimo-kernel-1.0.jar +geronimo/jars/geronimo-jetty-builder-1.0.jar +geronimo/jars/geronimo-jetty-builder-1.1.jar +geronimo/jars/geronimo-jmxdebug-1.0-M2.jar +geronimo/jars/geronimo-jmxremoting-1.0-M2.jar +geronimo/jars/geronimo-jmxremoting-1.0-M3.jar +geronimo/jars/geronimo-jmxremoting-1.0-M4.jar +geronimo/jars/geronimo-jmxremoting-1.0-M5.jar +geronimo/jars/geronimo-jmxremoting-1.0.jar +geronimo/jars/geronimo-jmxremoting-1.1.jar +geronimo/jars/geronimo-kernel-1.0-M1.jar +geronimo/jars/geronimo-kernel-1.0-M2.jar +geronimo/jars/geronimo-kernel-1.0-M3.jar +geronimo/jars/geronimo-kernel-1.0-M4.jar +geronimo/jars/geronimo-kernel-1.0-M5.jar +geronimo/jars/geronimo-kernel-1.1.jar +geronimo/jars/geronimo-mail-1.0-M3.jar +geronimo/jars/geronimo-mail-1.0-M4.jar +geronimo/jars/geronimo-mail-1.0-M5.jar +geronimo/jars/geronimo-mail-1.0.jar +geronimo/jars/geronimo-mail-1.1.jar +geronimo/jars/geronimo-management-1.0-M5.jar +geronimo/jars/geronimo-management-1.0.jar +geronimo/jars/geronimo-management-1.1.jar +geronimo/jars/geronimo-naming-1.0-M1.jar +geronimo/jars/geronimo-naming-1.0-M2.jar +geronimo/jars/geronimo-naming-1.0-M3.jar +geronimo/jars/geronimo-naming-1.0-M4.jar +geronimo/jars/geronimo-naming-1.0-M5.jar +geronimo/jars/geronimo-naming-1.0.jar +geronimo/jars/geronimo-naming-1.1.jar +geronimo/jars/geronimo-naming-builder-1.0-M3.jar +geronimo/jars/geronimo-naming-builder-1.0-M4.jar +geronimo/jars/geronimo-naming-builder-1.0-M5.jar +geronimo/jars/geronimo-network-1.0-M1.jar +geronimo/jars/geronimo-naming-builder-1.0.jar +geronimo/jars/geronimo-naming-builder-1.1.jar +geronimo/jars/geronimo-network-1.0-M2.jar +geronimo/jars/geronimo-network-1.0-M3.jar +geronimo/jars/geronimo-packaging-plugin-1.0-M5.jar +geronimo/jars/geronimo-scripts-1.0.jar +geronimo/jars/geronimo-remote-deploy-lib-1.0.jar +geronimo/jars/geronimo-remote-deploy-lib-1.1.jar +geronimo/jars/geronimo-remoting-1.0-M1.jar +geronimo/jars/geronimo-remoting-1.0-M2.jar +geronimo/jars/geronimo-remoting-1.0-M3.jar +geronimo/jars/geronimo-spring-1.0-M3.jar +geronimo/jars/geronimo-scripts-1.1.jar +geronimo/jars/geronimo-security-1.0-M1.jar +geronimo/jars/geronimo-security-1.0-M2.jar +geronimo/jars/geronimo-security-1.0-M3.jar +geronimo/jars/geronimo-security-1.0-M4.jar +geronimo/jars/geronimo-security-1.0-M5.jar +geronimo/jars/geronimo-security-1.0.jar +geronimo/jars/geronimo-security-1.1.jar +geronimo/jars/geronimo-security-builder-1.0-M3.jar +geronimo/jars/geronimo-security-builder-1.0-M4.jar +geronimo/jars/geronimo-security-builder-1.0-M5.jar +geronimo/jars/geronimo-security-builder-1.0.jar +geronimo/jars/geronimo-security-builder-1.1.jar +geronimo/jars/geronimo-service-builder-1.0-M4.jar +geronimo/jars/geronimo-service-builder-1.0-M5.jar +geronimo/jars/geronimo-service-builder-1.0.jar +geronimo/jars/geronimo-service-builder-1.1.jar +geronimo/jars/geronimo-servicemix-1.0-M4.jar +geronimo/jars/geronimo-servicemix-1.0-M5.jar +geronimo/jars/geronimo-servicemix-builder-1.0-M4.jar +geronimo/jars/geronimo-servicemix-builder-1.0-M5.jar +geronimo/jars/geronimo-spring-1.0-M2.jar +geronimo/jars/geronimo-spring-1.0-M4.jar +geronimo/jars/geronimo-spring-1.0-M5.jar +geronimo/jars/geronimo-spring-builder-1.0-M4.jar +geronimo/jars/geronimo-spring-builder-1.0-M5.jar +geronimo/jars/geronimo-system-1.0-M1.jar +geronimo/jars/geronimo-system-1.0-M2.jar +geronimo/jars/geronimo-system-1.0-M3.jar +geronimo/jars/geronimo-system-1.0-M4.jar +geronimo/jars/geronimo-system-1.0-M5.jar +geronimo/jars/geronimo-system-1.0.jar +geronimo/jars/geronimo-system-1.1.jar +geronimo/jars/geronimo-test-ddbean-1.0-M4.jar +geronimo/jars/geronimo-test-ddbean-1.0-M5.jar +geronimo/jars/geronimo-test-ddbean-1.0.jar +geronimo/jars/geronimo-test-ddbean-1.1.jar +geronimo/jars/geronimo-timer-1.0-M2.jar +geronimo/jars/geronimo-timer-1.0-M3.jar +geronimo/jars/geronimo-timer-1.0-M4.jar +geronimo/jars/geronimo-timer-1.0-M5.jar +geronimo/jars/geronimo-timer-1.0.jar +geronimo/jars/geronimo-timer-1.1.jar +geronimo/jars/geronimo-tomcat-1.0-M3.jar +geronimo/jars/geronimo-tomcat-1.0-M4.jar +geronimo/jars/geronimo-tomcat-1.0-M5.jar +geronimo/jars/geronimo-tomcat-1.0.jar +geronimo/jars/geronimo-tomcat-1.1.jar +geronimo/jars/geronimo-transaction-1.0-M2.jar +geronimo/jars/geronimo-tomcat-builder-1.0-M4.jar +geronimo/jars/geronimo-tomcat-builder-1.0-M5.jar +geronimo/jars/geronimo-tomcat-builder-1.0.jar +geronimo/jars/geronimo-tomcat-builder-1.1.jar +geronimo/jars/geronimo-transaction-1.0-M1.jar +geronimo/jars/geronimo-util-1.0.jar +geronimo/jars/geronimo-transaction-1.0-M3.jar +geronimo/jars/geronimo-transaction-1.0-M4.jar +geronimo/jars/geronimo-transaction-1.0-M5.jar +geronimo/jars/geronimo-transaction-1.0.jar +geronimo/jars/geronimo-transaction-1.1.jar +geronimo/jars/geronimo-uddi-db-1.0.jar +geronimo/jars/geronimo-uddi-db-1.1.jar +geronimo/jars/geronimo-uddi-server-1.0-M4.jar +geronimo/jars/geronimo-uddi-server-1.0-M5.jar +geronimo/jars/geronimo-upgrade-1.1.jar +geronimo/jars/geronimo-util-1.0-M5.jar +geronimo/jars/geronimo-web-builder-1.0-M4.jar +geronimo/jars/geronimo-util-1.1.jar +geronimo/jars/geronimo-web-builder-1.0-M5.jar +geronimo/jars/geronimo-web-builder-1.0.jar +geronimo/jars/geronimo-web-builder-1.1.jar +geronimo/jars/geronimo-webservices-1.0-M4.jar +geronimo/jars/geronimo-webservices-1.0-M5.jar +geronimo/jars/geronimo-webservices-1.0.jar +geronimo/jars/geronimo-webservices-1.1.jar +geronimo/jars/geronimo-welcome-1.0-M5.jar +geronimo/jars/geronimo-xmlbeans-plugin-1.0-M2.jar +geronimo/plugins/geronimo-assembly-plugin-1.0.2.jar +geronimo/plugins/geronimo-dependency-plugin-1.0.0.jar +geronimo/plugins/geronimo-deployment-plugin-1.0-M1.jar +geronimo/plugins/geronimo-deployment-plugin-1.0-M3.jar +geronimo/plugins/geronimo-deployment-plugin-1.0-M4.jar +geronimo/plugins/geronimo-deployment-plugin-1.0-M5.jar +geronimo/plugins/geronimo-deployment-plugin-1.0.0.jar +geronimo/plugins/geronimo-izpack-plugin-1.0.jar +geronimo/plugins/geronimo-packaging-plugin-1.0.1.jar +geronimo/plugins/geronimo-xmlbeans-plugin-1.0-M1.jar +geronimo/plugins/geronimo-xmlbeans-plugin-1.0-M3.jar +geronimo/plugins/geronimo-xmlbeans-plugin-1.0-M4.jar +geronimo/plugins/geronimo-xpom-plugin-1.0-M3.jar +geronimo/plugins/geronimo-xpom-plugin-1.0-M4.jar +geronimo/plugins/xmlbeans-maven-plugin-2.0.0-beta1.jar +geronimo/poms/activemq-1.0.pom +geronimo/poms/activemq-broker-1.0.pom +geronimo/poms/client-1.0.pom +geronimo/poms/client-corba-1.0.pom +geronimo/poms/client-security-1.0.pom +geronimo/poms/client-system-1.0.pom +geronimo/poms/client-system-1.1.pom +geronimo/poms/daytrader-core-1.0.pom +geronimo/poms/daytrader-derby-jetty-1.0.pom +geronimo/poms/daytrader-derby-tomcat-1.0.pom +geronimo/poms/daytrader-ear-1.0.pom +geronimo/poms/daytrader-ear-1.1.pom +geronimo/poms/daytrader-ejb-1.0.pom +geronimo/poms/directory-1.0.pom +geronimo/poms/daytrader-streamer-1.0.pom +geronimo/poms/daytrader-web-1.0.pom +geronimo/poms/daytrader-wsappclient-1.0.pom +geronimo/poms/ge-activemq-rar-1.1.pom +geronimo/poms/geronimo-1.0-M5.pom +geronimo/poms/geronimo-activation-1.0-M4.pom +geronimo/poms/geronimo-activation-1.0-M5.pom +geronimo/poms/geronimo-activation-1.0.pom +geronimo/poms/geronimo-activation-1.1.pom +geronimo/poms/geronimo-axis-1.0.pom +geronimo/poms/geronimo-axis-builder-1.0-M4.pom +geronimo/poms/geronimo-assembly-1.0-M3.pom +geronimo/poms/geronimo-assembly-1.0-M4.pom +geronimo/poms/geronimo-assembly-plugin-1.0-M4.pom +geronimo/poms/geronimo-assembly-plugin-1.0-M5.pom +geronimo/poms/geronimo-assembly-plugin-1.0.2.pom +geronimo/poms/j2ee-corba-1.0.pom +geronimo/poms/geronimo-assembly-plugin-1.1.0-12.pom +geronimo/poms/geronimo-axis-1.0-M2.pom +geronimo/poms/geronimo-axis-1.0-M3.pom +geronimo/poms/geronimo-axis-1.0-M4.pom +geronimo/poms/geronimo-axis-1.0-M5.pom +geronimo/poms/geronimo-axis-1.1.pom +geronimo/poms/geronimo-axis-builder-1.0-M5.pom +geronimo/poms/geronimo-axis-builder-1.0.pom +geronimo/poms/geronimo-client-1.1.pom +geronimo/poms/geronimo-axis-builder-1.1.pom +geronimo/poms/geronimo-client-1.0-M3.pom +geronimo/poms/geronimo-client-1.0-M4.pom +geronimo/poms/geronimo-client-1.0-M5.pom +geronimo/poms/geronimo-client-1.0.pom +geronimo/poms/geronimo-client-builder-1.0-M3.pom +geronimo/poms/geronimo-client-builder-1.0-M4.pom +geronimo/poms/geronimo-client-builder-1.0-M5.pom +geronimo/poms/geronimo-client-builder-1.0.pom +geronimo/poms/geronimo-client-builder-1.1.pom +geronimo/poms/geronimo-common-1.0-M4.pom +geronimo/poms/geronimo-common-1.0-M5.pom +geronimo/poms/geronimo-clustering-1.0-M2.pom +geronimo/poms/geronimo-clustering-1.0-M3.pom +geronimo/poms/geronimo-clustering-1.0-M4.pom +geronimo/poms/geronimo-clustering-1.0-M5.pom +geronimo/poms/geronimo-common-1.0-M2.pom +geronimo/poms/geronimo-common-1.0-M3.pom +geronimo/poms/geronimo-common-1.0.pom +geronimo/poms/geronimo-common-1.1.pom +geronimo/poms/geronimo-connector-1.0-M2.pom +geronimo/poms/geronimo-connector-1.0-M3.pom +geronimo/poms/geronimo-connector-1.0-M4.pom +geronimo/poms/geronimo-connector-1.0-M5.pom +geronimo/poms/geronimo-connector-1.0.pom +geronimo/poms/geronimo-connector-1.1.pom +geronimo/poms/geronimo-connector-builder-1.0-M3.pom +geronimo/poms/geronimo-connector-builder-1.0-M4.pom +geronimo/poms/geronimo-connector-builder-1.0-M5.pom +geronimo/poms/geronimo-connector-builder-1.0.pom +geronimo/poms/geronimo-connector-builder-1.1.pom +geronimo/poms/geronimo-console-1.0-M5.pom +geronimo/poms/geronimo-console-1.0.pom +geronimo/poms/geronimo-console-1.1.pom +geronimo/poms/geronimo-console-core-1.0-M5.pom +geronimo/poms/geronimo-console-core-1.0.pom +geronimo/poms/geronimo-console-core-1.1.pom +geronimo/poms/geronimo-console-framework-1.0-M5.pom +geronimo/poms/geronimo-console-framework-1.0.pom +geronimo/poms/geronimo-deployment-1.1.pom +geronimo/poms/jetty-1.0.pom +geronimo/poms/geronimo-console-framework-1.1.pom +geronimo/poms/geronimo-console-standard-1.0-M5.pom +geronimo/poms/geronimo-console-standard-1.0.pom +geronimo/poms/geronimo-core-1.0.pom +geronimo/poms/geronimo-console-standard-1.1.pom +geronimo/poms/geronimo-console-web-1.0-M2.pom +geronimo/poms/geronimo-console-web-1.0-M3.pom +geronimo/poms/geronimo-console-web-1.0-M4.pom +geronimo/poms/geronimo-console-web-1.0-M5.pom +geronimo/poms/tomcat-1.0.pom +geronimo/poms/geronimo-console-web-1.0.pom +geronimo/poms/geronimo-console-web-1.1.pom +geronimo/poms/geronimo-converter-1.0.pom +geronimo/poms/geronimo-converter-1.1.pom +geronimo/poms/geronimo-core-1.0-M2.pom +geronimo/poms/geronimo-core-1.0-M3.pom +geronimo/poms/geronimo-core-1.0-M4.pom +geronimo/poms/geronimo-core-1.0-M5.pom +geronimo/poms/geronimo-core-1.1.pom +geronimo/poms/geronimo-demo-1.0.pom +geronimo/poms/geronimo-daytrader-derby-db-1.0.pom +geronimo/poms/geronimo-daytrader-derby-db-1.1.pom +geronimo/poms/geronimo-demo-1.0-M2.pom +geronimo/poms/geronimo-demo-1.0-M3.pom +geronimo/poms/geronimo-demo-1.0-M4.pom +geronimo/poms/geronimo-demo-1.1.pom +geronimo/poms/geronimo-demo-1.0-M5.pom +geronimo/poms/geronimo-dependency-plugin-1.0.0.pom +geronimo/poms/geronimo-dependency-plugin-1.1.0-3.pom +geronimo/poms/geronimo-deploy-config-1.0-M4.pom +geronimo/poms/geronimo-deploy-config-1.0-M5.pom +geronimo/poms/geronimo-deploy-config-1.0.pom +geronimo/poms/geronimo-deploy-config-1.1.pom +geronimo/poms/geronimo-deploy-jsr88-1.0-M4.pom +geronimo/poms/geronimo-deploy-jsr88-1.0-M5.pom +geronimo/poms/geronimo-deploy-jsr88-1.0.pom +geronimo/poms/geronimo-deploy-jsr88-1.1.pom +geronimo/poms/j2ee-server-1.0.pom +geronimo/poms/geronimo-deploy-tool-1.0-M4.pom +geronimo/poms/geronimo-deploy-tool-1.0-M5.pom +geronimo/poms/geronimo-deploy-tool-1.0.pom +geronimo/poms/geronimo-deploy-tool-1.1.pom +geronimo/poms/geronimo-deployment-1.0-M2.pom +geronimo/poms/geronimo-deployment-1.0-M3.pom +geronimo/poms/geronimo-deployment-1.0-M4.pom +geronimo/poms/geronimo-deployment-1.0-M5.pom +geronimo/poms/geronimo-deployment-1.0.pom +geronimo/poms/geronimo-deployment-plugin-1.0-M2.pom +geronimo/poms/geronimo-deployment-plugin-1.0-M4.pom +geronimo/poms/geronimo-deployment-plugin-1.0-M5.pom +geronimo/poms/geronimo-deployment-plugin-1.0.0.pom +geronimo/poms/geronimo-derby-1.0-M3.pom +geronimo/poms/geronimo-deployment-plugin-1.1.0-3.pom +geronimo/poms/geronimo-derby-1.0-M4.pom +geronimo/poms/geronimo-derby-1.0-M5.pom +geronimo/poms/geronimo-derby-1.0.pom +geronimo/poms/geronimo-derby-1.1.pom +geronimo/poms/geronimo-derby-connector-1.0-M3.pom +geronimo/poms/geronimo-derby-connector-1.0-M4.pom +geronimo/poms/geronimo-directory-1.0-M5.pom +geronimo/poms/geronimo-directory-1.0.pom +geronimo/poms/geronimo-directory-1.1.pom +geronimo/poms/geronimo-gbean-deployer-1.0.pom +geronimo/poms/geronimo-gbean-deployer-1.1.pom +geronimo/poms/geronimo-hot-deploy-1.0.pom +geronimo/poms/geronimo-hot-deploy-1.1.pom +geronimo/poms/geronimo-installer-processing-1.1.pom +geronimo/poms/geronimo-installer-support-1.1.pom +geronimo/poms/geronimo-jetty-1.0-M3.pom +geronimo/poms/j2ee-system-1.0.pom +geronimo/poms/geronimo-interop-1.0-M4.pom +geronimo/poms/geronimo-interop-1.0-M5.pom +geronimo/poms/geronimo-izpack-plugin-1.0.pom +geronimo/poms/geronimo-izpack-plugin-1.1.pom +geronimo/poms/geronimo-j2ee-1.0-M2.pom +geronimo/poms/geronimo-j2ee-1.0-M3.pom +geronimo/poms/geronimo-j2ee-1.0-M4.pom +geronimo/poms/geronimo-j2ee-1.0-M5.pom +geronimo/poms/geronimo-j2ee-1.0.pom +geronimo/poms/geronimo-j2ee-1.1.pom +geronimo/poms/geronimo-j2ee-builder-1.0-M3.pom +geronimo/poms/geronimo-j2ee-builder-1.0-M4.pom +geronimo/poms/geronimo-j2ee-builder-1.0-M5.pom +geronimo/poms/geronimo-j2ee-builder-1.0.pom +geronimo/poms/geronimo-j2ee-builder-1.1.pom +geronimo/poms/j2ee-system-1.1.pom +geronimo/poms/geronimo-j2ee-schema-1.0-M2.pom +geronimo/poms/geronimo-j2ee-schema-1.0-M3.pom +geronimo/poms/geronimo-j2ee-schema-1.0-M4.pom +geronimo/poms/geronimo-j2ee-schema-1.0-M5.pom +geronimo/poms/geronimo-j2ee-schema-1.0.pom +geronimo/poms/geronimo-j2ee-schema-1.1.pom +geronimo/poms/geronimo-javamail-transport-1.0.pom +geronimo/poms/geronimo-javamail-transport-1.1.pom +geronimo/poms/geronimo-jetty-1.0-M2.pom +geronimo/poms/geronimo-jetty-1.0-M4.pom +geronimo/poms/geronimo-jetty-1.0-M5.pom +geronimo/poms/geronimo-jetty-1.0.pom +geronimo/poms/geronimo-jetty-1.1.pom +geronimo/poms/geronimo-jetty-builder-1.0-M3.pom +geronimo/poms/geronimo-jetty-builder-1.0-M4.pom +geronimo/poms/javamail-1.0.pom +geronimo/poms/geronimo-jetty-builder-1.0-M5.pom +geronimo/poms/geronimo-jetty-builder-1.0.pom +geronimo/poms/geronimo-jetty-builder-1.1.pom +geronimo/poms/geronimo-jmxdebug-1.0-M2.pom +geronimo/poms/geronimo-jmxdebug-1.0.pom +geronimo/poms/geronimo-jmxdebug-1.0-M3.pom +geronimo/poms/geronimo-jmxdebug-1.0-M4.pom +geronimo/poms/geronimo-jmxdebug-1.0-M5.pom +geronimo/poms/geronimo-jmxremoting-1.0-M2.pom +geronimo/poms/geronimo-jmxremoting-1.0-M3.pom +geronimo/poms/geronimo-jmxremoting-1.0-M4.pom +geronimo/poms/geronimo-jmxremoting-1.0-M5.pom +geronimo/poms/geronimo-kernel-1.0-M5.pom +geronimo/poms/geronimo-jmxremoting-1.0.pom +geronimo/poms/geronimo-jmxremoting-1.1.pom +geronimo/poms/geronimo-kernel-1.0-M2.pom +geronimo/poms/geronimo-kernel-1.0-M3.pom +geronimo/poms/geronimo-kernel-1.0-M4.pom +geronimo/poms/geronimo-kernel-1.0.pom +geronimo/poms/geronimo-kernel-1.1.pom +geronimo/poms/geronimo-ldap-demo-1.0.pom +geronimo/poms/geronimo-ldap-demo-1.1.pom +geronimo/poms/geronimo-mail-1.0-M3.pom +geronimo/poms/geronimo-mail-1.0-M4.pom +geronimo/poms/geronimo-mail-1.0-M5.pom +geronimo/poms/geronimo-mail-1.0.pom +geronimo/poms/geronimo-mail-1.1.pom +geronimo/poms/geronimo-naming-1.0.pom +geronimo/poms/geronimo-management-1.0-M5.pom +geronimo/poms/geronimo-management-1.0.pom +geronimo/poms/geronimo-management-1.1.pom +geronimo/poms/geronimo-naming-1.1.pom +geronimo/poms/geronimo-naming-1.0-M2.pom +geronimo/poms/geronimo-naming-1.0-M3.pom +geronimo/poms/geronimo-naming-1.0-M4.pom +geronimo/poms/geronimo-naming-1.0-M5.pom +geronimo/poms/geronimo-naming-builder-1.0-M3.pom +geronimo/poms/geronimo-naming-builder-1.0-M4.pom +geronimo/poms/geronimo-naming-builder-1.0-M5.pom +geronimo/poms/geronimo-naming-builder-1.0.pom +geronimo/poms/geronimo-naming-builder-1.1.pom +geronimo/poms/geronimo-network-1.0-M2.pom +geronimo/poms/geronimo-network-1.0-M3.pom +geronimo/poms/geronimo-packaging-plugin-0.1.1.pom +geronimo/poms/geronimo-packaging-plugin-0.1.pom +geronimo/poms/geronimo-packaging-plugin-1.0-M5.pom +geronimo/poms/geronimo-packaging-plugin-1.0.1.pom +geronimo/poms/geronimo-packaging-plugin-1.1.0-10.pom +geronimo/poms/geronimo-remote-deploy-1.0.pom +geronimo/poms/geronimo-remote-deploy-1.1.pom +geronimo/poms/geronimo-remote-deploy-lib-1.0.pom +geronimo/poms/geronimo-remote-deploy-lib-1.1.pom +geronimo/poms/geronimo-remoting-1.0-M2.pom +geronimo/poms/geronimo-remoting-1.0-M3.pom +geronimo/poms/geronimo-scripts-1.0.pom +geronimo/poms/geronimo-scripts-1.1.pom +geronimo/poms/geronimo-security-1.0-M2.pom +geronimo/poms/geronimo-security-1.0-M3.pom +geronimo/poms/geronimo-security-1.0-M4.pom +geronimo/poms/geronimo-security-1.0-M5.pom +geronimo/poms/geronimo-security-1.0.pom +geronimo/poms/geronimo-security-1.1.pom +geronimo/poms/geronimo-system-1.0.pom +geronimo/poms/geronimo-security-builder-1.0-M3.pom +geronimo/poms/geronimo-security-builder-1.0-M4.pom +geronimo/poms/geronimo-security-builder-1.0-M5.pom +geronimo/poms/geronimo-security-builder-1.0.pom +geronimo/poms/geronimo-security-builder-1.1.pom +geronimo/poms/geronimo-service-builder-1.0-M4.pom +geronimo/poms/geronimo-service-builder-1.0-M5.pom +geronimo/poms/geronimo-service-builder-1.0.pom +geronimo/poms/geronimo-service-builder-1.1.pom +geronimo/poms/geronimo-servicemix-1.0-M4.pom +geronimo/poms/geronimo-servicemix-1.0-M5.pom +geronimo/poms/geronimo-servicemix-builder-1.0-M4.pom +geronimo/poms/geronimo-servicemix-builder-1.0-M5.pom +geronimo/poms/geronimo-spring-1.0-M2.pom +geronimo/poms/geronimo-test-ddbean-1.0-M5.pom +geronimo/poms/ldap-realm-1.0.pom +geronimo/poms/geronimo-spring-1.0-M3.pom +geronimo/poms/geronimo-spring-1.0-M4.pom +geronimo/poms/geronimo-spring-1.0-M5.pom +geronimo/poms/geronimo-spring-builder-1.0-M4.pom +geronimo/poms/geronimo-spring-builder-1.0-M5.pom +geronimo/poms/geronimo-system-1.0-M2.pom +geronimo/poms/geronimo-system-1.0-M3.pom +geronimo/poms/geronimo-system-1.0-M4.pom +geronimo/poms/geronimo-system-1.0-M5.pom +geronimo/poms/geronimo-system-1.1.pom +geronimo/poms/geronimo-test-ddbean-1.0-M4.pom +geronimo/poms/geronimo-timer-1.0-M4.pom +geronimo/poms/magicGball-1.0.pom +geronimo/poms/geronimo-test-ddbean-1.0.pom +geronimo/poms/geronimo-test-ddbean-1.1.pom +geronimo/poms/geronimo-timer-1.0-M2.pom +geronimo/poms/geronimo-timer-1.0-M3.pom +geronimo/poms/geronimo-tomcat-builder-1.0-M4.pom +geronimo/poms/geronimo-timer-1.0-M5.pom +geronimo/poms/geronimo-timer-1.0.pom +geronimo/poms/geronimo-timer-1.1.pom +geronimo/poms/geronimo-tomcat-1.0-M3.pom +geronimo/poms/geronimo-tomcat-1.0-M4.pom +geronimo/poms/geronimo-tomcat-1.0-M5.pom +geronimo/poms/geronimo-tomcat-1.0.pom +geronimo/poms/geronimo-tomcat-1.1.pom +geronimo/poms/geronimo-tomcat-builder-1.0-M5.pom +geronimo/poms/geronimo-uddi-db-1.0.pom +geronimo/poms/geronimo-tomcat-builder-1.0.pom +geronimo/poms/geronimo-tomcat-builder-1.1.pom +geronimo/poms/geronimo-transaction-1.0-M2.pom +geronimo/poms/geronimo-transaction-1.0-M3.pom +geronimo/poms/geronimo-transaction-1.0-M4.pom +geronimo/poms/geronimo-transaction-1.0-M5.pom +geronimo/poms/geronimo-transaction-1.0.pom +geronimo/poms/geronimo-transaction-1.1.pom +geronimo/poms/geronimo-uddi-db-1.1.pom +geronimo/poms/geronimo-uddi-server-1.0-M4.pom +geronimo/poms/geronimo-uddi-server-1.0-M5.pom +geronimo/poms/geronimo-uddi-server-1.0.pom +geronimo/poms/geronimo-uddi-server-1.1.pom +geronimo/poms/geronimo-upgrade-1.1.pom +geronimo/poms/geronimo-util-1.0-M5.pom +geronimo/poms/geronimo-util-1.0.pom +geronimo/poms/geronimo-util-1.1.pom +geronimo/poms/geronimo-web-builder-1.0-M4.pom +geronimo/poms/geronimo-web-builder-1.0-M5.pom +geronimo/poms/geronimo-web-builder-1.0.pom +geronimo/poms/geronimo-web-builder-1.1.pom +geronimo/poms/rmi-naming-1.0.pom +geronimo/poms/geronimo-webservices-1.0-M4.pom +geronimo/poms/geronimo-webservices-1.0-M5.pom +geronimo/poms/geronimo-webservices-1.0.pom +geronimo/poms/geronimo-webservices-1.1.pom +geronimo/poms/geronimo-welcome-1.0-M5.pom +geronimo/poms/geronimo-welcome-1.0.pom +geronimo/poms/geronimo-welcome-1.1.pom +geronimo/poms/geronimo-xmlbeans-plugin-1.0-20040908.pom +geronimo/poms/geronimo-xmlbeans-plugin-1.0-46009.pom +geronimo/poms/geronimo-xmlbeans-plugin-1.0-M2.pom +geronimo/poms/geronimo-xmlbeans-plugin-1.0-M3.pom +geronimo/poms/geronimo-xmlbeans-plugin-1.0-M4.pom +geronimo/poms/geronimo-xpom-plugin-1.0-M4.pom +geronimo/poms/hot-deployer-1.0.pom +geronimo/poms/j2ee-deployer-1.0.pom +geronimo/poms/j2ee-security-1.0.pom +geronimo/poms/j2ee-system-experimental-1.0.pom +geronimo/poms/jetty-deployer-1.0.pom +geronimo/poms/jmxdebug-jetty-1.0.pom +geronimo/poms/jmxdebug-tomcat-1.0.pom +geronimo/poms/jsp-examples-jetty-1.0.pom +geronimo/poms/jsp-examples-tomcat-1.0.pom +geronimo/poms/ldap-demo-jetty-1.0.pom +geronimo/poms/ldap-demo-tomcat-1.0.pom +geronimo/poms/magicGball-1.1.pom +geronimo/poms/maven-metadata-mavenOneRepository.xml +geronimo/poms/online-deployer-1.0.pom +geronimo/poms/online-deployer-1.1.pom +geronimo/poms/remote-deploy-jetty-1.0.pom +geronimo/poms/servlets-examples-jetty-1.0.pom +geronimo/poms/remote-deploy-tomcat-1.0.pom +geronimo/poms/servlets-examples-tomcat-1.0.pom +geronimo/poms/shutdown-1.0.pom +geronimo/poms/shutdown-1.1.pom +geronimo/poms/system-database-1.0.pom +geronimo/poms/tomcat-deployer-1.0.pom +geronimo/poms/uddi-jetty-1.0.pom +geronimo/poms/uddi-tomcat-1.0.pom +geronimo/poms/upgrade-cli-1.1.pom +geronimo/poms/webconsole-jetty-1.0.pom +geronimo/poms/webconsole-tomcat-1.0.pom +geronimo/poms/welcome-jetty-1.0.pom +geronimo/poms/welcome-tomcat-1.0.pom +geronimo/poms/xmlbeans-maven-plugin-2.0.0-beta1.pom +geronimo/rars/geronimo-derby-connector-1.0-M3.rar +geronimo/rars/geronimo-derby-connector-1.0-M4.rar +geronimo/wars/daytrader-web-1.0.war +geronimo/wars/geronimo-console-framework-1.0.war +geronimo/wars/geronimo-servlet-examples-tomcat-5.5.12.war +geronimo/wars/geronimo-console-standard-1.0.war +geronimo/wars/geronimo-console-web-1.0-M1.war +geronimo/wars/geronimo-demo-1.0-M3.war +geronimo/wars/geronimo-demo-1.0-M4.war +geronimo/wars/geronimo-demo-1.0-M5.war +geronimo/wars/geronimo-demo-1.0.war +geronimo/wars/geronimo-jmxdebug-1.0-M1.war +geronimo/wars/geronimo-jmxdebug-1.0-M3.war +geronimo/wars/geronimo-jmxdebug-1.0-M4.war +geronimo/wars/geronimo-jmxdebug-1.0-M5.war +geronimo/wars/geronimo-jmxdebug-1.0.war +geronimo/wars/geronimo-jsp-examples-tomcat-5.5.12.war +geronimo/wars/geronimo-ldap-demo-1.0.war +geronimo/wars/geronimo-remote-deploy-1.0.war +geronimo/wars/geronimo-uddi-server-1.0.war +geronimo/wars/geronimo-welcome-1.0.war +geronimo/wars/magicGball-1.0.war +geronimo/KEYS +geronimo-spec/jars/geronimo-spec-activation-1.0.2-rc1.jar +geronimo-spec/jars/geronimo-spec-activation-1.0.2-rc2.jar +geronimo-spec/jars/geronimo-spec-activation-1.0.2-rc3.jar +geronimo-spec/jars/geronimo-spec-activation-1.0.2-rc4.jar +geronimo-spec/jars/geronimo-spec-corba-2.3-rc4.jar +geronimo-spec/jars/geronimo-spec-ejb-1.0-M1.jar +geronimo-spec/jars/geronimo-spec-ejb-2.1-rc1.jar +geronimo-spec/jars/geronimo-spec-ejb-2.1-rc2.jar +geronimo-spec/jars/geronimo-spec-ejb-2.1-rc3.jar +geronimo-spec/jars/geronimo-spec-ejb-2.1-rc4.jar +geronimo-spec/jars/geronimo-spec-ejb-DEV.jar +geronimo-spec/jars/geronimo-spec-j2ee-1.0-M1.jar +geronimo-spec/jars/geronimo-spec-j2ee-connector-1.0-M1.jar +geronimo-spec/jars/geronimo-spec-j2ee-1.4-rc1.jar +geronimo-spec/jars/geronimo-spec-j2ee-1.4-rc2.jar +geronimo-spec/jars/geronimo-spec-j2ee-1.4-rc3.jar +geronimo-spec/jars/geronimo-spec-j2ee-1.4-rc4.jar +geronimo-spec/jars/geronimo-spec-jaxr-1.0-rc1.jar +geronimo-spec/jars/geronimo-spec-j2ee-connector-1.5-rc1.jar +geronimo-spec/jars/geronimo-spec-j2ee-connector-1.5-rc2.jar +geronimo-spec/jars/geronimo-spec-j2ee-connector-1.5-rc3.jar +geronimo-spec/jars/geronimo-spec-j2ee-connector-1.5-rc4.jar +geronimo-spec/jars/geronimo-spec-j2ee-deployment-1.0-M1.jar +geronimo-spec/jars/geronimo-spec-j2ee-deployment-1.1-rc1.jar +geronimo-spec/jars/geronimo-spec-j2ee-deployment-1.1-rc2.jar +geronimo-spec/jars/geronimo-spec-j2ee-deployment-1.1-rc3.jar +geronimo-spec/jars/geronimo-spec-jaxr-1.0-rc2.jar +geronimo-spec/jars/geronimo-spec-j2ee-deployment-1.1-rc4.jar +geronimo-spec/jars/geronimo-spec-j2ee-jacc-1.0-M1.jar +geronimo-spec/jars/geronimo-spec-j2ee-jacc-1.0-rc1.jar +geronimo-spec/jars/geronimo-spec-j2ee-jacc-1.0-rc2.jar +geronimo-spec/jars/geronimo-spec-j2ee-jacc-1.0-rc3.jar +geronimo-spec/jars/geronimo-spec-j2ee-jacc-1.0-rc4.jar +geronimo-spec/jars/geronimo-spec-j2ee-management-1.0-M1.jar +geronimo-spec/jars/geronimo-spec-javamail-1.3.1-rc5.jar +geronimo-spec/jars/geronimo-spec-j2ee-management-1.0-rc1.jar +geronimo-spec/jars/geronimo-spec-jaxr-1.0-rc3.jar +geronimo-spec/jars/geronimo-spec-j2ee-management-1.0-rc2.jar +geronimo-spec/jars/geronimo-spec-j2ee-management-1.0-rc3.jar +geronimo-spec/jars/geronimo-spec-j2ee-management-1.0-rc4.jar +geronimo-spec/jars/geronimo-spec-j2eeschema-1.0-M1.jar +geronimo-spec/jars/geronimo-spec-javamail-1.3.1-rc1.jar +geronimo-spec/jars/geronimo-spec-javamail-1.3.1-rc2.jar +geronimo-spec/jars/geronimo-spec-javamail-1.3.1-rc3.jar +geronimo-spec/jars/geronimo-spec-javamail-1.3.1-rc4.jar +geronimo-spec/jars/geronimo-spec-jaxr-1.0-rc4.jar +geronimo-spec/jars/geronimo-spec-jaxrpc-1.1-rc4.jar +geronimo-spec/jars/geronimo-spec-jms-1.0-M1.jar +geronimo-spec/jars/geronimo-spec-jms-1.1-rc1.jar +geronimo-spec/jars/geronimo-spec-jms-1.1-rc2.jar +geronimo-spec/jars/geronimo-spec-jms-1.1-rc3.jar +geronimo-spec/jars/geronimo-spec-jms-1.1-rc4.jar +geronimo-spec/jars/geronimo-spec-jms-DEV.jar +geronimo-spec/jars/geronimo-spec-jsp-1.0-M1.jar +geronimo-spec/jars/geronimo-spec-jsp-2.0-rc1.jar +geronimo-spec/jars/geronimo-spec-jsp-2.0-rc2.jar +geronimo-spec/jars/geronimo-spec-jsp-2.0-rc3.jar +geronimo-spec/jars/geronimo-spec-jsp-2.0-rc4.jar +geronimo-spec/jars/geronimo-spec-jta-1.0-M1.jar +geronimo-spec/jars/geronimo-spec-jta-1.0.1B-rc1.jar +geronimo-spec/jars/geronimo-spec-jta-1.0.1B-rc2.jar +geronimo-spec/jars/geronimo-spec-jta-1.0.1B-rc3.jar +geronimo-spec/jars/geronimo-spec-jta-1.0.1B-rc4.jar +geronimo-spec/jars/geronimo-spec-jta-DEV.jar +geronimo-spec/jars/geronimo-spec-qname-1.1-rc4.jar +geronimo-spec/jars/geronimo-spec-saaj-1.1-rc4.jar +geronimo-spec/jars/geronimo-spec-servlet-1.0-M1.jar +geronimo-spec/jars/geronimo-spec-servlet-2.4-rc1.jar +geronimo-spec/jars/geronimo-spec-servlet-2.4-rc2.jar +geronimo-spec/jars/geronimo-spec-servlet-2.4-rc3.jar +geronimo-spec/jars/geronimo-spec-servlet-2.4-rc4.jar +geronimo-spec/poms/geronimo-spec-j2ee-connector-1.5-rc1.pom +geronimo-spec/poms/geronimo-spec-activation-1.0.2-rc1.pom +geronimo-spec/poms/geronimo-spec-activation-1.0.2-rc2.pom +geronimo-spec/poms/geronimo-spec-activation-1.0.2-rc3.pom +geronimo-spec/poms/geronimo-spec-activation-1.0.2-rc4.pom +geronimo-spec/poms/geronimo-spec-corba-2.3-rc4.pom +geronimo-spec/poms/geronimo-spec-ejb-2.1-rc1.pom +geronimo-spec/poms/geronimo-spec-ejb-2.1-rc2.pom +geronimo-spec/poms/geronimo-spec-ejb-2.1-rc3.pom +geronimo-spec/poms/geronimo-spec-ejb-2.1-rc4.pom +geronimo-spec/poms/geronimo-spec-j2ee-1.4-rc1.pom +geronimo-spec/poms/geronimo-spec-j2ee-1.4-rc2.pom +geronimo-spec/poms/geronimo-spec-j2ee-1.4-rc3.pom +geronimo-spec/poms/geronimo-spec-j2ee-1.4-rc4.pom +geronimo-spec/poms/geronimo-spec-saaj-1.1-rc4.pom +geronimo-spec/poms/geronimo-spec-j2ee-connector-1.5-rc2.pom +geronimo-spec/poms/geronimo-spec-j2ee-connector-1.5-rc3.pom +geronimo-spec/poms/geronimo-spec-j2ee-connector-1.5-rc4.pom +geronimo-spec/poms/geronimo-spec-j2ee-deployment-1.1-rc1.pom +geronimo-spec/poms/geronimo-spec-j2ee-deployment-1.1-rc2.pom +geronimo-spec/poms/geronimo-spec-j2ee-deployment-1.1-rc3.pom +geronimo-spec/poms/geronimo-spec-j2ee-deployment-1.1-rc4.pom +geronimo-spec/poms/geronimo-spec-j2ee-jacc-1.0-rc1.pom +geronimo-spec/poms/geronimo-spec-j2ee-jacc-1.0-rc2.pom +geronimo-spec/poms/geronimo-spec-j2ee-jacc-1.0-rc3.pom +geronimo-spec/poms/geronimo-spec-j2ee-jacc-1.0-rc4.pom +geronimo-spec/poms/geronimo-spec-j2ee-management-1.0-rc1.pom +geronimo-spec/poms/geronimo-spec-j2ee-management-1.0-rc2.pom +geronimo-spec/poms/geronimo-spec-j2ee-management-1.0-rc3.pom +geronimo-spec/poms/geronimo-spec-j2ee-management-1.0-rc4.pom +geronimo-spec/poms/geronimo-spec-javamail-1.3.1-rc1.pom +geronimo-spec/poms/geronimo-spec-javamail-1.3.1-rc2.pom +geronimo-spec/poms/geronimo-spec-javamail-1.3.1-rc3.pom +geronimo-spec/poms/geronimo-spec-javamail-1.3.1-rc4.pom +geronimo-spec/poms/geronimo-spec-javamail-1.3.1-rc5.pom +geronimo-spec/poms/geronimo-spec-jaxr-1.0-rc1.pom +geronimo-spec/poms/geronimo-spec-jaxr-1.0-rc2.pom +geronimo-spec/poms/geronimo-spec-jaxr-1.0-rc3.pom +geronimo-spec/poms/geronimo-spec-jaxr-1.0-rc4.pom +geronimo-spec/poms/geronimo-spec-jaxrpc-1.1-rc4.pom +geronimo-spec/poms/geronimo-spec-jms-1.1-rc1.pom +geronimo-spec/poms/geronimo-spec-jms-1.1-rc2.pom +geronimo-spec/poms/geronimo-spec-jms-1.1-rc3.pom +geronimo-spec/poms/geronimo-spec-jms-1.1-rc4.pom +geronimo-spec/poms/geronimo-spec-jsp-2.0-rc1.pom +geronimo-spec/poms/geronimo-spec-jsp-2.0-rc2.pom +geronimo-spec/poms/geronimo-spec-jsp-2.0-rc3.pom +geronimo-spec/poms/geronimo-spec-jsp-2.0-rc4.pom +geronimo-spec/poms/geronimo-spec-jta-1.0.1B-rc1.pom +geronimo-spec/poms/geronimo-spec-jta-1.0.1B-rc2.pom +geronimo-spec/poms/geronimo-spec-jta-1.0.1B-rc3.pom +geronimo-spec/poms/geronimo-spec-jta-1.0.1B-rc4.pom +geronimo-spec/poms/geronimo-spec-qname-1.1-rc4.pom +geronimo-spec/poms/geronimo-spec-servlet-2.4-rc1.pom +geronimo-spec/poms/geronimo-spec-servlet-2.4-rc2.pom +geronimo-spec/poms/geronimo-spec-servlet-2.4-rc3.pom +geronimo-spec/poms/geronimo-spec-servlet-2.4-rc4.pom +hivemind/jars/hivemind-1.0-beta-1.jar +hivemind/jars/hivemind-1.0-beta-2.jar +hivemind/jars/hivemind-1.0-beta-3-snapshot.jar +hivemind/jars/hivemind-1.0-rc-1.jar +hivemind/jars/hivemind-1.0-rc-2.jar +hivemind/jars/hivemind-1.0.jar +hivemind/jars/hivemind-1.1.1.jar +hivemind/jars/hivemind-1.1-alpha-1.jar +hivemind/jars/hivemind-1.1-alpha-2.jar +hivemind/jars/hivemind-1.1-alpha-3.jar +hivemind/jars/hivemind-1.1-beta-1.jar +hivemind/jars/hivemind-1.1-beta-2.jar +hivemind/jars/hivemind-1.1-beta-3.jar +hivemind/jars/hivemind-1.1-rc-1.jar +hivemind/jars/hivemind-1.1.jar +hivemind/jars/hivemind-jmx-1.1-beta-1.jar +hivemind/jars/hivemind-jmx-1.1-beta-2.jar +hivemind/jars/hivemind-jmx-1.1-beta-3.jar +hivemind/jars/hivemind-jmx-1.1-rc-1.jar +hivemind/jars/hivemind-jmx-1.1.1.jar +hivemind/jars/hivemind-jmx-1.1.jar +hivemind/jars/hivemind-lib-1.0-beta-3-snapshot.jar +hivemind/jars/hivemind-lib-1.0-beta-1.jar +hivemind/jars/hivemind-lib-1.0-beta-2.jar +hivemind/jars/hivemind-lib-1.0-rc-1.jar +hivemind/jars/hivemind-lib-1.0-rc-2.jar +hivemind/jars/hivemind-lib-1.0.jar +hivemind/jars/hivemind-lib-1.1-alpha-1.jar +hivemind/jars/hivemind-lib-1.1-alpha-2.jar +hivemind/jars/hivemind-lib-1.1-alpha-3.jar +hivemind/jars/hivemind-lib-1.1-beta-1.jar +hivemind/jars/hivemind-lib-1.1-beta-2.jar +hivemind/jars/hivemind-lib-1.1-beta-3.jar +hivemind/jars/hivemind-lib-1.1.1.jar +hivemind/jars/hivemind-lib-1.1-rc-1.jar +hivemind/jars/hivemind-lib-1.1.jar +httpcomponents-httpcore/jars/jakarta-httpcore-4.0-alpha3.jar +httpcomponents-httpcore/jars/jakarta-httpcore-4.0-alpha2.jar +httpcomponents-httpcore/jars/jakarta-httpcore-nio-4.0-alpha3.jar +httpcomponents-httpcore/jars/jakarta-httpcore-4.0-alpha4.jar +httpcomponents-httpcore/jars/jakarta-httpcore-niossl-4.0-alpha4.jar +httpcomponents-httpcore/jars/jakarta-httpcore-nio-4.0-alpha4.jar +httpcomponents-httpcore/jars/httpcore-4.0-alpha5.jar +httpcomponents-httpcore/jars/httpcore-nio-4.0-alpha5.jar +httpcomponents-httpcore/jars/httpcore-niossl-4.0-alpha5.jar +jakarta-regexp/jars/jakarta-regexp-1.4.jar +james/bars/james-server-3.0a.bar +james/blocks/james-server-3.0a.block +james/configs/james-server-3.0a.config +james/jars/james-3.0a1.jar +james/jars/mailet-1.0.jar +james/jars/mailet-3.0.jar +james/jars/mailet-api-1.0.jar +james/jars/mailet-api-3.0.jar +james/xmls/block.xml +james/xmls/config.xml +javax.jdo/jars/jdo2-api-2.0-beta.jar +javax.jdo/jars/jdo2-api-2.0-rc1.jar +javax.jdo/jars/jdo2-api-2.0.jar +javax.jdo/poms/jdo2-api-2.0-beta.pom +javax.jdo/poms/jdo2-api-2.0-rc1.pom +javax.jdo/poms/jdo2-api-2.0.pom +jaxme/jars/jaxme-0.2.jar +jaxme/jars/jaxme-0.3.1.jar +jaxme/jars/jaxme-0.3.jar +jaxme/jars/jaxme-api-0.2.jar +jaxme/jars/jaxme-api-0.3.1.jar +jaxme/jars/jaxme-api-0.3.jar +jaxme/jars/jaxme2-0.4beta.jar +jaxme/jars/jaxme-js-0.2.jar +jaxme/jars/jaxme-js-0.3.1.jar +jaxme/jars/jaxme-js-0.3.jar +jaxme/jars/jaxme-pm-0.2.jar +jaxme/jars/jaxme-pm-0.3.1.jar +jaxme/jars/jaxme-pm-0.3.jar +jaxme/jars/jaxme-rt-0.2.jar +jaxme/jars/jaxme-rt-0.3.1.jar +jaxme/jars/jaxme-rt-0.3.jar +jaxme/jars/jaxme-xs-0.2.jar +jaxme/jars/jaxme-xs-0.3.1.jar +jaxme/jars/jaxme-xs-0.3.jar +jaxme/jars/jaxme2-0.4-src.zip +jaxme/jars/jaxme2-0.4.jar +jaxme/jars/jaxme2-0.4beta-src.zip +jaxme/jars/jaxme2-0.5.1-sources.jar +jaxme/jars/jaxme2-0.5.1.jar +jaxme/jars/jaxme2-0.5.jar +jaxme/jars/jaxme2-0.5beta.jar +jaxme/jars/jaxme2-src.zip +jaxme/jars/jaxme2-rt-0.4.jar +jaxme/jars/jaxme2-rt-0.4beta.jar +jaxme/jars/jaxme2-rt-0.5.1-sources.jar +jaxme/jars/jaxme2-rt-0.5.1.jar +jaxme/jars/jaxme2-rt-0.5.jar +jaxme/jars/jaxme2-rt-0.5beta.jar +jaxme/jars/jaxme2-src-0.5.zip +jaxme/jars/jaxme2-src-0.5beta.zip +jaxme/jars/jaxmeapi-0.4-src.zip +jaxme/jars/jaxmeapi-0.5.1.jar +jaxme/jars/jaxmejs-0.4.jar +jaxme/jars/jaxmeapi-0.4.jar +jaxme/jars/jaxmeapi-0.4beta-src.zip +jaxme/jars/jaxmeapi-0.4beta.jar +jaxme/jars/jaxmeapi-0.5.1-sources.jar +jaxme/jars/jaxmeapi-0.5.jar +jaxme/jars/jaxmeapi-0.5beta.jar +jaxme/jars/jaxmeapi-src-0.5.zip +jaxme/jars/jaxmeapi-src-0.5beta.zip +jaxme/jars/jaxmejs-0.4-src.zip +jaxme/jars/jaxmejs-0.4beta-src.zip +jaxme/jars/jaxmejs-0.4beta.jar +jaxme/jars/jaxmejs-0.5.1-sources.jar +jaxme/jars/jaxmejs-0.5.1.jar +jaxme/jars/jaxmejs-0.5.jar +jaxme/jars/jaxmejs-0.5beta.jar +jaxme/jars/jaxmejs-src-0.5.zip +jaxme/jars/jaxmejs-src-0.5beta.zip +jaxme/jars/jaxmepm-0.4-src.zip +jaxme/jars/jaxmepm-0.4.jar +jaxme/jars/jaxmepm-0.4beta-src.zip +jaxme/jars/jaxmepm-0.4beta.jar +jaxme/jars/jaxmepm-0.5.1-sources.jar +jaxme/jars/jaxmepm-0.5.1.jar +jaxme/jars/jaxmepm-0.5.jar +jaxme/jars/jaxmepm-0.5beta.jar +jaxme/jars/jaxmepm-src-0.5.zip +jaxme/jars/jaxmepm-src-0.5beta.zip +jaxme/jars/jaxmexs-0.4-src.zip +jaxme/jars/jaxmexs-0.4.jar +jaxme/jars/jaxmexs-0.5.jar +jaxme/jars/jaxmexs-0.4beta-src.zip +jaxme/jars/jaxmexs-0.4beta.jar +jaxme/jars/jaxmexs-0.5.1-sources.jar +jaxme/jars/jaxmexs-0.5.1.jar +jaxme/jars/jaxmexs-0.5beta.jar +jaxme/jars/jaxmexs-src-0.5.zip +jaxme/jars/jaxmexs-src-0.5beta.zip +jcs/jars/jcs-1.0-dev.20020801.123921.jar +jcs/jars/jcs-1.0-dev.20020801.125151.jar +jcs/jars/jcs-1.0-dev.jar +jcs/jars/jcs-20030822.182132.jar +jcs/jars/jcs-snapshot-version +jcs/jars/jcs-1.3.jar +jcs/poms/jcs-1.3.pom +jcs-javagroups/jars/jcs-javagroups-alpha-0.20020813.013703.jar +jspapi/jars/jsp-api-2.0-20040521.jar +jstl/jars/jstl-1.0.1.jar +jstl/jars/jstl-1.0.2.jar +jstl/jars/jstl-1.0.3.jar +jstl/jars/jstl-1.0.4.jar +jstl/jars/jstl-1.0.5.jar +jstl/jars/jstl-1.0.6.jar +jstl/jars/jstl-1.0.jar +jstl/jars/jstl-1.1.0.jar +jstl/jars/jstl-1.1.1.jar +jstl/jars/jstl-1.1.2.jar +jstl/README +log4j/jars/log4j-1.1.3.jar +log4j/jars/log4j-1.2.11.jar +log4j/jars/log4j-1.2.14.jar +log4j/jars/log4j-1.2.12.jar +log4j/jars/log4j-1.2.13.jar +log4j/jars/log4j-1.2.4.jar +log4j/jars/log4j-1.2.5.jar +log4j/jars/log4j-1.2.6.jar +log4j/jars/log4j-1.2.7.jar +log4j/jars/log4j-1.2.8.jar +log4j/jars/log4j-1.2.9.jar +log4j/jars/log4j-1.2.15.jar +log4j/java-sources/log4j-1.2.13-sources.jar +log4j/java-sources/log4j-1.2.14-sources.jar +log4j/java-sources/log4j-1.2.15-sources.jar +log4j/poms/log4j-1.2.12.pom +log4j/poms/log4j-1.2.13.pom +log4j/poms/log4j-1.2.14.pom +log4j/poms/log4j-1.2.15.pom +logkit/distributions/LogKit-1.2-bin.zip +logkit/jars/logkit-1.0.1.jar +logkit/jars/logkit-1.2.2.jar.asc.txt +logkit/jars/logkit-1.2.2.jar +logkit/jars/logkit-1.2.jar +logkit/jars/logkit-20020529.jar +lucene/jars/lucene-1.2.jar +lucene/jars/lucene-1.3-rc1.jar +lucene/jars/lucene-1.4.1.jar +lucene/jars/lucene-1.4.2.jar +lucene/jars/lucene-1.4.3.jar +magicGball/jars/magicGball-0.01234-alpha0.jar +magicGball/poms/magicGball-0.01234-alpha0.pom +maven/jars/commons-jelly-1.0.1-20060717.jar +maven/jars/maven-1.0.1.jar +maven/jars/maven-1.0-rc3.jar +maven/jars/maven-1.0-rc4.jar +maven/jars/maven-1.1-beta-1.jar +maven/jars/maven-1.0.2.jar +maven/jars/maven-1.0.jar +maven/jars/maven-1.1-beta-2.jar +maven/jars/maven-1.1-beta-3.jar +maven/jars/maven-1.1-RC1.jar +maven/jars/maven-jar-plugin-1.5.jar +maven/jars/maven-java-plugin-1.5.jar +maven/jars/maven-jelly-tags-1.0.1.jar +maven/jars/velocity-1.5-20060721.044818.jar +maven/jars/maven-jelly-tags-1.0.jar +maven/jars/maven-model-3.0.0.jar +maven/jars/maven-1.1.jar +maven/jars/maven-model-3.0.1.jar +maven/jars/maven-model-3.0.2.jar +maven/jars/wagon-file-1.0-alpha-3.jar +maven/jars/wagon-http-1.0-alpha-3.jar +maven/jars/wagon-provider-api-1.0-alpha-3.jar +maven/java-sources/maven-1.1-beta-3-sources.jar +maven/java-sources/maven-ant-plugin-1.10-sources.jar +maven/java-sources/maven-ear-plugin-1.9-sources.jar +maven/java-sources/maven-linkcheck-plugin-1.4-sources.jar +maven/java-sources/maven-modello-plugin-1.0-sources.jar +maven/java-sources/maven-pdf-plugin-2.5-sources.jar +maven/java-sources/maven-pmd-plugin-1.9-sources.jar +maven/java-sources/maven-site-plugin-1.7.2-sources.jar +maven/java-sources/maven-announcement-plugin-1.4.1-sources.jar +maven/java-sources/maven-developer-activity-plugin-1.6.1-sources.jar +maven/java-sources/maven-file-activity-plugin-1.6.1-sources.jar +maven/java-sources/maven-model-3.0.2-sources.jar +maven/java-sources/maven-plugin-plugin-1.7.1-sources.jar +maven/java-sources/maven-1.1-RC1-sources.jar +maven/java-sources/maven-idea-plugin-1.7-sources.jar +maven/java-sources/maven-jalopy-plugin-1.5.1-sources.jar +maven/java-sources/maven-jar-plugin-1.8.1-sources.jar +maven/java-sources/maven-javadoc-plugin-1.9-sources.jar +maven/java-sources/maven-multichanges-plugin-1.3-sources.jar +maven/java-sources/maven-1.1-sources.jar +maven/javadoc.jars/maven-1.1-beta-3.javadoc.jar +maven/javadoc.jars/maven-modello-plugin-1.0.javadoc.jar +maven/javadoc.jars/maven-announcement-plugin-1.4.1.javadoc.jar +maven/javadoc.jars/maven-model-3.0.2.javadoc.jar +maven/javadoc.jars/maven-plugin-plugin-1.7.1.javadoc.jar +maven/javadoc.jars/maven-jalopy-plugin-1.5.1.javadoc.jar +maven/javadoc.jars/maven-jar-plugin-1.8.1.javadoc.jar +maven/javadoc.jars/maven-javadoc-plugin-1.9.javadoc.jar +maven/javadoc.jars/maven-multichanges-plugin-1.3.javadoc.jar +maven/javadoc.jars/maven-1.1-RC1.javadoc.jar +maven/javadoc.jars/maven-1.1.javadoc.jar +maven/plugins/maven-abbot-plugin-1.0.jar +maven/plugins/maven-abbot-plugin-1.1.jar +maven/plugins/maven-announcement-plugin-1.1.jar +maven/plugins/maven-announcement-plugin-1.2.jar +maven/plugins/maven-announcement-plugin-1.3.jar +maven/plugins/maven-changelog-plugin-1.9.1.jar +maven/plugins/maven-announcement-plugin-1.4.jar +maven/plugins/maven-ant-plugin-1.10.jar +maven/plugins/maven-ant-plugin-1.7.jar +maven/plugins/maven-ant-plugin-1.8.1.jar +maven/plugins/maven-ant-plugin-1.8.jar +maven/plugins/maven-ant-plugin-1.9.jar +maven/plugins/maven-antlr-plugin-1.2.1.jar +maven/plugins/maven-antlr-plugin-1.2.2.jar +maven/plugins/maven-antlr-plugin-1.2.jar +maven/plugins/maven-appserver-plugin-2.0.jar +maven/plugins/maven-artifact-plugin-1.2.jar +maven/plugins/maven-artifact-plugin-1.3.jar +maven/plugins/maven-artifact-plugin-1.4.1.jar +maven/plugins/maven-artifact-plugin-1.4.jar +maven/plugins/maven-artifact-plugin-1.5.1.jar +maven/plugins/maven-artifact-plugin-1.5.2.jar +maven/plugins/maven-caller-plugin-1.1.jar +maven/plugins/maven-artifact-plugin-1.5.jar +maven/plugins/maven-artifact-plugin-1.6.jar +maven/plugins/maven-artifact-plugin-1.7.jar +maven/plugins/maven-castor-plugin-1.2.jar +maven/plugins/maven-artifact-plugin-1.8.jar +maven/plugins/maven-ashkelon-plugin-1.2.jar +maven/plugins/maven-aspectj-plugin-3.0.jar +maven/plugins/maven-aspectj-plugin-3.1.1.jar +maven/plugins/maven-aspectj-plugin-3.1.jar +maven/plugins/maven-aspectj-plugin-3.2.jar +maven/plugins/maven-aspectj-plugin-4.0.jar +maven/plugins/maven-aspectwerkz-plugin-1.2.jar +maven/plugins/maven-clean-plugin-1.2.jar +maven/plugins/maven-changelog-plugin-1.5.jar +maven/plugins/maven-changelog-plugin-1.6.jar +maven/plugins/maven-changelog-plugin-1.7.1.jar +maven/plugins/maven-changelog-plugin-1.7.2.jar +maven/plugins/maven-changelog-plugin-1.7.jar +maven/plugins/maven-changelog-plugin-1.8.1.jar +maven/plugins/maven-changelog-plugin-1.8.2.jar +maven/plugins/maven-changelog-plugin-1.8.jar +maven/plugins/maven-changelog-plugin-1.9.jar +maven/plugins/maven-changes-plugin-1.4.jar +maven/plugins/maven-changes-plugin-1.5.1.jar +maven/plugins/maven-changes-plugin-1.5.jar +maven/plugins/maven-clean-plugin-1.3.jar +maven/plugins/maven-changes-plugin-1.6.jar +maven/plugins/maven-checkstyle-plugin-2.4.1.jar +maven/plugins/maven-checkstyle-plugin-2.4.jar +maven/plugins/maven-checkstyle-plugin-2.5.jar +maven/plugins/maven-checkstyle-plugin-3.0.1.jar +maven/plugins/maven-checkstyle-plugin-3.0.jar +maven/plugins/maven-clean-plugin-1.4.jar +maven/plugins/maven-clover-plugin-1.10.jar +maven/plugins/maven-clover-plugin-1.11.jar +maven/plugins/maven-clover-plugin-1.5.jar +maven/plugins/maven-clover-plugin-1.6.jar +maven/plugins/maven-clover-plugin-1.7.jar +maven/plugins/maven-clover-plugin-1.8.jar +maven/plugins/maven-clover-plugin-1.9.1.jar +maven/plugins/maven-clover-plugin-1.9.jar +maven/plugins/maven-console-plugin-1.1.jar +maven/plugins/maven-console-plugin-1.2.jar +maven/plugins/maven-cruisecontrol-plugin-1.2.jar +maven/plugins/maven-cruisecontrol-plugin-1.3.jar +maven/plugins/maven-cruisecontrol-plugin-1.4.jar +maven/plugins/maven-cruisecontrol-plugin-1.5.jar +maven/plugins/maven-cruisecontrol-plugin-1.6.jar +maven/plugins/maven-cruisecontrol-plugin-1.7.jar +maven/plugins/maven-cruisecontrol-plugin-1.8.jar +maven/plugins/maven-dashboard-plugin-1.3.jar +maven/plugins/maven-developer-activity-plugin-1.5.1.jar +maven/plugins/maven-dashboard-plugin-1.4.jar +maven/plugins/maven-dashboard-plugin-1.5.jar +maven/plugins/maven-dashboard-plugin-1.6.jar +maven/plugins/maven-dashboard-plugin-1.7.jar +maven/plugins/maven-dashboard-plugin-1.8.jar +maven/plugins/maven-dashboard-plugin-1.9.jar +maven/plugins/maven-deploy-plugin-1.3.jar +maven/plugins/maven-developer-activity-plugin-1.5.2.jar +maven/plugins/maven-dist-plugin-1.5.jar +maven/plugins/maven-developer-activity-plugin-1.5.jar +maven/plugins/maven-developer-activity-plugin-1.6.jar +maven/plugins/maven-dist-plugin-1.6.1.jar +maven/plugins/maven-dist-plugin-1.6.jar +maven/plugins/maven-dist-plugin-1.7.jar +maven/plugins/maven-docbook-plugin-1.2.jar +maven/plugins/maven-ear-plugin-1.5.jar +maven/plugins/maven-ear-plugin-1.6.1.jar +maven/plugins/maven-ear-plugin-1.6.jar +maven/plugins/maven-ear-plugin-1.7.jar +maven/plugins/maven-ear-plugin-1.8.jar +maven/plugins/maven-ear-plugin-1.9.jar +maven/plugins/maven-eclipse-plugin-1.10.jar +maven/plugins/maven-eclipse-plugin-1.11.jar +maven/plugins/maven-eclipse-plugin-1.7.jar +maven/plugins/maven-eclipse-plugin-1.8.jar +maven/plugins/maven-eclipse-plugin-1.9.jar +maven/plugins/maven-ejb-plugin-1.4.jar +maven/plugins/maven-ejb-plugin-1.5.jar +maven/plugins/maven-ejb-plugin-1.6.jar +maven/plugins/maven-ejb-plugin-1.7.1.jar +maven/plugins/maven-ejb-plugin-1.7.2.jar +maven/plugins/maven-ejb-plugin-1.7.jar +maven/plugins/maven-faq-plugin-1.3.jar +maven/plugins/maven-faq-plugin-1.4.jar +maven/plugins/maven-faq-plugin-1.5.jar +maven/plugins/maven-faq-plugin-1.6.1.jar +maven/plugins/maven-file-activity-plugin-1.5.1.jar +maven/plugins/maven-faq-plugin-1.6.jar +maven/plugins/maven-file-activity-plugin-1.5.2.jar +maven/plugins/maven-genapp-plugin-2.3.jar +maven/plugins/maven-gump-plugin-1.3.jar +maven/plugins/maven-file-activity-plugin-1.5.jar +maven/plugins/maven-file-activity-plugin-1.6.jar +maven/plugins/maven-genapp-plugin-2.2.jar +maven/plugins/maven-gump-plugin-1.4.jar +maven/plugins/maven-gump-plugin-2.0.1.jar +maven/plugins/maven-gump-plugin-2.0.jar +maven/plugins/maven-hibernate-plugin-1.1.jar +maven/plugins/maven-hibernate-plugin-1.2.jar +maven/plugins/maven-hibernate-plugin-1.3.jar +maven/plugins/maven-html2xdoc-plugin-1.3.1.jar +maven/plugins/maven-idea-plugin-1.4.jar +maven/plugins/maven-html2xdoc-plugin-1.3.jar +maven/plugins/maven-html2xdoc-plugin-1.4.jar +maven/plugins/maven-idea-plugin-1.5.jar +maven/plugins/maven-idea-plugin-1.6.jar +maven/plugins/maven-jar-plugin-1.7.jar +maven/plugins/maven-j2ee-plugin-1.5.1.jar +maven/plugins/maven-j2ee-plugin-1.5.jar +maven/plugins/maven-jalopy-plugin-1.2.jar +maven/plugins/maven-jalopy-plugin-1.3.1.jar +maven/plugins/maven-jalopy-plugin-1.3.jar +maven/plugins/maven-jalopy-plugin-1.4.jar +maven/plugins/maven-jalopy-plugin-1.5.jar +maven/plugins/maven-jar-plugin-1.5.jar +maven/plugins/maven-jar-plugin-1.6.1.jar +maven/plugins/maven-jar-plugin-1.6.jar +maven/plugins/maven-jar-plugin-1.8.jar +maven/plugins/maven-java-plugin-1.4.jar +maven/plugins/maven-java-plugin-1.5.jar +maven/plugins/maven-java-plugin-1.6.jar +maven/plugins/maven-javacc-plugin-1.1.jar +maven/plugins/maven-jbuilder-plugin-1.5.jar +maven/plugins/maven-javacc-plugin-1.2.jar +maven/plugins/maven-javadoc-plugin-1.5.jar +maven/plugins/maven-javadoc-plugin-1.6.1.jar +maven/plugins/maven-javadoc-plugin-1.6.jar +maven/plugins/maven-javadoc-plugin-1.7.jar +maven/plugins/maven-javadoc-plugin-1.8.jar +maven/plugins/maven-jboss-plugin-1.5.jar +maven/plugins/maven-jcoverage-plugin-1.0.4.jar +maven/plugins/maven-jcoverage-plugin-1.0.5.jar +maven/plugins/maven-jcoverage-plugin-1.0.6.jar +maven/plugins/maven-jcoverage-plugin-1.0.7.jar +maven/plugins/maven-jcoverage-plugin-1.0.8.jar +maven/plugins/maven-jcoverage-plugin-1.0.9.jar +maven/plugins/maven-jdee-plugin-1.1.jar +maven/plugins/maven-jdepend-plugin-1.5.1.jar +maven/plugins/maven-jdepend-plugin-1.5.jar +maven/plugins/maven-jdepend-plugin-1.6.1.jar +maven/plugins/maven-jdepend-plugin-1.6.jar +maven/plugins/maven-jdeveloper-plugin-1.4.jar +maven/plugins/maven-jdiff-plugin-1.3.jar +maven/plugins/maven-jdiff-plugin-1.4.jar +maven/plugins/maven-jdiff-plugin-1.5.jar +maven/plugins/maven-jellydoc-plugin-1.3.1.jar +maven/plugins/maven-jellydoc-plugin-1.3.jar +maven/plugins/maven-jetty-plugin-1.1.jar +maven/plugins/maven-jira-plugin-1.1.1.jar +maven/plugins/maven-jira-plugin-1.1.2.jar +maven/plugins/maven-jira-plugin-1.1.jar +maven/plugins/maven-jira-plugin-1.2.jar +maven/plugins/maven-jira-plugin-1.3.jar +maven/plugins/maven-jnlp-plugin-1.3.jar +maven/plugins/maven-jnlp-plugin-1.4.1.jar +maven/plugins/maven-jnlp-plugin-1.4.jar +maven/plugins/maven-junit-doclet-plugin-1.2.jar +maven/plugins/maven-junit-report-plugin-1.5.1.jar +maven/plugins/maven-junit-report-plugin-1.5.jar +maven/plugins/maven-jxr-plugin-1.4.1.jar +maven/plugins/maven-jxr-plugin-1.4.2.jar +maven/plugins/maven-jxr-plugin-1.4.3.jar +maven/plugins/maven-jxr-plugin-1.4.jar +maven/plugins/maven-jxr-plugin-1.5.jar +maven/plugins/maven-latex-plugin-1.2.jar +maven/plugins/maven-latka-plugin-1.4.jar +maven/plugins/maven-latex-plugin-1.4.1.jar +maven/plugins/maven-latka-plugin-1.4.1.jar +maven/plugins/maven-license-plugin-1.2.jar +maven/plugins/maven-linkcheck-plugin-1.3.1.jar +maven/plugins/maven-linkcheck-plugin-1.4.jar +maven/plugins/maven-linkcheck-plugin-1.3.2.jar +maven/plugins/maven-linkcheck-plugin-1.3.3.jar +maven/plugins/maven-linkcheck-plugin-1.3.4.jar +maven/plugins/maven-linkcheck-plugin-1.3.jar +maven/plugins/maven-multichanges-plugin-1.1.jar +maven/plugins/maven-multichanges-plugin-1.2.jar +maven/plugins/maven-multiproject-plugin-1.3.1.jar +maven/plugins/maven-multiproject-plugin-1.3.jar +maven/plugins/maven-multiproject-plugin-1.4.1.jar +maven/plugins/maven-multiproject-plugin-1.4.jar +maven/plugins/maven-multiproject-plugin-1.5.jar +maven/plugins/maven-native-plugin-1.1.jar +maven/plugins/maven-native-plugin-1.2.jar +maven/plugins/maven-nsis-plugin-1.1.jar +maven/plugins/maven-nsis-plugin-2.0.jar +maven/plugins/maven-pdf-plugin-2.1.jar +maven/plugins/maven-pdf-plugin-2.2.1.jar +maven/plugins/maven-pdf-plugin-2.2.jar +maven/plugins/maven-pdf-plugin-2.3.jar +maven/plugins/maven-pdf-plugin-2.4.jar +maven/plugins/maven-pdf-plugin-2.5.jar +maven/plugins/maven-plugin-plugin-1.4.jar +maven/plugins/maven-plugin-plugin-1.5.1.jar +maven/plugins/maven-plugin-plugin-1.5.2.jar +maven/plugins/maven-plugin-plugin-1.5.jar +maven/plugins/maven-plugin-plugin-1.6.jar +maven/plugins/maven-plugin-plugin-1.7.jar +maven/plugins/maven-pmd-plugin-1.4.jar +maven/plugins/maven-pmd-plugin-1.5.jar +maven/plugins/maven-pmd-plugin-1.6.jar +maven/plugins/maven-pmd-plugin-1.7.jar +maven/plugins/maven-pmd-plugin-1.8.jar +maven/plugins/maven-pmd-plugin-1.9.jar +maven/plugins/maven-pom-plugin-1.4.1.jar +maven/plugins/maven-pom-plugin-1.4.jar +maven/plugins/maven-pom-plugin-1.5.jar +maven/plugins/maven-rar-plugin-1.0.jar +maven/plugins/maven-rar-plugin-1.1.jar +maven/plugins/maven-release-plugin-1.3.jar +maven/plugins/maven-release-plugin-1.4.1.jar +maven/plugins/maven-release-plugin-1.4.jar +maven/plugins/maven-repository-plugin-1.2.jar +maven/plugins/maven-scm-plugin-1.3.jar +maven/plugins/maven-scm-plugin-1.4.1.jar +maven/plugins/maven-scm-plugin-1.4.jar +maven/plugins/maven-scm-plugin-1.5-beta-2.jar +maven/plugins/maven-site-plugin-1.6.jar +maven/plugins/maven-site-plugin-1.7.jar +maven/plugins/maven-scm-plugin-1.5-beta-3.jar +maven/plugins/maven-scm-plugin-1.5.jar +maven/plugins/maven-scm-plugin-1.6.jar +maven/plugins/maven-shell-plugin-1.1.jar +maven/plugins/maven-simian-plugin-1.4.jar +maven/plugins/maven-simian-plugin-1.5.jar +maven/plugins/maven-simian-plugin-1.6.jar +maven/plugins/maven-site-plugin-1.5.1.jar +maven/plugins/maven-site-plugin-1.5.2.jar +maven/plugins/maven-site-plugin-1.5.jar +maven/plugins/maven-site-plugin-1.6.1.jar +maven/plugins/maven-source-plugin-1.0.jar +maven/plugins/maven-struts-plugin-1.3.jar +maven/plugins/maven-tasklist-plugin-2.3.jar +maven/plugins/maven-tasklist-plugin-2.4.jar +maven/plugins/maven-xdoc-plugin-1.9.2.jar +maven/plugins/maven-test-plugin-1.6.1.jar +maven/plugins/maven-test-plugin-1.6.2.jar +maven/plugins/maven-test-plugin-1.6.jar +maven/plugins/maven-test-plugin-1.7.jar +maven/plugins/maven-test-plugin-1.8.jar +maven/plugins/maven-tjdo-plugin-1.0.0.jar +maven/plugins/maven-uberjar-plugin-1.2.jar +maven/plugins/maven-vdoclet-plugin-1.2.jar +maven/plugins/maven-war-plugin-1.6.1.jar +maven/plugins/maven-war-plugin-1.6.2.jar +maven/plugins/maven-war-plugin-1.6.jar +maven/plugins/maven-webserver-plugin-2.0.jar +maven/plugins/maven-wizard-plugin-1.1.jar +maven/plugins/maven-xdoc-plugin-1.10.jar +maven/plugins/maven-xdoc-plugin-1.7.1.jar +maven/plugins/maven-xdoc-plugin-1.7.2.jar +maven/plugins/maven-xdoc-plugin-1.7.jar +maven/plugins/maven-xdoc-plugin-1.8.jar +maven/plugins/maven-xdoc-plugin-1.9.1.jar +maven/plugins/maven-changes-plugin-1.7.jar +maven/plugins/maven-xdoc-plugin-1.9.jar +maven/plugins/maven-genapp-plugin-2.3.1.jar +maven/plugins/maven-pom-plugin-1.5.1.jar +maven/plugins/maven-clover-plugin-1.11.1.jar +maven/plugins/maven-java-plugin-1.6.1.jar +maven/plugins/maven-jira-plugin-1.3.1.jar +maven/plugins/maven-simian-plugin-1.6.1.jar +maven/plugins/maven-clover-plugin-1.11.2.jar +maven/plugins/maven-jdiff-plugin-1.5.1.jar +maven/plugins/maven-pdf-plugin-2.5.1.jar +maven/plugins/maven-pmd-plugin-1.10.jar +maven/plugins/maven-scm-plugin-1.6.1.jar +maven/plugins/maven-site-plugin-1.7.1.jar +maven/plugins/maven-modello-plugin-1.0.jar +maven/plugins/maven-site-plugin-1.7.2.jar +maven/plugins/maven-announcement-plugin-1.4.1.jar +maven/plugins/maven-developer-activity-plugin-1.6.1.jar +maven/plugins/maven-file-activity-plugin-1.6.1.jar +maven/plugins/maven-plugin-plugin-1.7.1.jar +maven/plugins/maven-idea-plugin-1.7.jar +maven/plugins/maven-jalopy-plugin-1.5.1.jar +maven/plugins/maven-jar-plugin-1.8.1.jar +maven/plugins/maven-javadoc-plugin-1.9.jar +maven/plugins/maven-multichanges-plugin-1.3.jar +maven/plugins/maven-artifact-plugin-1.9.jar +maven/plugins/maven-changelog-plugin-1.9.2.jar +maven/plugins/maven-dist-plugin-1.7.1.jar +maven/plugins/maven-eclipse-plugin-1.12.jar +maven/plugins/maven-ejb-plugin-1.7.3.jar +maven/plugins/maven-linkcheck-plugin-1.4.1.jar +maven/plugins/maven-multiproject-plugin-1.5.1.jar +maven/plugins/maven-test-plugin-1.8.1.jar +maven/plugins/maven-war-plugin-1.6.3.jar +maven/plugins/maven-xdoc-plugin-1.10.1.jar +maven/plugins/maven-nsis-plugin-2.1.jar +maven/plugins/maven-artifact-plugin-1.9.1.jar +maven/plugins/maven-test-plugin-1.8.2.jar +maven/poms/commons-jelly-1.0.1-20060717.pom +maven/poms/maven-1.0.1.pom +maven/poms/maven-1.0-rc4.pom +maven/poms/maven-1.0.2.pom +maven/poms/maven-1.0.pom +maven/poms/maven-1.1-beta-3.pom +maven/poms/maven-abbot-plugin-1.0.pom +maven/poms/maven-abbot-plugin-1.1.pom +maven/poms/maven-announcement-plugin-1.2.pom +maven/poms/maven-announcement-plugin-1.3.pom +maven/poms/maven-1.1-RC1.pom +maven/poms/maven-announcement-plugin-1.4.pom +maven/poms/maven-ant-plugin-1.10.pom +maven/poms/maven-ant-plugin-1.8.1.pom +maven/poms/maven-ant-plugin-1.8.pom +maven/poms/maven-ant-plugin-1.9.pom +maven/poms/maven-antlr-plugin-1.2.1.pom +maven/poms/maven-model-3.0.0.pom +maven/poms/maven-antlr-plugin-1.2.2.pom +maven/poms/maven-artifact-plugin-1.3.pom +maven/poms/maven-artifact-plugin-1.4.1.pom +maven/poms/maven-artifact-plugin-1.4.pom +maven/poms/maven-artifact-plugin-1.5.1.pom +maven/poms/maven-artifact-plugin-1.5.2.pom +maven/poms/maven-artifact-plugin-1.5.pom +maven/poms/maven-artifact-plugin-1.6.pom +maven/poms/maven-model-3.0.1.pom +maven/poms/maven-artifact-plugin-1.7.pom +maven/poms/maven-artifact-plugin-1.8.pom +maven/poms/maven-aspectj-plugin-3.1.1.pom +maven/poms/maven-aspectj-plugin-3.2.pom +maven/poms/maven-aspectj-plugin-4.0.pom +maven/poms/maven-changelog-plugin-1.6.pom +maven/poms/maven-changelog-plugin-1.7.1.pom +maven/poms/maven-clean-plugin-1.4.pom +maven/poms/maven-changelog-plugin-1.7.2.pom +maven/poms/maven-changelog-plugin-1.7.pom +maven/poms/maven-changelog-plugin-1.8.1.pom +maven/poms/maven-changelog-plugin-1.9.pom +maven/poms/maven-changelog-plugin-1.8.2.pom +maven/poms/maven-changelog-plugin-1.8.pom +maven/poms/maven-changelog-plugin-1.9.1.pom +maven/poms/maven-changes-plugin-1.5.1.pom +maven/poms/maven-changes-plugin-1.5.pom +maven/poms/maven-changes-plugin-1.6.pom +maven/poms/maven-checkstyle-plugin-2.5.pom +maven/poms/maven-checkstyle-plugin-3.0.1.pom +maven/poms/maven-checkstyle-plugin-3.0.pom +maven/poms/maven-dashboard-plugin-1.5.pom +maven/poms/maven-clover-plugin-1.10.pom +maven/poms/maven-clover-plugin-1.11.pom +maven/poms/maven-clover-plugin-1.6.pom +maven/poms/maven-clover-plugin-1.7.pom +maven/poms/maven-clover-plugin-1.8.pom +maven/poms/maven-clover-plugin-1.9.1.pom +maven/poms/maven-clover-plugin-1.9.pom +maven/poms/maven-dist-plugin-1.6.1.pom +maven/poms/maven-console-plugin-1.2.pom +maven/poms/maven-cruisecontrol-plugin-1.4.pom +maven/poms/maven-cruisecontrol-plugin-1.5.pom +maven/poms/maven-cruisecontrol-plugin-1.6.pom +maven/poms/maven-cruisecontrol-plugin-1.7.pom +maven/poms/maven-cruisecontrol-plugin-1.8.pom +maven/poms/maven-dashboard-plugin-1.4.pom +maven/poms/maven-developer-activity-plugin-1.5.1.pom +maven/poms/maven-dashboard-plugin-1.6.pom +maven/poms/maven-dashboard-plugin-1.7.pom +maven/poms/maven-dashboard-plugin-1.8.pom +maven/poms/maven-dashboard-plugin-1.9.pom +maven/poms/maven-developer-activity-plugin-1.5.2.pom +maven/poms/maven-developer-activity-plugin-1.6.pom +maven/poms/maven-dist-plugin-1.6.pom +maven/poms/maven-dist-plugin-1.7.pom +maven/poms/maven-ear-plugin-1.6.1.pom +maven/poms/maven-ear-plugin-1.6.pom +maven/poms/maven-ear-plugin-1.7.pom +maven/poms/maven-ear-plugin-1.8.pom +maven/poms/maven-ear-plugin-1.9.pom +maven/poms/maven-ejb-plugin-1.5.pom +maven/poms/maven-eclipse-plugin-1.10.pom +maven/poms/maven-eclipse-plugin-1.11.pom +maven/poms/maven-eclipse-plugin-1.8.pom +maven/poms/maven-eclipse-plugin-1.9.pom +maven/poms/maven-ejb-plugin-1.6.pom +maven/poms/maven-ejb-plugin-1.7.1.pom +maven/poms/maven-ejb-plugin-1.7.2.pom +maven/poms/maven-ejb-plugin-1.7.pom +maven/poms/maven-faq-plugin-1.4.pom +maven/poms/maven-faq-plugin-1.5.pom +maven/poms/maven-faq-plugin-1.6.1.pom +maven/poms/maven-file-activity-plugin-1.5.1.pom +maven/poms/maven-faq-plugin-1.6.pom +maven/poms/maven-file-activity-plugin-1.5.2.pom +maven/poms/maven-file-activity-plugin-1.6.pom +maven/poms/maven-genapp-plugin-2.3.pom +maven/poms/maven-gump-plugin-1.4.pom +maven/poms/maven-gump-plugin-2.0.1.pom +maven/poms/maven-gump-plugin-2.0.pom +maven/poms/maven-hibernate-plugin-1.2.pom +maven/poms/maven-hibernate-plugin-1.3.pom +maven/poms/maven-html2xdoc-plugin-1.3.1.pom +maven/poms/maven-html2xdoc-plugin-1.4.pom +maven/poms/maven-idea-plugin-1.5.pom +maven/poms/maven-idea-plugin-1.6.pom +maven/poms/maven-j2ee-plugin-1.5.1.pom +maven/poms/maven-jalopy-plugin-1.3.1.pom +maven/poms/maven-jalopy-plugin-1.3.pom +maven/poms/maven-jalopy-plugin-1.4.pom +maven/poms/maven-jalopy-plugin-1.5.pom +maven/poms/maven-jar-plugin-1.6.1.pom +maven/poms/maven-jar-plugin-1.6.pom +maven/poms/maven-jar-plugin-1.7.pom +maven/poms/maven-jar-plugin-1.8.pom +maven/poms/maven-java-plugin-1.5.pom +maven/poms/maven-java-plugin-1.6.pom +maven/poms/maven-javacc-plugin-1.2.pom +maven/poms/maven-model-3.0.2.pom +maven/poms/maven-javadoc-plugin-1.6.1.pom +maven/poms/maven-javadoc-plugin-1.6.pom +maven/poms/maven-javadoc-plugin-1.7.pom +maven/poms/maven-javadoc-plugin-1.8.pom +maven/poms/maven-jcoverage-plugin-1.0.5.pom +maven/poms/maven-jcoverage-plugin-1.0.6.pom +maven/poms/maven-jcoverage-plugin-1.0.7.pom +maven/poms/maven-jelly-tags-1.0.1.pom +maven/poms/maven-jcoverage-plugin-1.0.8.pom +maven/poms/maven-jcoverage-plugin-1.0.9.pom +maven/poms/maven-jdepend-plugin-1.5.1.pom +maven/poms/maven-jdepend-plugin-1.6.1.pom +maven/poms/maven-jdepend-plugin-1.6.pom +maven/poms/maven-jdiff-plugin-1.5.pom +maven/poms/maven-jira-plugin-1.2-20051203.221911.pom +maven/poms/maven-jellydoc-plugin-1.3.1.pom +maven/poms/maven-jira-plugin-1.1.1.pom +maven/poms/maven-jira-plugin-1.1.2.pom +maven/poms/maven-jira-plugin-1.2.pom +maven/poms/maven-jira-plugin-1.3.pom +maven/poms/maven-jira-plugin-snapshot-version +maven/poms/maven-jnlp-plugin-1.4.1.pom +maven/poms/maven-jnlp-plugin-1.4.pom +maven/poms/maven-junit-report-plugin-1.5.1.pom +maven/poms/maven-jxr-plugin-1.4.1.pom +maven/poms/maven-jxr-plugin-1.4.2.pom +maven/poms/maven-jxr-plugin-1.4.3.pom +maven/poms/maven-jxr-plugin-1.5.pom +maven/poms/maven-latex-plugin-1.4.1.pom +maven/poms/maven-latka-plugin-1.4.1.pom +maven/poms/maven-linkcheck-plugin-1.3.2.pom +maven/poms/maven-linkcheck-plugin-1.3.3.pom +maven/poms/maven-native-plugin-1.2.pom +maven/poms/maven-linkcheck-plugin-1.3.4.pom +maven/poms/maven-linkcheck-plugin-1.4.pom +maven/poms/maven-multichanges-plugin-1.2.pom +maven/poms/maven-multiproject-plugin-1.3.1.pom +maven/poms/maven-multiproject-plugin-1.4.1.pom +maven/poms/maven-multiproject-plugin-1.4.pom +maven/poms/maven-multiproject-plugin-1.5.pom +maven/poms/maven-nsis-plugin-2.0.pom +maven/poms/maven-pdf-plugin-2.2.1.pom +maven/poms/maven-pdf-plugin-2.5.pom +maven/poms/maven-pdf-plugin-2.2.pom +maven/poms/maven-pdf-plugin-2.3.pom +maven/poms/maven-pdf-plugin-2.4.pom +maven/poms/maven-plugin-plugin-1.5.1.pom +maven/poms/maven-plugin-plugin-1.5.2.pom +maven/poms/maven-plugin-plugin-1.5.pom +maven/poms/maven-plugin-plugin-1.6.pom +maven/poms/maven-plugin-plugin-1.7.pom +maven/poms/maven-pmd-plugin-1.5.pom +maven/poms/maven-pmd-plugin-1.6.pom +maven/poms/maven-pmd-plugin-1.7.pom +maven/poms/maven-pmd-plugin-1.8.pom +maven/poms/maven-pmd-plugin-1.9.pom +maven/poms/maven-pom-plugin-1.5.pom +maven/poms/maven-rar-plugin-1.1.pom +maven/poms/maven-release-plugin-1.4.1.pom +maven/poms/maven-scm-plugin-1.4.1.pom +maven/poms/maven-scm-plugin-1.5-beta-2.pom +maven/poms/maven-scm-plugin-1.5-beta-3.pom +maven/poms/maven-scm-plugin-1.5.pom +maven/poms/maven-scm-plugin-1.6.pom +maven/poms/maven-simian-plugin-1.5.pom +maven/poms/maven-simian-plugin-1.6.pom +maven/poms/maven-site-plugin-1.5.1.pom +maven/poms/maven-site-plugin-1.5.2.pom +maven/poms/maven-site-plugin-1.6.1.pom +maven/poms/maven-site-plugin-1.6.pom +maven/poms/maven-site-plugin-1.7.pom +maven/poms/maven-source-plugin-1.0.pom +maven/poms/maven-tasklist-plugin-2.4.pom +maven/poms/maven-test-plugin-1.6.2.pom +maven/poms/maven-test-plugin-1.7.pom +maven/poms/maven-test-plugin-1.8.pom +maven/poms/maven-war-plugin-1.6.1.pom +maven/poms/maven-war-plugin-1.6.2.pom +maven/poms/maven-xdoc-plugin-1.10.pom +maven/poms/maven-xdoc-plugin-1.7.2.pom +maven/poms/maven-xdoc-plugin-1.8.pom +maven/poms/maven-xdoc-plugin-1.9.1.pom +maven/poms/maven-xdoc-plugin-1.9.2.pom +maven/poms/maven-xdoc-plugin-1.9.pom +maven/poms/velocity-1.5-20060721.044818.pom +maven/poms/maven-changes-plugin-1.7.pom +maven/poms/maven-genapp-plugin-2.3.1.pom +maven/poms/maven-pom-plugin-1.5.1.pom +maven/poms/maven-clover-plugin-1.11.1.pom +maven/poms/maven-java-plugin-1.6.1.pom +maven/poms/maven-jira-plugin-1.3.1.pom +maven/poms/maven-simian-plugin-1.6.1.pom +maven/poms/maven-clover-plugin-1.11.2.pom +maven/poms/maven-jdiff-plugin-1.5.1.pom +maven/poms/maven-pdf-plugin-2.5.1.pom +maven/poms/maven-pmd-plugin-1.10.pom +maven/poms/maven-scm-plugin-1.6.1.pom +maven/poms/maven-site-plugin-1.7.1.pom +maven/poms/maven-modello-plugin-1.0.pom +maven/poms/maven-site-plugin-1.7.2.pom +maven/poms/maven-announcement-plugin-1.4.1.pom +maven/poms/maven-developer-activity-plugin-1.6.1.pom +maven/poms/maven-file-activity-plugin-1.6.1.pom +maven/poms/maven-plugin-plugin-1.7.1.pom +maven/poms/maven-idea-plugin-1.7.pom +maven/poms/maven-jalopy-plugin-1.5.1.pom +maven/poms/maven-jar-plugin-1.8.1.pom +maven/poms/maven-javadoc-plugin-1.9.pom +maven/poms/maven-multichanges-plugin-1.3.pom +maven/poms/maven-artifact-plugin-1.9.pom +maven/poms/maven-changelog-plugin-1.9.2.pom +maven/poms/maven-dist-plugin-1.7.1.pom +maven/poms/maven-eclipse-plugin-1.12.pom +maven/poms/maven-ejb-plugin-1.7.3.pom +maven/poms/maven-linkcheck-plugin-1.4.1.pom +maven/poms/maven-multiproject-plugin-1.5.1.pom +maven/poms/maven-test-plugin-1.8.1.pom +maven/poms/maven-war-plugin-1.6.3.pom +maven/poms/maven-xdoc-plugin-1.10.1.pom +maven/poms/maven-nsis-plugin-2.1.pom +maven/poms/maven-artifact-plugin-1.9.1.pom +maven/poms/maven-1.1.pom +maven/poms/maven-test-plugin-1.8.2.pom +maven-new/jars/maven-fetch-20030525.145948.jar +maven-new/jars/maven-fetch-snapshot-version +maven-plugins/jars/maven-aptdoc-plugin-20030413.030249.jar +maven-plugins/jars/maven-aptdoc-plugin-snapshot-version +maven-plugins/jars/maven-dbunit-plugin-20030413.024213.jar +maven-plugins/jars/maven-dbunit-plugin-snapshot-version +maven-plugins/plugins/maven-dbunit-plugin-1.0.jar +maven-plugins/plugins/maven-dbunit-plugin-20030814.080708.jar +merlin/jars/merlin-api-3.3.0.jar +merlin/jars/merlin-cli-3.3.0.jar +merlin/jars/merlin-impl-3.3.0.jar +merlin/jars/merlin-unit-3.3.0.jar +merlin/plugins/merlin-plugin-3.3.0.jar +merlin-developer/jars/merlin-developer-core-snapshot-version +merlin-developer/jars/merlin-developer-core-0.1.jar +merlin-developer/jars/merlin-developer-core-20040423.083017.jar +merlin-tutorial/jars/locator-impl-1.0.jar +merlin-tutorial/jars/locator-api-1.0.jar +merlin-tutorial/jars/publisher-api-1.0.jar +merlin-tutorial/jars/publisher-impl-1.0.jar +muse/jars/2.0.0-M1/KEYS +muse/jars/2.0.0-M1/muse-core-2.0.0-M1.jar +muse/jars/2.0.0-M1/muse-platform-axis2-2.0.0-M1.jar +muse/jars/2.0.0-M1/muse-tools-2.0.0-M1.jar +muse/jars/2.0.0-M1/muse-util-2.0.0-M1.jar +muse/jars/2.0.0-M1/muse-util-xml-2.0.0-M1.jar +muse/jars/2.0.0-M1/muse-util-qname-2.0.0-M1.jar +muse/jars/2.0.0-M1/muse-util-xstream-2.0.0-M1.jar +muse/jars/2.0.0-M1/muse-wsa-soap-2.0.0-M1.jar +muse/jars/2.0.0-M1/muse-wsdm-muws-adv-api-2.0.0-M1.jar +muse/jars/2.0.0-M1/muse-wsdm-muws-adv-impl-2.0.0-M1.jar +muse/jars/2.0.0-M1/muse-wsdm-muws-api-2.0.0-M1.jar +muse/jars/2.0.0-M1/muse-wsrf-impl-2.0.0-M1.jar +muse/jars/2.0.0-M1/muse-wsdm-muws-impl-2.0.0-M1.jar +muse/jars/2.0.0-M1/muse-wsdm-wef-api-2.0.0-M1.jar +muse/jars/2.0.0-M1/muse-wsdm-wef-impl-2.0.0-M1.jar +muse/jars/2.0.0-M1/muse-wsn-api-2.0.0-M1.jar +muse/jars/2.0.0-M1/muse-wsn-impl-2.0.0-M1.jar +muse/jars/2.0.0-M1/muse-wsrf-api-2.0.0-M1.jar +muse/jars/2.0.0-M1/muse-wsx-api-2.0.0-M1.jar +muse/jars/2.0.0-M1/muse-wsx-impl-2.0.0-M1.jar +muse/jars/advertiser-xbeans-src-1.0.jar +muse/jars/advertiser-xbeans-1.0.jar +muse/jars/wsdm-xbeans-1.0.jar +muse/jars/muse-1.0.jar +muse/jars/wsdm-xbeans-src-1.0.jar +myfaces/jars/myfaces-1.0.9/myfaces-impl-1.0.9.jar +myfaces/jars/myfaces-1.0.9/myfaces-1.0.9.jar +myfaces/jars/myfaces-1.0.9/myfaces-extensions-1.0.9.jar +myfaces/jars/myfaces-1.0.9/myfaces-jsf-api-1.0.9.jar +myfaces/jars/myfaces-1.0.9/myfaces-wap-1.0.9.jar +myfaces/jars/myfaces-1.0.9/myfaces-xdoclet-1.0.9.jar +myfaces/jars/myfaces-1.1.0/myfaces-impl.jar +myfaces/jars/myfaces-1.1.0/myfaces-all.jar +myfaces/jars/myfaces-1.1.0/myfaces-api.jar +myfaces/jars/myfaces-1.1.0/tomahawk.jar +myfaces/jars/myfaces-1.0.9.jar +myfaces/jars/myfaces-extensions-1.0.9.jar +myfaces/jars/myfaces-all-1.1.0.jar +myfaces/jars/myfaces-all-1.1.1.jar +myfaces/jars/myfaces-api-1.1.0.jar +myfaces/jars/myfaces-api-1.1.1.jar +myfaces/jars/myfaces-impl-1.0.9.jar +myfaces/jars/myfaces-impl-1.1.0.jar +myfaces/jars/myfaces-impl-1.1.1.jar +myfaces/jars/myfaces-jsf-api-1.0.8-beta.jar +myfaces/jars/myfaces-jsf-api-1.0.9.jar +myfaces/jars/myfaces-wap-1.0.9.jar +myfaces/jars/myfaces-xdoclet-1.0.9.jar +myfaces/jars/tomahawk-1.1.0.jar +myfaces/jars/tomahawk-1.1.1.jar +myfaces/poms/myfaces.pom +nekohtml/jars/nekohtml-0.6.5.jar +nekohtml/jars/nekohtml-0.7.1.jar +nekohtml/jars/nekohtml-0.7.4.jar +nekohtml/jars/nekohtml-0.7.6.jar +nekohtml/jars/nekohtml-0.7.7.jar +nekohtml/jars/nekohtml-0.8.1.jar +nekohtml/jars/nekohtmlSamples-0.7.1.jar +nekohtml/jars/nekohtmlSamples-0.7.7.jar +nekohtml/jars/nekohtmlSamples-0.8.1.jar +nekohtml/jars/nekohtmlXni-0.7.1.jar +nekohtml/jars/nekohtmlXni-0.7.6.jar +nekohtml/jars/nekohtmlXni-0.7.7.jar +nekohtml/jars/nekohtmlXni-0.8.1.jar +ojb/jars/db-ojb-1.0.0-tools.jar +ojb/jars/db-ojb-1.0.0.jar +ojb/jars/db-ojb-1.0.1.jar +ojb/jars/db-ojb-1.0.2.jar +ojb/jars/db-ojb-1.0.3.jar +ojb/jars/db-ojb-1.0.4.jar.MD5 +ojb/jars/db-ojb-1.0.4.jar +ojb/jars/db-ojb-1.0.rc5-tools.jar +ojb/jars/ojb-0.9.jar +ojb/jars/db-ojb-1.0.rc5.jar +ojb/jars/db-ojb-1.0.rc7.jar +ojb/jars/ojb-0.5.200.jar +ojb/jars/ojb-0.7.343.jar +ojb/jars/ojb-0.8.375.jar +ojb/jars/ojb-0.9.1.jar +ojb/jars/ojb-0.9.2.jar +ojb/jars/ojb-0.9.4.jar +ojb/jars/ojb-0.9.5.jar +ojb/jars/ojb-0.9.6-dev.jar +ojb/jars/ojb-0.9.6.jar +ojb/jars/ojb-1.0-dev-james-1.jar +ojb/jars/ojb-1.0.rc2.jar +ojb/jars/ojb-1.0.rc3.jar +ojb/jars/ojb-1.0.rc4.jar +ojb/jars/xdoclet-ojb-module-1.2.1.jar +ojb/jars/xdoclet-ojb-module-1.2.3.jar +ojb/jars/xdoclet-ojb-module-1.2.3.jar.MD5 +ojb/poms/db-ojb-1.0.4.pom.MD5 +ojb/poms/db-ojb-1.0.4.pom +ojb/poms/ojb-1.0.rc2.pom +org/apache/geronimo/specs/geronimo-activation_1.0.2_spec/1.0/geronimo-activation_1.0.2_spec-1.0.jar +org/apache/geronimo/specs/geronimo-activation_1.0.2_spec/1.0/geronimo-activation_1.0.2_spec-1.0.pom +org/apache/geronimo/specs/geronimo-activation_1.0.2_spec/maven-metadata.xml +org/apache/geronimo/specs/geronimo-corba_3.0_spec/1.0/geronimo-corba_3.0_spec-1.0.jar +org/apache/geronimo/specs/geronimo-corba_3.0_spec/1.0/geronimo-corba_3.0_spec-1.0.pom +org/apache/geronimo/specs/geronimo-corba_3.0_spec/maven-metadata.xml +org/apache/geronimo/specs/geronimo-ejb_2.1_spec/1.0/geronimo-ejb_2.1_spec-1.0.jar +org/apache/geronimo/specs/geronimo-ejb_2.1_spec/1.0/geronimo-ejb_2.1_spec-1.0.pom +org/apache/geronimo/specs/geronimo-ejb_2.1_spec/maven-metadata.xml +org/apache/geronimo/specs/geronimo-j2ee-connector_1.5_spec/1.0/geronimo-j2ee-connector_1.5_spec-1.0.jar +org/apache/geronimo/specs/geronimo-j2ee-connector_1.5_spec/1.0/geronimo-j2ee-connector_1.5_spec-1.0.pom +org/apache/geronimo/specs/geronimo-j2ee-connector_1.5_spec/maven-metadata.xml +org/apache/geronimo/specs/geronimo-j2ee-deployment_1.1_spec/1.0/geronimo-j2ee-deployment_1.1_spec-1.0.jar +org/apache/geronimo/specs/geronimo-j2ee-deployment_1.1_spec/1.0/geronimo-j2ee-deployment_1.1_spec-1.0.pom +org/apache/geronimo/specs/geronimo-j2ee-deployment_1.1_spec/maven-metadata.xml +org/apache/geronimo/specs/geronimo-j2ee-jacc_1.0_spec/1.0/geronimo-j2ee-jacc_1.0_spec-1.0.jar +org/apache/geronimo/specs/geronimo-j2ee-jacc_1.0_spec/1.0/geronimo-j2ee-jacc_1.0_spec-1.0.pom +org/apache/geronimo/specs/geronimo-j2ee-jacc_1.0_spec/maven-metadata.xml +org/apache/geronimo/specs/geronimo-j2ee-management_1.0_spec/1.0/geronimo-j2ee-management_1.0_spec-1.0.jar +org/apache/geronimo/specs/geronimo-j2ee-management_1.0_spec/1.0/geronimo-j2ee-management_1.0_spec-1.0.pom +org/apache/geronimo/specs/geronimo-j2ee-management_1.0_spec/maven-metadata.xml +org/apache/geronimo/specs/geronimo-jaxr_1.0_spec/1.0/geronimo-jaxr_1.0_spec-1.0.jar +org/apache/geronimo/specs/geronimo-jaxr_1.0_spec/1.0/geronimo-jaxr_1.0_spec-1.0.pom +org/apache/geronimo/specs/geronimo-jaxr_1.0_spec/maven-metadata.xml +org/apache/geronimo/specs/geronimo-jaxrpc_1.1_spec/1.0/geronimo-jaxrpc_1.1_spec-1.0.jar +org/apache/geronimo/specs/geronimo-jaxrpc_1.1_spec/1.0/geronimo-jaxrpc_1.1_spec-1.0.pom +org/apache/geronimo/specs/geronimo-jaxrpc_1.1_spec/maven-metadata.xml +org/apache/geronimo/specs/geronimo-jms_1.1_spec/1.0/geronimo-jms_1.1_spec-1.0.jar +org/apache/geronimo/specs/geronimo-jms_1.1_spec/1.0/geronimo-jms_1.1_spec-1.0.pom +org/apache/geronimo/specs/geronimo-jms_1.1_spec/maven-metadata.xml +org/apache/geronimo/specs/geronimo-jsp_2.0_spec/1.0/geronimo-jsp_2.0_spec-1.0.jar +org/apache/geronimo/specs/geronimo-jsp_2.0_spec/1.0/geronimo-jsp_2.0_spec-1.0.pom +org/apache/geronimo/specs/geronimo-jsp_2.0_spec/maven-metadata.xml +org/apache/geronimo/specs/geronimo-jta_1.0.1B_spec/1.0/geronimo-jta_1.0.1B_spec-1.0.jar +org/apache/geronimo/specs/geronimo-jta_1.0.1B_spec/1.0/geronimo-jta_1.0.1B_spec-1.0.pom +org/apache/geronimo/specs/geronimo-jta_1.0.1B_spec/maven-metadata.xml +org/apache/geronimo/specs/geronimo-qname_1.1_spec/1.0/geronimo-qname_1.1_spec-1.0.jar +org/apache/geronimo/specs/geronimo-qname_1.1_spec/1.0/geronimo-qname_1.1_spec-1.0.pom +org/apache/geronimo/specs/geronimo-qname_1.1_spec/maven-metadata.xml +org/apache/geronimo/specs/geronimo-saaj_1.1_spec/1.0/geronimo-saaj_1.1_spec-1.0.jar +org/apache/geronimo/specs/geronimo-saaj_1.1_spec/1.0/geronimo-saaj_1.1_spec-1.0.pom +org/apache/geronimo/specs/geronimo-saaj_1.1_spec/maven-metadata.xml +org/apache/geronimo/specs/geronimo-servlet_2.4_spec/1.0/geronimo-servlet_2.4_spec-1.0.jar +org/apache/geronimo/specs/geronimo-servlet_2.4_spec/1.0/geronimo-servlet_2.4_spec-1.0.pom +org/apache/geronimo/specs/geronimo-servlet_2.4_spec/maven-metadata.xml +org.apache.axis/jars/axis-1.4.jar +org.apache.axis/jars/axis-1.4.jar.sha +org.apache.axis/jars/axis-ant-1.4.jar +org.apache.axis/jars/axis-ant-1.4.jar.sha +org.apache.axis/jars/axis-jaxrpc-1.4.jar +org.apache.axis/jars/axis-jaxrpc-1.4.jar.sha +org.apache.axis/jars/axis-saaj-1.4.jar +org.apache.axis/jars/axis-saaj-1.4.jar.sha +org.apache.bcel/jars/bcel-5.2.jar +org.apache.beehive/jars/beehive-controls-1.0.1.jar +org.apache.beehive/jars/beehive-ejb-control-1.0.1.jar +org.apache.beehive/jars/beehive-jdbc-control-1.0.1.jar +org.apache.beehive/jars/beehive-jms-control-1.0.1.jar +org.apache.beehive/jars/beehive-netui-compiler-1.0.1.jar +org.apache.beehive/jars/beehive-netui-core-1.0.1.jar +org.apache.beehive/jars/beehive-netui-tags-1.0.1.jar +org.apache.beehive/poms/beehive-control-ejb-1.0.1.pom +org.apache.beehive/poms/beehive-control-jdbc-1.0.1.pom +org.apache.beehive/poms/beehive-control-jms-1.0.1.pom +org.apache.beehive/poms/beehive-controls-1.0.1.pom +org.apache.beehive/poms/beehive-netui-compiler-1.0.1.pom +org.apache.beehive/poms/beehive-netui-core-1.0.1.pom +org.apache.beehive/poms/beehive-netui-tags-1.0.1.pom +org.apache.derby/jars/derby-10.1.1.0.jar +org.apache.derby/jars/derbyLocale_de_DE-10.1.1.0.jar +org.apache.derby/jars/derby-10.1.2.1.jar +org.apache.derby/jars/derby-10.1.3.1.jar +org.apache.derby/jars/derbyclient-10.1.1.0.jar +org.apache.derby/jars/derbyLocale_de_DE-10.1.2.1.jar +org.apache.derby/jars/derbyLocale_de_DE-10.1.3.1.jar +org.apache.derby/jars/derbyLocale_es-10.1.1.0.jar +org.apache.derby/jars/derbyLocale_es-10.1.2.1.jar +org.apache.derby/jars/derbyLocale_es-10.1.3.1.jar +org.apache.derby/jars/derbyLocale_fr-10.1.1.0.jar +org.apache.derby/jars/derbyLocale_fr-10.1.2.1.jar +org.apache.derby/jars/derbyLocale_fr-10.1.3.1.jar +org.apache.derby/jars/derbyLocale_it-10.1.1.0.jar +org.apache.derby/jars/derbyLocale_it-10.1.2.1.jar +org.apache.derby/jars/derbyLocale_it-10.1.3.1.jar +org.apache.derby/jars/derbyLocale_ja_JP-10.1.1.0.jar +org.apache.derby/jars/derbyLocale_ja_JP-10.1.2.1.jar +org.apache.derby/jars/derbyLocale_ja_JP-10.1.3.1.jar +org.apache.derby/jars/derbyLocale_ko_KR-10.1.1.0.jar +org.apache.derby/jars/derbyLocale_ko_KR-10.1.2.1.jar +org.apache.derby/jars/derbyLocale_ko_KR-10.1.3.1.jar +org.apache.derby/jars/derbyLocale_pt_BR-10.1.1.0.jar +org.apache.derby/jars/derbyLocale_pt_BR-10.1.2.1.jar +org.apache.derby/jars/derbyLocale_pt_BR-10.1.3.1.jar +org.apache.derby/jars/derbyLocale_zh_CN-10.1.1.0.jar +org.apache.derby/jars/derbyLocale_zh_CN-10.1.2.1.jar +org.apache.derby/jars/derbyLocale_zh_CN-10.1.3.1.jar +org.apache.derby/jars/derbyLocale_zh_TW-10.1.1.0.jar +org.apache.derby/jars/derbyLocale_zh_TW-10.1.2.1.jar +org.apache.derby/jars/derbyLocale_zh_TW-10.1.3.1.jar +org.apache.derby/jars/derbyclient-10.1.2.1.jar +org.apache.derby/jars/derbyclient-10.1.3.1.jar +org.apache.derby/jars/derbynet-10.1.1.0.jar +org.apache.derby/jars/derbynet-10.1.2.1.jar +org.apache.derby/jars/derbynet-10.1.3.1.jar +org.apache.derby/jars/derbytools-10.1.1.0.jar +org.apache.derby/jars/derbytools-10.1.2.1.jar +org.apache.derby/jars/derbytools-10.1.3.1.jar +org.apache.derby/jars/derby-10.2.2.0.jar +org.apache.derby/jars/derbyLocale_de_DE-10.2.2.0.jar +org.apache.derby/jars/derbyLocale_es-10.2.2.0.jar +org.apache.derby/jars/derbyLocale_fr-10.2.2.0.jar +org.apache.derby/jars/derbyLocale_it-10.2.2.0.jar +org.apache.derby/jars/derbyLocale_ja_JP-10.2.2.0.jar +org.apache.derby/jars/derbyLocale_ko_KR-10.2.2.0.jar +org.apache.derby/jars/derbyLocale_pt_BR-10.2.2.0.jar +org.apache.derby/jars/derbyLocale_zh_CN-10.2.2.0.jar +org.apache.derby/jars/derbyLocale_zh_TW-10.2.2.0.jar +org.apache.derby/jars/derbyclient-10.2.2.0.jar +org.apache.derby/jars/derbynet-10.2.2.0.jar +org.apache.derby/jars/derbytools-10.2.2.0.jar +org.apache.derby/jars/derbyclient-10.3.1.4.jar +org.apache.derby/jars/derbyLocale_cs-10.3.1.4.jar +org.apache.derby/jars/derbyLocale_de_DE-10.3.1.4.jar +org.apache.derby/jars/derbyLocale_es-10.3.1.4.jar +org.apache.derby/jars/derbyLocale_fr-10.3.1.4.jar +org.apache.derby/jars/derbyLocale_hu-10.3.1.4.jar +org.apache.derby/jars/derbyLocale_it-10.3.1.4.jar +org.apache.derby/jars/derbyLocale_ja_JP-10.3.1.4.jar +org.apache.derby/jars/derbyLocale_ko_KR-10.3.1.4.jar +org.apache.derby/jars/derbyLocale_pl-10.3.1.4.jar +org.apache.derby/jars/derbyLocale_pt_BR-10.3.1.4.jar +org.apache.derby/jars/derbyLocale_ru-10.3.1.4.jar +org.apache.derby/jars/derbyLocale_zh_CN-10.3.1.4.jar +org.apache.derby/jars/derbyLocale_zh_TW-10.3.1.4.jar +org.apache.derby/jars/derby-10.3.1.4.jar +org.apache.derby/jars/derbynet-10.3.1.4.jar +org.apache.derby/jars/derbytools-10.3.1.4.jar +org.apache.derby/poms/derby-10.1.1.0.pom +org.apache.derby/poms/derbyLocale_de_DE-10.1.1.0.pom +org.apache.derby/poms/derby-10.1.2.1.pom +org.apache.derby/poms/derby-10.1.3.1.pom +org.apache.derby/poms/derbyLocale_de_DE-10.1.2.1.pom +org.apache.derby/poms/derbyLocale_de_DE-10.1.3.1.pom +org.apache.derby/poms/derbyLocale_es-10.1.1.0.pom +org.apache.derby/poms/derbyLocale_es-10.1.2.1.pom +org.apache.derby/poms/derbyLocale_es-10.1.3.1.pom +org.apache.derby/poms/derbyLocale_fr-10.1.1.0.pom +org.apache.derby/poms/derbynet-10.1.1.0.pom +org.apache.derby/poms/derbyLocale_fr-10.1.2.1.pom +org.apache.derby/poms/derbyLocale_fr-10.1.3.1.pom +org.apache.derby/poms/derbyLocale_it-10.1.1.0.pom +org.apache.derby/poms/derbyLocale_it-10.1.2.1.pom +org.apache.derby/poms/derbyLocale_it-10.1.3.1.pom +org.apache.derby/poms/derbyLocale_ja_JP-10.1.1.0.pom +org.apache.derby/poms/derbyLocale_ja_JP-10.1.2.1.pom +org.apache.derby/poms/derbyLocale_ja_JP-10.1.3.1.pom +org.apache.derby/poms/derbyLocale_ko_KR-10.1.1.0.pom +org.apache.derby/poms/derbyLocale_ko_KR-10.1.2.1.pom +org.apache.derby/poms/derbyLocale_ko_KR-10.1.3.1.pom +org.apache.derby/poms/derbyLocale_pt_BR-10.1.1.0.pom +org.apache.derby/poms/derbyLocale_pt_BR-10.1.2.1.pom +org.apache.derby/poms/derbyLocale_pt_BR-10.1.3.1.pom +org.apache.derby/poms/derbyLocale_zh_CN-10.1.1.0.pom +org.apache.derby/poms/derbyLocale_zh_CN-10.1.2.1.pom +org.apache.derby/poms/derbyLocale_zh_CN-10.1.3.1.pom +org.apache.derby/poms/derbyLocale_zh_TW-10.1.1.0.pom +org.apache.derby/poms/derbyLocale_zh_TW-10.1.2.1.pom +org.apache.derby/poms/derbyLocale_zh_TW-10.1.3.1.pom +org.apache.derby/poms/derbyclient-10.1.1.0.pom +org.apache.derby/poms/derbytools-10.1.2.1.pom +org.apache.derby/poms/derbyclient-10.1.2.1.pom +org.apache.derby/poms/derbyclient-10.1.3.1.pom +org.apache.derby/poms/derbynet-10.1.2.1.pom +org.apache.derby/poms/derbynet-10.1.3.1.pom +org.apache.derby/poms/derbytools-10.1.1.0.pom +org.apache.derby/poms/derbytools-10.1.3.1.pom +org.apache.derby/poms/derbywar-10.1.1.0.pom +org.apache.derby/poms/derbywar-10.1.2.1.pom +org.apache.derby/poms/derbywar-10.1.3.1.pom +org.apache.derby/poms/derby-10.2.2.0.pom +org.apache.derby/poms/derbyLocale_de_DE-10.2.2.0.pom +org.apache.derby/poms/derbyLocale_es-10.2.2.0.pom +org.apache.derby/poms/derbyLocale_fr-10.2.2.0.pom +org.apache.derby/poms/derbyLocale_it-10.2.2.0.pom +org.apache.derby/poms/derbyLocale_ja_JP-10.2.2.0.pom +org.apache.derby/poms/derbyLocale_ko_KR-10.2.2.0.pom +org.apache.derby/poms/derbyLocale_pt_BR-10.2.2.0.pom +org.apache.derby/poms/derbyLocale_zh_CN-10.2.2.0.pom +org.apache.derby/poms/derbyLocale_zh_TW-10.2.2.0.pom +org.apache.derby/poms/derbyclient-10.2.2.0.pom +org.apache.derby/poms/derbynet-10.2.2.0.pom +org.apache.derby/poms/derbytools-10.2.2.0.pom +org.apache.derby/poms/derbywar-10.2.2.0.pom +org.apache.derby/poms/derbyclient-10.3.1.4.pom +org.apache.derby/poms/derbyLocale_cs-10.3.1.4.pom +org.apache.derby/poms/derbyLocale_de_DE-10.3.1.4.pom +org.apache.derby/poms/derbyLocale_es-10.3.1.4.pom +org.apache.derby/poms/derbyLocale_fr-10.3.1.4.pom +org.apache.derby/poms/derbyLocale_hu-10.3.1.4.pom +org.apache.derby/poms/derbyLocale_it-10.3.1.4.pom +org.apache.derby/poms/derbyLocale_ja_JP-10.3.1.4.pom +org.apache.derby/poms/derby-10.3.1.4.pom +org.apache.derby/poms/derbyLocale_ko_KR-10.3.1.4.pom +org.apache.derby/poms/derbyLocale_pl-10.3.1.4.pom +org.apache.derby/poms/derbyLocale_pt_BR-10.3.1.4.pom +org.apache.derby/poms/derbyLocale_ru-10.3.1.4.pom +org.apache.derby/poms/derbyLocale_zh_CN-10.3.1.4.pom +org.apache.derby/poms/derbyLocale_zh_TW-10.3.1.4.pom +org.apache.derby/poms/derbynet-10.3.1.4.pom +org.apache.derby/poms/derbytools-10.3.1.4.pom +org.apache.derby/poms/derbywar-10.3.1.4.pom +org.apache.derby/wars/derbywar-10.1.1.0.war +org.apache.derby/wars/derbywar-10.1.2.1.war +org.apache.derby/wars/derbywar-10.1.3.1.war +org.apache.derby/wars/derbywar-10.2.2.0.war +org.apache.derby/wars/derbywar-10.3.1.4.war +org.apache.geronimo/jars/daytrader-core-1.0.jar +org.apache.geronimo/jars/daytrader-streamer-1.0.jar +org.apache.geronimo/jars/daytrader-wsappclient-1.0.jar +org.apache.geronimo/jars/geronimo-activation-1.0.jar +org.apache.geronimo/jars/geronimo-axis-1.0.jar +org.apache.geronimo/jars/geronimo-axis-builder-1.0.jar +org.apache.geronimo/jars/geronimo-client-1.0.jar +org.apache.geronimo/jars/geronimo-client-builder-1.0.jar +org.apache.geronimo/jars/geronimo-common-1.0.jar +org.apache.geronimo/jars/geronimo-connector-1.0.jar +org.apache.geronimo/jars/geronimo-connector-builder-1.0.jar +org.apache.geronimo/jars/geronimo-console-core-1.0.jar +org.apache.geronimo/jars/geronimo-console-web-1.0.jar +org.apache.geronimo/jars/geronimo-converter-1.0.jar +org.apache.geronimo/jars/geronimo-core-1.0.jar +org.apache.geronimo/jars/geronimo-daytrader-derby-db-1.0.jar +org.apache.geronimo/jars/geronimo-deploy-config-1.0.jar +org.apache.geronimo/jars/geronimo-deploy-jsr88-1.0.jar +org.apache.geronimo/jars/geronimo-deploy-tool-1.0.jar +org.apache.geronimo/jars/geronimo-deployment-1.0.jar +org.apache.geronimo/jars/geronimo-derby-1.0.jar +org.apache.geronimo/jars/geronimo-directory-1.0.jar +org.apache.geronimo/jars/geronimo-hot-deploy-1.0.jar +org.apache.geronimo/jars/geronimo-j2ee-1.0.jar +org.apache.geronimo/jars/geronimo-j2ee-builder-1.0.jar +org.apache.geronimo/jars/geronimo-j2ee-schema-1.0.jar +org.apache.geronimo/jars/geronimo-javamail-transport-1.0.jar +org.apache.geronimo/jars/geronimo-jetty-1.0.jar +org.apache.geronimo/jars/geronimo-jetty-builder-1.0.jar +org.apache.geronimo/jars/geronimo-jmxremoting-1.0.jar +org.apache.geronimo/jars/geronimo-kernel-1.0.jar +org.apache.geronimo/jars/geronimo-mail-1.0.jar +org.apache.geronimo/jars/geronimo-management-1.0.jar +org.apache.geronimo/jars/geronimo-naming-1.0.jar +org.apache.geronimo/jars/geronimo-naming-builder-1.0.jar +org.apache.geronimo/jars/geronimo-remote-deploy-lib-1.0.jar +org.apache.geronimo/jars/geronimo-scripts-1.0.jar +org.apache.geronimo/jars/geronimo-security-1.0.jar +org.apache.geronimo/jars/geronimo-security-builder-1.0.jar +org.apache.geronimo/jars/geronimo-service-builder-1.0.jar +org.apache.geronimo/jars/geronimo-system-1.0.jar +org.apache.geronimo/jars/geronimo-test-ddbean-1.0.jar +org.apache.geronimo/jars/geronimo-timer-1.0.jar +org.apache.geronimo/jars/geronimo-tomcat-1.0.jar +org.apache.geronimo/jars/geronimo-tomcat-builder-1.0.jar +org.apache.geronimo/jars/geronimo-transaction-1.0.jar +org.apache.geronimo/jars/geronimo-uddi-db-1.0.jar +org.apache.geronimo/jars/geronimo-util-1.0.jar +org.apache.geronimo/jars/geronimo-web-builder-1.0.jar +org.apache.geronimo/jars/geronimo-webservices-1.0.jar +org.apache.geronimo.specs/jars/geronimo-activation_1.0.2_spec-1.0.jar +org.apache.geronimo.specs/jars/geronimo-activation_1.0.2_spec-1.0.jar.sha +org.apache.geronimo.specs/jars/geronimo-activation_1.0.2_spec-1.1.jar +org.apache.geronimo.specs/jars/geronimo-commonj_1.1_spec-1.0.jar +org.apache.geronimo.specs/jars/geronimo-corba_2.3_spec-1.0.jar +org.apache.geronimo.specs/jars/geronimo-j2ee-connector_1.5_spec-1.0.1.jar +org.apache.geronimo.specs/jars/geronimo-corba_2.3_spec-1.0.jar.sha +org.apache.geronimo.specs/jars/geronimo-corba_2.3_spec-1.1.jar +org.apache.geronimo.specs/jars/geronimo-corba_3.0_spec-1.1.jar +org.apache.geronimo.specs/jars/geronimo-ejb_2.1_spec-1.0.1.jar +org.apache.geronimo.specs/jars/geronimo-ejb_2.1_spec-1.0.jar +org.apache.geronimo.specs/jars/geronimo-ejb_2.1_spec-1.0.jar.sha +org.apache.geronimo.specs/jars/geronimo-j2ee_1.4_spec-1.0.jar.sha +org.apache.geronimo.specs/jars/geronimo-j2ee-connector_1.5_spec-1.0.jar +org.apache.geronimo.specs/jars/geronimo-j2ee-connector_1.5_spec-1.0.jar.sha +org.apache.geronimo.specs/jars/geronimo-j2ee-deployment_1.1_spec-1.0.1.jar +org.apache.geronimo.specs/jars/geronimo-j2ee_1.4_spec-1.1.jar +org.apache.geronimo.specs/jars/geronimo-j2ee-deployment_1.1_spec-1.0.jar +org.apache.geronimo.specs/jars/geronimo-j2ee-deployment_1.1_spec-1.0.jar.sha +org.apache.geronimo.specs/jars/geronimo-j2ee-jacc_1.0_spec-1.0.1.jar +org.apache.geronimo.specs/jars/geronimo-j2ee-jacc_1.0_spec-1.0.jar +org.apache.geronimo.specs/jars/geronimo-j2ee-jacc_1.0_spec-1.0.jar.sha +org.apache.geronimo.specs/jars/geronimo-j2ee-management_1.0_spec-1.0.1.jar +org.apache.geronimo.specs/jars/geronimo-j2ee-management_1.0_spec-1.0.jar +org.apache.geronimo.specs/jars/geronimo-j2ee-management_1.0_spec-1.0.jar.sha +org.apache.geronimo.specs/jars/geronimo-j2ee_1.4_spec-1.0.jar +org.apache.geronimo.specs/jars/geronimo-javamail_1.3.1_spec-1.0.jar +org.apache.geronimo.specs/jars/geronimo-javamail_1.3.1_spec-1.0.jar.sha +org.apache.geronimo.specs/jars/geronimo-javamail_1.3.1_spec-1.1.jar +org.apache.geronimo.specs/jars/geronimo-jaxr_1.0_spec-1.0.1.jar +org.apache.geronimo.specs/jars/geronimo-jaxr_1.0_spec-1.0.jar +org.apache.geronimo.specs/jars/geronimo-jms_1.1_spec-1.0.jar +org.apache.geronimo.specs/jars/geronimo-jaxr_1.0_spec-1.0.jar.sha +org.apache.geronimo.specs/jars/geronimo-jaxrpc_1.1_spec-1.0.1.jar +org.apache.geronimo.specs/jars/geronimo-jaxrpc_1.1_spec-1.0.jar +org.apache.geronimo.specs/jars/geronimo-jaxrpc_1.1_spec-1.0.jar.sha +org.apache.geronimo.specs/jars/geronimo-jms_1.1_spec-1.0.1.jar +org.apache.geronimo.specs/jars/geronimo-jms_1.1_spec-1.0.jar.sha +org.apache.geronimo.specs/jars/geronimo-jsp_2.0_spec-1.0.1.jar +org.apache.geronimo.specs/jars/geronimo-jsp_2.0_spec-1.0.jar +org.apache.geronimo.specs/jars/geronimo-jsp_2.0_spec-1.0.jar.sha +org.apache.geronimo.specs/jars/geronimo-jta_1.0.1B_spec-1.0.1.jar +org.apache.geronimo.specs/jars/geronimo-jta_1.0.1B_spec-1.0.jar +org.apache.geronimo.specs/jars/geronimo-jta_1.0.1B_spec-1.0.jar.sha +org.apache.geronimo.specs/jars/geronimo-qname_1.1_spec-1.0.1.jar +org.apache.geronimo.specs/jars/geronimo-qname_1.1_spec-1.0.jar +org.apache.geronimo.specs/jars/geronimo-qname_1.1_spec-1.0.jar.sha +org.apache.geronimo.specs/jars/geronimo-saaj_1.1_spec-1.0.1.jar +org.apache.geronimo.specs/jars/geronimo-saaj_1.1_spec-1.0.jar +org.apache.geronimo.specs/jars/geronimo-saaj_1.1_spec-1.0.jar.sha +org.apache.geronimo.specs/jars/geronimo-servlet_2.4_spec-1.0.1.jar +org.apache.geronimo.specs/jars/geronimo-servlet_2.4_spec-1.0.jar +org.apache.geronimo.specs/jars/geronimo-servlet_2.4_spec-1.0.jar.sha +org.apache.geronimo.specs/jars/geronimo-annotation_1.0_spec-1.1.jar +org.apache.jackrabbit/jars/jackrabbit-core-1.0.1.jar +org.apache.jackrabbit/jars/jackrabbit-core-1.0.jar +org.apache.jackrabbit/jars/jackrabbit-index-filters-1.0.1.jar +org.apache.jackrabbit/jars/jackrabbit-core-1.1.jar +org.apache.jackrabbit/jars/jackrabbit-index-filters-1.0.jar +org.apache.jackrabbit/jars/jackrabbit-jcr-client-1.0.1.jar +org.apache.jackrabbit/jars/jackrabbit-jcr-client-1.0.jar +org.apache.jackrabbit/jars/jackrabbit-jcr-commons-1.0.1.jar +org.apache.jackrabbit/jars/jackrabbit-jcr-commons-1.0.jar +org.apache.jackrabbit/jars/jackrabbit-jcr-rmi-1.0.1.jar +org.apache.jackrabbit/jars/jackrabbit-jcr-rmi-1.0.jar +org.apache.jackrabbit/jars/jackrabbit-jcr-server-1.0.1.jar +org.apache.jackrabbit/jars/jackrabbit-jcr-server-1.0.jar +org.apache.jackrabbit/jars/jackrabbit-jcr-webdav-1.0.1.jar +org.apache.jackrabbit/jars/jackrabbit-jcr-webdav-1.0.jar +org.apache.jackrabbit/jars/jackrabbit-jcr-webdav-1.1.jar +org.apache.jackrabbit/jars/jackrabbit-jcr-server-1.1.jar +org.apache.jackrabbit/jars/jackrabbit-core-1.1.1.jar +org.apache.jackrabbit/jars/jackrabbit-jcr-rmi-1.1.jar +org.apache.jackrabbit/jars/jackrabbit-jcr-commons-1.1.jar +org.apache.jackrabbit/jars/jackrabbit-jcr-client-1.1.jar +org.apache.jackrabbit/jars/jackrabbit-index-filters-1.1.jar +org.apache.jackrabbit/jars/jackrabbit-jca-1.1.1.jar +org.apache.jackrabbit/jars/jackrabbit-jcr-commons-1.1.1.jar +org.apache.jackrabbit/jars/jackrabbit-jcr-rmi-1.1.1.jar +org.apache.jackrabbit/jars/jackrabbit-index-filters-1.1.1.jar +org.apache.jackrabbit/jars/jackrabbit-jcr-webdav-1.1.1.jar +org.apache.jackrabbit/jars/jackrabbit-jcr-client-1.1.1.jar +org.apache.jackrabbit/jars/jackrabbit-jcr-server-1.1.1.jar +org.apache.jackrabbit/java-sources/jackrabbit-core-1.0-sources.jar +org.apache.jackrabbit/java-sources/jackrabbit-core-1.0.1-sources.jar +org.apache.jackrabbit/java-sources/jackrabbit-index-filters-1.0-sources.jar +org.apache.jackrabbit/java-sources/jackrabbit-jcr-client-1.0.1-sources.jar +org.apache.jackrabbit/java-sources/jackrabbit-index-filters-1.0.1-sources.jar +org.apache.jackrabbit/java-sources/jackrabbit-jca-1.0-sources.jar +org.apache.jackrabbit/java-sources/jackrabbit-jca-1.0.1-sources.jar +org.apache.jackrabbit/java-sources/jackrabbit-jcr-client-1.0-sources.jar +org.apache.jackrabbit/java-sources/jackrabbit-jcr-commons-1.0-sources.jar +org.apache.jackrabbit/java-sources/jackrabbit-jcr-commons-1.0.1-sources.jar +org.apache.jackrabbit/java-sources/jackrabbit-jcr-rmi-1.0-sources.jar +org.apache.jackrabbit/java-sources/jackrabbit-jcr-rmi-1.0.1-sources.jar +org.apache.jackrabbit/java-sources/jackrabbit-core-1.1-sources.jar +org.apache.jackrabbit/java-sources/jackrabbit-jcr-server-1.0-sources.jar +org.apache.jackrabbit/java-sources/jackrabbit-jcr-server-1.0.1-sources.jar +org.apache.jackrabbit/java-sources/jackrabbit-jcr-webdav-1.0-sources.jar +org.apache.jackrabbit/java-sources/jackrabbit-jcr-webdav-1.0.1-sources.jar +org.apache.jackrabbit/java-sources/jackrabbit-server-1.0-sources.jar +org.apache.jackrabbit/java-sources/jackrabbit-server-1.0.1-sources.jar +org.apache.jackrabbit/java-sources/jackrabbit-server-1.1-sources.jar +org.apache.jackrabbit/java-sources/jackrabbit-jcr-webdav-1.1-sources.jar +org.apache.jackrabbit/java-sources/jackrabbit-jcr-server-1.1-sources.jar +org.apache.jackrabbit/java-sources/jackrabbit-jcr-rmi-1.1-sources.jar +org.apache.jackrabbit/java-sources/jackrabbit-jcr-commons-1.1-sources.jar +org.apache.jackrabbit/java-sources/jackrabbit-jcr-client-1.1-sources.jar +org.apache.jackrabbit/java-sources/jackrabbit-jca-1.1-sources.jar +org.apache.jackrabbit/java-sources/jackrabbit-index-filters-1.1-sources.jar +org.apache.jackrabbit/java-sources/jackrabbit-server-1.1.1-sources.jar +org.apache.jackrabbit/java-sources/jackrabbit-core-1.1.1-sources.jar +org.apache.jackrabbit/java-sources/jackrabbit-jcr-rmi-1.1.1-sources.jar +org.apache.jackrabbit/java-sources/jackrabbit-index-filters-1.1.1-sources.jar +org.apache.jackrabbit/java-sources/jackrabbit-jca-1.1.1-sources.jar +org.apache.jackrabbit/java-sources/jackrabbit-jcr-webdav-1.1.1-sources.jar +org.apache.jackrabbit/java-sources/jackrabbit-jcr-client-1.1.1-sources.jar +org.apache.jackrabbit/java-sources/jackrabbit-jcr-server-1.1.1-sources.jar +org.apache.jackrabbit/poms/jackrabbit-core-1.0.1.pom +org.apache.jackrabbit/poms/jackrabbit-core-1.0.pom +org.apache.jackrabbit/poms/jackrabbit-index-filters-1.0.1.pom +org.apache.jackrabbit/poms/jackrabbit-core-1.1.pom +org.apache.jackrabbit/poms/jackrabbit-index-filters-1.0.pom +org.apache.jackrabbit/poms/jackrabbit-server-1.1.pom +org.apache.jackrabbit/poms/jackrabbit-jca-1.0.1.pom +org.apache.jackrabbit/poms/jackrabbit-jca-1.0.pom +org.apache.jackrabbit/poms/jackrabbit-jcr-client-1.0.1.pom +org.apache.jackrabbit/poms/jackrabbit-jcr-client-1.0.pom +org.apache.jackrabbit/poms/jackrabbit-jcr-commons-1.0.1.pom +org.apache.jackrabbit/poms/jackrabbit-jcr-commons-1.0.pom +org.apache.jackrabbit/poms/jackrabbit-jcr-rmi-1.0.1.pom +org.apache.jackrabbit/poms/jackrabbit-jcr-rmi-1.0.pom +org.apache.jackrabbit/poms/jackrabbit-jcr-server-1.0.1.pom +org.apache.jackrabbit/poms/jackrabbit-jcr-server-1.0.pom +org.apache.jackrabbit/poms/jackrabbit-jcr-webdav-1.0.1.pom +org.apache.jackrabbit/poms/jackrabbit-jcr-webdav-1.0.pom +org.apache.jackrabbit/poms/jackrabbit-server-1.0.1.pom +org.apache.jackrabbit/poms/jackrabbit-server-1.0.pom +org.apache.jackrabbit/poms/jackrabbit-jcr-webdav-1.1.pom +org.apache.jackrabbit/poms/jackrabbit-jcr-server-1.1.pom +org.apache.jackrabbit/poms/jackrabbit-jcr-rmi-1.1.pom +org.apache.jackrabbit/poms/jackrabbit-jcr-commons-1.1.pom +org.apache.jackrabbit/poms/jackrabbit-jcr-client-1.1.pom +org.apache.jackrabbit/poms/jackrabbit-jca-1.1.pom +org.apache.jackrabbit/poms/jackrabbit-index-filters-1.1.pom +org.apache.jackrabbit/poms/jackrabbit-core-1.1.1.pom +org.apache.jackrabbit/poms/jackrabbit-jcr-commons-1.1.1.pom +org.apache.jackrabbit/poms/jackrabbit-jcr-rmi-1.1.1.pom +org.apache.jackrabbit/poms/jackrabbit-index-filters-1.1.1.pom +org.apache.jackrabbit/poms/jackrabbit-jca-1.1.1.pom +org.apache.jackrabbit/poms/jackrabbit-jcr-webdav-1.1.1.pom +org.apache.jackrabbit/poms/jackrabbit-jcr-client-1.1.1.pom +org.apache.jackrabbit/poms/jackrabbit-jcr-server-1.1.1.pom +org.apache.jackrabbit/poms/jackrabbit-server-1.1.1.pom +org.apache.jackrabbit/rars/jackrabbit-jca-1.0.1.rar +org.apache.jackrabbit/rars/jackrabbit-jca-1.0.rar +org.apache.jackrabbit/rars/jackrabbit-jca-1.1.rar +org.apache.jackrabbit/rars/jackrabbit-jca-1.1.1.rar +org.apache.jackrabbit/wars/jackrabbit-server-1.0.1.war +org.apache.jackrabbit/wars/jackrabbit-server-1.0.war +org.apache.jackrabbit/wars/jackrabbit-server-1.1.war +org.apache.jackrabbit/wars/jackrabbit-server-1.1.1.war +org.apache.jdo/jars/jdo2-core-2.0-beta.jar +org.apache.jdo/jars/jdo2-core-2.0-rc1.jar +org.apache.jdo/jars/jdo2-core-2.0.jar +org.apache.jdo/jars/jdo2-enhancer-2.0-beta.jar +org.apache.jdo/jars/jdo2-enhancer-2.0-rc1.jar +org.apache.jdo/jars/jdo2-enhancer-2.0.jar +org.apache.jdo/jars/jdo2-tck-2.0-rc1.jar +org.apache.jdo/poms/jdo2-core-2.0-beta.pom +org.apache.jdo/poms/jdo2-core-2.0-rc1.pom +org.apache.jdo/poms/jdo2-core-2.0.pom +org.apache.jdo/poms/jdo2-enhancer-2.0-beta.pom +org.apache.jdo/poms/jdo2-enhancer-2.0-rc1.pom +org.apache.jdo/poms/jdo2-enhancer-2.0.pom +org.apache.jdo/poms/jdo2-tck-2.0-rc1.pom +org.apache.maven/jars/maven-artifact-ant-2.0-alpha-1-dep.jar +org.apache.maven/jars/maven-artifact-ant-2.0-alpha-2-dep.jar +org.apache.maven/jars/maven-artifact-ant-2.0-alpha-3-dep.jar +org.apache.maven/jars/maven-artifact-ant-2.0-beta-1-dep.jar +org.apache.maven/jars/maven-artifact-ant-2.0-beta-2-dep.jar +org.apache.maven/jars/maven-model-v3-2.0.jar +org.apache.maven/poms/maven-model-v3-2.0.pom +org.apache.pluto/jars/pluto-1.0.1-rc4.jar +org.apache.pluto/jars/pluto-deploy-1.0.1-rc4.jar +org.apache.pluto/jars/pluto-1.0.1.jar +org.apache.pluto/jars/pluto-deploy-1.0.1.jar +org.apache.pluto/jars/pluto-descriptors-1.0.1-rc4.jar +org.apache.pluto/jars/pluto-descriptors-1.0.1.jar +org.apache.pluto/jars/pluto-portal-1.0.1-rc4.jar +org.apache.pluto/jars/pluto-portal-1.0.1.jar +org.apache.portals.bridges/jars/portals-bridges-common-1.0.jar +org.apache.portals.bridges/jars/portals-bridges-frameworks-1.0.jar +org.apache.portals.bridges/jars/portals-bridges-jsf-1.0.jar +org.apache.portals.bridges/jars/portals-bridges-perl-1.0.jar +org.apache.portals.bridges/jars/portals-bridges-php-1.0.jar +org.apache.portals.bridges/jars/portals-bridges-portletfilter-1.0.jar +org.apache.portals.bridges/jars/portals-bridges-struts-1.2.4-1.0.jar +org.apache.portals.bridges/jars/portals-bridges-struts-1.2.7-1.0.jar +org.apache.portals.bridges/jars/portals-bridges-velocity-1.0.jar +org.apache.portals.jetspeed-2/jars/content-server-2.1-dev.jar +org.apache.portals.jetspeed-2/jars/content-server-2.0.jar +org.apache.portals.jetspeed-2/jars/jetspeed-api-2.1-dev.jar +org.apache.portals.jetspeed-2/jars/jetspeed-2.1-dev.jar +org.apache.portals.jetspeed-2/jars/jetspeed-api-2.0.1.jar +org.apache.portals.jetspeed-2/jars/jetspeed-api-2.0.jar +org.apache.portals.jetspeed-2/jars/jetspeed-capability-2.1-dev.jar +org.apache.portals.jetspeed-2/jars/jetspeed-capability-2.0.jar +org.apache.portals.jetspeed-2/jars/jetspeed-cm-2.1-dev.jar +org.apache.portals.jetspeed-2/jars/jetspeed-cm-2.0.jar +org.apache.portals.jetspeed-2/jars/jetspeed-commons-2.1-dev.jar +org.apache.portals.jetspeed-2/jars/jetspeed-commons-2.0.jar +org.apache.portals.jetspeed-2/jars/jetspeed-sso-2.0.jar +org.apache.portals.jetspeed-2/jars/jetspeed-statistics-2.1-dev.jar +org.apache.portals.jetspeed-2/jars/jetspeed-components-2.0.jar +org.apache.portals.jetspeed-2/jars/jetspeed-components-2.1-dev.jar +org.apache.portals.jetspeed-2/jars/jetspeed-deploy-tools-2.0.jar +org.apache.portals.jetspeed-2/jars/jetspeed-deploy-tools-2.1-dev.jar +org.apache.portals.jetspeed-2/jars/jetspeed-file-cache-2.0.jar +org.apache.portals.jetspeed-2/jars/jetspeed-file-cache-2.1-dev.jar +org.apache.portals.jetspeed-2/jars/jetspeed-header-resource-2.0.jar +org.apache.portals.jetspeed-2/jars/jetspeed-header-resource-2.1-dev.jar +org.apache.portals.jetspeed-2/jars/jetspeed-id-generator-2.0.jar +org.apache.portals.jetspeed-2/jars/jetspeed-id-generator-2.1-dev.jar +org.apache.portals.jetspeed-2/jars/jetspeed-importer-2.1-dev.jar +org.apache.portals.jetspeed-2/jars/jetspeed-layout-portlets-2.1-dev.jar +org.apache.portals.jetspeed-2/jars/jetspeed-locator-2.0.jar +org.apache.portals.jetspeed-2/jars/jetspeed-locator-2.1-dev.jar +org.apache.portals.jetspeed-2/jars/jetspeed-page-manager-2.0.jar +org.apache.portals.jetspeed-2/jars/jetspeed-page-manager-2.1-dev.jar +org.apache.portals.jetspeed-2/jars/jetspeed-portal-2.0.jar +org.apache.portals.jetspeed-2/jars/jetspeed-portal-2.1-dev.jar +org.apache.portals.jetspeed-2/jars/jetspeed-portal-site-2.0.jar +org.apache.portals.jetspeed-2/jars/jetspeed-portal-site-2.1-dev.jar +org.apache.portals.jetspeed-2/jars/jetspeed-portlet-factory-2.0.jar +org.apache.portals.jetspeed-2/jars/jetspeed-portlet-factory-2.1-dev.jar +org.apache.portals.jetspeed-2/jars/jetspeed-prefs-2.0.jar +org.apache.portals.jetspeed-2/jars/jetspeed-prefs-2.1-dev.jar +org.apache.portals.jetspeed-2/jars/jetspeed-profiler-2.0.jar +org.apache.portals.jetspeed-2/jars/jetspeed-profiler-2.1-dev.jar +org.apache.portals.jetspeed-2/jars/jetspeed-rdbms-2.0.jar +org.apache.portals.jetspeed-2/jars/jetspeed-rdbms-2.1-dev.jar +org.apache.portals.jetspeed-2/jars/jetspeed-registry-2.0.jar +org.apache.portals.jetspeed-2/jars/jetspeed-registry-2.1-dev.jar +org.apache.portals.jetspeed-2/jars/jetspeed-rewriter-2.0.jar +org.apache.portals.jetspeed-2/jars/jetspeed-rewriter-2.1-dev.jar +org.apache.portals.jetspeed-2/jars/jetspeed-rss-2.1-dev.jar +org.apache.portals.jetspeed-2/jars/jetspeed-search-2.0.jar +org.apache.portals.jetspeed-2/jars/jetspeed-search-2.1-dev.jar +org.apache.portals.jetspeed-2/jars/jetspeed-security-2.0.jar +org.apache.portals.jetspeed-2/jars/jetspeed-security-2.1-dev.jar +org.apache.portals.jetspeed-2/jars/jetspeed-security-schema-2.0.jar +org.apache.portals.jetspeed-2/jars/portlet-api-1.0.jar +org.apache.portals.jetspeed-2/jars/jetspeed-security-schema-2.1-dev.jar +org.apache.portals.jetspeed-2/jars/jetspeed-serializer-2.1-dev.jar +org.apache.portals.jetspeed-2/jars/jetspeed-sso-2.1-dev.jar +org.apache.portals.jetspeed-2/jars/jetspeed-statistics-2.0.jar +org.apache.portals.jetspeed-2/jars/jetspeed-web-content-2.0.jar +org.apache.portals.jetspeed-2/jars/jetspeed-web-content-2.1-dev.jar +org.apache.portals.jetspeed-2/jars/jetspeed-webapp-logging-2.1-dev.jar +org.apache.portals.jetspeed-2/jars/jetspeed2-taglib-treecontrol-2.0.jar +org.apache.portals.jetspeed-2/jars/jetspeed2-taglib-treecontrol-2.1-dev.jar +org.apache.portals.jetspeed-2/jars/portals-gems-2.0.jar +org.apache.portals.jetspeed-2/jars/portals-gems-2.1-dev.jar +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/META-INF/MANIFEST.MF +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/org/apache/jetspeed/dbutil/HSQLServerThread.class +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/org/apache/jetspeed/dbutil/HSQLServer.class +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/org/apache/jetspeed/dbutil/ScriptUtil.class +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/apacheds/apacheds-server.xml +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/apacheds/j2-apacheds.ldif +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/conf/jboss/jboss-login-config.xml +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/conf/jboss/jetspeed-ds.xml +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/conf/jboss/jetspeed-mysql-ds.xml +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/conf/jboss/jetspeed-oracle-ds.xml +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/conf/tomcat/jetspeed-tomcat-5.5.xml +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/conf/tomcat/jetspeed-tomcat-5.xml +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/db-ojb/OJB-logging.properties +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/db-ojb/OJB.properties +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/db-ojb/repository.dtd +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/db-ojb/repository.xml +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/db-ojb/repository_database.xml +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/db-ojb/repository_internal.xml +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/schema/phase3ojb-schema.xml +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/schema/phase1-schema.xml +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/schema/phase2-schema.xml +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/schema/prefs-schema.xml +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/schema/registry-schema.xml +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/schema/security-schema.xml +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/schema/velocity.log +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/schema/velocity.log.1 +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/sql/derby/schema/phase3ojb-schema.sql +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/sql/derby/schema/phase1-schema.sql +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/sql/derby/schema/phase2-schema.sql +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/sql/derby/schema/prefs-schema.sql +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/sql/derby/schema/registry-schema.sql +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/sql/derby/schema/security-schema.sql +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/sql/hsql/portal-drop.sql +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/sql/hsql/drop.sql +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/sql/hsql/registry-drop.sql +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/sql/hsql/prefs-drop.sql +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/sql/hsql/populate-userinfo-for-default-psml.sql +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/sql/hsql/security-drop.sql +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/sql/mssql/schema/phase2-schema.sql +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/sql/mssql/schema/security-schema.sql +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/sql/mssql/drop.sql +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/sql/mssql/populate-userinfo-for-default-psml.sql +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/sql/mysql/drop.sql +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/sql/mysql/populate-entities-for-default-psml.sql +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/sql/mysql/populate-userinfo-for-default-psml.sql +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/sql/oracle/drop.sql +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/sql/oracle/populate-userinfo-for-default-psml.sql +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/sql/xml/README.txt +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/sql/xml/populate-db-default.xml +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/sql/drop.sql +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/sql/populate-db-default.sql +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/sql/populate-userinfo-for-default-psml.sql +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/webapp/ajax/portlet_definitions.ajax +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/webapp/ajax/portlet_apps.ajax +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/webapp/ajax/portlet_entities.ajax +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/webapp/ajax/portlet_entity.ajax +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/webapp/decorations/images/customize.gif +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/webapp/decorations/images/close.gif +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/webapp/decorations/images/icon_error_sml.gif +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/webapp/decorations/images/edit.gif +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/webapp/decorations/images/help.gif +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/webapp/decorations/images/icon_arrowfolderclosed1_sml.gif +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/webapp/decorations/images/icon_arrowdoc_sml.gif +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/webapp/decorations/images/leftnavbg.gif +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/webapp/decorations/images/info.gif +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/webapp/decorations/images/icon_arrowfolderopen2_sml.gif +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/webapp/decorations/images/icon_info_sml.gif +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/webapp/decorations/images/icon_success_sml.gif +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/webapp/decorations/images/icon_warning_sml.gif +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/webapp/decorations/images/info1.gif +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/webapp/decorations/images/maximized.gif +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/webapp/decorations/images/minimized.gif +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/webapp/decorations/images/nw_maj_rond.gif +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/webapp/decorations/images/print.gif +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/webapp/decorations/images/restore.gif +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/webapp/decorations/images/sw_med_rond.gif +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/webapp/decorations/images/view.gif +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/webapp/decorations/layout/css/PLT.C.3-Messages.css +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/webapp/decorations/layout/css/PLT.C.1-Links.css +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/webapp/decorations/layout/css/PLT.C.2-Fonts.css +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/webapp/decorations/layout/css/PLT.C.4-Sections.css +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/webapp/decorations/layout/css/PLT.C.5-Forms.css +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/webapp/decorations/layout/css/PLT.C.6-Menus-Arrow.css +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/webapp/decorations/layout/css/PLT.C.6-Menus.css +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/webapp/decorations/layout/css/PLT.C.All.css +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/webapp/decorations/layout/css/data-scroller.css +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/webapp/decorations/layout/css/database-browser.css +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/webapp/decorations/layout/css/html-tables.css +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/webapp/decorations/layout/css/portal-standard.css +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/webapp/decorations/layout/css/standard-columns.css +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/webapp/decorations/layout/css/tree-component.css +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/webapp/decorations/layout/images/movePortletDown.gif +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev/plugin-resources/webapp/decorations/layout/images/close.gif +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.1-dev.jar +org.apache.portals.jetspeed-2/plugins/maven-jetspeed2-plugin-2.0.jar +org.apache.portals.jetspeed-2/wars/demo-2.1-dev.war +org.apache.portals.jetspeed-2/wars/demo-2.0.war +org.apache.portals.jetspeed-2/wars/j2-admin-2.1-dev.war +org.apache.portals.jetspeed-2/wars/j2-admin-2.0.war +org.apache.portals.jetspeed-2/wars/jetspeed-2.1-dev.war +org.apache.portals.jetspeed-2/wars/jetspeed-2.0.war +org.apache.portals.jetspeed-2/wars/jetspeed-layouts-2.1-dev.war +org.apache.portals.jetspeed-2/wars/jetspeed-layouts-2.0.war +org.apache.portals.jetspeed-2/wars/portals-gems-2.1-dev.war +org.apache.portals.jetspeed-2/wars/portals-gems-2.0.war +org.apache.portals.jetspeed-2/wars/rss-2.1-dev.war +org.apache.portals.jetspeed-2/wars/rss-2.0.war +org.apache.ws.commons/jars/XmlSchema-1.0.1.jar +org.apache.ws.commons/jars/XmlSchema-1.0.2.jar +org.apache.ws.commons/jars/XmlSchema-1.0.3.jar +org.apache.ws.commons/jars/XmlSchema-1.2.jar +org.apache.ws.commons/jars/XmlSchema-1.0.jar +org.apache.ws.commons/poms/XmlSchema-1.0.1.pom +org.apache.ws.commons/poms/XmlSchema-1.0.2.pom +org.apache.ws.commons/poms/XmlSchema-1.0.3.pom +org.apache.ws.commons/poms/XmlSchema-SNAPSHOT.pom +org.apache.ws.commons/poms/maven-metadata.xml +org.apache.xbean/jars/xbean-classpath-2.3.jar +org.apache.xbean/jars/xbean-classpath-2.4.jar +org.apache.xbean/jars/xbean-finder-2.4.jar +org.apache.xbean/jars/xbean-jaxb-2.4.jar +org.apache.xbean/jars/xbean-kernel-2.3.jar +org.apache.xbean/jars/xbean-kernel-2.4.jar +org.apache.xbean/jars/xbean-osgi-2.3.jar +org.apache.xbean/jars/xbean-osgi-2.4.jar +org.apache.xbean/jars/xbean-reflect-2.3.jar +org.apache.xbean/jars/xbean-reflect-2.4.jar +org.apache.xbean/jars/xbean-server-2.3.jar +org.apache.xbean/jars/xbean-server-2.4.jar +org.apache.xbean/jars/xbean-spring-2.3.jar +org.apache.xbean/jars/xbean-spring-2.4.jar +org.apache.xbean/jars/xbean-spring-common-2.4.jar +org.apache.xbean/jars/xbean-tiger-2.4.jar +org.apache.xbean/jars/xbean-spring-itests-124-2.4.jar +org.apache.xbean/jars/xbean-spring-itests-125-2.4.jar +org.apache.xbean/jars/xbean-spring-itests-126-2.4.jar +org.apache.xbean/jars/xbean-spring-itests-127-2.4.jar +org.apache.xbean/jars/xbean-spring-itests-128-2.4.jar +org.apache.xbean/jars/xbean-spring-itests-20m5-2.4.jar +org.apache.xbean/jars/xbean-spring-itests-core-2.4.jar +org.apache.xbean/jars/xbean-spring-v1-2.4.jar +org.apache.xbean/jars/xbean-spring-v2-2.4.jar +org.apache.xbean/jars/xbean-telnet-2.3.jar +org.apache.xbean/jars/xbean-telnet-2.4.jar +org.apache.xbean/jars/xbean-tiger-2.3.jar +org.apache.xbean/maven-plugins/maven-xbean-plugin-2.3.jar +org.apache.xbean/poms/xbean-2.3.pom +org.apache.xbean/poms/maven-metadata-mavenOneRepository.xml +org.apache.xbean/poms/maven-metadata.xml +org.apache.xbean/poms/maven-xbean-plugin-2.3.pom +org.apache.xbean/poms/xbean-classpath-2.3.pom +org.apache.xbean/poms/xbean-kernel-2.3.pom +org.apache.xbean/poms/xbean-osgi-2.3.pom +org.apache.xbean/poms/xbean-reflect-2.3.pom +org.apache.xbean/poms/xbean-server-2.3.pom +org.apache.xbean/poms/xbean-spring-2.3.pom +org.apache.xbean/poms/xbean-telnet-2.3.pom +org.apache.xbean/poms/xbean-tiger-2.3.pom +org.apache.xbean/KEYS +oro/jars/oro-2.0.6.jar +oro/jars/oro-2.0.7.jar +oro/jars/oro-2.0.8.jar +pluto-container/jars/pluto-0.46.jar +poi/jars/poi-1.8.0-dev-20020919.jar +poi/jars/poi-2.0-final-20040126.jar +poi/jars/poi-2.5-final-20040302.jar +poi/jars/poi-2.5.1-final-20040804.jar +poi/jars/poi-3.0-alpha2-sources.jar +poi/jars/poi-3.0-alpha3-sources.jar +poi/jars/poi-3.0-alpha2.jar +poi/jars/poi-contrib-2.0-final-20040126.jar +poi/jars/poi-contrib-2.5-final-20040302.jar +poi/jars/poi-contrib-2.5.1-final-20040804.jar +poi/jars/poi-scratchpad-2.0-final-20040126.jar +poi/jars/poi-3.0-alpha3.jar +poi/jars/poi-scratchpad-2.5-final-20040302.jar +poi/jars/poi-scratchpad-2.5.1-final-20040804.jar +poi/jars/poi-3.0-FINAL.jar +poi/jars/poi-3.0-FINAL-sources.jar +poi/poms/poi-1.8.0-dev-20020919.pom +poi/poms/poi-2.0-final-20040126.pom +poi/poms/poi-2.5-final-20040302.pom +poi/poms/poi-2.5.1-final-20040804.pom +poi/poms/poi-3.0-alpha2.pom +poi/poms/poi-3.0-alpha3.pom +poi/poms/poi-contrib-2.0-final-20040126.pom +poi/poms/poi-contrib-2.5-final-20040302.pom +poi/poms/poi-contrib-2.5.1-final-20040804.pom +poi/poms/poi-scratchpad-2.0-final-20040126.pom +poi/poms/poi-scratchpad-2.5-final-20040302.pom +poi/poms/poi-scratchpad-2.5.1-final-20040804.pom +poi/poms/poi-3.0-FINAL.pom +poi/poms/poi-3.0-FINAL.pom.bak +poi/poms/poi-3.0.1-FINAL.pom +poi/poms/poi-scratchpad-3.0.1-FINAL.pom +poi/poms/poi-contrib-3.0.1-FINAL.pom +pubscribe/jars/submgr-xbeans-1.0.jar +pubscribe/jars/pubscribe-1.0.jar +pubscribe/jars/pubscribe-1.1.jar +pubscribe/jars/submgr-xbeans-src-1.0.jar +pubscribe/jars/wse-xbeans-1.0.jar +pubscribe/jars/wse-xbeans-src-1.0.jar +pubscribe/jars/wsn-xbeans-1.0.jar +pubscribe/jars/wsn-xbeans-src-1.0.jar +sandesha/Sandesha-1.0-RC1.jar +servletapi/jars/servlet-api-2.4-20040521.jar +servletapi/jars/jsp-api-2.4-20040521.jar +slide/jars/catalinawrapper-2.1M1.jar +slide/jars/ant-webdav-2.1M1.jar +slide/jars/catalinawrapper-2.0.jar +slide/jars/jdk14logger-2.0.jar +slide/jars/jaas-2.1M1.jar +slide/jars/jdk14logger-2.1M1.jar +slide/jars/kernel-2.0.jar +slide/jars/kernel-2.1M1.jar +slide/jars/log4jlogger-2.0.jar +slide/jars/log4jlogger-2.1M1.jar +slide/jars/roles-2.0.jar +slide/jars/roles-2.1M1.jar +slide/jars/slide-kernel-2.1.jar +slide/jars/stores-2.1M1.jar +slide/jars/stores-2.0.jar +slide/jars/slide-stores-2.1.jar +slide/jars/slide-webdavlib-2.1.jar +slide/jars/slide-webdavservlet-2.1.jar +slide/jars/webdavlib-2.0beta1.jar +slide/jars/webdavlib-2.0.jar +slide/jars/webdavlib-2.1M1.jar +slide/jars/webdavlib-2.2-20050624.203112.jar +slide/jars/webdavservlet-2.0.jar +slide/jars/webdavservlet-2.1M1.jar +slide/jars/webdavservlet-2.2-20050624.203112.jar +stratum/distributions/stratum-1.0-src.tar.gz +stratum/distributions/stratum-1.0-src.zip +stratum/distributions/stratum-1.0.tar.gz +stratum/distributions/stratum-1.0.zip +stratum/jars/stratum-1.0-b5.jar +stratum/jars/stratum-1.0.jar +stratum/poms/stratum-1.0-b5.pom +stratum/poms/stratum-1.0.pom +struts/jars/struts-1.0.2.jar +struts/jars/struts-1.1-b2-20021124.jar +struts/jars/struts-1.1-b3.jar +struts/jars/struts-1.1-beta-2.jar +struts/jars/struts-1.1-rc2.jar +struts/jars/struts-1.1.jar +struts/jars/struts-1.2.2.jar +struts/jars/struts-1.2.4.jar +struts/jars/struts-1.2.7.jar +struts/jars/struts-1.2.8.jar +struts/jars/struts-1.2.9.jar +struts/jars/struts-el-1.1.jar +struts/jars/struts-el-1.2.4.jar +struts/jars/struts-el-1.2.7.jar +struts/jars/struts-el-1.2.8.jar +struts/jars/struts-el-1.2.9.jar +struts/jars/struts-legacy-1.1.jar +struts/jars/struts-scripting-1.0.1.jar +struts/poms/struts-1.2.4.pom +struts/poms/struts-1.2.7.pom +struts/poms/struts-1.2.8-el.pom +struts/poms/struts-1.2.8.pom +struts/poms/struts-1.2.9.pom +struts/poms/struts-el-1.2.6.pom +struts/poms/struts-scripting-1.0.1.pom +struts/poms/struts-el-1.2.9.pom +struts/tlds/struts-bean-1.1-rc1.tld +struts/tlds/struts-bean-1.1-rc2.tld +struts/tlds/struts-bean-1.2.2.tld +struts/tlds/struts-bean-1.2.4.tld +struts/tlds/struts-bean-1.2.7.tld +struts/tlds/struts-bean-1.2.8.tld +struts/tlds/struts-bean-el-1.2.2.tld +struts/tlds/struts-bean-el-1.2.4.tld +struts/tlds/struts-bean-el-1.2.7.tld +struts/tlds/struts-bean-el-1.2.8.tld +struts/tlds/struts-html-1.1-rc1.tld +struts/tlds/struts-html-1.1-rc2.tld +struts/tlds/struts-html-1.2.2.tld +struts/tlds/struts-html-1.2.4.tld +struts/tlds/struts-html-1.2.7.tld +struts/tlds/struts-html-1.2.8.tld +struts/tlds/struts-html-el-1.2.2.tld +struts/tlds/struts-html-el-1.2.4.tld +struts/tlds/struts-html-el-1.2.7.tld +struts/tlds/struts-html-el-1.2.8.tld +struts/tlds/struts-logic-1.1-rc1.tld +struts/tlds/struts-logic-1.1-rc2.tld +struts/tlds/struts-logic-1.2.2.tld +struts/tlds/struts-logic-1.2.4.tld +struts/tlds/struts-logic-1.2.7.tld +struts/tlds/struts-logic-1.2.8.tld +struts/tlds/struts-logic-el-1.2.2.tld +struts/tlds/struts-logic-el-1.2.4.tld +struts/tlds/struts-logic-el-1.2.7.tld +struts/tlds/struts-logic-el-1.2.8.tld +struts/tlds/struts-nested-1.1-rc1.tld +struts/tlds/struts-nested-1.1-rc2.tld +struts/tlds/struts-nested-1.2.2.tld +struts/tlds/struts-nested-1.2.4.tld +struts/tlds/struts-nested-1.2.7.tld +struts/tlds/struts-nested-1.2.8.tld +struts/tlds/struts-template-1.1-rc1.tld +struts/tlds/struts-tiles-1.1-rc1.tld +struts/tlds/struts-tiles-1.1-rc2.tld +struts/tlds/struts-tiles-1.2.2.tld +struts/tlds/struts-tiles-1.2.4.tld +struts/tlds/struts-tiles-1.2.7.tld +struts/tlds/struts-tiles-1.2.8.tld +struts/tlds/struts-tiles-el-1.2.2.tld +struts/tlds/struts-tiles-el-1.2.4.tld +struts/tlds/struts-tiles-el-1.2.7.tld +struts/tlds/struts-tiles-el-1.2.8.tld +taglibs/jars/application-1.0.1.jar +taglibs/jars/benchmark-1.0.jar +taglibs/jars/datetime-1.0.1.jar +taglibs/jars/dbtags-1.0.0.jar +taglibs/jars/log-1.0.jar +taglibs/jars/mailer-1.1.jar +taglibs/jars/page-1.0.1.jar +taglibs/jars/random-1.0.1.jar +taglibs/jars/random-1.0.2.jar +taglibs/jars/regexp-1.0.1.jar +taglibs/jars/request-1.0.1.jar +taglibs/jars/response-1.0.1.jar +taglibs/jars/session-1.0.1.jar +taglibs/jars/standard-1.0.1.jar +taglibs/jars/standard-1.0.2.jar +taglibs/jars/standard-1.0.3.jar +taglibs/jars/standard-1.0.4.jar +taglibs/jars/standard-1.0.5.jar +taglibs/jars/standard-1.0.6.jar +taglibs/jars/standard-1.0.jar +taglibs/jars/standard-1.1.0.jar +taglibs/jars/standard-1.1.1.jar +taglibs/jars/string-1.0.jar +taglibs/jars/standard-1.1.2.jar +taglibs/jars/string-1.0.1.jar +taglibs/jars/string-1.1.0.jar +taglibs/jars/xsl-1.0.1.jar +taglibs/tlds/permittedTaglibs-1.1.0.tld +taglibs/tlds/application-1.0.1.tld +taglibs/tlds/benchmark-1.0.tld +taglibs/tlds/c-1.0.1.tld +taglibs/tlds/c-1.0.2.tld +taglibs/tlds/c-1.0.3.tld +taglibs/tlds/c-1.0.4.tld +taglibs/tlds/c-1.0.5.tld +taglibs/tlds/c-1.0.6.tld +taglibs/tlds/c-1.0.tld +taglibs/tlds/c-1.1.0.tld +taglibs/tlds/c-1.1.1.tld +taglibs/tlds/c-1.1.2.tld +taglibs/tlds/c-rt-1.0.1.tld +taglibs/tlds/c-rt-1.0.2.tld +taglibs/tlds/c-rt-1.0.3.tld +taglibs/tlds/c-rt-1.0.4.tld +taglibs/tlds/c-rt-1.0.5.tld +taglibs/tlds/c-rt-1.0.6.tld +taglibs/tlds/c-rt-1.0.tld +taglibs/tlds/fmt-1.0.tld +taglibs/tlds/datetime-1.0.1.tld +taglibs/tlds/dbtags-1.0.0.tld +taglibs/tlds/fmt-1.0.1.tld +taglibs/tlds/fmt-1.0.2.tld +taglibs/tlds/fmt-1.0.3.tld +taglibs/tlds/fmt-1.0.4.tld +taglibs/tlds/fmt-1.0.5.tld +taglibs/tlds/fmt-1.0.6.tld +taglibs/tlds/fmt-1.1.0.tld +taglibs/tlds/fmt-1.1.1.tld +taglibs/tlds/fmt-1.1.2.tld +taglibs/tlds/fmt-rt-1.0.1.tld +taglibs/tlds/fmt-rt-1.0.2.tld +taglibs/tlds/fmt-rt-1.0.3.tld +taglibs/tlds/fmt-rt-1.0.4.tld +taglibs/tlds/fmt-rt-1.0.5.tld +taglibs/tlds/fmt-rt-1.0.6.tld +taglibs/tlds/fmt-rt-1.0.tld +taglibs/tlds/fn-1.1.0.tld +taglibs/tlds/fn-1.1.1.tld +taglibs/tlds/log-1.0.tld +taglibs/tlds/mailer-1.1.tld +taglibs/tlds/page-1.0.1.tld +taglibs/tlds/sql-rt-1.0.1.tld +taglibs/tlds/permittedTaglibs-1.1.1.tld +taglibs/tlds/random-1.0.1.tld +taglibs/tlds/random-1.0.2.tld +taglibs/tlds/regexp-1.0.1.tld +taglibs/tlds/request-1.0.1.tld +taglibs/tlds/response-1.0.1.tld +taglibs/tlds/scriptfree-1.1.0.tld +taglibs/tlds/scriptfree-1.1.1.tld +taglibs/tlds/session-1.0.1.tld +taglibs/tlds/sql-1.0.1.tld +taglibs/tlds/sql-1.0.2.tld +taglibs/tlds/sql-1.0.3.tld +taglibs/tlds/sql-1.0.4.tld +taglibs/tlds/sql-1.0.5.tld +taglibs/tlds/sql-1.0.6.tld +taglibs/tlds/sql-1.0.tld +taglibs/tlds/sql-1.1.0.tld +taglibs/tlds/sql-1.1.1.tld +taglibs/tlds/sql-1.1.2.tld +taglibs/tlds/sql-rt-1.0.2.tld +taglibs/tlds/sql-rt-1.0.3.tld +taglibs/tlds/sql-rt-1.0.4.tld +taglibs/tlds/sql-rt-1.0.5.tld +taglibs/tlds/sql-rt-1.0.6.tld +taglibs/tlds/sql-rt-1.0.tld +taglibs/tlds/string-1.0.1.tld +taglibs/tlds/string-1.0.tld +taglibs/tlds/string-1.1.0.tld +taglibs/tlds/x-1.0.1.tld +taglibs/tlds/x-1.0.2.tld +taglibs/tlds/x-1.0.3.tld +taglibs/tlds/x-1.0.4.tld +taglibs/tlds/x-1.0.5.tld +taglibs/tlds/x-1.0.6.tld +taglibs/tlds/x-1.0.tld +taglibs/tlds/x-1.1.0.tld +taglibs/tlds/x-1.1.1.tld +taglibs/tlds/x-1.1.2.tld +taglibs/tlds/x-rt-1.0.1.tld +taglibs/tlds/x-rt-1.0.2.tld +taglibs/tlds/x-rt-1.0.3.tld +taglibs/tlds/x-rt-1.0.4.tld +taglibs/tlds/x-rt-1.0.5.tld +taglibs/tlds/x-rt-1.0.6.tld +taglibs/tlds/x-rt-1.0.tld +taglibs/tlds/xsl-1.0.1.tld +taglibs/wars/application-examples-1.0.1.war +taglibs/wars/application-doc-1.0.1.war +taglibs/wars/benchmark-examples-1.0.war +taglibs/wars/benchmark-doc-1.0.war +taglibs/wars/datetime-examples-1.0.1.war +taglibs/wars/datetime-doc-1.0.1.war +taglibs/wars/dbtags-examples-1.0.0.war +taglibs/wars/dbtags-doc-1.0.0.war +taglibs/wars/log-examples-1.0.war +taglibs/wars/log-doc-1.0.war +taglibs/wars/mailer-examples-1.1.war +taglibs/wars/mailer-doc-1.1.war +taglibs/wars/page-doc-1.0.1.war +taglibs/wars/page-examples-1.0.1.war +taglibs/wars/random-doc-1.0.1.war +taglibs/wars/random-doc-1.0.2.war +taglibs/wars/random-examples-1.0.1.war +taglibs/wars/random-examples-1.0.2.war +taglibs/wars/regexp-doc-1.0.1.war +taglibs/wars/regexp-examples-1.0.1.war +taglibs/wars/request-doc-1.0.1.war +taglibs/wars/request-examples-1.0.1.war +taglibs/wars/response-doc-1.0.1.war +taglibs/wars/response-examples-1.0.1.war +taglibs/wars/session-doc-1.0.1.war +taglibs/wars/session-examples-1.0.1.war +taglibs/wars/standard-doc-1.0.1.war +taglibs/wars/standard-doc-1.0.3.war +taglibs/wars/standard-doc-1.0.4.war +taglibs/wars/standard-doc-1.0.5.war +taglibs/wars/standard-doc-1.0.6.war +taglibs/wars/standard-doc-1.0.war +taglibs/wars/standard-doc-1.1.0.war +taglibs/wars/standard-doc-1.1.1.war +taglibs/wars/standard-doc-1.1.2.war +taglibs/wars/standard-examples-1.0.1.war +taglibs/wars/standard-examples-1.0.3.war +taglibs/wars/standard-examples-1.0.4.war +taglibs/wars/standard-examples-1.0.5.war +taglibs/wars/standard-examples-1.0.6.war +taglibs/wars/standard-examples-1.0.war +taglibs/wars/standard-examples-1.1.0.war +taglibs/wars/standard-examples-1.1.1.war +taglibs/wars/standard-examples-1.1.2.war +taglibs/wars/string-doc-1.0.1.war +taglibs/wars/string-doc-1.0.war +taglibs/wars/string-doc-1.1.0.war +taglibs/wars/string-examples-1.0.1.war +taglibs/wars/string-examples-1.0.war +taglibs/wars/string-examples-1.1.0.war +taglibs/wars/xsl-doc-1.0.1.war +taglibs/wars/xsl-examples-1.0.1.war +tapestry/jars/net.sf.tapestry-2.2.jar +tapestry/jars/net.sf.tapestry.contrib-2.2.jar +tapestry/jars/tapestry-3.0-beta-1a.jar +tapestry/jars/tapestry-3.0-beta-2.jar +tapestry/jars/tapestry-3.0.1.jar +tapestry/jars/tapestry-3.0.2.jar +tapestry/jars/tapestry-3.0.3.jar +tapestry/jars/tapestry-3.0.jar +tapestry/jars/tapestry-3.1-alpha-1.jar +tapestry/jars/tapestry-4.0-alpha-2.jar +tapestry/jars/tapestry-4.0-alpha-3.jar +tapestry/jars/tapestry-4.0-alpha-4-snapshot.jar +tapestry/jars/tapestry-4.0-beta-1.jar +tapestry/jars/tapestry-4.0-beta-5.jar +tapestry/jars/tapestry-4.0-beta-10.jar +tapestry/jars/tapestry-4.0-beta-11.jar +tapestry/jars/tapestry-4.0-beta-12.jar +tapestry/jars/tapestry-4.0-beta-13.jar +tapestry/jars/tapestry-4.0-beta-2.jar +tapestry/jars/tapestry-4.0-beta-3.jar +tapestry/jars/tapestry-4.0-beta-4.jar +tapestry/jars/tapestry-4.0-beta-6.jar +tapestry/jars/tapestry-4.0-beta-7.jar +tapestry/jars/tapestry-4.0-beta-8.jar +tapestry/jars/tapestry-4.0-beta-9.jar +tapestry/jars/tapestry-4.0-rc-1.jar +tapestry/jars/tapestry-4.0.1.jar +tapestry/jars/tapestry-4.0-rc-2.jar +tapestry/jars/tapestry-annotations-4.0.1.jar +tapestry/jars/tapestry-4.0-rc-3.jar +tapestry/jars/tapestry-4.0.2.jar +tapestry/jars/tapestry-4.0.jar +tapestry/jars/tapestry-annotations-4.0-alpha-4-snapshot.jar +tapestry/jars/tapestry-annotations-4.0-beta-1.jar +tapestry/jars/tapestry-annotations-4.0-beta-7.jar +tapestry/jars/tapestry-annotations-4.0-beta-10.jar +tapestry/jars/tapestry-annotations-4.0-beta-11.jar +tapestry/jars/tapestry-annotations-4.0-beta-12.jar +tapestry/jars/tapestry-annotations-4.0-beta-13.jar +tapestry/jars/tapestry-annotations-4.0-beta-2.jar +tapestry/jars/tapestry-annotations-4.0-beta-3.jar +tapestry/jars/tapestry-annotations-4.0-beta-4.jar +tapestry/jars/tapestry-annotations-4.0-beta-5.jar +tapestry/jars/tapestry-annotations-4.0-beta-6.jar +tapestry/jars/tapestry-annotations-4.0-beta-8.jar +tapestry/jars/tapestry-annotations-4.0-beta-9.jar +tapestry/jars/tapestry-annotations-4.0-rc-1.jar +tapestry/jars/tapestry-annotations-4.0-rc-2.jar +tapestry/jars/tapestry-annotations-4.0-rc-3.jar +tapestry/jars/tapestry-annotations-4.0.2.jar +tapestry/jars/tapestry-annotations-4.0.jar +tapestry/jars/tapestry-contrib-3.0-beta-2.jar +tapestry/jars/tapestry-contrib-3.0.1.jar +tapestry/jars/tapestry-contrib-3.0.2.jar +tapestry/jars/tapestry-contrib-3.0.3.jar +tapestry/jars/tapestry-contrib-3.0.jar +tapestry/jars/tapestry-contrib-3.1-alpha-1.jar +tapestry/jars/tapestry-contrib-4.0-alpha-2.jar +tapestry/jars/tapestry-contrib-4.0-alpha-4-snapshot.jar +tapestry/jars/tapestry-contrib-4.0-alpha-3.jar +tapestry/jars/tapestry-contrib-4.0-beta-1.jar +tapestry/jars/tapestry-contrib-4.0-beta-10.jar +tapestry/jars/tapestry-contrib-4.0-beta-11.jar +tapestry/jars/tapestry-contrib-4.0-beta-12.jar +tapestry/jars/tapestry-contrib-4.0-beta-13.jar +tapestry/jars/tapestry-contrib-4.0-beta-2.jar +tapestry/jars/tapestry-contrib-4.0-beta-3.jar +tapestry/jars/tapestry-contrib-4.0-beta-4.jar +tapestry/jars/tapestry-contrib-4.0-beta-5.jar +tapestry/jars/tapestry-contrib-4.0-rc-2.jar +tapestry/jars/tapestry-contrib-4.0-beta-6.jar +tapestry/jars/tapestry-contrib-4.0-beta-7.jar +tapestry/jars/tapestry-contrib-4.0-beta-8.jar +tapestry/jars/tapestry-contrib-4.0-beta-9.jar +tapestry/jars/tapestry-contrib-4.0-rc-1.jar +tapestry/jars/tapestry-contrib-4.0-rc-3.jar +tapestry/jars/tapestry-contrib-4.0.1.jar +tapestry/jars/tapestry-contrib-4.0.2.jar +tapestry/jars/tapestry-contrib-4.0.jar +tapestry/jars/tapestry-portlet-4.0.1.jar +tapestry/jars/tapestry-portlet-4.0-alpha-2.jar +tapestry/jars/tapestry-portlet-4.0-alpha-3.jar +tapestry/jars/tapestry-portlet-4.0-alpha-4-snapshot.jar +tapestry/jars/tapestry-portlet-4.0-beta-1.jar +tapestry/jars/tapestry-portlet-4.0-beta-10.jar +tapestry/jars/tapestry-portlet-4.0-beta-11.jar +tapestry/jars/tapestry-portlet-4.0-beta-12.jar +tapestry/jars/tapestry-portlet-4.0-beta-13.jar +tapestry/jars/tapestry-portlet-4.0-beta-2.jar +tapestry/jars/tapestry-portlet-4.0-beta-3.jar +tapestry/jars/tapestry-portlet-4.0-beta-4.jar +tapestry/jars/tapestry-portlet-4.0-beta-5.jar +tapestry/jars/tapestry-portlet-4.0-beta-6.jar +tapestry/jars/tapestry-portlet-4.0-beta-7.jar +tapestry/jars/tapestry-portlet-4.0-beta-8.jar +tapestry/jars/tapestry-portlet-4.0-beta-9.jar +tapestry/jars/tapestry-portlet-4.0-rc-1.jar +tapestry/jars/tapestry-portlet-4.0-rc-2.jar +tapestry/jars/tapestry-portlet-4.0-rc-3.jar +tapestry/jars/tapestry-portlet-4.0.2.jar +tapestry/jars/tapestry-portlet-4.0.jar +tapestry/jars/vlibbeans-4.0-beta-4.jar +tapestry/jars/vlibbeans-4.0-beta-5.jar +tapestry/poms/tapestry-4.0-beta-8.pom +tapestry/poms/tapestry-4.0.1.pom +tapestry/poms/tapestry-annotations-4.0.1.pom +tapestry/poms/tapestry-4.0.2.pom +tapestry/poms/tapestry-annotations-4.0.2.pom +tapestry/poms/tapestry-contrib-4.0.1.pom +tapestry/poms/tapestry-contrib-4.0.2.pom +tapestry/poms/tapestry-portlet-4.0.1.pom +tapestry/poms/tapestry-portlet-4.0.2.pom +tapestry/tlds/tapestry-3.0.1.tld +tomcat/jars/bootstrap-4.0.6.jar +tomcat/jars/bootstrap-5.0.28.jar +tomcat/jars/bootstrap-5.5.12.jar +tomcat/jars/catalina-5.5.15.jar +tomcat/jars/catalina-4.0.4.jar +tomcat/jars/catalina-4.0.6.jar +tomcat/jars/catalina-5.0.28.jar +tomcat/jars/catalina-5.5.12.jar +tomcat/jars/catalina-admin-5.0.28.jar +tomcat/jars/catalina-ant-5.0.28.jar +tomcat/jars/catalina-ant-5.5.12.jar +tomcat/jars/catalina-ant-5.5.15.jar +tomcat/jars/catalina-ant-jmx-5.5.12.jar +tomcat/jars/catalina-balancer-5.0.28.jar +tomcat/jars/catalina-balancer-5.5.12.jar +tomcat/jars/catalina-cluster-5.0.28.jar +tomcat/jars/catalina-cluster-5.5.12.jar +tomcat/jars/catalina-cluster-5.5.15.jar +tomcat/jars/catalina-host-manager-5.5.12.jar +tomcat/jars/warp-4.0.6.jar +tomcat/jars/catalina-i18n-es-5.0.28.jar +tomcat/jars/catalina-i18n-fr-5.0.28.jar +tomcat/jars/catalina-i18n-ja-5.0.28.jar +tomcat/jars/catalina-manager-5.0.28.jar +tomcat/jars/catalina-manager-5.5.12.jar +tomcat/jars/catalina-optional-5.0.28.jar +tomcat/jars/catalina-optional-5.5.12.jar +tomcat/jars/catalina-optional-5.5.15.jar +tomcat/jars/catalina-root-5.0.28.jar +tomcat/jars/catalina-root-5.5.12.jar +tomcat/jars/catalina-storeconfig-5.5.12.jar +tomcat/jars/catalina-storeconfig-5.5.15.jar +tomcat/jars/commons-logging-4.0.6.jar +tomcat/jars/container_util-3.3.2.jar +tomcat/jars/core_util-3.3.2.jar +tomcat/jars/etomcat-3.3.2.jar +tomcat/jars/jasper-compiler-4.0.4.jar +tomcat/jars/facade22-3.3.2.jar +tomcat/jars/jasper-3.2.4.jar +tomcat/jars/jasper-3.3.2.jar +tomcat/jars/jasper-compiler-4.0.6.jar +tomcat/jars/jasper-compiler-5.0.28.jar +tomcat/jars/jasper-compiler-5.5.12.jar +tomcat/jars/jasper-compiler-5.5.15.jar +tomcat/jars/jasper-compiler-jdt-5.5.12.jar +tomcat/jars/jasper-compiler-jdt-5.5.15.jar +tomcat/jars/jasper-runtime-3.3.2.jar +tomcat/jars/jasper-runtime-4.0.4.jar +tomcat/jars/jasper-runtime-5.5.15.jar +tomcat/jars/jkconfig-5.0.28.jar +tomcat/jars/jasper-runtime-4.0.6.jar +tomcat/jars/jasper-runtime-5.0.28.jar +tomcat/jars/jasper-runtime-5.5.12.jar +tomcat/jars/jkshm-5.0.28.jar +tomcat/jars/jsp-api-5.5.12.jar +tomcat/jars/jsp-api-5.5.15.jar +tomcat/jars/naming-common-4.0.6.jar +tomcat/jars/naming-common-5.0.28.jar +tomcat/jars/naming-factory-4.0.6.jar +tomcat/jars/naming-factory-5.0.28.jar +tomcat/jars/naming-factory-5.5.12.jar +tomcat/jars/naming-factory-5.5.15.jar +tomcat/jars/naming-factory-dbcp-5.5.12.jar +tomcat/jars/naming-factory-dbcp-5.5.15.jar +tomcat/jars/naming-java-5.0.28.jar +tomcat/jars/naming-resources-4.0.6.jar +tomcat/jars/servlet-4.0.6.jar +tomcat/jars/naming-resources-5.0.28.jar +tomcat/jars/naming-resources-5.5.12.jar +tomcat/jars/naming-resources-5.5.15.jar +tomcat/jars/servlet-api-5.5.12.jar +tomcat/jars/servlet-api-5.5.15.jar +tomcat/jars/servlets-common-4.0.6.jar +tomcat/jars/servlets-common-5.0.28.jar +tomcat/jars/servlets-default-4.0.6.jar +tomcat/jars/servlets-default-5.0.28.jar +tomcat/jars/servlets-default-5.5.12.jar +tomcat/jars/servlets-default-5.5.15.jar +tomcat/jars/servlets-invoker-4.0.6.jar +tomcat/jars/servlets-invoker-5.0.28.jar +tomcat/jars/servlets-invoker-5.5.12.jar +tomcat/jars/servlets-invoker-5.5.15.jar +tomcat/jars/servlets-manager-4.0.6.jar +tomcat/jars/servlets-webdav-4.0.6.jar +tomcat/jars/servlets-webdav-5.0.28.jar +tomcat/jars/servlets-webdav-5.5.12.jar +tomcat/jars/servlets-webdav-5.5.15.jar +tomcat/jars/stop-tomcat-3.3.2.jar +tomcat/jars/tomcat-3.2.3.jar +tomcat/jars/tomcat-3.3.2.jar +tomcat/jars/tomcat-ajp-4.0.6.jar +tomcat/jars/tomcat-ajp-5.5.12.jar +tomcat/jars/tomcat-ajp-5.5.15.jar +tomcat/jars/tomcat-ant-3.3.2.jar +tomcat/jars/tomcat-apr-5.5.12.jar +tomcat/jars/tomcat-apr-5.5.15.jar +tomcat/jars/tomcat-coyote-3.3.2.jar +tomcat/jars/tomcat-coyote-4.0.4.jar +tomcat/jars/tomcat-coyote-4.0.6.jar +tomcat/jars/tomcat-coyote-5.0.28.jar +tomcat/jars/tomcat-coyote-5.5.12.jar +tomcat/jars/tomcat-coyote-5.5.15.jar +tomcat/jars/tomcat-http-5.5.12.jar +tomcat/jars/tomcat-http-5.5.15.jar +tomcat/jars/tomcat-http11-3.3.2.jar +tomcat/jars/tomcat-http11-4.0.6.jar +tomcat/jars/tomcat-http11-5.0.28.jar +tomcat/jars/tomcat-i18n-en-5.5.12.jar +tomcat/jars/tomcat-i18n-es-5.5.12.jar +tomcat/jars/tomcat-i18n-fr-5.5.12.jar +tomcat/jars/tomcat-i18n-ja-5.5.12.jar +tomcat/jars/tomcat-jk-5.0.28.jar +tomcat/jars/tomcat-jk2-3.3.2.jar +tomcat/jars/tomcat-jk2-5.0.28.jar +tomcat/jars/tomcat-jni-5.0.28.jar +tomcat/jars/tomcat-juli-5.5.12.jar +tomcat/jars/tomcat-naming-1.0.jar +tomcat/jars/tomcat-util-3.3.2.jar +tomcat/jars/tomcat-util-4.0.6.jar +tomcat/jars/tomcat-util-5.0.28.jar +tomcat/jars/tomcat-util-5.5.12.jar +tomcat/jars/tomcat-util-5.5.15.jar +tomcat/jars/tomcat33-coyote-3.3.2.jar +tomcat/jars/tomcat33-resource-3.3.2.jar +tomcat/jars/bootstrap-4.1.36.jar +tomcat/jars/tomcat_core-3.3.2.jar +tomcat/jars/tomcat_modules-3.3.2.jar +tomcat/jars/webserver-3.2.4.jar +tomcat/jars/catalina-4.1.36.jar +tomcat/jars/catalina-ant-4.1.36.jar +tomcat/jars/jasper-compiler-4.1.36.jar +tomcat/jars/jasper-runtime-4.1.36.jar +tomcat/jars/naming-common-4.1.36.jar +tomcat/jars/naming-factory-4.1.36.jar +tomcat/jars/naming-resources-4.1.36.jar +tomcat/jars/servlet-4.1.36.jar +tomcat/jars/servlets-cgi-4.1.36.jar +tomcat/jars/servlets-common-4.1.36.jar +tomcat/jars/servlets-default-4.1.36.jar +tomcat/jars/servlets-invoker-4.1.36.jar +tomcat/jars/servlets-manager-4.1.36.jar +tomcat/jars/servlets-ssi-4.1.36.jar +tomcat/jars/servlets-webdav-4.1.36.jar +tomcat/jars/tomcat4-coyote-4.1.36.jar +tomcat/jars/tomcat-coyote-4.1.36.jar +tomcat/jars/tomcat-http11-4.1.36.jar +tomcat/jars/tomcat-jk2-4.1.36.jar +tomcat/jars/tomcat-jk-4.1.36.jar +tomcat/jars/tomcat-jni-4.1.36.jar +tomcat/jars/tomcat-util-4.1.36.jar +tomcat/poms/catalina-5.5.15.pom +tomcat/poms/catalina-ant-5.5.15.pom +tomcat/poms/catalina-cluster-5.5.15.pom +tomcat/poms/catalina-optional-5.5.15.pom +tomcat/poms/catalina-storeconfig-5.5.15.pom +tomcat/poms/jasper-compiler-5.5.15.pom +tomcat/poms/jasper-compiler-jdt-5.5.15.pom +tomcat/poms/jasper-runtime-5.5.15.pom +tomcat/poms/jsp-api-5.5.15.pom +tomcat/poms/naming-factory-5.5.15.pom +tomcat/poms/naming-factory-dbcp-5.5.15.pom +tomcat/poms/naming-resources-5.5.15.pom +tomcat/poms/servlet-api-5.5.15.pom +tomcat/poms/servlets-default-5.5.15.pom +tomcat/poms/servlets-invoker-5.5.15.pom +tomcat/poms/servlets-webdav-5.5.15.pom +tomcat/poms/tomcat-ajp-5.5.15.pom +tomcat/poms/tomcat-apr-5.5.15.pom +tomcat/poms/tomcat-coyote-5.5.15.pom +tomcat/poms/tomcat-http-5.5.15.pom +tomcat/poms/tomcat-parent-5.5.15.pom +tomcat/poms/tomcat-util-5.5.15.pom +tomcat/zips/apache-tomcat-5.5.23.zip +tomcat-util/jars/tomcat-util-dev.20021002.102355.jar +torque/jars/maven-torque-plugin-3.2-rc1.jar +torque/jars/torque-20030218.172852.jar +torque/jars/torque-20030310.174947.jar +torque/jars/torque-20030327.065722.jar +torque/jars/torque-3.0-b4.jar +torque/jars/torque-3.0-b3-dev.20020711.025538.jar +torque/jars/torque-3.0-b4-dev.20020724.014157.jar +torque/jars/torque-3.0-b4-dev.20020814.103755.jar +torque/jars/torque-3.0-rc1.jar +torque/jars/torque-3.0.1.jar +torque/jars/torque-3.0.2.jar +torque/jars/torque-3.1.1.jar +torque/jars/torque-3.0.jar +torque/jars/torque-3.1-alpha1.jar +torque/jars/torque-3.1-alpha2.jar +torque/jars/torque-3.1-beta1.jar +torque/jars/torque-3.1-dev.jar +torque/jars/torque-3.1-rc.jar +torque/jars/torque-3.1.1-rc1.jar +torque/jars/torque-3.1.1-rc2.jar +torque/jars/torque-3.1.1-rc3.jar +torque/jars/torque-3.1.jar +torque/jars/torque-3.2-rc1.jar +torque/jars/torque-gen-3.1-alpha1.jar +torque/jars/torque-3.2-rc2.jar +torque/jars/torque-3.2-rc3.jar +torque/jars/torque-3.2.jar +torque/jars/torque-gen-20030215.100807.jar +torque/jars/torque-gen-20030310.175447.jar +torque/jars/torque-gen-20030327.070220.jar +torque/jars/torque-gen-3.1-alpha2.jar +torque/jars/torque-gen-3.1-beta1.jar +torque/jars/torque-gen-3.1-dev.jar +torque/jars/torque-gen-3.1-rc.jar +torque/jars/torque-gen-3.1.1-rc1.jar +torque/jars/torque-gen-3.1.1-rc2.jar +torque/jars/torque-gen-3.1.1-rc3.jar +torque/jars/torque-gen-3.1.1.jar +torque/jars/torque-gen-3.1.jar +torque/jars/torque-gen-3.2-rc1.jar +torque/jars/torque-gen-3.2.jar +torque/jars/torque-gen-3.2-rc2.jar +torque/jars/torque-gen-3.2-rc3.jar +torque/jars/torque-gen-snapshot-version +torque/jars/torque-gen-templates-3.2-rc1.jar +torque/jars/torque-gen-templates-3.2-rc2.jar +torque/jars/torque-gen-templates-3.2-rc3.jar +torque/jars/torque-gen-templates-3.2.jar +torque/jars/torque-3.3-RC1.jar +torque/jars/torque-snapshot-version +torque/jars/torque-gen-templates-3.3-RC1.jar +torque/jars/torque-gen-3.3-RC1.jar +torque/jars/torque-3.3-RC2.jar +torque/jars/torque-gen-templates-3.3-RC2.jar +torque/jars/torque-gen-3.3-RC2.jar +torque/plugins/maven-torque-plugin-3.1.1-dev.jar +torque/plugins/maven-torque-plugin-3.1.1-rc1.jar +torque/plugins/maven-torque-plugin-3.1.1-rc2.jar +torque/plugins/maven-torque-plugin-3.1.1-rc3.jar +torque/plugins/maven-torque-plugin-3.1.1.jar +torque/plugins/maven-torque-plugin-3.2-rc1.jar +torque/plugins/maven-torque-plugin-3.2-rc2.jar +torque/plugins/maven-torque-plugin-3.2-rc3.jar +torque/plugins/maven-torque-plugin-3.2.jar +torque/plugins/maven-torque-plugin-3.3-RC1.jar +torque/plugins/maven-torque-plugin-3.3-RC2.jar +torque/poms/maven-torque-plugin-3.1.1-dev.pom +torque/poms/maven-torque-plugin-3.1.1-rc1.pom +torque/poms/maven-torque-plugin-3.1.1-rc2.pom +torque/poms/maven-torque-plugin-3.1.1-rc3.pom +torque/poms/maven-torque-plugin-3.2-rc1.pom +torque/poms/maven-torque-plugin-3.2-rc2.pom +torque/poms/maven-torque-plugin-3.2-rc3.pom +torque/poms/maven-torque-plugin-3.2.pom +torque/poms/torque-3.1.1-rc1.pom +torque/poms/torque-3.1.1-rc2.pom +torque/poms/torque-3.1.1-rc3.pom +torque/poms/torque-3.2-rc1.pom +torque/poms/torque-3.2-rc2.pom +torque/poms/torque-gen-templates-3.2-rc1.pom +torque/poms/torque-3.2-rc3.pom +torque/poms/torque-3.2.pom +torque/poms/torque-gen-3.1.1-rc1.pom +torque/poms/torque-gen-3.1.1-rc2.pom +torque/poms/torque-gen-3.1.1-rc3.pom +torque/poms/torque-gen-3.2-rc1.pom +torque/poms/torque-gen-3.2-rc2.pom +torque/poms/torque-gen-3.2-rc3.pom +torque/poms/torque-gen-3.2.pom +torque/poms/torque-3.3-RC1.pom +torque/poms/torque-gen-templates-3.2-rc2.pom +torque/poms/maven-torque-plugin-3.3-RC1.pom +torque/poms/torque-gen-templates-3.2-rc3.pom +torque/poms/torque-gen-templates-3.2.pom +torque/poms/torque-gen-templates-3.3-RC1.pom +torque/poms/torque-gen-3.3-RC1.pom +torque/poms/torque-3.3-RC2.pom +torque/poms/torque-gen-templates-3.3-RC2.pom +torque/poms/torque-gen-3.3-RC2.pom +torque/poms/maven-torque-plugin-3.3-RC2.pom +turbine/distributions/maven-turbine-plugin-1.3-src.tar.gz +turbine/distributions/maven-turbine-plugin-1.3-src.zip +turbine/distributions/maven-turbine-plugin-1.3.tar.gz +turbine/distributions/maven-turbine-plugin-1.3.zip +turbine/distributions/turbine-2.3.2-src.tar.gz +turbine/distributions/turbine-2.3.2-src.zip +turbine/distributions/turbine-2.3.2.tar.gz +turbine/distributions/turbine-2.3.2.zip +turbine/jars/turbine-2.1.jar +turbine/jars/turbine-2.2-b1.jar +turbine/jars/turbine-2.2-b2-dev.jar +turbine/jars/turbine-2.2-rc1.jar +turbine/jars/turbine-2.2.jar +turbine/jars/turbine-2.2b1.jar +turbine/jars/turbine-2.3-rc1.jar +turbine/jars/turbine-2.3.1-rc1.jar +turbine/jars/turbine-2.3.1-rc2.jar +turbine/jars/turbine-2.3.1.jar +turbine/jars/turbine-2.3.2.jar +turbine/jars/turbine-2.3.jar +turbine/jars/turbine-2.4-M1.jar +turbine/jars/turbine-3.0-alpha-1.20020912.045138.jar +turbine/jars/turbine-3.0-dev.jar +turbine/plugins/maven-turbine-plugin-20040825.211642.jar +turbine/plugins/maven-turbine-plugin-1.2-rc1.jar +turbine/plugins/maven-turbine-plugin-1.2.jar +turbine/plugins/maven-turbine-plugin-1.3.jar +turbine/plugins/maven-turbine-plugin-20040825.214656.jar +turbine/plugins/maven-turbine-plugin-snapshot-version +turbine/poms/maven-turbine-plugin-20040825.211642.pom +turbine/poms/maven-turbine-plugin-1.2-rc1.pom +turbine/poms/maven-turbine-plugin-1.3.pom +turbine/poms/maven-turbine-plugin-20040825.214656.pom +turbine/poms/maven-turbine-plugin-snapshot-version +turbine/poms/turbine-2.3.1-rc1.pom +turbine/poms/turbine-2.3.1-rc2.pom +turbine/poms/turbine-2.3.2.pom +velocity/jars/velocity-1.3-dev.jar +velocity/jars/velocity-1.3.1.jar +velocity/jars/velocity-1.3.jar +velocity/jars/velocity-1.4-dev.jar +velocity/jars/velocity-1.4-rc1.jar +velocity/jars/velocity-1.4.jar +velocity/jars/velocity-dep-1.5-beta2.jar +velocity/jars/velocity-1.5.jar +velocity/jars/velocity-dep-1.3.1.jar +velocity/jars/velocity-dep-1.4-rc1.jar +velocity/jars/velocity-dep-1.4.jar +velocity/jars/velocity-1.5-beta2.jar +velocity/jars/anakia-1.0.jar +velocity/jars/texen-1.0.jar +velocity/poms/velocity-1.5.pom.bak +velocity/poms/velocity-1.5.pom.carlos +velocity/poms/velocity-1.5.pom.md5.bak +velocity-dvsl/jars/velocity-dvsl-0.31.jar +velocity-dvsl/jars/velocity-dvsl-0.40.jar +velocity-dvsl/jars/velocity-dvsl-0.43.20020711.010949.jar +velocity-dvsl/jars/velocity-dvsl-0.43.20020716.041424.jar +velocity-dvsl/jars/velocity-dvsl-0.43.jar +velocity-dvsl/jars/velocity-dvsl-0.43.20020719.020022.jar +velocity-dvsl/jars/velocity-dvsl-0.45.jar +velocity-dvsl/jars/velocity-dvsl-0.44.20020719.122919.jar +velocity-dvsl/jars/velocity-dvsl-0.44.20020720.011619.jar +velocity-dvsl/jars/velocity-dvsl-0.44.20020720.082908.jar +velocity-tools/jars/velocity-tools-1.0.jar +velocity-tools/jars/velocity-tools-1.1.jar +velocity-tools/jars/velocity-tools-1.2.jar +velocity-tools/jars/velocity-tools-generic-1.0.jar +velocity-tools/jars/velocity-tools-generic-1.1.jar +velocity-tools/jars/velocity-tools-generic-1.2.jar +velocity-tools/jars/velocity-tools-view-1.0.jar +velocity-tools/jars/velocity-tools-view-1.1.jar +velocity-tools/jars/velocity-tools-view-1.2.jar +velocity-tools/jars/velocity-tools-1.3.jar +velocity-tools/jars/velocity-tools-generic-1.3.jar +velocity-tools/jars/velocity-tools-view-1.3.jar +ws-commons/jars/KEYS +ws-commons/jars/axiom-api-0.95.jar +ws-commons/jars/tcpmon-1.0.jar +ws-commons/jars/sign.sh +ws-commons/jars/axiom-api-1.0.jar +ws-commons/jars/axiom-dom-1.0.jar +ws-commons/jars/axiom-impl-0.95.jar +ws-commons/jars/axiom-impl-1.0.jar +ws-commons/jars/neethi-1.0.1.jar +ws-commons/jars/policy-1.0.jar +ws-commons/poms/axiom-1.0.pom +ws-commons/poms/axiom-api-1.0.pom +ws-commons/poms/axiom-impl-1.0.pom +ws-commons/poms/neethi-1.0.1.pom +ws-commons-java5/jars/ws-commons-java5-1.0-sources.jar +ws-commons-java5/jars/ws-commons-java5-1.0.1-sources.jar +ws-commons-java5/jars/ws-commons-java5-1.0.1.jar +ws-commons-java5/jars/ws-commons-java5-1.0.jar +ws-commons-java5/poms/ws-commons-java5-1.0.1.pom +ws-commons-java5/poms/ws-commons-java5-1.0.pom +ws-commons-util/jars/ws-commons-util-1.0-sources.jar +ws-commons-util/jars/ws-commons-util-1.0.1-sources.jar +ws-commons-util/jars/ws-commons-util-1.0.1.jar +ws-commons-util/jars/ws-commons-util-1.0.jar +ws-commons-util/poms/ws-commons-util-1.0.1.pom +ws-commons-util/poms/ws-commons-util-1.0.pom +ws-scout/jars/scout-0.5.jar +ws-scout/jars/scout-0.7rc1.jar +ws-scout/jars/scout-0.7rc2.pom +ws-scout/jars/scout-0.7rc2.jar +ws-scout/jars/scout-0.7rc2-sources.jar +ws-scout/KEYS +wsdl4j/jars/wsdl4j-1.0.jar +wsrf/jars/j2ee-xbeans-src-1.0.jar +wsrf/jars/j2ee-xbeans-1.0.jar +wsrf/jars/wsa-xbeans-src-1.0.jar +wsrf/jars/wsa-xbeans-1.0.jar +wsrf/jars/wsrf-xbeans-1.0.jar +wsrf/jars/wsrf-1.0.jar +wsrf/jars/wsrf-1.1.jar +wsrf/jars/wsrf-jndi-config-src-1.0.jar +wsrf/jars/wsrf-jndi-config-1.0.jar +wsrf/jars/wsrf-xbeans-src-1.0.jar +wss4j/jars/wss4j-1.5.0.jar +wss4j/jars/wss4j-1.5.1.jar +xalan/jars/xalan-2.1.0.jar +xalan/jars/xalan-2.3.1.jar +xalan/jars/xalan-2.4.0.jar +xalan/jars/xalan-2.4.1.jar +xalan/jars/xalan-2.5.0.jar +xalan/jars/xalan-2.5.1.jar +xalan/jars/xalan-2.6.0.jar +xalan/jars/xalan-2.7.0.jar +xalan/jars/xalansamples-2.4.1.jar +xalan/jars/xalansamples-2.5.1.jar +xalan/jars/xalansamples-2.6.0.jar +xalan/jars/xalanservlet-2.4.1.jar +xalan/wars/xalanservlet-2.5.1.war +xerces/jars/xerces-1.2.3.jar +xerces/jars/xerces-1.4.0.jar +xerces/jars/xerces-1.4.4.jar +xerces/jars/xerces-2.0.0.jar +xerces/jars/xerces-2.0.1.jar +xerces/jars/xerces-2.0.2.jar +xerces/jars/xerces-2.2.1.jar +xerces/jars/xerces-2.3.0.jar +xerces/jars/xerces-2.4.0.jar +xerces/jars/xercesImpl-2.0.0.jar +xerces/jars/xercesImpl-2.5.0.jar +xerces/jars/xercesImpl-2.6.0.jar +xerces/jars/xercesImpl-2.6.2.jar +xerces/jars/xercesImpl-2.7.1.jar +xerces/jars/xercesImpl-2.8.0.jar +xerces/jars/xercesImpl-2.8.0.jar.sig +xerces/jars/xercesSamples-2.5.0.jar +xerces/jars/xercesSamples-2.6.0.jar +xerces/jars/xercesSamples-2.6.2.jar +xerces/jars/xercesSamples-2.8.0.jar +xerces/jars/xercesSamples-2.8.0.jar.sig +xerces/jars/xmlParserAPIs-2.0.0.jar +xerces/jars/xmlParserAPIs-2.0.2.jar +xerces/jars/xmlParserAPIs-2.2.1.jar +xerces/jars/xmlParserAPIs-2.6.0.jar +xerces/jars/xmlParserAPIs-2.6.2.jar +xerces/java-sources/xercesImpl-2.8.0-sources.jar +xerces/poms/xercesImpl-2.8.0.pom +xercesjarv/jars/xercesjarv-20020712-DG.jar +xercesjarv/jars/xercesjarv-20020712.jar +xml-apis/jars/xml-apis-1.0.b2.jar +xml-apis/jars/.htaccess +xml-apis/jars/README.html +xml-apis/jars/xml-apis-1.0.b2.james +xml-apis/jars/xml-apis-1.3.02.jar +xml-apis/jars/xml-apis-1.3.03.jar +xml-apis/jars/xml-apis-1.3.03.jar.sig +xml-apis/poms/xml-apis-1.3.02.pom +xml-apis/poms/xml-apis-1.3.03.pom +xml-resolver/jars/xml-resolver-1.1.jar +xml-security/jars/xml-security-1.0.4.jar +xml-security/jars/xmlsec-1.0.5D2.jar +xml-security/jars/xmlsec-1.1.0.jar +xml-security/jars/xmlsec-1.1.0.jar.sig +xml-security/jars/xmlsec-1.2.1.jar +xml-security/jars/xmlsec-1.2.1.jar.sig +xml-security/jars/xmlsec-1.3.0.jar +xml-security/jars/xmlsec-1.3.0.jar.sig +xmlbeans/jars/jsr173_1.0_api.jar +xmlbeans/jars/jsr173_1.0_api_bundle.jar +xmlbeans/jars/xbean-1.0.3.jar +xmlbeans/jars/xbean-1.0.4-jdk1.3.jar +xmlbeans/jars/xbean-1.0.4.jar +xmlbeans/jars/xbean-2.0.0-beta1.jar +xmlbeans/jars/xbean-2.0.0.jar +xmlbeans/jars/xbean-2.1.0.jar +xmlbeans/jars/xbean_xpath-1.0.3.jar +xmlbeans/jars/xbean-2.2.0.jar +xmlbeans/jars/xbean_xpath-1.0.4-jdk1.3.jar +xmlbeans/jars/xbean_xpath-1.0.4.jar +xmlbeans/jars/xbean_xpath-2.0.0-beta1.jar +xmlbeans/jars/xbean_xpath-2.0.0.jar +xmlbeans/jars/xbean_xpath-2.1.0.jar +xmlbeans/jars/xbean_xpath-2.2.0.jar +xmlbeans/jars/xmlbeans-1.0.3.jar +xmlbeans/jars/xmlbeans-1.0.jar +xmlbeans/jars/xmlpublic-2.0.0-beta1.jar +xmlbeans/jars/xmlpublic-2.0.0.jar +xmlbeans/jars/xmlpublic-2.1.0.jar +xmlbeans/jars/xmlpublic-2.2.0.jar +xmlbeans/poms/xmlbeans-1.0.3.pom +xmlbeans/poms/xbean-2.2.0.pom +xmlrpc/jars/xmlrpc-1.1.jar +xmlrpc/jars/xmlrpc-1.2-a1.jar +xmlrpc/jars/xmlrpc-1.2-a2.jar +xmlrpc/jars/xmlrpc-1.2-a3-dev.20030102.111633.jar +xmlrpc/jars/xmlrpc-1.2-a3-dev.jar +xmlrpc/jars/xmlrpc-1.2-b1.jar +xmlrpc/jars/xmlrpc-2.0-applet.jar +xmlrpc/jars/xmlrpc-1.2.jar +xmlrpc/jars/xmlrpc-2.0-beta-applet.jar +xmlrpc/jars/xmlrpc-2.0-beta.jar +xmlrpc/jars/xmlrpc-2.0.1-sources.jar +xmlrpc/jars/xmlrpc-3.0a1-sources.jar +xmlrpc/jars/xmlrpc-2.0.1.jar +xmlrpc/jars/xmlrpc-2.0.jar +xmlrpc/jars/xmlrpc-3.0a1.jar +xmlrpc/jars/xmlrpc-client-3.0-sources.jar +xmlrpc/jars/xmlrpc-common-3.0.jar +xmlrpc/jars/xmlrpc-client-3.0.jar +xmlrpc/jars/xmlrpc-client-3.0b1-sources.jar +xmlrpc/jars/xmlrpc-client-3.0b1.jar +xmlrpc/jars/xmlrpc-common-3.0-sources.jar +xmlrpc/jars/xmlrpc-common-3.0b1-sources.jar +xmlrpc/jars/xmlrpc-common-3.0b1.jar +xmlrpc/jars/xmlrpc-helma-1.0.jar +xmlrpc/jars/xmlrpc-server-3.0-sources.jar +xmlrpc/jars/xmlrpc-server-3.0.jar +xmlrpc/jars/xmlrpc-server-3.0b1-sources.jar +xmlrpc/jars/xmlrpc-server-3.0b1.jar +xmlrpc/poms/xmlrpc-3.0.pom +xmlrpc/poms/xmlrpc-3.0b1.pom +xmlrpc/poms/xmlrpc-client-3.0.pom +xmlrpc/poms/xmlrpc-client-3.0b1.pom +xmlrpc/poms/xmlrpc-common-3.0.pom +xmlrpc/poms/xmlrpc-common-3.0b1.pom +xmlrpc/poms/xmlrpc-server-3.0.pom +xmlrpc/poms/xmlrpc-server-3.0b1.pom +org.apache.ws.commons.axiom/jars/axiom-api-1.2.jar +org.apache.ws.commons.axiom/jars/axiom-impl-1.2.jar +org.apache.ws.commons.axiom/jars/axiom-dom-1.2.jar +org.apache.ws.commons.axiom/jars/axiom-1.2.1.jar +org.apache.ws.commons.axiom/jars/axiom-impl-1.2.1.jar +org.apache.ws.commons.axiom/jars/axiom-dom-1.2.1.jar +org.apache.ws.commons.axiom/jars/axiom-api-1.2.1.jar +org.apache.ws.commons.axiom/jars/axiom-1.2.2.jar +org.apache.ws.commons.axiom/jars/axiom-api-1.2.2.jar +org.apache.ws.commons.axiom/jars/axiom-dom-1.2.2.jar +org.apache.ws.commons.axiom/jars/axiom-impl-1.2.2.jar +org.apache.ws.commons.axiom/jars/axiom-1.2.3.jar +org.apache.ws.commons.axiom/jars/axiom-api-1.2.3.jar +org.apache.ws.commons.axiom/jars/axiom-dom-1.2.3.jar +org.apache.ws.commons.axiom/jars/axiom-impl-1.2.3.jar +org.apache.ws.commons.axiom/jars/axiom-1.2.4.jar +org.apache.ws.commons.axiom/jars/axiom-api-1.2.4.jar +org.apache.ws.commons.axiom/jars/axiom-dom-1.2.4.jar +org.apache.ws.commons.axiom/jars/axiom-impl-1.2.4.jar +org.apache.ws.commons.axiom/jars/axiom-impl-1.2.5.jar +org.apache.ws.commons.axiom/jars/axiom-dom-1.2.5.jar +org.apache.ws.commons.axiom/jars/axiom-api-1.2.5.jar +org.apache.ws.commons.axiom/jars/axiom-1.2.5.jar +org.apache.ws.commons.schema/jars/XmlSchema-1.2.jar +org.apache.axis2/jars/axis2-adb-1.1.jar +org.apache.axis2/jars/axis2-adb-codegen-1.1.jar +org.apache.axis2/jars/axis2-codegen-1.1.jar +org.apache.axis2/jars/axis2-java2wsdl-1.1.jar +org.apache.axis2/jars/axis2-jibx-1.1.jar +org.apache.axis2/jars/axis2-kernel-1.1.jar +org.apache.axis2/jars/axis2-saaj-1.1.jar +org.apache.axis2/jars/axis2-soapmonitor-1.1.jar +org.apache.axis2/jars/axis2-spring-1.1.jar +org.apache.axis2/jars/axis2-tools-1.1.jar +org.apache.axis2/jars/axis2-xmlbeans-1.1.jar +org.apache.axis2/jars/axis2-1.1.jar +org.apache.axis2/jars/axis2-rahas-1.1.jar +org.apache.axis2/jars/axis2-secpolicy-1.1.jar +org.apache.axis2/jars/axis2-security-1.1.jar +org.apache.axis2/jars/axis2-1.1.1.jar +org.apache.axis2/jars/axis2-adb-1.1.1.jar +org.apache.axis2/jars/axis2-adb-codegen-1.1.1.jar +org.apache.axis2/jars/axis2-codegen-1.1.1.jar +org.apache.axis2/jars/axis2-java2wsdl-1.1.1.jar +org.apache.axis2/jars/axis2-jaxbri-1.1.1.jar +org.apache.axis2/jars/axis2-jibx-1.1.1.jar +org.apache.axis2/jars/axis2-kernel-1.1.1.jar +org.apache.axis2/jars/axis2-saaj-1.1.1.jar +org.apache.axis2/jars/axis2-soapmonitor-1.1.1.jar +org.apache.axis2/jars/axis2-spring-1.1.1.jar +org.apache.axis2/jars/axis2-tools-1.1.1.jar +org.apache.axis2/jars/axis2-xmlbeans-1.1.1.jar +org.apache.axis2/jars/axis2-1.2.jar +org.apache.axis2/jars/axis2-adb-1.2.jar +org.apache.axis2/jars/axis2-adb-codegen-1.2.jar +org.apache.axis2/jars/axis2-addressing-1.2.jar +org.apache.axis2/jars/axis2-codegen-1.2.jar +org.apache.axis2/jars/axis2-fastinfoset-1.2.jar +org.apache.axis2/jars/axis2-jaxws-1.2.jar +org.apache.axis2/jars/axis2-java2wsdl-1.2.jar +org.apache.axis2/jars/axis2-jaxbri-1.2.jar +org.apache.axis2/jars/axis2-jaxws-api-1.2.jar +org.apache.axis2/jars/axis2-jibx-1.2.jar +org.apache.axis2/jars/axis2-json-1.2.jar +org.apache.axis2/jars/axis2-kernel-1.2.jar +org.apache.axis2/jars/axis2-metadata-1.2.jar +org.apache.axis2/jars/axis2-mex-1.2.jar +org.apache.axis2/jars/axis2-mtompolicy-1.2.jar +org.apache.axis2/jars/axis2-ping-1.2.jar +org.apache.axis2/jars/axis2-saaj-1.2.jar +org.apache.axis2/jars/axis2-saaj-api-1.2.jar +org.apache.axis2/jars/axis2-soapmonitor-1.2.jar +org.apache.axis2/jars/axis2-spring-1.2.jar +org.apache.axis2/jars/axis2-xmlbeans-1.2.jar +org.apache.axis2/mars/addressing-1.1.mar +org.apache.axis2/mars/soapmonitor-1.1.mar +org.apache.axis2/mars/rampart-1.1.mar +org.apache.axis2/mars/rahas-1.1.mar +org.apache.axis2/mars/addressing-1.1.1.mar +org.apache.axis2/mars/soapmonitor-1.1.1.mar +org.apache.axis2/mars/addressing-1.2.mar +org.apache.axis2/mars/soapmonitor-1.2.mar +org.apache.neethi/jars/neethi-2.0.jar +org.apache.neethi/jars/neethi-2.0.1.jar +org.apache.neethi/jars/neethi-2.0.2.jar +org.apache.ws.commons.neethi/jars/neethi-1.0.1.jar +org.apache.ws.commons.neethi/jars/neethi-2.0.1.jar +org.apache.sandesha2/jars/sandesha2-1.1.jar +org.apache.sandesha2/jars/sandesha2-client-1.1.jar +org.apache.sandesha2/jars/sandesha2-policy-1.1.jar +org.apache.sandesha2/mars/sandesha2-1.1.mar +org.apache.ant/jars/ant-1.7.0.jar +org.apache.ant/jars/ant-antlr-1.7.0.jar +org.apache.ant/jars/ant-apache-bcel-1.7.0.jar +org.apache.ant/jars/ant-apache-bsf-1.7.0.jar +org.apache.ant/jars/ant-apache-log4j-1.7.0.jar +org.apache.ant/jars/ant-apache-oro-1.7.0.jar +org.apache.ant/jars/ant-apache-regexp-1.7.0.jar +org.apache.ant/jars/ant-apache-resolver-1.7.0.jar +org.apache.ant/jars/ant-commons-logging-1.7.0.jar +org.apache.ant/jars/ant-commons-net-1.7.0.jar +org.apache.ant/jars/ant-jai-1.7.0.jar +org.apache.ant/jars/ant-javamail-1.7.0.jar +org.apache.ant/jars/ant-jdepend-1.7.0.jar +org.apache.ant/jars/ant-jmf-1.7.0.jar +org.apache.ant/jars/ant-jsch-1.7.0.jar +org.apache.ant/jars/ant-junit-1.7.0.jar +org.apache.ant/jars/ant-launcher-1.7.0.jar +org.apache.ant/jars/ant-netrexx-1.7.0.jar +org.apache.ant/jars/ant-nodeps-1.7.0.jar +org.apache.ant/jars/ant-starteam-1.7.0.jar +org.apache.ant/jars/ant-stylebook-1.7.0.jar +org.apache.ant/jars/ant-swing-1.7.0.jar +org.apache.ant/jars/ant-testutil-1.7.0.jar +org.apache.ant/jars/ant-trax-1.7.0.jar +org.apache.ant/jars/ant-weblogic-1.7.0.jar +org.apache.ant/poms/ant-1.7.0.pom +org.apache.ant/poms/ant-antlr-1.7.0.pom +org.apache.ant/poms/ant-apache-bcel-1.7.0.pom +org.apache.ant/poms/ant-apache-bsf-1.7.0.pom +org.apache.ant/poms/ant-apache-log4j-1.7.0.pom +org.apache.ant/poms/ant-apache-oro-1.7.0.pom +org.apache.ant/poms/ant-apache-regexp-1.7.0.pom +org.apache.ant/poms/ant-apache-resolver-1.7.0.pom +org.apache.ant/poms/ant-commons-logging-1.7.0.pom +org.apache.ant/poms/ant-commons-net-1.7.0.pom +org.apache.ant/poms/ant-jai-1.7.0.pom +org.apache.ant/poms/ant-javamail-1.7.0.pom +org.apache.ant/poms/ant-jdepend-1.7.0.pom +org.apache.ant/poms/ant-jmf-1.7.0.pom +org.apache.ant/poms/ant-jsch-1.7.0.pom +org.apache.ant/poms/ant-junit-1.7.0.pom +org.apache.ant/poms/ant-launcher-1.7.0.pom +org.apache.ant/poms/ant-netrexx-1.7.0.pom +org.apache.ant/poms/ant-nodeps-1.7.0.pom +org.apache.ant/poms/ant-parent-1.7.0.pom +org.apache.ant/poms/ant-starteam-1.7.0.pom +org.apache.ant/poms/ant-stylebook-1.7.0.pom +org.apache.ant/poms/ant-swing-1.7.0.pom +org.apache.ant/poms/ant-trax-1.7.0.pom +org.apache.ant/poms/ant-testutil-1.7.0.pom +org.apache.ant/poms/ant-weblogic-1.7.0.pom +org.apache.activemq/tar.bz2s/apache-activemq-4.1.1.tar.bz2 +org.apache.activemq/jars/activemq-console-4.1.1.jar +org.apache.activemq/jars/activemq-core-4.1.1-tests.jar +org.apache.activemq/jars/activemq-core-4.1.1.jar +org.apache.activemq/jars/activemq-jaas-4.1.1.jar +org.apache.activemq/jars/activemq-openwire-generator-4.1.1.jar +org.apache.activemq/jars/activemq-optional-4.1.1.jar +org.apache.activemq/jars/activemq-ra-4.1.1.jar +org.apache.activemq/jars/activemq-test-atomikos-4.1.1.jar +org.apache.activemq/jars/activemq-web-4.1.1.jar +org.apache.activemq/jars/activemq-xmpp-4.1.1.jar +org.apache.activemq/jars/apache-activemq-4.1.1.jar +org.apache.activemq/java-sources/activemq-console-4.1.1-sources.jar +org.apache.activemq/java-sources/activemq-openwire-generator-4.1.1-sources.jar +org.apache.activemq/java-sources/activemq-core-4.1.1-sources.jar +org.apache.activemq/java-sources/activemq-jaas-4.1.1-sources.jar +org.apache.activemq/java-sources/activemq-optional-4.1.1-sources.jar +org.apache.activemq/java-sources/activemq-ra-4.1.1-sources.jar +org.apache.activemq/java-sources/activemq-test-atomikos-4.1.1-sources.jar +org.apache.activemq/java-sources/activemq-rar-4.1.1-sources.jar +org.apache.activemq/java-sources/activemq-web-4.1.1-sources.jar +org.apache.activemq/java-sources/activemq-web-console-4.1.1-sources.jar +org.apache.activemq/java-sources/activemq-web-demo-4.1.1-sources.jar +org.apache.activemq/java-sources/activemq-xmpp-4.1.1-sources.jar +org.apache.activemq/java-sources/apache-activemq-4.1.1-sources.jar +org.apache.activemq/poms/activemq-console-4.1.1.pom +org.apache.activemq/poms/activemq-openwire-generator-4.1.1.pom +org.apache.activemq/poms/activemq-core-4.1.1.pom +org.apache.activemq/poms/activemq-jaas-4.1.1.pom +org.apache.activemq/poms/activemq-ra-4.1.1.pom +org.apache.activemq/poms/activemq-optional-4.1.1.pom +org.apache.activemq/poms/activemq-parent-4.1.1.pom +org.apache.activemq/poms/activemq-xmpp-4.1.1.pom +org.apache.activemq/poms/activemq-rar-4.1.1.pom +org.apache.activemq/poms/activemq-test-atomikos-4.1.1.pom +org.apache.activemq/poms/activemq-web-4.1.1.pom +org.apache.activemq/poms/activemq-web-console-4.1.1.pom +org.apache.activemq/poms/activemq-web-demo-4.1.1.pom +org.apache.activemq/poms/apache-activemq-4.1.1.pom +org.apache.activemq/poms/maven-metadata.xml +org.apache.activemq/rars/activemq-rar-4.1.1.rar +org.apache.activemq/htmls/activemq-core-4.1.1-schema.html +org.apache.activemq/htmls/activemq-ra-4.1.1-schema.html +org.apache.activemq/tar.gzs/apache-activemq-4.1.1-src.tar.gz +org.apache.activemq/tar.gzs/apache-activemq-4.1.1.tar.gz +org.apache.activemq/wars/activemq-web-console-4.1.1.war +org.apache.activemq/wars/activemq-web-demo-4.1.1.war +org.apache.activemq/xsd.htmls/activemq-core-4.1.1.xsd.html +org.apache.activemq/xsd.htmls/activemq-ra-4.1.1.xsd.html +org.apache.activemq/xsds/activemq-core-4.1.1.xsd +org.apache.activemq/xsds/activemq-ra-4.1.1.xsd +org.apache.activemq/xsds/README.txt +org.apache.activemq/xsds/ReadMe.html +org.apache.activemq/xsds/HEADER.html +org.apache.activemq/zips/apache-activemq-4.1.1-src.zip +org.apache.activemq/zips/apache-activemq-4.1.1.zip +org.apache.activemq/snapshot-schema +org.apache.poi/jars/poi-3.0.1-FINAL.jar +org.apache.poi/jars/poi-scratchpad-3.0.1-FINAL.jar +org.apache.poi/jars/poi-contrib-3.0.1-FINAL.jar +org.apache.poi/poms/poi-3.0-FINAL.pom +org.apache.poi/poms/poi-3.0.1-FINAL.pom +org.apache.poi/poms/poi-scratchpad-3.0.1-FINAL.pom +org.apache.poi/poms/poi-contrib-3.0.1-FINAL.pom +org.apache.camel/poms/apache-camel-1.0.0.pom +org.apache.camel/poms/archetypes-1.0.0.pom +org.apache.camel/poms/camel-activemq-1.0.0.pom +org.apache.camel/poms/camel-example-jms-file-1.0.0.pom +org.apache.camel/poms/camel-bam-1.0.0.pom +org.apache.camel/poms/camel-book-1.0.0.pom +org.apache.camel/poms/camel-core-1.0.0.pom +org.apache.camel/poms/camel-cxf-1.0.0.pom +org.apache.camel/poms/camel-example-spring-1.0.0.pom +org.apache.camel/poms/camel-ftp-1.0.0.pom +org.apache.camel/poms/camel-jms-1.0.0.pom +org.apache.camel/poms/camel-http-1.0.0.pom +org.apache.camel/poms/camel-irc-1.0.0.pom +org.apache.camel/poms/camel-jaxb-1.0.0.pom +org.apache.camel/poms/camel-jbi-1.0.0.pom +org.apache.camel/poms/camel-josql-1.0.0.pom +org.apache.camel/poms/camel-jpa-1.0.0.pom +org.apache.camel/poms/camel-mail-1.0.0.pom +org.apache.camel/poms/camel-maven-plugin-1.0.0.pom +org.apache.camel/poms/camel-mina-1.0.0.pom +org.apache.camel/poms/camel-parent-1.0.0.pom +org.apache.camel/poms/camel-rmi-1.0.0.pom +org.apache.camel/poms/camel-quartz-1.0.0.pom +org.apache.camel/poms/camel-router-1.0.0.pom +org.apache.camel/poms/camel-saxon-1.0.0.pom +org.apache.camel/poms/camel-script-1.0.0.pom +org.apache.camel/poms/camel-spring-1.0.0.pom +org.apache.camel/poms/camel-xmpp-1.0.0.pom +org.apache.camel/poms/components-1.0.0.pom +org.apache.camel/poms/examples-1.0.0.pom +org.apache.camel/poms/maven-html-to-docbook-1.0.0.pom +org.apache.camel/poms/maven-metadata.xml +org.apache.camel/poms/maven-plugins-1.0.0.pom +org.apache.camel/poms/tooling-1.0.0.pom +org.apache.camel/poms/apache-camel-1.1.0.pom +org.apache.camel/poms/archetypes-1.1.0.pom +org.apache.camel/poms/camel-activemq-1.1.0.pom +org.apache.camel/poms/camel-bam-1.1.0.pom +org.apache.camel/poms/camel-book-1.1.0.pom +org.apache.camel/poms/camel-core-1.1.0.pom +org.apache.camel/poms/camel-cxf-1.1.0.pom +org.apache.camel/poms/camel-example-bam-1.1.0.pom +org.apache.camel/poms/camel-example-etl-1.1.0.pom +org.apache.camel/poms/camel-example-jms-file-1.1.0.pom +org.apache.camel/poms/camel-jpa-1.1.0.pom +org.apache.camel/poms/camel-example-spring-1.1.0.pom +org.apache.camel/poms/camel-ftp-1.1.0.pom +org.apache.camel/poms/camel-http-1.1.0.pom +org.apache.camel/poms/camel-irc-1.1.0.pom +org.apache.camel/poms/camel-jaxb-1.1.0.pom +org.apache.camel/poms/camel-jing-1.1.0.pom +org.apache.camel/poms/camel-jms-1.1.0.pom +org.apache.camel/poms/camel-maven-plugin-1.1.0.pom +org.apache.camel/poms/camel-josql-1.1.0.pom +org.apache.camel/poms/camel-juel-1.1.0.pom +org.apache.camel/poms/camel-mail-1.1.0.pom +org.apache.camel/poms/camel-msv-1.1.0.pom +org.apache.camel/poms/camel-mina-1.1.0.pom +org.apache.camel/poms/camel-rmi-1.1.0.pom +org.apache.camel/poms/camel-ognl-1.1.0.pom +org.apache.camel/poms/camel-parent-1.1.0.pom +org.apache.camel/poms/camel-quartz-1.1.0.pom +org.apache.camel/poms/examples-1.1.0.pom +org.apache.camel/poms/camel-router-1.1.0.pom +org.apache.camel/poms/camel-saxon-1.1.0.pom +org.apache.camel/poms/camel-script-1.1.0.pom +org.apache.camel/poms/camel-spring-1.1.0.pom +org.apache.camel/poms/camel-xmpp-1.1.0.pom +org.apache.camel/poms/components-1.1.0.pom +org.apache.camel/poms/maven-html-to-docbook-1.1.0.pom +org.apache.camel/poms/maven-plugins-1.1.0.pom +org.apache.camel/poms/tooling-1.1.0.pom +org.apache.camel/java-sources/apache-camel-1.0.0-sources.jar +org.apache.camel/java-sources/camel-activemq-1.0.0-sources.jar +org.apache.camel/java-sources/camel-bam-1.0.0-sources.jar +org.apache.camel/java-sources/camel-cxf-1.0.0-sources.jar +org.apache.camel/java-sources/camel-core-1.0.0-sources.jar +org.apache.camel/java-sources/camel-example-jms-file-1.0.0-sources.jar +org.apache.camel/java-sources/camel-ftp-1.0.0-sources.jar +org.apache.camel/java-sources/camel-example-spring-1.0.0-sources.jar +org.apache.camel/java-sources/camel-http-1.0.0-sources.jar +org.apache.camel/java-sources/camel-irc-1.0.0-sources.jar +org.apache.camel/java-sources/camel-jaxb-1.0.0-sources.jar +org.apache.camel/java-sources/camel-jbi-1.0.0-sources.jar +org.apache.camel/java-sources/camel-jms-1.0.0-sources.jar +org.apache.camel/java-sources/camel-josql-1.0.0-sources.jar +org.apache.camel/java-sources/camel-jpa-1.0.0-sources.jar +org.apache.camel/java-sources/camel-mail-1.0.0-sources.jar +org.apache.camel/java-sources/camel-maven-plugin-1.0.0-sources.jar +org.apache.camel/java-sources/camel-rmi-1.0.0-sources.jar +org.apache.camel/java-sources/camel-mina-1.0.0-sources.jar +org.apache.camel/java-sources/camel-quartz-1.0.0-sources.jar +org.apache.camel/java-sources/camel-router-1.0.0-sources.jar +org.apache.camel/java-sources/camel-saxon-1.0.0-sources.jar +org.apache.camel/java-sources/camel-script-1.0.0-sources.jar +org.apache.camel/java-sources/camel-spring-1.0.0-sources.jar +org.apache.camel/java-sources/camel-xmpp-1.0.0-sources.jar +org.apache.camel/java-sources/maven-html-to-docbook-1.0.0-sources.jar +org.apache.camel/java-sources/apache-camel-1.1.0-sources.jar +org.apache.camel/java-sources/camel-activemq-1.1.0-sources.jar +org.apache.camel/java-sources/camel-bam-1.1.0-sources.jar +org.apache.camel/java-sources/camel-core-1.1.0-sources.jar +org.apache.camel/java-sources/camel-cxf-1.1.0-sources.jar +org.apache.camel/java-sources/camel-example-bam-1.1.0-sources.jar +org.apache.camel/java-sources/camel-ftp-1.1.0-sources.jar +org.apache.camel/java-sources/camel-example-etl-1.1.0-sources.jar +org.apache.camel/java-sources/camel-example-jms-file-1.1.0-sources.jar +org.apache.camel/java-sources/camel-example-spring-1.1.0-sources.jar +org.apache.camel/java-sources/camel-http-1.1.0-sources.jar +org.apache.camel/java-sources/camel-irc-1.1.0-sources.jar +org.apache.camel/java-sources/camel-maven-plugin-1.1.0-sources.jar +org.apache.camel/java-sources/camel-jaxb-1.1.0-sources.jar +org.apache.camel/java-sources/camel-jing-1.1.0-sources.jar +org.apache.camel/java-sources/camel-jms-1.1.0-sources.jar +org.apache.camel/java-sources/camel-josql-1.1.0-sources.jar +org.apache.camel/java-sources/camel-jpa-1.1.0-sources.jar +org.apache.camel/java-sources/camel-juel-1.1.0-sources.jar +org.apache.camel/java-sources/camel-mail-1.1.0-sources.jar +org.apache.camel/java-sources/camel-mina-1.1.0-sources.jar +org.apache.camel/java-sources/camel-msv-1.1.0-sources.jar +org.apache.camel/java-sources/camel-ognl-1.1.0-sources.jar +org.apache.camel/java-sources/camel-rmi-1.1.0-sources.jar +org.apache.camel/java-sources/camel-quartz-1.1.0-sources.jar +org.apache.camel/java-sources/camel-router-1.1.0-sources.jar +org.apache.camel/java-sources/camel-saxon-1.1.0-sources.jar +org.apache.camel/java-sources/camel-script-1.1.0-sources.jar +org.apache.camel/java-sources/camel-spring-1.1.0-sources.jar +org.apache.camel/java-sources/camel-xmpp-1.1.0-sources.jar +org.apache.camel/java-sources/maven-html-to-docbook-1.1.0-sources.jar +org.apache.camel/maven-plugins/camel-maven-plugin-1.0.0.jar +org.apache.camel/maven-plugins/maven-html-to-docbook-1.0.0.jar +org.apache.camel/maven-plugins/camel-maven-plugin-1.1.0.jar +org.apache.camel/maven-plugins/maven-html-to-docbook-1.1.0.jar +org.apache.camel/jars/apache-camel-1.0.0.jar +org.apache.camel/jars/camel-activemq-1.0.0.jar +org.apache.camel/jars/camel-example-jms-file-1.0.0.jar +org.apache.camel/jars/camel-bam-1.0.0.jar +org.apache.camel/jars/camel-core-1.0.0-tests.jar +org.apache.camel/jars/camel-core-1.0.0.jar +org.apache.camel/jars/camel-cxf-1.0.0.jar +org.apache.camel/jars/camel-example-spring-1.0.0.jar +org.apache.camel/jars/camel-ftp-1.0.0.jar +org.apache.camel/jars/camel-http-1.0.0.jar +org.apache.camel/jars/camel-irc-1.0.0.jar +org.apache.camel/jars/camel-jaxb-1.0.0.jar +org.apache.camel/jars/camel-jbi-1.0.0.jar +org.apache.camel/jars/camel-jms-1.0.0.jar +org.apache.camel/jars/camel-josql-1.0.0.jar +org.apache.camel/jars/camel-jpa-1.0.0.jar +org.apache.camel/jars/camel-mail-1.0.0.jar +org.apache.camel/jars/camel-mina-1.0.0.jar +org.apache.camel/jars/camel-quartz-1.0.0.jar +org.apache.camel/jars/camel-rmi-1.0.0.jar +org.apache.camel/jars/camel-router-1.0.0.jar +org.apache.camel/jars/camel-saxon-1.0.0.jar +org.apache.camel/jars/camel-script-1.0.0.jar +org.apache.camel/jars/camel-spring-1.0.0-tests.jar +org.apache.camel/jars/camel-spring-1.0.0.jar +org.apache.camel/jars/camel-xmpp-1.0.0.jar +org.apache.camel/jars/apache-camel-1.1.0.jar +org.apache.camel/jars/camel-activemq-1.1.0.jar +org.apache.camel/jars/camel-bam-1.1.0.jar +org.apache.camel/jars/camel-core-1.1.0-tests.jar +org.apache.camel/jars/camel-core-1.1.0.jar +org.apache.camel/jars/camel-cxf-1.1.0.jar +org.apache.camel/jars/camel-example-bam-1.1.0.jar +org.apache.camel/jars/camel-example-etl-1.1.0.jar +org.apache.camel/jars/camel-example-jms-file-1.1.0.jar +org.apache.camel/jars/camel-ftp-1.1.0.jar +org.apache.camel/jars/camel-example-spring-1.1.0.jar +org.apache.camel/jars/camel-http-1.1.0.jar +org.apache.camel/jars/camel-irc-1.1.0.jar +org.apache.camel/jars/camel-jaxb-1.1.0.jar +org.apache.camel/jars/camel-jing-1.1.0.jar +org.apache.camel/jars/camel-jms-1.1.0.jar +org.apache.camel/jars/camel-josql-1.1.0.jar +org.apache.camel/jars/camel-jpa-1.1.0.jar +org.apache.camel/jars/camel-juel-1.1.0.jar +org.apache.camel/jars/camel-mail-1.1.0.jar +org.apache.camel/jars/camel-mina-1.1.0.jar +org.apache.camel/jars/camel-msv-1.1.0.jar +org.apache.camel/jars/camel-ognl-1.1.0.jar +org.apache.camel/jars/camel-quartz-1.1.0.jar +org.apache.camel/jars/camel-rmi-1.1.0.jar +org.apache.camel/jars/camel-router-1.1.0.jar +org.apache.camel/jars/camel-saxon-1.1.0.jar +org.apache.camel/jars/camel-script-1.1.0.jar +org.apache.camel/jars/camel-spring-1.1.0-tests.jar +org.apache.camel/jars/camel-spring-1.1.0.jar +org.apache.camel/jars/camel-xmpp-1.1.0.jar +org.apache.camel/tar.gzs/apache-camel-1.0.0-src.tar.gz +org.apache.camel/tar.gzs/apache-camel-1.0.0.tar.gz +org.apache.camel/tar.gzs/apache-camel-1.1.0-src.tar.gz +org.apache.camel/tar.gzs/apache-camel-1.1.0.tar.gz +org.apache.camel/xsds/camel-spring-1.0.0.xsd +org.apache.camel/xsds/camel-spring-1.1.0.xsd +org.apache.camel/zips/apache-camel-1.0.0-src.zip +org.apache.camel/zips/apache-camel-1.0.0.zip +org.apache.camel/zips/apache-camel-1.1.0-src.zip +org.apache.camel/zips/apache-camel-1.1.0.zip +org.apache.xmlbeans/jars/xmlbeans-2.3.0.jar +org.apache.xmlbeans/jars/xmlbeans-xmlpublic-2.3.0.jar +org.apache.xmlbeans/jars/xmlbeans-qname-2.3.0.jar +org.apache.xmlbeans/jars/xmlbeans-2.2.0.jar +org.apache.xmlbeans/jars/xmlbeans-xmlpublic-2.2.0.jar +org.apache.xmlbeans/jars/xmlbeans-xpath-2.3.0.jar +org.apache.xmlbeans/jars/xmlbeans-xpath-2.2.0.jar +org.apache.xmlbeans/poms/xmlbeans-2.2.0.pom +org.apache.xmlbeans/poms/xmlbeans-2.3.0.pom +org.apache.xmlbeans/poms/xmlbeans-xpath-2.3.0.pom +org.apache.xmlbeans/poms/xmlbeans-xmlpublic-2.2.0.pom +org.apache.xmlbeans/poms/xmlbeans-xmlpublic-2.3.0.pom +org.apache.xmlbeans/poms/xmlbeans-xpath-2.2.0.pom +org.apache.xmlbeans/poms/xmlbeans-qname-2.3.0.pom +org.apache.poi.DELETE/poms/poi-3.0-FINAL.pom diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/resources/org/apache/maven/archiva/repository/content/RepositoryRequestTest.xml b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/resources/org/apache/maven/archiva/repository/content/RepositoryRequestTest.xml new file mode 100644 index 000000000..b77b71142 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/resources/org/apache/maven/archiva/repository/content/RepositoryRequestTest.xml @@ -0,0 +1,55 @@ + + + + + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + org.apache.maven.archiva.configuration.DefaultArchivaConfiguration + + + org.codehaus.plexus.registry.Registry + configured + + + org.apache.maven.archiva.policies.PreDownloadPolicy + prePolicies + + + org.apache.maven.archiva.policies.PostDownloadPolicy + postPolicies + + + + + org.codehaus.plexus.registry.Registry + configured + org.codehaus.plexus.registry.commons.CommonsConfigurationRegistry + + + + + + + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/resources/org/apache/maven/archiva/repository/metadata/MetadataToolsTest.xml b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/resources/org/apache/maven/archiva/repository/metadata/MetadataToolsTest.xml new file mode 100644 index 000000000..0de938fa1 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/resources/org/apache/maven/archiva/repository/metadata/MetadataToolsTest.xml @@ -0,0 +1,66 @@ + + + + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + mock + org.apache.maven.archiva.repository.MockConfiguration + + + + org.apache.maven.archiva.repository.metadata.MetadataTools + org.apache.maven.archiva.repository.metadata.MetadataTools + MetadataTools + + + org.apache.maven.archiva.configuration.FileTypes + filetypes + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + mock + configuration + + + + + + org.codehaus.plexus.cache.Cache + url-failures-cache + org.codehaus.plexus.cache.ehcache.EhcacheCache + URL Failure Cache + + 600 + false + ${java.io.tmpdir}/archiva/urlcache + false + 1000 + LRU + url-failures-cache + false + + 2700 + + 1800 + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/resources/org/apache/maven/archiva/repository/project/filters/EffectiveProjectModelFilterTest.xml b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/resources/org/apache/maven/archiva/repository/project/filters/EffectiveProjectModelFilterTest.xml new file mode 100644 index 000000000..72b797c20 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/resources/org/apache/maven/archiva/repository/project/filters/EffectiveProjectModelFilterTest.xml @@ -0,0 +1,50 @@ + + + + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + mock + org.apache.maven.archiva.repository.MockConfiguration + + + + org.codehaus.plexus.cache.Cache + effective-project-cache + org.codehaus.plexus.cache.ehcache.EhcacheCache + Effective Project Cache + + 600 + true + ${java.io.tmpdir}/archiva/effectiveproject + true + 1000 + LRU + effective-project-cache + false + + + 2700 + + 1800 + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/resources/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumersTest.xml b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/resources/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumersTest.xml new file mode 100644 index 000000000..57256f87d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/resources/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumersTest.xml @@ -0,0 +1,144 @@ + + + + + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + org.apache.maven.archiva.configuration.DefaultArchivaConfiguration + + + org.codehaus.plexus.registry.Registry + configured + + + org.apache.maven.archiva.policies.PreDownloadPolicy + prePolicies + + + org.apache.maven.archiva.policies.PostDownloadPolicy + postPolicies + + + + + org.codehaus.plexus.registry.Registry + configured + org.codehaus.plexus.registry.commons.CommonsConfigurationRegistry + + + + + + + + + + + org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer + update-db-artifact + org.apache.maven.archiva.repository.scanner.SampleKnownConsumer + + update-db-artifact + + + + org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer + create-missing-checksums + org.apache.maven.archiva.repository.scanner.SampleKnownConsumer + + create-missing-checksums + + + + org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer + update-db-repository-metadata + org.apache.maven.archiva.repository.scanner.SampleKnownConsumer + + update-db-repository-metadata + + + + org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer + validate-checksum + org.apache.maven.archiva.repository.scanner.SampleKnownConsumer + + validate-checksum + + + + org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer + index-content + org.apache.maven.archiva.repository.scanner.SampleKnownConsumer + + index-content + + + + org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer + auto-remove + org.apache.maven.archiva.repository.scanner.SampleKnownConsumer + + auto-remove + + + + org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer + auto-rename + org.apache.maven.archiva.repository.scanner.SampleKnownConsumer + + auto-rename + + + + org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer + available-but-unselected + org.apache.maven.archiva.repository.scanner.SampleKnownConsumer + + available-but-unselected + + + + + + org.apache.maven.archiva.consumers.InvalidRepositoryContentConsumer + update-db-bad-content + org.apache.maven.archiva.repository.scanner.InvalidScanConsumer + + update-db-bad-content + + + + org.apache.maven.archiva.consumers.InvalidRepositoryContentConsumer + move-to-trash-then-notify + org.apache.maven.archiva.repository.scanner.InvalidScanConsumer + + move-to-trash-then-notify + + + + org.apache.maven.archiva.repository.scanner.RepositoryContentConsumers + test + org.apache.maven.archiva.repository.scanner.RepositoryContentConsumersStub + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/resources/scanner-archiva.xml b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/resources/scanner-archiva.xml new file mode 100644 index 000000000..13a884e14 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-repository-layer/src/test/resources/scanner-archiva.xml @@ -0,0 +1,109 @@ + + + + + + + + + artifacts + + **/*.pom + **/*.jar + **/*.ear + **/*.war + **/*.car + **/*.sar + **/*.mar + **/*.rar + **/*.dtd + **/*.tld + **/*.tar.gz + **/*.tar.bz2 + **/*.zip + + + + indexable-content + + **/*.txt + **/*.TXT + **/*.block + **/*.config + **/*.pom + **/*.xml + **/*.xsd + **/*.dtd + **/*.tld + + + + auto-remove + + **/*.bak + **/*~ + **/*- + + + + ignored + + **/.htaccess + **/KEYS + **/*.rb + **/*.sh + **/.svn/** + **/.DAV/** + + + + + update-db-artifact + create-missing-checksums + update-db-repository-metadata + validate-checksum + validate-signature + index-content + auto-remove + auto-rename + + + update-db-bad-content + + + + + 0 0 * * * ? + + index-artifact + update-db-project + validate-repository-metadata + index-archive-toc + update-db-bytecode-stats + index-public-methods + + + not-present-remove-db-artifact + not-present-remove-db-project + not-present-remove-indexed + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-transaction/pom.xml b/MRM-541/archiva-modules/archiva-base/archiva-transaction/pom.xml new file mode 100644 index 000000000..c9655ca90 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-transaction/pom.xml @@ -0,0 +1,53 @@ + + + + 4.0.0 + + org.apache.archiva + archiva-base + 1.2-SNAPSHOT + + archiva-transaction + Archiva Transactions + API for managing transaction. + + + commons-io + commons-io + + + org.codehaus.plexus + plexus-digest + + + org.codehaus.plexus + plexus-spring + test + + + org.codehaus.plexus + plexus-utils + + + org.codehaus.plexus + plexus-component-api + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-transaction/src/main/java/org/apache/maven/archiva/transaction/AbstractTransactionEvent.java b/MRM-541/archiva-modules/archiva-base/archiva-transaction/src/main/java/org/apache/maven/archiva/transaction/AbstractTransactionEvent.java new file mode 100644 index 000000000..cb6d8886b --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-transaction/src/main/java/org/apache/maven/archiva/transaction/AbstractTransactionEvent.java @@ -0,0 +1,234 @@ +package org.apache.maven.archiva.transaction; + +/* + * 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.io.FileUtils; +import org.codehaus.plexus.digest.Digester; +import org.codehaus.plexus.digest.DigesterException; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +/** + * Abstract class for the TransactionEvents + * + * @author Edwin Punzalan + * @author Carlos Sanchez + * @version $Id$ + */ +public abstract class AbstractTransactionEvent + implements TransactionEvent +{ + private Map backups = new HashMap(); + + private List createdDirs = new ArrayList(); + + private List createdFiles = new ArrayList(); + + /** + * {@link List}<{@link Digester}> + */ + private List digesters; + + protected AbstractTransactionEvent() + { + this( new ArrayList( 0 ) ); + } + + protected AbstractTransactionEvent( List digesters ) + { + this.digesters = digesters; + } + + protected List getDigesters() + { + return digesters; + } + + /** + * Method that creates a directory as well as all the parent directories needed + * + * @param dir The File directory to be created + * @throws IOException when an unrecoverable error occurred + */ + protected void mkDirs( File dir ) + throws IOException + { + List createDirs = new ArrayList(); + + File parent = dir; + while ( !parent.exists() || !parent.isDirectory() ) + { + createDirs.add( parent ); + + parent = parent.getParentFile(); + } + + while ( !createDirs.isEmpty() ) + { + File directory = (File) createDirs.remove( createDirs.size() - 1 ); + + if ( directory.mkdir() ) + { + createdDirs.add( directory ); + } + else + { + throw new IOException( "Failed to create directory: " + directory.getAbsolutePath() ); + } + } + } + + protected void revertMkDirs() + throws IOException + { + if ( createdDirs != null ) + { + Collections.reverse( createdDirs ); + + while ( !createdDirs.isEmpty() ) + { + File dir = (File) createdDirs.remove( 0 ); + + if ( dir.isDirectory() && dir.list().length == 0 ) + { + FileUtils.deleteDirectory( dir ); + } + else + { + //cannot rollback created directory if it still contains files + break; + } + } + } + } + + protected void revertFilesCreated() + throws IOException + { + Iterator it = createdFiles.iterator(); + while ( it.hasNext() ) + { + File file = (File) it.next(); + file.delete(); + it.remove(); + } + } + + protected void createBackup( File file ) + throws IOException + { + if ( file.exists() && file.isFile() ) + { + File backup = File.createTempFile( "temp-", ".backup" ); + + FileUtils.copyFile( file, backup ); + + backup.deleteOnExit(); + + backups.put( file, backup ); + } + } + + protected void restoreBackups() + throws IOException + { + Iterator it = backups.entrySet().iterator(); + while ( it.hasNext() ) + { + Map.Entry entry = (Map.Entry) it.next(); + FileUtils.copyFile( (File) entry.getValue(), (File) entry.getKey() ); + } + } + + protected void restoreBackup( File file ) + throws IOException + { + File backup = (File) backups.get( file ); + if ( backup != null ) + { + FileUtils.copyFile( backup, file ); + } + } + + /** + * Create checksums of file using all digesters defined at construction time. + * + * @param file + * @param force whether existing checksums should be overwritten or not + * @throws IOException + */ + protected void createChecksums( File file, boolean force ) + throws IOException + { + Iterator it = getDigesters().iterator(); + while ( it.hasNext() ) + { + Digester digester = (Digester) it.next(); + File checksumFile = new File( file.getAbsolutePath() + "." + getDigesterFileExtension( digester ) ); + if ( checksumFile.exists() ) + { + if ( !force ) + { + continue; + } + createBackup( checksumFile ); + } + else + { + createdFiles.add( checksumFile ); + } + + try + { + writeStringToFile( checksumFile, digester.calc( file ) ); + } + catch ( DigesterException e ) + { + throw (IOException) e.getCause(); + } + } + } + + /** + * TODO: Remove in favor of using FileUtils directly. + */ + protected void writeStringToFile( File file, String content ) + throws IOException + { + FileUtils.writeStringToFile( file, content ); + } + + /** + * File extension for checksums + * TODO should be moved to plexus-digester ? + */ + protected String getDigesterFileExtension( Digester digester ) + { + return digester.getAlgorithm().toLowerCase().replaceAll( "-", "" ); + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-transaction/src/main/java/org/apache/maven/archiva/transaction/CopyFileEvent.java b/MRM-541/archiva-modules/archiva-base/archiva-transaction/src/main/java/org/apache/maven/archiva/transaction/CopyFileEvent.java new file mode 100644 index 000000000..6261e8d8d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-transaction/src/main/java/org/apache/maven/archiva/transaction/CopyFileEvent.java @@ -0,0 +1,119 @@ +package org.apache.maven.archiva.transaction; + +/* + * 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.io.FileUtils; +import org.codehaus.plexus.digest.Digester; + +import java.io.File; +import java.io.IOException; +import java.util.Iterator; +import java.util.List; + +/** + * Event to copy a file. + * + * @author Brett Porter + * @author Carlos Sanchez + * @version $Id$ + */ +public class CopyFileEvent + extends AbstractTransactionEvent +{ + private final File source; + + private final File destination; + + /** + * + * @param source + * @param destination + * @param digesters {@link List}<{@link Digester}> digesters to use for checksumming + */ + public CopyFileEvent( File source, File destination, List digesters ) + { + super( digesters ); + this.source = source; + this.destination = destination; + } + + public void commit() + throws IOException + { + createBackup( destination ); + + mkDirs( destination.getParentFile() ); + + FileUtils.copyFile( source, destination ); + + createChecksums( destination, true ); + copyChecksums(); + + copyChecksum( "asc" ); + } + + /** + * Copy checksums of source file with all digesters if exist + * + * @throws IOException + */ + private void copyChecksums() + throws IOException + { + Iterator it = getDigesters().iterator(); + while ( it.hasNext() ) + { + Digester digester = (Digester) it.next(); + copyChecksum( getDigesterFileExtension( digester ) ); + } + } + + /** + * Copy checksum of source file with extension provided if exists + * + * @param extension + * @return whether the checksum exists or not + * @throws IOException + */ + private boolean copyChecksum( String extension ) + throws IOException + { + File checksumSource = new File( source.getAbsolutePath() + "." + extension ); + if ( checksumSource.exists() ) + { + File checksumDestination = new File( destination.getAbsolutePath() + "." + extension ); + FileUtils.copyFile( checksumSource, checksumDestination ); + return true; + } + return false; + } + + public void rollback() + throws IOException + { + destination.delete(); + + revertFilesCreated(); + + revertMkDirs(); + + restoreBackups(); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-transaction/src/main/java/org/apache/maven/archiva/transaction/CreateFileEvent.java b/MRM-541/archiva-modules/archiva-base/archiva-transaction/src/main/java/org/apache/maven/archiva/transaction/CreateFileEvent.java new file mode 100644 index 000000000..8cf0eb612 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-transaction/src/main/java/org/apache/maven/archiva/transaction/CreateFileEvent.java @@ -0,0 +1,81 @@ +package org.apache.maven.archiva.transaction; + +/* + * 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; +import java.io.IOException; +import java.util.List; + +/** + * Event for creating a file from a string content. + * + * @author Brett Porter + * @author Carlos Sanchez + * @version $Id$ + */ +public class CreateFileEvent + extends AbstractTransactionEvent +{ + private final File destination; + + private final String content; + + /** + * + * @param content + * @param destination + * @param digesters {@link List}<{@link Digester}> digesters to use for checksumming + */ + public CreateFileEvent( String content, File destination, List digesters ) + { + super( digesters ); + this.content = content; + this.destination = destination; + } + + public void commit() + throws IOException + { + createBackup( destination ); + + mkDirs( destination.getParentFile() ); + + if ( !destination.exists() && !destination.createNewFile() ) + { + throw new IOException( "Unable to create new file" ); + } + + writeStringToFile( destination, content ); + + createChecksums( destination, true ); + } + + public void rollback() + throws IOException + { + destination.delete(); + + revertFilesCreated(); + + revertMkDirs(); + + restoreBackups(); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-transaction/src/main/java/org/apache/maven/archiva/transaction/FileTransaction.java b/MRM-541/archiva-modules/archiva-base/archiva-transaction/src/main/java/org/apache/maven/archiva/transaction/FileTransaction.java new file mode 100644 index 000000000..11503fc87 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-transaction/src/main/java/org/apache/maven/archiva/transaction/FileTransaction.java @@ -0,0 +1,100 @@ +package org.apache.maven.archiva.transaction; + +/* + * 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; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +/** + * Implement commit/rollback semantics for a set of files. + * + * @author Brett Porter + */ +public class FileTransaction +{ + private List events = new ArrayList(); + + public void commit() + throws TransactionException + { + List toRollback = new ArrayList( events.size() ); + + for ( Iterator i = events.iterator(); i.hasNext(); ) + { + TransactionEvent event = (TransactionEvent) i.next(); + + try + { + event.commit(); + + toRollback.add( event ); + } + catch ( IOException e ) + { + try + { + rollback( toRollback ); + + throw new TransactionException( "Unable to commit file transaction", e ); + } + catch ( IOException ioe ) + { + throw new TransactionException( + "Unable to commit file transaction, and rollback failed with error: '" + ioe.getMessage() + "'", + e ); + } + } + } + } + + private void rollback( List toRollback ) + throws IOException + { + for ( Iterator i = toRollback.iterator(); i.hasNext(); ) + { + TransactionEvent event = (TransactionEvent) i.next(); + + event.rollback(); + } + } + + /** + * @param source + * @param destination + * @param digesters {@link List}<{@link org.codehaus.plexus.digest.Digester}> digesters to use for checksumming + */ + public void copyFile( File source, File destination, List digesters ) + { + events.add( new CopyFileEvent( source, destination, digesters ) ); + } + + /** + * @param content + * @param destination + * @param digesters {@link List}<{@link org.codehaus.plexus.digest.Digester}> digesters to use for checksumming + */ + public void createFile( String content, File destination, List digesters ) + { + events.add( new CreateFileEvent( content, destination, digesters ) ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-transaction/src/main/java/org/apache/maven/archiva/transaction/TransactionEvent.java b/MRM-541/archiva-modules/archiva-base/archiva-transaction/src/main/java/org/apache/maven/archiva/transaction/TransactionEvent.java new file mode 100644 index 000000000..94d3cb011 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-transaction/src/main/java/org/apache/maven/archiva/transaction/TransactionEvent.java @@ -0,0 +1,46 @@ +package org.apache.maven.archiva.transaction; + +/* + * 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.IOException; + +/** + * Interface for individual events in a transaction. + * + * @author Brett Porter + */ +public interface TransactionEvent +{ + /** + * Commit this event. + * + * @throws IOException if an error occurred committing the change + */ + void commit() + throws IOException; + + /** + * Rollback the even already committed. + * + * @throws IOException if an error occurred reverting the change + */ + void rollback() + throws IOException; +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-transaction/src/main/java/org/apache/maven/archiva/transaction/TransactionException.java b/MRM-541/archiva-modules/archiva-base/archiva-transaction/src/main/java/org/apache/maven/archiva/transaction/TransactionException.java new file mode 100644 index 000000000..6d5f40c75 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-transaction/src/main/java/org/apache/maven/archiva/transaction/TransactionException.java @@ -0,0 +1,51 @@ +package org.apache.maven.archiva.transaction; + +/* + * 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. + */ + +/** + * TransactionException + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class TransactionException + extends Exception +{ + + public TransactionException() + { + } + + public TransactionException( String message ) + { + super( message ); + } + + public TransactionException( Throwable cause ) + { + super( cause ); + } + + public TransactionException( String message, Throwable cause ) + { + super( message, cause ); + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-transaction/src/test/java/org/apache/maven/archiva/transaction/AbstractFileEventTest.java b/MRM-541/archiva-modules/archiva-base/archiva-transaction/src/test/java/org/apache/maven/archiva/transaction/AbstractFileEventTest.java new file mode 100644 index 000000000..5e7064ec2 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-transaction/src/test/java/org/apache/maven/archiva/transaction/AbstractFileEventTest.java @@ -0,0 +1,91 @@ +package org.apache.maven.archiva.transaction; + +/* + * 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.io.FileUtils; +import org.codehaus.plexus.spring.PlexusInSpringTestCase; +import org.codehaus.plexus.spring.PlexusToSpringUtils; +import org.codehaus.plexus.digest.Digester; + +import java.io.File; +import java.io.IOException; +import java.util.List; + +/** + * + * @author Carlos Sanchez + * @version $Id$ + */ +public abstract class AbstractFileEventTest + extends PlexusInSpringTestCase +{ + protected List digesters; + + public void setUp() + throws Exception + { + super.setUp(); + + digesters = PlexusToSpringUtils.lookupList( PlexusToSpringUtils.buildSpringId( Digester.class.getName() ), getApplicationContext() ); + } + + protected void assertChecksumExists( File file, String algorithm ) + { + assertChecksum( file, algorithm, true ); + } + + protected void assertChecksumDoesNotExist( File file, String algorithm ) + { + assertChecksum( file, algorithm, false ); + } + + private void assertChecksum( File file, String algorithm, boolean exist ) + { + String msg = exist ? "exists" : "does not exist"; + File checksumFile = new File( file.getPath() + "." + algorithm ); + assertEquals( "Test file " + algorithm + " checksum " + msg, exist, checksumFile.exists() ); + } + + protected void assertChecksumCommit( File file ) + throws IOException + { + assertChecksumExists( file, "md5" ); + assertChecksumExists( file, "sha1" ); + } + + protected void assertChecksumRollback( File file ) + throws IOException + { + assertChecksumDoesNotExist( file, "md5" ); + assertChecksumDoesNotExist( file, "sha1" ); + } + + protected String readFile( File file ) + throws IOException + { + return FileUtils.readFileToString( file ); + } + + protected void writeFile( File file, String content ) + throws IOException + { + FileUtils.writeStringToFile( file, content ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-transaction/src/test/java/org/apache/maven/archiva/transaction/CopyFileEventTest.java b/MRM-541/archiva-modules/archiva-base/archiva-transaction/src/test/java/org/apache/maven/archiva/transaction/CopyFileEventTest.java new file mode 100644 index 000000000..252375c41 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-transaction/src/test/java/org/apache/maven/archiva/transaction/CopyFileEventTest.java @@ -0,0 +1,179 @@ +package org.apache.maven.archiva.transaction; + +/* + * 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.io.FileUtils; + +import java.io.File; +import java.io.IOException; + +/** + * @author Edwin Punzalan + */ +public class CopyFileEventTest + extends AbstractFileEventTest +{ + private File testDir = new File( getBasedir(), "target/transaction-tests/copy-file" ); + + private File testDest = new File( testDir, "test-file.txt" ); + + private File testSource = new File( getBasedir(), "target/transaction-tests/test-file.txt" ); + + private File testDestChecksum; + + private String source, oldChecksum; + + public void setUp() + throws Exception + { + super.setUp(); + + testSource.getParentFile().mkdirs(); + + testSource.createNewFile(); + + writeFile( testSource, "source contents" ); + + testDestChecksum = new File( testDest.getPath() + ".sha1" ); + + testDestChecksum.getParentFile().mkdirs(); + + testDestChecksum.createNewFile(); + + writeFile( testDestChecksum, "this is the checksum" ); + + assertTrue( "Test if the source exists", testSource.exists() ); + + assertTrue( "Test if the destination checksum exists", testDestChecksum.exists() ); + + source = readFile( testSource ); + + oldChecksum = readFile( testDestChecksum ); + } + + public void testCopyCommitRollback() + throws Exception + { + CopyFileEvent event = new CopyFileEvent( testSource, testDest, digesters ); + + assertFalse( "Test that the destination is not yet created", testDest.exists() ); + + event.commit(); + + assertTrue( "Test that the destination is created", testDest.exists() ); + + assertChecksumCommit( testDest ); + + String target = readFile( testDest ); + + assertTrue( "Test that the destination contents are copied correctly", source.equals( target ) ); + + event.rollback(); + + assertFalse( "Test that the destination file has been deleted", testDest.exists() ); + + assertChecksumRollback( testDest ); + } + + public void testCopyCommitRollbackWithBackup() + throws Exception + { + testDest.getParentFile().mkdirs(); + + testDest.createNewFile(); + + writeFile( testDest, "overwritten contents" ); + + assertTrue( "Test that the destination exists", testDest.exists() ); + + CopyFileEvent event = new CopyFileEvent( testSource, testDest, digesters ); + + String target = readFile( testDest ); + + assertTrue( "Test that the destination contents have not changed", target.equals( "overwritten contents" ) ); + + event.commit(); + + target = readFile( testDest ); + + assertTrue( "Test that the destination contents are copied correctly", source.equals( target ) ); + + assertChecksumCommit( testDest ); + + event.rollback(); + + target = readFile( testDest ); + + assertTrue( "Test the destination file contents have been restored", target.equals( "overwritten contents" ) ); + + assertChecksumRollback( testDest ); + } + + public void testCreateRollbackCommit() + throws Exception + { + CopyFileEvent event = new CopyFileEvent( testSource, testDest, digesters ); + + assertFalse( "Test that the destination is not yet created", testDest.exists() ); + + event.rollback(); + + assertFalse( "Test that the destination file is not yet created", testDest.exists() ); + + event.commit(); + + assertTrue( "Test that the destination is created", testDest.exists() ); + + assertChecksumCommit( testDest ); + + String target = readFile( testDest ); + + assertTrue( "Test that the destination contents are copied correctly", source.equals( target ) ); + } + + protected void tearDown() + throws Exception + { + super.tearDown(); + + FileUtils.deleteDirectory( new File( getBasedir(), "target/transaction-tests" ) ); + } + + protected void assertChecksumCommit( File file ) + throws IOException + { + super.assertChecksumCommit( file ); + + String target = readFile( testDestChecksum ); + + assertFalse( "Test that the destination checksum contents are created correctly", oldChecksum.equals( target ) ); + } + + protected void assertChecksumRollback( File file ) + throws IOException + { + assertChecksumDoesNotExist( file, "md5" ); + assertChecksumExists( file, "sha1" ); + + String target = readFile( testDestChecksum ); + + assertEquals( "Test that the destination checksum contents are reverted correctly", oldChecksum, target ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-transaction/src/test/java/org/apache/maven/archiva/transaction/CreateFileEventTest.java b/MRM-541/archiva-modules/archiva-base/archiva-transaction/src/test/java/org/apache/maven/archiva/transaction/CreateFileEventTest.java new file mode 100644 index 000000000..a212a0ee2 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-transaction/src/test/java/org/apache/maven/archiva/transaction/CreateFileEventTest.java @@ -0,0 +1,120 @@ +package org.apache.maven.archiva.transaction; + +/* + * 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; + +import org.apache.commons.io.FileUtils; + +/** + * @author Edwin Punzalan + */ +public class CreateFileEventTest + extends AbstractFileEventTest +{ + private File testDir = new File( getBasedir(), "target/transaction-tests/create-file" ); + + public void testCreateCommitRollback() + throws Exception + { + File testFile = new File( testDir, "test-file.txt" ); + + CreateFileEvent event = new CreateFileEvent( "file contents", testFile, digesters ); + + assertFalse( "Test file is not yet created", testFile.exists() ); + + event.commit(); + + assertTrue( "Test file has been created", testFile.exists() ); + + assertChecksumCommit( testFile ); + + event.rollback(); + + assertFalse( "Test file is has been deleted after rollback", testFile.exists() ); + + assertChecksumRollback( testFile ); + + assertFalse( "Test file parent directories has been rolledback too", testDir.exists() ); + assertTrue( "target directory still exists", new File( getBasedir(), "target" ).exists() ); + } + + public void testCreateCommitRollbackWithBackup() + throws Exception + { + File testFile = new File( testDir, "test-file.txt" ); + + testFile.getParentFile().mkdirs(); + + testFile.createNewFile(); + + writeFile( testFile, "original contents" ); + + CreateFileEvent event = new CreateFileEvent( "modified contents", testFile, digesters ); + + String contents = readFile( testFile ); + + assertEquals( "Test contents have not changed", "original contents", contents ); + + event.commit(); + + contents = readFile( testFile ); + + assertEquals( "Test contents have not changed", "modified contents", contents ); + + assertChecksumCommit( testFile ); + + event.rollback(); + + contents = readFile( testFile ); + + assertEquals( "Test contents have not changed", "original contents", contents ); + + assertChecksumRollback( testFile ); + } + + public void testCreateRollbackCommit() + throws Exception + { + File testFile = new File( testDir, "test-file.txt" ); + + CreateFileEvent event = new CreateFileEvent( "file contents", testFile, digesters ); + + assertFalse( "Test file is not yet created", testFile.exists() ); + + event.rollback(); + + assertFalse( "Test file is not yet created", testFile.exists() ); + + event.commit(); + + assertTrue( "Test file is not yet created", testFile.exists() ); + + assertChecksumCommit( testFile ); + } + + protected void tearDown() + throws Exception + { + super.tearDown(); + + FileUtils.deleteDirectory( new File( getBasedir(), "target/transaction-tests" ) ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-xml-tools/pom.xml b/MRM-541/archiva-modules/archiva-base/archiva-xml-tools/pom.xml new file mode 100644 index 000000000..80177618d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-xml-tools/pom.xml @@ -0,0 +1,80 @@ + + + + + + org.apache.archiva + archiva-base + 1.2-SNAPSHOT + + 4.0.0 + archiva-xml-tools + Archiva Base :: XML Tools + + + org.apache.archiva + archiva-common + + + commons-collections + commons-collections + + + commons-io + commons-io + + + dom4j + dom4j + + + jaxen + jaxen + + + org.codehaus.plexus + plexus-utils + + + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-xml-tools/src/main/java/org/apache/maven/archiva/xml/ElementTextListClosure.java b/MRM-541/archiva-modules/archiva-base/archiva-xml-tools/src/main/java/org/apache/maven/archiva/xml/ElementTextListClosure.java new file mode 100644 index 000000000..e827bfa34 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-xml-tools/src/main/java/org/apache/maven/archiva/xml/ElementTextListClosure.java @@ -0,0 +1,52 @@ +package org.apache.maven.archiva.xml; + +/* + * 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.collections.Closure; +import org.dom4j.Element; + +import java.util.ArrayList; +import java.util.List; + +/** + * Gather the text from a collection of {@link Element}'s into a {@link List} + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ElementTextListClosure + implements Closure +{ + private List list = new ArrayList(); + + public void execute( Object input ) + { + if ( input instanceof Element ) + { + Element elem = (Element) input; + list.add( elem.getTextTrim() ); + } + } + + public List getList() + { + return list; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-xml-tools/src/main/java/org/apache/maven/archiva/xml/LatinEntities.java b/MRM-541/archiva-modules/archiva-base/archiva-xml-tools/src/main/java/org/apache/maven/archiva/xml/LatinEntities.java new file mode 100644 index 000000000..46622b455 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-xml-tools/src/main/java/org/apache/maven/archiva/xml/LatinEntities.java @@ -0,0 +1,327 @@ +package org.apache.maven.archiva.xml; + +/* + * 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.HashMap; +import java.util.Map; + +/** + * LatinEntities - simple utility class to handle latin entity conversion. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class LatinEntities +{ + private static final Map defaultEntityMap; + + static + { + defaultEntityMap = new HashMap(); + + defaultEntityMap.put( "nbsp", "\u00a0" ); + defaultEntityMap.put( "iexcl", "\u00a1" ); + defaultEntityMap.put( "cent", "\u00a2" ); + defaultEntityMap.put( "pound", "\u00a3" ); + defaultEntityMap.put( "curren", "\u00a4" ); + defaultEntityMap.put( "yen", "\u00a5" ); + defaultEntityMap.put( "brvbar", "\u00a6" ); + defaultEntityMap.put( "sect", "\u00a7" ); + defaultEntityMap.put( "uml", "\u00a8" ); + defaultEntityMap.put( "copy", "\u00a9" ); + defaultEntityMap.put( "ordf", "\u00aa" ); + defaultEntityMap.put( "laquo", "\u00ab" ); + defaultEntityMap.put( "not", "\u00ac" ); + defaultEntityMap.put( "shy", "\u00ad" ); + defaultEntityMap.put( "reg", "\u00ae" ); + defaultEntityMap.put( "macr", "\u00af" ); + defaultEntityMap.put( "deg", "\u00b0" ); + defaultEntityMap.put( "plusmn", "\u00b1" ); + defaultEntityMap.put( "sup2", "\u00b2" ); + defaultEntityMap.put( "sup3", "\u00b3" ); + defaultEntityMap.put( "acute", "\u00b4" ); + defaultEntityMap.put( "micro", "\u00b5" ); + defaultEntityMap.put( "para", "\u00b6" ); + defaultEntityMap.put( "middot", "\u00b7" ); + defaultEntityMap.put( "cedil", "\u00b8" ); + defaultEntityMap.put( "sup1", "\u00b9" ); + defaultEntityMap.put( "ordm", "\u00ba" ); + defaultEntityMap.put( "raquo", "\u00bb" ); + defaultEntityMap.put( "frac14", "\u00bc" ); + defaultEntityMap.put( "frac12", "\u00bd" ); + defaultEntityMap.put( "frac34", "\u00be" ); + defaultEntityMap.put( "iquest", "\u00bf" ); + defaultEntityMap.put( "Agrave", "\u00c0" ); + defaultEntityMap.put( "Aacute", "\u00c1" ); + defaultEntityMap.put( "Acirc", "\u00c2" ); + defaultEntityMap.put( "Atilde", "\u00c3" ); + defaultEntityMap.put( "Auml", "\u00c4" ); + defaultEntityMap.put( "Aring", "\u00c5" ); + defaultEntityMap.put( "AElig", "\u00c6" ); + defaultEntityMap.put( "Ccedil", "\u00c7" ); + defaultEntityMap.put( "Egrave", "\u00c8" ); + defaultEntityMap.put( "Eacute", "\u00c9" ); + defaultEntityMap.put( "Ecirc", "\u00ca" ); + defaultEntityMap.put( "Euml", "\u00cb" ); + defaultEntityMap.put( "Igrave", "\u00cc" ); + defaultEntityMap.put( "Iacute", "\u00cd" ); + defaultEntityMap.put( "Icirc", "\u00ce" ); + defaultEntityMap.put( "Iuml", "\u00cf" ); + defaultEntityMap.put( "ETH", "\u00d0" ); + defaultEntityMap.put( "Ntilde", "\u00d1" ); + defaultEntityMap.put( "Ograve", "\u00d2" ); + defaultEntityMap.put( "Oacute", "\u00d3" ); + defaultEntityMap.put( "Ocirc", "\u00d4" ); + defaultEntityMap.put( "Otilde", "\u00d5" ); + defaultEntityMap.put( "Ouml", "\u00d6" ); + defaultEntityMap.put( "times", "\u00d7" ); + defaultEntityMap.put( "Oslash", "\u00d8" ); + defaultEntityMap.put( "Ugrave", "\u00d9" ); + defaultEntityMap.put( "Uacute", "\u00da" ); + defaultEntityMap.put( "Ucirc", "\u00db" ); + defaultEntityMap.put( "Uuml", "\u00dc" ); + defaultEntityMap.put( "Yacute", "\u00dd" ); + defaultEntityMap.put( "THORN", "\u00de" ); + defaultEntityMap.put( "szlig", "\u00df" ); + defaultEntityMap.put( "agrave", "\u00e0" ); + defaultEntityMap.put( "aacute", "\u00e1" ); + defaultEntityMap.put( "acirc", "\u00e2" ); + defaultEntityMap.put( "atilde", "\u00e3" ); + defaultEntityMap.put( "auml", "\u00e4" ); + defaultEntityMap.put( "aring", "\u00e5" ); + defaultEntityMap.put( "aelig", "\u00e6" ); + defaultEntityMap.put( "ccedil", "\u00e7" ); + defaultEntityMap.put( "egrave", "\u00e8" ); + defaultEntityMap.put( "eacute", "\u00e9" ); + defaultEntityMap.put( "ecirc", "\u00ea" ); + defaultEntityMap.put( "euml", "\u00eb" ); + defaultEntityMap.put( "igrave", "\u00ec" ); + defaultEntityMap.put( "iacute", "\u00ed" ); + defaultEntityMap.put( "icirc", "\u00ee" ); + defaultEntityMap.put( "iuml", "\u00ef" ); + defaultEntityMap.put( "eth", "\u00f0" ); + defaultEntityMap.put( "ntilde", "\u00f1" ); + defaultEntityMap.put( "ograve", "\u00f2" ); + defaultEntityMap.put( "oacute", "\u00f3" ); + defaultEntityMap.put( "ocirc", "\u00f4" ); + defaultEntityMap.put( "otilde", "\u00f5" ); + defaultEntityMap.put( "ouml", "\u00f6" ); + defaultEntityMap.put( "divide", "\u00f7" ); + defaultEntityMap.put( "oslash", "\u00f8" ); + defaultEntityMap.put( "ugrave", "\u00f9" ); + defaultEntityMap.put( "uacute", "\u00fa" ); + defaultEntityMap.put( "ucirc", "\u00fb" ); + defaultEntityMap.put( "uuml", "\u00fc" ); + defaultEntityMap.put( "yacute", "\u00fd" ); + defaultEntityMap.put( "thorn", "\u00fe" ); + defaultEntityMap.put( "yuml", "\u00ff" ); + + // ---------------------------------------------------------------------- + // Special entities + // ---------------------------------------------------------------------- + + defaultEntityMap.put( "OElig", "\u0152" ); + defaultEntityMap.put( "oelig", "\u0153" ); + defaultEntityMap.put( "Scaron", "\u0160" ); + defaultEntityMap.put( "scaron", "\u0161" ); + defaultEntityMap.put( "Yuml", "\u0178" ); + defaultEntityMap.put( "circ", "\u02c6" ); + defaultEntityMap.put( "tilde", "\u02dc" ); + defaultEntityMap.put( "ensp", "\u2002" ); + defaultEntityMap.put( "emsp", "\u2003" ); + defaultEntityMap.put( "thinsp", "\u2009" ); + defaultEntityMap.put( "zwnj", "\u200c" ); + defaultEntityMap.put( "zwj", "\u200d" ); + defaultEntityMap.put( "lrm", "\u200e" ); + defaultEntityMap.put( "rlm", "\u200f" ); + defaultEntityMap.put( "ndash", "\u2013" ); + defaultEntityMap.put( "mdash", "\u2014" ); + defaultEntityMap.put( "lsquo", "\u2018" ); + defaultEntityMap.put( "rsquo", "\u2019" ); + defaultEntityMap.put( "sbquo", "\u201a" ); + defaultEntityMap.put( "ldquo", "\u201c" ); + defaultEntityMap.put( "rdquo", "\u201d" ); + defaultEntityMap.put( "bdquo", "\u201e" ); + defaultEntityMap.put( "dagger", "\u2020" ); + defaultEntityMap.put( "Dagger", "\u2021" ); + defaultEntityMap.put( "permil", "\u2030" ); + defaultEntityMap.put( "lsaquo", "\u2039" ); + defaultEntityMap.put( "rsaquo", "\u203a" ); + defaultEntityMap.put( "euro", "\u20ac" ); + + // ---------------------------------------------------------------------- + // Symbol entities + // ---------------------------------------------------------------------- + + defaultEntityMap.put( "fnof", "\u0192" ); + defaultEntityMap.put( "Alpha", "\u0391" ); + defaultEntityMap.put( "Beta", "\u0392" ); + defaultEntityMap.put( "Gamma", "\u0393" ); + defaultEntityMap.put( "Delta", "\u0394" ); + defaultEntityMap.put( "Epsilon", "\u0395" ); + defaultEntityMap.put( "Zeta", "\u0396" ); + defaultEntityMap.put( "Eta", "\u0397" ); + defaultEntityMap.put( "Theta", "\u0398" ); + defaultEntityMap.put( "Iota", "\u0399" ); + defaultEntityMap.put( "Kappa", "\u039a" ); + defaultEntityMap.put( "Lambda", "\u039b" ); + defaultEntityMap.put( "Mu", "\u039c" ); + defaultEntityMap.put( "Nu", "\u039d" ); + defaultEntityMap.put( "Xi", "\u039e" ); + defaultEntityMap.put( "Omicron", "\u039f" ); + defaultEntityMap.put( "Pi", "\u03a0" ); + defaultEntityMap.put( "Rho", "\u03a1" ); + defaultEntityMap.put( "Sigma", "\u03a3" ); + defaultEntityMap.put( "Tau", "\u03a4" ); + defaultEntityMap.put( "Upsilon", "\u03a5" ); + defaultEntityMap.put( "Phi", "\u03a6" ); + defaultEntityMap.put( "Chi", "\u03a7" ); + defaultEntityMap.put( "Psi", "\u03a8" ); + defaultEntityMap.put( "Omega", "\u03a9" ); + defaultEntityMap.put( "alpha", "\u03b1" ); + defaultEntityMap.put( "beta", "\u03b2" ); + defaultEntityMap.put( "gamma", "\u03b3" ); + defaultEntityMap.put( "delta", "\u03b4" ); + defaultEntityMap.put( "epsilon", "\u03b5" ); + defaultEntityMap.put( "zeta", "\u03b6" ); + defaultEntityMap.put( "eta", "\u03b7" ); + defaultEntityMap.put( "theta", "\u03b8" ); + defaultEntityMap.put( "iota", "\u03b9" ); + defaultEntityMap.put( "kappa", "\u03ba" ); + defaultEntityMap.put( "lambda", "\u03bb" ); + defaultEntityMap.put( "mu", "\u03bc" ); + defaultEntityMap.put( "nu", "\u03bd" ); + defaultEntityMap.put( "xi", "\u03be" ); + defaultEntityMap.put( "omicron", "\u03bf" ); + defaultEntityMap.put( "pi", "\u03c0" ); + defaultEntityMap.put( "rho", "\u03c1" ); + defaultEntityMap.put( "sigmaf", "\u03c2" ); + defaultEntityMap.put( "sigma", "\u03c3" ); + defaultEntityMap.put( "tau", "\u03c4" ); + defaultEntityMap.put( "upsilon", "\u03c5" ); + defaultEntityMap.put( "phi", "\u03c6" ); + defaultEntityMap.put( "chi", "\u03c7" ); + defaultEntityMap.put( "psi", "\u03c8" ); + defaultEntityMap.put( "omega", "\u03c9" ); + defaultEntityMap.put( "thetasym", "\u03d1" ); + defaultEntityMap.put( "upsih", "\u03d2" ); + defaultEntityMap.put( "piv", "\u03d6" ); + defaultEntityMap.put( "bull", "\u2022" ); + defaultEntityMap.put( "hellip", "\u2026" ); + defaultEntityMap.put( "prime", "\u2032" ); + defaultEntityMap.put( "Prime", "\u2033" ); + defaultEntityMap.put( "oline", "\u203e" ); + defaultEntityMap.put( "frasl", "\u2044" ); + defaultEntityMap.put( "weierp", "\u2118" ); + defaultEntityMap.put( "image", "\u2111" ); + defaultEntityMap.put( "real", "\u211c" ); + defaultEntityMap.put( "trade", "\u2122" ); + defaultEntityMap.put( "alefsym", "\u2135" ); + defaultEntityMap.put( "larr", "\u2190" ); + defaultEntityMap.put( "uarr", "\u2191" ); + defaultEntityMap.put( "rarr", "\u2192" ); + defaultEntityMap.put( "darr", "\u2193" ); + defaultEntityMap.put( "harr", "\u2194" ); + defaultEntityMap.put( "crarr", "\u21b5" ); + defaultEntityMap.put( "lArr", "\u21d0" ); + defaultEntityMap.put( "uArr", "\u21d1" ); + defaultEntityMap.put( "rArr", "\u21d2" ); + defaultEntityMap.put( "dArr", "\u21d3" ); + defaultEntityMap.put( "hArr", "\u21d4" ); + defaultEntityMap.put( "forall", "\u2200" ); + defaultEntityMap.put( "part", "\u2202" ); + defaultEntityMap.put( "exist", "\u2203" ); + defaultEntityMap.put( "empty", "\u2205" ); + defaultEntityMap.put( "nabla", "\u2207" ); + defaultEntityMap.put( "isin", "\u2208" ); + defaultEntityMap.put( "notin", "\u2209" ); + defaultEntityMap.put( "ni", "\u220b" ); + defaultEntityMap.put( "prod", "\u220f" ); + defaultEntityMap.put( "sum", "\u2211" ); + defaultEntityMap.put( "minus", "\u2212" ); + defaultEntityMap.put( "lowast", "\u2217" ); + defaultEntityMap.put( "radic", "\u221a" ); + defaultEntityMap.put( "prop", "\u221d" ); + defaultEntityMap.put( "infin", "\u221e" ); + defaultEntityMap.put( "ang", "\u2220" ); + defaultEntityMap.put( "and", "\u2227" ); + defaultEntityMap.put( "or", "\u2228" ); + defaultEntityMap.put( "cap", "\u2229" ); + defaultEntityMap.put( "cup", "\u222a" ); + defaultEntityMap.put( "int", "\u222b" ); + defaultEntityMap.put( "there4", "\u2234" ); + defaultEntityMap.put( "sim", "\u223c" ); + defaultEntityMap.put( "cong", "\u2245" ); + defaultEntityMap.put( "asymp", "\u2248" ); + defaultEntityMap.put( "ne", "\u2260" ); + defaultEntityMap.put( "equiv", "\u2261" ); + defaultEntityMap.put( "le", "\u2264" ); + defaultEntityMap.put( "ge", "\u2265" ); + defaultEntityMap.put( "sub", "\u2282" ); + defaultEntityMap.put( "sup", "\u2283" ); + defaultEntityMap.put( "nsub", "\u2284" ); + defaultEntityMap.put( "sube", "\u2286" ); + defaultEntityMap.put( "supe", "\u2287" ); + defaultEntityMap.put( "oplus", "\u2295" ); + defaultEntityMap.put( "otimes", "\u2297" ); + defaultEntityMap.put( "perp", "\u22a5" ); + defaultEntityMap.put( "sdot", "\u22c5" ); + defaultEntityMap.put( "lceil", "\u2308" ); + defaultEntityMap.put( "rceil", "\u2309" ); + defaultEntityMap.put( "lfloor", "\u230a" ); + defaultEntityMap.put( "rfloor", "\u230b" ); + defaultEntityMap.put( "lang", "\u2329" ); + defaultEntityMap.put( "rang", "\u232a" ); + defaultEntityMap.put( "loz", "\u25ca" ); + defaultEntityMap.put( "spades", "\u2660" ); + defaultEntityMap.put( "clubs", "\u2663" ); + defaultEntityMap.put( "hearts", "\u2665" ); + defaultEntityMap.put( "diams", "\u2666" ); + } + + public static String resolveEntity( String entity ) + { + if ( entity == null ) + { + // Invalid. null. + return entity; + } + + if ( entity.trim().length() <= 0 ) + { + // Invalid. empty. + return entity; + } + + if ( !( entity.charAt( 0 ) == '&' ) && ( entity.charAt( entity.length() ) == ';' ) ) + { + // Invalid, not an entity. + return entity; + } + + String result = (String) defaultEntityMap.get( entity.substring( 1, entity.length() - 1 ) ); + if ( result == null ) + { + return entity; + } + + return result; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-xml-tools/src/main/java/org/apache/maven/archiva/xml/LatinEntityResolutionReader.java b/MRM-541/archiva-modules/archiva-base/archiva-xml-tools/src/main/java/org/apache/maven/archiva/xml/LatinEntityResolutionReader.java new file mode 100644 index 000000000..1146ae7fb --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-xml-tools/src/main/java/org/apache/maven/archiva/xml/LatinEntityResolutionReader.java @@ -0,0 +1,190 @@ +package org.apache.maven.archiva.xml; + +/* + * 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.BufferedReader; +import java.io.IOException; +import java.io.Reader; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * LatinEntityResolutionReader - Read a Character Stream. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class LatinEntityResolutionReader + extends Reader +{ + private BufferedReader originalReader; + + private char leftover[]; + + private Pattern entityPattern; + + public LatinEntityResolutionReader( Reader reader ) + { + this.originalReader = new BufferedReader( reader ); + this.entityPattern = Pattern.compile( "\\&[a-zA-Z]+\\;" ); + } + + /** + * Read characters into a portion of an array. This method will block until some input is available, + * an I/O error occurs, or the end of the stream is reached. + * + * @param destbuf Destination buffer + * @param offset Offset (in destination buffer) at which to start storing characters + * @param length Maximum number of characters to read + * @return The number of characters read, or -1 if the end of the stream has been reached + * @throws IOException if an I/O error occurs. + */ + public int read( char[] destbuf, int offset, int length ) + throws IOException + { + int tmp_length; + int current_requested_offset = offset; + int current_requested_length = length; + + // Drain leftover from last read request. + if ( leftover != null ) + { + if ( leftover.length > length ) + { + // Copy partial leftover. + System.arraycopy( leftover, 0, destbuf, current_requested_offset, length ); + + // Create new leftover of remaining. + char tmp[] = new char[length]; + System.arraycopy( leftover, length, tmp, 0, length ); + leftover = new char[tmp.length]; + System.arraycopy( tmp, 0, leftover, 0, length ); + + // Return len + return length; + } + else + { + tmp_length = leftover.length; + + // Copy full leftover + System.arraycopy( leftover, 0, destbuf, current_requested_offset, tmp_length ); + + // Empty out leftover (as there is now none left) + leftover = null; + + // Adjust offset and lengths. + current_requested_offset += tmp_length; + current_requested_length -= tmp_length; + } + } + + StringBuffer sbuf = getExpandedBuffer( current_requested_length ); + + // Have we reached the end of the buffer? + if ( sbuf == null ) + { + // Do we have content? + if ( current_requested_offset > offset ) + { + // Signal that we do, by calculating length. + return ( current_requested_offset - offset ); + } + + // No content. signal end of buffer. + return -1; + } + + // Copy from expanded buf whatever length we can accomodate. + tmp_length = Math.min( sbuf.length(), current_requested_length ); + sbuf.getChars( 0, tmp_length, destbuf, current_requested_offset ); + + // Create the leftover (if any) + if ( tmp_length < sbuf.length() ) + { + leftover = new char[sbuf.length() - tmp_length]; + sbuf.getChars( tmp_length, tmp_length + leftover.length, leftover, 0 ); + } + + // Calculate Actual Length and return. + return ( current_requested_offset - offset ) + tmp_length; + } + + private StringBuffer getExpandedBuffer( int minimum_length ) + throws IOException + { + StringBuffer buf = null; + String line = this.originalReader.readLine(); + boolean done = ( line == null ); + + while ( !done ) + { + if ( buf == null ) + { + buf = new StringBuffer(); + } + + buf.append( expandLine( line ) ); + + // Add newline only if there is more data. + if ( this.originalReader.ready() ) + { + buf.append( "\n" ); + } + + if ( buf.length() > minimum_length ) + { + done = true; + } + else + { + line = this.originalReader.readLine(); + done = ( line == null ); + } + } + + return buf; + } + + private String expandLine( String line ) + { + StringBuffer ret = new StringBuffer(); + + int offset = 0; + String entity; + Matcher mat = this.entityPattern.matcher( line ); + while ( mat.find( offset ) ) + { + ret.append( line.substring( offset, mat.start() ) ); + entity = mat.group(); + ret.append( LatinEntities.resolveEntity( entity ) ); + offset = mat.start() + entity.length(); + } + ret.append( line.substring( offset ) ); + + return ret.toString(); + } + + public void close() + throws IOException + { + this.originalReader.close(); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-xml-tools/src/main/java/org/apache/maven/archiva/xml/XMLException.java b/MRM-541/archiva-modules/archiva-base/archiva-xml-tools/src/main/java/org/apache/maven/archiva/xml/XMLException.java new file mode 100644 index 000000000..1c450cf32 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-xml-tools/src/main/java/org/apache/maven/archiva/xml/XMLException.java @@ -0,0 +1,41 @@ +package org.apache.maven.archiva.xml; + +/* + * 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.archiva.common.ArchivaException; + +/** + * XMLException + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class XMLException extends ArchivaException +{ + public XMLException( String message, Throwable cause ) + { + super( message, cause ); + } + + public XMLException( String message ) + { + super( message ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-xml-tools/src/main/java/org/apache/maven/archiva/xml/XMLReader.java b/MRM-541/archiva-modules/archiva-base/archiva-xml-tools/src/main/java/org/apache/maven/archiva/xml/XMLReader.java new file mode 100644 index 000000000..f597499e8 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-xml-tools/src/main/java/org/apache/maven/archiva/xml/XMLReader.java @@ -0,0 +1,331 @@ +package org.apache.maven.archiva.xml; + +/* + * 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.io.IOUtils; +import org.apache.commons.lang.StringUtils; +import org.dom4j.Attribute; +import org.dom4j.Document; +import org.dom4j.DocumentException; +import org.dom4j.Element; +import org.dom4j.Namespace; +import org.dom4j.Node; +import org.dom4j.QName; +import org.dom4j.XPath; +import org.dom4j.io.SAXReader; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +/** + * XMLReader - a set of common xml utility methods for reading content out of an xml file. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class XMLReader +{ + private URL xmlUrl; + + private String documentType; + + private Document document; + + private Map namespaceMap = new HashMap(); + + public XMLReader( String type, File file ) + throws XMLException + { + if ( !file.exists() ) + { + throw new XMLException( "file does not exist: " + file.getAbsolutePath() ); + } + + if ( !file.isFile() ) + { + throw new XMLException( "path is not a file: " + file.getAbsolutePath() ); + } + + if ( !file.canRead() ) + { + throw new XMLException( "Cannot read xml file due to permissions: " + file.getAbsolutePath() ); + } + + try + { + init( type, file.toURL() ); + } + catch ( MalformedURLException e ) + { + throw new XMLException( "Unable to translate file " + file + " to URL: " + e.getMessage(), e ); + } + } + + public XMLReader( String type, URL url ) + throws XMLException + { + init( type, url ); + } + + private void init( String type, URL url ) + throws XMLException + { + this.documentType = type; + this.xmlUrl = url; + + InputStream in = null; + SAXReader reader = new SAXReader(); + + try + { + in = url.openStream(); + InputStreamReader inReader = new InputStreamReader( in, "UTF-8" ); + LatinEntityResolutionReader latinReader = new LatinEntityResolutionReader( inReader ); + this.document = reader.read( latinReader ); + } + catch ( DocumentException e ) + { + throw new XMLException( "Unable to parse " + documentType + " xml " + xmlUrl + ": " + e.getMessage(), e ); + } + catch ( IOException e ) + { + throw new XMLException( "Unable to open stream to " + url + ": " + e.getMessage(), e ); + } + finally + { + IOUtils.closeQuietly( in ); + } + + Element root = this.document.getRootElement(); + if ( root == null ) + { + throw new XMLException( "Invalid " + documentType + " xml: root element is null." ); + } + + if ( !StringUtils.equals( root.getName(), documentType ) ) + { + throw new XMLException( "Invalid " + documentType + " xml: Unexpected root element <" + root.getName() + + ">, expected <" + documentType + ">" ); + } + } + + public String getDefaultNamespaceURI() + { + Namespace namespace = this.document.getRootElement().getNamespace(); + return namespace.getURI(); + } + + public void addNamespaceMapping( String elementName, String uri ) + { + this.namespaceMap.put( elementName, uri ); + } + + public Element getElement( String xpathExpr ) + throws XMLException + { + XPath xpath = createXPath( xpathExpr ); + Object evaluated = xpath.selectSingleNode( document ); + + if ( evaluated == null ) + { + return null; + } + + if ( evaluated instanceof Element ) + { + Element evalElem = (Element) evaluated; + return evalElem; + } + else + { + // Unknown evaluated type. + throw new XMLException( ".getElement( Expr: " + xpathExpr + " ) resulted in non-Element type -> (" + + evaluated.getClass().getName() + ") " + evaluated ); + } + } + + private XPath createXPath( String xpathExpr ) + { + XPath xpath = document.createXPath( xpathExpr ); + if ( !this.namespaceMap.isEmpty() ) + { + xpath.setNamespaceURIs( this.namespaceMap ); + } + return xpath; + } + + public boolean hasElement( String xpathExpr ) + throws XMLException + { + XPath xpath = createXPath( xpathExpr ); + Object evaluated = xpath.selectSingleNode( document ); + + if ( evaluated == null ) + { + return false; + } + + return true; + } + + /** + * Remove namespaces from entire document. + */ + public void removeNamespaces() + { + removeNamespaces( this.document.getRootElement() ); + } + + /** + * Remove namespaces from element recursively. + */ + public void removeNamespaces( Element elem ) + { + elem.setQName( QName.get( elem.getName(), Namespace.NO_NAMESPACE, elem.getQualifiedName() ) ); + + Node n; + + Iterator it = elem.elementIterator(); + while ( it.hasNext() ) + { + n = it.next(); + + switch ( n.getNodeType() ) + { + case Node.ATTRIBUTE_NODE: + ( (Attribute) n ).setNamespace( Namespace.NO_NAMESPACE ); + break; + case Node.ELEMENT_NODE: + removeNamespaces( (Element) n ); + break; + } + } + } + + public String getElementText( Node context, String xpathExpr ) + throws XMLException + { + XPath xpath = createXPath( xpathExpr ); + Object evaluated = xpath.selectSingleNode( context ); + + if ( evaluated == null ) + { + return null; + } + + if ( evaluated instanceof Element ) + { + Element evalElem = (Element) evaluated; + return evalElem.getTextTrim(); + } + else + { + // Unknown evaluated type. + throw new XMLException( ".getElementText( Node, Expr: " + xpathExpr + + " ) resulted in non-Element type -> (" + evaluated.getClass().getName() + ") " + evaluated ); + } + } + + public String getElementText( String xpathExpr ) + throws XMLException + { + XPath xpath = createXPath( xpathExpr ); + Object evaluated = xpath.selectSingleNode( document ); + + if ( evaluated == null ) + { + return null; + } + + if ( evaluated instanceof Element ) + { + Element evalElem = (Element) evaluated; + return evalElem.getTextTrim(); + } + else + { + // Unknown evaluated type. + throw new XMLException( ".getElementText( Expr: " + xpathExpr + " ) resulted in non-Element type -> (" + + evaluated.getClass().getName() + ") " + evaluated ); + } + } + + public List getElementList( String xpathExpr ) + throws XMLException + { + XPath xpath = createXPath( xpathExpr ); + Object evaluated = xpath.evaluate( document ); + + if ( evaluated == null ) + { + return null; + } + + /* The xpath.evaluate(Context) method can return: + * 1) A Collection or List of dom4j Nodes. + * 2) A single dom4j Node. + */ + + if ( evaluated instanceof List ) + { + return (List) evaluated; + } + else if ( evaluated instanceof Node ) + { + List ret = new ArrayList(); + ret.add( (Element) evaluated ); + return ret; + } + else + { + // Unknown evaluated type. + throw new XMLException( ".getElementList( Expr: " + xpathExpr + " ) resulted in non-List type -> (" + + evaluated.getClass().getName() + ") " + evaluated ); + } + } + + public List getElementListText( String xpathExpr ) + throws XMLException + { + List elemList = getElementList( xpathExpr ); + if ( elemList == null ) + { + return null; + } + + List ret = new ArrayList(); + for ( Iterator iter = elemList.iterator(); iter.hasNext(); ) + { + Element listelem = iter.next(); + ret.add( listelem.getTextTrim() ); + } + return ret; + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-xml-tools/src/main/java/org/apache/maven/archiva/xml/XMLWriter.java b/MRM-541/archiva-modules/archiva-base/archiva-xml-tools/src/main/java/org/apache/maven/archiva/xml/XMLWriter.java new file mode 100644 index 000000000..9af8c2b94 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-xml-tools/src/main/java/org/apache/maven/archiva/xml/XMLWriter.java @@ -0,0 +1,88 @@ +package org.apache.maven.archiva.xml; + +/* + * 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.dom4j.Document; +import org.dom4j.io.OutputFormat; + +import java.io.IOException; +import java.io.Writer; + +/** + * XMLWriter - Making writing XML files easier. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class XMLWriter +{ + /** + * Write the Document to the provided Writer, leaving the Writer open. + * + * @param doc the document to write. + * @param writer the writer to write to. + * @throws XMLException if there was a problem writing the xml to the writer. + */ + public static void write( Document doc, Writer writer ) + throws XMLException + { + write( doc, writer, false ); + } + + /** + * Write the Document to the provided Writer, with an option to close the writer upon completion. + * + * @param doc the document to write. + * @param writer the writer to write to. + * @param close true to close the writer on completion. + * @throws XMLException if there was a problem writing the xml to the writer. + */ + public static void write( Document doc, Writer writer, boolean close ) + throws XMLException + { + org.dom4j.io.XMLWriter xmlwriter = null; + + try + { + OutputFormat outputFormat = OutputFormat.createPrettyPrint(); + xmlwriter = new org.dom4j.io.XMLWriter( writer, outputFormat ); + xmlwriter.write( doc ); + xmlwriter.flush(); + } + catch ( IOException e ) + { + throw new XMLException( "Unable to write xml contents to writer: " + e.getMessage(), e ); + } + finally + { + if ( close && ( xmlwriter != null ) ) + { + try + { + xmlwriter.close(); + } + catch ( IOException e ) + { + /* quietly ignore */ + } + } + } + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-xml-tools/src/test/examples/commons-codec-1.2.pom b/MRM-541/archiva-modules/archiva-base/archiva-xml-tools/src/test/examples/commons-codec-1.2.pom new file mode 100644 index 000000000..0ff5e43a1 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-xml-tools/src/test/examples/commons-codec-1.2.pom @@ -0,0 +1,113 @@ + + 4.0.0 + commons-codec + commons-codec + Codec + 1.2 + The codec package contains simple encoder and decoders for + various formats such as Base64 and Hexadecimal. In addition to these + widely used encoders and decoders, the codec package also maintains a + collection of phonetic encoding utilities. + + http://nagoya.apache.org/bugzilla/buglist.cgi?bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&email1=&emailtype1=substring&emailassigned_to1=1&email2=&emailtype2=substring&emailreporter2=1&bugidtype=include&bug_id=&changedin=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&product=Commons&component=Codec&short_desc=&short_desc_type=allwordssubstr&long_desc=&long_desc_type=allwordssubstr&bug_file_loc=&bug_file_loc_type=allwordssubstr&keywords=&keywords_type=anywords&field0-0-0=noop&type0-0-0=noop&value0-0-0=&cmdtype=doit&newqueryname=&order=Reuse+same+sort+as+last+time + + 2002 + + + bayard + Henri Yandell + bayard@generationjava.com + + + tobrien + Tim OBrien + tobrien@apache.org + -6 + + + sanders + Scott Sanders + sanders@totalsync.com + + + rwaldhoff + Rodney Waldhoff + rwaldhoff@apache.org + + + dlr + Daniel Rall + dlr@finemaltcoding.com + + + jon + Jon S. Stevens + jon@collab.net + + + ggregory + Gary D. Gregory + ggregory@seagullsw.com + SEAGULL Software + + Java Developer + + + + dgraham + David Graham + dgraham@apache.org + + + + + Christopher O'Brien + siege@preoccupied.net + + + Martin Redington + + + Jeffery Dever + + + Steve Zimmermann + steve.zimmermann@heii.com + + + Benjamin Walstrum + ben@walstrum.com + + + Oleg Kalnichevski + oleg@ural.ru + + + Dave Dribin + apache@dave.dribin.org + + + + + + ${pom.build.unitTestSourceDirectory} + + **/*.xml + + + + + + maven-surefire-plugin + + + **/*Test.java + + + **/*AbstractTest.java + + + + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-xml-tools/src/test/examples/no-prolog-basic.xml b/MRM-541/archiva-modules/archiva-base/archiva-xml-tools/src/test/examples/no-prolog-basic.xml new file mode 100644 index 000000000..8f5e76887 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-xml-tools/src/test/examples/no-prolog-basic.xml @@ -0,0 +1,14 @@ + + + + apple + + + + + + peach + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-xml-tools/src/test/examples/no-prolog-with-entities.xml b/MRM-541/archiva-modules/archiva-base/archiva-xml-tools/src/test/examples/no-prolog-with-entities.xml new file mode 100644 index 000000000..1c80613bf --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-xml-tools/src/test/examples/no-prolog-with-entities.xml @@ -0,0 +1,6 @@ + + + Trygve Laugstøl + The ∞ Archiva + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-xml-tools/src/test/examples/no-prolog-with-utf8.xml b/MRM-541/archiva-modules/archiva-base/archiva-xml-tools/src/test/examples/no-prolog-with-utf8.xml new file mode 100644 index 000000000..c6fd4015b --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-xml-tools/src/test/examples/no-prolog-with-utf8.xml @@ -0,0 +1,6 @@ + + + Trygve Laugstøl + The ∞ Archiva + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-base/archiva-xml-tools/src/test/examples/prolog-with-utf8.xml b/MRM-541/archiva-modules/archiva-base/archiva-xml-tools/src/test/examples/prolog-with-utf8.xml new file mode 100644 index 000000000..3bc319199 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-xml-tools/src/test/examples/prolog-with-utf8.xml @@ -0,0 +1,8 @@ + + + + + Trygve Laugstøl + The ∞ Archiva + + diff --git a/MRM-541/archiva-modules/archiva-base/archiva-xml-tools/src/test/java/org/apache/maven/archiva/xml/AbstractArchivaXmlTestCase.java b/MRM-541/archiva-modules/archiva-base/archiva-xml-tools/src/test/java/org/apache/maven/archiva/xml/AbstractArchivaXmlTestCase.java new file mode 100644 index 000000000..7fd49274a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-xml-tools/src/test/java/org/apache/maven/archiva/xml/AbstractArchivaXmlTestCase.java @@ -0,0 +1,54 @@ +package org.apache.maven.archiva.xml; + +/* + * 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; + +import junit.framework.TestCase; + +/** + * AbstractArchivaXmlTestCase + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public abstract class AbstractArchivaXmlTestCase + extends TestCase +{ + protected static final String OSLASH = "\u00f8"; + protected static final String TRYGVIS = "Trygve Laugst" + OSLASH + "l"; + protected static final String INFIN = "\u221e"; + protected static final String INFINITE_ARCHIVA = "The " + INFIN + " Archiva"; + + protected File getExampleXml( String filename ) + { + File examplesDir = new File( "src/test/examples" ); + if ( !examplesDir.exists() ) + { + fail( "Missing the examples directory: " + examplesDir.getAbsolutePath() ); + } + File exampleFile = new File( examplesDir, filename ); + if ( !exampleFile.exists() ) + { + fail( "Missing the example xml file: " + exampleFile.getAbsolutePath() ); + } + return exampleFile; + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-xml-tools/src/test/java/org/apache/maven/archiva/xml/LatinEntitiesTest.java b/MRM-541/archiva-modules/archiva-base/archiva-xml-tools/src/test/java/org/apache/maven/archiva/xml/LatinEntitiesTest.java new file mode 100644 index 000000000..b8a01b3de --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-xml-tools/src/test/java/org/apache/maven/archiva/xml/LatinEntitiesTest.java @@ -0,0 +1,45 @@ +package org.apache.maven.archiva.xml; + +/* + * 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; + +/** + * LatinEntitiesTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class LatinEntitiesTest + extends TestCase +{ + public void testResolveEntity() + { + // Good Entities. + assertEquals( "\u00a9", LatinEntities.resolveEntity( "©" ) ); + assertEquals( "\u221e", LatinEntities.resolveEntity( "∞" ) ); + assertEquals( "\u00f8", LatinEntities.resolveEntity( "ø" ) ); + + // Bad Entities. + assertEquals( "", LatinEntities.resolveEntity( "" ) ); + assertEquals( "&", LatinEntities.resolveEntity( "&" ) ); + assertEquals( null, LatinEntities.resolveEntity( null ) ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-xml-tools/src/test/java/org/apache/maven/archiva/xml/LatinEntityResolutionReaderTest.java b/MRM-541/archiva-modules/archiva-base/archiva-xml-tools/src/test/java/org/apache/maven/archiva/xml/LatinEntityResolutionReaderTest.java new file mode 100644 index 000000000..1e5be8b1c --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-xml-tools/src/test/java/org/apache/maven/archiva/xml/LatinEntityResolutionReaderTest.java @@ -0,0 +1,201 @@ +package org.apache.maven.archiva.xml; + +/* + * 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.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; +import java.io.Reader; +import java.io.StringWriter; + +/** + * LatinEntityResolutionReaderTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class LatinEntityResolutionReaderTest + extends AbstractArchivaXmlTestCase +{ + /** + * A method to obtain the content of a reader as a String, + * while allowing for specifing the buffer size of the operation. + * + * This method is only really useful for testing a Reader implementation. + * + * @param input the reader to get the input from. + * @param bufsize the buffer size to use. + * @return the contents of the reader as a String. + * @throws IOException if there was an I/O error. + */ + private String toStringFromReader( Reader input, int bufsize ) + throws IOException + { + StringWriter output = new StringWriter(); + + final char[] buffer = new char[bufsize]; + int n = 0; + while ( -1 != ( n = input.read( buffer ) ) ) + { + output.write( buffer, 0, n ); + } + output.flush(); + + return output.toString(); + } + + /** + * This reads a text file from the src/test/examples directory, + * normalizes the end of lines, and returns the contents as a big String. + * + * @param examplePath the name of the file in the src/test/examples directory. + * @return the contents of the provided file + * @throws IOException if there was an I/O error. + */ + private String toStringFromExample( String examplePath ) + throws IOException + { + File exampleFile = getExampleXml( examplePath ); + FileReader fileReader = new FileReader( exampleFile ); + BufferedReader lineReader = new BufferedReader( fileReader ); + StringBuffer sb = new StringBuffer(); + + boolean hasContent = false; + + String line = lineReader.readLine(); + while ( line != null ) + { + if ( hasContent ) + { + sb.append( "\n" ); + } + sb.append( line ); + hasContent = true; + line = lineReader.readLine(); + } + + return sb.toString(); + } + + public void assertProperRead( String sourcePath, String expectedPath, int bufsize ) + { + try + { + File inputFile = getExampleXml( sourcePath ); + + FileReader fileReader = new FileReader( inputFile ); + LatinEntityResolutionReader testReader = new LatinEntityResolutionReader( fileReader ); + + String actualOutput = toStringFromReader( testReader, bufsize ); + String expectedOutput = toStringFromExample( expectedPath ); + + assertEquals( expectedOutput, actualOutput ); + } + catch ( IOException e ) + { + fail( "IOException: " + e.getMessage() ); + } + } + + private void assertProperRead( StringBuffer expected, String sourcePath, int bufSize ) + { + try + { + File inputFile = getExampleXml( sourcePath ); + + FileReader fileReader = new FileReader( inputFile ); + LatinEntityResolutionReader testReader = new LatinEntityResolutionReader( fileReader ); + + String actualOutput = toStringFromReader( testReader, bufSize ); + + assertEquals( "Proper Read: ", expected.toString(), actualOutput ); + } + catch ( IOException e ) + { + fail( "IOException: " + e.getMessage() ); + } + } + + public void testReaderNormalBufsize() + throws IOException + { + StringBuffer expected = new StringBuffer(); + + expected.append( "\n" ); + expected.append( " \n" ); + expected.append( " " ).append( TRYGVIS ).append( "\n" ); + expected.append( " " ).append( INFINITE_ARCHIVA ).append( "\n" ); + expected.append( " \n" ); + expected.append( "" ); + + assertProperRead( expected, "no-prolog-with-entities.xml", 4096 ); + } + + public void testReaderSmallBufsize() + throws IOException + { + StringBuffer expected = new StringBuffer(); + + expected.append( "\n" ); + expected.append( " \n" ); + expected.append( " " ).append( TRYGVIS ).append( "\n" ); + expected.append( " " ).append( INFINITE_ARCHIVA ).append( "\n" ); + expected.append( " \n" ); + expected.append( "" ); + + assertProperRead( expected, "no-prolog-with-entities.xml", 1024 ); + } + + public void testReaderRediculouslyTinyBufsize() + throws IOException + { + StringBuffer expected = new StringBuffer(); + + expected.append( "\n" ); + expected.append( " \n" ); + expected.append( " " ).append( TRYGVIS ).append( "\n" ); + expected.append( " " ).append( INFINITE_ARCHIVA ).append( "\n" ); + expected.append( " \n" ); + expected.append( "" ); + + assertProperRead( expected, "no-prolog-with-entities.xml", 32 ); + } + + public void testReaderHugeBufsize() + throws IOException + { + StringBuffer expected = new StringBuffer(); + + expected.append( "\n" ); + expected.append( " \n" ); + expected.append( " " ).append( TRYGVIS ).append( "\n" ); + expected.append( " " ).append( INFINITE_ARCHIVA ).append( "\n" ); + expected.append( " \n" ); + expected.append( "" ); + + assertProperRead( expected, "no-prolog-with-entities.xml", 409600 ); + } + + public void testNoLatinEntitiesHugeLine() + { + assertProperRead( "commons-codec-1.2.pom", "commons-codec-1.2.pom", 4096 ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-xml-tools/src/test/java/org/apache/maven/archiva/xml/XMLReaderTest.java b/MRM-541/archiva-modules/archiva-base/archiva-xml-tools/src/test/java/org/apache/maven/archiva/xml/XMLReaderTest.java new file mode 100644 index 000000000..bda872a8b --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-xml-tools/src/test/java/org/apache/maven/archiva/xml/XMLReaderTest.java @@ -0,0 +1,96 @@ +package org.apache.maven.archiva.xml; + +/* + * 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.dom4j.Element; + +import java.io.File; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +/** + * XMLReaderTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class XMLReaderTest + extends AbstractArchivaXmlTestCase +{ + private void assertElementTexts( List elementList, String[] expectedTexts ) + { + assertEquals( "Element List Size", expectedTexts.length, elementList.size() ); + + List texts = new ArrayList(); + for ( Iterator iter = elementList.iterator(); iter.hasNext(); ) + { + Element element = (Element) iter.next(); + texts.add( element.getTextTrim() ); + } + + for ( int i = 0; i < expectedTexts.length; i++ ) + { + String expectedText = expectedTexts[i]; + assertTrue( "Contains [" + expectedText + "]", texts.contains( expectedText ) ); + } + } + + public void testNoPrologBasicRead() + throws XMLException + { + File xmlFile = getExampleXml( "no-prolog-basic.xml" ); + XMLReader reader = new XMLReader( "basic", xmlFile ); + + List fruits = reader.getElementList( "//basic/fruits/fruit" ); + assertElementTexts( fruits, new String[] { "apple", "cherry", "pear", "peach" } ); + } + + public void testNoPrologEntitiesRead() + throws XMLException + { + File xmlFile = getExampleXml( "no-prolog-with-entities.xml" ); + XMLReader reader = new XMLReader( "basic", xmlFile ); + + List names = reader.getElementList( "//basic/names/name" ); + assertElementTexts( names, new String[] { TRYGVIS, INFINITE_ARCHIVA } ); + } + + public void testNoPrologUtf8Read() + throws XMLException + { + File xmlFile = getExampleXml( "no-prolog-with-utf8.xml" ); + XMLReader reader = new XMLReader( "basic", xmlFile ); + + List names = reader.getElementList( "//basic/names/name" ); + assertElementTexts( names, new String[] { TRYGVIS, INFINITE_ARCHIVA } ); + } + + public void testPrologUtf8Read() + throws XMLException + { + File xmlFile = getExampleXml( "prolog-with-utf8.xml" ); + XMLReader reader = new XMLReader( "basic", xmlFile ); + + List names = reader.getElementList( "//basic/names/name" ); + assertElementTexts( names, new String[] { TRYGVIS, INFINITE_ARCHIVA } ); + } + +} diff --git a/MRM-541/archiva-modules/archiva-base/archiva-xml-tools/src/test/java/org/apache/maven/archiva/xml/XMLWriterTest.java b/MRM-541/archiva-modules/archiva-base/archiva-xml-tools/src/test/java/org/apache/maven/archiva/xml/XMLWriterTest.java new file mode 100644 index 000000000..1d7f596c8 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/archiva-xml-tools/src/test/java/org/apache/maven/archiva/xml/XMLWriterTest.java @@ -0,0 +1,63 @@ +package org.apache.maven.archiva.xml; + +/* + * 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.dom4j.Document; +import org.dom4j.DocumentHelper; +import org.dom4j.Element; + +import java.io.StringWriter; + +/** + * XMLWriterTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class XMLWriterTest + extends AbstractArchivaXmlTestCase +{ + public void testWrite() + throws Exception + { + StringBuffer expected = new StringBuffer(); + + expected.append( "\n" ); + expected.append( "\n" ); + expected.append( "\n" ); + expected.append( " \n" ); + expected.append( " " ).append( TRYGVIS ).append( "\n" ); + expected.append( " " ).append( INFINITE_ARCHIVA ).append( "\n" ); + expected.append( " \n" ); + expected.append( "\n" ); + + Element basic = DocumentHelper.createElement( "basic" ); + Document doc = DocumentHelper.createDocument( basic ); + + Element names = basic.addElement( "names" ); + names.addElement( "name" ).setText( TRYGVIS ); + names.addElement( "name" ).setText( INFINITE_ARCHIVA ); + + StringWriter actual = new StringWriter(); + XMLWriter.write( doc, actual ); + + assertEquals( "Comparision of contents:", expected.toString(), actual.toString() ); + } +} diff --git a/MRM-541/archiva-modules/archiva-base/pom.xml b/MRM-541/archiva-modules/archiva-base/pom.xml new file mode 100644 index 000000000..f95c75f13 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-base/pom.xml @@ -0,0 +1,46 @@ + + + + + 4.0.0 + + org.apache.archiva + archiva-modules + 1.2-SNAPSHOT + + + archiva-base + Archiva Base + pom + + + archiva-checksum + archiva-common + archiva-policies + archiva-configuration + archiva-consumers + archiva-indexer + archiva-model + archiva-dependency-graph + archiva-repository-layer + archiva-xml-tools + archiva-proxy + archiva-transaction + archiva-artifact-converter + archiva-converter + + diff --git a/MRM-541/archiva-modules/archiva-database/pom.xml b/MRM-541/archiva-modules/archiva-database/pom.xml new file mode 100755 index 000000000..5268b9531 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/pom.xml @@ -0,0 +1,106 @@ + + + + + + org.apache.archiva + archiva-modules + 1.2-SNAPSHOT + + 4.0.0 + archiva-database + Archiva Database + + + org.apache.archiva + archiva-repository-layer + + + org.apache.archiva + archiva-consumer-api + + + org.apache.archiva + archiva-configuration + + + org.apache.archiva + archiva-model + + + org.codehaus.plexus + plexus-spring + test + + + org.codehaus.plexus + plexus-component-api + + + org.codehaus.plexus + plexus-jdo2 + + + jpox + jpox + compile + + + commons-lang + commons-lang + + + commons-io + commons-io + + + log4j + log4j + + + org.apache.derby + derby + + + + org.codehaus.plexus.registry + plexus-registry-commons + test + + + hsqldb + hsqldb + test + + + org.apache.derby + derbytools + test + + + + + + org.codehaus.plexus + plexus-maven-plugin + + + + diff --git a/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/ArchivaDAO.java b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/ArchivaDAO.java new file mode 100644 index 000000000..61b1d6889 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/ArchivaDAO.java @@ -0,0 +1,58 @@ +package org.apache.maven.archiva.database; + +/* + * 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.Serializable; +import java.util.List; + +/** + * ArchivaDAO - The interface for all content within the database. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public interface ArchivaDAO +{ + public static final String ROLE = ArchivaDAO.class.getName(); + + /** + * Perform a simple query against the database. + * + * @param constraint the constraint to use. + * @return the List of results. + */ + List query( SimpleConstraint constraint ); + + /** + * Perform a simple save of a peristable object to the database. + * + * @param o the serializable (persistable) object to save. + * @return the post-serialized object. + */ + Object save( Serializable obj ); + + ArtifactDAO getArtifactDAO(); + + ProjectModelDAO getProjectModelDAO(); + + RepositoryProblemDAO getRepositoryProblemDAO(); + + RepositoryContentStatisticsDAO getRepositoryContentStatisticsDAO(); +} diff --git a/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/ArchivaDatabaseException.java b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/ArchivaDatabaseException.java new file mode 100644 index 000000000..b170c7feb --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/ArchivaDatabaseException.java @@ -0,0 +1,42 @@ +package org.apache.maven.archiva.database; + +/* + * 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. + */ + +/** + * ArchivaDatabaseException + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ArchivaDatabaseException + extends Exception +{ + + public ArchivaDatabaseException( String message, Throwable cause ) + { + super( message, cause ); + } + + public ArchivaDatabaseException( String message ) + { + super( message ); + } + +} diff --git a/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/ArtifactDAO.java b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/ArtifactDAO.java new file mode 100644 index 000000000..610dd60f1 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/ArtifactDAO.java @@ -0,0 +1,70 @@ +package org.apache.maven.archiva.database; + +/* + * 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.archiva.model.ArchivaArtifact; + +import java.util.List; + +/** + * ArtifactDAO + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public interface ArtifactDAO +{ + /* NOTE TO ARCHIVA DEVELOPERS. + * + * Please keep this interface clean and lean. + * We don't want a repeat of the Continuum Store. + * You should have the following methods per object type ... + * + * (Required Methods) + * + * DatabaseObject .createDatabaseObject( Required Params ) ; + * List .queryDatabaseObject( Constraint ) throws ObjectNotFoundException, DatabaseException; + * DatabaseObject .saveDatabaseObject( DatabaseObject ) throws DatabaseException; + * + * (Optional Methods) + * + * DatabaseObject .getDatabaseObject( Id ) throws ObjectNotFoundException, DatabaseException; + * List .getDatabaseObjects() throws ObjectNotFoundException, DatabaseException; + * void .deleteDatabaseObject( DatabaseObject ) throws DatabaseException; + * + * This is the only list of options created in this DAO. + */ + + public ArchivaArtifact createArtifact( String groupId, String artifactId, String version, String classifier, + String type ); + + public ArchivaArtifact getArtifact( String groupId, String artifactId, String version, String classifier, + String type ) + throws ObjectNotFoundException, ArchivaDatabaseException; + + public List /**/queryArtifacts( Constraint constraint ) + throws ObjectNotFoundException, ArchivaDatabaseException; + + public ArchivaArtifact saveArtifact( ArchivaArtifact artifact ) + throws ArchivaDatabaseException; + + public void deleteArtifact( ArchivaArtifact artifact ) + throws ArchivaDatabaseException; +} diff --git a/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/Constraint.java b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/Constraint.java new file mode 100644 index 000000000..f5355aadb --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/Constraint.java @@ -0,0 +1,43 @@ +package org.apache.maven.archiva.database; + +/* + * 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. + */ + + +/** + * Constraint - a generic object for dealing with database constraints. + * + * @author Joakim Erdfelt + * @version $Id$ + * @see DeclarativeConstraint + * @see SimpleConstraint + */ +public interface Constraint +{ + public static final String ASCENDING = "ascending"; + + public static final String DESCENDING = "descending"; + + /** + * Get the fetch limits on the object. + * + * @return the fetch limits on the object. (can be null) (O/RM specific) + */ + public String getFetchLimits(); +} diff --git a/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/DeclarativeConstraint.java b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/DeclarativeConstraint.java new file mode 100644 index 000000000..15fa14e2b --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/DeclarativeConstraint.java @@ -0,0 +1,105 @@ +package org.apache.maven.archiva.database; + +/* + * 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. + */ + +/** + * DeclarativeConstraint + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public interface DeclarativeConstraint + extends Constraint +{ + /** + * Get the declared imports used for this query. (optional) + *

+ * NOTE: This is DAO implementation specific. + * + * @return the imports. (can be null) + */ + public abstract String[] getDeclaredImports(); + + /** + * Get the declared parameters used for this query. (optional) + *

+ * NOTE: This is DAO implementation specific. + * + * @return the parameters. (can be null) + */ + public abstract String[] getDeclaredParameters(); + + /** + * The JDOQL filter to apply to the query. (optional) + *

+ * NOTE: This is DAO implementation specific. + * + * @return the filter to apply. (can be null) + */ + public abstract String getFilter(); + + /** + * Get the parameters used for this query. (required if using {@link #getDeclaredParameters()} ) + *

+ * NOTE: This is DAO implementation specific. + * + * @return the parameters. (can be null) + */ + public abstract Object[] getParameters(); + + /** + * Get the sort direction name. + * + * @return the sort direction name. ("ASC" or "DESC") (only valid if {@link #getSortColumn()} is specified.) + */ + public abstract String getSortDirection(); + + /** + * Get the sort column name. + * + * @return the sort column name. (can be null) + */ + public abstract String getSortColumn(); + + /** + * Get the variables used within the query. + *

+ * NOTE: This is DAO implementation specific. + * + * @return the variables used within the query. + */ + public abstract String[] getVariables(); + + /** + * Get the SELECT WHERE (condition) value for the constraint. + * + * @return the equivalent of the SELECT WHERE (condition) value for this constraint. (can be null) + */ + public abstract String getWhereCondition(); + + /** + * Get the declared range used for this query. (optional) + *

+ * NOTE: This is DAO implementation specific. + * + * @return the range. (can be null) + */ + public abstract int[] getRange(); +} diff --git a/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/ObjectNotFoundException.java b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/ObjectNotFoundException.java new file mode 100644 index 000000000..b1e65e605 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/ObjectNotFoundException.java @@ -0,0 +1,53 @@ +package org.apache.maven.archiva.database; + +/* + * 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. + */ + +/** + * ObjectNotFoundException + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ObjectNotFoundException + extends ArchivaDatabaseException +{ + private Object id; + + public ObjectNotFoundException( String message, Throwable cause, Object id ) + { + super( message, cause ); + this.id = id; + } + + public ObjectNotFoundException( String message, Throwable cause ) + { + super( message, cause ); + } + + public ObjectNotFoundException( String message ) + { + super( message ); + } + + public Object getId() + { + return id; + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/ProjectModelDAO.java b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/ProjectModelDAO.java new file mode 100644 index 000000000..492d6d7bf --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/ProjectModelDAO.java @@ -0,0 +1,68 @@ +package org.apache.maven.archiva.database; + +/* + * 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.archiva.model.ArchivaProjectModel; + +import java.util.List; + +/** + * ProjectModelDAO + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public interface ProjectModelDAO +{ + /* NOTE TO ARCHIVA DEVELOPERS. + * + * Please keep this interface clean and lean. + * We don't want a repeat of the Continuum Store. + * You should have the following methods per object type ... + * + * (Required Methods) + * + * DatabaseObject .createDatabaseObject( Required Params ) ; + * List .queryDatabaseObject( Constraint ) throws ObjectNotFoundException, DatabaseException; + * DatabaseObject .saveDatabaseObject( DatabaseObject ) throws DatabaseException; + * + * (Optional Methods) + * + * DatabaseObject .getDatabaseObject( Id ) throws ObjectNotFoundException, DatabaseException; + * List .getDatabaseObjects() throws ObjectNotFoundException, DatabaseException; + * void .deleteDatabaseObject( DatabaseObject ) throws DatabaseException; + * + * This is the only list of options created in this DAO. + */ + + public ArchivaProjectModel createProjectModel( String groupId, String artifactId, String version ); + + public ArchivaProjectModel getProjectModel( String groupId, String artifactId, String version ) + throws ObjectNotFoundException, ArchivaDatabaseException; + + public List queryProjectModels( Constraint constraint ) + throws ObjectNotFoundException, ArchivaDatabaseException; + + public ArchivaProjectModel saveProjectModel( ArchivaProjectModel model ) + throws ArchivaDatabaseException; + + public void deleteProjectModel( ArchivaProjectModel model ) + throws ArchivaDatabaseException; +} diff --git a/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/RepositoryContentStatisticsDAO.java b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/RepositoryContentStatisticsDAO.java new file mode 100644 index 000000000..20f07889b --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/RepositoryContentStatisticsDAO.java @@ -0,0 +1,41 @@ +package org.apache.maven.archiva.database; + +/* + * 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.archiva.model.RepositoryContentStatistics; + +/** + * RepositoryContentStatisticsDAO + * + * @author Maria Odea Ching + * @version + */ +public interface RepositoryContentStatisticsDAO +{ + public List queryRepositoryContentStatistics( Constraint constraint ) + throws ObjectNotFoundException, ArchivaDatabaseException; + + public RepositoryContentStatistics saveRepositoryContentStatistics( RepositoryContentStatistics stats ); + + public void deleteRepositoryContentStatistics( RepositoryContentStatistics stats ) + throws ArchivaDatabaseException; +} diff --git a/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/RepositoryProblemDAO.java b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/RepositoryProblemDAO.java new file mode 100644 index 000000000..b544e2add --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/RepositoryProblemDAO.java @@ -0,0 +1,63 @@ +package org.apache.maven.archiva.database; + +/* + * 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.archiva.model.RepositoryProblem; + +import java.util.List; + +/** + * RepositoryProblemDAO + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public interface RepositoryProblemDAO +{ + /* NOTE TO ARCHIVA DEVELOPERS. + * + * Please keep this interface clean and lean. + * We don't want a repeat of the Continuum Store. + * You should have the following methods per object type ... + * + * (Required Methods) + * + * List .queryDatabaseObject( Constraint ) throws ObjectNotFoundException, DatabaseException; + * DatabaseObject .saveDatabaseObject( DatabaseObject ) throws DatabaseException; + * + * (Optional Methods) + * + * DatabaseObject .createDatabaseObject( Required Params ) ; + * DatabaseObject .getDatabaseObject( Id ) throws ObjectNotFoundException, DatabaseException; + * List .getDatabaseObjects() throws ObjectNotFoundException, DatabaseException; + * void .deleteDatabaseObject( DatabaseObject ) throws DatabaseException; + * + * This is the only list of options created in this DAO. + */ + + public List /**/queryRepositoryProblems( Constraint constraint ) + throws ObjectNotFoundException, ArchivaDatabaseException; + + public RepositoryProblem saveRepositoryProblem( RepositoryProblem problem ) + throws ArchivaDatabaseException; + + public void deleteRepositoryProblem( RepositoryProblem problem ) + throws ArchivaDatabaseException; +} diff --git a/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/SimpleConstraint.java b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/SimpleConstraint.java new file mode 100644 index 000000000..79f9150e2 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/SimpleConstraint.java @@ -0,0 +1,60 @@ +package org.apache.maven.archiva.database; + +/* + * 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. + */ + +/** + * SimpleConstraint + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public interface SimpleConstraint extends Constraint +{ + /** + * Get the parameters used for this query. (required if using parameterized SQL) + * + * NOTE: This is DAO implementation specific. + * + * @return the parameters. (can be null) + */ + public Object[] getParameters(); + + /** + * Get the SELECT query value for the constraint. + * + * @return the SELECT value for this constraint. (can be null) + */ + public abstract String getSelectSql(); + + /** + * For simple Constraints the results class must be specified. + * + * @return the result class. + */ + public Class getResultClass(); + + /** + * When working with result classes that are not persistable, + * it is advisable to tell the underlying DAO to not do the persistable related efforts. + * + * @return true if result classes are persistable. + */ + public boolean isResultsPersistable(); +} diff --git a/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/browsing/BrowsingResults.java b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/browsing/BrowsingResults.java new file mode 100644 index 000000000..ccf526662 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/browsing/BrowsingResults.java @@ -0,0 +1,126 @@ +package org.apache.maven.archiva.database.browsing; + +/* + * 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.collections.CollectionUtils; + +import java.util.List; + +/** + * BrowsingResults + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class BrowsingResults +{ + private String selectedGroupId; + + private String selectedArtifactId; + + private List selectedRepositoryIds = null; + + private List groupIds = null; + + private List artifacts = null; + + private List versions = null; + + public BrowsingResults() + { + /* do nothing, this is the results of the root */ + } + + public BrowsingResults( String groupId ) + { + this.selectedGroupId = groupId; + } + + public BrowsingResults( String groupId, String artifactId ) + { + this.selectedGroupId = groupId; + this.selectedArtifactId = artifactId; + } + + public List getArtifacts() + { + return artifacts; + } + + public List getGroupIds() + { + return groupIds; + } + + public String getSelectedArtifactId() + { + return selectedArtifactId; + } + + public String getSelectedGroupId() + { + return selectedGroupId; + } + + public List getVersions() + { + return versions; + } + + public boolean hasArtifacts() + { + return CollectionUtils.isNotEmpty( artifacts ); + } + + public boolean hasGroupIds() + { + return CollectionUtils.isNotEmpty( groupIds ); + } + + public boolean hasVersions() + { + return CollectionUtils.isNotEmpty( versions ); + } + + public void setArtifacts( List artifacts ) + { + this.artifacts = artifacts; + } + + public void setGroupIds( List groupIds ) + { + this.groupIds = groupIds; + } + + public void setVersions( List versions ) + { + this.versions = versions; + } + + public List getSelectedRepositoryIds() + { + return selectedRepositoryIds; + } + + public void setSelectedRepositoryIds( List selectedRepositoryIds ) + { + this.selectedRepositoryIds = selectedRepositoryIds; + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/browsing/DefaultRepositoryBrowsing.java b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/browsing/DefaultRepositoryBrowsing.java new file mode 100644 index 000000000..65a8a0546 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/browsing/DefaultRepositoryBrowsing.java @@ -0,0 +1,309 @@ +package org.apache.maven.archiva.database.browsing; + +/* + * 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.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; + +import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections.PredicateUtils; +import org.apache.commons.collections.functors.NotPredicate; +import org.apache.commons.lang.StringUtils; +import org.apache.maven.archiva.common.utils.VersionUtil; +import org.apache.maven.archiva.database.ArchivaDAO; +import org.apache.maven.archiva.database.ArchivaDatabaseException; +import org.apache.maven.archiva.database.ObjectNotFoundException; +import org.apache.maven.archiva.database.constraints.ProjectsByArtifactUsageConstraint; +import org.apache.maven.archiva.database.constraints.UniqueArtifactIdConstraint; +import org.apache.maven.archiva.database.constraints.UniqueGroupIdConstraint; +import org.apache.maven.archiva.database.constraints.UniqueVersionConstraint; +import org.apache.maven.archiva.database.updater.DatabaseUpdater; +import org.apache.maven.archiva.model.ArchivaArtifact; +import org.apache.maven.archiva.model.ArchivaProjectModel; +import org.apache.maven.archiva.model.Keys; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * DefaultRepositoryBrowsing + * + * @author Joakim Erdfelt + * @version $Id$ + * @plexus.component role="org.apache.maven.archiva.database.browsing.RepositoryBrowsing" + */ +public class DefaultRepositoryBrowsing + implements RepositoryBrowsing +{ + private Logger log = LoggerFactory.getLogger( DefaultRepositoryBrowsing.class ); + + /** + * @plexus.requirement role-hint="jdo" + */ + private ArchivaDAO dao; + + /** + * @plexus.requirement role-hint="jdo" + */ + private DatabaseUpdater dbUpdater; + + public BrowsingResults getRoot( String principle, List observableRepositoryIds ) + { + List groups = dao.query( new UniqueGroupIdConstraint( observableRepositoryIds ) ); + + BrowsingResults results = new BrowsingResults(); + results.setSelectedRepositoryIds( observableRepositoryIds ); + + results.setGroupIds( GroupIdFilter.filterGroups( groups ) ); + + return results; + } + + public BrowsingResults selectArtifactId( String principle, List observableRepositoryIds, String groupId, + String artifactId ) + { + // NOTE: No group Id or artifact Id's should be returned here. + List versions = dao.query( new UniqueVersionConstraint( observableRepositoryIds, groupId, artifactId ) ); + + BrowsingResults results = new BrowsingResults( groupId, artifactId ); + results.setSelectedRepositoryIds( observableRepositoryIds ); + + processSnapshots( versions ); + + results.setVersions( versions ); + + return results; + } + + public BrowsingResults selectGroupId( String principle, List observableRepositoryIds, String groupId ) + { + List groups = dao.query( new UniqueGroupIdConstraint( observableRepositoryIds, groupId ) ); + List artifacts = dao.query( new UniqueArtifactIdConstraint( observableRepositoryIds, groupId ) ); + + BrowsingResults results = new BrowsingResults( groupId ); + + // Remove searched for groupId from groups list. + // Easier to do this here, vs doing it in the SQL query. + CollectionUtils.filter( groups, NotPredicate.getInstance( PredicateUtils.equalPredicate( groupId ) ) ); + + results.setGroupIds( groups ); + results.setArtifacts( artifacts ); + + return results; + } + + public ArchivaProjectModel selectVersion( String principle, List observableRepositoryIds, String groupId, + String artifactId, String version ) + throws ObjectNotFoundException, ArchivaDatabaseException + { + ArchivaArtifact pomArtifact = getArtifact( principle, observableRepositoryIds, groupId, artifactId, version ); + + ArchivaProjectModel model; + version = pomArtifact.getVersion(); + + if ( !pomArtifact.getModel().isProcessed() ) + { + // Process it. + dbUpdater.updateUnprocessed( pomArtifact ); + } + + model = getProjectModel( groupId, artifactId, version ); + + return model; + } + + public String getRepositoryId( String principle, List observableRepositoryIds, String groupId, + String artifactId, String version ) + throws ObjectNotFoundException, ArchivaDatabaseException + { + ArchivaArtifact pomArchivaArtifact = + getArtifact( principle, observableRepositoryIds, groupId, artifactId, version ); + + return pomArchivaArtifact.getModel().getRepositoryId(); + } + + private ArchivaArtifact getArtifact( String principle, List observableRepositoryIds, String groupId, + String artifactId, String version ) + throws ObjectNotFoundException, ArchivaDatabaseException + { + ArchivaArtifact pomArtifact = null; + + try + { + pomArtifact = dao.getArtifactDAO().getArtifact( groupId, artifactId, version, null, "pom" ); + } + catch ( ObjectNotFoundException e ) + { + pomArtifact = handleGenericSnapshots( groupId, artifactId, version, pomArtifact ); + } + + if ( pomArtifact == null ) + { + throw new ObjectNotFoundException( "Unable to find artifact [" + Keys.toKey( groupId, artifactId, version ) + + "]" ); + } + + // Allowed to see this? + if ( observableRepositoryIds.contains( pomArtifact.getModel().getRepositoryId() ) ) + { + return pomArtifact; + } + else + { + throw new ObjectNotFoundException( "Unable to find artifact " + Keys.toKey( groupId, artifactId, version ) + + " in observable repository [" + StringUtils.join( observableRepositoryIds.iterator(), ", " ) + + "] for user " + principle ); + } + } + + public List getUsedBy( String principle, List observableRepositoryIds, String groupId, + String artifactId, String version ) + throws ArchivaDatabaseException + { + ProjectsByArtifactUsageConstraint constraint = new ProjectsByArtifactUsageConstraint( groupId, artifactId, + version ); + List results = dao.getProjectModelDAO().queryProjectModels( constraint ); + if ( results == null ) + { + // defensive. to honor contract as specified. never null. + return Collections.EMPTY_LIST; + } + + return results; + } + + /** + * Add generic (*-SNAPSHOT) snapshot versions in the list for artifacts with only unique version (timestamped) + * snapshots. + *

+ * Ex. + * artifact1 has the ff. versions retrieved from the db: + * - 1.0 + * - 1.1-20061118.060401-2 + * - 1.1-20061118.060402-3 + * - 2.2-20071007.070101-1 + * - 2.2-20071007.070110-2 + * - 2.2-SNAPSHOT + *

+ * This method will add a '1.1-SNAPSHOT' in the list since there is no generic snapshot entry for it. + * When this version is browsed, the pom of the latest snapshot will be displayed. + * + * @param versions + */ + private void processSnapshots( List versions ) + { + Map snapshots = new HashMap(); + + log.info( "Processing snapshots." ); + + for ( String version : versions ) + { + if ( VersionUtil.isSnapshot( version ) ) + { + String baseVersion = VersionUtil.getBaseVersion( version ); + if ( !snapshots.containsKey( baseVersion ) ) + { + snapshots.put( baseVersion, baseVersion ); + } + } + } + + for ( Entry entry : snapshots.entrySet() ) + { + String baseVersion = entry.getValue(); + if ( !versions.contains( baseVersion ) ) + { + versions.add( baseVersion ); + } + } + } + + /** + * Handles querying of generic (*-SNAPSHOT) snapshot version. + * Process: + * - Get all the timestamped/unique versions of the artifact from the db + * - Sort the queried project models + * - Reverse the list of queried project models to get the latest timestamp version + * - Loop through the list and get the first one to match the generic (*-SNAPHOT) version + * + * @param groupId + * @param artifactId + * @param version + * @param pomArtifact + * @throws ArchivaDatabaseException + */ + private ArchivaArtifact handleGenericSnapshots( String groupId, String artifactId, String version, + ArchivaArtifact pomArtifact ) + throws ArchivaDatabaseException + { + if ( VersionUtil.isGenericSnapshot( version ) ) + { + List versions = dao.query( new UniqueVersionConstraint( groupId, artifactId ) ); + Collections.sort( versions ); + Collections.reverse( versions ); + + for ( String uniqueVersion : versions ) + { + if ( VersionUtil.getBaseVersion( uniqueVersion ).equals( version ) ) + { + log.info( "Retrieving artifact with version " + uniqueVersion ); + pomArtifact = dao.getArtifactDAO().getArtifact( groupId, artifactId, uniqueVersion, null, "pom" ); + + return pomArtifact; + } + } + } + + return null; + } + + /** + * Get the project model from the database. + * + * @param groupId + * @param artifactId + * @param version + * @return + * @throws ArchivaDatabaseException + */ + private ArchivaProjectModel getProjectModel( String groupId, String artifactId, String version ) + throws ArchivaDatabaseException + { + try + { + ArchivaProjectModel model = dao.getProjectModelDAO().getProjectModel( groupId, artifactId, version ); + + if ( model == null ) + { + throw new ObjectNotFoundException( "Unable to find project model for [" + + Keys.toKey( groupId, artifactId, version ) + "]" ); + } + + return model; + } + catch ( ObjectNotFoundException e ) + { + throw e; + } + } + +} diff --git a/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/browsing/GroupIdFilter.java b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/browsing/GroupIdFilter.java new file mode 100644 index 000000000..18b7bdba5 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/browsing/GroupIdFilter.java @@ -0,0 +1,171 @@ +package org.apache.maven.archiva.database.browsing; + +/* + * 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.List; +import java.util.Map; +import java.util.StringTokenizer; +import java.util.TreeMap; + +/** + * GroupIdFilter - utility methods for filtering groupIds. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class GroupIdFilter +{ + private static final String GROUP_SEPARATOR = "."; + + /** + *

+ * Filter out excessive groupId naming. (to provide a tree-ish view of the list of groupIds). + *

+ * + *
+     *  // Input List
+     *  commons-lang
+     *  com.jsch
+     *  org.apache.apache
+     *  org.apache.maven
+     *  org.codehaus.modello
+     *  // Filtered List
+     *  commons-lang
+     *  com.jsch
+     *  org
+     * 
+ * + *
+     *  // Input List
+     *  commons-lang
+     *  commons-io
+     *  commons-pool
+     *  com.jsch
+     *  com.jsch.lib
+     *  com.jsch.providers
+     *  org.apache.apache
+     *  org.apache.maven
+     *  org.apache.maven.archiva
+     *  org.apache.maven.shared
+     *  // Filtered List
+     *  commons-lang
+     *  commons-io
+     *  commons-pool
+     *  com.jsch
+     *  org.apache
+     * 
+ * + * @param groups the list of groupIds. + * @return + */ + public static List filterGroups( List groups ) + { + GroupTreeNode tree = buildGroupTree( groups ); + return collateGroups( tree ); + } + + public static GroupTreeNode buildGroupTree( List groups ) + { + GroupTreeNode rootNode = new GroupTreeNode(); + + // build a tree structure + for ( String groupId : groups ) + { + StringTokenizer tok = new StringTokenizer( groupId, GROUP_SEPARATOR ); + + GroupTreeNode node = rootNode; + + while ( tok.hasMoreTokens() ) + { + String part = tok.nextToken(); + + if ( !node.getChildren().containsKey( part ) ) + { + GroupTreeNode newNode = new GroupTreeNode( part, node ); + node.addChild( newNode ); + node = newNode; + } + else + { + node = node.getChildren().get( part ); + } + } + } + + return rootNode; + } + + private static List collateGroups( GroupTreeNode rootNode ) + { + List groups = new ArrayList(); + for ( GroupTreeNode node : rootNode.getChildren().values() ) + { + while ( node.getChildren().size() == 1 ) + { + node = node.getChildren().values().iterator().next(); + } + + groups.add( node.getFullName() ); + } + return groups; + } + + private static class GroupTreeNode + { + private final String name; + + private final String fullName; + + private final Map children = new TreeMap(); + + GroupTreeNode() + { + name = null; + fullName = null; + } + + GroupTreeNode( String name, GroupTreeNode parent ) + { + this.name = name; + this.fullName = parent.fullName != null ? parent.fullName + GROUP_SEPARATOR + name : name; + } + + public String getName() + { + return name; + } + + public String getFullName() + { + return fullName; + } + + public Map getChildren() + { + return children; + } + + public void addChild( GroupTreeNode newNode ) + { + children.put( newNode.name, newNode ); + } + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/browsing/RepositoryBrowsing.java b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/browsing/RepositoryBrowsing.java new file mode 100644 index 000000000..ef4d8ed8e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/browsing/RepositoryBrowsing.java @@ -0,0 +1,93 @@ +package org.apache.maven.archiva.database.browsing; + +/* + * 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.archiva.database.ArchivaDatabaseException; +import org.apache.maven.archiva.database.ObjectNotFoundException; +import org.apache.maven.archiva.model.ArchivaProjectModel; + +import java.util.List; + +/** + * Repository Browsing component + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public interface RepositoryBrowsing +{ + /** + * Get the {@link BrowsingResults} for the root of the repository. + * + * @return the root browsing results. + */ + public BrowsingResults getRoot( String principle, List observableRepositoryIds ); + + /** + * Get the {@link BrowsingResults} for the selected groupId. + * + * @param groupId the groupId to select. + * @return the {@link BrowsingResults} for the specified groupId. + */ + public BrowsingResults selectGroupId( String principle, List observableRepositoryIds, String groupId ); + + /** + * Get the {@link BrowsingResults} for the selected groupId & artifactId. + * + * @param groupId the groupId selected + * @param artifactId the artifactId selected + * @return the {@link BrowsingResults} for the specified groupId / artifactId combo. + */ + public BrowsingResults selectArtifactId( String principle, List observableRepositoryIds, String groupId, + String artifactId ); + + /** + * Get the {@link ArchivaProjectModel} for the selected groupId / artifactId / version combo. + * + * @param groupId the groupId selected + * @param artifactId the artifactId selected + * @param version the version selected + * @return the {@link ArchivaProjectModel} for the selected groupId / artifactId / version combo. + * @throws ObjectNotFoundException if the artifact object or project object isn't found in the database. + * @throws ArchivaDatabaseException if there is a fundamental database error. + */ + public ArchivaProjectModel selectVersion( String principle, List observableRepositoryIds, String groupId, + String artifactId, String version ) + throws ObjectNotFoundException, ArchivaDatabaseException; + + /** + * Get the {@link List} of {@link ArchivaProjectModel} that are used by the provided + * groupId, artifactId, and version specified. + * + * @param groupId the groupId selected + * @param artifactId the artifactId selected + * @param version the version selected + * @return the {@link List} of {@link ArchivaProjectModel} objects. (never null, but can be empty) + * @throws ArchivaDatabaseException if there is a fundamental database error. + */ + public List getUsedBy( String principle, List observableRepositoryIds, String groupId, + String artifactId, String version ) + throws ArchivaDatabaseException; + + + public String getRepositoryId( String principle, List observableRepositoryIds, String groupId, + String artifactId, String version ) + throws ObjectNotFoundException, ArchivaDatabaseException; +} diff --git a/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/AbstractDeclarativeConstraint.java b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/AbstractDeclarativeConstraint.java new file mode 100644 index 000000000..fe3985a02 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/AbstractDeclarativeConstraint.java @@ -0,0 +1,83 @@ +package org.apache.maven.archiva.database.constraints; + +/* + * 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.archiva.database.Constraint; +import org.apache.maven.archiva.database.DeclarativeConstraint; + +/** + * AbstractDeclarativeConstraint + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public abstract class AbstractDeclarativeConstraint + implements DeclarativeConstraint +{ + protected String[] declImports; + + protected String[] declParams; + + protected String[] variables; + + protected Object[] params; + + protected int[] range; + + public String getFilter() + { + return null; + } + + public String getFetchLimits() + { + return null; + } + + public String[] getDeclaredImports() + { + return declImports; + } + + public String[] getDeclaredParameters() + { + return declParams; + } + + public Object[] getParameters() + { + return params; + } + + public String getSortDirection() + { + return Constraint.ASCENDING; + } + + public String[] getVariables() + { + return variables; + } + + public int[] getRange() + { + return range; + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/AbstractSimpleConstraint.java b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/AbstractSimpleConstraint.java new file mode 100644 index 000000000..5bf85741d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/AbstractSimpleConstraint.java @@ -0,0 +1,49 @@ +package org.apache.maven.archiva.database.constraints; + +/* + * 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.archiva.database.SimpleConstraint; + +/** + * Simple Constraint abstract for working with nearly-raw SQL strings. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public abstract class AbstractSimpleConstraint + implements SimpleConstraint +{ + protected Object[] params; + + public Object[] getParameters() + { + return params; + } + + public String getFetchLimits() + { + return null; + } + + public boolean isResultsPersistable() + { + return false; + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/ArchivaRepositoryByUrlConstraint.java b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/ArchivaRepositoryByUrlConstraint.java new file mode 100644 index 000000000..57df0ecf8 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/ArchivaRepositoryByUrlConstraint.java @@ -0,0 +1,50 @@ +package org.apache.maven.archiva.database.constraints; + +/* + * 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.archiva.database.Constraint; + +/** + * ArchivaRepositoryByUrlConstraint + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ArchivaRepositoryByUrlConstraint + extends AbstractDeclarativeConstraint + implements Constraint +{ + private String whereCondition; + + public ArchivaRepositoryByUrlConstraint( String url ) + { + whereCondition = "this.url == '" + url + "'"; + } + + public String getWhereCondition() + { + return whereCondition; + } + + public String getSortColumn() + { + return "url"; + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/ArtifactVersionsConstraint.java b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/ArtifactVersionsConstraint.java new file mode 100644 index 000000000..c7eee23a5 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/ArtifactVersionsConstraint.java @@ -0,0 +1,71 @@ +package org.apache.maven.archiva.database.constraints; + +/* + * 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.archiva.database.Constraint; + +/** + * ArtifactVersionsConstraint + * + * @author Maria Odea Ching + * @version + */ +public class ArtifactVersionsConstraint + extends AbstractDeclarativeConstraint + implements Constraint +{ + private String whereClause = ""; + + private String sortColumn = "repositoryId"; + + public ArtifactVersionsConstraint( String repoId, String groupId, String artifactId ) + { + if( repoId != null ) + { + whereClause = "repositoryId.equals(selectedRepoId) && groupId.equals(selectedGroupId) && artifactId.equals(selectedArtifactId) " + + "&& whenGathered != null"; + declParams = new String[] { "String selectedRepoId", "String selectedGroupId", "String selectedArtifactId" }; + params = new Object[] { repoId, groupId, artifactId }; + } + else + { + whereClause = "groupId.equals(selectedGroupId) && artifactId.equals(selectedArtifactId) && this.whenGathered != null"; + declParams = new String[] { "String selectedGroupId", "String selectedArtifactId" }; + params = new Object[] { groupId, artifactId }; + } + } + + public ArtifactVersionsConstraint( String repoId, String groupId, String artifactId, String sortColumn ) + { + this( repoId, groupId, artifactId ); + this.sortColumn = sortColumn; + } + + public String getSortColumn() + { + return sortColumn; + } + + public String getWhereCondition() + { + return whereClause; + } + +} diff --git a/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/ArtifactsByChecksumConstraint.java b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/ArtifactsByChecksumConstraint.java new file mode 100644 index 000000000..f814730fb --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/ArtifactsByChecksumConstraint.java @@ -0,0 +1,88 @@ +package org.apache.maven.archiva.database.constraints; + +/* + * 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.maven.archiva.database.Constraint; + +/** + * Constraint for retrieving artifacts whose sha1 or md5 checksum matches the + * specified value. + * + * @author Maria Odea Ching + */ +public class ArtifactsByChecksumConstraint + extends AbstractDeclarativeConstraint + implements Constraint +{ + private String whereClause; + + public static final String SHA1 = "SHA1"; + + public static final String MD5 = "MD5"; + + /** + * Create constraint for checksum (without providing type) + * + * @param desiredChecksum the checksum (either SHA1 or MD5) + */ + public ArtifactsByChecksumConstraint( String desiredChecksum ) + { + this( desiredChecksum, null ); + } + + /** + * Create constraint for specific checksum. + * + * @param desiredChecksum the checksum (either SHA1 or MD5) + * @param type the type of checksum (either {@link #SHA1} or {@link #MD5}) + */ + public ArtifactsByChecksumConstraint( String desiredChecksum, String type ) + { + if ( StringUtils.isEmpty( type ) ) + { + // default for no specified type. + whereClause = "this.checksumSHA1 == desiredChecksum || this.checksumMD5 == desiredChecksum"; + } + else if ( !type.equals( SHA1 ) && !type.equals( MD5 ) ) + { + // default for type that isn't recognized. + whereClause = "this.checksumSHA1 == desiredChecksum || this.checksumMD5 == desiredChecksum"; + } + else if ( type.equals( SHA1 ) || type.equals( MD5 ) ) + { + // specific type. + whereClause = "this.checksum" + type.trim() + " == desiredChecksum"; + } + + declParams = new String[]{"String desiredChecksum"}; + params = new Object[]{desiredChecksum.toLowerCase()}; + } + + public String getSortColumn() + { + return "groupId"; + } + + public String getWhereCondition() + { + return whereClause; + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/ArtifactsByRepositoryConstraint.java b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/ArtifactsByRepositoryConstraint.java new file mode 100644 index 000000000..4506123a2 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/ArtifactsByRepositoryConstraint.java @@ -0,0 +1,65 @@ +package org.apache.maven.archiva.database.constraints; + +/* + * 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.Date; + +import org.apache.maven.archiva.database.Constraint; + +/** + * ArtifactsByRepositoryConstraint + * + * @author Maria Odea Ching + * @version + */ +public class ArtifactsByRepositoryConstraint + extends AbstractDeclarativeConstraint + implements Constraint +{ + private String whereClause; + + private String sortColumn = "groupId"; + + public ArtifactsByRepositoryConstraint( String repoId ) + { + whereClause = "repositoryId == repoId"; + declParams = new String[] { "String repoId" }; + params = new Object[] { repoId }; + } + + public ArtifactsByRepositoryConstraint( String repoId, Date targetWhenGathered, String sortColumn ) + { + declImports = new String[] { "import java.util.Date" }; + whereClause = "this.repositoryId == repoId && this.whenGathered >= targetWhenGathered"; + declParams = new String[] { "String repoId", "Date targetWhenGathered" }; + params = new Object[] { repoId, targetWhenGathered }; + this.sortColumn = sortColumn; + } + + public String getSortColumn() + { + return sortColumn; + } + + public String getWhereCondition() + { + return whereClause; + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/ArtifactsProcessedConstraint.java b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/ArtifactsProcessedConstraint.java new file mode 100644 index 000000000..987e1ba3b --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/ArtifactsProcessedConstraint.java @@ -0,0 +1,72 @@ +package org.apache.maven.archiva.database.constraints; + +/* + * 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.archiva.database.Constraint; + +import java.util.Date; + +/** + * ArtifactsProcessedConstraint + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ArtifactsProcessedConstraint + extends AbstractDeclarativeConstraint + implements Constraint +{ + private String whereClause; + + public ArtifactsProcessedConstraint( boolean isProcessed ) + { + if ( isProcessed ) + { + whereClause = "whenProcessed != null"; + } + else + { + whereClause = "whenProcessed == null"; + } + } + + /** + * A Constraint showing artifacts processed since date provided. + * @param since + */ + public ArtifactsProcessedConstraint( Date since ) + { + whereClause = "whenProcessed > since"; + declImports = new String[] { "import java.util.Date" }; + declParams = new String[] { "Date since" }; + params = new Object[] { since }; + } + + public String getSortColumn() + { + return "groupId"; + } + + public String getWhereCondition() + { + return whereClause; + } + +} diff --git a/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/ArtifactsRelatedConstraint.java b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/ArtifactsRelatedConstraint.java new file mode 100644 index 000000000..4b3062afe --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/ArtifactsRelatedConstraint.java @@ -0,0 +1,52 @@ +package org.apache.maven.archiva.database.constraints; + +/* + * 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.archiva.database.Constraint; + +/** + * ArtifactsRelatedConstraint + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ArtifactsRelatedConstraint + extends AbstractDeclarativeConstraint + implements Constraint +{ + private String whereClause; + + public ArtifactsRelatedConstraint( String groupId, String artifactId, String version ) + { + whereClause = "groupId.equals(selectedGroupId) && artifactId.equals(selectedArtifactId) && version.equals(selectedVersion)"; + declParams = new String[] { "String selectedGroupId", "String selectedArtifactId", "String selectedVersion" }; + params = new Object[] { groupId, artifactId, version }; + } + + public String getSortColumn() + { + return "classifier"; + } + + public String getWhereCondition() + { + return whereClause; + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/MostRecentRepositoryScanStatistics.java b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/MostRecentRepositoryScanStatistics.java new file mode 100644 index 000000000..fdc4ff2cc --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/MostRecentRepositoryScanStatistics.java @@ -0,0 +1,53 @@ +package org.apache.maven.archiva.database.constraints; + +/* + * 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.archiva.model.RepositoryContentStatistics; + +/** + * MostRecentRepositoryScanStatistics + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class MostRecentRepositoryScanStatistics + extends AbstractSimpleConstraint +{ + private String sql; + + public MostRecentRepositoryScanStatistics( String repoId ) + { + sql = "SELECT FROM " + RepositoryContentStatistics.class.getName() + + " WHERE repositoryId == repoId PARAMETERS String repoId" + " ORDER BY whenGathered DESCENDING" + + " RANGE 0,1"; + + super.params = new Object[]{repoId}; + } + + public Class getResultClass() + { + return RepositoryContentStatistics.class; + } + + public String getSelectSql() + { + return sql; + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/OlderArtifactsByAgeConstraint.java b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/OlderArtifactsByAgeConstraint.java new file mode 100644 index 000000000..5e577d9ac --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/OlderArtifactsByAgeConstraint.java @@ -0,0 +1,60 @@ +package org.apache.maven.archiva.database.constraints; + +/* + * 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.archiva.database.Constraint; + +import java.util.Calendar; +import java.util.Date; + +/** + * Constraint for artifacts that are of a certain age (in days) or older. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class OlderArtifactsByAgeConstraint + extends AbstractDeclarativeConstraint + implements Constraint +{ + private String whereClause; + + public OlderArtifactsByAgeConstraint( int daysOld ) + { + Calendar cal = Calendar.getInstance(); + cal.add( Calendar.DAY_OF_MONTH, ( -1 ) * daysOld ); + Date cutoffDate = cal.getTime(); + + whereClause = "this.lastModified <= cutoffDate"; + declImports = new String[] { "import java.util.Date" }; + declParams = new String[] { "java.util.Date cutoffDate" }; + params = new Object[] { cutoffDate }; + } + + public String getSortColumn() + { + return "groupId"; + } + + public String getWhereCondition() + { + return whereClause; + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/OlderSnapshotArtifactsByAgeConstraint.java b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/OlderSnapshotArtifactsByAgeConstraint.java new file mode 100644 index 000000000..925def758 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/OlderSnapshotArtifactsByAgeConstraint.java @@ -0,0 +1,60 @@ +package org.apache.maven.archiva.database.constraints; + +/* + * 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.archiva.database.Constraint; + +import java.util.Calendar; +import java.util.Date; + +/** + * Constraint for snapshot artifacts that are of a certain age (in days) or older. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class OlderSnapshotArtifactsByAgeConstraint + extends AbstractDeclarativeConstraint + implements Constraint +{ + private String whereClause; + + public OlderSnapshotArtifactsByAgeConstraint( int daysOld ) + { + Calendar cal = Calendar.getInstance(); + cal.add( Calendar.DAY_OF_MONTH, ( -1 ) * daysOld ); + Date cutoffDate = cal.getTime(); + + whereClause = "this.lastModified <= cutoffDate && this.snapshot == true"; + declImports = new String[] { "import java.util.Date" }; + declParams = new String[] { "java.util.Date cutoffDate" }; + params = new Object[] { cutoffDate }; + } + + public String getSortColumn() + { + return "groupId"; + } + + public String getWhereCondition() + { + return whereClause; + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/ProjectsByArtifactUsageConstraint.java b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/ProjectsByArtifactUsageConstraint.java new file mode 100644 index 000000000..39d599727 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/ProjectsByArtifactUsageConstraint.java @@ -0,0 +1,81 @@ +package org.apache.maven.archiva.database.constraints; + +/* + * 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.archiva.database.DeclarativeConstraint; +import org.apache.maven.archiva.model.ArchivaArtifact; +import org.apache.maven.archiva.model.Dependency; + +/** + * ProjectsByArtifactUsageConstraint + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ProjectsByArtifactUsageConstraint + extends AbstractDeclarativeConstraint + implements DeclarativeConstraint +{ + private String filter; + + public ProjectsByArtifactUsageConstraint( ArchivaArtifact artifact ) + { + this( artifact.getGroupId(), artifact.getArtifactId(), artifact.getBaseVersion() ); + } + + public ProjectsByArtifactUsageConstraint( String groupId, String artifactId, String version ) + { + super.declImports = new String[] { + "import " + Dependency.class.getName() + }; + + super.variables = new String[] { + "Dependency dep" + }; + + super.declParams = new String[] { + "String selectedGroupId", + "String selectedArtifactId", + "String selectedVersion" + }; + + filter = "dependencies.contains( dep ) && " + + "dep.groupId == selectedGroupId && " + + "dep.artifactId == selectedArtifactId && " + + "dep.version == selectedVersion"; + + super.params = new Object[] { groupId, artifactId, version }; + } + + public String getSortColumn() + { + return "groupId"; + } + + public String getWhereCondition() + { + return null; + } + + public String getFilter() + { + return filter; + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/RangeConstraint.java b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/RangeConstraint.java new file mode 100644 index 000000000..268e3191c --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/RangeConstraint.java @@ -0,0 +1,60 @@ +package org.apache.maven.archiva.database.constraints; + +/* + * 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.archiva.database.Constraint; + +/** + * RangeConstraint + */ +public class RangeConstraint + extends AbstractDeclarativeConstraint + implements Constraint +{ + private String sortColumn; + + public RangeConstraint() + { + this.range = null; + this.sortColumn = null; + } + + public RangeConstraint( int[] range ) + { + this.range = range; + this.sortColumn = null; + } + + public RangeConstraint( int[] range, String sortColumn ) + { + this.range = range; + this.sortColumn = sortColumn; + } + + public String getSortColumn() + { + return sortColumn; + } + + public String getWhereCondition() + { + return null; + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/RecentArtifactsByAgeConstraint.java b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/RecentArtifactsByAgeConstraint.java new file mode 100644 index 000000000..33e9f0f2b --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/RecentArtifactsByAgeConstraint.java @@ -0,0 +1,61 @@ +package org.apache.maven.archiva.database.constraints; + +/* + * 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.archiva.database.Constraint; + +import java.util.Calendar; +import java.util.Date; + +/** + * Constraint for artifacts that are of a certain age (in days) or newer. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class RecentArtifactsByAgeConstraint + extends AbstractDeclarativeConstraint + implements Constraint +{ + private String whereClause; + + public RecentArtifactsByAgeConstraint( int daysOld ) + { + Calendar cal = Calendar.getInstance(); + // Extra subtraction of 1 done to allow for lastModified that occur on the day represented by 'daysOld'. + cal.add( Calendar.DAY_OF_MONTH, (( -1 ) * daysOld) - 1 ); + Date cutoffDate = cal.getTime(); + + whereClause = "this.lastModified >= cutoffDate"; + declImports = new String[] { "import java.util.Date" }; + declParams = new String[] { "java.util.Date cutoffDate" }; + params = new Object[] { cutoffDate }; + } + + public String getSortColumn() + { + return "groupId"; + } + + public String getWhereCondition() + { + return whereClause; + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/RepositoryContentStatisticsByRepositoryConstraint.java b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/RepositoryContentStatisticsByRepositoryConstraint.java new file mode 100644 index 000000000..dc3990980 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/RepositoryContentStatisticsByRepositoryConstraint.java @@ -0,0 +1,49 @@ +package org.apache.maven.archiva.database.constraints; + +/* + * 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. + */ + +/** + * RepositoryContentStatisticsByRepositoryConstraint + * + * @author Maria Odea Ching + * @version + */ +public class RepositoryContentStatisticsByRepositoryConstraint + extends AbstractDeclarativeConstraint +{ + private String whereClause; + + public RepositoryContentStatisticsByRepositoryConstraint( String repoId ) + { + whereClause = "repositoryId == repoId"; + declParams = new String[] { "String repoId" }; + params = new Object[] { repoId }; + } + + public String getSortColumn() + { + return "whenGathered"; + } + + public String getWhereCondition() + { + return whereClause; + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/RepositoryProblemByArtifactConstraint.java b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/RepositoryProblemByArtifactConstraint.java new file mode 100644 index 000000000..587f522c7 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/RepositoryProblemByArtifactConstraint.java @@ -0,0 +1,57 @@ +package org.apache.maven.archiva.database.constraints; + +/* + * 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.archiva.database.Constraint; +import org.apache.maven.archiva.model.ArchivaArtifact; + +/** + * RepositoryProblemByArtifactConstraint + */ +public class RepositoryProblemByArtifactConstraint + extends AbstractDeclarativeConstraint + implements Constraint +{ + private String whereClause; + + private void createWhereClause( ArchivaArtifact artifact ) + { + whereClause = + "groupId.like(desiredGroupId) && artifactId.like(desiredArtifactId) && version.like(desiredVersion)"; + declParams = new String[] { "String desiredGroupId" , "String desiredArtifactId" , "String desiredVersion"}; + params = new Object[] { artifact.getGroupId() + "%" , artifact.getArtifactId() + "%", artifact.getVersion() + "%"}; + } + + public RepositoryProblemByArtifactConstraint( ArchivaArtifact desiredArtifact ) + { + super(); + createWhereClause( desiredArtifact ); + } + + public String getSortColumn() + { + return "artifactId"; + } + + public String getWhereCondition() + { + return whereClause; + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/RepositoryProblemByGroupIdConstraint.java b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/RepositoryProblemByGroupIdConstraint.java new file mode 100644 index 000000000..dd07add4f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/RepositoryProblemByGroupIdConstraint.java @@ -0,0 +1,61 @@ +package org.apache.maven.archiva.database.constraints; + +/* + * 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.archiva.database.Constraint; + +/** + * RepositoryProblemByGroupIdConstraint + */ +public class RepositoryProblemByGroupIdConstraint + extends RangeConstraint + implements Constraint +{ + private String whereClause; + + private void createWhereClause( String desiredGroupId ) + { + whereClause = "groupId.like(desiredGroupId)"; + declParams = new String[]{"String desiredGroupId"}; + params = new Object[]{desiredGroupId + "%"}; + } + + public RepositoryProblemByGroupIdConstraint( String desiredGroupId ) + { + super(); + createWhereClause( desiredGroupId ); + } + + public RepositoryProblemByGroupIdConstraint( int[] range, String desiredGroupId ) + { + super( range ); + createWhereClause( desiredGroupId ); + } + + public String getSortColumn() + { + return "repositoryId"; + } + + public String getWhereCondition() + { + return whereClause; + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/RepositoryProblemByRepositoryIdConstraint.java b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/RepositoryProblemByRepositoryIdConstraint.java new file mode 100644 index 000000000..d1b5de7d8 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/RepositoryProblemByRepositoryIdConstraint.java @@ -0,0 +1,61 @@ +package org.apache.maven.archiva.database.constraints; + +/* + * 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.archiva.database.Constraint; + +/** + * RepositoryProblemByRepositoryIdConstraint + */ +public class RepositoryProblemByRepositoryIdConstraint + extends RangeConstraint + implements Constraint +{ + private String whereClause; + + private void createWhereClause( String desiredRepositoryId ) + { + whereClause = "repositoryId == desiredRepositoryId"; + declParams = new String[]{"String desiredRepositoryId"}; + params = new Object[]{desiredRepositoryId}; + } + + public RepositoryProblemByRepositoryIdConstraint( String desiredRepositoryId ) + { + super(); + createWhereClause( desiredRepositoryId ); + } + + public RepositoryProblemByRepositoryIdConstraint( int[] range, String desiredRepositoryId ) + { + super( range ); + createWhereClause( desiredRepositoryId ); + } + + public String getSortColumn() + { + return "groupId"; + } + + public String getWhereCondition() + { + return whereClause; + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/RepositoryProblemByTypeConstraint.java b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/RepositoryProblemByTypeConstraint.java new file mode 100644 index 000000000..cfc89cdc5 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/RepositoryProblemByTypeConstraint.java @@ -0,0 +1,52 @@ +package org.apache.maven.archiva.database.constraints; + +/* + * 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.archiva.database.Constraint; + +/** + * RepositoryProblemByTypeConstraint + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class RepositoryProblemByTypeConstraint + extends AbstractDeclarativeConstraint + implements Constraint +{ + private String whereClause; + + public RepositoryProblemByTypeConstraint( String desiredType ) + { + whereClause = "type == desiredType"; + declParams = new String[] { "String desiredType" }; + params = new Object[] { desiredType }; + } + + public String getSortColumn() + { + return "groupId"; + } + + public String getWhereCondition() + { + return whereClause; + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/RepositoryProblemConstraint.java b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/RepositoryProblemConstraint.java new file mode 100644 index 000000000..eaff8338b --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/RepositoryProblemConstraint.java @@ -0,0 +1,61 @@ +package org.apache.maven.archiva.database.constraints; + +/* + * 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.archiva.database.Constraint; + +/** + * RepositoryProblemConstraint + */ +public class RepositoryProblemConstraint + extends RangeConstraint + implements Constraint +{ + private String whereClause; + + private void createWhereClause( String desiredGroupId, String desiredRepositoryId ) + { + whereClause = "groupId.like(desiredGroupId) && repositoryId == desiredRepositoryId"; + declParams = new String[]{"String desiredGroupId", "String desiredRepositoryId"}; + params = new Object[]{desiredGroupId + "%", desiredRepositoryId}; + } + + public RepositoryProblemConstraint( String desiredGroupId, String desiredRepositoryId ) + { + super(); + createWhereClause( desiredGroupId, desiredRepositoryId ); + } + + public RepositoryProblemConstraint( int[] range, String desiredGroupId, String desiredRepositoryId ) + { + super( range ); + createWhereClause( desiredGroupId, desiredRepositoryId ); + } + + public String getSortColumn() + { + return "artifactId"; + } + + public String getWhereCondition() + { + return whereClause; + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/SqlBuilder.java b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/SqlBuilder.java new file mode 100644 index 000000000..208475dab --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/SqlBuilder.java @@ -0,0 +1,80 @@ +package org.apache.maven.archiva.database.constraints; + +/* + * 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 java.util.List; + +/** + * SqlBuilder - common sql building mechanisms. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class SqlBuilder +{ + /** + * Append a sql specific where clause within "()" braces that selects the specific + * repository ids provided. + * + * NOTE: This does not append the "WHERE" statement itself. + * + * @param sql the sql buffer to append to. + * @param fieldId the field id for the repository Id. + * @param selectedRepositoryIds the list of repository ids to provide. + */ + public static void appendWhereSelectedRepositories( StringBuffer sql, String fieldId, + List selectedRepositoryIds ) + { + if ( fieldId == null ) + { + throw new NullPointerException( "Null field id is not allowed." ); + } + + if ( StringUtils.isBlank( fieldId ) ) + { + throw new IllegalArgumentException( "Blank field id is not allowed." ); + } + + if ( selectedRepositoryIds == null ) + { + throw new NullPointerException( "Selected repositories cannot be null." ); + } + + if ( selectedRepositoryIds.isEmpty() ) + { + throw new IllegalArgumentException( "Selected repositories cannot be null." ); + } + + sql.append( " (" ); + boolean multiple = false; + for ( String repo : selectedRepositoryIds ) + { + if ( multiple ) + { + sql.append( " || " ); + } + sql.append( " " ).append( fieldId ).append( " == \"" ).append( repo ).append( "\"" ); + multiple = true; + } + sql.append( " )" ); + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/UniqueArtifactIdConstraint.java b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/UniqueArtifactIdConstraint.java new file mode 100644 index 000000000..47766b94e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/UniqueArtifactIdConstraint.java @@ -0,0 +1,97 @@ +package org.apache.maven.archiva.database.constraints; + +/* + * 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.archiva.database.Constraint; +import org.apache.maven.archiva.model.ArchivaArtifactModel; + +import java.util.List; + +/** + * Obtain a set of unique ArtifactIds for the specified groupId. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class UniqueArtifactIdConstraint + extends AbstractSimpleConstraint + implements Constraint +{ + private StringBuffer sql = new StringBuffer(); + + /** + * Obtain a set of unique ArtifactIds for the specified groupId. + * + * @param groupId the groupId to search for artifactIds within. + */ + public UniqueArtifactIdConstraint( List selectedRepositoryIds, String groupId ) + { + appendSelect( sql ); + sql.append( " WHERE " ); + SqlBuilder.appendWhereSelectedRepositories( sql, "repositoryId", selectedRepositoryIds ); + sql.append( " && " ); + appendWhereSelectedGroupId( sql ); + appendGroupBy( sql ); + + super.params = new Object[] { groupId }; + } + + /** + * Obtain a set of unique ArtifactIds for the specified groupId. + * + * @param groupId the groupId to search for artifactIds within. + */ + public UniqueArtifactIdConstraint( String groupId ) + { + appendSelect( sql ); + sql.append( " WHERE " ); + appendWhereSelectedGroupId( sql ); + appendGroupBy( sql ); + + super.params = new Object[] { groupId }; + } + + @SuppressWarnings("unchecked") + public Class getResultClass() + { + return String.class; + } + + public String getSelectSql() + { + return sql.toString(); + } + + private void appendGroupBy( StringBuffer buf ) + { + buf.append( " GROUP BY artifactId ORDER BY artifactId ASCENDING" ); + } + + private void appendSelect( StringBuffer buf ) + { + buf.append( "SELECT artifactId FROM " ).append( ArchivaArtifactModel.class.getName() ); + } + + private void appendWhereSelectedGroupId( StringBuffer buf ) + { + buf.append( " groupId == selectedGroupId PARAMETERS String selectedGroupId" ); + } + +} diff --git a/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/UniqueFieldConstraint.java b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/UniqueFieldConstraint.java new file mode 100644 index 000000000..8e22ac255 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/UniqueFieldConstraint.java @@ -0,0 +1,57 @@ +package org.apache.maven.archiva.database.constraints; + +/* + * 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.archiva.database.Constraint; + +/** + * UniqueFieldConstraint + */ +public class UniqueFieldConstraint + extends AbstractSimpleConstraint + implements Constraint +{ + private String sql; + + public UniqueFieldConstraint( String className, String fieldName ) + { + sql = "SELECT " + fieldName + " FROM " + className + " GROUP BY " + fieldName + " ORDER BY " + fieldName + + " ASCENDING"; + } + + public UniqueFieldConstraint( String className, String fieldName, String fieldNamePrefix ) + { + sql = "SELECT " + fieldName + " FROM " + className + " WHERE " + fieldName + + ".startsWith( fieldPrefix ) PARAMETERS String fieldPrefix GROUP BY " + fieldName + " ORDER BY " + + fieldName + " ASCENDING"; + + super.params = new Object[]{fieldNamePrefix}; + } + + public Class getResultClass() + { + return String.class; + } + + public String getSelectSql() + { + return sql; + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/UniqueGroupIdConstraint.java b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/UniqueGroupIdConstraint.java new file mode 100644 index 000000000..06490c211 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/UniqueGroupIdConstraint.java @@ -0,0 +1,101 @@ +package org.apache.maven.archiva.database.constraints; + +/* + * 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.archiva.database.Constraint; +import org.apache.maven.archiva.model.ArchivaArtifactModel; + +import java.util.List; + +/** + * UniqueGroupIdConstraint + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class UniqueGroupIdConstraint + extends AbstractSimpleConstraint + implements Constraint +{ + private StringBuffer sql = new StringBuffer(); + + public UniqueGroupIdConstraint() + { + /* this assumes search for no groupId prefix */ + appendSelect( sql ); + appendGroupBy( sql ); + } + + public UniqueGroupIdConstraint( List selectedRepositories ) + { + appendSelect( sql ); + sql.append( " WHERE " ); + SqlBuilder.appendWhereSelectedRepositories( sql, "repositoryId", selectedRepositories ); + appendGroupBy( sql ); + } + + public UniqueGroupIdConstraint( List selectedRepositories, String groupIdPrefix ) + { + appendSelect( sql ); + sql.append( " WHERE " ); + SqlBuilder.appendWhereSelectedRepositories( sql, "repositoryId", selectedRepositories ); + sql.append( " && " ); + appendWhereGroupIdStartsWith( sql ); + appendGroupBy( sql ); + + super.params = new Object[] { groupIdPrefix }; + } + + public UniqueGroupIdConstraint( String groupIdPrefix ) + { + appendSelect( sql ); + sql.append( " WHERE " ); + appendWhereGroupIdStartsWith( sql ); + appendGroupBy( sql ); + + super.params = new Object[] { groupIdPrefix }; + } + + @SuppressWarnings("unchecked") + public Class getResultClass() + { + return String.class; + } + + public String getSelectSql() + { + return sql.toString(); + } + + private void appendGroupBy( StringBuffer buf ) + { + buf.append( " GROUP BY groupId ORDER BY groupId ASCENDING" ); + } + + private void appendSelect( StringBuffer buf ) + { + buf.append( "SELECT groupId FROM " ).append( ArchivaArtifactModel.class.getName() ); + } + + private void appendWhereGroupIdStartsWith( StringBuffer buf ) + { + buf.append( " groupId.startsWith(groupIdPrefix) PARAMETERS String groupIdPrefix" ); + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/UniqueVersionConstraint.java b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/UniqueVersionConstraint.java new file mode 100644 index 000000000..c36e34f82 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/UniqueVersionConstraint.java @@ -0,0 +1,121 @@ +package org.apache.maven.archiva.database.constraints; + +/* + * 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.maven.archiva.database.Constraint; +import org.apache.maven.archiva.model.ArchivaArtifactModel; + +import java.util.List; + +/** + * Obtain the list of version's for specific GroupId and ArtifactId. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class UniqueVersionConstraint + extends AbstractSimpleConstraint + implements Constraint +{ + private StringBuffer sql = new StringBuffer(); + + /** + * Obtain the list of version's for specific GroupId and ArtifactId. + * + * @param selectedRepositoryIds the selected repository ids. + * @param groupId the selected groupId. + * @param artifactId the selected artifactId. + */ + public UniqueVersionConstraint( List selectedRepositoryIds, String groupId, String artifactId ) + { + if ( StringUtils.isBlank( groupId ) ) + { + throw new IllegalArgumentException( "A blank groupId is not allowed." ); + } + + if ( StringUtils.isBlank( artifactId ) ) + { + throw new IllegalArgumentException( "A blank artifactId is not allowed." ); + } + + appendSelect( sql ); + sql.append( " WHERE " ); + SqlBuilder.appendWhereSelectedRepositories( sql, "repositoryId", selectedRepositoryIds ); + sql.append( " && " ); + appendWhereSelectedGroupIdArtifactId( sql ); + appendGroupBy( sql ); + + super.params = new Object[] { groupId, artifactId }; + } + + /** + * Obtain the list of version's for specific GroupId and ArtifactId. + * + * @param groupId the selected groupId. + * @param artifactId the selected artifactId. + */ + public UniqueVersionConstraint( String groupId, String artifactId ) + { + if ( StringUtils.isBlank( groupId ) ) + { + throw new IllegalArgumentException( "A blank groupId is not allowed." ); + } + + if ( StringUtils.isBlank( artifactId ) ) + { + throw new IllegalArgumentException( "A blank artifactId is not allowed." ); + } + + appendSelect( sql ); + sql.append( " WHERE " ); + appendWhereSelectedGroupIdArtifactId( sql ); + appendGroupBy( sql ); + + super.params = new Object[] { groupId, artifactId }; + } + + @SuppressWarnings("unchecked") + public Class getResultClass() + { + return String.class; + } + + public String getSelectSql() + { + return sql.toString(); + } + + private void appendGroupBy( StringBuffer buf ) + { + buf.append( " GROUP BY version ORDER BY version ASCENDING" ); + } + + private void appendSelect( StringBuffer buf ) + { + buf.append( "SELECT version FROM " ).append( ArchivaArtifactModel.class.getName() ); + } + + private void appendWhereSelectedGroupIdArtifactId( StringBuffer buf ) + { + buf.append( " groupId == selectedGroupId && artifactId == selectedArtifactId" ); + buf.append( " PARAMETERS String selectedGroupId, String selectedArtifactId" ); + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/jdo/JdoAccess.java b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/jdo/JdoAccess.java new file mode 100644 index 000000000..d0512dcc4 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/jdo/JdoAccess.java @@ -0,0 +1,599 @@ +package org.apache.maven.archiva.database.jdo; + +/* + * 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.maven.archiva.database.ArchivaDatabaseException; +import org.apache.maven.archiva.database.Constraint; +import org.apache.maven.archiva.database.DeclarativeConstraint; +import org.apache.maven.archiva.database.ObjectNotFoundException; +import org.apache.maven.archiva.database.SimpleConstraint; +import org.apache.maven.archiva.database.constraints.AbstractSimpleConstraint; +import org.apache.maven.archiva.model.CompoundKey; +import org.codehaus.plexus.jdo.JdoFactory; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException; + +import java.io.PrintStream; +import java.util.ArrayList; +import java.util.List; + +import javax.jdo.Extent; +import javax.jdo.JDOException; +import javax.jdo.JDOHelper; +import javax.jdo.JDOObjectNotFoundException; +import javax.jdo.JDOUserException; +import javax.jdo.PersistenceManager; +import javax.jdo.PersistenceManagerFactory; +import javax.jdo.Query; +import javax.jdo.Transaction; +import javax.jdo.datastore.DataStoreCache; +import javax.jdo.listener.InstanceLifecycleEvent; +import javax.jdo.listener.InstanceLifecycleListener; +import javax.jdo.listener.StoreLifecycleListener; +import javax.jdo.spi.Detachable; +import javax.jdo.spi.PersistenceCapable; + +/** + * JdoAccess + * + * @author Joakim Erdfelt + * @version $Id$ + * @plexus.component role="org.apache.maven.archiva.database.jdo.JdoAccess" role-hint="archiva" + */ +public class JdoAccess + implements Initializable, InstanceLifecycleListener, StoreLifecycleListener +{ + /** + * @plexus.requirement role-hint="archiva" + */ + private JdoFactory jdoFactory; + + private PersistenceManagerFactory pmf; + + public void initialize() + throws InitializationException + { + pmf = jdoFactory.getPersistenceManagerFactory(); + + /* Primitive (and failed) attempt at creating the schema on startup. + Just to prevent the multiple stack trace warnings on auto-gen of schema. + + // Create the schema (if needed) + URL jdoFileUrls[] = new URL[] { getClass().getResource( "/org/apache/maven/archiva/model/package.jdo" ) }; + + File propsFile = null; // intentional + boolean verbose = true; + + try + { + String connectionFactoryName = pmf.getConnectionFactoryName(); + if ( StringUtils.isNotBlank( connectionFactoryName ) && connectionFactoryName.startsWith( "java:comp" ) ) + { + // We have a JNDI datasource! + String jndiDatasource = connectionFactoryName; + System.setProperty( PMFConfiguration.JDO_DATASTORE_URL_PROPERTY, jndiDatasource ); + } + + // TODO: figure out how to get the jdbc driver details from JNDI to pass into SchemaTool. + + SchemaTool.createSchemaTables( jdoFileUrls, new URL[] {}, propsFile, verbose, null ); + } + catch ( Exception e ) + { + getLogger().error( "Unable to create schema: " + e.getMessage(), e ); + } + + pmf.getPersistenceManager(); + */ + + // Add the lifecycle listener. + pmf.addInstanceLifecycleListener( this, null ); + } + + public static void dumpObjectState( PrintStream out, Object o ) + { + final String STATE = "[STATE] "; + final String INDENT = " "; + + if ( o == null ) + { + out.println( STATE + "Object is null." ); + return; + } + + out.println( STATE + "Object " + o.getClass().getName() ); + + if ( !( o instanceof PersistenceCapable ) ) + { + out.println( INDENT + "is NOT PersistenceCapable (not a jdo object?)" ); + return; + } + + out.println( INDENT + "is PersistenceCapable." ); + if ( o instanceof Detachable ) + { + out.println( INDENT + "is Detachable" ); + } + + out.println( INDENT + "is new : " + Boolean.toString( JDOHelper.isNew( o ) ) ); + out.println( INDENT + "is transactional : " + Boolean.toString( JDOHelper.isTransactional( o ) ) ); + out.println( INDENT + "is deleted : " + Boolean.toString( JDOHelper.isDeleted( o ) ) ); + out.println( INDENT + "is detached : " + Boolean.toString( JDOHelper.isDetached( o ) ) ); + out.println( INDENT + "is dirty : " + Boolean.toString( JDOHelper.isDirty( o ) ) ); + out.println( INDENT + "is persistent : " + Boolean.toString( JDOHelper.isPersistent( o ) ) ); + + out.println( INDENT + "object id : " + JDOHelper.getObjectId( o ) ); + } + + public PersistenceManager getPersistenceManager() + { + PersistenceManager pm = pmf.getPersistenceManager(); + + pm.getFetchPlan().setMaxFetchDepth( -1 ); + + return pm; + } + + public void enableCache( Class clazz ) + { + DataStoreCache cache = pmf.getDataStoreCache(); + cache.pinAll( clazz, false ); // Pin all objects of type clazz from now on + } + + public Object saveObject( Object object ) + { + return saveObject( object, null ); + } + + public Object saveObject( Object object, String[] fetchGroups ) + { + PersistenceManager pm = getPersistenceManager(); + Transaction tx = pm.currentTransaction(); + + try + { + tx.begin(); + + if ( ( JDOHelper.getObjectId( object ) != null ) && !JDOHelper.isDetached( object ) ) + { + // This is a fatal error that means we need to fix our code. + // Leave it as a JDOUserException, it's intentional. + throw new JDOUserException( "Existing object is not detached: " + object, object ); + } + + if ( fetchGroups != null ) + { + for ( int i = 0; i >= fetchGroups.length; i++ ) + { + pm.getFetchPlan().addGroup( fetchGroups[i] ); + } + } + + pm.makePersistent( object ); + + object = pm.detachCopy( object ); + + tx.commit(); + + return object; + } + finally + { + rollbackIfActive( tx ); + } + } + + public List getAllObjects( Class clazz ) + { + return queryObjects( clazz, null ); + } + + public List queryObjects( Class clazz, Constraint constraint ) + { + PersistenceManager pm = getPersistenceManager(); + Transaction tx = pm.currentTransaction(); + + try + { + tx.begin(); + + List result = null; + + if ( constraint != null ) + { + if ( constraint instanceof DeclarativeConstraint ) + { + result = processConstraint( pm, clazz, (DeclarativeConstraint) constraint ); + } + else if ( constraint instanceof AbstractSimpleConstraint ) + { + result = processConstraint( pm, (SimpleConstraint) constraint ); + } + else + { + result = processUnconstrained( pm, clazz ); + } + } + else + { + result = processUnconstrained( pm, clazz ); + } + + result = (List) pm.detachCopyAll( result ); + + tx.commit(); + + return result; + } + finally + { + rollbackIfActive( tx ); + } + } + + public List queryObjects( SimpleConstraint constraint ) + { + PersistenceManager pm = getPersistenceManager(); + Transaction tx = pm.currentTransaction(); + + try + { + tx.begin(); + + List result = processConstraint( pm, constraint ); + + // Only detach if results are known to be persistable. + if ( constraint.isResultsPersistable() ) + { + result = (List) pm.detachCopyAll( result ); + } + else + { + List copiedResults = new ArrayList(); + copiedResults.addAll( result ); + result = copiedResults; + } + + tx.commit(); + + return result; + } + finally + { + rollbackIfActive( tx ); + } + } + + private List processUnconstrained( PersistenceManager pm, Class clazz ) + { + Extent extent = pm.getExtent( clazz, true ); + Query query = pm.newQuery( extent ); + return (List) query.execute(); + } + + private List processConstraint( PersistenceManager pm, SimpleConstraint constraint ) + { + Query query = pm.newQuery( constraint.getSelectSql() ); + + if ( constraint.getResultClass() == null ) + { + throw new IllegalStateException( "Unable to use a SimpleConstraint with a null result class." ); + } + + query.setResultClass( constraint.getResultClass() ); + + if ( constraint.getFetchLimits() != null ) + { + pm.getFetchPlan().addGroup( constraint.getFetchLimits() ); + } + + if ( constraint.getParameters() != null ) + { + return processParameterizedQuery( query, constraint.getParameters() ); + } + + return (List) query.execute(); + } + + private List processConstraint( PersistenceManager pm, Class clazz, DeclarativeConstraint constraint ) + { + Extent extent = pm.getExtent( clazz, true ); + Query query = pm.newQuery( extent ); + + if ( constraint.getFilter() != null ) + { + query.setFilter( constraint.getFilter() ); + } + + if ( constraint.getVariables() != null ) + { + query.declareVariables( StringUtils.join( constraint.getVariables(), "; " ) ); + } + + if ( constraint.getSortColumn() != null ) + { + String ordering = constraint.getSortColumn(); + + if ( constraint.getSortDirection() != null ) + { + ordering += " " + constraint.getSortDirection(); + } + + query.setOrdering( ordering ); + } + + if ( constraint.getFetchLimits() != null ) + { + pm.getFetchPlan().addGroup( constraint.getFetchLimits() ); + } + + if ( constraint.getWhereCondition() != null ) + { + query.setFilter( constraint.getWhereCondition() ); + } + + if ( constraint.getDeclaredImports() != null ) + { + query.declareImports( StringUtils.join( constraint.getDeclaredImports(), ", " ) ); + } + + if ( constraint.getRange() != null ) + { + query.setRange( constraint.getRange()[0], constraint.getRange()[1] ); + } + + if ( constraint.getDeclaredParameters() != null ) + { + if ( constraint.getParameters() == null ) + { + throw new JDOException( "Unable to use query, there are declared parameters, " + + "but no parameter objects to use." ); + } + + if ( constraint.getParameters().length != constraint.getDeclaredParameters().length ) + { + throw new JDOException( "Unable to use query, there are <" + constraint.getDeclaredParameters().length + + "> declared parameters, yet there are <" + constraint.getParameters().length + + "> parameter objects to use. This should be equal." ); + } + + query.declareParameters( StringUtils.join( constraint.getDeclaredParameters(), ", " ) ); + + return processParameterizedQuery( query, constraint.getParameters() ); + } + else + { + return (List) query.execute(); + } + } + + private List processParameterizedQuery( Query query, Object parameters[] ) + { + switch ( parameters.length ) + { + case 1: + return (List) query.execute( parameters[0] ); + case 2: + return (List) query.execute( parameters[0], parameters[1] ); + case 3: + return (List) query.execute( parameters[0], parameters[1], parameters[2] ); + default: + throw new JDOException( "Unable to use more than 3 parameters." ); + } + } + + public Object getObjectById( Class clazz, Object id, String fetchGroup ) + throws ObjectNotFoundException, ArchivaDatabaseException + { + if ( id == null ) + { + throw new ObjectNotFoundException( "Unable to get object '" + clazz.getName() + "' from jdo using null id." ); + } + + PersistenceManager pm = getPersistenceManager(); + Transaction tx = pm.currentTransaction(); + + try + { + tx.begin(); + + if ( fetchGroup != null ) + { + pm.getFetchPlan().addGroup( fetchGroup ); + } + + Object objectId = null; + + if ( id instanceof CompoundKey ) + { + objectId = pm.newObjectIdInstance( clazz, id.toString() ); + } + else + { + objectId = pm.newObjectIdInstance( clazz, id ); + } + + Object object = pm.getObjectById( objectId ); + + object = pm.detachCopy( object ); + + tx.commit(); + + return object; + } + catch ( JDOObjectNotFoundException e ) + { + throw new ObjectNotFoundException( "Unable to find Database Object [" + id + "] of type " + clazz.getName() + + " using " + ( ( fetchGroup == null ) ? "no fetch-group" : "a fetch-group of [" + fetchGroup + "]" ), + e, id ); + } + catch ( JDOException e ) + { + throw new ArchivaDatabaseException( "Error in JDO during get of Database object id [" + id + "] of type " + + clazz.getName() + " using " + + ( ( fetchGroup == null ) ? "no fetch-group" : "a fetch-group of [" + fetchGroup + "]" ), e ); + } + finally + { + rollbackIfActive( tx ); + } + } + + public Object getObjectById( Class clazz, String id, String fetchGroup ) + throws ObjectNotFoundException, ArchivaDatabaseException + { + if ( StringUtils.isEmpty( id ) ) + { + throw new ObjectNotFoundException( "Unable to get object '" + clazz.getName() + + "' from jdo using null/empty id." ); + } + + return getObjectById( clazz, (Object) id, fetchGroup ); + } + + public boolean objectExists( Object object ) + { + return ( JDOHelper.getObjectId( object ) != null ); + } + + public boolean objectExistsById( Class clazz, String id ) + throws ArchivaDatabaseException + { + try + { + Object o = getObjectById( clazz, id, null ); + return ( o != null ); + } + catch ( ObjectNotFoundException e ) + { + return false; + } + } + + public void removeObject( Object o ) + throws ArchivaDatabaseException + { + if ( o == null ) + { + throw new ArchivaDatabaseException( "Unable to remove null object '" + o.getClass().getName() + "'" ); + } + + PersistenceManager pm = getPersistenceManager(); + Transaction tx = pm.currentTransaction(); + + try + { + tx.begin(); + + o = pm.getObjectById( pm.getObjectId( o ) ); + + pm.deletePersistent( o ); + + tx.commit(); + } + finally + { + rollbackIfActive( tx ); + } + } + + public void rollbackIfActive( Transaction tx ) + { + PersistenceManager pm = tx.getPersistenceManager(); + + try + { + if ( tx.isActive() ) + { + tx.rollback(); + } + } + finally + { + closePersistenceManager( pm ); + } + } + + public void closePersistenceManager( PersistenceManager pm ) + { + try + { + pm.close(); + } + catch ( JDOUserException e ) + { + // ignore + } + } + + public void postDelete( InstanceLifecycleEvent evt ) + { + PersistenceCapable obj = ( (PersistenceCapable) evt.getSource() ); + + if ( obj == null ) + { + // Do not track null objects. + // These events are typically a product of an internal lifecycle event. + return; + } + } + + public void preDelete( InstanceLifecycleEvent evt ) + { + // ignore + } + + public void postStore( InstanceLifecycleEvent evt ) + { + // PersistenceCapable obj = ( (PersistenceCapable) evt.getSource() ); + } + + public void preStore( InstanceLifecycleEvent evt ) + { + // ignore + } + + public void removeAll( Class aClass ) + { + PersistenceManager pm = getPersistenceManager(); + Transaction tx = pm.currentTransaction(); + + try + { + tx.begin(); + + Query query = pm.newQuery( aClass ); + query.deletePersistentAll(); + + tx.commit(); + } + finally + { + rollbackIfActive( tx ); + } + } + + public JdoFactory getJdoFactory() + { + return jdoFactory; + } + +} diff --git a/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/jdo/JdoArchivaDAO.java b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/jdo/JdoArchivaDAO.java new file mode 100644 index 000000000..90b2d0870 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/jdo/JdoArchivaDAO.java @@ -0,0 +1,98 @@ +package org.apache.maven.archiva.database.jdo; + +/* + * 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.archiva.database.ArchivaDAO; +import org.apache.maven.archiva.database.ArtifactDAO; +import org.apache.maven.archiva.database.ProjectModelDAO; +import org.apache.maven.archiva.database.RepositoryContentStatisticsDAO; +import org.apache.maven.archiva.database.RepositoryProblemDAO; +import org.apache.maven.archiva.database.SimpleConstraint; + +import java.io.Serializable; +import java.util.List; + +/** + * JdoArchivaDAO + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component role-hint="jdo" + */ +public class JdoArchivaDAO + implements ArchivaDAO +{ + /** + * @plexus.requirement role-hint="archiva" + */ + private JdoAccess jdo; + + /** + * @plexus.requirement role-hint="jdo" + */ + private ArtifactDAO artifactDAO; + + /** + * @plexus.requirement role-hint="jdo" + */ + private ProjectModelDAO projectModelDAO; + + /** + * @plexus.requirement role-hint="jdo" + */ + private RepositoryProblemDAO repositoryProblemDAO; + + /** + * @plexus.requirement role-hint="jdo" + */ + private RepositoryContentStatisticsDAO repositoryContentStatisticsDAO; + + + public List query( SimpleConstraint constraint ) + { + return jdo.queryObjects( constraint ); + } + + public Object save( Serializable obj ) + { + return jdo.saveObject( obj ); + } + + public ArtifactDAO getArtifactDAO() + { + return artifactDAO; + } + + public ProjectModelDAO getProjectModelDAO() + { + return projectModelDAO; + } + + public RepositoryProblemDAO getRepositoryProblemDAO() + { + return repositoryProblemDAO; + } + + public RepositoryContentStatisticsDAO getRepositoryContentStatisticsDAO() + { + return repositoryContentStatisticsDAO; + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/jdo/JdoArtifactDAO.java b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/jdo/JdoArtifactDAO.java new file mode 100644 index 000000000..81a0fc7b7 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/jdo/JdoArtifactDAO.java @@ -0,0 +1,122 @@ +package org.apache.maven.archiva.database.jdo; + +/* + * 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.archiva.database.ArchivaDatabaseException; +import org.apache.maven.archiva.database.ArtifactDAO; +import org.apache.maven.archiva.database.Constraint; +import org.apache.maven.archiva.database.ObjectNotFoundException; +import org.apache.maven.archiva.model.ArchivaArtifact; +import org.apache.maven.archiva.model.ArchivaArtifactModel; +import org.apache.maven.archiva.model.jpox.ArchivaArtifactModelKey; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +/** + * JdoArtifactDAO + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component role-hint="jdo" + */ +public class JdoArtifactDAO + implements ArtifactDAO +{ + /** + * @plexus.requirement role-hint="archiva" + */ + private JdoAccess jdo; + + /* .\ Archiva Artifact \. _____________________________________________________________ */ + + public ArchivaArtifact createArtifact( String groupId, String artifactId, String version, String classifier, + String type ) + { + ArchivaArtifact artifact; + + try + { + artifact = getArtifact( groupId, artifactId, version, classifier, type ); + } + catch ( ArchivaDatabaseException e ) + { + artifact = new ArchivaArtifact( groupId, artifactId, version, classifier, type ); + } + + return artifact; + } + + public ArchivaArtifact getArtifact( String groupId, String artifactId, String version, String classifier, + String type ) + throws ObjectNotFoundException, ArchivaDatabaseException + { + ArchivaArtifactModelKey key = new ArchivaArtifactModelKey(); + key.setGroupId( groupId ); + key.setArtifactId( artifactId ); + key.setVersion( version ); + key.setClassifier( classifier ); + key.setType( type ); + + ArchivaArtifactModel model = (ArchivaArtifactModel) jdo.getObjectById( ArchivaArtifactModel.class, key, null ); + + return new ArchivaArtifact( model ); + } + + public List queryArtifacts( Constraint constraint ) + throws ObjectNotFoundException, ArchivaDatabaseException + { + List results = jdo.queryObjects( ArchivaArtifactModel.class, constraint ); + if ( ( results == null ) || results.isEmpty() ) + { + return results; + } + + List ret = new ArrayList(); + Iterator it = results.iterator(); + while ( it.hasNext() ) + { + ArchivaArtifactModel model = (ArchivaArtifactModel) it.next(); + ret.add( new ArchivaArtifact( model ) ); + } + + return ret; + } + + public ArchivaArtifact saveArtifact( ArchivaArtifact artifact ) + throws ArchivaDatabaseException + { + ArchivaArtifactModel model = (ArchivaArtifactModel) jdo.saveObject( artifact.getModel() ); + if ( model == null ) + { + return null; + } + + return new ArchivaArtifact( model ); + } + + public void deleteArtifact( ArchivaArtifact artifact ) + throws ArchivaDatabaseException + { + jdo.removeObject( artifact.getModel() ); + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/jdo/JdoProjectModelDAO.java b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/jdo/JdoProjectModelDAO.java new file mode 100644 index 000000000..f643bdfd2 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/jdo/JdoProjectModelDAO.java @@ -0,0 +1,94 @@ +package org.apache.maven.archiva.database.jdo; + +/* + * 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.archiva.database.ArchivaDatabaseException; +import org.apache.maven.archiva.database.Constraint; +import org.apache.maven.archiva.database.ObjectNotFoundException; +import org.apache.maven.archiva.database.ProjectModelDAO; +import org.apache.maven.archiva.model.ArchivaProjectModel; +import org.apache.maven.archiva.model.jpox.ArchivaProjectModelKey; + +import java.util.List; + +/** + * JdoProjectModelDAO + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component role-hint="jdo" + */ +public class JdoProjectModelDAO + implements ProjectModelDAO +{ + /** + * @plexus.requirement role-hint="archiva" + */ + private JdoAccess jdo; + + public ArchivaProjectModel createProjectModel( String groupId, String artifactId, String version ) + { + ArchivaProjectModel model; + + try + { + model = getProjectModel( groupId, artifactId, version ); + } + catch ( ArchivaDatabaseException e ) + { + model = new ArchivaProjectModel(); + model.setGroupId( groupId ); + model.setArtifactId( artifactId ); + model.setVersion( version ); + } + + return model; + } + + public ArchivaProjectModel getProjectModel( String groupId, String artifactId, String version ) + throws ObjectNotFoundException, ArchivaDatabaseException + { + ArchivaProjectModelKey key = new ArchivaProjectModelKey(); + key.groupId = groupId; + key.artifactId = artifactId; + key.version = version; + + return (ArchivaProjectModel) jdo.getObjectById( ArchivaProjectModel.class, key, null ); + } + + public List queryProjectModels( Constraint constraint ) + throws ObjectNotFoundException, ArchivaDatabaseException + { + return jdo.queryObjects( ArchivaProjectModel.class, constraint ); + } + + public ArchivaProjectModel saveProjectModel( ArchivaProjectModel model ) + throws ArchivaDatabaseException + { + return (ArchivaProjectModel) jdo.saveObject( model ); + } + + public void deleteProjectModel( ArchivaProjectModel model ) + throws ArchivaDatabaseException + { + jdo.removeObject( model ); + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/jdo/JdoRepositoryContentStatisticsDAO.java b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/jdo/JdoRepositoryContentStatisticsDAO.java new file mode 100644 index 000000000..00475ed9e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/jdo/JdoRepositoryContentStatisticsDAO.java @@ -0,0 +1,67 @@ +package org.apache.maven.archiva.database.jdo; + +/* + * 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.archiva.database.ArchivaDatabaseException; +import org.apache.maven.archiva.database.Constraint; +import org.apache.maven.archiva.database.ObjectNotFoundException; +import org.apache.maven.archiva.database.RepositoryContentStatisticsDAO; +import org.apache.maven.archiva.model.RepositoryContentStatistics; + +/** + * JdoRepositoryContentStatisticsDAO + * + * @author Maria Odea Ching + * @version + * + * @plexus.component role-hint="jdo" + */ +public class JdoRepositoryContentStatisticsDAO + implements RepositoryContentStatisticsDAO +{ + /** + * @plexus.requirement role-hint="archiva" + */ + private JdoAccess jdo; + + public void deleteRepositoryContentStatistics( RepositoryContentStatistics stats ) + throws ArchivaDatabaseException + { + jdo.removeObject( stats ); + } + + public List queryRepositoryContentStatistics( Constraint constraint ) + throws ObjectNotFoundException, ArchivaDatabaseException + { + List results = jdo.queryObjects( RepositoryContentStatistics.class, constraint ); + + return results; + } + + public RepositoryContentStatistics saveRepositoryContentStatistics( RepositoryContentStatistics stats ) + { + RepositoryContentStatistics savedStats = (RepositoryContentStatistics) jdo.saveObject( stats ); + + return savedStats; + } + +} diff --git a/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/jdo/JdoRepositoryProblemDAO.java b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/jdo/JdoRepositoryProblemDAO.java new file mode 100644 index 000000000..49c1385f0 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/jdo/JdoRepositoryProblemDAO.java @@ -0,0 +1,63 @@ +package org.apache.maven.archiva.database.jdo; + +/* + * 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.archiva.database.ArchivaDatabaseException; +import org.apache.maven.archiva.database.Constraint; +import org.apache.maven.archiva.database.ObjectNotFoundException; +import org.apache.maven.archiva.database.RepositoryProblemDAO; +import org.apache.maven.archiva.model.RepositoryProblem; + +import java.util.List; + +/** + * JdoRepositoryProblemDAO + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component role-hint="jdo" + */ +public class JdoRepositoryProblemDAO + implements RepositoryProblemDAO +{ + /** + * @plexus.requirement role-hint="archiva" + */ + private JdoAccess jdo; + + public List queryRepositoryProblems( Constraint constraint ) + throws ObjectNotFoundException, ArchivaDatabaseException + { + return jdo.queryObjects( RepositoryProblem.class, constraint ); + } + + public RepositoryProblem saveRepositoryProblem( RepositoryProblem problem ) + throws ArchivaDatabaseException + { + return (RepositoryProblem) jdo.saveObject( problem ); + } + + public void deleteRepositoryProblem( RepositoryProblem problem ) + throws ArchivaDatabaseException + { + jdo.removeObject( problem ); + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/project/DatabaseProjectModelResolver.java b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/project/DatabaseProjectModelResolver.java new file mode 100644 index 000000000..1310a90cb --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/project/DatabaseProjectModelResolver.java @@ -0,0 +1,66 @@ +package org.apache.maven.archiva.database.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. + */ + +import org.apache.maven.archiva.database.ArchivaDAO; +import org.apache.maven.archiva.database.ArchivaDatabaseException; +import org.apache.maven.archiva.database.ObjectNotFoundException; +import org.apache.maven.archiva.model.ArchivaProjectModel; +import org.apache.maven.archiva.model.VersionedReference; +import org.apache.maven.archiva.repository.project.ProjectModelException; +import org.apache.maven.archiva.repository.project.ProjectModelResolver; + +/** + * Resolves a project model from the database. + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component role="org.apache.maven.archiva.repository.project.ProjectModelResolver" + * role-hint="database" + */ +public class DatabaseProjectModelResolver + implements ProjectModelResolver +{ + /** + * @plexus.requirement role-hint="jdo" + */ + private ArchivaDAO dao; + + public ArchivaProjectModel resolveProjectModel( VersionedReference reference ) + throws ProjectModelException + { + try + { + ArchivaProjectModel model = dao.getProjectModelDAO().getProjectModel( reference.getGroupId(), + reference.getArtifactId(), + reference.getVersion() ); + return model; + } + catch ( ObjectNotFoundException e ) + { + return null; + } + catch ( ArchivaDatabaseException e ) + { + return null; + } + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/project/ProjectModelToDatabaseListener.java b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/project/ProjectModelToDatabaseListener.java new file mode 100644 index 000000000..04f3a23c7 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/project/ProjectModelToDatabaseListener.java @@ -0,0 +1,155 @@ +package org.apache.maven.archiva.database.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. + */ + +import java.util.List; + +import org.apache.maven.archiva.database.ArchivaDAO; +import org.apache.maven.archiva.database.ArchivaDatabaseException; +import org.apache.maven.archiva.database.ObjectNotFoundException; +import org.apache.maven.archiva.model.ArchivaProjectModel; +import org.apache.maven.archiva.model.VersionedReference; +import org.apache.maven.archiva.repository.project.ProjectModelException; +import org.apache.maven.archiva.repository.project.ProjectModelResolver; +import org.apache.maven.archiva.repository.project.resolvers.FilesystemBasedResolver; +import org.apache.maven.archiva.repository.project.resolvers.ProjectModelResolutionListener; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Just in Time save of project models to the database, implemented as a listener + * on {@link ProjectModelResolver} objects that implement {@link FilesystemBasedResolver}. + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component + * role="org.apache.maven.archiva.repository.project.resolvers.ProjectModelResolutionListener" + * role-hint="model-to-db" + */ +public class ProjectModelToDatabaseListener + implements ProjectModelResolutionListener +{ + private Logger log = LoggerFactory.getLogger( ProjectModelToDatabaseListener.class ); + + /** + * @plexus.requirement role-hint="jdo" + */ + private ArchivaDAO dao; + + private void saveInDatabase( ArchivaProjectModel model ) + throws ProjectModelException + { + try + { + dao.getProjectModelDAO().saveProjectModel( model ); + } + catch ( ArchivaDatabaseException e ) + { + throw new ProjectModelException( "Unable to save model to database: " + e.getMessage(), e ); + } + } + + private void removeFromDatabase( ArchivaProjectModel model ) + throws ProjectModelException + { + try + { + dao.getProjectModelDAO().deleteProjectModel( model ); + } + catch ( ArchivaDatabaseException e ) + { + throw new ProjectModelException( "Unable to remove existing model from database: " + e.getMessage(), e ); + } + } + + private boolean existsInDatabase( ArchivaProjectModel model ) + throws ProjectModelException + { + try + { + ArchivaProjectModel dbmodel = dao.getProjectModelDAO().getProjectModel( model.getGroupId(), + model.getArtifactId(), + model.getVersion() ); + + return ( dbmodel != null ); + } + catch ( ObjectNotFoundException e ) + { + return false; + } + catch ( ArchivaDatabaseException e ) + { + throw new ProjectModelException( "Unable to check for existing model from database: " + e.getMessage(), e ); + } + } + + public void resolutionAttempting( VersionedReference projectRef, ProjectModelResolver resolver ) + { + /* do nothing */ + } + + public void resolutionError( VersionedReference projectRef, ProjectModelResolver resolver, Exception cause ) + { + /* do nothing */ + } + + public void resolutionMiss( VersionedReference projectRef, ProjectModelResolver resolver ) + { + /* do nothing */ + } + + public void resolutionNotFound( VersionedReference projectRef, List resolverList ) + { + /* do nothing */ + } + + public void resolutionStart( VersionedReference projectRef, List resolverList ) + { + /* do nothing */ + } + + public void resolutionSuccess( VersionedReference projectRef, ProjectModelResolver resolver, + ArchivaProjectModel model ) + { + if ( !( resolver instanceof FilesystemBasedResolver ) ) + { + // Nothing to do. skip it. + return; + } + + model.setOrigin( "filesystem" ); + + try + { + // Test if it exists. + if ( existsInDatabase( model ) ) + { + removeFromDatabase( model ); + } + + saveInDatabase( model ); + } + catch ( ProjectModelException e ) + { + log.warn( e.getMessage(), e ); + } + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/updater/DatabaseConsumers.java b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/updater/DatabaseConsumers.java new file mode 100644 index 000000000..01dee02fd --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/updater/DatabaseConsumers.java @@ -0,0 +1,161 @@ +package org.apache.maven.archiva.database.updater; + +/* + * 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.collections.CollectionUtils; +import org.apache.commons.collections.Predicate; +import org.apache.commons.collections.functors.OrPredicate; +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.DatabaseScanningConfiguration; +import org.apache.maven.archiva.consumers.DatabaseCleanupConsumer; +import org.apache.maven.archiva.consumers.DatabaseUnprocessedArtifactConsumer; +import org.apache.maven.archiva.consumers.functors.PermanentConsumerPredicate; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +/** + * DatabaseConsumers + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component role="org.apache.maven.archiva.database.updater.DatabaseConsumers" + */ +public class DatabaseConsumers + implements Initializable +{ + /** + * @plexus.requirement + */ + private ArchivaConfiguration archivaConfiguration; + + /** + * @plexus.requirement role="org.apache.maven.archiva.consumers.DatabaseUnprocessedArtifactConsumer" + */ + private List availableUnprocessedConsumers; + + /** + * @plexus.requirement role="org.apache.maven.archiva.consumers.DatabaseCleanupConsumer" + */ + private List availableCleanupConsumers; + + private Predicate selectedCleanupConsumers; + + private Predicate selectedUnprocessedConsumers; + + class SelectedUnprocessedConsumersPredicate + implements Predicate + { + public boolean evaluate( Object object ) + { + boolean satisfies = false; + + if ( object instanceof DatabaseUnprocessedArtifactConsumer ) + { + DatabaseUnprocessedArtifactConsumer consumer = (DatabaseUnprocessedArtifactConsumer) object; + DatabaseScanningConfiguration config = archivaConfiguration.getConfiguration().getDatabaseScanning(); + + return config.getUnprocessedConsumers().contains( consumer.getId() ); + } + + return satisfies; + } + } + + class SelectedCleanupConsumersPredicate + implements Predicate + { + public boolean evaluate( Object object ) + { + boolean satisfies = false; + + if ( object instanceof DatabaseCleanupConsumer ) + { + DatabaseCleanupConsumer consumer = (DatabaseCleanupConsumer) object; + DatabaseScanningConfiguration config = archivaConfiguration.getConfiguration().getDatabaseScanning(); + + return config.getCleanupConsumers().contains( consumer.getId() ); + } + + return satisfies; + } + } + + public void initialize() + throws InitializationException + { + Predicate permanentConsumers = new PermanentConsumerPredicate(); + + selectedCleanupConsumers = new OrPredicate( permanentConsumers, new SelectedCleanupConsumersPredicate() ); + selectedUnprocessedConsumers = new OrPredicate( permanentConsumers, new SelectedUnprocessedConsumersPredicate() ); + } + + /** + * Get the {@link List} of {@link DatabaseUnprocessedArtifactConsumer} objects + * for those consumers selected due to the configuration. + * + * @return the list of selected {@link DatabaseUnprocessedArtifactConsumer} objects. + */ + public List getSelectedUnprocessedConsumers() + { + List ret = new ArrayList(); + ret.addAll( CollectionUtils.select( availableUnprocessedConsumers, selectedUnprocessedConsumers ) ); + return ret; + } + + /** + * Get the {@link List} of {@link DatabaseCleanupConsumer} objects for those + * consumers selected due to the configuration. + * + * @return the list of selected {@link DatabaseCleanupConsumer} objects. + */ + public List getSelectedCleanupConsumers() + { + List ret = new ArrayList(); + ret.addAll( CollectionUtils.select( availableCleanupConsumers, selectedCleanupConsumers ) ); + return ret; + } + + /** + * Get the complete {@link List} of {@link DatabaseUnprocessedArtifactConsumer} objects + * that are available in the system, regardless of configuration. + * + * @return the list of all available {@link DatabaseUnprocessedArtifactConsumer} objects. + */ + public List getAvailableUnprocessedConsumers() + { + return Collections.unmodifiableList( this.availableUnprocessedConsumers ); + } + + /** + * Get the complete {@link List} of {@link DatabaseCleanupConsumer} objects + * that are available in the system, regardless of configuration. + * + * @return the list of all available {@link DatabaseCleanupConsumer} objects. + */ + public List getAvailableCleanupConsumers() + { + return Collections.unmodifiableList( this.availableCleanupConsumers ); + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/updater/DatabaseUpdater.java b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/updater/DatabaseUpdater.java new file mode 100644 index 000000000..293e19368 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/updater/DatabaseUpdater.java @@ -0,0 +1,79 @@ +package org.apache.maven.archiva.database.updater; + +/* + * 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.archiva.database.ArchivaDatabaseException; +import org.apache.maven.archiva.model.ArchivaArtifact; + +/** + * The database update component. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public interface DatabaseUpdater +{ + /** + * Execute the {@link #updateAllUnprocessed()} and {@link #updateAllProcessed()} + * tasks in one go. + * + * @throws ArchivaDatabaseException + */ + public void update() + throws ArchivaDatabaseException; + + /** + * Update all unprocessed content. + * + * @throws ArchivaDatabaseException if there was a fatal error with the database. + */ + public void updateAllUnprocessed() + throws ArchivaDatabaseException; + + /** + * Update specific unprocessed content. + * + * @throws ArchivaDatabaseException if there was a fatal error with the database. + */ + public void updateUnprocessed( ArchivaArtifact artifact ) + throws ArchivaDatabaseException; + + /** + * Update all previously processed content. + * + * This is done to allow archiva to remove content from the database that + * may have been removed from the filesystem too. + * + * @throws ArchivaDatabaseException if there was a fatal error with the database. + */ + public void updateAllProcessed() + throws ArchivaDatabaseException; + + /** + * Update specific processed content. + * + * Example: This is done to allow a specific artifact to be removed from the + * database if it no longer exists on the filesystem. + * + * @throws ArchivaDatabaseException if there was a fatal error with the database. + */ + public void updateProcessed( ArchivaArtifact artifact ) + throws ArchivaDatabaseException; +} diff --git a/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/updater/JdoDatabaseUpdater.java b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/updater/JdoDatabaseUpdater.java new file mode 100644 index 000000000..fce87a76f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/updater/JdoDatabaseUpdater.java @@ -0,0 +1,174 @@ +package org.apache.maven.archiva.database.updater; + +/* + * 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.Date; +import java.util.Iterator; +import java.util.List; + +import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections.IteratorUtils; +import org.apache.commons.collections.Predicate; +import org.apache.commons.collections.functors.NotPredicate; +import org.apache.maven.archiva.consumers.ArchivaArtifactConsumer; +import org.apache.maven.archiva.database.ArchivaDAO; +import org.apache.maven.archiva.database.ArchivaDatabaseException; +import org.apache.maven.archiva.database.constraints.ArtifactsProcessedConstraint; +import org.apache.maven.archiva.model.ArchivaArtifact; +import org.apache.maven.archiva.model.functors.UnprocessedArtifactPredicate; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * JdoDatabaseUpdater + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component role="org.apache.maven.archiva.database.updater.DatabaseUpdater" + * role-hint="jdo" + */ +public class JdoDatabaseUpdater + implements DatabaseUpdater +{ + private Logger log = LoggerFactory.getLogger( JdoDatabaseUpdater.class ); + + /** + * @plexus.requirement role-hint="jdo" + */ + private ArchivaDAO dao; + + /** + * @plexus.requirement + */ + private DatabaseConsumers dbConsumers; + + private ProcessArchivaArtifactClosure processArtifactClosure = new ProcessArchivaArtifactClosure(); + + public void update() + throws ArchivaDatabaseException + { + updateAllUnprocessed(); + updateAllProcessed(); + } + + public void updateAllUnprocessed() + throws ArchivaDatabaseException + { + List unprocessedArtifacts = dao.getArtifactDAO().queryArtifacts( new ArtifactsProcessedConstraint( false ) ); + + beginConsumerLifecycle( dbConsumers.getSelectedUnprocessedConsumers() ); + + try + { + // Process each consumer. + Predicate predicate = UnprocessedArtifactPredicate.getInstance(); + + Iterator it = IteratorUtils.filteredIterator( unprocessedArtifacts.iterator(), predicate ); + while ( it.hasNext() ) + { + ArchivaArtifact artifact = (ArchivaArtifact) it.next(); + updateUnprocessed( artifact ); + } + } + finally + { + endConsumerLifecycle( dbConsumers.getSelectedUnprocessedConsumers() ); + } + } + + public void updateAllProcessed() + throws ArchivaDatabaseException + { + List processedArtifacts = dao.getArtifactDAO().queryArtifacts( new ArtifactsProcessedConstraint( true ) ); + + beginConsumerLifecycle( dbConsumers.getSelectedCleanupConsumers() ); + + try + { + // Process each consumer. + Predicate predicate = NotPredicate.getInstance( UnprocessedArtifactPredicate.getInstance() ); + + Iterator it = IteratorUtils.filteredIterator( processedArtifacts.iterator(), predicate ); + while ( it.hasNext() ) + { + ArchivaArtifact artifact = (ArchivaArtifact) it.next(); + updateProcessed( artifact ); + } + } + finally + { + endConsumerLifecycle( dbConsumers.getSelectedCleanupConsumers() ); + } + } + + private void endConsumerLifecycle( List consumers ) + { + Iterator it = consumers.iterator(); + while ( it.hasNext() ) + { + ArchivaArtifactConsumer consumer = (ArchivaArtifactConsumer) it.next(); + consumer.completeScan(); + } + } + + private void beginConsumerLifecycle( List consumers ) + { + Iterator it = consumers.iterator(); + while ( it.hasNext() ) + { + ArchivaArtifactConsumer consumer = (ArchivaArtifactConsumer) it.next(); + consumer.beginScan(); + } + } + + public void updateUnprocessed( ArchivaArtifact artifact ) + throws ArchivaDatabaseException + { + List consumers = dbConsumers.getSelectedUnprocessedConsumers(); + + if ( CollectionUtils.isEmpty( consumers ) ) + { + log.warn( "There are no selected consumers for unprocessed artifacts." ); + return; + } + + this.processArtifactClosure.setArtifact( artifact ); + CollectionUtils.forAllDo( consumers, this.processArtifactClosure ); + + artifact.getModel().setWhenProcessed( new Date() ); + dao.getArtifactDAO().saveArtifact( artifact ); + } + + public void updateProcessed( ArchivaArtifact artifact ) + throws ArchivaDatabaseException + { + List consumers = dbConsumers.getSelectedCleanupConsumers(); + + if ( CollectionUtils.isEmpty( consumers ) ) + { + log.warn( "There are no selected consumers for artifact cleanup." ); + return; + } + + this.processArtifactClosure.setArtifact( artifact ); + CollectionUtils.forAllDo( consumers, this.processArtifactClosure ); + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/updater/ProcessArchivaArtifactClosure.java b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/updater/ProcessArchivaArtifactClosure.java new file mode 100644 index 000000000..7d404a842 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/updater/ProcessArchivaArtifactClosure.java @@ -0,0 +1,69 @@ +package org.apache.maven.archiva.database.updater; + +/* + * 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.collections.Closure; +import org.apache.maven.archiva.consumers.ArchivaArtifactConsumer; +import org.apache.maven.archiva.consumers.ConsumerException; +import org.apache.maven.archiva.model.ArchivaArtifact; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * ProcessArchivaArtifactClosure + * + * @author Joakim Erdfelt + * @version $Id$ + */ +class ProcessArchivaArtifactClosure + implements Closure +{ + private Logger log = LoggerFactory.getLogger( ProcessArchivaArtifactClosure.class ); + + private ArchivaArtifact artifact; + + public void execute( Object input ) + { + if ( input instanceof ArchivaArtifactConsumer ) + { + ArchivaArtifactConsumer consumer = (ArchivaArtifactConsumer) input; + + try + { + consumer.processArchivaArtifact( artifact ); + } + catch ( ConsumerException e ) + { + log.warn( "Unable to process artifact [" + artifact + "] with consumer [" + consumer.getId() + "]", e ); + } + } + + } + + public ArchivaArtifact getArtifact() + { + return artifact; + } + + public void setArtifact( ArchivaArtifact artifact ) + { + this.artifact = artifact; + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/main/resources/org/apache/maven/archiva/database/ArtifactKey.xml b/MRM-541/archiva-modules/archiva-database/src/main/resources/org/apache/maven/archiva/database/ArtifactKey.xml new file mode 100644 index 000000000..82dc174b1 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/resources/org/apache/maven/archiva/database/ArtifactKey.xml @@ -0,0 +1,26 @@ + + + + + + + + + + INSERT INTO + ARTIFACT_KEYS ( GROUP_ID, ARTIFACT_ID, VERSION_ID, CLASSIFIER, TYPE ) + VALUES (#groupId#, #artifactId#, #version# ) + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-database/src/main/resources/org/apache/maven/archiva/database/ManageTables.xml b/MRM-541/archiva-modules/archiva-database/src/main/resources/org/apache/maven/archiva/database/ManageTables.xml new file mode 100644 index 000000000..1f8f8d295 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/resources/org/apache/maven/archiva/database/ManageTables.xml @@ -0,0 +1,87 @@ + + + + + + + + + + CREATE TABLE ArtifactKeys ( + GROUP_ID varchar (100) not null, + ARTIFACT_ID varchar (100) not null, + VERSION varchar (50) not null, + CLASSIFIER varchar (50), + TYPE varchar (20), + ARTIFACT_KEY integer generated always as identity ( start with 1 ), + primary key ( GROUP_ID, ARTIFACT_ID, VERSION, CLASSIFIER, TYPE ) + ) + + + + DROP TABLE ArtifactKeys + + + + + + + + CREATE TABLE MetadataKeys ( + metadataKey integer generated always as identity ( start with 1 ) primary key, + groupId varchar(100) not null, + artifactId varchar(100) not null, + version varchar(100) not null + ) + + + + DROP TABLE MetadataKeys + + + + CREATE TABLE RepositoryMetadata ( + metadataKey integer not null, + id integer generated always as identity ( start with 1 ) primary key, + latest varchar(100) not null, + release varchar(100) not null, + lastUpdated integer, + snapshotTimestamp integer, + snapshotBuildNumber integer, + snapshotLocalCopy char(1), + foreign key( metadataKey ) references MetadataKeys( metadataKey ) + ) + + + + DROP TABLE RepositoryMetadata + + + + CREATE TABLE HealthMetadata ( + metadataKey integer not null, + id integer generated always as identity ( start with 1 ) primary key, + processId varchar(100) not null, + problemId varchar(100) not null, + message varchar(8000) not null, + foreign key( metadataKey ) references MetadataKeys( metadataKey ) + ) + + + + CREATE TABLE VersionMetadata ( + metadataKey integer not null, + id integer generated always as identity ( start with 1 ) primary key, + version varchar(100) not null, + foreign key( metadataKey ) references MetadataKeys( metadataKey ) + ) + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-database/src/main/resources/org/apache/maven/archiva/database/MetadataKey.xml b/MRM-541/archiva-modules/archiva-database/src/main/resources/org/apache/maven/archiva/database/MetadataKey.xml new file mode 100644 index 000000000..7713c9ba8 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/resources/org/apache/maven/archiva/database/MetadataKey.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + INSERT INTO + MetadataKeys ( groupId, artifactId, version ) + VALUES ( #groupId#, #artifactId#, #version# ) + + + + DELETE FROM + MetadataKeys + WHERE metadataKey=#metadataKey# + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-database/src/main/resources/org/apache/maven/archiva/database/RepositoryMetadata.xml b/MRM-541/archiva-modules/archiva-database/src/main/resources/org/apache/maven/archiva/database/RepositoryMetadata.xml new file mode 100644 index 000000000..6c745f9c8 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/main/resources/org/apache/maven/archiva/database/RepositoryMetadata.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + DELETE FROM + RepositoryMetadata + WHERE metadataKey=#metadataKey# + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/AbstractArchivaDatabaseTestCase.java b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/AbstractArchivaDatabaseTestCase.java new file mode 100644 index 000000000..d40fed4d8 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/AbstractArchivaDatabaseTestCase.java @@ -0,0 +1,208 @@ +package org.apache.maven.archiva.database; + +/* + * 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.maven.archiva.consumers.DatabaseCleanupConsumer; +import org.apache.maven.archiva.consumers.DatabaseUnprocessedArtifactConsumer; +import org.apache.maven.archiva.database.updater.TestDatabaseCleanupConsumer; +import org.apache.maven.archiva.database.updater.TestDatabaseUnprocessedConsumer; +import org.apache.maven.archiva.model.ArtifactReference; +import org.apache.maven.archiva.model.VersionedReference; +import org.codehaus.plexus.jdo.DefaultConfigurableJdoFactory; +import org.codehaus.plexus.jdo.JdoFactory; +import org.codehaus.plexus.spring.PlexusInSpringTestCase; +import org.jpox.SchemaTool; + +import java.io.File; +import java.net.URL; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Iterator; +import java.util.Map; +import java.util.Properties; + +import javax.jdo.PersistenceManager; +import javax.jdo.PersistenceManagerFactory; + +/** + * AbstractArchivaDatabaseTestCase + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public abstract class AbstractArchivaDatabaseTestCase + extends PlexusInSpringTestCase +{ + private static final String TIMESTAMP = "yyyy/MM/dd HH:mm:ss"; + + protected ArchivaDAO dao; + + protected void setUp() + throws Exception + { + super.setUp(); + + DefaultConfigurableJdoFactory jdoFactory = (DefaultConfigurableJdoFactory) lookup( JdoFactory.ROLE, "archiva" ); + assertEquals( DefaultConfigurableJdoFactory.class.getName(), jdoFactory.getClass().getName() ); + + jdoFactory.setPersistenceManagerFactoryClass( "org.jpox.PersistenceManagerFactoryImpl" ); + + /* derby version + File derbyDbDir = new File( "target/plexus-home/testdb" ); + if ( derbyDbDir.exists() ) + { + FileUtils.deleteDirectory( derbyDbDir ); + } + + jdoFactory.setDriverName( System.getProperty( "jdo.test.driver", "org.apache.derby.jdbc.EmbeddedDriver" ) ); + jdoFactory.setUrl( System.getProperty( "jdo.test.url", "jdbc:derby:" + derbyDbDir.getAbsolutePath() + ";create=true" ) ); + */ + + jdoFactory.setDriverName( System.getProperty( "jdo.test.driver", "org.hsqldb.jdbcDriver" ) ); + jdoFactory.setUrl( System.getProperty( "jdo.test.url", "jdbc:hsqldb:mem:" + getName() ) ); + + jdoFactory.setUserName( System.getProperty( "jdo.test.user", "sa" ) ); + + jdoFactory.setPassword( System.getProperty( "jdo.test.pass", "" ) ); + + jdoFactory.setProperty( "org.jpox.transactionIsolation", "READ_COMMITTED" ); + + jdoFactory.setProperty( "org.jpox.poid.transactionIsolation", "READ_COMMITTED" ); + + jdoFactory.setProperty( "org.jpox.autoCreateSchema", "true" ); + + jdoFactory.setProperty( "javax.jdo.option.RetainValues", "true" ); + + jdoFactory.setProperty( "javax.jdo.option.RestoreValues", "true" ); + + // jdoFactory.setProperty( "org.jpox.autoCreateColumns", "true" ); + + jdoFactory.setProperty( "org.jpox.validateTables", "true" ); + + jdoFactory.setProperty( "org.jpox.validateColumns", "true" ); + + jdoFactory.setProperty( "org.jpox.validateConstraints", "true" ); + + Properties properties = jdoFactory.getProperties(); + + for ( Iterator it = properties.entrySet().iterator(); it.hasNext(); ) + { + Map.Entry entry = (Map.Entry) it.next(); + + System.setProperty( (String) entry.getKey(), (String) entry.getValue() ); + } + + URL jdoFileUrls[] = new URL[] { getClass().getResource( "/org/apache/maven/archiva/model/package.jdo" ) }; + + if ( ( jdoFileUrls == null ) || ( jdoFileUrls[0] == null ) ) + { + fail( "Unable to process test " + getName() + " - missing package.jdo." ); + } + + File propsFile = null; // intentional + boolean verbose = true; + + SchemaTool.deleteSchemaTables( jdoFileUrls, new URL[] {}, propsFile, verbose ); + SchemaTool.createSchemaTables( jdoFileUrls, new URL[] {}, propsFile, verbose, null ); + + PersistenceManagerFactory pmf = jdoFactory.getPersistenceManagerFactory(); + + assertNotNull( pmf ); + + PersistenceManager pm = pmf.getPersistenceManager(); + + pm.close(); + + this.dao = (ArchivaDAO) lookup( ArchivaDAO.class.getName(), "jdo" ); + } + + protected TestDatabaseCleanupConsumer lookupTestCleanupConsumer() + throws Exception + { + TestDatabaseCleanupConsumer consumer = (TestDatabaseCleanupConsumer) lookup( DatabaseCleanupConsumer.class, + "test-db-cleanup" ); + assertNotNull( "Test Database Cleanup Consumer should not be null.", consumer ); + return consumer; + } + + protected TestDatabaseUnprocessedConsumer lookupTestUnprocessedConsumer() + throws Exception + { + TestDatabaseUnprocessedConsumer consumer = (TestDatabaseUnprocessedConsumer) lookup( + DatabaseUnprocessedArtifactConsumer.class, + "test-db-unprocessed" ); + assertNotNull( "Test Database Unprocessed Consumer should not be null.", consumer ); + return consumer; + } + + protected Date toDate( String txt ) + throws Exception + { + SimpleDateFormat sdf = new SimpleDateFormat( TIMESTAMP ); + return sdf.parse( txt ); + } + + protected String fromDate( Date date ) + throws Exception + { + SimpleDateFormat sdf = new SimpleDateFormat( TIMESTAMP ); + return sdf.format( date ); + } + + protected VersionedReference toVersionedReference( String id ) + { + String parts[] = StringUtils.splitPreserveAllTokens( id, ':' ); + assertEquals( "Should have 3 parts [" + id + "]", 3, parts.length ); + + VersionedReference ref = new VersionedReference(); + ref.setGroupId( parts[0] ); + ref.setArtifactId( parts[1] ); + ref.setVersion( parts[2] ); + + assertTrue( "Group ID should not be blank [" + id + "]", StringUtils.isNotBlank( ref.getGroupId() ) ); + assertTrue( "Artifact ID should not be blank [" + id + "]", StringUtils.isNotBlank( ref.getArtifactId() ) ); + assertTrue( "Version should not be blank [" + id + "]", StringUtils.isNotBlank( ref.getVersion() ) ); + + return ref; + } + + protected ArtifactReference toArtifactReference( String id ) + { + String parts[] = StringUtils.splitPreserveAllTokens( id, ':' ); + assertEquals( "Should have 5 parts [" + id + "]", 5, parts.length ); + + ArtifactReference ref = new ArtifactReference(); + ref.setGroupId( parts[0] ); + ref.setArtifactId( parts[1] ); + ref.setVersion( parts[2] ); + ref.setClassifier( parts[3] ); + ref.setType( parts[4] ); + + assertTrue( "Group ID should not be blank [" + id + "]", StringUtils.isNotBlank( ref.getGroupId() ) ); + assertTrue( "Artifact ID should not be blank [" + id + "]", StringUtils.isNotBlank( ref.getArtifactId() ) ); + assertTrue( "Version should not be blank [" + id + "]", StringUtils.isNotBlank( ref.getVersion() ) ); + // Blank string is ok for classifier, NULL is not. + assertNotNull( "Classifier should not be null [" + id + "]", ref.getClassifier() ); + assertTrue( "Type should not be blank [" + id + "]", StringUtils.isNotBlank( ref.getType() ) ); + + return ref; + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/browsing/RepositoryBrowsingTest.java b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/browsing/RepositoryBrowsingTest.java new file mode 100644 index 000000000..3eb408b9c --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/browsing/RepositoryBrowsingTest.java @@ -0,0 +1,153 @@ +package org.apache.maven.archiva.database.browsing; + +/* + * 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.archiva.database.AbstractArchivaDatabaseTestCase; +import org.apache.maven.archiva.database.ArchivaDAO; +import org.apache.maven.archiva.database.ArtifactDAO; +import org.apache.maven.archiva.model.ArchivaArtifact; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * RepositoryBrowsingTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class RepositoryBrowsingTest + extends AbstractArchivaDatabaseTestCase +{ + private static final List GUEST_REPO_IDS; + + private static final String USER_GUEST = "guest"; + + static + { + GUEST_REPO_IDS = new ArrayList(); + GUEST_REPO_IDS.add( "central" ); + GUEST_REPO_IDS.add( "snapshots" ); + } + + private ArtifactDAO artifactDao; + + public ArchivaArtifact createArtifact( String groupId, String artifactId, String version ) + { + ArchivaArtifact artifact = artifactDao.createArtifact( groupId, artifactId, version, "", "jar" ); + artifact.getModel().setLastModified( new Date() ); // mandatory field. + artifact.getModel().setRepositoryId( "central" ); + return artifact; + } + + public RepositoryBrowsing lookupBrowser() + throws Exception + { + RepositoryBrowsing browser = (RepositoryBrowsing) lookup( RepositoryBrowsing.class ); + assertNotNull( "RepositoryBrowsing should not be null.", browser ); + return browser; + } + + public void saveTestData() + throws Exception + { + ArchivaArtifact artifact; + + // Setup artifacts in fresh DB. + artifact = createArtifact( "commons-lang", "commons-lang", "2.0" ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "commons-lang", "commons-lang", "2.1" ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "org.apache.maven.test", "test-one", "1.2" ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "org.apache.maven.test.foo", "test-two", "1.0" ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "org.apache.maven.shared", "test-two", "2.0" ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "org.apache.maven.shared", "test-two", "2.1-SNAPSHOT" ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "org.apache.maven.shared", "test-two", "2.1.1" ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "org.apache.maven.shared", "test-two", "2.1-alpha-1" ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "org.apache.maven.shared", "test-bar", "2.1" ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "org.codehaus.modello", "modellong", "3.0" ); + artifactDao.saveArtifact( artifact ); + } + + public void testBrowseIntoGroupWithSubgroups() + throws Exception + { + saveTestData(); + + RepositoryBrowsing browser = lookupBrowser(); + BrowsingResults results = browser.selectGroupId( USER_GUEST, GUEST_REPO_IDS, "org.apache.maven.test" ); + assertNotNull( "Browsing Results should not be null.", results ); + + String expectedSubGroupIds[] = new String[] { "org.apache.maven.test.foo" }; + assertGroupIds( "Browsing Results (subgroup org.apache.maven.test)", results.getGroupIds(), expectedSubGroupIds ); + } + + public void testSimpleBrowse() + throws Exception + { + saveTestData(); + + RepositoryBrowsing browser = lookupBrowser(); + BrowsingResults results = browser.getRoot( USER_GUEST, GUEST_REPO_IDS ); + assertNotNull( "Browsing Results should not be null.", results ); + + String expectedRootGroupIds[] = new String[] { "commons-lang", "org" }; + + assertGroupIds( "Browsing Results (root)", results.getGroupIds(), expectedRootGroupIds ); + } + + private void assertGroupIds( String msg, List actualGroupIds, String[] expectedGroupIds ) + { + assertEquals( msg + ": groupIds.length", expectedGroupIds.length, actualGroupIds.size() ); + + for ( int i = 0; i < expectedGroupIds.length; i++ ) + { + String expectedGroupId = expectedGroupIds[i]; + assertTrue( msg + ": actual groupIds.contains(" + expectedGroupId + ")", actualGroupIds + .contains( expectedGroupId ) ); + } + } + + protected void setUp() + throws Exception + { + super.setUp(); + + ArchivaDAO dao = (ArchivaDAO) lookup( ArchivaDAO.ROLE, "jdo" ); + artifactDao = dao.getArtifactDAO(); + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/AllTests.java b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/AllTests.java new file mode 100644 index 000000000..a2580de42 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/AllTests.java @@ -0,0 +1,48 @@ +package org.apache.maven.archiva.database.constraints; + +/* + * 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.Test; +import junit.framework.TestSuite; + +/** + * IDE Provided Utility Class for all tests. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class AllTests +{ + + public static Test suite() + { + TestSuite suite = new TestSuite( "Test for org.apache.maven.archiva.database.constraints" ); + //$JUnit-BEGIN$ + suite.addTestSuite( ArtifactsProcessedConstraintTest.class ); + suite.addTestSuite( ArtifactsByChecksumConstraintTest.class ); + suite.addTestSuite( OlderArtifactsByAgeConstraintTest.class ); + suite.addTestSuite( UniqueGroupIdConstraintTest.class ); + suite.addTestSuite( OlderSnapshotArtifactsByAgeConstraintTest.class ); + suite.addTestSuite( RecentArtifactsByAgeConstraintTest.class ); + //$JUnit-END$ + return suite; + } + +} diff --git a/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/ArtifactVersionsConstraintTest.java b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/ArtifactVersionsConstraintTest.java new file mode 100644 index 000000000..f7fa5b4ff --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/ArtifactVersionsConstraintTest.java @@ -0,0 +1,107 @@ +package org.apache.maven.archiva.database.constraints; + +/* + * 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.Calendar; +import java.util.Date; +import java.util.List; + +import org.apache.maven.archiva.database.AbstractArchivaDatabaseTestCase; +import org.apache.maven.archiva.database.ArchivaDAO; +import org.apache.maven.archiva.database.ArtifactDAO; +import org.apache.maven.archiva.model.ArchivaArtifact; + +/** + * ArtifactVersionsConstraintTest + * + * @author Maria Odea Ching + * @version + */ +public class ArtifactVersionsConstraintTest + extends AbstractArchivaDatabaseTestCase +{ + private ArtifactDAO artifactDao; + + public static final String TEST_REPO = "test-repo"; + + public void setUp() + throws Exception + { + super.setUp(); + + ArchivaDAO dao = (ArchivaDAO) lookup( ArchivaDAO.ROLE, "jdo" ); + artifactDao = dao.getArtifactDAO(); + } + + private ArchivaArtifact createArtifact( String groupId, String artifactId, String version ) + { + ArchivaArtifact artifact = artifactDao.createArtifact( groupId, artifactId, version, null, "jar" ); + artifact.getModel().setLastModified( new Date() ); + artifact.getModel().setRepositoryId( TEST_REPO ); + + return artifact; + } + + private void populateDb() + throws Exception + { + Date whenGathered = Calendar.getInstance().getTime(); + whenGathered.setTime( 123456789 ); + + ArchivaArtifact artifact = createArtifact( "org.apache.archiva", "artifact-one", "1.0" ); + artifact.getModel().setWhenGathered( null ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "org.apache.archiva", "artifact-one", "1.0.1" ); + artifact.getModel().setWhenGathered( whenGathered ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "org.apache.archiva", "artifact-one", "1.0.2" ); + artifact.getModel().setWhenGathered( whenGathered ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "org.apache.archiva", "artifact-one", "2.0" ); + artifact.getModel().setRepositoryId( "different-repo" ); + artifact.getModel().setWhenGathered( whenGathered ); + artifactDao.saveArtifact( artifact ); + } + + public void testQueryAllVersionsOfArtifactAcrossRepos() throws Exception + { + populateDb(); + assertConstraint( "Artifacts By Repository", 3, + new ArtifactVersionsConstraint( null, "org.apache.archiva", "artifact-one" ) ); + } + + public void testQueryAllVersionsOfArtifactInARepo() throws Exception + { + populateDb(); + assertConstraint( "Artifacts By Repository", 2, + new ArtifactVersionsConstraint( TEST_REPO, "org.apache.archiva", "artifact-one" ) ); + } + + private void assertConstraint( String msg, int count, ArtifactVersionsConstraint constraint ) + throws Exception + { + List results = artifactDao.queryArtifacts( constraint ); + assertNotNull( msg + ": Not Null", results ); + assertEquals( msg + ": Results.size", count, results.size() ); + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/ArtifactsByChecksumConstraintTest.java b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/ArtifactsByChecksumConstraintTest.java new file mode 100644 index 000000000..2cb34b08e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/ArtifactsByChecksumConstraintTest.java @@ -0,0 +1,202 @@ +package org.apache.maven.archiva.database.constraints; + +/* + * 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.archiva.database.AbstractArchivaDatabaseTestCase; +import org.apache.maven.archiva.database.ArtifactDAO; +import org.apache.maven.archiva.database.ArchivaDAO; +import org.apache.maven.archiva.model.ArchivaArtifact; + +import java.util.Date; +import java.util.List; + +/** + * ArtifactsByChecksumConstraintTest + * + * @author Joakim Erdfelt + * @author Maria Odea Ching + * @version + */ +public class ArtifactsByChecksumConstraintTest + extends AbstractArchivaDatabaseTestCase +{ + private static final String SHA1_HASH3 = "f3f653289f3217c65324830ab3415bc92feddefa"; + + private static final String SHA1_HASH2 = "a49810ad3eba8651677ab57cd40a0f76fdef9538"; + + private static final String SHA1_HASH1 = "232f01b24b1617c46a3d4b0ab3415bc9237dcdec"; + + private static final String MD5_HASH3 = "5440efd724c9a5246ddc148662a4f20a"; + + private static final String MD5_HASH2 = "4685525525d82dea68c6a6cd5a08f726"; + + private static final String MD5_HASH1 = "53e3b856aa1a3f3cb7fe0f7ac6163aaf"; + + private ArtifactDAO artifactDao; + + + protected void setUp() + throws Exception + { + super.setUp(); + + ArchivaDAO dao = (ArchivaDAO) lookup( ArchivaDAO.ROLE, "jdo" ); + artifactDao = dao.getArtifactDAO(); + } + + public ArchivaArtifact createArtifact( String artifactId, String version ) + { + ArchivaArtifact artifact = + artifactDao.createArtifact( "org.apache.maven.archiva.test", artifactId, version, "", "jar" ); + artifact.getModel().setLastModified( new Date() ); + artifact.getModel().setRepositoryId( "testable_repo" ); + return artifact; + } + + public void testConstraintSHA1() + throws Exception + { + ArchivaArtifact artifact; + + // Setup artifacts in fresh DB. + artifact = createArtifact( "test-sha1-one", "1.0" ); + artifact.getModel().setChecksumSHA1( SHA1_HASH1 ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "test-sha1-one", "1.1" ); + artifact.getModel().setChecksumSHA1( SHA1_HASH1 ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "test-sha1-one", "1.2" ); + artifact.getModel().setChecksumSHA1( SHA1_HASH1 ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "test-sha1-two", "1.0" ); + artifact.getModel().setChecksumSHA1( SHA1_HASH1 ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "test-sha1-two", "2.0" ); + artifact.getModel().setChecksumSHA1( SHA1_HASH3 ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "test-sha1-two", "2.1" ); + artifact.getModel().setChecksumSHA1( SHA1_HASH2 ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "test-sha1-two", "3.0" ); + artifact.getModel().setChecksumSHA1( SHA1_HASH2 ); + artifactDao.saveArtifact( artifact ); + + assertConstraint( "Artifacts by SHA1 Checksum", 4, + new ArtifactsByChecksumConstraint( SHA1_HASH1, ArtifactsByChecksumConstraint.SHA1 ) ); + assertConstraint( "Artifacts by SHA1 Checksum", 2, + new ArtifactsByChecksumConstraint( SHA1_HASH2, ArtifactsByChecksumConstraint.SHA1 ) ); + assertConstraint( "Artifacts by SHA1 Checksum", 1, + new ArtifactsByChecksumConstraint( SHA1_HASH3, ArtifactsByChecksumConstraint.SHA1 ) ); + } + + public void testConstraintMD5() + throws Exception + { + ArchivaArtifact artifact; + + artifact = createArtifact( "test-md5-one", "1.0" ); + artifact.getModel().setChecksumMD5( MD5_HASH1 ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "test-md5-one", "1.1" ); + artifact.getModel().setChecksumMD5( MD5_HASH1 ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "test-md5-one", "1.2" ); + artifact.getModel().setChecksumMD5( MD5_HASH1 ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "test-md5-two", "1.0" ); + artifact.getModel().setChecksumMD5( MD5_HASH1 ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "test-md5-two", "2.0" ); + artifact.getModel().setChecksumMD5( MD5_HASH3 ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "test-md5-two", "2.1" ); + artifact.getModel().setChecksumMD5( MD5_HASH2 ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "test-md5-two", "3.0" ); + artifact.getModel().setChecksumMD5( MD5_HASH2 ); + artifactDao.saveArtifact( artifact ); + + assertConstraint( "Artifacts by MD5 Checksum", 4, + new ArtifactsByChecksumConstraint( MD5_HASH1, ArtifactsByChecksumConstraint.MD5 ) ); + assertConstraint( "Artifacts by MD5 Checksum", 2, + new ArtifactsByChecksumConstraint( MD5_HASH2, ArtifactsByChecksumConstraint.MD5 ) ); + assertConstraint( "Artifacts by MD5 Checksum", 1, + new ArtifactsByChecksumConstraint( MD5_HASH3, ArtifactsByChecksumConstraint.MD5 ) ); + } + + public void testConstraintOR() + throws Exception + { + ArchivaArtifact artifact; + + artifact = createArtifact( "test-one", "1.0" ); + artifact.getModel().setChecksumMD5( MD5_HASH1 ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "test-one", "1.1" ); + artifact.getModel().setChecksumMD5( MD5_HASH1 ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "test-one", "1.2" ); + artifact.getModel().setChecksumMD5( MD5_HASH1 ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "test-two", "1.0" ); + artifact.getModel().setChecksumMD5( MD5_HASH1 ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "test-two", "2.0" ); + artifact.getModel().setChecksumMD5( MD5_HASH3 ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "test-two", "2.1" ); + artifact.getModel().setChecksumMD5( MD5_HASH2 ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "test-two", "3.0" ); + artifact.getModel().setChecksumMD5( MD5_HASH2 ); + artifactDao.saveArtifact( artifact ); + + assertConstraint( "Artifacts by MD5 Checksum", 4, new ArtifactsByChecksumConstraint( MD5_HASH1 ) ); + assertConstraint( "Artifacts by MD5 Checksum", 2, new ArtifactsByChecksumConstraint( MD5_HASH2 ) ); + assertConstraint( "Artifacts by MD5 Checksum", 1, new ArtifactsByChecksumConstraint( MD5_HASH3 ) ); + } + + + private void assertConstraint( String msg, int count, ArtifactsByChecksumConstraint constraint ) + throws Exception + { + List results = artifactDao.queryArtifacts( constraint ); + assertNotNull( msg + ": Not Null", results ); + assertEquals( msg + ": Results.size", count, results.size() ); + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/ArtifactsByRepositoryConstraintTest.java b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/ArtifactsByRepositoryConstraintTest.java new file mode 100644 index 000000000..c503ffcfa --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/ArtifactsByRepositoryConstraintTest.java @@ -0,0 +1,130 @@ +package org.apache.maven.archiva.database.constraints; + +/* + * 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.Calendar; +import java.util.Date; +import java.util.List; + +import org.apache.maven.archiva.database.AbstractArchivaDatabaseTestCase; +import org.apache.maven.archiva.database.ArchivaDAO; +import org.apache.maven.archiva.database.ArtifactDAO; +import org.apache.maven.archiva.model.ArchivaArtifact; + +/** + * ArtifactsByRepositoryConstraintTest + * + * @author Maria Odea Ching + * @version + */ +public class ArtifactsByRepositoryConstraintTest + extends AbstractArchivaDatabaseTestCase +{ + private ArtifactDAO artifactDao; + + public void setUp() + throws Exception + { + super.setUp(); + + ArchivaDAO dao = (ArchivaDAO) lookup( ArchivaDAO.ROLE, "jdo" ); + artifactDao = dao.getArtifactDAO(); + } + + private ArchivaArtifact createArtifact( String groupId, String artifactId, String version ) + { + ArchivaArtifact artifact = artifactDao.createArtifact( groupId, artifactId, version, null, "jar" ); + artifact.getModel().setLastModified( new Date() ); + artifact.getModel().setRepositoryId( "test-repo" ); + + return artifact; + } + + public void testQueryAllArtifactsInRepo() + throws Exception + { + Date whenGathered = Calendar.getInstance().getTime(); + whenGathered.setTime( 123456789 ); + + ArchivaArtifact artifact = createArtifact( "org.apache.archiva", "artifact-one", "1.0" ); + artifact.getModel().setWhenGathered( whenGathered ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "org.apache.archiva", "artifact-one", "1.0.1" ); + artifact.getModel().setWhenGathered( whenGathered ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "org.apache.archiva", "artifact-two", "1.0.2" ); + artifact.getModel().setWhenGathered( whenGathered ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "org.apache.archiva", "artifact-one", "2.0" ); + artifact.getModel().setRepositoryId( "different-repo" ); + artifact.getModel().setWhenGathered( whenGathered ); + artifactDao.saveArtifact( artifact ); + + assertConstraint( "Artifacts By Repository", 3, new ArtifactsByRepositoryConstraint( "test-repo" ) ); + } + + public void testQueryArtifactsInRepoWithWhenGathered() + throws Exception + { + Date whenGathered = Calendar.getInstance().getTime(); + + ArchivaArtifact artifact = createArtifact( "org.apache.archiva", "artifact-one", "1.0" ); + artifact.getModel().setWhenGathered( whenGathered ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "org.apache.archiva", "artifact-one", "1.0.1" ); + artifact.getModel().setWhenGathered( whenGathered ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "org.apache.archiva", "artifact-one", "1.0.2" ); + artifact.getModel().setWhenGathered( whenGathered ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "org.apache.archiva", "artifact-one", "2.0" ); + artifact.getModel().setRepositoryId( "different-repo" ); + artifact.getModel().setWhenGathered( whenGathered ); + artifactDao.saveArtifact( artifact ); + + Date olderWhenGathered = Calendar.getInstance().getTime(); + olderWhenGathered.setTime( 123456789 ); + + artifact = createArtifact( "org.apache.archiva", "artifact-two", "1.1-SNAPSHOT" ); + artifact.getModel().setWhenGathered( olderWhenGathered ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "org.apache.archiva", "artifact-three", "2.0-beta-1" ); + artifact.getModel().setWhenGathered( whenGathered ); + artifactDao.saveArtifact( artifact ); + + assertConstraint( "Artifacts By Repository and When Gathered", 4, + new ArtifactsByRepositoryConstraint( "test-repo", whenGathered, "repositoryId" ) ); + } + + private void assertConstraint( String msg, int count, ArtifactsByRepositoryConstraint constraint ) + throws Exception + { + List results = artifactDao.queryArtifacts( constraint ); + assertNotNull( msg + ": Not Null", results ); + assertEquals( msg + ": Results.size", count, results.size() ); + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/ArtifactsProcessedConstraintTest.java b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/ArtifactsProcessedConstraintTest.java new file mode 100644 index 000000000..d978213af --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/ArtifactsProcessedConstraintTest.java @@ -0,0 +1,136 @@ +package org.apache.maven.archiva.database.constraints; + +/* + * 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.archiva.database.AbstractArchivaDatabaseTestCase; +import org.apache.maven.archiva.database.ArtifactDAO; +import org.apache.maven.archiva.model.ArchivaArtifact; + +import java.util.Date; +import java.util.Iterator; +import java.util.List; + +/** + * ArtifactsProcessedConstraintTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ArtifactsProcessedConstraintTest + extends AbstractArchivaDatabaseTestCase +{ + public ArchivaArtifact createArtifact( String groupId, String artifactId, String version, String whenProcessed ) + throws Exception + { + ArchivaArtifact artifact = dao.getArtifactDAO().createArtifact( groupId, artifactId, version, "", "jar" ); + assertNotNull( "Artifact should not be null.", artifact ); + Date dateWhenProcessed = null; + + if ( whenProcessed != null ) + { + dateWhenProcessed = toDate( whenProcessed ); + } + + artifact.getModel().setWhenProcessed( dateWhenProcessed ); + + // Satisfy table / column requirements. + artifact.getModel().setLastModified( new Date() ); + + return artifact; + } + + public void assertResults( String type, List results, String expectedArtifacts[] ) + { + assertNotNull( "Results[" + type + "] should not be null.", results ); + assertEquals( "Results[" + type + "].size", expectedArtifacts.length, results.size() ); + + for ( int i = 0; i < expectedArtifacts.length; i++ ) + { + String artifactId = expectedArtifacts[i]; + + int found = 0; + Iterator it = results.iterator(); + while ( it.hasNext() ) + { + ArchivaArtifact artifact = (ArchivaArtifact) it.next(); + if ( artifactId.equals( artifact.getArtifactId() ) ) + { + found++; + } + } + + if ( found <= 0 ) + { + fail( "Results[" + type + "] - Did not find expected artifact ID [" + artifactId + "]" ); + } + + if ( found > 1 ) + { + fail( "Results[" + type + "] - Expected to find 1 copy of artifact ID [" + artifactId + + "], yet found <" + found + "> instead." ); + } + } + } + + protected void setUp() + throws Exception + { + super.setUp(); + + ArtifactDAO adao = dao.getArtifactDAO(); + assertNotNull( "Artifact DAO should not be null.", adao ); + + adao.saveArtifact( createArtifact( "org.apache.maven.archiva", "archiva-common", "1.0-SNAPSHOT", null ) ); + adao.saveArtifact( createArtifact( "org.apache.maven.archiva", "archiva-utils", "1.0-SNAPSHOT", + "2006/08/22 19:01:00" ) ); + adao.saveArtifact( createArtifact( "org.apache.maven.archiva", "archiva-old", "0.1", "2004/02/15 9:01:00" ) ); + adao.saveArtifact( createArtifact( "org.apache.maven.archiva", "archiva-database", "1.0-SNAPSHOT", null ) ); + } + + public void testNotProcessed() + throws Exception + { + List results = dao.getArtifactDAO().queryArtifacts( new ArtifactsProcessedConstraint( false ) ); + assertResults( "not-processed", results, new String[] { "archiva-common", "archiva-database" } ); + } + + public void testProcessed() + throws Exception + { + List results = dao.getArtifactDAO().queryArtifacts( new ArtifactsProcessedConstraint( true ) ); + assertResults( "processed", results, new String[] { "archiva-utils", "archiva-old" } ); + } + + public void testSinceRecent() + throws Exception + { + Date since = toDate( "2006/01/01 12:00:00" ); + List results = dao.getArtifactDAO().queryArtifacts( new ArtifactsProcessedConstraint( since ) ); + assertResults( "processed", results, new String[] { "archiva-utils" } ); + } + + public void testSinceOld() + throws Exception + { + Date since = toDate( "2001/01/01 12:00:00" ); + List results = dao.getArtifactDAO().queryArtifacts( new ArtifactsProcessedConstraint( since ) ); + assertResults( "processed", results, new String[] { "archiva-utils", "archiva-old" } ); + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/ArtifactsRelatedConstraintTest.java b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/ArtifactsRelatedConstraintTest.java new file mode 100644 index 000000000..e257f0dce --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/ArtifactsRelatedConstraintTest.java @@ -0,0 +1,91 @@ +package org.apache.maven.archiva.database.constraints; + +/* + * 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.archiva.database.AbstractArchivaDatabaseTestCase; +import org.apache.maven.archiva.database.ArchivaDAO; +import org.apache.maven.archiva.database.ArtifactDAO; +import org.apache.maven.archiva.database.Constraint; +import org.apache.maven.archiva.model.ArchivaArtifact; + +import java.util.Calendar; +import java.util.List; + +/** + * ArtifactsRelatedConstraintTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ArtifactsRelatedConstraintTest + extends AbstractArchivaDatabaseTestCase +{ + private static final String TEST_GROUPID = "org.apache.maven.archiva.test"; + private ArtifactDAO artifactDao; + + protected void setUp() + throws Exception + { + super.setUp(); + + ArchivaDAO dao = (ArchivaDAO) lookup( ArchivaDAO.ROLE, "jdo" ); + artifactDao = dao.getArtifactDAO(); + } + + public ArchivaArtifact createArtifact( String artifactId, String version, String classifier, String type ) + { + ArchivaArtifact artifact = artifactDao.createArtifact( TEST_GROUPID, artifactId, version, + classifier, type ); + Calendar cal = Calendar.getInstance(); + artifact.getModel().setLastModified( cal.getTime() ); + artifact.getModel().setRepositoryId( "testable_repo" ); + return artifact; + } + + public void testConstraint() + throws Exception + { + // Setup artifacts in fresh DB. + artifactDao.saveArtifact( createArtifact( "test-one", "1.0", "", "jar" ) ); + artifactDao.saveArtifact( createArtifact( "test-one", "1.0", "", "pom" ) ); + artifactDao.saveArtifact( createArtifact( "test-one", "1.0", "javadoc", "jar" ) ); + artifactDao.saveArtifact( createArtifact( "test-one", "1.0", "sources", "jar" ) ); + + artifactDao.saveArtifact( createArtifact( "test-one", "1.1", "", "jar" ) ); + artifactDao.saveArtifact( createArtifact( "test-one", "1.2", "", "jar" ) ); + + artifactDao.saveArtifact( createArtifact( "test-two", "1.0", "", "jar" ) ); + artifactDao.saveArtifact( createArtifact( "test-two", "2.0", "", "jar" ) ); + artifactDao.saveArtifact( createArtifact( "test-two", "2.1", "", "jar" ) ); + artifactDao.saveArtifact( createArtifact( "test-two", "3.0", "", "jar" ) ); + + assertConstraint( 4, new ArtifactsRelatedConstraint( TEST_GROUPID, "test-one", "1.0" ) ); + assertConstraint( 1, new ArtifactsRelatedConstraint( TEST_GROUPID, "test-one", "1.1" ) ); + } + + private void assertConstraint( int expectedHits, Constraint constraint ) + throws Exception + { + List results = artifactDao.queryArtifacts( constraint ); + assertNotNull( "Related Artifacts: Not Null", results ); + assertEquals( "Related Artifacts: Results.size", expectedHits, results.size() ); + } + +} diff --git a/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/MostRecentRepositoryScanStatisticsTest.java b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/MostRecentRepositoryScanStatisticsTest.java new file mode 100644 index 000000000..2114f479a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/MostRecentRepositoryScanStatisticsTest.java @@ -0,0 +1,86 @@ +package org.apache.maven.archiva.database.constraints; + +/* + * 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.archiva.database.AbstractArchivaDatabaseTestCase; +import org.apache.maven.archiva.model.RepositoryContentStatistics; + +import java.util.List; + +/** + * MostRecentRepositoryScanStatisticsTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class MostRecentRepositoryScanStatisticsTest + extends AbstractArchivaDatabaseTestCase +{ + private RepositoryContentStatistics createStats( String repoId, String timestamp, long duration, long totalfiles, + long newfiles ) + throws Exception + { + RepositoryContentStatistics stats = new RepositoryContentStatistics(); + stats.setRepositoryId( repoId ); + stats.setDuration( duration ); + stats.setNewFileCount( newfiles ); + stats.setTotalFileCount( totalfiles ); + stats.setWhenGathered( toDate( timestamp ) ); + + return stats; + } + + protected void setUp() + throws Exception + { + super.setUp(); + + dao.save( createStats( "internal", "2007/02/21 10:00:00", 20000, 12000, 400 ) ); + dao.save( createStats( "internal", "2007/02/20 10:00:00", 20000, 11800, 0 ) ); + dao.save( createStats( "internal", "2007/02/19 10:00:00", 20000, 11800, 100 ) ); + dao.save( createStats( "internal", "2007/02/18 10:00:00", 20000, 11700, 320 ) ); + } + + public void testNotProcessedYet() + throws Exception + { + List results = dao.query( new MostRecentRepositoryScanStatistics( "central" ) ); + assertNotNull( "Not Processed Yet", results ); + assertTrue( "Not Processed Yet", results.isEmpty() ); + } + + public void testStats() + throws Exception + { + List results = dao.query( new MostRecentRepositoryScanStatistics( "internal" ) ); + assertNotNull( "Stats: results (not null)", results ); + assertEquals( "Stats: results.size", 1, results.size() ); + + Object o = results.get( 0 ); + assertTrue( "Stats: result[0] instanceof RepositoryScanStatistics", o instanceof RepositoryContentStatistics ); + RepositoryContentStatistics stats = (RepositoryContentStatistics) o; + assertEquals( "Stats: id", "internal", stats.getRepositoryId() ); + assertEquals( "Stats: when gathered", "2007/02/21 10:00:00", fromDate( stats.getWhenGathered() ) ); + assertEquals( "Stats: duration", 20000, stats.getDuration() ); + assertEquals( "Stats: total file count", 12000, stats.getTotalFileCount() ); + assertEquals( "Stats: new file count", 400, stats.getNewFileCount() ); + } + +} diff --git a/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/OlderArtifactsByAgeConstraintTest.java b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/OlderArtifactsByAgeConstraintTest.java new file mode 100644 index 000000000..2f23d34d7 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/OlderArtifactsByAgeConstraintTest.java @@ -0,0 +1,103 @@ +package org.apache.maven.archiva.database.constraints; + +/* + * 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.archiva.database.AbstractArchivaDatabaseTestCase; +import org.apache.maven.archiva.database.ArchivaDAO; +import org.apache.maven.archiva.database.ArtifactDAO; +import org.apache.maven.archiva.database.Constraint; +import org.apache.maven.archiva.model.ArchivaArtifact; + +import java.util.Calendar; +import java.util.List; + +/** + * OlderArtifactsByAgeConstraintTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class OlderArtifactsByAgeConstraintTest + extends AbstractArchivaDatabaseTestCase +{ + private ArtifactDAO artifactDao; + + protected void setUp() + throws Exception + { + super.setUp(); + + ArchivaDAO dao = (ArchivaDAO) lookup( ArchivaDAO.ROLE, "jdo" ); + artifactDao = dao.getArtifactDAO(); + } + + public ArchivaArtifact createArtifact( String artifactId, String version, int daysOld ) + { + ArchivaArtifact artifact = artifactDao.createArtifact( "org.apache.maven.archiva.test", artifactId, version, + "", "jar" ); + Calendar cal = Calendar.getInstance(); + cal.add( Calendar.DAY_OF_MONTH, ( -1 ) * daysOld ); + artifact.getModel().setLastModified( cal.getTime() ); + artifact.getModel().setRepositoryId( "testable_repo" ); + return artifact; + } + + public void testConstraint() + throws Exception + { + ArchivaArtifact artifact; + + // Setup artifacts in fresh DB. + artifact = createArtifact( "test-one", "1.0", 200 ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "test-one", "1.1", 100 ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "test-one", "1.2", 50 ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "test-two", "1.0", 200 ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "test-two", "2.0", 150 ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "test-two", "2.1", 100 ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "test-two", "3.0", 5 ); + artifactDao.saveArtifact( artifact ); + + assertConstraint( 6, new OlderArtifactsByAgeConstraint( 7 ) ); + assertConstraint( 5, new OlderArtifactsByAgeConstraint( 90 ) ); + assertConstraint( 5, new OlderArtifactsByAgeConstraint( 100 ) ); + assertConstraint( 3, new OlderArtifactsByAgeConstraint( 150 ) ); + assertConstraint( 0, new OlderArtifactsByAgeConstraint( 9000 ) ); + } + + private void assertConstraint( int expectedHits, Constraint constraint ) + throws Exception + { + List results = artifactDao.queryArtifacts( constraint ); + assertNotNull( "Older Artifacts By Age: Not Null", results ); + assertEquals( "Older Artifacts By Age: Results.size", expectedHits, results.size() ); + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/OlderSnapshotArtifactsByAgeConstraintTest.java b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/OlderSnapshotArtifactsByAgeConstraintTest.java new file mode 100644 index 000000000..d8a0e0229 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/OlderSnapshotArtifactsByAgeConstraintTest.java @@ -0,0 +1,118 @@ +package org.apache.maven.archiva.database.constraints; + +/* + * 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.archiva.database.AbstractArchivaDatabaseTestCase; +import org.apache.maven.archiva.database.ArchivaDAO; +import org.apache.maven.archiva.database.ArtifactDAO; +import org.apache.maven.archiva.database.Constraint; +import org.apache.maven.archiva.model.ArchivaArtifact; + +import java.util.Calendar; +import java.util.List; + +/** + * OlderArtifactsByAgeConstraintTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class OlderSnapshotArtifactsByAgeConstraintTest + extends AbstractArchivaDatabaseTestCase +{ + private ArtifactDAO artifactDao; + + protected void setUp() + throws Exception + { + super.setUp(); + + ArchivaDAO dao = (ArchivaDAO) lookup( ArchivaDAO.ROLE, "jdo" ); + artifactDao = dao.getArtifactDAO(); + } + + public ArchivaArtifact createArtifact( String artifactId, String version, int daysOld ) + { + ArchivaArtifact artifact = artifactDao.createArtifact( "org.apache.maven.archiva.test", artifactId, version, + "", "jar" ); + Calendar cal = Calendar.getInstance(); + cal.add( Calendar.DAY_OF_MONTH, ( -1 ) * daysOld ); + artifact.getModel().setLastModified( cal.getTime() ); + artifact.getModel().setRepositoryId( "testable_repo" ); + return artifact; + } + + public void testConstraint() + throws Exception + { + ArchivaArtifact artifact; + + // Setup artifacts in fresh DB. + artifact = createArtifact( "test-one", "1.0", 200 ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "test-one", "1.1-SNAPSHOT", 110 ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "test-one", "1.1", 100 ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "test-one", "1.2-20060923.005752-2", 55 ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "test-one", "1.2-SNAPSHOT", 52 ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "test-one", "1.2", 50 ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "test-two", "1.0-20060828.144210-1", 220 ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "test-two", "1.0-SNAPSHOT", 210 ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "test-two", "1.0", 200 ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "test-two", "2.0", 150 ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "test-two", "2.1", 100 ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "test-two", "3.0", 5 ); + artifactDao.saveArtifact( artifact ); + + assertConstraint( 5, new OlderSnapshotArtifactsByAgeConstraint( 7 ) ); + assertConstraint( 3, new OlderSnapshotArtifactsByAgeConstraint( 90 ) ); + assertConstraint( 3, new OlderSnapshotArtifactsByAgeConstraint( 100 ) ); + assertConstraint( 2, new OlderSnapshotArtifactsByAgeConstraint( 150 ) ); + assertConstraint( 0, new OlderSnapshotArtifactsByAgeConstraint( 500 ) ); + } + + private void assertConstraint( int expectedHits, Constraint constraint ) + throws Exception + { + List results = artifactDao.queryArtifacts( constraint ); + assertNotNull( "Older Snapshot Artifacts By Age: Not Null", results ); + assertEquals( "Older Snapshot Artifacts By Age: Results.size", expectedHits, results.size() ); + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/ProjectsByArtifactUsageConstraintTest.java b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/ProjectsByArtifactUsageConstraintTest.java new file mode 100644 index 000000000..b9e56c1d1 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/ProjectsByArtifactUsageConstraintTest.java @@ -0,0 +1,115 @@ +package org.apache.maven.archiva.database.constraints; + +/* + * 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.archiva.database.AbstractArchivaDatabaseTestCase; +import org.apache.maven.archiva.database.DeclarativeConstraint; +import org.apache.maven.archiva.model.ArchivaArtifact; +import org.apache.maven.archiva.model.ArchivaProjectModel; +import org.apache.maven.archiva.model.ArtifactReference; +import org.apache.maven.archiva.model.Dependency; +import org.apache.maven.archiva.model.VersionedReference; + +import java.util.Date; +import java.util.List; + +/** + * ProjectsByArtifactUsageConstraintTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ProjectsByArtifactUsageConstraintTest + extends AbstractArchivaDatabaseTestCase +{ + protected void setUp() + throws Exception + { + super.setUp(); + } + + private void saveModel( String modelId, String deps[] ) + throws Exception + { + ArchivaProjectModel model = new ArchivaProjectModel(); + // Piece together a simple model. + VersionedReference ref = toVersionedReference( modelId ); + model.setGroupId( ref.getGroupId() ); + model.setArtifactId( ref.getArtifactId() ); + model.setVersion( ref.getVersion() ); + model.setPackaging( "jar" ); + model.setOrigin( "testcase" ); + + if ( deps != null ) + { + for ( int i = 0; i < deps.length; i++ ) + { + ArtifactReference artiref = toArtifactReference( deps[i] ); + Dependency dep = new Dependency(); + dep.setGroupId( artiref.getGroupId() ); + dep.setArtifactId( artiref.getArtifactId() ); + dep.setVersion( artiref.getVersion() ); + dep.setClassifier( artiref.getClassifier() ); + dep.setClassifier( artiref.getType() ); + + model.addDependency( dep ); + } + } + + dao.getProjectModelDAO().saveProjectModel( model ); + } + + public ArchivaArtifact toArtifact( String id ) + { + ArtifactReference ref = toArtifactReference( id ); + + ArchivaArtifact artifact = new ArchivaArtifact( ref.getGroupId(), ref.getArtifactId(), ref.getVersion(), ref + .getClassifier(), ref.getType() ); + artifact.getModel().setLastModified( new Date() ); + artifact.getModel().setRepositoryId( "testable_repo" ); + return artifact; + } + + public void testContraint() + throws Exception + { + saveModel( "org.apache.maven.archiva:archiva-configuration:1.0", + new String[] { "org.codehaus.plexus:plexus-digest:1.0::jar" } ); + + saveModel( "org.apache.maven.archiva:archiva-common:1.0", new String[] { + "org.codehaus.plexus:plexus-digest:1.0::jar", + "junit:junit:3.8.1::jar" } ); + + ArchivaArtifact artifact; + + artifact = toArtifact( "org.foo:bar:4.0::jar" ); + assertConstraint( 0, new ProjectsByArtifactUsageConstraint( artifact ) ); + artifact = toArtifact( "org.codehaus.plexus:plexus-digest:1.0::jar" ); + assertConstraint( 2, new ProjectsByArtifactUsageConstraint( artifact ) ); + } + + private void assertConstraint( int expectedHits, DeclarativeConstraint constraint ) + throws Exception + { + List results = dao.getProjectModelDAO().queryProjectModels( constraint ); + assertNotNull( "Projects By Artifact Usage: Not Null", results ); + assertEquals( "Projects By Artifact Usage: Results.size", expectedHits, results.size() ); + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/RangeConstraintTest.java b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/RangeConstraintTest.java new file mode 100644 index 000000000..aa0618955 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/RangeConstraintTest.java @@ -0,0 +1,88 @@ +package org.apache.maven.archiva.database.constraints; + +/* + * 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.archiva.database.AbstractArchivaDatabaseTestCase; +import org.apache.maven.archiva.database.ArchivaDAO; +import org.apache.maven.archiva.database.Constraint; +import org.apache.maven.archiva.database.RepositoryProblemDAO; +import org.apache.maven.archiva.model.RepositoryProblem; + +import java.util.List; + +/** + * RangeConstraintTest + */ +public class RangeConstraintTest + extends AbstractArchivaDatabaseTestCase +{ + private RepositoryProblemDAO repoProblemDao; + + protected void setUp() + throws Exception + { + super.setUp(); + + ArchivaDAO dao = (ArchivaDAO) lookup( ArchivaDAO.ROLE, "jdo" ); + repoProblemDao = dao.getRepositoryProblemDAO(); + } + + public RepositoryProblem createRepoProblem() + { + RepositoryProblem repoProblem = new RepositoryProblem(); + + repoProblem.setGroupId( "groupId" ); + repoProblem.setArtifactId( "artifactId" ); + repoProblem.setMessage( "message" ); + repoProblem.setOrigin( "origin" ); + repoProblem.setPath( "path" ); + repoProblem.setRepositoryId( "repositoryId" ); + repoProblem.setType( "type" ); + repoProblem.setVersion( "version" ); + + return repoProblem; + } + + public void testConstraint() + throws Exception + { + repoProblemDao.saveRepositoryProblem( createRepoProblem() ); + repoProblemDao.saveRepositoryProblem( createRepoProblem() ); + repoProblemDao.saveRepositoryProblem( createRepoProblem() ); + repoProblemDao.saveRepositoryProblem( createRepoProblem() ); + repoProblemDao.saveRepositoryProblem( createRepoProblem() ); + + assertConstraint( 0, new RangeConstraint( new int[]{5, 10} ) ); + assertConstraint( 1, new RangeConstraint( new int[]{0, 1} ) ); + assertConstraint( 2, new RangeConstraint( new int[]{0, 2} ) ); + assertConstraint( 3, new RangeConstraint( new int[]{0, 3} ) ); + assertConstraint( 4, new RangeConstraint( new int[]{0, 4} ) ); + assertConstraint( 5, new RangeConstraint( new int[]{0, 5} ) ); + assertConstraint( 5, new RangeConstraint() ); + } + + private void assertConstraint( int expectedHits, Constraint constraint ) + throws Exception + { + List results = repoProblemDao.queryRepositoryProblems( constraint ); + assertNotNull( "Range Constraint: Not Null", results ); + assertEquals( "Range Constraint: Results.size", expectedHits, results.size() ); + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/RecentArtifactsByAgeConstraintTest.java b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/RecentArtifactsByAgeConstraintTest.java new file mode 100644 index 000000000..c1586e1c7 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/RecentArtifactsByAgeConstraintTest.java @@ -0,0 +1,104 @@ +package org.apache.maven.archiva.database.constraints; + +/* + * 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.archiva.database.AbstractArchivaDatabaseTestCase; +import org.apache.maven.archiva.database.ArchivaDAO; +import org.apache.maven.archiva.database.ArtifactDAO; +import org.apache.maven.archiva.database.Constraint; +import org.apache.maven.archiva.model.ArchivaArtifact; + +import java.util.Calendar; +import java.util.List; + +/** + * RecentArtifactsByAgeConstraintTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class RecentArtifactsByAgeConstraintTest + extends AbstractArchivaDatabaseTestCase +{ + private ArtifactDAO artifactDao; + + protected void setUp() + throws Exception + { + super.setUp(); + + ArchivaDAO dao = (ArchivaDAO) lookup( ArchivaDAO.ROLE, "jdo" ); + artifactDao = dao.getArtifactDAO(); + } + + public ArchivaArtifact createArtifact( String artifactId, String version, int daysOld ) + { + ArchivaArtifact artifact = artifactDao.createArtifact( "org.apache.maven.archiva.test", artifactId, version, + "", "jar" ); + Calendar cal = Calendar.getInstance(); + cal.add( Calendar.DAY_OF_MONTH, ( -1 ) * daysOld ); + artifact.getModel().setLastModified( cal.getTime() ); + artifact.getModel().setRepositoryId( "testable_repo" ); + return artifact; + } + + public void testConstraint() + throws Exception + { + ArchivaArtifact artifact; + + // Setup artifacts in fresh DB. + artifact = createArtifact( "test-one", "1.0", 200 ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "test-one", "1.1", 100 ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "test-one", "1.2", 50 ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "test-two", "1.0", 200 ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "test-two", "2.0", 150 ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "test-two", "2.1", 100 ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "test-two", "3.0", 5 ); + artifactDao.saveArtifact( artifact ); + + assertConstraint( 0, new RecentArtifactsByAgeConstraint( 2 ) ); + assertConstraint( 1, new RecentArtifactsByAgeConstraint( 7 ) ); + assertConstraint( 2, new RecentArtifactsByAgeConstraint( 90 ) ); + assertConstraint( 4, new RecentArtifactsByAgeConstraint( 100 ) ); + assertConstraint( 5, new RecentArtifactsByAgeConstraint( 150 ) ); + assertConstraint( 7, new RecentArtifactsByAgeConstraint( 9000 ) ); + } + + private void assertConstraint( int expectedHits, Constraint constraint ) + throws Exception + { + List results = artifactDao.queryArtifacts( constraint ); + assertNotNull( "Recent Artifacts By Age: Not Null", results ); + assertEquals( "Recent Artifacts By Age: Results.size", expectedHits, results.size() ); + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/RepositoryContentStatisticsByRepositoryConstraintTest.java b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/RepositoryContentStatisticsByRepositoryConstraintTest.java new file mode 100644 index 000000000..3e036b554 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/RepositoryContentStatisticsByRepositoryConstraintTest.java @@ -0,0 +1,79 @@ +package org.apache.maven.archiva.database.constraints; + +/* + * 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.archiva.database.AbstractArchivaDatabaseTestCase; +import org.apache.maven.archiva.database.Constraint; +import org.apache.maven.archiva.model.RepositoryContentStatistics; + +/** + * RepositoryContentStatisticsByRepositoryConstraintTest + * + * @author Maria Odea Ching + * @version + */ +public class RepositoryContentStatisticsByRepositoryConstraintTest + extends AbstractArchivaDatabaseTestCase +{ + private RepositoryContentStatistics createStats( String repoId, String timestamp, long duration, long totalfiles, + long newfiles ) + throws Exception + { + RepositoryContentStatistics stats = new RepositoryContentStatistics(); + stats.setRepositoryId( repoId ); + stats.setDuration( duration ); + stats.setNewFileCount( newfiles ); + stats.setTotalFileCount( totalfiles ); + stats.setWhenGathered( toDate( timestamp ) ); + + return stats; + } + + protected void setUp() + throws Exception + { + super.setUp(); + + dao.getRepositoryContentStatisticsDAO().saveRepositoryContentStatistics( + createStats( "internal", "2007/10/21 8:00:00", 20000, 12000, 400 ) ); + dao.getRepositoryContentStatisticsDAO().saveRepositoryContentStatistics( + createStats( "internal", "2007/10/20 8:00:00", 20000, 11800, 0 ) ); + dao.getRepositoryContentStatisticsDAO().saveRepositoryContentStatistics( + createStats( "internal", "2007/10/19 8:00:00", 20000, 11800, 100 ) ); + dao.getRepositoryContentStatisticsDAO().saveRepositoryContentStatistics( + createStats( "internal", "2007/10/18 8:00:00", 20000, 11700, 320 ) ); + } + + public void testStats() + throws Exception + { + Constraint constraint = new RepositoryContentStatisticsByRepositoryConstraint( "internal" ); + List results = dao.getRepositoryContentStatisticsDAO().queryRepositoryContentStatistics( constraint ); + assertNotNull( "Stats: results (not null)", results ); + assertEquals( "Stats: results.size", 4, results.size() ); + + assertEquals( "internal", ( (RepositoryContentStatistics) results.get( 0 ) ).getRepositoryId() ); + assertEquals( "internal", ( (RepositoryContentStatistics) results.get( 1 ) ).getRepositoryId() ); + assertEquals( "internal", ( (RepositoryContentStatistics) results.get( 2 ) ).getRepositoryId() ); + assertEquals( "internal", ( (RepositoryContentStatistics) results.get( 3 ) ).getRepositoryId() ); + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/RepositoryProblemByGroupIdConstraintTest.java b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/RepositoryProblemByGroupIdConstraintTest.java new file mode 100644 index 000000000..cc8b3f42b --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/RepositoryProblemByGroupIdConstraintTest.java @@ -0,0 +1,96 @@ +package org.apache.maven.archiva.database.constraints; + +/* + * 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.archiva.database.AbstractArchivaDatabaseTestCase; +import org.apache.maven.archiva.database.ArchivaDAO; +import org.apache.maven.archiva.database.Constraint; +import org.apache.maven.archiva.database.RepositoryProblemDAO; +import org.apache.maven.archiva.model.RepositoryProblem; + +import java.util.List; + +/** + * RepositoryProblemByGroupIdConstraintTest + */ +public class RepositoryProblemByGroupIdConstraintTest + extends AbstractArchivaDatabaseTestCase +{ + private static final String GROUP_ID_1 = "org.apache.maven.archiva.test.1"; + + private static final String GROUP_ID_2 = "org.apache.maven.archiva.test.2"; + + private static final String GROUP_ID_3 = "org.apache.maven.archiva.test.3"; + + private static final String GROUP_ID_PARTIAL = "org.apache.maven.archiva"; + + private RepositoryProblemDAO repoProblemDao; + + protected void setUp() + throws Exception + { + super.setUp(); + + ArchivaDAO dao = (ArchivaDAO) lookup( ArchivaDAO.ROLE, "jdo" ); + repoProblemDao = dao.getRepositoryProblemDAO(); + } + + public RepositoryProblem createRepoProblem( String groupId ) + { + RepositoryProblem repoProblem = new RepositoryProblem(); + + repoProblem.setGroupId( groupId ); + repoProblem.setArtifactId( "artifactId" ); + repoProblem.setMessage( "message" ); + repoProblem.setOrigin( "origin" ); + repoProblem.setPath( "path" ); + repoProblem.setRepositoryId( "repositoryId" ); + repoProblem.setType( "type" ); + repoProblem.setVersion( "version" ); + + return repoProblem; + } + + public void testConstraint() + throws Exception + { + repoProblemDao.saveRepositoryProblem( createRepoProblem( GROUP_ID_1 ) ); + + repoProblemDao.saveRepositoryProblem( createRepoProblem( GROUP_ID_2 ) ); + repoProblemDao.saveRepositoryProblem( createRepoProblem( GROUP_ID_2 ) ); + + repoProblemDao.saveRepositoryProblem( createRepoProblem( GROUP_ID_3 ) ); + repoProblemDao.saveRepositoryProblem( createRepoProblem( GROUP_ID_3 ) ); + repoProblemDao.saveRepositoryProblem( createRepoProblem( GROUP_ID_3 ) ); + + assertConstraint( 1, new RepositoryProblemByGroupIdConstraint( GROUP_ID_1 ) ); + assertConstraint( 2, new RepositoryProblemByGroupIdConstraint( GROUP_ID_2 ) ); + assertConstraint( 3, new RepositoryProblemByGroupIdConstraint( GROUP_ID_3 ) ); + assertConstraint( 6, new RepositoryProblemByGroupIdConstraint( GROUP_ID_PARTIAL ) ); + } + + private void assertConstraint( int expectedHits, Constraint constraint ) + throws Exception + { + List results = repoProblemDao.queryRepositoryProblems( constraint ); + assertNotNull( "Repository Problems by Group Id: Not Null", results ); + assertEquals( "Repository Problems by Group Id: Results.size", expectedHits, results.size() ); + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/RepositoryProblemByRepositoryIdConstraintTest.java b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/RepositoryProblemByRepositoryIdConstraintTest.java new file mode 100644 index 000000000..425fc0e8d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/RepositoryProblemByRepositoryIdConstraintTest.java @@ -0,0 +1,93 @@ +package org.apache.maven.archiva.database.constraints; + +/* + * 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.archiva.database.AbstractArchivaDatabaseTestCase; +import org.apache.maven.archiva.database.ArchivaDAO; +import org.apache.maven.archiva.database.Constraint; +import org.apache.maven.archiva.database.RepositoryProblemDAO; +import org.apache.maven.archiva.model.RepositoryProblem; + +import java.util.List; + +/** + * RepositoryProblemByRepositoryIdConstraintTest + */ +public class RepositoryProblemByRepositoryIdConstraintTest + extends AbstractArchivaDatabaseTestCase +{ + private static final String REPO_ID_1 = "test-repo-1"; + + private static final String REPO_ID_2 = "test-repo-2"; + + private static final String REPO_ID_3 = "test-repo-3"; + + private RepositoryProblemDAO repoProblemDao; + + protected void setUp() + throws Exception + { + super.setUp(); + + ArchivaDAO dao = (ArchivaDAO) lookup( ArchivaDAO.ROLE, "jdo" ); + repoProblemDao = dao.getRepositoryProblemDAO(); + } + + public RepositoryProblem createRepoProblem( String repoId ) + { + RepositoryProblem repoProblem = new RepositoryProblem(); + + repoProblem.setGroupId( "groupId" ); + repoProblem.setArtifactId( "artifactId" ); + repoProblem.setMessage( "message" ); + repoProblem.setOrigin( "origin" ); + repoProblem.setPath( "path" ); + repoProblem.setRepositoryId( repoId ); + repoProblem.setType( "type" ); + repoProblem.setVersion( "version" ); + + return repoProblem; + } + + public void testConstraint() + throws Exception + { + repoProblemDao.saveRepositoryProblem( createRepoProblem( REPO_ID_1 ) ); + + repoProblemDao.saveRepositoryProblem( createRepoProblem( REPO_ID_2 ) ); + repoProblemDao.saveRepositoryProblem( createRepoProblem( REPO_ID_2 ) ); + + repoProblemDao.saveRepositoryProblem( createRepoProblem( REPO_ID_3 ) ); + repoProblemDao.saveRepositoryProblem( createRepoProblem( REPO_ID_3 ) ); + repoProblemDao.saveRepositoryProblem( createRepoProblem( REPO_ID_3 ) ); + + assertConstraint( 1, new RepositoryProblemByRepositoryIdConstraint( REPO_ID_1 ) ); + assertConstraint( 2, new RepositoryProblemByRepositoryIdConstraint( REPO_ID_2 ) ); + assertConstraint( 3, new RepositoryProblemByRepositoryIdConstraint( REPO_ID_3 ) ); + } + + private void assertConstraint( int expectedHits, Constraint constraint ) + throws Exception + { + List results = repoProblemDao.queryRepositoryProblems( constraint ); + assertNotNull( "Repository Problems by Repository Id: Not Null", results ); + assertEquals( "Repository Problems by Repository Id: Results.size", expectedHits, results.size() ); + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/RepositoryProblemConstraintTest.java b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/RepositoryProblemConstraintTest.java new file mode 100644 index 000000000..a593281ac --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/RepositoryProblemConstraintTest.java @@ -0,0 +1,129 @@ +package org.apache.maven.archiva.database.constraints; + +/* + * 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.archiva.database.AbstractArchivaDatabaseTestCase; +import org.apache.maven.archiva.database.ArchivaDAO; +import org.apache.maven.archiva.database.Constraint; +import org.apache.maven.archiva.database.RepositoryProblemDAO; +import org.apache.maven.archiva.model.RepositoryProblem; + +import java.util.List; + +/** + * RepositoryProblemConstraintTest + */ +public class RepositoryProblemConstraintTest + extends AbstractArchivaDatabaseTestCase +{ + private static final String GROUP_ID_1 = "org.apache.maven.archiva.test.1"; + + private static final String GROUP_ID_2 = "org.apache.maven.archiva.test.2"; + + private static final String GROUP_ID_3 = "org.apache.maven.archiva.test.3"; + + private static final String GROUP_ID_4 = "org.apache.maven.archiva.test.4"; + + private static final String GROUP_ID_PARTIAL = "org.apache.maven.archiva"; + + private static final String REPO_ID_1 = "test-repo-1"; + + private static final String REPO_ID_2 = "test-repo-2"; + + private static final String REPO_ID_3 = "test-repo-3"; + + private static final String REPO_ID_4 = "test-repo-4"; + + private RepositoryProblemDAO repoProblemDao; + + protected void setUp() + throws Exception + { + super.setUp(); + + ArchivaDAO dao = (ArchivaDAO) lookup( ArchivaDAO.ROLE, "jdo" ); + repoProblemDao = dao.getRepositoryProblemDAO(); + } + + public RepositoryProblem createRepoProblem( String groupId, String repoId ) + { + RepositoryProblem repoProblem = new RepositoryProblem(); + + repoProblem.setGroupId( groupId ); + repoProblem.setArtifactId( "artifactId" ); + repoProblem.setMessage( "message" ); + repoProblem.setOrigin( "origin" ); + repoProblem.setPath( "path" ); + repoProblem.setRepositoryId( repoId ); + repoProblem.setType( "type" ); + repoProblem.setVersion( "version" ); + + return repoProblem; + } + + public void testGroupIdConstraint() + throws Exception + { + repoProblemDao.saveRepositoryProblem( createRepoProblem( GROUP_ID_1, REPO_ID_1 ) ); + + repoProblemDao.saveRepositoryProblem( createRepoProblem( GROUP_ID_2, REPO_ID_1 ) ); + repoProblemDao.saveRepositoryProblem( createRepoProblem( GROUP_ID_2, REPO_ID_1 ) ); + + repoProblemDao.saveRepositoryProblem( createRepoProblem( GROUP_ID_3, REPO_ID_1 ) ); + repoProblemDao.saveRepositoryProblem( createRepoProblem( GROUP_ID_3, REPO_ID_1 ) ); + repoProblemDao.saveRepositoryProblem( createRepoProblem( GROUP_ID_3, REPO_ID_1 ) ); + + assertConstraint( 1, new RepositoryProblemConstraint( GROUP_ID_1, REPO_ID_1 ) ); + assertConstraint( 2, new RepositoryProblemConstraint( GROUP_ID_2, REPO_ID_1 ) ); + assertConstraint( 3, new RepositoryProblemConstraint( GROUP_ID_3, REPO_ID_1 ) ); + assertConstraint( 0, new RepositoryProblemConstraint( GROUP_ID_4, REPO_ID_1 ) ); + assertConstraint( 6, new RepositoryProblemConstraint( GROUP_ID_PARTIAL, REPO_ID_1 ) ); + } + + public void testRepoIdConstraint() + throws Exception + { + repoProblemDao.saveRepositoryProblem( createRepoProblem( GROUP_ID_1, REPO_ID_1 ) ); + + repoProblemDao.saveRepositoryProblem( createRepoProblem( GROUP_ID_1, REPO_ID_2 ) ); + repoProblemDao.saveRepositoryProblem( createRepoProblem( GROUP_ID_1, REPO_ID_2 ) ); + + repoProblemDao.saveRepositoryProblem( createRepoProblem( GROUP_ID_1, REPO_ID_3 ) ); + repoProblemDao.saveRepositoryProblem( createRepoProblem( GROUP_ID_1, REPO_ID_3 ) ); + repoProblemDao.saveRepositoryProblem( createRepoProblem( GROUP_ID_1, REPO_ID_3 ) ); + + assertConstraint( 1, new RepositoryProblemConstraint( GROUP_ID_1, REPO_ID_1 ) ); + assertConstraint( 2, new RepositoryProblemConstraint( GROUP_ID_1, REPO_ID_2 ) ); + assertConstraint( 3, new RepositoryProblemConstraint( GROUP_ID_1, REPO_ID_3 ) ); + assertConstraint( 0, new RepositoryProblemConstraint( GROUP_ID_1, REPO_ID_4 ) ); + assertConstraint( 1, new RepositoryProblemConstraint( GROUP_ID_PARTIAL, REPO_ID_1 ) ); + assertConstraint( 2, new RepositoryProblemConstraint( GROUP_ID_PARTIAL, REPO_ID_2 ) ); + assertConstraint( 3, new RepositoryProblemConstraint( GROUP_ID_PARTIAL, REPO_ID_3 ) ); + assertConstraint( 0, new RepositoryProblemConstraint( GROUP_ID_PARTIAL, REPO_ID_4 ) ); + } + + private void assertConstraint( int expectedHits, Constraint constraint ) + throws Exception + { + List results = repoProblemDao.queryRepositoryProblems( constraint ); + assertNotNull( "Repository Problems: Not Null", results ); + assertEquals( "Repository Problems: Results.size", expectedHits, results.size() ); + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/UniqueArtifactIdConstraintTest.java b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/UniqueArtifactIdConstraintTest.java new file mode 100644 index 000000000..45191ec3a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/UniqueArtifactIdConstraintTest.java @@ -0,0 +1,119 @@ +package org.apache.maven.archiva.database.constraints; + +/* + * 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.maven.archiva.database.AbstractArchivaDatabaseTestCase; +import org.apache.maven.archiva.database.ArchivaDAO; +import org.apache.maven.archiva.database.ArtifactDAO; +import org.apache.maven.archiva.database.SimpleConstraint; +import org.apache.maven.archiva.model.ArchivaArtifact; + +import java.util.Arrays; +import java.util.Date; +import java.util.Iterator; +import java.util.List; + +/** + * UniqueArtifactIdConstraintTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class UniqueArtifactIdConstraintTest + extends AbstractArchivaDatabaseTestCase +{ + private ArtifactDAO artifactDao; + + protected void setUp() + throws Exception + { + super.setUp(); + + ArchivaDAO dao = (ArchivaDAO) lookup( ArchivaDAO.ROLE, "jdo" ); + artifactDao = dao.getArtifactDAO(); + } + + public ArchivaArtifact createArtifact( String groupId, String artifactId, String version ) + { + ArchivaArtifact artifact = artifactDao.createArtifact( groupId, artifactId, version, "", "jar" ); + artifact.getModel().setLastModified( new Date() ); // mandatory field. + artifact.getModel().setRepositoryId( "testable_repo" ); + return artifact; + } + + public void testConstraint() + throws Exception + { + ArchivaArtifact artifact; + + // Setup artifacts in fresh DB. + artifact = createArtifact( "commons-lang", "commons-lang", "2.0" ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "commons-lang", "commons-lang", "2.1" ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "org.apache.maven.test", "test-one", "1.2" ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "org.apache.maven.test.foo", "test-two", "1.0" ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "org.apache.maven.shared", "test-two", "2.0" ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "org.apache.maven.shared", "test-two", "2.1" ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "org.apache.maven.shared", "test-bar", "2.1" ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "org.codehaus.modello", "modellong", "3.0" ); + artifactDao.saveArtifact( artifact ); + + assertConstraint( new String[] {}, new UniqueArtifactIdConstraint( "org.apache" ) ); + assertConstraint( new String[] { "commons-lang" }, new UniqueArtifactIdConstraint( "commons-lang" ) ); + assertConstraint( new String[] { "test-one" }, new UniqueArtifactIdConstraint( "org.apache.maven.test" ) ); + assertConstraint( new String[] { "test-two", "test-bar" }, + new UniqueArtifactIdConstraint( "org.apache.maven.shared" ) ); + assertConstraint( new String[] { "modellong" }, new UniqueArtifactIdConstraint( "org.codehaus.modello" ) ); + } + + private void assertConstraint( String[] artifactIds, SimpleConstraint constraint ) + { + String prefix = "Unique Artifact IDs: "; + + List results = dao.query( constraint ); + assertNotNull( prefix + "Not Null", results ); + assertEquals( prefix + "Results.size", artifactIds.length, results.size() ); + + List expectedArtifactIds = Arrays.asList( artifactIds ); + + Iterator it = results.iterator(); + while ( it.hasNext() ) + { + String actualArtifactId = (String) it.next(); + assertTrue( prefix + "artifactId result should not be blank.", StringUtils.isNotBlank( actualArtifactId ) ); + assertTrue( prefix + " artifactId result <" + actualArtifactId + "> exists in expected artifactIds.", + expectedArtifactIds.contains( actualArtifactId ) ); + } + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/UniqueFieldConstraintTest.java b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/UniqueFieldConstraintTest.java new file mode 100644 index 000000000..b453281fa --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/UniqueFieldConstraintTest.java @@ -0,0 +1,117 @@ +package org.apache.maven.archiva.database.constraints; + +/* + * 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.archiva.database.AbstractArchivaDatabaseTestCase; +import org.apache.maven.archiva.database.ArchivaDAO; +import org.apache.maven.archiva.database.ArtifactDAO; +import org.apache.maven.archiva.database.RepositoryProblemDAO; +import org.apache.maven.archiva.database.SimpleConstraint; +import org.apache.maven.archiva.model.ArchivaArtifact; +import org.apache.maven.archiva.model.ArchivaArtifactModel; +import org.apache.maven.archiva.model.RepositoryProblem; + +import java.util.Date; +import java.util.List; + +/** + * UniqueFieldConstraintTest + */ +public class UniqueFieldConstraintTest + extends AbstractArchivaDatabaseTestCase +{ + private static final String GROUP_ID_1 = "org.apache.maven.archiva.test.1"; + + private static final String GROUP_ID_2 = "org.apache.maven.archiva.test.2"; + + private static final String GROUP_ID_3 = "org.apache.maven.archiva.test.3"; + + private ArchivaDAO archivaDao; + + private ArtifactDAO artifactDao; + + private RepositoryProblemDAO repoProblemDao; + + protected void setUp() + throws Exception + { + super.setUp(); + + archivaDao = (ArchivaDAO) lookup( ArchivaDAO.ROLE, "jdo" ); + artifactDao = archivaDao.getArtifactDAO(); + repoProblemDao = archivaDao.getRepositoryProblemDAO(); + } + + public ArchivaArtifact createArtifact( String groupId ) + { + ArchivaArtifact artifact = artifactDao.createArtifact( groupId, "artifactId", "version", "classifier", "jar" ); + + artifact.getModel().setLastModified( new Date() ); + artifact.getModel().setRepositoryId( "repoId" ); + + return artifact; + } + + public RepositoryProblem createRepoProblem( String groupId ) + { + RepositoryProblem repoProblem = new RepositoryProblem(); + + repoProblem.setGroupId( groupId ); + repoProblem.setArtifactId( "artifactId" ); + repoProblem.setMessage( "message" ); + repoProblem.setOrigin( "origin" ); + repoProblem.setPath( "path" ); + repoProblem.setRepositoryId( "repoId" ); + repoProblem.setType( "type" ); + repoProblem.setVersion( "version" ); + + return repoProblem; + } + + public void testArtifact() + throws Exception + { + artifactDao.saveArtifact( createArtifact( GROUP_ID_1 ) ); + artifactDao.saveArtifact( createArtifact( GROUP_ID_2 ) ); + artifactDao.saveArtifact( createArtifact( GROUP_ID_3 ) ); + + assertConstraint( 1, new UniqueFieldConstraint( ArchivaArtifactModel.class.getName(), "artifactId" ) ); + assertConstraint( 3, new UniqueFieldConstraint( ArchivaArtifactModel.class.getName(), "groupId" ) ); + } + + public void testRepoProblem() + throws Exception + { + repoProblemDao.saveRepositoryProblem( createRepoProblem( GROUP_ID_1 ) ); + repoProblemDao.saveRepositoryProblem( createRepoProblem( GROUP_ID_2 ) ); + repoProblemDao.saveRepositoryProblem( createRepoProblem( GROUP_ID_3 ) ); + + assertConstraint( 1, new UniqueFieldConstraint( RepositoryProblem.class.getName(), "artifactId" ) ); + assertConstraint( 3, new UniqueFieldConstraint( RepositoryProblem.class.getName(), "groupId" ) ); + } + + private void assertConstraint( int expectedHits, SimpleConstraint constraint ) + throws Exception + { + List results = archivaDao.query( constraint ); + assertNotNull( "Repository Problems: Not Null", results ); + assertEquals( "Repository Problems: Results.size", expectedHits, results.size() ); + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/UniqueGroupIdConstraintTest.java b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/UniqueGroupIdConstraintTest.java new file mode 100644 index 000000000..b32ea06cf --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/UniqueGroupIdConstraintTest.java @@ -0,0 +1,310 @@ +package org.apache.maven.archiva.database.constraints; + +/* + * 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.maven.archiva.database.AbstractArchivaDatabaseTestCase; +import org.apache.maven.archiva.database.ArchivaDAO; +import org.apache.maven.archiva.database.ArtifactDAO; +import org.apache.maven.archiva.database.SimpleConstraint; +import org.apache.maven.archiva.model.ArchivaArtifact; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.Iterator; +import java.util.List; + +/** + * UniqueGroupIdConstraintTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class UniqueGroupIdConstraintTest + extends AbstractArchivaDatabaseTestCase +{ + private ArtifactDAO artifactDao; + + public void testConstraintGroupIdParamCommonsLang() + throws Exception + { + setupArtifacts(); + + assertConstraint( new String[] { "commons-lang" }, new UniqueGroupIdConstraint( "commons-lang" ) ); + } + + public void testConstraintGroupIdParamNoRepos() + throws Exception + { + try + { + List selectedRepos = new ArrayList(); + new UniqueGroupIdConstraint( selectedRepos, "org" ); + fail( "Should have thrown an IllegalArgumentException due to lack of specified repos." ); + } + catch ( IllegalArgumentException e ) + { + // expected path. + } + } + + public void testConstraintGroupIdParamNullRepos() + throws Exception + { + try + { + new UniqueGroupIdConstraint( (List) null, "org" ); + fail( "Should have thrown an NullPointerException due to lack of specified repos." ); + } + catch ( NullPointerException e ) + { + // expected path. + } + } + + public void testConstraintGroupIdParamOrg() + throws Exception + { + setupArtifacts(); + + assertConstraint( new String[] { + "org.apache.maven.test", + "org.apache.maven.test.foo", + "org.apache.maven.shared", + "org.apache.archiva", + "org.codehaus.modello", + "org.codehaus.mojo" }, new UniqueGroupIdConstraint( "org" ) ); + } + + public void testConstraintGroupIdParamOrgApache() + throws Exception + { + setupArtifacts(); + + assertConstraint( new String[] { + "org.apache.maven.test", + "org.apache.maven.test.foo", + "org.apache.maven.shared", + "org.apache.archiva" }, new UniqueGroupIdConstraint( "org.apache" ) ); + } + + public void testConstraintGroupIdParamOrgApacheMaven() + throws Exception + { + setupArtifacts(); + + assertConstraint( new String[] { + "org.apache.maven.test", + "org.apache.maven.test.foo", + "org.apache.maven.shared" }, new UniqueGroupIdConstraint( "org.apache.maven" ) ); + } + + public void testConstraintGroupIdParamOrgApacheSnapshotsOnly() + throws Exception + { + setupArtifacts(); + + List observableRepositories = new ArrayList(); + observableRepositories.add( "snapshots" ); + + assertConstraint( new String[] { "org.apache.archiva" }, new UniqueGroupIdConstraint( observableRepositories, + "org.apache" ) ); + } + + public void testConstraintGroupIdParamOrgSnapshotsOnly() + throws Exception + { + setupArtifacts(); + + List observableRepositories = new ArrayList(); + observableRepositories.add( "snapshots" ); + + assertConstraint( new String[] { "org.apache.archiva", "org.codehaus.modello", "org.codehaus.mojo" }, + new UniqueGroupIdConstraint( observableRepositories, "org" ) ); + } + + public void testConstraintNoGroupIdParam() + throws Exception + { + setupArtifacts(); + + assertConstraint( new String[] { + "commons-lang", + "org.apache.maven.test", + "org.apache.maven.test.foo", + "org.apache.maven.shared", + "org.codehaus.modello", + "org.codehaus.mojo", + "org.apache.archiva" }, new UniqueGroupIdConstraint() ); + } + + public void testConstraintNoGroupIdParamCentralAndSnapshots() + throws Exception + { + setupArtifacts(); + + List observableRepositories = new ArrayList(); + observableRepositories.add( "central" ); + observableRepositories.add( "snapshots" ); + + assertConstraint( new String[] { + "commons-lang", + "org.apache.maven.test", + "org.apache.maven.test.foo", + "org.apache.maven.shared", + "org.codehaus.modello", + "org.codehaus.mojo", + "org.apache.archiva" }, new UniqueGroupIdConstraint( observableRepositories ) ); + } + + public void testConstraintNoGroupIdParamCentralOnly() + throws Exception + { + setupArtifacts(); + + List observableRepositories = new ArrayList(); + observableRepositories.add( "central" ); + + assertConstraint( new String[] { + "commons-lang", + "org.apache.maven.test", + "org.apache.maven.test.foo", + "org.apache.maven.shared", + "org.codehaus.modello" }, new UniqueGroupIdConstraint( observableRepositories ) ); + } + + public void testConstraintNoGroupIdParamNoRepos() + throws Exception + { + try + { + List selectedRepos = new ArrayList(); + new UniqueGroupIdConstraint( selectedRepos ); + fail( "Should have thrown an IllegalArgumentException due to lack of specified repos." ); + } + catch ( IllegalArgumentException e ) + { + // expected path. + } + } + + public void testConstraintNoGroupIdParamNullRepos() + throws Exception + { + try + { + new UniqueGroupIdConstraint( (List) null ); + fail( "Should have thrown an NullPointerException due to lack of specified repos." ); + } + catch ( NullPointerException e ) + { + // expected path. + } + } + + public void testConstraintNoGroupIdParamSnapshotsOnly() + throws Exception + { + setupArtifacts(); + + List observableRepositories = new ArrayList(); + observableRepositories.add( "snapshots" ); + + assertConstraint( new String[] { "org.codehaus.modello", "org.codehaus.mojo", "org.apache.archiva" }, + new UniqueGroupIdConstraint( observableRepositories ) ); + } + + private void assertConstraint( String[] expectedGroupIds, SimpleConstraint constraint ) + throws Exception + { + String prefix = "Unique Group IDs: "; + + List results = dao.query( constraint ); + assertNotNull( prefix + "Not Null", results ); + assertEquals( prefix + "Results.size", expectedGroupIds.length, results.size() ); + + List groupIdList = Arrays.asList( expectedGroupIds ); + + Iterator it = results.iterator(); + while ( it.hasNext() ) + { + String actualGroupId = (String) it.next(); + assertTrue( prefix + "groupId result should not be blank.", StringUtils.isNotBlank( actualGroupId ) ); + assertTrue( prefix + " groupId result <" + actualGroupId + "> exists in expected GroupIds.", groupIdList + .contains( actualGroupId ) ); + } + } + + private ArchivaArtifact createArtifact( String repoId, String groupId, String artifactId, String version ) + { + ArchivaArtifact artifact = artifactDao.createArtifact( groupId, artifactId, version, "", "jar" ); + artifact.getModel().setLastModified( new Date() ); // mandatory field. + artifact.getModel().setRepositoryId( repoId ); + return artifact; + } + + private void setupArtifacts() + throws Exception + { + ArchivaArtifact artifact; + + // Setup artifacts in fresh DB. + artifact = createArtifact( "central", "commons-lang", "commons-lang", "2.0" ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "central", "commons-lang", "commons-lang", "2.1" ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "central", "org.apache.maven.test", "test-one", "1.2" ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "central", "org.apache.maven.test.foo", "test-two", "1.0" ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "central", "org.apache.maven.shared", "test-two", "2.0" ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "central", "org.apache.maven.shared", "test-two", "2.1" ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "central", "org.codehaus.modello", "test-two", "3.0" ); + artifactDao.saveArtifact( artifact ); + + // Snapshots repository artifacts + artifact = createArtifact( "snapshots", "org.codehaus.modello", "test-three", "1.0-SNAPSHOT" ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "snapshots", "org.codehaus.mojo", "testable-maven-plugin", "2.1-SNAPSHOT" ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "snapshots", "org.apache.archiva", "testable", "1.1-alpha-1-20070822.033400-43" ); + artifactDao.saveArtifact( artifact ); + } + + protected void setUp() + throws Exception + { + super.setUp(); + + ArchivaDAO dao = (ArchivaDAO) lookup( ArchivaDAO.ROLE, "jdo" ); + artifactDao = dao.getArtifactDAO(); + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/UniqueVersionConstraintTest.java b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/UniqueVersionConstraintTest.java new file mode 100644 index 000000000..c30a624f1 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/UniqueVersionConstraintTest.java @@ -0,0 +1,193 @@ +package org.apache.maven.archiva.database.constraints; + +/* + * 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.maven.archiva.database.AbstractArchivaDatabaseTestCase; +import org.apache.maven.archiva.database.ArchivaDAO; +import org.apache.maven.archiva.database.ArtifactDAO; +import org.apache.maven.archiva.database.SimpleConstraint; +import org.apache.maven.archiva.model.ArchivaArtifact; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.List; + +/** + * UniqueVersionConstraintTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class UniqueVersionConstraintTest + extends AbstractArchivaDatabaseTestCase +{ + private ArtifactDAO artifactDao; + + public void testConstraintGroupIdArtifactIdCommonsLang() + throws Exception + { + setupArtifacts(); + + assertConstraint( new String[] { "2.0", "2.1" }, new UniqueVersionConstraint( "commons-lang", "commons-lang" ) ); + } + + public void testConstraintGroupIdArtifactIdInvalid() + throws Exception + { + setupArtifacts(); + + assertConstraint( new String[] {}, new UniqueVersionConstraint( "org.apache", "invalid" ) ); + assertConstraint( new String[] {}, new UniqueVersionConstraint( "org.apache.test", "invalid" ) ); + assertConstraint( new String[] {}, new UniqueVersionConstraint( "invalid", "test-two" ) ); + } + + public void testConstraintGroupIdArtifactIdMavenSharedTestTwo() + throws Exception + { + setupArtifacts(); + + assertConstraint( new String[] { "2.0", "2.1-SNAPSHOT", "2.1.1", "2.1-alpha-1" }, + new UniqueVersionConstraint( "org.apache.maven.shared", "test-two" ) ); + } + + public void testConstraintGroupIdArtifactIdMavenSharedTestTwoCentralOnly() + throws Exception + { + setupArtifacts(); + + List observableRepositories = new ArrayList(); + observableRepositories.add( "central" ); + + assertConstraint( new String[] { "2.0", "2.1.1", "2.1-alpha-1" }, + new UniqueVersionConstraint( observableRepositories, "org.apache.maven.shared", "test-two" ) ); + } + + public void testConstraintGroupIdArtifactIdMavenSharedTestTwoSnapshotsOnly() + throws Exception + { + setupArtifacts(); + + List observableRepositories = new ArrayList(); + observableRepositories.add( "snapshots" ); + + assertConstraint( new String[] { "2.1-SNAPSHOT" }, + new UniqueVersionConstraint( observableRepositories, "org.apache.maven.shared", "test-two" ) ); + } + + public void testConstraintGroupIdArtifactIdMavenTestOne() + throws Exception + { + setupArtifacts(); + + assertConstraint( new String[] { "1.2" }, new UniqueVersionConstraint( "org.apache.maven.test", "test-one" ) ); + } + + public void testConstraintGroupIdArtifactIdModelloLong() + throws Exception + { + setupArtifacts(); + + assertConstraint( new String[] { "3.0" }, new UniqueVersionConstraint( "org.codehaus.modello", "modellong" ) ); + } + + private void assertConstraint( String[] versions, SimpleConstraint constraint ) + { + String prefix = "Unique Versions: "; + + List results = dao.query( constraint ); + assertNotNull( prefix + "Not Null", results ); + assertEquals( prefix + "Results.size", versions.length, results.size() ); + + List expectedVersions = Arrays.asList( versions ); + + for ( String actualVersion : results ) + { + assertTrue( prefix + "version result should not be blank.", StringUtils.isNotBlank( actualVersion ) ); + assertTrue( prefix + "version result <" + actualVersion + "> exists in expected versions.", + expectedVersions.contains( actualVersion ) ); + } + } + + private ArchivaArtifact createArtifact( String repoId, String groupId, String artifactId, String version ) + { + ArchivaArtifact artifact = artifactDao.createArtifact( groupId, artifactId, version, "", "jar" ); + artifact.getModel().setLastModified( new Date() ); // mandatory field. + artifact.getModel().setRepositoryId( repoId ); + return artifact; + } + + private void setupArtifacts() + throws Exception + { + ArchivaArtifact artifact; + + // Setup artifacts in fresh DB. + artifact = createArtifact( "central", "commons-lang", "commons-lang", "2.0" ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "central", "commons-lang", "commons-lang", "2.1" ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "central", "org.apache.maven.test", "test-one", "1.2" ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "central", "org.apache.maven.test.foo", "test-two", "1.0" ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "central", "org.apache.maven.shared", "test-two", "2.0" ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "central", "org.apache.maven.shared", "test-two", "2.1.1" ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "central", "org.apache.maven.shared", "test-two", "2.1-alpha-1" ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "central", "org.apache.maven.shared", "test-bar", "2.1" ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "central", "org.codehaus.modello", "modellong", "3.0" ); + artifactDao.saveArtifact( artifact ); + + // Snapshots repository artifacts + artifact = createArtifact( "snapshots", "org.apache.maven.shared", "test-two", "2.1-SNAPSHOT" ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "snapshots", "org.codehaus.modello", "test-three", "1.0-SNAPSHOT" ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "snapshots", "org.codehaus.mojo", "testable-maven-plugin", "2.1-SNAPSHOT" ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "snapshots", "org.apache.archiva", "testable", "1.1-alpha-1-20070822.033400-43" ); + artifactDao.saveArtifact( artifact ); + } + + protected void setUp() + throws Exception + { + super.setUp(); + + ArchivaDAO dao = (ArchivaDAO) lookup( ArchivaDAO.ROLE, "jdo" ); + artifactDao = dao.getArtifactDAO(); + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/jdo/JdoArchivaDAOTest.java b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/jdo/JdoArchivaDAOTest.java new file mode 100644 index 000000000..4f51e5bb5 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/jdo/JdoArchivaDAOTest.java @@ -0,0 +1,39 @@ +package org.apache.maven.archiva.database.jdo; + +/* + * 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.archiva.database.AbstractArchivaDatabaseTestCase; + +/** + * JdoArchivaDAOTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class JdoArchivaDAOTest + extends AbstractArchivaDatabaseTestCase +{ + public void testSubDAOs() + { + assertNotNull( "Artifact DAO", dao.getArtifactDAO() ); + assertNotNull( "Project Model DAO", dao.getProjectModelDAO() ); + assertNotNull( "Repository Problem DAO", dao.getRepositoryProblemDAO() ); + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/jdo/JdoArtifactDAOTest.java b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/jdo/JdoArtifactDAOTest.java new file mode 100644 index 000000000..360209358 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/jdo/JdoArtifactDAOTest.java @@ -0,0 +1,115 @@ +package org.apache.maven.archiva.database.jdo; + +/* + * 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.archiva.database.AbstractArchivaDatabaseTestCase; +import org.apache.maven.archiva.database.ArtifactDAO; +import org.apache.maven.archiva.model.ArchivaArtifact; +import org.apache.maven.archiva.model.ArchivaArtifactModel; +import org.apache.maven.archiva.model.jpox.ArchivaArtifactModelKey; + +import java.util.Date; +import java.util.List; + +import javax.jdo.JDOHelper; +import javax.jdo.spi.JDOImplHelper; + +/** + * JdoArtifactDAOTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class JdoArtifactDAOTest + extends AbstractArchivaDatabaseTestCase +{ + public void testArtifactKey() + { + Object o = JDOImplHelper.getInstance().newObjectIdInstance( ArchivaArtifactModel.class, "foo:bar:1.0::jar" ); + assertNotNull( "Key should not be null.", o ); + assertTrue( "Key should be an instance of " + ArchivaArtifactModelKey.class.getName(), + ( o instanceof ArchivaArtifactModelKey ) ); + + ArchivaArtifactModelKey key = (ArchivaArtifactModelKey) o; + assertEquals( "foo", key.groupId ); + assertEquals( "bar", key.artifactId ); + assertEquals( "1.0", key.version ); + assertEquals( "", key.classifier ); + assertEquals( "jar", key.type ); + } + + public void testArtifactCRUD() + throws Exception + { + ArtifactDAO artiDao = dao.getArtifactDAO(); + + // Create it + ArchivaArtifact artifact = artiDao.createArtifact( "org.apache.maven.archiva", "archiva-test-module", "1.0", + "", "jar" ); + assertNotNull( artifact ); + + // Set some mandatory values + artifact.getModel().setLastModified( new Date() ); + artifact.getModel().setOrigin( "test" ); + + // Save it. + ArchivaArtifact savedArtifact = artiDao.saveArtifact( artifact ); + assertNotNull( savedArtifact ); + String savedKeyId = JDOHelper.getObjectId( savedArtifact.getModel() ).toString(); + assertEquals( "org.apache.maven.archiva:archiva-test-module:1.0::jar", savedKeyId ); + + // Test that something has been saved. + List artifacts = artiDao.queryArtifacts( null ); + assertNotNull( artifacts ); + assertEquals( 1, artifacts.size() ); + + // Test that retrieved object is what we expect. + ArchivaArtifact firstArtifact = (ArchivaArtifact) artifacts.get( 0 ); + assertNotNull( firstArtifact ); + assertEquals( "org.apache.maven.archiva", firstArtifact.getGroupId() ); + assertEquals( "archiva-test-module", firstArtifact.getArtifactId() ); + assertEquals( "1.0", firstArtifact.getVersion() ); + assertEquals( "", firstArtifact.getClassifier() ); + assertEquals( "jar", firstArtifact.getType() ); + + // Change value and save. + savedArtifact.getModel().setOrigin( "changed" ); + artiDao.saveArtifact( savedArtifact ); + + // Test that only 1 object is saved. + assertEquals( 1, artiDao.queryArtifacts( null ).size() ); + + // Get the specific artifact. + ArchivaArtifact actualArtifact = artiDao.getArtifact( "org.apache.maven.archiva", "archiva-test-module", "1.0", + null, "jar" ); + assertNotNull( actualArtifact ); + + // Test expected values. + assertEquals( "archiva-test-module", actualArtifact.getArtifactId() ); + assertEquals( "changed", actualArtifact.getModel().getOrigin() ); + + // Test that only 1 object is saved. + assertEquals( 1, artiDao.queryArtifacts( null ).size() ); + + // Delete object. + artiDao.deleteArtifact( actualArtifact ); + assertEquals( 0, artiDao.queryArtifacts( null ).size() ); + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/jdo/JdoProjectModelDAOTest.java b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/jdo/JdoProjectModelDAOTest.java new file mode 100644 index 000000000..e9a79a377 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/jdo/JdoProjectModelDAOTest.java @@ -0,0 +1,172 @@ +package org.apache.maven.archiva.database.jdo; + +/* + * 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.beanutils.PropertyUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.maven.archiva.database.AbstractArchivaDatabaseTestCase; +import org.apache.maven.archiva.database.ProjectModelDAO; +import org.apache.maven.archiva.model.ArchivaProjectModel; +import org.apache.maven.archiva.repository.project.ProjectModelReader; +import org.apache.maven.archiva.repository.project.readers.ProjectModel400Reader; + +import java.io.File; +import java.util.ArrayList; +import java.util.Date; +import java.util.Iterator; +import java.util.List; + +import javax.jdo.JDOHelper; + +/** + * JdoProjectModelDAOTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class JdoProjectModelDAOTest + extends AbstractArchivaDatabaseTestCase +{ + public void testProjectModelCRUD() + throws Exception + { + ProjectModelDAO projectDao = dao.getProjectModelDAO(); + + // Create it + ArchivaProjectModel model = projectDao.createProjectModel( "org.apache.maven.archiva", "archiva-test-module", + "1.0" ); + assertNotNull( model ); + + // Set some mandatory values + model.setPackaging( "pom" ); + model.setWhenIndexed( new Date() ); + model.setOrigin( "test" ); + + // Save it. + ArchivaProjectModel savedModel = projectDao.saveProjectModel( model ); + assertNotNull( savedModel ); + String savedKeyId = JDOHelper.getObjectId( savedModel ).toString(); + assertEquals( "org.apache.maven.archiva:archiva-test-module:1.0", savedKeyId ); + + // Test that something has been saved. + List projects = projectDao.queryProjectModels( null ); + assertNotNull( projects ); + assertEquals( 1, projects.size() ); + + // Test that retrieved object is what we expect. + ArchivaProjectModel firstModel = (ArchivaProjectModel) projects.get( 0 ); + assertNotNull( firstModel ); + assertEquals( "org.apache.maven.archiva", firstModel.getGroupId() ); + assertEquals( "archiva-test-module", firstModel.getArtifactId() ); + assertEquals( "1.0", firstModel.getVersion() ); + + // Change value and save. + savedModel.setOrigin( "changed" ); + projectDao.saveProjectModel( savedModel ); + + // Test that only 1 object is saved. + assertEquals( 1, projectDao.queryProjectModels( null ).size() ); + + // Get the specific artifact. + ArchivaProjectModel actualModel = projectDao.getProjectModel( "org.apache.maven.archiva", + "archiva-test-module", "1.0" ); + assertNotNull( actualModel ); + + // Test expected values. + assertEquals( "archiva-test-module", actualModel.getArtifactId() ); + assertEquals( "changed", actualModel.getOrigin() ); + + // Test that only 1 object is saved. + assertEquals( 1, projectDao.queryProjectModels( null ).size() ); + + // Delete object. + projectDao.deleteProjectModel( actualModel ); + assertEquals( 0, projectDao.queryProjectModels( null ).size() ); + } + + public void testSaveGetRealProjectModel() + throws Exception + { + String groupId = "org.apache.maven.shared"; + String artifactId = "maven-shared-jar"; + String version = "1.0-SNAPSHOT"; + + ProjectModelDAO projectDao = dao.getProjectModelDAO(); + + ProjectModelReader modelReader = new ProjectModel400Reader(); + + File pomFile = getTestFile( "src/test/resources/projects/maven-shared-jar-1.0-SNAPSHOT.pom" ); + + assertTrue( "pom file should exist: " + pomFile.getAbsolutePath(), pomFile.exists() && pomFile.isFile() ); + + ArchivaProjectModel model = modelReader.read( pomFile ); + assertNotNull( "Model should not be null.", model ); + + /* NOTE: We are intentionally using a basic project model in this unit test. + * The expansion of expressions, resolving of dependencies, and merging + * of parent poms is *NOT* performed to keep this unit test simple. + */ + + // Fill in mandatory/missing fields + model.setGroupId( groupId ); + model.setOrigin( "testcase" ); + + projectDao.saveProjectModel( model ); + + ArchivaProjectModel savedModel = projectDao.getProjectModel( groupId, artifactId, version ); + assertNotNull( "Project model should not be null.", savedModel ); + + // Test proper detachment of sub-objects. + List exprs = new ArrayList(); + exprs.add( "parentProject.groupId" ); + exprs.add( "organization.name" ); + exprs.add( "issueManagement.system" ); + exprs.add( "ciManagement.system" ); + exprs.add( "scm.url" ); + exprs.add( "individuals[0].name" ); + exprs.add( "dependencies[0].groupId" ); + exprs.add( "dependencyManagement[0].artifactId" ); + exprs.add( "repositories[0].id" ); + exprs.add( "plugins[0].artifactId" ); + exprs.add( "reports[0].artifactId" ); + exprs.add( "buildExtensions[0].artifactId" ); + exprs.add( "licenses[0].url" ); + exprs.add( "mailingLists[0].name" ); + + Iterator it = exprs.iterator(); + while ( it.hasNext() ) + { + String expr = (String) it.next(); + try + { + Object obj = PropertyUtils.getProperty( model, expr ); + assertNotNull( "Expr \"" + expr + "\" != null", obj ); + assertTrue( "Expr \"" + expr + "\" should be a String.", ( obj instanceof String ) ); + String value = (String) obj; + assertTrue( "Expr \"" + expr + "\" value should not be blank.", StringUtils.isNotBlank( value ) ); + } + catch ( IndexOutOfBoundsException e ) + { + fail( "Expr \"" + expr + "\" unable to get indexed property: " + e.getClass().getName() + ": " + + e.getMessage() ); + } + } + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/jdo/JdoRepositoryContentStatisticsDAOTest.java b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/jdo/JdoRepositoryContentStatisticsDAOTest.java new file mode 100644 index 000000000..3989d72fe --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/jdo/JdoRepositoryContentStatisticsDAOTest.java @@ -0,0 +1,84 @@ +package org.apache.maven.archiva.database.jdo; + +/* + * 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 javax.jdo.JDOHelper; + +import org.apache.maven.archiva.database.AbstractArchivaDatabaseTestCase; +import org.apache.maven.archiva.database.RepositoryContentStatisticsDAO; +import org.apache.maven.archiva.database.constraints.RepositoryContentStatisticsByRepositoryConstraint; +import org.apache.maven.archiva.model.RepositoryContentStatistics; + +/** + * JdoRepositoryContentStatisticsDAOTest + * + * @author Maria Odea Ching + * @version + */ +public class JdoRepositoryContentStatisticsDAOTest + extends AbstractArchivaDatabaseTestCase +{ + public void testCRUD() + throws Exception + { + RepositoryContentStatisticsDAO repoContentStatisticsDAO = dao.getRepositoryContentStatisticsDAO(); + + // create + RepositoryContentStatistics savedStats = + repoContentStatisticsDAO.saveRepositoryContentStatistics( createStats( "internal", "2007/10/21 8:00:00", + 20000, 12000, 400 ) ); + assertNotNull( savedStats ); + + String savedKeyId = JDOHelper.getObjectId( savedStats ).toString(); + assertEquals( "1[OID]org.apache.maven.archiva.model.RepositoryContentStatistics", savedKeyId ); + + // query + List results = + repoContentStatisticsDAO.queryRepositoryContentStatistics( new RepositoryContentStatisticsByRepositoryConstraint( + "internal" ) ); + assertNotNull( results ); + assertEquals( 1, results.size() ); + + RepositoryContentStatistics stats = (RepositoryContentStatistics) results.get( 0 ); + assertEquals( "internal", stats.getRepositoryId() ); + + // delete + repoContentStatisticsDAO.deleteRepositoryContentStatistics( stats ); + + assertEquals( 0, repoContentStatisticsDAO.queryRepositoryContentStatistics( + new RepositoryContentStatisticsByRepositoryConstraint( "internal" ) ).size() ); + } + + private RepositoryContentStatistics createStats( String repoId, String timestamp, long duration, long totalfiles, + long newfiles ) + throws Exception + { + RepositoryContentStatistics stats = new RepositoryContentStatistics(); + stats.setRepositoryId( repoId ); + stats.setDuration( duration ); + stats.setNewFileCount( newfiles ); + stats.setTotalFileCount( totalfiles ); + stats.setWhenGathered( toDate( timestamp ) ); + + return stats; + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/updater/DatabaseConsumersTest.java b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/updater/DatabaseConsumersTest.java new file mode 100644 index 000000000..575774283 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/updater/DatabaseConsumersTest.java @@ -0,0 +1,84 @@ +package org.apache.maven.archiva.database.updater; + +/* + * 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.collections.CollectionUtils; +import org.codehaus.plexus.spring.PlexusInSpringTestCase; + +import java.util.List; + +/** + * DatabaseConsumersTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class DatabaseConsumersTest + extends PlexusInSpringTestCase +{ + private DatabaseConsumers lookupDbConsumers() + throws Exception + { + DatabaseConsumers dbconsumers = (DatabaseConsumers) lookup( DatabaseConsumers.class ); + assertNotNull( "DatabaseConsumers should not be null.", dbconsumers ); + return dbconsumers; + } + + public void testGetAvailableCleanupConsumers() + throws Exception + { + DatabaseConsumers dbconsumers = lookupDbConsumers(); + List available = dbconsumers.getAvailableCleanupConsumers(); + assertNotNull( "Available Cleanup Consumers should never be null.", available ); + + assertTrue( "Available Cleanup Consumers should have entries.", CollectionUtils.isNotEmpty( available ) ); + } + + public void testGetAvailableUnprocessedConsumers() + throws Exception + { + DatabaseConsumers dbconsumers = lookupDbConsumers(); + List available = dbconsumers.getAvailableUnprocessedConsumers(); + assertNotNull( "Available Unprocessed Consumers should never be null.", available ); + + assertTrue( "Available Unprocessed Consumers should have entries.", CollectionUtils.isNotEmpty( available ) ); + } + + public void testGetSelectedCleanupConsumers() + throws Exception + { + DatabaseConsumers dbconsumers = lookupDbConsumers(); + List available = dbconsumers.getSelectedCleanupConsumers(); + assertNotNull( "Selected Cleanup Consumers should never be null.", available ); + + assertTrue( "Selected Cleanup Consumers should have entries.", CollectionUtils.isNotEmpty( available ) ); + } + + public void testGetSelectedUnprocessedConsumers() + throws Exception + { + DatabaseConsumers dbconsumers = lookupDbConsumers(); + List available = dbconsumers.getSelectedUnprocessedConsumers(); + assertNotNull( "Selected Unprocessed Consumers should never be null.", available ); + + assertTrue( "Selected Unprocessed Consumers should have entries.", CollectionUtils.isNotEmpty( available ) ); + } + +} diff --git a/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/updater/DatabaseUpdaterTest.java b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/updater/DatabaseUpdaterTest.java new file mode 100644 index 000000000..28c4e6350 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/updater/DatabaseUpdaterTest.java @@ -0,0 +1,103 @@ +package org.apache.maven.archiva.database.updater; + +/* + * 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.archiva.database.AbstractArchivaDatabaseTestCase; +import org.apache.maven.archiva.database.ArtifactDAO; +import org.apache.maven.archiva.model.ArchivaArtifact; + +import java.util.Date; + +/** + * DatabaseUpdaterTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class DatabaseUpdaterTest + extends AbstractArchivaDatabaseTestCase +{ + private DatabaseUpdater dbupdater; + + public ArchivaArtifact createArtifact( String groupId, String artifactId, String version, String whenProcessed ) + throws Exception + { + ArchivaArtifact artifact = dao.getArtifactDAO().createArtifact( groupId, artifactId, version, "", "jar" ); + assertNotNull( "Artifact should not be null.", artifact ); + Date dateWhenProcessed = null; + + if ( whenProcessed != null ) + { + dateWhenProcessed = toDate( whenProcessed ); + } + + artifact.getModel().setWhenProcessed( dateWhenProcessed ); + + // Satisfy table / column requirements. + artifact.getModel().setLastModified( new Date() ); + + return artifact; + } + + protected void setUp() + throws Exception + { + super.setUp(); + + ArtifactDAO adao = dao.getArtifactDAO(); + assertNotNull( "Artifact DAO should not be null.", adao ); + + adao.saveArtifact( createArtifact( "org.apache.maven.archiva", "archiva-common", "1.0-SNAPSHOT", null ) ); + adao.saveArtifact( createArtifact( "org.apache.maven.archiva", "archiva-utils", "1.0-SNAPSHOT", null ) ); + adao.saveArtifact( createArtifact( "org.apache.maven.archiva", "archiva-old", "0.1", "2004/02/15 9:01:00" ) ); + adao.saveArtifact( createArtifact( "org.apache.maven.archiva", "archiva-database", "1.0-SNAPSHOT", null ) ); + + dbupdater = (DatabaseUpdater) lookup( DatabaseUpdater.class, "jdo" ); + assertNotNull( "DatabaseUpdater should not be null.", dbupdater ); + } + + public void testUpdateUnprocessed() + throws Exception + { + String groupId = "org.apache.maven.archiva"; + String artifactId = "archiva-utils"; + String version = "1.0-SNAPSHOT"; + String classifier = ""; + String type = "jar"; + + TestDatabaseUnprocessedConsumer consumer = lookupTestUnprocessedConsumer(); + consumer.resetCount(); + + // Check the state of the artifact in the DB. + ArchivaArtifact savedArtifact = dao.getArtifactDAO().getArtifact( groupId, artifactId, version, classifier, + type ); + assertFalse( "Artifact should not be considered processed (yet).", savedArtifact.getModel().isProcessed() ); + + // Update the artifact + dbupdater.updateUnprocessed( savedArtifact ); + + // Check the update. + ArchivaArtifact processed = dao.getArtifactDAO().getArtifact( groupId, artifactId, version, classifier, type ); + assertTrue( "Artifact should be flagged as processed.", processed.getModel().isProcessed() ); + + // Did the unprocessed consumer do it's thing? + assertEquals( "Processed Count.", 1, consumer.getCountProcessed() ); + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/updater/TestDatabaseCleanupConsumer.java b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/updater/TestDatabaseCleanupConsumer.java new file mode 100644 index 000000000..0062a8945 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/updater/TestDatabaseCleanupConsumer.java @@ -0,0 +1,100 @@ +package org.apache.maven.archiva.database.updater; + +/* + * 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.archiva.consumers.AbstractMonitoredConsumer; +import org.apache.maven.archiva.consumers.ConsumerException; +import org.apache.maven.archiva.consumers.DatabaseCleanupConsumer; +import org.apache.maven.archiva.model.ArchivaArtifact; + +import java.util.List; + +/** + * TestDatabaseCleanupConsumer + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class TestDatabaseCleanupConsumer + extends AbstractMonitoredConsumer + implements DatabaseCleanupConsumer +{ + private int countBegin = 0; + private int countComplete = 0; + private int countProcessed = 0; + + public void resetCount() + { + countBegin = 0; + countProcessed = 0; + countComplete = 0; + } + + public void beginScan() + { + countBegin++; + } + + public void completeScan() + { + countComplete++; + } + + public List getIncludedTypes() + { + return null; + } + + public void processArchivaArtifact( ArchivaArtifact artifact ) + throws ConsumerException + { + countProcessed++; + } + + public String getDescription() + { + return "Test Consumer for Database Cleanup"; + } + + public String getId() + { + return "test-db-cleanup"; + } + + public boolean isPermanent() + { + return false; + } + + public int getCountBegin() + { + return countBegin; + } + + public int getCountComplete() + { + return countComplete; + } + + public int getCountProcessed() + { + return countProcessed; + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/updater/TestDatabaseUnprocessedConsumer.java b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/updater/TestDatabaseUnprocessedConsumer.java new file mode 100644 index 000000000..664508e0f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/updater/TestDatabaseUnprocessedConsumer.java @@ -0,0 +1,111 @@ +package org.apache.maven.archiva.database.updater; + +/* + * 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.List; + +import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer; +import org.apache.maven.archiva.consumers.ConsumerException; +import org.apache.maven.archiva.consumers.DatabaseUnprocessedArtifactConsumer; +import org.apache.maven.archiva.model.ArchivaArtifact; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * TestDatabaseUnprocessedConsumer + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class TestDatabaseUnprocessedConsumer + extends AbstractMonitoredConsumer + implements DatabaseUnprocessedArtifactConsumer +{ + private Logger log = LoggerFactory.getLogger( TestDatabaseUnprocessedConsumer.class ); + + private int countBegin = 0; + + private int countComplete = 0; + + private int countProcessed = 0; + + public void resetCount() + { + countBegin = 0; + countProcessed = 0; + countComplete = 0; + } + + public void beginScan() + { + countBegin++; + } + + public void completeScan() + { + countComplete++; + } + + public List getIncludedTypes() + { + List types = new ArrayList(); + types.add( "pom" ); + types.add( "jar" ); + return types; + } + + public void processArchivaArtifact( ArchivaArtifact artifact ) + throws ConsumerException + { + log.info( "Processing Artifact: " + artifact ); + countProcessed++; + } + + public String getDescription() + { + return "Test Consumer for Database Unprocessed"; + } + + public String getId() + { + return "test-db-unprocessed"; + } + + public boolean isPermanent() + { + return false; + } + + public int getCountBegin() + { + return countBegin; + } + + public int getCountComplete() + { + return countComplete; + } + + public int getCountProcessed() + { + return countProcessed; + } +} diff --git a/MRM-541/archiva-modules/archiva-database/src/test/resources/META-INF/plexus/components.xml b/MRM-541/archiva-modules/archiva-database/src/test/resources/META-INF/plexus/components.xml new file mode 100644 index 000000000..6c3e13e95 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/test/resources/META-INF/plexus/components.xml @@ -0,0 +1,31 @@ + + + + org.codehaus.plexus.jdo.JdoFactory + archiva + org.codehaus.plexus.jdo.DefaultConfigurableJdoFactory + + org.jpox.PersistenceManagerFactoryImpl + + + javax.jdo.PersistenceManagerFactoryClass + org.jpox.PersistenceManagerFactoryImpl + + + + + + + org.apache.maven.archiva.consumers.DatabaseCleanupConsumer + test-db-cleanup + org.apache.maven.archiva.database.updater.TestDatabaseCleanupConsumer + + + + org.apache.maven.archiva.consumers.DatabaseUnprocessedArtifactConsumer + test-db-unprocessed + org.apache.maven.archiva.database.updater.TestDatabaseUnprocessedConsumer + + + + diff --git a/MRM-541/archiva-modules/archiva-database/src/test/resources/archiva-test.xml b/MRM-541/archiva-modules/archiva-database/src/test/resources/archiva-test.xml new file mode 100644 index 000000000..6875b442f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/test/resources/archiva-test.xml @@ -0,0 +1,152 @@ + + + + + + + internal + Archiva Managed Internal Repository + file://${appserver.home}/repositories/internal + default + true + false + true + 0 0 * * * ? + + + snapshots + Archiva Managed Snapshot Repository + file://${appserver.home}/repositories/internal + default + false + true + true + 0 0,30 * * * ? + + + central + Central Repository + http://repo1.maven.org/maven2 + default + true + false + false + + + maven2-repository.dev.java.net + Java.net Repository for Maven 2 + https://maven2-repository.dev.java.net/nonav/repository + default + true + false + false + + + + + + + + + + + artifacts + + **/*.pom + **/*.jar + **/*.ear + **/*.war + **/*.car + **/*.sar + **/*.mar + **/*.rar + **/*.dtd + **/*.tld + **/*.tar.gz + **/*.tar.bz2 + **/*.zip + + + + indexable-content + + **/*.txt + **/*.TXT + **/*.block + **/*.config + **/*.pom + **/*.xml + **/*.xsd + **/*.dtd + **/*.tld + + + + auto-remove + + **/*.bak + **/*~ + **/*- + + + + ignored + + **/.htaccess + **/KEYS + **/*.rb + **/*.sh + **/.svn/** + **/.DAV/** + + + + + update-db-artifact + create-missing-checksums + update-db-repository-metadata + validate-checksum + validate-signature + index-content + auto-remove + auto-rename + + + update-db-bad-content + + + + + 0 0 * * * ? + + test-db-unprocessed + index-artifact + update-db-project + validate-repository-metadata + index-archive-toc + update-db-bytecode-stats + index-public-methods + + + test-db-cleanup + + + + diff --git a/MRM-541/archiva-modules/archiva-database/src/test/resources/log4j.xml b/MRM-541/archiva-modules/archiva-database/src/test/resources/log4j.xml new file mode 100644 index 000000000..395941ac3 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/test/resources/log4j.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MRM-541/archiva-modules/archiva-database/src/test/resources/org/apache/maven/archiva/database/updater/DatabaseConsumersTest.xml b/MRM-541/archiva-modules/archiva-database/src/test/resources/org/apache/maven/archiva/database/updater/DatabaseConsumersTest.xml new file mode 100644 index 000000000..c9e47bd41 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/test/resources/org/apache/maven/archiva/database/updater/DatabaseConsumersTest.xml @@ -0,0 +1,37 @@ + + + + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + org.apache.maven.archiva.configuration.DefaultArchivaConfiguration + + + org.codehaus.plexus.registry.Registry + configured + + + org.apache.maven.archiva.policies.PreDownloadPolicy + prePolicies + + + org.apache.maven.archiva.policies.PostDownloadPolicy + postPolicies + + + + + org.codehaus.plexus.registry.Registry + configured + org.codehaus.plexus.registry.commons.CommonsConfigurationRegistry + + + + + + + + + + diff --git a/MRM-541/archiva-modules/archiva-database/src/test/resources/org/apache/maven/archiva/database/updater/DatabaseUpdaterTest.xml b/MRM-541/archiva-modules/archiva-database/src/test/resources/org/apache/maven/archiva/database/updater/DatabaseUpdaterTest.xml new file mode 100644 index 000000000..c9e47bd41 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/test/resources/org/apache/maven/archiva/database/updater/DatabaseUpdaterTest.xml @@ -0,0 +1,37 @@ + + + + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + org.apache.maven.archiva.configuration.DefaultArchivaConfiguration + + + org.codehaus.plexus.registry.Registry + configured + + + org.apache.maven.archiva.policies.PreDownloadPolicy + prePolicies + + + org.apache.maven.archiva.policies.PostDownloadPolicy + postPolicies + + + + + org.codehaus.plexus.registry.Registry + configured + org.codehaus.plexus.registry.commons.CommonsConfigurationRegistry + + + + + + + + + + diff --git a/MRM-541/archiva-modules/archiva-database/src/test/resources/projects/maven-shared-jar-1.0-SNAPSHOT.pom b/MRM-541/archiva-modules/archiva-database/src/test/resources/projects/maven-shared-jar-1.0-SNAPSHOT.pom new file mode 100644 index 000000000..90ae915e6 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-database/src/test/resources/projects/maven-shared-jar-1.0-SNAPSHOT.pom @@ -0,0 +1,229 @@ + + + + + + 4.0.0 + + + org.apache.maven.shared + maven-shared-components + 3 + + + maven-shared-jar + jar + 1.0-SNAPSHOT + + Maven Shared Jar Utils + + + scm:svn:http://svn.apache.org/repos/asf/maven/sandbox/maven-shared-jar + scm:svn:https://svn.apache.org/repos/asf/maven/sandbox/maven-shared-jar + http://svn.apache.org/viewcvs.cgi/maven/sandbox/maven-shared-jar + + + + Apache + + + + jira + + + + continuum + + + + + joakime + joakime@apache.org + Joakim Erdfelt + + + + + + Someone Else + + + + + + http://www.apache.org/licenses/LICENSE-2.0 + + + + + + Shared Mailing List + + + + + + + org.codehaus.plexus + plexus-maven-plugin + + + + descriptor + + + + + + org.codehaus.mojo + cobertura-maven-plugin + + + + clean + + + + + + + + org.apache.maven.wagon + wagon-webdav + 1.0-beta-2 + + + + + + + + maven-project-info-reports-plugin + + + maven-javadoc-plugin + + + maven-surefire-report-plugin + + + org.codehaus.mojo + changelog-maven-plugin + + + + maven-jxr-plugin + + + maven-checkstyle-plugin + + + maven-pmd-plugin + + true + + rulesets/basic.xml + rulesets/codesize.xml + rulesets/controversial.xml + rulesets/coupling.xml + rulesets/finalizers.xml + rulesets/imports.xml + rulesets/junit.xml + rulesets/logging-jakarta-commons.xml + rulesets/naming.xml + rulesets/optimizations.xml + rulesets/strictexception.xml + rulesets/strings.xml + rulesets/sunsecure.xml + rulesets/unusedcode.xml + + + + + org.codehaus.mojo + cobertura-maven-plugin + + + + + + + snapshots.codehaus + http://snapshots.repository.codehaus.org/ + + false + + + true + + + + + + + + org.apache.maven + maven-model + 2.0.5 + + + + + + + org.apache.maven + maven-model + compile + + + + org.apache.maven + maven-artifact-manager + 2.0.2 + compile + + + + org.codehaus.plexus + plexus-digest + 1.0 + + + + org.apache.bcel + bcel + 5.2 + compile + + + + commons-collections + commons-collections + 3.1 + compile + + + + + diff --git a/MRM-541/archiva-modules/archiva-reporting/archiva-artifact-reports/pom.xml b/MRM-541/archiva-modules/archiva-reporting/archiva-artifact-reports/pom.xml new file mode 100755 index 000000000..30969cb23 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-reporting/archiva-artifact-reports/pom.xml @@ -0,0 +1,63 @@ + + + + + + org.apache.archiva + archiva-reporting + 1.2-SNAPSHOT + + 4.0.0 + archiva-artifact-reports + Archiva Reporting :: Artifact Reports + + + org.apache.archiva + archiva-report-manager + + + org.apache.archiva + archiva-database + + + org.apache.archiva + archiva-repository-layer + + + org.codehaus.plexus + plexus-utils + + + org.codehaus.plexus.registry + plexus-registry-commons + test + + + org.codehaus.plexus + plexus-spring + test + + + hsqldb + hsqldb + test + + + diff --git a/MRM-541/archiva-modules/archiva-reporting/archiva-artifact-reports/src/main/java/org/apache/maven/archiva/reporting/artifact/CorruptArtifactReport.java b/MRM-541/archiva-modules/archiva-reporting/archiva-artifact-reports/src/main/java/org/apache/maven/archiva/reporting/artifact/CorruptArtifactReport.java new file mode 100644 index 000000000..502489310 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-reporting/archiva-artifact-reports/src/main/java/org/apache/maven/archiva/reporting/artifact/CorruptArtifactReport.java @@ -0,0 +1,75 @@ +package org.apache.maven.archiva.reporting.artifact; + +/* + * 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.archiva.reporting.DynamicReportSource; +import org.apache.maven.archiva.reporting.DataLimits; +import org.apache.maven.archiva.database.ArchivaDAO; +import org.apache.maven.archiva.database.Constraint; +import org.apache.maven.archiva.database.ObjectNotFoundException; +import org.apache.maven.archiva.database.ArchivaDatabaseException; +import org.apache.maven.archiva.database.constraints.RepositoryProblemByTypeConstraint; + +import java.util.List; + +/** + * Report for corrupt artifacts + *

+ * Maria Odea Ching + */ +public class CorruptArtifactReport + implements DynamicReportSource +{ + public static final String PROBLEM_TYPE_CORRUPT_ARTIFACT = "corrupt-artifact"; + + /** + * @plexus.configuration default-value="Corrupt Artifact Report" + */ + private String name; + + /** + * @plexus.requirement role-hint="jdo" + */ + private ArchivaDAO dao; + + private Constraint constraint; + + public CorruptArtifactReport() + { + constraint = new RepositoryProblemByTypeConstraint( PROBLEM_TYPE_CORRUPT_ARTIFACT ); + } + + public List getData() + throws ObjectNotFoundException, ArchivaDatabaseException + { + return dao.getRepositoryProblemDAO().queryRepositoryProblems( constraint ); + } + + public List getData( DataLimits limits ) + throws ObjectNotFoundException, ArchivaDatabaseException + { + return dao.getRepositoryProblemDAO().queryRepositoryProblems( constraint ); + } + + public String getName() + { + return name; + } +} diff --git a/MRM-541/archiva-modules/archiva-reporting/archiva-artifact-reports/src/main/java/org/apache/maven/archiva/reporting/artifact/DuplicateArtifactReport.java b/MRM-541/archiva-modules/archiva-reporting/archiva-artifact-reports/src/main/java/org/apache/maven/archiva/reporting/artifact/DuplicateArtifactReport.java new file mode 100644 index 000000000..1583665c5 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-reporting/archiva-artifact-reports/src/main/java/org/apache/maven/archiva/reporting/artifact/DuplicateArtifactReport.java @@ -0,0 +1,80 @@ +package org.apache.maven.archiva.reporting.artifact; + +/* + * 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.archiva.database.ArchivaDAO; +import org.apache.maven.archiva.database.ArchivaDatabaseException; +import org.apache.maven.archiva.database.Constraint; +import org.apache.maven.archiva.database.ObjectNotFoundException; +import org.apache.maven.archiva.database.constraints.RepositoryProblemByTypeConstraint; +import org.apache.maven.archiva.reporting.DataLimits; +import org.apache.maven.archiva.reporting.DynamicReportSource; + +import java.util.List; + +/** + * DuplicateArtifactReport + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component role="org.apache.maven.archiva.reporting.DynamicReportSource" + * role-hint="duplicate-artifacts" + */ +public class DuplicateArtifactReport + implements DynamicReportSource +{ + public static final String PROBLEM_TYPE_DUPLICATE_ARTIFACTS = "duplicate-artifacts"; + + /** + * @plexus.configuration default-value="Duplicate Artifact Report" + */ + private String name; + + /** + * @plexus.requirement role-hint="jdo" + */ + private ArchivaDAO dao; + + private Constraint constraint; + + public DuplicateArtifactReport() + { + constraint = new RepositoryProblemByTypeConstraint( PROBLEM_TYPE_DUPLICATE_ARTIFACTS ); + } + + public List getData() + throws ObjectNotFoundException, ArchivaDatabaseException + { + return dao.getRepositoryProblemDAO().queryRepositoryProblems( constraint ); + } + + public List getData( DataLimits limits ) + throws ObjectNotFoundException, ArchivaDatabaseException + { + // TODO: implement limits. + return dao.getRepositoryProblemDAO().queryRepositoryProblems( constraint ); + } + + public String getName() + { + return name; + } +} diff --git a/MRM-541/archiva-modules/archiva-reporting/archiva-artifact-reports/src/main/java/org/apache/maven/archiva/reporting/artifact/DuplicateArtifactsConsumer.java b/MRM-541/archiva-modules/archiva-reporting/archiva-artifact-reports/src/main/java/org/apache/maven/archiva/reporting/artifact/DuplicateArtifactsConsumer.java new file mode 100644 index 000000000..63ff6e7d1 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-reporting/archiva-artifact-reports/src/main/java/org/apache/maven/archiva/reporting/artifact/DuplicateArtifactsConsumer.java @@ -0,0 +1,231 @@ +package org.apache.maven.archiva.reporting.artifact; + +/* + * 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.List; + +import org.apache.commons.collections.CollectionUtils; +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.ConfigurationNames; +import org.apache.maven.archiva.configuration.FileTypes; +import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer; +import org.apache.maven.archiva.consumers.ArchivaArtifactConsumer; +import org.apache.maven.archiva.consumers.ConsumerException; +import org.apache.maven.archiva.database.ArchivaDAO; +import org.apache.maven.archiva.database.ArchivaDatabaseException; +import org.apache.maven.archiva.database.ObjectNotFoundException; +import org.apache.maven.archiva.database.constraints.ArtifactsByChecksumConstraint; +import org.apache.maven.archiva.model.ArchivaArtifact; +import org.apache.maven.archiva.model.RepositoryProblem; +import org.apache.maven.archiva.repository.ManagedRepositoryContent; +import org.apache.maven.archiva.repository.RepositoryContentFactory; +import org.apache.maven.archiva.repository.RepositoryException; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException; +import org.codehaus.plexus.registry.Registry; +import org.codehaus.plexus.registry.RegistryListener; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Search the database of known SHA1 Checksums for potential duplicate artifacts. + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component role="org.apache.maven.archiva.consumers.ArchivaArtifactConsumer" + * role-hint="duplicate-artifacts" + */ +public class DuplicateArtifactsConsumer + extends AbstractMonitoredConsumer + implements ArchivaArtifactConsumer, RegistryListener, Initializable +{ + private Logger log = LoggerFactory.getLogger( DuplicateArtifactsConsumer.class ); + + /** + * @plexus.configuration default-value="duplicate-artifacts" + */ + private String id; + + /** + * @plexus.configuration default-value="Check for Duplicate Artifacts via SHA1 Checksums" + */ + private String description; + + /** + * @plexus.requirement + */ + private ArchivaConfiguration configuration; + + /** + * @plexus.requirement + */ + private FileTypes filetypes; + + /** + * @plexus.requirement role-hint="jdo" + */ + private ArchivaDAO dao; + + /** + * @plexus.requirement + */ + private RepositoryContentFactory repositoryFactory; + + // TODO: why is this not used? If it should be, what about excludes? + private List includes = new ArrayList(); + + public String getId() + { + return id; + } + + public String getDescription() + { + return description; + } + + public boolean isPermanent() + { + return false; + } + + public void beginScan() + { + /* do nothing */ + } + + public void completeScan() + { + /* do nothing */ + } + + public List getIncludedTypes() + { + return null; + } + + public void processArchivaArtifact( ArchivaArtifact artifact ) + throws ConsumerException + { + String checksumSha1 = artifact.getModel().getChecksumSHA1(); + + List results = null; + try + { + results = dao.getArtifactDAO().queryArtifacts( new ArtifactsByChecksumConstraint( + checksumSha1, ArtifactsByChecksumConstraint.SHA1 ) ); + } + catch ( ObjectNotFoundException e ) + { + log.debug( "No duplicates for artifact: " + artifact ); + return; + } + catch ( ArchivaDatabaseException e ) + { + log.warn( "Unable to query DB for potential duplicates with : " + artifact ); + return; + } + + if ( CollectionUtils.isNotEmpty( results ) ) + { + if ( results.size() <= 1 ) + { + // No duplicates detected. + log.debug( "Found no duplicate artifact results on: " + artifact ); + return; + } + + for ( ArchivaArtifact dupArtifact : results ) + { + if ( dupArtifact.equals( artifact ) ) + { + // Skip reference to itself. + continue; + } + + RepositoryProblem problem = new RepositoryProblem(); + problem.setRepositoryId( dupArtifact.getModel().getRepositoryId() ); + problem.setPath( toPath( dupArtifact ) ); + problem.setGroupId( artifact.getGroupId() ); + problem.setArtifactId( artifact.getArtifactId() ); + problem.setVersion( artifact.getVersion() ); + problem.setType( DuplicateArtifactReport.PROBLEM_TYPE_DUPLICATE_ARTIFACTS ); + problem.setOrigin( getId() ); + problem.setMessage( "Duplicate Artifact Detected: " + artifact + " <--> " + dupArtifact ); + + try + { + log.debug( "Found duplicate artifact: " + problem ); + dao.getRepositoryProblemDAO().saveRepositoryProblem( problem ); + } + catch ( ArchivaDatabaseException e ) + { + String emsg = "Unable to save problem with duplicate artifact to DB: " + e.getMessage(); + log.warn( emsg, e ); + throw new ConsumerException( emsg, e ); + } + } + } + } + + private String toPath( ArchivaArtifact artifact ) + { + try + { + String repoId = artifact.getModel().getRepositoryId(); + ManagedRepositoryContent repo = repositoryFactory.getManagedRepositoryContent( repoId ); + return repo.toPath( artifact ); + } + catch ( RepositoryException e ) + { + log.warn( "Unable to calculate path for artifact: " + artifact ); + return ""; + } + } + + public void afterConfigurationChange( Registry registry, String propertyName, Object propertyValue ) + { + if ( ConfigurationNames.isRepositoryScanning( propertyName ) ) + { + initIncludes(); + } + } + + public void beforeConfigurationChange( Registry registry, String propertyName, Object propertyValue ) + { + /* do nothing */ + } + + private void initIncludes() + { + includes.clear(); + + includes.addAll( filetypes.getFileTypePatterns( FileTypes.ARTIFACTS ) ); + } + + public void initialize() + throws InitializationException + { + initIncludes(); + configuration.addChangeListener( this ); + } +} diff --git a/MRM-541/archiva-modules/archiva-reporting/archiva-artifact-reports/src/main/java/org/apache/maven/archiva/reporting/artifact/LocationArtifactsConsumer.java b/MRM-541/archiva-modules/archiva-reporting/archiva-artifact-reports/src/main/java/org/apache/maven/archiva/reporting/artifact/LocationArtifactsConsumer.java new file mode 100644 index 000000000..23355f818 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-reporting/archiva-artifact-reports/src/main/java/org/apache/maven/archiva/reporting/artifact/LocationArtifactsConsumer.java @@ -0,0 +1,361 @@ +package org.apache.maven.archiva.reporting.artifact; + +/* + * 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; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.jar.JarEntry; +import java.util.jar.JarFile; + +import org.apache.commons.lang.StringUtils; +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.ConfigurationNames; +import org.apache.maven.archiva.configuration.FileTypes; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer; +import org.apache.maven.archiva.consumers.ArchivaArtifactConsumer; +import org.apache.maven.archiva.consumers.ConsumerException; +import org.apache.maven.archiva.database.ArchivaDAO; +import org.apache.maven.archiva.database.ArchivaDatabaseException; +import org.apache.maven.archiva.model.ArchivaArtifact; +import org.apache.maven.archiva.model.ArchivaProjectModel; +import org.apache.maven.archiva.model.RepositoryProblem; +import org.apache.maven.archiva.repository.ManagedRepositoryContent; +import org.apache.maven.archiva.repository.RepositoryContentFactory; +import org.apache.maven.archiva.repository.RepositoryException; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException; +import org.codehaus.plexus.registry.Registry; +import org.codehaus.plexus.registry.RegistryListener; +import org.codehaus.plexus.util.SelectorUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Validate the location of the artifact based on the values indicated + * in its pom (both the pom packaged with the artifact & the pom in the + * file system). + * + * @author Joakim Erdfelt + * @version $Id$ + * @plexus.component role="org.apache.maven.archiva.consumers.ArchivaArtifactConsumer" + * role-hint="validate-artifacts-location" + */ +public class LocationArtifactsConsumer + extends AbstractMonitoredConsumer + implements ArchivaArtifactConsumer, RegistryListener, Initializable +{ + private Logger log = LoggerFactory.getLogger( LocationArtifactsConsumer.class ); + + /** + * @plexus.configuration default-value="duplicate-artifacts" + */ + private String id; + + /** + * @plexus.configuration default-value="Check for Duplicate Artifacts via SHA1 Checksums" + */ + private String description; + + /** + * @plexus.requirement + */ + private ArchivaConfiguration configuration; + + /** + * @plexus.requirement + */ + private FileTypes filetypes; + + /** + * @plexus.requirement role-hint="jdo" + */ + private ArchivaDAO dao; + + /** + * @plexus.requirement + */ + private RepositoryContentFactory repositoryFactory; + + private Map repositoryMap = new HashMap(); + + // TODO: why is this not used? If it should be, what about excludes? + private List includes = new ArrayList(); + + public String getId() + { + return id; + } + + public String getDescription() + { + return description; + } + + public boolean isPermanent() + { + return false; + } + + public void beginScan() + { + /* do nothing */ + } + + public void completeScan() + { + /* do nothing */ + } + + public List getIncludedTypes() + { + return null; + } + + /** + * Check whether the artifact is in its proper location. The location of the artifact + * is validated first against the groupId, artifactId and versionId in the specified model + * object (pom in the file system). Then unpack the artifact (jar file) and get the model (pom) + * included in the package. If a model exists inside the package, then check if the artifact's + * location is valid based on the location specified in the pom. Check if the both the location + * specified in the file system pom and in the pom included in the package is the same. + */ + public void processArchivaArtifact( ArchivaArtifact artifact ) + throws ConsumerException + { + ManagedRepositoryConfiguration repository = findRepository( artifact ); + + File artifactFile = new File( repository.getLocation(), toPath( artifact ) ); + ArchivaProjectModel fsModel = readFilesystemModel( artifactFile ); + ArchivaProjectModel embeddedModel = readEmbeddedModel( artifact, artifactFile ); + + validateAppropriateModel( "Filesystem", artifact, fsModel ); + validateAppropriateModel( "Embedded", artifact, embeddedModel ); + } + + private void validateAppropriateModel( String location, ArchivaArtifact artifact, ArchivaProjectModel model ) + throws ConsumerException + { + if ( model != null ) + { + if ( !StringUtils.equals( model.getGroupId(), artifact.getGroupId() ) ) + { + addProblem( artifact, "The groupId of the " + location + + " project model doesn't match with the artifact, expected <" + artifact.getGroupId() + + ">, but was actually <" + model.getGroupId() + ">" ); + } + + if ( !StringUtils.equals( model.getArtifactId(), artifact.getArtifactId() ) ) + { + addProblem( artifact, "The artifactId of the " + location + + " project model doesn't match with the artifact, expected <" + artifact.getArtifactId() + + ">, but was actually <" + model.getArtifactId() + ">" ); + } + + if ( !StringUtils.equals( model.getVersion(), artifact.getVersion() ) ) + { + addProblem( artifact, "The version of the " + location + + " project model doesn't match with the artifact, expected <" + artifact.getVersion() + + ">, but was actually <" + model.getVersion() + ">" ); + } + } + } + + private ArchivaProjectModel readEmbeddedModel( ArchivaArtifact artifact, File artifactFile ) + throws ConsumerException + { + try + { + JarFile jar = new JarFile( artifactFile ); + + // Get the entry and its input stream. + JarEntry expectedEntry = jar.getJarEntry( + "META-INF/maven/" + artifact.getGroupId() + "/" + artifact.getArtifactId() + "/pom.xml" ); + + if ( expectedEntry != null ) + { + // TODO: read and resolve model here. + return null; + } + + /* Expected Entry not found, look for alternate that might + * indicate that the artifact is, indeed located in the wrong place. + */ + + List actualPomXmls = findJarEntryPattern( jar, "META-INF/maven/**/pom.xml" ); + if ( actualPomXmls.isEmpty() ) + { + // No check needed. + + } + + // TODO: test for invalid actual pom.xml + // TODO: test + } + catch ( IOException e ) + { + // Not able to read from the file. + String emsg = "Unable to read file contents: " + e.getMessage(); + addProblem( artifact, emsg ); + } + + return null; + } + + private List findJarEntryPattern( JarFile jar, String pattern ) + { + List hits = new ArrayList(); + + Enumeration entries = jar.entries(); + while ( entries.hasMoreElements() ) + { + JarEntry entry = entries.nextElement(); + if ( SelectorUtils.match( pattern, entry.getName() ) ) + { + hits.add( entry ); + } + } + + return hits; + } + + private void addProblem( ArchivaArtifact artifact, String msg ) + throws ConsumerException + { + RepositoryProblem problem = new RepositoryProblem(); + problem.setRepositoryId( artifact.getModel().getRepositoryId() ); + problem.setPath( toPath( artifact ) ); + problem.setGroupId( artifact.getGroupId() ); + problem.setArtifactId( artifact.getArtifactId() ); + problem.setVersion( artifact.getVersion() ); + problem.setType( LocationArtifactsReport.PROBLEM_TYPE_BAD_ARTIFACT_LOCATION ); + problem.setOrigin( getId() ); + problem.setMessage( msg ); + + try + { + dao.getRepositoryProblemDAO().saveRepositoryProblem( problem ); + } + catch ( ArchivaDatabaseException e ) + { + String emsg = "Unable to save problem with artifact location to DB: " + e.getMessage(); + log.warn( emsg, e ); + throw new ConsumerException( emsg, e ); + } + } + + private ArchivaProjectModel readFilesystemModel( File artifactFile ) + { + File pomFile = createPomFileReference( artifactFile ); + + // TODO: read and resolve model here. + + return null; + } + + private File createPomFileReference( File artifactFile ) + { + String pomFilename = artifactFile.getAbsolutePath(); + + int pos = pomFilename.lastIndexOf( '.' ); + if ( pos <= 0 ) + { + // Invalid filename. + return null; + } + + pomFilename = pomFilename.substring( 0, pos ) + ".pom"; + return new File( pomFilename ); + } + + private ManagedRepositoryConfiguration findRepository( ArchivaArtifact artifact ) + { + return (ManagedRepositoryConfiguration) this.repositoryMap.get( artifact.getModel().getRepositoryId() ); + } + + private String toPath( ArchivaArtifact artifact ) + { + try + { + String repoId = artifact.getModel().getRepositoryId(); + ManagedRepositoryContent repo = repositoryFactory.getManagedRepositoryContent( repoId ); + return repo.toPath( artifact ); + } + catch ( RepositoryException e ) + { + log.warn( "Unable to calculate path for artifact: " + artifact ); + return ""; + } + } + + public void afterConfigurationChange( Registry registry, String propertyName, Object propertyValue ) + { + if ( ConfigurationNames.isManagedRepositories( propertyName ) ) + { + initRepositoryMap(); + } + + if ( ConfigurationNames.isRepositoryScanning( propertyName ) ) + { + initIncludes(); + } + } + + public void beforeConfigurationChange( Registry registry, String propertyName, Object propertyValue ) + { + /* do nothing */ + } + + private void initIncludes() + { + includes.clear(); + + includes.addAll( filetypes.getFileTypePatterns( FileTypes.ARTIFACTS ) ); + } + + private void initRepositoryMap() + { + synchronized ( this.repositoryMap ) + { + this.repositoryMap.clear(); + + Map map = + configuration.getConfiguration().getManagedRepositoriesAsMap(); + + for ( Map.Entry entry : map.entrySet() ) + { + this.repositoryMap.put( entry.getKey(), entry.getValue() ); + } + } + } + + public void initialize() + throws InitializationException + { + initRepositoryMap(); + initIncludes(); + configuration.addChangeListener( this ); + } +} diff --git a/MRM-541/archiva-modules/archiva-reporting/archiva-artifact-reports/src/main/java/org/apache/maven/archiva/reporting/artifact/LocationArtifactsReport.java b/MRM-541/archiva-modules/archiva-reporting/archiva-artifact-reports/src/main/java/org/apache/maven/archiva/reporting/artifact/LocationArtifactsReport.java new file mode 100644 index 000000000..5aede32ce --- /dev/null +++ b/MRM-541/archiva-modules/archiva-reporting/archiva-artifact-reports/src/main/java/org/apache/maven/archiva/reporting/artifact/LocationArtifactsReport.java @@ -0,0 +1,81 @@ +package org.apache.maven.archiva.reporting.artifact; + +/* + * 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.archiva.database.ArchivaDAO; +import org.apache.maven.archiva.database.ArchivaDatabaseException; +import org.apache.maven.archiva.database.Constraint; +import org.apache.maven.archiva.database.ObjectNotFoundException; +import org.apache.maven.archiva.database.constraints.RepositoryProblemByTypeConstraint; +import org.apache.maven.archiva.reporting.DataLimits; +import org.apache.maven.archiva.reporting.DynamicReportSource; + +import java.util.List; + +/** + * LocationArtifactsReport + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component role="org.apache.maven.archiva.reporting.DynamicReportSource" + * role-hint="artifact-location" + */ +public class LocationArtifactsReport + implements DynamicReportSource +{ + public static final String PROBLEM_TYPE_BAD_ARTIFACT_LOCATION = "bad-artifact-location"; + + /** + * @plexus.configuration default-value="Artifact Locations Report" + */ + private String name; + + /** + * @plexus.requirement role-hint="jdo" + */ + private ArchivaDAO dao; + + private Constraint constraint; + + public LocationArtifactsReport() + { + constraint = new RepositoryProblemByTypeConstraint( PROBLEM_TYPE_BAD_ARTIFACT_LOCATION ); + } + + public List getData() + throws ObjectNotFoundException, ArchivaDatabaseException + { + return dao.getRepositoryProblemDAO().queryRepositoryProblems( constraint ); + } + + public List getData( DataLimits limits ) + throws ObjectNotFoundException, ArchivaDatabaseException + { + // TODO: implement limits. + return dao.getRepositoryProblemDAO().queryRepositoryProblems( constraint ); + } + + public String getName() + { + return name; + } + +} diff --git a/MRM-541/archiva-modules/archiva-reporting/archiva-artifact-reports/src/main/java/org/apache/maven/archiva/reporting/artifact/OldArtifactReport.java b/MRM-541/archiva-modules/archiva-reporting/archiva-artifact-reports/src/main/java/org/apache/maven/archiva/reporting/artifact/OldArtifactReport.java new file mode 100644 index 000000000..e95c1cc1c --- /dev/null +++ b/MRM-541/archiva-modules/archiva-reporting/archiva-artifact-reports/src/main/java/org/apache/maven/archiva/reporting/artifact/OldArtifactReport.java @@ -0,0 +1,76 @@ +package org.apache.maven.archiva.reporting.artifact; + +/* + * 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.archiva.database.ArchivaDAO; +import org.apache.maven.archiva.database.ArchivaDatabaseException; +import org.apache.maven.archiva.database.ObjectNotFoundException; +import org.apache.maven.archiva.database.constraints.OlderArtifactsByAgeConstraint; +import org.apache.maven.archiva.reporting.DataLimits; +import org.apache.maven.archiva.reporting.DynamicReportSource; + +import java.util.List; + +/** + * OldArtifactReport + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component role="org.apache.maven.archiva.reporting.DynamicReportSource" + * role-hint="old-artifacts" + */ +public class OldArtifactReport + implements DynamicReportSource +{ + /** + * @plexus.configuration default-value="Old Artifacts Report" + */ + private String name; + + /** + * @plexus.requirement role-hint="jdo" + */ + private ArchivaDAO dao; + + /** + * The maximum age of an artifact before it is reported old, specified in days. The default is 1 year. + * + * @plexus.configuration default-value="365" + */ + private int cutoffDays; + + public List getData() + throws ObjectNotFoundException, ArchivaDatabaseException + { + return dao.getArtifactDAO().queryArtifacts( new OlderArtifactsByAgeConstraint( cutoffDays ) ); + } + + public List getData( DataLimits limits ) + throws ObjectNotFoundException, ArchivaDatabaseException + { + return dao.getArtifactDAO().queryArtifacts( new OlderArtifactsByAgeConstraint( cutoffDays ) ); + } + + public String getName() + { + return name; + } +} diff --git a/MRM-541/archiva-modules/archiva-reporting/archiva-artifact-reports/src/main/java/org/apache/maven/archiva/reporting/artifact/OldSnapshotArtifactReport.java b/MRM-541/archiva-modules/archiva-reporting/archiva-artifact-reports/src/main/java/org/apache/maven/archiva/reporting/artifact/OldSnapshotArtifactReport.java new file mode 100644 index 000000000..a77bb9659 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-reporting/archiva-artifact-reports/src/main/java/org/apache/maven/archiva/reporting/artifact/OldSnapshotArtifactReport.java @@ -0,0 +1,76 @@ +package org.apache.maven.archiva.reporting.artifact; + +/* + * 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.archiva.database.ArchivaDAO; +import org.apache.maven.archiva.database.ArchivaDatabaseException; +import org.apache.maven.archiva.database.ObjectNotFoundException; +import org.apache.maven.archiva.database.constraints.OlderSnapshotArtifactsByAgeConstraint; +import org.apache.maven.archiva.reporting.DataLimits; +import org.apache.maven.archiva.reporting.DynamicReportSource; + +import java.util.List; + +/** + * OldSnapshotArtifactReport + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component role="org.apache.maven.archiva.reporting.DynamicReportSource" + * role-hint="old-snapshots" + */ +public class OldSnapshotArtifactReport + implements DynamicReportSource +{ + /** + * @plexus.configuration default-value="Old Snapshots Report" + */ + private String name; + + /** + * @plexus.requirement role-hint="jdo" + */ + private ArchivaDAO dao; + + /** + * The maximum age of a snapshot before it is reported old, specified in days. The default is 1 year. + * + * @plexus.configuration default-value="365" + */ + private int cutoffDays; + + public List getData() + throws ObjectNotFoundException, ArchivaDatabaseException + { + return dao.getArtifactDAO().queryArtifacts( new OlderSnapshotArtifactsByAgeConstraint( cutoffDays ) ); + } + + public List getData( DataLimits limits ) + throws ObjectNotFoundException, ArchivaDatabaseException + { + return dao.getArtifactDAO().queryArtifacts( new OlderSnapshotArtifactsByAgeConstraint( cutoffDays ) ); + } + + public String getName() + { + return name; + } +} diff --git a/MRM-541/archiva-modules/archiva-reporting/archiva-artifact-reports/src/test/java/org/apache/maven/archiva/reporting/artifact/AbstractArtifactReportsTestCase.java b/MRM-541/archiva-modules/archiva-reporting/archiva-artifact-reports/src/test/java/org/apache/maven/archiva/reporting/artifact/AbstractArtifactReportsTestCase.java new file mode 100644 index 000000000..577cdba68 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-reporting/archiva-artifact-reports/src/test/java/org/apache/maven/archiva/reporting/artifact/AbstractArtifactReportsTestCase.java @@ -0,0 +1,126 @@ +package org.apache.maven.archiva.reporting.artifact; + +/* + * 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.archiva.database.ArchivaDAO; +import org.codehaus.plexus.jdo.DefaultConfigurableJdoFactory; +import org.codehaus.plexus.jdo.JdoFactory; +import org.codehaus.plexus.spring.PlexusInSpringTestCase; +import org.jpox.SchemaTool; + +import java.io.File; +import java.net.URL; +import java.util.Iterator; +import java.util.Map; +import java.util.Properties; + +import javax.jdo.PersistenceManager; +import javax.jdo.PersistenceManagerFactory; + +/** + * AbstractArtifactReportsTestCase + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public abstract class AbstractArtifactReportsTestCase + extends PlexusInSpringTestCase +{ + protected ArchivaDAO dao; + + protected void setUp() + throws Exception + { + super.setUp(); + + DefaultConfigurableJdoFactory jdoFactory = (DefaultConfigurableJdoFactory) lookup( JdoFactory.ROLE, "archiva" ); + assertEquals( DefaultConfigurableJdoFactory.class.getName(), jdoFactory.getClass().getName() ); + + jdoFactory.setPersistenceManagerFactoryClass( "org.jpox.PersistenceManagerFactoryImpl" ); + + /* derby version + File derbyDbDir = new File( "target/plexus-home/testdb" ); + if ( derbyDbDir.exists() ) + { + FileUtils.deleteDirectory( derbyDbDir ); + } + + jdoFactory.setDriverName( System.getProperty( "jdo.test.driver", "org.apache.derby.jdbc.EmbeddedDriver" ) ); + jdoFactory.setUrl( System.getProperty( "jdo.test.url", "jdbc:derby:" + derbyDbDir.getAbsolutePath() + ";create=true" ) ); + */ + + jdoFactory.setDriverName( System.getProperty( "jdo.test.driver", "org.hsqldb.jdbcDriver" ) ); + jdoFactory.setUrl( System.getProperty( "jdo.test.url", "jdbc:hsqldb:mem:" + getName() ) ); + + jdoFactory.setUserName( System.getProperty( "jdo.test.user", "sa" ) ); + + jdoFactory.setPassword( System.getProperty( "jdo.test.pass", "" ) ); + + jdoFactory.setProperty( "org.jpox.transactionIsolation", "READ_COMMITTED" ); + + jdoFactory.setProperty( "org.jpox.poid.transactionIsolation", "READ_COMMITTED" ); + + jdoFactory.setProperty( "org.jpox.autoCreateSchema", "true" ); + + jdoFactory.setProperty( "javax.jdo.option.RetainValues", "true" ); + + jdoFactory.setProperty( "javax.jdo.option.RestoreValues", "true" ); + + // jdoFactory.setProperty( "org.jpox.autoCreateColumns", "true" ); + + jdoFactory.setProperty( "org.jpox.validateTables", "true" ); + + jdoFactory.setProperty( "org.jpox.validateColumns", "true" ); + + jdoFactory.setProperty( "org.jpox.validateConstraints", "true" ); + + Properties properties = jdoFactory.getProperties(); + + for ( Iterator it = properties.entrySet().iterator(); it.hasNext(); ) + { + Map.Entry entry = (Map.Entry) it.next(); + + System.setProperty( (String) entry.getKey(), (String) entry.getValue() ); + } + + URL jdoFileUrls[] = new URL[] { getClass().getResource( "/org/apache/maven/archiva/model/package.jdo" ) }; + + if ( ( jdoFileUrls == null ) || ( jdoFileUrls[0] == null ) ) + { + fail( "Unable to process test " + getName() + " - missing package.jdo." ); + } + + File propsFile = null; // intentional + boolean verbose = true; + + SchemaTool.deleteSchemaTables( jdoFileUrls, new URL[] {}, propsFile, verbose ); + SchemaTool.createSchemaTables( jdoFileUrls, new URL[] {}, propsFile, verbose, null ); + + PersistenceManagerFactory pmf = jdoFactory.getPersistenceManagerFactory(); + + assertNotNull( pmf ); + + PersistenceManager pm = pmf.getPersistenceManager(); + + pm.close(); + + this.dao = (ArchivaDAO) lookup( ArchivaDAO.class.getName(), "jdo" ); + } +} diff --git a/MRM-541/archiva-modules/archiva-reporting/archiva-artifact-reports/src/test/java/org/apache/maven/archiva/reporting/artifact/DuplicateArtifactReportTest.java b/MRM-541/archiva-modules/archiva-reporting/archiva-artifact-reports/src/test/java/org/apache/maven/archiva/reporting/artifact/DuplicateArtifactReportTest.java new file mode 100644 index 000000000..4d0f244c2 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-reporting/archiva-artifact-reports/src/test/java/org/apache/maven/archiva/reporting/artifact/DuplicateArtifactReportTest.java @@ -0,0 +1,166 @@ +package org.apache.maven.archiva.reporting.artifact; + +/* + * 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.io.FileUtils; +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.consumers.ArchivaArtifactConsumer; +import org.apache.maven.archiva.database.ArtifactDAO; +import org.apache.maven.archiva.model.ArchivaArtifact; +import org.apache.maven.archiva.model.RepositoryProblem; +import org.apache.maven.archiva.reporting.DynamicReportSource; + +import java.io.File; +import java.util.Date; +import java.util.Iterator; +import java.util.List; + +/** + * DuplicateArtifactReportTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class DuplicateArtifactReportTest + extends AbstractArtifactReportsTestCase +{ + private static final String TESTABLE_REPO = "testable"; + + private static final String HASH3 = "f3f653289f3217c65324830ab3415bc92feddefa"; + + private static final String HASH2 = "a49810ad3eba8651677ab57cd40a0f76fdef9538"; + + private static final String HASH1 = "232f01b24b1617c46a3d4b0ab3415bc9237dcdec"; + + private ArtifactDAO artifactDao; + + protected void setUp() + throws Exception + { + super.setUp(); + + artifactDao = dao.getArtifactDAO(); + + ArchivaConfiguration config = (ArchivaConfiguration) lookup( ArchivaConfiguration.class.getName(), "default" ); + + ManagedRepositoryConfiguration repoConfig = new ManagedRepositoryConfiguration(); + repoConfig.setId( TESTABLE_REPO ); + repoConfig.setLayout( "default" ); + File testRepoDir = new File( getBasedir(), "target/test-repository" ); + FileUtils.forceMkdir( testRepoDir ); + repoConfig.setLocation( testRepoDir.getAbsolutePath() ); + config.getConfiguration().addManagedRepository( repoConfig ); + } + + public ArchivaArtifact createArtifact( String artifactId, String version ) + { + ArchivaArtifact artifact = + artifactDao.createArtifact( "org.apache.maven.archiva.test", artifactId, version, "", "jar" ); + artifact.getModel().setLastModified( new Date() ); + artifact.getModel().setRepositoryId( TESTABLE_REPO ); + return artifact; + } + + public void testSimpleReport() + throws Exception + { + ArchivaArtifact artifact; + + // Setup artifacts in fresh DB. + artifact = createArtifact( "test-one", "1.0" ); + artifact.getModel().setChecksumSHA1( HASH1 ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "test-one", "1.1" ); + artifact.getModel().setChecksumSHA1( HASH1 ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "test-one", "1.2" ); + artifact.getModel().setChecksumSHA1( HASH1 ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "test-two", "1.0" ); + artifact.getModel().setChecksumSHA1( HASH1 ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "test-two", "2.0" ); + artifact.getModel().setChecksumSHA1( HASH3 ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "test-two", "2.1" ); + artifact.getModel().setChecksumSHA1( HASH2 ); + artifactDao.saveArtifact( artifact ); + + artifact = createArtifact( "test-two", "3.0" ); + artifact.getModel().setChecksumSHA1( HASH2 ); + artifactDao.saveArtifact( artifact ); + + // Setup entries for bad/duplicate in problem DB. + pretendToRunDuplicateArtifactsConsumer(); + + List allArtifacts = artifactDao.queryArtifacts( null ); + assertEquals( "Total Artifact Count", 7, allArtifacts.size() ); + + DuplicateArtifactReport report = + (DuplicateArtifactReport) lookup( DynamicReportSource.class.getName(), "duplicate-artifacts" ); + + List results = report.getData(); + + System.out.println( "Results.size: " + results.size() ); + int i = 0; + Iterator it = results.iterator(); + while ( it.hasNext() ) + { + RepositoryProblem problem = (RepositoryProblem) it.next(); + System.out.println( "[" + ( i++ ) + "] " + problem.getMessage() ); + } + + int hash1Count = 4; + int hash2Count = 2; + int hash3Count = 1; + + int totals = ( ( hash1Count * hash1Count ) - hash1Count ) + ( ( hash2Count * hash2Count ) - hash2Count ) + + ( ( hash3Count * hash3Count ) - hash3Count ); + assertEquals( "Total report hits.", totals, results.size() ); + } + + private void pretendToRunDuplicateArtifactsConsumer() + throws Exception + { + List artifacts = dao.getArtifactDAO().queryArtifacts( null ); + ArchivaArtifactConsumer consumer = + (ArchivaArtifactConsumer) lookup( ArchivaArtifactConsumer.class.getName(), "duplicate-artifacts" ); + consumer.beginScan(); + try + { + Iterator it = artifacts.iterator(); + while ( it.hasNext() ) + { + ArchivaArtifact artifact = (ArchivaArtifact) it.next(); + consumer.processArchivaArtifact( artifact ); + } + } + finally + { + consumer.completeScan(); + } + } +} diff --git a/MRM-541/archiva-modules/archiva-reporting/archiva-artifact-reports/src/test/resources/META-INF/plexus/components.xml b/MRM-541/archiva-modules/archiva-reporting/archiva-artifact-reports/src/test/resources/META-INF/plexus/components.xml new file mode 100644 index 000000000..a780793c7 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-reporting/archiva-artifact-reports/src/test/resources/META-INF/plexus/components.xml @@ -0,0 +1,70 @@ + + + + org.codehaus.plexus.jdo.JdoFactory + archiva + org.codehaus.plexus.jdo.DefaultConfigurableJdoFactory + + org.jpox.PersistenceManagerFactoryImpl + + + javax.jdo.PersistenceManagerFactoryClass + org.jpox.PersistenceManagerFactoryImpl + + + + + + + org.codehaus.plexus.registry.Registry + org.codehaus.plexus.registry.commons.CommonsConfigurationRegistry + commons-configuration + + + + + + + + + + + + + + plexus + + + plexus + Plexus Lifecycle Handler + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MRM-541/archiva-modules/archiva-reporting/archiva-artifact-reports/src/test/resources/log4j.xml b/MRM-541/archiva-modules/archiva-reporting/archiva-artifact-reports/src/test/resources/log4j.xml new file mode 100644 index 000000000..395941ac3 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-reporting/archiva-artifact-reports/src/test/resources/log4j.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MRM-541/archiva-modules/archiva-reporting/archiva-metadata-reports/pom.xml b/MRM-541/archiva-modules/archiva-reporting/archiva-metadata-reports/pom.xml new file mode 100755 index 000000000..6d50ef3ee --- /dev/null +++ b/MRM-541/archiva-modules/archiva-reporting/archiva-metadata-reports/pom.xml @@ -0,0 +1,58 @@ + + + + + + org.apache.archiva + archiva-reporting + 1.2-SNAPSHOT + + 4.0.0 + archiva-metadata-reports + Archiva Reporting :: Metadata Reports + + + org.apache.archiva + archiva-report-manager + + + org.apache.archiva + archiva-database + + + org.apache.archiva + archiva-repository-layer + + + org.codehaus.plexus + plexus-utils + + + commons-lang + commons-lang + + + commons-io + commons-io + + + + + diff --git a/MRM-541/archiva-modules/archiva-reporting/archiva-metadata-reports/src/main/java/org/apache/maven/archiva/reporting/metadata/MetadataReport.java b/MRM-541/archiva-modules/archiva-reporting/archiva-metadata-reports/src/main/java/org/apache/maven/archiva/reporting/metadata/MetadataReport.java new file mode 100644 index 000000000..2ca17dbe2 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-reporting/archiva-metadata-reports/src/main/java/org/apache/maven/archiva/reporting/metadata/MetadataReport.java @@ -0,0 +1,81 @@ +package org.apache.maven.archiva.reporting.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.archiva.database.ArchivaDAO; +import org.apache.maven.archiva.database.ArchivaDatabaseException; +import org.apache.maven.archiva.database.Constraint; +import org.apache.maven.archiva.database.ObjectNotFoundException; +import org.apache.maven.archiva.database.constraints.RepositoryProblemByTypeConstraint; +import org.apache.maven.archiva.reporting.DataLimits; +import org.apache.maven.archiva.reporting.DynamicReportSource; + +import java.util.List; + +/** + * MetadataReport + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component role="org.apache.maven.archiva.reporting.DynamicReportSource" + * role-hint="metadata" + */ +public class MetadataReport + implements DynamicReportSource +{ + public static final String PROBLEM_TYPE_METADATA = "metadata"; + + /** + * @plexus.configuration default-value="Metadata Report" + */ + private String name; + + /** + * @plexus.requirement role-hint="jdo" + */ + private ArchivaDAO dao; + + private Constraint constraint; + + public MetadataReport() + { + constraint = new RepositoryProblemByTypeConstraint( PROBLEM_TYPE_METADATA ); + } + + public List getData() + throws ObjectNotFoundException, ArchivaDatabaseException + { + return dao.getRepositoryProblemDAO().queryRepositoryProblems( constraint ); + } + + public List getData( DataLimits limits ) + throws ObjectNotFoundException, ArchivaDatabaseException + { + // TODO: implement limits. + return dao.getRepositoryProblemDAO().queryRepositoryProblems( constraint ); + } + + public String getName() + { + return name; + } + +} diff --git a/MRM-541/archiva-modules/archiva-reporting/archiva-metadata-reports/src/main/java/org/apache/maven/archiva/reporting/metadata/MetadataValidateConsumer.java b/MRM-541/archiva-modules/archiva-reporting/archiva-metadata-reports/src/main/java/org/apache/maven/archiva/reporting/metadata/MetadataValidateConsumer.java new file mode 100644 index 000000000..578e04603 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-reporting/archiva-metadata-reports/src/main/java/org/apache/maven/archiva/reporting/metadata/MetadataValidateConsumer.java @@ -0,0 +1,308 @@ +package org.apache.maven.archiva.reporting.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. + */ + + +/** + * MetadataValidateConsumer + * + * @author Joakim Erdfelt + * @version $Id$ + * + * TODO: whoops, how do we consumer metadata? + */ +public class MetadataValidateConsumer +{ + +// /** +// * Process the metadata encountered in the repository and report all errors found, if any. +// * +// * @param metadata the metadata to be processed. +// * @param repository the repository where the metadata was encountered +// * @param reporter the ReportingDatabase to receive processing results +// */ +// public void processMetadata( RepositoryMetadata metadata, ArtifactRepository repository ) +// { +// if ( metadata.storedInGroupDirectory() ) +// { +// try +// { +// checkPluginMetadata( metadata, repository ); +// } +// catch ( IOException e ) +// { +// addWarning( metadata, null, "Error getting plugin artifact directories versions: " + e ); +// } +// } +// else +// { +// Versioning versioning = metadata.getMetadata().getVersioning(); +// boolean found = false; +// if ( versioning != null ) +// { +// String lastUpdated = versioning.getLastUpdated(); +// if ( lastUpdated != null && lastUpdated.length() != 0 ) +// { +// found = true; +// } +// } +// if ( !found ) +// { +// addFailure( metadata, "missing-last-updated", "Missing lastUpdated element inside the metadata." ); +// } +// +// if ( metadata.storedInArtifactVersionDirectory() ) +// { +// checkSnapshotMetadata( metadata, repository ); +// } +// else +// { +// checkMetadataVersions( metadata, repository ); +// +// try +// { +// checkRepositoryVersions( metadata, repository ); +// } +// catch ( IOException e ) +// { +// String reason = "Error getting plugin artifact directories versions: " + e; +// addWarning( metadata, null, reason ); +// } +// } +// } +// } +// +// private void addWarning( RepositoryMetadata metadata, String problem, String reason ) +// { +// // TODO: reason could be an i18n key derived from the processor and the problem ID and the +// database.addWarning( metadata, ROLE_HINT, problem, reason ); +// } +// +// /** +// * Method for processing a GroupRepositoryMetadata +// * +// * @param metadata the metadata to be processed. +// * @param repository the repository where the metadata was encountered +// * @param reporter the ReportingDatabase to receive processing results +// */ +// private void checkPluginMetadata( RepositoryMetadata metadata, ArtifactRepository repository ) +// throws IOException +// { +// File metadataDir = new File( repository.getBasedir(), repository.pathOfRemoteRepositoryMetadata( metadata ) ) +// .getParentFile(); +// List pluginDirs = getArtifactIdFiles( metadataDir ); +// +// Map prefixes = new HashMap(); +// for ( Iterator plugins = metadata.getMetadata().getPlugins().iterator(); plugins.hasNext(); ) +// { +// Plugin plugin = (Plugin) plugins.next(); +// +// String artifactId = plugin.getArtifactId(); +// if ( artifactId == null || artifactId.length() == 0 ) +// { +// addFailure( metadata, "missing-artifact-id:" + plugin.getPrefix(), +// "Missing or empty artifactId in group metadata for plugin " + plugin.getPrefix() ); +// } +// +// String prefix = plugin.getPrefix(); +// if ( prefix == null || prefix.length() == 0 ) +// { +// addFailure( metadata, "missing-plugin-prefix:" + artifactId, +// "Missing or empty plugin prefix for artifactId " + artifactId + "." ); +// } +// else +// { +// if ( prefixes.containsKey( prefix ) ) +// { +// addFailure( metadata, "duplicate-plugin-prefix:" + prefix, "Duplicate plugin prefix found: " +// + prefix + "." ); +// } +// else +// { +// prefixes.put( prefix, plugin ); +// } +// } +// +// if ( artifactId != null && artifactId.length() > 0 ) +// { +// File pluginDir = new File( metadataDir, artifactId ); +// if ( !pluginDirs.contains( pluginDir ) ) +// { +// addFailure( metadata, "missing-plugin-from-repository:" + artifactId, "Metadata plugin " +// + artifactId + " not found in the repository" ); +// } +// else +// { +// pluginDirs.remove( pluginDir ); +// } +// } +// } +// +// if ( pluginDirs.size() > 0 ) +// { +// for ( Iterator plugins = pluginDirs.iterator(); plugins.hasNext(); ) +// { +// File plugin = (File) plugins.next(); +// addFailure( metadata, "missing-plugin-from-metadata:" + plugin.getName(), "Plugin " + plugin.getName() +// + " is present in the repository but " + "missing in the metadata." ); +// } +// } +// } +// +// /** +// * Method for processing a SnapshotArtifactRepository +// * +// * @param metadata the metadata to be processed. +// * @param repository the repository where the metadata was encountered +// * @param reporter the ReportingDatabase to receive processing results +// */ +// private void checkSnapshotMetadata( RepositoryMetadata metadata, ArtifactRepository repository ) +// { +// RepositoryQueryLayer repositoryQueryLayer = repositoryQueryLayerFactory.createRepositoryQueryLayer( repository ); +// +// Versioning versioning = metadata.getMetadata().getVersioning(); +// if ( versioning != null ) +// { +// Snapshot snapshot = versioning.getSnapshot(); +// +// String version = StringUtils.replace( metadata.getBaseVersion(), Artifact.SNAPSHOT_VERSION, snapshot +// .getTimestamp() +// + "-" + snapshot.getBuildNumber() ); +// Artifact artifact = artifactFactory.createProjectArtifact( metadata.getGroupId(), metadata.getArtifactId(), +// version ); +// artifact.isSnapshot(); // trigger baseVersion correction +// +// if ( !repositoryQueryLayer.containsArtifact( artifact ) ) +// { +// addFailure( metadata, "missing-snapshot-artifact-from-repository:" + version, "Snapshot artifact " +// + version + " does not exist." ); +// } +// } +// } +// +// /** +// * Method for validating the versions declared inside an ArtifactRepositoryMetadata +// * +// * @param metadata the metadata to be processed. +// * @param repository the repository where the metadata was encountered +// * @param reporter the ReportingDatabase to receive processing results +// */ +// private void checkMetadataVersions( RepositoryMetadata metadata, ArtifactRepository repository ) +// { +// RepositoryQueryLayer repositoryQueryLayer = repositoryQueryLayerFactory.createRepositoryQueryLayer( repository ); +// +// Versioning versioning = metadata.getMetadata().getVersioning(); +// if ( versioning != null ) +// { +// for ( Iterator versions = versioning.getVersions().iterator(); versions.hasNext(); ) +// { +// String version = (String) versions.next(); +// +// Artifact artifact = artifactFactory.createProjectArtifact( metadata.getGroupId(), metadata +// .getArtifactId(), version ); +// +// if ( !repositoryQueryLayer.containsArtifact( artifact ) ) +// { +// addFailure( metadata, "missing-artifact-from-repository:" + version, "Artifact version " + version +// + " is present in metadata but " + "missing in the repository." ); +// } +// } +// } +// } +// +// /** +// * Searches the artifact repository directory for all versions and verifies that all of them are listed in the +// * ArtifactRepositoryMetadata +// * +// * @param metadata the metadata to be processed. +// * @param repository the repository where the metadata was encountered +// * @param reporter the ReportingDatabase to receive processing results +// * @throws java.io.IOException if there is a problem reading from the file system +// */ +// private void checkRepositoryVersions( RepositoryMetadata metadata, ArtifactRepository repository ) +// throws IOException +// { +// Versioning versioning = metadata.getMetadata().getVersioning(); +// List metadataVersions = versioning != null ? versioning.getVersions() : Collections.EMPTY_LIST; +// File versionsDir = new File( repository.getBasedir(), repository.pathOfRemoteRepositoryMetadata( metadata ) ) +// .getParentFile(); +// +// // TODO: I don't know how this condition can happen, but it was seen on the main repository. +// // Avoid hard failure +// if ( versionsDir.exists() ) +// { +// List versions = FileUtils.getFileNames( versionsDir, "*/*.pom", null, false ); +// for ( Iterator i = versions.iterator(); i.hasNext(); ) +// { +// File path = new File( (String) i.next() ); +// String version = path.getParentFile().getName(); +// if ( !metadataVersions.contains( version ) ) +// { +// addFailure( metadata, "missing-artifact-from-metadata:" + version, "Artifact version " + version +// + " found in the repository but " + "missing in the metadata." ); +// } +// } +// } +// else +// { +// addFailure( metadata, null, "Metadata's directory did not exist: " + versionsDir ); +// } +// } +// +// /** +// * Used to gather artifactIds from a groupId directory. +// * +// * @param groupIdDir the directory of the group +// * @return the list of artifact ID File objects for each directory +// * @throws IOException if there was a failure to read the directories +// */ +// private List getArtifactIdFiles( File groupIdDir ) +// throws IOException +// { +// List artifactIdFiles = new ArrayList(); +// +// File[] files = groupIdDir.listFiles(); +// if ( files != null ) +// { +// for ( Iterator i = Arrays.asList( files ).iterator(); i.hasNext(); ) +// { +// File artifactDir = (File) i.next(); +// +// if ( artifactDir.isDirectory() ) +// { +// List versions = FileUtils.getFileNames( artifactDir, "*/*.pom", null, false ); +// if ( versions.size() > 0 ) +// { +// artifactIdFiles.add( artifactDir ); +// } +// } +// } +// } +// +// return artifactIdFiles; +// } +// +// private void addFailure( RepositoryMetadata metadata, String problem, String reason ) +// { +// // TODO: reason could be an i18n key derived from the processor and the problem ID and the +// database.addFailure( metadata, ROLE_HINT, problem, reason ); +// } + +} diff --git a/MRM-541/archiva-modules/archiva-reporting/archiva-project-reports/pom.xml b/MRM-541/archiva-modules/archiva-reporting/archiva-project-reports/pom.xml new file mode 100755 index 000000000..b8be1ec34 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-reporting/archiva-project-reports/pom.xml @@ -0,0 +1,58 @@ + + + + + + org.apache.archiva + archiva-reporting + 1.2-SNAPSHOT + + 4.0.0 + archiva-project-reports + Archiva Reporting :: Project Reports + + + org.apache.archiva + archiva-report-manager + + + org.apache.archiva + archiva-database + + + org.apache.archiva + archiva-repository-layer + + + org.codehaus.plexus + plexus-utils + + + commons-lang + commons-lang + + + commons-io + commons-io + + + + + diff --git a/MRM-541/archiva-modules/archiva-reporting/archiva-project-reports/src/main/java/org/apache/maven/archiva/reporting/project/MissingDependenciesReport.java b/MRM-541/archiva-modules/archiva-reporting/archiva-project-reports/src/main/java/org/apache/maven/archiva/reporting/project/MissingDependenciesReport.java new file mode 100644 index 000000000..dfc15c71c --- /dev/null +++ b/MRM-541/archiva-modules/archiva-reporting/archiva-project-reports/src/main/java/org/apache/maven/archiva/reporting/project/MissingDependenciesReport.java @@ -0,0 +1,80 @@ +package org.apache.maven.archiva.reporting.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. + */ + +import org.apache.maven.archiva.database.ArchivaDAO; +import org.apache.maven.archiva.database.ArchivaDatabaseException; +import org.apache.maven.archiva.database.Constraint; +import org.apache.maven.archiva.database.ObjectNotFoundException; +import org.apache.maven.archiva.database.constraints.RepositoryProblemByTypeConstraint; +import org.apache.maven.archiva.reporting.DataLimits; +import org.apache.maven.archiva.reporting.DynamicReportSource; + +import java.util.List; + +/** + * MissingDependenciesReport + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component role="org.apache.maven.archiva.reporting.DynamicReportSource" + * role-hint="missing-dependencies" + */ +public class MissingDependenciesReport + implements DynamicReportSource +{ + public static final String PROBLEM_TYPE_MISSING_DEPENDENCY = "missing-dependency"; + + /** + * @plexus.configuration default-value="Missing Dependencies Report" + */ + private String name; + + /** + * @plexus.requirement role-hint="jdo" + */ + private ArchivaDAO dao; + + private Constraint constraint; + + public MissingDependenciesReport() + { + constraint = new RepositoryProblemByTypeConstraint( PROBLEM_TYPE_MISSING_DEPENDENCY ); + } + + public List getData() + throws ObjectNotFoundException, ArchivaDatabaseException + { + return dao.getRepositoryProblemDAO().queryRepositoryProblems( constraint ); + } + + public List getData( DataLimits limits ) + throws ObjectNotFoundException, ArchivaDatabaseException + { + // TODO: implement limits. + return dao.getRepositoryProblemDAO().queryRepositoryProblems( constraint ); + } + + public String getName() + { + return name; + } +} diff --git a/MRM-541/archiva-modules/archiva-reporting/archiva-project-reports/src/main/java/org/apache/maven/archiva/reporting/project/ProjectDependenciesConsumer.java b/MRM-541/archiva-modules/archiva-reporting/archiva-project-reports/src/main/java/org/apache/maven/archiva/reporting/project/ProjectDependenciesConsumer.java new file mode 100644 index 000000000..ff7d68ff0 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-reporting/archiva-project-reports/src/main/java/org/apache/maven/archiva/reporting/project/ProjectDependenciesConsumer.java @@ -0,0 +1,101 @@ +package org.apache.maven.archiva.reporting.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. + */ + +import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer; +import org.apache.maven.archiva.consumers.ArchivaArtifactConsumer; +import org.apache.maven.archiva.consumers.ConsumerException; +import org.apache.maven.archiva.model.ArchivaArtifact; + +import java.util.ArrayList; +import java.util.List; + +/** + * ProjectDependenciesConsumer + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component role="org.apache.maven.archiva.consumers.ArchivaArtifactConsumer" + * role-hint="missing-dependencies" + */ +public class ProjectDependenciesConsumer + extends AbstractMonitoredConsumer + implements ArchivaArtifactConsumer +{ + /** + * @plexus.configuration default-value="missing-dependencies" + */ + private String id; + + /** + * @plexus.configuration default-value="Check for missing dependencies." + */ + private String description; + + private List includes; + + public ProjectDependenciesConsumer() + { + this.includes = new ArrayList(); + this.includes.add( "pom" ); + } + + public String getId() + { + return id; + } + + public String getDescription() + { + return description; + } + + public boolean isPermanent() + { + return false; + } + + public void beginScan() + { + /* do nothing */ + } + + public void completeScan() + { + /* do nothing */ + } + + public List getIncludedTypes() + { + return includes; + } + + public void processArchivaArtifact( ArchivaArtifact artifact ) + throws ConsumerException + { + // TODO: consider loading this logic into the 'update-db-project' consumer. + + // TODO: Load the ArchivaProjectModel. + // TODO: Attach a monitor for missing parent poms to resolvers / filters. + // TODO: Attach a monitor for missing dependencies to resolvers / filters. + // TODO: Fully resolve the ArchivaProjectModel and listen on monitors. + } +} diff --git a/MRM-541/archiva-modules/archiva-reporting/archiva-report-manager/pom.xml b/MRM-541/archiva-modules/archiva-reporting/archiva-report-manager/pom.xml new file mode 100755 index 000000000..2220a81f1 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-reporting/archiva-report-manager/pom.xml @@ -0,0 +1,54 @@ + + + + + + org.apache.archiva + archiva-reporting + 1.2-SNAPSHOT + + 4.0.0 + archiva-report-manager + Archiva Reporting :: Report Manager + + + org.apache.archiva + archiva-database + + + org.apache.archiva + archiva-repository-layer + + + org.codehaus.plexus + plexus-utils + + + commons-lang + commons-lang + + + commons-io + commons-io + + + + + diff --git a/MRM-541/archiva-modules/archiva-reporting/archiva-report-manager/src/main/java/org/apache/maven/archiva/reporting/DataLimits.java b/MRM-541/archiva-modules/archiva-reporting/archiva-report-manager/src/main/java/org/apache/maven/archiva/reporting/DataLimits.java new file mode 100644 index 000000000..3e2680a40 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-reporting/archiva-report-manager/src/main/java/org/apache/maven/archiva/reporting/DataLimits.java @@ -0,0 +1,77 @@ +package org.apache.maven.archiva.reporting; + +/* + * 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. + */ + +/** + * Limits on how much data should be returned by the report sources. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class DataLimits +{ + private int currentPage = 0; + + private int perPageCount = 25; + + private int countOfPages = 1; + + private int totalCount = 0; + + public int getCountOfPages() + { + return countOfPages; + } + + public void setCountOfPages( int countOfPages ) + { + this.countOfPages = countOfPages; + } + + public int getCurrentPage() + { + return currentPage; + } + + public void setCurrentPage( int currentPage ) + { + this.currentPage = currentPage; + } + + public int getPerPageCount() + { + return perPageCount; + } + + public void setPerPageCount( int perPageCount ) + { + this.perPageCount = perPageCount; + } + + public int getTotalCount() + { + return totalCount; + } + + public void setTotalCount( int totalCount ) + { + this.totalCount = totalCount; + } +} diff --git a/MRM-541/archiva-modules/archiva-reporting/archiva-report-manager/src/main/java/org/apache/maven/archiva/reporting/DefaultReportingManager.java b/MRM-541/archiva-modules/archiva-reporting/archiva-report-manager/src/main/java/org/apache/maven/archiva/reporting/DefaultReportingManager.java new file mode 100644 index 000000000..6cea0ab65 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-reporting/archiva-report-manager/src/main/java/org/apache/maven/archiva/reporting/DefaultReportingManager.java @@ -0,0 +1,50 @@ +package org.apache.maven.archiva.reporting; + +/* + * 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.Map; + +/** + * DefaultReportingManager + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component role="org.apache.maven.archiva.reporting.ReportingManager" + * role-hint="default" + */ +public class DefaultReportingManager + implements ReportingManager +{ + /** + * @plexus.requirement role="org.apache.maven.archiva.reporting.DynamicReportSource" + */ + private Map reportSourceMap; + + public DynamicReportSource getReport( String id ) + { + return (DynamicReportSource) reportSourceMap.get( id ); + } + + public Map getAvailableReports() + { + return reportSourceMap; + } +} diff --git a/MRM-541/archiva-modules/archiva-reporting/archiva-report-manager/src/main/java/org/apache/maven/archiva/reporting/DynamicReportSource.java b/MRM-541/archiva-modules/archiva-reporting/archiva-report-manager/src/main/java/org/apache/maven/archiva/reporting/DynamicReportSource.java new file mode 100644 index 000000000..1b1ad7b44 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-reporting/archiva-report-manager/src/main/java/org/apache/maven/archiva/reporting/DynamicReportSource.java @@ -0,0 +1,62 @@ +package org.apache.maven.archiva.reporting; + +/* + * 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.archiva.database.ArchivaDatabaseException; +import org.apache.maven.archiva.database.ObjectNotFoundException; + +import java.util.List; + +/** + * DynamicReportSource + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public interface DynamicReportSource +{ + /** + * The human readable name of this report. + * + * @return the name of the report. + */ + public String getName(); + + /** + * Get the entire list of values for this report. + * + * @return the complete List of objects for this report. + * @throws ArchivaDatabaseException if there was a fundamental issue with accessing the database. + * @throws ObjectNotFoundException if no records were found. + */ + public List getData() throws ObjectNotFoundException, ArchivaDatabaseException; + + /** + * Get the entire list of values for this report. + * + * @param limits the limits on the data to fetch. (NOTE: This object is + * updated by the underlying implementation of this interface with + * the current values appropriate for the limits object). + * @return the complete List of objects for this report. + * @throws ArchivaDatabaseException if there was a fundamental issue with accessing the database. + * @throws ObjectNotFoundException if no records were found. + */ + public List getData( DataLimits limits ) throws ObjectNotFoundException, ArchivaDatabaseException; +} diff --git a/MRM-541/archiva-modules/archiva-reporting/archiva-report-manager/src/main/java/org/apache/maven/archiva/reporting/ReportingException.java b/MRM-541/archiva-modules/archiva-reporting/archiva-report-manager/src/main/java/org/apache/maven/archiva/reporting/ReportingException.java new file mode 100644 index 000000000..db98c5590 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-reporting/archiva-report-manager/src/main/java/org/apache/maven/archiva/reporting/ReportingException.java @@ -0,0 +1,50 @@ +package org.apache.maven.archiva.reporting; + +/* + * 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. + */ + +/** + * ReportingException + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ReportingException + extends Exception +{ + + public ReportingException() + { + } + + public ReportingException( String message ) + { + super( message ); + } + + public ReportingException( Throwable cause ) + { + super( cause ); + } + + public ReportingException( String message, Throwable cause ) + { + super( message, cause ); + } +} diff --git a/MRM-541/archiva-modules/archiva-reporting/archiva-report-manager/src/main/java/org/apache/maven/archiva/reporting/ReportingManager.java b/MRM-541/archiva-modules/archiva-reporting/archiva-report-manager/src/main/java/org/apache/maven/archiva/reporting/ReportingManager.java new file mode 100644 index 000000000..f1fc03f5d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-reporting/archiva-report-manager/src/main/java/org/apache/maven/archiva/reporting/ReportingManager.java @@ -0,0 +1,35 @@ +package org.apache.maven.archiva.reporting; + +/* + * 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.Map; + +/** + * ReportingManager + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public interface ReportingManager +{ + public DynamicReportSource getReport( String id ); + + public Map /**/getAvailableReports(); +} diff --git a/MRM-541/archiva-modules/archiva-reporting/archiva-report-manager/src/main/java/org/apache/maven/archiva/reporting/RepositoryProblemMonitor.java b/MRM-541/archiva-modules/archiva-reporting/archiva-report-manager/src/main/java/org/apache/maven/archiva/reporting/RepositoryProblemMonitor.java new file mode 100644 index 000000000..801ee7970 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-reporting/archiva-report-manager/src/main/java/org/apache/maven/archiva/reporting/RepositoryProblemMonitor.java @@ -0,0 +1,33 @@ +package org.apache.maven.archiva.reporting; + +/* + * 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.archiva.model.RepositoryProblem; + +/** + * RepositoryProblemMonitor + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public interface RepositoryProblemMonitor +{ + public void reportProblem( RepositoryProblem problem ); +} diff --git a/MRM-541/archiva-modules/archiva-reporting/archiva-report-manager/src/test/resources/META-INF/plexus/components.xml b/MRM-541/archiva-modules/archiva-reporting/archiva-report-manager/src/test/resources/META-INF/plexus/components.xml new file mode 100644 index 000000000..6e2700539 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-reporting/archiva-report-manager/src/test/resources/META-INF/plexus/components.xml @@ -0,0 +1,9 @@ + + + + org.codehaus.plexus.jdo.JdoFactory + archiva + org.codehaus.plexus.jdo.DefaultConfigurableJdoFactory + + + diff --git a/MRM-541/archiva-modules/archiva-reporting/archiva-report-manager/src/test/resources/log4j.properties b/MRM-541/archiva-modules/archiva-reporting/archiva-report-manager/src/test/resources/log4j.properties new file mode 100644 index 000000000..9b2c26ade --- /dev/null +++ b/MRM-541/archiva-modules/archiva-reporting/archiva-report-manager/src/test/resources/log4j.properties @@ -0,0 +1,10 @@ +# Set root logger level to DEBUG and its only appender to A1. +log4j.rootLogger=WARN, A1 + +# A1 is set to be a ConsoleAppender. +log4j.appender.A1=org.apache.log4j.ConsoleAppender + +# A1 uses PatternLayout. +log4j.appender.A1.layout=org.apache.log4j.PatternLayout +log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n + diff --git a/MRM-541/archiva-modules/archiva-reporting/archiva-report-manager/src/test/resources/org/apache/maven/archiva/reporting/processor/DuplicateArtifactFileReportProcessorTest.xml b/MRM-541/archiva-modules/archiva-reporting/archiva-report-manager/src/test/resources/org/apache/maven/archiva/reporting/processor/DuplicateArtifactFileReportProcessorTest.xml new file mode 100644 index 000000000..5ae012392 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-reporting/archiva-report-manager/src/test/resources/org/apache/maven/archiva/reporting/processor/DuplicateArtifactFileReportProcessorTest.xml @@ -0,0 +1,47 @@ + + + + + + + org.apache.maven.archiva.reporting.processor.ArtifactReportProcessor + duplicate + org.apache.maven.archiva.reporting.processor.DuplicateArtifactFileReportProcessor + + + org.codehaus.plexus.digest.Digester + md5 + digester + + + org.apache.maven.archiva.indexer.RepositoryArtifactIndexFactory + indexFactory + + + org.apache.maven.archiva.reporting.database.ArtifactResultsDatabase + database + + + + ${basedir}/target/indexDirectory + + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-reporting/archiva-report-manager/src/test/resources/org/apache/maven/archiva/reporting/processor/OldArtifactReportProcessorTest.xml b/MRM-541/archiva-modules/archiva-reporting/archiva-report-manager/src/test/resources/org/apache/maven/archiva/reporting/processor/OldArtifactReportProcessorTest.xml new file mode 100644 index 000000000..016361e9b --- /dev/null +++ b/MRM-541/archiva-modules/archiva-reporting/archiva-report-manager/src/test/resources/org/apache/maven/archiva/reporting/processor/OldArtifactReportProcessorTest.xml @@ -0,0 +1,38 @@ + + + + + + + org.apache.maven.archiva.reporting.processor.ArtifactReportProcessor + old-artifact + org.apache.maven.archiva.reporting.processor.OldArtifactReportProcessor + + + org.apache.maven.archiva.reporting.database.ArtifactResultsDatabase + database + + + + 10 + + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-reporting/archiva-report-manager/src/test/resources/org/apache/maven/archiva/reporting/processor/OldSnapshotArtifactReportProcessorTest.xml b/MRM-541/archiva-modules/archiva-reporting/archiva-report-manager/src/test/resources/org/apache/maven/archiva/reporting/processor/OldSnapshotArtifactReportProcessorTest.xml new file mode 100644 index 000000000..779aa8c24 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-reporting/archiva-report-manager/src/test/resources/org/apache/maven/archiva/reporting/processor/OldSnapshotArtifactReportProcessorTest.xml @@ -0,0 +1,39 @@ + + + + + + + org.apache.maven.archiva.reporting.processor.ArtifactReportProcessor + old-snapshot-artifact + org.apache.maven.archiva.reporting.processor.OldSnapshotArtifactReportProcessor + + + org.apache.maven.archiva.reporting.database.ArtifactResultsDatabase + database + + + + 3600 + 2 + + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-reporting/pom.xml b/MRM-541/archiva-modules/archiva-reporting/pom.xml new file mode 100644 index 000000000..bb2193438 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-reporting/pom.xml @@ -0,0 +1,38 @@ + + + + + 4.0.0 + + org.apache.archiva + archiva-modules + 1.2-SNAPSHOT + ../pom.xml + + + archiva-reporting + Archiva Reporting + pom + + + archiva-report-manager + + archiva-artifact-reports + archiva-metadata-reports + archiva-project-reports + + diff --git a/MRM-541/archiva-modules/archiva-scheduled/pom.xml b/MRM-541/archiva-modules/archiva-scheduled/pom.xml new file mode 100644 index 000000000..f3c289882 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-scheduled/pom.xml @@ -0,0 +1,107 @@ + + + + + + org.apache.archiva + archiva-modules + 1.2-SNAPSHOT + + 4.0.0 + archiva-scheduled + Archiva Base :: Scheduled Tasks + + + org.apache.archiva + archiva-configuration + + + org.apache.archiva + archiva-database + + + org.apache.archiva + archiva-repository-layer + + + org.codehaus.plexus + plexus-taskqueue + + + org.codehaus.plexus + plexus-quartz + + + org.codehaus.plexus + plexus-spring + test + + + org.codehaus.plexus + plexus-component-api + + + commons-lang + commons-lang + + + org.codehaus.plexus.registry + plexus-registry-api + + + + org.apache.archiva + archiva-database-consumers + test + + + hsqldb + hsqldb + test + + + org.codehaus.plexus.registry + plexus-registry-commons + test + + + + + + org.codehaus.plexus + plexus-maven-plugin + + + merge + + merge-descriptors + + + + ${basedir}/src/main/resources/META-INF/plexus/components.xml + ${project.build.directory}/generated-resources/plexus/META-INF/plexus/components.xml + + + + + + + + diff --git a/MRM-541/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/ArchivaTaskScheduler.java b/MRM-541/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/ArchivaTaskScheduler.java new file mode 100644 index 000000000..70478a591 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/ArchivaTaskScheduler.java @@ -0,0 +1,60 @@ +package org.apache.maven.archiva.scheduled; + +/* + * 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.archiva.common.ArchivaException; +import org.apache.maven.archiva.scheduled.tasks.DatabaseTask; +import org.apache.maven.archiva.scheduled.tasks.RepositoryTask; +import org.codehaus.plexus.taskqueue.TaskQueueException; +import org.codehaus.plexus.taskqueue.execution.TaskExecutionException; + +/** + * The component that takes care of scheduling in the application. + * + * @author Brett Porter + */ +public interface ArchivaTaskScheduler +{ + /** + * The Plexus component role. + */ + public final static String ROLE = ArchivaTaskScheduler.class.getName(); + + public boolean isProcessingAnyRepositoryTask() + throws ArchivaException; + + public boolean isProcessingDatabaseTask() + throws ArchivaException; + + public boolean isProcessingRepositoryTask( String repositoryId ) + throws ArchivaException; + + public void queueDatabaseTask( DatabaseTask task ) + throws TaskQueueException; + + public void queueRepositoryTask( RepositoryTask task ) + throws TaskQueueException; + + public void scheduleDatabaseTasks() + throws TaskExecutionException; + + public void startup() + throws ArchivaException; +} diff --git a/MRM-541/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/DatabaseTaskJob.java b/MRM-541/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/DatabaseTaskJob.java new file mode 100644 index 000000000..ede35a8f6 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/DatabaseTaskJob.java @@ -0,0 +1,85 @@ +package org.apache.maven.archiva.scheduled; + +/* + * 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.archiva.scheduled.tasks.ArchivaTask; +import org.apache.maven.archiva.scheduled.tasks.DatabaseTask; +import org.codehaus.plexus.scheduler.AbstractJob; +import org.codehaus.plexus.taskqueue.TaskQueue; +import org.codehaus.plexus.taskqueue.TaskQueueException; +import org.quartz.JobDataMap; +import org.quartz.JobExecutionContext; +import org.quartz.JobExecutionException; + +/** + * This class is the database job that is executed by the scheduler. + */ +public class DatabaseTaskJob + extends AbstractJob +{ + static final String TASK_KEY = "EXECUTION"; + + static final String TASK_QUEUE = "TASK_QUEUE"; + + static final String TASK_QUEUE_POLICY = "TASK_QUEUE_POLICY"; + + /** + * Execute the discoverer and the indexer. + * + * @param context + * @throws org.quartz.JobExecutionException + * + */ + public void execute( JobExecutionContext context ) + throws JobExecutionException + { + JobDataMap dataMap = context.getJobDetail().getJobDataMap(); + setJobDataMap( dataMap ); + + TaskQueue taskQueue = (TaskQueue) dataMap.get( TASK_QUEUE ); + String queuePolicy = (String) dataMap.get( TASK_QUEUE_POLICY ); + + ArchivaTask task = new DatabaseTask(); + task.setName( context.getJobDetail().getName() ); + + try + { + if ( taskQueue.getQueueSnapshot().size() == 0 ) + { + taskQueue.put( task ); + } + else + { + if ( ArchivaTask.QUEUE_POLICY_WAIT.equals( queuePolicy ) ) + { + taskQueue.put( task ); + } + else if ( ArchivaTask.QUEUE_POLICY_SKIP.equals( queuePolicy ) ) + { + // do not queue anymore, policy is to skip + } + } + } + catch ( TaskQueueException e ) + { + throw new JobExecutionException( e ); + } + } +} diff --git a/MRM-541/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/DefaultArchivaTaskScheduler.java b/MRM-541/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/DefaultArchivaTaskScheduler.java new file mode 100644 index 000000000..6af0ce2dc --- /dev/null +++ b/MRM-541/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/DefaultArchivaTaskScheduler.java @@ -0,0 +1,428 @@ +package org.apache.maven.archiva.scheduled; + +/* + * 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.collections.CollectionUtils; +import org.apache.maven.archiva.common.ArchivaException; +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.ConfigurationEvent; +import org.apache.maven.archiva.configuration.ConfigurationListener; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.database.ArchivaDAO; +import org.apache.maven.archiva.database.constraints.MostRecentRepositoryScanStatistics; +import org.apache.maven.archiva.repository.scanner.RepositoryScanStatistics; +import org.apache.maven.archiva.scheduled.tasks.ArchivaTask; +import org.apache.maven.archiva.scheduled.tasks.DatabaseTask; +import org.apache.maven.archiva.scheduled.tasks.RepositoryTask; +import org.apache.maven.archiva.scheduled.tasks.RepositoryTaskSelectionPredicate; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.Startable; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.StartingException; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.StoppingException; +import org.codehaus.plexus.scheduler.CronExpressionValidator; +import org.codehaus.plexus.scheduler.Scheduler; +import org.codehaus.plexus.taskqueue.Task; +import org.codehaus.plexus.taskqueue.TaskQueue; +import org.codehaus.plexus.taskqueue.TaskQueueException; +import org.codehaus.plexus.taskqueue.execution.TaskExecutionException; +import org.quartz.CronTrigger; +import org.quartz.JobDataMap; +import org.quartz.JobDetail; +import org.quartz.SchedulerException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.text.ParseException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +/** + * Default implementation of a scheduling component for archiva. + * + * @author Brett Porter + * @author Jesse McConnell + * @plexus.component role="org.apache.maven.archiva.scheduled.ArchivaTaskScheduler" role-hint="default" + */ +public class DefaultArchivaTaskScheduler + implements ArchivaTaskScheduler, Startable, ConfigurationListener +{ + private Logger log = LoggerFactory.getLogger( DefaultArchivaTaskScheduler.class ); + + /** + * @plexus.requirement + */ + private Scheduler scheduler; + + /** + * @plexus.requirement role-hint="database-update" + */ + private TaskQueue databaseUpdateQueue; + + /** + * @plexus.requirement role-hint="repository-scanning" + */ + private TaskQueue repositoryScanningQueue; + + /** + * @plexus.requirement + */ + private ArchivaConfiguration archivaConfiguration; + + /** + * @plexus.requirement role-hint="jdo" + */ + private ArchivaDAO dao; + + public static final String DATABASE_SCAN_GROUP = "database-group"; + + public static final String DATABASE_JOB = "database-job"; + + public static final String DATABASE_JOB_TRIGGER = "database-job-trigger"; + + public static final String REPOSITORY_SCAN_GROUP = "repository-group"; + + public static final String REPOSITORY_JOB = "repository-job"; + + public static final String REPOSITORY_JOB_TRIGGER = "repository-job-trigger"; + + public static final String CRON_HOURLY = "0 0 * * * ?"; + + private Set jobs = new HashSet(); + + private List queuedRepos = new ArrayList(); + + public void startup() + throws ArchivaException + { + archivaConfiguration.addListener( this ); + + try + { + start(); + } + catch ( StartingException e ) + { + throw new ArchivaException( e.getMessage(), e ); + } + } + + public void start() + throws StartingException + { + try + { + List repositories = archivaConfiguration.getConfiguration() + .getManagedRepositories(); + + for ( ManagedRepositoryConfiguration repoConfig : repositories ) + { + if ( repoConfig.isScanned() ) + { + scheduleRepositoryJobs( repoConfig ); + + if( !isPreviouslyScanned( repoConfig ) ) + { + queueInitialRepoScan( repoConfig ); + } + } + } + + scheduleDatabaseJobs(); + } + catch ( SchedulerException e ) + { + throw new StartingException( "Unable to start scheduler: " + e.getMessage(), e ); + } + } + + private boolean isPreviouslyScanned( ManagedRepositoryConfiguration repoConfig ) + { + List results = + dao.query( new MostRecentRepositoryScanStatistics( repoConfig.getId() ) ); + + if ( results != null && !results.isEmpty() ) + { + return true; + } + + return false; + } + + // MRM-848: Pre-configured repository initially appear to be empty + private synchronized void queueInitialRepoScan( ManagedRepositoryConfiguration repoConfig ) + { + String repoId = repoConfig.getId(); + + RepositoryTask task = new RepositoryTask(); + task.setRepositoryId( repoId ); + task.setName( REPOSITORY_JOB + ":" + repoId + ":initial-scan" ); + task.setQueuePolicy( ArchivaTask.QUEUE_POLICY_WAIT ); + + boolean scheduleTask = false; + + if ( queuedRepos.contains( repoId ) ) + { + log.error( "Repository [" + repoId + "] is currently being processed or is already queued." ); + } + else + { + scheduleTask = true; + } + + if ( scheduleTask ) + { + try + { + queuedRepos.add( repoConfig.getId() ); + this.queueRepositoryTask( task ); + } + catch ( TaskQueueException e ) + { + log.error( "Error occurred while queueing repository [" + repoId + "] task : " + e.getMessage() ); + } + } + } + + private synchronized void scheduleRepositoryJobs( ManagedRepositoryConfiguration repoConfig ) + throws SchedulerException + { + if ( repoConfig.getRefreshCronExpression() == null ) + { + log.warn( "Skipping job, no cron expression for " + repoConfig.getId() ); + return; + } + + // get the cron string for these database scanning jobs + String cronString = repoConfig.getRefreshCronExpression(); + + CronExpressionValidator cronValidator = new CronExpressionValidator(); + if ( !cronValidator.validate( cronString ) ) + { + log.warn( "Cron expression [" + cronString + "] for repository [" + repoConfig.getId() + + "] is invalid. Defaulting to hourly." ); + cronString = CRON_HOURLY; + } + + // setup the unprocessed artifact job + JobDetail repositoryJob = + new JobDetail( REPOSITORY_JOB + ":" + repoConfig.getId(), REPOSITORY_SCAN_GROUP, RepositoryTaskJob.class ); + + JobDataMap dataMap = new JobDataMap(); + dataMap.put( RepositoryTaskJob.TASK_QUEUE, repositoryScanningQueue ); + dataMap.put( RepositoryTaskJob.TASK_QUEUE_POLICY, ArchivaTask.QUEUE_POLICY_WAIT ); + dataMap.put( RepositoryTaskJob.TASK_REPOSITORY, repoConfig.getId() ); + repositoryJob.setJobDataMap( dataMap ); + + try + { + CronTrigger trigger = + new CronTrigger( REPOSITORY_JOB_TRIGGER + ":" + repoConfig.getId(), REPOSITORY_SCAN_GROUP, cronString ); + + jobs.add( REPOSITORY_JOB + ":" + repoConfig.getId() ); + scheduler.scheduleJob( repositoryJob, trigger ); + } + catch ( ParseException e ) + { + log.error( + "ParseException in repository scanning cron expression, disabling repository scanning for '" + + repoConfig.getId() + "': " + e.getMessage() ); + } + + } + + private synchronized void scheduleDatabaseJobs() + throws SchedulerException + { + String cronString = archivaConfiguration.getConfiguration().getDatabaseScanning().getCronExpression(); + + // setup the unprocessed artifact job + JobDetail databaseJob = new JobDetail( DATABASE_JOB, DATABASE_SCAN_GROUP, DatabaseTaskJob.class ); + + JobDataMap dataMap = new JobDataMap(); + dataMap.put( DatabaseTaskJob.TASK_QUEUE, databaseUpdateQueue ); + databaseJob.setJobDataMap( dataMap ); + + CronExpressionValidator cronValidator = new CronExpressionValidator(); + if ( !cronValidator.validate( cronString ) ) + { + log.warn( + "Cron expression [" + cronString + "] for database update is invalid. Defaulting to hourly." ); + cronString = CRON_HOURLY; + } + + try + { + CronTrigger trigger = new CronTrigger( DATABASE_JOB_TRIGGER, DATABASE_SCAN_GROUP, cronString ); + + scheduler.scheduleJob( databaseJob, trigger ); + } + catch ( ParseException e ) + { + log.error( + "ParseException in database scanning cron expression, disabling database scanning: " + e.getMessage() ); + } + + } + + public void stop() + throws StoppingException + { + try + { + scheduler.unscheduleJob( DATABASE_JOB, DATABASE_SCAN_GROUP ); + + for ( String job : jobs ) + { + scheduler.unscheduleJob( job, REPOSITORY_SCAN_GROUP ); + } + jobs.clear(); + queuedRepos.clear(); + } + catch ( SchedulerException e ) + { + throw new StoppingException( "Unable to unschedule tasks", e ); + } + } + + public void scheduleDatabaseTasks() + throws TaskExecutionException + { + try + { + scheduleDatabaseJobs(); + } + catch ( SchedulerException e ) + { + throw new TaskExecutionException( "Unable to schedule repository jobs: " + e.getMessage(), e ); + + } + } + + public boolean isProcessingAnyRepositoryTask() + throws ArchivaException + { + List queue = null; + + try + { + queue = repositoryScanningQueue.getQueueSnapshot(); + } + catch ( TaskQueueException e ) + { + throw new ArchivaException( "Unable to get repository scanning queue:" + e.getMessage(), e ); + } + + return !queue.isEmpty(); + } + + public boolean isProcessingRepositoryTask( String repositoryId ) + throws ArchivaException + { + List queue = null; + + try + { + queue = repositoryScanningQueue.getQueueSnapshot(); + } + catch ( TaskQueueException e ) + { + throw new ArchivaException( "Unable to get repository scanning queue:" + e.getMessage(), e ); + } + + return CollectionUtils.exists( queue, new RepositoryTaskSelectionPredicate( repositoryId ) ); + } + + public boolean isProcessingDatabaseTask() + throws ArchivaException + { + List queue = null; + + try + { + queue = databaseUpdateQueue.getQueueSnapshot(); + } + catch ( TaskQueueException e ) + { + throw new ArchivaException( "Unable to get database update queue:" + e.getMessage(), e ); + } + + return !queue.isEmpty(); + } + + public void queueRepositoryTask( RepositoryTask task ) + throws TaskQueueException + { + repositoryScanningQueue.put( task ); + } + + public void queueDatabaseTask( DatabaseTask task ) + throws TaskQueueException + { + databaseUpdateQueue.put( task ); + } + + public void configurationEvent( ConfigurationEvent event ) + { + if ( event.getType() == ConfigurationEvent.SAVED ) + { + try + { + scheduler.unscheduleJob( DATABASE_JOB, DATABASE_SCAN_GROUP ); + + scheduleDatabaseJobs(); + } + catch ( SchedulerException e ) + { + log.error( "Error restarting the database scanning job after property change." ); + } + + for ( String job : jobs ) + { + try + { + scheduler.unscheduleJob( job, REPOSITORY_SCAN_GROUP ); + } + catch ( SchedulerException e ) + { + log.error( "Error restarting the repository scanning job after property change." ); + } + } + jobs.clear(); + + List repositories = archivaConfiguration.getConfiguration().getManagedRepositories(); + + for ( ManagedRepositoryConfiguration repoConfig : repositories ) + { + if ( repoConfig.getRefreshCronExpression() != null ) + { + try + { + scheduleRepositoryJobs( repoConfig ); + } + catch ( SchedulerException e ) + { + log.error( "error restarting job: " + REPOSITORY_JOB + ":" + repoConfig.getId() ); + } + } + } + } + } +} diff --git a/MRM-541/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/RepositoryTaskJob.java b/MRM-541/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/RepositoryTaskJob.java new file mode 100644 index 000000000..e71d084fa --- /dev/null +++ b/MRM-541/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/RepositoryTaskJob.java @@ -0,0 +1,88 @@ +package org.apache.maven.archiva.scheduled; + +/* + * 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.archiva.scheduled.tasks.ArchivaTask; +import org.apache.maven.archiva.scheduled.tasks.RepositoryTask; +import org.codehaus.plexus.scheduler.AbstractJob; +import org.codehaus.plexus.taskqueue.TaskQueue; +import org.codehaus.plexus.taskqueue.TaskQueueException; +import org.quartz.JobDataMap; +import org.quartz.JobExecutionContext; +import org.quartz.JobExecutionException; + +/** + * This class is the repository job that is executed by the scheduler. + */ +public class RepositoryTaskJob + extends AbstractJob +{ + static final String TASK_KEY = "EXECUTION"; + + static final String TASK_QUEUE = "TASK_QUEUE"; + + static final String TASK_QUEUE_POLICY = "TASK_QUEUE_POLICY"; + + static final String TASK_REPOSITORY = "TASK_REPOSITORY"; + + /** + * Execute the discoverer and the indexer. + * + * @param context + * @throws org.quartz.JobExecutionException + * + */ + public void execute( JobExecutionContext context ) + throws JobExecutionException + { + JobDataMap dataMap = context.getJobDetail().getJobDataMap(); + setJobDataMap( dataMap ); + + TaskQueue taskQueue = (TaskQueue) dataMap.get( TASK_QUEUE ); + String queuePolicy = dataMap.get( TASK_QUEUE_POLICY ).toString(); + + RepositoryTask task = new RepositoryTask(); + task.setName( context.getJobDetail().getName() ); + task.setRepositoryId( (String) dataMap.get( TASK_REPOSITORY ) ); + + try + { + if ( taskQueue.getQueueSnapshot().size() == 0 ) + { + taskQueue.put( task ); + } + else + { + if ( ArchivaTask.QUEUE_POLICY_WAIT.equals( queuePolicy ) ) + { + taskQueue.put( task ); + } + else if ( ArchivaTask.QUEUE_POLICY_SKIP.equals( queuePolicy ) ) + { + // do not queue anymore, policy is to skip + } + } + } + catch ( TaskQueueException e ) + { + throw new JobExecutionException( e ); + } + } +} diff --git a/MRM-541/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/executors/ArchivaDatabaseUpdateTaskExecutor.java b/MRM-541/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/executors/ArchivaDatabaseUpdateTaskExecutor.java new file mode 100644 index 000000000..2c764ce12 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/executors/ArchivaDatabaseUpdateTaskExecutor.java @@ -0,0 +1,91 @@ +package org.apache.maven.archiva.scheduled.executors; + +/* + * 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.archiva.database.ArchivaDatabaseException; +import org.apache.maven.archiva.database.updater.DatabaseUpdater; +import org.apache.maven.archiva.scheduled.tasks.DatabaseTask; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException; +import org.codehaus.plexus.taskqueue.Task; +import org.codehaus.plexus.taskqueue.execution.TaskExecutionException; +import org.codehaus.plexus.taskqueue.execution.TaskExecutor; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * ArchivaDatabaseTaskExecutor + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component + * role="org.codehaus.plexus.taskqueue.execution.TaskExecutor" + * role-hint="database-update" + */ +public class ArchivaDatabaseUpdateTaskExecutor + implements TaskExecutor, Initializable +{ + private Logger log = LoggerFactory.getLogger( ArchivaDatabaseUpdateTaskExecutor.class ); + + /** + * @plexus.requirement role-hint="jdo" + */ + private DatabaseUpdater databaseUpdater; + + public void initialize() + throws InitializationException + { + log.info( "Initialized " + this.getClass().getName() ); + } + + public void executeTask( Task task ) + throws TaskExecutionException + { + DatabaseTask dbtask = (DatabaseTask) task; + + log.info( "Executing task from queue with job name: " + dbtask.getName() ); + long time = System.currentTimeMillis(); + + try + { + log.info( "Task: Updating unprocessed artifacts" ); + databaseUpdater.updateAllUnprocessed(); + } + catch ( ArchivaDatabaseException e ) + { + throw new TaskExecutionException( "Error running unprocessed updater", e ); + } + + try + { + log.info( "Task: Updating processed artifacts" ); + databaseUpdater.updateAllProcessed(); + } + catch ( ArchivaDatabaseException e ) + { + throw new TaskExecutionException( "Error running processed updater", e ); + } + + time = System.currentTimeMillis() - time; + + log.info( "Finished database task in " + time + "ms." ); + } +} diff --git a/MRM-541/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/executors/ArchivaRepositoryScanningTaskExecutor.java b/MRM-541/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/executors/ArchivaRepositoryScanningTaskExecutor.java new file mode 100644 index 000000000..527ee34fc --- /dev/null +++ b/MRM-541/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/executors/ArchivaRepositoryScanningTaskExecutor.java @@ -0,0 +1,130 @@ +package org.apache.maven.archiva.scheduled.executors; + +/* + * 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.collections.CollectionUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.database.ArchivaDAO; +import org.apache.maven.archiva.database.constraints.MostRecentRepositoryScanStatistics; +import org.apache.maven.archiva.model.RepositoryContentStatistics; +import org.apache.maven.archiva.repository.RepositoryException; +import org.apache.maven.archiva.repository.scanner.RepositoryScanStatistics; +import org.apache.maven.archiva.repository.scanner.RepositoryScanner; +import org.apache.maven.archiva.scheduled.tasks.RepositoryTask; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException; +import org.codehaus.plexus.taskqueue.Task; +import org.codehaus.plexus.taskqueue.execution.TaskExecutionException; +import org.codehaus.plexus.taskqueue.execution.TaskExecutor; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.List; + +/** + * ArchivaRepositoryScanningTaskExecutor + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component + * role="org.codehaus.plexus.taskqueue.execution.TaskExecutor" + * role-hint="repository-scanning" + */ +public class ArchivaRepositoryScanningTaskExecutor + implements TaskExecutor, Initializable +{ + private Logger log = LoggerFactory.getLogger( ArchivaRepositoryScanningTaskExecutor.class ); + + /** + * @plexus.requirement role-hint="jdo" + */ + private ArchivaDAO dao; + + /** + * @plexus.requirement + */ + private ArchivaConfiguration archivaConfiguration; + + /** + * The repository scanner component. + * + * @plexus.requirement + */ + private RepositoryScanner repoScanner; + + public void initialize() + throws InitializationException + { + log.info( "Initialized " + this.getClass().getName() ); + } + + public void executeTask( Task task ) + throws TaskExecutionException + { + RepositoryTask repoTask = (RepositoryTask) task; + + if ( StringUtils.isBlank( repoTask.getRepositoryId() ) ) + { + throw new TaskExecutionException("Unable to execute RepositoryTask with blank repository Id."); + } + + log.info( "Executing task from queue with job name: " + repoTask.getName() ); + + try + { + ManagedRepositoryConfiguration arepo = archivaConfiguration.getConfiguration().findManagedRepositoryById( repoTask.getRepositoryId() ); + if ( arepo == null ) + { + throw new TaskExecutionException( "Unable to execute RepositoryTask with invalid repository id: " + repoTask.getRepositoryId() ); + } + + long sinceWhen = RepositoryScanner.FRESH_SCAN; + + List results = dao.query( new MostRecentRepositoryScanStatistics( arepo.getId() ) ); + + if ( CollectionUtils.isNotEmpty( results ) ) + { + RepositoryContentStatistics lastStats = results.get( 0 ); + sinceWhen = lastStats.getWhenGathered().getTime() + lastStats.getDuration(); + } + + RepositoryScanStatistics stats = repoScanner.scan( arepo, sinceWhen ); + + log.info( "Finished repository task: " + stats.toDump( arepo ) ); + + // I hate jpox and modello + RepositoryContentStatistics dbstats = new RepositoryContentStatistics(); + dbstats.setDuration( stats.getDuration() ); + dbstats.setNewFileCount( stats.getNewFileCount() ); + dbstats.setRepositoryId( stats.getRepositoryId() ); + dbstats.setTotalFileCount( stats.getTotalFileCount() ); + dbstats.setWhenGathered( stats.getWhenGathered() ); + + dao.getRepositoryContentStatisticsDAO().saveRepositoryContentStatistics( dbstats ); + } + catch ( RepositoryException e ) + { + throw new TaskExecutionException( "Repository error when executing repository job.", e ); + } + } +} diff --git a/MRM-541/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/tasks/ArchivaTask.java b/MRM-541/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/tasks/ArchivaTask.java new file mode 100644 index 000000000..642f16b7f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/tasks/ArchivaTask.java @@ -0,0 +1,68 @@ +package org.apache.maven.archiva.scheduled.tasks; + +/* + * 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.codehaus.plexus.taskqueue.Task; + +/** + * A repository task. + * + * @author Brett Porter + */ +public interface ArchivaTask + extends Task +{ + public static final String QUEUE_POLICY_WAIT = "wait"; + + public static final String QUEUE_POLICY_SKIP = "skip"; + + /** + * Gets the queue policy for this task. + * + * @return Queue policy for this task + */ + public String getQueuePolicy(); + + /** + * Sets the queue policy for this task. + * + * @param policy + */ + public void setQueuePolicy( String policy ); + + /** + * Sets the job name to represent a group of similar / identical job tasks. Can be used to check the + * task queue for similar / identical job tasks. + */ + public void setName( String name ); + + /** + * obtains the name of the task + * @return + */ + public String getName(); + + public long getMaxExecutionTime(); + + public void setMaxExecutionTime( long maxExecutionTime ); + + + +} diff --git a/MRM-541/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/tasks/DatabaseTask.java b/MRM-541/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/tasks/DatabaseTask.java new file mode 100644 index 000000000..427d9e8e9 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/tasks/DatabaseTask.java @@ -0,0 +1,68 @@ +package org.apache.maven.archiva.scheduled.tasks; + +/* + * 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. + */ + +/** + * DataRefreshTask - task for discovering changes in the repository + * and updating all associated data. + * + * @author Joakim Erdfelt + * @version $Id: DataRefreshTask.java 525176 2007-04-03 15:21:33Z joakime $ + */ +public class DatabaseTask + implements ArchivaTask +{ + + String name; + + String queuePolicy; + + long maxExecutionTime; + + public long getMaxExecutionTime() + { + return maxExecutionTime; + } + + public void setMaxExecutionTime( long maxExecutionTime ) + { + this.maxExecutionTime = maxExecutionTime; + } + + public String getName() + { + return name; + } + + public void setName( String name ) + { + this.name = name; + } + + public String getQueuePolicy() + { + return queuePolicy; + } + + public void setQueuePolicy( String queuePolicy ) + { + this.queuePolicy = queuePolicy; + } +} diff --git a/MRM-541/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/tasks/RepositoryTask.java b/MRM-541/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/tasks/RepositoryTask.java new file mode 100644 index 000000000..cd4da2d6f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/tasks/RepositoryTask.java @@ -0,0 +1,79 @@ +package org.apache.maven.archiva.scheduled.tasks; + +/* + * 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. + */ + +/** + * DataRefreshTask - task for discovering changes in the repository + * and updating all associated data. + * + * @author Joakim Erdfelt + * @version $Id: DataRefreshTask.java 525176 2007-04-03 15:21:33Z joakime $ + */ +public class RepositoryTask + implements ArchivaTask +{ + String repositoryId; + + String name; + + String queuePolicy; + + long maxExecutionTime; + + public String getRepositoryId() + { + return repositoryId; + } + + public void setRepositoryId( String repositoryId ) + { + this.repositoryId = repositoryId; + } + + public long getMaxExecutionTime() + { + return maxExecutionTime; + } + + public void setMaxExecutionTime( long maxExecutionTime ) + { + this.maxExecutionTime = maxExecutionTime; + } + + public String getName() + { + return name; + } + + public void setName( String name ) + { + this.name = name; + } + + public String getQueuePolicy() + { + return queuePolicy; + } + + public void setQueuePolicy( String queuePolicy ) + { + this.queuePolicy = queuePolicy; + } +} diff --git a/MRM-541/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/tasks/RepositoryTaskSelectionPredicate.java b/MRM-541/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/tasks/RepositoryTaskSelectionPredicate.java new file mode 100644 index 000000000..c328ebe9c --- /dev/null +++ b/MRM-541/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/tasks/RepositoryTaskSelectionPredicate.java @@ -0,0 +1,54 @@ +package org.apache.maven.archiva.scheduled.tasks; + +/* + * 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.collections.Predicate; +import org.apache.commons.lang.StringUtils; + +/** + * RepositoryTaskSelectionPredicate + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class RepositoryTaskSelectionPredicate + implements Predicate +{ + private String repoid; + + public RepositoryTaskSelectionPredicate( String repositoryId ) + { + this.repoid = repositoryId; + } + + public boolean evaluate( Object object ) + { + boolean satisfies = false; + + if ( object instanceof RepositoryTask ) + { + RepositoryTask task = (RepositoryTask) object; + return StringUtils.equals( repoid, task.getRepositoryId() ); + } + + return satisfies; + } + +} diff --git a/MRM-541/archiva-modules/archiva-scheduled/src/main/resources/META-INF/plexus/components.xml b/MRM-541/archiva-modules/archiva-scheduled/src/main/resources/META-INF/plexus/components.xml new file mode 100644 index 000000000..4d6d6370f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-scheduled/src/main/resources/META-INF/plexus/components.xml @@ -0,0 +1,104 @@ + + + + + + + + org.codehaus.plexus.taskqueue.TaskQueue + database-update + org.codehaus.plexus.taskqueue.DefaultTaskQueue + plexus-configurable + + + + + + + + + + + + org.codehaus.plexus.taskqueue.execution.TaskQueueExecutor + database-update + org.codehaus.plexus.taskqueue.execution.ThreadedTaskQueueExecutor + singleton + + + org.codehaus.plexus.taskqueue.execution.TaskExecutor + database-update + + + org.codehaus.plexus.taskqueue.TaskQueue + database-update + + + + database-update + + + + + + org.codehaus.plexus.taskqueue.TaskQueue + repository-scanning + org.codehaus.plexus.taskqueue.DefaultTaskQueue + plexus-configurable + + + + + + + + + + + + org.codehaus.plexus.taskqueue.execution.TaskQueueExecutor + repository-scanning + org.codehaus.plexus.taskqueue.execution.ThreadedTaskQueueExecutor + singleton + + + org.codehaus.plexus.taskqueue.execution.TaskExecutor + repository-scanning + + + org.codehaus.plexus.taskqueue.TaskQueue + repository-scanning + + + + repository-scanning + + + + + diff --git a/MRM-541/archiva-modules/archiva-scheduled/src/test/java/org/apache/maven/archiva/scheduled/TestDatabaseCleanupConsumer.java b/MRM-541/archiva-modules/archiva-scheduled/src/test/java/org/apache/maven/archiva/scheduled/TestDatabaseCleanupConsumer.java new file mode 100644 index 000000000..ff6979877 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-scheduled/src/test/java/org/apache/maven/archiva/scheduled/TestDatabaseCleanupConsumer.java @@ -0,0 +1,100 @@ +package org.apache.maven.archiva.scheduled; + +/* + * 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.archiva.consumers.AbstractMonitoredConsumer; +import org.apache.maven.archiva.consumers.ConsumerException; +import org.apache.maven.archiva.consumers.DatabaseCleanupConsumer; +import org.apache.maven.archiva.model.ArchivaArtifact; + +import java.util.List; + +/** + * TestDatabaseCleanupConsumer + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class TestDatabaseCleanupConsumer + extends AbstractMonitoredConsumer + implements DatabaseCleanupConsumer +{ + private int countBegin = 0; + private int countComplete = 0; + private int countProcessed = 0; + + public void resetCount() + { + countBegin = 0; + countProcessed = 0; + countComplete = 0; + } + + public void beginScan() + { + countBegin++; + } + + public void completeScan() + { + countComplete++; + } + + public List getIncludedTypes() + { + return null; + } + + public void processArchivaArtifact( ArchivaArtifact artifact ) + throws ConsumerException + { + countProcessed++; + } + + public String getDescription() + { + return "Test Consumer for Database Cleanup"; + } + + public String getId() + { + return "test-db-cleanup"; + } + + public boolean isPermanent() + { + return false; + } + + public int getCountBegin() + { + return countBegin; + } + + public int getCountComplete() + { + return countComplete; + } + + public int getCountProcessed() + { + return countProcessed; + } +} diff --git a/MRM-541/archiva-modules/archiva-scheduled/src/test/java/org/apache/maven/archiva/scheduled/TestDatabaseUnprocessedConsumer.java b/MRM-541/archiva-modules/archiva-scheduled/src/test/java/org/apache/maven/archiva/scheduled/TestDatabaseUnprocessedConsumer.java new file mode 100644 index 000000000..ec93b3e87 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-scheduled/src/test/java/org/apache/maven/archiva/scheduled/TestDatabaseUnprocessedConsumer.java @@ -0,0 +1,111 @@ +package org.apache.maven.archiva.scheduled; + +/* + * 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.List; + +import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer; +import org.apache.maven.archiva.consumers.ConsumerException; +import org.apache.maven.archiva.consumers.DatabaseUnprocessedArtifactConsumer; +import org.apache.maven.archiva.model.ArchivaArtifact; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * TestDatabaseUnprocessedConsumer + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class TestDatabaseUnprocessedConsumer + extends AbstractMonitoredConsumer + implements DatabaseUnprocessedArtifactConsumer +{ + private Logger log = LoggerFactory.getLogger( TestDatabaseUnprocessedConsumer.class ); + + private int countBegin = 0; + + private int countComplete = 0; + + private int countProcessed = 0; + + public void resetCount() + { + countBegin = 0; + countProcessed = 0; + countComplete = 0; + } + + public void beginScan() + { + countBegin++; + } + + public void completeScan() + { + countComplete++; + } + + public List getIncludedTypes() + { + List types = new ArrayList(); + types.add( "pom" ); + types.add( "jar" ); + return types; + } + + public void processArchivaArtifact( ArchivaArtifact artifact ) + throws ConsumerException + { + log.info( "Processing Artifact: " + artifact ); + countProcessed++; + } + + public String getDescription() + { + return "Test Consumer for Database Unprocessed"; + } + + public String getId() + { + return "test-db-unprocessed"; + } + + public boolean isPermanent() + { + return false; + } + + public int getCountBegin() + { + return countBegin; + } + + public int getCountComplete() + { + return countComplete; + } + + public int getCountProcessed() + { + return countProcessed; + } +} diff --git a/MRM-541/archiva-modules/archiva-scheduled/src/test/java/org/apache/maven/archiva/scheduled/executors/ArchivaDatabaseUpdateTaskExecutorTest.java b/MRM-541/archiva-modules/archiva-scheduled/src/test/java/org/apache/maven/archiva/scheduled/executors/ArchivaDatabaseUpdateTaskExecutorTest.java new file mode 100644 index 000000000..d6ee52438 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-scheduled/src/test/java/org/apache/maven/archiva/scheduled/executors/ArchivaDatabaseUpdateTaskExecutorTest.java @@ -0,0 +1,199 @@ +package org.apache.maven.archiva.scheduled.executors; + +/* + * 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.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.database.ArchivaDAO; +import org.apache.maven.archiva.database.ArtifactDAO; +import org.apache.maven.archiva.database.constraints.ArtifactsProcessedConstraint; +import org.apache.maven.archiva.model.ArchivaArtifact; +import org.apache.maven.archiva.scheduled.tasks.DatabaseTask; +import org.codehaus.plexus.jdo.DefaultConfigurableJdoFactory; +import org.codehaus.plexus.jdo.JdoFactory; +import org.codehaus.plexus.spring.PlexusInSpringTestCase; +import org.codehaus.plexus.taskqueue.execution.TaskExecutor; +import org.jpox.SchemaTool; + +import java.io.File; +import java.net.URL; +import java.util.Date; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Properties; + +import javax.jdo.PersistenceManager; +import javax.jdo.PersistenceManagerFactory; + +/** + * ArchivaDatabaseUpdateTaskExecutorTest + * + * @author Joakim Erdfelt + * @version $Id:$ + */ +public class ArchivaDatabaseUpdateTaskExecutorTest + extends PlexusInSpringTestCase +{ + private TaskExecutor taskExecutor; + + protected ArchivaDAO dao; + + protected void setUp() + throws Exception + { + super.setUp(); + + DefaultConfigurableJdoFactory jdoFactory = (DefaultConfigurableJdoFactory) lookup( JdoFactory.ROLE, "archiva" ); + assertEquals( DefaultConfigurableJdoFactory.class.getName(), jdoFactory.getClass().getName() ); + + jdoFactory.setPersistenceManagerFactoryClass( "org.jpox.PersistenceManagerFactoryImpl" ); + + /* derby version + File derbyDbDir = new File( "target/plexus-home/testdb" ); + if ( derbyDbDir.exists() ) + { + FileUtils.deleteDirectory( derbyDbDir ); + } + + jdoFactory.setDriverName( System.getProperty( "jdo.test.driver", "org.apache.derby.jdbc.EmbeddedDriver" ) ); + jdoFactory.setUrl( System.getProperty( "jdo.test.url", "jdbc:derby:" + derbyDbDir.getAbsolutePath() + ";create=true" ) ); + */ + + jdoFactory.setDriverName( System.getProperty( "jdo.test.driver", "org.hsqldb.jdbcDriver" ) ); + jdoFactory.setUrl( System.getProperty( "jdo.test.url", "jdbc:hsqldb:mem:" + getName() ) ); + + jdoFactory.setUserName( System.getProperty( "jdo.test.user", "sa" ) ); + + jdoFactory.setPassword( System.getProperty( "jdo.test.pass", "" ) ); + + jdoFactory.setProperty( "org.jpox.transactionIsolation", "READ_COMMITTED" ); + + jdoFactory.setProperty( "org.jpox.poid.transactionIsolation", "READ_COMMITTED" ); + + jdoFactory.setProperty( "org.jpox.autoCreateSchema", "true" ); + + jdoFactory.setProperty( "javax.jdo.option.RetainValues", "true" ); + + jdoFactory.setProperty( "javax.jdo.option.RestoreValues", "true" ); + + // jdoFactory.setProperty( "org.jpox.autoCreateColumns", "true" ); + + jdoFactory.setProperty( "org.jpox.validateTables", "true" ); + + jdoFactory.setProperty( "org.jpox.validateColumns", "true" ); + + jdoFactory.setProperty( "org.jpox.validateConstraints", "true" ); + + Properties properties = jdoFactory.getProperties(); + + for ( Iterator it = properties.entrySet().iterator(); it.hasNext(); ) + { + Map.Entry entry = (Map.Entry) it.next(); + + System.setProperty( (String) entry.getKey(), (String) entry.getValue() ); + } + + URL jdoFileUrls[] = new URL[] { getClass().getResource( "/org/apache/maven/archiva/model/package.jdo" ) }; + + if ( ( jdoFileUrls == null ) || ( jdoFileUrls[0] == null ) ) + { + fail( "Unable to process test " + getName() + " - missing package.jdo." ); + } + + File propsFile = null; // intentional + boolean verbose = true; + + SchemaTool.deleteSchemaTables( jdoFileUrls, new URL[] {}, propsFile, verbose ); + SchemaTool.createSchemaTables( jdoFileUrls, new URL[] {}, propsFile, verbose, null ); + + PersistenceManagerFactory pmf = jdoFactory.getPersistenceManagerFactory(); + + assertNotNull( pmf ); + + PersistenceManager pm = pmf.getPersistenceManager(); + + pm.close(); + + this.dao = (ArchivaDAO) lookup( ArchivaDAO.class.getName(), "jdo" ); + + taskExecutor = (TaskExecutor) lookup( TaskExecutor.class, "test-database-update" ); + } + + public void testExecutor() + throws Exception + { + File repoDir = new File( getBasedir(), "src/test/repositories/default-repository" ); + + assertTrue( "Default Test Repository should exist.", repoDir.exists() && repoDir.isDirectory() ); + + ManagedRepositoryConfiguration repo = createRepository( "testRepo", "Test Repository", repoDir ); + assertNotNull( repo ); + + ArtifactDAO adao = dao.getArtifactDAO(); + + ArchivaArtifact sqlArtifact = adao.createArtifact( "javax.sql", "jdbc", "2.0", "", "jar" ); + sqlArtifact.getModel().setLastModified( new Date() ); + sqlArtifact.getModel().setSize( 1234 ); + sqlArtifact.getModel().setOrigin( "testcase" ); + sqlArtifact.getModel().setWhenProcessed( null ); + + adao.saveArtifact( sqlArtifact ); + + ArchivaArtifact artifact = adao.getArtifact( "javax.sql", "jdbc", "2.0", null, "jar" ); + + assertNotNull( artifact ); + + // Test for artifact existance. + List artifactList = adao.queryArtifacts( null ); + assertNotNull( "Artifact list should not be null.", artifactList ); + assertEquals( "Artifact list size", 1, artifactList.size() ); + + // Test for unprocessed artifacts. + List unprocessedResultList = adao.queryArtifacts( new ArtifactsProcessedConstraint( false ) ); + assertNotNull( "Unprocessed Results should not be null.", unprocessedResultList ); + assertEquals( "Incorrect number of unprocessed artifacts detected.", 1, unprocessedResultList.size() ); + + // Execute the database task. + DatabaseTask dataTask = new DatabaseTask(); + + dataTask.setName( "testDataTask" ); + + taskExecutor.executeTask( dataTask ); + + // Test for artifact existance. + artifactList = adao.queryArtifacts( null ); + assertNotNull( "Artifact list should not be null.", artifactList ); + assertEquals( "Artifact list size", 1, artifactList.size() ); + + // Test for processed artifacts. + List processedResultList = adao.queryArtifacts( new ArtifactsProcessedConstraint( true ) ); + assertNotNull( "Processed Results should not be null.", processedResultList ); + assertEquals( "Incorrect number of processed artifacts detected.", 1, processedResultList.size() ); + } + + protected ManagedRepositoryConfiguration createRepository( String id, String name, File location ) + { + ManagedRepositoryConfiguration repo = new ManagedRepositoryConfiguration(); + repo.setId( id ); + repo.setName( name ); + repo.setLocation( location.getAbsolutePath() ); + return repo; + } +} diff --git a/MRM-541/archiva-modules/archiva-scheduled/src/test/java/org/apache/maven/archiva/scheduled/executors/ArchivaRepositoryScanningTaskExecutorTest.java b/MRM-541/archiva-modules/archiva-scheduled/src/test/java/org/apache/maven/archiva/scheduled/executors/ArchivaRepositoryScanningTaskExecutorTest.java new file mode 100644 index 000000000..af5f708b6 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-scheduled/src/test/java/org/apache/maven/archiva/scheduled/executors/ArchivaRepositoryScanningTaskExecutorTest.java @@ -0,0 +1,176 @@ +package org.apache.maven.archiva.scheduled.executors; + +/* + * 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.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.database.ArchivaDAO; +import org.apache.maven.archiva.database.ArtifactDAO; +import org.apache.maven.archiva.database.constraints.ArtifactsProcessedConstraint; +import org.apache.maven.archiva.scheduled.tasks.RepositoryTask; +import org.codehaus.plexus.jdo.DefaultConfigurableJdoFactory; +import org.codehaus.plexus.jdo.JdoFactory; +import org.codehaus.plexus.spring.PlexusInSpringTestCase; +import org.codehaus.plexus.taskqueue.execution.TaskExecutor; +import org.jpox.SchemaTool; + +import java.io.File; +import java.net.URL; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Properties; + +import javax.jdo.PersistenceManager; +import javax.jdo.PersistenceManagerFactory; + +/** + * ArchivaRepositoryScanningTaskExecutorTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ArchivaRepositoryScanningTaskExecutorTest + extends PlexusInSpringTestCase +{ + private TaskExecutor taskExecutor; + + protected ArchivaDAO dao; + + protected void setUp() + throws Exception + { + super.setUp(); + + DefaultConfigurableJdoFactory jdoFactory = (DefaultConfigurableJdoFactory) lookup( JdoFactory.ROLE, "archiva" ); + assertEquals( DefaultConfigurableJdoFactory.class.getName(), jdoFactory.getClass().getName() ); + + jdoFactory.setPersistenceManagerFactoryClass( "org.jpox.PersistenceManagerFactoryImpl" ); + + /* derby version + File derbyDbDir = new File( "target/plexus-home/testdb" ); + if ( derbyDbDir.exists() ) + { + FileUtils.deleteDirectory( derbyDbDir ); + } + + jdoFactory.setDriverName( System.getProperty( "jdo.test.driver", "org.apache.derby.jdbc.EmbeddedDriver" ) ); + jdoFactory.setUrl( System.getProperty( "jdo.test.url", "jdbc:derby:" + derbyDbDir.getAbsolutePath() + ";create=true" ) ); + */ + + jdoFactory.setDriverName( System.getProperty( "jdo.test.driver", "org.hsqldb.jdbcDriver" ) ); + jdoFactory.setUrl( System.getProperty( "jdo.test.url", "jdbc:hsqldb:mem:" + getName() ) ); + + jdoFactory.setUserName( System.getProperty( "jdo.test.user", "sa" ) ); + + jdoFactory.setPassword( System.getProperty( "jdo.test.pass", "" ) ); + + jdoFactory.setProperty( "org.jpox.transactionIsolation", "READ_COMMITTED" ); + + jdoFactory.setProperty( "org.jpox.poid.transactionIsolation", "READ_COMMITTED" ); + + jdoFactory.setProperty( "org.jpox.autoCreateSchema", "true" ); + + jdoFactory.setProperty( "javax.jdo.option.RetainValues", "true" ); + + jdoFactory.setProperty( "javax.jdo.option.RestoreValues", "true" ); + + // jdoFactory.setProperty( "org.jpox.autoCreateColumns", "true" ); + + jdoFactory.setProperty( "org.jpox.validateTables", "true" ); + + jdoFactory.setProperty( "org.jpox.validateColumns", "true" ); + + jdoFactory.setProperty( "org.jpox.validateConstraints", "true" ); + + Properties properties = jdoFactory.getProperties(); + + for ( Iterator it = properties.entrySet().iterator(); it.hasNext(); ) + { + Map.Entry entry = (Map.Entry) it.next(); + + System.setProperty( (String) entry.getKey(), (String) entry.getValue() ); + } + + URL jdoFileUrls[] = new URL[] { getClass() + .getResource( "/org/apache/maven/archiva/model/package.jdo" ) }; + + if ( ( jdoFileUrls == null ) || ( jdoFileUrls[0] == null ) ) + { + fail( "Unable to process test " + getName() + " - missing package.jdo." ); + } + + File propsFile = null; // intentional + boolean verbose = true; + + SchemaTool.deleteSchemaTables( jdoFileUrls, new URL[] {}, propsFile, verbose ); + SchemaTool.createSchemaTables( jdoFileUrls, new URL[] {}, propsFile, verbose, null ); + + PersistenceManagerFactory pmf = jdoFactory.getPersistenceManagerFactory(); + + assertNotNull( pmf ); + + PersistenceManager pm = pmf.getPersistenceManager(); + + pm.close(); + + this.dao = (ArchivaDAO) lookup( ArchivaDAO.class.getName(), "jdo" ); + + taskExecutor = (TaskExecutor) lookup( TaskExecutor.class, "test-repository-scanning" ); + } + + public void testExecutor() throws Exception + { + File repoDir = new File( getBasedir(), "src/test/repositories/default-repository" ); + + assertTrue( "Default Test Repository should exist.", repoDir.exists() && repoDir.isDirectory() ); + + ArchivaConfiguration archivaConfig = (ArchivaConfiguration) lookup( ArchivaConfiguration.class ); + assertNotNull( archivaConfig ); + + // Create it + ManagedRepositoryConfiguration repo = createRepository( "testRepo", "Test Repository", repoDir ); + assertNotNull( repo ); + archivaConfig.getConfiguration().getManagedRepositories().clear(); + archivaConfig.getConfiguration().addManagedRepository( repo ); + + RepositoryTask repoTask = new RepositoryTask(); + + repoTask.setName( "testRepoTask" ); + repoTask.setRepositoryId( "testRepo" ); + + taskExecutor.executeTask( repoTask ); + + ArtifactDAO adao = dao.getArtifactDAO(); + List unprocessedResultList = adao.queryArtifacts( new ArtifactsProcessedConstraint( false ) ); + + assertNotNull( unprocessedResultList ); + assertEquals("Incorrect number of unprocessed artifacts detected.", 8, unprocessedResultList.size() ); + } + + protected ManagedRepositoryConfiguration createRepository( String id, String name, File location ) + { + ManagedRepositoryConfiguration repo = new ManagedRepositoryConfiguration(); + repo.setId( id ); + repo.setName( name ); + repo.setLocation( location.getAbsolutePath() ); + return repo; + } +} diff --git a/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/javax/maven-metadata.xml b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/javax/maven-metadata.xml new file mode 100644 index 000000000..b3baf545d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/javax/maven-metadata.xml @@ -0,0 +1,26 @@ + + + + + + javax.sql + jdbc + 2.0 + diff --git a/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/javax/sql/jdbc/2.0/jdbc-2.0.jar b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/javax/sql/jdbc/2.0/jdbc-2.0.jar new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/javax/sql/jdbc/2.0/jdbc-2.0.jar.md5 b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/javax/sql/jdbc/2.0/jdbc-2.0.jar.md5 new file mode 100644 index 000000000..ef7483fad --- /dev/null +++ b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/javax/sql/jdbc/2.0/jdbc-2.0.jar.md5 @@ -0,0 +1 @@ +d41d8cd98f00b204e9800998ecf8427e jdbc-2.0.jar \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/javax/sql/jdbc/2.0/jdbc-2.0.jar.sha1 b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/javax/sql/jdbc/2.0/jdbc-2.0.jar.sha1 new file mode 100644 index 000000000..4bc014766 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/javax/sql/jdbc/2.0/jdbc-2.0.jar.sha1 @@ -0,0 +1 @@ +da39a3ee5e6b4b0d3255bfef95601890afd80709 jdbc-2.0.jar \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/javax/sql/jdbc/2.0/maven-metadata-repository.xml b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/javax/sql/jdbc/2.0/maven-metadata-repository.xml new file mode 100644 index 000000000..caf5b6697 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/javax/sql/jdbc/2.0/maven-metadata-repository.xml @@ -0,0 +1,25 @@ + + + + + javax.sql + jdbc + 2.0 + diff --git a/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/javax/sql/jdbc/maven-metadata-repository.xml b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/javax/sql/jdbc/maven-metadata-repository.xml new file mode 100644 index 000000000..bb7570891 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/javax/sql/jdbc/maven-metadata-repository.xml @@ -0,0 +1,30 @@ + + + + + javax.sql + jdbc + 2.0 + + + 2.0 + + + diff --git a/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/javax/sql/maven-metadata-repository.xml b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/javax/sql/maven-metadata-repository.xml new file mode 100644 index 000000000..caf5b6697 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/javax/sql/maven-metadata-repository.xml @@ -0,0 +1,25 @@ + + + + + javax.sql + jdbc + 2.0 + diff --git a/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/A/1.0/A-1.0.pom b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/A/1.0/A-1.0.pom new file mode 100644 index 000000000..202a0a448 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/A/1.0/A-1.0.pom @@ -0,0 +1,28 @@ + + + + 4.0.0 + org.apache.maven + A + 1.0 + Maven Test Repository Artifact Discovery + war + diff --git a/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/A/1.0/A-1.0.pom.md5 b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/A/1.0/A-1.0.pom.md5 new file mode 100644 index 000000000..78a953bc5 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/A/1.0/A-1.0.pom.md5 @@ -0,0 +1 @@ +bc479af1df809dbabb92e29548776b84 A-1.0.pom \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/A/1.0/A-1.0.pom.sha1 b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/A/1.0/A-1.0.pom.sha1 new file mode 100644 index 000000000..71d6233aa --- /dev/null +++ b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/A/1.0/A-1.0.pom.sha1 @@ -0,0 +1 @@ +fbb4c97603c64f3915c88243e1ea49f1a238afa7 A-1.0.pom \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/A/1.0/A-1.0.war b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/A/1.0/A-1.0.war new file mode 100644 index 000000000..54d190b23 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/A/1.0/A-1.0.war @@ -0,0 +1 @@ +dummy content. sample file only. diff --git a/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/A/1.0/A-1.0.war.md5 b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/A/1.0/A-1.0.war.md5 new file mode 100644 index 000000000..665059bc7 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/A/1.0/A-1.0.war.md5 @@ -0,0 +1 @@ +fd4275a6811332d67075ffd879d13d4a A-1.0.war \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/A/1.0/A-1.0.war.sha1 b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/A/1.0/A-1.0.war.sha1 new file mode 100644 index 000000000..c8494eb9d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/A/1.0/A-1.0.war.sha1 @@ -0,0 +1 @@ +754133cd9c36adef86d35b96c0e96e11a9c6bfc9 A-1.0.war \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/B/1.0/B-1.0.pom b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/B/1.0/B-1.0.pom new file mode 100644 index 000000000..fa5f8f6c8 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/B/1.0/B-1.0.pom @@ -0,0 +1,28 @@ + + + + 4.0.0 + org.apache.maven + B + 1.0 + Maven Test Repository Artifact Discovery + pom + diff --git a/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/B/1.0/B-1.0.pom.md5 b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/B/1.0/B-1.0.pom.md5 new file mode 100644 index 000000000..2324bce0c --- /dev/null +++ b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/B/1.0/B-1.0.pom.md5 @@ -0,0 +1 @@ +c543ad342d1de7a4352fc9b0f42067b8 B-1.0.pom \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/B/1.0/B-1.0.pom.sha1 b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/B/1.0/B-1.0.pom.sha1 new file mode 100644 index 000000000..d8d5abce7 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/B/1.0/B-1.0.pom.sha1 @@ -0,0 +1 @@ +be06d04d5824859253abf423394dc85d24971ba8 B-1.0.pom \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/B/2.0/B-2.0.pom b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/B/2.0/B-2.0.pom new file mode 100644 index 000000000..c3034e820 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/B/2.0/B-2.0.pom @@ -0,0 +1,28 @@ + + + + 4.0.0 + org.apache.maven + B + 2.0 + Maven Test Repository Artifact Discovery + pom + diff --git a/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/B/2.0/B-2.0.pom.md5 b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/B/2.0/B-2.0.pom.md5 new file mode 100644 index 000000000..4ddd22b82 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/B/2.0/B-2.0.pom.md5 @@ -0,0 +1 @@ +1af6c812f02f24e1ba287647a6856cd5 B-2.0.pom \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/B/2.0/B-2.0.pom.sha1 b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/B/2.0/B-2.0.pom.sha1 new file mode 100644 index 000000000..95912764c --- /dev/null +++ b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/B/2.0/B-2.0.pom.sha1 @@ -0,0 +1 @@ +5d49f821499ab061c97457b3e6512fd1624a3033 B-2.0.pom \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/C/1.0/C-1.0.pom b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/C/1.0/C-1.0.pom new file mode 100644 index 000000000..ae14cd7eb --- /dev/null +++ b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/C/1.0/C-1.0.pom @@ -0,0 +1,28 @@ + + + + 4.0.0 + org.apache.maven + C + 1.0 + Maven Test Repository Artifact Discovery + war + diff --git a/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/C/1.0/C-1.0.pom.md5 b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/C/1.0/C-1.0.pom.md5 new file mode 100644 index 000000000..d08745961 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/C/1.0/C-1.0.pom.md5 @@ -0,0 +1 @@ +90f5c062bded5f794cd4ea9479b35173 C-1.0.pom \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/C/1.0/C-1.0.pom.sha1 b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/C/1.0/C-1.0.pom.sha1 new file mode 100644 index 000000000..fbe7bd338 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/C/1.0/C-1.0.pom.sha1 @@ -0,0 +1 @@ +fcefa8220d30b7aa72a1b7422cc06336ca14bb6f C-1.0.pom \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/C/1.0/C-1.0.war b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/C/1.0/C-1.0.war new file mode 100644 index 000000000..54d190b23 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/C/1.0/C-1.0.war @@ -0,0 +1 @@ +dummy content. sample file only. diff --git a/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/C/1.0/C-1.0.war.md5 b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/C/1.0/C-1.0.war.md5 new file mode 100644 index 000000000..4eb175498 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/C/1.0/C-1.0.war.md5 @@ -0,0 +1 @@ +fd4275a6811332d67075ffd879d13d4a C-1.0.war \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/C/1.0/C-1.0.war.sha1 b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/C/1.0/C-1.0.war.sha1 new file mode 100644 index 000000000..78e0b6eb7 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/C/1.0/C-1.0.war.sha1 @@ -0,0 +1 @@ +754133cd9c36adef86d35b96c0e96e11a9c6bfc9 C-1.0.war \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/maven-metadata.xml b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/maven-metadata.xml new file mode 100644 index 000000000..8ce7fc7bb --- /dev/null +++ b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/maven/maven-metadata.xml @@ -0,0 +1,23 @@ + + + + + org.apache.maven + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/testgroup/discovery/1.0/discovery-1.0.pom b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/testgroup/discovery/1.0/discovery-1.0.pom new file mode 100644 index 000000000..12538e81a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/testgroup/discovery/1.0/discovery-1.0.pom @@ -0,0 +1,28 @@ + + + + 4.0.0 + org.apache.testgroup + discovery + 1.0 + Maven Test Repository Artifact Discovery + pom + diff --git a/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/testgroup/discovery/1.0/discovery-1.0.pom.md5 b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/testgroup/discovery/1.0/discovery-1.0.pom.md5 new file mode 100644 index 000000000..b163670f2 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/testgroup/discovery/1.0/discovery-1.0.pom.md5 @@ -0,0 +1 @@ +764dd493029133aff4c0f7cb4be2d9b7 discovery-1.0.pom \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/testgroup/discovery/1.0/discovery-1.0.pom.sha1 b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/testgroup/discovery/1.0/discovery-1.0.pom.sha1 new file mode 100644 index 000000000..dedf18ade --- /dev/null +++ b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/testgroup/discovery/1.0/discovery-1.0.pom.sha1 @@ -0,0 +1 @@ +a7aaf680caaf5bb971753e047c439f3fd4efa473 discovery-1.0.pom \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/testgroup/discovery/1.0/maven-metadata.xml b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/testgroup/discovery/1.0/maven-metadata.xml new file mode 100644 index 000000000..8ee18048c --- /dev/null +++ b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/testgroup/discovery/1.0/maven-metadata.xml @@ -0,0 +1,25 @@ + + + + + org.apache.testgroup + discovery + 1.0 + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/testgroup/discovery/maven-metadata.xml b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/testgroup/discovery/maven-metadata.xml new file mode 100644 index 000000000..b024ef7ef --- /dev/null +++ b/MRM-541/archiva-modules/archiva-scheduled/src/test/repositories/default-repository/org/apache/testgroup/discovery/maven-metadata.xml @@ -0,0 +1,24 @@ + + + + + org.apache.testgroup + discovery + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-scheduled/src/test/resources/archiva-test.xml b/MRM-541/archiva-modules/archiva-scheduled/src/test/resources/archiva-test.xml new file mode 100644 index 000000000..7721bb63e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-scheduled/src/test/resources/archiva-test.xml @@ -0,0 +1,119 @@ + + + + + + + testRepo + Archiva Test Repository + ${basedir}/src/test/repositories/default-repository + default + true + false + true + 0 0 * * * ? + + + + + + + + + + + artifacts + + **/*.pom + **/*.jar + **/*.ear + **/*.war + **/*.car + **/*.sar + **/*.mar + **/*.rar + **/*.dtd + **/*.tld + **/*.tar.gz + **/*.tar.bz2 + **/*.zip + + + + indexable-content + + **/*.txt + **/*.TXT + **/*.block + **/*.config + **/*.pom + **/*.xml + **/*.xsd + **/*.dtd + **/*.tld + + + + auto-remove + + **/*.bak + **/*~ + **/*- + + + + ignored + + **/.htaccess + **/KEYS + **/*.rb + **/*.sh + **/.svn/** + **/.DAV/** + + + + + update-db-artifact + create-missing-checksums + update-db-repository-metadata + validate-checksum + validate-signature + index-content + auto-remove + auto-rename + + + update-db-bad-content + + + + + 0 0 * * * ? + + test-db-unprocessed + update-db-artifact + + + test-db-cleanup + + + + diff --git a/MRM-541/archiva-modules/archiva-scheduled/src/test/resources/log4j.xml b/MRM-541/archiva-modules/archiva-scheduled/src/test/resources/log4j.xml new file mode 100644 index 000000000..3c782b138 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-scheduled/src/test/resources/log4j.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MRM-541/archiva-modules/archiva-scheduled/src/test/resources/org/apache/maven/archiva/scheduled/executors/ArchivaDatabaseUpdateTaskExecutorTest.xml b/MRM-541/archiva-modules/archiva-scheduled/src/test/resources/org/apache/maven/archiva/scheduled/executors/ArchivaDatabaseUpdateTaskExecutorTest.xml new file mode 100644 index 000000000..24e60e8fb --- /dev/null +++ b/MRM-541/archiva-modules/archiva-scheduled/src/test/resources/org/apache/maven/archiva/scheduled/executors/ArchivaDatabaseUpdateTaskExecutorTest.xml @@ -0,0 +1,98 @@ + + + + + + + org.codehaus.plexus.taskqueue.execution.TaskExecutor + test-database-update + org.apache.maven.archiva.scheduled.executors.ArchivaDatabaseUpdateTaskExecutor + + + + org.apache.maven.archiva.database.updater.DatabaseUpdater + jdo + databaseUpdater + + + + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + org.apache.maven.archiva.configuration.DefaultArchivaConfiguration + + + org.codehaus.plexus.registry.Registry + configured + + + org.apache.maven.archiva.policies.PreDownloadPolicy + prePolicies + + + org.apache.maven.archiva.policies.PostDownloadPolicy + postPolicies + + + + + + org.codehaus.plexus.registry.Registry + configured + org.codehaus.plexus.registry.commons.CommonsConfigurationRegistry + + + + + + + + + + org.apache.maven.archiva.consumers.DatabaseCleanupConsumer + test-db-cleanup + org.apache.maven.archiva.scheduled.TestDatabaseCleanupConsumer + + + + org.apache.maven.archiva.consumers.DatabaseUnprocessedArtifactConsumer + test-db-unprocessed + org.apache.maven.archiva.scheduled.TestDatabaseUnprocessedConsumer + + + + + org.codehaus.plexus.jdo.JdoFactory + archiva + org.codehaus.plexus.jdo.DefaultConfigurableJdoFactory + + org.jpox.PersistenceManagerFactoryImpl + + + javax.jdo.PersistenceManagerFactoryClass + org.jpox.PersistenceManagerFactoryImpl + + + + + + + diff --git a/MRM-541/archiva-modules/archiva-scheduled/src/test/resources/org/apache/maven/archiva/scheduled/executors/ArchivaRepositoryScanningTaskExecutorTest.xml b/MRM-541/archiva-modules/archiva-scheduled/src/test/resources/org/apache/maven/archiva/scheduled/executors/ArchivaRepositoryScanningTaskExecutorTest.xml new file mode 100644 index 000000000..f903ba33f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-scheduled/src/test/resources/org/apache/maven/archiva/scheduled/executors/ArchivaRepositoryScanningTaskExecutorTest.xml @@ -0,0 +1,94 @@ + + + + + + + org.codehaus.plexus.taskqueue.execution.TaskExecutor + test-repository-scanning + org.apache.maven.archiva.scheduled.executors.ArchivaRepositoryScanningTaskExecutor + + + + + org.apache.maven.archiva.database.ArchivaDAO + jdo + dao + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + archivaConfiguration + + + org.apache.maven.archiva.repository.scanner.RepositoryScanner + repoScanner + + + + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + org.apache.maven.archiva.configuration.DefaultArchivaConfiguration + + + org.codehaus.plexus.registry.Registry + configured + + + org.apache.maven.archiva.policies.PreDownloadPolicy + prePolicies + + + org.apache.maven.archiva.policies.PostDownloadPolicy + postPolicies + + + + + + org.codehaus.plexus.registry.Registry + configured + org.codehaus.plexus.registry.commons.CommonsConfigurationRegistry + + + + + + + + + + org.codehaus.plexus.jdo.JdoFactory + archiva + org.codehaus.plexus.jdo.DefaultConfigurableJdoFactory + + org.jpox.PersistenceManagerFactoryImpl + + + javax.jdo.PersistenceManagerFactoryClass + org.jpox.PersistenceManagerFactoryImpl + + + + + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-applet/pom.xml b/MRM-541/archiva-modules/archiva-web/archiva-applet/pom.xml new file mode 100644 index 000000000..47c848910 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-applet/pom.xml @@ -0,0 +1,89 @@ + + + + + 4.0.0 + + org.apache.archiva + archiva-web + 1.2-SNAPSHOT + + archiva-applet + Archiva Web :: Applet + + Applet for performing local operations on files such as creating a checksum of an artifact + before uploading it. + + + + + org.codehaus.mojo + keytool-maven-plugin + 1.0-beta-1 + + + generate-resources + + clean + genkey + + + + + ${basedir}/target/keystore + cn=Brett Porter, ou=Archiva, L=Sydney, ST=NSW, o=Apache Software Foundation, c=AU + password + password + 10000 + + + + org.apache.maven.plugins + maven-jar-plugin + 2.1 + + ${basedir}/target/keystore + mykey + password + password + + + + + sign + + + + + + org.codehaus.mojo + cobertura-maven-plugin + + + + + **/** + + + + + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-applet/src/main/java/org/apache/maven/archiva/applet/ChecksumApplet.java b/MRM-541/archiva-modules/archiva-web/archiva-applet/src/main/java/org/apache/maven/archiva/applet/ChecksumApplet.java new file mode 100644 index 000000000..ca9f6337d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-applet/src/main/java/org/apache/maven/archiva/applet/ChecksumApplet.java @@ -0,0 +1,143 @@ +package org.apache.maven.archiva.applet; + +/* + * 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 javax.swing.*; +import java.applet.Applet; +import java.awt.*; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.security.AccessController; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.security.PrivilegedAction; + +/** + * Applet that takes a file on the local filesystem and checksums it for sending to the server. + * + * @author Brett Porter + */ +public class ChecksumApplet + extends Applet +{ + private static final int CHECKSUM_BUFFER_SIZE = 8192; + + private static final int BYTE_MASK = 0xFF; + + private JProgressBar progressBar; + + public void init() + { + setLayout( new BorderLayout() ); + progressBar = new JProgressBar(); + progressBar.setStringPainted( true ); + add( progressBar, BorderLayout.CENTER ); + JLabel label = new JLabel( "Checksum progress: " ); + add( label, BorderLayout.WEST ); + } + + public String generateMd5( final String file ) + throws IOException, NoSuchAlgorithmException + { + Object o = AccessController.doPrivileged( new PrivilegedAction() + { + public Object run() + { + try + { + return checksumFile( file ); + } + catch ( NoSuchAlgorithmException e ) + { + return "Error checksumming file: " + e.getMessage(); + } + catch ( FileNotFoundException e ) + { + return "Couldn't find the file. " + e.getMessage(); + } + catch ( IOException e ) + { + return "Error reading file: " + e.getMessage(); + } + } + } ); + return (String) o; + } + + protected String checksumFile( String file ) + throws NoSuchAlgorithmException, IOException + { + MessageDigest digest = MessageDigest.getInstance( "MD5" ); + + long total = new File( file ).length(); + InputStream fis = new FileInputStream( file ); + try + { + long totalRead = 0; + byte[] buffer = new byte[CHECKSUM_BUFFER_SIZE]; + int numRead; + do + { + numRead = fis.read( buffer ); + if ( numRead > 0 ) + { + digest.update( buffer, 0, numRead ); + totalRead += numRead; + progressBar.setValue( (int) ( totalRead * progressBar.getMaximum() / total ) ); + } + } + while ( numRead != -1 ); + } + finally + { + fis.close(); + } + + return byteArrayToHexStr( digest.digest() ); + } + + protected static String byteArrayToHexStr( byte[] data ) + { + String output = ""; + + for ( int cnt = 0; cnt < data.length; cnt++ ) + { + //Deposit a byte into the 8 lsb of an int. + int tempInt = data[cnt] & BYTE_MASK; + + //Get hex representation of the int as a string. + String tempStr = Integer.toHexString( tempInt ); + + //Append a leading 0 if necessary so that each hex string will contain 2 characters. + if ( tempStr.length() == 1 ) + { + tempStr = "0" + tempStr; + } + + //Concatenate the two characters to the output string. + output = output + tempStr; + } + + return output.toUpperCase(); + } +} \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-rss/pom.xml b/MRM-541/archiva-modules/archiva-web/archiva-rss/pom.xml new file mode 100644 index 000000000..9aa671e60 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-rss/pom.xml @@ -0,0 +1,44 @@ + + + archiva-web + org.apache.archiva + 1.2-SNAPSHOT + + 4.0.0 + archiva-rss + Archiva Web :: RSS + http://maven.apache.org + + + org.codehaus.plexus + plexus-spring + test + + + org.apache.archiva + archiva-model + + + org.apache.archiva + archiva-database + + + commons-io + commons-io + + + org.slf4j + slf4j-api + + + rome + rome + 0.9 + + + xmlunit + xmlunit + test + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/RssFeedEntry.java b/MRM-541/archiva-modules/archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/RssFeedEntry.java new file mode 100644 index 000000000..2090f9717 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/RssFeedEntry.java @@ -0,0 +1,161 @@ +package org.apache.archiva.rss; + +import java.util.Date; + +/* + * 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. + */ + +/** + * Holds the data for the SyndEntry in the RSS feed. + * + * @author Maria Odea Ching + * @version + */ +public class RssFeedEntry +{ + private String title; + + private String link; + + private String description; + + private String author; + + private String category; + + private String comments; + + private String enclosure; + + private String guid; + + private String source; + + private Date publishedDate; + + public RssFeedEntry() + { + + } + + public RssFeedEntry( String title ) + { + this.title = title; + } + + public String getTitle() + { + return title; + } + + public void setTitle( String title ) + { + this.title = title; + } + + public String getLink() + { + return link; + } + + public void setLink( String link ) + { + this.link = link; + } + + public String getDescription() + { + return description; + } + + public void setDescription( String description ) + { + this.description = description; + } + + public String getAuthor() + { + return author; + } + + public void setAuthor( String author ) + { + this.author = author; + } + + public String getCategory() + { + return category; + } + + public void setCategory( String category ) + { + this.category = category; + } + + public String getComments() + { + return comments; + } + + public void setComments( String comments ) + { + this.comments = comments; + } + + public String getEnclosure() + { + return enclosure; + } + + public void setEnclosure( String enclosure ) + { + this.enclosure = enclosure; + } + + public String getGuid() + { + return guid; + } + + public void setGuid( String guid ) + { + this.guid = guid; + } + + public String getSource() + { + return source; + } + + public void setSource( String source ) + { + this.source = source; + } + + public Date getPublishedDate() + { + return publishedDate; + } + + public void setPublishedDate( Date publishedDate ) + { + this.publishedDate = publishedDate; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/RssFeedGenerator.java b/MRM-541/archiva-modules/archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/RssFeedGenerator.java new file mode 100644 index 000000000..4b05a36fc --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/RssFeedGenerator.java @@ -0,0 +1,97 @@ +package org.apache.archiva.rss; + +/* + * 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.List; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.sun.syndication.feed.synd.SyndContent; +import com.sun.syndication.feed.synd.SyndContentImpl; +import com.sun.syndication.feed.synd.SyndEntry; +import com.sun.syndication.feed.synd.SyndEntryImpl; +import com.sun.syndication.feed.synd.SyndFeed; +import com.sun.syndication.feed.synd.SyndFeedImpl; + +/** + * Generates RSS feeds. + * + * @plexus.component role="org.apache.archiva.rss.RssFeedGenerator" + * instantiation-strategy="per-lookup" + * + * @author Maria Odea Ching + * @version + */ +public class RssFeedGenerator +{ + private Logger log = LoggerFactory.getLogger( RssFeedGenerator.class ); + + // TODO: make configurable + public static String DEFAULT_FEEDTYPE = "rss_2.0"; + + public static String DEFAULT_LANGUAGE = "en-us"; + + public SyndFeed generateFeed( String title, String description, List dataEntries ) + { + if( dataEntries.size() == 0 ) + { + log.debug( "No updates found, feed not generated." ); + return null; + } + + SyndFeed feed = new SyndFeedImpl(); + feed.setTitle( title ); + feed.setDescription( description ); + feed.setLanguage( DEFAULT_LANGUAGE ); + feed.setPublishedDate( dataEntries.get( dataEntries.size() - 1 ).getPublishedDate() ); + feed.setFeedType( DEFAULT_FEEDTYPE ); + feed.setEntries( getEntries( dataEntries ) ); + + log.debug( "Finished generating the feed \'" + title + "\'." ); + + return feed; + } + + private List getEntries( List dataEntries ) + { + List entries = new ArrayList(); + + SyndEntry entry; + SyndContent description; + + for ( RssFeedEntry dataEntry : dataEntries ) + { + entry = new SyndEntryImpl(); + entry.setTitle( dataEntry.getTitle() ); + entry.setPublishedDate( dataEntry.getPublishedDate() ); + + description = new SyndContentImpl(); + description.setType( "text/plain" ); + description.setValue( dataEntry.getDescription() ); + entry.setDescription( description ); + + entries.add( entry ); + } + + return entries; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/processor/AbstractArtifactsRssFeedProcessor.java b/MRM-541/archiva-modules/archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/processor/AbstractArtifactsRssFeedProcessor.java new file mode 100644 index 000000000..55a7086cb --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/processor/AbstractArtifactsRssFeedProcessor.java @@ -0,0 +1,101 @@ +package org.apache.archiva.rss.processor; + +/* + * 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.Date; +import java.util.List; +import java.util.Map; + +import org.apache.archiva.rss.RssFeedEntry; +import org.apache.maven.archiva.database.ArchivaDatabaseException; +import org.apache.maven.archiva.model.ArchivaArtifact; + +import com.sun.syndication.feed.synd.SyndFeed; + +/** + * @author Maria Odea Ching + * @version + */ +public abstract class AbstractArtifactsRssFeedProcessor + implements RssFeedProcessor +{ + public abstract SyndFeed process( Map reqParams ) throws ArchivaDatabaseException; + + protected List processData( List artifacts, boolean isRepoLevel ) + { + long tmp = 0; + RssFeedEntry entry = null; + List entries = new ArrayList(); + String description = ""; + int idx = 0; + for ( ArchivaArtifact artifact : artifacts ) + { + long whenGathered = artifact.getModel().getWhenGathered().getTime(); + + if ( tmp != whenGathered ) + { + if ( entry != null ) + { + entry.setDescription( description ); + entries.add( entry ); + entry = null; + } + + if ( !isRepoLevel ) + { + entry = + new RssFeedEntry( getTitle() + "\'" + artifact.getGroupId() + ":" + artifact.getArtifactId() + + "\'" + " as of " + new Date( whenGathered ) ); + entry.setPublishedDate( artifact.getModel().getWhenGathered() ); + description = getDescription() + "\'" + artifact.getGroupId() + ":" + artifact.getArtifactId() + + "\'" + ": \n" + artifact.toString() + " | "; + } + else + { + String repoId = artifact.getModel().getRepositoryId(); + entry = new RssFeedEntry( getTitle() + "\'" + repoId + "\'" + " as of " + new Date( whenGathered ) ); + entry.setPublishedDate( artifact.getModel().getWhenGathered() ); + description = getDescription() + "\'" + repoId + "\'" + ": \n" + artifact.toString() + " | "; + } + } + else + { + description = description + artifact.toString() + " | "; + } + + if ( idx == ( artifacts.size() - 1 ) ) + { + entry.setDescription( description ); + entries.add( entry ); + } + + tmp = whenGathered; + idx++; + } + + return entries; + } + + protected abstract String getTitle(); + + protected abstract String getDescription(); + +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/processor/NewArtifactsRssFeedProcessor.java b/MRM-541/archiva-modules/archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/processor/NewArtifactsRssFeedProcessor.java new file mode 100644 index 000000000..3ef5c9182 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/processor/NewArtifactsRssFeedProcessor.java @@ -0,0 +1,141 @@ +package org.apache.archiva.rss.processor; + +/* + * 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.Calendar; +import java.util.List; +import java.util.Map; + +import org.apache.archiva.rss.RssFeedEntry; +import org.apache.archiva.rss.RssFeedGenerator; +import org.apache.commons.lang.time.DateUtils; +import org.apache.maven.archiva.database.ArchivaDatabaseException; +import org.apache.maven.archiva.database.ArtifactDAO; +import org.apache.maven.archiva.database.Constraint; +import org.apache.maven.archiva.database.constraints.ArtifactsByRepositoryConstraint; +import org.apache.maven.archiva.model.ArchivaArtifact; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.sun.syndication.feed.synd.SyndFeed; + +/** + * Retrieve and process all artifacts of a repository from the database and generate a rss feed. + * The artifacts will be grouped by the date when the artifacts were gathered. + * Each group will appear as one entry in the feed. + * + * @author Maria Odea Ching + * @version + * @plexus.component role="org.apache.archiva.rss.processor.RssFeedProcessor" role-hint="new-artifacts" + */ +public class NewArtifactsRssFeedProcessor + extends AbstractArtifactsRssFeedProcessor +{ + private int numberOfDaysBeforeNow = 30; + + private static final String title = "New Artifacts in Repository "; + + private static final String desc = "These are the new artifacts found in the repository "; + + /** + * @plexus.requirement + */ + private RssFeedGenerator generator; + + private Logger log = LoggerFactory.getLogger( NewArtifactsRssFeedProcessor.class ); + + /** + * @plexus.requirement role-hint="jdo" + */ + private ArtifactDAO artifactDAO; + + /** + * Process the newly discovered artifacts in the repository. Generate feeds for new artifacts in the repository and + * new versions of artifact. + */ + public SyndFeed process( Map reqParams ) throws ArchivaDatabaseException + { + log.debug( "Process new artifacts into rss feeds." ); + + String repoId = reqParams.get( RssFeedProcessor.KEY_REPO_ID ); + if ( repoId != null ) + { + return processNewArtifactsInRepo( repoId ); + } + + return null; + } + + private SyndFeed processNewArtifactsInRepo( String repoId ) throws ArchivaDatabaseException + { + + Calendar greaterThanThisDate = Calendar.getInstance( DateUtils.UTC_TIME_ZONE ); + greaterThanThisDate.add( Calendar.DATE, -( getNumberOfDaysBeforeNow() ) ); + + Constraint artifactsByRepo = new ArtifactsByRepositoryConstraint( repoId, greaterThanThisDate.getTime(), "whenGathered" ); + List artifacts = artifactDAO.queryArtifacts( artifactsByRepo ); + + List entries = processData( artifacts, true ); + + return generator.generateFeed( getTitle() + "\'" + repoId + "\'", "New artifacts found in repository " + + "\'" + repoId + "\'" + " during repository scan.", entries ); + } + + public String getTitle() + { + return title; + } + + public String getDescription() + { + return desc; + } + + public RssFeedGenerator getGenerator() + { + return generator; + } + + public void setGenerator( RssFeedGenerator generator ) + { + this.generator = generator; + } + + public ArtifactDAO getArtifactDAO() + { + return artifactDAO; + } + + public void setArtifactDAO( ArtifactDAO artifactDAO ) + { + this.artifactDAO = artifactDAO; + } + + public int getNumberOfDaysBeforeNow() + { + return numberOfDaysBeforeNow; + } + + public void setNumberOfDaysBeforeNow( int numberOfDaysBeforeNow ) + { + this.numberOfDaysBeforeNow = numberOfDaysBeforeNow; + } + +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/processor/NewVersionsOfArtifactRssFeedProcessor.java b/MRM-541/archiva-modules/archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/processor/NewVersionsOfArtifactRssFeedProcessor.java new file mode 100644 index 000000000..78c21480c --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/processor/NewVersionsOfArtifactRssFeedProcessor.java @@ -0,0 +1,126 @@ +package org.apache.archiva.rss.processor; + +/* + * 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 java.util.Map; + +import org.apache.archiva.rss.RssFeedEntry; +import org.apache.archiva.rss.RssFeedGenerator; +import org.apache.maven.archiva.database.ArchivaDatabaseException; +import org.apache.maven.archiva.database.ArtifactDAO; +import org.apache.maven.archiva.database.Constraint; +import org.apache.maven.archiva.database.constraints.ArtifactVersionsConstraint; +import org.apache.maven.archiva.model.ArchivaArtifact; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.sun.syndication.feed.synd.SyndFeed; + +/** + * Retrieve and process new versions of an artifact from the database and + * generate a rss feed. The versions will be grouped by the date when the artifact + * was gathered. Each group will appear as one entry in the feed. + * + * @author Maria Odea Ching + * @version + * @plexus.component role="org.apache.archiva.rss.processor.RssFeedProcessor" role-hint="new-versions" + */ +public class NewVersionsOfArtifactRssFeedProcessor + extends AbstractArtifactsRssFeedProcessor +{ + private static final String title = "New Versions of Artifact "; + + private static final String desc = "These are the new versions of artifact "; + + /** + * @plexus.requirement + */ + private RssFeedGenerator generator; + + private Logger log = LoggerFactory.getLogger( NewVersionsOfArtifactRssFeedProcessor.class ); + + /** + * @plexus.requirement role-hint="jdo" + */ + private ArtifactDAO artifactDAO; + + /** + * Process all versions of the artifact which had a rss feed request. + */ + public SyndFeed process( Map reqParams ) throws ArchivaDatabaseException + { + String repoId = reqParams.get( RssFeedProcessor.KEY_REPO_ID ); + String groupId = reqParams.get( RssFeedProcessor.KEY_GROUP_ID ); + String artifactId = reqParams.get( RssFeedProcessor.KEY_ARTIFACT_ID ); + + if ( groupId != null && artifactId != null ) + { + return processNewVersionsOfArtifact( repoId, groupId, artifactId ); + } + + return null; + } + + private SyndFeed processNewVersionsOfArtifact( String repoId, String groupId, String artifactId ) + throws ArchivaDatabaseException + { + + Constraint artifactVersions = new ArtifactVersionsConstraint( repoId, groupId, artifactId, "whenGathered" ); + List artifacts = artifactDAO.queryArtifacts( artifactVersions ); + + List entries = processData( artifacts, false ); + String key = groupId + ":" + artifactId; + + return generator.generateFeed( getTitle() + "\'" + key + "\'", "New versions of artifact " + "\'" + key + + "\' found in repository " + "\'" + repoId + "\'" + " during repository scan.", entries ); + } + + public String getTitle() + { + return title; + } + + public String getDescription() + { + return desc; + } + + public RssFeedGenerator getGenerator() + { + return generator; + } + + public void setGenerator( RssFeedGenerator generator ) + { + this.generator = generator; + } + + public ArtifactDAO getArtifactDAO() + { + return artifactDAO; + } + + public void setArtifactDAO( ArtifactDAO artifactDAO ) + { + this.artifactDAO = artifactDAO; + } + +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/processor/RssFeedProcessor.java b/MRM-541/archiva-modules/archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/processor/RssFeedProcessor.java new file mode 100644 index 000000000..806fe3853 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/processor/RssFeedProcessor.java @@ -0,0 +1,43 @@ +package org.apache.archiva.rss.processor; + +/* + * 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.Map; + +import org.apache.maven.archiva.database.ArchivaDatabaseException; + +import com.sun.syndication.feed.synd.SyndFeed; + +/** + * Retrieve and process the data that will be fed into the RssFeedGenerator. + * + * @author Maria Odea Ching + * @version + */ +public interface RssFeedProcessor +{ + public static final String KEY_REPO_ID = "repoId"; + + public static final String KEY_GROUP_ID = "groupId"; + + public static final String KEY_ARTIFACT_ID = "artifactId"; + + SyndFeed process( Map reqParams ) throws ArchivaDatabaseException; +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-rss/src/test/java/org/apache/archiva/rss/RssFeedGeneratorTest.java b/MRM-541/archiva-modules/archiva-web/archiva-rss/src/test/java/org/apache/archiva/rss/RssFeedGeneratorTest.java new file mode 100644 index 000000000..356177ef8 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-rss/src/test/java/org/apache/archiva/rss/RssFeedGeneratorTest.java @@ -0,0 +1,161 @@ +package org.apache.archiva.rss; + +/* + * 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.Date; +import java.util.List; + +import org.codehaus.plexus.spring.PlexusInSpringTestCase; + +import com.sun.syndication.feed.synd.SyndEntry; +import com.sun.syndication.feed.synd.SyndFeed; + +/** + * @author Maria Odea Ching + * @version + */ +public class RssFeedGeneratorTest + extends PlexusInSpringTestCase +{ + private RssFeedGenerator generator; + + public void setUp() + throws Exception + { + super.setUp(); + + generator = (RssFeedGenerator) lookup( RssFeedGenerator.class ); + } + + public void testNewFeed() + throws Exception + { + List entries = new ArrayList(); + RssFeedEntry entry = new RssFeedEntry( "Item 1" ); + + Date whenGathered = new Date( System.currentTimeMillis() ); + + entry.setDescription( "RSS 2.0 feed item 1." ); + entry.setPublishedDate( whenGathered ); + entries.add( entry ); + + entry = new RssFeedEntry( "Item 2" ); + entry.setDescription( "RSS 2.0 feed item 2." ); + entry.setPublishedDate( whenGathered ); + entries.add( entry ); + + entry = new RssFeedEntry( "Item 3" ); + entry.setDescription( "RSS 2.0 feed item 3." ); + entry.setPublishedDate( whenGathered ); + entries.add( entry ); + + SyndFeed feed = + generator.generateFeed( "Test Feed", "The test feed from Archiva.", entries ); + + assertEquals( "Test Feed", feed.getTitle() ); + assertEquals( "The test feed from Archiva.", feed.getDescription() ); + assertEquals( "en-us", feed.getLanguage() ); + assertEquals( entries.get( 2 ).getPublishedDate(), feed.getPublishedDate() ); + + List syndEntries = feed.getEntries(); + assertEquals( 3, syndEntries.size() ); + assertEquals( "Item 1", syndEntries.get( 0 ).getTitle() ); + assertEquals( "Item 2", syndEntries.get( 1 ).getTitle() ); + assertEquals( "Item 3", syndEntries.get( 2 ).getTitle() ); + } + + public void testNoDataEntries() + throws Exception + { + List entries = new ArrayList(); + SyndFeed feed = + generator.generateFeed( "Test Feed", "The test feed from Archiva.", entries ); + + assertNull( feed ); + } + + /* + * this test might need to be removed since + * no updates are happening in the feeds anymore since everything's processed from the db. + * + public void testUpdateFeed() + throws Exception + { + generator.setRssDirectory( getBasedir() + "/target/test-classes/rss-feeds/" ); + + List entries = new ArrayList(); + RssFeedEntry entry = new RssFeedEntry( "Item 1" ); + + entry.setDescription( "RSS 2.0 feed item 1." ); + entries.add( entry ); + + entry = new RssFeedEntry( "Item 2" ); + entry.setDescription( "RSS 2.0 feed item 2." ); + entries.add( entry ); + + generator.generateFeed( "Test Feed", "The test feed from Archiva.", entries, + "generated-test-update-rss2.0-feed.xml" ); + + File outputFile = new File( getBasedir(), "/target/test-classes/rss-feeds/generated-test-update-rss2.0-feed.xml" ); + String generatedContent = FileUtils.readFileToString( outputFile ); + + XMLAssert.assertXpathEvaluatesTo( "Test Feed", "//channel/title", generatedContent ); + XMLAssert.assertXpathEvaluatesTo( "http://localhost:8080/archiva/rss/generated-test-update-rss2.0-feed.xml", "//channel/link", generatedContent ); + XMLAssert.assertXpathEvaluatesTo( "The test feed from Archiva.", "//channel/description", generatedContent ); + XMLAssert.assertXpathEvaluatesTo( "en-us", "//channel/language", generatedContent ); + + String expectedItem1 = + "Item 1Item 2"; + + XMLAssert.assertXpathsEqual( "//channel/item/title", expectedItem1, "//channel/item/title", generatedContent ); + + //update existing rss feed + entries = new ArrayList(); + entry = new RssFeedEntry( "Item 3" ); + + entry.setDescription( "RSS 2.0 feed item 3." ); + entries.add( entry ); + + entry = new RssFeedEntry( "Item 4" ); + entry.setDescription( "RSS 2.0 feed item 4." ); + entries.add( entry ); + + generator.generateFeed( "Test Feed", "The test feed from Archiva.", entries, + "generated-test-update-rss2.0-feed.xml" ); + + outputFile = new File( getBasedir(), "/target/test-classes/rss-feeds/generated-test-update-rss2.0-feed.xml" ); + generatedContent = FileUtils.readFileToString( outputFile ); + + XMLAssert.assertXpathEvaluatesTo( "Test Feed", "//channel/title", generatedContent ); + XMLAssert.assertXpathEvaluatesTo( "http://localhost:8080/archiva/rss/generated-test-update-rss2.0-feed.xml", "//channel/link", generatedContent ); + XMLAssert.assertXpathEvaluatesTo( "The test feed from Archiva.", "//channel/description", generatedContent ); + XMLAssert.assertXpathEvaluatesTo( "en-us", "//channel/language", generatedContent ); + + expectedItem1 = + "Item 1Item 2" + + "Item 3Item 4"; + XMLAssert.assertXpathsEqual( "//channel/item/title", expectedItem1, "//channel/item/title", generatedContent ); + + outputFile.deleteOnExit(); + } + */ + +} \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-rss/src/test/java/org/apache/archiva/rss/processor/NewArtifactsRssFeedProcessorTest.java b/MRM-541/archiva-modules/archiva-web/archiva-rss/src/test/java/org/apache/archiva/rss/processor/NewArtifactsRssFeedProcessorTest.java new file mode 100644 index 000000000..91bb1a19c --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-rss/src/test/java/org/apache/archiva/rss/processor/NewArtifactsRssFeedProcessorTest.java @@ -0,0 +1,128 @@ +package org.apache.archiva.rss.processor; + +/* + * 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.Calendar; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.archiva.rss.RssFeedGenerator; +import org.apache.archiva.rss.stubs.ArtifactDAOStub; +import org.apache.maven.archiva.model.ArchivaArtifact; +import org.codehaus.plexus.spring.PlexusInSpringTestCase; + +import com.sun.syndication.feed.synd.SyndEntry; +import com.sun.syndication.feed.synd.SyndFeed; + +/** + * @author Maria Odea Ching + * @version + */ +public class NewArtifactsRssFeedProcessorTest + extends PlexusInSpringTestCase +{ + private NewArtifactsRssFeedProcessor newArtifactsProcessor; + + private ArtifactDAOStub artifactDAOStub; + + private RssFeedGenerator rssFeedGenerator; + + public void setUp() + throws Exception + { + super.setUp(); + + newArtifactsProcessor = new NewArtifactsRssFeedProcessor(); + artifactDAOStub = new ArtifactDAOStub(); + + rssFeedGenerator = new RssFeedGenerator(); + + newArtifactsProcessor.setGenerator( rssFeedGenerator ); + newArtifactsProcessor.setArtifactDAO( artifactDAOStub ); + } + + public void testProcess() + throws Exception + { + List newArtifacts = new ArrayList(); + Date whenGathered = Calendar.getInstance().getTime(); + + ArchivaArtifact artifact = new ArchivaArtifact( "org.apache.archiva", "artifact-one", "1.0", "", "jar" ); + artifact.getModel().setRepositoryId( "test-repo" ); + artifact.getModel().setWhenGathered( whenGathered ); + newArtifacts.add( artifact ); + + artifact = new ArchivaArtifact( "org.apache.archiva", "artifact-one", "1.1", "", "jar" ); + artifact.getModel().setRepositoryId( "test-repo" ); + artifact.getModel().setWhenGathered( whenGathered ); + newArtifacts.add( artifact ); + + artifact = new ArchivaArtifact( "org.apache.archiva", "artifact-one", "2.0", "", "jar" ); + artifact.getModel().setRepositoryId( "test-repo" ); + artifact.getModel().setWhenGathered( whenGathered ); + newArtifacts.add( artifact ); + + artifact = new ArchivaArtifact( "org.apache.archiva", "artifact-two", "1.0.1", "", "jar" ); + artifact.getModel().setRepositoryId( "test-repo" ); + artifact.getModel().setWhenGathered( whenGathered ); + newArtifacts.add( artifact ); + + artifact = new ArchivaArtifact( "org.apache.archiva", "artifact-two", "1.0.2", "", "jar" ); + artifact.getModel().setRepositoryId( "test-repo" ); + artifact.getModel().setWhenGathered( whenGathered ); + newArtifacts.add( artifact ); + + artifact = new ArchivaArtifact( "org.apache.archiva", "artifact-two", "1.0.3-SNAPSHOT", "", "jar" ); + artifact.getModel().setRepositoryId( "test-repo" ); + artifact.getModel().setWhenGathered( whenGathered ); + newArtifacts.add( artifact ); + + artifact = new ArchivaArtifact( "org.apache.archiva", "artifact-three", "2.0-SNAPSHOT", "", "jar" ); + artifact.getModel().setRepositoryId( "test-repo" ); + artifact.getModel().setWhenGathered( whenGathered ); + newArtifacts.add( artifact ); + + artifact = new ArchivaArtifact( "org.apache.archiva", "artifact-four", "1.1-beta-2", "", "jar" ); + artifact.getModel().setRepositoryId( "test-repo" ); + artifact.getModel().setWhenGathered( whenGathered ); + newArtifacts.add( artifact ); + + artifactDAOStub.setArtifacts( newArtifacts ); + + Map reqParams = new HashMap(); + reqParams.put( RssFeedProcessor.KEY_REPO_ID, "test-repo" ); + + SyndFeed feed = newArtifactsProcessor.process( reqParams ); + + assertTrue( feed.getTitle().equals( "New Artifacts in Repository 'test-repo'" ) ); + assertTrue( feed.getDescription().equals( + "New artifacts found in repository 'test-repo' during repository scan." ) ); + assertTrue( feed.getLanguage().equals( "en-us" ) ); + assertTrue( feed.getPublishedDate().equals( whenGathered ) ); + + List entries = feed.getEntries(); + assertEquals( entries.size(), 1 ); + assertTrue( entries.get( 0 ).getTitle().equals( "New Artifacts in Repository 'test-repo' as of " + whenGathered ) ); + assertTrue( entries.get( 0 ).getPublishedDate().equals( whenGathered ) ); + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-rss/src/test/java/org/apache/archiva/rss/processor/NewVersionsOfArtifactRssFeedProcessorTest.java b/MRM-541/archiva-modules/archiva-web/archiva-rss/src/test/java/org/apache/archiva/rss/processor/NewVersionsOfArtifactRssFeedProcessorTest.java new file mode 100644 index 000000000..307380af4 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-rss/src/test/java/org/apache/archiva/rss/processor/NewVersionsOfArtifactRssFeedProcessorTest.java @@ -0,0 +1,115 @@ +package org.apache.archiva.rss.processor; + +/* + * 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.Calendar; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.archiva.rss.RssFeedGenerator; +import org.apache.archiva.rss.stubs.ArtifactDAOStub; +import org.apache.maven.archiva.model.ArchivaArtifact; +import org.codehaus.plexus.spring.PlexusInSpringTestCase; + +import com.sun.syndication.feed.synd.SyndEntry; +import com.sun.syndication.feed.synd.SyndFeed; + +public class NewVersionsOfArtifactRssFeedProcessorTest + extends PlexusInSpringTestCase +{ + private NewVersionsOfArtifactRssFeedProcessor newVersionsProcessor; + + private ArtifactDAOStub artifactDAOStub; + + private RssFeedGenerator rssFeedGenerator; + + public void setUp() + throws Exception + { + super.setUp(); + + newVersionsProcessor = new NewVersionsOfArtifactRssFeedProcessor(); + artifactDAOStub = new ArtifactDAOStub(); + + rssFeedGenerator = new RssFeedGenerator(); + + newVersionsProcessor.setGenerator( rssFeedGenerator ); + newVersionsProcessor.setArtifactDAO( artifactDAOStub ); + } + + public void testProcess() + throws Exception + { + List artifacts = new ArrayList(); + + Date whenGathered = Calendar.getInstance().getTime(); + whenGathered.setTime( 123456789 ); + + ArchivaArtifact artifact = new ArchivaArtifact( "org.apache.archiva", "artifact-two", "1.0.1", "", "jar" ); + artifact.getModel().setRepositoryId( "test-repo" ); + artifact.getModel().setWhenGathered( whenGathered ); + artifacts.add( artifact ); + + artifact = new ArchivaArtifact( "org.apache.archiva", "artifact-two", "1.0.2", "", "jar" ); + artifact.getModel().setRepositoryId( "test-repo" ); + artifact.getModel().setWhenGathered( whenGathered ); + artifacts.add( artifact ); + + Date whenGatheredNext = Calendar.getInstance().getTime(); + whenGatheredNext.setTime( 345678912 ); + + artifact = new ArchivaArtifact( "org.apache.archiva", "artifact-two", "1.0.3-SNAPSHOT", "", "jar" ); + artifact.getModel().setRepositoryId( "test-repo" ); + artifact.getModel().setWhenGathered( whenGatheredNext ); + artifacts.add( artifact ); + + artifactDAOStub.setArtifacts( artifacts ); + + Map reqParams = new HashMap(); + reqParams.put( RssFeedProcessor.KEY_REPO_ID, "test-repo" ); + reqParams.put( RssFeedProcessor.KEY_GROUP_ID, "org.apache.archiva" ); + reqParams.put( RssFeedProcessor.KEY_ARTIFACT_ID, "artifact-two" ); + + SyndFeed feed = newVersionsProcessor.process( reqParams ); + + assertEquals( "New Versions of Artifact 'org.apache.archiva:artifact-two'", feed.getTitle() ); + assertEquals( + "New versions of artifact 'org.apache.archiva:artifact-two' found in repository 'test-repo' during repository scan.", + feed.getDescription() ); + assertEquals( "en-us", feed.getLanguage() ); + assertEquals( artifacts.get( 2 ).getModel().getWhenGathered(), feed.getPublishedDate() ); + + List entries = feed.getEntries(); + + assertEquals( 2, entries.size() ); + + assertEquals( "New Versions of Artifact 'org.apache.archiva:artifact-two' as of " + whenGathered, + entries.get( 0 ).getTitle() ); + assertEquals( whenGathered, entries.get( 0 ).getPublishedDate() ); + + assertEquals( "New Versions of Artifact 'org.apache.archiva:artifact-two' as of " + whenGatheredNext, + entries.get( 1 ).getTitle() ); + assertEquals( whenGatheredNext, entries.get( 1 ).getPublishedDate() ); + } + +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-rss/src/test/java/org/apache/archiva/rss/stubs/ArtifactDAOStub.java b/MRM-541/archiva-modules/archiva-web/archiva-rss/src/test/java/org/apache/archiva/rss/stubs/ArtifactDAOStub.java new file mode 100644 index 000000000..6337c0b21 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-rss/src/test/java/org/apache/archiva/rss/stubs/ArtifactDAOStub.java @@ -0,0 +1,80 @@ +package org.apache.archiva.rss.stubs; + +/* + * 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.archiva.database.ArchivaDatabaseException; +import org.apache.maven.archiva.database.ArtifactDAO; +import org.apache.maven.archiva.database.Constraint; +import org.apache.maven.archiva.database.ObjectNotFoundException; +import org.apache.maven.archiva.model.ArchivaArtifact; + +/** + * ArtifactDAO stub. + * + * @author Maria Odea Ching + * @version * + */ +public class ArtifactDAOStub + implements ArtifactDAO +{ + private List artifacts; + + public ArchivaArtifact createArtifact( String groupId, String artifactId, String version, String classifier, + String type ) + { + // TODO Auto-generated method stub + return null; + } + + public void deleteArtifact( ArchivaArtifact artifact ) + throws ArchivaDatabaseException + { + // TODO Auto-generated method stub + + } + + public ArchivaArtifact getArtifact( String groupId, String artifactId, String version, String classifier, + String type ) + throws ObjectNotFoundException, ArchivaDatabaseException + { + // TODO Auto-generated method stub + return null; + } + + public List queryArtifacts( Constraint constraint ) + throws ObjectNotFoundException, ArchivaDatabaseException + { + return artifacts; + } + + public ArchivaArtifact saveArtifact( ArchivaArtifact artifact ) + throws ArchivaDatabaseException + { + // TODO Auto-generated method stub + return null; + } + + public void setArtifacts( List artifacts ) + { + this.artifacts = artifacts; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-security/pom.xml b/MRM-541/archiva-modules/archiva-web/archiva-security/pom.xml new file mode 100644 index 000000000..a5da9f400 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-security/pom.xml @@ -0,0 +1,79 @@ + + + + + + org.apache.archiva + archiva-web + 1.2-SNAPSHOT + + 4.0.0 + archiva-security + Archiva Web :: Security Configuration + + + org.apache.archiva + archiva-configuration + + + javax.servlet + servlet-api + provided + + + org.codehaus.plexus + plexus-spring + test + + + org.codehaus.plexus.redback + redback-system + + + org.codehaus.plexus.redback + redback-rbac-model + + + org.codehaus.plexus.redback + redback-rbac-role-manager + + + + org.codehaus.plexus.redback + redback-authorization-rbac + test + + + org.codehaus.plexus.redback + redback-keys-memory + test + + + org.codehaus.plexus.redback + redback-users-memory + test + + + org.codehaus.plexus.redback + redback-rbac-memory + test + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/maven/archiva/security/AccessDeniedException.java b/MRM-541/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/maven/archiva/security/AccessDeniedException.java new file mode 100644 index 000000000..2c3ea5e40 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/maven/archiva/security/AccessDeniedException.java @@ -0,0 +1,40 @@ +package org.apache.maven.archiva.security; + +/* + * 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. + */ + +/** + * AccessDeniedException + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class AccessDeniedException + extends ArchivaSecurityException +{ + public AccessDeniedException( String message, Throwable cause ) + { + super( message, cause ); + } + + public AccessDeniedException( String message ) + { + super( message ); + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/maven/archiva/security/ArchivaRoleConstants.java b/MRM-541/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/maven/archiva/security/ArchivaRoleConstants.java new file mode 100644 index 000000000..78745ec35 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/maven/archiva/security/ArchivaRoleConstants.java @@ -0,0 +1,86 @@ +package org.apache.maven.archiva.security; + +/* + * 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 ArchivaRoleConstants +{ + public static final String DELIMITER = " - "; + + // globalish roles + public static final String SYSTEM_ADMINISTRATOR_ROLE = "System Administrator"; + + public static final String USER_ADMINISTRATOR_ROLE = "User Administrator"; + + public static final String GLOBAL_REPOSITORY_MANAGER_ROLE = "Global Repository Manager"; + + public static final String GLOBAL_REPOSITORY_OBSERVER_ROLE = "Global Repository Observer"; + + public static final String REGISTERED_USER_ROLE = "Registered User"; + + public static final String GUEST_ROLE = "Guest"; + + // principals + + public static final String PRINCIPAL_GUEST = "guest"; + + // dynamic role prefixes + public static final String REPOSITORY_MANAGER_ROLE_PREFIX = "Repository Manager"; + + public static final String REPOSITORY_OBSERVER_ROLE_PREFIX = "Repository Observer"; + + // operations + public static final String OPERATION_MANAGE_USERS = "archiva-manage-users"; + + public static final String OPERATION_MANAGE_CONFIGURATION = "archiva-manage-configuration"; + + public static final String OPERATION_ACTIVE_GUEST = "archiva-guest"; + + public static final String OPERATION_RUN_INDEXER = "archiva-run-indexer"; + + public static final String OPERATION_REGENERATE_INDEX = "archiva-regenerate-index"; + + public static final String OPERATION_ACCESS_REPORT = "archiva-access-reports"; + + public static final String OPERATION_ADD_REPOSITORY = "archiva-add-repository"; + + public static final String OPERATION_REPOSITORY_ACCESS = "archiva-read-repository"; + + public static final String OPERATION_DELETE_REPOSITORY = "archiva-delete-repository"; + + public static final String OPERATION_EDIT_REPOSITORY = "archiva-edit-repository"; + + public static final String OPERATION_REPOSITORY_UPLOAD = "archiva-upload-repository"; + + // Role templates + public static final String TEMPLATE_REPOSITORY_MANAGER = "archiva-repository-manager"; + + public static final String TEMPLATE_REPOSITORY_OBSERVER = "archiva-repository-observer"; + + public static final String TEMPLATE_GLOBAL_REPOSITORY_OBSERVER = "archiva-global-repository-observer"; + + public static final String TEMPLATE_SYSTEM_ADMIN = "archiva-system-administrator"; + + public static final String TEMPLATE_GUEST = "archiva-guest"; + + public static String toRepositoryObserverRoleName( String repoId ) + { + return REPOSITORY_OBSERVER_ROLE_PREFIX + " - " + repoId; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/maven/archiva/security/ArchivaSecurityException.java b/MRM-541/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/maven/archiva/security/ArchivaSecurityException.java new file mode 100644 index 000000000..47973fc25 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/maven/archiva/security/ArchivaSecurityException.java @@ -0,0 +1,42 @@ +package org.apache.maven.archiva.security; + +/* + * 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.archiva.common.ArchivaException; + +/** + * ArchivaSecurityException + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ArchivaSecurityException + extends ArchivaException +{ + public ArchivaSecurityException( String message, Throwable cause ) + { + super( message, cause ); + } + + public ArchivaSecurityException( String message ) + { + super( message ); + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/maven/archiva/security/ArchivaServletAuthenticator.java b/MRM-541/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/maven/archiva/security/ArchivaServletAuthenticator.java new file mode 100644 index 000000000..4e8c040b7 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/maven/archiva/security/ArchivaServletAuthenticator.java @@ -0,0 +1,122 @@ +package org.apache.maven.archiva.security; + +/* + * 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 javax.servlet.http.HttpServletRequest; + +import org.apache.maven.archiva.security.ArchivaRoleConstants; +import org.codehaus.plexus.redback.authentication.AuthenticationException; +import org.codehaus.plexus.redback.authentication.AuthenticationResult; +import org.codehaus.plexus.redback.authorization.AuthorizationException; +import org.codehaus.plexus.redback.authorization.AuthorizationResult; +import org.codehaus.plexus.redback.authorization.UnauthorizedException; +import org.codehaus.plexus.redback.policy.AccountLockedException; +import org.codehaus.plexus.redback.policy.MustChangePasswordException; +import org.codehaus.plexus.redback.system.DefaultSecuritySession; +import org.codehaus.plexus.redback.system.SecuritySession; +import org.codehaus.plexus.redback.system.SecuritySystem; +import org.codehaus.plexus.redback.users.User; +import org.codehaus.plexus.redback.users.UserNotFoundException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * @version + * @plexus.component role="org.apache.maven.archiva.security.ServletAuthenticator" role-hint="default" + */ +public class ArchivaServletAuthenticator + implements ServletAuthenticator +{ + private Logger log = LoggerFactory.getLogger( ArchivaServletAuthenticator.class ); + + /** + * @plexus.requirement + */ + private SecuritySystem securitySystem; + + public boolean isAuthenticated( HttpServletRequest request, AuthenticationResult result ) + throws AuthenticationException, AccountLockedException, MustChangePasswordException + { + if ( result != null && !result.isAuthenticated() ) + { + throw new AuthenticationException( "User Credentials Invalid" ); + } + + return true; + } + + public boolean isAuthorized( HttpServletRequest request, SecuritySession securitySession, String repositoryId, + boolean isWriteRequest ) + throws AuthorizationException, UnauthorizedException + { + // TODO: also check for permission to proxy the resource when MRM-579 is implemented + + String permission = ArchivaRoleConstants.OPERATION_REPOSITORY_ACCESS; + + if ( isWriteRequest ) + { + permission = ArchivaRoleConstants.OPERATION_REPOSITORY_UPLOAD; + } + + AuthorizationResult authzResult = securitySystem.authorize( securitySession, permission, repositoryId ); + + if ( !authzResult.isAuthorized() ) + { + if ( authzResult.getException() != null ) + { + log.info( "Authorization Denied [ip=" + request.getRemoteAddr() + ",isWriteRequest=" + isWriteRequest + + ",permission=" + permission + ",repo=" + repositoryId + "] : " + + authzResult.getException().getMessage() ); + + throw new UnauthorizedException( "Access denied for repository " + repositoryId ); + } + throw new UnauthorizedException( "User account is locked" ); + } + + return true; + } + + public boolean isAuthorizedToAccessVirtualRepository( String principal, String repoId ) + throws UnauthorizedException + { + try + { + User user = securitySystem.getUserManager().findUser( principal ); + if ( user.isLocked() ) + { + throw new UnauthorizedException( "User account is locked." ); + } + + AuthenticationResult authn = new AuthenticationResult( true, principal, null ); + SecuritySession securitySession = new DefaultSecuritySession( authn, user ); + + return securitySystem.isAuthorized( securitySession, ArchivaRoleConstants.OPERATION_REPOSITORY_ACCESS, + repoId ); + } + catch ( UserNotFoundException e ) + { + throw new UnauthorizedException( e.getMessage() ); + } + catch ( AuthorizationException e ) + { + throw new UnauthorizedException( e.getMessage() ); + } + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/maven/archiva/security/ArchivaStandardRolesCheck.java b/MRM-541/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/maven/archiva/security/ArchivaStandardRolesCheck.java new file mode 100644 index 000000000..b513d6bee --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/maven/archiva/security/ArchivaStandardRolesCheck.java @@ -0,0 +1,105 @@ +package org.apache.maven.archiva.security; + +/* + * 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.codehaus.plexus.redback.rbac.RBACManager; +import org.codehaus.plexus.redback.system.check.EnvironmentCheck; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * ArchivaStandardRolesCheck tests for the existance of expected / standard roles and permissions. + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component role="org.codehaus.plexus.redback.system.check.EnvironmentCheck" + * role-hint="required-roles" + */ +public class ArchivaStandardRolesCheck + implements EnvironmentCheck +{ + private Logger log = LoggerFactory.getLogger( ArchivaStandardRolesCheck.class ); + + /** + * @plexus.requirement role-hint="cached" + */ + private RBACManager rbacManager; + + /** + * boolean detailing if this environment check has been executed + */ + private boolean checked = false; + + @SuppressWarnings("unchecked") + public void validateEnvironment( List violations ) + { + if ( !checked ) + { + String expectedRoles[] = new String[] { + ArchivaRoleConstants.SYSTEM_ADMINISTRATOR_ROLE, + ArchivaRoleConstants.GLOBAL_REPOSITORY_MANAGER_ROLE, + ArchivaRoleConstants.GLOBAL_REPOSITORY_OBSERVER_ROLE, + ArchivaRoleConstants.GUEST_ROLE, + ArchivaRoleConstants.REGISTERED_USER_ROLE, + ArchivaRoleConstants.USER_ADMINISTRATOR_ROLE }; + + log.info( "Checking the existance of required roles." ); + + for ( String roleName : expectedRoles ) + { + if ( !rbacManager.roleExists( roleName ) ) + { + violations.add( "Unable to validate the existances of the '" + roleName + "' role." ); + } + } + + String expectedOperations[] = new String[] { + ArchivaRoleConstants.OPERATION_MANAGE_USERS, + ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION, + ArchivaRoleConstants.OPERATION_REGENERATE_INDEX, + ArchivaRoleConstants.OPERATION_RUN_INDEXER, + ArchivaRoleConstants.OPERATION_ACCESS_REPORT, + ArchivaRoleConstants.OPERATION_ADD_REPOSITORY, + ArchivaRoleConstants.OPERATION_DELETE_REPOSITORY, + ArchivaRoleConstants.OPERATION_REPOSITORY_ACCESS, + ArchivaRoleConstants.OPERATION_EDIT_REPOSITORY, + ArchivaRoleConstants.OPERATION_REPOSITORY_UPLOAD, + ArchivaRoleConstants.OPERATION_REPOSITORY_ACCESS, + "archiva-guest" }; + + log.info( "Checking the existance of required operations." ); + + for ( String operation : expectedOperations ) + { + if ( !rbacManager.operationExists( operation ) ) + { + violations.add( "Unable to validate the existances of the '" + operation + "' operation." ); + } + } + + checked = true; + } + + } + +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/maven/archiva/security/ArchivaXworkUser.java b/MRM-541/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/maven/archiva/security/ArchivaXworkUser.java new file mode 100644 index 000000000..4189392e6 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/maven/archiva/security/ArchivaXworkUser.java @@ -0,0 +1,66 @@ +package org.apache.maven.archiva.security; + +/* + * 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.HashMap; +import java.util.Map; + +import org.apache.maven.archiva.security.ArchivaRoleConstants; +import org.codehaus.plexus.redback.system.SecuritySession; +import org.codehaus.plexus.redback.system.SecuritySystemConstants; +import org.codehaus.plexus.redback.users.User; + +/** + * ArchivaXworkUser + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ArchivaXworkUser +{ + public static String getActivePrincipal( Map sessionMap ) + { + if ( sessionMap == null ) + { + return ArchivaRoleConstants.PRINCIPAL_GUEST; + } + + SecuritySession securitySession = + (SecuritySession) sessionMap.get( SecuritySystemConstants.SECURITY_SESSION_KEY ); + + if ( securitySession == null ) + { + securitySession = (SecuritySession) sessionMap.get( SecuritySession.ROLE ); + } + + if ( securitySession == null ) + { + return ArchivaRoleConstants.PRINCIPAL_GUEST; + } + + User user = securitySession.getUser(); + if ( user == null ) + { + return ArchivaRoleConstants.PRINCIPAL_GUEST; + } + + return (String) user.getPrincipal(); + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/maven/archiva/security/DefaultUserRepositories.java b/MRM-541/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/maven/archiva/security/DefaultUserRepositories.java new file mode 100644 index 000000000..0d8c029bb --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/maven/archiva/security/DefaultUserRepositories.java @@ -0,0 +1,165 @@ +package org.apache.maven.archiva.security; + +/* + * 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.List; + +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.codehaus.plexus.redback.authentication.AuthenticationResult; +import org.codehaus.plexus.redback.authorization.AuthorizationException; +import org.codehaus.plexus.redback.rbac.RBACManager; +import org.codehaus.plexus.redback.role.RoleManager; +import org.codehaus.plexus.redback.role.RoleManagerException; +import org.codehaus.plexus.redback.system.DefaultSecuritySession; +import org.codehaus.plexus.redback.system.SecuritySession; +import org.codehaus.plexus.redback.system.SecuritySystem; +import org.codehaus.plexus.redback.users.User; +import org.codehaus.plexus.redback.users.UserNotFoundException; + +/** + * DefaultUserRepositories + * + * @author Joakim Erdfelt + * @version $Id$ + * @plexus.component role="org.apache.maven.archiva.security.UserRepositories" role-hint="default" + */ +public class DefaultUserRepositories + implements UserRepositories +{ + /** + * @plexus.requirement + */ + private SecuritySystem securitySystem; + + /** + * @plexus.requirement role-hint="cached" + */ + private RBACManager rbacManager; + + /** + * @plexus.requirement role-hint="default" + */ + private RoleManager roleManager; + + /** + * @plexus.requirement + */ + private ArchivaConfiguration archivaConfiguration; + + public List getObservableRepositoryIds( String principal ) + throws PrincipalNotFoundException, AccessDeniedException, ArchivaSecurityException + { + + try + { + User user = securitySystem.getUserManager().findUser( principal ); + + if ( user.isLocked() ) + { + throw new AccessDeniedException( "User " + principal + "(" + user.getFullName() + ") is locked." ); + } + + AuthenticationResult authn = new AuthenticationResult( true, principal, null ); + SecuritySession securitySession = new DefaultSecuritySession( authn, user ); + + List repoIds = new ArrayList(); + + List repos = + archivaConfiguration.getConfiguration().getManagedRepositories(); + + for ( ManagedRepositoryConfiguration repo : repos ) + { + try + { + String repoId = repo.getId(); + if ( securitySystem.isAuthorized( securitySession, + ArchivaRoleConstants.OPERATION_REPOSITORY_ACCESS, repoId ) ) + { + repoIds.add( repoId ); + } + } + catch ( AuthorizationException e ) + { + // swallow. + } + } + + return repoIds; + } + catch ( UserNotFoundException e ) + { + throw new PrincipalNotFoundException( "Unable to find principal " + principal + "" ); + } + } + + public void createMissingRepositoryRoles( String repoId ) + throws ArchivaSecurityException + { + try + { + if ( !roleManager.templatedRoleExists( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER, repoId ) ) + { + roleManager.createTemplatedRole( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER, repoId ); + } + + if ( !roleManager.templatedRoleExists( ArchivaRoleConstants.TEMPLATE_REPOSITORY_MANAGER, repoId ) ) + { + roleManager.createTemplatedRole( ArchivaRoleConstants.TEMPLATE_REPOSITORY_MANAGER, repoId ); + } + } + catch ( RoleManagerException e ) + { + throw new ArchivaSecurityException( + "Unable to create roles for configured repositories: " + e.getMessage(), + e ); + } + } + + public boolean isAuthorizedToUploadArtifacts( String principal, String repoId ) + throws PrincipalNotFoundException, ArchivaSecurityException + { + try + { + User user = securitySystem.getUserManager().findUser( principal ); + + if ( user.isLocked() ) + { + throw new AccessDeniedException( "User " + principal + "(" + user.getFullName() + ") is locked." ); + } + + AuthenticationResult authn = new AuthenticationResult( true, principal, null ); + SecuritySession securitySession = new DefaultSecuritySession( authn, user ); + + return securitySystem.isAuthorized( securitySession, ArchivaRoleConstants.OPERATION_REPOSITORY_UPLOAD, + repoId ); + + } + catch ( UserNotFoundException e ) + { + throw new PrincipalNotFoundException( "Unable to find principal " + principal + "" ); + } + catch ( AuthorizationException e ) + { + throw new ArchivaSecurityException( e.getMessage() ); + } + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/maven/archiva/security/PrincipalNotFoundException.java b/MRM-541/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/maven/archiva/security/PrincipalNotFoundException.java new file mode 100644 index 000000000..196204436 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/maven/archiva/security/PrincipalNotFoundException.java @@ -0,0 +1,40 @@ +package org.apache.maven.archiva.security; + +/* + * 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. + */ + +/** + * PrincipalNotFoundException + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class PrincipalNotFoundException + extends ArchivaSecurityException +{ + public PrincipalNotFoundException( String message, Throwable cause ) + { + super( message, cause ); + } + + public PrincipalNotFoundException( String message ) + { + super( message ); + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/maven/archiva/security/SecurityStartup.java b/MRM-541/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/maven/archiva/security/SecurityStartup.java new file mode 100644 index 000000000..ed854668d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/maven/archiva/security/SecurityStartup.java @@ -0,0 +1,208 @@ +package org.apache.maven.archiva.security; + +/* + * 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.List; +import java.util.Map; +import java.util.Map.Entry; + +import org.apache.commons.collections.CollectionUtils; +import org.apache.maven.archiva.common.ArchivaException; +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.ConfigurationNames; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.codehaus.plexus.redback.rbac.RBACManager; +import org.codehaus.plexus.redback.rbac.RbacManagerException; +import org.codehaus.plexus.redback.rbac.UserAssignment; +import org.codehaus.plexus.redback.system.check.EnvironmentCheck; +import org.codehaus.plexus.registry.Registry; +import org.codehaus.plexus.registry.RegistryListener; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * SecurityStartup + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component role="org.apache.maven.archiva.security.SecurityStartup" + */ +public class SecurityStartup + implements RegistryListener +{ + private Logger log = LoggerFactory.getLogger( SecurityStartup.class ); + + /** + * @plexus.requirement + */ + private UserRepositories userRepos; + + /** + * @plexus.requirement role-hint="cached" + */ + private RBACManager rbacManager; + + /** + * @plexus.requirement role="org.codehaus.plexus.redback.system.check.EnvironmentCheck" + */ + private Map checkers; + + /** + * @plexus.requirement + */ + private ArchivaConfiguration archivaConfiguration; + + public void afterConfigurationChange( Registry registry, String propertyName, Object propertyValue ) + { + if ( ConfigurationNames.isManagedRepositories( propertyName ) ) + { + createMissingManagedRepositoryRoles( archivaConfiguration.getConfiguration().getManagedRepositories() ); + } + } + + public void assignRepositoryObserverToGuestUser( List repos ) + { + for ( ManagedRepositoryConfiguration repoConfig : repos ) + { + String repoId = repoConfig.getId(); + + // TODO: Use the Redback / UserConfiguration..getString( "redback.default.guest" ) to get the right name. + String principal = "guest"; + + try + { + UserAssignment ua; + + if ( rbacManager.userAssignmentExists( principal ) ) + { + ua = rbacManager.getUserAssignment( principal ); + } + else + { + ua = rbacManager.createUserAssignment( principal ); + } + + ua.addRoleName( ArchivaRoleConstants.toRepositoryObserverRoleName( repoId ) ); + rbacManager.saveUserAssignment( ua ); + } + catch ( RbacManagerException e ) + { + log.warn( + "Unable to add role [" + ArchivaRoleConstants.toRepositoryObserverRoleName( repoId ) + + "] to " + principal + " user.", e ); + } + } + } + + public void beforeConfigurationChange( Registry registry, String propertyName, Object propertyValue ) + { + /* do nothing */ + } + + public void createMissingManagedRepositoryRoles( List repos ) + { + // NOTE: Remote Repositories do not have roles or security placed around them. + + for ( ManagedRepositoryConfiguration repoConfig : repos ) + { + // manage roles for repositories + try + { + userRepos.createMissingRepositoryRoles( repoConfig.getId() ); + } + catch ( ArchivaSecurityException e ) + { + log.warn( e.getMessage(), e ); + } + } + } + + public void createMissingRepositoryRoles( List repoIds ) + { + for ( String repoId : repoIds ) + { + // manage roles for repositories + try + { + userRepos.createMissingRepositoryRoles( repoId ); + } + catch ( ArchivaSecurityException e ) + { + log.warn( e.getMessage(), e ); + } + } + } + + public void executeEnvironmentChecks() + throws ArchivaException + { + if ( ( checkers == null ) || CollectionUtils.isEmpty( checkers.values() ) ) + { + throw new ArchivaException( "Unable to initialize the Redback Security Environment, " + + "no Environment Check components found." ); + } + + List violations = new ArrayList(); + + for ( Entry entry : checkers.entrySet() ) + { + EnvironmentCheck check = entry.getValue(); + log.info( "Running Environment Check: " + entry.getKey() ); + check.validateEnvironment( violations ); + } + + if ( CollectionUtils.isNotEmpty( violations ) ) + { + StringBuffer msg = new StringBuffer(); + msg.append( "EnvironmentCheck Failure.\n" ); + msg.append( "======================================================================\n" ); + msg.append( " ENVIRONMENT FAILURE !! \n" ); + msg.append( "\n" ); + + for ( String violation : violations ) + { + msg.append( violation ).append( "\n" ); + } + + msg.append( "\n" ); + msg.append( "======================================================================" ); + log.error( msg.toString() ); + + throw new ArchivaException( "Unable to initialize Redback Security Environment, [" + violations.size() + + "] violation(s) encountered, See log for details." ); + } + } + + public void startup() + throws ArchivaException + { + executeEnvironmentChecks(); + + createMissingManagedRepositoryRoles( archivaConfiguration.getConfiguration().getManagedRepositories() ); + archivaConfiguration.addChangeListener( this ); + + if ( archivaConfiguration.isDefaulted() ) + { + assignRepositoryObserverToGuestUser( archivaConfiguration.getConfiguration().getManagedRepositories() ); + } + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/maven/archiva/security/ServletAuthenticator.java b/MRM-541/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/maven/archiva/security/ServletAuthenticator.java new file mode 100644 index 000000000..fb39b4bca --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/maven/archiva/security/ServletAuthenticator.java @@ -0,0 +1,46 @@ +package org.apache.maven.archiva.security; + +/* + * 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 javax.servlet.http.HttpServletRequest; + +import org.codehaus.plexus.redback.authentication.AuthenticationException; +import org.codehaus.plexus.redback.authentication.AuthenticationResult; +import org.codehaus.plexus.redback.authorization.AuthorizationException; +import org.codehaus.plexus.redback.authorization.UnauthorizedException; +import org.codehaus.plexus.redback.policy.AccountLockedException; +import org.codehaus.plexus.redback.policy.MustChangePasswordException; +import org.codehaus.plexus.redback.system.SecuritySession; + +/** + * @author Maria Odea Ching + * @version + */ +public interface ServletAuthenticator +{ + public boolean isAuthenticated( HttpServletRequest request, AuthenticationResult result ) + throws AuthenticationException, AccountLockedException, MustChangePasswordException; + + public boolean isAuthorized( HttpServletRequest request, SecuritySession securitySession, String repositoryId, + boolean isWriteRequest ) throws AuthorizationException, UnauthorizedException; + + public boolean isAuthorizedToAccessVirtualRepository( String principal, String repoId ) + throws UnauthorizedException; +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/maven/archiva/security/UserRepositories.java b/MRM-541/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/maven/archiva/security/UserRepositories.java new file mode 100644 index 000000000..4ea6c7f2d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/maven/archiva/security/UserRepositories.java @@ -0,0 +1,65 @@ +package org.apache.maven.archiva.security; + +/* + * 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; + +/** + * UserRepositories + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public interface UserRepositories +{ + /** + * Get the list of observable repository ids for the user specified. + * + * @param principal the principle to obtain the observable repository ids from. + * @return the list of observable repository ids. + * @throws PrincipalNotFoundException + * @throws AccessDeniedException + * @throws ArchivaSecurityException + */ + public List getObservableRepositoryIds( String principal ) + throws PrincipalNotFoundException, AccessDeniedException, ArchivaSecurityException; + + /** + * Create any missing repository roles for the provided repository id. + * + * @param repoId the repository id to work off of. + * @throws ArchivaSecurityException if there was a problem creating the repository roles. + */ + public void createMissingRepositoryRoles( String repoId ) + throws ArchivaSecurityException; + + /** + * Check if user is authorized to upload artifacts in the repository. + * + * @param principal + * @param repoId + * @return + * @throws PrincipalNotFoundException + * @throws ArchivaSecurityException + */ + public boolean isAuthorizedToUploadArtifacts( String principal, String repoId) + throws PrincipalNotFoundException, ArchivaSecurityException; + +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-security/src/main/resources/META-INF/redback/redback.xml b/MRM-541/archiva-modules/archiva-web/archiva-security/src/main/resources/META-INF/redback/redback.xml new file mode 100644 index 000000000..4a12cb481 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-security/src/main/resources/META-INF/redback/redback.xml @@ -0,0 +1,228 @@ + + 1.0.0 + + + Archiva + 1.0 + + + archiva-manage-users + archiva-manage-users + Manage Archiva Users + + + archiva-manage-configuration + archiva-manage-configuration + Manage Archiva Configuration + + + archiva-regenerate-index + archiva-regenerate-index + Regenerate Archiva Index + + + archiva-run-indexer + archiva-run-indexer + Run Archiva Indexer + + + archiva-access-reports + archiva-access-reports + Access Archiva Reports + + + archiva-add-repository + archiva-add-repository + Add Archiva Repository + + + archiva-delete-repository + archiva-delete-repository + Delete Archiva Repository + + + archiva-read-repository + archiva-read-repository + Read Archiva Repository + + + archiva-edit-repository + archiva-edit-repository + Edit Archiva Repository + + + archiva-upload-repository + archiva-upload-repository + Upload Archiva Repository + + + archiva-access-repository + archiva-access-repository + Access Archiva Repository + + + archiva-guest + archiva-guest + Active Archiva Guest + + + + + archiva-system-administrator + Archiva System Administrator + true + false + + + archiva-manage-configuration + archiva-manage-configuration + archiva-manage-configuration + global + true + + + archiva-manage-users + archiva-manage-users + archiva-manage-users + global + true + + + archiva-run-indexer + archiva-run-indexer + archiva-run-indexer + global + true + + + archiva-regenerate-index + archiva-regenerate-index + archiva-regenerate-index + global + true + + + archiva-access-reports + archiva-access-reports + archiva-access-reports + global + true + + + + archiva-global-repository-manager + + + system-administrator + + + + archiva-user-administrator + Archiva User Administrator + true + false + + + archiva-guest + Archiva Guest Permission + archiva-guest + global + true + + + + user-administrator + + + + archiva-guest + Archiva Guest + true + false + + + archiva-guest + Archiva Guest Permission + archiva-guest + global + true + + + + guest + + + + archiva-global-repository-manager + Global Repository Manager + true + true + + + archiva-add-repository + Archiva Add Repository + archiva-add-repository + global + true + + + + + archiva-global-repository-observer + Global Repository Observer + true + true + + + + + + + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-security/src/test/java/org/apache/maven/archiva/security/DefaultUserRepositoriesTest.java b/MRM-541/archiva-modules/archiva-web/archiva-security/src/test/java/org/apache/maven/archiva/security/DefaultUserRepositoriesTest.java new file mode 100644 index 000000000..ceb0a357c --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-security/src/test/java/org/apache/maven/archiva/security/DefaultUserRepositoriesTest.java @@ -0,0 +1,175 @@ +package org.apache.maven.archiva.security; + +/* + * 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; +import java.util.List; + +import org.apache.commons.io.FileUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.codehaus.plexus.spring.PlexusInSpringTestCase; +import org.codehaus.plexus.redback.rbac.RBACManager; +import org.codehaus.plexus.redback.role.RoleManager; +import org.codehaus.plexus.redback.system.SecuritySystem; +import org.codehaus.plexus.redback.users.User; +import org.codehaus.plexus.redback.users.UserManager; + +/** + * DefaultUserRepositoriesTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class DefaultUserRepositoriesTest + extends PlexusInSpringTestCase +{ + private static final String USER_GUEST = "guest"; + + private static final String USER_ADMIN = "admin"; + + private static final String USER_ALPACA = "alpaca"; + + private SecuritySystem securitySystem; + + private RBACManager rbacManager; + + private RoleManager roleManager; + + private ArchivaConfiguration archivaConfiguration; + + private UserRepositories userRepos; + + public void testGetObservableRepositoryIds() + throws Exception + { + // create some users. + createUser( USER_ALPACA, "Al 'Archiva' Paca" ); + + assertEquals( "Expected users", 3, securitySystem.getUserManager().getUsers().size() ); + + // some unassigned repo observer roles. + setupRepository( "central" ); + setupRepository( "corporate" ); + setupRepository( "internal" ); + setupRepository( "snapshots" ); + setupRepository( "secret" ); + + // some assigned repo observer roles. + assignRepositoryObserverRole( USER_ALPACA, "corporate" ); + assignRepositoryObserverRole( USER_ALPACA, "central" ); + assignRepositoryObserverRole( USER_GUEST, "corporate" ); + // the global repo observer role. + assignGlobalRepositoryObserverRole( USER_ADMIN ); + + assertRepoIds( new String[] { "central", "corporate" }, userRepos.getObservableRepositoryIds( USER_ALPACA ) ); + assertRepoIds( new String[] { "coporate" }, userRepos.getObservableRepositoryIds( USER_GUEST ) ); + assertRepoIds( new String[] { "central", "internal", "corporate", "snapshots", "secret" }, userRepos + .getObservableRepositoryIds( USER_ADMIN ) ); + } + + private void assertRepoIds( String[] expectedRepoIds, List observableRepositoryIds ) + { + assertNotNull( "Observable Repository Ids cannot be null.", observableRepositoryIds ); + + if ( expectedRepoIds.length != observableRepositoryIds.size() ) + { + fail( "Size of Observable Repository Ids wrong, expected <" + expectedRepoIds.length + "> but got <" + + observableRepositoryIds.size() + "> instead. \nExpected: [" + StringUtils.join( expectedRepoIds, "," ) + + "]\nActual: [" + StringUtils.join( observableRepositoryIds.iterator(), "," ) + "]" ); + } + } + + private void setupRepository( String repoId ) + throws Exception + { + // Add repo to configuration. + ManagedRepositoryConfiguration repoConfig = new ManagedRepositoryConfiguration(); + repoConfig.setId( repoId ); + repoConfig.setName( "Testable repo <" + repoId + ">" ); + repoConfig.setLocation( getTestPath( "target/test-repo/" + repoId ) ); + archivaConfiguration.getConfiguration().addManagedRepository( repoConfig ); + + // Add repo roles to security. + userRepos.createMissingRepositoryRoles( repoId ); + } + + private void assignGlobalRepositoryObserverRole( String principal ) + throws Exception + { + roleManager.assignRole( ArchivaRoleConstants.TEMPLATE_GLOBAL_REPOSITORY_OBSERVER, principal ); + } + + private void assignRepositoryObserverRole( String principal, String repoId ) + throws Exception + { + roleManager.assignTemplatedRole( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER, repoId, principal ); + } + + private User createUser( String principal, String fullname ) + { + UserManager userManager = securitySystem.getUserManager(); + + User user = userManager.createUser( principal, fullname, principal + "@testable.archiva.apache.org" ); + securitySystem.getPolicy().setEnabled( false ); + userManager.addUser( user ); + securitySystem.getPolicy().setEnabled( true ); + + return user; + } + + @Override + protected void setUp() + throws Exception + { + super.setUp(); + + File srcConfig = getTestFile( "src/test/resources/repository-archiva.xml" ); + File destConfig = getTestFile( "target/test-conf/archiva.xml" ); + + destConfig.getParentFile().mkdirs(); + destConfig.delete(); + + FileUtils.copyFile( srcConfig, destConfig ); + + securitySystem = (SecuritySystem) lookup( SecuritySystem.class, "testable" ); + rbacManager = (RBACManager) lookup( RBACManager.class, "memory" ); + roleManager = (RoleManager) lookup( RoleManager.class, "default" ); + userRepos = (UserRepositories) lookup( UserRepositories.class, "default" ); + archivaConfiguration = (ArchivaConfiguration) lookup( ArchivaConfiguration.class ); + + // Some basic asserts. + assertNotNull( securitySystem ); + assertNotNull( rbacManager ); + assertNotNull( roleManager ); + assertNotNull( userRepos ); + assertNotNull( archivaConfiguration ); + + // Setup Admin User. + User adminUser = createUser( USER_ADMIN, "Admin User" ); + roleManager.assignRole( ArchivaRoleConstants.TEMPLATE_SYSTEM_ADMIN, adminUser.getPrincipal().toString() ); + + // Setup Guest User. + User guestUser = createUser( USER_GUEST, "Guest User" ); + roleManager.assignRole( ArchivaRoleConstants.TEMPLATE_GUEST, guestUser.getPrincipal().toString() ); + + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-security/src/test/java/org/apache/maven/archiva/security/RoleManagerTest.java b/MRM-541/archiva-modules/archiva-web/archiva-security/src/test/java/org/apache/maven/archiva/security/RoleManagerTest.java new file mode 100644 index 000000000..f2a4474c4 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-security/src/test/java/org/apache/maven/archiva/security/RoleManagerTest.java @@ -0,0 +1,58 @@ +package org.apache.maven.archiva.security; + +/* + * 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.codehaus.plexus.spring.PlexusInSpringTestCase; +import org.codehaus.plexus.redback.role.RoleManager; + +/** + * RoleProfilesTest + * + * @author Joakim Erdfelt + * @version $Id: RoleManagerTest.java 4330 2007-05-10 17:28:56Z jmcconnell $ + */ +public class RoleManagerTest + extends PlexusInSpringTestCase +{ + /** + * @plexus.requirement role-hint="default" + */ + RoleManager roleManager; + + protected void setUp() + throws Exception + { + super.setUp(); + + roleManager = (RoleManager) lookup( RoleManager.ROLE, "default" ); + } + + public void testExpectedRoles() + throws Exception + { + assertNotNull( roleManager ); + + assertTrue( roleManager.roleExists( "system-administrator" ) ); + assertTrue( roleManager.roleExists( "user-administrator" ) ); + assertTrue( roleManager.roleExists( "archiva-global-repository-observer" ) ); + assertTrue( roleManager.roleExists( "archiva-guest" ) ); + assertTrue( roleManager.roleExists( "guest" ) ); + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-security/src/test/java/org/apache/maven/archiva/security/SecurityStartupTest.java b/MRM-541/archiva-modules/archiva-web/archiva-security/src/test/java/org/apache/maven/archiva/security/SecurityStartupTest.java new file mode 100644 index 000000000..7096133cc --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-security/src/test/java/org/apache/maven/archiva/security/SecurityStartupTest.java @@ -0,0 +1,49 @@ +package org.apache.maven.archiva.security; + +/* + * 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.codehaus.plexus.spring.PlexusInSpringTestCase; + +/** + * SecurityStartupTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class SecurityStartupTest + extends PlexusInSpringTestCase +{ + private SecurityStartup secStart; + + @Override + protected void setUp() + throws Exception + { + super.setUp(); + + secStart = (SecurityStartup) lookup( SecurityStartup.class ); + } + + public void testEnvironmentChecks() + throws Exception + { + secStart.executeEnvironmentChecks(); + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-security/src/test/resources/META-INF/redback/redback-core.xml b/MRM-541/archiva-modules/archiva-web/archiva-security/src/test/resources/META-INF/redback/redback-core.xml new file mode 100644 index 000000000..6e6457b80 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-security/src/test/resources/META-INF/redback/redback-core.xml @@ -0,0 +1,204 @@ + + 1.0.0 + + + Redback XWork Integration Security Core + 1.0 + + + global + * + true + + global resource implies full access for authorization + + + + username + ${username} + true + + replaced with the username of the principal at authorization + check time + + + + + + configuration-edit + configuration-edit + edit configuration + true + + + user-management-user-create + user-management-user-create + create user + true + + + user-management-user-edit + user-management-user-edit + edit user + true + + + user-management-user-role + user-management-user-role + user roles + true + + + user-management-user-delete + user-management-user-delete + delete user + true + + + user-management-user-list + user-management-user-list + list users + true + + + user-management-role-grant + user-management-role-grant + grant role + true + + + user-management-role-drop + user-management-role-drop + drop role + true + + + user-management-rbac-admin + user-management-rbac-admin + administer rbac + true + + + guest-access + guest-access + access guest + true + + + + + system-administrator + System Administrator + true + true + + + edit-redback-configuration + Edit Redback Configuration + configuration-edit + global + true + + + manage-rbac-setup + User RBAC Management + user-management-rbac-admin + global + true + + + + user-administrator + + + + user-administrator + User Administrator + true + true + + + drop-roles-for-anyone + Drop Roles for Anyone + user-management-role-drop + global + true + + + grant-roles-for-anyone + Grant Roles for Anyone + user-management-role-grant + global + true + + + user-create + Create Users + user-management-user-create + global + true + + + user-delete + Delete Users + user-management-user-delete + global + true + + + user-edit + Edit Users + user-management-user-edit + global + true + + + access-users-roles + Access Users Roles + user-management-user-role + global + true + + + access-user-list + Access User List + user-management-user-list + global + true + + + + + registered-user + Registered User + true + true + + + edit-user-by-username + Edit User Data by Username + user-management-user-edit + username + true + + + + + guest + Guest + true + true + + + guest-permission + Guest Permission + guest-access + global + true + + + + + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-security/src/test/resources/log4j.properties b/MRM-541/archiva-modules/archiva-web/archiva-security/src/test/resources/log4j.properties new file mode 100644 index 000000000..6d107570b --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-security/src/test/resources/log4j.properties @@ -0,0 +1,10 @@ +# Set root logger level to DEBUG and its only appender to A1. +log4j.rootLogger=INFO, A1 + +# A1 is set to be a ConsoleAppender. +log4j.appender.A1=org.apache.log4j.ConsoleAppender + +# A1 uses PatternLayout. +log4j.appender.A1.layout=org.apache.log4j.PatternLayout +log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-security/src/test/resources/org/apache/maven/archiva/security/DefaultUserRepositoriesTest.xml b/MRM-541/archiva-modules/archiva-web/archiva-security/src/test/resources/org/apache/maven/archiva/security/DefaultUserRepositoriesTest.xml new file mode 100644 index 000000000..8d43cac8d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-security/src/test/resources/org/apache/maven/archiva/security/DefaultUserRepositoriesTest.xml @@ -0,0 +1,188 @@ + + + + + + org.apache.maven.archiva.security.UserRepositories + default + org.apache.maven.archiva.security.DefaultUserRepositories + DefaultUserRepositories + + + org.codehaus.plexus.redback.system.SecuritySystem + testable + securitySystem + + + org.codehaus.plexus.redback.rbac.RBACManager + memory + rbacManager + + + org.codehaus.plexus.redback.role.RoleManager + default + roleManager + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + archivaConfiguration + + + + + + org.codehaus.plexus.redback.system.SecuritySystem + testable + org.codehaus.plexus.redback.system.DefaultSecuritySystem + DefaultSecuritySystem: + + + org.codehaus.plexus.redback.authentication.AuthenticationManager + authnManager + + + org.codehaus.plexus.redback.authorization.Authorizer + rbac + authorizer + + + org.codehaus.plexus.redback.users.UserManager + memory + userManager + + + org.codehaus.plexus.redback.keys.KeyManager + memory + keyManager + + + org.codehaus.plexus.redback.policy.UserSecurityPolicy + policy + + + + + + org.codehaus.plexus.redback.authorization.Authorizer + rbac + org.codehaus.plexus.redback.authorization.rbac.RbacAuthorizer + RbacAuthorizer: + + + org.codehaus.plexus.redback.rbac.RBACManager + memory + manager + + + org.codehaus.plexus.redback.users.UserManager + memory + userManager + + + org.codehaus.plexus.redback.authorization.rbac.evaluator.PermissionEvaluator + default + evaluator + + + org.codehaus.plexus.redback.configuration.UserConfiguration + default + config + + + + + + org.codehaus.plexus.redback.authorization.rbac.evaluator.PermissionEvaluator + default + org.codehaus.plexus.redback.authorization.rbac.evaluator.DefaultPermissionEvaluator + + + org.codehaus.plexus.redback.users.UserManager + memory + userManager + + + + + + org.codehaus.plexus.redback.role.RoleManager + default + org.codehaus.plexus.redback.role.DefaultRoleManager + RoleProfileManager: + + + org.codehaus.plexus.redback.role.validator.RoleModelValidator + default + modelValidator + + + org.codehaus.plexus.redback.role.processor.RoleModelProcessor + default + modelProcessor + + + org.codehaus.plexus.redback.role.template.RoleTemplateProcessor + default + templateProcessor + + + org.codehaus.plexus.redback.rbac.RBACManager + memory + rbacManager + + + + + + org.codehaus.plexus.redback.role.processor.RoleModelProcessor + default + org.codehaus.plexus.redback.role.processor.DefaultRoleModelProcessor + DefaultRoleModelProcessor: inserts the components of the model that can be populated into the rbac manager + + + org.codehaus.plexus.redback.rbac.RBACManager + memory + rbacManager + + + + + + org.codehaus.plexus.redback.role.template.RoleTemplateProcessor + default + org.codehaus.plexus.redback.role.template.DefaultRoleTemplateProcessor + DefaultRoleTemplateProcessor: inserts the components of a template into the rbac manager + + + org.codehaus.plexus.redback.rbac.RBACManager + memory + rbacManager + + + + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + org.apache.maven.archiva.configuration.DefaultArchivaConfiguration + + + org.codehaus.plexus.registry.Registry + configured + + + + + org.codehaus.plexus.registry.Registry + configured + org.codehaus.plexus.registry.commons.CommonsConfigurationRegistry + + + + + + + + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-security/src/test/resources/org/apache/maven/archiva/security/RoleManagerTest.xml b/MRM-541/archiva-modules/archiva-web/archiva-security/src/test/resources/org/apache/maven/archiva/security/RoleManagerTest.xml new file mode 100644 index 000000000..f32a77d10 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-security/src/test/resources/org/apache/maven/archiva/security/RoleManagerTest.xml @@ -0,0 +1,100 @@ + + + + + org.codehaus.plexus.redback.role.RoleManager + default + org.codehaus.plexus.redback.role.DefaultRoleManager + RoleProfileManager: + + + org.codehaus.plexus.redback.role.validator.RoleModelValidator + default + modelValidator + + + org.codehaus.plexus.redback.role.processor.RoleModelProcessor + default + modelProcessor + + + org.codehaus.plexus.redback.role.template.RoleTemplateProcessor + default + templateProcessor + + + org.codehaus.plexus.redback.rbac.RBACManager + memory + rbacManager + + + + + org.codehaus.plexus.redback.role.processor.RoleModelProcessor + default + org.codehaus.plexus.redback.role.processor.DefaultRoleModelProcessor + DefaultRoleModelProcessor: inserts the components of the model that can be populated into the rbac manager + + + org.codehaus.plexus.redback.rbac.RBACManager + memory + rbacManager + + + + + + org.codehaus.plexus.redback.role.template.RoleTemplateProcessor + default + org.codehaus.plexus.redback.role.template.DefaultRoleTemplateProcessor + DefaultRoleTemplateProcessor: inserts the components of a template into the rbac manager + + + org.codehaus.plexus.redback.rbac.RBACManager + memory + rbacManager + + + + + org.codehaus.plexus.redback.system.check.EnvironmentCheck + required-roles + org.apache.maven.archiva.security.ArchivaStandardRolesCheck + ArchivaStandardRolesCheck tests for the existance of expected / standard roles and permissions. + + + org.codehaus.plexus.redback.rbac.RBACManager + memory + rbacManager + + + + + + org.apache.maven.archiva.security.SecurityStartup + org.apache.maven.archiva.security.SecurityStartup + SecurityStartup + + + org.codehaus.plexus.redback.role.RoleManager + default + roleManager + + + org.codehaus.plexus.redback.rbac.RBACManager + memory + rbacManager + + + org.codehaus.plexus.redback.system.check.EnvironmentCheck + checkers + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + archivaConfiguration + + + + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-security/src/test/resources/org/apache/maven/archiva/security/SecurityStartupTest.xml b/MRM-541/archiva-modules/archiva-web/archiva-security/src/test/resources/org/apache/maven/archiva/security/SecurityStartupTest.xml new file mode 100644 index 000000000..0ff02e859 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-security/src/test/resources/org/apache/maven/archiva/security/SecurityStartupTest.xml @@ -0,0 +1,205 @@ + + + + + + org.codehaus.plexus.redback.system.check.EnvironmentCheck + required-roles + org.apache.maven.archiva.security.ArchivaStandardRolesCheck + ArchivaStandardRolesCheck tests for the existance of expected / standard roles and permissions. + + + org.codehaus.plexus.redback.rbac.RBACManager + memory + rbacManager + + + + + + org.apache.maven.archiva.security.SecurityStartup + org.apache.maven.archiva.security.SecurityStartup + SecurityStartup + + + org.apache.maven.archiva.security.UserRepositories + userRepos + + + org.codehaus.plexus.redback.rbac.RBACManager + memory + rbacManager + + + org.codehaus.plexus.redback.system.check.EnvironmentCheck + checkers + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + archivaConfiguration + + + + + + org.apache.maven.archiva.security.UserRepositories + default + org.apache.maven.archiva.security.DefaultUserRepositories + DefaultUserRepositories + + + org.codehaus.plexus.redback.system.SecuritySystem + testable + securitySystem + + + org.codehaus.plexus.redback.rbac.RBACManager + memory + rbacManager + + + org.codehaus.plexus.redback.role.RoleManager + default + roleManager + + + + + + org.codehaus.plexus.redback.role.template.RoleTemplateProcessor + default + org.codehaus.plexus.redback.role.template.DefaultRoleTemplateProcessor + DefaultRoleTemplateProcessor: inserts the components of a template into the rbac manager + + + org.codehaus.plexus.redback.rbac.RBACManager + memory + rbacManager + + + + + + org.codehaus.plexus.redback.role.processor.RoleModelProcessor + default + org.codehaus.plexus.redback.role.processor.DefaultRoleModelProcessor + DefaultRoleModelProcessor: inserts the components of the model that can be populated into the rbac manager + + + org.codehaus.plexus.redback.rbac.RBACManager + memory + rbacManager + + + + + + org.codehaus.plexus.redback.role.RoleManager + default + org.codehaus.plexus.redback.role.DefaultRoleManager + singleton + RoleProfileManager: + + + org.codehaus.plexus.redback.role.validator.RoleModelValidator + default + modelValidator + + + org.codehaus.plexus.redback.role.processor.RoleModelProcessor + default + modelProcessor + + + org.codehaus.plexus.redback.role.template.RoleTemplateProcessor + default + templateProcessor + + + org.codehaus.plexus.redback.rbac.RBACManager + memory + rbacManager + + + org.codehaus.plexus.PlexusContainer + container + + + + + + org.codehaus.plexus.redback.system.SecuritySystem + testable + org.codehaus.plexus.redback.system.DefaultSecuritySystem + DefaultSecuritySystem: + + + org.codehaus.plexus.redback.authentication.AuthenticationManager + authnManager + + + org.codehaus.plexus.redback.authorization.Authorizer + rbac + authorizer + + + org.codehaus.plexus.redback.users.UserManager + memory + userManager + + + org.codehaus.plexus.redback.keys.KeyManager + memory + keyManager + + + org.codehaus.plexus.redback.policy.UserSecurityPolicy + policy + + + + + + org.codehaus.plexus.redback.authorization.Authorizer + rbac + org.codehaus.plexus.redback.authorization.rbac.RbacAuthorizer + RbacAuthorizer: + + + org.codehaus.plexus.redback.rbac.RBACManager + memory + manager + + + org.codehaus.plexus.redback.users.UserManager + memory + userManager + + + org.codehaus.plexus.redback.authorization.rbac.evaluator.PermissionEvaluator + default + evaluator + + + org.codehaus.plexus.redback.configuration.UserConfiguration + default + config + + + + + + org.codehaus.plexus.redback.authorization.rbac.evaluator.PermissionEvaluator + default + org.codehaus.plexus.redback.authorization.rbac.evaluator.DefaultPermissionEvaluator + + + org.codehaus.plexus.redback.users.UserManager + memory + userManager + + + + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-security/src/test/resources/repository-archiva.xml b/MRM-541/archiva-modules/archiva-web/archiva-security/src/test/resources/repository-archiva.xml new file mode 100644 index 000000000..997d62b00 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-security/src/test/resources/repository-archiva.xml @@ -0,0 +1,111 @@ + + + + + + 2 + + + + + artifacts + + **/*.pom + **/*.jar + **/*.ear + **/*.war + **/*.car + **/*.sar + **/*.mar + **/*.rar + **/*.dtd + **/*.tld + **/*.tar.gz + **/*.tar.bz2 + **/*.zip + + + + indexable-content + + **/*.txt + **/*.TXT + **/*.block + **/*.config + **/*.pom + **/*.xml + **/*.xsd + **/*.dtd + **/*.tld + + + + auto-remove + + **/*.bak + **/*~ + **/*- + + + + ignored + + **/.htaccess + **/KEYS + **/*.rb + **/*.sh + **/.svn/** + **/.DAV/** + + + + + update-db-artifact + create-missing-checksums + update-db-repository-metadata + validate-checksum + validate-signature + index-content + auto-remove + auto-rename + + + update-db-bad-content + + + + + 0 0 * * * ? + + index-artifact + update-db-project + validate-repository-metadata + index-archive-toc + update-db-bytecode-stats + index-public-methods + + + not-present-remove-db-artifact + not-present-remove-db-project + not-present-remove-indexed + + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/pom.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/pom.xml new file mode 100644 index 000000000..4d996f96a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/pom.xml @@ -0,0 +1,321 @@ + + + + 4.0.0 + + org.apache.archiva + archiva-web + 1.2-SNAPSHOT + + archiva-webapp-test + pom + Archiva Web :: Application Tests + + + org.codehaus.plexus + plexus-command-line + 1.0-alpha-2 + + + plexus-container-default + org.codehaus.plexus + + + + + org.apache.archiva + archiva-webapp + war + + + org.apache.maven.shared + maven-web-ui-tests + 1.0-SNAPSHOT + test + + + org.codehaus.plexus + plexus-utils + + + org.codehaus.plexus + plexus-slf4j-logging + + + + + jdom + jdom + + + jaxen + jaxen + + + + + org.apache.derby + derby + + + javax.mail + mail + + + javax.activation + activation + + + + src/test/it + + + org.codehaus.mojo + dependency-maven-plugin + + + unzip-archiva-webapp + generate-resources + + unpack + + + + + ${project.groupId} + archiva-webapp + ${project.version} + war + + + ${project.build.directory}/${container.name}conf/webapps/archiva + + + + prepare-provided-dependencies + generate-resources + + copy-dependencies + + + org.apache.derby,javax.mail,javax.activation + false + true + false + ${project.build.directory}/providedDependencies + + + + + + maven-antrun-plugin + + + generate-resources + + run + + + + + + + + + + + + + + + + + + + + + + + + + + copy-container-conf + package + + + + + + + + + + + + + + run + + + + check-archiva-loaded + integration-test + + + + + + + + run + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + + testCompile + + + + + + org.codehaus.mojo + selenium-maven-plugin + 1.0-beta-1 + + + start-selenium + pre-integration-test + + start-server + + + + + true + + + + org.codehaus.cargo + cargo-maven2-plugin + + + start-container + pre-integration-test + + start + + + + stop-container + post-integration-test + + stop + + + + + false + + ${container.name} + + ${container.url} + ${project.build.directory}/installs/${container.name} + + ${project.build.directory}/logs/${container.name}.log + ${project.build.directory}/logs/${container.name}.out + 600000 + + ${project.build.directory}/appserver-base + ${project.build.directory}/appserver-base + + + + ${project.build.directory}/${container.name}conf + existing + + 9696 + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + integration-test + + test + + + + + + + browser + ${browser} + + + + + + + + + tomcat5x + + true + + + tomcat5x + http://archive.apache.org/dist/tomcat/tomcat-5/v5.5.26/bin/apache-tomcat-5.5.26.zip + + + + firefox + + true + + + *firefox + + + + iexplore + + *iexplore + + + + otherbrowser + + *custom ${browserPath} + + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/it/org/apache/maven/archiva/web/test/AbstractArchivaTestCase.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/it/org/apache/maven/archiva/web/test/AbstractArchivaTestCase.java new file mode 100644 index 000000000..de0db4e7e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/it/org/apache/maven/archiva/web/test/AbstractArchivaTestCase.java @@ -0,0 +1,90 @@ +package org.apache.maven.archiva.web.test; + +/* + * 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.shared.web.test.AbstractSeleniumTestCase; + +/** + * @author Edwin Punzalan + */ +public abstract class AbstractArchivaTestCase + extends AbstractSeleniumTestCase +{ + private String baseUrl = "http://localhost:9696/archiva"; + + protected String getApplicationName() + { + return "Archiva"; + } + + protected String getInceptionYear() + { + return "2005"; + } + + protected void postAdminUserCreation() + { + if ( getTitle().equals( getTitlePrefix() + "Configuration" ) ) + { + //Add Managed Repository + setFieldValue( "id", "test-repository" ); + setFieldValue( "urlName", "test-repository" ); + setFieldValue( "name", "Web UI Test Managed Repository" ); + setFieldValue( "directory", getBasedir() + "/target/repository" ); + clickButtonWithValue( "Add Repository" ); + + //Set Index location + assertPage( "Configuration" ); + setFieldValue( "indexPath", getBasedir() + "/target/index" ); + clickButtonWithValue( "Save Configuration" ); + assertPage( "Administration" ); + } + } + + public void assertHeader() + { + assertTrue( "banner is missing", getSelenium().isElementPresent( "xpath=//div[@id='banner']" ) ); + assertTrue( "bannerLeft is missing", + getSelenium().isElementPresent( "xpath=//div[@id='banner']" + "/span[@id='bannerLeft']" ) ); + assertTrue( "bannerLeft link is missing", getSelenium().isElementPresent( + "xpath=//div[@id='banner']" + "/span[@id='bannerLeft']/a[@href='http://maven.apache.org/archiva/']" ) ); + assertTrue( "bannerLeft img is missing", getSelenium().isElementPresent( "xpath=//div[@id='banner']" + + "/span[@id='bannerLeft']/a[@href='http://maven.apache.org/archiva/']" + "/img[@src='" + getWebContext() + + "/images/archiva.png']" ) ); + + assertTrue( "bannerRight is missing", + getSelenium().isElementPresent( "xpath=//div[@id='banner']/span[@id='bannerRight']" ) ); + } + + protected String getTitlePrefix() + { + return "Maven Archiva :: "; + } + + public String getBaseUrl() + { + return baseUrl; + } + + protected String getWebContext() + { + return "/archiva"; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/it/org/apache/maven/archiva/web/test/BrowseRepositoryTest.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/it/org/apache/maven/archiva/web/test/BrowseRepositoryTest.java new file mode 100644 index 000000000..a02dc1d6a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/it/org/apache/maven/archiva/web/test/BrowseRepositoryTest.java @@ -0,0 +1,194 @@ +package org.apache.maven.archiva.web.test; + +/* + * 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. + */ + +/** + * Archiva's webapp UI test for browsing the indexed repository. + * + * @author Napoleon Esmundo C. Ramirez + */ +public class BrowseRepositoryTest + extends AbstractArchivaTestCase +{ + private void browseArtifact() + { + clickLinkWithText( "Browse" ); + assertPage( "Browse Repository" ); + assertTextPresent( "Browse Repository" ); + assertLinkPresent( "org.apache.maven.archiva.web.test/" ); + + clickLinkWithText( "org.apache.maven.archiva.web.test/" ); + assertPage( "Browse Repository" ); + assertTextPresent( "Browse Repository" ); + assertTextPresent( "Artifacts" ); + assertLinkPresent( "artifact-a/" ); + + clickLinkWithText( "artifact-a/" ); + assertPage( "Browse Repository" ); + assertTextPresent( "Browse Repository" ); + assertTextPresent( "Versions" ); + assertLinkPresent( "1.0/" ); + + clickLinkWithText( "1.0/" ); + assertPage( "Browse Repository" ); + assertTextPresent( "artifact-a" ); + assertLinkPresent( "Main" ); + } + + public void testBrowseArtifactInfo() + { + browseArtifact(); + + assertTextPresent( "Info" ); + assertLinkPresent( "Dependencies" ); + assertLinkPresent( "Dependency Tree" ); + assertLinkPresent( "Used By" ); + assertLinkPresent( "Mailing Lists" ); + + assertEquals("Group ID", getSelenium().getTable("//table[1].0.0")); + assertEquals("org.apache.maven.archiva.web.test", getSelenium().getTable("//table[1].0.1")); + assertEquals("Artifact ID", getSelenium().getTable("//table[1].1.0")); + assertEquals("artifact-a", getSelenium().getTable("//table[1].1.1")); + assertEquals("Version", getSelenium().getTable("//table[1].2.0")); + assertEquals("1.0", getSelenium().getTable("//table[1].2.1")); + assertEquals("Packaging", getSelenium().getTable("//table[1].3.0")); + assertEquals("jar", getSelenium().getTable("//table[1].3.1")); + } + + public void testBrowseArtifactDependencies() + { + browseArtifact(); + + clickLinkWithText( "Dependencies" ); + assertLinkPresent( "Info" ); + assertTextPresent( "Dependencies" ); + assertLinkPresent( "Dependency Tree" ); + assertLinkPresent( "Used By" ); + assertLinkPresent( "Mailing Lists" ); + + assertPage( "Browse Repository" ); + assertTextPresent( "artifact-a" ); + assertLinkPresent( "artifact-b" ); + } + + public void testBrowseArtifactDependencyTree() + { + browseArtifact(); + + clickLinkWithText( "Dependency Tree" ); + assertLinkPresent( "Info" ); + assertLinkPresent( "Dependencies" ); + assertTextPresent( "Dependency Tree" ); + assertLinkPresent( "Used By" ); + assertLinkPresent( "Mailing Lists" ); + + assertPage( "Browse Repository" ); + assertTextPresent( "artifact-a" ); + assertLinkPresent( "artifact-b" ); + assertLinkPresent( "artifact-c" ); + } + + public void testBrowseArtifactUsedBy() + { + browseArtifact(); + + clickLinkWithText( "Used By" ); + assertLinkPresent( "Info" ); + assertLinkPresent( "Dependencies" ); + assertLinkPresent( "Dependency Tree" ); + assertTextPresent( "Used By" ); + assertLinkPresent( "Mailing Lists" ); + + assertPage( "Browse Repository" ); + assertTextPresent( "artifact-a" ); + assertLinkPresent( "artifact-s" ); + } + + public void testBrowseArtifactMailingLists() + { + browseArtifact(); + + clickLinkWithText( "Mailing Lists" ); + assertLinkPresent( "Info" ); + assertLinkPresent( "Dependencies" ); + assertLinkPresent( "Dependency Tree" ); + assertLinkPresent( "Used By" ); + assertTextPresent( "Mailing Lists" ); + + assertPage( "Browse Repository" ); + assertTextPresent( "artifact-a" ); + assertTextPresent( "No mailing lists" ); + } + + public void testBrowseUpRepositoryDirectory() + { + browseArtifact(); + + assertLinkPresent( "artifact-a" ); + + clickLinkWithText( "artifact-a" ); + assertPage( "Browse Repository" ); + assertTextPresent( "Browse Repository" ); + assertTextPresent( "artifact-a" ); + assertTextPresent( "Versions" ); + assertLinkPresent( "1.0/" ); + assertLinkPresent( "test" ); + + clickLinkWithText( "test" ); + assertPage( "Browse Repository" ); + assertTextPresent( "Browse Repository" ); + assertTextPresent( "Artifacts" ); + assertLinkPresent( "artifact-a/" ); + assertLinkPresent( "web" ); + + clickLinkWithText( "web" ); + assertPage( "Browse Repository" ); + assertTextPresent( "Browse Repository" ); + assertTextPresent( "Groups" ); + assertLinkPresent( "org.apache.maven.archiva.web.test/" ); + assertLinkPresent( "[top]" ); + + clickLinkWithText( "[top]" ); + assertPage( "Browse Repository" ); + assertTextPresent( "Browse Repository" ); + assertTextPresent( "Groups" ); + assertLinkPresent( "org.apache.maven.archiva.web.test/" ); + } + + public void testBrowseDependencyArtifact() + { + browseArtifact(); + + clickLinkWithText( "Dependencies" ); + assertPage( "Browse Repository" ); + assertTextPresent( "artifact-a" ); + assertLinkPresent( "artifact-b" ); + + clickLinkWithText( "artifact-b" ); + assertEquals("Group ID", getSelenium().getTable("//table[1].0.0")); + assertEquals("org.apache.maven.archiva.web.test", getSelenium().getTable("//table[1].0.1")); + assertEquals("Artifact ID", getSelenium().getTable("//table[1].1.0")); + assertEquals("artifact-b", getSelenium().getTable("//table[1].1.1")); + assertEquals("Version", getSelenium().getTable("//table[1].2.0")); + assertEquals("2.0", getSelenium().getTable("//table[1].2.1")); + assertEquals("Packaging", getSelenium().getTable("//table[1].3.0")); + assertEquals("jar", getSelenium().getTable("//table[1].3.1")); + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/it/org/apache/maven/archiva/web/test/LoginTest.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/it/org/apache/maven/archiva/web/test/LoginTest.java new file mode 100644 index 000000000..6dda27d90 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/it/org/apache/maven/archiva/web/test/LoginTest.java @@ -0,0 +1,102 @@ +package org.apache.maven.archiva.web.test; + +/* + * 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 Edwin Punzalan + */ +public class LoginTest + extends AbstractArchivaTestCase +{ + public void testBadLogin() + { + goToLoginPage(); + submitLoginPage( "badUsername", "badPassword", false ); + assertTextPresent( "You have entered an incorrect username and/or password" ); + } + + public void testUserLogin() + { + createUser( "test-user", "temp-pass" ); + + goToLoginPage(); + submitLoginPage( "test-user", "temp-pass" ); + + // change of password required for new users + if ( getTitle().equals( getTitlePrefix() + "Change Password" ) ) + { + setFieldValue( "existingPassword", "temp-pass" ); + setFieldValue( "newPassword", "p4ssw0rd" ); + setFieldValue( "newPasswordConfirm", "p4ssw0rd" ); + clickButtonWithValue( "Change Password" ); + } + + logout(); + + deleteUser( "test-user" ); + } + + private void createUser( String username, String password ) + { + goToLoginPage(); + submitLoginPage( adminUsername, adminPassword ); + + clickLinkWithText( "User Management" ); + //assertPage( "[Admin] User List" ); + //assertLinkNotPresent( username ); + clickButtonWithValue( "Create New User" ); + + //assertPage( "[Admin] User Create" ); + setFieldValue( "user.username", username ); + setFieldValue( "user.fullName", username + " FullName" ); + setFieldValue( "user.email", username + "@localhost.com" ); + setFieldValue( "user.password", password ); + setFieldValue( "user.confirmPassword", password ); + clickButtonWithValue( "Create User" ); + waitPage(); + //assertPage( "[Admin] User List" ); + //assertLinkPresent( username ); + + logout(); + } + + private void deleteUser( String username ) + { + goToLoginPage(); + submitLoginPage( adminUsername, adminPassword ); + + clickLinkWithText( "User Management" ); + assertPage( "[Admin] User List" ); + assertLinkPresent( username ); + + //this does not work bec the image is pointing to /archiva/archiva/images/pss/admin/delete.gif + // when ran in selenium + // clickLinkWithXPath( "//a[@href='/security/userdelete.action?username=" + username + "']" ); + //so instead we use this + open( "/archiva/security/userdelete.action?username=" + username ); + + assertPage( "[Admin] User Delete" ); + assertTextPresent( "The following user will be deleted: " + username ); + clickButtonWithValue( "Delete User" ); + assertPage( "[Admin] User List" ); + + logout(); + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/it/org/apache/maven/archiva/web/test/ManagedRepositoryTest.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/it/org/apache/maven/archiva/web/test/ManagedRepositoryTest.java new file mode 100644 index 000000000..b25ae8195 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/it/org/apache/maven/archiva/web/test/ManagedRepositoryTest.java @@ -0,0 +1,201 @@ +package org.apache.maven.archiva.web.test; + +/* + * 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. + */ + +/** + * Archiva's webapp UI test for adding/editing/deleting managed repositories. + * + * @author Napoleon Esmundo C. Ramirez + */ +public class ManagedRepositoryTest + extends AbstractArchivaTestCase +{ + private static final String TEST_REPOSITORY_ID = "test-repository-id"; + + private static final String TEST_REPOSITORY_URL = "test-repository-url"; + + private static final String TEST_REPOSITORY_NAME = "test-repository-name"; + + private static final String TEST_REPOSITORY_DIRECTORY = "test-repository-directory"; + + + private void clickManagedRepositories() + { + goToLoginPage(); + submitLoginPage( adminUsername, adminPassword ); + + clickLinkWithText( "Managed Repositories" ); + assertPage( "Administration" ); + assertTextPresent( "Administration" ); + } + + private void createManagedRepository( String id, String url, String name, String directory ) + { + clickManagedRepositories(); + + clickLinkWithText( "Add Repository" ); + assertTextPresent( "Configuration" ); + + setFieldValue( "addRepository_id", id ); + setFieldValue( "urlName", url ); + setFieldValue( "addRepository_name", name ); + setFieldValue( "addRepository_directory", directory ); + + clickButtonWithValue( "Add Repository", false ); + } + + private void removeManagedRepository( String id ) + { + logout(); + + clickManagedRepositories(); + + clickLinkWithLocator( "//a[contains(@href, '/admin/deleteRepository!input.action?repoId=" + id + "')]" ); + clickLinkWithLocator( "deleteRepository_operationdelete-contents", false ); + clickButtonWithValue( "Go" ); + + assertPage( "Administration" ); + assertTextNotPresent( TEST_REPOSITORY_ID ); + } + + public void testAddRepositoryWithValidValues() + { + createManagedRepository( TEST_REPOSITORY_ID, TEST_REPOSITORY_URL, TEST_REPOSITORY_NAME, TEST_REPOSITORY_DIRECTORY ); + waitPage(); + + assertPage( "Administration" ); + assertTextPresent( TEST_REPOSITORY_ID ); + + removeManagedRepository( TEST_REPOSITORY_ID ); + } + + public void testAddRepositoryWithInvalidValues() + { + createManagedRepository( "", "", "", "" ); + + assertTextPresent( "You must enter the repository identifier." ); + assertTextPresent( "You must enter the url name." ); + assertTextPresent( "You must enter the repository name." ); + assertTextPresent( "You must enter the repository directory." ); + } + + public void testEditRepositoryWithValidValues() + { + createManagedRepository( TEST_REPOSITORY_ID, TEST_REPOSITORY_URL, TEST_REPOSITORY_NAME, TEST_REPOSITORY_DIRECTORY ); + waitPage(); + + assertPage( "Administration" ); + assertTextPresent( TEST_REPOSITORY_NAME ); + + clickLinkWithLocator( "//a[contains(@href, '/admin/editRepository!input.action?repoId=" + TEST_REPOSITORY_ID + "')]" ); + assertPage( "Configuration" ); + assertTextPresent( "Configuration" ); + + assertTextPresent( "Edit Managed Repository" ); + assertEquals( TEST_REPOSITORY_URL, getFieldValue( "urlName" ) ); + assertEquals( TEST_REPOSITORY_NAME, getFieldValue( "editRepository_name" ) ); + assertTrue( getFieldValue( "editRepository_directory" ).endsWith( TEST_REPOSITORY_DIRECTORY ) ); + + setFieldValue( "urlName", "edited-" + TEST_REPOSITORY_URL ); + setFieldValue( "editRepository_name", "edited-" + TEST_REPOSITORY_NAME ); + setFieldValue( "editRepository_directory", "edited-" + TEST_REPOSITORY_DIRECTORY ); + + clickButtonWithValue( "Update Repository" ); + assertPage( "Administration" ); + assertTextPresent( TEST_REPOSITORY_ID ); + assertTextPresent( "edited-" + TEST_REPOSITORY_NAME ); + + removeManagedRepository( TEST_REPOSITORY_ID ); + } + + public void testEditRepositoryWithInvalidValues() + { + createManagedRepository( TEST_REPOSITORY_ID, TEST_REPOSITORY_URL, TEST_REPOSITORY_NAME, TEST_REPOSITORY_DIRECTORY ); + waitPage(); + + assertPage( "Administration" ); + assertTextPresent( TEST_REPOSITORY_NAME ); + + clickLinkWithLocator( "//a[contains(@href, '/admin/editRepository!input.action?repoId=" + TEST_REPOSITORY_ID + "')]" ); + assertPage( "Configuration" ); + assertTextPresent( "Configuration" ); + + assertTextPresent( "Edit Managed Repository" ); + assertEquals( TEST_REPOSITORY_URL, getFieldValue( "urlName" ) ); + assertEquals( TEST_REPOSITORY_NAME, getFieldValue( "editRepository_name" ) ); + assertTrue( getFieldValue( "editRepository_directory" ).endsWith( TEST_REPOSITORY_DIRECTORY ) ); + + setFieldValue( "urlName", "" ); + setFieldValue( "editRepository_name", "" ); + setFieldValue( "editRepository_directory", "" ); + + clickButtonWithValue( "Update Repository", false ); + assertTextPresent( "You must enter the url name." ); + assertTextPresent( "You must enter the repository name." ); + assertTextPresent( "You must enter the repository directory." ); + + removeManagedRepository( TEST_REPOSITORY_ID ); + } + + public void testDeleteRepositoryButLeaveUnmodified() + { + createManagedRepository( TEST_REPOSITORY_ID, TEST_REPOSITORY_URL, TEST_REPOSITORY_NAME, TEST_REPOSITORY_DIRECTORY ); + waitPage(); + + assertPage( "Administration" ); + assertTextPresent( TEST_REPOSITORY_ID ); + + clickLinkWithLocator( "//a[contains(@href, '/admin/deleteRepository!input.action?repoId=" + TEST_REPOSITORY_ID + "')]" ); + clickLinkWithLocator( "deleteRepository_operationunmodified", false ); + clickButtonWithValue( "Go" ); + + assertPage( "Administration" ); + assertTextPresent( TEST_REPOSITORY_ID ); + + removeManagedRepository( TEST_REPOSITORY_ID ); + } + + public void testDeleteRepositoryAndContents() + { + createManagedRepository( TEST_REPOSITORY_ID, TEST_REPOSITORY_URL, TEST_REPOSITORY_NAME, TEST_REPOSITORY_DIRECTORY ); + waitPage(); + + assertPage( "Administration" ); + assertTextPresent( TEST_REPOSITORY_ID ); + + removeManagedRepository( TEST_REPOSITORY_ID ); + } + + public void testDeleteRepositoryButLeaveContentsUnmodified() + { + createManagedRepository( TEST_REPOSITORY_ID, TEST_REPOSITORY_URL, TEST_REPOSITORY_NAME, TEST_REPOSITORY_DIRECTORY ); + waitPage(); + + assertPage( "Administration" ); + assertTextPresent( TEST_REPOSITORY_ID ); + + clickLinkWithLocator( "//a[contains(@href, '/admin/deleteRepository!input.action?repoId=" + TEST_REPOSITORY_ID + "')]" ); + clickLinkWithLocator( "deleteRepository_operationdelete-entry", false ); + clickButtonWithValue( "Go" ); + + assertPage( "Administration" ); + assertTextNotPresent( TEST_REPOSITORY_ID ); + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/it/org/apache/maven/archiva/web/test/MavenConnectionTest.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/it/org/apache/maven/archiva/web/test/MavenConnectionTest.java new file mode 100644 index 000000000..a0eb5aebf --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/it/org/apache/maven/archiva/web/test/MavenConnectionTest.java @@ -0,0 +1,397 @@ +package org.apache.maven.archiva.web.test; + +/* + * 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.codehaus.plexus.util.cli.CommandLineUtils; +import org.codehaus.plexus.util.cli.Commandline; +import org.codehaus.plexus.util.cli.StreamConsumer; +import org.codehaus.plexus.util.cli.WriterStreamConsumer; +import org.codehaus.plexus.commandline.ExecutableResolver; +import org.codehaus.plexus.commandline.DefaultExecutableResolver; +import org.jdom.input.SAXBuilder; +import org.jdom.Document; +import org.jdom.Element; +import org.jdom.output.XMLOutputter; +import org.jdom.xpath.XPath; + +import java.io.File; +import java.io.Writer; +import java.io.FileWriter; +import java.io.FileReader; +import java.io.BufferedReader; +import java.util.List; +import java.util.Collections; + + +/** + * Test maven connection to archiva + * + * @author Maria Odea Ching + */ +public class MavenConnectionTest + extends AbstractArchivaTestCase +{ + public static final String PATH_TO_ARCHIVA_XML = "/target/appserver-base/conf/archiva.xml"; + + public static final String PATH_TO_SETTINGS_XML = "/target/local-repo/settings.xml"; + + public static final String NEW_LOCAL_REPO_VALUE = "/target/local-repo"; + + /** + * @throws Exception + */ + public void setUp() + throws Exception + { + super.setUp(); + + String newValue = getBasedir() + NEW_LOCAL_REPO_VALUE; + updateXml( new File( getBasedir(), PATH_TO_ARCHIVA_XML ), newValue ); + updateXml( new File( getBasedir(), PATH_TO_SETTINGS_XML ), newValue ); + } + + /** + * Update localRepository element value + * + * @param f + * @param newValue + * @throws Exception + */ + private void updateXml( File f, String newValue ) + throws Exception + { + SAXBuilder builder = new SAXBuilder(); + FileReader reader = new FileReader( f ); + Document document = builder.build( reader ); + + Element localRepository = + (Element) XPath.newInstance( "./" + "localRepository" ).selectSingleNode( document.getRootElement() ); + localRepository.setText( newValue ); + + // re-write xml file + FileWriter writer = new FileWriter( f ); + XMLOutputter output = new XMLOutputter(); + output.output( document, writer ); + } + + private void clickManagedRepositories() + { + goToLoginPage(); + submitLoginPage( adminUsername, adminPassword ); + + clickLinkWithText( "Managed Repositories" ); + assertPage( "Administration" ); + assertTextPresent( "Administration" ); + } + + private void removeManagedRepository( String id ) + { + clickManagedRepositories(); + + clickLinkWithLocator( "//a[contains(@href, '/admin/deleteRepository!input.action?repoId=" + id + "')]" ); + clickLinkWithLocator( "deleteRepository_operationdelete-contents", false ); + clickButtonWithValue( "Go" ); + + assertPage( "Administration" ); + } + + /** + * Click Settings from the navigation menu + */ + private void clickProxiedRepositories() + { + goToLoginPage(); + submitLoginPage( adminUsername, adminPassword ); + + clickLinkWithText( "Proxied Repositories" ); + assertPage( "Administration" ); + assertTextPresent( "Proxied Repositories" ); + } + + /** + * Remove the created test repo + */ + protected void removeProxiedRepository() + { + if ( !isLinkPresent( "Login" ) ) + { + logout(); + } + + clickProxiedRepositories(); + + if ( isTextPresent( "Delete Repository " ) ) + { + clickLinkWithText( "Delete Repository" ); + assertPage( "Configuration" ); + clickLinkWithLocator( "deleteProxiedRepository_operationdelete-entry", false ); + clickButtonWithValue( "Go" ); + + assertPage( "Administration" ); + assertTextNotPresent( "Test Proxied Repository" ); + } + + logout(); + } + + /** + * Execute 'mvn' from commandline + * + * @param workingDir + * @param outputFile + * @return + * @throws Exception + */ + private int executeMaven( String workingDir, File outputFile ) + throws Exception + { + + ExecutableResolver executableResolver = new DefaultExecutableResolver(); + + String actualExecutable = "mvn"; + File workingDirectory = new File( workingDir ); + + List path = executableResolver.getDefaultPath(); + + if ( path == null ) + { + path = Collections.EMPTY_LIST; + } + + File e = executableResolver.findExecutable( "mvn", path ); + + if ( e != null ) + { + actualExecutable = e.getAbsolutePath(); + } + + File actualExecutableFile = new File( actualExecutable ); + + if ( !actualExecutableFile.exists() ) + { + actualExecutable = "mvn"; + } + + // Set command line + Commandline cmd = new Commandline(); + + cmd.addSystemEnvironment(); + + cmd.addEnvironment( "MAVEN_TERMINATE_CMD", "on" ); + + cmd.setExecutable( actualExecutable ); + + cmd.setWorkingDirectory( workingDirectory.getAbsolutePath() ); + + cmd.createArgument().setValue( "clean" ); + + cmd.createArgument().setValue( "install" ); + + cmd.createArgument().setValue( "-s" ); + + cmd.createArgument().setValue( getBasedir() + "/target/local-repo/settings.xml" ); + + // Excute command + + Writer writer = new FileWriter( outputFile ); + + StreamConsumer consumer = new WriterStreamConsumer( writer ); + + int exitCode = CommandLineUtils.executeCommandLine( cmd, consumer, consumer ); + + writer.flush(); + + writer.close(); + + return exitCode; + } + + public void testBadDependency() + throws Exception + { + File outputFile = new File( getBasedir(), "/target/projects/bad-dependency/bad-dependency.log" ); + int exitCode = executeMaven( getBasedir() + "/target/projects/bad-dependency", outputFile ); + + assertEquals( 1, exitCode ); + + File f = new File( getBasedir(), + "/target/local-repo/org/apache/mavem/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.jar" ); + assertTrue( !f.exists() ); + + BufferedReader reader = new BufferedReader( new FileReader( outputFile ) ); + String str; + boolean foundSnapshot = false, foundBadDep = false; + + while ( ( str = reader.readLine() ) != null ) + { + //System.out.println( str ); + if ( str.indexOf( + "mvn install:install-file -DgroupId=org.apache.maven.archiva.web.test -DartifactId=foo-bar" ) != -1 ) + { + foundSnapshot = true; + } + else if ( str.indexOf( + "mvn install:install-file -DgroupId=org.apache.maven.archiva.web.test -DartifactId=bad-dependency" ) != + -1 ) + { + foundBadDep = true; + } + } + + reader.close(); + + assertTrue( foundSnapshot ); + assertTrue( foundBadDep ); + } + + /* + @todo: commented out since tests are currently failing due to MRM-323 + + public void testDownloadArtifactFromManagedRepo() + throws Exception + { + clickManagedRepositories(); + + clickLinkWithText( "Add Repository" ); + assertTextPresent( "Configuration" ); + + setFieldValue( "addRepository_id", "snapshots" ); + setFieldValue( "urlName", "snapshots" ); + setFieldValue( "addRepository_name", "snapshots-repository" ); + setFieldValue( "addRepository_directory", getBasedir() + "/target/snapshots" ); + + clickButtonWithValue( "Add Repository" ); + assertPage( "Administration" ); + + clickLinkWithText( "User Management" ); + clickLinkWithLocator( "//a[contains(@href, '/security/useredit.action?username=admin')]" ); + clickLinkWithText( "Edit Roles" ); + checkField( "addRolesToUser_addSelectedRolesRepository Observer - snapshots" ); + checkField( "addRolesToUser_addSelectedRolesRepository Manager - snapshots" ); + + clickButtonWithValue( "Add Selected Roles" ); + assertPage( "[Admin] User List" ); + + logout(); + + File outputFile = new File( getBasedir(), "/target/projects/bad-dependency/bad-dependency2.log" ); + int exitCode = executeMaven( getBasedir() + "/target/projects/bad-dependency", + outputFile ); + + assertEquals( 0, exitCode ); + + File f = new File( getBasedir(), + "/target/local-repo/org/apache/maven/archiva/web/test/foo-bar-1.0-SNAPSHOT.jar" ); + assertTrue( f.exists() ); + + BufferedReader reader = new BufferedReader( new FileReader( outputFile ) ); + String str; + + while( ( str = reader.readLine() ) != null) + { + System.out.println( str ); + } + reader.close(); + + removeManagedRepository( "snapshots" ); + } + + + public void testDownloadArtifactFromProxiedRepo() + throws Exception + { + //add managed repository + clickManagedRepositories(); + + clickLinkWithText( "Add Repository" ); + assertTextPresent( "Configuration" ); + + setFieldValue( "addRepository_id", "repository" ); + setFieldValue( "urlName", "repository" ); + setFieldValue( "addRepository_name", "repository" ); + setFieldValue( "addRepository_directory", getBasedir() + "/target/repository" ); + + clickButtonWithValue( "Add Repository" ); + waitPage(); + assertPage( "Administration" ); + + clickLinkWithText( "User Management" ); + clickLinkWithLocator( "//a[contains(@href, '/security/useredit.action?username=admin')]" ); + clickLinkWithText( "Edit Roles" ); + checkField( "addRolesToUser_addSelectedRolesRepository Observer - repository" ); + checkField( "addRolesToUser_addSelectedRolesRepository Manager - repository" ); + + clickButtonWithValue( "Add Selected Roles" ); + assertPage( "[Admin] User List" ); + logout(); + + //add proxied repository + clickProxiedRepositories(); + clickLinkWithText( "Add Repository" ); + assertPage( "Configuration" ); + setFieldValue( "id", "central" ); + setFieldValue( "name", "Central Repository" ); + setFieldValue( "url", "http://mirrors.ibiblio.org/pub/mirrors/maven2" ); + clickButtonWithValue( "Add Repository" ); + waitPage(); + + assertPage( "Administration" ); + assertTextPresent( "Central Repository" ); + assertLinkPresent( "Edit Repository" ); + + logout(); + + File outputFile = new File( getBasedir(), "/target/projects/dependency-in-proxied/dependency-in-proxied.log" ); + int exitCode = executeMaven( getBasedir() + "/target/projects/dependency-in-proxied", + outputFile ); + + assertEquals( 0, exitCode ); + + File f = new File( getBasedir(),"/target/repository/com/lowagie/itext/1.3/itext-1.3.jar" ); + assertTrue( f.exists() ); + + f = new File( getBasedir(), "/target/local-repo/com/lowagie/itext/1.3/itext-1.3.jar" ); + assertTrue( f.exists() ); + + + BufferedReader reader = new BufferedReader( new FileReader( outputFile ) ); + String str; + + while( ( str = reader.readLine() ) != null) + { + System.out.println( str ); + } + reader.close(); + + removeProxiedRepository(); + removeManagedRepository( "repository" ); + } + + */ + + /** + * @throws Exception + */ + public void tearDown() + throws Exception + { + super.tearDown(); + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/it/org/apache/maven/archiva/web/test/ProxiedRepositoryTest.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/it/org/apache/maven/archiva/web/test/ProxiedRepositoryTest.java new file mode 100644 index 000000000..370995765 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/it/org/apache/maven/archiva/web/test/ProxiedRepositoryTest.java @@ -0,0 +1,233 @@ +package org.apache.maven.archiva.web.test; + +/* + * 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. + */ + +/** + * Test archiva proxied repositories configuration + * + * @author Maria Odea Ching + */ +public class ProxiedRepositoryTest + extends AbstractArchivaTestCase +{ + /** + * + */ + protected void initialize() + { + super.initialize(); + + createTestRepo(); + } + + /** + * Create a proxied repo which will be used for testing + */ + private void createTestRepo() + { + clickProxiedRepositories(); + + if ( isTextPresent( "There are no proxied repositories configured yet." ) ) + { + clickLinkWithText( "Add Repository" ); + assertPage( "Configuration" ); + setFieldValue( "id", "test-proxied" ); + setFieldValue( "name", "Test Proxied Repository" ); + setFieldValue( "url", "http://test.com/test-proxied" ); + clickButtonWithValue( "Add Repository" ); + waitPage(); + + assertPage( "Administration" ); + assertTextPresent( "Test Proxied Repository" ); + assertLinkPresent( "Edit Repository" ); + } + + logout(); + } + + /** + * Test add proxied repo with invalid data + */ + public void testInvalidAddProxiedRepoConfiguration() + { + clickProxiedRepositories(); + + clickLinkWithText( "Add Repository" ); + assertPage( "Configuration" ); + + clickButtonWithValue( "Add Repository", false ); + assertPage( "Configuration" ); + assertTextPresent( "You must enter the repository identifier." ); + assertTextPresent( "You must enter the repository name." ); + assertTextPresent( "You must enter the repository URL." ); + + logout(); + } + + /** + * Test edit proxied repo with valid data + */ + public void testValidEditProxiedRepoConfiguration() + { + clickProxiedRepositories(); + clickLinkWithText( "Edit Repository" ); + + assertPage( "Configuration" ); + assertTextPresent( "Edit Proxied Repository" ); + setFieldValue( "name", "Test Valid" ); + setFieldValue( "url", "http://valid.org/test-valid" ); + clickButtonWithValue( "Update Repository" ); + waitPage(); + + assertPage( "Administration" ); + assertTextPresent( "Test Valid" ); + assertLinkPresent( "Edit Repository" ); + + logout(); + } + + /** + * Test edit proxied repo with invalid data + */ + public void testInvalidEditProxiedRepoConfiguration() + { + clickProxiedRepositories(); + clickLinkWithText( "Edit Repository" ); + + assertPage( "Configuration" ); + assertTextPresent( "Edit Proxied Repository" ); + setFieldValue( "name", "" ); + setFieldValue( "url", "" ); + clickButtonWithValue( "Update Repository", false ); + + assertPage( "Configuration" ); + assertTextPresent( "You must enter the repository name." ); + assertTextPresent( "You must enter the repository URL." ); + + logout(); + } + + /** + * Test delete repository, unmodified entry and contents + */ + public void testDeleteRepoUnmodified() + { + clickProxiedRepositories(); + clickLinkWithText( "Delete Repository" ); + + assertPage( "Configuration" ); + assertTextPresent( "Delete Proxied Repository" ); + clickButtonWithValue( "Go" ); + + assertPage( "Administration" ); + assertTextPresent( "Test Proxied Repository" ); + + logout(); + } + + /** + * Test delete repository including contents + */ + public void testDeleteRepoRemoveFromDisk() + { + clickProxiedRepositories(); + clickLinkWithText( "Delete Repository" ); + + assertPage( "Configuration" ); + clickLinkWithLocator( "deleteProxiedRepository_operationdelete-contents", false ); + clickButtonWithValue( "Go" ); + + assertPage( "Administration" ); + assertTextNotPresent( "Test Proxied Repository" ); + + logout(); + } + + /** + * Test delete repository, unmodified contents/entry deleted + */ + public void testDeleteRepoUnmodifiedContents() + { + clickProxiedRepositories(); + clickLinkWithText( "Delete Repository" ); + + assertPage( "Configuration" ); + clickLinkWithLocator( "deleteProxiedRepository_operationdelete-entry", false ); + clickButtonWithValue( "Go" ); + + assertPage( "Administration" ); + assertTextNotPresent( "Test Proxied Repository" ); + + logout(); + } + + /** + * Click Settings from the navigation menu + */ + private void clickProxiedRepositories() + { + goToLoginPage(); + submitLoginPage( adminUsername, adminPassword ); + + clickLinkWithText( "Proxied Repositories" ); + assertPage( "Administration" ); + assertTextPresent( "Proxied Repositories" ); + } + + /** + * Remove the created test repo + */ + protected void removeTestRepo() + { + if ( !isLinkPresent( "Login" ) ) + { + logout(); + } + + clickProxiedRepositories(); + + if ( isTextPresent( "Delete Repository " ) ) + { + clickLinkWithText( "Delete Repository" ); + assertPage( "Configuration" ); + clickLinkWithLocator( "deleteProxiedRepository_operationdelete-entry", false ); + clickButtonWithValue( "Go" ); + + assertPage( "Administration" ); + assertTextNotPresent( "Test Proxied Repository" ); + } + + logout(); + } + + /** + * Revert to original value + * + * @throws Exception + */ + public void tearDown() + throws Exception + { + removeTestRepo(); + + super.tearDown(); + } + +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/it/org/apache/maven/archiva/web/test/SearchTest.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/it/org/apache/maven/archiva/web/test/SearchTest.java new file mode 100644 index 000000000..67ce4271a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/it/org/apache/maven/archiva/web/test/SearchTest.java @@ -0,0 +1,129 @@ +package org.apache.maven.archiva.web.test; + +/* + * 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 SearchTest + extends AbstractArchivaTestCase +{ + private static int PAGE_LOAD_WAIT = 1500; + + public void testSearchNonExistingArtifact() + { + searchForArtifact( "asdf" ); + + waitPage( PAGE_LOAD_WAIT ); + + assertTextPresent( "No results found" ); + } + + public void testSearchExistingArtifact() + { + searchForArtifact( "artifact-a" ); + + waitPage( PAGE_LOAD_WAIT ); + + assertPage( "Search Results" ); + + assertTextPresent( "artifact-a" ); + } + + public void testViewSearchedArtifact() + { + // test viewing artifact (header link) listed in search results + + searchForArtifact( "artifact-a" ); + + waitPage( PAGE_LOAD_WAIT ); + + getSelenium().click( "link=artifact-a" ); + + waitPage( PAGE_LOAD_WAIT ); + + assertPage( "Browse Repository" ); + + assertTextPresent( "artifact-a" ); + + //test viewing artifact listed in search results + + searchForArtifact( "artifact-a" ); + + waitPage( PAGE_LOAD_WAIT ); + + clickLinkWithText( "1.0" ); + + waitPage( PAGE_LOAD_WAIT ); + + assertPage( "Browse Repository" ); + + assertTextPresent( "Artifact ID" ); + + assertTextPresent( "artifact-a" ); + + assertTextPresent( "Version" ); + + assertTextPresent( "1.0" ); + } + + public void testBrowseSearchedArtifact() + { + // test viewing artifact listed in search results + + searchForArtifact( "artifact-a" ); + + waitPage( PAGE_LOAD_WAIT ); + + getSelenium().click("//p[1]/span/a[1]"); + + waitPage( PAGE_LOAD_WAIT ); + + assertPage( "Browse Repository" ); + + assertTextPresent( "artifact-a" ); + } + + public void testBrowseRepoFromSearchResults() + { + searchForArtifact( "artifact-a" ); + + waitPage( PAGE_LOAD_WAIT ); + + clickLinkWithText( "[top]" ); + + waitPage( PAGE_LOAD_WAIT ); + + assertPage( "Browse Repository" ); + } + + private void searchForArtifact( String artifactId ) + { + if ( !"Maven Archiva :: Quick Search".equals( getSelenium().getTitle() ) ) + { + clickLinkWithText( "Search" ); + + waitPage( PAGE_LOAD_WAIT ); + + assertPage( "Quick Search" ); + } + + setFieldValue( "quickSearch_q", artifactId ); + + clickButtonWithValue( "Submit" ); + } +} \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/it/org/apache/maven/archiva/web/test/SettingsTest.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/it/org/apache/maven/archiva/web/test/SettingsTest.java new file mode 100644 index 000000000..2b88efb33 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/it/org/apache/maven/archiva/web/test/SettingsTest.java @@ -0,0 +1,184 @@ +package org.apache.maven.archiva.web.test; + +/* + * 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. + */ + + +/** + * Test archiva 'Settings' + * + * @author Maria Odea Ching + */ +public class SettingsTest + extends AbstractArchivaTestCase +{ + /* + public void testRunIndexer() + { + clickSettings(); + + clickLinkWithText( "Run Now" ); + waitPage(); + + assertPage( "Administration" ); + + logout(); + } */ + + public void testEditIndexDirectory() + { + clickEditConfiguration(); + + setFieldValue( "indexPath", getBasedir() + "/target/web-ui-index" ); + clickButtonWithValue( "Save Configuration" ); + waitPage(); + assertPage( "Administration" ); + assertTextPresent( getBasedir() + "/target/web-ui-index" ); + + logout(); + } + + public void testValidIndexSchedule() + { + clickEditConfiguration(); + + setFieldValue( "second", "*" ); + setFieldValue( "minute", "*" ); + clickButtonWithValue( "Save Configuration" ); + waitPage(); + assertPage( "Administration" ); + + logout(); + } + + public void testInvalidIndexSchedule() + { + clickEditConfiguration(); + setFieldValue( "second", "asdf" ); + clickButtonWithValue( "Save Configuration" ); + waitPage(); + assertPage( "Configuration" ); + assertTextPresent( "Invalid Cron Expression" ); + + logout(); + } + + public void testEditProxyHost() + { + clickEditConfiguration(); + + setFieldValue( "proxy.host", "asdf" ); + clickButtonWithValue( "Save Configuration" ); + waitPage(); + assertPage( "Administration" ); + + logout(); + } + + public void testValidProxyPort() + { + clickEditConfiguration(); + + setFieldValue( "proxy.port", "32143" ); + clickButtonWithValue( "Save Configuration" ); + waitPage(); + assertPage( "Administration" ); + + logout(); + } + + public void testInvalidProxyPort() + { + clickEditConfiguration(); + setFieldValue( "proxy.port", "asdf" ); + clickButtonWithValue( "Save Configuration" ); + waitPage(); + assertPage( "Configuration" ); + assertTextPresent( "Port" ); + assertTextPresent( "Invalid field value for field \"proxy.port\"" ); + + setFieldValue( "proxy.port", "-1" ); + clickButtonWithValue( "Save Configuration" ); + waitPage(); + assertPage( "Administration" ); + + logout(); + } + + public void testEditProxyCredentials() + { + clickEditConfiguration(); + + setFieldValue( "proxy.username", "asdf" ); + clickButtonWithValue( "Save Configuration" ); + waitPage(); + assertPage( "Administration" ); + + logout(); + } + + /** + * Click Edit Configuration link + */ + private void clickEditConfiguration() + { + clickSettings(); + + clickLinkWithText( "Edit Configuration" ); + assertPage( "Configuration" ); + } + + /** + * Click Settings from the navigation menu + */ + private void clickSettings() + { + goToLoginPage(); + submitLoginPage( adminUsername, adminPassword ); + + clickLinkWithText( "Settings" ); + assertPage( "Administration" ); + } + + public void tearDown() + throws Exception + { + clickEditConfiguration(); + setFieldValue( "indexPath", getBasedir() + "/target/web-ui-index" ); + setFieldValue( "second", "0" ); + setFieldValue( "minute", "0,30" ); + setFieldValue( "hour", "*" ); + setFieldValue( "dayOfMonth", "*" ); + setFieldValue( "month", "*" ); + setFieldValue( "dayOfWeek", "?" ); + setFieldValue( "year", "" ); + setFieldValue( "proxy.port", "8080" ); + setFieldValue( "proxy.host", "" ); + setFieldValue( "proxy.username", "" ); + setFieldValue( "proxy.password", "" ); + clickButtonWithValue( "Save Configuration" ); + waitPage(); + assertPage( "Administration" ); + + logout(); + + super.tearDown(); + } + +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/appserver-base/conf/archiva.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/appserver-base/conf/archiva.xml new file mode 100644 index 000000000..4208167ec --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/appserver-base/conf/archiva.xml @@ -0,0 +1,3 @@ + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/appserver-base/conf/shared.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/appserver-base/conf/shared.xml new file mode 100644 index 000000000..9afb83352 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/appserver-base/conf/shared.xml @@ -0,0 +1 @@ + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/index/_7.cfs b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/index/_7.cfs new file mode 100644 index 000000000..e95ea7eb8 Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/index/_7.cfs differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/index/deletable b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/index/deletable new file mode 100644 index 000000000..593f4708d Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/index/deletable differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/index/segments b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/index/segments new file mode 100644 index 000000000..d9d4f014f Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/index/segments differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/local-repo/settings.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/local-repo/settings.xml new file mode 100644 index 000000000..23b66a9db --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/local-repo/settings.xml @@ -0,0 +1,44 @@ + + + + + snapshots + admin + admin1 + + + + + repositories + + + snapshots + snapshots-repository + http://localhost:9696/archiva/repository/snapshots/ + + false + + + true + + + + + + snapshots + snapshots-repository + http://localhost:9696/archiva/repository/snapshot/ + + false + + + true + + + + + + + repositories + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/projects/bad-dependency/bad-dependency.log b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/projects/bad-dependency/bad-dependency.log new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/projects/bad-dependency/bad-dependency2.log b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/projects/bad-dependency/bad-dependency2.log new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/projects/bad-dependency/pom.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/projects/bad-dependency/pom.xml new file mode 100644 index 000000000..24fc2aa46 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/projects/bad-dependency/pom.xml @@ -0,0 +1,41 @@ + + + + + 4.0.0 + org.apache.archiva + bad-dependency + 1.0 + jar + Bad Dependency + + + org.apache.archiva.web.test + bad-dependency + 1.0 + + + org.apache.archiva.web.test + foo-bar + 1.2-SNAPSHOT + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/projects/dependency-in-proxied/dependency-in-proxied.log b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/projects/dependency-in-proxied/dependency-in-proxied.log new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/projects/dependency-in-proxied/pom.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/projects/dependency-in-proxied/pom.xml new file mode 100644 index 000000000..82606837b --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/projects/dependency-in-proxied/pom.xml @@ -0,0 +1,41 @@ + + + + + 4.0.0 + org.apache.archiva + dependency-in-proxied + 1.0 + jar + Dependency In Proxied + + + + com.lowagie + itext + 1.3 + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/.datarefresh b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/.datarefresh new file mode 100644 index 000000000..c53a40aad --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/.datarefresh @@ -0,0 +1,7 @@ +#Last Scan Information, managed by Archiva. DO NOT EDIT +#Thu Apr 19 17:04:36 PHT 2007 +scan.included.files=12 +scan.skipped.files=0 +scan.finished.timestamp=1176973476967 +scan.consumed.files=20 +scan.started.timestamp=1176973467414 diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/1.0/artifact-a-1.0.jar.md5 b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/1.0/artifact-a-1.0.jar.md5 new file mode 100644 index 000000000..158138e09 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/1.0/artifact-a-1.0.jar.md5 @@ -0,0 +1 @@ +0360f14347d5502114ba7afe4ea2e07f \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/1.0/artifact-a-1.0.jar.sha1 b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/1.0/artifact-a-1.0.jar.sha1 new file mode 100644 index 000000000..c9524a069 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/1.0/artifact-a-1.0.jar.sha1 @@ -0,0 +1 @@ +4a667b9923fb936409b96c8242bebc2f96f374f5 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/1.0/artifact-a-1.0.pom b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/1.0/artifact-a-1.0.pom new file mode 100644 index 000000000..9d419ea6d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/1.0/artifact-a-1.0.pom @@ -0,0 +1,25 @@ + + 4.0.0 + org.apache.maven.archiva.web.test + artifact-a + jar + 1.0 + artifact-a + http://maven.apache.org + + + org.apache.maven.archiva.web.test + artifact-b + 2.0 + + + + + + org.apache.maven.wagon + wagon-webdav + + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/1.0/artifact-a-1.0.pom.md5 b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/1.0/artifact-a-1.0.pom.md5 new file mode 100644 index 000000000..93cdd6f43 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/1.0/artifact-a-1.0.pom.md5 @@ -0,0 +1 @@ +cdf69ffbcb888aacea6cfeaf479fefd1 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/1.0/artifact-a-1.0.pom.sha1 b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/1.0/artifact-a-1.0.pom.sha1 new file mode 100644 index 000000000..293b6c1f4 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/1.0/artifact-a-1.0.pom.sha1 @@ -0,0 +1 @@ +f6a384b1ab62ed45ae7dee1a059815e94bbc7fa6 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/maven-metadata.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/maven-metadata.xml new file mode 100644 index 000000000..113676922 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/maven-metadata.xml @@ -0,0 +1,11 @@ + + org.apache.maven.archiva.web.test + artifact-a + 1.0 + + + 1.0 + + 20070417090928 + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/maven-metadata.xml.md5 b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/maven-metadata.xml.md5 new file mode 100644 index 000000000..a02aa88a4 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/maven-metadata.xml.md5 @@ -0,0 +1 @@ +bc87573a595a2c387b5baa4ad7d06743 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/maven-metadata.xml.sha1 b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/maven-metadata.xml.sha1 new file mode 100644 index 000000000..11bee708c --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-a/maven-metadata.xml.sha1 @@ -0,0 +1 @@ +e9ecaaa14a3c09b07206980c15749a631dbc986a \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/2.0/artifact-b-2.0.jar.md5 b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/2.0/artifact-b-2.0.jar.md5 new file mode 100644 index 000000000..3bb4fd4e6 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/2.0/artifact-b-2.0.jar.md5 @@ -0,0 +1 @@ +16a308257949f23afa5d1f1dec41aa44 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/2.0/artifact-b-2.0.jar.sha1 b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/2.0/artifact-b-2.0.jar.sha1 new file mode 100644 index 000000000..e5d0934b1 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/2.0/artifact-b-2.0.jar.sha1 @@ -0,0 +1 @@ +36a3a9cc35b8ca0d73998d7b39d290b489800a22 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/2.0/artifact-b-2.0.pom b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/2.0/artifact-b-2.0.pom new file mode 100644 index 000000000..218543673 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/2.0/artifact-b-2.0.pom @@ -0,0 +1,25 @@ + + 4.0.0 + org.apache.maven.archiva.web.test + artifact-b + jar + 2.0 + artifact-b + http://maven.apache.org + + + org.apache.maven.archiva.web.test + artifact-c + 3.0 + + + + + + org.apache.maven.wagon + wagon-webdav + + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/2.0/artifact-b-2.0.pom.md5 b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/2.0/artifact-b-2.0.pom.md5 new file mode 100644 index 000000000..5fabe5807 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/2.0/artifact-b-2.0.pom.md5 @@ -0,0 +1 @@ +be5b8f8539a62b5935793ebeb87215fd \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/2.0/artifact-b-2.0.pom.sha1 b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/2.0/artifact-b-2.0.pom.sha1 new file mode 100644 index 000000000..6eb9715a0 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/2.0/artifact-b-2.0.pom.sha1 @@ -0,0 +1 @@ +012a658d4a4f70aa3e8dd4b2db67020817b7dfcc \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/maven-metadata.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/maven-metadata.xml new file mode 100644 index 000000000..60b171df5 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/maven-metadata.xml @@ -0,0 +1,11 @@ + + org.apache.maven.archiva.web.test + artifact-b + 2.0 + + + 2.0 + + 20070417090908 + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/maven-metadata.xml.md5 b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/maven-metadata.xml.md5 new file mode 100644 index 000000000..80c703319 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/maven-metadata.xml.md5 @@ -0,0 +1 @@ +bedfccc27fc7dc262d5c99a7aa8b83d8 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/maven-metadata.xml.sha1 b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/maven-metadata.xml.sha1 new file mode 100644 index 000000000..42390adcc --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-b/maven-metadata.xml.sha1 @@ -0,0 +1 @@ +4902ea6b16838ff26f9136460c4394b0ad7cc7f5 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/3.0/artifact-c-3.0.jar.md5 b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/3.0/artifact-c-3.0.jar.md5 new file mode 100644 index 000000000..edc258a75 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/3.0/artifact-c-3.0.jar.md5 @@ -0,0 +1 @@ +853a10a201f8a296e37e856615c5349c \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/3.0/artifact-c-3.0.jar.sha1 b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/3.0/artifact-c-3.0.jar.sha1 new file mode 100644 index 000000000..aafda15fa --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/3.0/artifact-c-3.0.jar.sha1 @@ -0,0 +1 @@ +5155da8820ed77c43e983c1244d94a3b27bf08f7 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/3.0/artifact-c-3.0.pom b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/3.0/artifact-c-3.0.pom new file mode 100644 index 000000000..8299fbf11 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/3.0/artifact-c-3.0.pom @@ -0,0 +1,26 @@ + + 4.0.0 + org.apache.maven.archiva.web.test + artifact-c + jar + 3.0 + artifact-c + http://maven.apache.org + + + junit + junit + 3.8.1 + test + + + + + + org.apache.maven.wagon + wagon-webdav + + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/3.0/artifact-c-3.0.pom.md5 b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/3.0/artifact-c-3.0.pom.md5 new file mode 100644 index 000000000..d225acc75 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/3.0/artifact-c-3.0.pom.md5 @@ -0,0 +1 @@ +4df0417579b1492f37da14316adb85af \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/3.0/artifact-c-3.0.pom.sha1 b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/3.0/artifact-c-3.0.pom.sha1 new file mode 100644 index 000000000..1f2435ee6 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/3.0/artifact-c-3.0.pom.sha1 @@ -0,0 +1 @@ +c3b007acd9c17b80753b39a4121255965e7e2e65 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/maven-metadata.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/maven-metadata.xml new file mode 100644 index 000000000..1d7394c7a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/maven-metadata.xml @@ -0,0 +1,11 @@ + + org.apache.maven.archiva.web.test + artifact-c + 3.0 + + + 3.0 + + 20070417090835 + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/maven-metadata.xml.md5 b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/maven-metadata.xml.md5 new file mode 100644 index 000000000..8c0378271 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/maven-metadata.xml.md5 @@ -0,0 +1 @@ +74d58d97e78d5e51cc02c489c5edba0d \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/maven-metadata.xml.sha1 b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/maven-metadata.xml.sha1 new file mode 100644 index 000000000..535860369 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-c/maven-metadata.xml.sha1 @@ -0,0 +1 @@ +5c7571eb35248be0f65758783b036e8f7899c146 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/0.1/artifact-s-0.1.jar.md5 b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/0.1/artifact-s-0.1.jar.md5 new file mode 100644 index 000000000..9d902f06e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/0.1/artifact-s-0.1.jar.md5 @@ -0,0 +1 @@ +55f498a518e1151ce2e54daa674691de \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/0.1/artifact-s-0.1.jar.sha1 b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/0.1/artifact-s-0.1.jar.sha1 new file mode 100644 index 000000000..b351a034e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/0.1/artifact-s-0.1.jar.sha1 @@ -0,0 +1 @@ +730551bde461564d3f8a7e0178ef9bc54a86d2dd \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/0.1/artifact-s-0.1.pom b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/0.1/artifact-s-0.1.pom new file mode 100644 index 000000000..478f8fd50 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/0.1/artifact-s-0.1.pom @@ -0,0 +1,25 @@ + + 4.0.0 + org.apache.maven.archiva.web.test + artifact-s + jar + 0.1 + artifact-s + http://maven.apache.org + + + org.apache.maven.archiva.web.test + artifact-a + 1.0 + + + + + + org.apache.maven.wagon + wagon-webdav + + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/0.1/artifact-s-0.1.pom.md5 b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/0.1/artifact-s-0.1.pom.md5 new file mode 100644 index 000000000..b49dc167a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/0.1/artifact-s-0.1.pom.md5 @@ -0,0 +1 @@ +746ba2848229dbc1c9683ece0e7f02c8 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/0.1/artifact-s-0.1.pom.sha1 b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/0.1/artifact-s-0.1.pom.sha1 new file mode 100644 index 000000000..ae029df5c --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/0.1/artifact-s-0.1.pom.sha1 @@ -0,0 +1 @@ +0d068f63069a86d982075a1dca7fe74fd95a29df \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/maven-metadata.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/maven-metadata.xml new file mode 100644 index 000000000..ddcad75d9 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/maven-metadata.xml @@ -0,0 +1,11 @@ + + org.apache.maven.archiva.web.test + artifact-s + 0.1 + + + 0.1 + + 20070417090721 + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/maven-metadata.xml.md5 b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/maven-metadata.xml.md5 new file mode 100644 index 000000000..f6bd69743 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/maven-metadata.xml.md5 @@ -0,0 +1 @@ +baa0ad0afaba9cee66ec262b38f796b6 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/maven-metadata.xml.sha1 b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/maven-metadata.xml.sha1 new file mode 100644 index 000000000..c341e6296 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/repository/org/apache/maven/archiva/web/test/artifact-s/maven-metadata.xml.sha1 @@ -0,0 +1 @@ +dea84d579f673d2d87c7bd47e4318cdf8e59e4d0 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/.datarefresh b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/.datarefresh new file mode 100644 index 000000000..c53a40aad --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/.datarefresh @@ -0,0 +1,7 @@ +#Last Scan Information, managed by Archiva. DO NOT EDIT +#Thu Apr 19 17:04:36 PHT 2007 +scan.included.files=12 +scan.skipped.files=0 +scan.finished.timestamp=1176973476967 +scan.consumed.files=20 +scan.started.timestamp=1176973467414 diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.jar b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.jar new file mode 100644 index 000000000..033956d43 Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.jar differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.jar.md5 b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.jar.md5 new file mode 100644 index 000000000..0a3eeb690 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.jar.md5 @@ -0,0 +1 @@ +306d556e6e5e4d604dc854d09ddcdefd \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.jar.sha1 b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.jar.sha1 new file mode 100644 index 000000000..39c5c3061 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.jar.sha1 @@ -0,0 +1 @@ +afb6586f5eb4c63dd5735a0bed11c99c7fac6755 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.pom b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.pom new file mode 100644 index 000000000..d580176ff --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.pom @@ -0,0 +1,9 @@ + + 4.0.0 + org.apache.maven.archiva.web.test + foo-bar + 1.0-SNAPSHOT + + deployed + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.pom.md5 b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.pom.md5 new file mode 100644 index 000000000..6caf8be40 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.pom.md5 @@ -0,0 +1 @@ +8e896baea663a45d7bd2737f8e464481 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.pom.sha1 b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.pom.sha1 new file mode 100644 index 000000000..a3bbc7ea1 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/foo-bar-1.0-SNAPSHOT.pom.sha1 @@ -0,0 +1 @@ +e37897c617d78dedd978766a2db318d301e80105 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/maven-metadata.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/maven-metadata.xml new file mode 100644 index 000000000..ab1eb426d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/maven-metadata.xml @@ -0,0 +1,11 @@ + + org.apache.maven.archiva.web.test + foo-bar + 1.0-SNAPSHOT + + + 1 + + 20070425105840 + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/maven-metadata.xml.md5 b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/maven-metadata.xml.md5 new file mode 100644 index 000000000..76ef1e4b3 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/maven-metadata.xml.md5 @@ -0,0 +1 @@ +add4f71a005137e9a296c5b192e900c2 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/maven-metadata.xml.sha1 b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/maven-metadata.xml.sha1 new file mode 100644 index 000000000..ebe7cf339 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/1.0-SNAPSHOT/maven-metadata.xml.sha1 @@ -0,0 +1 @@ +b505e302169e04fc821bf571da7435b1e42ef8d7 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/maven-metadata.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/maven-metadata.xml new file mode 100644 index 000000000..8f00ecefa --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/maven-metadata.xml @@ -0,0 +1,11 @@ + + org.apache.maven.archiva.web.test + foo-bar + 1.0-SNAPSHOT + + + 1.0-SNAPSHOT + + 20070425105840 + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/maven-metadata.xml.md5 b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/maven-metadata.xml.md5 new file mode 100644 index 000000000..f6270d9c8 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/maven-metadata.xml.md5 @@ -0,0 +1 @@ +f3b657fb48d2e82fee5fada169756938 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/maven-metadata.xml.sha1 b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/maven-metadata.xml.sha1 new file mode 100644 index 000000000..7f4812f9f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/resources/snapshots/org/apache/maven/archiva/web/test/foo-bar/maven-metadata.xml.sha1 @@ -0,0 +1 @@ +f4629e609deb95cefdcdddc6dd8c2942d1c3e47f \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/tomcat5x/conf/Catalina/localhost/archiva.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/tomcat5x/conf/Catalina/localhost/archiva.xml new file mode 100644 index 000000000..180dbb742 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/tomcat5x/conf/Catalina/localhost/archiva.xml @@ -0,0 +1,36 @@ + + + + + + + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/tomcat5x/conf/Catalina/localhost/host-manager.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/tomcat5x/conf/Catalina/localhost/host-manager.xml new file mode 100644 index 000000000..e41e1a918 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/tomcat5x/conf/Catalina/localhost/host-manager.xml @@ -0,0 +1,32 @@ + + + + + + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/tomcat5x/conf/Catalina/localhost/manager.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/tomcat5x/conf/Catalina/localhost/manager.xml new file mode 100644 index 000000000..29abc9f1c --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/tomcat5x/conf/Catalina/localhost/manager.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/tomcat5x/conf/catalina.policy b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/tomcat5x/conf/catalina.policy new file mode 100644 index 000000000..53a6c90e2 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/tomcat5x/conf/catalina.policy @@ -0,0 +1,172 @@ +// ============================================================================ +// catalina.corepolicy - Security Policy Permissions for Tomcat 5 +// +// This file contains a default set of security policies to be enforced (by the +// JVM) when Catalina is executed with the "-security" option. In addition +// to the permissions granted here, the following additional permissions are +// granted to the codebase specific to each web application: +// +// * Read access to the document root directory +// +// $Id: catalina.policy 393732 2006-04-13 06:32:25Z pero $ +// ============================================================================ + + +// ========== SYSTEM CODE PERMISSIONS ========================================= + + +// These permissions apply to javac +grant codeBase "file:${java.home}/lib/-" { + permission java.security.AllPermission; +}; + +// These permissions apply to all shared system extensions +grant codeBase "file:${java.home}/jre/lib/ext/-" { + permission java.security.AllPermission; +}; + +// These permissions apply to javac when ${java.home] points at $JAVA_HOME/jre +grant codeBase "file:${java.home}/../lib/-" { + permission java.security.AllPermission; +}; + +// These permissions apply to all shared system extensions when +// ${java.home} points at $JAVA_HOME/jre +grant codeBase "file:${java.home}/lib/ext/-" { + permission java.security.AllPermission; +}; + + +// ========== CATALINA CODE PERMISSIONS ======================================= + + +// These permissions apply to the launcher code +grant codeBase "file:${catalina.home}/bin/commons-launcher.jar" { + permission java.security.AllPermission; +}; + +// These permissions apply to the daemon code +grant codeBase "file:${catalina.home}/bin/commons-daemon.jar" { + permission java.security.AllPermission; +}; + +// These permissions apply to the commons-logging API +grant codeBase "file:${catalina.home}/bin/commons-logging-api.jar" { + permission java.security.AllPermission; +}; + +// These permissions apply to the server startup code +grant codeBase "file:${catalina.home}/bin/bootstrap.jar" { + permission java.security.AllPermission; +}; + +// These permissions apply to the JMX server +grant codeBase "file:${catalina.home}/bin/jmx.jar" { + permission java.security.AllPermission; +}; + +// These permissions apply to JULI +grant codeBase "file:${catalina.home}/bin/tomcat-juli.jar" { + permission java.security.AllPermission; +}; + +// These permissions apply to the servlet API classes +// and those that are shared across all class loaders +// located in the "common" directory +grant codeBase "file:${catalina.home}/common/-" { + permission java.security.AllPermission; +}; + +// These permissions apply to the container's core code, plus any additional +// libraries installed in the "server" directory +grant codeBase "file:${catalina.home}/server/-" { + permission java.security.AllPermission; +}; + +// The permissions granted to the balancer WEB-INF/classes and WEB-INF/lib directory +grant codeBase "file:${catalina.home}/webapps/balancer/-" { + permission java.lang.RuntimePermission "accessClassInPackage.org.apache.tomcat.util.digester"; + permission java.lang.RuntimePermission "accessClassInPackage.org.apache.tomcat.util.digester.*"; +}; +// ========== WEB APPLICATION PERMISSIONS ===================================== + + +// These permissions are granted by default to all web applications +// In addition, a web application will be given a read FilePermission +// and JndiPermission for all files and directories in its document root. +grant { + // Required for JNDI lookup of named JDBC DataSource's and + // javamail named MimePart DataSource used to send mail + permission java.util.PropertyPermission "java.home", "read"; + permission java.util.PropertyPermission "java.naming.*", "read"; + permission java.util.PropertyPermission "javax.sql.*", "read"; + + // OS Specific properties to allow read access + permission java.util.PropertyPermission "os.name", "read"; + permission java.util.PropertyPermission "os.version", "read"; + permission java.util.PropertyPermission "os.arch", "read"; + permission java.util.PropertyPermission "file.separator", "read"; + permission java.util.PropertyPermission "path.separator", "read"; + permission java.util.PropertyPermission "line.separator", "read"; + + // JVM properties to allow read access + permission java.util.PropertyPermission "java.version", "read"; + permission java.util.PropertyPermission "java.vendor", "read"; + permission java.util.PropertyPermission "java.vendor.url", "read"; + permission java.util.PropertyPermission "java.class.version", "read"; + permission java.util.PropertyPermission "java.specification.version", "read"; + permission java.util.PropertyPermission "java.specification.vendor", "read"; + permission java.util.PropertyPermission "java.specification.name", "read"; + + permission java.util.PropertyPermission "java.vm.specification.version", "read"; + permission java.util.PropertyPermission "java.vm.specification.vendor", "read"; + permission java.util.PropertyPermission "java.vm.specification.name", "read"; + permission java.util.PropertyPermission "java.vm.version", "read"; + permission java.util.PropertyPermission "java.vm.vendor", "read"; + permission java.util.PropertyPermission "java.vm.name", "read"; + + // Required for OpenJMX + permission java.lang.RuntimePermission "getAttribute"; + + // Allow read of JAXP compliant XML parser debug + permission java.util.PropertyPermission "jaxp.debug", "read"; + + // Precompiled JSPs need access to this package. + permission java.lang.RuntimePermission "accessClassInPackage.org.apache.jasper.runtime"; + permission java.lang.RuntimePermission "accessClassInPackage.org.apache.jasper.runtime.*"; + +}; + + +// You can assign additional permissions to particular web applications by +// adding additional "grant" entries here, based on the code base for that +// application, /WEB-INF/classes/, or /WEB-INF/lib/ jar files. +// +// Different permissions can be granted to JSP pages, classes loaded from +// the /WEB-INF/classes/ directory, all jar files in the /WEB-INF/lib/ +// directory, or even to individual jar files in the /WEB-INF/lib/ directory. +// +// For instance, assume that the standard "examples" application +// included a JDBC driver that needed to establish a network connection to the +// corresponding database and used the scrape taglib to get the weather from +// the NOAA web server. You might create a "grant" entries like this: +// +// The permissions granted to the context root directory apply to JSP pages. +// grant codeBase "file:${catalina.home}/webapps/examples/-" { +// permission java.net.SocketPermission "dbhost.mycompany.com:5432", "connect"; +// permission java.net.SocketPermission "*.noaa.gov:80", "connect"; +// }; +// +// The permissions granted to the context WEB-INF/classes directory +// grant codeBase "file:${catalina.home}/webapps/examples/WEB-INF/classes/-" { +// }; +// +// The permission granted to your JDBC driver +// grant codeBase "jar:file:${catalina.home}/webapps/examples/WEB-INF/lib/driver.jar!/-" { +// permission java.net.SocketPermission "dbhost.mycompany.com:5432", "connect"; +// }; +// The permission granted to the scrape taglib +// grant codeBase "jar:file:${catalina.home}/webapps/examples/WEB-INF/lib/scrape.jar!/-" { +// permission java.net.SocketPermission "*.noaa.gov:80", "connect"; +// }; + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/tomcat5x/conf/catalina.properties b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/tomcat5x/conf/catalina.properties new file mode 100644 index 000000000..3e937aced --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/tomcat5x/conf/catalina.properties @@ -0,0 +1,85 @@ +# +# 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. +# + +# +# List of comma-separated packages that start with or equal this string +# will cause a security exception to be thrown when +# passed to checkPackageAccess unless the +# corresponding RuntimePermission ("accessClassInPackage."+package) has +# been granted. +package.access=sun.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper.,sun.beans. +# +# List of comma-separated packages that start with or equal this string +# will cause a security exception to be thrown when +# passed to checkPackageDefinition unless the +# corresponding RuntimePermission ("defineClassInPackage."+package) has +# been granted. +# +# by default, no packages are restricted for definition, and none of +# the class loaders supplied with the JDK call checkPackageDefinition. +# +package.definition=sun.,java.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper. + +# +# +# List of comma-separated paths defining the contents of the "common" +# classloader. Prefixes should be used to define what is the repository type. +# Path may be relative to the CATALINA_HOME or CATALINA_BASE path or absolute. +# If left as blank,the JVM system loader will be used as Catalina's "common" +# loader. +# Examples: +# "foo": Add this folder as a class repository +# "foo/*.jar": Add all the JARs of the specified folder as class +# repositories +# "foo/bar.jar": Add bar.jar as a class repository +common.loader=${catalina.home}/common/classes,${catalina.home}/common/i18n/*.jar,${catalina.home}/common/endorsed/*.jar,${catalina.home}/common/lib/*.jar + +# +# List of comma-separated paths defining the contents of the "server" +# classloader. Prefixes should be used to define what is the repository type. +# Path may be relative to the CATALINA_HOME or CATALINA_BASE path or absolute. +# If left as blank, the "common" loader will be used as Catalina's "server" +# loader. +# Examples: +# "foo": Add this folder as a class repository +# "foo/*.jar": Add all the JARs of the specified folder as class +# repositories +# "foo/bar.jar": Add bar.jar as a class repository +server.loader=${catalina.home}/server/classes,${catalina.home}/server/lib/*.jar + +# +# List of comma-separated paths defining the contents of the "shared" +# classloader. Prefixes should be used to define what is the repository type. +# Path may be relative to the CATALINA_BASE path or absolute. If left as blank, +# the "common" loader will be used as Catalina's "shared" loader. +# Examples: +# "foo": Add this folder as a class repository +# "foo/*.jar": Add all the JARs of the specified folder as class +# repositories +# "foo/bar.jar": Add bar.jar as a class repository +# Please note that for individual jar files, e.g. bar.jar, you need the URL form +# starting with file:. +shared.loader=${catalina.base}/shared/classes,${catalina.base}/shared/lib/*.jar + +# +# String cache configuration. +tomcat.util.buf.StringCache.byte.enabled=true +#tomcat.util.buf.StringCache.char.enabled=true +#tomcat.util.buf.StringCache.trainThreshold=500000 +#tomcat.util.buf.StringCache.cacheSize=5000 diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/tomcat5x/conf/context.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/tomcat5x/conf/context.xml new file mode 100644 index 000000000..895adb9b1 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/tomcat5x/conf/context.xml @@ -0,0 +1,31 @@ + + + + + + + WEB-INF/web.xml + + + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/tomcat5x/conf/logging.properties b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/tomcat5x/conf/logging.properties new file mode 100644 index 000000000..07f85e265 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/tomcat5x/conf/logging.properties @@ -0,0 +1,74 @@ +# +# 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. +# + +handlers = 1catalina.org.apache.juli.FileHandler, 2localhost.org.apache.juli.FileHandler, 3manager.org.apache.juli.FileHandler, 4admin.org.apache.juli.FileHandler, 5host-manager.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler + +.handlers = 1catalina.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler + +############################################################ +# Handler specific properties. +# Describes specific configuration info for Handlers. +############################################################ + +1catalina.org.apache.juli.FileHandler.level = FINE +1catalina.org.apache.juli.FileHandler.directory = ${catalina.base}/logs +1catalina.org.apache.juli.FileHandler.prefix = catalina. + +2localhost.org.apache.juli.FileHandler.level = FINE +2localhost.org.apache.juli.FileHandler.directory = ${catalina.base}/logs +2localhost.org.apache.juli.FileHandler.prefix = localhost. + +3manager.org.apache.juli.FileHandler.level = FINE +3manager.org.apache.juli.FileHandler.directory = ${catalina.base}/logs +3manager.org.apache.juli.FileHandler.prefix = manager. + +4admin.org.apache.juli.FileHandler.level = FINE +4admin.org.apache.juli.FileHandler.directory = ${catalina.base}/logs +4admin.org.apache.juli.FileHandler.prefix = admin. + +5host-manager.org.apache.juli.FileHandler.level = FINE +5host-manager.org.apache.juli.FileHandler.directory = ${catalina.base}/logs +5host-manager.org.apache.juli.FileHandler.prefix = host-manager. + +java.util.logging.ConsoleHandler.level = FINE +java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter + + +############################################################ +# Facility specific properties. +# Provides extra control for each logger. +############################################################ + +org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = INFO +org.apache.catalina.core.ContainerBase.[Catalina].[localhost].handlers = 2localhost.org.apache.juli.FileHandler + +org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].level = INFO +org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].handlers = 3manager.org.apache.juli.FileHandler + +org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/admin].level = INFO +org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/admin].handlers = 4admin.org.apache.juli.FileHandler + +org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].level = INFO +org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].handlers = 5host-manager.org.apache.juli.FileHandler + +# For example, set the com.xyz.foo logger to only log SEVERE +# messages: +#org.apache.catalina.startup.ContextConfig.level = FINE +#org.apache.catalina.startup.HostConfig.level = FINE +#org.apache.catalina.session.ManagerBase.level = FINE diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/tomcat5x/conf/server-minimal.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/tomcat5x/conf/server-minimal.xml new file mode 100644 index 000000000..316475801 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/tomcat5x/conf/server-minimal.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/tomcat5x/conf/server.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/tomcat5x/conf/server.xml new file mode 100644 index 000000000..22a041059 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/tomcat5x/conf/server.xml @@ -0,0 +1,384 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/tomcat5x/conf/tomcat-users.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/tomcat5x/conf/tomcat-users.xml new file mode 100644 index 000000000..472566645 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/tomcat5x/conf/tomcat-users.xml @@ -0,0 +1,29 @@ + + + + + + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/tomcat5x/conf/web.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/tomcat5x/conf/web.xml new file mode 100644 index 000000000..0263f1e46 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp-test/src/test/tomcat5x/conf/web.xml @@ -0,0 +1,1183 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + default + org.apache.catalina.servlets.DefaultServlet + + debug + 0 + + + listings + false + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + jsp + org.apache.jasper.servlet.JspServlet + + fork + false + + + xpoweredBy + false + + 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + default + / + + + + + + + + jsp + *.jsp + + + + jsp + *.jspx + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 30 + + + + + + + + + + + + abs + audio/x-mpeg + + + ai + application/postscript + + + aif + audio/x-aiff + + + aifc + audio/x-aiff + + + aiff + audio/x-aiff + + + aim + application/x-aim + + + art + image/x-jg + + + asf + video/x-ms-asf + + + asx + video/x-ms-asf + + + au + audio/basic + + + avi + video/x-msvideo + + + avx + video/x-rad-screenplay + + + bcpio + application/x-bcpio + + + bin + application/octet-stream + + + bmp + image/bmp + + + body + text/html + + + cdf + application/x-netcdf + + + cer + application/x-x509-ca-cert + + + class + application/java + + + cpio + application/x-cpio + + + csh + application/x-csh + + + css + text/css + + + dib + image/bmp + + + doc + application/msword + + + dtd + application/xml-dtd + + + dv + video/x-dv + + + dvi + application/x-dvi + + + eps + application/postscript + + + etx + text/x-setext + + + exe + application/octet-stream + + + gif + image/gif + + + gtar + application/x-gtar + + + gz + application/x-gzip + + + hdf + application/x-hdf + + + htc + text/x-component + + + htm + text/html + + + html + text/html + + + hqx + application/mac-binhex40 + + + ico + image/x-icon + + + ief + image/ief + + + jad + text/vnd.sun.j2me.app-descriptor + + + jar + application/java-archive + + + java + text/plain + + + jnlp + application/x-java-jnlp-file + + + jpe + image/jpeg + + + jpeg + image/jpeg + + + jpg + image/jpeg + + + js + text/javascript + + + jsf + text/plain + + + jspf + text/plain + + + kar + audio/midi + + + latex + application/x-latex + + + m3u + audio/x-mpegurl + + + mac + image/x-macpaint + + + man + application/x-troff-man + + + mathml + application/mathml+xml + + + me + application/x-troff-me + + + mid + audio/midi + + + midi + audio/midi + + + mif + application/vnd.mif + + + mov + video/quicktime + + + movie + video/x-sgi-movie + + + mp1 + audio/x-mpeg + + + mp2 + audio/mpeg + + + mp3 + audio/mpeg + + + mpa + audio/x-mpeg + + + mpe + video/mpeg + + + mpeg + video/mpeg + + + mpega + audio/x-mpeg + + + mpg + video/mpeg + + + mpv2 + video/mpeg2 + + + ms + application/x-troff-ms + + + nc + application/x-netcdf + + + oda + application/oda + + + + odb + application/vnd.oasis.opendocument.database + + + + odc + application/vnd.oasis.opendocument.chart + + + + odf + application/vnd.oasis.opendocument.formula + + + + odg + application/vnd.oasis.opendocument.graphics + + + + odi + application/vnd.oasis.opendocument.image + + + + odm + application/vnd.oasis.opendocument.text-master + + + + odp + application/vnd.oasis.opendocument.presentation + + + + ods + application/vnd.oasis.opendocument.spreadsheet + + + + odt + application/vnd.oasis.opendocument.text + + + ogg + application/ogg + + + + otg + application/vnd.oasis.opendocument.graphics-template + + + + oth + application/vnd.oasis.opendocument.text-web + + + + otp + application/vnd.oasis.opendocument.presentation-template + + + + ots + application/vnd.oasis.opendocument.spreadsheet-template + + + + ott + application/vnd.oasis.opendocument.text-template + + + pbm + image/x-portable-bitmap + + + pct + image/pict + + + pdf + application/pdf + + + pgm + image/x-portable-graymap + + + pic + image/pict + + + pict + image/pict + + + pls + audio/x-scpls + + + png + image/png + + + pnm + image/x-portable-anymap + + + pnt + image/x-macpaint + + + ppm + image/x-portable-pixmap + + + pps + application/vnd.ms-powerpoint + + + ppt + application/vnd.ms-powerpoint + + + ps + application/postscript + + + psd + image/x-photoshop + + + qt + video/quicktime + + + qti + image/x-quicktime + + + qtif + image/x-quicktime + + + ras + image/x-cmu-raster + + + rdf + application/rdf+xml + + + rgb + image/x-rgb + + + rm + application/vnd.rn-realmedia + + + roff + application/x-troff + + + rtf + text/rtf + + + rtx + text/richtext + + + sh + application/x-sh + + + shar + application/x-shar + + + + smf + audio/x-midi + + + sit + application/x-stuffit + + + snd + audio/basic + + + src + application/x-wais-source + + + sv4cpio + application/x-sv4cpio + + + sv4crc + application/x-sv4crc + + + svg + image/svg+xml + + + svgz + image/svg + + + swf + application/x-shockwave-flash + + + t + application/x-troff + + + tar + application/x-tar + + + tcl + application/x-tcl + + + tex + application/x-tex + + + texi + application/x-texinfo + + + texinfo + application/x-texinfo + + + tif + image/tiff + + + tiff + image/tiff + + + tr + application/x-troff + + + tsv + text/tab-separated-values + + + txt + text/plain + + + ulw + audio/basic + + + ustar + application/x-ustar + + + vrml + model/vrml + + + vsd + application/x-visio + + + vxml + application/voicexml+xml + + + wav + audio/x-wav + + + + wbmp + image/vnd.wap.wbmp + + + + wml + text/vnd.wap.wml + + + + wmlc + application/vnd.wap.wmlc + + + + wmls + text/vnd.wap.wmlscript + + + + wmlscriptc + application/vnd.wap.wmlscriptc + + + wrl + model/vrml + + + xbm + image/x-xbitmap + + + xht + application/xhtml+xml + + + xhtml + application/xhtml+xml + + + xls + application/vnd.ms-excel + + + xml + application/xml + + + xpm + image/x-xpixmap + + + xsl + application/xml + + + xslt + application/xslt+xml + + + xul + application/vnd.mozilla.xul+xml + + + xwd + image/x-xwindowdump + + + Z + application/x-compress + + + z + application/x-compress + + + zip + application/zip + + + + + + + + + + + + + + + + index.html + index.htm + index.jsp + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/pom.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp/pom.xml new file mode 100644 index 000000000..7e1927a81 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/pom.xml @@ -0,0 +1,530 @@ + + + + + 4.0.0 + + org.apache.archiva + archiva-web + 1.2-SNAPSHOT + ../pom.xml + + archiva-webapp + war + Archiva Web :: Application + + + org.apache.archiva + archiva-report-manager + + + org.apache.archiva + archiva-scheduled + + + org.apache.archiva + archiva-indexer + + + org.apache.archiva + archiva-proxy + + + org.apache.archiva + archiva-database + + + org.apache.archiva + archiva-repository-layer + + + org.apache.archiva + archiva-security + + + org.apache.archiva + archiva-core-consumers + + + org.apache.archiva + archiva-database-consumers + + + org.apache.archiva + archiva-lucene-consumers + + + org.apache.archiva + archiva-signature-consumers + + + org.apache.archiva + archiva-applet + + provided + + + org.apache.archiva + archiva-rss + + + javax.servlet + servlet-api + provided + + + javax.servlet + jsp-api + provided + + + opensymphony + sitemesh + + + taglibs + standard + + + javax.servlet + jstl + + + org.codehaus.plexus + plexus-slf4j-logging + runtime + + + org.slf4j + slf4j-log4j12 + + + commons-lang + commons-lang + + + com.opensymphony + webwork + + + org.codehaus.plexus.registry + plexus-registry-api + + + org.codehaus.plexus.registry + plexus-registry-commons + + + org.codehaus.plexus.cache + plexus-cache-api + + + org.codehaus.plexus.cache + plexus-cache-ehcache + + + org.codehaus.plexus + plexus-component-api + + + + org.codehaus.plexus.redback + redback-xwork-content + war + runtime + + + org.codehaus.plexus.redback + redback-xwork-integration + + + org.codehaus.plexus.redback + redback-taglib + + + + org.apache.archiva + archiva-webdav + + + commons-io + commons-io + + + org.springframework + spring-web + + + org.apache.derby + derby + provided + + + javax.mail + mail + provided + + + javax.activation + activation + provided + + + org.codehaus.plexus + plexus-quartz + + + org.codehaus.plexus + plexus-taskqueue + + + commons-fileupload + commons-fileupload + + + commons-codec + commons-codec + + + stax + stax + + + org.apache.maven.wagon + wagon-http-lightweight + runtime + + + org.apache.maven.wagon + wagon-file + runtime + + + commons-logging + commons-logging-api + 1.1 + + + + + + src/main/resources + + + src/main/filtered-resources + true + + + + + + org.apache.maven.plugins + maven-clean-plugin + 2.1.1 + + + + + ${basedir}/src/main/webapp + + + META-INF + archiva-applet.jar + images/redback + + template/redback + + WEB-INF/classes + + WEB-INF/lib + + WEB-INF/database + + WEB-INF/logs + + redback + + css/redback + WEB-INF/jsp/redback + + WEB-INF/template/redback + + WEB-INF/logs + + WEB-INF/temp + + WEB-INF/jasperreports + + + + + + + + org.apache.maven.plugins + maven-war-plugin + 2.0.1 + + + false + META-INF/**,WEB-INF/web.xml,WEB-INF/classes/xwork.xml + WEB-INF/lib/xalan-*.jar,WEB-INF/lib/velocity-dep-*.jar,WEB-INF/lib/xml-apis-*.jar,WEB-INF/lib/wstx-asl-*.jar,WEB-INF/lib/stax-utils-*.jar,WEB-INF/lib/xercesImpl-*.jar + + + + + compile + + + inplace + + + + + + org.mortbay.jetty + maven-jetty-plugin + 6.1.1 + + 10 + / + src/jetty-env.xml + + + 9091 + 60000 + + + + + plexus.home + ${project.build.directory}/appserver-base + + + appserver.base + ${project.build.directory}/appserver-base + + + appserver.home + ${project.build.directory}/appserver-home + + + derby.system.home + ${project.build.directory}/appserver-base/logs + + + + + + org.apache.derby + derby + 10.1.3.1 + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 2.0 + + + copy + process-resources + + copy + + + + + ${project.groupId} + archiva-applet + ${project.version} + src/main/webapp + archiva-applet.jar + + + + + + + + org.codehaus.plexus + plexus-maven-plugin + + + + com.opensymphony.xwork.Action + per-lookup + + + + + + maven-antrun-plugin + 1.1 + + + generate-resources + + run + + + + + + + + + + + + + + + + mysql + + + mysql + mysql-connector-java + 5.0.4 + + + + + + org.mortbay.jetty + maven-jetty-plugin + + src/jetty-env-mysql.xml + + + + + + + postgres + + + postgresql + postgresql + 8.2-504.jdbc3 + + + + + + org.mortbay.jetty + maven-jetty-plugin + + src/jetty-env-postgres.xml + + + + + + + + jasper + + + jasperreports + jasperreports + 1.2.0 + + + + + + org.codehaus.mojo + jasperreports-maven-plugin + 1.0-SNAPSHOT + + + compile + + compile-reports + + + + + src/main/webapp/WEB-INF/jasperreports + + + + + + + Codehaus Snapshots + http://snapshots.repository.codehaus.org/ + + true + + + false + + + + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/appserver-base/conf/shared.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/appserver-base/conf/shared.xml new file mode 100644 index 000000000..9afb83352 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/appserver-base/conf/shared.xml @@ -0,0 +1 @@ + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/appserver-base/logs/.donotdelete b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/appserver-base/logs/.donotdelete new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/jetty-env-mysql.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/jetty-env-mysql.xml new file mode 100644 index 000000000..989988361 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/jetty-env-mysql.xml @@ -0,0 +1,161 @@ + + + + + + + + mail/Session + + + + + + + localhost + 25 + + + + + + + + + + + jdbc/archiva + + + localhost + archiva + archiva + sa + + + + + + jdbc/archivaShutdown + + + + localhost + archiva + archiva + sa + + + + + + + jdbc/users + + + + localhost + redback + archiva + sa + + + + + + jdbc/usersShutdown + + + jdbc:mysql://localhost/redback + archiva + sa + + + + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/jetty-env-postgres.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/jetty-env-postgres.xml new file mode 100644 index 000000000..8914ac44a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/jetty-env-postgres.xml @@ -0,0 +1,92 @@ + + + + + + + + + + + + mail/Session + + + + + + + localhost + continuum@localhost + Continuum + true + + + + + + + + jdbc/archiva + + + localhost + archiva + postgres + sparky + + + + + jdbc/archiva_shutdown + + + localhost + archiva + postgres + sparky + + + + + jdbc/users + + + localhost + users + postgres + sparky + + + + + jdbc/users_shutdown + + + localhost + users + postgres + sparky + + + + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/jetty-env.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/jetty-env.xml new file mode 100644 index 000000000..6774b0e32 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/jetty-env.xml @@ -0,0 +1,89 @@ + + + + + + + + mail/Session + + + + + + + localhost + archiva@localhost + Archiva + true + + + + + + + + + jdbc/archiva + + + ../databases/archiva + sa + create + + + + + + jdbc/archivaShutdown + + + ../databases/archiva + sa + shutdown + + + + + + + jdbc/users + + + ../databases/users + sa + create + + + + + + jdbc/usersShutdown + + + ../databases/users + sa + shutdown + + + + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/filtered-resources/application.properties b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/filtered-resources/application.properties new file mode 100644 index 000000000..ba4360776 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/filtered-resources/application.properties @@ -0,0 +1 @@ +user.agent=Apache Archiva/${project.version} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/jasperreports/report.jrxml b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/jasperreports/report.jrxml new file mode 100644 index 000000000..bebb368d3 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/jasperreports/report.jrxml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + <band height="50"> + <staticText> + <reportElement x="0" y="0" width="1040" height="50"/> + <textElement textAlignment="Center"> + <font size="14" isBold="true"/> + </textElement> + <text><![CDATA[Archiva Report]]></text> + </staticText> + </band> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/BrowseAction.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/BrowseAction.java new file mode 100644 index 000000000..7dee82270 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/BrowseAction.java @@ -0,0 +1,183 @@ +package org.apache.maven.archiva.web.action; + +/* + * 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.Collections; +import java.util.List; + +import com.opensymphony.xwork.ActionContext; +import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.maven.archiva.database.browsing.BrowsingResults; +import org.apache.maven.archiva.database.browsing.RepositoryBrowsing; +import org.apache.maven.archiva.security.*; +import org.apache.maven.archiva.security.ArchivaXworkUser; +import org.codehaus.plexus.xwork.action.PlexusActionSupport; + +/** + * Browse the repository. + * + * @todo cache browsing results. + * @todo implement repository selectors (all or specific repository) + * @todo implement security around browse (based on repository id at first) + * @plexus.component role="com.opensymphony.xwork.Action" role-hint="browseAction" + */ +public class BrowseAction + extends PlexusActionSupport +{ + /** + * @plexus.requirement role-hint="default" + */ + private RepositoryBrowsing repoBrowsing; + + /** + * @plexus.requirement + */ + private UserRepositories userRepositories; + + private BrowsingResults results; + + private String groupId; + + private String artifactId; + + private String repositoryId; + + public String browse() + { + List selectedRepos = getObservableRepos(); + if ( CollectionUtils.isEmpty( selectedRepos ) ) + { + return GlobalResults.ACCESS_TO_NO_REPOS; + } + + this.results = repoBrowsing.getRoot( getPrincipal(), selectedRepos ); + return SUCCESS; + } + + public String browseGroup() + { + if ( StringUtils.isEmpty( groupId ) ) + { + // TODO: i18n + addActionError( "You must specify a group ID to browse" ); + return ERROR; + } + + List selectedRepos = getObservableRepos(); + if ( CollectionUtils.isEmpty( selectedRepos ) ) + { + return GlobalResults.ACCESS_TO_NO_REPOS; + } + + + this.results = repoBrowsing.selectGroupId( getPrincipal(), selectedRepos, groupId ); + return SUCCESS; + } + + public String browseArtifact() + { + if ( StringUtils.isEmpty( groupId ) ) + { + // TODO: i18n + addActionError( "You must specify a group ID to browse" ); + return ERROR; + } + + if ( StringUtils.isEmpty( artifactId ) ) + { + // TODO: i18n + addActionError( "You must specify a artifact ID to browse" ); + return ERROR; + } + + List selectedRepos = getObservableRepos(); + if ( CollectionUtils.isEmpty( selectedRepos ) ) + { + return GlobalResults.ACCESS_TO_NO_REPOS; + } + + + this.results = repoBrowsing.selectArtifactId( getPrincipal(), selectedRepos, groupId, artifactId ); + return SUCCESS; + } + + private String getPrincipal() + { + return ArchivaXworkUser.getActivePrincipal( ActionContext.getContext().getSession() ); + } + + private List getObservableRepos() + { + try + { + return userRepositories.getObservableRepositoryIds( getPrincipal() ); + } + catch ( PrincipalNotFoundException e ) + { + getLogger().warn( e.getMessage(), e ); + } + catch ( AccessDeniedException e ) + { + getLogger().warn( e.getMessage(), e ); + // TODO: pass this onto the screen. + } + catch ( ArchivaSecurityException e ) + { + getLogger().warn( e.getMessage(), e ); + } + return Collections.emptyList(); + } + + public String getGroupId() + { + return groupId; + } + + public void setGroupId( String groupId ) + { + this.groupId = groupId; + } + + public String getArtifactId() + { + return artifactId; + } + + public void setArtifactId( String artifactId ) + { + this.artifactId = artifactId; + } + + public BrowsingResults getResults() + { + return results; + } + + public String getRepositoryId(){ + + return repositoryId; + } + + public void setRepositoryId(String repositoryId){ + + this.repositoryId = repositoryId; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/GlobalResults.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/GlobalResults.java new file mode 100644 index 000000000..7552dfa1b --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/GlobalResults.java @@ -0,0 +1,31 @@ +package org.apache.maven.archiva.web.action; + +/* + * 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. + */ + +/** + * GlobalResults - constants for global result definitions. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class GlobalResults +{ + public static final String ACCESS_TO_NO_REPOS = "access_to_no_repos"; +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/SearchAction.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/SearchAction.java new file mode 100644 index 000000000..39c3bb361 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/SearchAction.java @@ -0,0 +1,340 @@ +package org.apache.maven.archiva.web.action; + +/* + * 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.net.MalformedURLException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import com.opensymphony.xwork.ActionContext; +import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.maven.archiva.database.ArchivaDAO; +import org.apache.maven.archiva.database.Constraint; +import org.apache.maven.archiva.database.constraints.ArtifactsByChecksumConstraint; +import org.apache.maven.archiva.indexer.RepositoryIndexException; +import org.apache.maven.archiva.indexer.RepositoryIndexSearchException; +import org.apache.maven.archiva.indexer.search.CrossRepositorySearch; +import org.apache.maven.archiva.indexer.search.SearchResultLimits; +import org.apache.maven.archiva.indexer.search.SearchResults; +import org.apache.maven.archiva.security.AccessDeniedException; +import org.apache.maven.archiva.security.ArchivaSecurityException; +import org.apache.maven.archiva.security.ArchivaXworkUser; +import org.apache.maven.archiva.security.PrincipalNotFoundException; +import org.apache.maven.archiva.security.UserRepositories; +import org.codehaus.plexus.xwork.action.PlexusActionSupport; + +/** + * Search all indexed fields by the given criteria. + * + * @plexus.component role="com.opensymphony.xwork.Action" role-hint="searchAction" + */ +public class SearchAction + extends PlexusActionSupport +{ + /** + * Query string. + */ + private String q; + + /** + * @plexus.requirement role-hint="jdo" + */ + private ArchivaDAO dao; + + /** + * The Search Results. + */ + private SearchResults results; + + /** + * @plexus.requirement role-hint="default" + */ + private CrossRepositorySearch crossRepoSearch; + + /** + * @plexus.requirement + */ + private UserRepositories userRepositories; + + private static final String RESULTS = "results"; + + private static final String ARTIFACT = "artifact"; + + private List databaseResults; + + private int currentPage = 0; + + private int totalPages; + + private boolean searchResultsOnly; + + private String completeQueryString; + + private static final String COMPLETE_QUERY_STRING_SEPARATOR = ";"; + + private static final String BYTECODE_KEYWORD = "bytecode:"; + + public String quickSearch() + throws MalformedURLException, RepositoryIndexException, RepositoryIndexSearchException + { + /* TODO: give action message if indexing is in progress. + * This should be based off a count of 'unprocessed' artifacts. + * This (yet to be written) routine could tell the user that X (unprocessed) artifacts are not yet + * present in the full text search. + */ + + assert q != null && q.length() != 0; + + SearchResultLimits limits = new SearchResultLimits( currentPage ); + + List selectedRepos = getObservableRepos(); + if ( CollectionUtils.isEmpty( selectedRepos ) ) + { + return GlobalResults.ACCESS_TO_NO_REPOS; + } + + if( isBytecodeSearch( q ) ) + { + results = crossRepoSearch.searchForBytecode( getPrincipal(), selectedRepos, removeKeyword( q ), limits ); + } + else + { + if( searchResultsOnly && !completeQueryString.equals( "" ) ) + { + results = crossRepoSearch.searchForTerm( getPrincipal(), selectedRepos, q, limits, parseCompleteQueryString() ); + } + else + { + completeQueryString = ""; + results = crossRepoSearch.searchForTerm( getPrincipal(), selectedRepos, q, limits ); + } + } + + if ( results.isEmpty() ) + { + addActionError( "No results found" ); + return INPUT; + } + + totalPages = results.getTotalHits() / limits.getPageSize(); + + if( (results.getTotalHits() % limits.getPageSize()) != 0 ) + { + totalPages = totalPages + 1; + } + // TODO: filter / combine the artifacts by version? (is that even possible with non-artifact hits?) + + /* I don't think that we should, as I expect us to utilize the 'score' system in lucene in + * the future to return relevant links better. + * I expect the lucene scoring system to take multiple hits on different areas of a single document + * to result in a higher score. + * - Joakim + */ + + if( !isEqualToPreviousSearchTerm( q ) ) + { + buildCompleteQueryString( q ); + } + + return SUCCESS; + } + + public String findArtifact() + throws Exception + { + // TODO: give action message if indexing is in progress + + if ( StringUtils.isBlank( q ) ) + { + addActionError( "Unable to search for a blank checksum" ); + return INPUT; + } + + Constraint constraint = new ArtifactsByChecksumConstraint( q ); + databaseResults = dao.getArtifactDAO().queryArtifacts( constraint ); + + if ( databaseResults.isEmpty() ) + { + addActionError( "No results found" ); + return INPUT; + } + + if ( databaseResults.size() == 1 ) + { + // 1 hit? return it's information directly! + return ARTIFACT; + } + + return RESULTS; + } + + @Override + public String doInput() + { + return INPUT; + } + + private String getPrincipal() + { + return ArchivaXworkUser.getActivePrincipal( ActionContext.getContext().getSession() ); + } + + private List getObservableRepos() + { + try + { + return userRepositories.getObservableRepositoryIds( getPrincipal() ); + } + catch ( PrincipalNotFoundException e ) + { + getLogger().warn( e.getMessage(), e ); + } + catch ( AccessDeniedException e ) + { + getLogger().warn( e.getMessage(), e ); + // TODO: pass this onto the screen. + } + catch ( ArchivaSecurityException e ) + { + getLogger().warn( e.getMessage(), e ); + } + return Collections.emptyList(); + } + + private void buildCompleteQueryString( String searchTerm ) + { + if( searchTerm.indexOf( COMPLETE_QUERY_STRING_SEPARATOR ) != -1 ) + { + searchTerm = StringUtils.remove( searchTerm, COMPLETE_QUERY_STRING_SEPARATOR ); + } + + if( completeQueryString == null || "".equals( completeQueryString ) ) + { + completeQueryString = searchTerm; + } + else + { + completeQueryString = completeQueryString + COMPLETE_QUERY_STRING_SEPARATOR + searchTerm; + } + } + + private List parseCompleteQueryString() + { + List parsedCompleteQueryString = new ArrayList(); + String[] parsed = StringUtils.split( completeQueryString, COMPLETE_QUERY_STRING_SEPARATOR ); + CollectionUtils.addAll( parsedCompleteQueryString, parsed ); + + return parsedCompleteQueryString; + } + + private boolean isEqualToPreviousSearchTerm( String searchTerm ) + { + if( !"".equals( completeQueryString ) ) + { + String[] parsed = StringUtils.split( completeQueryString, COMPLETE_QUERY_STRING_SEPARATOR ); + if( StringUtils.equalsIgnoreCase( searchTerm, parsed[ parsed.length - 1 ] ) ) + { + return true; + } + } + + return false; + } + + public String getQ() + { + return q; + } + + public void setQ( String q ) + { + this.q = q; + } + + public SearchResults getResults() + { + return results; + } + + public List getDatabaseResults() + { + return databaseResults; + } + + public void setCurrentPage( int page ) + { + this.currentPage = page; + } + + public int getCurrentPage() + { + return currentPage; + } + + public int getTotalPages() + { + return totalPages; + } + + public void setTotalPages( int totalPages ) + { + this.totalPages = totalPages; + } + + public boolean isSearchResultsOnly() + { + return searchResultsOnly; + } + + public void setSearchResultsOnly( boolean searchResultsOnly ) + { + this.searchResultsOnly = searchResultsOnly; + } + + public String getCompleteQueryString() + { + return completeQueryString; + } + + public void setCompleteQueryString( String completeQueryString ) + { + this.completeQueryString = completeQueryString; + } + + private boolean isBytecodeSearch( String queryString ) + { + if( queryString.startsWith( BYTECODE_KEYWORD ) ) + { + return true; + } + + return false; + } + + private String removeKeyword( String queryString ) + { + String qString = StringUtils.uncapitalize( queryString ); + qString= StringUtils.remove( queryString, BYTECODE_KEYWORD ); + + return qString; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/ShowArtifactAction.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/ShowArtifactAction.java new file mode 100644 index 000000000..97dca610e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/ShowArtifactAction.java @@ -0,0 +1,290 @@ +package org.apache.maven.archiva.web.action; + +/* + * 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.Collections; +import java.util.List; + +import org.apache.commons.lang.StringUtils; +import org.apache.maven.archiva.database.ArchivaDatabaseException; +import org.apache.maven.archiva.database.ObjectNotFoundException; +import org.apache.maven.archiva.database.browsing.RepositoryBrowsing; +import org.apache.maven.archiva.model.ArchivaProjectModel; +import org.apache.maven.archiva.security.AccessDeniedException; +import org.apache.maven.archiva.security.ArchivaSecurityException; +import org.apache.maven.archiva.security.PrincipalNotFoundException; +import org.apache.maven.archiva.security.UserRepositories; +import org.apache.maven.archiva.security.ArchivaXworkUser; +import org.codehaus.plexus.xwork.action.PlexusActionSupport; + +import com.opensymphony.xwork.ActionContext; +import com.opensymphony.xwork.Validateable; + +/** + * Browse the repository. + * + * TODO change name to ShowVersionedAction to conform to terminology. + * + * @plexus.component role="com.opensymphony.xwork.Action" role-hint="showArtifactAction" + */ +public class ShowArtifactAction + extends PlexusActionSupport + implements Validateable +{ + /* .\ Not Exposed \._____________________________________________ */ + + /** + * @plexus.requirement role-hint="default" + */ + private RepositoryBrowsing repoBrowsing; + + /** + * @plexus.requirement + */ + private UserRepositories userRepositories; + + /* .\ Input Parameters \.________________________________________ */ + + private String groupId; + + private String artifactId; + + private String version; + + private String repositoryId; + + /* .\ Exposed Output Objects \.__________________________________ */ + + /** + * The model of this versioned project. + */ + private ArchivaProjectModel model; + + /** + * The list of artifacts that depend on this versioned project. + */ + private List dependees; + + /** + * The reports associated with this versioned project. + */ + private List reports; + + private List mailingLists; + + private List dependencies; + + /** + * Show the versioned project information tab. TODO: Change name to 'project' + */ + public String artifact() + throws ObjectNotFoundException, ArchivaDatabaseException + { + try + { + this.model = + repoBrowsing.selectVersion( getPrincipal(), getObservableRepos(), groupId, artifactId, version ); + this.repositoryId = + repoBrowsing.getRepositoryId( getPrincipal(), getObservableRepos(), groupId, artifactId, version ); + } + catch ( ObjectNotFoundException oe ) + { + addActionError( "Unable to find project model for [" + groupId + ":" + artifactId + ":" + version + "]." ); + + return ERROR; + } + + return SUCCESS; + } + + /** + * Show the artifact information tab. + */ + public String dependencies() + throws ObjectNotFoundException, ArchivaDatabaseException + { + this.model = repoBrowsing.selectVersion( getPrincipal(), getObservableRepos(), groupId, artifactId, version ); + + this.dependencies = model.getDependencies(); + + return SUCCESS; + } + + /** + * Show the mailing lists information tab. + */ + public String mailingLists() + throws ObjectNotFoundException, ArchivaDatabaseException + { + this.model = repoBrowsing.selectVersion( getPrincipal(), getObservableRepos(), groupId, artifactId, version ); + this.mailingLists = model.getMailingLists(); + + return SUCCESS; + } + + /** + * Show the reports tab. + */ + public String reports() + throws ObjectNotFoundException, ArchivaDatabaseException + { + System.out.println( "#### In reports." ); + // TODO: hook up reports on project - this.reports = artifactsDatabase.findArtifactResults( groupId, artifactId, + // version ); + System.out.println( "#### Found " + reports.size() + " reports." ); + + return SUCCESS; + } + + /** + * Show the dependees (other artifacts that depend on this project) tab. + */ + public String dependees() + throws ObjectNotFoundException, ArchivaDatabaseException + { + this.model = repoBrowsing.selectVersion( getPrincipal(), getObservableRepos(), groupId, artifactId, version ); + + this.dependees = repoBrowsing.getUsedBy( getPrincipal(), getObservableRepos(), groupId, artifactId, version ); + + return SUCCESS; + } + + /** + * Show the dependencies of this versioned project tab. + */ + public String dependencyTree() + throws ObjectNotFoundException, ArchivaDatabaseException + { + this.model = repoBrowsing.selectVersion( getPrincipal(), getObservableRepos(), groupId, artifactId, version ); + + return SUCCESS; + } + + private String getPrincipal() + { + return ArchivaXworkUser.getActivePrincipal( ActionContext.getContext().getSession() ); + } + + private List getObservableRepos() + { + try + { + return userRepositories.getObservableRepositoryIds( getPrincipal() ); + } + catch ( PrincipalNotFoundException e ) + { + getLogger().warn( e.getMessage(), e ); + } + catch ( AccessDeniedException e ) + { + getLogger().warn( e.getMessage(), e ); + // TODO: pass this onto the screen. + } + catch ( ArchivaSecurityException e ) + { + getLogger().warn( e.getMessage(), e ); + } + return Collections.emptyList(); + } + + public void validate() + { + if ( StringUtils.isBlank( groupId ) ) + { + addActionError( "You must specify a group ID to browse" ); + } + + if ( StringUtils.isBlank( artifactId ) ) + { + addActionError( "You must specify a artifact ID to browse" ); + } + + if ( StringUtils.isBlank( version ) ) + { + addActionError( "You must specify a version to browse" ); + } + } + + public ArchivaProjectModel getModel() + { + return model; + } + + public String getGroupId() + { + return groupId; + } + + public void setGroupId( String groupId ) + { + this.groupId = groupId; + } + + public String getArtifactId() + { + return artifactId; + } + + public void setArtifactId( String artifactId ) + { + this.artifactId = artifactId; + } + + public String getVersion() + { + return version; + } + + public void setVersion( String version ) + { + this.version = version; + } + + public List getReports() + { + return reports; + } + + public List getMailingLists() + { + return mailingLists; + } + + public List getDependencies() + { + return dependencies; + } + + public List getDependees() + { + return dependees; + } + + public String getRepositoryId() + { + return repositoryId; + } + + public void setRepositoryId( String repositoryId ) + { + this.repositoryId = repositoryId; + } + +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/UploadAction.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/UploadAction.java new file mode 100644 index 000000000..c539f1962 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/UploadAction.java @@ -0,0 +1,633 @@ +package org.apache.maven.archiva.web.action; + +/* + * 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; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.Collections; +import java.util.List; +import java.util.TimeZone; + +import org.apache.archiva.checksum.ChecksumAlgorithm; +import org.apache.archiva.checksum.ChecksummedFile; +import org.apache.maven.archiva.common.utils.VersionComparator; +import org.apache.maven.archiva.common.utils.VersionUtil; +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.model.ArchivaProjectModel; +import org.apache.maven.archiva.model.ArchivaRepositoryMetadata; +import org.apache.maven.archiva.model.ArtifactReference; +import org.apache.maven.archiva.model.SnapshotVersion; +import org.apache.maven.archiva.repository.ManagedRepositoryContent; +import org.apache.maven.archiva.repository.RepositoryContentFactory; +import org.apache.maven.archiva.repository.RepositoryException; +import org.apache.maven.archiva.repository.RepositoryNotFoundException; +import org.apache.maven.archiva.repository.scanner.RepositoryContentConsumers; +import org.apache.maven.archiva.repository.audit.AuditEvent; +import org.apache.maven.archiva.repository.audit.AuditListener; +import org.apache.maven.archiva.repository.audit.Auditable; +import org.apache.maven.archiva.repository.metadata.MetadataTools; +import org.apache.maven.archiva.repository.metadata.RepositoryMetadataException; +import org.apache.maven.archiva.repository.metadata.RepositoryMetadataReader; +import org.apache.maven.archiva.repository.metadata.RepositoryMetadataWriter; +import org.apache.maven.archiva.repository.project.ProjectModelException; +import org.apache.maven.archiva.repository.project.ProjectModelWriter; +import org.apache.maven.archiva.repository.project.writers.ProjectModel400Writer; +import org.apache.maven.archiva.security.ArchivaSecurityException; +import org.apache.maven.archiva.security.PrincipalNotFoundException; +import org.apache.maven.archiva.security.UserRepositories; +import org.apache.maven.archiva.security.ArchivaXworkUser; +import org.codehaus.plexus.xwork.action.PlexusActionSupport; + +import com.opensymphony.webwork.ServletActionContext; +import com.opensymphony.xwork.ActionContext; +import com.opensymphony.xwork.Preparable; +import com.opensymphony.xwork.Validateable; +import org.apache.commons.io.FilenameUtils; +import org.apache.commons.lang.StringUtils; + +/** + * Upload an artifact using Jakarta file upload in webwork. If set by the user a pom will also be generated. Metadata + * will also be updated if one exists, otherwise it would be created. + * + * @author Wendy Smoak + * @author Maria Odea Ching + * @plexus.component role="com.opensymphony.xwork.Action" role-hint="uploadAction" + */ +public class UploadAction + extends PlexusActionSupport + implements Validateable, Preparable, Auditable +{ + /** + * @plexus.requirement + */ + private RepositoryContentConsumers consumers; + + /** + * The groupId of the artifact to be deployed. + */ + private String groupId; + + /** + * The artifactId of the artifact to be deployed. + */ + private String artifactId; + + /** + * The version of the artifact to be deployed. + */ + private String version; + + /** + * The packaging of the artifact to be deployed. + */ + private String packaging; + + /** + * The classifier of the artifact to be deployed. + */ + private String classifier; + + /** + * The temporary file representing the artifact to be deployed. + */ + private File artifactFile; + + /** + * The content type of the artifact to be deployed. + */ + private String artifactContentType; + + /** + * The original filename of the uploaded artifact file. + */ + private String artifactFilename; + + /** + * The temporary file representing the pom to be deployed alongside the artifact. + */ + private File pomFile; + + /** + * The content type of the pom file. + */ + private String pomContentType; + + /** + * The original filename of the uploaded pom file. + */ + private String pomFilename; + + /** + * The repository where the artifact is to be deployed. + */ + private String repositoryId; + + /** + * Flag whether to generate a pom for the artifact or not. + */ + private boolean generatePom; + + /** + * List of managed repositories to deploy to. + */ + private List managedRepoIdList; + + /** + * @plexus.requirement + */ + private UserRepositories userRepositories; + + /** + * @plexus.requirement role-hint="default" + */ + private ArchivaConfiguration configuration; + + /** + * @plexus.requirement + */ + private RepositoryContentFactory repositoryFactory; + + /** + * @plexus.requirement role="org.apache.maven.archiva.repository.audit.AuditListener" + */ + private List auditListeners = new ArrayList(); + + private ChecksumAlgorithm[] algorithms = new ChecksumAlgorithm[] { ChecksumAlgorithm.SHA1, ChecksumAlgorithm.MD5 }; + + private ProjectModelWriter pomWriter = new ProjectModel400Writer(); + + public void setArtifact( File file ) + { + this.artifactFile = file; + } + + public void setArtifactContentType( String contentType ) + { + this.artifactContentType = contentType; + } + + public void setArtifactFileName( String filename ) + { + this.artifactFilename = filename; + } + + public void setPom( File file ) + { + this.pomFile = file; + } + + public void setPomContentType( String contentType ) + { + this.pomContentType = contentType; + } + + public void setPomFileName( String filename ) + { + this.pomFilename = filename; + } + + public String getGroupId() + { + return groupId; + } + + public void setGroupId( String groupId ) + { + this.groupId = groupId; + } + + public String getArtifactId() + { + return artifactId; + } + + public void setArtifactId( String artifactId ) + { + this.artifactId = artifactId; + } + + public String getVersion() + { + return version; + } + + public void setVersion( String version ) + { + this.version = version; + } + + public String getPackaging() + { + return packaging; + } + + public void setPackaging( String packaging ) + { + this.packaging = packaging; + } + + public String getClassifier() + { + return classifier; + } + + public void setClassifier( String classifier ) + { + this.classifier = classifier; + } + + public String getRepositoryId() + { + return repositoryId; + } + + public void setRepositoryId( String repositoryId ) + { + this.repositoryId = repositoryId; + } + + public boolean isGeneratePom() + { + return generatePom; + } + + public void setGeneratePom( boolean generatePom ) + { + this.generatePom = generatePom; + } + + public List getManagedRepoIdList() + { + return managedRepoIdList; + } + + public void setManagedRepoIdList( List managedRepoIdList ) + { + this.managedRepoIdList = managedRepoIdList; + } + + public void prepare() + { + managedRepoIdList = + new ArrayList( configuration.getConfiguration().getManagedRepositoriesAsMap().keySet() ); + } + + public String input() + { + return INPUT; + } + + private void reset() + { + // reset the fields so the form is clear when + // the action returns to the jsp page + groupId = ""; + artifactId = ""; + version = ""; + packaging = ""; + classifier = ""; + artifactFile = null; + artifactContentType = ""; + artifactFilename = ""; + pomFile = null; + pomContentType = ""; + pomFilename = ""; + repositoryId = ""; + generatePom = false; + } + + public String doUpload() + { + try + { + ManagedRepositoryConfiguration repoConfig = + configuration.getConfiguration().findManagedRepositoryById( repositoryId ); + + ArtifactReference artifactReference = new ArtifactReference(); + artifactReference.setArtifactId( artifactId ); + artifactReference.setGroupId( groupId ); + artifactReference.setVersion( version ); + artifactReference.setClassifier( classifier ); + artifactReference.setType( packaging ); + + ManagedRepositoryContent repository = repositoryFactory.getManagedRepositoryContent( repositoryId ); + + String artifactPath = repository.toPath( artifactReference ); + + int lastIndex = artifactPath.lastIndexOf( '/' ); + + File targetPath = new File( repoConfig.getLocation(), artifactPath.substring( 0, lastIndex ) ); + + Date lastUpdatedTimestamp = Calendar.getInstance().getTime(); + int newBuildNumber = -1; + String timestamp = null; + + File metadataFile = getMetadata( targetPath.getAbsolutePath() ); + ArchivaRepositoryMetadata metadata = getMetadata( metadataFile ); + + if (VersionUtil.isSnapshot(version)) + { + TimeZone timezone = TimeZone.getTimeZone( "UTC" ); + DateFormat fmt = new SimpleDateFormat( "yyyyMMdd.HHmmss" ); + fmt.setTimeZone( timezone ); + timestamp = fmt.format( lastUpdatedTimestamp ); + if ( metadata.getSnapshotVersion() != null ) + { + newBuildNumber = metadata.getSnapshotVersion().getBuildNumber() + 1; + } + else + { + metadata.setSnapshotVersion( new SnapshotVersion() ); + newBuildNumber = 1; + } + } + + if ( !targetPath.exists() ) + { + targetPath.mkdirs(); + } + + String filename = artifactPath.substring( lastIndex + 1 ); + if ( VersionUtil.isSnapshot( version ) ) + { + filename = filename.replaceAll( "SNAPSHOT", timestamp + "-" + newBuildNumber ); + } + + try + { + copyFile( artifactFile, targetPath, filename ); + consumers.executeConsumers( repoConfig, repository.toFile( artifactReference ) ); + } + catch ( IOException ie ) + { + addActionError( "Error encountered while uploading file: " + ie.getMessage() ); + return ERROR; + } + + String pomFilename = filename; + if( classifier != null && !"".equals( classifier ) ) + { + pomFilename = StringUtils.remove( pomFilename, "-" + classifier ); + } + pomFilename = FilenameUtils.removeExtension( pomFilename ) + ".pom"; + + if ( generatePom ) + { + try + { + File generatedPomFile = createPom( targetPath, pomFilename ); + consumers.executeConsumers( repoConfig, generatedPomFile ); + } + catch ( IOException ie ) + { + addActionError( "Error encountered while writing pom file: " + ie.getMessage() ); + return ERROR; + } + catch ( ProjectModelException pe ) + { + addActionError( "Error encountered while generating pom file: " + pe.getMessage() ); + return ERROR; + } + } + + if ( pomFile != null && pomFile.length() > 0 ) + { + try + { + copyFile( pomFile, targetPath, pomFilename ); + consumers.executeConsumers( repoConfig, new File( targetPath, pomFilename ) ); + } + catch ( IOException ie ) + { + addActionError( "Error encountered while uploading pom file: " + ie.getMessage() ); + return ERROR; + } + + } + + updateMetadata( metadata, metadataFile, lastUpdatedTimestamp, timestamp, newBuildNumber ); + + String msg = "Artifact \'" + groupId + ":" + artifactId + ":" + version + + "\' was successfully deployed to repository \'" + repositoryId + "\'"; + + triggerAuditEvent( getPrincipal(), repositoryId, groupId + ":" + artifactId + ":" + version, AuditEvent.UPLOAD_FILE ); + + addActionMessage( msg ); + + reset(); + return SUCCESS; + } + catch ( RepositoryNotFoundException re ) + { + addActionError( "Target repository cannot be found: " + re.getMessage() ); + return ERROR; + } + catch ( RepositoryException rep ) + { + addActionError( "Repository exception: " + rep.getMessage() ); + return ERROR; + } + } + + private String getPrincipal() + { + return ArchivaXworkUser.getActivePrincipal( ActionContext.getContext().getSession() ); + } + + private void copyFile( File sourceFile, File targetPath, String targetFilename ) + throws IOException + { + FileOutputStream out = new FileOutputStream( new File( targetPath, targetFilename ) ); + + try + { + FileInputStream input = new FileInputStream( sourceFile ); + int i = 0; + while ( ( i = input.read() ) != -1 ) + { + out.write( i ); + } + out.flush(); + } + finally + { + out.close(); + } + } + + private File createPom( File targetPath, String filename ) + throws IOException, ProjectModelException + { + ArchivaProjectModel projectModel = new ArchivaProjectModel(); + projectModel.setGroupId( groupId ); + projectModel.setArtifactId( artifactId ); + projectModel.setVersion( version ); + projectModel.setPackaging( packaging ); + + File pomFile = new File( targetPath, filename); + pomWriter.write( projectModel, pomFile ); + + return pomFile; + } + + private File getMetadata( String targetPath ) + { + String artifactPath = targetPath.substring( 0, targetPath.lastIndexOf( File.separatorChar ) ); + + return new File( artifactPath, MetadataTools.MAVEN_METADATA ); + } + + private ArchivaRepositoryMetadata getMetadata( File metadataFile ) + throws RepositoryMetadataException + { + ArchivaRepositoryMetadata metadata = new ArchivaRepositoryMetadata(); + if ( metadataFile.exists() ) + { + metadata = RepositoryMetadataReader.read( metadataFile ); + } + return metadata; + } + + /** + * Update artifact level metadata. If it does not exist, create the metadata. + * + * @param metadata + */ + private void updateMetadata( ArchivaRepositoryMetadata metadata, File metadataFile, Date lastUpdatedTimestamp, + String timestamp, int buildNumber ) + throws RepositoryMetadataException + { + List availableVersions = new ArrayList(); + String latestVersion = version; + + if ( metadataFile.exists() ) + { + availableVersions = metadata.getAvailableVersions(); + + Collections.sort( availableVersions, VersionComparator.getInstance() ); + + if ( !availableVersions.contains( version ) ) + { + availableVersions.add( version ); + } + + latestVersion = availableVersions.get( availableVersions.size() - 1 ); + } + else + { + availableVersions.add( version ); + + metadata.setGroupId( groupId ); + metadata.setArtifactId( artifactId ); + } + + if ( metadata.getGroupId() == null ) + { + metadata.setGroupId( groupId ); + } + if ( metadata.getArtifactId() == null ) + { + metadata.setArtifactId( artifactId ); + } + + metadata.setLatestVersion( latestVersion ); + metadata.setLastUpdatedTimestamp( lastUpdatedTimestamp ); + metadata.setAvailableVersions( availableVersions ); + + if ( !VersionUtil.isSnapshot( version ) ) + { + metadata.setReleasedVersion( latestVersion ); + } + else + { + metadata.getSnapshotVersion().setBuildNumber( buildNumber ); + + metadata.getSnapshotVersion().setTimestamp( timestamp ); + } + + RepositoryMetadataWriter.write( metadata, metadataFile ); + ChecksummedFile checksum = new ChecksummedFile( metadataFile ); + checksum.fixChecksums( algorithms ); + } + + public void validate() + { + try + { + // is this enough check for the repository permission? + if ( !userRepositories.isAuthorizedToUploadArtifacts( getPrincipal(), repositoryId ) ) + { + addActionError( "User is not authorized to upload in repository " + repositoryId ); + } + + if ( artifactFile == null || artifactFile.length() == 0 ) + { + addActionError( "Please add a file to upload." ); + } + + if ( !VersionUtil.isVersion( version ) ) + { + addActionError( "Invalid version." ); + } + } + catch ( PrincipalNotFoundException pe ) + { + addActionError( pe.getMessage() ); + } + catch ( ArchivaSecurityException ae ) + { + addActionError( ae.getMessage() ); + } + } + + public void addAuditListener( AuditListener listener ) + { + this.auditListeners.add( listener ); + } + + public void clearAuditListeners() + { + this.auditListeners.clear(); + } + + public void removeAuditListener( AuditListener listener ) + { + this.auditListeners.remove( listener ); + } + + private void triggerAuditEvent( String user, String repositoryId, String resource, String action ) + { + AuditEvent event = new AuditEvent( repositoryId, user, resource, action ); + event.setRemoteIP( ServletActionContext.getRequest().getRemoteAddr() ); + + for ( AuditListener listener : auditListeners ) + { + listener.auditEvent( event ); + } + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/SchedulerAction.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/SchedulerAction.java new file mode 100644 index 000000000..fb0db8436 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/SchedulerAction.java @@ -0,0 +1,188 @@ +package org.apache.maven.archiva.web.action.admin; + +/* + * 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.maven.archiva.common.ArchivaException; +import org.apache.maven.archiva.scheduled.ArchivaTaskScheduler; +import org.apache.maven.archiva.scheduled.DefaultArchivaTaskScheduler; +import org.apache.maven.archiva.scheduled.tasks.ArchivaTask; +import org.apache.maven.archiva.scheduled.tasks.DatabaseTask; +import org.apache.maven.archiva.scheduled.tasks.RepositoryTask; +import org.apache.maven.archiva.security.ArchivaRoleConstants; +import org.codehaus.plexus.redback.rbac.Resource; +import org.codehaus.plexus.redback.xwork.interceptor.SecureAction; +import org.codehaus.plexus.redback.xwork.interceptor.SecureActionBundle; +import org.codehaus.plexus.redback.xwork.interceptor.SecureActionException; +import org.codehaus.plexus.taskqueue.TaskQueueException; +import org.codehaus.plexus.xwork.action.PlexusActionSupport; + +/** + * Configures the application. + * + * @plexus.component role="com.opensymphony.xwork.Action" role-hint="schedulerAction" + */ +public class SchedulerAction + extends PlexusActionSupport + implements SecureAction +{ + private static final String REPO_SUCCESS = "repoSucces"; + + private static final String DB_SUCCESS = "dbSuccess"; + + /** + * @plexus.requirement + */ + private ArchivaTaskScheduler taskScheduler; + + private String repoid; + + public String scanRepository() + { + if ( StringUtils.isBlank( repoid ) ) + { + addActionError( "Cannot run indexer on blank repository id." ); + return SUCCESS; + } + + RepositoryTask task = new RepositoryTask(); + task.setRepositoryId( repoid ); + task.setName( DefaultArchivaTaskScheduler.REPOSITORY_JOB + ":" + repoid ); + task.setQueuePolicy( ArchivaTask.QUEUE_POLICY_WAIT ); + + boolean scheduleTask = false; + + try + { + if ( taskScheduler.isProcessingAnyRepositoryTask() ) + { + if ( taskScheduler.isProcessingRepositoryTask( repoid ) ) + { + addActionError( "Repository [" + repoid + "] task was already queued." ); + } + else + { + scheduleTask = true; + } + } + else + { + scheduleTask = true; + } + } + catch ( ArchivaException e ) + { + scheduleTask = false; + addActionError( e.getMessage() ); + } + + if ( scheduleTask ) + { + try + { + taskScheduler.queueRepositoryTask( task ); + addActionMessage( "Your request to have repository [" + repoid + "] be indexed has been queued." ); + } + catch ( TaskQueueException e ) + { + addActionError( "Unable to queue your request to have repository [" + repoid + "] be indexed: " + + e.getMessage() ); + } + } + + // Return to the repositories screen. + return SUCCESS; + } + + public String updateDatabase() + { + DatabaseTask task = new DatabaseTask(); + task.setName( DefaultArchivaTaskScheduler.DATABASE_JOB + ":user-requested" ); + task.setQueuePolicy( ArchivaTask.QUEUE_POLICY_WAIT ); + + boolean scheduleTask = false; + + try + { + if ( taskScheduler.isProcessingDatabaseTask() ) + { + addActionError( "Database task was already queued." ); + } + else + { + scheduleTask = true; + } + } + catch ( ArchivaException e ) + { + scheduleTask = false; + addActionError( e.getMessage() ); + } + + if ( scheduleTask ) + { + try + { + taskScheduler.queueDatabaseTask( task ); + addActionMessage( "Your request to update the database has been queued." ); + } + catch ( TaskQueueException e ) + { + addActionError( "Unable to queue your request to update the database: " + e.getMessage() ); + } + } + + // Return to the database screen. + return SUCCESS; + } + + public void addActionMessage( String aMessage ) + { + super.addActionMessage( aMessage ); + getLogger().info( "[ActionMessage] " + aMessage ); + } + + public void addActionError( String anErrorMessage ) + { + super.addActionError( anErrorMessage ); + getLogger().warn( "[ActionError] " + anErrorMessage ); + } + + public SecureActionBundle getSecureActionBundle() + throws SecureActionException + { + SecureActionBundle bundle = new SecureActionBundle(); + + bundle.setRequiresAuthentication( true ); + bundle.addRequiredAuthorization( ArchivaRoleConstants.OPERATION_RUN_INDEXER, Resource.GLOBAL ); + + return bundle; + } + + public String getRepoid() + { + return repoid; + } + + public void setRepoid( String repoid ) + { + this.repoid = repoid; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/appearance/AbstractAppearanceAction.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/appearance/AbstractAppearanceAction.java new file mode 100644 index 000000000..f8d6bf73f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/appearance/AbstractAppearanceAction.java @@ -0,0 +1,101 @@ +package org.apache.maven.archiva.web.action.admin.appearance; + +/* + * 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.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.Configuration; +import org.apache.maven.archiva.configuration.OrganisationInformation; +import org.codehaus.plexus.xwork.action.PlexusActionSupport; + +import com.opensymphony.xwork.Preparable; + +/** + * AbstractAppearanceAction + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public abstract class AbstractAppearanceAction + extends PlexusActionSupport + implements Preparable +{ + /** + * Archiva Application Configuration + * @plexus.requirement + */ + protected ArchivaConfiguration configuration; + + private String organisationLogo; + + private String organisationUrl; + + private String organisationName; + + public void setConfiguration(ArchivaConfiguration configuration) + { + this.configuration = configuration; + } + + public String getOrganisationLogo() + { + return organisationLogo; + } + + public String getOrganisationName() + { + return organisationName; + } + + public String getOrganisationUrl() + { + return organisationUrl; + } + + public void setOrganisationLogo(String organisationLogo) + { + this.organisationLogo = organisationLogo; + } + + public void setOrganisationName(String organisationName) + { + this.organisationName = organisationName; + } + + public void setOrganisationUrl(String organisationUrl) + { + this.organisationUrl = organisationUrl; + } + + public void prepare() + throws Exception + { + Configuration config = configuration.getConfiguration(); + if (config != null) + { + OrganisationInformation orgInfo = config.getOrganisationInfo(); + if (orgInfo != null) + { + setOrganisationLogo(orgInfo.getLogoLocation()); + setOrganisationName(orgInfo.getName()); + setOrganisationUrl(orgInfo.getUrl()); + } + } + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/appearance/EditOrganisationInfoAction.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/appearance/EditOrganisationInfoAction.java new file mode 100644 index 000000000..1304b5046 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/appearance/EditOrganisationInfoAction.java @@ -0,0 +1,74 @@ +package org.apache.maven.archiva.web.action.admin.appearance; + +/* + * 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.codehaus.plexus.redback.xwork.interceptor.SecureAction; + +import org.apache.maven.archiva.configuration.Configuration; +import org.apache.maven.archiva.configuration.IndeterminateConfigurationException; +import org.apache.maven.archiva.configuration.OrganisationInformation; +import org.apache.maven.archiva.security.ArchivaRoleConstants; +import org.codehaus.plexus.redback.rbac.Resource; +import org.codehaus.plexus.redback.xwork.interceptor.SecureActionBundle; +import org.codehaus.plexus.redback.xwork.interceptor.SecureActionException; +import org.codehaus.plexus.registry.RegistryException; + +/** + * @author Brett Porter + * @version $Id: ConfigurationAction.java 480950 2006-11-30 14:58:35Z evenisse $ + * + * @plexus.component role="com.opensymphony.xwork.Action" + * role-hint="editOrganisationInfo" + */ +public class EditOrganisationInfoAction + extends AbstractAppearanceAction + implements SecureAction +{ + @Override + public String execute() + throws RegistryException, IndeterminateConfigurationException + { + Configuration config = configuration.getConfiguration(); + if (config != null) + { + OrganisationInformation orgInfo = config.getOrganisationInfo(); + if (orgInfo == null) + { + config.setOrganisationInfo(orgInfo); + } + + orgInfo.setLogoLocation(getOrganisationLogo()); + orgInfo.setName(getOrganisationName()); + orgInfo.setUrl(getOrganisationUrl()); + + configuration.save(config); + } + return SUCCESS; + } + + public SecureActionBundle getSecureActionBundle() + throws SecureActionException + { + SecureActionBundle bundle = new SecureActionBundle(); + bundle.setRequiresAuthentication( true ); + bundle.addRequiredAuthorization( ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION, Resource.GLOBAL ); + return bundle; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/appearance/OrganisationInfoAction.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/appearance/OrganisationInfoAction.java new file mode 100644 index 000000000..bcacf1ea4 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/appearance/OrganisationInfoAction.java @@ -0,0 +1,30 @@ +package org.apache.maven.archiva.web.action.admin.appearance; + +/* + * 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. + */ + +/** + * Stores the organisation information for displaying on the page. + * + * @plexus.component role="com.opensymphony.xwork.Action" role-hint="organisationInfo" + */ +public class OrganisationInfoAction + extends AbstractAppearanceAction +{ +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/AbstractProxyConnectorAction.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/AbstractProxyConnectorAction.java new file mode 100644 index 000000000..b7f2e60d4 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/AbstractProxyConnectorAction.java @@ -0,0 +1,137 @@ +package org.apache.maven.archiva.web.action.admin.connectors.proxy; + +/* + * 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.collections.CollectionUtils; +import org.apache.commons.collections.functors.NotPredicate; +import org.apache.commons.lang.StringUtils; +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.Configuration; +import org.apache.maven.archiva.configuration.IndeterminateConfigurationException; +import org.apache.maven.archiva.configuration.ProxyConnectorConfiguration; +import org.apache.maven.archiva.configuration.functors.ProxyConnectorSelectionPredicate; +import org.apache.maven.archiva.security.ArchivaRoleConstants; +import org.codehaus.plexus.redback.rbac.Resource; +import org.codehaus.plexus.redback.xwork.interceptor.SecureAction; +import org.codehaus.plexus.redback.xwork.interceptor.SecureActionBundle; +import org.codehaus.plexus.redback.xwork.interceptor.SecureActionException; +import org.codehaus.plexus.registry.RegistryException; +import org.codehaus.plexus.xwork.action.PlexusActionSupport; + +import java.util.List; +import java.util.Map; + +/** + * AbstractProxyConnectorAction + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public abstract class AbstractProxyConnectorAction + extends PlexusActionSupport + implements SecureAction +{ + public static final String DIRECT_CONNECTION = "(direct connection)"; + + /** + * @plexus.requirement + */ + protected ArchivaConfiguration archivaConfiguration; + + public SecureActionBundle getSecureActionBundle() + throws SecureActionException + { + SecureActionBundle bundle = new SecureActionBundle(); + + bundle.setRequiresAuthentication( true ); + bundle.addRequiredAuthorization( ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION, Resource.GLOBAL ); + + return bundle; + } + + public void setArchivaConfiguration( ArchivaConfiguration archivaConfiguration ) + { + this.archivaConfiguration = archivaConfiguration; + } + + protected void addProxyConnector( ProxyConnectorConfiguration proxyConnector ) + { + getConfig().addProxyConnector( proxyConnector ); + } + + protected ProxyConnectorConfiguration findProxyConnector( String sourceId, String targetId ) + { + if ( StringUtils.isBlank( sourceId ) ) + { + return null; + } + + if ( StringUtils.isBlank( targetId ) ) + { + return null; + } + + ProxyConnectorSelectionPredicate selectedProxy = new ProxyConnectorSelectionPredicate( sourceId, targetId ); + return (ProxyConnectorConfiguration) CollectionUtils.find( getConfig().getProxyConnectors(), selectedProxy ); + } + + protected Configuration getConfig() + { + return this.archivaConfiguration.getConfiguration(); + } + + protected Map> createProxyConnectorMap() + { + return getConfig().getProxyConnectorAsMap(); + } + + protected void removeConnector( String sourceId, String targetId ) + { + ProxyConnectorSelectionPredicate selectedProxy = new ProxyConnectorSelectionPredicate( sourceId, targetId ); + NotPredicate notSelectedProxy = new NotPredicate( selectedProxy ); + CollectionUtils.filter( getConfig().getProxyConnectors(), notSelectedProxy ); + } + + protected void removeProxyConnector( ProxyConnectorConfiguration connector ) + { + getConfig().removeProxyConnector( connector ); + } + + protected String saveConfiguration() + { + try + { + archivaConfiguration.save( getConfig() ); + addActionMessage( "Successfully saved configuration" ); + } + catch ( RegistryException e ) + { + addActionError( "Unable to save configuration: " + e.getMessage() ); + return INPUT; + } + catch ( IndeterminateConfigurationException e ) + { + addActionError( e.getMessage() ); + return INPUT; + } + + return SUCCESS; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/AbstractProxyConnectorFormAction.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/AbstractProxyConnectorFormAction.java new file mode 100644 index 000000000..1318f5765 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/AbstractProxyConnectorFormAction.java @@ -0,0 +1,452 @@ +package org.apache.maven.archiva.web.action.admin.connectors.proxy; + +/* + * 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 com.opensymphony.xwork.Preparable; +import org.apache.commons.lang.StringUtils; +import org.apache.maven.archiva.configuration.ProxyConnectorConfiguration; +import org.apache.maven.archiva.policies.DownloadErrorPolicy; +import org.apache.maven.archiva.policies.Policy; +import org.apache.maven.archiva.policies.PostDownloadPolicy; +import org.apache.maven.archiva.policies.PreDownloadPolicy; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +/** + * AbstractProxyConnectorFormAction - generic fields and methods for either add or edit actions related with the + * Proxy Connector. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public abstract class AbstractProxyConnectorFormAction + extends AbstractProxyConnectorAction + implements Preparable +{ + + /** + * @plexus.requirement role="org.apache.maven.archiva.policies.PreDownloadPolicy" + */ + private Map preDownloadPolicyMap; + + /** + * @plexus.requirement role="org.apache.maven.archiva.policies.PostDownloadPolicy" + */ + private Map postDownloadPolicyMap; + + /** + * @plexus.requirement role="org.apache.maven.archiva.policies.DownloadErrorPolicy" + */ + private Map downloadErrorPolicyMap; + + /** + * The list of network proxy ids that are available. + */ + private List proxyIdOptions; + + /** + * The list of managed repository ids that are available. + */ + private List managedRepoIdList; + + /** + * The list of remove repository ids that are available. + */ + private List remoteRepoIdList; + + /** + * The map of policies that are available to be set. + */ + private Map policyMap; + + /** + * The property key to add or remove. + */ + private String propertyKey; + + /** + * The property value to add. + */ + private String propertyValue; + + /** + * The blacklist pattern to add. + */ + private String blackListPattern; + + /** + * The whitelist pattern to add. + */ + private String whiteListPattern; + + /** + * The pattern to add or remove (black or white). + */ + private String pattern; + + /** + * The model for this action. + */ + protected ProxyConnectorConfiguration connector; + + public String addBlackListPattern() + { + String pattern = getBlackListPattern(); + + if ( StringUtils.isBlank( pattern ) ) + { + addActionError( "Cannot add a blank black list pattern." ); + } + + if ( !hasActionErrors() ) + { + getConnector().getBlackListPatterns().add( pattern ); + setBlackListPattern( null ); + } + + return INPUT; + } + + public String addProperty() + { + String key = getPropertyKey(); + String value = getPropertyValue(); + + if ( StringUtils.isBlank( key ) ) + { + addActionError( "Unable to add property with blank key." ); + } + + if ( StringUtils.isBlank( value ) ) + { + addActionError( "Unable to add property with blank value." ); + } + + if ( !hasActionErrors() ) + { + getConnector().getProperties().put( key, value ); + setPropertyKey( null ); + setPropertyValue( null ); + } + + return INPUT; + } + + public String addWhiteListPattern() + { + String pattern = getWhiteListPattern(); + + if ( StringUtils.isBlank( pattern ) ) + { + addActionError( "Cannot add a blank white list pattern." ); + } + + if ( !hasActionErrors() ) + { + getConnector().getWhiteListPatterns().add( pattern ); + setWhiteListPattern( null ); + } + + return INPUT; + } + + public String getBlackListPattern() + { + return blackListPattern; + } + + public ProxyConnectorConfiguration getConnector() + { + return connector; + } + + public List getManagedRepoIdList() + { + return managedRepoIdList; + } + + public String getPattern() + { + return pattern; + } + + public Map getPolicyMap() + { + return policyMap; + } + + public String getPropertyKey() + { + return propertyKey; + } + + public String getPropertyValue() + { + return propertyValue; + } + + public List getProxyIdOptions() + { + return proxyIdOptions; + } + + public List getRemoteRepoIdList() + { + return remoteRepoIdList; + } + + public String getWhiteListPattern() + { + return whiteListPattern; + } + + public void prepare() + { + proxyIdOptions = createNetworkProxyOptions(); + managedRepoIdList = createManagedRepoOptions(); + remoteRepoIdList = createRemoteRepoOptions(); + policyMap = createPolicyMap(); + } + + public String removeBlackListPattern() + { + String pattern = getPattern(); + + if ( StringUtils.isBlank( pattern ) ) + { + addActionError( "Cannot remove a blank black list pattern." ); + } + + if ( !getConnector().getBlackListPatterns().contains( pattern ) ) + { + addActionError( "Non-existant black list pattern [" + pattern + "], no black list pattern removed." ); + } + + if ( !hasActionErrors() ) + { + getConnector().getBlackListPatterns().remove( pattern ); + } + + setBlackListPattern( null ); + setPattern( null ); + + return INPUT; + } + + public String removeProperty() + { + String key = getPropertyKey(); + + if ( StringUtils.isBlank( key ) ) + { + addActionError( "Unable to remove property with blank key." ); + } + + if ( !getConnector().getProperties().containsKey( key ) ) + { + addActionError( "Non-existant property key [" + pattern + "], no property was removed." ); + } + + if ( !hasActionErrors() ) + { + getConnector().getProperties().remove( key ); + } + + setPropertyKey( null ); + setPropertyValue( null ); + + return INPUT; + } + + public String removeWhiteListPattern() + { + String pattern = getPattern(); + + if ( StringUtils.isBlank( pattern ) ) + { + addActionError( "Cannot remove a blank white list pattern." ); + } + + if ( !getConnector().getWhiteListPatterns().contains( pattern ) ) + { + addActionError( "Non-existant white list pattern [" + pattern + "], no white list pattern removed." ); + } + + if ( !hasActionErrors() ) + { + getConnector().getWhiteListPatterns().remove( pattern ); + } + + setWhiteListPattern( null ); + setPattern( null ); + + return INPUT; + } + + public void setBlackListPattern( String blackListPattern ) + { + this.blackListPattern = blackListPattern; + } + + public void setConnector( ProxyConnectorConfiguration connector ) + { + this.connector = connector; + } + + public void setManagedRepoIdList( List managedRepoIdList ) + { + this.managedRepoIdList = managedRepoIdList; + } + + public void setPattern( String pattern ) + { + this.pattern = pattern; + } + + public void setPolicyMap( Map policyMap ) + { + this.policyMap = policyMap; + } + + public void setPropertyKey( String propertyKey ) + { + this.propertyKey = propertyKey; + } + + public void setPropertyValue( String propertyValue ) + { + this.propertyValue = propertyValue; + } + + public void setProxyIdOptions( List proxyIdOptions ) + { + this.proxyIdOptions = proxyIdOptions; + } + + public void setRemoteRepoIdList( List remoteRepoIdList ) + { + this.remoteRepoIdList = remoteRepoIdList; + } + + public void setWhiteListPattern( String whiteListPattern ) + { + this.whiteListPattern = whiteListPattern; + } + + protected List createManagedRepoOptions() + { + return new ArrayList( getConfig().getManagedRepositoriesAsMap().keySet() ); + } + + protected List createNetworkProxyOptions() + { + List options = new ArrayList(); + + options.add( DIRECT_CONNECTION ); + options.addAll( getConfig().getNetworkProxiesAsMap().keySet() ); + + return options; + } + + protected Map createPolicyMap() + { + Map policyMap = new HashMap(); + + policyMap.putAll( preDownloadPolicyMap ); + policyMap.putAll( postDownloadPolicyMap ); + policyMap.putAll( downloadErrorPolicyMap ); + + return policyMap; + } + + protected List createRemoteRepoOptions() + { + return new ArrayList( getConfig().getRemoteRepositoriesAsMap().keySet() ); + } + + protected void validateConnector() + { + if ( connector.getPolicies() == null ) + { + addActionError( "Policies must be set." ); + } + else + { + // Validate / Fix policy settings arriving from browser. + for ( Map.Entry entry : getPolicyMap().entrySet() ) + { + String policyId = entry.getKey(); + Policy policy = entry.getValue(); + List options = policy.getOptions(); + + if ( !connector.getPolicies().containsKey( policyId ) ) + { + addActionError( "Policy [" + policyId + "] must be set (missing id)." ); + continue; + } + + Map properties = connector.getProperties(); + for ( Iterator j = properties.keySet().iterator(); j.hasNext(); ) + { + String key = (String) j.next(); + + Object value = properties.get( key ); + if ( value.getClass().isArray() ) + { + String[] arr = (String[]) value; + properties.put( key, arr[0] ); + } + } + + // Ugly hack to compensate for ugly browsers. + Object o = connector.getPolicies().get( policyId ); + String value; + if ( o.getClass().isArray() ) + { + String arr[] = (String[]) o; + value = arr[0]; + } + else + { + value = (String) o; + } + + connector.getPolicies().put( policyId, value ); + + if ( StringUtils.isBlank( value ) ) + { + addActionError( "Policy [" + policyId + "] must be set (missing value)." ); + continue; + } + + if ( !options.contains( value ) ) + { + addActionError( "Value of [" + value + "] is invalid for policy [" + policyId + "], valid values: " + + options ); + continue; + } + } + } + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/AddProxyConnectorAction.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/AddProxyConnectorAction.java new file mode 100644 index 000000000..84c158cff --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/AddProxyConnectorAction.java @@ -0,0 +1,81 @@ +package org.apache.maven.archiva.web.action.admin.connectors.proxy; + +/* + * 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.maven.archiva.configuration.ProxyConnectorConfiguration; + +/** + * AddProxyConnectorAction + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component role="com.opensymphony.xwork.Action" role-hint="addProxyConnectorAction" + */ +public class AddProxyConnectorAction + extends AbstractProxyConnectorFormAction +{ + @Override + public void prepare() + { + super.prepare(); + connector = new ProxyConnectorConfiguration(); + } + + public String input() + { + return INPUT; + } + + public String commit() + { + /* Too complex for webwork's ${Action}-validation.xml techniques. + * Not appropriate for use with webwork's implements Validatable, as that validates regardless of + * the request method, such as .addProperty() or .addWhiteList(). + * + * This validation is ultimately only useful on this one request method. + */ + String sourceId = connector.getSourceRepoId(); + String targetId = connector.getTargetRepoId(); + + ProxyConnectorConfiguration otherConnector = findProxyConnector( sourceId, targetId ); + if ( otherConnector != null ) + { + addActionError( "Unable to add proxy connector, as one already exists with source repository id [" + + sourceId + "] and target repository id [" + targetId + "]." ); + } + + validateConnector(); + + if ( hasActionErrors() ) + { + return INPUT; + } + + if( StringUtils.equals( DIRECT_CONNECTION, connector.getProxyId() ) ) + { + connector.setProxyId( null ); + } + + addProxyConnector( connector ); + return saveConfiguration(); + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/DeleteProxyConnectorAction.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/DeleteProxyConnectorAction.java new file mode 100644 index 000000000..2de3ee9a5 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/DeleteProxyConnectorAction.java @@ -0,0 +1,106 @@ +package org.apache.maven.archiva.web.action.admin.connectors.proxy; + +/* + * 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.archiva.configuration.ProxyConnectorConfiguration; + +/** + * DeleteProxyConnectorAction + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component role="com.opensymphony.xwork.Action" role-hint="deleteProxyConnectorAction" + */ +public class DeleteProxyConnectorAction + extends AbstractProxyConnectorAction +{ + private String source; + + private String target; + + private ProxyConnectorConfiguration proxyConfig; + + public String confirmDelete() + { + this.proxyConfig = findProxyConnector( source, target ); + + // Not set? Then there is nothing to delete. + if ( this.proxyConfig == null ) + { + addActionError( "Unable to delete proxy configuration, configuration with source [" + source + + "], and target [" + target + "] does not exist." ); + return ERROR; + } + + return INPUT; + } + + public String delete() + { + this.proxyConfig = findProxyConnector( source, target ); + + // Not set? Then there is nothing to delete. + if ( this.proxyConfig == null ) + { + addActionError( "Unable to delete proxy configuration, configuration with source [" + source + + "], and target [" + target + "] does not exist." ); + return ERROR; + } + + if ( hasActionErrors() ) + { + return ERROR; + } + + removeProxyConnector( proxyConfig ); + addActionMessage( "Successfully removed proxy connector [" + source + " , " + target + " ]" ); + + setSource( null ); + setTarget( null ); + + return saveConfiguration(); + } + + public String getSource() + { + return source; + } + + public void setSource( String id ) + { + this.source = id; + } + + public String getTarget() + { + return target; + } + + public void setTarget( String id ) + { + this.target = id; + } + + public ProxyConnectorConfiguration getProxyConfig() + { + return proxyConfig; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/EditProxyConnectorAction.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/EditProxyConnectorAction.java new file mode 100644 index 000000000..8b050e94f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/EditProxyConnectorAction.java @@ -0,0 +1,114 @@ +package org.apache.maven.archiva.web.action.admin.connectors.proxy; + +/* + * 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.archiva.configuration.ProxyConnectorConfiguration; + + +/** + * EditProxyConnectorAction + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component role="com.opensymphony.xwork.Action" role-hint="editProxyConnectorAction" + */ +public class EditProxyConnectorAction + extends AbstractProxyConnectorFormAction +{ + /** + * The proxy connector source id to edit. (used with {@link #target}) + */ + private String source; + + /** + * The proxy connector target id to edit. (used with {@link #source}) + */ + private String target; + + @Override + public void prepare() + { + super.prepare(); + + connector = findProxyConnector( source, target ); + } + + public String input() + { + if ( connector == null ) + { + addActionError( "Unable to edit non existant proxy connector with source [" + source + "] and target [" + + target + "]" ); + return ERROR; + } + + return INPUT; + } + + public String commit() + { + validateConnector(); + + if ( hasActionErrors() ) + { + return INPUT; + } + + String sourceId = connector.getSourceRepoId(); + String targetId = connector.getTargetRepoId(); + + ProxyConnectorConfiguration otherConnector = findProxyConnector( sourceId, targetId ); + if ( otherConnector != null ) + { + // Remove the previous connector. + removeProxyConnector( otherConnector ); + } + + if ( hasActionErrors() ) + { + return INPUT; + } + + addProxyConnector( connector ); + return saveConfiguration(); + } + + public String getSource() + { + return source; + } + + public void setSource( String source ) + { + this.source = source; + } + + public String getTarget() + { + return target; + } + + public void setTarget( String target ) + { + this.target = target; + } + +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/ProxyConnectorsAction.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/ProxyConnectorsAction.java new file mode 100644 index 000000000..fccbd380e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/ProxyConnectorsAction.java @@ -0,0 +1,71 @@ +package org.apache.maven.archiva.web.action.admin.connectors.proxy; + +/* + * 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 com.opensymphony.xwork.Preparable; + +import org.apache.maven.archiva.configuration.AbstractRepositoryConfiguration; +import org.apache.maven.archiva.configuration.Configuration; +import org.apache.maven.archiva.configuration.ProxyConnectorConfiguration; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * ProxyConnectorsAction + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component role="com.opensymphony.xwork.Action" role-hint="proxyConnectorsAction" + */ +public class ProxyConnectorsAction + extends AbstractProxyConnectorAction + implements Preparable +{ + private Map repoMap; + + /** + * Map of Proxy Connectors. + */ + private Map> proxyConnectorMap; + + public void prepare() + { + Configuration config = archivaConfiguration.getConfiguration(); + + repoMap = new HashMap(); + repoMap.putAll( config.getRemoteRepositoriesAsMap() ); + repoMap.putAll( config.getManagedRepositoriesAsMap() ); + + proxyConnectorMap = createProxyConnectorMap(); + } + + public Map getRepoMap() + { + return repoMap; + } + + public Map> getProxyConnectorMap() + { + return proxyConnectorMap; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/SortProxyConnectorsAction.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/SortProxyConnectorsAction.java new file mode 100644 index 000000000..75b0f455a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/SortProxyConnectorsAction.java @@ -0,0 +1,136 @@ +package org.apache.maven.archiva.web.action.admin.connectors.proxy; + +/* + * 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.maven.archiva.configuration.ProxyConnectorConfiguration; + +import java.util.List; + +/** + * SortProxyConnectorsAction - + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component role="com.opensymphony.xwork.Action" role-hint="sortProxyConnectorsAction" + */ +public class SortProxyConnectorsAction + extends AbstractProxyConnectorAction +{ + private String source; + + private String target; + + public String getSource() + { + return source; + } + + public String getTarget() + { + return target; + } + + public void setSource( String id ) + { + this.source = id; + } + + public void setTarget( String id ) + { + this.target = id; + } + + public String sortDown() + { + List connectors = createProxyConnectorMap().get( source ); + + int idx = findTargetConnector( connectors, target ); + + if ( idx >= 0 ) + { + incrementConnectorOrder( connectors, idx ); + decrementConnectorOrder( connectors, idx + 1 ); + } + + return saveConfiguration(); + } + + public String sortUp() + { + List connectors = createProxyConnectorMap().get( source ); + + int idx = findTargetConnector( connectors, target ); + + if ( idx >= 0 ) + { + decrementConnectorOrder( connectors, idx ); + incrementConnectorOrder( connectors, idx - 1 ); + } + + return saveConfiguration(); + } + + private void decrementConnectorOrder( List connectors, int idx ) + { + if ( !validIndex( connectors, idx ) ) + { + // Do nothing. + return; + } + + int order = connectors.get( idx ).getOrder(); + connectors.get( idx ).setOrder( Math.max( 1, order - 1 ) ); + } + + private int findTargetConnector( List connectors, String targetRepoId ) + { + int idx = ( -1 ); + + for ( int i = 0; i < connectors.size(); i++ ) + { + if ( StringUtils.equals( targetRepoId, connectors.get( i ).getTargetRepoId() ) ) + { + idx = i; + break; + } + } + + return idx; + } + + private void incrementConnectorOrder( List connectors, int idx ) + { + if ( !validIndex( connectors, idx ) ) + { + // Do nothing. + return; + } + + int order = connectors.get( idx ).getOrder(); + connectors.get( idx ).setOrder( order + 1 ); + } + + private boolean validIndex( List connectors, int idx ) + { + return ( idx >= 0 ) && ( idx < connectors.size() ); + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/database/AddAdminDatabaseConsumerClosure.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/database/AddAdminDatabaseConsumerClosure.java new file mode 100644 index 000000000..e777de63e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/database/AddAdminDatabaseConsumerClosure.java @@ -0,0 +1,67 @@ +package org.apache.maven.archiva.web.action.admin.database; + +/* + * 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.collections.Closure; +import org.apache.maven.archiva.consumers.ArchivaArtifactConsumer; + +import java.util.ArrayList; +import java.util.List; + +/** + * AddAdminDatabaseConsumerClosure + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class AddAdminDatabaseConsumerClosure + implements Closure +{ + private List list = new ArrayList(); + + private List selectedIds; + + public AddAdminDatabaseConsumerClosure( List selectedIds ) + { + this.selectedIds = selectedIds; + } + + public void execute( Object input ) + { + if ( input instanceof ArchivaArtifactConsumer ) + { + ArchivaArtifactConsumer consumer = (ArchivaArtifactConsumer) input; + + boolean enabled = this.selectedIds.contains( consumer.getId() ); + + AdminDatabaseConsumer adminconsumer = new AdminDatabaseConsumer(); + adminconsumer.setEnabled( enabled ); + adminconsumer.setId( consumer.getId() ); + adminconsumer.setDescription( consumer.getDescription() ); + + list.add( adminconsumer ); + } + } + + public List getList() + { + return list; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/database/AdminDatabaseConsumer.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/database/AdminDatabaseConsumer.java new file mode 100644 index 000000000..33172320f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/database/AdminDatabaseConsumer.java @@ -0,0 +1,65 @@ +package org.apache.maven.archiva.web.action.admin.database; + +/* + * 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. + */ + +/** + * AdminDatabaseConsumer + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class AdminDatabaseConsumer +{ + private boolean enabled = false; + + private String id; + + private String description; + + public String getDescription() + { + return description; + } + + public String getId() + { + return id; + } + + public boolean isEnabled() + { + return enabled; + } + + public void setDescription( String description ) + { + this.description = description; + } + + public void setEnabled( boolean enabled ) + { + this.enabled = enabled; + } + + public void setId( String id ) + { + this.id = id; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/database/AdminDatabaseConsumerComparator.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/database/AdminDatabaseConsumerComparator.java new file mode 100644 index 000000000..98d1f51a5 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/database/AdminDatabaseConsumerComparator.java @@ -0,0 +1,67 @@ +package org.apache.maven.archiva.web.action.admin.database; + +/* + * 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.Comparator; + +/** + * AdminDatabaseConsumerComparator + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class AdminDatabaseConsumerComparator + implements Comparator +{ + private static AdminDatabaseConsumerComparator INSTANCE = new AdminDatabaseConsumerComparator(); + + public static AdminDatabaseConsumerComparator getInstance() + { + return INSTANCE; + } + + public int compare( Object o1, Object o2 ) + { + if ( o1 == null && o2 == null ) + { + return 0; + } + + if ( o1 == null && o2 != null ) + { + return 1; + } + + if ( o1 != null && o2 == null ) + { + return -1; + } + + if ( ( o1 instanceof AdminDatabaseConsumer ) && ( o2 instanceof AdminDatabaseConsumer ) ) + { + String id1 = ( (AdminDatabaseConsumer) o1 ).getId(); + String id2 = ( (AdminDatabaseConsumer) o2 ).getId(); + return id1.compareToIgnoreCase( id2 ); + } + + return 0; + } + +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/database/DatabaseAction.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/database/DatabaseAction.java new file mode 100644 index 000000000..277aefee6 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/database/DatabaseAction.java @@ -0,0 +1,199 @@ +package org.apache.maven.archiva.web.action.admin.database; + +/* + * 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 com.opensymphony.xwork.Preparable; +import org.apache.commons.collections.CollectionUtils; +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.Configuration; +import org.apache.maven.archiva.configuration.DatabaseScanningConfiguration; +import org.apache.maven.archiva.configuration.IndeterminateConfigurationException; +import org.apache.maven.archiva.database.updater.DatabaseConsumers; +import org.apache.maven.archiva.security.ArchivaRoleConstants; +import org.apache.maven.archiva.web.action.admin.scanning.AdminRepositoryConsumerComparator; +import org.codehaus.plexus.redback.rbac.Resource; +import org.codehaus.plexus.redback.xwork.interceptor.SecureAction; +import org.codehaus.plexus.redback.xwork.interceptor.SecureActionBundle; +import org.codehaus.plexus.redback.xwork.interceptor.SecureActionException; +import org.codehaus.plexus.registry.RegistryException; +import org.codehaus.plexus.xwork.action.PlexusActionSupport; + +import java.util.Collections; +import java.util.List; + +/** + * DatabaseAction + * + * @author Joakim Erdfelt + * @version $Id$ + * @plexus.component role="com.opensymphony.xwork.Action" role-hint="databaseAction" + */ +public class DatabaseAction + extends PlexusActionSupport + implements Preparable, SecureAction +{ + /** + * @plexus.requirement + */ + private ArchivaConfiguration archivaConfiguration; + + /** + * @plexus.requirement + */ + private DatabaseConsumers databaseConsumers; + + private String cron; + + /** + * List of available {@link AdminDatabaseConsumer} objects for unprocessed artifacts. + */ + private List unprocessedConsumers; + + /** + * List of enabled {@link AdminDatabaseConsumer} objects for unprocessed artifacts. + */ + private List enabledUnprocessedConsumers; + + /** + * List of {@link AdminDatabaseConsumer} objects for "to cleanup" artifacts. + */ + private List cleanupConsumers; + + /** + * List of enabled {@link AdminDatabaseConsumer} objects for "to cleanup" artifacts. + */ + private List enabledCleanupConsumers; + + public void prepare() + throws Exception + { + Configuration config = archivaConfiguration.getConfiguration(); + DatabaseScanningConfiguration dbscanning = config.getDatabaseScanning(); + + this.cron = dbscanning.getCronExpression(); + + AddAdminDatabaseConsumerClosure addAdminDbConsumer; + + addAdminDbConsumer = new AddAdminDatabaseConsumerClosure( dbscanning.getUnprocessedConsumers() ); + CollectionUtils.forAllDo( databaseConsumers.getAvailableUnprocessedConsumers(), addAdminDbConsumer ); + this.unprocessedConsumers = addAdminDbConsumer.getList(); + Collections.sort( this.unprocessedConsumers, AdminRepositoryConsumerComparator.getInstance() ); + + addAdminDbConsumer = new AddAdminDatabaseConsumerClosure( dbscanning.getCleanupConsumers() ); + CollectionUtils.forAllDo( databaseConsumers.getAvailableCleanupConsumers(), addAdminDbConsumer ); + this.cleanupConsumers = addAdminDbConsumer.getList(); + Collections.sort( this.cleanupConsumers, AdminRepositoryConsumerComparator.getInstance() ); + } + + public String updateUnprocessedConsumers() + { + archivaConfiguration.getConfiguration().getDatabaseScanning().setUnprocessedConsumers( + enabledUnprocessedConsumers ); + + return saveConfiguration(); + } + + public String updateCleanupConsumers() + { + archivaConfiguration.getConfiguration().getDatabaseScanning().setCleanupConsumers( enabledCleanupConsumers ); + + return saveConfiguration(); + } + + public String updateSchedule() + { + archivaConfiguration.getConfiguration().getDatabaseScanning().setCronExpression( cron ); + + return saveConfiguration(); + } + + private String saveConfiguration() + { + try + { + archivaConfiguration.save( archivaConfiguration.getConfiguration() ); + addActionMessage( "Successfully saved configuration" ); + } + catch ( RegistryException e ) + { + getLogger().error( e.getMessage(), e ); + addActionError( "Error in saving configuration" ); + return INPUT; + } + catch ( IndeterminateConfigurationException e ) + { + addActionError( e.getMessage() ); + return INPUT; + } + + return SUCCESS; + } + + public SecureActionBundle getSecureActionBundle() + throws SecureActionException + { + SecureActionBundle bundle = new SecureActionBundle(); + + bundle.setRequiresAuthentication( true ); + bundle.addRequiredAuthorization( ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION, Resource.GLOBAL ); + + return bundle; + } + + public String getCron() + { + return cron; + } + + public void setCron( String cron ) + { + this.cron = cron; + } + + public List getCleanupConsumers() + { + return cleanupConsumers; + } + + public List getUnprocessedConsumers() + { + return unprocessedConsumers; + } + + public List getEnabledUnprocessedConsumers() + { + return enabledUnprocessedConsumers; + } + + public void setEnabledUnprocessedConsumers( List enabledUnprocessedConsumers ) + { + this.enabledUnprocessedConsumers = enabledUnprocessedConsumers; + } + + public List getEnabledCleanupConsumers() + { + return enabledCleanupConsumers; + } + + public void setEnabledCleanupConsumers( List enabledCleanupConsumers ) + { + this.enabledCleanupConsumers = enabledCleanupConsumers; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/legacy/AddLegacyArtifactPathAction.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/legacy/AddLegacyArtifactPathAction.java new file mode 100644 index 000000000..fa7f22616 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/legacy/AddLegacyArtifactPathAction.java @@ -0,0 +1,184 @@ +package org.apache.maven.archiva.web.action.admin.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. + */ + +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.Configuration; +import org.apache.maven.archiva.configuration.IndeterminateConfigurationException; +import org.apache.maven.archiva.configuration.LegacyArtifactPath; +import org.apache.maven.archiva.model.ArtifactReference; +import org.apache.maven.archiva.repository.ManagedRepositoryContent; +import org.codehaus.plexus.registry.RegistryException; +import org.codehaus.plexus.xwork.action.PlexusActionSupport; + +import com.opensymphony.webwork.components.ActionError; +import com.opensymphony.xwork.Preparable; + +/** + * Add a LegacyArtifactPath to archiva configuration + * + * @since 1.1 + * @plexus.component role="com.opensymphony.xwork.Action" role-hint="addLegacyArtifactPathAction" + */ +public class AddLegacyArtifactPathAction + extends PlexusActionSupport + implements Preparable +{ + /** + * @plexus.requirement + */ + private ArchivaConfiguration archivaConfiguration; + + /** + * @plexus.requirement role-hint="legacy" + */ + private ManagedRepositoryContent repositoryContent; + + + private LegacyArtifactPath legacyArtifactPath; + + private String groupId; + + private String artifactId; + + private String version; + + private String classifier; + + private String type; + + + public void prepare() + { + this.legacyArtifactPath = new LegacyArtifactPath(); + } + + public String input() + { + return INPUT; + } + + public String commit() + { + this.legacyArtifactPath.setArtifact( + this.groupId + ":" + this.artifactId + ":" + this.classifier + ":" + this.version + ":" + this.type ); + + // Check the proposed Artifact macthes the path + ArtifactReference artifact = new ArtifactReference(); + + artifact.setGroupId( this.groupId ); + artifact.setArtifactId( this.artifactId ); + artifact.setClassifier( this.classifier ); + artifact.setVersion( this.version ); + artifact.setType( this.type ); + + String path = repositoryContent.toPath( artifact ); + if ( ! path.equals( this.legacyArtifactPath.getPath() ) ) + { + addActionError( "artifact reference does not match the initial path : " + path ); + return ERROR; + } + + Configuration configuration = archivaConfiguration.getConfiguration(); + configuration.addLegacyArtifactPath( legacyArtifactPath ); + return saveConfiguration( configuration ); + } + + public LegacyArtifactPath getLegacyArtifactPath() + { + return legacyArtifactPath; + } + + public void setLegacyArtifactPath( LegacyArtifactPath legacyArtifactPath ) + { + this.legacyArtifactPath = legacyArtifactPath; + } + + protected String saveConfiguration( Configuration configuration ) + { + try + { + archivaConfiguration.save( configuration ); + addActionMessage( "Successfully saved configuration" ); + } + catch ( IndeterminateConfigurationException e ) + { + addActionError( e.getMessage() ); + return INPUT; + } + catch ( RegistryException e ) + { + addActionError( "Configuration Registry Exception: " + e.getMessage() ); + return INPUT; + } + + return SUCCESS; + } + + public String getGroupId() + { + return groupId; + } + + public void setGroupId( String groupId ) + { + this.groupId = groupId; + } + + public String getArtifactId() + { + return artifactId; + } + + public void setArtifactId( String artifactId ) + { + this.artifactId = artifactId; + } + + public String getVersion() + { + return version; + } + + public void setVersion( String version ) + { + this.version = version; + } + + public String getClassifier() + { + return classifier; + } + + public void setClassifier( String classifier ) + { + this.classifier = classifier; + } + + public String getType() + { + return type; + } + + public void setType( String type ) + { + this.type = type; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/legacy/DeleteLegacyArtifactPathAction.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/legacy/DeleteLegacyArtifactPathAction.java new file mode 100644 index 000000000..0a0f6a025 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/legacy/DeleteLegacyArtifactPathAction.java @@ -0,0 +1,93 @@ +package org.apache.maven.archiva.web.action.admin.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. + */ + +import java.util.Iterator; + +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.Configuration; +import org.apache.maven.archiva.configuration.IndeterminateConfigurationException; +import org.apache.maven.archiva.configuration.LegacyArtifactPath; +import org.codehaus.plexus.registry.RegistryException; +import org.codehaus.plexus.xwork.action.PlexusActionSupport; + +/** + * Delete a LegacyArtifactPath to archiva configuration + * + * + * @since 1.1 + * @plexus.component role="com.opensymphony.xwork.Action" role-hint="deleteLegacyArtifactPathAction" + */ +public class DeleteLegacyArtifactPathAction + extends PlexusActionSupport +{ + /** + * @plexus.requirement + */ + private ArchivaConfiguration archivaConfiguration; + + private String path; + + public String delete() + { + getLogger().info( "remove [" + path + "] from legacy artifact path resolution" ); + Configuration configuration = archivaConfiguration.getConfiguration(); + for ( Iterator iterator = configuration.getLegacyArtifactPaths().iterator(); iterator.hasNext(); ) + { + LegacyArtifactPath legacyArtifactPath = (LegacyArtifactPath) iterator.next(); + if (legacyArtifactPath.match( path )) + { + iterator.remove(); + } + } + return saveConfiguration( configuration ); + } + + protected String saveConfiguration( Configuration configuration ) + { + try + { + archivaConfiguration.save( configuration ); + addActionMessage( "Successfully saved configuration" ); + } + catch ( IndeterminateConfigurationException e ) + { + addActionError( e.getMessage() ); + return INPUT; + } + catch ( RegistryException e ) + { + addActionError( "Configuration Registry Exception: " + e.getMessage() ); + return INPUT; + } + + return SUCCESS; + } + + public String getPath() + { + return path; + } + + public void setPath( String path ) + { + this.path = path; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/legacy/LegacyArtifactPathAction.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/legacy/LegacyArtifactPathAction.java new file mode 100644 index 000000000..7efa73b6b --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/legacy/LegacyArtifactPathAction.java @@ -0,0 +1,97 @@ +package org.apache.maven.archiva.web.action.admin.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. + */ + +import java.util.ArrayList; +import java.util.List; + +import javax.servlet.http.HttpServletRequest; + +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.Configuration; +import org.apache.maven.archiva.configuration.LegacyArtifactPath; +import org.apache.maven.archiva.security.ArchivaRoleConstants; +import org.apache.maven.archiva.web.util.ContextUtils; +import org.codehaus.plexus.redback.rbac.Resource; +import org.codehaus.plexus.redback.xwork.interceptor.SecureAction; +import org.codehaus.plexus.redback.xwork.interceptor.SecureActionBundle; +import org.codehaus.plexus.redback.xwork.interceptor.SecureActionException; +import org.codehaus.plexus.xwork.action.PlexusActionSupport; + +import com.opensymphony.webwork.interceptor.ServletRequestAware; +import com.opensymphony.xwork.Preparable; + +/** + * Shows the LegacyArtifactPath Tab for the administrator. + * + * @since 1.1 + * @plexus.component role="com.opensymphony.xwork.Action" role-hint="legacyArtifactPathAction" + */ +public class LegacyArtifactPathAction + extends PlexusActionSupport + implements SecureAction, ServletRequestAware, Preparable +{ + /** + * @plexus.requirement + */ + private ArchivaConfiguration archivaConfiguration; + + private List legacyArtifactPaths; + + /** + * Used to construct the repository WebDAV URL in the repository action. + */ + private String baseUrl; + + public void setServletRequest( HttpServletRequest request ) + { + // TODO: is there a better way to do this? + this.baseUrl = ContextUtils.getBaseURL( request, "repository" ); + } + + public SecureActionBundle getSecureActionBundle() + throws SecureActionException + { + SecureActionBundle bundle = new SecureActionBundle(); + + bundle.setRequiresAuthentication( true ); + bundle.addRequiredAuthorization( ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION, + Resource.GLOBAL ); + + return bundle; + } + + public void prepare() + { + Configuration config = archivaConfiguration.getConfiguration(); + + legacyArtifactPaths = new ArrayList( config.getLegacyArtifactPaths() ); + } + + public List getLegacyArtifactPaths() + { + return legacyArtifactPaths; + } + + public String getBaseUrl() + { + return baseUrl; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/networkproxies/ConfigureNetworkProxyAction.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/networkproxies/ConfigureNetworkProxyAction.java new file mode 100644 index 000000000..4acc3ae14 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/networkproxies/ConfigureNetworkProxyAction.java @@ -0,0 +1,229 @@ +package org.apache.maven.archiva.web.action.admin.networkproxies; + +/* + * 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 com.opensymphony.xwork.Preparable; +import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.collections.functors.NotPredicate; +import org.apache.commons.lang.StringUtils; +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.Configuration; +import org.apache.maven.archiva.configuration.IndeterminateConfigurationException; +import org.apache.maven.archiva.configuration.NetworkProxyConfiguration; +import org.apache.maven.archiva.configuration.functors.NetworkProxySelectionPredicate; +import org.apache.maven.archiva.security.ArchivaRoleConstants; +import org.codehaus.plexus.redback.rbac.Resource; +import org.codehaus.plexus.redback.xwork.interceptor.SecureAction; +import org.codehaus.plexus.redback.xwork.interceptor.SecureActionBundle; +import org.codehaus.plexus.redback.xwork.interceptor.SecureActionException; +import org.codehaus.plexus.registry.RegistryException; +import org.codehaus.plexus.xwork.action.PlexusActionSupport; + +/** + * ConfigureNetworkProxyAction + * + * @author Joakim Erdfelt + * @version $Id$ + * @plexus.component role="com.opensymphony.xwork.Action" role-hint="configureNetworkProxyAction" + */ +public class ConfigureNetworkProxyAction + extends PlexusActionSupport + implements SecureAction, Preparable +{ + /** + * @plexus.requirement + */ + private ArchivaConfiguration archivaConfiguration; + + private String mode; + + private String proxyid; + + private NetworkProxyConfiguration proxy; + + public String add() + { + this.mode = "add"; + return INPUT; + } + + public String confirm() + { + return INPUT; + } + + public String delete() + { + Configuration config = archivaConfiguration.getConfiguration(); + + String id = getProxyid(); + if ( StringUtils.isBlank( id ) ) + { + addActionError( "Unable to delete network proxy with blank id." ); + return SUCCESS; + } + + NetworkProxySelectionPredicate networkProxySelection = new NetworkProxySelectionPredicate( id ); + NetworkProxyConfiguration proxyConfig = (NetworkProxyConfiguration) CollectionUtils.find( config + .getNetworkProxies(), networkProxySelection ); + if ( proxyConfig == null ) + { + addActionError( "Unable to remove network proxy, proxy with id [" + id + "] not found." ); + return SUCCESS; + } + + archivaConfiguration.getConfiguration().removeNetworkProxy( proxyConfig ); + addActionMessage( "Successfully removed network proxy [" + id + "]" ); + return saveConfiguration(); + } + + public String edit() + { + this.mode = "edit"; + return INPUT; + } + + public String getMode() + { + return mode; + } + + public NetworkProxyConfiguration getProxy() + { + return proxy; + } + + public String getProxyid() + { + return proxyid; + } + + public SecureActionBundle getSecureActionBundle() + throws SecureActionException + { + SecureActionBundle bundle = new SecureActionBundle(); + + bundle.setRequiresAuthentication( true ); + bundle.addRequiredAuthorization( ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION, Resource.GLOBAL ); + + return bundle; + } + + public String input() + { + return INPUT; + } + + public void prepare() + throws Exception + { + String id = getProxyid(); + + if ( StringUtils.isNotBlank( id ) ) + { + proxy = findNetworkProxy( id ); + } + + if ( proxy == null ) + { + proxy = new NetworkProxyConfiguration(); + } + } + + public String save() + { + String mode = getMode(); + + String id = getProxy().getId(); + + if ( StringUtils.equalsIgnoreCase( "edit", mode ) ) + { + removeNetworkProxy( id ); + } + else + { + if ( findNetworkProxy( id ) != null ) + { + addActionError( "Unable to add new repository with id [" + id + "], that id already exists." ); + return INPUT; + } + } + + addNetworkProxy( getProxy() ); + return saveConfiguration(); + } + + public void setMode( String mode ) + { + this.mode = mode; + } + + public void setProxy( NetworkProxyConfiguration proxy ) + { + this.proxy = proxy; + } + + public void setProxyid( String proxyid ) + { + this.proxyid = proxyid; + } + + private void addNetworkProxy( NetworkProxyConfiguration proxy ) + { + archivaConfiguration.getConfiguration().addNetworkProxy( proxy ); + } + + private NetworkProxyConfiguration findNetworkProxy( String id ) + { + Configuration config = archivaConfiguration.getConfiguration(); + + NetworkProxySelectionPredicate selectedProxy = new NetworkProxySelectionPredicate( id ); + + return (NetworkProxyConfiguration) CollectionUtils.find( config.getNetworkProxies(), selectedProxy ); + } + + private void removeNetworkProxy( String id ) + { + NetworkProxySelectionPredicate selectedProxy = new NetworkProxySelectionPredicate( id ); + NotPredicate notSelectedProxy = new NotPredicate( selectedProxy ); + CollectionUtils.filter( archivaConfiguration.getConfiguration().getNetworkProxies(), notSelectedProxy ); + } + + private String saveConfiguration() + { + try + { + archivaConfiguration.save( archivaConfiguration.getConfiguration() ); + addActionMessage( "Successfully saved configuration" ); + } + catch ( RegistryException e ) + { + addActionError( "Unable to save configuration: " + e.getMessage() ); + return INPUT; + } + catch ( IndeterminateConfigurationException e ) + { + addActionError( e.getMessage() ); + return INPUT; + } + + return SUCCESS; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/networkproxies/NetworkProxiesAction.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/networkproxies/NetworkProxiesAction.java new file mode 100644 index 000000000..467b3e454 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/networkproxies/NetworkProxiesAction.java @@ -0,0 +1,79 @@ +package org.apache.maven.archiva.web.action.admin.networkproxies; + +/* + * 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 com.opensymphony.xwork.Preparable; + +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.security.ArchivaRoleConstants; +import org.codehaus.plexus.redback.rbac.Resource; +import org.codehaus.plexus.redback.xwork.interceptor.SecureAction; +import org.codehaus.plexus.redback.xwork.interceptor.SecureActionBundle; +import org.codehaus.plexus.redback.xwork.interceptor.SecureActionException; +import org.codehaus.plexus.xwork.action.PlexusActionSupport; + +import java.util.List; + +/** + * NetworkProxiesAction + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component role="com.opensymphony.xwork.Action" role-hint="networkProxiesAction" + */ +public class NetworkProxiesAction + extends PlexusActionSupport + implements Preparable, SecureAction +{ + /** + * @plexus.requirement + */ + private ArchivaConfiguration configuration; + + private List networkProxies; + + public void prepare() + throws Exception + { + networkProxies = configuration.getConfiguration().getNetworkProxies(); + } + + public SecureActionBundle getSecureActionBundle() + throws SecureActionException + { + SecureActionBundle bundle = new SecureActionBundle(); + + bundle.setRequiresAuthentication( true ); + bundle.addRequiredAuthorization( ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION, Resource.GLOBAL ); + + return bundle; + } + + public List getNetworkProxies() + { + return networkProxies; + } + + public void setNetworkProxies( List networkProxies ) + { + this.networkProxies = networkProxies; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AbstractManagedRepositoriesAction.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AbstractManagedRepositoriesAction.java new file mode 100644 index 000000000..7fc658676 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AbstractManagedRepositoriesAction.java @@ -0,0 +1,129 @@ +package org.apache.maven.archiva.web.action.admin.repositories; + +/* + * 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.io.FileUtils; +import org.apache.maven.archiva.configuration.Configuration; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.security.ArchivaRoleConstants; +import org.codehaus.plexus.redback.role.RoleManager; +import org.codehaus.plexus.redback.role.RoleManagerException; + +import java.io.File; +import java.io.IOException; + +/** + * Abstract ManagedRepositories Action. + * + * Place for all generic methods used in Managed Repository Administration. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public abstract class AbstractManagedRepositoriesAction + extends AbstractRepositoriesAdminAction +{ + /** + * @plexus.requirement role-hint="default" + */ + protected RoleManager roleManager; + + public static final String CONFIRM = "confirm"; + + public RoleManager getRoleManager() + { + return roleManager; + } + + public void setRoleManager( RoleManager roleManager ) + { + this.roleManager = roleManager; + } + + protected void addRepository( ManagedRepositoryConfiguration repository, Configuration configuration ) + throws IOException + { + // Normalize the path + File file = new File( repository.getLocation() ); + repository.setLocation( file.getCanonicalPath() ); + if ( !file.exists() ) + { + file.mkdirs(); + } + if ( !file.exists() || !file.isDirectory() ) + { + throw new IOException( "unable to add repository - can not create the root directory: " + file ); + } + + configuration.addManagedRepository( repository ); + + } + + protected void addRepositoryRoles( ManagedRepositoryConfiguration newRepository ) throws RoleManagerException + { + String repoId = newRepository.getId(); + + // TODO: double check these are configured on start up + // TODO: belongs in the business logic + + if ( !roleManager.templatedRoleExists( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER, repoId ) ) + { + roleManager.createTemplatedRole( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER, repoId ); + } + + if ( !roleManager.templatedRoleExists( ArchivaRoleConstants.TEMPLATE_REPOSITORY_MANAGER, repoId ) ) + { + roleManager.createTemplatedRole( ArchivaRoleConstants.TEMPLATE_REPOSITORY_MANAGER, repoId ); + } + } + + protected void removeContents( ManagedRepositoryConfiguration existingRepository ) + throws IOException + { + FileUtils.deleteDirectory( new File( existingRepository.getLocation() ) ); + } + + protected void removeRepository( String repoId, Configuration configuration ) + { + ManagedRepositoryConfiguration toremove = configuration.findManagedRepositoryById( repoId ); + if ( toremove != null ) + { + configuration.removeManagedRepository( toremove ); + } + } + + protected void removeRepositoryRoles( ManagedRepositoryConfiguration existingRepository ) + throws RoleManagerException + { + String repoId = existingRepository.getId(); + + if ( roleManager.templatedRoleExists( ArchivaRoleConstants.TEMPLATE_REPOSITORY_MANAGER, repoId ) ) + { + roleManager.removeTemplatedRole( ArchivaRoleConstants.TEMPLATE_REPOSITORY_MANAGER, repoId ); + } + + if ( roleManager.templatedRoleExists( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER, repoId ) ) + { + roleManager.removeTemplatedRole( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER, repoId ); + } + + getLogger().debug( "removed user roles associated with repository " + repoId ); + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AbstractRemoteRepositoriesAction.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AbstractRemoteRepositoriesAction.java new file mode 100644 index 000000000..f991673e1 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AbstractRemoteRepositoriesAction.java @@ -0,0 +1,51 @@ +package org.apache.maven.archiva.web.action.admin.repositories; + +import org.apache.maven.archiva.configuration.Configuration; +import org.apache.maven.archiva.configuration.RemoteRepositoryConfiguration; +import org.codehaus.plexus.redback.role.RoleManagerException; + +import java.io.IOException; + +/* + * 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. + */ + +/** + * AbstractRemoteRepositoriesAction + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class AbstractRemoteRepositoriesAction + extends AbstractRepositoriesAdminAction +{ + protected void addRepository( RemoteRepositoryConfiguration repository, Configuration configuration ) + throws IOException, RoleManagerException + { + configuration.addRemoteRepository( repository ); + } + + protected void removeRepository( String repoId, Configuration configuration ) + { + RemoteRepositoryConfiguration toremove = configuration.findRemoteRepositoryById( repoId ); + if ( toremove != null ) + { + configuration.removeRemoteRepository( toremove ); + } + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AbstractRepositoriesAdminAction.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AbstractRepositoriesAdminAction.java new file mode 100644 index 000000000..a7cd0d7f2 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AbstractRepositoriesAdminAction.java @@ -0,0 +1,115 @@ +package org.apache.maven.archiva.web.action.admin.repositories; + +/* + * 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.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.Configuration; +import org.apache.maven.archiva.configuration.IndeterminateConfigurationException; +import org.apache.maven.archiva.configuration.ProxyConnectorConfiguration; +import org.apache.maven.archiva.security.ArchivaRoleConstants; +import org.codehaus.plexus.redback.rbac.Resource; +import org.codehaus.plexus.redback.xwork.interceptor.SecureAction; +import org.codehaus.plexus.redback.xwork.interceptor.SecureActionBundle; +import org.codehaus.plexus.redback.xwork.interceptor.SecureActionException; +import org.codehaus.plexus.registry.RegistryException; +import org.codehaus.plexus.xwork.action.PlexusActionSupport; + +import java.util.ArrayList; +import java.util.List; + +/** + * Abstract AdminRepositories Action base. + * + * Base class for all repository administrative functions. + * This should be neutral to the type of action (add/edit/delete) and type of repo (managed/remote) + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public abstract class AbstractRepositoriesAdminAction + extends PlexusActionSupport + implements SecureAction +{ + /** + * @plexus.requirement + */ + protected ArchivaConfiguration archivaConfiguration; + + public ArchivaConfiguration getArchivaConfiguration() + { + return archivaConfiguration; + } + + public SecureActionBundle getSecureActionBundle() + throws SecureActionException + { + SecureActionBundle bundle = new SecureActionBundle(); + + bundle.setRequiresAuthentication( true ); + bundle.addRequiredAuthorization( ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION, Resource.GLOBAL ); + + return bundle; + } + + public void setArchivaConfiguration( ArchivaConfiguration archivaConfiguration ) + { + this.archivaConfiguration = archivaConfiguration; + } + + /** + * Save the configuration. + * + * @param configuration the configuration to save. + * @return the webwork result code to issue. + * @throws IOException thrown if unable to save file to disk. + * @throws InvalidConfigurationException thrown if configuration is invalid. + * @throws RegistryException thrown if configuration subsystem has a problem saving the configuration to disk. + */ + protected String saveConfiguration( Configuration configuration ) + { + try + { + archivaConfiguration.save( configuration ); + addActionMessage( "Successfully saved configuration" ); + } + catch ( IndeterminateConfigurationException e ) + { + addActionError( e.getMessage() ); + return INPUT; + } + catch ( RegistryException e ) + { + addActionError( "Configuration Registry Exception: " + e.getMessage() ); + return INPUT; + } + + return SUCCESS; + } + + /** + * Get the list of ProxyConnectors that are present in the configuration. + * + * @return a new list of ProxyConnectors present in the configuration. + */ + protected List getProxyConnectors() + { + return new ArrayList( archivaConfiguration.getConfiguration().getProxyConnectors() ); + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AddManagedRepositoryAction.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AddManagedRepositoryAction.java new file mode 100644 index 000000000..919bce071 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AddManagedRepositoryAction.java @@ -0,0 +1,151 @@ +package org.apache.maven.archiva.web.action.admin.repositories; + +/* + * 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 com.opensymphony.xwork.Preparable; +import com.opensymphony.xwork.Validateable; + +import org.apache.maven.archiva.configuration.Configuration; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.codehaus.plexus.redback.role.RoleManagerException; +import org.codehaus.plexus.scheduler.CronExpressionValidator; +import java.io.File; +import java.io.IOException; + +/** + * AddManagedRepositoryAction + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component role="com.opensymphony.xwork.Action" role-hint="addManagedRepositoryAction" + */ +public class AddManagedRepositoryAction + extends AbstractManagedRepositoriesAction + implements Preparable, Validateable +{ + /** + * The model for this action. + */ + private ManagedRepositoryConfiguration repository; + + private String action = "addRepository"; + + public void prepare() + { + this.repository = new ManagedRepositoryConfiguration(); + this.repository.setReleases( false ); + this.repository.setScanned( false ); + } + + public String input() + { + this.repository.setReleases( true ); + this.repository.setScanned( true ); + + return INPUT; + } + + public String confirmAdd() + { + return save(); + } + + public String commit() + { + File location = new File( repository.getLocation() ); + if( location.exists() ) + { + return CONFIRM; + } + + return save(); + } + + private String save() + { + Configuration configuration = archivaConfiguration.getConfiguration(); + + String result; + try + { + addRepository( repository, configuration ); + addRepositoryRoles( repository ); + result = saveConfiguration( configuration ); + } + catch ( RoleManagerException e ) + { + addActionError( "Role Manager Exception: " + e.getMessage() ); + result = INPUT; + } + catch ( IOException e ) + { + addActionError( "Role Manager Exception: " + e.getMessage() ); + result = INPUT; + } + + return result; + } + + @Override + public void validate() + { + Configuration config = archivaConfiguration.getConfiguration(); + + CronExpressionValidator validator = new CronExpressionValidator(); + String repoId = repository.getId(); + + if ( config.getManagedRepositoriesAsMap().containsKey( repoId ) ) + { + addFieldError( "repository.id", "Unable to add new repository with id [" + repoId + + "], that id already exists as a managed repository." ); + } + else if ( config.getRemoteRepositoriesAsMap().containsKey( repoId ) ) + { + addFieldError( "repository.id", "Unable to add new repository with id [" + repoId + + "], that id already exists as a remote repository." ); + } + else if( config.getRepositoryGroupsAsMap().containsKey( repoId ) ) + { + addFieldError( "repository.id", "Unable to add new repository with id [" + repoId + + "], that id already exists as a repository group." ); + } + + if ( !validator.validate( repository.getRefreshCronExpression() ) ) + { + addFieldError( "repository.refreshCronExpression", "Invalid cron expression." ); + } + } + + public ManagedRepositoryConfiguration getRepository() + { + return repository; + } + + public void setRepository( ManagedRepositoryConfiguration repository ) + { + this.repository = repository; + } + + public String getAction() + { + return action; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AddRemoteRepositoryAction.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AddRemoteRepositoryAction.java new file mode 100644 index 000000000..80d67582c --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AddRemoteRepositoryAction.java @@ -0,0 +1,119 @@ +package org.apache.maven.archiva.web.action.admin.repositories; + +/* + * 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 com.opensymphony.xwork.Preparable; +import com.opensymphony.xwork.Validateable; + +import org.apache.maven.archiva.configuration.Configuration; +import org.apache.maven.archiva.configuration.RemoteRepositoryConfiguration; +import org.codehaus.plexus.redback.role.RoleManagerException; + +import java.io.IOException; + +/** + * AddRemoteRepositoryAction + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component role="com.opensymphony.xwork.Action" role-hint="addRemoteRepositoryAction" + */ +public class AddRemoteRepositoryAction + extends AbstractRemoteRepositoriesAction + implements Preparable, Validateable +{ + /** + * The model for this action. + */ + private RemoteRepositoryConfiguration repository; + + public void prepare() + { + this.repository = new RemoteRepositoryConfiguration(); + } + + public String input() + { + return INPUT; + } + + public String commit() + { + Configuration configuration = archivaConfiguration.getConfiguration(); + + //MRM-752 - url needs trimming + repository.setUrl(repository.getUrl().trim()); + + // Save the repository configuration. + String result; + try + { + addRepository( repository, configuration ); + result = saveConfiguration( configuration ); + } + catch ( IOException e ) + { + addActionError( "I/O Exception: " + e.getMessage() ); + result = INPUT; + } + catch ( RoleManagerException e ) + { + addActionError( "Role Manager Exception: " + e.getMessage() ); + result = INPUT; + } + + return result; + } + + @Override + public void validate() + { + Configuration config = archivaConfiguration.getConfiguration(); + + String repoId = repository.getId(); + + if ( config.getManagedRepositoriesAsMap().containsKey( repoId ) ) + { + addFieldError( "repository.id", "Unable to add new repository with id [" + repoId + + "], that id already exists as a managed repository." ); + } + else if ( config.getRemoteRepositoriesAsMap().containsKey( repoId ) ) + { + addFieldError( "repository.id", "Unable to add new repository with id [" + repoId + + "], that id already exists as a remote repository." ); + } + else if( config.getRepositoryGroupsAsMap().containsKey( repoId ) ) + { + addFieldError( "repository.id", "Unable to add new repository with id [" + repoId + + "], that id already exists as a repository group." ); + } + } + + public RemoteRepositoryConfiguration getRepository() + { + return repository; + } + + public void setRepository( RemoteRepositoryConfiguration repository ) + { + this.repository = repository; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteManagedRepositoryAction.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteManagedRepositoryAction.java new file mode 100644 index 000000000..79b5c8d78 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteManagedRepositoryAction.java @@ -0,0 +1,245 @@ +package org.apache.maven.archiva.web.action.admin.repositories; + +/* + * 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 com.opensymphony.xwork.Preparable; + +import org.apache.commons.lang.StringUtils; +import org.apache.maven.archiva.configuration.Configuration; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; + +import org.apache.maven.archiva.database.ArchivaDAO; +import org.apache.maven.archiva.database.ArchivaDatabaseException; +import org.apache.maven.archiva.database.Constraint; +import org.apache.maven.archiva.database.ObjectNotFoundException; +import org.apache.maven.archiva.database.constraints.ArtifactsByRepositoryConstraint; +import org.apache.maven.archiva.database.constraints.RepositoryContentStatisticsByRepositoryConstraint; +import org.apache.maven.archiva.model.ArchivaArtifact; +import org.apache.maven.archiva.model.ArchivaProjectModel; +import org.apache.maven.archiva.model.RepositoryContentStatistics; + +import org.apache.maven.archiva.configuration.ProxyConnectorConfiguration; + +import org.codehaus.plexus.redback.role.RoleManagerException; + +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * DeleteManagedRepositoryAction + * + * @author Joakim Erdfelt + * @version $Id$ + * @plexus.component role="com.opensymphony.xwork.Action" role-hint="deleteManagedRepositoryAction" + */ +public class DeleteManagedRepositoryAction + extends AbstractManagedRepositoriesAction + implements Preparable +{ + private ManagedRepositoryConfiguration repository; + + private String repoid; + + /** + * @plexus.requirement role-hint="jdo" + */ + private ArchivaDAO archivaDAO; + + public void prepare() + { + if ( StringUtils.isNotBlank( repoid ) ) + { + this.repository = archivaConfiguration.getConfiguration().findManagedRepositoryById( repoid ); + } + } + + public String confirmDelete() + { + if ( StringUtils.isBlank( repoid ) ) + { + addActionError( "Unable to delete managed repository: repository id was blank." ); + return ERROR; + } + + return INPUT; + } + + public String deleteEntry() + { + return deleteRepository( false ); + } + + public String deleteContents() + { + return deleteRepository( true ); + } + + private String deleteRepository( boolean deleteContents ) + { + ManagedRepositoryConfiguration existingRepository = repository; + if ( existingRepository == null ) + { + addActionError( "A repository with that id does not exist" ); + return ERROR; + } + + String result = SUCCESS; + + try + { + Configuration configuration = archivaConfiguration.getConfiguration(); + cleanupRepositoryData( existingRepository ); + removeRepository( repoid, configuration ); + result = saveConfiguration( configuration ); + + if ( result.equals( SUCCESS ) ) + { + if ( deleteContents ) + { + removeContents( existingRepository ); + } + } + } + catch ( IOException e ) + { + addActionError( "Unable to delete repository: " + e.getMessage() ); + result = ERROR; + } + catch ( RoleManagerException e ) + { + addActionError( "Unable to delete repository: " + e.getMessage() ); + result = ERROR; + } + catch ( ArchivaDatabaseException e ) + { + addActionError( "Unable to delete repositoy: " + e.getMessage() ); + result = ERROR; + } + + return result; + } + + private void cleanupRepositoryData( ManagedRepositoryConfiguration cleanupRepository ) + throws RoleManagerException, ArchivaDatabaseException + { + removeRepositoryRoles( cleanupRepository ); + cleanupDatabase( cleanupRepository.getId() ); + cleanupScanStats( cleanupRepository.getId() ); + + List proxyConnectors = getProxyConnectors(); + for ( ProxyConnectorConfiguration proxyConnector : proxyConnectors ) + { + if ( StringUtils.equals( proxyConnector.getSourceRepoId(), cleanupRepository.getId() ) ) + { + archivaConfiguration.getConfiguration().removeProxyConnector( proxyConnector ); + } + } + + Map> repoToGroupMap = archivaConfiguration.getConfiguration().getRepositoryToGroupMap(); + if( repoToGroupMap != null ) + { + if( repoToGroupMap.containsKey( cleanupRepository.getId() ) ) + { + List repoGroups = repoToGroupMap.get( cleanupRepository.getId() ); + for( String repoGroup : repoGroups ) + { + archivaConfiguration.getConfiguration().findRepositoryGroupById( repoGroup ).removeRepository( cleanupRepository.getId() ); + } + } + } + } + + private void cleanupDatabase( String repoId ) + throws ArchivaDatabaseException + { + Constraint constraint = new ArtifactsByRepositoryConstraint( repoId ); + + List artifacts = archivaDAO.getArtifactDAO().queryArtifacts( constraint ); + + for ( ArchivaArtifact artifact : artifacts ) + { + getLogger().info( "Removing artifact " + artifact + " from the database." ); + try + { + archivaDAO.getArtifactDAO().deleteArtifact( artifact ); + + ArchivaProjectModel projectModel = + archivaDAO.getProjectModelDAO().getProjectModel( artifact.getGroupId(), artifact.getArtifactId(), + artifact.getVersion() ); + + archivaDAO.getProjectModelDAO().deleteProjectModel( projectModel ); + } + catch ( ObjectNotFoundException oe ) + { + getLogger().info( "Project model of artifact " + artifact + " does not exist in the database. " + + "Moving on to the next artifact." ); + } + catch ( ArchivaDatabaseException ae ) + { + getLogger().info( "Unable to delete artifact " + artifact + " from the database. " + + "Moving on to the next artifact." ); + } + } + } + + private void cleanupScanStats( String repoId ) + throws ArchivaDatabaseException + { + List results = + archivaDAO.getRepositoryContentStatisticsDAO().queryRepositoryContentStatistics( + new RepositoryContentStatisticsByRepositoryConstraint( repoId ) ); + + for ( RepositoryContentStatistics stats : results ) + { + archivaDAO.getRepositoryContentStatisticsDAO().deleteRepositoryContentStatistics( stats ); + } + } + + public ManagedRepositoryConfiguration getRepository() + { + return repository; + } + + public void setRepository( ManagedRepositoryConfiguration repository ) + { + this.repository = repository; + } + + public String getRepoid() + { + return repoid; + } + + public void setRepoid( String repoid ) + { + this.repoid = repoid; + } + + public void setArchivaDAO( ArchivaDAO archivaDAO ) + { + this.archivaDAO = archivaDAO; + } + + public ArchivaDAO getArchivaDAO() + { + return archivaDAO; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteRemoteRepositoryAction.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteRemoteRepositoryAction.java new file mode 100644 index 000000000..c63996b5f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteRemoteRepositoryAction.java @@ -0,0 +1,118 @@ +package org.apache.maven.archiva.web.action.admin.repositories; + +/* + * 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 com.opensymphony.xwork.Preparable; + +import org.apache.commons.lang.StringUtils; +import org.apache.maven.archiva.configuration.Configuration; +import org.apache.maven.archiva.configuration.ProxyConnectorConfiguration; +import org.apache.maven.archiva.configuration.RemoteRepositoryConfiguration; + +import java.util.List; + +/** + * DeleteRemoteRepositoryAction + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component role="com.opensymphony.xwork.Action" role-hint="deleteRemoteRepositoryAction" + */ +public class DeleteRemoteRepositoryAction + extends AbstractRemoteRepositoriesAction + implements Preparable +{ + private RemoteRepositoryConfiguration repository; + + private String repoid; + + public void prepare() + { + if ( StringUtils.isNotBlank( repoid ) ) + { + this.repository = archivaConfiguration.getConfiguration().findRemoteRepositoryById( repoid ); + } + } + + public String confirmDelete() + { + if ( StringUtils.isBlank( repoid ) ) + { + addActionError( "Unable to delete remote repository: repository id was blank." ); + return ERROR; + } + + return INPUT; + } + + public String delete() + { + String result = SUCCESS; + RemoteRepositoryConfiguration existingRepository = repository; + if ( existingRepository == null ) + { + addActionError( "A repository with that id does not exist" ); + return ERROR; + } + + Configuration configuration = archivaConfiguration.getConfiguration(); + removeRepository( repoid, configuration ); + result = saveConfiguration( configuration ); + + cleanupRepositoryData( existingRepository ); + + return result; + } + + private void cleanupRepositoryData( RemoteRepositoryConfiguration existingRepository ) + { + // [MRM-520] Proxy Connectors are not deleted with the deletion of a Repository. + + List proxyConnectors = getProxyConnectors(); + for ( ProxyConnectorConfiguration proxyConnector : proxyConnectors ) + { + if ( StringUtils.equals( proxyConnector.getTargetRepoId(), existingRepository.getId() ) ) + { + archivaConfiguration.getConfiguration().removeProxyConnector( proxyConnector ); + } + } + } + + public RemoteRepositoryConfiguration getRepository() + { + return repository; + } + + public void setRepository( RemoteRepositoryConfiguration repository ) + { + this.repository = repository; + } + + public String getRepoid() + { + return repoid; + } + + public void setRepoid( String repoid ) + { + this.repoid = repoid; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteRepositoryGroupAction.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteRepositoryGroupAction.java new file mode 100644 index 000000000..653a29318 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteRepositoryGroupAction.java @@ -0,0 +1,96 @@ +package org.apache.maven.archiva.web.action.admin.repositories; + +/* + * 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 com.opensymphony.xwork.Preparable; + +import org.apache.commons.lang.StringUtils; +import org.apache.maven.archiva.configuration.Configuration; +import org.apache.maven.archiva.configuration.RepositoryGroupConfiguration; + +/** + * DeleteRepositoryGroupAction + * + * @author + * @version + * @plexus.component role="com.opensymphony.xwork.Action" role-hint="deleteRepositoryGroupAction" + */ +public class DeleteRepositoryGroupAction + extends AbstractRepositoriesAdminAction + implements Preparable +{ + private RepositoryGroupConfiguration repositoryGroup; + + private String repoGroupId; + + public void prepare() + { + if ( StringUtils.isNotBlank( repoGroupId ) ) + { + this.repositoryGroup = archivaConfiguration.getConfiguration().findRepositoryGroupById( repoGroupId ); + } + } + + public String confirmDelete() + { + if ( StringUtils.isBlank( repoGroupId ) ) + { + addActionError( "Unable to delete repository group: repository id was blank." ); + return ERROR; + } + + return INPUT; + } + + public String delete() + { + Configuration config = archivaConfiguration.getConfiguration(); + + RepositoryGroupConfiguration group = config.findRepositoryGroupById( repoGroupId ); + if ( group == null ) + { + addActionError( "A repository group with that id does not exist." ); + return ERROR; + } + + config.removeRepositoryGroup( group ); + return saveConfiguration( config ); + } + + public RepositoryGroupConfiguration getRepositoryGroup() + { + return repositoryGroup; + } + + public void setRepositoryGroup( RepositoryGroupConfiguration repositoryGroup ) + { + this.repositoryGroup = repositoryGroup; + } + + public String getRepoGroupId() + { + return repoGroupId; + } + + public void setRepoGroupId( String repoGroupId ) + { + this.repoGroupId = repoGroupId; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/EditManagedRepositoryAction.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/EditManagedRepositoryAction.java new file mode 100644 index 000000000..86817bab6 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/EditManagedRepositoryAction.java @@ -0,0 +1,167 @@ +package org.apache.maven.archiva.web.action.admin.repositories; + +/* + * 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 com.opensymphony.xwork.Preparable; +import com.opensymphony.xwork.Validateable; + +import org.apache.commons.lang.StringUtils; +import org.apache.maven.archiva.configuration.Configuration; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.codehaus.plexus.redback.role.RoleManagerException; +import org.codehaus.plexus.scheduler.CronExpressionValidator; + +import java.io.File; +import java.io.IOException; + +/** + * AddManagedRepositoryAction + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component role="com.opensymphony.xwork.Action" role-hint="editManagedRepositoryAction" + */ +public class EditManagedRepositoryAction + extends AbstractManagedRepositoriesAction + implements Preparable, Validateable +{ + /** + * The model for this action. + */ + private ManagedRepositoryConfiguration repository; + + private String repoid; + + private final String action = "editRepository"; + + public void prepare() + { + if ( StringUtils.isNotBlank( repoid ) ) + { + repository = archivaConfiguration.getConfiguration().findManagedRepositoryById( repoid ); + } + else if ( repository != null ) + { + repository.setReleases( false ); + repository.setScanned( false ); + } + } + + public String input() + { + if ( repository == null ) + { + addActionError( "Edit failure, unable to edit a repository with a blank repository id." ); + return ERROR; + } + + return INPUT; + } + + public String confirmUpdate() + { + return save(); + } + + public String commit() + { + ManagedRepositoryConfiguration existingConfig = + archivaConfiguration.getConfiguration().findManagedRepositoryById( repository.getId() ); + + // check if the location was changed + if( !StringUtils.equalsIgnoreCase( existingConfig.getLocation().trim(), repository.getLocation().trim() ) ) + { + File dir = new File( repository.getLocation() ); + if( dir.exists() ) + { + return CONFIRM; + } + } + + return save(); + } + + private String save() + { + // Ensure that the fields are valid. + Configuration configuration = archivaConfiguration.getConfiguration(); + + // We are in edit mode, remove the old repository configuration. + removeRepository( repository.getId(), configuration ); + + // Save the repository configuration. + String result; + try + { + addRepository( repository, configuration ); + addRepositoryRoles( repository ); + result = saveConfiguration( configuration ); + } + catch ( IOException e ) + { + addActionError( "I/O Exception: " + e.getMessage() ); + result = ERROR; + } + catch ( RoleManagerException e ) + { + addActionError( "Role Manager Exception: " + e.getMessage() ); + result = ERROR; + } + + return result; + } + + @Override + public void validate() + { + CronExpressionValidator validator = new CronExpressionValidator(); + + if ( !validator.validate( repository.getRefreshCronExpression() ) ) + { + addFieldError( "repository.refreshCronExpression", "Invalid cron expression." ); + } + } + + public String getRepoid() + { + return repoid; + } + + public void setRepoid( String repoid ) + { + this.repoid = repoid; + } + + public ManagedRepositoryConfiguration getRepository() + { + return repository; + } + + public void setRepository( ManagedRepositoryConfiguration repository ) + { + this.repository = repository; + } + + public String getAction() + { + return action; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/EditRemoteRepositoryAction.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/EditRemoteRepositoryAction.java new file mode 100644 index 000000000..abcb8d775 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/EditRemoteRepositoryAction.java @@ -0,0 +1,120 @@ +package org.apache.maven.archiva.web.action.admin.repositories; + +/* + * 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 com.opensymphony.xwork.Preparable; + +import org.apache.commons.lang.StringUtils; +import org.apache.maven.archiva.configuration.Configuration; +import org.apache.maven.archiva.configuration.RemoteRepositoryConfiguration; +import org.codehaus.plexus.redback.role.RoleManagerException; + +import java.io.IOException; + +/** + * EditRemoteRepositoryAction + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component role="com.opensymphony.xwork.Action" role-hint="editRemoteRepositoryAction" + */ +public class EditRemoteRepositoryAction + extends AbstractRemoteRepositoriesAction + implements Preparable +{ + /** + * The model for this action. + */ + private RemoteRepositoryConfiguration repository; + + /** + * The repository id to edit. + */ + private String repoid; + + public void prepare() + { + String id = repoid; + if ( StringUtils.isNotBlank( repoid ) ) + { + this.repository = archivaConfiguration.getConfiguration().findRemoteRepositoryById( id ); + } + } + + public String input() + { + if ( StringUtils.isBlank( repoid ) ) + { + addActionError( "Edit failure, unable to edit a repository with a blank repository id." ); + return ERROR; + } + + return INPUT; + } + + public String commit() + { + Configuration configuration = archivaConfiguration.getConfiguration(); + + // We are in edit mode, remove the old repository configuration. + removeRepository( repository.getId(), configuration ); + + // Save the repository configuration. + String result; + try + { + addRepository( repository, configuration ); + result = saveConfiguration( configuration ); + } + catch ( IOException e ) + { + addActionError( "I/O Exception: " + e.getMessage() ); + result = INPUT; + } + catch ( RoleManagerException e ) + { + addActionError( "Role Manager Exception: " + e.getMessage() ); + result = INPUT; + } + + return result; + } + + public RemoteRepositoryConfiguration getRepository() + { + return repository; + } + + public void setRepository( RemoteRepositoryConfiguration repository ) + { + this.repository = repository; + } + + public String getRepoid() + { + return repoid; + } + + public void setRepoid( String repoid ) + { + this.repoid = repoid; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoriesAction.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoriesAction.java new file mode 100644 index 000000000..3dda6d7d5 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoriesAction.java @@ -0,0 +1,145 @@ +package org.apache.maven.archiva.web.action.admin.repositories; + +/* + * 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 com.opensymphony.webwork.interceptor.ServletRequestAware; +import com.opensymphony.xwork.Preparable; +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.configuration.RemoteRepositoryConfiguration; +import org.apache.maven.archiva.configuration.functors.RepositoryConfigurationComparator; +import org.apache.maven.archiva.database.ArchivaDAO; +import org.apache.maven.archiva.database.constraints.MostRecentRepositoryScanStatistics; +import org.apache.maven.archiva.model.RepositoryContentStatistics; +import org.apache.maven.archiva.security.ArchivaRoleConstants; +import org.apache.maven.archiva.web.util.ContextUtils; +import org.codehaus.plexus.redback.rbac.Resource; +import org.codehaus.plexus.redback.xwork.interceptor.SecureAction; +import org.codehaus.plexus.redback.xwork.interceptor.SecureActionBundle; +import org.codehaus.plexus.redback.xwork.interceptor.SecureActionException; +import org.codehaus.plexus.xwork.action.PlexusActionSupport; + +import javax.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Shows the Repositories Tab for the administrator. + * + * @author Joakim Erdfelt + * @version $Id$ + * @plexus.component role="com.opensymphony.xwork.Action" role-hint="repositoriesAction" + */ +public class RepositoriesAction + extends PlexusActionSupport + implements SecureAction, ServletRequestAware, Preparable +{ + /** + * @plexus.requirement + */ + private ArchivaConfiguration archivaConfiguration; + + private List managedRepositories; + + private List remoteRepositories; + + private Map repositoryStatistics; + + private Map> repositoryToGroupMap; + + /** + * @plexus.requirement role-hint="jdo" + */ + private ArchivaDAO dao; + + /** + * Used to construct the repository WebDAV URL in the repository action. + */ + private String baseUrl; + + public void setServletRequest( HttpServletRequest request ) + { + // TODO: is there a better way to do this? + this.baseUrl = ContextUtils.getBaseURL( request, "repository" ); + } + + public SecureActionBundle getSecureActionBundle() + throws SecureActionException + { + SecureActionBundle bundle = new SecureActionBundle(); + + bundle.setRequiresAuthentication( true ); + bundle.addRequiredAuthorization( ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION, Resource.GLOBAL ); + + return bundle; + } + + public void prepare() + { + Configuration config = archivaConfiguration.getConfiguration(); + + remoteRepositories = new ArrayList( config.getRemoteRepositories() ); + managedRepositories = new ArrayList( config.getManagedRepositories() ); + repositoryToGroupMap = config.getRepositoryToGroupMap(); + + Collections.sort( managedRepositories, new RepositoryConfigurationComparator() ); + Collections.sort( remoteRepositories, new RepositoryConfigurationComparator() ); + + repositoryStatistics = new HashMap(); + for ( ManagedRepositoryConfiguration repo : managedRepositories ) + { + List results = + dao.query( new MostRecentRepositoryScanStatistics( repo.getId() ) ); + if ( !results.isEmpty() ) + { + repositoryStatistics.put( repo.getId(), results.get( 0 ) ); + } + } + } + + public List getManagedRepositories() + { + return managedRepositories; + } + + public List getRemoteRepositories() + { + return remoteRepositories; + } + + public Map getRepositoryStatistics() + { + return repositoryStatistics; + } + + public String getBaseUrl() + { + return baseUrl; + } + + public Map> getRepositoryToGroupMap() + { + return repositoryToGroupMap; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoryGroupsAction.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoryGroupsAction.java new file mode 100644 index 000000000..d1109d12a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoryGroupsAction.java @@ -0,0 +1,264 @@ +package org.apache.maven.archiva.web.action.admin.repositories; + +/* + * 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 java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import javax.servlet.http.HttpServletRequest; + +import com.opensymphony.webwork.interceptor.ServletRequestAware; +import com.opensymphony.xwork.Preparable; + +import org.apache.commons.lang.StringUtils; +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.web.util.ContextUtils; + +/** + * RepositoryGroupsAction + * + * @author + * @version + * @plexus.component role="com.opensymphony.xwork.Action" role-hint="repositoryGroupsAction" + */ +public class RepositoryGroupsAction + extends AbstractRepositoriesAdminAction + implements ServletRequestAware, Preparable +{ + private RepositoryGroupConfiguration repositoryGroup; + + private Map repositoryGroups; + + private Map managedRepositories; + + private Map> groupToRepositoryMap; + + private String repoGroupId; + + private String repoId; + + /** + * Used to construct the repository WebDAV URL in the repository action. + */ + private String baseUrl; + + private static final Pattern REPO_GROUP_ID_PATTERN = Pattern.compile( "[A-Za-z0-9\\._\\-]+" ); + + public void setServletRequest( HttpServletRequest request ) + { + this.baseUrl = ContextUtils.getBaseURL( request, "repository" ); + } + + public void prepare() + { + Configuration config = archivaConfiguration.getConfiguration(); + + repositoryGroup = new RepositoryGroupConfiguration(); + repositoryGroups = config.getRepositoryGroupsAsMap(); + managedRepositories = config.getManagedRepositoriesAsMap(); + groupToRepositoryMap = config.getGroupToRepositoryMap(); + } + + public String addRepositoryGroup() + { + Configuration configuration = archivaConfiguration.getConfiguration(); + + String repoGroupId = repositoryGroup.getId(); + + if( repoGroupId == null || "".equals( repoGroupId.trim() ) ) + { + addActionError( "Identifier field is required." ); + return ERROR; + } + + if( repoGroupId.length() > 100 ) + { + addActionError( "Identifier [" + repoGroupId + "] is over the maximum limit of 100 characters" ); + return ERROR; + } + + Matcher matcher = REPO_GROUP_ID_PATTERN.matcher( repoGroupId ); + if( !matcher.matches() ) + { + addActionError( "Invalid character(s) found in identifier. Only the following characters are allowed: alphanumeric, '.', '-' and '_'" ); + return ERROR; + } + + if ( StringUtils.isBlank( repoGroupId ) ) + { + addActionError( "You must enter a repository group id." ); + return ERROR; + } + + if ( configuration.getRepositoryGroupsAsMap().containsKey( repoGroupId ) ) + { + addActionError( "Unable to add new repository group with id [" + repoGroupId + + "], that id already exists as a repository group." ); + return ERROR; + } + else if ( configuration.getManagedRepositoriesAsMap().containsKey( repoGroupId ) ) + { + addActionError( "Unable to add new repository group with id [" + repoGroupId + + "], that id already exists as a managed repository." ); + return ERROR; + } + else if ( configuration.getRemoteRepositoriesAsMap().containsKey( repoGroupId ) ) + { + addActionError( "Unable to add new repository group with id [" + repoGroupId + + "], that id already exists as a remote repository." ); + return ERROR; + } + + configuration.addRepositoryGroup( repositoryGroup ); + return saveConfiguration( configuration ); + } + + public String addRepositoryToGroup() + { + Configuration config = archivaConfiguration.getConfiguration(); + RepositoryGroupConfiguration group = config.findRepositoryGroupById( repoGroupId ); + + validateRepository(); + + if ( hasErrors() ) + { + return ERROR; + } + + if ( group.getRepositories().contains( repoId ) ) + { + addActionError( "Repository with id [" + repoId + "] is already in the group" ); + return ERROR; + } + + // remove the old repository group configuration + config.removeRepositoryGroup( group ); + + // save repository group configuration + group.addRepository( repoId ); + config.addRepositoryGroup( group ); + + return saveConfiguration( config ); + } + + public String removeRepositoryFromGroup() + { + Configuration config = archivaConfiguration.getConfiguration(); + RepositoryGroupConfiguration group = config.findRepositoryGroupById( repoGroupId ); + + validateRepository(); + + if( hasErrors() ) + { + return ERROR; + } + + if ( !group.getRepositories().contains( repoId ) ) + { + addActionError( "No repository with id[" + repoId + "] found in the group" ); + return ERROR; + } + + // remove the old repository group configuration + config.removeRepositoryGroup( group ); + + // save repository group configuration + group.removeRepository( repoId ); + config.addRepositoryGroup( group ); + + return saveConfiguration( config ); + } + + public void validateRepository() + { + Configuration config = archivaConfiguration.getConfiguration(); + RepositoryGroupConfiguration group = config.findRepositoryGroupById( repoGroupId ); + ManagedRepositoryConfiguration repo = config.findManagedRepositoryById( repoId ); + + if ( group == null ) + { + addActionError( "A repository group with that id does not exist." ); + } + + if ( repo == null ) + { + addActionError( "A repository with that id does not exist." ); + } + } + + public RepositoryGroupConfiguration getRepositoryGroup() + { + return repositoryGroup; + } + + public void setRepositoryGroup( RepositoryGroupConfiguration repositoryGroup ) + { + this.repositoryGroup = repositoryGroup; + } + + public Map getRepositoryGroups() + { + return repositoryGroups; + } + + public void setRepositoryGroups( Map repositoryGroups ) + { + this.repositoryGroups = repositoryGroups; + } + + public Map getManagedRepositories() + { + return managedRepositories; + } + + public Map> getGroupToRepositoryMap() + { + return this.groupToRepositoryMap; + } + + public String getRepoGroupId() + { + return repoGroupId; + } + + public void setRepoGroupId( String repoGroupId ) + { + this.repoGroupId = repoGroupId; + } + + public String getRepoId() + { + return repoId; + } + + public void setRepoId( String repoId ) + { + this.repoId = repoId; + } + + public String getBaseUrl() + { + return baseUrl; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/SortRepositoriesAction.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/SortRepositoriesAction.java new file mode 100644 index 000000000..4ac5c3ddc --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/SortRepositoriesAction.java @@ -0,0 +1,122 @@ +package org.apache.maven.archiva.web.action.admin.repositories; + +/* + * 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.commons.lang.StringUtils; +import org.apache.maven.archiva.configuration.Configuration; +import org.apache.maven.archiva.configuration.RepositoryGroupConfiguration; + +/** + * SortRepositoriesAction + * + * @author + * @version + * @plexus.component role="com.opensymphony.xwork.Action" role-hint="sortRepositoriesAction" + */ +public class SortRepositoriesAction + extends AbstractRepositoriesAdminAction +{ + private String repoGroupId; + + private String targetRepo; + + public String sortDown() + { + Configuration config = archivaConfiguration.getConfiguration(); + + List repositories = getRepositoriesFromGroup(); + + int idx = findTargetRepository( repositories, targetRepo ); + + if ( idx >= 0 && validIndex( repositories, idx + 1 ) ) + { + repositories.remove( idx ); + repositories.add( idx + 1, targetRepo ); + } + + return saveConfiguration( config ); + } + + public String sortUp() + { + Configuration config = archivaConfiguration.getConfiguration(); + + List repositories = getRepositoriesFromGroup(); + + int idx = findTargetRepository( repositories, targetRepo ); + + if ( idx >= 0 && validIndex( repositories, idx - 1 ) ) + { + repositories.remove( idx ); + repositories.add( idx - 1, targetRepo ); + } + + return saveConfiguration( config ); + } + + public String getRepoGroupId() + { + return repoGroupId; + } + + public void setRepoGroupId( String repoGroupId ) + { + this.repoGroupId = repoGroupId; + } + + public String getTargetRepo() + { + return targetRepo; + } + + public void setTargetRepo( String targetRepo ) + { + this.targetRepo = targetRepo; + } + + private int findTargetRepository( List repositories, String targetRepository ) + { + int idx = ( -1 ); + + for ( int i = 0; i < repositories.size(); i++ ) + { + if ( StringUtils.equals( targetRepository, repositories.get(i) ) ) + { + idx = i; + break; + } + } + return idx; + } + + private List getRepositoriesFromGroup() + { + Configuration config = archivaConfiguration.getConfiguration(); + RepositoryGroupConfiguration repoGroup = config.findRepositoryGroupById( repoGroupId ); + return repoGroup.getRepositories(); + } + + private boolean validIndex( List repositories, int idx ) + { + return ( idx >= 0 ) && ( idx < repositories.size() ); + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/scanning/AddAdminRepoConsumerClosure.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/scanning/AddAdminRepoConsumerClosure.java new file mode 100644 index 000000000..eba5cee96 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/scanning/AddAdminRepoConsumerClosure.java @@ -0,0 +1,66 @@ +package org.apache.maven.archiva.web.action.admin.scanning; + +/* + * 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.collections.Closure; +import org.apache.maven.archiva.consumers.RepositoryContentConsumer; + +import java.util.ArrayList; +import java.util.List; + +/** + * AddAdminRepoConsumerClosure + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class AddAdminRepoConsumerClosure + implements Closure +{ + private List list = new ArrayList(); + + private List selectedIds; + + public AddAdminRepoConsumerClosure( List selectedIds ) + { + this.selectedIds = selectedIds; + } + + public void execute( Object input ) + { + if ( input instanceof RepositoryContentConsumer ) + { + RepositoryContentConsumer consumer = (RepositoryContentConsumer) input; + + boolean enabled = this.selectedIds.contains( consumer.getId() ); + AdminRepositoryConsumer adminconsumer = new AdminRepositoryConsumer(); + adminconsumer.setEnabled( enabled ); + adminconsumer.setId( consumer.getId() ); + adminconsumer.setDescription( consumer.getDescription() ); + + list.add( adminconsumer ); + } + } + + public List getList() + { + return list; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/scanning/AdminRepositoryConsumer.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/scanning/AdminRepositoryConsumer.java new file mode 100644 index 000000000..cc33d23b4 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/scanning/AdminRepositoryConsumer.java @@ -0,0 +1,63 @@ +package org.apache.maven.archiva.web.action.admin.scanning; + +/* + * 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. + */ + +/** + * AdminRepositoryConsumer + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class AdminRepositoryConsumer +{ + private boolean enabled = false; + private String id; + private String description; + + public String getDescription() + { + return description; + } + + public String getId() + { + return id; + } + + public boolean isEnabled() + { + return enabled; + } + + public void setDescription( String description ) + { + this.description = description; + } + + public void setEnabled( boolean enabled ) + { + this.enabled = enabled; + } + + public void setId( String id ) + { + this.id = id; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/scanning/AdminRepositoryConsumerComparator.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/scanning/AdminRepositoryConsumerComparator.java new file mode 100644 index 000000000..cf549fe0d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/scanning/AdminRepositoryConsumerComparator.java @@ -0,0 +1,66 @@ +package org.apache.maven.archiva.web.action.admin.scanning; + +/* + * 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.Comparator; + +/** + * AdminRepositoryConsumerComparator + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class AdminRepositoryConsumerComparator + implements Comparator +{ + private static AdminRepositoryConsumerComparator INSTANCE = new AdminRepositoryConsumerComparator(); + + public static AdminRepositoryConsumerComparator getInstance() + { + return INSTANCE; + } + + public int compare( Object o1, Object o2 ) + { + if ( o1 == null && o2 == null ) + { + return 0; + } + + if ( o1 == null && o2 != null ) + { + return 1; + } + + if ( o1 != null && o2 == null ) + { + return -1; + } + + if ( ( o1 instanceof AdminRepositoryConsumer ) && ( o2 instanceof AdminRepositoryConsumer ) ) + { + String id1 = ( (AdminRepositoryConsumer) o1 ).getId(); + String id2 = ( (AdminRepositoryConsumer) o2 ).getId(); + return id1.compareToIgnoreCase( id2 ); + } + + return 0; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/scanning/RepositoryScanningAction.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/scanning/RepositoryScanningAction.java new file mode 100644 index 000000000..0fb82401b --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/scanning/RepositoryScanningAction.java @@ -0,0 +1,320 @@ +package org.apache.maven.archiva.web.action.admin.scanning; + +/* + * 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 com.opensymphony.xwork.Preparable; +import com.opensymphony.xwork.Validateable; +import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.Configuration; +import org.apache.maven.archiva.configuration.FileType; +import org.apache.maven.archiva.configuration.IndeterminateConfigurationException; +import org.apache.maven.archiva.configuration.RepositoryScanningConfiguration; +import org.apache.maven.archiva.configuration.functors.FiletypeSelectionPredicate; +import org.apache.maven.archiva.configuration.functors.FiletypeToMapClosure; +import org.apache.maven.archiva.repository.scanner.RepositoryContentConsumers; +import org.apache.maven.archiva.security.ArchivaRoleConstants; +import org.codehaus.plexus.redback.rbac.Resource; +import org.codehaus.plexus.redback.xwork.interceptor.SecureAction; +import org.codehaus.plexus.redback.xwork.interceptor.SecureActionBundle; +import org.codehaus.plexus.redback.xwork.interceptor.SecureActionException; +import org.codehaus.plexus.registry.RegistryException; +import org.codehaus.plexus.xwork.action.PlexusActionSupport; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +/** + * RepositoryScanningAction + * + * @author Joakim Erdfelt + * @version $Id$ + * @plexus.component role="com.opensymphony.xwork.Action" role-hint="repositoryScanningAction" + */ +public class RepositoryScanningAction + extends PlexusActionSupport + implements Preparable, Validateable, SecureAction +{ + /** + * @plexus.requirement + */ + private ArchivaConfiguration archivaConfiguration; + + /** + * @plexus.requirement + */ + private RepositoryContentConsumers repoconsumerUtil; + + private Map fileTypeMap; + + private List fileTypeIds; + + /** + * List of {@link AdminRepositoryConsumer} objects for consumers of known content. + */ + private List knownContentConsumers; + + /** + * List of enabled {@link AdminRepositoryConsumer} objects for consumers of known content. + */ + private List enabledKnownContentConsumers; + + /** + * List of {@link AdminRepositoryConsumer} objects for consumers of invalid/unknown content. + */ + private List invalidContentConsumers; + + /** + * List of enabled {@link AdminRepositoryConsumer} objects for consumers of invalid/unknown content. + */ + private List enabledInvalidContentConsumers; + + private String pattern; + + private String fileTypeId; + + public void addActionError( String anErrorMessage ) + { + super.addActionError( anErrorMessage ); + getLogger().warn( "[ActionError] " + anErrorMessage ); + } + + public void addActionMessage( String aMessage ) + { + super.addActionMessage( aMessage ); + getLogger().info( "[ActionMessage] " + aMessage ); + } + + public String addFiletypePattern() + { + getLogger().info( "Add New File Type Pattern [" + getFileTypeId() + ":" + getPattern() + "]" ); + + if ( !isValidFiletypeCommand() ) + { + return INPUT; + } + + String id = getFileTypeId(); + String pattern = getPattern(); + + FileType filetype = findFileType( id ); + if ( filetype == null ) + { + addActionError( "Pattern not added, unable to find filetype " + id ); + return INPUT; + } + + if ( filetype.getPatterns().contains( pattern ) ) + { + addActionError( "Not adding pattern \"" + pattern + "\" to filetype " + id + " as it already exists." ); + return INPUT; + } + + filetype.addPattern( pattern ); + addActionMessage( "Added pattern \"" + pattern + "\" to filetype " + id ); + + return saveConfiguration(); + } + + public String getFileTypeId() + { + return fileTypeId; + } + + public List getFileTypeIds() + { + return fileTypeIds; + } + + public Map getFileTypeMap() + { + return fileTypeMap; + } + + public List getInvalidContentConsumers() + { + return invalidContentConsumers; + } + + public List getKnownContentConsumers() + { + return knownContentConsumers; + } + + public String getPattern() + { + return pattern; + } + + public SecureActionBundle getSecureActionBundle() + throws SecureActionException + { + SecureActionBundle bundle = new SecureActionBundle(); + + bundle.setRequiresAuthentication( true ); + bundle.addRequiredAuthorization( ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION, Resource.GLOBAL ); + + return bundle; + } + + public void prepare() + throws Exception + { + Configuration config = archivaConfiguration.getConfiguration(); + RepositoryScanningConfiguration reposcanning = config.getRepositoryScanning(); + + FiletypeToMapClosure filetypeToMapClosure = new FiletypeToMapClosure(); + + CollectionUtils.forAllDo( reposcanning.getFileTypes(), filetypeToMapClosure ); + fileTypeMap = filetypeToMapClosure.getMap(); + + AddAdminRepoConsumerClosure addAdminRepoConsumer; + + addAdminRepoConsumer = new AddAdminRepoConsumerClosure( reposcanning.getKnownContentConsumers() ); + CollectionUtils.forAllDo( repoconsumerUtil.getAvailableKnownConsumers(), addAdminRepoConsumer ); + this.knownContentConsumers = addAdminRepoConsumer.getList(); + Collections.sort( knownContentConsumers, AdminRepositoryConsumerComparator.getInstance() ); + + addAdminRepoConsumer = new AddAdminRepoConsumerClosure( reposcanning.getInvalidContentConsumers() ); + CollectionUtils.forAllDo( repoconsumerUtil.getAvailableInvalidConsumers(), addAdminRepoConsumer ); + this.invalidContentConsumers = addAdminRepoConsumer.getList(); + Collections.sort( invalidContentConsumers, AdminRepositoryConsumerComparator.getInstance() ); + + fileTypeIds = new ArrayList(); + fileTypeIds.addAll( fileTypeMap.keySet() ); + Collections.sort( fileTypeIds ); + } + + public String removeFiletypePattern() + { + getLogger().info( "Remove File Type Pattern [" + getFileTypeId() + ":" + getPattern() + "]" ); + + if ( !isValidFiletypeCommand() ) + { + return INPUT; + } + + FileType filetype = findFileType( getFileTypeId() ); + if ( filetype == null ) + { + addActionError( "Pattern not removed, unable to find filetype " + getFileTypeId() ); + return INPUT; + } + + filetype.removePattern( getPattern() ); + + return saveConfiguration(); + } + + public void setFileTypeId( String fileTypeId ) + { + this.fileTypeId = fileTypeId; + } + + public void setPattern( String pattern ) + { + this.pattern = pattern; + } + + public String updateInvalidConsumers() + { + addActionMessage( "Update Invalid Consumers" ); + + archivaConfiguration.getConfiguration().getRepositoryScanning().setInvalidContentConsumers( + enabledInvalidContentConsumers ); + + return saveConfiguration(); + } + + public String updateKnownConsumers() + { + addActionMessage( "Update Known Consumers" ); + + archivaConfiguration.getConfiguration().getRepositoryScanning().setKnownContentConsumers( + enabledKnownContentConsumers ); + + return saveConfiguration(); + } + + private FileType findFileType( String id ) + { + RepositoryScanningConfiguration scanning = archivaConfiguration.getConfiguration().getRepositoryScanning(); + return (FileType) CollectionUtils.find( scanning.getFileTypes(), new FiletypeSelectionPredicate( id ) ); + } + + private boolean isValidFiletypeCommand() + { + if ( StringUtils.isBlank( getFileTypeId() ) ) + { + addActionError( "Unable to process blank filetype id." ); + } + + if ( StringUtils.isBlank( getPattern() ) ) + { + addActionError( "Unable to process blank pattern." ); + } + + return !hasActionErrors(); + } + + private String saveConfiguration() + { + try + { + archivaConfiguration.save( archivaConfiguration.getConfiguration() ); + addActionMessage( "Successfully saved configuration" ); + } + catch ( RegistryException e ) + { + addActionError( "Unable to save configuration: " + e.getMessage() ); + return INPUT; + } + catch ( IndeterminateConfigurationException e ) + { + addActionError( e.getMessage() ); + return INPUT; + } + + return SUCCESS; + } + + public List getEnabledInvalidContentConsumers() + { + return enabledInvalidContentConsumers; + } + + public void setEnabledInvalidContentConsumers( List enabledInvalidContentConsumers ) + { + this.enabledInvalidContentConsumers = enabledInvalidContentConsumers; + } + + public List getEnabledKnownContentConsumers() + { + return enabledKnownContentConsumers; + } + + public void setEnabledKnownContentConsumers( List enabledKnownContentConsumers ) + { + this.enabledKnownContentConsumers = enabledKnownContentConsumers; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/reports/GenerateReportAction.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/reports/GenerateReportAction.java new file mode 100644 index 000000000..747ec9802 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/reports/GenerateReportAction.java @@ -0,0 +1,313 @@ +package org.apache.maven.archiva.web.action.reports; + +/* + * 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 com.opensymphony.webwork.interceptor.ServletRequestAware; +import com.opensymphony.xwork.Preparable; +import org.apache.maven.archiva.database.ArchivaDAO; +import org.apache.maven.archiva.database.Constraint; +import org.apache.maven.archiva.database.constraints.RangeConstraint; +import org.apache.maven.archiva.database.constraints.RepositoryProblemByGroupIdConstraint; +import org.apache.maven.archiva.database.constraints.RepositoryProblemByRepositoryIdConstraint; +import org.apache.maven.archiva.database.constraints.RepositoryProblemConstraint; +import org.apache.maven.archiva.database.constraints.UniqueFieldConstraint; +import org.apache.maven.archiva.model.RepositoryProblem; +import org.apache.maven.archiva.model.RepositoryProblemReport; +import org.apache.maven.archiva.security.ArchivaRoleConstants; +import org.codehaus.plexus.redback.rbac.Resource; +import org.codehaus.plexus.redback.xwork.interceptor.SecureAction; +import org.codehaus.plexus.redback.xwork.interceptor.SecureActionBundle; +import org.codehaus.plexus.redback.xwork.interceptor.SecureActionException; +import org.codehaus.plexus.xwork.action.PlexusActionSupport; + +import javax.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.TreeMap; + +/** + * @plexus.component role="com.opensymphony.xwork.Action" role-hint="generateReport" + */ +public class GenerateReportAction + extends PlexusActionSupport + implements SecureAction, ServletRequestAware, Preparable +{ + /** + * @plexus.requirement role-hint="jdo" + */ + protected ArchivaDAO dao; + + protected Constraint constraint; + + protected HttpServletRequest request; + + protected List reports = new ArrayList(); + + protected String groupId; + + protected String repositoryId; + + protected String prev; + + protected String next; + + protected int[] range = new int[2]; + + protected int page = 1; + + protected int rowCount = 100; + + protected boolean isLastPage; + + public static final String BLANK = "blank"; + + public static final String BASIC = "basic"; + + private static Boolean jasperPresent; + + private Collection repositoryIds; + + public static final String ALL_REPOSITORIES = "All Repositories"; + + protected Map> repositoriesMap = + new TreeMap>(); + + public void prepare() + { + repositoryIds = new ArrayList(); + repositoryIds.add( ALL_REPOSITORIES ); // comes first to be first in the list + repositoryIds.addAll( + dao.query( new UniqueFieldConstraint( RepositoryProblem.class.getName(), "repositoryId" ) ) ); + } + + public Collection getRepositoryIds() + { + return repositoryIds; + } + + public String execute() + throws Exception + { + List problemArtifacts = + dao.getRepositoryProblemDAO().queryRepositoryProblems( configureConstraint() ); + + String contextPath = + request.getRequestURL().substring( 0, request.getRequestURL().indexOf( request.getRequestURI() ) ); + RepositoryProblem problemArtifact; + RepositoryProblemReport problemArtifactReport; + for ( int i = 0; i < problemArtifacts.size(); i++ ) + { + problemArtifact = (RepositoryProblem) problemArtifacts.get( i ); + problemArtifactReport = new RepositoryProblemReport( problemArtifact ); + + problemArtifactReport.setGroupURL( contextPath + "/browse/" + problemArtifact.getGroupId() ); + problemArtifactReport.setArtifactURL( + contextPath + "/browse/" + problemArtifact.getGroupId() + "/" + problemArtifact.getArtifactId() ); + + addToList( problemArtifactReport ); + + // retained the reports list because this is the datasource for the jasper report + reports.add( problemArtifactReport ); + } + + if ( reports.size() <= rowCount ) + { + isLastPage = true; + } + else + { + reports.remove( rowCount ); + } + + prev = request.getRequestURL() + "?page=" + ( page - 1 ) + "&rowCount=" + rowCount + "&groupId=" + groupId + + "&repositoryId=" + repositoryId; + next = request.getRequestURL() + "?page=" + ( page + 1 ) + "&rowCount=" + rowCount + "&groupId=" + groupId + + "&repositoryId=" + repositoryId; + + if ( reports.size() == 0 && page == 1 ) + { + return BLANK; + } + else if ( isJasperPresent() ) + { + return "jasper"; + } + else + { + return SUCCESS; + } + } + + private static boolean isJasperPresent() + { + if ( jasperPresent == null ) + { + try + { + Class.forName( "net.sf.jasperreports.engine.JRExporterParameter" ); + jasperPresent = Boolean.TRUE; + } + catch ( NoClassDefFoundError e ) + { + jasperPresent = Boolean.FALSE; + } + catch ( ClassNotFoundException e ) + { + jasperPresent = Boolean.FALSE; + } + } + return jasperPresent.booleanValue(); + } + + private Constraint configureConstraint() + { + Constraint constraint; + + range[0] = ( page - 1 ) * rowCount; + range[1] = ( page * rowCount ) + 1; // Add 1 to check if it's the last page or not. + + if ( groupId != null && ( !groupId.equals( "" ) ) ) + { + if ( repositoryId != null && ( !repositoryId.equals( "" ) && !repositoryId.equals( ALL_REPOSITORIES ) ) ) + { + constraint = new RepositoryProblemConstraint( range, groupId, repositoryId ); + } + else + { + constraint = new RepositoryProblemByGroupIdConstraint( range, groupId ); + } + } + else if ( repositoryId != null && ( !repositoryId.equals( "" ) && !repositoryId.equals( ALL_REPOSITORIES ) ) ) + { + constraint = new RepositoryProblemByRepositoryIdConstraint( range, repositoryId ); + } + else + { + constraint = new RangeConstraint( range, "repositoryId" ); + } + + return constraint; + } + + public void setServletRequest( HttpServletRequest request ) + { + this.request = request; + } + + public List getReports() + { + return reports; + } + + public String getGroupId() + { + return groupId; + } + + public void setGroupId( String groupId ) + { + this.groupId = groupId; + } + + public String getRepositoryId() + { + return repositoryId; + } + + public void setRepositoryId( String repositoryId ) + { + this.repositoryId = repositoryId; + } + + public String getPrev() + { + return prev; + } + + public String getNext() + { + return next; + } + + public int getPage() + { + return page; + } + + public void setPage( int page ) + { + this.page = page; + } + + public int getRowCount() + { + return rowCount; + } + + public void setRowCount( int rowCount ) + { + this.rowCount = rowCount; + } + + public boolean getIsLastPage() + { + return isLastPage; + } + + public void setRepositoriesMap( Map> repositoriesMap ) + { + this.repositoriesMap = repositoriesMap; + } + + public Map> getRepositoriesMap() + { + return repositoriesMap; + } + + public SecureActionBundle getSecureActionBundle() + throws SecureActionException + { + SecureActionBundle bundle = new SecureActionBundle(); + + bundle.setRequiresAuthentication( true ); + bundle.addRequiredAuthorization( ArchivaRoleConstants.OPERATION_ACCESS_REPORT, Resource.GLOBAL ); + + return bundle; + } + + private void addToList( RepositoryProblemReport repoProblemReport ) + { + List problemsList = null; + + if ( repositoriesMap.containsKey( repoProblemReport.getRepositoryId() ) ) + { + problemsList = ( List ) repositoriesMap.get( repoProblemReport.getRepositoryId() ); + } + else + { + problemsList = new ArrayList(); + repositoriesMap.put( repoProblemReport.getRepositoryId(), problemsList ); + } + + problemsList.add( repoProblemReport ); + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/interceptor/ConfigurationInterceptor.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/interceptor/ConfigurationInterceptor.java new file mode 100644 index 000000000..0ab429965 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/interceptor/ConfigurationInterceptor.java @@ -0,0 +1,64 @@ +package org.apache.maven.archiva.web.interceptor; + +/* + * 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 com.opensymphony.webwork.ServletActionContext; +import com.opensymphony.xwork.ActionInvocation; +import com.opensymphony.xwork.interceptor.Interceptor; +import org.apache.maven.archiva.configuration.ArchivaConfiguration; + +import javax.servlet.ServletContext; + +/** + * An interceptor that makes the configuration bits available, both to the application and the webapp + * + * @author Brett Porter + * @plexus.component role="com.opensymphony.xwork.interceptor.Interceptor" + * role-hint="configurationInterceptor" + */ +public class ConfigurationInterceptor + implements Interceptor +{ + /** + * @plexus.requirement role-hint="default" + */ + private ArchivaConfiguration configuration; + + public String intercept( ActionInvocation actionInvocation ) + throws Exception + { + // populate webapp configuration bits into the session + ServletContext applicationScope = ServletActionContext.getServletContext(); + applicationScope.setAttribute( "uiOptions", configuration.getConfiguration().getWebapp().getUi() ); + + return actionInvocation.invoke(); + } + + public void destroy() + { + // This space left intentionally blank + } + + public void init() + { + // This space left intentionally blank + } + +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/mapper/RepositoryActionMapper.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/mapper/RepositoryActionMapper.java new file mode 100644 index 000000000..37e657baa --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/mapper/RepositoryActionMapper.java @@ -0,0 +1,214 @@ +package org.apache.maven.archiva.web.mapper; + +/* + * 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 com.opensymphony.webwork.dispatcher.mapper.ActionMapping; +import com.opensymphony.webwork.dispatcher.mapper.DefaultActionMapper; + +import org.apache.commons.lang.StringUtils; + +import java.util.HashMap; +import java.util.Map; + +import javax.servlet.http.HttpServletRequest; + +/** + * Map alternate URLs to specific actions. Used for the repository browser and the proxy. + * + * @author Brett Porter + */ +public class RepositoryActionMapper + extends DefaultActionMapper +{ + private static final String ACTION_BROWSE = "browse"; + + private static final String ACTION_BROWSE_ARTIFACT = "browseArtifact"; + + private static final String ACTION_BROWSE_GROUP = "browseGroup"; + + private static final String ACTION_SHOW_ARTIFACT = "showArtifact"; + + private static final String ACTION_SHOW_ARTIFACT_DEPENDEES = "showArtifactDependees"; + + private static final String ACTION_SHOW_ARTIFACT_DEPENDENCIES = "showArtifactDependencies"; + + private static final String ACTION_SHOW_ARTIFACT_DEPENDENCY_TREE = "showArtifactDependencyTree"; + + private static final String ACTION_SHOW_ARTIFACT_MAILING_LISTS = "showArtifactMailingLists"; + + private static final String BROWSE_PREFIX = "/browse"; + + private static final String METHOD_DEPENDENCIES = "dependencies"; + + private static final String METHOD_DEPENDENCY_TREE = "dependencyTree"; + + private static final String METHOD_MAILING_LISTS = "mailingLists"; + + private static final String METHOD_USEDBY = "usedby"; + + private static final String PARAM_ARTIFACT_ID = "artifactId"; + + private static final String PARAM_GROUP_ID = "groupId"; + + private static final String PARAM_VERSION = "version"; + + public ActionMapping getMapping( HttpServletRequest httpServletRequest ) + { + String path = httpServletRequest.getServletPath(); + + if ("".equals(path)){ + // if JEE 5 spec is correctly implemented, the "/*" pattern implies an empty string in servletpath + path = httpServletRequest.getPathInfo(); + } + + if ( path.startsWith( BROWSE_PREFIX ) ) + { + path = path.substring( BROWSE_PREFIX.length() ); + if ( StringUtils.isBlank( path ) || + StringUtils.equals( path, "/" ) || + StringUtils.equals( path, ".action" ) ) + { + // Return "root" browse. + return new ActionMapping( ACTION_BROWSE, "/", "", null ); + } + else + { + Map params = new HashMap(); + + if ( path.charAt( 0 ) == '/' ) + { + path = path.substring( 1 ); + } + + String[] parts = path.split( "/" ); + switch ( parts.length ) + { + case 1: + params.put( PARAM_GROUP_ID, parts[0] ); + return new ActionMapping( ACTION_BROWSE_GROUP, "/", "", params ); + + case 2: + params.put( PARAM_GROUP_ID, parts[0] ); + params.put( PARAM_ARTIFACT_ID, parts[1] ); + return new ActionMapping( ACTION_BROWSE_ARTIFACT, "/", "", params ); + + case 3: + params.put( PARAM_GROUP_ID, parts[0] ); + params.put( PARAM_ARTIFACT_ID, parts[1] ); + params.put( PARAM_VERSION, parts[2] ); + return new ActionMapping( ACTION_SHOW_ARTIFACT, "/", "", params ); + + case 4: + params.put( PARAM_GROUP_ID, parts[0] ); + params.put( PARAM_ARTIFACT_ID, parts[1] ); + params.put( PARAM_VERSION, parts[2] ); + + if ( METHOD_DEPENDENCIES.equals( parts[3] ) ) + { + return new ActionMapping( ACTION_SHOW_ARTIFACT_DEPENDENCIES, "/", "", params ); + } + else if ( METHOD_MAILING_LISTS.equals( parts[3] ) ) + { + return new ActionMapping( ACTION_SHOW_ARTIFACT_MAILING_LISTS, "/", "", params ); + } + else if ( METHOD_USEDBY.equals( parts[3] ) ) + { + return new ActionMapping( ACTION_SHOW_ARTIFACT_DEPENDEES, "/", "", params ); + } + else if ( METHOD_DEPENDENCY_TREE.equals( parts[3] ) ) + { + return new ActionMapping( ACTION_SHOW_ARTIFACT_DEPENDENCY_TREE, "/", "", params ); + } + break; + } + } + } + + return super.getMapping( httpServletRequest ); + } + + public String getUriFromActionMapping( ActionMapping actionMapping ) + { + Map params = actionMapping.getParams(); + if ( ACTION_BROWSE.equals( actionMapping.getName() ) ) + { + return BROWSE_PREFIX; + } + else if ( ACTION_BROWSE_GROUP.equals( actionMapping.getName() ) ) + { + return toUri( params, false, false, null ); + } + else if ( ACTION_BROWSE_ARTIFACT.equals( actionMapping.getName() ) ) + { + return toUri( params, true, false, null ); + } + else if ( ACTION_SHOW_ARTIFACT.equals( actionMapping.getName() ) ) + { + return toUri( params, true, true, null ); + } + else if ( ACTION_SHOW_ARTIFACT_DEPENDENCIES.equals( actionMapping.getName() ) ) + { + return toUri( params, true, true, METHOD_DEPENDENCIES ); + } + else if ( ACTION_SHOW_ARTIFACT_MAILING_LISTS.equals( actionMapping.getName() ) ) + { + return toUri( params, true, true, METHOD_MAILING_LISTS ); + } + else if ( ACTION_SHOW_ARTIFACT_DEPENDEES.equals( actionMapping.getName() ) ) + { + return toUri( params, true, true, METHOD_USEDBY ); + } + else if ( ACTION_SHOW_ARTIFACT_DEPENDENCY_TREE.equals( actionMapping.getName() ) ) + { + return toUri( params, true, true, METHOD_DEPENDENCY_TREE ); + } + + return super.getUriFromActionMapping( actionMapping ); + } + + private String toUri( Map params, boolean artifactId, boolean version, String method ) + { + StringBuffer buf = new StringBuffer(); + + buf.append( BROWSE_PREFIX ); + buf.append( '/' ); + buf.append( params.remove( PARAM_GROUP_ID ) ); + + if ( artifactId ) + { + buf.append( '/' ); + buf.append( params.remove( PARAM_ARTIFACT_ID ) ); + + if ( version ) + { + buf.append( '/' ); + buf.append( params.remove( PARAM_VERSION ) ); + + if ( StringUtils.isNotBlank( method ) ) + { + buf.append( '/' ); + buf.append( method ); + } + } + } + + return buf.toString(); + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/rss/RssFeedServlet.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/rss/RssFeedServlet.java new file mode 100644 index 000000000..caedf31bf --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/rss/RssFeedServlet.java @@ -0,0 +1,323 @@ +package org.apache.maven.archiva.web.rss; + +/* + * 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.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.archiva.rss.processor.RssFeedProcessor; +import org.apache.commons.codec.Decoder; +import org.apache.commons.codec.DecoderException; +import org.apache.commons.codec.binary.Base64; +import org.apache.maven.archiva.database.ArchivaDatabaseException; +import org.apache.maven.archiva.security.AccessDeniedException; +import org.apache.maven.archiva.security.ArchivaRoleConstants; +import org.apache.maven.archiva.security.ArchivaSecurityException; +import org.apache.maven.archiva.security.PrincipalNotFoundException; +import org.apache.maven.archiva.security.ServletAuthenticator; +import org.apache.maven.archiva.security.UserRepositories; +import org.codehaus.plexus.redback.authentication.AuthenticationException; +import org.codehaus.plexus.redback.authentication.AuthenticationResult; +import org.codehaus.plexus.redback.authorization.AuthorizationException; +import org.codehaus.plexus.redback.authorization.UnauthorizedException; +import org.codehaus.plexus.redback.policy.AccountLockedException; +import org.codehaus.plexus.redback.policy.MustChangePasswordException; +import org.codehaus.plexus.redback.system.SecuritySession; +import org.codehaus.plexus.redback.users.UserNotFoundException; +import org.codehaus.plexus.redback.xwork.filter.authentication.HttpAuthenticator; +import org.codehaus.plexus.spring.PlexusToSpringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.context.WebApplicationContext; +import org.springframework.web.context.support.WebApplicationContextUtils; + +import com.sun.syndication.feed.synd.SyndFeed; +import com.sun.syndication.io.FeedException; +import com.sun.syndication.io.SyndFeedOutput; + +/** + * Servlet for handling rss feed requests. + * + * @author Maria Odea Ching + * @version + */ +public class RssFeedServlet + extends HttpServlet +{ + public static final String MIME_TYPE = "application/rss+xml; charset=UTF-8"; + + private static final String COULD_NOT_GENERATE_FEED_ERROR = "Could not generate feed"; + + private static final String COULD_NOT_AUTHENTICATE_USER = "Could not authenticate user"; + + private static final String USER_NOT_AUTHORIZED = "User not authorized to access feed."; + + private Logger log = LoggerFactory.getLogger( RssFeedServlet.class ); + + private RssFeedProcessor processor; + + private WebApplicationContext wac; + + private UserRepositories userRepositories; + + private ServletAuthenticator servletAuth; + + private HttpAuthenticator httpAuth; + + public void init( javax.servlet.ServletConfig servletConfig ) + throws ServletException + { + super.init( servletConfig ); + wac = WebApplicationContextUtils.getRequiredWebApplicationContext( servletConfig.getServletContext() ); + userRepositories = + (UserRepositories) wac.getBean( PlexusToSpringUtils.buildSpringId( UserRepositories.class.getName() ) ); + servletAuth = + (ServletAuthenticator) wac.getBean( PlexusToSpringUtils.buildSpringId( ServletAuthenticator.class.getName() ) ); + httpAuth = + (HttpAuthenticator) wac.getBean( PlexusToSpringUtils.buildSpringId( HttpAuthenticator.ROLE, "basic" ) ); + } + + public void doGet( HttpServletRequest req, HttpServletResponse res ) + throws ServletException, IOException + { + String repoId = req.getParameter( "repoId" ); + String groupId = req.getParameter( "groupId" ); + String artifactId = req.getParameter( "artifactId" ); + + try + { + Map map = new HashMap(); + SyndFeed feed = null; + + if ( ( repoId == null ) && ( groupId == null && artifactId == null ) ) + { + res.sendError( HttpServletResponse.SC_BAD_REQUEST, "Required fields not found in request." ); + return; + } + + if ( isAllowed( req ) ) + { + if ( repoId != null ) + { + // new artifacts in repo feed request + processor = + (RssFeedProcessor) wac.getBean( PlexusToSpringUtils.buildSpringId( + RssFeedProcessor.class.getName(), + "new-artifacts" ) ); + map.put( RssFeedProcessor.KEY_REPO_ID, repoId ); + } + else if ( ( groupId != null ) && ( artifactId != null ) ) + { + // new versions of artifact feed request + processor = + (RssFeedProcessor) wac.getBean( PlexusToSpringUtils.buildSpringId( + RssFeedProcessor.class.getName(), + "new-versions" ) ); + map.put( RssFeedProcessor.KEY_GROUP_ID, groupId ); + map.put( RssFeedProcessor.KEY_ARTIFACT_ID, artifactId ); + } + } + else + { + res.sendError( HttpServletResponse.SC_UNAUTHORIZED, USER_NOT_AUTHORIZED ); + return; + } + + feed = processor.process( map ); + if( feed == null ) + { + res.sendError( HttpServletResponse.SC_NO_CONTENT, "No information available." ); + return; + } + + res.setContentType( MIME_TYPE ); + + if ( repoId != null ) + { + feed.setLink( req.getRequestURL() + "?repoId=" + repoId ); + } + else if ( ( groupId != null ) && ( artifactId != null ) ) + { + feed.setLink( req.getRequestURL() + "?groupId=" + groupId + "&artifactId=" + artifactId ); + } + + SyndFeedOutput output = new SyndFeedOutput(); + output.output( feed, res.getWriter() ); + } + catch ( ArchivaDatabaseException e ) + { + log.debug( COULD_NOT_GENERATE_FEED_ERROR, e ); + res.sendError( HttpServletResponse.SC_INTERNAL_SERVER_ERROR, COULD_NOT_GENERATE_FEED_ERROR ); + } + catch ( UserNotFoundException unfe ) + { + log.debug( COULD_NOT_AUTHENTICATE_USER, unfe ); + res.sendError( HttpServletResponse.SC_UNAUTHORIZED, COULD_NOT_AUTHENTICATE_USER ); + } + catch ( AccountLockedException acce ) + { + res.sendError( HttpServletResponse.SC_UNAUTHORIZED, COULD_NOT_AUTHENTICATE_USER ); + } + catch ( AuthenticationException authe ) + { + log.debug( COULD_NOT_AUTHENTICATE_USER, authe ); + res.sendError( HttpServletResponse.SC_UNAUTHORIZED, COULD_NOT_AUTHENTICATE_USER ); + } + catch ( FeedException ex ) + { + log.debug( COULD_NOT_GENERATE_FEED_ERROR, ex ); + res.sendError( HttpServletResponse.SC_INTERNAL_SERVER_ERROR, COULD_NOT_GENERATE_FEED_ERROR ); + } + catch ( MustChangePasswordException e ) + { + res.sendError( HttpServletResponse.SC_UNAUTHORIZED, COULD_NOT_AUTHENTICATE_USER ); + } + catch ( UnauthorizedException e ) + { + log.debug( e.getMessage() ); + if ( repoId != null ) + { + res.setHeader("WWW-Authenticate", "Basic realm=\"Repository Archiva Managed " + repoId + " Repository" ); + } + else + { + res.setHeader("WWW-Authenticate", "Basic realm=\"Artifact " + groupId + ":" + artifactId ); + } + + res.sendError( HttpServletResponse.SC_UNAUTHORIZED, USER_NOT_AUTHORIZED ); + } + } + + /** + * Basic authentication. + * + * @param req + * @return + */ + private boolean isAllowed( HttpServletRequest req ) + throws UserNotFoundException, AccountLockedException, AuthenticationException, MustChangePasswordException, + UnauthorizedException + { + String auth = req.getHeader( "Authorization" ); + List repoIds = new ArrayList(); + + if ( req.getParameter( "repoId" ) != null ) + { + repoIds.add( req.getParameter( "repoId" ) ); + } + else if ( req.getParameter( "artifactId" ) != null && req.getParameter( "groupId" ) != null ) + { + if ( auth != null ) + { + if ( !auth.toUpperCase().startsWith( "BASIC " ) ) + { + return false; + } + + Decoder dec = new Base64(); + String usernamePassword = ""; + + try + { + usernamePassword = new String( (byte[]) dec.decode( auth.substring( 6 ).getBytes() ) ); + } + catch ( DecoderException ie ) + { + log.warn( "Error decoding username and password.", ie.getMessage() ); + } + + if ( usernamePassword == null || usernamePassword.trim().equals( "" ) ) + { + repoIds = getObservableRepos( ArchivaRoleConstants.PRINCIPAL_GUEST ); + } + else + { + String[] userCredentials = usernamePassword.split( ":" ); + repoIds = getObservableRepos( userCredentials[0] ); + } + } + else + { + repoIds = getObservableRepos( ArchivaRoleConstants.PRINCIPAL_GUEST ); + } + } + else + { + return false; + } + + for ( String repoId : repoIds ) + { + try + { + AuthenticationResult result = httpAuth.getAuthenticationResult( req, null ); + SecuritySession securitySession = httpAuth.getSecuritySession(); + + if ( servletAuth.isAuthenticated( req, result ) && + servletAuth.isAuthorized( req, securitySession, repoId, false ) ) + { + return true; + } + } + catch ( AuthorizationException e ) + { + + } + catch ( UnauthorizedException e ) + { + + } + } + + throw new UnauthorizedException( "Access denied." ); + } + + private List getObservableRepos( String principal ) + { + try + { + return userRepositories.getObservableRepositoryIds( principal ); + } + catch ( PrincipalNotFoundException e ) + { + log.warn( e.getMessage(), e ); + } + catch ( AccessDeniedException e ) + { + log.warn( e.getMessage(), e ); + } + catch ( ArchivaSecurityException e ) + { + log.warn( e.getMessage(), e ); + } + + return Collections.emptyList(); + } + +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/ArchivaStartup.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/ArchivaStartup.java new file mode 100644 index 000000000..1cb8fe56f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/ArchivaStartup.java @@ -0,0 +1,67 @@ +package org.apache.maven.archiva.web.startup; + +/* + * 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 javax.servlet.ServletContextEvent; +import javax.servlet.ServletContextListener; + +import org.apache.maven.archiva.common.ArchivaException; +import org.apache.maven.archiva.scheduled.ArchivaTaskScheduler; +import org.codehaus.plexus.spring.PlexusToSpringUtils; +import org.codehaus.plexus.taskqueue.execution.TaskQueueExecutor; +import org.springframework.web.context.WebApplicationContext; +import org.springframework.web.context.support.WebApplicationContextUtils; + +/** + * ArchivaStartup - the startup of all archiva features in a deterministic order. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ArchivaStartup + implements ServletContextListener +{ + public void contextDestroyed(ServletContextEvent arg0) { + } + + public void contextInitialized(ServletContextEvent arg0) { + WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(arg0.getServletContext()); + + SecuritySynchronization securitySync = (SecuritySynchronization) wac.getBean(PlexusToSpringUtils.buildSpringId(SecuritySynchronization.class)); + ResolverFactoryInit resolverFactory = (ResolverFactoryInit) wac.getBean(PlexusToSpringUtils.buildSpringId(ResolverFactoryInit.class)); + ArchivaTaskScheduler taskScheduler = (ArchivaTaskScheduler) wac.getBean(PlexusToSpringUtils.buildSpringId(ArchivaTaskScheduler.class)); + TaskQueueExecutor databaseUpdateQueue = (TaskQueueExecutor) wac.getBean(PlexusToSpringUtils.buildSpringId(TaskQueueExecutor.class, "database-update")); + TaskQueueExecutor repositoryScanningQueue = (TaskQueueExecutor) wac.getBean(PlexusToSpringUtils.buildSpringId(TaskQueueExecutor.class, "repository-scanning")); + Banner banner = new Banner(); + + try + { + securitySync.startup(); + resolverFactory.startup(); + taskScheduler.startup(); + banner.display(); + } + catch ( ArchivaException e ) + { + throw new RuntimeException( "Unable to properly startup archiva: " + e.getMessage(), e ); + } + } + +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/ArchivaVersion.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/ArchivaVersion.java new file mode 100644 index 000000000..ea78d8761 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/ArchivaVersion.java @@ -0,0 +1,84 @@ +package org.apache.maven.archiva.web.startup; + +/* + * 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.IOException; +import java.io.InputStream; +import java.util.Properties; + +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.maven.archiva.configuration.ArchivaConfiguration; + +/** + * ArchivaVersion + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ArchivaVersion +{ + private static String version = null; + + private ArchivaVersion() + { + } + + public static String determineVersion( ) + { + if ( version != null ) + { + return version; + } + + InputStream is = ArchivaConfiguration.class.getResourceAsStream( "/META-INF/maven/org.apache.archiva/archiva-configuration/pom.properties" ); + + if ( is != null ) + { + try + { + Properties props = new Properties(); + props.load( is ); + String version = props.getProperty( "version" ); + if ( StringUtils.isNotBlank( version ) ) + { + ArchivaVersion.version = version; + return version; + } + } + catch ( IOException e ) + { + /* do nothing */ + } + finally + { + IOUtils.closeQuietly( is ); + } + } + + ArchivaVersion.version = ""; + return version; + } + + public static String getVersion() + { + return version; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/Banner.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/Banner.java new file mode 100644 index 000000000..ea090e624 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/Banner.java @@ -0,0 +1,226 @@ +package org.apache.maven.archiva.web.startup; + +/* + * 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.regex.Matcher; +import java.util.regex.Pattern; + +import org.apache.commons.lang.StringUtils; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException; +import org.slf4j.LoggerFactory; + +/** + * Banner + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class Banner +{ + public static String encode( String raw ) + { + StringBuffer encoded = new StringBuffer(); + int rawlen = raw.length(); + + for ( int i = 0; i < rawlen; i++ ) + { + char c = raw.charAt( i ); + if ( c == '\\' ) + { + encoded.append( "$." ); + } + else if ( c == '$' ) + { + encoded.append( "$$" ); + } + else if ( c == '\n' ) + { + encoded.append( "$n" ); + } + else if ( Character.isDigit( c ) ) + { + encoded.append( c ); + } + else if ( Character.isLetter( c ) ) + { + encoded.append( rot13( c ) ); + } + else if ( i < raw.length() - 1 ) + { + char nc; + boolean done = false; + int count = 0; + for ( int n = i; !done; n++ ) + { + if ( n >= rawlen ) + { + break; + } + + nc = raw.charAt( n ); + + if ( nc != c ) + { + done = true; + } + else + { + count++; + } + } + if ( count < 3 ) + { + encoded.append( c ); + } + else + { + encoded.append( "$" ).append( String.valueOf( count ) ).append( c ); + i += count - 1; + } + } + else + { + encoded.append( c ); + } + } + + return encoded.toString(); + } + + public static String decode( String encoded ) + { + StringBuffer decoded = new StringBuffer(); + int enlen = encoded.length(); + for ( int i = 0; i < enlen; i++ ) + { + char c = encoded.charAt( i ); + if ( c == '$' ) + { + char nc = encoded.charAt( i + 1 ); + if ( nc == '$' ) + { + decoded.append( '$' ); + i++; + } + else if ( nc == '.' ) + { + decoded.append( '\\' ); + i++; + } + else if ( nc == 'n' ) + { + decoded.append( '\n' ); + i++; + } + else if ( Character.isDigit( nc ) ) + { + int count = 0; + int nn = i + 1; + while ( Character.isDigit( nc ) ) + { + count = ( count * 10 ); + count += ( nc - '0' ); + nc = encoded.charAt( ++nn ); + } + for ( int d = 0; d < count; d++ ) + { + decoded.append( nc ); + } + i = nn; + } + } + else if ( Character.isLetter( c ) ) + { + decoded.append( rot13( c ) ); + } + else + { + decoded.append( c ); + } + } + + return decoded.toString(); + } + + private static char rot13( char c ) + { + if ( ( c >= 'a' ) && ( c <= 'z' ) ) + { + char dc = c += 13; + if ( dc > 'z' ) + { + dc -= 26; + } + return dc; + } + else if ( ( c >= 'A' ) && ( c <= 'Z' ) ) + { + char dc = c += 13; + if ( dc > 'Z' ) + { + dc -= 26; + } + return dc; + } + else + { + return c; + } + } + + public static String injectVersion( String text, String version ) + { + Pattern pat = Pattern.compile( "#{2,}" ); + Matcher mat = pat.matcher( text ); + StringBuffer ret = new StringBuffer(); + int off = 0; + + while ( mat.find( off ) ) + { + ret.append( text.substring( off, mat.start() ) ); + String repl = mat.group(); + ret.append( StringUtils.center( version, repl.length() ) ); + off = mat.end(); + } + + ret.append( text.substring( off ) ); + + return ret.toString(); + } + + public static String getBanner( String version ) + { + String encodedBanner = "$26 $34_$n$15 /$._$7 /$34 $.$n$14 /`/@),$4 | Ba" + + " orunys bs nyy bs gur nycnpn'f |$n$14 | (~' __| gbvyvat njnl ba " + + "gur Ncnpur Nepuvin |$n$6 _,--.$3_/ |$4 $.$5 cebwrpg grnz, V jbhyq y" + + "vxr gb$3 |$n$4 ,' ,$5 ($3 |$5 $.$5 jrypbzr lbh gb Nepuvin$6 |$" + + "n$4 | ($6 $. /$6 | $32# |$n$5 $. )$._/ ,_/$7 |$36 |$n$5 / /$3 " + + "( |/$9 | uggc://nepuvin.ncnpur.bet/ |$n$4 ( |$4 ( |$10 | hf" + + "ref@nepuvin.ncnpur.bet$7 |$n$5 $.|$5 $.|$11 $.$34_/$n$n"; + + return injectVersion( decode( encodedBanner ), version ); + } + + public void display() + { + String banner = getBanner( ArchivaVersion.determineVersion() ); + LoggerFactory.getLogger( Banner.class ).info( StringUtils.repeat( "_", 25 ) + "\n" + banner ); + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/ResolverFactoryInit.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/ResolverFactoryInit.java new file mode 100644 index 000000000..2371ed2e1 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/ResolverFactoryInit.java @@ -0,0 +1,68 @@ +package org.apache.maven.archiva.web.startup; + +/* + * 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.archiva.common.ArchivaException; +import org.apache.maven.archiva.database.project.ProjectModelToDatabaseListener; +import org.apache.maven.archiva.repository.project.ProjectModelResolver; +import org.apache.maven.archiva.repository.project.ProjectModelResolverFactory; + +/** + * ResolverFactoryInit - Initialize the Resolver Factory, and hook it up to + * the database. + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component + * role="org.apache.maven.archiva.web.startup.ResolverFactoryInit" + * role-hint="default" + */ +public class ResolverFactoryInit +{ + /** + * @plexus.requirement role-hint="database" + */ + private ProjectModelResolver databaseResolver; + + /** + * @plexus.requirement + * role="org.apache.maven.archiva.repository.project.resolvers.ProjectModelResolutionListener" + * role-hint="model-to-db" + */ + private ProjectModelToDatabaseListener modelToDbListener; + + /** + * The resolver factorying being initialized. + * + * @plexus.requirement + */ + private ProjectModelResolverFactory resolverFactory; + + public void startup() + throws ArchivaException + { + if ( !resolverFactory.getCurrentResolverStack().hasResolver( databaseResolver ) ) + { + resolverFactory.getCurrentResolverStack().prependProjectModelResolver( databaseResolver ); + } + resolverFactory.getCurrentResolverStack().addListener( modelToDbListener ); + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/SecuritySynchronization.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/SecuritySynchronization.java new file mode 100644 index 000000000..7671c7391 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/SecuritySynchronization.java @@ -0,0 +1,208 @@ +package org.apache.maven.archiva.web.startup; + +/* + * 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.List; +import java.util.Map; +import java.util.Map.Entry; + +import org.apache.commons.collections.CollectionUtils; +import org.apache.maven.archiva.common.ArchivaException; +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.ConfigurationNames; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.security.ArchivaRoleConstants; +import org.codehaus.plexus.redback.rbac.RBACManager; +import org.codehaus.plexus.redback.rbac.RbacManagerException; +import org.codehaus.plexus.redback.rbac.UserAssignment; +import org.codehaus.plexus.redback.role.RoleManager; +import org.codehaus.plexus.redback.role.RoleManagerException; +import org.codehaus.plexus.redback.system.check.EnvironmentCheck; +import org.codehaus.plexus.registry.Registry; +import org.codehaus.plexus.registry.RegistryListener; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * ConfigurationSynchronization + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component role="org.apache.maven.archiva.web.startup.SecuritySynchronization" + * role-hint="default" + */ +public class SecuritySynchronization + implements RegistryListener +{ + private Logger log = LoggerFactory.getLogger( SecuritySynchronization.class ); + + /** + * @plexus.requirement role-hint="default" + */ + private RoleManager roleManager; + + /** + * @plexus.requirement role-hint="cached" + */ + private RBACManager rbacManager; + + /** + * @plexus.requirement role="org.codehaus.plexus.redback.system.check.EnvironmentCheck" + */ + private Map checkers; + + /** + * @plexus.requirement + */ + private ArchivaConfiguration archivaConfiguration; + + public void afterConfigurationChange( Registry registry, String propertyName, Object propertyValue ) + { + if ( ConfigurationNames.isManagedRepositories( propertyName ) ) + { + synchConfiguration( archivaConfiguration.getConfiguration().getManagedRepositories() ); + } + } + + public void beforeConfigurationChange( Registry registry, String propertyName, Object propertyValue ) + { + /* do nothing */ + } + + private void synchConfiguration( List repos ) + { + // NOTE: Remote Repositories do not have roles or security placed around them. + + for ( ManagedRepositoryConfiguration repoConfig : repos ) + { + // manage roles for repositories + try + { + if ( !roleManager.templatedRoleExists( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER, repoConfig + .getId() ) ) + { + roleManager.createTemplatedRole( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER, repoConfig + .getId() ); + } + + if ( !roleManager.templatedRoleExists( ArchivaRoleConstants.TEMPLATE_REPOSITORY_MANAGER, repoConfig + .getId() ) ) + { + roleManager.createTemplatedRole( ArchivaRoleConstants.TEMPLATE_REPOSITORY_MANAGER, repoConfig + .getId() ); + } + } + catch ( RoleManagerException e ) + { + // Log error. + log.error( "Unable to create roles for configured repositories: " + e.getMessage(), e ); + } + } + } + + public void startup() + throws ArchivaException + { + executeEnvironmentChecks(); + + synchConfiguration( archivaConfiguration.getConfiguration().getManagedRepositories() ); + archivaConfiguration.addChangeListener( this ); + + if ( archivaConfiguration.isDefaulted() ) + { + assignRepositoryObserverToGuestUser( archivaConfiguration.getConfiguration().getManagedRepositories() ); + } + } + + private void executeEnvironmentChecks() + throws ArchivaException + { + if ( ( checkers == null ) || CollectionUtils.isEmpty( checkers.values() ) ) + { + throw new ArchivaException( "Unable to initialize the Redback Security Environment, " + + "no Environment Check components found." ); + } + + List violations = new ArrayList(); + + for ( Entry entry : checkers.entrySet() ) + { + EnvironmentCheck check = entry.getValue(); + log.info( "Running Environment Check: " + entry.getKey() ); + check.validateEnvironment( violations ); + } + + if ( CollectionUtils.isNotEmpty( violations ) ) + { + StringBuffer msg = new StringBuffer(); + msg.append( "EnvironmentCheck Failure.\n" ); + msg.append( "======================================================================\n" ); + msg.append( " ENVIRONMENT FAILURE !! \n" ); + msg.append( "\n" ); + + for ( String violation : violations ) + { + msg.append( violation ).append( "\n" ); + } + + msg.append( "\n" ); + msg.append( "======================================================================" ); + log.error( msg.toString() ); + + throw new ArchivaException( "Unable to initialize Redback Security Environment, [" + violations.size() + + "] violation(s) encountered, See log for details." ); + } + } + + private void assignRepositoryObserverToGuestUser( List repos ) + { + for ( ManagedRepositoryConfiguration repoConfig : repos ) + { + String repoId = repoConfig.getId(); + + // TODO: Use the Redback / UserConfiguration..getString( "redback.default.guest" ) to get the right name. + String principal = "guest"; + + try + { + UserAssignment ua; + + if ( rbacManager.userAssignmentExists( principal ) ) + { + ua = rbacManager.getUserAssignment( principal ); + } + else + { + ua = rbacManager.createUserAssignment( principal ); + } + + ua.addRoleName( ArchivaRoleConstants.toRepositoryObserverRoleName( repoId ) ); + rbacManager.saveUserAssignment( ua ); + } + catch ( RbacManagerException e ) + { + log.warn( "Unable to add role [" + ArchivaRoleConstants.toRepositoryObserverRoleName( repoId ) + + "] to " + principal + " user.", e ); + } + } + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/CopyPasteSnippetTag.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/CopyPasteSnippetTag.java new file mode 100644 index 000000000..0a18effe6 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/CopyPasteSnippetTag.java @@ -0,0 +1,180 @@ +package org.apache.maven.archiva.web.tags; + +/* + * 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.IOException; + +import javax.servlet.jsp.JspException; +import javax.servlet.jsp.JspWriter; +import javax.servlet.jsp.PageContext; +import javax.servlet.jsp.tagext.TagSupport; + +import org.apache.commons.lang.StringEscapeUtils; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.web.util.ContextUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * CopyPasteSnippetTag + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class CopyPasteSnippetTag + extends TagSupport +{ + private Logger log = LoggerFactory.getLogger( CopyPasteSnippetTag.class ); + + private Object object; + + private String wrapper = PRE; + + public static final String PRE = "pre"; + + public static final String TOGGLE = "toggle"; + + public void release() + { + object = null; + super.release(); + } + + public int doEndTag() + throws JspException + { + StringBuffer prefix = new StringBuffer(); + StringBuffer buf = new StringBuffer(); + StringBuffer suffix = new StringBuffer(); + + if ( object == null ) + { + buf.append( "Error generating snippet." ); + log.error( "Unable to generate snippet for null object." ); + } + else if ( object instanceof ManagedRepositoryConfiguration ) + { + ManagedRepositoryConfiguration repo = (ManagedRepositoryConfiguration) object; + + if ( TOGGLE.equals( wrapper ) ) + { + prefix.append( "Show POM Snippet
" ); + prefix.append( "
" );
+        
+                suffix.append( "
" ); + } + else if ( PRE.equals( wrapper ) ) + { + prefix.append( "
" );
+                suffix.append( "
" ); + } + + createSnippet( buf, repo, pageContext ); + } + else + { + buf.append( "Unable to generate snippet for object " ).append( object.getClass().getName() ); + } + + try + { + JspWriter out = pageContext.getOut(); + + out.write( prefix.toString() ); + out.write( StringEscapeUtils.escapeXml( buf.toString() ) ); + out.write( suffix.toString() ); + + out.flush(); + } + catch ( IOException e ) + { + throw new JspException( "Unable to write snippet to output: " + e.getMessage(), e ); + } + + return super.doEndTag(); + } + + public void setObject( Object object ) + { + this.object = object; + } + + public void setWrapper( String wrapper ) + { + this.wrapper = wrapper; + } + + private void createSnippet( StringBuffer snippet, ManagedRepositoryConfiguration repo, PageContext pageContext ) + { + snippet.append( "\n" ); + snippet.append( " ...\n" ); + snippet.append( " \n" ); + + String distRepoName = "repository"; + if ( repo.isSnapshots() ) + { + distRepoName = "snapshotRepository"; + } + + snippet.append( " <" ).append( distRepoName ).append( ">\n" ); + snippet.append( " " ).append( repo.getId() ).append( "\n" ); + snippet.append( " dav:" ).append( ContextUtils.getBaseURL( pageContext, "repository" ) ); + snippet.append( "/" ).append( repo.getId() ).append( "/" ).append( "\n" ); + + if ( !"default".equals( repo.getLayout() ) ) + { + snippet.append( " " ).append( repo.getLayout() ).append( "" ); + } + + snippet.append( " \n" ); + snippet.append( " \n" ); + snippet.append( "\n" ); + + snippet.append( " \n" ); + snippet.append( " \n" ); + snippet.append( " " ).append( repo.getId() ).append( "\n" ); + snippet.append( " " ).append( repo.getName() ).append( "\n" ); + + snippet.append( " " ); + snippet.append( ContextUtils.getBaseURL( pageContext, "repository" ) ); + snippet.append( "/" ).append( repo.getId() ).append( "/" ); + + snippet.append( "\n" ); + + if ( !"default".equals( repo.getLayout() ) ) + { + snippet.append( " " ).append( repo.getLayout() ).append( "\n" ); + } + + snippet.append( " \n" ); + snippet.append( " " ).append( Boolean.valueOf( repo.isReleases() ) ).append( "\n" ); + snippet.append( " \n" ); + snippet.append( " \n" ); + snippet.append( " " ).append( Boolean.valueOf( repo.isSnapshots() ) ).append( "\n" ); + snippet.append( " \n" ); + snippet.append( " \n" ); + snippet.append( " \n" ); + + snippet.append( " ...\n" ); + snippet.append( "\n" ); + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/DependencyTree.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/DependencyTree.java new file mode 100644 index 000000000..eab658979 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/DependencyTree.java @@ -0,0 +1,265 @@ +package org.apache.maven.archiva.web.tags; + +/* + * 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.List; +import java.util.Stack; + +import javax.servlet.jsp.PageContext; + +import org.apache.commons.lang.StringUtils; +import org.apache.maven.archiva.common.ArchivaException; +import org.apache.maven.archiva.dependency.DependencyGraphFactory; +import org.apache.maven.archiva.dependency.graph.DependencyGraph; +import org.apache.maven.archiva.dependency.graph.DependencyGraphBuilder; +import org.apache.maven.archiva.dependency.graph.DependencyGraphEdge; +import org.apache.maven.archiva.dependency.graph.DependencyGraphNode; +import org.apache.maven.archiva.dependency.graph.GraphTaskException; +import org.apache.maven.archiva.dependency.graph.walk.BaseVisitor; +import org.apache.maven.archiva.dependency.graph.walk.DependencyGraphWalker; +import org.apache.maven.archiva.dependency.graph.walk.WalkDepthFirstSearch; +import org.apache.maven.archiva.model.ArtifactReference; +import org.apache.maven.archiva.model.DependencyScope; +import org.apache.maven.archiva.model.Keys; +import org.apache.maven.archiva.model.VersionedReference; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * DependencyTree + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component role="org.apache.maven.archiva.web.tags.DependencyTree" + */ +public class DependencyTree + implements Initializable +{ + private Logger log = LoggerFactory.getLogger( DependencyTree.class ); + + /** + * @plexus.requirement + * role="org.apache.maven.archiva.dependency.graph.DependencyGraphBuilder" + * role-hint="project-model" + */ + private DependencyGraphBuilder graphBuilder; + + private DependencyGraphFactory graphFactory = new DependencyGraphFactory(); + + public class TreeEntry + { + private String pre = ""; + + private String post = ""; + + private ArtifactReference artifact; + + public void setArtifact( ArtifactReference artifact ) + { + this.artifact = artifact; + } + + public ArtifactReference getArtifact() + { + return artifact; + } + + public String getPost() + { + return post; + } + + public void setPost( String post ) + { + this.post = post; + } + + public String getPre() + { + return pre; + } + + public void setPre( String pre ) + { + this.pre = pre; + } + + public void appendPre( String string ) + { + this.pre += string; + } + + public void appendPost( String string ) + { + this.post += string; + } + } + + public List gatherTreeList( String groupId, String artifactId, String modelVersion, String nodevar, + PageContext pageContext ) throws ArchivaException + { + if ( StringUtils.isBlank( groupId ) ) + { + String emsg = "Error generating dependency tree [" + Keys.toKey( groupId, artifactId, modelVersion ) + + "]: groupId is blank."; + log.error( emsg ); + throw new ArchivaException( emsg ); + } + + if ( StringUtils.isBlank( artifactId ) ) + { + String emsg = "Error generating dependency tree [" + Keys.toKey( groupId, artifactId, modelVersion ) + + "]: artifactId is blank."; + log.error( emsg ); + throw new ArchivaException( emsg ); + } + + if ( StringUtils.isBlank( modelVersion ) ) + { + String emsg = "Error generating dependency tree [" + Keys.toKey( groupId, artifactId, modelVersion ) + + "]: version is blank."; + log.error( emsg ); + throw new ArchivaException( emsg ); + } + + DependencyGraph graph = fetchGraph( groupId, artifactId, modelVersion ); + + if ( graph == null ) + { + throw new ArchivaException( "Graph is unexpectedly null." ); + } + + TreeListVisitor treeListVisitor = new TreeListVisitor(); + DependencyGraphWalker walker = new WalkDepthFirstSearch(); + walker.visit( graph, treeListVisitor ); + + return treeListVisitor.getList(); + } + + class TreeListVisitor + extends BaseVisitor + { + private List list; + + private int walkDepth; + + private int outputDepth; + + private Stack entryStack = new Stack(); + + private TreeEntry currentEntry; + + public TreeListVisitor() + { + this.list = new ArrayList(); + } + + public List getList() + { + return this.list; + } + + public void discoverGraph( DependencyGraph graph ) + { + super.discoverGraph( graph ); + this.list.clear(); + this.entryStack.clear(); + walkDepth = 0; + outputDepth = -1; + } + + public void discoverNode( DependencyGraphNode node ) + { + super.discoverNode( node ); + currentEntry = new TreeEntry(); + + while ( walkDepth > outputDepth ) + { + currentEntry.appendPre( "
    " ); + outputDepth++; + } + currentEntry.appendPre( "
  • " ); + currentEntry.setArtifact( node.getArtifact() ); + currentEntry.appendPost( "
  • " ); + this.list.add( currentEntry ); + this.entryStack.push( currentEntry ); + } + + public void finishNode( DependencyGraphNode node ) + { + super.finishNode( node ); + + while ( walkDepth < outputDepth ) + { + currentEntry.appendPost( "
" ); + outputDepth--; + } + + this.entryStack.pop(); + } + + public void discoverEdge( DependencyGraphEdge edge ) + { + super.discoverEdge( edge ); + walkDepth++; + } + + public void finishEdge( DependencyGraphEdge edge ) + { + super.finishEdge( edge ); + walkDepth--; + } + } + + private DependencyGraph fetchGraph( String groupId, String artifactId, String modelVersion ) + throws ArchivaException + { + // TODO Cache the results to disk, in XML format, in the same place as the artifact is located. + + VersionedReference projectRef = new VersionedReference(); + projectRef.setGroupId( groupId ); + projectRef.setArtifactId( artifactId ); + projectRef.setVersion( modelVersion ); + + try + { + DependencyGraph depGraph = graphFactory.getGraph( projectRef ); + + return depGraph; + } + catch ( GraphTaskException e ) + { + String emsg = "Unable to generate graph for [" + Keys.toKey( projectRef ) + "] : " + e.getMessage(); + log.warn( emsg, e ); + throw new ArchivaException( emsg, e ); + } + } + + public void initialize() + throws InitializationException + { + this.graphFactory.setGraphBuilder( graphBuilder ); + this.graphFactory.setDesiredScope( DependencyScope.TEST ); + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/DependencyTreeTag.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/DependencyTreeTag.java new file mode 100644 index 000000000..05393904d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/DependencyTreeTag.java @@ -0,0 +1,225 @@ +package org.apache.maven.archiva.web.tags; + +/* + * 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.collections.CollectionUtils; +import org.apache.commons.collections.IteratorUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.maven.archiva.common.ArchivaException; +import org.apache.maven.archiva.web.tags.DependencyTree.TreeEntry; +import org.codehaus.plexus.component.repository.exception.ComponentLookupException; + +import java.io.IOException; +import java.io.PrintWriter; +import java.util.Iterator; +import java.util.List; + +import javax.servlet.jsp.JspException; +import javax.servlet.jsp.PageContext; +import javax.servlet.jsp.tagext.IterationTag; +import javax.servlet.jsp.tagext.TagSupport; +import javax.servlet.jsp.tagext.TryCatchFinally; + +/** + * DependencyTreeTag - just here to output the dependency tree to the browser. + * It was easier to do it this way, vs accessing the dependency graph via a JSP. + * + *
+ *   
+ *     ${node.groupId}:${node.artifactId}:${node.version} (${node.scope})
+ *   
+ * 
+ * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class DependencyTreeTag + extends TagSupport + implements IterationTag, TryCatchFinally +{ + private String groupId; + + private String artifactId; + + private String version; + + private String nodevar; + + private Iterator treeIterator; + + private List tree; + + private TreeEntry currentTreeEntry; + + private String modelVersion; + + public int doAfterBody() + throws JspException + { + if ( currentTreeEntry != null ) + { + out( currentTreeEntry.getPost() ); + } + + if ( treeIterator.hasNext() ) + { + currentTreeEntry = (TreeEntry) treeIterator.next(); + out( currentTreeEntry.getPre() ); + exposeVariables(); + return EVAL_BODY_AGAIN; + } + + out( "\n" ); + + return SKIP_BODY; + } + + public void doCatch( Throwable t ) + throws Throwable + { + throw t; + } + + public void doFinally() + { + unExposeVariables(); + } + + public int doStartTag() + throws JspException + { + DependencyTree deptree; + try + { + deptree = (DependencyTree) PlexusTagUtil.lookup( pageContext, DependencyTree.class.getName() ); + } + catch ( ComponentLookupException e ) + { + throw new JspException( "Unable to lookup DependencyTree: " + e.getMessage(), e ); + } + + if ( deptree == null ) + { + throw new JspException( "Unable to process dependency tree. Component not found." ); + } + + if ( StringUtils.isBlank( nodevar ) ) + { + nodevar = "node"; + } + + out( "
" ); + try + { + this.tree = deptree.gatherTreeList( groupId, artifactId, modelVersion, nodevar, pageContext ); + + if ( CollectionUtils.isEmpty( this.tree ) ) + { + return SKIP_BODY; + } + + treeIterator = tree.iterator(); + + currentTreeEntry = (TreeEntry) treeIterator.next(); + out( currentTreeEntry.getPre() ); + exposeVariables(); + } + catch ( ArchivaException e ) + { + treeIterator = IteratorUtils.EMPTY_LIST_ITERATOR; + + out("
");
+            e.printStackTrace( new PrintWriter( pageContext.getOut() ) );
+            out("
"); + } + + return EVAL_BODY_INCLUDE; + } + + public void release() + { + groupId = ""; + artifactId = ""; + version = ""; + nodevar = ""; + tree = null; + treeIterator = null; + super.release(); + } + + public void setArtifactId( String artifactId ) + { + this.artifactId = artifactId; + } + + public void setGroupId( String groupId ) + { + this.groupId = groupId; + } + + public void setNodevar( String nodevar ) + { + this.nodevar = nodevar; + } + + public void setVersion( String version ) + { + this.version = version; + } + + public void setModelVersion( String modelVersion ) + { + this.modelVersion = modelVersion; + } + + private void exposeVariables() + throws JspException + { + if ( currentTreeEntry == null ) + { + pageContext.removeAttribute( nodevar, PageContext.PAGE_SCOPE ); + } + else + { + pageContext.setAttribute( nodevar, currentTreeEntry.getArtifact() ); + } + } + + private void out( String msg ) + throws JspException + { + try + { + pageContext.getOut().print( msg ); + } + catch ( IOException e ) + { + throw new JspException( "Unable to output to jsp page context." ); + } + } + + private void unExposeVariables() + { + pageContext.removeAttribute( nodevar, PageContext.PAGE_SCOPE ); + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/DownloadArtifact.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/DownloadArtifact.java new file mode 100644 index 000000000..7f6fe606f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/DownloadArtifact.java @@ -0,0 +1,300 @@ +package org.apache.maven.archiva.web.tags; + +/* + * 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 com.opensymphony.webwork.WebWorkException; +import com.opensymphony.webwork.components.Component; +import com.opensymphony.xwork.util.OgnlValueStack; + +import org.apache.commons.lang.StringEscapeUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.maven.archiva.database.ArchivaDAO; +import org.apache.maven.archiva.database.ArchivaDatabaseException; +import org.apache.maven.archiva.database.Constraint; +import org.apache.maven.archiva.database.ObjectNotFoundException; +import org.apache.maven.archiva.database.constraints.ArtifactsRelatedConstraint; +import org.apache.maven.archiva.model.ArchivaArtifact; +import org.apache.maven.archiva.repository.ManagedRepositoryContent; +import org.apache.maven.archiva.repository.RepositoryContentFactory; +import org.apache.maven.archiva.repository.RepositoryException; +import org.apache.maven.archiva.repository.RepositoryNotFoundException; +import org.codehaus.plexus.component.repository.exception.ComponentLookupException; + +import java.io.IOException; +import java.io.Writer; +import java.text.DecimalFormat; +import java.util.List; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.jsp.PageContext; + +/** + * DownloadArtifact + * + * @author Joakim Erdfelt + * @version $Id$ + * @plexus.component role="com.opensymphony.webwork.components.Component" role-hint="download-artifact" + * instantiation-strategy="per-lookup" + */ +public class DownloadArtifact + extends Component +{ + /** + * @plexus.requirement role-hint="jdo" + */ + private ArchivaDAO dao; + + /** + * @plexus.requirement + */ + private RepositoryContentFactory repositoryFactory; + + private HttpServletRequest req; + + @SuppressWarnings("unused") + private HttpServletResponse res; + + private String groupId; + + private String artifactId; + + private String version; + + private boolean mini = false; + + private DecimalFormat decimalFormat; + + public DownloadArtifact( OgnlValueStack stack, PageContext pageContext ) + { + super( stack ); + decimalFormat = new DecimalFormat( "#,#00" ); + this.req = (HttpServletRequest) pageContext.getRequest(); + this.res = (HttpServletResponse) pageContext.getResponse(); + try + { + dao = (ArchivaDAO) PlexusTagUtil.lookup( pageContext, ArchivaDAO.ROLE, "jdo" ); + repositoryFactory = (RepositoryContentFactory) PlexusTagUtil.lookup( pageContext, + RepositoryContentFactory.class ); + } + catch ( ComponentLookupException e ) + { + throw new RuntimeException( e.getMessage(), e ); + } + } + + public boolean end( Writer writer, String body ) + { + StringBuffer sb = new StringBuffer(); + + try + { + Constraint constraint = new ArtifactsRelatedConstraint( groupId, artifactId, version ); + List relatedArtifacts = dao.getArtifactDAO().queryArtifacts( constraint ); + + if ( relatedArtifacts != null ) + { + String repoId = ( (ArchivaArtifact) relatedArtifacts.get( 0 ) ).getModel().getRepositoryId(); + ManagedRepositoryContent repo = repositoryFactory.getManagedRepositoryContent( repoId ); + + String prefix = req.getContextPath() + "/repository/" + repoId; + + if ( mini ) + { + appendMini( sb, prefix, repo, relatedArtifacts ); + } + else + { + appendNormal( sb, prefix, repo, relatedArtifacts ); + } + } + } + catch ( ObjectNotFoundException e ) + { + appendError( sb, e ); + } + catch ( ArchivaDatabaseException e ) + { + appendError( sb, e ); + } + catch ( RepositoryNotFoundException e ) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } + catch ( RepositoryException e ) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + try + { + writer.write( sb.toString() ); + } + catch ( IOException e ) + { + throw new WebWorkException( "IOError: " + e.getMessage(), e ); + } + + return super.end( writer, body ); + } + + private void appendError( StringBuffer sb, Exception e ) + { + /* do nothing */ + } + + private void appendMini( StringBuffer sb, String prefix, ManagedRepositoryContent repo, + List relatedArtifacts ) + { + // TODO: write 1 line download link for main artifact. + } + + private void appendNormal( StringBuffer sb, String prefix, ManagedRepositoryContent repo, + List relatedArtifacts ) + { + /* + *
+ *
+ *
+ *
+ *
+ *
+ * <-- main content goes here --> + *
+ *
+ *
+ *
+ *
+ *
+ */ + + sb.append( "
" ); + sb.append( "
" ); + sb.append( "
" ); + + // Heading + sb.append( "

" ); + if ( relatedArtifacts.size() > 1 ) + { + sb.append( "Downloads" ); + } + else + { + sb.append( "Download" ); + } + sb.append( "

" ); + + // Body + sb.append( "

" ); + + sb.append( "" ); + for ( ArchivaArtifact artifact : relatedArtifacts ) + { + sb.append( "\n" ); + + sb.append( "" ); + + sb.append( "" ); + + sb.append( "" ); + + sb.append( "" ); + } + sb.append( "
" ); + appendImageLink( sb, prefix, repo, artifact ); + sb.append( "" ); + appendLink( sb, prefix, repo, artifact ); + sb.append( "" ); + appendFilesize( sb, artifact ); + sb.append( "
" ); + sb.append( "

" ); + + sb.append( "
" ); // close "downloadbox.bd.c" + sb.append( "
" ); // close "downloadbox.bd" + + sb.append( "
" ); + sb.append( "
" ); // close "download" + } + + private void appendImageLink( StringBuffer sb, String prefix, ManagedRepositoryContent repo, + ArchivaArtifact artifact ) + { + String type = artifact.getType(); + String linkText = ""; + appendLink( sb, prefix, repo, artifact, linkText ); + } + + private static void appendLink( StringBuffer sb, String prefix, ManagedRepositoryContent repo, + ArchivaArtifact artifact, String linkText ) + { + StringBuffer url = new StringBuffer(); + + String path = repo.toPath( artifact ); + + url.append( prefix ); + url.append( "/" ).append( path ); + + String filename = path.substring( path.lastIndexOf( "/" ) + 1 ); + + sb.append( "" ); + + sb.append( linkText ); + + sb.append( "" ); + } + + private void appendLink( StringBuffer sb, String prefix, ManagedRepositoryContent repo, + ArchivaArtifact artifact ) + { + String type = artifact.getType(); + String linkText = StringUtils.capitalize( type ); + + appendLink( sb, prefix, repo, artifact, linkText ); + } + + private void appendFilesize( StringBuffer sb, ArchivaArtifact artifact ) + { + sb.append( decimalFormat.format( artifact.getModel().getSize() ) ); + } + + public void setArtifactId( String artifactId ) + { + this.artifactId = artifactId; + } + + public void setGroupId( String groupId ) + { + this.groupId = groupId; + } + + public void setMini( boolean mini ) + { + this.mini = mini; + } + + public void setVersion( String version ) + { + this.version = version; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/DownloadArtifactTag.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/DownloadArtifactTag.java new file mode 100644 index 000000000..21aaa982f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/DownloadArtifactTag.java @@ -0,0 +1,96 @@ +package org.apache.maven.archiva.web.tags; + +/* + * 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 com.opensymphony.webwork.views.jsp.TagUtils; + +import javax.servlet.jsp.JspException; +import javax.servlet.jsp.tagext.TagSupport; + +/** + * DownloadArtifactTag + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class DownloadArtifactTag + extends TagSupport +{ + private String groupId_; // stores EL-based groupId property + + private String groupId; // stores the evaluated groupId object. + + private String artifactId_; // stores EL-based artifactId property + + private String artifactId; // stores the evaluated artifactId object. + + private String version_; // stores EL-based version property + + private String version; // stores the evaluated version object. + + private String mini_; // stores EL-based mini property + + private boolean mini; // stores the evaluated mini object. + + public int doEndTag() + throws JspException + { + evaluateExpressions(); + + DownloadArtifact download = new DownloadArtifact( TagUtils.getStack( pageContext ), pageContext ); + download.setGroupId( groupId ); + download.setArtifactId( artifactId ); + download.setVersion( version ); + download.setMini( mini ); + + download.end( pageContext.getOut(), "" ); + + return super.doEndTag(); + } + + private void evaluateExpressions() + throws JspException + { + ExpressionTool exprTool = new ExpressionTool( pageContext, this, "download" ); + + // Handle required properties. + groupId = exprTool.requiredString( "groupId", groupId_ ); + artifactId = exprTool.requiredString( "artifactId", artifactId_ ); + version = exprTool.requiredString( "version", version_ ); + + // Handle optional properties + mini = exprTool.optionalBoolean( "mini", mini_, false ); + } + + public void setArtifactId( String artifactId ) + { + this.artifactId_ = artifactId; + } + + public void setGroupId( String groupId ) + { + this.groupId_ = groupId; + } + + public void setVersion( String version ) + { + this.version_ = version; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/ExpressionTool.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/ExpressionTool.java new file mode 100644 index 000000000..b59c5636f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/ExpressionTool.java @@ -0,0 +1,114 @@ +package org.apache.maven.archiva.web.tags; + +/* + * 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.taglibs.standard.tag.common.core.NullAttributeException; +import org.apache.taglibs.standard.tag.el.core.ExpressionUtil; + +import javax.servlet.jsp.JspException; +import javax.servlet.jsp.PageContext; +import javax.servlet.jsp.tagext.Tag; + +/** + * ExpressionTool + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ExpressionTool +{ + private PageContext pageContext; + + private Tag tag; + + private String tagName; + + public ExpressionTool( PageContext pageContext, Tag tag, String tagName ) + { + this.pageContext = pageContext; + this.tag = tag; + this.tagName = tagName; + } + + public boolean optionalBoolean( String propertyName, String expression, boolean defaultValue ) + throws JspException + { + try + { + Boolean ret = (Boolean) ExpressionUtil.evalNotNull( this.tagName, propertyName, expression, Boolean.class, + this.tag, this.pageContext ); + + if ( ret == null ) + { + return defaultValue; + } + + return ret.booleanValue(); + } + catch ( NullAttributeException e ) + { + return defaultValue; + } + } + + public String optionalString( String propertyName, String expression, String defaultValue ) + throws JspException + { + try + { + String ret = (String) ExpressionUtil.evalNotNull( this.tagName, propertyName, expression, String.class, + this.tag, this.pageContext ); + + if ( ret == null ) + { + return defaultValue; + } + + return ret; + } + catch ( NullAttributeException e ) + { + return defaultValue; + } + } + + public String requiredString( String propertyName, String expression ) + throws JspException + { + try + { + String ret = (String) ExpressionUtil.evalNotNull( this.tagName, propertyName, expression, String.class, + this.tag, this.pageContext ); + return ret; + } + catch ( NullAttributeException e ) + { + String emsg = "Required " + this.tagName + " property [" + propertyName + "] is null!"; + + log( emsg, e ); + throw new JspException( emsg ); + } + } + + private void log( String msg, Throwable t ) + { + pageContext.getServletContext().log( msg, t ); + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/GroupIdLink.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/GroupIdLink.java new file mode 100644 index 000000000..37871480c --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/GroupIdLink.java @@ -0,0 +1,148 @@ +package org.apache.maven.archiva.web.tags; + +/* + * 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 com.opensymphony.webwork.WebWorkException; +import com.opensymphony.webwork.components.Component; +import com.opensymphony.xwork.util.OgnlValueStack; + +import java.io.IOException; +import java.io.Writer; +import java.util.StringTokenizer; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * GroupIdLink + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class GroupIdLink + extends Component +{ + private static final String ACTION = "browseGroup"; + + private static final String NAMESPACE = "/"; + + private static final boolean includeContext = true; + + private static final boolean encode = true; + + private static final String method = null; + + private HttpServletRequest req; + + private HttpServletResponse res; + + private String groupId; + + private boolean includeTop = false; + + public GroupIdLink( OgnlValueStack stack, HttpServletRequest req, HttpServletResponse res ) + { + super( stack ); + this.req = req; + this.res = res; + } + + public boolean end( Writer writer, String body ) + { + StringBuffer sb = new StringBuffer(); + + sb.append( "" ); + + if ( includeTop ) + { + sb.append( "[top] / " ); // TODO: i18n + } + + StringTokenizer tok = new StringTokenizer( groupId, "." ); + String cumulativeGroup = null; + + while ( tok.hasMoreTokens() ) + { + String token = tok.nextToken(); + + if ( cumulativeGroup == null ) + { + cumulativeGroup = token; + } + else + { + cumulativeGroup += "." + token; + } + sb.append( "" ).append( token ).append( " / " ); + } + + sb.append( "" ); + + try + { + writer.write( sb.toString() ); + } + catch ( IOException e ) + { + throw new WebWorkException( "IOError: " + e.getMessage(), e ); + } + + return super.end( writer, body ); + } + + private String determineBrowseActionUrl() + { + return determineActionURL( "browse", NAMESPACE, method, req, res, parameters, req.getScheme(), includeContext, + encode, true ); + } + + private String determineBrowseGroupActionUrl( String gid ) + { + parameters.put( "groupId", gid ); + + return determineActionURL( ACTION, NAMESPACE, method, req, res, parameters, req.getScheme(), includeContext, + encode, true ); + } + + public String getGroupId() + { + return groupId; + } + + public void setGroupId( String groupId ) + { + this.groupId = groupId; + } + + public boolean isIncludeTop() + { + return includeTop; + } + + public void setIncludeTop( boolean includeTop ) + { + this.includeTop = includeTop; + } + +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/GroupIdLinkTag.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/GroupIdLinkTag.java new file mode 100644 index 000000000..ec42b8bbe --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/GroupIdLinkTag.java @@ -0,0 +1,86 @@ +package org.apache.maven.archiva.web.tags; + +/* + * 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 com.opensymphony.webwork.views.jsp.TagUtils; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.jsp.JspException; +import javax.servlet.jsp.tagext.TagSupport; + +/** + * GroupIdLink + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class GroupIdLinkTag + extends TagSupport +{ + private String var_; // stores EL-based property + + private String var; // stores the evaluated object. + + private boolean includeTop = false; + + public void release() + { + var_ = null; + var = null; + includeTop = false; + + super.release(); + } + + public int doEndTag() + throws JspException + { + evaluateExpressions(); + + GroupIdLink gidlink = new GroupIdLink( TagUtils.getStack( pageContext ), (HttpServletRequest) pageContext + .getRequest(), (HttpServletResponse) pageContext.getResponse() ); + + gidlink.setGroupId( var ); + gidlink.setIncludeTop( includeTop ); + + gidlink.end( pageContext.getOut(), "" ); + + return super.doEndTag(); + } + + private void evaluateExpressions() + throws JspException + { + ExpressionTool exprTool = new ExpressionTool( pageContext, this, "groupIdLink" ); + + var = exprTool.optionalString( "var", var_, "" ); + } + + public void setVar( String value ) + { + this.var_ = value; + } + + public void setIncludeTop( boolean includeTop ) + { + this.includeTop = includeTop; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/PlexusTagUtil.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/PlexusTagUtil.java new file mode 100644 index 000000000..b6ef516b9 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/PlexusTagUtil.java @@ -0,0 +1,82 @@ +package org.apache.maven.archiva.web.tags; + +/* + * 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.codehaus.plexus.PlexusConstants; +import org.codehaus.plexus.PlexusContainer; +import org.codehaus.plexus.component.repository.exception.ComponentLookupException; + +import javax.servlet.ServletContext; +import javax.servlet.jsp.PageContext; + +/** + * PlexusTagUtil + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class PlexusTagUtil +{ + public static Object lookup( PageContext pageContext, Class clazz ) + throws ComponentLookupException + { + return getContainer( pageContext ).lookup( clazz ); + } + + public static Object lookup( PageContext pageContext, String role ) + throws ComponentLookupException + { + return getContainer( pageContext ).lookup( role ); + } + + public static Object lookup( PageContext pageContext, Class clazz, String hint ) + throws ComponentLookupException + { + return getContainer( pageContext ).lookup( clazz, hint ); + } + + public static Object lookup( PageContext pageContext, String role, String hint ) + throws ComponentLookupException + { + return getContainer( pageContext ).lookup( role, hint ); + } + + public static PlexusContainer getContainer( PageContext pageContext ) + throws ComponentLookupException + { + ServletContext servletContext = pageContext.getServletContext(); + + PlexusContainer xworkContainer = (PlexusContainer) servletContext.getAttribute( "webwork.plexus.container" ); + + if ( xworkContainer != null ) + { + servletContext.setAttribute( PlexusConstants.PLEXUS_KEY, xworkContainer ); + + return xworkContainer; + } + + PlexusContainer container = (PlexusContainer) servletContext.getAttribute( PlexusConstants.PLEXUS_KEY ); + if ( container == null ) + { + throw new ComponentLookupException( "PlexusContainer is null." ); + } + return container; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/util/ContextUtils.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/util/ContextUtils.java new file mode 100644 index 000000000..55c2e54ac --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/util/ContextUtils.java @@ -0,0 +1,106 @@ +package org.apache.maven.archiva.web.util; + +/* + * 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 java.util.HashMap; +import java.util.Map; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.jsp.PageContext; + +/** + * ContextUtils + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ContextUtils +{ + private static final Map defaultSchemePortMap; + + static + { + defaultSchemePortMap = new HashMap(); + defaultSchemePortMap.put( "http", new Integer( 80 ) ); + defaultSchemePortMap.put( "https", new Integer( 443 ) ); + } + + /** + * Using the page context, get the base url. + * + * @param pageContext the page context to use + * @return the base url with module name. + */ + public static String getBaseURL( PageContext pageContext ) + { + return getBaseURL( pageContext, null ); + } + + /** + * Using the page context, get the base url and append an optional resource name to the end of the provided url. + * + * @param pageContext the page context to use + * @param resource the resource name (or null if no resource name specified) + * @return the base url with resource name. + */ + public static String getBaseURL( PageContext pageContext, String resource ) + { + HttpServletRequest request = (HttpServletRequest) pageContext.getRequest(); + return getBaseURL( request, resource ); + } + + /** + * Using the http servlet request, get the base url and append an optional resource name to the end of the url. + * + * @param request the request to use + * @param resource the resource name (or null if not resource name should be appended) + * @return the base url with resource name. + */ + public static String getBaseURL( HttpServletRequest request, String resource ) + { + StringBuffer baseUrl = new StringBuffer(); + + baseUrl.append( request.getScheme() ).append( "://" ); + baseUrl.append( request.getServerName() ); + int portnum = request.getServerPort(); + + // Only add port if non-standard. + Integer defaultPortnum = (Integer) defaultSchemePortMap.get( request.getScheme() ); + if ( ( defaultPortnum == null ) || ( defaultPortnum.intValue() != portnum ) ) + { + baseUrl.append( ":" ).append( String.valueOf( portnum ) ); + } + baseUrl.append( request.getContextPath() ); + + if ( StringUtils.isNotBlank( resource ) ) + { + if ( !baseUrl.toString().endsWith( "/" ) ) + { + baseUrl.append( "/" ); + } + + baseUrl.append( resource ); + } + + return baseUrl.toString(); + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/util/VersionMerger.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/util/VersionMerger.java new file mode 100644 index 000000000..07e4a702c --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/util/VersionMerger.java @@ -0,0 +1,212 @@ +package org.apache.maven.archiva.web.util; + +/* + * 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.archiva.indexer.record.StandardArtifactIndexRecord; +//import org.apache.maven.artifact.versioning.DefaultArtifactVersion; +//import org.apache.maven.model.Dependency; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +public class VersionMerger +{ + + public static List /**/ wrap( List /**/ artifacts ) + { + List dependencies = new ArrayList(); + +// for ( Iterator i = artifacts.iterator(); i.hasNext(); ) +// { +// Dependency dependency = (Dependency) i.next(); +// +// dependencies.add( new DependencyWrapper( dependency ) ); +// } + + return dependencies; + } + + public static Collection /**/ artifacts ) + { + Map dependees = new LinkedHashMap(); + +// for ( Iterator i = artifacts.iterator(); i.hasNext(); ) +// { +// StandardArtifactIndexRecord record = (StandardArtifactIndexRecord) i.next(); +// +// String key = record.getGroupId() + ":" + record.getArtifactId(); +// if ( dependees.containsKey( key ) ) +// { +// DependencyWrapper wrapper = (DependencyWrapper) dependees.get( key ); +// wrapper.addVersion( record.getVersion() ); +// } +// else +// { +// DependencyWrapper wrapper = new DependencyWrapper( record ); +// +// dependees.put( key, wrapper ); +// } +// } + + return dependees.values(); + } + +// public static class DependencyWrapper +// { +// private final String groupId; +// +// private final String artifactId; +// +// /** +// * Versions added. We ignore duplicates since you might add those with varying classifiers. +// */ +// private Set versions = new HashSet(); +// +// private String version; +// +// private String scope; +// +// private String classifier; +// +// public DependencyWrapper( StandardArtifactIndexRecord record ) +// { +// this.groupId = record.getGroupId(); +// +// this.artifactId = record.getArtifactId(); +// +// addVersion( record.getVersion() ); +// } +// +// public DependencyWrapper( Dependency dependency ) +// { +// this.groupId = dependency.getGroupId(); +// +// this.artifactId = dependency.getArtifactId(); +// +// this.scope = dependency.getScope(); +// +// this.classifier = dependency.getClassifier(); +// +// addVersion( dependency.getVersion() ); +// } +// +// public String getScope() +// { +// return scope; +// } +// +// public String getClassifier() +// { +// return classifier; +// } +// +// public void addVersion( String version ) +// { +// // We use DefaultArtifactVersion to get the correct sorting order later, however it does not have +// // hashCode properly implemented, so we add it here. +// // TODO: add these methods to the actual DefaultArtifactVersion and use that. +// versions.add( new DefaultArtifactVersion( version ) +// { +// public int hashCode() +// { +// int result; +// result = getBuildNumber(); +// result = 31 * result + getMajorVersion(); +// result = 31 * result + getMinorVersion(); +// result = 31 * result + getIncrementalVersion(); +// result = 31 * result + ( getQualifier() != null ? getQualifier().hashCode() : 0 ); +// return result; +// } +// +// public boolean equals( Object o ) +// { +// if ( this == o ) +// { +// return true; +// } +// if ( o == null || getClass() != o.getClass() ) +// { +// return false; +// } +// +// DefaultArtifactVersion that = (DefaultArtifactVersion) o; +// +// if ( getBuildNumber() != that.getBuildNumber() ) +// { +// return false; +// } +// if ( getIncrementalVersion() != that.getIncrementalVersion() ) +// { +// return false; +// } +// if ( getMajorVersion() != that.getMajorVersion() ) +// { +// return false; +// } +// if ( getMinorVersion() != that.getMinorVersion() ) +// { +// return false; +// } +// if ( getQualifier() != null ? !getQualifier().equals( that.getQualifier() ) +// : that.getQualifier() != null ) +// { +// return false; +// } +// +// return true; +// } +// } ); +// +// if ( versions.size() == 1 ) +// { +// this.version = version; +// } +// else +// { +// this.version = null; +// } +// } +// +// public String getGroupId() +// { +// return groupId; +// } +// +// public String getArtifactId() +// { +// return artifactId; +// } +// +// public List getVersions() +// { +// List versions = new ArrayList( this.versions ); +// Collections.sort( versions ); +// return versions; +// } +// +// public String getVersion() +// { +// return version; +// } +// } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/validator/CronExpressionValidator.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/validator/CronExpressionValidator.java new file mode 100644 index 000000000..86464e59d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/validator/CronExpressionValidator.java @@ -0,0 +1,47 @@ +package org.apache.maven.archiva.web.validator; + +/* + * 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 com.opensymphony.xwork.validator.ValidationException; +import com.opensymphony.xwork.validator.ValidatorContext; +import com.opensymphony.xwork.validator.validators.FieldValidatorSupport; + +/** + * Reused from Continuum crontab validator + */ +public class CronExpressionValidator + extends FieldValidatorSupport +{ + public void validate( Object obj ) + throws ValidationException + { + String cron = (String) getFieldValue( "cron", obj ); + + org.codehaus.plexus.scheduler.CronExpressionValidator cronExpressionValidator = + new org.codehaus.plexus.scheduler.CronExpressionValidator(); + + ValidatorContext ctxt = getValidatorContext(); + if ( !cronExpressionValidator.validate( String.valueOf( cron ) ) ) + { + ctxt.addActionError( "Invalid cron expression value(s)" ); + return; + } + } +} \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/validator/IntervalValidator.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/validator/IntervalValidator.java new file mode 100644 index 000000000..628caa8a0 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/validator/IntervalValidator.java @@ -0,0 +1,64 @@ +package org.apache.maven.archiva.web.validator; + +/* + * 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 com.opensymphony.xwork.validator.ValidationException; +import com.opensymphony.xwork.validator.ValidatorContext; +import com.opensymphony.xwork.validator.validators.ValidatorSupport; + +/** + * @author Maria Odea Ching + */ +public class IntervalValidator + extends ValidatorSupport +{ + + public void validate( Object obj ) + throws ValidationException + { + String snapshotsPolicy = (String) getFieldValue( "snapshotsPolicy", obj ); + String releasesPolicy = (String) getFieldValue( "releasesPolicy", obj ); + Integer snapshotsInterval = (Integer) getFieldValue( "snapshotsInterval", obj ); + Integer releasesInterval = (Integer) getFieldValue( "releasesInterval", obj ); + + ValidatorContext ctxt = getValidatorContext(); + + if ( !snapshotsPolicy.equals( "interval" ) ) + { + if ( snapshotsInterval.intValue() != 0 ) + { + ctxt.addActionError( "Snapshots Interval must be set to zero." ); + } + } + + if ( !releasesPolicy.equals( "interval" ) ) + { + if ( releasesInterval.intValue() != 0 ) + { + ctxt.addActionError( "Releases Interval must be set to zero." ); + } + } + + if ( ctxt.hasActionErrors() ) + { + return; + } + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/validator/SyncedRepositoryValidator.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/validator/SyncedRepositoryValidator.java new file mode 100644 index 000000000..d97a9e2c4 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/validator/SyncedRepositoryValidator.java @@ -0,0 +1,114 @@ +package org.apache.maven.archiva.web.validator; + +/* + * 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 com.opensymphony.xwork.validator.ValidationException; +import com.opensymphony.xwork.validator.ValidatorContext; +import com.opensymphony.xwork.validator.validators.ValidatorSupport; + +/** + * Validator for synced repository form. The values to be validated depends on the + * selected sync method to be used. + * + * @author Maria Odea Ching + */ +public class SyncedRepositoryValidator + extends ValidatorSupport +{ + + public void validate( Object obj ) + throws ValidationException + { + + String method = (String) getFieldValue( "method", obj ); + ValidatorContext ctxt = getValidatorContext(); + + if ( method.equals( "rsync" ) ) + { + String rsyncHost = (String) getFieldValue( "rsyncHost", obj ); + if ( rsyncHost == null || rsyncHost.equals( "" ) ) + { + ctxt.addActionError( "Rsync host is required." ); + } + + String rsyncDirectory = (String) getFieldValue( "rsyncDirectory", obj ); + if ( rsyncDirectory == null || rsyncDirectory.equals( "" ) ) + { + ctxt.addActionError( "Rsync directory is required." ); + } + + String rsyncMethod = (String) getFieldValue( "rsyncMethod", obj ); + if ( rsyncMethod == null || rsyncMethod.equals( "" ) ) + { + ctxt.addActionError( "Rsync method is required." ); + } + else + { + if ( !rsyncMethod.equals( "anonymous" ) && !rsyncMethod.equals( "ssh" ) ) + { + ctxt.addActionError( "Invalid rsync method" ); + } + } + + String username = (String) getFieldValue( "username", obj ); + if ( username == null || username.equals( "" ) ) + { + ctxt.addActionError( "Username is required." ); + } + + } + else if ( method.equals( "svn" ) ) + { + String svnUrl = (String) getFieldValue( "svnUrl", obj ); + if ( svnUrl == null || svnUrl.equals( "" ) ) + { + ctxt.addActionError( "SVN url is required." ); + } + + String username = (String) getFieldValue( "username", obj ); + if ( username == null || username.equals( "" ) ) + { + ctxt.addActionError( "Username is required." ); + } + } + else if ( method.equals( "cvs" ) ) + { + String cvsRoot = (String) getFieldValue( "cvsRoot", obj ); + if ( cvsRoot == null || cvsRoot.equals( "" ) ) + { + ctxt.addActionError( "CVS root is required." ); + } + } + else if ( method.equals( "file" ) ) + { + String directory = (String) getFieldValue( "directory", obj ); + if ( directory == null || directory.equals( "" ) ) + { + ctxt.addActionError( "Directory is required." ); + } + } + + if ( ctxt.hasActionErrors() ) + { + return; + } + } + +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/META-INF/plexus/application.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/META-INF/plexus/application.xml new file mode 100644 index 000000000..22ad7d1ac --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/META-INF/plexus/application.xml @@ -0,0 +1,419 @@ + + + + + + + org.codehaus.plexus.registry.Registry + org.codehaus.plexus.registry.commons.CommonsConfigurationRegistry + commons-configuration + + + + + + + + + + + + + + + + + + + + + + + org.codehaus.plexus.mailsender.MailSender + org.codehaus.plexus.mailsender.javamail.JndiJavamailMailSender + + java:comp/env/mail/Session + + + + + org.codehaus.plexus.jdo.JdoFactory + archiva + org.codehaus.plexus.jdo.DataSourceConfigurableJdoFactory + + + java:comp/env/jdbc/archiva + java:comp/env/jdbc/archivaShutdown + + + org.jpox.PersistenceManagerFactoryImpl + + + org.jpox.autoCreateSchema + true + + + org.jpox.autoCreateColumns + true + + + org.jpox.validateTables + false + + + org.jpox.validateConstraints + false + + + org.jpox.validateColumns + false + + + org.jpox.autoStartMechanism + None + + + org.jpox.transactionIsolation + READ_COMMITTED + + + org.jpox.poid.transactionIsolation + READ_COMMITTED + + + org.jpox.rdbms.dateTimezone + JDK_DEFAULT_TIMEZONE + + + + + + + + org.codehaus.plexus.jdo.JdoFactory + users + org.codehaus.plexus.jdo.DataSourceConfigurableJdoFactory + + + java:comp/env/jdbc/users + java:comp/env/jdbc/usersShutdown + + + org.jpox.PersistenceManagerFactoryImpl + + + org.jpox.autoCreateSchema + true + + + org.jpox.validateTables + false + + + org.jpox.validateConstraints + false + + + org.jpox.validateColumns + false + + + org.jpox.autoStartMechanism + None + + + org.jpox.transactionIsolation + READ_COMMITTED + + + org.jpox.poid.transactionIsolation + READ_COMMITTED + + + org.jpox.rdbms.dateTimezone + JDK_DEFAULT_TIMEZONE + + + + + + + + + + + org.codehaus.plexus.logging.LoggerManager + org.codehaus.plexus.logging.slf4j.Slf4jLoggerManager + basic + + + + + org.codehaus.plexus.redback.system.check.EnvironmentCheck + locked-admin-check + org.codehaus.plexus.redback.xwork.checks.security.LockedAdminEnvironmentCheck + LockedAdminEnvironmentCheck: checks if accounts marked as system administrator are locked + and unlocks them on startup. + + + + org.codehaus.plexus.redback.users.UserManager + cached + userManager + + + org.codehaus.plexus.redback.rbac.RBACManager + cached + rbacManager + + + + + + + + + + + + + + + + + + + + + + + + + + + plexus + + + plexus + Plexus Lifecycle Handler + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/META-INF/taglib.tld b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/META-INF/taglib.tld new file mode 100644 index 000000000..af5e7e972 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/META-INF/taglib.tld @@ -0,0 +1,154 @@ + + + + + + 2.2.3 + 1.2 + ArchivaTaglib + + http://archiva.apache.org + + Archiva Taglib + + + + + groupIdLink + org.apache.maven.archiva.web.tags.GroupIdLinkTag + empty + + + + var + true + true + + + + + + includeTop + false + true + + + + + + + + + downloadArtifact + org.apache.maven.archiva.web.tags.DownloadArtifactTag + empty + + + + groupId + true + true + + + + + + artifactId + true + true + + + + + + version + true + true + + + + + + mini + false + true + + + + + + + + + copy-paste-snippet + org.apache.maven.archiva.web.tags.CopyPasteSnippetTag + empty + + + + object + true + true + + + + + + wrapper + false + true + + + + + + + + dependency-tree + org.apache.maven.archiva.web.tags.DependencyTreeTag + JSP + + + + groupId + true + true + + + + + + artifactId + true + true + + + + + + version + true + true + + + + + + modelVersion + false + true + + + + + + nodevar + false + true + + + + + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/archiva-mime-types.txt b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/archiva-mime-types.txt new file mode 100644 index 000000000..43e6cb24f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/archiva-mime-types.txt @@ -0,0 +1,127 @@ +# This file controls what Internet media types are sent to the client for +# given file extension(s). Sending the correct media type to the client +# is important so they know how to handle the content of the file. +# Extra types can either be added here or by using an AddType directive +# in your config files. For more information about Internet media types, +# please read RFC 2045, 2046, 2047, 2048, and 2077. The Internet media type +# registry is at . + +# MIME type Extensions + +application/andrew-inset ez +application/atom+xml atom +application/java-archive jar +application/mac-binhex40 hqx +application/mac-compactpro cpt +application/mathml+xml mathml +application/msword doc +application/octet-stream bin dms lha lzh exe class so dll dmg +application/oda oda +application/ogg ogg +application/pdf pdf +application/pgp-encrypted pgp +application/postscript ai eps ps +application/rdf+xml rdf +application/smil smi smil +application/srgs gram +application/srgs+xml grxml +application/vnd.mif mif +application/vnd.mozilla.xul+xml xul +application/vnd.ms-excel xls +application/vnd.ms-powerpoint ppt +application/vnd.rn-realmedia rm +application/vnd.wap.wbxml wbxml +application/vnd.wap.wmlc wmlc +application/vnd.wap.wmlscriptc wmlsc +application/voicexml+xml vxml +application/x-bcpio bcpio +application/x-cdlink vcd +application/x-chess-pgn pgn +application/x-cpio cpio +application/x-csh csh +application/x-director dcr dir dxr +application/x-dvi dvi +application/x-futuresplash spl +application/x-gtar gtar +application/x-hdf hdf +application/x-java-jnlp-file jnlp +application/x-javascript js +application/x-koan skp skd skt skm +application/x-latex latex +application/x-netcdf nc cdf +application/x-sh sh +application/x-shar shar +application/x-shockwave-flash swf +application/x-stuffit sit +application/x-sv4cpio sv4cpio +application/x-sv4crc sv4crc +application/x-tar tar +application/x-tcl tcl +application/x-tex tex +application/x-texinfo texinfo texi +application/x-troff t tr roff +application/x-troff-man man +application/x-troff-me me +application/x-troff-ms ms +application/x-ustar ustar +application/x-wais-source src +application/xhtml+xml xhtml xht +application/xml xml xsl pom +application/xml-dtd dtd +application/xslt+xml xslt +application/zip zip +audio/basic au snd +audio/midi mid midi kar +audio/mpeg mpga mp2 mp3 +audio/x-aiff aif aiff aifc +audio/x-mpegurl m3u +audio/x-pn-realaudio ram ra +audio/x-wav wav +chemical/x-pdb pdb +chemical/x-xyz xyz +image/bmp bmp +image/cgm cgm +image/gif gif +image/ief ief +image/jp2 jp2 +image/jpeg jpeg jpg jpe +image/pict pict pic pct +image/png png +image/svg+xml svg +image/tiff tiff tif +image/vnd.djvu djvu djv +image/vnd.wap.wbmp wbmp +image/x-cmu-raster ras +image/x-icon ico +image/x-macpaint pntg pnt mac +image/x-portable-anymap pnm +image/x-portable-bitmap pbm +image/x-portable-graymap pgm +image/x-portable-pixmap ppm +image/x-quicktime qtif qti +image/x-rgb rgb +image/x-xbitmap xbm +image/x-xpixmap xpm +image/x-xwindowdump xwd +model/iges igs iges +model/mesh msh mesh silo +model/vrml wrl vrml +text/calendar ics ifb +text/css css +text/html html htm +text/plain asc txt sha1 md5 +text/richtext rtx +text/rtf rtf +text/sgml sgml sgm +text/tab-separated-values tsv +text/vnd.wap.wml wml +text/vnd.wap.wmlscript wmls +text/x-setext etx +video/mp4 mp4 +video/mpeg mpeg mpg mpe +video/quicktime qt mov +video/vnd.mpegurl mxu m4u +video/x-dv dv dif +video/x-msvideo avi +video/x-sgi-movie movie +x-conference/x-cooltalk ice diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/freemarker.properties b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/freemarker.properties new file mode 100644 index 000000000..e2c1805e7 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/freemarker.properties @@ -0,0 +1,20 @@ +# +# 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. +# +# 1 hour +template_update_delay=3600000 \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/log4j.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/log4j.xml new file mode 100644 index 000000000..284f1bcc7 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/log4j.xml @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/redback/custom.properties b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/redback/custom.properties new file mode 100644 index 000000000..134092cb2 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/redback/custom.properties @@ -0,0 +1,4 @@ +# text resources within redback can be customized by overriding them here + +#password.reset.success=An email has been sent. +#password.reset.failure=No email was not sent, perhaps the user did not exist as entered. \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/security.properties b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/security.properties new file mode 100644 index 000000000..2074ef020 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/security.properties @@ -0,0 +1,27 @@ +# +# 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. +# + +# -------------------------------------------------------------------- +# Email Settings + +# The subject line for the email message. +email.validation.subject=Welcome to Archiva + +# Feedback page +email.feedback.path=http://archiva.apache.org/mail-lists.html diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/SearchAction-checksumSearch-validation.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/SearchAction-checksumSearch-validation.xml new file mode 100644 index 000000000..712e2910a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/SearchAction-checksumSearch-validation.xml @@ -0,0 +1,33 @@ + + + + + + + + + + You must select a file, or enter the checksum. If the file was given and you receive this message, + there may have been an error generating the checksum. + + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/SearchAction-quickSearch-validation.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/SearchAction-quickSearch-validation.xml new file mode 100644 index 000000000..705f0be19 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/SearchAction-quickSearch-validation.xml @@ -0,0 +1,30 @@ + + + + + + + + + You must enter some search terms. + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/UploadAction-validation.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/UploadAction-validation.xml new file mode 100644 index 000000000..b56cf3757 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/UploadAction-validation.xml @@ -0,0 +1,45 @@ + + + + + + + + + You must enter a groupId. + + + + + You must enter an artifactId. + + + + + You must enter a version. + + + + + You must enter a packaging. + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureAction-validation.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureAction-validation.xml new file mode 100644 index 000000000..3253d2e18 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureAction-validation.xml @@ -0,0 +1,30 @@ + + + + + + + + + You must enter the index directory. + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureAppearance-validation.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureAppearance-validation.xml new file mode 100644 index 000000000..64c011f1f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureAppearance-validation.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureAppearance.properties b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureAppearance.properties new file mode 100644 index 000000000..2084ccd4a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureAppearance.properties @@ -0,0 +1,21 @@ +# +# 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. +# + +appearance.organisation.url = You must define an organisation url." +appearance.organisation.logourl = You must define an organisation logo url." \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureProxiedRepositoryAction-validation.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureProxiedRepositoryAction-validation.xml new file mode 100644 index 000000000..74f61f404 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureProxiedRepositoryAction-validation.xml @@ -0,0 +1,91 @@ + + + + + + + + + You must enter the repository identifier. + + + + + + You must enter the repository name. + + + + + + You must enter the repository URL. + + + + + + The value must be numeric + + + + + + The value must be numeric + + + + + + + + + + + Repository type is required. + + + layout in {"legacy", "default"} + Invalid repository type. + + + + + snapshotsPolicy in { "disabled", "daily", "hourly", "never", "interval" } + Invalid snapshot policy. + + + + + releasesPolicy in { "disabled", "daily", "hourly", "never", "interval" } + Invalid releases policy. + + + + + + A managed repository must be selected. + + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureRepositoryAction-validation.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureRepositoryAction-validation.xml new file mode 100644 index 000000000..7d38693c3 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureRepositoryAction-validation.xml @@ -0,0 +1,51 @@ + + + + + + + + + You must enter the repository identifier. + + + + + You must enter the url name. + + + + + You must enter the repository name. + + + + + You must enter the repository directory. + + + + + layout in {"legacy", "default"} + Invalid repository type. + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureSyncedRepositoryAction-addSelectedSyncedRepository-validation.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureSyncedRepositoryAction-addSelectedSyncedRepository-validation.xml new file mode 100644 index 000000000..d31c27c23 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureSyncedRepositoryAction-addSelectedSyncedRepository-validation.xml @@ -0,0 +1,54 @@ + + + + + + + + + You must enter the repository identifier. + + + + + You must enter the repository name. + + + + + Select repository type. + + + layout in {"legacy", "default"} + Invalid repository type. + + + + + A managed repository must be selected. + + + + + + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureSyncedRepositoryAction-validation.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureSyncedRepositoryAction-validation.xml new file mode 100644 index 000000000..483ebdddf --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/ConfigureSyncedRepositoryAction-validation.xml @@ -0,0 +1,34 @@ + + + + + + + + + You must enter the synchronization method. + + + method in { "rsync", "cvs", "svn", "file" } + Invalid method. + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/appearance/EditOrganisationInfoAction-validation.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/appearance/EditOrganisationInfoAction-validation.xml new file mode 100644 index 000000000..38b3bcfa8 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/appearance/EditOrganisationInfoAction-validation.xml @@ -0,0 +1,40 @@ + + + + + + + + + You must enter a name + + + + + You must enter a URL + + + + + You must enter a URL + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/connectors/proxy/ConfigureProxyConnector-saveProxyConnector-validation.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/connectors/proxy/ConfigureProxyConnector-saveProxyConnector-validation.xml new file mode 100644 index 000000000..5c6e25ce3 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/connectors/proxy/ConfigureProxyConnector-saveProxyConnector-validation.xml @@ -0,0 +1,37 @@ + + + + + + + + + true + You must select a source repository Id. + + + + + true + You must select a target repository Id. + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/database/DatabaseAction-validation.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/database/DatabaseAction-validation.xml new file mode 100644 index 000000000..5743b6a43 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/database/DatabaseAction-validation.xml @@ -0,0 +1,32 @@ + + + + + + + + You must enter a cron expression. + + + Invalid cron expression value(s). + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/legacy/AddLegacyArtifactPathAction-validation.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/legacy/AddLegacyArtifactPathAction-validation.xml new file mode 100644 index 000000000..1725a33ec --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/legacy/AddLegacyArtifactPathAction-validation.xml @@ -0,0 +1,50 @@ + + + + + + + + + You must enter a legacy path. + + + + + You must enter a groupId. + + + + + You must enter an artifactId. + + + + + You must enter a version. + + + + + You must enter a type. + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/networkproxies/ConfigureNetworkProxyAction-saveNetworkProxy-validation.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/networkproxies/ConfigureNetworkProxyAction-saveNetworkProxy-validation.xml new file mode 100644 index 000000000..5e39f8d7e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/networkproxies/ConfigureNetworkProxyAction-saveNetworkProxy-validation.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + true + You must enter an identifier. + + + 4 + 45 + true + You must enter an identifier of 4 or more than 4 characters. + + + + + true + You must enter a protocol. + + + + + true + You must enter a host. + + + + + You must enter an port. + + + 1 + + Port needs to be larger than ${min} + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/repositories/AddManagedRepositoryAction-validation.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/repositories/AddManagedRepositoryAction-validation.xml new file mode 100644 index 000000000..23f4cb495 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/repositories/AddManagedRepositoryAction-validation.xml @@ -0,0 +1,53 @@ + + + + + + + + + You must enter a repository identifier. + + + + + You must enter a directory. + + + + + You must enter a repository name. + + + + + 1 + 100 + Repository Purge By Retention Count needs to be between ${min} and ${max}. + + + + + 0 + Repository Purge By Days Older Than needs to be larger than ${min}. + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/repositories/AddRemoteRepositoryAction-validation.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/repositories/AddRemoteRepositoryAction-validation.xml new file mode 100644 index 000000000..7902bc532 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/repositories/AddRemoteRepositoryAction-validation.xml @@ -0,0 +1,40 @@ + + + + + + + + + You must enter a repository identifier. + + + + + You must enter a url. + + + + + You must enter a repository name. + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/repositories/EditManagedRepositoryAction-validation.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/repositories/EditManagedRepositoryAction-validation.xml new file mode 100644 index 000000000..4ce434a43 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/repositories/EditManagedRepositoryAction-validation.xml @@ -0,0 +1,53 @@ + + + + + + + + + You must enter a repository identifier. + + + + + You must enter a directory. + + + + + You must enter a repository name. + + + + + 1 + 100 + Repository Purge By Retention Count needs to be between ${min} and ${max}. + + + + + 0 + Repository Purge By Days Older Than needs to be larger than ${min}. + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/repositories/EditRemoteRepositoryAction-validation.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/repositories/EditRemoteRepositoryAction-validation.xml new file mode 100644 index 000000000..7902bc532 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/admin/repositories/EditRemoteRepositoryAction-validation.xml @@ -0,0 +1,40 @@ + + + + + + + + + You must enter a repository identifier. + + + + + You must enter a url. + + + + + You must enter a repository name. + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/reports/GenerateReportAction-validation.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/reports/GenerateReportAction-validation.xml new file mode 100644 index 000000000..a31c0652d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/reports/GenerateReportAction-validation.xml @@ -0,0 +1,44 @@ + + + + + + + + + 10 + Row count must be larger than ${min}. + + + + + + You must provide a repository id. + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/validators.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/validators.xml new file mode 100644 index 000000000..c05423ec7 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/validators.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/webwork.properties b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/webwork.properties new file mode 100644 index 000000000..1ad77fc06 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/webwork.properties @@ -0,0 +1,31 @@ +# +# 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. +# + +# define our own action mapper here +webwork.mapper.class = org.apache.maven.archiva.web.mapper.RepositoryActionMapper +webwork.objectFactory = org.codehaus.plexus.spring.WebWorkPlexusInSpringObjectFactory +webwork.url.includeParams = none + +#webwork.devMode = true +webwork.multipart.parser=jakarta + +# TODO: package up a theme and share with Continuum. Should contain everything from xhtml, and set templateDir to WEB-INF/themes + +# Localization +webwork.custom.i18n.resources=org.codehaus.plexus.redback.xwork.default,org.apache.maven.archiva.redback.custom diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/xwork.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/xwork.xml new file mode 100644 index 000000000..21d0363f6 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/resources/xwork.xml @@ -0,0 +1,493 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + externalResult + + + + + + input,back,cancel,browse + + + input,back,cancel,browse + + + + + + + + + + + input,back,cancel,browse + + + input,back,cancel,browse + + + + + + + + + + + + + + + + + index + index + + Account Locked + index + + index + + login + /security + + + login + /security + + + login + /security + + + login + /security + + index + + login + /security + + + login + /security + + + addadmin + /security + + + password + /security + + + + /WEB-INF/jsp/generalError.jsp + /WEB-INF/jsp/accessToNoRepos.jsp + + + + + + + + + browse + + + + /WEB-INF/jsp/quickSearch.jsp + + + + /WEB-INF/jsp/quickSearch.jsp + /WEB-INF/jsp/results.jsp + /WEB-INF/jsp/quickSearch.jsp + + + + /WEB-INF/jsp/findArtifact.jsp + + + + /WEB-INF/jsp/upload.jsp + /WEB-INF/jsp/upload.jsp + /WEB-INF/jsp/upload.jsp + + + + + + /WEB-INF/jsp/findArtifact.jsp + /WEB-INF/jsp/results.jsp + /WEB-INF/jsp/findArtifact.jsp + + /browse/${databaseResults.get(0).getGroupId()}/${databaseResults.get(0).getArtifactId()}/${databaseResults.get(0).getVersion()} + + + + + /WEB-INF/jsp/browse.jsp + + + + /WEB-INF/jsp/browse.jsp + + + + /WEB-INF/jsp/browse.jsp + + + + /WEB-INF/jsp/generalError.jsp + /WEB-INF/jsp/showArtifact.jsp + + + + /WEB-INF/jsp/showArtifact.jsp + + + + /WEB-INF/jsp/showArtifact.jsp + + + + /WEB-INF/jsp/showArtifact.jsp + + + + /WEB-INF/jsp/showArtifact.jsp + + + + /WEB-INF/jsp/artifact/dependencyTree.jsp + + + + + + + + /WEB-INF/jsp/components/companyLogo.jsp + + + + + + + + /WEB-INF/jsp/admin/repositories.jsp + + + + + + /WEB-INF/jsp/admin/repositoryGroups.jsp + + + + /WEB-INF/jsp/admin/repositoryGroups.jsp + /WEB-INF/jsp/admin/repositoryGroups.jsp + repositoryGroups + + + + + /WEB-INF/jsp/admin/deleteRepositoryGroup.jsp + + + + + /WEB-INF/jsp/admin/deleteRepositoryGroup.jsp + /WEB-INF/jsp/admin/deleteRepositoryGroup.jsp + repositoryGroups + + + + + /WEB-INF/jsp/admin/repositoryGroups.jsp + /WEB-INF/jsp/admin/repositoryGroups.jsp + repositoryGroups + + + + + /WEB-INF/jsp/admin/repositoryGroups.jsp + /WEB-INF/jsp/admin/repositoryGroups.jsp + repositoryGroups + + + + + /WEB-INF/jsp/admin/repositoryGroups.jsp + /WEB-INF/jsp/admin/repositoryGroups.jsp + repositoryGroups + + + + + /WEB-INF/jsp/admin/repositoryGroups.jsp + /WEB-INF/jsp/admin/repositoryGroups.jsp + repositoryGroups + + + + + + + /WEB-INF/jsp/admin/repositories.jsp + deleteRepository + + + + repositories + + + + /WEB-INF/jsp/admin/addRepository.jsp + /WEB-INF/jsp/admin/addRepository.jsp + /WEB-INF/jsp/admin/confirmAddRepository.jsp + repositories + + + + + /WEB-INF/jsp/admin/editRepository.jsp + /WEB-INF/jsp/admin/editRepository.jsp + repositories + /WEB-INF/jsp/admin/confirmAddRepository.jsp + + + + + /WEB-INF/jsp/admin/deleteRepository.jsp + + + + + /WEB-INF/jsp/admin/deleteRepository.jsp + /WEB-INF/jsp/admin/deleteRepository.jsp + repositories + + + + + /WEB-INF/jsp/admin/addRemoteRepository.jsp + /WEB-INF/jsp/admin/addRemoteRepository.jsp + repositories + + + + + /WEB-INF/jsp/admin/editRemoteRepository.jsp + /WEB-INF/jsp/admin/editRemoteRepository.jsp + repositories + + + + + /WEB-INF/jsp/admin/deleteRemoteRepository.jsp + + + + + /WEB-INF/jsp/admin/deleteRemoteRepository.jsp + /WEB-INF/jsp/admin/deleteRemoteRepository.jsp + repositories + + + + + + + /WEB-INF/jsp/admin/proxyConnectors.jsp + + + + /WEB-INF/jsp/admin/addProxyConnector.jsp + proxyConnectors + + + + + /WEB-INF/jsp/admin/editProxyConnector.jsp + proxyConnectors + + + + + /WEB-INF/jsp/admin/editProxyConnector.jsp + proxyConnectors + + + + + /WEB-INF/jsp/admin/editProxyConnector.jsp + proxyConnectors + + + + + /WEB-INF/jsp/admin/deleteProxyConnector.jsp + proxyConnectors + + + + + + + /WEB-INF/jsp/admin/networkProxies.jsp + + + + /WEB-INF/jsp/admin/editNetworkProxy.jsp + networkProxies + + + + + /WEB-INF/jsp/admin/editNetworkProxy.jsp + networkProxies + + + + + /WEB-INF/jsp/admin/editNetworkProxy.jsp + networkProxies + + + + + /WEB-INF/jsp/admin/deleteNetworkProxy.jsp + networkProxies + + + + + + + /WEB-INF/jsp/admin/repositoryScanning.jsp + + repositoryScanning + + + + + + + /WEB-INF/jsp/admin/database.jsp + + database + + + + + database + + + + + + /WEB-INF/jsp/admin/appearance.jsp + + + + /WEB-INF/jsp/admin/editAppearance.jsp + + + + /WEB-INF/jsp/admin/editAppearance.jsp + + configureAppearance + /admin + + + + + + + /WEB-INF/jsp/admin/legacyArtifactPath.jsp + + legacyArtifactPath + + + + + /WEB-INF/jsp/admin/addLegacyArtifactPath.jsp + /WEB-INF/jsp/admin/addLegacyArtifactPath.jsp + legacyArtifactPath + + + + + /WEB-INF/jsp/admin/legacyArtifactPath.jsp + /WEB-INF/jsp/admin/legacyArtifactPath.jsp + legacyArtifactPath + + + + + + + + /WEB-INF/jsp/reports/pickReport.jsp + + + + + /WEB-INF/jasperreports/report.jasper + reports + HTML + + /WEB-INF/jsp/reports/pickReport.jsp + /WEB-INF/jsp/reports/blankReport.jsp + /WEB-INF/jsp/reports/basicReport.jsp + + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/applicationContext.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/applicationContext.xml new file mode 100644 index 000000000..93bd4a30b --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/applicationContext.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/decorators.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/decorators.xml new file mode 100644 index 000000000..638f2c53a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/decorators.xml @@ -0,0 +1,34 @@ + + + + + + /repository/* + /components/* + + + + /* + + + + /*/dependencyTree + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/accessToNoRepos.jsp b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/accessToNoRepos.jsp new file mode 100644 index 000000000..5ed04736f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/accessToNoRepos.jsp @@ -0,0 +1,46 @@ +<%-- + ~ 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. + --%> + +<%@ taglib prefix="ww" uri="/webwork" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> + + + + You have access to no repositories + + + + + +
+ +
+ You have access to no repositories. + Ask your system administrator for access. +
+ +
+ +
+
+
+ + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/addLegacyArtifactPath.jsp b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/addLegacyArtifactPath.jsp new file mode 100644 index 000000000..6c647d426 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/addLegacyArtifactPath.jsp @@ -0,0 +1,100 @@ +<%-- + ~ 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. + --%> + +<%@ taglib prefix="ww" uri="/webwork" %> + + + + Admin: Add Legacy Artifact Path + + + + + +

Admin: Add Legacy Artifact Path

+ +
+ +

+ Enter the legacy path to map to a particular artifact reference, then adjust the fields as necessary. +

+ + + + + + + + + + + + + + + + + +
+ + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/addProxyConnector.jsp b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/addProxyConnector.jsp new file mode 100644 index 000000000..314f9bc1b --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/addProxyConnector.jsp @@ -0,0 +1,45 @@ +<%-- + ~ 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. + --%> + +<%@ taglib prefix="ww" uri="/webwork" %> + + + + Admin: Add Proxy Connector + + + + + +

Admin: Add Proxy Connector

+ +
+ + + + + + <%@ include file="/WEB-INF/jsp/admin/include/proxyConnectorForm.jspf" %> + + + +
+ + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/addRemoteRepository.jsp b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/addRemoteRepository.jsp new file mode 100644 index 000000000..d1455abf8 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/addRemoteRepository.jsp @@ -0,0 +1,48 @@ +<%-- + ~ 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. + --%> + +<%@ taglib prefix="ww" uri="/webwork" %> + + + + Admin: Add Remote Repository + + + + + +

Admin: Add Remote Repository

+ +
+ + + + + <%@ include file="/WEB-INF/jsp/admin/include/remoteRepositoryForm.jspf" %> + + + + + +
+ + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/addRepository.jsp b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/addRepository.jsp new file mode 100644 index 000000000..55bbda151 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/addRepository.jsp @@ -0,0 +1,48 @@ +<%-- + ~ 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. + --%> + +<%@ taglib prefix="ww" uri="/webwork" %> + + + + Admin: Add Managed Repository + + + + + +

Admin: Add Managed Repository

+ +
+ + + + + <%@ include file="/WEB-INF/jsp/admin/include/repositoryForm.jspf" %> + + + + + +
+ + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/appearance.jsp b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/appearance.jsp new file mode 100644 index 000000000..d2b24e83a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/appearance.jsp @@ -0,0 +1,68 @@ +<%-- + ~ 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. + --%> + +<%@ taglib prefix="ww" uri="/webwork" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> + + + + Configure Appearance + + + + +

Appearance

+ +
+ Edit +
+

Organization Details

+ +

+ The logo in the top right of the screen is controlled by the following settings. + Change your appearence +

+ +

Organization Information

+ + + + + + + + + + + + + + + + + +
Name${organisationName}
URL + ${organisationUrl} +
Logo URL + ${organisationLogo} +
  + +
+ + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/confirmAddRepository.jsp b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/confirmAddRepository.jsp new file mode 100644 index 000000000..270b90591 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/confirmAddRepository.jsp @@ -0,0 +1,135 @@ +<%-- + ~ 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. + --%> + +<%@ taglib prefix="ww" uri="/webwork" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> + + + + Admin: Add Managed Repository + + + + + +

Admin: Add Managed Repository

+ +
+

+ WARNING: Repository location already exists. +

+
+ +

+ Are you sure you want to ${action == 'addRepository' ? 'add' : 'update'} the following managed repository? +

+ +
+ + + + + + + + + + + + + + + + + + + + <%--td>${repository.layout} + + + + + + + + + + + + + + + + + + + + + + + + + + +
ID:${repository.id}
Name:${repository.name}
Directory:${repository.location}
Index Directory:${repository.indexDir}
Type: + + + Maven 2.x Repository + + + Maven 1.x Repository + + +
Cron:${repository.refreshCronExpression}
Repository Purge By Days Older Than:${repository.daysOlder}
Repository Purge By Retention Count:${repository.retentionCount}
Releases Included: +
Snapshots Included: +
Scannable: +
Delete Released Snapshots: +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/database.jsp b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/database.jsp new file mode 100644 index 000000000..6359c4e12 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/database.jsp @@ -0,0 +1,178 @@ +<%-- + ~ 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. + --%> + +<%@ taglib prefix="ww" uri="/webwork"%> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> +<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> +<%@ taglib prefix="redback" uri="http://plexus.codehaus.org/redback/taglib-1.0" %> +<%@ taglib prefix="archiva" uri="http://archiva.apache.org" %> + + + +Administration - Database + + + + + +

Administration - Database

+ +
+ + + + + + + +
+ +

Database - Unprocessed Artifacts Scanning

+ + + + + + + +
+ +
+
+ + + + + +

Database - Unprocessed Artifacts Scanning

+ + + + <%-- No Consumers. Eeek! --%> + There are no consumers for unprocessed artifacts. + + + <%-- Display the consumers. --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 Enabled?IDDescription
+ checked /> + + + enabled + + + ${consumer.id} + ${consumer.description}
+ +
+
+ +
+
+ +

Database - Artifact Cleanup Scanning

+ + + + <%-- No Consumers. Eeek! --%> + There are no consumers for artifact cleanup. + + + <%-- Display the consumers. --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 Enabled?IDDescription
+ checked /> + + + enabled + + + ${consumer.id} + ${consumer.description}
+ +
+
+ +
+
+ + +
+
+ + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/deleteNetworkProxy.jsp b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/deleteNetworkProxy.jsp new file mode 100644 index 000000000..c4feaa87a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/deleteNetworkProxy.jsp @@ -0,0 +1,53 @@ +<%-- + ~ 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. + --%> + +<%@ taglib prefix="ww" uri="/webwork" %> + + + + Admin: Delete Network Proxy + + + + + +

Admin: Delete Network Proxy

+ + + +
+ +

Delete Network Proxy

+ +
+ WARNING: This operation can not be undone. +
+ +

+ Are you sure you want to delete network proxy ${proxyid} ? +

+ + + + + +
+ + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/deleteProxyConnector.jsp b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/deleteProxyConnector.jsp new file mode 100644 index 000000000..de6937eca --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/deleteProxyConnector.jsp @@ -0,0 +1,54 @@ +<%-- + ~ 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. + --%> + +<%@ taglib prefix="ww" uri="/webwork" %> + + + + Admin: Delete Proxy Connector + + + + + +

Admin: Delete Proxy Connector

+ + + +
+ +

Delete Proxy Connector

+ +
+ WARNING: This operation can not be undone. +
+ +

+ Are you sure you want to delete proxy connector [ ${source} , ${target} ] ? +

+ + + + + + +
+ + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/deleteRemoteRepository.jsp b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/deleteRemoteRepository.jsp new file mode 100644 index 000000000..183da4d23 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/deleteRemoteRepository.jsp @@ -0,0 +1,73 @@ +<%-- + ~ 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. + --%> + +<%@ taglib prefix="ww" uri="/webwork" %> + + + + Admin: Delete Remote Repository + + + + + +

Admin: Delete Remote Repository

+ + + +
+ +
+

+ WARNING: This operation can not be undone. +

+
+ +

+ Are you sure you want to delete the following remote repository? +

+ +
+ + + + + + + + + + + + + +
ID:${repository.id}
Name:${repository.name}
URL:${repository.url}
+
+ + + +
+ + +
+
+
+ + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/deleteRepository.jsp b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/deleteRepository.jsp new file mode 100644 index 000000000..7394e1690 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/deleteRepository.jsp @@ -0,0 +1,74 @@ +<%-- + ~ 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. + --%> + +<%@ taglib prefix="ww" uri="/webwork" %> + + + + Admin: Delete Managed Repository + + + + + +

Admin: Delete Managed Repository

+ + + +
+ +
+

+ WARNING: This operation can not be undone. +

+
+ +

+ Are you sure you want to delete the following managed repository? +

+ +
+ + + + + + + + + + + + + +
ID:${repository.id}
Name:${repository.name}
Directory:${repository.location}
+
+ + + +
+ + + +
+
+
+ + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/deleteRepositoryGroup.jsp b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/deleteRepositoryGroup.jsp new file mode 100644 index 000000000..fa1892686 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/deleteRepositoryGroup.jsp @@ -0,0 +1,65 @@ +<%-- + ~ 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. + --%> + +<%@ taglib prefix="ww" uri="/webwork" %> + + + + Admin: Delete Repository Group + + + + + +

Admin: Delete Repository Group

+ + + +
+ +
+

+ WARNING: This operation can not be undone. +

+
+ +

+ Are you sure you want to delete the following repository group? +

+ +
+ + + + + +
ID:${repositoryGroup.id}
+
+ + + +
+ + +
+
+
+ + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editAppearance.jsp b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editAppearance.jsp new file mode 100644 index 000000000..5f5316a2a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editAppearance.jsp @@ -0,0 +1,46 @@ +<%-- + ~ 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. + --%> + +<%@ taglib prefix="ww" uri="/webwork" %> + + + Configure Appearance + + + + +

Appearance

+ +

Organization Details

+ +

+ Enter the details of your organization below. +

+ + + + + + + + + + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editNetworkProxy.jsp b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editNetworkProxy.jsp new file mode 100644 index 000000000..bb09274e7 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editNetworkProxy.jsp @@ -0,0 +1,73 @@ +<%-- + ~ 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. + --%> + +<%@ taglib prefix="ww" uri="/webwork" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> + + + + + + + + + + + + + + Admin: ${addedit} Network Proxy + + + + + +

Admin: ${addedit} Network Proxy

+ +
+ +

${addedit} network proxy: ${networkProxyName}

+ + + + + + + + + + + + + + + + + <%@ include file="/WEB-INF/jsp/admin/include/networkProxyForm.jspf" %> + + + + + +
+ + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editProxyConnector.jsp b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editProxyConnector.jsp new file mode 100644 index 000000000..e13584546 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editProxyConnector.jsp @@ -0,0 +1,46 @@ +<%-- + ~ 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. + --%> + +<%@ taglib prefix="ww" uri="/webwork" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> + + + + Admin : Edit Proxy Connector + + + + + +

Admin : Edit Proxy Connector

+ +
+ + + + + + <%@ include file="/WEB-INF/jsp/admin/include/proxyConnectorForm.jspf" %> + + + +
+ + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editRemoteRepository.jsp b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editRemoteRepository.jsp new file mode 100644 index 000000000..3f6686c57 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editRemoteRepository.jsp @@ -0,0 +1,50 @@ +<%-- + ~ 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. + --%> + +<%@ taglib prefix="ww" uri="/webwork" %> + + + + Admin: Edit Remote Repository + + + + + +

Admin: Edit Remote Repository

+ + + +
+ + + + + <%@ include file="/WEB-INF/jsp/admin/include/remoteRepositoryForm.jspf" %> + + + + + +
+ + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editRepository.jsp b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editRepository.jsp new file mode 100644 index 000000000..a2a899e35 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/editRepository.jsp @@ -0,0 +1,51 @@ +<%-- + ~ 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. + --%> + +<%@ taglib prefix="ww" uri="/webwork" %> + + + + Admin: Edit Managed Repository + + + + + +

Admin: Edit Managed Repository

+ + + +
+ + + + + + <%@ include file="/WEB-INF/jsp/admin/include/repositoryForm.jspf" %> + + + + + +
+ + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/errorMessages.jsp b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/errorMessages.jsp new file mode 100644 index 000000000..f4793128d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/errorMessages.jsp @@ -0,0 +1,29 @@ +<%-- + ~ 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. + --%> + +

+ + Errors: + +

  • + +
  • + + +

    \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/include/networkProxyForm.jspf b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/include/networkProxyForm.jspf new file mode 100644 index 000000000..935c4b176 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/include/networkProxyForm.jspf @@ -0,0 +1,26 @@ +<%-- + ~ 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. + --%> +<%@ taglib prefix="ww" uri="/webwork" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> + + + + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/include/proxyConnectorForm.jspf b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/include/proxyConnectorForm.jspf new file mode 100644 index 000000000..4a6b29101 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/include/proxyConnectorForm.jspf @@ -0,0 +1,259 @@ +<%-- + ~ 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. + --%> +<%@ taglib prefix="ww" uri="/webwork" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> + + + + +<%-- This hidden 'pattern' field is used by remove (white|black)list scripts --%> + + + + + + + + + + + + + + + + + + + +
    + ${policy.value.name}: + + + + + + +
    + + + + + + + + + + : + + + + + + + + + + + + No properties have been set. + + + + + + + + + + +
    + ${property.key} + + + + + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + No black list patterns have been set. + + + + + + + + + +
    + + "${pattern}" + + + +
    +
    +
    + + + + + + + + + + + + + + + + + + + No white list patterns have been set. + + + + + + + + + +
    + + "${pattern}" + + + +
    +
    +
    + + + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/include/remoteRepositoryForm.jspf b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/include/remoteRepositoryForm.jspf new file mode 100644 index 000000000..b59fa8f50 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/include/remoteRepositoryForm.jspf @@ -0,0 +1,28 @@ +<%-- + ~ 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. + --%> + +<%@ taglib prefix="ww" uri="/webwork" %> + + + + + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/include/repositoryForm.jspf b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/include/repositoryForm.jspf new file mode 100644 index 000000000..7cde90476 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/include/repositoryForm.jspf @@ -0,0 +1,36 @@ +<%-- + ~ 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. + --%> +<%@ taglib prefix="ww" uri="/webwork" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> + + + + + + + + + + + + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/legacyArtifactPath.jsp b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/legacyArtifactPath.jsp new file mode 100644 index 000000000..6c64cabf5 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/legacyArtifactPath.jsp @@ -0,0 +1,113 @@ +<%-- + ~ 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. + --%> + +<%@ taglib prefix="ww" uri="/webwork" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib prefix="redback" uri="http://plexus.codehaus.org/redback/taglib-1.0" %> +<%@ taglib prefix="archiva" uri="http://archiva.apache.org" %> + + + + Administration - Legacy support + + + + + +

    Administration - Legacy Artifact Path Resolution

    + +
    + + + + +
    +
    + + + + " alt="" width="16" height="16"/> + Add + + +
    +

    Path Mappings

    + + + + <%-- No paths. --%> +

    There are no legacy artifact paths configured yet.

    +
    + + <%-- Display the paths. --%> + + + + + + + + + + + +
    + +
    + <%-- TODO: make some icons --%> + + + + + + " alt="" width="16" height="16"/> + Delete + + +
    + + + + + + + + + + +
    Path + ${legacyArtifactPath.path} +
    Artifact + ${legacyArtifactPath.artifact} +
    + +
    +
    + +
    +
    + + + +
    + +
    + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/networkProxies.jsp b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/networkProxies.jsp new file mode 100644 index 000000000..a7aeea1c7 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/networkProxies.jsp @@ -0,0 +1,128 @@ +<%-- + ~ 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. + --%> + +<%@ taglib prefix="ww" uri="/webwork"%> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> +<%@ taglib prefix="redback" uri="http://plexus.codehaus.org/redback/taglib-1.0" %> +<%@ taglib prefix="archiva" uri="http://archiva.apache.org"%> + + + +Administration - Network Proxies + + + + + +

    Administration - Network Proxies

    + +
    + + + +
    +
    + + + + " /> + Add Network Proxy +
    +

    Network Proxies

    + + + + <%-- No Local Repositories. --%> + There are no network proxies configured yet. + + + <%-- Display the repositories. --%> + + + + + + + + + + + +
    + +
    + + + + + + + + + " /> + Edit Network Proxy + + " /> + Delete Network Proxy +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Identifier${proxy.id}
    Protocol${proxy.protocol}
    Host${proxy.host}
    Port${proxy.port}
    Username${proxy.username}
    Password••••••••
    + +
    +
    + +
    +
    +
    + +
    + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/proxyConnectors.jsp b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/proxyConnectors.jsp new file mode 100644 index 000000000..78963a1fa --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/proxyConnectors.jsp @@ -0,0 +1,221 @@ +<%-- + ~ 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. + --%> + +<%@ taglib prefix="ww" uri="/webwork" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> +<%@ taglib prefix="redback" uri="http://plexus.codehaus.org/redback/taglib-1.0" %> +<%@ taglib prefix="archiva" uri="http://archiva.apache.org" %> + + + + Administration - Proxy Connectors + + + + + +

    Administration - Proxy Connectors

    + + + + + + + +
    + + + + +
    + + + + "/> + Add + + +
    + +

    Repository Proxy Connectors

    + + + + No Repository Proxy Connectors Defined. + + + +
    + + + +
    +
    + "/> +

    ${repository.key}

    +

    ${repoMap[repository.key].name}

    +
    + + + + + + + + + + + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    Proxy Connector

    + +
    + "/> +

    ${connector.targetRepoId}

    +

    ${repoMap[connector.targetRepoId].name}

    +

    ${repoMap[connector.targetRepoId].url}

    +
    + + Expand + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    <%-- connector --%> + +
    +
    <%-- proxyConfig --%> +
    +
    <%-- admin --%> +
    +
    + +
    + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/repositories.jsp b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/repositories.jsp new file mode 100644 index 000000000..ecd8719b0 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/repositories.jsp @@ -0,0 +1,347 @@ +<%-- + ~ 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. + --%> + +<%@ taglib prefix="ww" uri="/webwork" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib prefix="redback" uri="http://plexus.codehaus.org/redback/taglib-1.0" %> +<%@ taglib prefix="archiva" uri="http://archiva.apache.org" %> + + + + Administration - Repositories + + + + + +

    Administration - Repositories

    + +
    + + + + +
    +
    + + + + " alt="" width="16" height="16"/> + Add + + +
    +

    Managed Repositories

    + + + + <%-- No Managed Repositories. --%> + There are no managed repositories configured yet. + + +<%-- Display the repositories. --%> + + + + + + + + + + + +
    + +
    + <%-- TODO: make some icons --%> + + + + + + + + + " alt="" width="16" height="16"/> + Edit + + + " alt="" width="16" height="16"/> + Delete + + + + + + +
    + +
    + " alt="" width="32" height="32"/> +
    + +

    ${repository.name}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- TODO: can probably just use layout appended to a key prefix in i18n to simplify this --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Identifier + ${repository.id} +
    Name + ${repository.name} +
    Directory${repository.location}
    Index Directory${repository.indexDir}
    WebDAV URL${baseUrl}/${repository.id}/
    Type + + + Maven 2.x Repository + + + Maven 1.x Repository + + +
    Groups + + ${group}, + +
    Releases Included
    Snapshots Included
    Delete Released Snapshots
    Repository Purge By Days Older Than${repository.daysOlder}
    Repository Purge By Retention Count${repository.retentionCount}
    Scanned
    Scanning Cron${repository.refreshCronExpression}
    + Actions + + + + + +
    + + + + + + +
    +
    Stats + + + + No Statistics Available. + + + + + + + + + + + + + + + + + +
    Last Scanned${stats.whenGathered}
    Duration${stats.duration} ms
    Total File Count${stats.totalFileCount} +
    New Files Found${stats.newFileCount} +
    +
    +
    +
    POM Snippet + +
    + +
    +
    + +
    +
    + +
    + + + + " alt="" width="16" height="16"/> + Add + + +
    +

    Remote Repositories

    + + + + <%-- No Remote Repositories. --%> + There are no remote repositories configured yet. + + + <%-- Display the repositories. --%> + + + + + + + + + + +
    + +
    + + + + + + " alt="" width="16" height="16"/> + Edit + + + + + + " alt="" width="16" height="16"/> + Delete + + +
    + +
    + " alt="" width="32" height="32"/> +
    + +

    ${repository.name}

    + + + + + + + + + + + + + + + + + <%-- TODO: can probably just use layout appended to a key prefix in i18n to simplify this --%> + + +
    Identifier + ${repository.id} +
    Name + ${repository.name} +
    URL${repository.url}
    Type + + + Maven 2.x Repository + + + Maven 1.x Repository + + +
    + +
    +
    +
    +
    + +
    + +
    + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/repositoryGroups.jsp b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/repositoryGroups.jsp new file mode 100644 index 000000000..85c78aeea --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/repositoryGroups.jsp @@ -0,0 +1,157 @@ +<%-- + ~ 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. + --%> + +<%@ taglib prefix="ww" uri="/webwork" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> +<%@ taglib prefix="redback" uri="http://plexus.codehaus.org/redback/taglib-1.0" %> +<%@ taglib prefix="archiva" uri="http://archiva.apache.org" %> + + + + Administration - Repository Groups + + + + + +

    Administration - Repository Groups

    + + + + + + + +
    + + + + +
    + + + Identifier*: + + + + +
    + +

    Repository Groups

    + + + + No Repository Groups Defined. + + + +
    + + + +
    +
    + +
    + + + + + + +
    + + "/> +

    ${repositoryGroup.key}

    +

    ${baseUrl}/${repositoryGroup.key}/

    +
    + + +
    + + + + + +
    +
    + + + + + + + + + + + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    Repository

    + +
    + "/> +

    ${repository}

    +

    ${managedRepositories[repository].name}

    +

    ${baseUrl}/${managedRepositories[repository].id}

    +
    +
    <%-- repository --%> +
    + +
    <%-- repository group --%> +
    +
    <%-- admin --%> + +
    <%-- content area --%> + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/repositoryScanning.jsp b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/repositoryScanning.jsp new file mode 100644 index 000000000..4450bee1e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/repositoryScanning.jsp @@ -0,0 +1,259 @@ +<%-- + ~ 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. + --%> + +<%@ taglib prefix="ww" uri="/webwork"%> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> +<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> +<%@ taglib prefix="redback" uri="http://plexus.codehaus.org/redback/taglib-1.0" %> +<%@ taglib prefix="archiva" uri="http://archiva.apache.org"%> + + + +Administration - Repository Scanning + + + + + +

    Administration - Repository Scanning

    + +
    + + + + + + + + + + + +
    +

    Repository Scanning - File Types

    + + + + <%-- No File Types. Eeek! --%> + There are no file types configured. + + + <%-- Display the filetypes. --%> + + + + + + + + + + +
    + +
    <%-- Does this even make sense for file types? --%>
    + +

    ${filetypeId}

    + + + + + + + + + + + + + + + + + + + + + + + +
    + ${escapedPattern} + + + + +
    + + + + + +
    + +
    +
    + +
    +
    + +

    Repository Scanning - Consumers of Known Content

    + + + + <%-- No Good Consumers. Eeek! --%> + There are no consumers of known content available. + + + <%-- Display the consumers. --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
     Enabled?IDDescription
    + checked /> + + + enabled + + + ${consumer.id} + ${consumer.description}
    + +
    +
    + +
    +
    + + +

    Repository Scanning - Consumers of Invalid Content

    + + + + <%-- No Consumers. Eeek! --%> + There are no consumers of invalid content available. + + + <%-- Display the consumers. --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
     Enabled?IDDescription
    + checked /> + + + enabled + + + ${consumer.id} + ${consumer.description}
    + +
    +
    + +
    +
    +
    + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/alert.jsp b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/alert.jsp new file mode 100644 index 000000000..897c82a4c --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/alert.jsp @@ -0,0 +1,45 @@ +<%-- + ~ 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. + --%> + +<%@ taglib prefix="ww" uri="/webwork" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> + + + + Security Alert Page + + + + + +
    + +
    + +
    +
    +
    + + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/artifact/dependencyTree.jsp b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/artifact/dependencyTree.jsp new file mode 100644 index 000000000..1af5188d6 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/artifact/dependencyTree.jsp @@ -0,0 +1,28 @@ +<%-- + ~ 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. + --%> + +<%@ taglib prefix="page" uri="http://www.opensymphony.com/sitemesh/page" %> +<%@ taglib prefix="my" tagdir="/WEB-INF/tags" %> +<%@ taglib prefix="archiva" uri="http://archiva.apache.org" %> + + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/browse.jsp b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/browse.jsp new file mode 100644 index 000000000..762cead71 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/browse.jsp @@ -0,0 +1,105 @@ +<%-- + ~ 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. + --%> + +<%@ taglib prefix="ww" uri="/webwork" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib prefix="archiva" uri="http://archiva.apache.org" %> +<%@ taglib prefix="redback" uri="http://plexus.codehaus.org/redback/taglib-1.0" %> + + + + Browse Repository + + + + + +

    Browse Repository

    + +
    + +

    + + + ${artifactId} + +

    +
    + + +
    +

    Groups

    + +
    +
    + + +
    +

    Artifacts

    + +
    +
    + + +
    +

    Versions

    + +
    +
    + +
    + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/browseArtifact.jsp b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/browseArtifact.jsp new file mode 100644 index 000000000..65fee203f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/browseArtifact.jsp @@ -0,0 +1,59 @@ +<%-- + ~ 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. + --%> + +<%@ taglib prefix="ww" uri="/webwork" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib prefix="archiva" uri="http://archiva.apache.org" %> + + + + Browse Repository + + + + + +

    Browse Repository

    + +
    +
    +

    + + ${artifactId} +

    + +

    Versions

    + +
    +
    + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/browseGroup.jsp b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/browseGroup.jsp new file mode 100644 index 000000000..ac8c69c40 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/browseGroup.jsp @@ -0,0 +1,91 @@ +<%-- + ~ 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. + --%> + +<%@ taglib prefix="ww" uri="/webwork" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib prefix="archiva" uri="http://archiva.apache.org" %> + + + + Browse Repository + + + + + +

    Browse Repository

    + +
    +

    + +

    + +
    +

    Groups

    + +
    + + +
    +

    Versions

    + +
    +
    + + +
    +

    Artifacts

    + +
    +
    + + +
    + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/components/companyLogo.jsp b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/components/companyLogo.jsp new file mode 100644 index 000000000..ce3bbe85f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/components/companyLogo.jsp @@ -0,0 +1,34 @@ +<%-- + ~ 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. + --%> + +<%@ taglib uri="/webwork" prefix="ww" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> + + + + + + + + + + + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/decorators/artifactDecorator.jsp b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/decorators/artifactDecorator.jsp new file mode 100644 index 000000000..256e46f6e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/decorators/artifactDecorator.jsp @@ -0,0 +1,149 @@ +<%-- + ~ 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. + --%> + +<%@ taglib prefix="decorator" uri="http://www.opensymphony.com/sitemesh/decorator" %> +<%@ taglib prefix="page" uri="http://www.opensymphony.com/sitemesh/page" %> +<%@ taglib prefix="ww" uri="/webwork" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib prefix="redback" uri="http://plexus.codehaus.org/redback/taglib-1.0" %> +<%@ taglib prefix="my" tagdir="/WEB-INF/tags" %> +<%@ taglib prefix="archiva" uri="http://archiva.apache.org" %> + + + + + + Browse Repository + + + + + + + + + + Maven Plugin + + + + POM + + <%-- These types aren't usually set in the POM yet, so we fudge them for the well known ones --%> + + + Maven Archetype + + + + Maven Skin + + <%-- Must be last so that the above get picked up if possible --%> + + + JAR + + + + + + +${packageName} + +

    + + + ${model.artifactId} + + + ${model.name} + + +

    + +
    +
    + + + + + + + + + Info + + + + + + + + Dependencies + + + + + + + + Dependency Tree + + + + + + + + Used By + + + + + + + + Mailing Lists + <%-- POSTPONED to 1.0-alpha-2 + + + + + + + + + Reports + + --%> + + +
    + +
    + +
    + + +
    + + + + +
    diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/decorators/default.jsp b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/decorators/default.jsp new file mode 100644 index 000000000..41f165b70 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/decorators/default.jsp @@ -0,0 +1,200 @@ + + +<%-- + ~ 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. + --%> + +<%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator" prefix="decorator" %> +<%@ taglib uri="/webwork" prefix="ww" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@ taglib prefix="my" tagdir="/WEB-INF/tags" %> +<%@ taglib prefix="redback" uri="http://plexus.codehaus.org/redback/taglib-1.0" %> +<%@ page import="org.apache.maven.archiva.web.startup.ArchivaVersion" %> +<%@ page import="java.util.Calendar" %> + + + + Apache Archiva \ + <decorator:title default="Apache Archiva"/> + + + " type="text/css" media="all"/> + " type="text/css" media="all"/> + " type="text/css" media="all"/> + " type="text/css" media="all"/> + " type="text/css" media="print"/> + "/> + + + + + +" class="composite"> + + + + +
    + + +
    + +
    +
    + +
    +
    + +
    +
    +
    + +<% + int inceptionYear = 2005; + int currentYear = Calendar.getInstance().get( Calendar.YEAR ); + String copyrightRange = String.valueOf( inceptionYear ); + if ( inceptionYear != currentYear ) + { + copyrightRange = copyrightRange + "-" + String.valueOf( currentYear ); + } +%> + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/findArtifact.jsp b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/findArtifact.jsp new file mode 100644 index 000000000..c325c2286 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/findArtifact.jsp @@ -0,0 +1,106 @@ +<%-- + ~ 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. + --%> + +<%@ taglib prefix="ww" uri="/webwork" %> + + + + Find Artifact + + + + + +

    Find Artifact

    + +
    + +
    + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/generalError.jsp b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/generalError.jsp new file mode 100644 index 000000000..49a6c1abf --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/generalError.jsp @@ -0,0 +1,36 @@ +<%-- + ~ 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. + --%> + +<%@ taglib prefix="ww" uri="/webwork" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> + + + + Error Occurred + + + + + +

    Error Occurred

    + + + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/artifactDependencies.jspf b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/artifactDependencies.jspf new file mode 100644 index 000000000..cbafc9829 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/artifactDependencies.jspf @@ -0,0 +1,40 @@ +<%-- + ~ 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. + --%> + +<%@ taglib prefix="ww" uri="/webwork" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib prefix="my" tagdir="/WEB-INF/tags" %> + +<%-- TODO: paginate [MRM-491] --%> + +

    + + +

    + +

    + +

    +
    + + No results + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/artifactInfo.jspf b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/artifactInfo.jspf new file mode 100644 index 000000000..d15092665 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/artifactInfo.jspf @@ -0,0 +1,230 @@ +<%-- + ~ 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. + --%> + +<%@ taglib prefix="ww" uri="/webwork" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib prefix="archiva" uri="http://archiva.apache.org" %> + +

    + + + + + + + + + ${model.artifactId} / + ${version} + + <%-- TODO: new versions? + (Newer version available: + 2.0.3) + --%> +

    + + +
    ${model.description}
    +
    + + + + + + + + + + + + + + + + + + + + + + + <%-- TODO: derivatives + + + + + --%> + + + + + + + <%-- TODO: deployment timestamp + + + + + --%> + <%-- TODO: origin + + + + + --%> +
    Repository${repositoryId}
    Group ID${model.groupId}
    Artifact ID${model.artifactId}
    Version${model.version}
    Packaging${model.packaging}
    Derivatives + Source + | + Javadoc +
    Parent + ${model.parentProject.groupId} ${model.parentProject.artifactId} ${model.parentProject.version} + + + + + + + + (View) +
    Deployment Date + 15 Jan 2006, 20:38:00 +1000 +
    Origin + Apache Repository +
    + + +

    POM Dependency Snippet

    +
    +    <dependency>
    +      <groupId>${model.groupId}</groupId>
    +      <artifactId>${model.artifactId}</artifactId>     
    +      <version>${version}</version>
    +      <type>${model.packaging}</type>
    +    </dependency>
    +
    +
    + + + +

    Other Details

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    URL + ${model.url} +
    Organisation + + + ${model.organization.name} + + + ${model.organization.name} + + +
    License + + + ${license.name} + + + ${license.name} + + +
    Issue Tracker + + + ${model.issueManagement.system} + + + ${model.issueManagement.system} + + +
    Continuous Integration + + + ${model.ciManagement.system} + + + ${model.ciManagement.system} + + +
    +
    + + +

    SCM

    + + + + + + + + + + + + + + + + + + + +
    Connection + ${model.scm.connection} +
    Dev. Connection + ${model.scm.developerConnection} +
    Viewer + ${model.scm.url} +
    +
    + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/artifactReports.jspf b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/artifactReports.jspf new file mode 100644 index 000000000..e983a292d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/artifactReports.jspf @@ -0,0 +1,38 @@ +<%-- + ~ 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. + --%> + +<%@ taglib prefix="ww" uri="/webwork" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib prefix="my" tagdir="/WEB-INF/tags" %> + + +

    + ${report.groupId} : ${report.artifactId} : ${report.version} : ${report.classifier} : ${report.type} +

    +
      + +
    • + ${result.reason} +
    • +
      +
    +
    + + No reports for this artifact. + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/dependencyTree.jspf b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/dependencyTree.jspf new file mode 100644 index 000000000..0d63005aa --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/dependencyTree.jspf @@ -0,0 +1,31 @@ +<%-- + ~ 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. + --%> + +<%@ taglib prefix="ww" uri="/webwork" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib prefix="my" tagdir="/WEB-INF/tags" %> +<%@ taglib prefix="archiva" uri="http://archiva.apache.org" %> + + + + <%-- + + --%> + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/mailingLists.jspf b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/mailingLists.jspf new file mode 100644 index 000000000..949af7580 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/mailingLists.jspf @@ -0,0 +1,84 @@ +<%-- + ~ 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. + --%> + +<%@ taglib prefix="ww" uri="/webwork" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib prefix="my" tagdir="/WEB-INF/tags" %> + + +

    + ${mailingList.name} +

    + <%-- TODO: description +

    + Description blah blah blah +

    + --%> + +
    + + No mailing lists + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/projectDependees.jspf b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/projectDependees.jspf new file mode 100644 index 000000000..4287a26c9 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/projectDependees.jspf @@ -0,0 +1,39 @@ +<%-- + ~ 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. + --%> + +<%@ taglib prefix="ww" uri="/webwork" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib prefix="my" tagdir="/WEB-INF/tags" %> + +<%-- TODO: paginate [MRM-491] --%> + +

    + + +

    + +

    + +

    +
    + + No results + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/quickSearchForm.jspf b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/quickSearchForm.jspf new file mode 100644 index 000000000..14693aa87 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/quickSearchForm.jspf @@ -0,0 +1,40 @@ +<%-- + ~ 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. + --%> + +<%@ taglib prefix="ww" uri="/webwork" %> + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/uploadForm.jspf b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/uploadForm.jspf new file mode 100644 index 000000000..e44d0b162 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/uploadForm.jspf @@ -0,0 +1,36 @@ +<%-- + ~ 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. + --%> + +<%-- http://www.opensymphony.com/webwork/wikidocs/File%20Upload%20Interceptor.html --%> + +<%@ taglib prefix="ww" uri="/webwork" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> + + + + + + + + + + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/quickSearch.jsp b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/quickSearch.jsp new file mode 100644 index 000000000..690ea4f25 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/quickSearch.jsp @@ -0,0 +1,40 @@ +<%-- + ~ 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. + --%> + +<%@ taglib prefix="ww" uri="/webwork" %> + + + Quick Search + + + + +

    ${infoMessage}

    +
    + + + +

    Search

    + +
    + <%@ include file="/WEB-INF/jsp/include/quickSearchForm.jspf" %> +
    + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/reports/basicReport.jsp b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/reports/basicReport.jsp new file mode 100644 index 000000000..f6f16364f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/reports/basicReport.jsp @@ -0,0 +1,65 @@ +<%-- + ~ 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. + --%> + +<%@ taglib prefix="ww" uri="/webwork" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib prefix="archiva" uri="http://archiva.apache.org" %> + + + + Reports + + + + +

    Reports

    + +
    + + + + + Repository: ${repository.key} + + +

    + + + + + + + + ${report.artifactId} / + ${report.version} +

    + +
    ${report.message}
    +
    +
    + + + << + Page: ${page} + + >> + +
    + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/reports/blankReport.jsp b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/reports/blankReport.jsp new file mode 100644 index 000000000..14cf9a385 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/reports/blankReport.jsp @@ -0,0 +1,37 @@ +<%-- + ~ 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. + --%> + +<%@ taglib prefix="ww" uri="/webwork" %> + + + + Reports + + + + +

    Reports

    + +
    + + + +
    + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/reports/pickReport.jsp b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/reports/pickReport.jsp new file mode 100644 index 000000000..117db55eb --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/reports/pickReport.jsp @@ -0,0 +1,43 @@ +<%-- + ~ 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. + --%> + +<%@ taglib prefix="ww" uri="/webwork" %> + + + + Reports + + + + +

    Reports

    + +
    + + + + + + + + +
    + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/results.jsp b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/results.jsp new file mode 100644 index 000000000..685f24cfe --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/results.jsp @@ -0,0 +1,211 @@ +<%-- + ~ 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. + --%> + +<%@ taglib uri="/webwork" prefix="ww" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> +<%@ taglib prefix="my" tagdir="/WEB-INF/tags" %> + + + + Search Results + + + + + +

    Search

    + + + + + + +
    + + +

    Results

    + +
    + + + <%-- search was made from the indices --%> + + ${fn:length(results.hits) + (currentPage * results.limits.pageSize)} + + +

    Hits: ${(hitsNum - results.limits.pageSize) + 1} to ${hitsNum} of ${results.totalHits}

    +
    + +

    Hits: 1 to ${hitsNum} of ${results.totalHits}

    +
    +
    + + +

    No results

    +
    + + + <%-- Pagination start --%> +

    + <%-- Prev & Next icons --%> + + + + + + + + + + + + + + + + + + + + + + + + + <%-- Google-style pagination --%> + + + + + 0 + 10 + + + ${(totalPages -1) - 10} + ${totalPages - 1} + + + ${currentPage - 5} + ${currentPage + 5} + + + + + 0 + ${totalPages - 1} + + + + + + + + + + + + + + + ${i + 1} + + + ${i + 1} + + + + + + + + + + + + + + +

    + <%-- Pagination end --%> + + + + +

    + +

    +

    + +

    +
    + +

    + + ${record.urlFilename} +

    +
    +
    +
    +
    +
    +
    + + <%-- search was made from the database (find artifact)--%> + +

    Hits: ${fn:length(databaseResults)}

    + + + +

    No results

    +
    + + + + +

    + +

    +

    + +

    +
    + +

    + + ${artifactModel.repositoryId} +

    +
    +
    +
    +
    +
    + +
    +
    +
    +
    + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/showArtifact.jsp b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/showArtifact.jsp new file mode 100644 index 000000000..8960e1cba --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/showArtifact.jsp @@ -0,0 +1,166 @@ +<%-- + ~ 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. + --%> + +<%@ taglib prefix="ww" uri="/webwork" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib prefix="my" tagdir="/WEB-INF/tags" %> +<%@ taglib prefix="archiva" uri="http://archiva.apache.org" %> +<%@ taglib prefix="redback" uri="http://plexus.codehaus.org/redback/taglib-1.0" %> + + + + Browse Repository + + + + + + + + + + Maven Plugin + + + + POM + + <%-- These types aren't usually set in the POM yet, so we fudge them for the well known ones --%> + + + Maven Archetype + + + + Maven Skin + + <%-- Must be last so that the above get picked up if possible --%> + + + JAR + + + + + + +${packageName} + +

    + + + ${model.artifactId} + + + ${model.name} + + +

    + +
    +
    + + + + + + + + + Info + + + + + + + + Dependencies + + + + + + + + Dependency Tree + + + + + + + + Used By + + + + + + + + Mailing Lists + <%-- POSTPONED to 1.0-alpha-2 + + + + + + + + + Reports + + --%> + + +
    + +
    + +
    + + <%-- TODO: perhaps using ajax? --%> + <%-- TODO: panels? this is ugly as is --%> +
    + + + <%@ include file="/WEB-INF/jsp/include/artifactDependencies.jspf" %> + + + <%@ include file="/WEB-INF/jsp/include/dependencyTree.jspf" %> + + + <%@ include file="/WEB-INF/jsp/include/projectDependees.jspf" %> + + + <%@ include file="/WEB-INF/jsp/include/mailingLists.jspf" %> + + + <%@ include file="/WEB-INF/jsp/include/artifactReports.jspf" %> + + + <%@ include file="/WEB-INF/jsp/include/artifactInfo.jspf" %> + + +
    +
    + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/upload.jsp b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/upload.jsp new file mode 100644 index 000000000..c22bccc97 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/upload.jsp @@ -0,0 +1,46 @@ +<%-- + ~ 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. + --%> + +<%-- http://www.opensymphony.com/webwork/wikidocs/File%20Upload%20Interceptor.html --%> + +<%@ taglib prefix="ww" uri="/webwork" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> + + + + Upload Artifact + + + + +

    Upload Artifact

    + +
    + + + + + + <%@ include file="/WEB-INF/jsp/include/uploadForm.jspf" %> + + +
    + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/tags/currentWWUrl.tag b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/tags/currentWWUrl.tag new file mode 100644 index 000000000..d3e738b43 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/tags/currentWWUrl.tag @@ -0,0 +1,52 @@ +<%-- + ~ 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. + --%> + +<%@ taglib uri="/webwork" prefix="ww" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@ attribute name="action" %> +<%@ attribute name="namespace" %> +<%@ attribute name="url" %> + + + + + + + + + + + + + + + + + ${text} + + + + + + + ${text} + + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/tags/displayUpdatePolicy.tag b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/tags/displayUpdatePolicy.tag new file mode 100644 index 000000000..702d74d76 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/tags/displayUpdatePolicy.tag @@ -0,0 +1,41 @@ +<%-- + ~ 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. + --%> + +<%-- TODO: this could perhaps just be a i18n call --%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@ attribute name="policy" required="true" %> +<%@ attribute name="interval" %> + + + + Disabled + + + Updated every request + + + Updated hourly + + + Updated daily + + + Updated every ${interval} minutes + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/tags/showArtifactLink.tag b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/tags/showArtifactLink.tag new file mode 100644 index 000000000..b2289e52e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/tags/showArtifactLink.tag @@ -0,0 +1,80 @@ +<%-- + ~ 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. + --%> + +<%@ taglib prefix="ww" uri="/webwork" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@ taglib prefix="archiva" uri="http://archiva.apache.org" %> + +<%@ attribute name="groupId" required="true" %> +<%@ attribute name="artifactId" %> +<%@ attribute name="version" %> +<%@ attribute name="classifier" %> +<%@ attribute name="scope" %> +<%@ attribute name="versions" type="java.util.List" %> +<%@ attribute name="repositoryId" %> + + + ${repositoryId} + : + + + + + + + + + + ${artifactId} + + | Version(s): + + + + + + + + + + + + ${version} + + + + + + + + + + + ${v} + , + + + + + | Scope: ${scope} + + + | Classifier: ${classifier} + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/tags/showArtifactTitle.tag b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/tags/showArtifactTitle.tag new file mode 100644 index 000000000..f11c0ee02 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/tags/showArtifactTitle.tag @@ -0,0 +1,46 @@ +<%-- + ~ 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. + --%> + +<%@ taglib prefix="ww" uri="/webwork" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@ attribute name="groupId" required="true" %> +<%@ attribute name="artifactId" %> +<%@ attribute name="version" %> + + + + + + + + + + + + + + + + + + + + <%-- TODO: showing the name and description would be nice, but that would require loading the POMs --%> + ${artifactId} + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/web.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 000000000..b732fe8b5 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,123 @@ + + + + + + Apache Archiva + + + webwork-cleanup + com.opensymphony.webwork.dispatcher.ActionContextCleanUp + + + + sitemesh + com.opensymphony.module.sitemesh.filter.PageFilter + + + + webwork + com.opensymphony.webwork.dispatcher.FilterDispatcher + + + + + webwork-cleanup + /* + + + + sitemesh + /* + + + + webwork + /* + + + + org.springframework.web.context.ContextLoaderListener + + + + org.apache.maven.archiva.web.startup.ArchivaStartup + + + + contextClass + org.codehaus.plexus.spring.PlexusWebApplicationContext + + + + contextConfigLocation + + classpath*:META-INF/plexus/components.xml + classpath*:META-INF/spring-context.xml + /WEB-INF/classes/META-INF/plexus/application.xml + /WEB-INF/classes/META-INF/plexus/components.xml + /WEB-INF/applicationContext.xml + + + + + RepositoryServlet + org.apache.maven.archiva.webdav.RepositoryServlet + + 1 + + + + RssFeedServlet + org.apache.maven.archiva.web.rss.RssFeedServlet + + + + RssFeedServlet + /rss/rss_feeds + + + + RepositoryServlet + /repository/* + + + + jdbc/users + javax.sql.DataSource + Container + Shareable + + + jdbc/archiva + javax.sql.DataSource + Container + Shareable + + + mail/Session + javax.mail.Session + Container + Shareable + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/css/maven-base.css b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/css/maven-base.css new file mode 100644 index 000000000..ca951f8d0 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/css/maven-base.css @@ -0,0 +1,201 @@ +/* + * 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. + */ + +body { + margin: 0px; + padding: 0px; +} + +img { + border: none; +} + +table { + padding: 0px; + width: 100%; + margin-left: -2px; + margin-right: -2px; +} + +acronym { + cursor: help; + border-bottom: 1px dotted #feb; +} + +table.bodyTable th, table.bodyTable td { + padding: 2px 4px 2px 4px; + vertical-align: top; +} + +div.clear { + clear: both; + visibility: hidden; +} + +div.clear hr { + display: none; +} + +#bannerLeft, #bannerRight { + font-size: xx-large; + font-weight: bold; +} + +#bannerLeft img, #bannerRight img { + margin: 0px; +} + +.xleft, #bannerLeft img { + float: left; +} + +.xright, #bannerRight img { + float: right; +} + +#banner { + padding: 0px; +} + +#banner img { + border: none; +} + +#breadcrumbs { + padding: 3px 10px 3px 10px; +} + +#leftColumn { + width: 170px; + float: left; + overflow: auto; +} + +#bodyColumn { + margin-right: 1.5em; + margin-left: 197px; +} + +#legend { + padding: 8px 0 8px 0; +} + +#navcolumn { + padding: 8px 4px 0 8px; +} + +#navcolumn h5 { + margin: 0; + padding: 0; + font-size: small; +} + +#navcolumn ul { + margin: 0; + padding: 0; + font-size: small; +} + +#navcolumn li { + list-style-type: none; + background-image: none; + background-repeat: no-repeat; + background-position: 0 0.4em; + padding-left: 16px; + list-style-position: outside; + line-height: 1.2em; + font-size: smaller; +} + +#navcolumn li.expanded { + background-image: url( ../images/expanded.gif ); +} + +#navcolumn li.collapsed { + background-image: url( ../images/collapsed.gif ); +} + +#poweredBy { + text-align: center; +} + +#navcolumn img { + margin-top: 10px; + margin-bottom: 3px; +} + +#poweredBy img { + display: block; + margin: 20px 0 20px 17px; + border: 1px solid black; + width: 90px; + height: 30px; +} + +#search img { + margin: 0px; + display: block; +} + +#search #q, #search #btnG { + border: 1px solid #999; + margin-bottom: 10px; +} + +#search form { + margin: 0px; +} + +#lastPublished { + font-size: x-small; +} + +.navSection { + margin-bottom: 2px; + padding: 8px; +} + +.navSectionHead { + font-weight: bold; + font-size: x-small; +} + +.section { + padding: 4px; +} + +#footer { + padding: 3px 10px 3px 10px; + font-size: x-small; +} + +#breadcrumbs { + font-size: x-small; + margin: 0pt; +} + +.source { + padding: 12px; + margin: 1em 7px 1em 7px; +} + +.source pre { + margin: 0px; + padding: 0px; +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/css/maven-theme.css b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/css/maven-theme.css new file mode 100644 index 000000000..983e387b2 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/css/maven-theme.css @@ -0,0 +1,330 @@ +/* + * 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. + */ + +body { + padding: 0 0 10px 0; +} + +body, td, th, select, input, li { + font-family: Verdana, Helvetica, Arial, sans-serif; + font-size: 11pt; +} + +select, input { + font-size: 0.9em; + border: 1px solid #AAAAAA; +} + +select { + padding-left: 3px; + height: 1.4em; +} + +input { + padding: 2px; +} + +label .required { + color: red; + font-weight: bold; +} + +th { + text-align: right; + padding-right: 1em; + font-size: x-small; + vertical-align: top; +} + +.infoTable th { + width: 15em; +} + +#contentBox h1 { + background-image: url( ../images/arrow.gif ); + background-repeat: no-repeat; + background-position: left bottom; + border-bottom: 1px solid #DFDEDE; + padding: 0 0 1px 23px; + margin-bottom: 0.5em; + color: #333; + voice-family: inherit; + font-size: medium !important; +} + +#contentBox h2 { + border-bottom: 1px solid #DFDEDE; + padding: 0 0 1px 0; + margin-bottom: 0.5em; + color: #333; + voice-family: inherit; + font-size: small !important; +} + +#contentBox h3 { + border-bottom: 1px solid #DFDEDE; + padding: 0 0 1px 0; + margin-bottom: 0.5em; + color: #333; + voice-family: inherit; + font-size: small !important; + margin-left: 2em; +} + +table { + width: auto; +} + +code { + font-family: Courier, monospace; + font-size: 13px; +} + +#legend li.externalLink { + background: url( ../images/external.png ) left top no-repeat; + padding-left: 18px; +} + +a.externalLink, a.externalLink:link, a.externalLink:visited, a.externalLink:active, a.externalLink:hover { + background: url( ../images/external.png ) right center no-repeat; + padding-right: 18px; +} + +#legend li.newWindow { + background: url( ../images/newwindow.png ) left top no-repeat; + padding-left: 18px; +} + +a.newWindow, a.newWindow:link, a.newWindow:visited, a.newWindow:active, a.newWindow:hover { + background: url( ../images/newwindow.png ) right center no-repeat; + padding-right: 18px; +} + +p { + line-height: 1.3em; + font-size: small; +} + +#breadcrumbs { + border-top: 1px solid #fff; + border-bottom: 1px solid #999; + background-color: #F3B455; + padding: 2px 8px; +} + +#navcolumn h5 { + color: gray; + font-weight: bold; + font-size: 11px; + padding: 10px 0 1px 19px; +} + +.source { + border: 1px solid #999; +} + +dl { + padding: 4px 4px 4px 6px; + border: 1px solid #aaa; + background-color: #ffc; +} + +dt { + color: #900; +} + +#organizationLogo img, #projectLogo img, #projectLogo span { + margin: 8px; +} + +#banner { + border-bottom: 1px solid #fff; + padding: 8px; +} + +#breadcrumbs a:link { + text-decoration: none; +} + +#breadcrumbs a:visited { + text-decoration: none; + color: #333 +} + +#breadcrumbs a:hover { + text-decoration: none; + color: white +} + +.errormark, .warningmark, .donemark, .infomark { + background: url( ../images/icon_error_sml.gif ) no-repeat; +} + +.warningmark { + background-image: url( ../images/icon_warning_sml.gif ); +} + +.donemark { + background-image: url( ../images/icon_success_sml.gif ); +} + +.infomark { + background-image: url( ../images/icon_info_sml.gif ); +} + +.booleanIcon { + padding-left: 20px; + height: 20px; +} + +pre.pom { + font-size: 0.9em; + border: 1px solid #ddddff; + background-color: #f8f8ff; + padding: 5px; +} + +pre.pom code { + font-size: 0.9em; +} + +#leftColumn { + padding: 4px 4px 4px 4px; + overflow: hidden; +} + +#navcolumn { + padding: 6px 0 0 2px; +} + +#navcolumn li { + font-size: 9px; + text-indent: 19px; + line-height: 24px; + height: 25px; + width: 161px; + background-image: url( ../images/super.gif ); + background-position: 0 0; + background-repeat: no-repeat; + display: block; + padding-left: 0; +} + +#navcolumn li li { + padding-left: 16px; + background: none; + display: block; +} + +#navcolumn li li a:hover { + color: black !important; + background: none; + display: block; +} + +#navcolumn li li a:active { + color: red !important; + background: none; + display: block; +} + +#navcolumn li.collapsed { + background-image: url( ../images/super.gif ); +} + +#navcolumn li.expanded { + background-image: url( ../images/super.gif ); + height: inherit; +} + +#navcolumn li a:link { + color: #666; + display: block; +} + +#navcolumn li a:hover { + color: #fff !important; + background: url( ../images/super_hl.gif ) 0 -25px no-repeat; + display: block; +} + +#navcolumn li a:active { + color: #fff !important; + background: url( ../images/super_hl.gif ) 0 -50px no-repeat; + display: block; +} + +#navcolumn li a:visited { + color: #666; + display: block; +} + +#navcolumn li ul li { + color: #333 !important; + text-indent: 30px !important; + line-height: 20px !important; + height: 20px !important; + background-image: url( ../images/supersub.gif ) !important; + font-size: 9px; + width: 161px; + background-repeat: no-repeat; + display: block; + padding-left: 0; +} + +#navcolumn li ul li a:hover { + color: #fff !important; + background: url( ../images/super_hl_sub.gif ) 0 -20px no-repeat; + background-position: right; + width: 161px; + display: block; +} + +#footer { + background: url( ../images/footerborder.gif ) 0 5px repeat-x; + padding: 14px 4px 12px 4px; + margin-top: 2em; +} + +a:link, a:visited { + color: #333; +} + +#navcolumn a { + text-decoration: none; +} + +a:active, a:hover { + color: #f30; +} + +blockquote { + border-left: 1px solid #DFDEDE; + padding-left: 1em; +} + +.missing { + background-color: red; + color: white; + font-weight: bold; + padding: 4px; + margin-left: 20px; + margin-right: 20px; + +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/css/print.css b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/css/print.css new file mode 100644 index 000000000..7f9db33dc --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/css/print.css @@ -0,0 +1,27 @@ +/* + * 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. + */ + +#banner, #footer, #leftcol, #breadcrumbs, .docs #toc, .docs .courtesylinks, #leftColumn, #navColumn { + display: none !important; +} + +#bodyColumn, body.docs div.docs { + margin: 0 !important; + border: none !important +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/css/site.css b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/css/site.css new file mode 100644 index 000000000..114580c0f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/css/site.css @@ -0,0 +1,419 @@ +/* + * 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. + */ +.sidebar3 { + width: 10em; + float: right; + text-align: center; +} + +#sidebarb { + font-size: small; + text-align: center; + padding: 10px 10px 10px 10px; + border: 1px #DFDEDE solid; + width: 10em; +} + +#sidebar { + float: right; + font-size: small; + margin: 10px; + padding: 10px; + border: 1px #DFDEDE solid; + width: 10em; +} + +.download { + float: right; + font-size: small; + font-weight: bold; + margin: 15px auto 0px auto; + height: auto; + width: 150px; + min-width: 120px; + display: block; +} + +.download .hd .c, +.download .ft .c { + font-size: 1px; /* ensure minimum height */ + height: 10px; +} + +.download .ft .c { + height: 10px; +} + +.download .hd { + background: transparent url(../images/download.tl.gif) no-repeat 0px 0px; +} + +.download .hd .c { + background: transparent url(../images/download.tr.gif) no-repeat right 0px; +} + +.download .bd { + background: transparent url(../images/download.ml.gif) repeat-y 0px 0px; +} + +.download .bd .c { + background: transparent url(../images/download.mr.gif) repeat-y right 0px; +} + +.download .bd .c .s { + margin: 0px 8px 0px 4px; + background: #000 url(../images/download.ms.jpg) repeat-x 0px 0px; + padding: 1em; +} + +.download .ft { + background: transparent url(../images/download.bl.gif) no-repeat 0px 0px; +} + +.download .ft .c { + background: transparent url(../images/download.br.gif) no-repeat right 0px; +} + +.download .bd h2 { + margin: 0px; + text-align: center; + border-bottom-width: 0px !important; +} + +.download .bd p { + margin: 0px; + border: 0px; + text-align: left; + padding-left: 0px; +} + +.download a { + text-decoration: none; +} + +.download p.body { + font-weight: bold; +} + +.download table { + margin-left: 2px; + width: 140px; +} + +.download .icon { + width: 16px; +} + +.download .type { + font-size: 0.9em; + text-align: center; +} + +.download .size { + font-weight: normal; + font-size: 0.8em; + text-align: right; +} + +#contentArea { + /* margin-right: 15em; */ + padding: 1em; +} + +#tabs b { + border: 1px #DFDEDE solid; + padding-left: 1em; + padding-right: 1em; +} + +#tabs a { + border: 1px #DFDEDE solid; + padding-left: 1em; + padding-right: 1em; + text-decoration: none; +} + +#tabArea { + border-top: 1px solid #DFDEDE; + padding: 1em; +} + +#searchTypes { + text-align: right; + font-size: xx-small; +} + +.statusFailed { + color: red; + font-weight: bold; +} + +/* WebWork validation failures */ +.errorMessage { + color: red; + font-weight: bold; +} + +.actionMessage { + font-size: 1.0em; + font-weight: bold; + color: blue; +} + +.errorBullet { + list-style-image: url( "../images/icon_error_sml.gif" ); +} + +.warningBullet { + list-style-image: url( "../images/icon_warning_sml.gif" ); +} + +.infoBullet { + list-style-image: url( "../images/icon_info_sml.gif" ); +} + +.artifact-link { + font-size: x-small; + padding-left: 5em; +} + +.artifact-title { + +} + +ul.dependencyTree { + margin-left: 50px; +} + +ul.dependencyTree span.artifact-link { + padding-left: 0px; +} + +.eXtremeTable tr.filter { + padding: 1px; +} + +.eXtremeTable .tableRegion,.eXtremeTable .statusBar { + width: 100%; +} + +.eXtremeTable .tableRegion .tableHeader { + background-color: #F3B455; +} + +.eXtremeTable .tableRegion .tableHeaderSort { + background-color: #FFBF5F; +} + +.eXtremeTable .compactToolbar td { + white-space: nowrap; +} + +.tools { + border-color: gray !important; +} + +.tools .toolHeading { + padding: 0px 3px 0px 3px; + margin: 0px !important; + font-size: 11px !important; + background-color: #F3B455 !important; +} + +div.repository h3 { + border-bottom: 0px !important; + padding-left: 15px !important; +} + +div.repository { + border-bottom: 1px solid #DFDEDE; +} + +div.proxyConfig, +div.repoGroup { + border: 1px dashed #DFDEDE; + margin-bottom: 15px; + padding: 5px; +} + +div.proxyConfig div.managedRepo, +div.proxyConfig div.remoteRepo, +div.repoGroup div.managedRepo { + border: 1px dotted gray; + padding: 5px; + background-color: white; +} + +div.proxyConfig div.remoteRepo { + margin: 5px; +} + +div.proxyConfig div.managedRepo img, +div.proxyConfig div.remoteRepo img, +div.repoGroup div.managedRepo img { + float: left; + border: 0px; +} + +div.proxyConfig div.managedRepo p, +div.proxyConfig div.remoteRepo p { + margin: 0px; + margin-left: 40px; + padding: 0px; +} + +div.repoGroup div.managedRepo p { + margin: 8px; + margin-left: 40px; + padding: 0px; +} + +div.proxyConfig div.managedRepo p.id, +div.proxyConfig div.remoteRepo p.id, +div.repoGroup div.managedRepo p.id { + font-family: monospace; +} + +div.proxyConfig div.connector, +div.repoGroup div.connector { + border: 1px solid #aaaaff; + margin-top: 10px; + margin-left: 40px !important; +} + +div.proxyConfig a.expand { + font-size: 7pt; + color: gray; +} + +div.proxyConfig div.controls, +div.repoGroup div.controls { + float: right; +} + +div.proxyConfig div.connector h4, +div.repoGroup div.connector h4 { + padding: 3px; + font-size: 8pt; + margin: 0px; +} + +div.proxyConfig div.connector table.settings { + border: 0px; + background-color: transparent; + font-size: 8pt; + margin-left: 10px; +} + +div.proxyConfig div.connector table.settings th, +div.proxyConfig div.connector table.settings td { + font-size: 8pt; +} + +div.proxyConfig div.connector table.settings table.policies { + border: 1px dotted gray; +} + +div.proxyConfig div.connector table p { + margin: 0px; + padding: 0px; +} + +div.repoGroup div.repos { + text-align: right; + padding: 4px 0px 0px 0px; +} + +div.admin div.dark, +div.admin div.lite { + border: 1px solid #aaaaaa; + font-size: 11pt; + margin-left: 15px; + margin-right: 15px; + margin-bottom: 5px; + padding: 5px; +} + +div.admin div.lite { + background-color: white; +} + +div.admin div.dark { + background-color: #eeeeee; +} + +div.admin div.controls { + float: right; + font-size: 8pt !important; +} + +div.admin div.filetype table { + margin-left: 25px; + border: 1px solid gray; +} + +div.filetype table td.controls { + width: 5%; +} + +div.filetype table td.odd, +div.admin table.consumers td.odd { + background-color: #dddddd; +} + +div.filetype table td.even, +div.admin table.consumers td.even { + background-color: white; +} + +div.admin table.consumers { + margin-left: 15px; + border: 1px solid gray; +} + +div.admin table.consumers th { + font-size: 1.0em; + background-color: #cccccc; + text-align: left; +} + +div.admin table.consumers td strong { + font-size: 0.8em; +} + +div.warningbox { + margin: 20px 40px 20px 40px; + border: 1px solid #CC0000; + background-color: #FFCCCC; + color: #000000; + font-size: 15pt; + padding: 20px; +} + +div.infobox { + margin: 20px 40px 20px 40px; + border: 1px solid #0000CC; + background-color: #EEEEFF; + font-size: 9pt; + padding: 20px; +} + +div.buttons { + text-align: center; +} \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/favicon.ico b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/favicon.ico new file mode 100644 index 000000000..06714d34a Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/favicon.ico differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/archetype.gif b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/archetype.gif new file mode 100755 index 000000000..fc84feff5 Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/archetype.gif differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/archiva-splat-32.gif b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/archiva-splat-32.gif new file mode 100644 index 000000000..8625d2311 Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/archiva-splat-32.gif differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/archiva-world.png b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/archiva-world.png new file mode 100644 index 000000000..8afb6cc93 Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/archiva-world.png differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/archiva.png b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/archiva.png new file mode 100644 index 000000000..a1e638175 Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/archiva.png differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/arrow.gif b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/arrow.gif new file mode 100755 index 000000000..ce00e3d0c Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/arrow.gif differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/collapsed.gif b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/collapsed.gif new file mode 100644 index 000000000..6e7108406 Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/collapsed.gif differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/dl.gif b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/dl.gif new file mode 100755 index 000000000..710e7b848 Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/dl.gif differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/download-type-jar.png b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/download-type-jar.png new file mode 100644 index 000000000..146e1fd8f Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/download-type-jar.png differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/download-type-java-source.png b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/download-type-java-source.png new file mode 100644 index 000000000..9660957eb Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/download-type-java-source.png differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/download-type-pom.png b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/download-type-pom.png new file mode 100644 index 000000000..d0e4c12bf Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/download-type-pom.png differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/download.bl.gif b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/download.bl.gif new file mode 100644 index 000000000..c59ba0062 Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/download.bl.gif differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/download.br.gif b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/download.br.gif new file mode 100644 index 000000000..d80f62ee8 Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/download.br.gif differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/download.ml.gif b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/download.ml.gif new file mode 100644 index 000000000..8fcfa4220 Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/download.ml.gif differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/download.mr.gif b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/download.mr.gif new file mode 100644 index 000000000..ded125be9 Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/download.mr.gif differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/download.tl.gif b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/download.tl.gif new file mode 100644 index 000000000..b4a8e97d3 Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/download.tl.gif differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/download.tr.gif b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/download.tr.gif new file mode 100644 index 000000000..07aeccee5 Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/download.tr.gif differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/expanded.gif b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/expanded.gif new file mode 100644 index 000000000..0fef3d89e Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/expanded.gif differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/external.png b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/external.png new file mode 100644 index 000000000..3f999fc88 Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/external.png differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/footerborder.gif b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/footerborder.gif new file mode 100644 index 000000000..958ce7ae3 Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/footerborder.gif differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icon_error_sml.gif b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icon_error_sml.gif new file mode 100644 index 000000000..61132ef2b Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icon_error_sml.gif differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icon_info_sml.gif b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icon_info_sml.gif new file mode 100644 index 000000000..c6cb9ad7c Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icon_info_sml.gif differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icon_next_page.gif b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icon_next_page.gif new file mode 100644 index 000000000..7c5b30758 Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icon_next_page.gif differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icon_next_page_disabled.gif b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icon_next_page_disabled.gif new file mode 100644 index 000000000..99c292f62 Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icon_next_page_disabled.gif differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icon_prev_page.gif b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icon_prev_page.gif new file mode 100644 index 000000000..a051fa1f3 Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icon_prev_page.gif differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icon_prev_page_disabled.gif b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icon_prev_page_disabled.gif new file mode 100644 index 000000000..79c241b37 Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icon_prev_page_disabled.gif differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icon_success_sml.gif b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icon_success_sml.gif new file mode 100644 index 000000000..52e85a430 Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icon_success_sml.gif differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icon_warning_sml.gif b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icon_warning_sml.gif new file mode 100644 index 000000000..873bbb52c Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icon_warning_sml.gif differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icons/arrow-down.png b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icons/arrow-down.png new file mode 100644 index 000000000..7ced90cd2 Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icons/arrow-down.png differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icons/arrow-left.png b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icons/arrow-left.png new file mode 100644 index 000000000..9e37b4128 Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icons/arrow-left.png differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icons/arrow-right.png b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icons/arrow-right.png new file mode 100644 index 000000000..00a443dbe Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icons/arrow-right.png differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icons/arrow-up.png b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icons/arrow-up.png new file mode 100644 index 000000000..310c61728 Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icons/arrow-up.png differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icons/box.png b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icons/box.png new file mode 100644 index 000000000..4d62e48ec Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icons/box.png differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icons/create.png b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icons/create.png new file mode 100644 index 000000000..24a84bb49 Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icons/create.png differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icons/delete.gif b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icons/delete.gif new file mode 100644 index 000000000..b6922ac11 Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icons/delete.gif differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icons/down.gif b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icons/down.gif new file mode 100644 index 000000000..9561bbe2a Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icons/down.gif differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icons/edit.png b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icons/edit.png new file mode 100644 index 000000000..5ea781e6d Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icons/edit.png differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icons/rss-feed.png b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icons/rss-feed.png new file mode 100644 index 000000000..6652d3e57 Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icons/rss-feed.png differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icons/security-key.png b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icons/security-key.png new file mode 100644 index 000000000..e66758a83 Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icons/security-key.png differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icons/security-lock.png b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icons/security-lock.png new file mode 100644 index 000000000..be4d4da03 Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icons/security-lock.png differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icons/up.gif b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icons/up.gif new file mode 100644 index 000000000..61942d6d1 Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icons/up.gif differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icons/user.png b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icons/user.png new file mode 100644 index 000000000..7f4c6d739 Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/icons/user.png differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/jar.gif b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/jar.gif new file mode 100755 index 000000000..63dcb611a Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/jar.gif differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/mavenplugin.gif b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/mavenplugin.gif new file mode 100755 index 000000000..4e335e3f2 Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/mavenplugin.gif differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/newwindow.png b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/newwindow.png new file mode 100644 index 000000000..6287f72bd Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/newwindow.png differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/other.gif b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/other.gif new file mode 100755 index 000000000..9b01e3e2c Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/other.gif differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/pom.gif b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/pom.gif new file mode 100755 index 000000000..b6efdc34c Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/pom.gif differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/skin.gif b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/skin.gif new file mode 100755 index 000000000..64ff878eb Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/skin.gif differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/super.gif b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/super.gif new file mode 100644 index 000000000..c8ee24344 Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/super.gif differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/super_hl.gif b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/super_hl.gif new file mode 100644 index 000000000..d90b8f0f8 Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/super_hl.gif differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/super_hl_sub.gif b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/super_hl_sub.gif new file mode 100755 index 000000000..0b35f7a26 Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/super_hl_sub.gif differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/supersub.gif b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/supersub.gif new file mode 100755 index 000000000..3f28dbce5 Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/supersub.gif differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/index.jsp b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/index.jsp new file mode 100644 index 000000000..77a2bd6a9 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/index.jsp @@ -0,0 +1,20 @@ +<%-- + ~ 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. + --%> + +<%response.sendRedirect( request.getContextPath() + "/index.action" );%> \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/scriptaculous/builder.js b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/scriptaculous/builder.js new file mode 100644 index 000000000..b7466ad83 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/scriptaculous/builder.js @@ -0,0 +1,160 @@ +/* + * 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. + */ + +// script.aculo.us builder.js v1.6.4, Wed Sep 06 11:30:58 CEST 2006 + +// Copyright (c) 2005 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) +// +// See scriptaculous.js for full license. + +var Builder = { + NODEMAP: { + AREA: 'map', + CAPTION: 'table', + COL: 'table', + COLGROUP: 'table', + LEGEND: 'fieldset', + OPTGROUP: 'select', + OPTION: 'select', + PARAM: 'object', + TBODY: 'table', + TD: 'table', + TFOOT: 'table', + TH: 'table', + THEAD: 'table', + TR: 'table' + }, +// note: For Firefox < 1.5, OPTION and OPTGROUP tags are currently broken, +// due to a Firefox bug + node: function( elementName ) + { + elementName = elementName.toUpperCase(); + + // try innerHTML approach + var parentTag = this.NODEMAP[elementName] || 'div'; + var parentElement = document.createElement(parentTag); + try + { // prevent IE "feature": http://dev.rubyonrails.org/ticket/2707 + parentElement.innerHTML = "<" + elementName + ">"; + } + catch( e ) + { + } + var element = parentElement.firstChild || null; + + // see if browser added wrapping tags + if ( element && (element.tagName != elementName) ) + element = element.getElementsByTagName(elementName)[0]; + + // fallback to createElement approach + if ( !element ) element = document.createElement(elementName); + + // abort if nothing could be created + if ( !element ) return; + + // attributes (or text) + if ( arguments[1] ) + if ( this._isStringOrNumber(arguments[1]) || (arguments[1] instanceof Array) ) + { + this._children(element, arguments[1]); + } + else + { + var attrs = this._attributes(arguments[1]); + if ( attrs.length ) + { + try + { // prevent IE "feature": http://dev.rubyonrails.org/ticket/2707 + parentElement.innerHTML = "<" + elementName + " " + attrs + ">"; + } + catch( e ) + { + } + element = parentElement.firstChild || null; + // workaround firefox 1.0.X bug + if ( !element ) + { + element = document.createElement(elementName); + for ( attr in arguments[1] ) + element[attr == 'class' ? 'className' : attr] = arguments[1][attr]; + } + if ( element.tagName != elementName ) + element = parentElement.getElementsByTagName(elementName)[0]; + } + } + + // text, or array of children + if ( arguments[2] ) + this._children(element, arguments[2]); + + return element; + }, + _text: function( text ) + { + return document.createTextNode(text); + }, + _attributes: function( attributes ) + { + var attrs = []; + for ( attribute in attributes ) + attrs.push((attribute == 'className' ? 'class' : attribute) + '="' + + attributes[attribute].toString().escapeHTML() + '"'); + return attrs.join(" "); + }, + _children: function( element, children ) + { + if ( typeof children == 'object' ) + { // array can hold nodes and text + children.flatten().each(function( e ) + { + if ( typeof e == 'object' ) + element.appendChild(e) + else + if ( Builder._isStringOrNumber(e) ) + element.appendChild(Builder._text(e)); + }); + } + else + if ( Builder._isStringOrNumber(children) ) + element.appendChild(Builder._text(children)); + }, + _isStringOrNumber: function( param ) + { + return(typeof param == 'string' || typeof param == 'number'); + }, + dump: function( scope ) + { + if ( typeof scope != 'object' && typeof scope != 'function' ) scope = window; //global scope + + var tags = ("A ABBR ACRONYM ADDRESS APPLET AREA B BASE BASEFONT BDO BIG BLOCKQUOTE BODY " + + "BR BUTTON CAPTION CENTER CITE CODE COL COLGROUP DD DEL DFN DIR DIV DL DT EM FIELDSET " + + "FONT FORM FRAME FRAMESET H1 H2 H3 H4 H5 H6 HEAD HR HTML I IFRAME IMG INPUT INS ISINDEX " + + "KBD LABEL LEGEND LI LINK MAP MENU META NOFRAMES NOSCRIPT OBJECT OL OPTGROUP OPTION P " + + "PARAM PRE Q S SAMP SCRIPT SELECT SMALL SPAN STRIKE STRONG STYLE SUB SUP TABLE TBODY TD " + + "TEXTAREA TFOOT TH THEAD TITLE TR TT U UL VAR").split(/\s+/); + + tags.each(function( tag ) + { + scope[tag] = function() + { + return Builder.node.apply(Builder, [tag].concat($A(arguments))); + } + }); + } +} \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/scriptaculous/controls.js b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/scriptaculous/controls.js new file mode 100644 index 000000000..8920d9375 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/scriptaculous/controls.js @@ -0,0 +1,969 @@ +/* + * 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. + */ + +// script.aculo.us controls.js v1.6.4, Wed Sep 06 11:30:58 CEST 2006 + +// Copyright (c) 2005 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) +// (c) 2005 Ivan Krstic (http://blogs.law.harvard.edu/ivan) +// (c) 2005 Jon Tirsen (http://www.tirsen.com) +// Contributors: +// Richard Livsey +// Rahul Bhargava +// Rob Wills +// +// See scriptaculous.js for full license. + +// Autocompleter.Base handles all the autocompletion functionality +// that's independent of the data source for autocompletion. This +// includes drawing the autocompletion menu, observing keyboard +// and mouse events, and similar. +// +// Specific autocompleters need to provide, at the very least, +// a getUpdatedChoices function that will be invoked every time +// the text inside the monitored textbox changes. This method +// should get the text for which to provide autocompletion by +// invoking this.getToken(), NOT by directly accessing +// this.element.value. This is to allow incremental tokenized +// autocompletion. Specific auto-completion logic (AJAX, etc) +// belongs in getUpdatedChoices. +// +// Tokenized incremental autocompletion is enabled automatically +// when an autocompleter is instantiated with the 'tokens' option +// in the options parameter, e.g.: +// new Ajax.Autocompleter('id','upd', '/url/', { tokens: ',' }); +// will incrementally autocomplete with a comma as the token. +// Additionally, ',' in the above example can be replaced with +// a token array, e.g. { tokens: [',', '\n'] } which +// enables autocompletion on multiple tokens. This is most +// useful when one of the tokens is \n (a newline), as it +// allows smart autocompletion after linebreaks. + +if ( typeof Effect == 'undefined' ) + throw("controls.js requires including script.aculo.us' effects.js library"); + +var Autocompleter = {} +Autocompleter.Base = function() +{ +}; +Autocompleter.Base.prototype = { + baseInitialize: function( element, update, options ) + { + this.element = $(element); + this.update = $(update); + this.hasFocus = false; + this.changed = false; + this.active = false; + this.index = 0; + this.entryCount = 0; + + if ( this.setOptions ) + this.setOptions(options); + else + this.options = options || {}; + + this.options.paramName = this.options.paramName || this.element.name; + this.options.tokens = this.options.tokens || []; + this.options.frequency = this.options.frequency || 0.4; + this.options.minChars = this.options.minChars || 1; + this.options.onShow = this.options.onShow || function( element, update ) + { + if ( !update.style.position || update.style.position == 'absolute' ) + { + update.style.position = 'absolute'; + Position.clone(element, update, { + setHeight: false, + offsetTop: element.offsetHeight + }); + } + Effect.Appear(update, {duration:0.15}); + }; + this.options.onHide = this.options.onHide || function( element, update ) + { + new Effect.Fade(update, {duration:0.15}) + }; + + if ( typeof(this.options.tokens) == 'string' ) + this.options.tokens = new Array(this.options.tokens); + + this.observer = null; + + this.element.setAttribute('autocomplete', 'off'); + + Element.hide(this.update); + + Event.observe(this.element, "blur", this.onBlur.bindAsEventListener(this)); + Event.observe(this.element, "keypress", this.onKeyPress.bindAsEventListener(this)); + }, + + show: function() + { + if ( Element.getStyle(this.update, 'display') == 'none' ) this.options.onShow(this.element, this.update); + if ( !this.iefix && (navigator.appVersion.indexOf('MSIE') > 0) && (navigator.userAgent.indexOf('Opera') < 0) && + (Element.getStyle(this.update, 'position') == 'absolute') ) + { + new Insertion.After(this.update, ''); + this.iefix = $(this.update.id + '_iefix'); + } + if ( this.iefix ) setTimeout(this.fixIEOverlapping.bind(this), 50); + }, + + fixIEOverlapping: function() + { + Position.clone(this.update, this.iefix, {setTop:(!this.update.style.height)}); + this.iefix.style.zIndex = 1; + this.update.style.zIndex = 2; + Element.show(this.iefix); + }, + + hide: function() + { + this.stopIndicator(); + if ( Element.getStyle(this.update, 'display') != 'none' ) this.options.onHide(this.element, this.update); + if ( this.iefix ) Element.hide(this.iefix); + }, + + startIndicator: function() + { + if ( this.options.indicator ) Element.show(this.options.indicator); + }, + + stopIndicator: function() + { + if ( this.options.indicator ) Element.hide(this.options.indicator); + }, + + onKeyPress: function( event ) + { + if ( this.active ) + switch ( event.keyCode ) + { + case Event.KEY_TAB: + case Event.KEY_RETURN: + this.selectEntry(); + Event.stop(event); + case Event.KEY_ESC: + this.hide(); + this.active = false; + Event.stop(event); + return; + case Event.KEY_LEFT: + case Event.KEY_RIGHT: + return; + case Event.KEY_UP: + this.markPrevious(); + this.render(); + if ( navigator.appVersion.indexOf('AppleWebKit') > 0 ) Event.stop(event); + return; + case Event.KEY_DOWN: + this.markNext(); + this.render(); + if ( navigator.appVersion.indexOf('AppleWebKit') > 0 ) Event.stop(event); + return; + } + else + if ( event.keyCode == Event.KEY_TAB || event.keyCode == Event.KEY_RETURN || + (navigator.appVersion.indexOf('AppleWebKit') > 0 && event.keyCode == 0) ) return; + + this.changed = true; + this.hasFocus = true; + + if ( this.observer ) clearTimeout(this.observer); + this.observer = setTimeout(this.onObserverEvent.bind(this), this.options.frequency * 1000); + }, + + activate: function() + { + this.changed = false; + this.hasFocus = true; + this.getUpdatedChoices(); + }, + + onHover: function( event ) + { + var element = Event.findElement(event, 'LI'); + if ( this.index != element.autocompleteIndex ) + { + this.index = element.autocompleteIndex; + this.render(); + } + Event.stop(event); + }, + + onClick: function( event ) + { + var element = Event.findElement(event, 'LI'); + this.index = element.autocompleteIndex; + this.selectEntry(); + this.hide(); + }, + + onBlur: function( event ) + { + // needed to make click events working + setTimeout(this.hide.bind(this), 250); + this.hasFocus = false; + this.active = false; + }, + + render: function() + { + if ( this.entryCount > 0 ) + { + for ( var i = 0; i < this.entryCount; i++ ) + this.index == i ? Element.addClassName(this.getEntry(i), "selected") + : Element.removeClassName(this.getEntry(i), "selected"); + + if ( this.hasFocus ) + { + this.show(); + this.active = true; + } + } + else + { + this.active = false; + this.hide(); + } + }, + + markPrevious: function() + { + if ( this.index > 0 ) this.index-- + else this.index = this.entryCount - 1; + this.getEntry(this.index).scrollIntoView(true); + }, + + markNext: function() + { + if ( this.index < this.entryCount - 1 ) this.index++ + else this.index = 0; + this.getEntry(this.index).scrollIntoView(false); + }, + + getEntry: function( index ) + { + return this.update.firstChild.childNodes[index]; + }, + + getCurrentEntry: function() + { + return this.getEntry(this.index); + }, + + selectEntry: function() + { + this.active = false; + this.updateElement(this.getCurrentEntry()); + }, + + updateElement: function( selectedElement ) + { + if ( this.options.updateElement ) + { + this.options.updateElement(selectedElement); + return; + } + var value = ''; + if ( this.options.select ) + { + var nodes = document.getElementsByClassName(this.options.select, selectedElement) || []; + if ( nodes.length > 0 ) value = Element.collectTextNodes(nodes[0], this.options.select); + } + else + value = Element.collectTextNodesIgnoreClass(selectedElement, 'informal'); + + var lastTokenPos = this.findLastToken(); + if ( lastTokenPos != -1 ) + { + var newValue = this.element.value.substr(0, lastTokenPos + 1); + var whitespace = this.element.value.substr(lastTokenPos + 1).match(/^\s+/); + if ( whitespace ) + newValue += whitespace[0]; + this.element.value = newValue + value; + } + else + { + this.element.value = value; + } + this.element.focus(); + + if ( this.options.afterUpdateElement ) + this.options.afterUpdateElement(this.element, selectedElement); + }, + + updateChoices: function( choices ) + { + if ( !this.changed && this.hasFocus ) + { + this.update.innerHTML = choices; + Element.cleanWhitespace(this.update); + Element.cleanWhitespace(this.update.firstChild); + + if ( this.update.firstChild && this.update.firstChild.childNodes ) + { + this.entryCount = this.update.firstChild.childNodes.length; + for ( var i = 0; i < this.entryCount; i++ ) + { + var entry = this.getEntry(i); + entry.autocompleteIndex = i; + this.addObservers(entry); + } + } + else + { + this.entryCount = 0; + } + + this.stopIndicator(); + this.index = 0; + + if ( this.entryCount == 1 && this.options.autoSelect ) + { + this.selectEntry(); + this.hide(); + } + else + { + this.render(); + } + } + }, + + addObservers: function( element ) + { + Event.observe(element, "mouseover", this.onHover.bindAsEventListener(this)); + Event.observe(element, "click", this.onClick.bindAsEventListener(this)); + }, + + onObserverEvent: function() + { + this.changed = false; + if ( this.getToken().length >= this.options.minChars ) + { + this.startIndicator(); + this.getUpdatedChoices(); + } + else + { + this.active = false; + this.hide(); + } + }, + + getToken: function() + { + var tokenPos = this.findLastToken(); + if ( tokenPos != -1 ) + var ret = this.element.value.substr(tokenPos + 1).replace(/^\s+/, '').replace(/\s+$/, ''); + else + var ret = this.element.value; + + return /\n/.test(ret) ? '' : ret; + }, + + findLastToken: function() + { + var lastTokenPos = -1; + + for ( var i = 0; i < this.options.tokens.length; i++ ) + { + var thisTokenPos = this.element.value.lastIndexOf(this.options.tokens[i]); + if ( thisTokenPos > lastTokenPos ) + lastTokenPos = thisTokenPos; + } + return lastTokenPos; + } +} + +Ajax.Autocompleter = Class.create(); +Object.extend(Object.extend(Ajax.Autocompleter.prototype, Autocompleter.Base.prototype), { + initialize: function( element, update, url, options ) + { + this.baseInitialize(element, update, options); + this.options.asynchronous = true; + this.options.onComplete = this.onComplete.bind(this); + this.options.defaultParams = this.options.parameters || null; + this.url = url; + }, + + getUpdatedChoices: function() + { + entry = encodeURIComponent(this.options.paramName) + '=' + encodeURIComponent(this.getToken()); + + this.options.parameters = this.options.callback ? this.options.callback(this.element, entry) : entry; + + if ( this.options.defaultParams ) + this.options.parameters += '&' + this.options.defaultParams; + + new Ajax.Request(this.url, this.options); + }, + + onComplete: function( request ) + { + this.updateChoices(request.responseText); + } + +}); + +// The local array autocompleter. Used when you'd prefer to +// inject an array of autocompletion options into the page, rather +// than sending out Ajax queries, which can be quite slow sometimes. +// +// The constructor takes four parameters. The first two are, as usual, +// the id of the monitored textbox, and id of the autocompletion menu. +// The third is the array you want to autocomplete from, and the fourth +// is the options block. +// +// Extra local autocompletion options: +// - choices - How many autocompletion choices to offer +// +// - partialSearch - If false, the autocompleter will match entered +// text only at the beginning of strings in the +// autocomplete array. Defaults to true, which will +// match text at the beginning of any *word* in the +// strings in the autocomplete array. If you want to +// search anywhere in the string, additionally set +// the option fullSearch to true (default: off). +// +// - fullSsearch - Search anywhere in autocomplete array strings. +// +// - partialChars - How many characters to enter before triggering +// a partial match (unlike minChars, which defines +// how many characters are required to do any match +// at all). Defaults to 2. +// +// - ignoreCase - Whether to ignore case when autocompleting. +// Defaults to true. +// +// It's possible to pass in a custom function as the 'selector' +// option, if you prefer to write your own autocompletion logic. +// In that case, the other options above will not apply unless +// you support them. + +Autocompleter.Local = Class.create(); +Autocompleter.Local.prototype = Object.extend(new Autocompleter.Base(), { + initialize: function( element, update, array, options ) + { + this.baseInitialize(element, update, options); + this.options.array = array; + }, + + getUpdatedChoices: function() + { + this.updateChoices(this.options.selector(this)); + }, + + setOptions: function( options ) + { + this.options = Object.extend({ + choices: 10, + partialSearch: true, + partialChars: 2, + ignoreCase: true, + fullSearch: false, + selector: function( instance ) + { + var ret = []; + // Beginning matches + var partial = []; + // Inside matches + var entry = instance.getToken(); + var count = 0; + + for ( var i = 0; i < instance.options.array.length && ret.length < instance.options.choices; i++ ) + { + + var elem = instance.options.array[i]; + var foundPos = instance.options.ignoreCase ? elem.toLowerCase().indexOf(entry.toLowerCase()) + : elem.indexOf(entry); + + while ( foundPos != -1 ) + { + if ( foundPos == 0 && elem.length != entry.length ) + { + ret.push("
  • " + elem.substr(0, entry.length) + "" + + elem.substr(entry.length) + "
  • "); + break; + } + else if ( entry.length >= instance.options.partialChars && instance.options.partialSearch && + foundPos != -1 ) + { + if ( instance.options.fullSearch || /\s/.test(elem.substr(foundPos - 1, 1)) ) + { + partial.push("
  • " + elem.substr(0, foundPos) + "" + + elem.substr(foundPos, entry.length) + "" + + elem.substr(foundPos + entry.length) + "
  • "); + break; + } + } + + foundPos = + instance.options.ignoreCase ? elem.toLowerCase().indexOf(entry.toLowerCase(), foundPos + 1) + : elem.indexOf(entry, foundPos + 1); + + } + } + if ( partial.length ) + ret = ret.concat(partial.slice(0, instance.options.choices - ret.length)) + return "
      " + ret.join('') + "
    "; + } + }, options || {}); + } +}); + +// AJAX in-place editor +// +// see documentation on http://wiki.script.aculo.us/scriptaculous/show/Ajax.InPlaceEditor + +// Use this if you notice weird scrolling problems on some browsers, +// the DOM might be a bit confused when this gets called so do this +// waits 1 ms (with setTimeout) until it does the activation +Field.scrollFreeActivate = function( field ) +{ + setTimeout(function() + { + Field.activate(field); + }, 1); +} + +Ajax.InPlaceEditor = Class.create(); +Ajax.InPlaceEditor.defaultHighlightColor = "#FFFF99"; +Ajax.InPlaceEditor.prototype = { + initialize: function( element, url, options ) + { + this.url = url; + this.element = $(element); + + this.options = Object.extend({ + okButton: true, + okText: "ok", + cancelLink: true, + cancelText: "cancel", + savingText: "Saving...", + clickToEditText: "Click to edit", + okText: "ok", + rows: 1, + onComplete: function( transport, element ) + { + new Effect.Highlight(element, {startcolor: this.options.highlightcolor}); + }, + onFailure: function( transport ) + { + alert("Error communicating with the server: " + transport.responseText.stripTags()); + }, + callback: function( form ) + { + return Form.serialize(form); + }, + handleLineBreaks: true, + loadingText: 'Loading...', + savingClassName: 'inplaceeditor-saving', + loadingClassName: 'inplaceeditor-loading', + formClassName: 'inplaceeditor-form', + highlightcolor: Ajax.InPlaceEditor.defaultHighlightColor, + highlightendcolor: "#FFFFFF", + externalControl: null, + submitOnBlur: false, + ajaxOptions: {}, + evalScripts: false + }, options || {}); + + if ( !this.options.formId && this.element.id ) + { + this.options.formId = this.element.id + "-inplaceeditor"; + if ( $(this.options.formId) ) + { + // there's already a form with that name, don't specify an id + this.options.formId = null; + } + } + + if ( this.options.externalControl ) + { + this.options.externalControl = $(this.options.externalControl); + } + + this.originalBackground = Element.getStyle(this.element, 'background-color'); + if ( !this.originalBackground ) + { + this.originalBackground = "transparent"; + } + + this.element.title = this.options.clickToEditText; + + this.onclickListener = this.enterEditMode.bindAsEventListener(this); + this.mouseoverListener = this.enterHover.bindAsEventListener(this); + this.mouseoutListener = this.leaveHover.bindAsEventListener(this); + Event.observe(this.element, 'click', this.onclickListener); + Event.observe(this.element, 'mouseover', this.mouseoverListener); + Event.observe(this.element, 'mouseout', this.mouseoutListener); + if ( this.options.externalControl ) + { + Event.observe(this.options.externalControl, 'click', this.onclickListener); + Event.observe(this.options.externalControl, 'mouseover', this.mouseoverListener); + Event.observe(this.options.externalControl, 'mouseout', this.mouseoutListener); + } + }, + enterEditMode: function( evt ) + { + if ( this.saving ) return; + if ( this.editing ) return; + this.editing = true; + this.onEnterEditMode(); + if ( this.options.externalControl ) + { + Element.hide(this.options.externalControl); + } + Element.hide(this.element); + this.createForm(); + this.element.parentNode.insertBefore(this.form, this.element); + if ( !this.options.loadTextURL ) Field.scrollFreeActivate(this.editField); + // stop the event to avoid a page refresh in Safari + if ( evt ) + { + Event.stop(evt); + } + return false; + }, + createForm: function() + { + this.form = document.createElement("form"); + this.form.id = this.options.formId; + Element.addClassName(this.form, this.options.formClassName) + this.form.onsubmit = this.onSubmit.bind(this); + + this.createEditField(); + + if ( this.options.textarea ) + { + var br = document.createElement("br"); + this.form.appendChild(br); + } + + if ( this.options.okButton ) + { + okButton = document.createElement("input"); + okButton.type = "submit"; + okButton.value = this.options.okText; + okButton.className = 'editor_ok_button'; + this.form.appendChild(okButton); + } + + if ( this.options.cancelLink ) + { + cancelLink = document.createElement("a"); + cancelLink.href = "#"; + cancelLink.appendChild(document.createTextNode(this.options.cancelText)); + cancelLink.onclick = this.onclickCancel.bind(this); + cancelLink.className = 'editor_cancel'; + this.form.appendChild(cancelLink); + } + }, + hasHTMLLineBreaks: function( string ) + { + if ( !this.options.handleLineBreaks ) return false; + return string.match(/
    /i); + }, + convertHTMLLineBreaks: function( string ) + { + return string.replace(/
    /gi, "\n").replace(//gi, "\n").replace(/<\/p>/gi, "\n").replace(/

    /gi, ""); + }, + createEditField: function() + { + var text; + if ( this.options.loadTextURL ) + { + text = this.options.loadingText; + } + else + { + text = this.getText(); + } + + var obj = this; + + if ( this.options.rows == 1 && !this.hasHTMLLineBreaks(text) ) + { + this.options.textarea = false; + var textField = document.createElement("input"); + textField.obj = this; + textField.type = "text"; + textField.name = "value"; + textField.value = text; + textField.style.backgroundColor = this.options.highlightcolor; + textField.className = 'editor_field'; + var size = this.options.size || this.options.cols || 0; + if ( size != 0 ) textField.size = size; + if ( this.options.submitOnBlur ) + textField.onblur = this.onSubmit.bind(this); + this.editField = textField; + } + else + { + this.options.textarea = true; + var textArea = document.createElement("textarea"); + textArea.obj = this; + textArea.name = "value"; + textArea.value = this.convertHTMLLineBreaks(text); + textArea.rows = this.options.rows; + textArea.cols = this.options.cols || 40; + textArea.className = 'editor_field'; + if ( this.options.submitOnBlur ) + textArea.onblur = this.onSubmit.bind(this); + this.editField = textArea; + } + + if ( this.options.loadTextURL ) + { + this.loadExternalText(); + } + this.form.appendChild(this.editField); + }, + getText: function() + { + return this.element.innerHTML; + }, + loadExternalText: function() + { + Element.addClassName(this.form, this.options.loadingClassName); + this.editField.disabled = true; + new Ajax.Request(this.options.loadTextURL, Object.extend({ + asynchronous: true, + onComplete: this.onLoadedExternalText.bind(this) + }, this.options.ajaxOptions)); + }, + onLoadedExternalText: function( transport ) + { + Element.removeClassName(this.form, this.options.loadingClassName); + this.editField.disabled = false; + this.editField.value = transport.responseText.stripTags(); + Field.scrollFreeActivate(this.editField); + }, + onclickCancel: function() + { + this.onComplete(); + this.leaveEditMode(); + return false; + }, + onFailure: function( transport ) + { + this.options.onFailure(transport); + if ( this.oldInnerHTML ) + { + this.element.innerHTML = this.oldInnerHTML; + this.oldInnerHTML = null; + } + return false; + }, + onSubmit: function() + { + // onLoading resets these so we need to save them away for the Ajax call + var form = this.form; + var value = this.editField.value; + + // do this first, sometimes the ajax call returns before we get a chance to switch on Saving... + // which means this will actually switch on Saving... *after* we've left edit mode causing Saving... + // to be displayed indefinitely + this.onLoading(); + + if ( this.options.evalScripts ) + { + new Ajax.Request(this.url, Object.extend({ + parameters: this.options.callback(form, value), + onComplete: this.onComplete.bind(this), + onFailure: this.onFailure.bind(this), + asynchronous:true, + evalScripts:true + }, this.options.ajaxOptions)); + } + else + { + new Ajax.Updater({ success: this.element, + // don't update on failure (this could be an option) + failure: null }, this.url, Object.extend({ + parameters: this.options.callback(form, value), + onComplete: this.onComplete.bind(this), + onFailure: this.onFailure.bind(this) + }, this.options.ajaxOptions)); + } + // stop the event to avoid a page refresh in Safari + if ( arguments.length > 1 ) + { + Event.stop(arguments[0]); + } + return false; + }, + onLoading: function() + { + this.saving = true; + this.removeForm(); + this.leaveHover(); + this.showSaving(); + }, + showSaving: function() + { + this.oldInnerHTML = this.element.innerHTML; + this.element.innerHTML = this.options.savingText; + Element.addClassName(this.element, this.options.savingClassName); + this.element.style.backgroundColor = this.originalBackground; + Element.show(this.element); + }, + removeForm: function() + { + if ( this.form ) + { + if ( this.form.parentNode ) Element.remove(this.form); + this.form = null; + } + }, + enterHover: function() + { + if ( this.saving ) return; + this.element.style.backgroundColor = this.options.highlightcolor; + if ( this.effect ) + { + this.effect.cancel(); + } + Element.addClassName(this.element, this.options.hoverClassName) + }, + leaveHover: function() + { + if ( this.options.backgroundColor ) + { + this.element.style.backgroundColor = this.oldBackground; + } + Element.removeClassName(this.element, this.options.hoverClassName) + if ( this.saving ) return; + this.effect = new Effect.Highlight(this.element, { + startcolor: this.options.highlightcolor, + endcolor: this.options.highlightendcolor, + restorecolor: this.originalBackground + }); + }, + leaveEditMode: function() + { + Element.removeClassName(this.element, this.options.savingClassName); + this.removeForm(); + this.leaveHover(); + this.element.style.backgroundColor = this.originalBackground; + Element.show(this.element); + if ( this.options.externalControl ) + { + Element.show(this.options.externalControl); + } + this.editing = false; + this.saving = false; + this.oldInnerHTML = null; + this.onLeaveEditMode(); + }, + onComplete: function( transport ) + { + this.leaveEditMode(); + this.options.onComplete.bind(this)(transport, this.element); + }, + onEnterEditMode: function() + { + }, + onLeaveEditMode: function() + { + }, + dispose: function() + { + if ( this.oldInnerHTML ) + { + this.element.innerHTML = this.oldInnerHTML; + } + this.leaveEditMode(); + Event.stopObserving(this.element, 'click', this.onclickListener); + Event.stopObserving(this.element, 'mouseover', this.mouseoverListener); + Event.stopObserving(this.element, 'mouseout', this.mouseoutListener); + if ( this.options.externalControl ) + { + Event.stopObserving(this.options.externalControl, 'click', this.onclickListener); + Event.stopObserving(this.options.externalControl, 'mouseover', this.mouseoverListener); + Event.stopObserving(this.options.externalControl, 'mouseout', this.mouseoutListener); + } + } +}; + +Ajax.InPlaceCollectionEditor = Class.create(); +Object.extend(Ajax.InPlaceCollectionEditor.prototype, Ajax.InPlaceEditor.prototype); +Object.extend(Ajax.InPlaceCollectionEditor.prototype, { + createEditField: function() + { + if ( !this.cached_selectTag ) + { + var selectTag = document.createElement("select"); + var collection = this.options.collection || []; + var optionTag; + collection.each(function( e, i ) + { + optionTag = document.createElement("option"); + optionTag.value = (e instanceof Array) ? e[0] : e; + if ( (typeof this.options.value == 'undefined') && + ((e instanceof Array) ? this.element.innerHTML == e[1] : e == + optionTag.value) ) optionTag.selected = + true; + if ( this.options.value == optionTag.value ) optionTag.selected = true; + optionTag.appendChild(document.createTextNode((e instanceof Array) ? e[1] : e)); + selectTag.appendChild(optionTag); + }.bind(this)); + this.cached_selectTag = selectTag; + } + + this.editField = this.cached_selectTag; + if ( this.options.loadTextURL ) this.loadExternalText(); + this.form.appendChild(this.editField); + this.options.callback = function( form, value ) + { + return "value=" + encodeURIComponent(value); + } + } +}); + +// Delayed observer, like Form.Element.Observer, +// but waits for delay after last key input +// Ideal for live-search fields + +Form.Element.DelayedObserver = Class.create(); +Form.Element.DelayedObserver.prototype = { + initialize: function( element, delay, callback ) + { + this.delay = delay || 0.5; + this.element = $(element); + this.callback = callback; + this.timer = null; + this.lastValue = $F(this.element); + Event.observe(this.element, 'keyup', this.delayedListener.bindAsEventListener(this)); + }, + delayedListener: function( event ) + { + if ( this.lastValue == $F(this.element) ) return; + if ( this.timer ) clearTimeout(this.timer); + this.timer = setTimeout(this.onTimerEvent.bind(this), this.delay * 1000); + this.lastValue = $F(this.element); + }, + onTimerEvent: function() + { + this.timer = null; + this.callback(this.element, $F(this.element)); + } +}; diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/scriptaculous/dragdrop.js b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/scriptaculous/dragdrop.js new file mode 100644 index 000000000..2f8c0522b --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/scriptaculous/dragdrop.js @@ -0,0 +1,1178 @@ +/* + * 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. + */ + +// script.aculo.us dragdrop.js v1.6.4, Wed Sep 06 11:30:58 CEST 2006 + +// Copyright (c) 2005 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) +// (c) 2005 Sammi Williams (http://www.oriontransfer.co.nz, sammi@oriontransfer.co.nz) +// +// See scriptaculous.js for full license. + +/*--------------------------------------------------------------------------*/ + +if ( typeof Effect == 'undefined' ) + throw("dragdrop.js requires including script.aculo.us' effects.js library"); + +var Droppables = { + drops: [], + + remove: function( element ) + { + this.drops = this.drops.reject(function( d ) + { + return d.element == $(element) + }); + }, + + add: function( element ) + { + element = $(element); + var options = Object.extend({ + greedy: true, + hoverclass: null, + tree: false + }, arguments[1] || {}); + + // cache containers + if ( options.containment ) + { + options._containers = []; + var containment = options.containment; + if ( (typeof containment == 'object') && (containment.constructor == Array) ) + { + containment.each(function( c ) + { + options._containers.push($(c)) + }); + } + else + { + options._containers.push($(containment)); + } + } + + if ( options.accept ) options.accept = [options.accept].flatten(); + + Element.makePositioned(element); + // fix IE + options.element = element; + + this.drops.push(options); + }, + + findDeepestChild: function( drops ) + { + deepest = drops[0]; + + for ( i = 1; i < drops.length; ++i ) + if ( Element.isParent(drops[i].element, deepest.element) ) + deepest = drops[i]; + + return deepest; + }, + + isContained: function( element, drop ) + { + var containmentNode; + if ( drop.tree ) + { + containmentNode = element.treeNode; + } + else + { + containmentNode = element.parentNode; + } + return drop._containers.detect(function( c ) + { + return containmentNode == c + }); + }, + + isAffected: function( point, element, drop ) + { + return ( + (drop.element != element) && ((!drop._containers) || this.isContained(element, drop)) && + ((!drop.accept) || (Element.classNames(element).detect(function( v ) + { + return drop.accept.include(v) + }) )) && Position.within(drop.element, point[0], point[1]) ); + }, + + deactivate: function( drop ) + { + if ( drop.hoverclass ) + Element.removeClassName(drop.element, drop.hoverclass); + this.last_active = null; + }, + + activate: function( drop ) + { + if ( drop.hoverclass ) + Element.addClassName(drop.element, drop.hoverclass); + this.last_active = drop; + }, + + show: function( point, element ) + { + if ( !this.drops.length ) return; + var affected = []; + + if ( this.last_active ) this.deactivate(this.last_active); + this.drops.each(function( drop ) + { + if ( Droppables.isAffected(point, element, drop) ) + affected.push(drop); + }); + + if ( affected.length > 0 ) + { + drop = Droppables.findDeepestChild(affected); + Position.within(drop.element, point[0], point[1]); + if ( drop.onHover ) + drop.onHover(element, drop.element, Position.overlap(drop.overlap, drop.element)); + + Droppables.activate(drop); + } + }, + + fire: function( event, element ) + { + if ( !this.last_active ) return; + Position.prepare(); + + if ( this.isAffected([Event.pointerX(event), Event.pointerY(event)], element, this.last_active) ) + if ( this.last_active.onDrop ) + this.last_active.onDrop(element, this.last_active.element, event); + }, + + reset: function() + { + if ( this.last_active ) + this.deactivate(this.last_active); + } +} + +var Draggables = { + drags: [], + observers: [], + + register: function( draggable ) + { + if ( this.drags.length == 0 ) + { + this.eventMouseUp = this.endDrag.bindAsEventListener(this); + this.eventMouseMove = this.updateDrag.bindAsEventListener(this); + this.eventKeypress = this.keyPress.bindAsEventListener(this); + + Event.observe(document, "mouseup", this.eventMouseUp); + Event.observe(document, "mousemove", this.eventMouseMove); + Event.observe(document, "keypress", this.eventKeypress); + } + this.drags.push(draggable); + }, + + unregister: function( draggable ) + { + this.drags = this.drags.reject(function( d ) + { + return d == draggable + }); + if ( this.drags.length == 0 ) + { + Event.stopObserving(document, "mouseup", this.eventMouseUp); + Event.stopObserving(document, "mousemove", this.eventMouseMove); + Event.stopObserving(document, "keypress", this.eventKeypress); + } + }, + + activate: function( draggable ) + { + if ( draggable.options.delay ) + { + this._timeout = setTimeout(function() + { + Draggables._timeout = null; + window.focus(); + Draggables.activeDraggable = draggable; + }.bind(this), draggable.options.delay); + } + else + { + window.focus(); + // allows keypress events if window isn't currently focused, fails for Safari + this.activeDraggable = draggable; + } + }, + + deactivate: function() + { + this.activeDraggable = null; + }, + + updateDrag: function( event ) + { + if ( !this.activeDraggable ) return; + var pointer = [Event.pointerX(event), Event.pointerY(event)]; + // Mozilla-based browsers fire successive mousemove events with + // the same coordinates, prevent needless redrawing (moz bug?) + if ( this._lastPointer && (this._lastPointer.inspect() == pointer.inspect()) ) return; + this._lastPointer = pointer; + + this.activeDraggable.updateDrag(event, pointer); + }, + + endDrag: function( event ) + { + if ( this._timeout ) + { + clearTimeout(this._timeout); + this._timeout = null; + } + if ( !this.activeDraggable ) return; + this._lastPointer = null; + this.activeDraggable.endDrag(event); + this.activeDraggable = null; + }, + + keyPress: function( event ) + { + if ( this.activeDraggable ) + this.activeDraggable.keyPress(event); + }, + + addObserver: function( observer ) + { + this.observers.push(observer); + this._cacheObserverCallbacks(); + }, + + removeObserver: function( element ) + { // element instead of observer fixes mem leaks + this.observers = this.observers.reject(function( o ) + { + return o.element == element + }); + this._cacheObserverCallbacks(); + }, + + notify: function( eventName, draggable, event ) + { // 'onStart', 'onEnd', 'onDrag' + if ( this[eventName + 'Count'] > 0 ) + this.observers.each(function( o ) + { + if ( o[eventName] ) o[eventName](eventName, draggable, event); + }); + if ( draggable.options[eventName] ) draggable.options[eventName](draggable, event); + }, + + _cacheObserverCallbacks: function() + { + ['onStart','onEnd','onDrag'].each(function( eventName ) + { + Draggables[eventName + 'Count'] = Draggables.observers.select(function( o ) + { + return o[eventName]; + }).length; + }); + } +} + +/*--------------------------------------------------------------------------*/ + +var Draggable = Class.create(); +Draggable._dragging = {}; + +Draggable.prototype = { + initialize: function( element ) + { + var defaults = { + handle: false, + reverteffect: function( element, top_offset, left_offset ) + { + var dur = Math.sqrt(Math.abs(top_offset ^ 2) + Math.abs(left_offset ^ 2)) * 0.02; + new Effect.Move(element, { x: -left_offset, y: -top_offset, duration: dur, + queue: {scope:'_draggable', position:'end'} + }); + }, + endeffect: function( element ) + { + var toOpacity = typeof element._opacity == 'number' ? element._opacity : 1.0; + new Effect.Opacity(element, {duration:0.2, from:0.7, to:toOpacity, + queue: {scope:'_draggable', position:'end'}, + afterFinish: function() + { + Draggable._dragging[element] = false + } + }); + }, + zindex: 1000, + revert: false, + scroll: false, + scrollSensitivity: 20, + scrollSpeed: 15, + snap: false, // false, or xy or [x,y] or function(x,y){ return [x,y] } + delay: 0 + }; + + if ( arguments[1] && typeof arguments[1].endeffect == 'undefined' ) + Object.extend(defaults, { + starteffect: function( element ) + { + element._opacity = Element.getOpacity(element); + Draggable._dragging[element] = true; + new Effect.Opacity(element, {duration:0.2, from:element._opacity, to:0.7}); + } + }); + + var options = Object.extend(defaults, arguments[1] || {}); + + this.element = $(element); + + if ( options.handle && (typeof options.handle == 'string') ) + { + var h = Element.childrenWithClassName(this.element, options.handle, true); + if ( h.length > 0 ) this.handle = h[0]; + } + if ( !this.handle ) this.handle = $(options.handle); + if ( !this.handle ) this.handle = this.element; + + if ( options.scroll && !options.scroll.scrollTo && !options.scroll.outerHTML ) + { + options.scroll = $(options.scroll); + this._isScrollChild = Element.childOf(this.element, options.scroll); + } + + Element.makePositioned(this.element); + // fix IE + + this.delta = this.currentDelta(); + this.options = options; + this.dragging = false; + + this.eventMouseDown = this.initDrag.bindAsEventListener(this); + Event.observe(this.handle, "mousedown", this.eventMouseDown); + + Draggables.register(this); + }, + + destroy: function() + { + Event.stopObserving(this.handle, "mousedown", this.eventMouseDown); + Draggables.unregister(this); + }, + + currentDelta: function() + { + return([ + parseInt(Element.getStyle(this.element, 'left') || '0'), + parseInt(Element.getStyle(this.element, 'top') || '0')]); + }, + + initDrag: function( event ) + { + if ( typeof Draggable._dragging[this.element] != 'undefined' && Draggable._dragging[this.element] ) return; + if ( Event.isLeftClick(event) ) + { + // abort on form elements, fixes a Firefox issue + var src = Event.element(event); + if ( src.tagName && ( + src.tagName == 'INPUT' || src.tagName == 'SELECT' || src.tagName == 'OPTION' || + src.tagName == 'BUTTON' || src.tagName == 'TEXTAREA') ) return; + + var pointer = [Event.pointerX(event), Event.pointerY(event)]; + var pos = Position.cumulativeOffset(this.element); + this.offset = [0,1].map(function( i ) + { + return (pointer[i] - pos[i]) + }); + + Draggables.activate(this); + Event.stop(event); + } + }, + + startDrag: function( event ) + { + this.dragging = true; + + if ( this.options.zindex ) + { + this.originalZ = parseInt(Element.getStyle(this.element, 'z-index') || 0); + this.element.style.zIndex = this.options.zindex; + } + + if ( this.options.ghosting ) + { + this._clone = this.element.cloneNode(true); + Position.absolutize(this.element); + this.element.parentNode.insertBefore(this._clone, this.element); + } + + if ( this.options.scroll ) + { + if ( this.options.scroll == window ) + { + var where = this._getWindowScroll(this.options.scroll); + this.originalScrollLeft = where.left; + this.originalScrollTop = where.top; + } + else + { + this.originalScrollLeft = this.options.scroll.scrollLeft; + this.originalScrollTop = this.options.scroll.scrollTop; + } + } + + Draggables.notify('onStart', this, event); + + if ( this.options.starteffect ) this.options.starteffect(this.element); + }, + + updateDrag: function( event, pointer ) + { + if ( !this.dragging ) this.startDrag(event); + Position.prepare(); + Droppables.show(pointer, this.element); + Draggables.notify('onDrag', this, event); + + this.draw(pointer); + if ( this.options.change ) this.options.change(this); + + if ( this.options.scroll ) + { + this.stopScrolling(); + + var p; + if ( this.options.scroll == window ) + { + with ( this._getWindowScroll(this.options.scroll) ) + { + p = [ left, top, left + width, top + height ]; + } + } + else + { + p = Position.page(this.options.scroll); + p[0] += this.options.scroll.scrollLeft; + p[1] += this.options.scroll.scrollTop; + + p[0] += (window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0); + p[1] += (window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0); + + p.push(p[0] + this.options.scroll.offsetWidth); + p.push(p[1] + this.options.scroll.offsetHeight); + } + var speed = [0,0]; + if ( pointer[0] < (p[0] + this.options.scrollSensitivity) ) speed[0] = pointer[0] - (p[0] + + this.options.scrollSensitivity); + if ( pointer[1] < (p[1] + this.options.scrollSensitivity) ) speed[1] = pointer[1] - (p[1] + + this.options.scrollSensitivity); + if ( pointer[0] > (p[2] - this.options.scrollSensitivity) ) speed[0] = pointer[0] - (p[2] - + this.options.scrollSensitivity); + if ( pointer[1] > (p[3] - this.options.scrollSensitivity) ) speed[1] = pointer[1] - (p[3] - + this.options.scrollSensitivity); + this.startScrolling(speed); + } + + // fix AppleWebKit rendering + if ( navigator.appVersion.indexOf('AppleWebKit') > 0 ) window.scrollBy(0, 0); + + Event.stop(event); + }, + + finishDrag: function( event, success ) + { + this.dragging = false; + + if ( this.options.ghosting ) + { + Position.relativize(this.element); + Element.remove(this._clone); + this._clone = null; + } + + if ( success ) Droppables.fire(event, this.element); + Draggables.notify('onEnd', this, event); + + var revert = this.options.revert; + if ( revert && typeof revert == 'function' ) revert = revert(this.element); + + var d = this.currentDelta(); + if ( revert && this.options.reverteffect ) + { + this.options.reverteffect(this.element, d[1] - this.delta[1], d[0] - this.delta[0]); + } + else + { + this.delta = d; + } + + if ( this.options.zindex ) + this.element.style.zIndex = this.originalZ; + + if ( this.options.endeffect ) + this.options.endeffect(this.element); + + Draggables.deactivate(this); + Droppables.reset(); + }, + + keyPress: function( event ) + { + if ( event.keyCode != Event.KEY_ESC ) return; + this.finishDrag(event, false); + Event.stop(event); + }, + + endDrag: function( event ) + { + if ( !this.dragging ) return; + this.stopScrolling(); + this.finishDrag(event, true); + Event.stop(event); + }, + + draw: function( point ) + { + var pos = Position.cumulativeOffset(this.element); + if ( this.options.ghosting ) + { + var r = Position.realOffset(this.element); + window.status = r.inspect(); + pos[0] += r[0] - Position.deltaX; + pos[1] += r[1] - Position.deltaY; + } + + var d = this.currentDelta(); + pos[0] -= d[0]; + pos[1] -= d[1]; + + if ( this.options.scroll && (this.options.scroll != window && this._isScrollChild) ) + { + pos[0] -= this.options.scroll.scrollLeft - this.originalScrollLeft; + pos[1] -= this.options.scroll.scrollTop - this.originalScrollTop; + } + + var p = [0,1].map(function( i ) + { + return (point[i] - pos[i] - this.offset[i]) + }.bind(this)); + + if ( this.options.snap ) + { + if ( typeof this.options.snap == 'function' ) + { + p = this.options.snap(p[0], p[1], this); + } + else + { + if ( this.options.snap instanceof Array ) + { + p = p.map(function( v, i ) + { + return Math.round(v / this.options.snap[i]) * this.options.snap[i] + }.bind(this)) + } + else + { + p = p.map(function( v ) + { + return Math.round(v / this.options.snap) * this.options.snap + }.bind(this)) + } + } + } + + var style = this.element.style; + if ( (!this.options.constraint) || (this.options.constraint == 'horizontal') ) + style.left = p[0] + "px"; + if ( (!this.options.constraint) || (this.options.constraint == 'vertical') ) + style.top = p[1] + "px"; + + if ( style.visibility == "hidden" ) style.visibility = ""; // fix gecko rendering + }, + + stopScrolling: function() + { + if ( this.scrollInterval ) + { + clearInterval(this.scrollInterval); + this.scrollInterval = null; + Draggables._lastScrollPointer = null; + } + }, + + startScrolling: function( speed ) + { + if ( !(speed[0] || speed[1]) ) return; + this.scrollSpeed = [speed[0] * this.options.scrollSpeed,speed[1] * this.options.scrollSpeed]; + this.lastScrolled = new Date(); + this.scrollInterval = setInterval(this.scroll.bind(this), 10); + }, + + scroll: function() + { + var current = new Date(); + var delta = current - this.lastScrolled; + this.lastScrolled = current; + if ( this.options.scroll == window ) + { + with ( this._getWindowScroll(this.options.scroll) ) + { + if ( this.scrollSpeed[0] || this.scrollSpeed[1] ) + { + var d = delta / 1000; + this.options.scroll.scrollTo(left + d * this.scrollSpeed[0], top + d * this.scrollSpeed[1]); + } + } + } + else + { + this.options.scroll.scrollLeft += this.scrollSpeed[0] * delta / 1000; + this.options.scroll.scrollTop += this.scrollSpeed[1] * delta / 1000; + } + + Position.prepare(); + Droppables.show(Draggables._lastPointer, this.element); + Draggables.notify('onDrag', this); + if ( this._isScrollChild ) + { + Draggables._lastScrollPointer = Draggables._lastScrollPointer || $A(Draggables._lastPointer); + Draggables._lastScrollPointer[0] += this.scrollSpeed[0] * delta / 1000; + Draggables._lastScrollPointer[1] += this.scrollSpeed[1] * delta / 1000; + if ( Draggables._lastScrollPointer[0] < 0 ) + Draggables._lastScrollPointer[0] = 0; + if ( Draggables._lastScrollPointer[1] < 0 ) + Draggables._lastScrollPointer[1] = 0; + this.draw(Draggables._lastScrollPointer); + } + + if ( this.options.change ) this.options.change(this); + }, + + _getWindowScroll: function( w ) + { + var T, L, W, H; + with ( w.document ) + { + if ( w.document.documentElement && documentElement.scrollTop ) + { + T = documentElement.scrollTop; + L = documentElement.scrollLeft; + } + else if ( w.document.body ) + { + T = body.scrollTop; + L = body.scrollLeft; + } + if ( w.innerWidth ) + { + W = w.innerWidth; + H = w.innerHeight; + } + else if ( w.document.documentElement && documentElement.clientWidth ) + { + W = documentElement.clientWidth; + H = documentElement.clientHeight; + } + else + { + W = body.offsetWidth; + H = body.offsetHeight + } + } + return { top: T, left: L, width: W, height: H }; + } +} + +/*--------------------------------------------------------------------------*/ + +var SortableObserver = Class.create(); +SortableObserver.prototype = { + initialize: function( element, observer ) + { + this.element = $(element); + this.observer = observer; + this.lastValue = Sortable.serialize(this.element); + }, + + onStart: function() + { + this.lastValue = Sortable.serialize(this.element); + }, + + onEnd: function() + { + Sortable.unmark(); + if ( this.lastValue != Sortable.serialize(this.element) ) + this.observer(this.element) + } +} + +var Sortable = { + SERIALIZE_RULE: /^[^_\-](?:[A-Za-z0-9\-\_]*)[_](.*)$/, + + sortables: {}, + + _findRootElement: function( element ) + { + while ( element.tagName != "BODY" ) + { + if ( element.id && Sortable.sortables[element.id] ) return element; + element = element.parentNode; + } + }, + + options: function( element ) + { + element = Sortable._findRootElement($(element)); + if ( !element ) return; + return Sortable.sortables[element.id]; + }, + + destroy: function( element ) + { + var s = Sortable.options(element); + + if ( s ) + { + Draggables.removeObserver(s.element); + s.droppables.each(function( d ) + { + Droppables.remove(d) + }); + s.draggables.invoke('destroy'); + + delete Sortable.sortables[s.element.id]; + } + }, + + create: function( element ) + { + element = $(element); + var options = Object.extend({ + element: element, + tag: 'li', // assumes li children, override with tag: 'tagname' + dropOnEmpty: false, + tree: false, + treeTag: 'ul', + overlap: 'vertical', // one of 'vertical', 'horizontal' + constraint: 'vertical', // one of 'vertical', 'horizontal', false + containment: element, // also takes array of elements (or id's); or false + handle: false, // or a CSS class + only: false, + delay: 0, + hoverclass: null, + ghosting: false, + scroll: false, + scrollSensitivity: 20, + scrollSpeed: 15, + format: this.SERIALIZE_RULE, + onChange: Prototype.emptyFunction, + onUpdate: Prototype.emptyFunction + }, arguments[1] || {}); + + // clear any old sortable with same element + this.destroy(element); + + // build options for the draggables + var options_for_draggable = { + revert: true, + scroll: options.scroll, + scrollSpeed: options.scrollSpeed, + scrollSensitivity: options.scrollSensitivity, + delay: options.delay, + ghosting: options.ghosting, + constraint: options.constraint, + handle: options.handle }; + + if ( options.starteffect ) + options_for_draggable.starteffect = options.starteffect; + + if ( options.reverteffect ) + options_for_draggable.reverteffect = options.reverteffect; + else + if ( options.ghosting ) options_for_draggable.reverteffect = function( element ) + { + element.style.top = 0; + element.style.left = 0; + }; + + if ( options.endeffect ) + options_for_draggable.endeffect = options.endeffect; + + if ( options.zindex ) + options_for_draggable.zindex = options.zindex; + + // build options for the droppables + var options_for_droppable = { + overlap: options.overlap, + containment: options.containment, + tree: options.tree, + hoverclass: options.hoverclass, + onHover: Sortable.onHover + //greedy: !options.dropOnEmpty + } + + var options_for_tree = { + onHover: Sortable.onEmptyHover, + overlap: options.overlap, + containment: options.containment, + hoverclass: options.hoverclass + } + + // fix for gecko engine + Element.cleanWhitespace(element); + + options.draggables = []; + options.droppables = []; + + // drop on empty handling + if ( options.dropOnEmpty || options.tree ) + { + Droppables.add(element, options_for_tree); + options.droppables.push(element); + } + + (this.findElements(element, options) || []).each(function( e ) + { + // handles are per-draggable + var handle = options.handle ? Element.childrenWithClassName(e, options.handle)[0] : e; + options.draggables.push(new Draggable(e, Object.extend(options_for_draggable, { handle: handle }))); + Droppables.add(e, options_for_droppable); + if ( options.tree ) e.treeNode = element; + options.droppables.push(e); + }); + + if ( options.tree ) + { + (Sortable.findTreeElements(element, options) || []).each(function( e ) + { + Droppables.add(e, options_for_tree); + e.treeNode = element; + options.droppables.push(e); + }); + } + + // keep reference + this.sortables[element.id] = options; + + // for onupdate + Draggables.addObserver(new SortableObserver(element, options.onUpdate)); + + }, + +// return all suitable-for-sortable elements in a guaranteed order + findElements: function( element, options ) + { + return Element.findChildren(element, options.only, options.tree ? true : false, options.tag); + }, + + findTreeElements: function( element, options ) + { + return Element.findChildren(element, options.only, options.tree ? true : false, options.treeTag); + }, + + onHover: function( element, dropon, overlap ) + { + if ( Element.isParent(dropon, element) ) return; + + if ( overlap > .33 && overlap < .66 && Sortable.options(dropon).tree ) + { + return; + } + else if ( overlap > 0.5 ) + { + Sortable.mark(dropon, 'before'); + if ( dropon.previousSibling != element ) + { + var oldParentNode = element.parentNode; + element.style.visibility = "hidden"; + // fix gecko rendering + dropon.parentNode.insertBefore(element, dropon); + if ( dropon.parentNode != oldParentNode ) + Sortable.options(oldParentNode).onChange(element); + Sortable.options(dropon.parentNode).onChange(element); + } + } + else + { + Sortable.mark(dropon, 'after'); + var nextElement = dropon.nextSibling || null; + if ( nextElement != element ) + { + var oldParentNode = element.parentNode; + element.style.visibility = "hidden"; + // fix gecko rendering + dropon.parentNode.insertBefore(element, nextElement); + if ( dropon.parentNode != oldParentNode ) + Sortable.options(oldParentNode).onChange(element); + Sortable.options(dropon.parentNode).onChange(element); + } + } + }, + + onEmptyHover: function( element, dropon, overlap ) + { + var oldParentNode = element.parentNode; + var droponOptions = Sortable.options(dropon); + + if ( !Element.isParent(dropon, element) ) + { + var index; + + var children = Sortable.findElements(dropon, {tag: droponOptions.tag, only: droponOptions.only}); + var child = null; + + if ( children ) + { + var offset = Element.offsetSize(dropon, droponOptions.overlap) * (1.0 - overlap); + + for ( index = 0; index < children.length; index += 1 ) + { + if ( offset - Element.offsetSize(children[index], droponOptions.overlap) >= 0 ) + { + offset -= Element.offsetSize(children[index], droponOptions.overlap); + } + else if ( offset - (Element.offsetSize(children[index], droponOptions.overlap) / 2) >= 0 ) + { + child = index + 1 < children.length ? children[index + 1] : null; + break; + } + else + { + child = children[index]; + break; + } + } + } + + dropon.insertBefore(element, child); + + Sortable.options(oldParentNode).onChange(element); + droponOptions.onChange(element); + } + }, + + unmark: function() + { + if ( Sortable._marker ) Element.hide(Sortable._marker); + }, + + mark: function( dropon, position ) + { + // mark on ghosting only + var sortable = Sortable.options(dropon.parentNode); + if ( sortable && !sortable.ghosting ) return; + + if ( !Sortable._marker ) + { + Sortable._marker = $('dropmarker') || document.createElement('DIV'); + Element.hide(Sortable._marker); + Element.addClassName(Sortable._marker, 'dropmarker'); + Sortable._marker.style.position = 'absolute'; + document.getElementsByTagName("body").item(0).appendChild(Sortable._marker); + } + var offsets = Position.cumulativeOffset(dropon); + Sortable._marker.style.left = offsets[0] + 'px'; + Sortable._marker.style.top = offsets[1] + 'px'; + + if ( position == 'after' ) + if ( sortable.overlap == 'horizontal' ) + Sortable._marker.style.left = (offsets[0] + dropon.clientWidth) + 'px'; + else + Sortable._marker.style.top = (offsets[1] + dropon.clientHeight) + 'px'; + + Element.show(Sortable._marker); + }, + + _tree: function( element, options, parent ) + { + var children = Sortable.findElements(element, options) || []; + + for ( var i = 0; i < children.length; ++i ) + { + var match = children[i].id.match(options.format); + + if ( !match ) continue; + + var child = { + id: encodeURIComponent(match ? match[1] : null), + element: element, + parent: parent, + children: new Array, + position: parent.children.length, + container: Sortable._findChildrenElement(children[i], options.treeTag.toUpperCase()) + } + + /* Get the element containing the children and recurse over it */ + if ( child.container ) + this._tree(child.container, options, child) + + parent.children.push(child); + } + + return parent; + }, + +/* Finds the first element of the given tag type within a parent element. +Used for finding the first LI[ST] within a L[IST]I[TEM].*/ + _findChildrenElement: function ( element, containerTag ) + { + if ( element && element.hasChildNodes ) + for ( var i = 0; i < element.childNodes.length; ++i ) + if ( element.childNodes[i].tagName == containerTag ) + return element.childNodes[i]; + + return null; + }, + + tree: function( element ) + { + element = $(element); + var sortableOptions = this.options(element); + var options = Object.extend({ + tag: sortableOptions.tag, + treeTag: sortableOptions.treeTag, + only: sortableOptions.only, + name: element.id, + format: sortableOptions.format + }, arguments[1] || {}); + + var root = { + id: null, + parent: null, + children: new Array, + container: element, + position: 0 + } + + return Sortable._tree(element, options, root); + }, + +/* Construct a [i] index for a particular node */ + _constructIndex: function( node ) + { + var index = ''; + do { + if ( node.id ) index = '[' + node.position + ']' + index; + } + while ( (node = node.parent) != null ); + return index; + }, + + sequence: function( element ) + { + element = $(element); + var options = Object.extend(this.options(element), arguments[1] || {}); + + return $(this.findElements(element, options) || []).map(function( item ) + { + return item.id.match(options.format) ? item.id.match(options.format)[1] : ''; + }); + }, + + setSequence: function( element, new_sequence ) + { + element = $(element); + var options = Object.extend(this.options(element), arguments[2] || {}); + + var nodeMap = {}; + this.findElements(element, options).each(function( n ) + { + if ( n.id.match(options.format) ) + nodeMap[n.id.match(options.format)[1]] = [n, n.parentNode]; + n.parentNode.removeChild(n); + }); + + new_sequence.each(function( ident ) + { + var n = nodeMap[ident]; + if ( n ) + { + n[1].appendChild(n[0]); + delete nodeMap[ident]; + } + }); + }, + + serialize: function( element ) + { + element = $(element); + var options = Object.extend(Sortable.options(element), arguments[1] || {}); + var name = encodeURIComponent((arguments[1] && arguments[1].name) ? arguments[1].name : element.id); + + if ( options.tree ) + { + return Sortable.tree(element, arguments[1]).children.map(function ( item ) + { + return [name + Sortable._constructIndex(item) + "[id]=" + + encodeURIComponent(item.id)].concat(item.children.map(arguments.callee)); + }).flatten().join('&'); + } + else + { + return Sortable.sequence(element, arguments[1]).map(function( item ) + { + return name + "[]=" + encodeURIComponent(item); + }).join('&'); + } + } +} + +/* Returns true if child is contained within element */ +Element.isParent = function( child, element ) +{ + if ( !child.parentNode || child == element ) return false; + + if ( child.parentNode == element ) return true; + + return Element.isParent(child.parentNode, element); +} + +Element.findChildren = function( element, only, recursive, tagName ) +{ + if ( !element.hasChildNodes() ) return null; + tagName = tagName.toUpperCase(); + if ( only ) only = [only].flatten(); + var elements = []; + $A(element.childNodes).each(function( e ) + { + if ( e.tagName && e.tagName.toUpperCase() == tagName && (!only || (Element.classNames(e).detect(function( v ) + { + return only.include(v) + }))) ) + elements.push(e); + if ( recursive ) + { + var grandchildren = Element.findChildren(e, only, recursive, tagName); + if ( grandchildren ) elements.push(grandchildren); + } + }); + + return (elements.length > 0 ? elements.flatten() : []); +} + +Element.offsetSize = function ( element, type ) +{ + if ( type == 'vertical' || type == 'height' ) + return element.offsetHeight; + else + return element.offsetWidth; +} \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/scriptaculous/effects.js b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/scriptaculous/effects.js new file mode 100644 index 000000000..4b7ffa132 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/scriptaculous/effects.js @@ -0,0 +1,1156 @@ +/* + * 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. + */ + +// script.aculo.us effects.js v1.6.4, Wed Sep 06 11:30:58 CEST 2006 + +// Copyright (c) 2005 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) +// Contributors: +// Justin Palmer (http://encytemedia.com/) +// Mark Pilgrim (http://diveintomark.org/) +// Martin Bialasinki +// +// See scriptaculous.js for full license. + +// converts rgb() and #xxx to #xxxxxx format, +// returns self (or first argument) if not convertable +String.prototype.parseColor = function() +{ + var color = '#'; + if ( this.slice(0, 4) == 'rgb(' ) + { + var cols = this.slice(4, this.length - 1).split(','); + var i = 0; + do { + color += parseInt(cols[i]).toColorPart() + } + while ( ++i < 3 ); + } + else + { + if ( this.slice(0, 1) == '#' ) + { + if ( this.length == 4 ) for ( var i = 1; i < 4; i++ ) color += + (this.charAt(i) + this.charAt(i)).toLowerCase(); + if ( this.length == 7 ) color = this.toLowerCase(); + } + } + return(color.length == 7 ? color : (arguments[0] || this)); +} + +/*--------------------------------------------------------------------------*/ + +Element.collectTextNodes = function( element ) +{ + return $A($(element).childNodes).collect(function( node ) + { + return (node.nodeType == 3 ? node.nodeValue : (node.hasChildNodes() ? Element.collectTextNodes(node) : '')); + }).flatten().join(''); +} + +Element.collectTextNodesIgnoreClass = function( element, className ) +{ + return $A($(element).childNodes).collect(function( node ) + { + return (node.nodeType == 3 ? node.nodeValue : ((node.hasChildNodes() && !Element.hasClassName(node, className)) + ? Element.collectTextNodesIgnoreClass(node, className) : '')); + }).flatten().join(''); +} + +Element.setContentZoom = function( element, percent ) +{ + element = $(element); + Element.setStyle(element, {fontSize: (percent / 100) + 'em'}); + if ( navigator.appVersion.indexOf('AppleWebKit') > 0 ) window.scrollBy(0, 0); +} + +Element.getOpacity = function( element ) +{ + var opacity; + if ( opacity = Element.getStyle(element, 'opacity') ) + return parseFloat(opacity); + if ( opacity = (Element.getStyle(element, 'filter') || '').match(/alpha\(opacity=(.*)\)/) ) + if ( opacity[1] ) return parseFloat(opacity[1]) / 100; + return 1.0; +} + +Element.setOpacity = function( element, value ) +{ + element = $(element); + if ( value == 1 ) + { + Element.setStyle(element, { opacity: + (/Gecko/.test(navigator.userAgent) && !/Konqueror|Safari|KHTML/.test(navigator.userAgent)) ? 0.999999 + : 1.0 }); + if ( /MSIE/.test(navigator.userAgent) && !window.opera ) + Element.setStyle(element, {filter: Element.getStyle(element, 'filter').replace(/alpha\([^\)]*\)/gi, '')}); + } + else + { + if ( value < 0.00001 ) value = 0; + Element.setStyle(element, {opacity: value}); + if ( /MSIE/.test(navigator.userAgent) && !window.opera ) + Element.setStyle(element, { filter: Element.getStyle(element, 'filter').replace(/alpha\([^\)]*\)/gi, '') + + 'alpha(opacity=' + value * 100 + ')' }); + } +} + +Element.getInlineOpacity = function( element ) +{ + return $(element).style.opacity || ''; +} + +Element.childrenWithClassName = function( element, className, findFirst ) +{ + var classNameRegExp = new RegExp("(^|\\s)" + className + "(\\s|$)"); + var results = $A($(element).getElementsByTagName('*'))[findFirst ? 'detect' : 'select'](function( c ) + { + return (c.className && c.className.match(classNameRegExp)); + }); + if ( !results ) results = []; + return results; +} + +Element.forceRerendering = function( element ) +{ + try + { + element = $(element); + var n = document.createTextNode(' '); + element.appendChild(n); + element.removeChild(n); + } + catch( e ) + { + } +}; + +/*--------------------------------------------------------------------------*/ + +Array.prototype.call = function() +{ + var args = arguments; + this.each(function( f ) + { + f.apply(this, args) + }); +} + +/*--------------------------------------------------------------------------*/ + +var Effect = { + _elementDoesNotExistError: { + name: 'ElementDoesNotExistError', + message: 'The specified DOM element does not exist, but is required for this effect to operate' + }, + tagifyText: function( element ) + { + if ( typeof Builder == 'undefined' ) + throw("Effect.tagifyText requires including script.aculo.us' builder.js library"); + + var tagifyStyle = 'position:relative'; + if ( /MSIE/.test(navigator.userAgent) && !window.opera ) tagifyStyle += ';zoom:1'; + element = $(element); + $A(element.childNodes).each(function( child ) + { + if ( child.nodeType == 3 ) + { + child.nodeValue.toArray().each(function( character ) + { + element.insertBefore(Builder.node('span', {style: tagifyStyle}, character == ' ' + ? String.fromCharCode(160) : character), child); + }); + Element.remove(child); + } + }); + }, + multiple: function( element, effect ) + { + var elements; + if ( ((typeof element == 'object') || (typeof element == 'function')) && (element.length) ) + elements = element; + else + elements = $(element).childNodes; + + var options = Object.extend({ + speed: 0.1, + delay: 0.0 + }, arguments[2] || {}); + var masterDelay = options.delay; + + $A(elements).each(function( element, index ) + { + new effect(element, Object.extend(options, { delay: index * options.speed + masterDelay })); + }); + }, + PAIRS: { + 'slide': ['SlideDown','SlideUp'], + 'blind': ['BlindDown','BlindUp'], + 'appear': ['Appear','Fade'] + }, + toggle: function( element, effect ) + { + element = $(element); + effect = (effect || 'appear').toLowerCase(); + var options = Object.extend({ + queue: { position:'end', scope:(element.id || 'global'), limit: 1 } + }, arguments[2] || {}); + Effect[element.visible() ? Effect.PAIRS[effect][1] : Effect.PAIRS[effect][0]](element, options); + } +}; + +var Effect2 = Effect; +// deprecated + +/* ------------- transitions ------------- */ + +Effect.Transitions = {} + +Effect.Transitions.linear = Prototype.K; + +Effect.Transitions.sinoidal = function( pos ) +{ + return (-Math.cos(pos * Math.PI) / 2) + 0.5; +} +Effect.Transitions.reverse = function( pos ) +{ + return 1 - pos; +} +Effect.Transitions.flicker = function( pos ) +{ + return ((-Math.cos(pos * Math.PI) / 4) + 0.75) + Math.random() / 4; +} +Effect.Transitions.wobble = function( pos ) +{ + return (-Math.cos(pos * Math.PI * (9 * pos)) / 2) + 0.5; +} +Effect.Transitions.pulse = function( pos ) +{ + return (Math.floor(pos * 10) % 2 == 0 ? (pos * 10 - Math.floor(pos * 10)) : 1 - (pos * 10 - Math.floor(pos * 10))); +} +Effect.Transitions.none = function( pos ) +{ + return 0; +} +Effect.Transitions.full = function( pos ) +{ + return 1; +} + +/* ------------- core effects ------------- */ + +Effect.ScopedQueue = Class.create(); +Object.extend(Object.extend(Effect.ScopedQueue.prototype, Enumerable), { + initialize: function() + { + this.effects = []; + this.interval = null; + }, + _each: function( iterator ) + { + this.effects._each(iterator); + }, + add: function( effect ) + { + var timestamp = new Date().getTime(); + + var position = (typeof effect.options.queue == 'string') ? effect.options.queue : effect.options.queue.position; + + switch ( position ) + { + case 'front': + // move unstarted effects after this effect + this.effects.findAll(function( e ) + { + return e.state == 'idle' + }).each(function( e ) + { + e.startOn += effect.finishOn; + e.finishOn += effect.finishOn; + }); + break; + case 'end': + // start effect after last queued effect has finished + timestamp = this.effects.pluck('finishOn').max() || timestamp; + break; + } + + effect.startOn += timestamp; + effect.finishOn += timestamp; + + if ( !effect.options.queue.limit || (this.effects.length < effect.options.queue.limit) ) + this.effects.push(effect); + + if ( !this.interval ) + this.interval = setInterval(this.loop.bind(this), 40); + }, + remove: function( effect ) + { + this.effects = this.effects.reject(function( e ) + { + return e == effect + }); + if ( this.effects.length == 0 ) + { + clearInterval(this.interval); + this.interval = null; + } + }, + loop: function() + { + var timePos = new Date().getTime(); + this.effects.invoke('loop', timePos); + } +}); + +Effect.Queues = { + instances: $H(), + get: function( queueName ) + { + if ( typeof queueName != 'string' ) return queueName; + + if ( !this.instances[queueName] ) + this.instances[queueName] = new Effect.ScopedQueue(); + + return this.instances[queueName]; + } +} +Effect.Queue = Effect.Queues.get('global'); + +Effect.DefaultOptions = { + transition: Effect.Transitions.sinoidal, + duration: 1.0, // seconds + fps: 25.0, // max. 25fps due to Effect.Queue implementation + sync: false, // true for combining + from: 0.0, + to: 1.0, + delay: 0.0, + queue: 'parallel' +} + +Effect.Base = function() +{ +}; +Effect.Base.prototype = { + position: null, + start: function( options ) + { + this.options = Object.extend(Object.extend({}, Effect.DefaultOptions), options || {}); + this.currentFrame = 0; + this.state = 'idle'; + this.startOn = this.options.delay * 1000; + this.finishOn = this.startOn + (this.options.duration * 1000); + this.event('beforeStart'); + if ( !this.options.sync ) + Effect.Queues.get(typeof this.options.queue == 'string' ? 'global' : this.options.queue.scope).add(this); + }, + loop: function( timePos ) + { + if ( timePos >= this.startOn ) + { + if ( timePos >= this.finishOn ) + { + this.render(1.0); + this.cancel(); + this.event('beforeFinish'); + if ( this.finish ) this.finish(); + this.event('afterFinish'); + return; + } + var pos = (timePos - this.startOn) / (this.finishOn - this.startOn); + var frame = Math.round(pos * this.options.fps * this.options.duration); + if ( frame > this.currentFrame ) + { + this.render(pos); + this.currentFrame = frame; + } + } + }, + render: function( pos ) + { + if ( this.state == 'idle' ) + { + this.state = 'running'; + this.event('beforeSetup'); + if ( this.setup ) this.setup(); + this.event('afterSetup'); + } + if ( this.state == 'running' ) + { + if ( this.options.transition ) pos = this.options.transition(pos); + pos *= (this.options.to - this.options.from); + pos += this.options.from; + this.position = pos; + this.event('beforeUpdate'); + if ( this.update ) this.update(pos); + this.event('afterUpdate'); + } + }, + cancel: function() + { + if ( !this.options.sync ) + Effect.Queues.get(typeof this.options.queue == 'string' ? 'global' : this.options.queue.scope).remove(this); + this.state = 'finished'; + }, + event: function( eventName ) + { + if ( this.options[eventName + 'Internal'] ) this.options[eventName + 'Internal'](this); + if ( this.options[eventName] ) this.options[eventName](this); + }, + inspect: function() + { + return '#'; + } +} + +Effect.Parallel = Class.create(); +Object.extend(Object.extend(Effect.Parallel.prototype, Effect.Base.prototype), { + initialize: function( effects ) + { + this.effects = effects || []; + this.start(arguments[1]); + }, + update: function( position ) + { + this.effects.invoke('render', position); + }, + finish: function( position ) + { + this.effects.each(function( effect ) + { + effect.render(1.0); + effect.cancel(); + effect.event('beforeFinish'); + if ( effect.finish ) effect.finish(position); + effect.event('afterFinish'); + }); + } +}); + +Effect.Opacity = Class.create(); +Object.extend(Object.extend(Effect.Opacity.prototype, Effect.Base.prototype), { + initialize: function( element ) + { + this.element = $(element); + if ( !this.element ) throw(Effect._elementDoesNotExistError); + // make this work on IE on elements without 'layout' + if ( /MSIE/.test(navigator.userAgent) && !window.opera && (!this.element.currentStyle.hasLayout) ) + this.element.setStyle({zoom: 1}); + var options = Object.extend({ + from: this.element.getOpacity() || 0.0, + to: 1.0 + }, arguments[1] || {}); + this.start(options); + }, + update: function( position ) + { + this.element.setOpacity(position); + } +}); + +Effect.Move = Class.create(); +Object.extend(Object.extend(Effect.Move.prototype, Effect.Base.prototype), { + initialize: function( element ) + { + this.element = $(element); + if ( !this.element ) throw(Effect._elementDoesNotExistError); + var options = Object.extend({ + x: 0, + y: 0, + mode: 'relative' + }, arguments[1] || {}); + this.start(options); + }, + setup: function() + { + // Bug in Opera: Opera returns the "real" position of a static element or + // relative element that does not have top/left explicitly set. + // ==> Always set top and left for position relative elements in your stylesheets + // (to 0 if you do not need them) + this.element.makePositioned(); + this.originalLeft = parseFloat(this.element.getStyle('left') || '0'); + this.originalTop = parseFloat(this.element.getStyle('top') || '0'); + if ( this.options.mode == 'absolute' ) + { + // absolute movement, so we need to calc deltaX and deltaY + this.options.x = this.options.x - this.originalLeft; + this.options.y = this.options.y - this.originalTop; + } + }, + update: function( position ) + { + this.element.setStyle({ + left: Math.round(this.options.x * position + this.originalLeft) + 'px', + top: Math.round(this.options.y * position + this.originalTop) + 'px' + }); + } +}); + +// for backwards compatibility +Effect.MoveBy = function( element, toTop, toLeft ) +{ + return new Effect.Move(element, Object.extend({ x: toLeft, y: toTop }, arguments[3] || {})); +}; + +Effect.Scale = Class.create(); +Object.extend(Object.extend(Effect.Scale.prototype, Effect.Base.prototype), { + initialize: function( element, percent ) + { + this.element = $(element); + if ( !this.element ) throw(Effect._elementDoesNotExistError); + var options = Object.extend({ + scaleX: true, + scaleY: true, + scaleContent: true, + scaleFromCenter: false, + scaleMode: 'box', // 'box' or 'contents' or {} with provided values + scaleFrom: 100.0, + scaleTo: percent + }, arguments[2] || {}); + this.start(options); + }, + setup: function() + { + this.restoreAfterFinish = this.options.restoreAfterFinish || false; + this.elementPositioning = this.element.getStyle('position'); + + this.originalStyle = {}; + ['top','left','width','height','fontSize'].each(function( k ) + { + this.originalStyle[k] = this.element.style[k]; + }.bind(this)); + + this.originalTop = this.element.offsetTop; + this.originalLeft = this.element.offsetLeft; + + var fontSize = this.element.getStyle('font-size') || '100%'; + ['em','px','%','pt'].each(function( fontSizeType ) + { + if ( fontSize.indexOf(fontSizeType) > 0 ) + { + this.fontSize = parseFloat(fontSize); + this.fontSizeType = fontSizeType; + } + }.bind(this)); + + this.factor = (this.options.scaleTo - this.options.scaleFrom) / 100; + + this.dims = null; + if ( this.options.scaleMode == 'box' ) + this.dims = [this.element.offsetHeight, this.element.offsetWidth]; + if ( /^content/.test(this.options.scaleMode) ) + this.dims = [this.element.scrollHeight, this.element.scrollWidth]; + if ( !this.dims ) + this.dims = [this.options.scaleMode.originalHeight, + this.options.scaleMode.originalWidth]; + }, + update: function( position ) + { + var currentScale = (this.options.scaleFrom / 100.0) + (this.factor * position); + if ( this.options.scaleContent && this.fontSize ) + this.element.setStyle({fontSize: this.fontSize * currentScale + this.fontSizeType }); + this.setDimensions(this.dims[0] * currentScale, this.dims[1] * currentScale); + }, + finish: function( position ) + { + if ( this.restoreAfterFinish ) this.element.setStyle(this.originalStyle); + }, + setDimensions: function( height, width ) + { + var d = {}; + if ( this.options.scaleX ) d.width = Math.round(width) + 'px'; + if ( this.options.scaleY ) d.height = Math.round(height) + 'px'; + if ( this.options.scaleFromCenter ) + { + var topd = (height - this.dims[0]) / 2; + var leftd = (width - this.dims[1]) / 2; + if ( this.elementPositioning == 'absolute' ) + { + if ( this.options.scaleY ) d.top = this.originalTop - topd + 'px'; + if ( this.options.scaleX ) d.left = this.originalLeft - leftd + 'px'; + } + else + { + if ( this.options.scaleY ) d.top = -topd + 'px'; + if ( this.options.scaleX ) d.left = -leftd + 'px'; + } + } + this.element.setStyle(d); + } +}); + +Effect.Highlight = Class.create(); +Object.extend(Object.extend(Effect.Highlight.prototype, Effect.Base.prototype), { + initialize: function( element ) + { + this.element = $(element); + if ( !this.element ) throw(Effect._elementDoesNotExistError); + var options = Object.extend({ startcolor: '#ffff99' }, arguments[1] || {}); + this.start(options); + }, + setup: function() + { + // Prevent executing on elements not in the layout flow + if ( this.element.getStyle('display') == 'none' ) + { + this.cancel(); + return; + } + // Disable background image during the effect + this.oldStyle = { + backgroundImage: this.element.getStyle('background-image') }; + this.element.setStyle({backgroundImage: 'none'}); + if ( !this.options.endcolor ) + this.options.endcolor = this.element.getStyle('background-color').parseColor('#ffffff'); + if ( !this.options.restorecolor ) + this.options.restorecolor = this.element.getStyle('background-color'); + // init color calculations + this._base = $R(0, 2).map(function( i ) + { + return parseInt(this.options.startcolor.slice(i * 2 + 1, i * 2 + 3), 16) + }.bind(this)); + this._delta = $R(0, 2).map(function( i ) + { + return parseInt(this.options.endcolor.slice(i * 2 + 1, i * 2 + 3), 16) - this._base[i] + }.bind(this)); + }, + update: function( position ) + { + this.element.setStyle({backgroundColor: $R(0, 2).inject('#', function( m, v, i ) + { + return m + (Math.round(this._base[i] + (this._delta[i] * position)).toColorPart()); + }.bind(this)) }); + }, + finish: function() + { + this.element.setStyle(Object.extend(this.oldStyle, { + backgroundColor: this.options.restorecolor + })); + } +}); + +Effect.ScrollTo = Class.create(); +Object.extend(Object.extend(Effect.ScrollTo.prototype, Effect.Base.prototype), { + initialize: function( element ) + { + this.element = $(element); + this.start(arguments[1] || {}); + }, + setup: function() + { + Position.prepare(); + var offsets = Position.cumulativeOffset(this.element); + if ( this.options.offset ) offsets[1] += this.options.offset; + var max = window.innerHeight ? window.height - window.innerHeight : document.body.scrollHeight - + (document.documentElement.clientHeight + ? document.documentElement.clientHeight + : document.body.clientHeight); + this.scrollStart = Position.deltaY; + this.delta = (offsets[1] > max ? max : offsets[1]) - this.scrollStart; + }, + update: function( position ) + { + Position.prepare(); + window.scrollTo(Position.deltaX, this.scrollStart + (position * this.delta)); + } +}); + +/* ------------- combination effects ------------- */ + +Effect.Fade = function( element ) +{ + element = $(element); + var oldOpacity = element.getInlineOpacity(); + var options = Object.extend({ + from: element.getOpacity() || 1.0, + to: 0.0, + afterFinishInternal: function( effect ) + { + if ( effect.options.to != 0 ) return; + effect.element.hide(); + effect.element.setStyle({opacity: oldOpacity}); + }}, arguments[1] || {}); + return new Effect.Opacity(element, options); +} + +Effect.Appear = function( element ) +{ + element = $(element); + var options = Object.extend({ + from: (element.getStyle('display') == 'none' ? 0.0 : element.getOpacity() || 0.0), + to: 1.0, + // force Safari to render floated elements properly + afterFinishInternal: function( effect ) + { + effect.element.forceRerendering(); + }, + beforeSetup: function( effect ) + { + effect.element.setOpacity(effect.options.from); + effect.element.show(); + }}, arguments[1] || {}); + return new Effect.Opacity(element, options); +} + +Effect.Puff = function( element ) +{ + element = $(element); + var oldStyle = { + opacity: element.getInlineOpacity(), + position: element.getStyle('position'), + top: element.style.top, + left: element.style.left, + width: element.style.width, + height: element.style.height + }; + return new Effect.Parallel([ new Effect.Scale(element, 200, { sync: true, scaleFromCenter: true, scaleContent: true, restoreAfterFinish: true }), + new Effect.Opacity(element, { sync: true, to: 0.0 }) ], Object.extend({ duration: 1.0, + beforeSetupInternal: function( effect ) + { + Position.absolutize(effect.effects[0].element) + }, + afterFinishInternal: function( effect ) + { + effect.effects[0].element.hide(); + effect.effects[0].element.setStyle(oldStyle); + } + }, arguments[1] || {})); +} + +Effect.BlindUp = function( element ) +{ + element = $(element); + element.makeClipping(); + return new Effect.Scale(element, 0, Object.extend({ scaleContent: false, + scaleX: false, + restoreAfterFinish: true, + afterFinishInternal: function( effect ) + { + effect.element.hide(); + effect.element.undoClipping(); + } + }, arguments[1] || {})); +} + +Effect.BlindDown = function( element ) +{ + element = $(element); + var elementDimensions = element.getDimensions(); + return new Effect.Scale(element, 100, Object.extend({ + scaleContent: false, + scaleX: false, + scaleFrom: 0, + scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width}, + restoreAfterFinish: true, + afterSetup: function( effect ) + { + effect.element.makeClipping(); + effect.element.setStyle({height: '0px'}); + effect.element.show(); + }, + afterFinishInternal: function( effect ) + { + effect.element.undoClipping(); + } + }, arguments[1] || {})); +} + +Effect.SwitchOff = function( element ) +{ + element = $(element); + var oldOpacity = element.getInlineOpacity(); + return new Effect.Appear(element, Object.extend({ + duration: 0.4, + from: 0, + transition: Effect.Transitions.flicker, + afterFinishInternal: function( effect ) + { + new Effect.Scale(effect.element, 1, { + duration: 0.3, scaleFromCenter: true, + scaleX: false, scaleContent: false, restoreAfterFinish: true, + beforeSetup: function( effect ) + { + effect.element.makePositioned(); + effect.element.makeClipping(); + }, + afterFinishInternal: function( effect ) + { + effect.element.hide(); + effect.element.undoClipping(); + effect.element.undoPositioned(); + effect.element.setStyle({opacity: oldOpacity}); + } + }) + } + }, arguments[1] || {})); +} + +Effect.DropOut = function( element ) +{ + element = $(element); + var oldStyle = { + top: element.getStyle('top'), + left: element.getStyle('left'), + opacity: element.getInlineOpacity() }; + return new Effect.Parallel([ new Effect.Move(element, {x: 0, y: 100, sync: true }), + new Effect.Opacity(element, { sync: true, to: 0.0 }) ], Object.extend({ duration: 0.5, + beforeSetup: function( effect ) + { + effect.effects[0].element.makePositioned(); + }, + afterFinishInternal: function( effect ) + { + effect.effects[0].element.hide(); + effect.effects[0].element.undoPositioned(); + effect.effects[0].element.setStyle(oldStyle); + } + }, arguments[1] || {})); +} + +Effect.Shake = function( element ) +{ + element = $(element); + var oldStyle = { + top: element.getStyle('top'), + left: element.getStyle('left') }; + return new Effect.Move(element, { x: 20, y: 0, duration: 0.05, afterFinishInternal: function( effect ) + { + new Effect.Move(effect.element, { x: -40, y: 0, duration: 0.1, afterFinishInternal: function( effect ) + { + new Effect.Move(effect.element, { x: 40, y: 0, duration: 0.1, afterFinishInternal: function( effect ) + { + new Effect.Move(effect.element, { x: -40, y: 0, duration: 0.1, afterFinishInternal: function( effect ) + { + new Effect.Move(effect.element, { x: 40, y: 0, duration: 0.1, afterFinishInternal: function( + effect ) + { + new Effect.Move(effect.element, { x: -20, y: 0, duration: 0.05, afterFinishInternal: function( + effect ) + { + effect.element.undoPositioned(); + effect.element.setStyle(oldStyle); + }}) + }}) + }}) + }}) + }}) + }}); +} + +Effect.SlideDown = function( element ) +{ + element = $(element); + element.cleanWhitespace(); + // SlideDown need to have the content of the element wrapped in a container element with fixed height! + var oldInnerBottom = $(element.firstChild).getStyle('bottom'); + var elementDimensions = element.getDimensions(); + return new Effect.Scale(element, 100, Object.extend({ + scaleContent: false, + scaleX: false, + scaleFrom: window.opera ? 0 : 1, + scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width}, + restoreAfterFinish: true, + afterSetup: function( effect ) + { + effect.element.makePositioned(); + effect.element.firstChild.makePositioned(); + if ( window.opera ) effect.element.setStyle({top: ''}); + effect.element.makeClipping(); + effect.element.setStyle({height: '0px'}); + effect.element.show(); + }, + afterUpdateInternal: function( effect ) + { + effect.element.firstChild.setStyle({bottom: + (effect.dims[0] - effect.element.clientHeight) + 'px' }); + }, + afterFinishInternal: function( effect ) + { + effect.element.undoClipping(); + // IE will crash if child is undoPositioned first + if ( /MSIE/.test(navigator.userAgent) && !window.opera ) + { + effect.element.undoPositioned(); + effect.element.firstChild.undoPositioned(); + } + else + { + effect.element.firstChild.undoPositioned(); + effect.element.undoPositioned(); + } + effect.element.firstChild.setStyle({bottom: oldInnerBottom}); + } + }, arguments[1] || {})); +} + +Effect.SlideUp = function( element ) +{ + element = $(element); + element.cleanWhitespace(); + var oldInnerBottom = $(element.firstChild).getStyle('bottom'); + return new Effect.Scale(element, window.opera ? 0 : 1, Object.extend({ scaleContent: false, + scaleX: false, + scaleMode: 'box', + scaleFrom: 100, + restoreAfterFinish: true, + beforeStartInternal: function( effect ) + { + effect.element.makePositioned(); + effect.element.firstChild.makePositioned(); + if ( window.opera ) effect.element.setStyle({top: ''}); + effect.element.makeClipping(); + effect.element.show(); + }, + afterUpdateInternal: function( effect ) + { + effect.element.firstChild.setStyle({bottom: + (effect.dims[0] - effect.element.clientHeight) + 'px' }); + }, + afterFinishInternal: function( effect ) + { + effect.element.hide(); + effect.element.undoClipping(); + effect.element.firstChild.undoPositioned(); + effect.element.undoPositioned(); + effect.element.setStyle({bottom: oldInnerBottom}); + } + }, arguments[1] || {})); +} + +// Bug in opera makes the TD containing this element expand for a instance after finish +Effect.Squish = function( element ) +{ + return new Effect.Scale(element, window.opera ? 1 : 0, { restoreAfterFinish: true, + beforeSetup: function( effect ) + { + effect.element.makeClipping(effect.element); + }, + afterFinishInternal: function( effect ) + { + effect.element.hide(effect.element); + effect.element.undoClipping(effect.element); + } + }); +} + +Effect.Grow = function( element ) +{ + element = $(element); + var options = Object.extend({ + direction: 'center', + moveTransition: Effect.Transitions.sinoidal, + scaleTransition: Effect.Transitions.sinoidal, + opacityTransition: Effect.Transitions.full + }, arguments[1] || {}); + var oldStyle = { + top: element.style.top, + left: element.style.left, + height: element.style.height, + width: element.style.width, + opacity: element.getInlineOpacity() }; + + var dims = element.getDimensions(); + var initialMoveX, initialMoveY; + var moveX, moveY; + + switch ( options.direction ) + { + case 'top-left': + initialMoveX = initialMoveY = moveX = moveY = 0; + break; + case 'top-right': + initialMoveX = dims.width; + initialMoveY = moveY = 0; + moveX = -dims.width; + break; + case 'bottom-left': + initialMoveX = moveX = 0; + initialMoveY = dims.height; + moveY = -dims.height; + break; + case 'bottom-right': + initialMoveX = dims.width; + initialMoveY = dims.height; + moveX = -dims.width; + moveY = -dims.height; + break; + case 'center': + initialMoveX = dims.width / 2; + initialMoveY = dims.height / 2; + moveX = -dims.width / 2; + moveY = -dims.height / 2; + break; + } + + return new Effect.Move(element, { + x: initialMoveX, + y: initialMoveY, + duration: 0.01, + beforeSetup: function( effect ) + { + effect.element.hide(); + effect.element.makeClipping(); + effect.element.makePositioned(); + }, + afterFinishInternal: function( effect ) + { + new Effect.Parallel([ new Effect.Opacity(effect.element, { sync: true, to: 1.0, from: 0.0, transition: options.opacityTransition }), + new Effect.Move(effect.element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition }), + new Effect.Scale(effect.element, 100, { + scaleMode: { originalHeight: dims.height, originalWidth: dims.width }, + sync: true, scaleFrom: window.opera ? 1 + : 0, transition: options.scaleTransition, restoreAfterFinish: true}) + ], Object.extend({ + beforeSetup: function( effect ) + { + effect.effects[0].element.setStyle({height: '0px'}); + effect.effects[0].element.show(); + }, + afterFinishInternal: function( effect ) + { + effect.effects[0].element.undoClipping(); + effect.effects[0].element.undoPositioned(); + effect.effects[0].element.setStyle(oldStyle); + } + }, options)) + } + }); +} + +Effect.Shrink = function( element ) +{ + element = $(element); + var options = Object.extend({ + direction: 'center', + moveTransition: Effect.Transitions.sinoidal, + scaleTransition: Effect.Transitions.sinoidal, + opacityTransition: Effect.Transitions.none + }, arguments[1] || {}); + var oldStyle = { + top: element.style.top, + left: element.style.left, + height: element.style.height, + width: element.style.width, + opacity: element.getInlineOpacity() }; + + var dims = element.getDimensions(); + var moveX, moveY; + + switch ( options.direction ) + { + case 'top-left': + moveX = moveY = 0; + break; + case 'top-right': + moveX = dims.width; + moveY = 0; + break; + case 'bottom-left': + moveX = 0; + moveY = dims.height; + break; + case 'bottom-right': + moveX = dims.width; + moveY = dims.height; + break; + case 'center': + moveX = dims.width / 2; + moveY = dims.height / 2; + break; + } + + return new Effect.Parallel([ new Effect.Opacity(element, { sync: true, to: 0.0, from: 1.0, transition: options.opacityTransition }), + new Effect.Scale(element, window.opera ? 1 + : 0, { sync: true, transition: options.scaleTransition, restoreAfterFinish: true}), + new Effect.Move(element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition }) + ], Object.extend({ + beforeStartInternal: function( effect ) + { + effect.effects[0].element.makePositioned(); + effect.effects[0].element.makeClipping(); + }, + afterFinishInternal: function( effect ) + { + effect.effects[0].element.hide(); + effect.effects[0].element.undoClipping(); + effect.effects[0].element.undoPositioned(); + effect.effects[0].element.setStyle(oldStyle); + } + }, options)); +} + +Effect.Pulsate = function( element ) +{ + element = $(element); + var options = arguments[1] || {}; + var oldOpacity = element.getInlineOpacity(); + var transition = options.transition || Effect.Transitions.sinoidal; + var reverser = function( pos ) + { + return transition(1 - Effect.Transitions.pulse(pos)) + }; + reverser.bind(transition); + return new Effect.Opacity(element, Object.extend(Object.extend({ duration: 3.0, from: 0, + afterFinishInternal: function( effect ) + { + effect.element.setStyle({opacity: oldOpacity}); + } + }, options), {transition: reverser})); +} + +Effect.Fold = function( element ) +{ + element = $(element); + var oldStyle = { + top: element.style.top, + left: element.style.left, + width: element.style.width, + height: element.style.height }; + Element.makeClipping(element); + return new Effect.Scale(element, 5, Object.extend({ + scaleContent: false, + scaleX: false, + afterFinishInternal: function( effect ) + { + new Effect.Scale(element, 1, { + scaleContent: false, + scaleY: false, + afterFinishInternal: function( effect ) + { + effect.element.hide(); + effect.element.undoClipping(); + effect.element.setStyle(oldStyle); + } }); + }}, arguments[1] || {})); +}; + +['setOpacity','getOpacity','getInlineOpacity','forceRerendering','setContentZoom', + 'collectTextNodes','collectTextNodesIgnoreClass','childrenWithClassName'].each(function( f ) +{ + Element.Methods[f] = Element[f]; +}); + +Element.Methods.visualEffect = function( element, effect, options ) +{ + s = effect.gsub(/_/, '-').camelize(); + effect_class = s.charAt(0).toUpperCase() + s.substring(1); + new Effect[effect_class](element, options); + return $(element); +}; + +Element.addMethods(); \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/scriptaculous/prototype.js b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/scriptaculous/prototype.js new file mode 100644 index 000000000..3131da7ff --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/scriptaculous/prototype.js @@ -0,0 +1,2696 @@ +/* + * 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. + */ + +/* Prototype JavaScript framework, version 1.5.0_rc1 + * (c) 2005 Sam Stephenson + * + * Prototype is freely distributable under the terms of an MIT-style license. + * For details, see the Prototype web site: http://prototype.conio.net/ + * +/*--------------------------------------------------------------------------*/ + +var Prototype = { + Version: '1.5.0_rc1', + ScriptFragment: '(?:)((\n|\r|.)*?)(?:<\/script>)', + + emptyFunction: function() + { + }, + K: function( x ) + { + return x + } +} + +var Class = { + create: function() + { + return function() + { + this.initialize.apply(this, arguments); + } + } +} + +var Abstract = new Object(); + +Object.extend = function( destination, source ) +{ + for ( var property in source ) + { + destination[property] = source[property]; + } + return destination; +} + +Object.extend(Object, { + inspect: function( object ) + { + try + { + if ( object == undefined ) return 'undefined'; + if ( object == null ) return 'null'; + return object.inspect ? object.inspect() : object.toString(); + } + catch ( e ) + { + if ( e instanceof RangeError ) return '...'; + throw e; + } + }, + + keys: function( object ) + { + var keys = []; + for ( var property in object ) + keys.push(property); + return keys; + }, + + values: function( object ) + { + var values = []; + for ( var property in object ) + values.push(object[property]); + return values; + }, + + clone: function( object ) + { + return Object.extend({}, object); + } +}); + +Function.prototype.bind = function() +{ + var __method = this, args = $A(arguments), object = args.shift(); + return function() + { + return __method.apply(object, args.concat($A(arguments))); + } +} + +Function.prototype.bindAsEventListener = function( object ) +{ + var __method = this, args = $A(arguments), object = args.shift(); + return function( event ) + { + return __method.apply(object, [( event || window.event)].concat(args).concat($A(arguments))); + } +} + +Object.extend(Number.prototype, { + toColorPart: function() + { + var digits = this.toString(16); + if ( this < 16 ) return '0' + digits; + return digits; + }, + + succ: function() + { + return this + 1; + }, + + times: function( iterator ) + { + $R(0, this, true).each(iterator); + return this; + } +}); + +var Try = { + these: function() + { + var returnValue; + + for ( var i = 0; i < arguments.length; i++ ) + { + var lambda = arguments[i]; + try + { + returnValue = lambda(); + break; + } + catch ( e ) + { + } + } + + return returnValue; + } +} + +/*--------------------------------------------------------------------------*/ + +var PeriodicalExecuter = Class.create(); +PeriodicalExecuter.prototype = { + initialize: function( callback, frequency ) + { + this.callback = callback; + this.frequency = frequency; + this.currentlyExecuting = false; + + this.registerCallback(); + }, + + registerCallback: function() + { + this.timer = setInterval(this.onTimerEvent.bind(this), this.frequency * 1000); + }, + + stop: function() + { + if ( !this.timer ) return; + clearInterval(this.timer); + this.timer = null; + }, + + onTimerEvent: function() + { + if ( !this.currentlyExecuting ) + { + try + { + this.currentlyExecuting = true; + this.callback(this); + } + finally + { + this.currentlyExecuting = false; + } + } + } +} +Object.extend(String.prototype, { + gsub: function( pattern, replacement ) + { + var result = '', source = this, match; + replacement = arguments.callee.prepareReplacement(replacement); + + while ( source.length > 0 ) + { + if ( match = source.match(pattern) ) + { + result += source.slice(0, match.index); + result += (replacement(match) || '').toString(); + source = source.slice(match.index + match[0].length); + } + else + { + result += source,source = ''; + } + } + return result; + }, + + sub: function( pattern, replacement, count ) + { + replacement = this.gsub.prepareReplacement(replacement); + count = count === undefined ? 1 : count; + + return this.gsub(pattern, function( match ) + { + if ( --count < 0 ) return match[0]; + return replacement(match); + }); + }, + + scan: function( pattern, iterator ) + { + this.gsub(pattern, iterator); + return this; + }, + + truncate: function( length, truncation ) + { + length = length || 30; + truncation = truncation === undefined ? '...' : truncation; + return this.length > length ? this.slice(0, length - truncation.length) + truncation : this; + }, + + strip: function() + { + return this.replace(/^\s+/, '').replace(/\s+$/, ''); + }, + + stripTags: function() + { + return this.replace(/<\/?[^>]+>/gi, ''); + }, + + stripScripts: function() + { + return this.replace(new RegExp(Prototype.ScriptFragment, 'img'), ''); + }, + + extractScripts: function() + { + var matchAll = new RegExp(Prototype.ScriptFragment, 'img'); + var matchOne = new RegExp(Prototype.ScriptFragment, 'im'); + return (this.match(matchAll) || []).map(function( scriptTag ) + { + return (scriptTag.match(matchOne) || ['', ''])[1]; + }); + }, + + evalScripts: function() + { + return this.extractScripts().map(function( script ) + { + return eval(script) + }); + }, + + escapeHTML: function() + { + var div = document.createElement('div'); + var text = document.createTextNode(this); + div.appendChild(text); + return div.innerHTML; + }, + + unescapeHTML: function() + { + var div = document.createElement('div'); + div.innerHTML = this.stripTags(); + return div.childNodes[0] ? div.childNodes[0].nodeValue : ''; + }, + + toQueryParams: function() + { + var pairs = this.match(/^\??(.*)$/)[1].split('&'); + return pairs.inject({}, function( params, pairString ) + { + var pair = pairString.split('='); + var value = pair[1] ? decodeURIComponent(pair[1]) : undefined; + params[decodeURIComponent(pair[0])] = value; + return params; + }); + }, + + toArray: function() + { + return this.split(''); + }, + + camelize: function() + { + var oStringList = this.split('-'); + if ( oStringList.length == 1 ) return oStringList[0]; + + var camelizedString = this.indexOf('-') == 0 ? oStringList[0].charAt(0).toUpperCase() + + oStringList[0].substring(1) : oStringList[0]; + + for ( var i = 1, len = oStringList.length; i < len; i++ ) + { + var s = oStringList[i]; + camelizedString += s.charAt(0).toUpperCase() + s.substring(1); + } + + return camelizedString; + }, + + inspect: function( useDoubleQuotes ) + { + var escapedString = this.replace(/\\/g, '\\\\'); + if ( useDoubleQuotes ) + return '"' + escapedString.replace(/"/g, '\\"') + '"'; + else + return "'" + escapedString.replace(/'/g, '\\\'') + "'"; + } +}); + +String.prototype.gsub.prepareReplacement = function( replacement ) +{ + if ( typeof replacement == 'function' ) return replacement; + var template = new Template(replacement); + return function( match ) + { + return template.evaluate(match) + }; +} + +String.prototype.parseQuery = String.prototype.toQueryParams; + +var Template = Class.create(); +Template.Pattern = /(^|.|\r|\n)(#\{(.*?)\})/; +Template.prototype = { + initialize: function( template, pattern ) + { + this.template = template.toString(); + this.pattern = pattern || Template.Pattern; + }, + + evaluate: function( object ) + { + return this.template.gsub(this.pattern, function( match ) + { + var before = match[1]; + if ( before == '\\' ) return match[2]; + return before + (object[match[3]] || '').toString(); + }); + } +} + +var $break = new Object(); +var $continue = new Object(); + +var Enumerable = { + each: function( iterator ) + { + var index = 0; + try + { + this._each(function( value ) + { + try + { + iterator(value, index++); + } + catch ( e ) + { + if ( e != $continue ) throw e; + } + }); + } + catch ( e ) + { + if ( e != $break ) throw e; + } + }, + + all: function( iterator ) + { + var result = true; + this.each(function( value, index ) + { + result = result && !!(iterator || Prototype.K)(value, index); + if ( !result ) throw $break; + }); + return result; + }, + + any: function( iterator ) + { + var result = false; + this.each(function( value, index ) + { + if ( result = !!(iterator || Prototype.K)(value, index) ) + throw $break; + }); + return result; + }, + + collect: function( iterator ) + { + var results = []; + this.each(function( value, index ) + { + results.push(iterator(value, index)); + }); + return results; + }, + + detect: function ( iterator ) + { + var result; + this.each(function( value, index ) + { + if ( iterator(value, index) ) + { + result = value; + throw $break; + } + }); + return result; + }, + + findAll: function( iterator ) + { + var results = []; + this.each(function( value, index ) + { + if ( iterator(value, index) ) + results.push(value); + }); + return results; + }, + + grep: function( pattern, iterator ) + { + var results = []; + this.each(function( value, index ) + { + var stringValue = value.toString(); + if ( stringValue.match(pattern) ) + results.push((iterator || Prototype.K)(value, index)); + }) + return results; + }, + + include: function( object ) + { + var found = false; + this.each(function( value ) + { + if ( value == object ) + { + found = true; + throw $break; + } + }); + return found; + }, + + inject: function( memo, iterator ) + { + this.each(function( value, index ) + { + memo = iterator(memo, value, index); + }); + return memo; + }, + + invoke: function( method ) + { + var args = $A(arguments).slice(1); + return this.collect(function( value ) + { + return value[method].apply(value, args); + }); + }, + + max: function( iterator ) + { + var result; + this.each(function( value, index ) + { + value = (iterator || Prototype.K)(value, index); + if ( result == undefined || value >= result ) + result = value; + }); + return result; + }, + + min: function( iterator ) + { + var result; + this.each(function( value, index ) + { + value = (iterator || Prototype.K)(value, index); + if ( result == undefined || value < result ) + result = value; + }); + return result; + }, + + partition: function( iterator ) + { + var trues = [], falses = []; + this.each(function( value, index ) + { + ((iterator || Prototype.K)(value, index) ? trues : falses).push(value); + }); + return [trues, falses]; + }, + + pluck: function( property ) + { + var results = []; + this.each(function( value, index ) + { + results.push(value[property]); + }); + return results; + }, + + reject: function( iterator ) + { + var results = []; + this.each(function( value, index ) + { + if ( !iterator(value, index) ) + results.push(value); + }); + return results; + }, + + sortBy: function( iterator ) + { + return this.collect(function( value, index ) + { + return {value: value, criteria: iterator(value, index)}; + }).sort(function( left, right ) + { + var a = left.criteria, b = right.criteria; + return a < b ? -1 : a > b ? 1 : 0; + }).pluck('value'); + }, + + toArray: function() + { + return this.collect(Prototype.K); + }, + + zip: function() + { + var iterator = Prototype.K, args = $A(arguments); + if ( typeof args.last() == 'function' ) + iterator = args.pop(); + + var collections = [this].concat(args).map($A); + return this.map(function( value, index ) + { + return iterator(collections.pluck(index)); + }); + }, + + inspect: function() + { + return '#'; + } +} + +Object.extend(Enumerable, { + map: Enumerable.collect, + find: Enumerable.detect, + select: Enumerable.findAll, + member: Enumerable.include, + entries: Enumerable.toArray +}); +var $A = Array.from = function( iterable ) +{ + if ( !iterable ) return []; + if ( iterable.toArray ) + { + return iterable.toArray(); + } + else + { + var results = []; + for ( var i = 0; i < iterable.length; i++ ) + results.push(iterable[i]); + return results; + } +} + +Object.extend(Array.prototype, Enumerable); + +if ( !Array.prototype._reverse ) + Array.prototype._reverse = Array.prototype.reverse; + +Object.extend(Array.prototype, { + _each: function( iterator ) + { + for ( var i = 0; i < this.length; i++ ) + iterator(this[i]); + }, + + clear: function() + { + this.length = 0; + return this; + }, + + first: function() + { + return this[0]; + }, + + last: function() + { + return this[this.length - 1]; + }, + + compact: function() + { + return this.select(function( value ) + { + return value != undefined || value != null; + }); + }, + + flatten: function() + { + return this.inject([], function( array, value ) + { + return array.concat(value && value.constructor == Array ? value.flatten() : [value]); + }); + }, + + without: function() + { + var values = $A(arguments); + return this.select(function( value ) + { + return !values.include(value); + }); + }, + + indexOf: function( object ) + { + for ( var i = 0; i < this.length; i++ ) + if ( this[i] == object ) return i; + return -1; + }, + + reverse: function( inline ) + { + return (inline !== false ? this : this.toArray())._reverse(); + }, + + reduce: function() + { + return this.length > 1 ? this : this[0]; + }, + + uniq: function() + { + return this.inject([], function( array, value ) + { + return array.include(value) ? array : array.concat([value]); + }); + }, + + inspect: function() + { + return '[' + this.map(Object.inspect).join(', ') + ']'; + } +}); +var Hash = { + _each: function( iterator ) + { + for ( var key in this ) + { + var value = this[key]; + if ( typeof value == 'function' ) continue; + + var pair = [key, value]; + pair.key = key; + pair.value = value; + iterator(pair); + } + }, + + keys: function() + { + return this.pluck('key'); + }, + + values: function() + { + return this.pluck('value'); + }, + + merge: function( hash ) + { + return $H(hash).inject($H(this), function( mergedHash, pair ) + { + mergedHash[pair.key] = pair.value; + return mergedHash; + }); + }, + + toQueryString: function() + { + return this.map(function( pair ) + { + return pair.map(encodeURIComponent).join('='); + }).join('&'); + }, + + inspect: function() + { + return '#'; + } +} + +function $H( object ) +{ + var hash = Object.extend({}, object || {}); + Object.extend(hash, Enumerable); + Object.extend(hash, Hash); + return hash; +} +ObjectRange = Class.create(); +Object.extend(ObjectRange.prototype, Enumerable); +Object.extend(ObjectRange.prototype, { + initialize: function( start, end, exclusive ) + { + this.start = start; + this.end = end; + this.exclusive = exclusive; + }, + + _each: function( iterator ) + { + var value = this.start; + while ( this.include(value) ) + { + iterator(value); + value = value.succ(); + } + }, + + include: function( value ) + { + if ( value < this.start ) + return false; + if ( this.exclusive ) + return value < this.end; + return value <= this.end; + } +}); + +var $R = function( start, end, exclusive ) +{ + return new ObjectRange(start, end, exclusive); +} + +var Ajax = { + getTransport: function() + { + return Try.these(function() + { + return new XMLHttpRequest() + }, function() + { + return new ActiveXObject('Msxml2.XMLHTTP') + }, function() + { + return new ActiveXObject('Microsoft.XMLHTTP') + }) || false; + }, + + activeRequestCount: 0 +} + +Ajax.Responders = { + responders: [], + + _each: function( iterator ) + { + this.responders._each(iterator); + }, + + register: function( responderToAdd ) + { + if ( !this.include(responderToAdd) ) + this.responders.push(responderToAdd); + }, + + unregister: function( responderToRemove ) + { + this.responders = this.responders.without(responderToRemove); + }, + + dispatch: function( callback, request, transport, json ) + { + this.each(function( responder ) + { + if ( responder[callback] && typeof responder[callback] == 'function' ) + { + try + { + responder[callback].apply(responder, [request, transport, json]); + } + catch ( e ) + { + } + } + }); + } +}; + +Object.extend(Ajax.Responders, Enumerable); + +Ajax.Responders.register({ + onCreate: function() + { + Ajax.activeRequestCount++; + }, + + onComplete: function() + { + Ajax.activeRequestCount--; + } +}); + +Ajax.Base = function() +{ +}; +Ajax.Base.prototype = { + setOptions: function( options ) + { + this.options = { + method: 'post', + asynchronous: true, + contentType: 'application/x-www-form-urlencoded', + parameters: '' + } + Object.extend(this.options, options || {}); + }, + + responseIsSuccess: function() + { + return this.transport.status == undefined || this.transport.status == 0 || + (this.transport.status >= 200 && this.transport.status < 300); + }, + + responseIsFailure: function() + { + return !this.responseIsSuccess(); + } +} + +Ajax.Request = Class.create(); +Ajax.Request.Events = ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete']; + +Ajax.Request.prototype = Object.extend(new Ajax.Base(), { + initialize: function( url, options ) + { + this.transport = Ajax.getTransport(); + this.setOptions(options); + this.request(url); + }, + + request: function( url ) + { + var parameters = this.options.parameters || ''; + if ( parameters.length > 0 ) parameters += '&_='; + + /* Simulate other verbs over post */ + if ( this.options.method != 'get' && this.options.method != 'post' ) + { + parameters += (parameters.length > 0 ? '&' : '') + '_method=' + this.options.method; + this.options.method = 'post'; + } + + try + { + this.url = url; + if ( this.options.method == 'get' && parameters.length > 0 ) + this.url += (this.url.match(/\?/) ? '&' : '?') + parameters; + + Ajax.Responders.dispatch('onCreate', this, this.transport); + + this.transport.open(this.options.method, this.url, this.options.asynchronous); + + if ( this.options.asynchronous ) + setTimeout(function() + { + this.respondToReadyState(1) + }.bind(this), 10); + + this.transport.onreadystatechange = this.onStateChange.bind(this); + this.setRequestHeaders(); + + var body = this.options.postBody ? this.options.postBody : parameters; + this.transport.send(this.options.method == 'post' ? body : null); + + /* Force Firefox to handle ready state 4 for synchronous requests */ + if ( !this.options.asynchronous && this.transport.overrideMimeType ) + this.onStateChange(); + + } + catch ( e ) + { + this.dispatchException(e); + } + }, + + setRequestHeaders: function() + { + var requestHeaders = ['X-Requested-With', 'XMLHttpRequest', + 'X-Prototype-Version', Prototype.Version, + 'Accept', 'text/javascript, text/html, application/xml, text/xml, */*']; + + if ( this.options.method == 'post' ) + { + requestHeaders.push('Content-type', this.options.contentType); + + /* Force "Connection: close" for Mozilla browsers to work around + * a bug where XMLHttpReqeuest sends an incorrect Content-length + * header. See Mozilla Bugzilla #246651. + */ + if ( this.transport.overrideMimeType ) + requestHeaders.push('Connection', 'close'); + } + + if ( this.options.requestHeaders ) + requestHeaders.push.apply(requestHeaders, this.options.requestHeaders); + + for ( var i = 0; i < requestHeaders.length; i += 2 ) + this.transport.setRequestHeader(requestHeaders[i], requestHeaders[i + 1]); + }, + + onStateChange: function() + { + var readyState = this.transport.readyState; + if ( readyState != 1 ) + this.respondToReadyState(this.transport.readyState); + }, + + header: function( name ) + { + try + { + return this.transport.getResponseHeader(name); + } + catch ( e ) + { + } + }, + + evalJSON: function() + { + try + { + return eval('(' + this.header('X-JSON') + ')'); + } + catch ( e ) + { + } + }, + + evalResponse: function() + { + try + { + return eval(this.transport.responseText); + } + catch ( e ) + { + this.dispatchException(e); + } + }, + + respondToReadyState: function( readyState ) + { + var event = Ajax.Request.Events[readyState]; + var transport = this.transport, json = this.evalJSON(); + + if ( event == 'Complete' ) + { + try + { + (this.options['on' + this.transport.status] || + this.options['on' + (this.responseIsSuccess() ? 'Success' : 'Failure')] || + Prototype.emptyFunction)(transport, json); + } + catch ( e ) + { + this.dispatchException(e); + } + + if ( (this.header('Content-type') || '').match(/^text\/javascript/i) ) + this.evalResponse(); + } + + try + { + (this.options['on' + event] || Prototype.emptyFunction)(transport, json); + Ajax.Responders.dispatch('on' + event, this, transport, json); + } + catch ( e ) + { + this.dispatchException(e); + } + + /* Avoid memory leak in MSIE: clean up the oncomplete event handler */ + if ( event == 'Complete' ) + this.transport.onreadystatechange = Prototype.emptyFunction; + }, + + dispatchException: function( exception ) + { + (this.options.onException || Prototype.emptyFunction)(this, exception); + Ajax.Responders.dispatch('onException', this, exception); + } +}); + +Ajax.Updater = Class.create(); + +Object.extend(Object.extend(Ajax.Updater.prototype, Ajax.Request.prototype), { + initialize: function( container, url, options ) + { + this.containers = { + success: container.success ? $(container.success) : $(container), + failure: container.failure ? $(container.failure) : (container.success ? null : $(container)) + } + + this.transport = Ajax.getTransport(); + this.setOptions(options); + + var onComplete = this.options.onComplete || Prototype.emptyFunction; + this.options.onComplete = (function( transport, object ) + { + this.updateContent(); + onComplete(transport, object); + }).bind(this); + + this.request(url); + }, + + updateContent: function() + { + var receiver = this.responseIsSuccess() ? this.containers.success : this.containers.failure; + var response = this.transport.responseText; + + if ( !this.options.evalScripts ) + response = response.stripScripts(); + + if ( receiver ) + { + if ( this.options.insertion ) + { + new this.options.insertion(receiver, response); + } + else + { + Element.update(receiver, response); + } + } + + if ( this.responseIsSuccess() ) + { + if ( this.onComplete ) + setTimeout(this.onComplete.bind(this), 10); + } + } +}); + +Ajax.PeriodicalUpdater = Class.create(); +Ajax.PeriodicalUpdater.prototype = Object.extend(new Ajax.Base(), { + initialize: function( container, url, options ) + { + this.setOptions(options); + this.onComplete = this.options.onComplete; + + this.frequency = (this.options.frequency || 2); + this.decay = (this.options.decay || 1); + + this.updater = {}; + this.container = container; + this.url = url; + + this.start(); + }, + + start: function() + { + this.options.onComplete = this.updateComplete.bind(this); + this.onTimerEvent(); + }, + + stop: function() + { + this.updater.options.onComplete = undefined; + clearTimeout(this.timer); + (this.onComplete || Prototype.emptyFunction).apply(this, arguments); + }, + + updateComplete: function( request ) + { + if ( this.options.decay ) + { + this.decay = (request.responseText == this.lastText ? this.decay * this.options.decay : 1); + + this.lastText = request.responseText; + } + this.timer = setTimeout(this.onTimerEvent.bind(this), this.decay * this.frequency * 1000); + }, + + onTimerEvent: function() + { + this.updater = new Ajax.Updater(this.container, this.url, this.options); + } +}); +function $() +{ + var results = [], element; + for ( var i = 0; i < arguments.length; i++ ) + { + element = arguments[i]; + if ( typeof element == 'string' ) + element = document.getElementById(element); + results.push(Element.extend(element)); + } + return results.reduce(); +} + +document.getElementsByClassName = function( className, parentElement ) +{ + var children = ($(parentElement) || document.body).getElementsByTagName('*'); + return $A(children).inject([], function( elements, child ) + { + if ( child.className.match(new RegExp("(^|\\s)" + className + "(\\s|$)")) ) + elements.push(Element.extend(child)); + return elements; + }); +} + +/*--------------------------------------------------------------------------*/ + +if ( !window.Element ) + var Element = new Object(); + +Element.extend = function( element ) +{ + if ( !element ) return; + if ( _nativeExtensions || element.nodeType == 3 ) return element; + + if ( !element._extended && element.tagName && element != window ) + { + var methods = Object.clone(Element.Methods), cache = Element.extend.cache; + + if ( element.tagName == 'FORM' ) + Object.extend(methods, Form.Methods); + if ( ['INPUT', 'TEXTAREA', 'SELECT'].include(element.tagName) ) + Object.extend(methods, Form.Element.Methods); + + for ( var property in methods ) + { + var value = methods[property]; + if ( typeof value == 'function' ) + element[property] = cache.findOrStore(value); + } + } + + element._extended = true; + return element; +} + +Element.extend.cache = { + findOrStore: function( value ) + { + return this[value] = this[value] || function() + { + return value.apply(null, [this].concat($A(arguments))); + } + } +} + +Element.Methods = { + visible: function( element ) + { + return $(element).style.display != 'none'; + }, + + toggle: function( element ) + { + element = $(element); + Element[Element.visible(element) ? 'hide' : 'show'](element); + return element; + }, + + hide: function( element ) + { + $(element).style.display = 'none'; + return element; + }, + + show: function( element ) + { + $(element).style.display = ''; + return element; + }, + + remove: function( element ) + { + element = $(element); + element.parentNode.removeChild(element); + return element; + }, + + update: function( element, html ) + { + $(element).innerHTML = html.stripScripts(); + setTimeout(function() + { + html.evalScripts() + }, 10); + return element; + }, + + replace: function( element, html ) + { + element = $(element); + if ( element.outerHTML ) + { + element.outerHTML = html.stripScripts(); + } + else + { + var range = element.ownerDocument.createRange(); + range.selectNodeContents(element); + element.parentNode.replaceChild(range.createContextualFragment(html.stripScripts()), element); + } + setTimeout(function() + { + html.evalScripts() + }, 10); + return element; + }, + + inspect: function( element ) + { + element = $(element); + var result = '<' + element.tagName.toLowerCase(); + $H({'id': 'id', 'className': 'class'}).each(function( pair ) + { + var property = pair.first(), attribute = pair.last(); + var value = (element[property] || '').toString(); + if ( value ) result += ' ' + attribute + '=' + value.inspect(true); + }); + return result + '>'; + }, + + recursivelyCollect: function( element, property ) + { + element = $(element); + var elements = []; + while ( element = element[property] ) + if ( element.nodeType == 1 ) + elements.push(Element.extend(element)); + return elements; + }, + + ancestors: function( element ) + { + return $(element).recursivelyCollect('parentNode'); + }, + + descendants: function( element ) + { + element = $(element); + return $A(element.getElementsByTagName('*')); + }, + + previousSiblings: function( element ) + { + return $(element).recursivelyCollect('previousSibling'); + }, + + nextSiblings: function( element ) + { + return $(element).recursivelyCollect('nextSibling'); + }, + + siblings: function( element ) + { + element = $(element); + return element.previousSiblings().reverse().concat(element.nextSiblings()); + }, + + match: function( element, selector ) + { + element = $(element); + if ( typeof selector == 'string' ) + selector = new Selector(selector); + return selector.match(element); + }, + + up: function( element, expression, index ) + { + return Selector.findElement($(element).ancestors(), expression, index); + }, + + down: function( element, expression, index ) + { + return Selector.findElement($(element).descendants(), expression, index); + }, + + previous: function( element, expression, index ) + { + return Selector.findElement($(element).previousSiblings(), expression, index); + }, + + next: function( element, expression, index ) + { + return Selector.findElement($(element).nextSiblings(), expression, index); + }, + + getElementsBySelector: function() + { + var args = $A(arguments), element = $(args.shift()); + return Selector.findChildElements(element, args); + }, + + getElementsByClassName: function( element, className ) + { + element = $(element); + return document.getElementsByClassName(className, element); + }, + + getHeight: function( element ) + { + element = $(element); + return element.offsetHeight; + }, + + classNames: function( element ) + { + return new Element.ClassNames(element); + }, + + hasClassName: function( element, className ) + { + if ( !(element = $(element)) ) return; + return Element.classNames(element).include(className); + }, + + addClassName: function( element, className ) + { + if ( !(element = $(element)) ) return; + Element.classNames(element).add(className); + return element; + }, + + removeClassName: function( element, className ) + { + if ( !(element = $(element)) ) return; + Element.classNames(element).remove(className); + return element; + }, + + observe: function() + { + Event.observe.apply(Event, arguments); + return $A(arguments).first(); + }, + + stopObserving: function() + { + Event.stopObserving.apply(Event, arguments); + return $A(arguments).first(); + }, + +// removes whitespace-only text node children + cleanWhitespace: function( element ) + { + element = $(element); + var node = element.firstChild; + while ( node ) + { + var nextNode = node.nextSibling; + if ( node.nodeType == 3 && !/\S/.test(node.nodeValue) ) + element.removeChild(node); + node = nextNode; + } + return element; + }, + + empty: function( element ) + { + return $(element).innerHTML.match(/^\s*$/); + }, + + childOf: function( element, ancestor ) + { + element = $(element),ancestor = $(ancestor); + while ( element = element.parentNode ) + if ( element == ancestor ) return true; + return false; + }, + + scrollTo: function( element ) + { + element = $(element); + var x = element.x ? element.x : element.offsetLeft, + y = element.y ? element.y : element.offsetTop; + window.scrollTo(x, y); + return element; + }, + + getStyle: function( element, style ) + { + element = $(element); + var value = element.style[style.camelize()]; + if ( !value ) + { + if ( document.defaultView && document.defaultView.getComputedStyle ) + { + var css = document.defaultView.getComputedStyle(element, null); + value = css ? css.getPropertyValue(style) : null; + } + else if ( element.currentStyle ) + { + value = element.currentStyle[style.camelize()]; + } + } + + if ( window.opera && ['left', 'top', 'right', 'bottom'].include(style) ) + if ( Element.getStyle(element, 'position') == 'static' ) value = 'auto'; + + return value == 'auto' ? null : value; + }, + + setStyle: function( element, style ) + { + element = $(element); + for ( var name in style ) + element.style[name.camelize()] = style[name]; + return element; + }, + + getDimensions: function( element ) + { + element = $(element); + if ( Element.getStyle(element, 'display') != 'none' ) + return {width: element.offsetWidth, height: element.offsetHeight}; + + // All *Width and *Height properties give 0 on elements with display none, + // so enable the element temporarily + var els = element.style; + var originalVisibility = els.visibility; + var originalPosition = els.position; + els.visibility = 'hidden'; + els.position = 'absolute'; + els.display = ''; + var originalWidth = element.clientWidth; + var originalHeight = element.clientHeight; + els.display = 'none'; + els.position = originalPosition; + els.visibility = originalVisibility; + return {width: originalWidth, height: originalHeight}; + }, + + makePositioned: function( element ) + { + element = $(element); + var pos = Element.getStyle(element, 'position'); + if ( pos == 'static' || !pos ) + { + element._madePositioned = true; + element.style.position = 'relative'; + // Opera returns the offset relative to the positioning context, when an + // element is position relative but top and left have not been defined + if ( window.opera ) + { + element.style.top = 0; + element.style.left = 0; + } + } + return element; + }, + + undoPositioned: function( element ) + { + element = $(element); + if ( element._madePositioned ) + { + element._madePositioned = undefined; + element.style.position = + element.style.top = element.style.left = element.style.bottom = element.style.right = ''; + } + return element; + }, + + makeClipping: function( element ) + { + element = $(element); + if ( element._overflow ) return; + element._overflow = element.style.overflow || 'auto'; + if ( (Element.getStyle(element, 'overflow') || 'visible') != 'hidden' ) + element.style.overflow = 'hidden'; + return element; + }, + + undoClipping: function( element ) + { + element = $(element); + if ( !element._overflow ) return; + element.style.overflow = element._overflow == 'auto' ? '' : element._overflow; + element._overflow = null; + return element; + } +} + +// IE is missing .innerHTML support for TABLE-related elements +if ( document.all ) +{ + Element.Methods.update = function( element, html ) + { + element = $(element); + var tagName = element.tagName.toUpperCase(); + if ( ['THEAD','TBODY','TR','TD'].indexOf(tagName) > -1 ) + { + var div = document.createElement('div'); + switch ( tagName ) + { + case 'THEAD': + case 'TBODY': + div.innerHTML = '' + html.stripScripts() + '
    '; + depth = 2; + break; + case 'TR': + div.innerHTML = '' + html.stripScripts() + '
    '; + depth = 3; + break; + case 'TD': + div.innerHTML = '
    ' + html.stripScripts() + '
    '; + depth = 4; + } + $A(element.childNodes).each(function( node ) + { + element.removeChild(node) + }); + depth.times(function() + { + div = div.firstChild + }); + + $A(div.childNodes).each(function( node ) + { + element.appendChild(node) + }); + } + else + { + element.innerHTML = html.stripScripts(); + } + setTimeout(function() + { + html.evalScripts() + }, 10); + return element; + } +} + +Object.extend(Element, Element.Methods); + +var _nativeExtensions = false; + +if ( !window.HTMLElement && /Konqueror|Safari|KHTML/.test(navigator.userAgent) ) +{ + /* Emulate HTMLElement, HTMLFormElement, HTMLInputElement, HTMLTextAreaElement, +and HTMLSelectElement in Safari */ + ['', 'Form', 'Input', 'TextArea', 'Select'].each(function( tag ) + { + var klass = window['HTML' + tag + 'Element'] = {}; + klass.prototype = document.createElement(tag ? tag.toLowerCase() : 'div').__proto__; + }); +} + +Element.addMethods = function( methods ) +{ + Object.extend(Element.Methods, methods || {}); + + function copy( methods, destination ) + { + var cache = Element.extend.cache; + for ( var property in methods ) + { + var value = methods[property]; + destination[property] = cache.findOrStore(value); + } + } + + if ( typeof HTMLElement != 'undefined' ) + { + copy(Element.Methods, HTMLElement.prototype); + copy(Form.Methods, HTMLFormElement.prototype); + [HTMLInputElement, HTMLTextAreaElement, HTMLSelectElement].each(function( klass ) + { + copy(Form.Element.Methods, klass.prototype); + }); + _nativeExtensions = true; + } +} + +var Toggle = new Object(); +Toggle.display = Element.toggle; + +/*--------------------------------------------------------------------------*/ + +Abstract.Insertion = function( adjacency ) +{ + this.adjacency = adjacency; +} + +Abstract.Insertion.prototype = { + initialize: function( element, content ) + { + this.element = $(element); + this.content = content.stripScripts(); + + if ( this.adjacency && this.element.insertAdjacentHTML ) + { + try + { + this.element.insertAdjacentHTML(this.adjacency, this.content); + } + catch ( e ) + { + var tagName = this.element.tagName.toLowerCase(); + if ( tagName == 'tbody' || tagName == 'tr' ) + { + this.insertContent(this.contentFromAnonymousTable()); + } + else + { + throw e; + } + } + } + else + { + this.range = this.element.ownerDocument.createRange(); + if ( this.initializeRange ) this.initializeRange(); + this.insertContent([this.range.createContextualFragment(this.content)]); + } + + setTimeout(function() + { + content.evalScripts() + }, 10); + }, + + contentFromAnonymousTable: function() + { + var div = document.createElement('div'); + div.innerHTML = '' + this.content + '
    '; + return $A(div.childNodes[0].childNodes[0].childNodes); + } +} + +var Insertion = new Object(); + +Insertion.Before = Class.create(); +Insertion.Before.prototype = Object.extend(new Abstract.Insertion('beforeBegin'), { + initializeRange: function() + { + this.range.setStartBefore(this.element); + }, + + insertContent: function( fragments ) + { + fragments.each((function( fragment ) + { + this.element.parentNode.insertBefore(fragment, this.element); + }).bind(this)); + } +}); + +Insertion.Top = Class.create(); +Insertion.Top.prototype = Object.extend(new Abstract.Insertion('afterBegin'), { + initializeRange: function() + { + this.range.selectNodeContents(this.element); + this.range.collapse(true); + }, + + insertContent: function( fragments ) + { + fragments.reverse(false).each((function( fragment ) + { + this.element.insertBefore(fragment, this.element.firstChild); + }).bind(this)); + } +}); + +Insertion.Bottom = Class.create(); +Insertion.Bottom.prototype = Object.extend(new Abstract.Insertion('beforeEnd'), { + initializeRange: function() + { + this.range.selectNodeContents(this.element); + this.range.collapse(this.element); + }, + + insertContent: function( fragments ) + { + fragments.each((function( fragment ) + { + this.element.appendChild(fragment); + }).bind(this)); + } +}); + +Insertion.After = Class.create(); +Insertion.After.prototype = Object.extend(new Abstract.Insertion('afterEnd'), { + initializeRange: function() + { + this.range.setStartAfter(this.element); + }, + + insertContent: function( fragments ) + { + fragments.each((function( fragment ) + { + this.element.parentNode.insertBefore(fragment, this.element.nextSibling); + }).bind(this)); + } +}); + +/*--------------------------------------------------------------------------*/ + +Element.ClassNames = Class.create(); +Element.ClassNames.prototype = { + initialize: function( element ) + { + this.element = $(element); + }, + + _each: function( iterator ) + { + this.element.className.split(/\s+/).select(function( name ) + { + return name.length > 0; + })._each(iterator); + }, + + set: function( className ) + { + this.element.className = className; + }, + + add: function( classNameToAdd ) + { + if ( this.include(classNameToAdd) ) return; + this.set(this.toArray().concat(classNameToAdd).join(' ')); + }, + + remove: function( classNameToRemove ) + { + if ( !this.include(classNameToRemove) ) return; + this.set(this.select(function( className ) + { + return className != classNameToRemove; + }).join(' ')); + }, + + toString: function() + { + return this.toArray().join(' '); + } +} + +Object.extend(Element.ClassNames.prototype, Enumerable); +var Selector = Class.create(); +Selector.prototype = { + initialize: function( expression ) + { + this.params = {classNames: []}; + this.expression = expression.toString().strip(); + this.parseExpression(); + this.compileMatcher(); + }, + + parseExpression: function() + { + function abort( message ) + { + throw 'Parse error in selector: ' + message; + } + + if ( this.expression == '' ) abort('empty expression'); + + var params = this.params, expr = this.expression, match, modifier, clause, rest; + while ( match = expr.match(/^(.*)\[([a-z0-9_:-]+?)(?:([~\|!]?=)(?:"([^"]*)"|([^\]\s]*)))?\]$/i) ) + { + params.attributes = params.attributes || []; + params.attributes.push({name: match[2], operator: match[3], value: match[4] || match[5] || ''}); + expr = match[1]; + } + + if ( expr == '*' ) return this.params.wildcard = true; + + while ( match = expr.match(/^([^a-z0-9_-])?([a-z0-9_-]+)(.*)/i) ) + { + modifier = match[1],clause = match[2],rest = match[3]; + switch ( modifier ) + { + case '#': params.id = clause; break; + case '.': params.classNames.push(clause); break; + case '': + case undefined: params.tagName = clause.toUpperCase(); break; + default: abort(expr.inspect()); + } + expr = rest; + } + + if ( expr.length > 0 ) abort(expr.inspect()); + }, + + buildMatchExpression: function() + { + var params = this.params, conditions = [], clause; + + if ( params.wildcard ) + conditions.push('true'); + if ( clause = params.id ) + conditions.push('element.id == ' + clause.inspect()); + if ( clause = params.tagName ) + conditions.push('element.tagName.toUpperCase() == ' + clause.inspect()); + if ( (clause = params.classNames).length > 0 ) + for ( var i = 0; i < clause.length; i++ ) + conditions.push('Element.hasClassName(element, ' + clause[i].inspect() + ')'); + if ( clause = params.attributes ) + { + clause.each(function( attribute ) + { + var value = 'element.getAttribute(' + attribute.name.inspect() + ')'; + var splitValueBy = function( delimiter ) + { + return value + ' && ' + value + '.split(' + delimiter.inspect() + ')'; + } + + switch ( attribute.operator ) + { + case '=': conditions.push(value + ' == ' + attribute.value.inspect()); break; + case '~=': conditions.push(splitValueBy(' ') + '.include(' + attribute.value.inspect() + + ')'); break; + case '|=': conditions.push(splitValueBy('-') + '.first().toUpperCase() == ' + + attribute.value.toUpperCase().inspect()); break; + case '!=': conditions.push(value + ' != ' + attribute.value.inspect()); break; + case '': + case undefined: conditions.push(value + ' != null'); break; + default: throw 'Unknown operator ' + attribute.operator + ' in selector'; + } + }); + } + + return conditions.join(' && '); + }, + + compileMatcher: function() + { + this.match = new Function('element', 'if (!element.tagName) return false; \ + return ' + this.buildMatchExpression()); + }, + + findElements: function( scope ) + { + var element; + + if ( element = $(this.params.id) ) + if ( this.match(element) ) + if ( !scope || Element.childOf(element, scope) ) + return [element]; + + scope = (scope || document).getElementsByTagName(this.params.tagName || '*'); + + var results = []; + for ( var i = 0; i < scope.length; i++ ) + if ( this.match(element = scope[i]) ) + results.push(Element.extend(element)); + + return results; + }, + + toString: function() + { + return this.expression; + } +} + +Object.extend(Selector, { + matchElements: function( elements, expression ) + { + var selector = new Selector(expression); + return elements.select(selector.match.bind(selector)); + }, + + findElement: function( elements, expression, index ) + { + if ( typeof expression == 'number' ) index = expression,expression = false; + return Selector.matchElements(elements, expression || '*')[index || 0]; + }, + + findChildElements: function( element, expressions ) + { + return expressions.map(function( expression ) + { + return expression.strip().split(/\s+/).inject([null], function( results, expr ) + { + var selector = new Selector(expr); + return results.inject([], function( elements, result ) + { + return elements.concat(selector.findElements(result || element)); + }); + }); + }).flatten(); + } +}); + +function $$() +{ + return Selector.findChildElements(document, $A(arguments)); +} +var Form = { + reset: function( form ) + { + $(form).reset(); + return form; + } +}; + +Form.Methods = { + serialize: function( form ) + { + var elements = Form.getElements($(form)); + var queryComponents = new Array(); + + for ( var i = 0; i < elements.length; i++ ) + { + var queryComponent = Form.Element.serialize(elements[i]); + if ( queryComponent ) + queryComponents.push(queryComponent); + } + + return queryComponents.join('&'); + }, + + getElements: function( form ) + { + form = $(form); + var elements = new Array(); + + for ( var tagName in Form.Element.Serializers ) + { + var tagElements = form.getElementsByTagName(tagName); + for ( var j = 0; j < tagElements.length; j++ ) + elements.push(tagElements[j]); + } + return elements; + }, + + getInputs: function( form, typeName, name ) + { + form = $(form); + var inputs = form.getElementsByTagName('input'); + + if ( !typeName && !name ) + return inputs; + + var matchingInputs = new Array(); + for ( var i = 0; i < inputs.length; i++ ) + { + var input = inputs[i]; + if ( (typeName && input.type != typeName) || (name && input.name != name) ) + continue; + matchingInputs.push(input); + } + + return matchingInputs; + }, + + disable: function( form ) + { + form = $(form); + var elements = Form.getElements(form); + for ( var i = 0; i < elements.length; i++ ) + { + var element = elements[i]; + element.blur(); + element.disabled = 'true'; + } + return form; + }, + + enable: function( form ) + { + form = $(form); + var elements = Form.getElements(form); + for ( var i = 0; i < elements.length; i++ ) + { + var element = elements[i]; + element.disabled = ''; + } + return form; + }, + + findFirstElement: function( form ) + { + return Form.getElements(form).find(function( element ) + { + return element.type != 'hidden' && !element.disabled && + ['input', 'select', 'textarea'].include(element.tagName.toLowerCase()); + }); + }, + + focusFirstElement: function( form ) + { + form = $(form); + Field.activate(Form.findFirstElement(form)); + return form; + } +} + +Object.extend(Form, Form.Methods); + +/*--------------------------------------------------------------------------*/ + +Form.Element = { + focus: function( element ) + { + $(element).focus(); + return element; + }, + + select: function( element ) + { + $(element).select(); + return element; + } +} + +Form.Element.Methods = { + serialize: function( element ) + { + element = $(element); + var method = element.tagName.toLowerCase(); + var parameter = Form.Element.Serializers[method](element); + + if ( parameter ) + { + var key = encodeURIComponent(parameter[0]); + if ( key.length == 0 ) return; + + if ( parameter[1].constructor != Array ) + parameter[1] = [parameter[1]]; + + return parameter[1].map(function( value ) + { + return key + '=' + encodeURIComponent(value); + }).join('&'); + } + }, + + getValue: function( element ) + { + element = $(element); + var method = element.tagName.toLowerCase(); + var parameter = Form.Element.Serializers[method](element); + + if ( parameter ) + return parameter[1]; + }, + + clear: function( element ) + { + $(element).value = ''; + return element; + }, + + present: function( element ) + { + return $(element).value != ''; + }, + + activate: function( element ) + { + element = $(element); + element.focus(); + if ( element.select ) + element.select(); + return element; + }, + + disable: function( element ) + { + element = $(element); + element.disabled = ''; + return element; + }, + + enable: function( element ) + { + element = $(element); + element.blur(); + element.disabled = 'true'; + return element; + } +} + +Object.extend(Form.Element, Form.Element.Methods); +var Field = Form.Element; + +/*--------------------------------------------------------------------------*/ + +Form.Element.Serializers = { + input: function( element ) + { + switch ( element.type.toLowerCase() ) + { + case 'checkbox': + case 'radio': + return Form.Element.Serializers.inputSelector(element); + default: + return Form.Element.Serializers.textarea(element); + } + return false; + }, + + inputSelector: function( element ) + { + if ( element.checked ) + return [element.name, element.value]; + }, + + textarea: function( element ) + { + return [element.name, element.value]; + }, + + select: function( element ) + { + return Form.Element.Serializers[element.type == 'select-one' ? 'selectOne' : 'selectMany'](element); + }, + + selectOne: function( element ) + { + var value = '', opt, index = element.selectedIndex; + if ( index >= 0 ) + { + opt = element.options[index]; + value = opt.value || opt.text; + } + return [element.name, value]; + }, + + selectMany: function( element ) + { + var value = []; + for ( var i = 0; i < element.length; i++ ) + { + var opt = element.options[i]; + if ( opt.selected ) + value.push(opt.value || opt.text); + } + return [element.name, value]; + } +} + +/*--------------------------------------------------------------------------*/ + +var $F = Form.Element.getValue; + +/*--------------------------------------------------------------------------*/ + +Abstract.TimedObserver = function() +{ +} +Abstract.TimedObserver.prototype = { + initialize: function( element, frequency, callback ) + { + this.frequency = frequency; + this.element = $(element); + this.callback = callback; + + this.lastValue = this.getValue(); + this.registerCallback(); + }, + + registerCallback: function() + { + setInterval(this.onTimerEvent.bind(this), this.frequency * 1000); + }, + + onTimerEvent: function() + { + var value = this.getValue(); + if ( this.lastValue != value ) + { + this.callback(this.element, value); + this.lastValue = value; + } + } +} + +Form.Element.Observer = Class.create(); +Form.Element.Observer.prototype = Object.extend(new Abstract.TimedObserver(), { + getValue: function() + { + return Form.Element.getValue(this.element); + } +}); + +Form.Observer = Class.create(); +Form.Observer.prototype = Object.extend(new Abstract.TimedObserver(), { + getValue: function() + { + return Form.serialize(this.element); + } +}); + +/*--------------------------------------------------------------------------*/ + +Abstract.EventObserver = function() +{ +} +Abstract.EventObserver.prototype = { + initialize: function( element, callback ) + { + this.element = $(element); + this.callback = callback; + + this.lastValue = this.getValue(); + if ( this.element.tagName.toLowerCase() == 'form' ) + this.registerFormCallbacks(); + else + this.registerCallback(this.element); + }, + + onElementEvent: function() + { + var value = this.getValue(); + if ( this.lastValue != value ) + { + this.callback(this.element, value); + this.lastValue = value; + } + }, + + registerFormCallbacks: function() + { + var elements = Form.getElements(this.element); + for ( var i = 0; i < elements.length; i++ ) + this.registerCallback(elements[i]); + }, + + registerCallback: function( element ) + { + if ( element.type ) + { + switch ( element.type.toLowerCase() ) + { + case 'checkbox': + case 'radio': + Event.observe(element, 'click', this.onElementEvent.bind(this)); + break; + default: + Event.observe(element, 'change', this.onElementEvent.bind(this)); + break; + } + } + } +} + +Form.Element.EventObserver = Class.create(); +Form.Element.EventObserver.prototype = Object.extend(new Abstract.EventObserver(), { + getValue: function() + { + return Form.Element.getValue(this.element); + } +}); + +Form.EventObserver = Class.create(); +Form.EventObserver.prototype = Object.extend(new Abstract.EventObserver(), { + getValue: function() + { + return Form.serialize(this.element); + } +}); +if ( !window.Event ) +{ + var Event = new Object(); +} + +Object.extend(Event, { + KEY_BACKSPACE: 8, + KEY_TAB: 9, + KEY_RETURN: 13, + KEY_ESC: 27, + KEY_LEFT: 37, + KEY_UP: 38, + KEY_RIGHT: 39, + KEY_DOWN: 40, + KEY_DELETE: 46, + KEY_HOME: 36, + KEY_END: 35, + KEY_PAGEUP: 33, + KEY_PAGEDOWN: 34, + + element: function( event ) + { + return event.target || event.srcElement; + }, + + isLeftClick: function( event ) + { + return (((event.which) && (event.which == 1)) || ((event.button) && (event.button == 1))); + }, + + pointerX: function( event ) + { + return event.pageX || (event.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft)); + }, + + pointerY: function( event ) + { + return event.pageY || (event.clientY + (document.documentElement.scrollTop || document.body.scrollTop)); + }, + + stop: function( event ) + { + if ( event.preventDefault ) + { + event.preventDefault(); + event.stopPropagation(); + } + else + { + event.returnValue = false; + event.cancelBubble = true; + } + }, + +// find the first node with the given tagName, starting from the +// node the event was triggered on; traverses the DOM upwards + findElement: function( event, tagName ) + { + var element = Event.element(event); + while ( element.parentNode && (!element.tagName || (element.tagName.toUpperCase() != tagName.toUpperCase())) ) + element = element.parentNode; + return element; + }, + + observers: false, + + _observeAndCache: function( element, name, observer, useCapture ) + { + if ( !this.observers ) this.observers = []; + if ( element.addEventListener ) + { + this.observers.push([element, name, observer, useCapture]); + element.addEventListener(name, observer, useCapture); + } + else if ( element.attachEvent ) + { + this.observers.push([element, name, observer, useCapture]); + element.attachEvent('on' + name, observer); + } + }, + + unloadCache: function() + { + if ( !Event.observers ) return; + for ( var i = 0; i < Event.observers.length; i++ ) + { + Event.stopObserving.apply(this, Event.observers[i]); + Event.observers[i][0] = null; + } + Event.observers = false; + }, + + observe: function( element, name, observer, useCapture ) + { + element = $(element); + useCapture = useCapture || false; + + if ( name == 'keypress' && (navigator.appVersion.match(/Konqueror|Safari|KHTML/) || element.attachEvent) ) + name = 'keydown'; + + Event._observeAndCache(element, name, observer, useCapture); + }, + + stopObserving: function( element, name, observer, useCapture ) + { + element = $(element); + useCapture = useCapture || false; + + if ( name == 'keypress' && (navigator.appVersion.match(/Konqueror|Safari|KHTML/) || element.detachEvent) ) + name = 'keydown'; + + if ( element.removeEventListener ) + { + element.removeEventListener(name, observer, useCapture); + } + else if ( element.detachEvent ) + { + try + { + element.detachEvent('on' + name, observer); + } + catch ( e ) + { + } + } + } +}); + +/* prevent memory leaks in IE */ +if ( navigator.appVersion.match(/\bMSIE\b/) ) + Event.observe(window, 'unload', Event.unloadCache, false); +var Position = { +// set to true if needed, warning: firefox performance problems +// NOT neeeded for page scrolling, only if draggable contained in +// scrollable elements + includeScrollOffsets: false, + +// must be called before calling withinIncludingScrolloffset, every time the +// page is scrolled + prepare: function() + { + this.deltaX = window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0; + this.deltaY = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0; + }, + + realOffset: function( element ) + { + var valueT = 0, valueL = 0; + do { + valueT += element.scrollTop || 0; + valueL += element.scrollLeft || 0; + element = element.parentNode; + } + while ( element ); + return [valueL, valueT]; + }, + + cumulativeOffset: function( element ) + { + var valueT = 0, valueL = 0; + do { + valueT += element.offsetTop || 0; + valueL += element.offsetLeft || 0; + element = element.offsetParent; + } + while ( element ); + return [valueL, valueT]; + }, + + positionedOffset: function( element ) + { + var valueT = 0, valueL = 0; + do { + valueT += element.offsetTop || 0; + valueL += element.offsetLeft || 0; + element = element.offsetParent; + if ( element ) + { + p = Element.getStyle(element, 'position'); + if ( p == 'relative' || p == 'absolute' ) break; + } + } + while ( element ); + return [valueL, valueT]; + }, + + offsetParent: function( element ) + { + if ( element.offsetParent ) return element.offsetParent; + if ( element == document.body ) return element; + + while ( (element = element.parentNode) && element != document.body ) + if ( Element.getStyle(element, 'position') != 'static' ) + return element; + + return document.body; + }, + +// caches x/y coordinate pair to use with overlap + within: function( element, x, y ) + { + if ( this.includeScrollOffsets ) + return this.withinIncludingScrolloffsets(element, x, y); + this.xcomp = x; + this.ycomp = y; + this.offset = this.cumulativeOffset(element); + + return (y >= this.offset[1] && y < this.offset[1] + element.offsetHeight && x >= this.offset[0] && + x < this.offset[0] + element.offsetWidth); + }, + + withinIncludingScrolloffsets: function( element, x, y ) + { + var offsetcache = this.realOffset(element); + + this.xcomp = x + offsetcache[0] - this.deltaX; + this.ycomp = y + offsetcache[1] - this.deltaY; + this.offset = this.cumulativeOffset(element); + + return (this.ycomp >= this.offset[1] && this.ycomp < this.offset[1] + element.offsetHeight && + this.xcomp >= this.offset[0] && this.xcomp < this.offset[0] + element.offsetWidth); + }, + +// within must be called directly before + overlap: function( mode, element ) + { + if ( !mode ) return 0; + if ( mode == 'vertical' ) + return ((this.offset[1] + element.offsetHeight) - this.ycomp) / element.offsetHeight; + if ( mode == 'horizontal' ) + return ((this.offset[0] + element.offsetWidth) - this.xcomp) / element.offsetWidth; + }, + + page: function( forElement ) + { + var valueT = 0, valueL = 0; + + var element = forElement; + do { + valueT += element.offsetTop || 0; + valueL += element.offsetLeft || 0; + + // Safari fix + if ( element.offsetParent == document.body ) + if ( Element.getStyle(element, 'position') == 'absolute' ) break; + + } + while ( element = element.offsetParent ); + + element = forElement; + do { + if ( !window.opera || element.tagName == 'BODY' ) + { + valueT -= element.scrollTop || 0; + valueL -= element.scrollLeft || 0; + } + } + while ( element = element.parentNode ); + + return [valueL, valueT]; + }, + + clone: function( source, target ) + { + var options = Object.extend({ + setLeft: true, + setTop: true, + setWidth: true, + setHeight: true, + offsetTop: 0, + offsetLeft: 0 + }, arguments[2] || {}) + + // find page position of source + source = $(source); + var p = Position.page(source); + + // find coordinate system to use + target = $(target); + var delta = [0, 0]; + var parent = null; + // delta [0,0] will do fine with position: fixed elements, + // position:absolute needs offsetParent deltas + if ( Element.getStyle(target, 'position') == 'absolute' ) + { + parent = Position.offsetParent(target); + delta = Position.page(parent); + } + + // correct by body offsets (fixes Safari) + if ( parent == document.body ) + { + delta[0] -= document.body.offsetLeft; + delta[1] -= document.body.offsetTop; + } + + // set position + if ( options.setLeft ) target.style.left = (p[0] - delta[0] + options.offsetLeft) + 'px'; + if ( options.setTop ) target.style.top = (p[1] - delta[1] + options.offsetTop) + 'px'; + if ( options.setWidth ) target.style.width = source.offsetWidth + 'px'; + if ( options.setHeight ) target.style.height = source.offsetHeight + 'px'; + }, + + absolutize: function( element ) + { + element = $(element); + if ( element.style.position == 'absolute' ) return; + Position.prepare(); + + var offsets = Position.positionedOffset(element); + var top = offsets[1]; + var left = offsets[0]; + var width = element.clientWidth; + var height = element.clientHeight; + + element._originalLeft = left - parseFloat(element.style.left || 0); + element._originalTop = top - parseFloat(element.style.top || 0); + element._originalWidth = element.style.width; + element._originalHeight = element.style.height; + + element.style.position = 'absolute'; + element.style.top = top + 'px'; + ; + element.style.left = left + 'px'; + ; + element.style.width = width + 'px'; + ; + element.style.height = height + 'px'; + ; + }, + + relativize: function( element ) + { + element = $(element); + if ( element.style.position == 'relative' ) return; + Position.prepare(); + + element.style.position = 'relative'; + var top = parseFloat(element.style.top || 0) - (element._originalTop || 0); + var left = parseFloat(element.style.left || 0) - (element._originalLeft || 0); + + element.style.top = top + 'px'; + element.style.left = left + 'px'; + element.style.height = element._originalHeight; + element.style.width = element._originalWidth; + } +} + +// Safari returns margins on body which is incorrect if the child is absolutely +// positioned. For performance reasons, redefine Position.cumulativeOffset for +// KHTML/WebKit only. +if ( /Konqueror|Safari|KHTML/.test(navigator.userAgent) ) +{ + Position.cumulativeOffset = function( element ) + { + var valueT = 0, valueL = 0; + do { + valueT += element.offsetTop || 0; + valueL += element.offsetLeft || 0; + if ( element.offsetParent == document.body ) + if ( Element.getStyle(element, 'position') == 'absolute' ) break; + + element = element.offsetParent; + } + while ( element ); + + return [valueL, valueT]; + } +} + +Element.addMethods(); \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/scriptaculous/scriptaculous.js b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/scriptaculous/scriptaculous.js new file mode 100644 index 000000000..60489ef74 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/scriptaculous/scriptaculous.js @@ -0,0 +1,72 @@ +/* + * 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. + */ + +// script.aculo.us scriptaculous.js v1.6.4, Wed Sep 06 11:30:58 CEST 2006 + +// Copyright (c) 2005 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +var Scriptaculous = { + Version: '1.6.4', + require: function( libraryName ) + { + // inserting via DOM fails in Safari 2.0, so brute force approach + document.write(''); + }, + load: function() + { + if ( (typeof Prototype == 'undefined') || (typeof Element == 'undefined') || + (typeof Element.Methods == 'undefined') || + parseFloat(Prototype.Version.split(".")[0] + "." + Prototype.Version.split(".")[1]) < 1.5 ) + throw("script.aculo.us requires the Prototype JavaScript framework >= 1.5.0"); + + $A(document.getElementsByTagName("script")).findAll(function( s ) + { + return (s.src && s.src.match(/scriptaculous\.js(\?.*)?$/)) + }).each(function( s ) + { + var path = s.src.replace(/scriptaculous\.js(\?.*)?$/, ''); + var includes = s.src.match(/\?.*load=([a-z,]*)/); + (includes ? includes[1] : 'builder,effects,dragdrop,controls,slider').split(',').each(function( include ) + { + Scriptaculous.require(path + include + '.js') + }); + }); + } +} + +Scriptaculous.load(); \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/scriptaculous/slider.js b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/scriptaculous/slider.js new file mode 100644 index 000000000..82a1cd1f0 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/scriptaculous/slider.js @@ -0,0 +1,365 @@ +/* + * 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. + */ + +// script.aculo.us slider.js v1.6.4, Wed Sep 06 11:30:58 CEST 2006 + +// Copyright (c) 2005 Marty Haught, Thomas Fuchs +// +// See http://script.aculo.us for more info +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +if ( !Control ) var Control = {}; +Control.Slider = Class.create(); + +// options: +// axis: 'vertical', or 'horizontal' (default) +// +// callbacks: +// onChange(value) +// onSlide(value) +Control.Slider.prototype = { + initialize: function( handle, track, options ) + { + var slider = this; + + if ( handle instanceof Array ) + { + this.handles = handle.collect(function( e ) + { + return $(e) + }); + } + else + { + this.handles = [$(handle)]; + } + + this.track = $(track); + this.options = options || {}; + + this.axis = this.options.axis || 'horizontal'; + this.increment = this.options.increment || 1; + this.step = parseInt(this.options.step || '1'); + this.range = this.options.range || $R(0, 1); + + this.value = 0; + // assure backwards compat + this.values = this.handles.map(function() + { + return 0 + }); + this.spans = this.options.spans ? this.options.spans.map(function( s ) + { + return $(s) + }) : false; + this.options.startSpan = $(this.options.startSpan || null); + this.options.endSpan = $(this.options.endSpan || null); + + this.restricted = this.options.restricted || false; + + this.maximum = this.options.maximum || this.range.end; + this.minimum = this.options.minimum || this.range.start; + + // Will be used to align the handle onto the track, if necessary + this.alignX = parseInt(this.options.alignX || '0'); + this.alignY = parseInt(this.options.alignY || '0'); + + this.trackLength = this.maximumOffset() - this.minimumOffset(); + + this.handleLength = this.isVertical() ? (this.handles[0].offsetHeight != 0 ? this.handles[0].offsetHeight + : this.handles[0].style.height.replace(/px$/, "")) : (this.handles[0].offsetWidth != 0 + ? this.handles[0].offsetWidth : this.handles[0].style.width.replace(/px$/, "")); + + this.active = false; + this.dragging = false; + this.disabled = false; + + if ( this.options.disabled ) this.setDisabled(); + + // Allowed values array + this.allowedValues = this.options.values ? this.options.values.sortBy(Prototype.K) : false; + if ( this.allowedValues ) + { + this.minimum = this.allowedValues.min(); + this.maximum = this.allowedValues.max(); + } + + this.eventMouseDown = this.startDrag.bindAsEventListener(this); + this.eventMouseUp = this.endDrag.bindAsEventListener(this); + this.eventMouseMove = this.update.bindAsEventListener(this); + + // Initialize handles in reverse (make sure first handle is active) + this.handles.each(function( h, i ) + { + i = slider.handles.length - 1 - i; + slider.setValue(parseFloat((slider.options.sliderValue instanceof Array ? slider.options.sliderValue[i] + : slider.options.sliderValue) || slider.range.start), i); + Element.makePositioned(h); + // fix IE + Event.observe(h, "mousedown", slider.eventMouseDown); + }); + + Event.observe(this.track, "mousedown", this.eventMouseDown); + Event.observe(document, "mouseup", this.eventMouseUp); + Event.observe(document, "mousemove", this.eventMouseMove); + + this.initialized = true; + }, + dispose: function() + { + var slider = this; + Event.stopObserving(this.track, "mousedown", this.eventMouseDown); + Event.stopObserving(document, "mouseup", this.eventMouseUp); + Event.stopObserving(document, "mousemove", this.eventMouseMove); + this.handles.each(function( h ) + { + Event.stopObserving(h, "mousedown", slider.eventMouseDown); + }); + }, + setDisabled: function() + { + this.disabled = true; + }, + setEnabled: function() + { + this.disabled = false; + }, + getNearestValue: function( value ) + { + if ( this.allowedValues ) + { + if ( value >= this.allowedValues.max() ) return(this.allowedValues.max()); + if ( value <= this.allowedValues.min() ) return(this.allowedValues.min()); + + var offset = Math.abs(this.allowedValues[0] - value); + var newValue = this.allowedValues[0]; + this.allowedValues.each(function( v ) + { + var currentOffset = Math.abs(v - value); + if ( currentOffset <= offset ) + { + newValue = v; + offset = currentOffset; + } + }); + return newValue; + } + if ( value > this.range.end ) return this.range.end; + if ( value < this.range.start ) return this.range.start; + return value; + }, + setValue: function( sliderValue, handleIdx ) + { + if ( !this.active ) + { + this.activeHandleIdx = handleIdx || 0; + this.activeHandle = this.handles[this.activeHandleIdx]; + this.updateStyles(); + } + handleIdx = handleIdx || this.activeHandleIdx || 0; + if ( this.initialized && this.restricted ) + { + if ( (handleIdx > 0) && (sliderValue < this.values[handleIdx - 1]) ) + sliderValue = this.values[handleIdx - 1]; + if ( (handleIdx < (this.handles.length - 1)) && (sliderValue > this.values[handleIdx + 1]) ) + sliderValue = this.values[handleIdx + 1]; + } + sliderValue = this.getNearestValue(sliderValue); + this.values[handleIdx] = sliderValue; + this.value = this.values[0]; + // assure backwards compat + + this.handles[handleIdx].style[this.isVertical() ? 'top' : 'left'] = this.translateToPx(sliderValue); + + this.drawSpans(); + if ( !this.dragging || !this.event ) this.updateFinished(); + }, + setValueBy: function( delta, handleIdx ) + { + this.setValue(this.values[handleIdx || this.activeHandleIdx || 0] + delta, handleIdx || this.activeHandleIdx || + 0); + }, + translateToPx: function( value ) + { + return Math.round(((this.trackLength - this.handleLength) / (this.range.end - this.range.start)) * + (value - this.range.start)) + "px"; + }, + translateToValue: function( offset ) + { + return ((offset / (this.trackLength - this.handleLength) * (this.range.end - this.range.start)) + + this.range.start); + }, + getRange: function( range ) + { + var v = this.values.sortBy(Prototype.K); + range = range || 0; + return $R(v[range], v[range + 1]); + }, + minimumOffset: function() + { + return(this.isVertical() ? this.alignY : this.alignX); + }, + maximumOffset: function() + { + return(this.isVertical() ? (this.track.offsetHeight != 0 ? this.track.offsetHeight + : this.track.style.height.replace(/px$/, "")) - this.alignY : (this.track.offsetWidth != 0 + ? this.track.offsetWidth : this.track.style.width.replace(/px$/, "")) - this.alignY); + }, + isVertical: function() + { + return (this.axis == 'vertical'); + }, + drawSpans: function() + { + var slider = this; + if ( this.spans ) + $R(0, this.spans.length - 1).each(function( r ) + { + slider.setSpan(slider.spans[r], slider.getRange(r)) + }); + if ( this.options.startSpan ) + this.setSpan(this.options.startSpan, $R(0, this.values.length > 1 ? this.getRange(0).min() : this.value)); + if ( this.options.endSpan ) + this.setSpan(this.options.endSpan, $R(this.values.length > 1 ? this.getRange(this.spans.length - 1).max() + : this.value, this.maximum)); + }, + setSpan: function( span, range ) + { + if ( this.isVertical() ) + { + span.style.top = this.translateToPx(range.start); + span.style.height = this.translateToPx(range.end - range.start + this.range.start); + } + else + { + span.style.left = this.translateToPx(range.start); + span.style.width = this.translateToPx(range.end - range.start + this.range.start); + } + }, + updateStyles: function() + { + this.handles.each(function( h ) + { + Element.removeClassName(h, 'selected') + }); + Element.addClassName(this.activeHandle, 'selected'); + }, + startDrag: function( event ) + { + if ( Event.isLeftClick(event) ) + { + if ( !this.disabled ) + { + this.active = true; + + var handle = Event.element(event); + var pointer = [Event.pointerX(event), Event.pointerY(event)]; + var track = handle; + if ( track == this.track ) + { + var offsets = Position.cumulativeOffset(this.track); + this.event = event; + this.setValue(this.translateToValue((this.isVertical() ? pointer[1] - offsets[1] : pointer[0] - + offsets[0]) - + (this.handleLength / 2))); + var offsets = Position.cumulativeOffset(this.activeHandle); + this.offsetX = (pointer[0] - offsets[0]); + this.offsetY = (pointer[1] - offsets[1]); + } + else + { + // find the handle (prevents issues with Safari) + while ( (this.handles.indexOf(handle) == -1) && handle.parentNode ) + handle = handle.parentNode; + + this.activeHandle = handle; + this.activeHandleIdx = this.handles.indexOf(this.activeHandle); + this.updateStyles(); + + var offsets = Position.cumulativeOffset(this.activeHandle); + this.offsetX = (pointer[0] - offsets[0]); + this.offsetY = (pointer[1] - offsets[1]); + } + } + Event.stop(event); + } + }, + update: function( event ) + { + if ( this.active ) + { + if ( !this.dragging ) this.dragging = true; + this.draw(event); + // fix AppleWebKit rendering + if ( navigator.appVersion.indexOf('AppleWebKit') > 0 ) window.scrollBy(0, 0); + Event.stop(event); + } + }, + draw: function( event ) + { + var pointer = [Event.pointerX(event), Event.pointerY(event)]; + var offsets = Position.cumulativeOffset(this.track); + pointer[0] -= this.offsetX + offsets[0]; + pointer[1] -= this.offsetY + offsets[1]; + this.event = event; + this.setValue(this.translateToValue(this.isVertical() ? pointer[1] : pointer[0])); + if ( this.initialized && this.options.onSlide ) + this.options.onSlide(this.values.length > 1 ? this.values : this.value, this); + }, + endDrag: function( event ) + { + if ( this.active && this.dragging ) + { + this.finishDrag(event, true); + Event.stop(event); + } + this.active = false; + this.dragging = false; + }, + finishDrag: function( event, success ) + { + this.active = false; + this.dragging = false; + this.updateFinished(); + }, + updateFinished: function() + { + if ( this.initialized && this.options.onChange ) + this.options.onChange(this.values.length > 1 ? this.values : this.value, this); + this.event = null; + } +} \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/scriptaculous/unittest.js b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/scriptaculous/unittest.js new file mode 100644 index 000000000..cd3143305 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/scriptaculous/unittest.js @@ -0,0 +1,744 @@ +/* + * 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. + */ + +// script.aculo.us unittest.js v1.6.4, Wed Sep 06 11:30:58 CEST 2006 + +// Copyright (c) 2005 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) +// (c) 2005 Jon Tirsen (http://www.tirsen.com) +// (c) 2005 Michael Schuerig (http://www.schuerig.de/michael/) +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +// experimental, Firefox-only +Event.simulateMouse = function( element, eventName ) +{ + var options = Object.extend({ + pointerX: 0, + pointerY: 0, + buttons: 0 + }, arguments[2] || {}); + var oEvent = document.createEvent("MouseEvents"); + oEvent.initMouseEvent(eventName, true, true, document.defaultView, options.buttons, options.pointerX, options.pointerY, options.pointerX, options.pointerY, false, false, false, false, 0, $(element)); + + if ( this.mark ) Element.remove(this.mark); + this.mark = document.createElement('div'); + this.mark.appendChild(document.createTextNode(" ")); + document.body.appendChild(this.mark); + this.mark.style.position = 'absolute'; + this.mark.style.top = options.pointerY + "px"; + this.mark.style.left = options.pointerX + "px"; + this.mark.style.width = "5px"; + this.mark.style.height = "5px;"; + this.mark.style.borderTop = "1px solid red;" + this.mark.style.borderLeft = "1px solid red;" + + if ( this.step ) + alert('[' + new Date().getTime().toString() + '] ' + eventName + '/' + Test.Unit.inspect(options)); + + $(element).dispatchEvent(oEvent); +}; + +// Note: Due to a fix in Firefox 1.0.5/6 that probably fixed "too much", this doesn't work in 1.0.6 or DP2. +// You need to downgrade to 1.0.4 for now to get this working +// See https://bugzilla.mozilla.org/show_bug.cgi?id=289940 for the fix that fixed too much +Event.simulateKey = function( element, eventName ) +{ + var options = Object.extend({ + ctrlKey: false, + altKey: false, + shiftKey: false, + metaKey: false, + keyCode: 0, + charCode: 0 + }, arguments[2] || {}); + + var oEvent = document.createEvent("KeyEvents"); + oEvent.initKeyEvent(eventName, true, true, window, options.ctrlKey, options.altKey, options.shiftKey, options.metaKey, options.keyCode, options.charCode); + $(element).dispatchEvent(oEvent); +}; + +Event.simulateKeys = function( element, command ) +{ + for ( var i = 0; i < command.length; i++ ) + { + Event.simulateKey(element, 'keypress', {charCode:command.charCodeAt(i)}); + } +}; + +var Test = {} +Test.Unit = {}; + +// security exception workaround +Test.Unit.inspect = Object.inspect; + +Test.Unit.Logger = Class.create(); +Test.Unit.Logger.prototype = { + initialize: function( log ) + { + this.log = $(log); + if ( this.log ) + { + this._createLogTable(); + } + }, + start: function( testName ) + { + if ( !this.log ) return; + this.testName = testName; + this.lastLogLine = document.createElement('tr'); + this.statusCell = document.createElement('td'); + this.nameCell = document.createElement('td'); + this.nameCell.appendChild(document.createTextNode(testName)); + this.messageCell = document.createElement('td'); + this.lastLogLine.appendChild(this.statusCell); + this.lastLogLine.appendChild(this.nameCell); + this.lastLogLine.appendChild(this.messageCell); + this.loglines.appendChild(this.lastLogLine); + }, + finish: function( status, summary ) + { + if ( !this.log ) return; + this.lastLogLine.className = status; + this.statusCell.innerHTML = status; + this.messageCell.innerHTML = this._toHTML(summary); + }, + message: function( message ) + { + if ( !this.log ) return; + this.messageCell.innerHTML = this._toHTML(message); + }, + summary: function( summary ) + { + if ( !this.log ) return; + this.logsummary.innerHTML = this._toHTML(summary); + }, + _createLogTable: function() + { + this.log.innerHTML = '

    ' + '' + + '' + + '' + '
    StatusTestMessage
    '; + this.logsummary = $('logsummary') + this.loglines = $('loglines'); + }, + _toHTML: function( txt ) + { + return txt.escapeHTML().replace(/\n/g, "
    "); + } +} + +Test.Unit.Runner = Class.create(); +Test.Unit.Runner.prototype = { + initialize: function( testcases ) + { + this.options = Object.extend({ + testLog: 'testlog' + }, arguments[1] || {}); + this.options.resultsURL = this.parseResultsURLQueryParameter(); + if ( this.options.testLog ) + { + this.options.testLog = $(this.options.testLog) || null; + } + if ( this.options.tests ) + { + this.tests = []; + for ( var i = 0; i < this.options.tests.length; i++ ) + { + if ( /^test/.test(this.options.tests[i]) ) + { + this.tests.push(new Test.Unit.Testcase(this.options.tests[i], testcases[this.options.tests[i]], testcases["setup"], testcases["teardown"])); + } + } + } + else + { + if ( this.options.test ) + { + this.tests = + [new Test.Unit.Testcase(this.options.test, testcases[this.options.test], testcases["setup"], testcases["teardown"])]; + } + else + { + this.tests = []; + for ( var testcase in testcases ) + { + if ( /^test/.test(testcase) ) + { + this.tests.push(new Test.Unit.Testcase(this.options.context ? ' -> ' + + this.options.titles[testcase] + : testcase, testcases[testcase], testcases["setup"], testcases["teardown"])); + } + } + } + } + this.currentTest = 0; + this.logger = new Test.Unit.Logger(this.options.testLog); + setTimeout(this.runTests.bind(this), 1000); + }, + parseResultsURLQueryParameter: function() + { + return window.location.search.parseQuery()["resultsURL"]; + }, +// Returns: +// "ERROR" if there was an error, +// "FAILURE" if there was a failure, or +// "SUCCESS" if there was neither + getResult: function() + { + var hasFailure = false; + for ( var i = 0; i < this.tests.length; i++ ) + { + if ( this.tests[i].errors > 0 ) + { + return "ERROR"; + } + if ( this.tests[i].failures > 0 ) + { + hasFailure = true; + } + } + if ( hasFailure ) + { + return "FAILURE"; + } + else + { + return "SUCCESS"; + } + }, + postResults: function() + { + if ( this.options.resultsURL ) + { + new Ajax.Request(this.options.resultsURL, { method: 'get', parameters: 'result=' + + this.getResult(), asynchronous: false }); + } + }, + runTests: function() + { + var test = this.tests[this.currentTest]; + if ( !test ) + { + // finished! + this.postResults(); + this.logger.summary(this.summary()); + return; + } + if ( !test.isWaiting ) + { + this.logger.start(test.name); + } + test.run(); + if ( test.isWaiting ) + { + this.logger.message("Waiting for " + test.timeToWait + "ms"); + setTimeout(this.runTests.bind(this), test.timeToWait || 1000); + } + else + { + this.logger.finish(test.status(), test.summary()); + this.currentTest++; + // tail recursive, hopefully the browser will skip the stackframe + this.runTests(); + } + }, + summary: function() + { + var assertions = 0; + var failures = 0; + var errors = 0; + var messages = []; + for ( var i = 0; i < this.tests.length; i++ ) + { + assertions += this.tests[i].assertions; + failures += this.tests[i].failures; + errors += this.tests[i].errors; + } + return ( + (this.options.context ? this.options.context + ': ' : '') + this.tests.length + " tests, " + assertions + + " assertions, " + failures + " failures, " + errors + " errors"); + } +} + +Test.Unit.Assertions = Class.create(); +Test.Unit.Assertions.prototype = { + initialize: function() + { + this.assertions = 0; + this.failures = 0; + this.errors = 0; + this.messages = []; + }, + summary: function() + { + return ( + this.assertions + " assertions, " + this.failures + " failures, " + this.errors + " errors" + "\n" + + this.messages.join("\n")); + }, + pass: function() + { + this.assertions++; + }, + fail: function( message ) + { + this.failures++; + this.messages.push("Failure: " + message); + }, + info: function( message ) + { + this.messages.push("Info: " + message); + }, + error: function( error ) + { + this.errors++; + this.messages.push(error.name + ": " + error.message + "(" + Test.Unit.inspect(error) + ")"); + }, + status: function() + { + if ( this.failures > 0 ) return 'failed'; + if ( this.errors > 0 ) return 'error'; + return 'passed'; + }, + assert: function( expression ) + { + var message = arguments[1] || 'assert: got "' + Test.Unit.inspect(expression) + '"'; + try + { + expression ? this.pass() : this.fail(message); + } + catch( e ) + { + this.error(e); + } + }, + assertEqual: function( expected, actual ) + { + var message = arguments[2] || "assertEqual"; + try + { + (expected == actual) ? this.pass() : this.fail(message + ': expected "' + Test.Unit.inspect(expected) + + '", actual "' + Test.Unit.inspect(actual) + '"'); + } + catch( e ) + { + this.error(e); + } + }, + assertEnumEqual: function( expected, actual ) + { + var message = arguments[2] || "assertEnumEqual"; + try + { + $A(expected).length == $A(actual).length && expected.zip(actual).all(function( pair ) + { + return pair[0] == pair[1] + }) ? this.pass() : this.fail(message + ': expected ' + Test.Unit.inspect(expected) + ', actual ' + + Test.Unit.inspect(actual)); + } + catch( e ) + { + this.error(e); + } + }, + assertNotEqual: function( expected, actual ) + { + var message = arguments[2] || "assertNotEqual"; + try + { + (expected != actual) ? this.pass() : this.fail(message + ': got "' + Test.Unit.inspect(actual) + '"'); + } + catch( e ) + { + this.error(e); + } + }, + assertIdentical: function( expected, actual ) + { + var message = arguments[2] || "assertIdentical"; + try + { + (expected === actual) ? this.pass() : this.fail(message + ': expected "' + Test.Unit.inspect(expected) + + '", actual "' + Test.Unit.inspect(actual) + '"'); + } + catch( e ) + { + this.error(e); + } + }, + assertNotIdentical: function( expected, actual ) + { + var message = arguments[2] || "assertNotIdentical"; + try + { + !(expected === actual) ? this.pass() : this.fail(message + ': expected "' + Test.Unit.inspect(expected) + + '", actual "' + Test.Unit.inspect(actual) + '"'); + } + catch( e ) + { + this.error(e); + } + }, + assertNull: function( obj ) + { + var message = arguments[1] || 'assertNull' + try + { + (obj == null) ? this.pass() : this.fail(message + ': got "' + Test.Unit.inspect(obj) + '"'); + } + catch( e ) + { + this.error(e); + } + }, + assertMatch: function( expected, actual ) + { + var message = arguments[2] || 'assertMatch'; + var regex = new RegExp(expected); + try + { + (regex.exec(actual)) ? this.pass() : this.fail(message + ' : regex: "' + Test.Unit.inspect(expected) + + ' did not match: ' + Test.Unit.inspect(actual) + '"'); + } + catch( e ) + { + this.error(e); + } + }, + assertHidden: function( element ) + { + var message = arguments[1] || 'assertHidden'; + this.assertEqual("none", element.style.display, message); + }, + assertNotNull: function( object ) + { + var message = arguments[1] || 'assertNotNull'; + this.assert(object != null, message); + }, + assertType: function( expected, actual ) + { + var message = arguments[2] || 'assertType'; + try + { + (actual.constructor == expected) ? this.pass() : this.fail(message + ': expected "' + + Test.Unit.inspect(expected) + '", actual "' + + (actual.constructor) + '"'); + } + catch( e ) + { + this.error(e); + } + }, + assertNotOfType: function( expected, actual ) + { + var message = arguments[2] || 'assertNotOfType'; + try + { + (actual.constructor != expected) ? this.pass() : this.fail(message + ': expected "' + + Test.Unit.inspect(expected) + '", actual "' + + (actual.constructor) + '"'); + } + catch( e ) + { + this.error(e); + } + }, + assertInstanceOf: function( expected, actual ) + { + var message = arguments[2] || 'assertInstanceOf'; + try + { + (actual instanceof expected) ? this.pass() : this.fail(message + + ": object was not an instance of the expected type"); + } + catch( e ) + { + this.error(e); + } + }, + assertNotInstanceOf: function( expected, actual ) + { + var message = arguments[2] || 'assertNotInstanceOf'; + try + { + !(actual instanceof expected) ? this.pass() : this.fail(message + + ": object was an instance of the not expected type"); + } + catch( e ) + { + this.error(e); + } + }, + assertRespondsTo: function( method, obj ) + { + var message = arguments[2] || 'assertRespondsTo'; + try + { + (obj[method] && typeof obj[method] == 'function') ? this.pass() : this.fail(message + + ": object doesn't respond to [" + + method + "]"); + } + catch( e ) + { + this.error(e); + } + }, + assertReturnsTrue: function( method, obj ) + { + var message = arguments[2] || 'assertReturnsTrue'; + try + { + var m = obj[method]; + if ( !m ) m = obj['is' + method.charAt(0).toUpperCase() + method.slice(1)]; + m() ? this.pass() : this.fail(message + ": method returned false"); + } + catch( e ) + { + this.error(e); + } + }, + assertReturnsFalse: function( method, obj ) + { + var message = arguments[2] || 'assertReturnsFalse'; + try + { + var m = obj[method]; + if ( !m ) m = obj['is' + method.charAt(0).toUpperCase() + method.slice(1)]; + !m() ? this.pass() : this.fail(message + ": method returned true"); + } + catch( e ) + { + this.error(e); + } + }, + assertRaise: function( exceptionName, method ) + { + var message = arguments[2] || 'assertRaise'; + try + { + method(); + this.fail(message + ": exception expected but none was raised"); + } + catch( e ) + { + (e.name == exceptionName) ? this.pass() : this.error(e); + } + }, + assertElementsMatch: function() + { + var expressions = $A(arguments), elements = $A(expressions.shift()); + if ( elements.length != expressions.length ) + { + this.fail('assertElementsMatch: size mismatch: ' + elements.length + ' elements, ' + expressions.length + + ' expressions'); + return false; + } + elements.zip(expressions).all(function( pair, index ) + { + var element = $(pair.first()), expression = pair.last(); + if ( element.match(expression) ) return true; + this.fail('assertElementsMatch: (in index ' + index + ') expected ' + expression.inspect() + ' but got ' + + element.inspect()); + }.bind(this)) && this.pass(); + }, + assertElementMatches: function( element, expression ) + { + this.assertElementsMatch([element], expression); + }, + benchmark: function( operation, iterations ) + { + var startAt = new Date(); + (iterations || 1).times(operation); + var timeTaken = ((new Date()) - startAt); + this.info((arguments[2] || 'Operation') + ' finished ' + iterations + ' iterations in ' + (timeTaken / 1000) + + 's'); + return timeTaken; + }, + _isVisible: function( element ) + { + element = $(element); + if ( !element.parentNode ) return true; + this.assertNotNull(element); + if ( element.style && Element.getStyle(element, 'display') == 'none' ) + return false; + + return this._isVisible(element.parentNode); + }, + assertNotVisible: function( element ) + { + this.assert(!this._isVisible(element), Test.Unit.inspect(element) + + " was not hidden and didn't have a hidden parent either. " + + ("" || arguments[1])); + }, + assertVisible: function( element ) + { + this.assert(this._isVisible(element), Test.Unit.inspect(element) + " was not visible. " + ("" || arguments[1])); + }, + benchmark: function( operation, iterations ) + { + var startAt = new Date(); + (iterations || 1).times(operation); + var timeTaken = ((new Date()) - startAt); + this.info((arguments[2] || 'Operation') + ' finished ' + iterations + ' iterations in ' + (timeTaken / 1000) + + 's'); + return timeTaken; + } +} + +Test.Unit.Testcase = Class.create(); +Object.extend(Object.extend(Test.Unit.Testcase.prototype, Test.Unit.Assertions.prototype), { + initialize: function( name, test, setup, teardown ) + { + Test.Unit.Assertions.prototype.initialize.bind(this)(); + this.name = name; + + if ( typeof test == 'string' ) + { + test = test.gsub(/(\.should[^\(]+\()/, '#{0}this,'); + test = test.gsub(/(\.should[^\(]+)\(this,\)/, '#{1}(this)'); + this.test = function() + { + eval('with(this){' + test + '}'); + } + } + else + { + this.test = test || function() + { + }; + } + + this.setup = setup || function() + { + }; + this.teardown = teardown || function() + { + }; + this.isWaiting = false; + this.timeToWait = 1000; + }, + wait: function( time, nextPart ) + { + this.isWaiting = true; + this.test = nextPart; + this.timeToWait = time; + }, + run: function() + { + try + { + try + { + if ( !this.isWaiting ) this.setup.bind(this)(); + this.isWaiting = false; + this.test.bind(this)(); + } + finally + { + if ( !this.isWaiting ) + { + this.teardown.bind(this)(); + } + } + } + catch( e ) + { + this.error(e); + } + } +}); + +// *EXPERIMENTAL* BDD-style testing to please non-technical folk +// This draws many ideas from RSpec http://rspec.rubyforge.org/ + +Test.setupBDDExtensionMethods = function() +{ + var METHODMAP = { + shouldEqual: 'assertEqual', + shouldNotEqual: 'assertNotEqual', + shouldEqualEnum: 'assertEnumEqual', + shouldBeA: 'assertType', + shouldNotBeA: 'assertNotOfType', + shouldBeAn: 'assertType', + shouldNotBeAn: 'assertNotOfType', + shouldBeNull: 'assertNull', + shouldNotBeNull: 'assertNotNull', + + shouldBe: 'assertReturnsTrue', + shouldNotBe: 'assertReturnsFalse', + shouldRespondTo: 'assertRespondsTo' + }; + Test.BDDMethods = {}; + for ( m in METHODMAP ) + { + Test.BDDMethods[m] = + eval('function(){' + 'var args = $A(arguments);' + 'var scope = args.shift();' + 'scope.' + METHODMAP[m] + + '.apply(scope,(args || []).concat([this])); }'); + } + [Array.prototype, String.prototype, Number.prototype].each(function( p ) + { + Object.extend(p, Test.BDDMethods) + }); +} + +Test.context = function( name, spec, log ) +{ + Test.setupBDDExtensionMethods(); + + var compiledSpec = {}; + var titles = {}; + for ( specName in spec ) + { + switch ( specName ) + { + case "setup": + case "teardown": + compiledSpec[specName] = spec[specName]; + break; + default: + var testName = 'test' + specName.gsub(/\s+/, '-').camelize(); + var body = spec[specName].toString().split('\n').slice(1); + if ( /^\{/.test(body[0]) ) body = body.slice(1); + body.pop(); + body = body.map(function( statement ) + { + return statement.strip() + }); + compiledSpec[testName] = body.join('\n'); + titles[testName] = specName; + } + } + new Test.Unit.Runner(compiledSpec, { titles: titles, testLog: log || 'testlog', context: name }); +}; \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/rss/rss.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/rss/rss.xml new file mode 100644 index 000000000..e69de29bb diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/template/archiva/checkboxlist.ftl b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/template/archiva/checkboxlist.ftl new file mode 100644 index 000000000..75d8c6d82 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/template/archiva/checkboxlist.ftl @@ -0,0 +1,39 @@ +<@ww.iterator value="parameters.list"> + <#if parameters.listKey?exists> + <#assign itemKey = stack.findValue(parameters.listKey)/> + <#else> + <#assign itemKey = stack.findValue('top')/> + + <#if parameters.listValue?exists> + <#assign itemValue = stack.findString(parameters.listValue)/> + <#else> + <#assign itemValue = stack.findString('top')/> + + +<#if tag.contains(parameters.nameValue, itemKey)> + checked="checked"<#rt/> + +<#if itemKey?exists> + value="${itemKey?html}"<#rt/> + +<#if parameters.disabled?default(false)> + disabled="disabled"<#rt/> + +<#if parameters.tabindex?exists> + tabindex="${parameters.tabindex?html}"<#rt/> + +<#if parameters.cssClass?exists> + class="${parameters.cssClass?html}"<#rt/> + +<#if parameters.cssStyle?exists> + style="${parameters.cssStyle?html}"<#rt/> + +<#if parameters.title?exists> + title="${parameters.title?html}"<#rt/> + +<#include "/${parameters.templateDir}/simple/scripting-events.ftl" /> +/><#rt/> +
    + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/template/archiva/radiomap.ftl b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/template/archiva/radiomap.ftl new file mode 100644 index 000000000..89ef578d1 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/template/archiva/radiomap.ftl @@ -0,0 +1,39 @@ +<@ww.iterator value="parameters.list"> + <#if parameters.listKey?exists> + <#assign itemKey = stack.findValue(parameters.listKey)/> + <#else> + <#assign itemKey = stack.findValue('top')/> + + <#if parameters.listValue?exists> + <#assign itemValue = stack.findString(parameters.listValue)/> + <#else> + <#assign itemValue = stack.findString('top')/> + + +<#if tag.contains(parameters.nameValue, itemKey)> + checked="checked"<#rt/> + +<#if itemKey?exists> + value="${itemKey?html}"<#rt/> + +<#if parameters.disabled?default(false)> + disabled="disabled"<#rt/> + +<#if parameters.tabindex?exists> + tabindex="${parameters.tabindex?html}"<#rt/> + +<#if parameters.cssClass?exists> + class="${parameters.cssClass?html}"<#rt/> + +<#if parameters.cssStyle?exists> + style="${parameters.cssStyle?html}"<#rt/> + +<#if parameters.title?exists> + title="${parameters.title?html}"<#rt/> + +<#include "/${parameters.templateDir}/simple/scripting-events.ftl" /> +/><#rt/> +
    + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/template/archiva/theme.properties b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/template/archiva/theme.properties new file mode 100644 index 000000000..0f2fddc8c --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/template/archiva/theme.properties @@ -0,0 +1,20 @@ +# +# 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. +# + +parent = xhtml diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/template/xhtml/a-close.ftl b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/template/xhtml/a-close.ftl new file mode 100644 index 000000000..706f1f49f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/template/xhtml/a-close.ftl @@ -0,0 +1 @@ +<#rt/> \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/template/xhtml/a.ftl b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/template/xhtml/a.ftl new file mode 100644 index 000000000..1b41b312f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/template/xhtml/a.ftl @@ -0,0 +1,22 @@ + +<#if parameters.id?if_exists != ""> + id="${parameters.id?html}"<#rt/> + +<#if parameters.href?if_exists != ""> + href="${parameters.href}"<#rt/> + +<#if parameters.tabindex?exists> + tabindex="${parameters.tabindex?html}"<#rt/> + +<#if parameters.cssClass?exists> + class="${parameters.cssClass?html}"<#rt/> + +<#if parameters.cssStyle?exists> + style="${parameters.cssStyle?html}"<#rt/> + +<#if parameters.title?exists> + title="${parameters.title?html}"<#rt/> + +<#include "/${parameters.templateDir}/simple/scripting-events.ftl" /> +<#include "/${parameters.templateDir}/simple/common-attributes.ftl" /> +><#rt/> diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/template/xhtml/actionerror.ftl b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/template/xhtml/actionerror.ftl new file mode 100644 index 000000000..74c313652 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/template/xhtml/actionerror.ftl @@ -0,0 +1,7 @@ +<#if (actionErrors?exists && actionErrors?size > 0)> +
      + <#list actionErrors as error> +
    • ${error}
    • + +
    + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/template/xhtml/actionmessage.ftl b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/template/xhtml/actionmessage.ftl new file mode 100644 index 000000000..384b75558 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/template/xhtml/actionmessage.ftl @@ -0,0 +1,7 @@ +<#if (actionMessages?exists && actionMessages?size > 0)> +
      + <#list actionMessages as message> +
    • ${message}
    • + +
    + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/template/xhtml/hidden.ftl b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/template/xhtml/hidden.ftl new file mode 100644 index 000000000..c97423fe9 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/template/xhtml/hidden.ftl @@ -0,0 +1,15 @@ + + name="${parameters.name?default("")?html}"<#rt/> +<#if parameters.nameValue?exists> + value="<@ww.property value="parameters.nameValue"/>"<#rt/> + +<#if parameters.id?exists> + id="${parameters.id?html}"<#rt/> + +<#if parameters.cssClass?exists> + class="${parameters.cssClass?html}"<#rt/> + +<#if parameters.cssStyle?exists> + style="${parameters.cssStyle?html}"<#rt/> + +/> diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/sql/mysql/dev_bootstrap.sql b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/sql/mysql/dev_bootstrap.sql new file mode 100644 index 000000000..9da244402 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/sql/mysql/dev_bootstrap.sql @@ -0,0 +1,17 @@ +-- mysql mysql --user=root --password < dev_bootstrap.sql + +create database archiva character set utf8 collate utf8_general_ci; +create database redback; + +use mysql; + +GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER,INDEX + ON archiva.* + TO 'archiva'@'localhost' + IDENTIFIED BY 'sa'; + +GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER,INDEX + ON redback.* + TO 'archiva'@'localhost' + IDENTIFIED BY 'sa'; + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/sql/mysql/drop_archiva_tables.sql b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/sql/mysql/drop_archiva_tables.sql new file mode 100644 index 000000000..b30ab647e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/sql/mysql/drop_archiva_tables.sql @@ -0,0 +1,34 @@ +-- mysql archiva --user=archiva --password=sa < drop_archiva_tables.sql + +DROP TABLE IF EXISTS `ARCHIVAPROJECTMODEL_BUILDEXTENSIONS` ; +DROP TABLE IF EXISTS `ARCHIVAPROJECTMODEL_DEPENDENCIES` ; +DROP TABLE IF EXISTS `ARCHIVAPROJECTMODEL_DEPENDENCYMANAGEMENT` ; +DROP TABLE IF EXISTS `ARCHIVAPROJECTMODEL_INDIVIDUALS` ; +DROP TABLE IF EXISTS `ARCHIVAPROJECTMODEL_LICENSES` ; +DROP TABLE IF EXISTS `ARCHIVAPROJECTMODEL_MAILINGLISTS` ; +DROP TABLE IF EXISTS `ARCHIVAPROJECTMODEL_PLUGINS` ; +DROP TABLE IF EXISTS `ARCHIVAPROJECTMODEL_REPORTS` ; +DROP TABLE IF EXISTS `ARCHIVAPROJECTMODEL_REPOSITORIES` ; +DROP TABLE IF EXISTS `ARCHIVA_ARTIFACT` ; +DROP TABLE IF EXISTS `INDIVIDUAL_ROLES` ; +DROP TABLE IF EXISTS `ARCHIVA_INDIVIDUAL` ; +DROP TABLE IF EXISTS `ARCHIVA_EXCLUSIONS` ; +DROP TABLE IF EXISTS `ARCHIVA_DEPENDENCY` ; +DROP TABLE IF EXISTS `DEPENDENCY_EXCLUSIONS` ; +DROP TABLE IF EXISTS `SEQUENCE_TABLE` ; +DROP TABLE IF EXISTS `ARCHIVA_LICENSES` ; +DROP TABLE IF EXISTS `ARCHIVA_PROJECT_REPOSITORIES` ; +DROP TABLE IF EXISTS `ARCHIVA_REPOSITORY_STATS` ; +DROP TABLE IF EXISTS `MAILINGLIST_OTHERARCHIVES` ; +DROP TABLE IF EXISTS `ARCHIVA_MAILING_LISTS` ; + +DROP TABLE IF EXISTS `ARCHIVA_REPOSITORIES` ; +DROP TABLE IF EXISTS `ARCHIVA_ARTIFACT_REFERENCE` ; +DROP TABLE IF EXISTS `ARCHIVA_PROJECT` ; +DROP TABLE IF EXISTS `ARCHIVA_ISSUE_MANAGEMENT` ; +DROP TABLE IF EXISTS `ARCHIVA_VERSIONED_REFERENCE` ; +DROP TABLE IF EXISTS `ARCHIVA_CIMANAGEMENT` ; +DROP TABLE IF EXISTS `ARCHIVA_SCM` ; +DROP TABLE IF EXISTS `ARCHIVA_ORGANIZATION` ; +DROP TABLE IF EXISTS `ARCHIVA_REPOSITORY_PROBLEMS` ; + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/AbstractWebworkTestCase.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/AbstractWebworkTestCase.java new file mode 100644 index 000000000..35f526e4f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/AbstractWebworkTestCase.java @@ -0,0 +1,127 @@ +package org.apache.maven.archiva.web.action; + +/* + * 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 com.opensymphony.xwork.ActionSupport; +import org.apache.commons.lang.StringUtils; +import org.codehaus.plexus.spring.PlexusInSpringTestCase; + +import java.lang.reflect.Method; +import java.util.Collection; +import java.util.List; + +/** + * AbstractWebworkTestCase + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public abstract class AbstractWebworkTestCase + extends PlexusInSpringTestCase +{ + /** + * This is a conveinence method for mimicking how the webwork interceptors + * operate on an action, before the request is processed. + * + * Call this before each major request to the action to be sure you mimic the webwork process correctly. + */ + protected void preRequest( ActionSupport action ) + { + action.clearErrorsAndMessages(); + } + + /** + * Tests the action to ensure that it has errors. + * + * NOTE: Don't forget to run {@link #preRequest(ActionSupport)} before each request to your action! + */ + protected void assertHasErrors( ActionSupport action ) + { + assertNotNull( action.getActionErrors() ); + assertTrue( "Expected an error to occur.", action.getActionErrors().size() > 0 ); + } + + /** + * Tests the action to ensure that it has messages. + * + * NOTE: Don't forget to run {@link #preRequest(ActionSupport)} before each request to your action! + */ + protected void assertHasMessages( ActionSupport action ) + { + assertNotNull( action.getActionMessages() ); + assertTrue( "Expected an message to be set.", action.getActionMessages().size() > 0 ); + } + + /** + * Tests the action to ensure that it has NO errors. + * + * NOTE: Don't forget to run {@link #preRequest(ActionSupport)} before each request to your action! + */ + protected void assertNoErrors( ActionSupport action ) + { + List errors = (List) action.getActionErrors(); + + assertNotNull( errors ); + if ( errors.size() > 0 ) + { + StringBuffer msg = new StringBuffer(); + msg.append( "Should have had no errors. but found the following errors." ); + + for ( String error : errors ) + { + msg.append( "\n " ).append( error ); + } + fail( msg.toString() ); + } + } + + protected void assertRequestStatus( ActionSupport action, String expectedStatus, String methodName ) + throws Exception + { + action.clearErrorsAndMessages(); + + Method method = action.getClass().getDeclaredMethod( methodName, (Class[]) null ); + Object actualStatus = method.invoke( action, (Object[]) null ); + assertTrue( "return should be of type String", actualStatus instanceof String ); + + if ( !StringUtils.equals( expectedStatus, (String) actualStatus ) ) + { + StringBuffer msg = new StringBuffer(); + msg.append( "Unexpected status returned from method <" ); + msg.append( methodName ).append( "> on action <" ); + String clazzname = action.getClass().getName(); + msg.append( clazzname.substring( clazzname.lastIndexOf( '.' ) ) ); + msg.append( ">: expected:<" ).append( expectedStatus ).append( "> but was:<" ); + msg.append( (String) actualStatus ).append( ">. (see attached action messages and errors below)" ); + + for ( String message : (Collection) action.getActionMessages() ) + { + msg.append( "\n [MESSAGE]: " ).append( message ); + } + + for ( String error : (Collection) action.getActionErrors() ) + { + msg.append( "\n [ERROR]: " ).append( error ); + } + + fail( msg.toString() ); + } + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/appearance/AbstractOrganizationInfoActionTest.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/appearance/AbstractOrganizationInfoActionTest.java new file mode 100644 index 000000000..c840c2381 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/appearance/AbstractOrganizationInfoActionTest.java @@ -0,0 +1,47 @@ +package org.apache.maven.archiva.web.action.admin.appearance; + +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.Configuration; +import org.apache.maven.archiva.web.action.AbstractWebworkTestCase; +import org.easymock.MockControl; + +/** + * @author James William Dumay + */ +public abstract class AbstractOrganizationInfoActionTest extends AbstractWebworkTestCase +{ + protected MockControl archivaConfigurationControl; + + protected ArchivaConfiguration configuration; + + protected AbstractAppearanceAction action; + + protected Configuration config; + + protected abstract AbstractAppearanceAction getAction(); + + @Override + protected void setUp() + throws Exception + { + super.setUp(); + + config = new Configuration(); + archivaConfigurationControl = MockControl.createControl( ArchivaConfiguration.class ); + configuration = (ArchivaConfiguration) archivaConfigurationControl.getMock(); + + configuration.getConfiguration(); + archivaConfigurationControl.setReturnValue(config, 1, 2); + + configuration.save(config); + archivaConfigurationControl.setVoidCallable(1, 2); + + archivaConfigurationControl.replay(); + } + + protected void reloadAction() + { + action = getAction(); + action.setConfiguration( configuration ); + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/appearance/EditOrganizationInfoActionTest.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/appearance/EditOrganizationInfoActionTest.java new file mode 100644 index 000000000..66ca872c2 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/appearance/EditOrganizationInfoActionTest.java @@ -0,0 +1,69 @@ +package org.apache.maven.archiva.web.action.admin.appearance; + +/* + * 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 com.opensymphony.xwork.Action; +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.Configuration; +import org.apache.maven.archiva.configuration.OrganisationInformation; +import org.apache.maven.archiva.web.action.AbstractWebworkTestCase; +import org.easymock.MockControl; + +/** + * @author James William Dumay + */ +public class EditOrganizationInfoActionTest extends AbstractOrganizationInfoActionTest +{ + public void testOrganisationInfoSaves() + throws Exception + { + config.setOrganisationInfo(new OrganisationInformation()); + OrganisationInformation orginfo = config.getOrganisationInfo(); + orginfo.setLogoLocation("LOGO"); + orginfo.setName("NAME"); + orginfo.setUrl("URL"); + + configuration.save(config); + + reloadAction(); + + action.prepare(); + + assertEquals("LOGO", action.getOrganisationLogo()); + assertEquals("NAME", action.getOrganisationName()); + assertEquals("URL", action.getOrganisationUrl()); + + action.setOrganisationLogo("LOGO1"); + action.setOrganisationName("NAME1"); + action.setOrganisationUrl("URL1"); + + action.execute(); + + assertEquals("LOGO1", orginfo.getLogoLocation()); + assertEquals("NAME1", orginfo.getName()); + assertEquals("URL1", orginfo.getUrl()); + } + + @Override + protected AbstractAppearanceAction getAction() + { + return (EditOrganisationInfoAction) lookup( Action.class.getName(), "editOrganisationInfo" ); + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/appearance/OrganizationInfoActionTest.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/appearance/OrganizationInfoActionTest.java new file mode 100644 index 000000000..fec9e8f81 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/appearance/OrganizationInfoActionTest.java @@ -0,0 +1,58 @@ +package org.apache.maven.archiva.web.action.admin.appearance; + +/* + * 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 com.opensymphony.xwork.Action; +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.OrganisationInformation; +import org.apache.maven.archiva.configuration.Configuration; +import org.apache.maven.archiva.web.action.AbstractWebworkTestCase; + +/** + * @author James William Dumay + */ +public class OrganizationInfoActionTest extends AbstractOrganizationInfoActionTest +{ + public void testOrganisationInfoLoads() + throws Exception + { + config.setOrganisationInfo(new OrganisationInformation()); + OrganisationInformation orginfo = config.getOrganisationInfo(); + orginfo.setLogoLocation("LOGO"); + orginfo.setName("NAME"); + orginfo.setUrl("URL"); + + configuration.save(config); + + reloadAction(); + + action.prepare(); + + assertEquals("URL", action.getOrganisationUrl()); + assertEquals("NAME", action.getOrganisationName()); + assertEquals("LOGO", action.getOrganisationLogo()); + } + + @Override + protected AbstractAppearanceAction getAction() + { + return (OrganisationInfoAction) lookup( Action.class.getName(), "organisationInfo" ); + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/AddProxyConnectorActionTest.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/AddProxyConnectorActionTest.java new file mode 100644 index 000000000..213ce9fbb --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/AddProxyConnectorActionTest.java @@ -0,0 +1,417 @@ +package org.apache.maven.archiva.web.action.admin.connectors.proxy; + +/* + * 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 com.opensymphony.xwork.Action; +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.Configuration; +import org.apache.maven.archiva.configuration.IndeterminateConfigurationException; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.configuration.ProxyConnectorConfiguration; +import org.apache.maven.archiva.configuration.RemoteRepositoryConfiguration; +import org.apache.maven.archiva.policies.CachedFailuresPolicy; +import org.apache.maven.archiva.policies.ChecksumPolicy; +import org.apache.maven.archiva.policies.PropagateErrorsDownloadPolicy; +import org.apache.maven.archiva.policies.PropagateErrorsOnUpdateDownloadPolicy; +import org.apache.maven.archiva.policies.ReleasesPolicy; +import org.apache.maven.archiva.policies.SnapshotsPolicy; +import org.apache.maven.archiva.web.action.AbstractWebworkTestCase; +import org.codehaus.plexus.redback.xwork.interceptor.SecureActionBundle; +import org.codehaus.plexus.registry.RegistryException; +import org.easymock.MockControl; + +import java.util.List; +import java.util.Map; + +/** + * AddProxyConnectorActionTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class AddProxyConnectorActionTest + extends AbstractWebworkTestCase +{ + private AddProxyConnectorAction action; + + private MockControl archivaConfigurationControl; + + private ArchivaConfiguration archivaConfiguration; + + public void testAddBlackListPattern() + throws Exception + { + expectConfigurationRequests( 7 ); + archivaConfigurationControl.replay(); + + // Prepare Test. + action.prepare(); + ProxyConnectorConfiguration connector = action.getConnector(); + populateProxyConnector( connector ); + + // Perform Test w/no values. + preRequest( action ); + String status = action.addBlackListPattern(); + assertEquals( Action.INPUT, status ); + + // Should have returned an error, with no blacklist pattern added. + assertHasErrors( action ); + assertEquals( 0, connector.getBlackListPatterns().size() ); + + // Try again, but now with a pattern to add. + action.setBlackListPattern( "**/*-javadoc.jar" ); + preRequest( action ); + status = action.addBlackListPattern(); + assertEquals( Action.INPUT, status ); + + // Should have no error, and 1 blacklist pattern added. + assertNoErrors( action ); + assertEquals( 1, connector.getBlackListPatterns().size() ); + } + + public void testAddProperty() + throws Exception + { + expectConfigurationRequests( 7 ); + archivaConfigurationControl.replay(); + + // Prepare Test. + action.prepare(); + ProxyConnectorConfiguration connector = action.getConnector(); + populateProxyConnector( connector ); + + // Perform Test w/no values. + preRequest( action ); + String status = action.addProperty(); + assertEquals( Action.INPUT, status ); + + // Should have returned an error, with no property pattern added. + assertHasErrors( action ); + assertEquals( 0, connector.getProperties().size() ); + + // Try again, but now with a property key/value to add. + action.setPropertyKey( "eat-a" ); + action.setPropertyValue( "gramov-a-bits" ); + preRequest( action ); + status = action.addProperty(); + assertEquals( Action.INPUT, status ); + + // Should have no error, and 1 property added. + assertNoErrors( action ); + assertEquals( 1, connector.getProperties().size() ); + } + + public void testAddProxyConnectorCommit() + throws Exception + { + expectConfigurationRequests( 7 ); + archivaConfigurationControl.replay(); + + // Prepare Test. + action.prepare(); + ProxyConnectorConfiguration connector = action.getConnector(); + populateProxyConnector( connector ); + // forms will use an array + connector.getProperties().put( "eat-a", new String[] { "gramov-a-bits" } ); + + // Create the input screen. + assertRequestStatus( action, Action.SUCCESS, "commit" ); + assertNoErrors( action ); + + // Test configuration. + List proxyConfigs = archivaConfiguration.getConfiguration().getProxyConnectors(); + assertNotNull( proxyConfigs ); + assertEquals( 1, proxyConfigs.size() ); + + ProxyConnectorConfiguration actualConnector = proxyConfigs.get( 0 ); + + assertNotNull( actualConnector ); + // The use of "(direct connection)" should result in a proxyId which is . + assertNull( actualConnector.getProxyId() ); + assertEquals( "corporate", actualConnector.getSourceRepoId() ); + assertEquals( "central", actualConnector.getTargetRepoId() ); + assertEquals( "gramov-a-bits", actualConnector.getProperties().get( "eat-a" ) ); + } + + public void testAddProxyConnectorInitialPage() + throws Exception + { + expectConfigurationRequests( 3 ); + archivaConfigurationControl.replay(); + + action.prepare(); + ProxyConnectorConfiguration configuration = action.getConnector(); + assertNotNull( configuration ); + assertNull( configuration.getProxyId() ); + assertNull( configuration.getSourceRepoId() ); + assertNull( configuration.getTargetRepoId() ); + assertTrue( configuration.getPolicies().isEmpty() ); + assertTrue( configuration.getProperties().isEmpty() ); + assertTrue( configuration.getBlackListPatterns().isEmpty() ); + assertTrue( configuration.getWhiteListPatterns().isEmpty() ); + + String status = action.input(); + assertEquals( Action.INPUT, status ); + } + + public void testAddWhiteListPattern() + throws Exception + { + expectConfigurationRequests( 7 ); + archivaConfigurationControl.replay(); + + // Prepare Test. + action.prepare(); + ProxyConnectorConfiguration connector = action.getConnector(); + populateProxyConnector( connector ); + + // Perform Test w/no values. + preRequest( action ); + String status = action.addWhiteListPattern(); + assertEquals( Action.INPUT, status ); + + // Should have returned an error, with no whitelist pattern added. + assertHasErrors( action ); + assertEquals( 0, connector.getWhiteListPatterns().size() ); + + // Try again, but now with a pattern to add. + action.setWhiteListPattern( "**/*.jar" ); + preRequest( action ); + status = action.addWhiteListPattern(); + assertEquals( Action.INPUT, status ); + + // Should have no error, and 1 whitelist pattern added. + assertNoErrors( action ); + assertEquals( 1, connector.getWhiteListPatterns().size() ); + } + + public void testRemoveBlackListPattern() + throws Exception + { + expectConfigurationRequests( 7 ); + archivaConfigurationControl.replay(); + + // Prepare Test. + action.prepare(); + ProxyConnectorConfiguration connector = action.getConnector(); + populateProxyConnector( connector ); + + // Add some arbitrary blacklist patterns. + connector.addBlackListPattern( "**/*-javadoc.jar" ); + connector.addBlackListPattern( "**/*.war" ); + + // Perform Test w/no pattern value. + preRequest( action ); + String status = action.removeBlackListPattern(); + assertEquals( Action.INPUT, status ); + + // Should have returned an error, with no blacklist pattern removed. + assertHasErrors( action ); + assertEquals( 2, connector.getBlackListPatterns().size() ); + + // Perform test w/invalid (non-existant) pattern value to remove. + preRequest( action ); + action.setPattern( "**/*oops*" ); + status = action.removeBlackListPattern(); + assertEquals( Action.INPUT, status ); + + // Should have returned an error, with no blacklist pattern removed. + assertHasErrors( action ); + assertEquals( 2, connector.getBlackListPatterns().size() ); + + // Try again, but now with a valid pattern to remove. + action.setPattern( "**/*-javadoc.jar" ); + preRequest( action ); + status = action.removeBlackListPattern(); + assertEquals( Action.INPUT, status ); + + // Should have no error, and 1 blacklist pattern left. + assertNoErrors( action ); + assertEquals( 1, connector.getBlackListPatterns().size() ); + assertEquals( "Should have left 1 blacklist pattern", "**/*.war", connector.getBlackListPatterns().get( 0 ) ); + } + + public void testRemoveProperty() + throws Exception + { + expectConfigurationRequests( 7 ); + archivaConfigurationControl.replay(); + + // Prepare Test. + action.prepare(); + ProxyConnectorConfiguration connector = action.getConnector(); + populateProxyConnector( connector ); + + // Add some arbitrary properties. + connector.addProperty( "username", "general-tso" ); + connector.addProperty( "password", "chicken" ); + + // Perform Test w/no property key. + preRequest( action ); + String status = action.removeProperty(); + assertEquals( Action.INPUT, status ); + + // Should have returned an error, with no properties removed. + assertHasErrors( action ); + assertEquals( 2, connector.getProperties().size() ); + + // Perform test w/invalid (non-existant) property key to remove. + preRequest( action ); + action.setPropertyKey( "slurm" ); + status = action.removeProperty(); + assertEquals( Action.INPUT, status ); + + // Should have returned an error, with no properties removed. + assertHasErrors( action ); + assertEquals( 2, connector.getProperties().size() ); + + // Try again, but now with a valid property to remove. + preRequest( action ); + action.setPropertyKey( "password" ); + status = action.removeProperty(); + assertEquals( Action.INPUT, status ); + + // Should have no error, and 1 property left. + assertNoErrors( action ); + assertEquals( 1, connector.getProperties().size() ); + assertEquals( "Should have left 1 property", "general-tso", connector.getProperties().get( "username" ) ); + } + + public void testRemoveWhiteListPattern() + throws Exception + { + expectConfigurationRequests( 7 ); + archivaConfigurationControl.replay(); + + // Prepare Test. + action.prepare(); + ProxyConnectorConfiguration connector = action.getConnector(); + populateProxyConnector( connector ); + + // Add some arbitrary whitelist patterns. + connector.addWhiteListPattern( "javax/**/*" ); + connector.addWhiteListPattern( "com/sun/**/*" ); + + // Perform Test w/no pattern value. + preRequest( action ); + String status = action.removeWhiteListPattern(); + assertEquals( Action.INPUT, status ); + + // Should have returned an error, with no whitelist pattern removed. + assertHasErrors( action ); + assertEquals( 2, connector.getWhiteListPatterns().size() ); + + // Perform test w/invalid (non-existant) pattern value to remove. + preRequest( action ); + action.setPattern( "**/*oops*" ); + status = action.removeWhiteListPattern(); + assertEquals( Action.INPUT, status ); + + // Should have returned an error, with no whitelist pattern removed. + assertHasErrors( action ); + assertEquals( 2, connector.getWhiteListPatterns().size() ); + + // Try again, but now with a valid pattern to remove. + action.setPattern( "com/sun/**/*" ); + preRequest( action ); + status = action.removeWhiteListPattern(); + assertEquals( Action.INPUT, status ); + + // Should have no error, and 1 whitelist pattern left. + assertNoErrors( action ); + assertEquals( 1, connector.getWhiteListPatterns().size() ); + assertEquals( "Should have left 1 whitelist pattern", "javax/**/*", connector.getWhiteListPatterns().get( 0 ) ); + } + + public void testSecureActionBundle() + throws Exception + { + expectConfigurationRequests( 3 ); + archivaConfigurationControl.replay(); + + action.prepare(); + SecureActionBundle bundle = action.getSecureActionBundle(); + assertTrue( bundle.requiresAuthentication() ); + assertEquals( 1, bundle.getAuthorizationTuples().size() ); + } + + private Configuration createInitialConfiguration() + { + Configuration config = new Configuration(); + + ManagedRepositoryConfiguration managedRepo = new ManagedRepositoryConfiguration(); + managedRepo.setId( "corporate" ); + managedRepo.setLayout( "${java.io.tmpdir}/archiva-test/managed-repo" ); + managedRepo.setReleases( true ); + + config.addManagedRepository( managedRepo ); + + RemoteRepositoryConfiguration remoteRepo = new RemoteRepositoryConfiguration(); + remoteRepo.setId( "central" ); + remoteRepo.setUrl( "http://repo1.maven.org/maven2/" ); + + config.addRemoteRepository( remoteRepo ); + + return config; + } + + private void expectConfigurationRequests( int requestConfigCount ) + throws RegistryException, IndeterminateConfigurationException + { + Configuration config = createInitialConfiguration(); + + for ( int i = 0; i < requestConfigCount; i++ ) + { + archivaConfiguration.getConfiguration(); + archivaConfigurationControl.setReturnValue( config ); + } + + archivaConfiguration.save( config ); + } + + private void populateProxyConnector( ProxyConnectorConfiguration connector ) + { + connector.setProxyId( AbstractProxyConnectorFormAction.DIRECT_CONNECTION ); + connector.setSourceRepoId( "corporate" ); + connector.setTargetRepoId( "central" ); + + // TODO: Set these options programatically via list of available policies. + Map policies = connector.getPolicies(); + policies.put( "releases", new ReleasesPolicy().getDefaultOption() ); + policies.put( "snapshots", new SnapshotsPolicy().getDefaultOption() ); + policies.put( "checksum", new ChecksumPolicy().getDefaultOption() ); + policies.put( "cache-failures", new CachedFailuresPolicy().getDefaultOption() ); + policies.put( "propagate-errors", new PropagateErrorsDownloadPolicy().getDefaultOption() ); + policies.put( "propagate-errors-on-update", new PropagateErrorsOnUpdateDownloadPolicy().getDefaultOption() ); + } + + @Override + protected void setUp() + throws Exception + { + super.setUp(); + + action = (AddProxyConnectorAction) lookup( Action.class.getName(), "addProxyConnectorAction" ); + + archivaConfigurationControl = MockControl.createControl( ArchivaConfiguration.class ); + archivaConfiguration = (ArchivaConfiguration) archivaConfigurationControl.getMock(); + action.setArchivaConfiguration( archivaConfiguration ); + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/DeleteProxyConnectorActionTest.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/DeleteProxyConnectorActionTest.java new file mode 100644 index 000000000..d3d30f190 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/DeleteProxyConnectorActionTest.java @@ -0,0 +1,225 @@ +package org.apache.maven.archiva.web.action.admin.connectors.proxy; + +/* + * 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 com.opensymphony.xwork.Action; + +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.Configuration; +import org.apache.maven.archiva.configuration.IndeterminateConfigurationException; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.configuration.ProxyConnectorConfiguration; +import org.apache.maven.archiva.configuration.RemoteRepositoryConfiguration; +import org.apache.maven.archiva.web.action.AbstractWebworkTestCase; +import org.codehaus.plexus.redback.xwork.interceptor.SecureActionBundle; +import org.codehaus.plexus.registry.RegistryException; +import org.easymock.MockControl; + +/** + * DeleteProxyConnectorActionTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class DeleteProxyConnectorActionTest + extends AbstractWebworkTestCase +{ + private static final String TEST_TARGET_ID = "central"; + + private static final String TEST_SOURCE_ID = "corporate"; + + private DeleteProxyConnectorAction action; + + private MockControl archivaConfigurationControl; + + private ArchivaConfiguration archivaConfiguration; + + public void testConfirmDelete() + throws Exception + { + expectConfigurationRequests( 1 ); + archivaConfigurationControl.replay(); + + // Show the confirm the delete of proxy connector screen. + preRequest( action ); + action.setSource( TEST_SOURCE_ID ); + action.setTarget( TEST_TARGET_ID ); + String status = action.confirmDelete(); + assertEquals( Action.INPUT, status ); + assertNoErrors( action ); + } + + public void testConfirmDeleteBadSourceOrTarget() + throws Exception + { + expectConfigurationRequests( 4 ); + archivaConfigurationControl.replay(); + + // Attempt to show the confirm delete screen, but provide + // a bad source id or target id to actually delete + + preRequest( action ); + action.setSource( "bad-source" ); // id doesn't exist. + action.setTarget( "bad-target" ); // id doesn't exist. + String status = action.confirmDelete(); + // Should have resulted in an error. + assertEquals( Action.ERROR, status ); + assertHasErrors( action ); + + preRequest( action ); + action.setSource( "bad" ); // Bad doesn't exist. + action.setTarget( TEST_TARGET_ID ); + status = action.confirmDelete(); + // Should have resulted in an error. + assertEquals( Action.ERROR, status ); + assertHasErrors( action ); + + preRequest( action ); + action.setSource( TEST_SOURCE_ID ); + action.setTarget( "bad" ); // Bad doesn't exist. + status = action.confirmDelete(); + // Should have resulted in an error. + assertEquals( Action.ERROR, status ); + assertHasErrors( action ); + } + + public void testConfirmDeleteNoSourceOrTarget() + throws Exception + { + expectConfigurationRequests( 1 ); + archivaConfigurationControl.replay(); + + // Attempt to show the confirm delete screen, but don't provide + // the source id or target id to actually delete + + preRequest( action ); + action.setSource( null ); // No source Id. + action.setTarget( null ); // No target Id. + String status = action.confirmDelete(); + // Should have resulted in an error. + assertEquals( Action.ERROR, status ); + assertHasErrors( action ); + + preRequest( action ); + action.setSource( TEST_SOURCE_ID ); + action.setTarget( null ); // No target Id. + status = action.confirmDelete(); + // Should have resulted in an error. + assertEquals( Action.ERROR, status ); + assertHasErrors( action ); + + preRequest( action ); + action.setSource( null ); // No source Id. + action.setTarget( TEST_TARGET_ID ); + status = action.confirmDelete(); + // Should have resulted in an error. + assertEquals( Action.ERROR, status ); + assertHasErrors( action ); + } + + public void testDelete() + throws Exception + { + expectConfigurationRequests( 5 ); + archivaConfigurationControl.replay(); + + // Show the confirm the delete of proxy connector screen. + preRequest( action ); + action.setSource( TEST_SOURCE_ID ); + action.setTarget( TEST_TARGET_ID ); + String status = action.confirmDelete(); + assertEquals( Action.INPUT, status ); + assertNoErrors( action ); + + // Perform the delete. + preRequest( action ); + status = action.delete(); + assertEquals( Action.SUCCESS, status ); + assertNoErrors( action ); + assertHasMessages( action ); + + // Test the configuration. + assertEquals( 0, archivaConfiguration.getConfiguration().getProxyConnectors().size() ); + } + + public void testSecureActionBundle() + throws Exception + { + expectConfigurationRequests( 1 ); + archivaConfigurationControl.replay(); + + SecureActionBundle bundle = action.getSecureActionBundle(); + assertTrue( bundle.requiresAuthentication() ); + assertEquals( 1, bundle.getAuthorizationTuples().size() ); + } + + private Configuration createInitialConfiguration() + { + Configuration config = new Configuration(); + + ManagedRepositoryConfiguration managedRepo = new ManagedRepositoryConfiguration(); + managedRepo.setId( TEST_SOURCE_ID ); + managedRepo.setLayout( "${java.io.tmpdir}/archiva-test/managed-repo" ); + managedRepo.setReleases( true ); + + config.addManagedRepository( managedRepo ); + + RemoteRepositoryConfiguration remoteRepo = new RemoteRepositoryConfiguration(); + remoteRepo.setId( TEST_TARGET_ID ); + remoteRepo.setUrl( "http://repo1.maven.org/maven2/" ); + + config.addRemoteRepository( remoteRepo ); + + ProxyConnectorConfiguration connector = new ProxyConnectorConfiguration(); + connector.setSourceRepoId( TEST_SOURCE_ID ); + connector.setTargetRepoId( TEST_TARGET_ID ); + + config.addProxyConnector( connector ); + + return config; + } + + private void expectConfigurationRequests( int requestConfigCount ) + throws RegistryException, IndeterminateConfigurationException + { + Configuration config = createInitialConfiguration(); + + for ( int i = 0; i < requestConfigCount; i++ ) + { + archivaConfiguration.getConfiguration(); + archivaConfigurationControl.setReturnValue( config ); + } + + archivaConfiguration.save( config ); + } + + @Override + protected void setUp() + throws Exception + { + super.setUp(); + + action = (DeleteProxyConnectorAction) lookup( Action.class.getName(), "deleteProxyConnectorAction" ); + + archivaConfigurationControl = MockControl.createControl( ArchivaConfiguration.class ); + archivaConfiguration = (ArchivaConfiguration) archivaConfigurationControl.getMock(); + action.setArchivaConfiguration( archivaConfiguration ); + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/EditProxyConnectorActionTest.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/EditProxyConnectorActionTest.java new file mode 100644 index 000000000..31364f4b8 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/EditProxyConnectorActionTest.java @@ -0,0 +1,447 @@ +package org.apache.maven.archiva.web.action.admin.connectors.proxy; + +/* + * 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 com.opensymphony.xwork.Action; +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.Configuration; +import org.apache.maven.archiva.configuration.IndeterminateConfigurationException; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.configuration.ProxyConnectorConfiguration; +import org.apache.maven.archiva.configuration.RemoteRepositoryConfiguration; +import org.apache.maven.archiva.policies.CachedFailuresPolicy; +import org.apache.maven.archiva.policies.ChecksumPolicy; +import org.apache.maven.archiva.policies.PropagateErrorsDownloadPolicy; +import org.apache.maven.archiva.policies.PropagateErrorsOnUpdateDownloadPolicy; +import org.apache.maven.archiva.policies.ReleasesPolicy; +import org.apache.maven.archiva.policies.SnapshotsPolicy; +import org.apache.maven.archiva.web.action.AbstractWebworkTestCase; +import org.codehaus.plexus.redback.xwork.interceptor.SecureActionBundle; +import org.codehaus.plexus.registry.RegistryException; +import org.easymock.MockControl; + +import java.util.List; +import java.util.Map; + +/** + * EditProxyConnectorActionTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class EditProxyConnectorActionTest + extends AbstractWebworkTestCase +{ + private static final String TEST_TARGET_ID = "central"; + + private static final String TEST_SOURCE_ID = "corporate"; + + private EditProxyConnectorAction action; + + private MockControl archivaConfigurationControl; + + private ArchivaConfiguration archivaConfiguration; + + public void testAddBlackListPattern() + throws Exception + { + expectConfigurationRequests( 7 ); + archivaConfigurationControl.replay(); + + // Prepare Test. + action.setSource( TEST_SOURCE_ID ); + action.setTarget( TEST_TARGET_ID ); + action.prepare(); + ProxyConnectorConfiguration connector = action.getConnector(); + assertInitialProxyConnector( connector ); + + // Perform Test w/no values. + preRequest( action ); + String status = action.addBlackListPattern(); + assertEquals( Action.INPUT, status ); + + // Should have returned an error, with no blacklist pattern added. + assertHasErrors( action ); + assertEquals( 0, connector.getBlackListPatterns().size() ); + + // Try again, but now with a pattern to add. + action.setBlackListPattern( "**/*-javadoc.jar" ); + preRequest( action ); + status = action.addBlackListPattern(); + assertEquals( Action.INPUT, status ); + + // Should have no error, and 1 blacklist pattern added. + assertNoErrors( action ); + assertEquals( 1, connector.getBlackListPatterns().size() ); + } + + public void testAddProperty() + throws Exception + { + expectConfigurationRequests( 7 ); + archivaConfigurationControl.replay(); + + // Prepare Test. + action.setSource( TEST_SOURCE_ID ); + action.setTarget( TEST_TARGET_ID ); + action.prepare(); + ProxyConnectorConfiguration connector = action.getConnector(); + assertInitialProxyConnector( connector ); + + // Perform Test w/no values. + preRequest( action ); + String status = action.addProperty(); + assertEquals( Action.INPUT, status ); + + // Should have returned an error, with no property pattern added. + assertHasErrors( action ); + assertEquals( 0, connector.getProperties().size() ); + + // Try again, but now with a property key/value to add. + action.setPropertyKey( "eat-a" ); + action.setPropertyValue( "gramov-a-bits" ); + preRequest( action ); + status = action.addProperty(); + assertEquals( Action.INPUT, status ); + + // Should have no error, and 1 property added. + assertNoErrors( action ); + assertEquals( 1, connector.getProperties().size() ); + assertEquals( "gramov-a-bits", connector.getProperties().get( "eat-a" ) ); + } + + public void testAddWhiteListPattern() + throws Exception + { + expectConfigurationRequests( 7 ); + archivaConfigurationControl.replay(); + + // Prepare Test. + action.setSource( TEST_SOURCE_ID ); + action.setTarget( TEST_TARGET_ID ); + action.prepare(); + ProxyConnectorConfiguration connector = action.getConnector(); + assertInitialProxyConnector( connector ); + + // Perform Test w/no values. + preRequest( action ); + String status = action.addWhiteListPattern(); + assertEquals( Action.INPUT, status ); + + // Should have returned an error, with no whitelist pattern added. + assertHasErrors( action ); + assertEquals( 0, connector.getWhiteListPatterns().size() ); + + // Try again, but now with a pattern to add. + action.setWhiteListPattern( "**/*.jar" ); + preRequest( action ); + status = action.addWhiteListPattern(); + assertEquals( Action.INPUT, status ); + + // Should have no error, and 1 whitelist pattern added. + assertNoErrors( action ); + assertEquals( 1, connector.getWhiteListPatterns().size() ); + } + + public void testEditProxyConnectorCommit() + throws Exception + { + expectConfigurationRequests( 7 ); + archivaConfigurationControl.replay(); + + // Prepare Test. + action.setSource( TEST_SOURCE_ID ); + action.setTarget( TEST_TARGET_ID ); + action.prepare(); + ProxyConnectorConfiguration connector = action.getConnector(); + assertInitialProxyConnector( connector ); + // forms will use an array + connector.getProperties().put( "eat-a", new String[] { "gramov-a-bits" } ); + + // Create the input screen. + assertRequestStatus( action, Action.SUCCESS, "commit" ); + assertNoErrors( action ); + + // Test configuration. + List proxyConfigs = archivaConfiguration.getConfiguration().getProxyConnectors(); + assertNotNull( proxyConfigs ); + assertEquals( 1, proxyConfigs.size() ); + + ProxyConnectorConfiguration actualConnector = proxyConfigs.get( 0 ); + + assertNotNull( actualConnector ); + // The use of "(direct connection)" should result in a proxyId which is . + assertNull( actualConnector.getProxyId() ); + assertEquals( "corporate", actualConnector.getSourceRepoId() ); + assertEquals( "central", actualConnector.getTargetRepoId() ); + + } + + public void testEditProxyConnectorInitialPage() + throws Exception + { + expectConfigurationRequests( 3 ); + archivaConfigurationControl.replay(); + + action.setSource( TEST_SOURCE_ID ); + action.setTarget( TEST_TARGET_ID ); + action.prepare(); + ProxyConnectorConfiguration connector = action.getConnector(); + assertInitialProxyConnector( connector ); + + String status = action.input(); + assertEquals( Action.INPUT, status ); + } + + public void testRemoveBlackListPattern() + throws Exception + { + expectConfigurationRequests( 7 ); + archivaConfigurationControl.replay(); + + // Prepare Test. + action.setSource( TEST_SOURCE_ID ); + action.setTarget( TEST_TARGET_ID ); + action.prepare(); + ProxyConnectorConfiguration connector = action.getConnector(); + assertInitialProxyConnector( connector ); + + // Add some arbitrary blacklist patterns. + connector.addBlackListPattern( "**/*-javadoc.jar" ); + connector.addBlackListPattern( "**/*.war" ); + + // Perform Test w/no pattern value. + preRequest( action ); + String status = action.removeBlackListPattern(); + assertEquals( Action.INPUT, status ); + + // Should have returned an error, with no blacklist pattern removed. + assertHasErrors( action ); + assertEquals( 2, connector.getBlackListPatterns().size() ); + + // Perform test w/invalid (non-existant) pattern value to remove. + preRequest( action ); + action.setPattern( "**/*oops*" ); + status = action.removeBlackListPattern(); + assertEquals( Action.INPUT, status ); + + // Should have returned an error, with no blacklist pattern removed. + assertHasErrors( action ); + assertEquals( 2, connector.getBlackListPatterns().size() ); + + // Try again, but now with a valid pattern to remove. + action.setPattern( "**/*-javadoc.jar" ); + preRequest( action ); + status = action.removeBlackListPattern(); + assertEquals( Action.INPUT, status ); + + // Should have no error, and 1 blacklist pattern left. + assertNoErrors( action ); + assertEquals( 1, connector.getBlackListPatterns().size() ); + assertEquals( "Should have left 1 blacklist pattern", "**/*.war", connector.getBlackListPatterns().get( 0 ) ); + } + + public void testRemoveProperty() + throws Exception + { + expectConfigurationRequests( 7 ); + archivaConfigurationControl.replay(); + + // Prepare Test. + action.setSource( TEST_SOURCE_ID ); + action.setTarget( TEST_TARGET_ID ); + action.prepare(); + ProxyConnectorConfiguration connector = action.getConnector(); + assertInitialProxyConnector( connector ); + + // Add some arbitrary properties. + connector.addProperty( "username", "general-tso" ); + connector.addProperty( "password", "chicken" ); + + // Perform Test w/no property key. + preRequest( action ); + String status = action.removeProperty(); + assertEquals( Action.INPUT, status ); + + // Should have returned an error, with no properties removed. + assertHasErrors( action ); + assertEquals( 2, connector.getProperties().size() ); + + // Perform test w/invalid (non-existant) property key to remove. + preRequest( action ); + action.setPropertyKey( "slurm" ); + status = action.removeProperty(); + assertEquals( Action.INPUT, status ); + + // Should have returned an error, with no properties removed. + assertHasErrors( action ); + assertEquals( 2, connector.getProperties().size() ); + + // Try again, but now with a valid property to remove. + preRequest( action ); + action.setPropertyKey( "password" ); + status = action.removeProperty(); + assertEquals( Action.INPUT, status ); + + // Should have no error, and 1 property left. + assertNoErrors( action ); + assertEquals( 1, connector.getProperties().size() ); + assertEquals( "Should have left 1 property", "general-tso", connector.getProperties().get( "username" ) ); + } + + public void testRemoveWhiteListPattern() + throws Exception + { + expectConfigurationRequests( 7 ); + archivaConfigurationControl.replay(); + + // Prepare Test. + action.setSource( TEST_SOURCE_ID ); + action.setTarget( TEST_TARGET_ID ); + action.prepare(); + ProxyConnectorConfiguration connector = action.getConnector(); + assertInitialProxyConnector( connector ); + + // Add some arbitrary whitelist patterns. + connector.addWhiteListPattern( "javax/**/*" ); + connector.addWhiteListPattern( "com/sun/**/*" ); + + // Perform Test w/no pattern value. + preRequest( action ); + String status = action.removeWhiteListPattern(); + assertEquals( Action.INPUT, status ); + + // Should have returned an error, with no whitelist pattern removed. + assertHasErrors( action ); + assertEquals( 2, connector.getWhiteListPatterns().size() ); + + // Perform test w/invalid (non-existant) pattern value to remove. + preRequest( action ); + action.setPattern( "**/*oops*" ); + status = action.removeWhiteListPattern(); + assertEquals( Action.INPUT, status ); + + // Should have returned an error, with no whitelist pattern removed. + assertHasErrors( action ); + assertEquals( 2, connector.getWhiteListPatterns().size() ); + + // Try again, but now with a valid pattern to remove. + action.setPattern( "com/sun/**/*" ); + preRequest( action ); + status = action.removeWhiteListPattern(); + assertEquals( Action.INPUT, status ); + + // Should have no error, and 1 whitelist pattern left. + assertNoErrors( action ); + assertEquals( 1, connector.getWhiteListPatterns().size() ); + assertEquals( "Should have left 1 whitelist pattern", "javax/**/*", connector.getWhiteListPatterns().get( 0 ) ); + } + + public void testSecureActionBundle() + throws Exception + { + archivaConfigurationControl.replay(); + + action.prepare(); + SecureActionBundle bundle = action.getSecureActionBundle(); + assertTrue( bundle.requiresAuthentication() ); + assertEquals( 1, bundle.getAuthorizationTuples().size() ); + } + + private void assertInitialProxyConnector( ProxyConnectorConfiguration connector ) + { + assertNotNull( connector ); + assertNotNull( connector.getBlackListPatterns() ); + assertNotNull( connector.getWhiteListPatterns() ); + assertNotNull( connector.getProperties() ); + + assertEquals( TEST_SOURCE_ID, connector.getSourceRepoId() ); + assertEquals( TEST_TARGET_ID, connector.getTargetRepoId() ); + } + + private Configuration createInitialConfiguration() + { + Configuration config = new Configuration(); + + ManagedRepositoryConfiguration managedRepo = new ManagedRepositoryConfiguration(); + managedRepo.setId( TEST_SOURCE_ID ); + managedRepo.setLayout( "${java.io.tmpdir}/archiva-test/managed-repo" ); + managedRepo.setReleases( true ); + + config.addManagedRepository( managedRepo ); + + RemoteRepositoryConfiguration remoteRepo = new RemoteRepositoryConfiguration(); + remoteRepo.setId( TEST_TARGET_ID ); + remoteRepo.setUrl( "http://repo1.maven.org/maven2/" ); + + config.addRemoteRepository( remoteRepo ); + + ProxyConnectorConfiguration connector = new ProxyConnectorConfiguration(); + connector.setSourceRepoId( TEST_SOURCE_ID ); + connector.setTargetRepoId( TEST_TARGET_ID ); + + // TODO: Set these options programatically via list of available policies. + Map policies = connector.getPolicies(); + policies.put( "releases", new ReleasesPolicy().getDefaultOption() ); + policies.put( "snapshots", new SnapshotsPolicy().getDefaultOption() ); + policies.put( "checksum", new ChecksumPolicy().getDefaultOption() ); + policies.put( "cache-failures", new CachedFailuresPolicy().getDefaultOption() ); + policies.put( "propagate-errors", new PropagateErrorsDownloadPolicy().getDefaultOption() ); + policies.put( "propagate-errors-on-update", new PropagateErrorsOnUpdateDownloadPolicy().getDefaultOption() ); + + config.addProxyConnector( connector ); + + return config; + } + + private void expectConfigurationRequests( int requestConfigCount ) + throws RegistryException, IndeterminateConfigurationException + { + Configuration config = createInitialConfiguration(); + + for ( int i = 0; i < requestConfigCount; i++ ) + { + archivaConfiguration.getConfiguration(); + archivaConfigurationControl.setReturnValue( config ); + } + + archivaConfiguration.save( config ); + } + + @Override + protected void setUp() + throws Exception + { + super.setUp(); + + action = (EditProxyConnectorAction) lookup( Action.class.getName(), "editProxyConnectorAction" ); + + archivaConfigurationControl = MockControl.createControl( ArchivaConfiguration.class ); + archivaConfiguration = (ArchivaConfiguration) archivaConfigurationControl.getMock(); + action.setArchivaConfiguration( archivaConfiguration ); + + /* Configuration will be requested at least 3 times. */ + for ( int i = 0; i < 3; i++ ) + { + archivaConfiguration.getConfiguration(); + archivaConfigurationControl.setReturnValue( new Configuration() ); + } + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/ProxyConnectorsActionTest.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/ProxyConnectorsActionTest.java new file mode 100644 index 000000000..fd54661ee --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/ProxyConnectorsActionTest.java @@ -0,0 +1,151 @@ +package org.apache.maven.archiva.web.action.admin.connectors.proxy; + +/* + * 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 com.opensymphony.xwork.Action; + +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.Configuration; +import org.apache.maven.archiva.configuration.IndeterminateConfigurationException; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.configuration.ProxyConnectorConfiguration; +import org.apache.maven.archiva.configuration.RemoteRepositoryConfiguration; +import org.apache.maven.archiva.web.action.AbstractWebworkTestCase; +import org.codehaus.plexus.redback.xwork.interceptor.SecureActionBundle; +import org.codehaus.plexus.registry.RegistryException; +import org.easymock.MockControl; + +/** + * ProxyConnectorsActionTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class ProxyConnectorsActionTest + extends AbstractWebworkTestCase +{ + private static final String JAVAX = "javax"; + + private static final String CENTRAL = "central"; + + private static final String CORPORATE = "corporate"; + + private ProxyConnectorsAction action; + + private MockControl archivaConfigurationControl; + + private ArchivaConfiguration archivaConfiguration; + + @Override + protected void setUp() + throws Exception + { + super.setUp(); + + action = (ProxyConnectorsAction) lookup( Action.class.getName(), "proxyConnectorsAction" ); + + archivaConfigurationControl = MockControl.createControl( ArchivaConfiguration.class ); + archivaConfiguration = (ArchivaConfiguration) archivaConfigurationControl.getMock(); + action.setArchivaConfiguration( archivaConfiguration ); + } + + public void testSecureActionBundle() + throws Exception + { + expectConfigurationRequests( 3 ); + archivaConfigurationControl.replay(); + + action.prepare(); + SecureActionBundle bundle = action.getSecureActionBundle(); + assertTrue( bundle.requiresAuthentication() ); + assertEquals( 1, bundle.getAuthorizationTuples().size() ); + } + + public void testExecute() + throws Exception + { + expectConfigurationRequests( 3 ); + archivaConfigurationControl.replay(); + + action.prepare(); + + String status = action.execute(); + assertEquals( Action.SUCCESS, status ); + assertNoErrors( action ); + + assertNotNull( action.getProxyConnectorMap() ); + assertNotNull( action.getRepoMap() ); + + assertEquals( 1, action.getProxyConnectorMap().size() ); + assertEquals( 3, action.getRepoMap().size() ); + } + + private void expectConfigurationRequests( int requestConfigCount ) + throws RegistryException, IndeterminateConfigurationException + { + Configuration config = createInitialConfiguration(); + + for ( int i = 0; i < requestConfigCount; i++ ) + { + archivaConfiguration.getConfiguration(); + archivaConfigurationControl.setReturnValue( config ); + } + + archivaConfiguration.save( config ); + } + + private Configuration createInitialConfiguration() + { + Configuration config = new Configuration(); + + ManagedRepositoryConfiguration managedRepo = new ManagedRepositoryConfiguration(); + managedRepo.setId( CORPORATE ); + managedRepo.setLayout( "${java.io.tmpdir}/archiva-test/managed-repo" ); + managedRepo.setReleases( true ); + + config.addManagedRepository( managedRepo ); + + RemoteRepositoryConfiguration remoteRepo = new RemoteRepositoryConfiguration(); + remoteRepo.setId( CENTRAL ); + remoteRepo.setUrl( "http://repo1.maven.org/maven2/" ); + + config.addRemoteRepository( remoteRepo ); + + remoteRepo = new RemoteRepositoryConfiguration(); + remoteRepo.setId( JAVAX ); + remoteRepo.setUrl( "http://download.java.net/maven/2/" ); + + config.addRemoteRepository( remoteRepo ); + + ProxyConnectorConfiguration connector = new ProxyConnectorConfiguration(); + connector.setSourceRepoId( CORPORATE ); + connector.setTargetRepoId( CENTRAL ); + + config.addProxyConnector( connector ); + + connector = new ProxyConnectorConfiguration(); + connector.setSourceRepoId( CORPORATE ); + connector.setTargetRepoId( JAVAX ); + + config.addProxyConnector( connector ); + + return config; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/SortProxyConnectorsActionTest.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/SortProxyConnectorsActionTest.java new file mode 100644 index 000000000..1e1d6b335 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/SortProxyConnectorsActionTest.java @@ -0,0 +1,253 @@ +package org.apache.maven.archiva.web.action.admin.connectors.proxy; + +/* + * 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 com.opensymphony.xwork.Action; + +import org.apache.commons.lang.StringUtils; +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.Configuration; +import org.apache.maven.archiva.configuration.IndeterminateConfigurationException; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.configuration.ProxyConnectorConfiguration; +import org.apache.maven.archiva.configuration.RemoteRepositoryConfiguration; +import org.apache.maven.archiva.configuration.functors.ProxyConnectorConfigurationOrderComparator; +import org.apache.maven.archiva.web.action.AbstractWebworkTestCase; +import org.codehaus.plexus.redback.xwork.interceptor.SecureActionBundle; +import org.codehaus.plexus.registry.RegistryException; +import org.easymock.MockControl; + +import java.util.Collections; +import java.util.List; + +/** + * SortProxyConnectorsActionTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class SortProxyConnectorsActionTest + extends AbstractWebworkTestCase +{ + private static final String JAVAX = "javax"; + + private static final String CENTRAL = "central"; + + private static final String CORPORATE = "corporate"; + + private static final String CODEHAUS = "codehaus"; + + private SortProxyConnectorsAction action; + + private MockControl archivaConfigurationControl; + + private ArchivaConfiguration archivaConfiguration; + + public void testSecureActionBundle() + throws Exception + { + expectConfigurationRequests( 1 ); + archivaConfigurationControl.replay(); + + SecureActionBundle bundle = action.getSecureActionBundle(); + assertTrue( bundle.requiresAuthentication() ); + assertEquals( 1, bundle.getAuthorizationTuples().size() ); + } + + public void testSortDown() + throws Exception + { + expectConfigurationRequests( 7 ); + archivaConfigurationControl.replay(); + + action.setSource( CORPORATE ); + action.setTarget( CENTRAL ); + String status = action.sortDown(); + assertEquals( Action.SUCCESS, status ); + + assertOrder( new String[] { JAVAX, CENTRAL, CODEHAUS } ); + } + + public void testSortDownPastEnd() + throws Exception + { + expectConfigurationRequests( 7 ); + archivaConfigurationControl.replay(); + + // Ask the last connector to sort down (essentially a no-op) + action.setSource( CORPORATE ); + action.setTarget( CODEHAUS ); + String status = action.sortDown(); + assertEquals( Action.SUCCESS, status ); + + // No order change. + assertOrder( new String[] { CENTRAL, JAVAX, CODEHAUS } ); + } + + public void testSortUp() + throws Exception + { + expectConfigurationRequests( 7 ); + archivaConfigurationControl.replay(); + + action.setSource( CORPORATE ); + action.setTarget( CODEHAUS ); + String status = action.sortUp(); + assertEquals( Action.SUCCESS, status ); + + assertOrder( new String[] { CENTRAL, CODEHAUS, JAVAX } ); + } + + public void testSortUpPastBeginning() + throws Exception + { + expectConfigurationRequests( 7 ); + archivaConfigurationControl.replay(); + + // Ask the first connector to sort up (essentially a no-op) + action.setSource( CORPORATE ); + action.setTarget( CENTRAL ); + String status = action.sortUp(); + assertEquals( Action.SUCCESS, status ); + + // No order change. + assertOrder( new String[] { CENTRAL, JAVAX, CODEHAUS } ); + } + + private void assertOrder( String[] targetRepoOrder ) + { + List connectors = archivaConfiguration.getConfiguration().getProxyConnectors(); + Collections.sort( connectors, ProxyConnectorConfigurationOrderComparator.getInstance() ); + + for ( ProxyConnectorConfiguration connector : connectors ) + { + assertEquals( "All connectors in list should have the same source id (in this test)", CORPORATE, connector + .getSourceRepoId() ); + } + + assertEquals( targetRepoOrder.length, connectors.size() ); + + int orderFailedAt = ( -1 ); + for ( int i = 0; i < targetRepoOrder.length; i++ ) + { + if ( !StringUtils.equals( targetRepoOrder[i], connectors.get( i ).getTargetRepoId() ) ) + { + orderFailedAt = i; + break; + } + } + + if ( orderFailedAt >= 0 ) + { + StringBuffer msg = new StringBuffer(); + + msg.append( "Failed expected order of the proxy connectors <" ); + msg.append( StringUtils.join( targetRepoOrder, ", " ) ); + msg.append( ">, actual <" ); + + boolean needsComma = false; + for ( ProxyConnectorConfiguration proxy : connectors ) + { + if ( needsComma ) + { + msg.append( ", " ); + } + msg.append( proxy.getTargetRepoId() ); + needsComma = true; + } + msg.append( "> failure at index <" ).append( orderFailedAt ).append( ">." ); + + fail( msg.toString() ); + } + } + + private Configuration createInitialConfiguration() + { + Configuration config = new Configuration(); + + ManagedRepositoryConfiguration managedRepo = new ManagedRepositoryConfiguration(); + managedRepo.setId( CORPORATE ); + managedRepo.setLayout( "${java.io.tmpdir}/archiva-test/managed-repo" ); + managedRepo.setReleases( true ); + config.addManagedRepository( managedRepo ); + + RemoteRepositoryConfiguration remoteRepo = new RemoteRepositoryConfiguration(); + remoteRepo.setId( CENTRAL ); + remoteRepo.setUrl( "http://repo1.maven.org/maven2/" ); + config.addRemoteRepository( remoteRepo ); + + remoteRepo = new RemoteRepositoryConfiguration(); + remoteRepo.setId( JAVAX ); + remoteRepo.setUrl( "http://download.java.net/maven/2/" ); + config.addRemoteRepository( remoteRepo ); + + remoteRepo = new RemoteRepositoryConfiguration(); + remoteRepo.setId( CODEHAUS ); + remoteRepo.setUrl( "http://repository.codehaus.org/" ); + config.addRemoteRepository( remoteRepo ); + + ProxyConnectorConfiguration connector = new ProxyConnectorConfiguration(); + connector.setSourceRepoId( CORPORATE ); + connector.setTargetRepoId( CENTRAL ); + connector.setOrder( 1 ); + config.addProxyConnector( connector ); + + connector = new ProxyConnectorConfiguration(); + connector.setSourceRepoId( CORPORATE ); + connector.setTargetRepoId( JAVAX ); + connector.setOrder( 2 ); + config.addProxyConnector( connector ); + + connector = new ProxyConnectorConfiguration(); + connector.setSourceRepoId( CORPORATE ); + connector.setTargetRepoId( CODEHAUS ); + connector.setOrder( 3 ); + config.addProxyConnector( connector ); + + return config; + } + + private void expectConfigurationRequests( int requestConfigCount ) + throws RegistryException, IndeterminateConfigurationException + { + Configuration config = createInitialConfiguration(); + + for ( int i = 0; i < requestConfigCount; i++ ) + { + archivaConfiguration.getConfiguration(); + archivaConfigurationControl.setReturnValue( config ); + } + + archivaConfiguration.save( config ); + } + + @Override + protected void setUp() + throws Exception + { + super.setUp(); + + action = (SortProxyConnectorsAction) lookup( Action.class.getName(), "sortProxyConnectorsAction" ); + + archivaConfigurationControl = MockControl.createControl( ArchivaConfiguration.class ); + archivaConfiguration = (ArchivaConfiguration) archivaConfigurationControl.getMock(); + action.setArchivaConfiguration( archivaConfiguration ); + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/AbstractManagedRepositoryArchivaDAOStub.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/AbstractManagedRepositoryArchivaDAOStub.java new file mode 100644 index 000000000..81c1b76bd --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/AbstractManagedRepositoryArchivaDAOStub.java @@ -0,0 +1,85 @@ +package org.apache.maven.archiva.web.action.admin.repositories; + +/* + * 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.Serializable; +import java.util.List; + +import org.apache.maven.archiva.database.ArchivaDAO; +import org.apache.maven.archiva.database.ArtifactDAO; +import org.apache.maven.archiva.database.ProjectModelDAO; +import org.apache.maven.archiva.database.RepositoryContentStatisticsDAO; +import org.apache.maven.archiva.database.RepositoryProblemDAO; +import org.apache.maven.archiva.database.SimpleConstraint; + +/** + * AbstractManagedRepositoryArchivaDAOStub + * + * @author Maria Odea Ching + * @version + */ +public class AbstractManagedRepositoryArchivaDAOStub + implements ArchivaDAO +{ + /** + * @plexus.requirement role-hint="jdo" + */ + private ProjectModelDAO projectModelDAO; + + /** + * @plexus.requirement role-hint="jdo" + */ + private ArtifactDAO artifactDAO; + + /** + * @plexus.requirement role-hint="jdo" + */ + private RepositoryContentStatisticsDAO repoContentStatisticsDAO; + + public List query( SimpleConstraint constraint ) + { + return null; + } + + public Object save( Serializable obj ) + { + throw new UnsupportedOperationException( "query not implemented for stub" ); + } + + public ArtifactDAO getArtifactDAO() + { + return artifactDAO; + } + + public ProjectModelDAO getProjectModelDAO() + { + return projectModelDAO; + } + + public RepositoryProblemDAO getRepositoryProblemDAO() + { + throw new UnsupportedOperationException( "query not implemented for stub" ); + } + + public RepositoryContentStatisticsDAO getRepositoryContentStatisticsDAO() + { + return repoContentStatisticsDAO; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/AddManagedRepositoryActionTest.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/AddManagedRepositoryActionTest.java new file mode 100644 index 000000000..beaafba67 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/AddManagedRepositoryActionTest.java @@ -0,0 +1,196 @@ +package org.apache.maven.archiva.web.action.admin.repositories; + +/* + * 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 com.opensymphony.xwork.Action; +import org.apache.commons.io.FileUtils; +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.security.ArchivaRoleConstants; +import org.codehaus.plexus.redback.role.RoleManager; +import org.codehaus.plexus.redback.xwork.interceptor.SecureActionBundle; +import org.codehaus.plexus.redback.xwork.interceptor.SecureActionException; +import org.codehaus.plexus.spring.PlexusInSpringTestCase; +import org.easymock.MockControl; + +import java.io.File; +import java.util.Collections; + +/** + * AddManagedRepositoryActionTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class AddManagedRepositoryActionTest + extends PlexusInSpringTestCase +{ + private AddManagedRepositoryAction action; + + private RoleManager roleManager; + + private MockControl roleManagerControl; + + private MockControl archivaConfigurationControl; + + private ArchivaConfiguration archivaConfiguration; + + private static final String REPO_ID = "repo-ident"; + + private File location; + + @Override + protected String getPlexusConfigLocation() + { + return AbstractManagedRepositoriesAction.class.getName().replace( '.', '/' ) + "Test.xml"; + } + + protected void setUp() + throws Exception + { + super.setUp(); + + action = (AddManagedRepositoryAction) lookup( Action.class.getName(), "addManagedRepositoryAction" ); + + archivaConfigurationControl = MockControl.createControl( ArchivaConfiguration.class ); + archivaConfiguration = (ArchivaConfiguration) archivaConfigurationControl.getMock(); + action.setArchivaConfiguration( archivaConfiguration ); + + roleManagerControl = MockControl.createControl( RoleManager.class ); + roleManager = (RoleManager) roleManagerControl.getMock(); + action.setRoleManager( roleManager ); + location = getTestFile( "target/test/location" ); + } + + public void testSecureActionBundle() + throws SecureActionException + { + archivaConfiguration.getConfiguration(); + archivaConfigurationControl.setReturnValue( new Configuration() ); + archivaConfigurationControl.replay(); + + action.prepare(); + SecureActionBundle bundle = action.getSecureActionBundle(); + assertTrue( bundle.requiresAuthentication() ); + assertEquals( 1, bundle.getAuthorizationTuples().size() ); + } + + public void testAddRepositoryInitialPage() + throws Exception + { + archivaConfiguration.getConfiguration(); + archivaConfigurationControl.setReturnValue( new Configuration() ); + archivaConfigurationControl.replay(); + + action.prepare(); + ManagedRepositoryConfiguration configuration = action.getRepository(); + assertNotNull( configuration ); + assertNull( configuration.getId() ); + // check all booleans are false + assertFalse( configuration.isDeleteReleasedSnapshots() ); + assertFalse( configuration.isScanned() ); + assertFalse( configuration.isReleases() ); + assertFalse( configuration.isSnapshots() ); + + String status = action.input(); + assertEquals( Action.INPUT, status ); + + // check defaults + assertFalse( configuration.isDeleteReleasedSnapshots() ); + assertTrue( configuration.isScanned() ); + assertTrue( configuration.isReleases() ); + assertFalse( configuration.isSnapshots() ); + } + + public void testAddRepository() + throws Exception + { + FileUtils.deleteDirectory( location ); + + roleManager.templatedRoleExists( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER, REPO_ID ); + roleManagerControl.setReturnValue( false ); + roleManager.createTemplatedRole( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER, REPO_ID ); + roleManagerControl.setVoidCallable(); + roleManager.templatedRoleExists( ArchivaRoleConstants.TEMPLATE_REPOSITORY_MANAGER, REPO_ID ); + roleManagerControl.setReturnValue( false ); + roleManager.createTemplatedRole( ArchivaRoleConstants.TEMPLATE_REPOSITORY_MANAGER, REPO_ID ); + roleManagerControl.setVoidCallable(); + + roleManagerControl.replay(); + + Configuration configuration = new Configuration(); + archivaConfiguration.getConfiguration(); + archivaConfigurationControl.setReturnValue( configuration ); + + archivaConfiguration.save( configuration ); + + archivaConfigurationControl.replay(); + + action.prepare(); + ManagedRepositoryConfiguration repository = action.getRepository(); + populateRepository( repository ); + + assertFalse( location.exists() ); + String status = action.commit(); + assertEquals( Action.SUCCESS, status ); + assertTrue( location.exists() ); + + assertEquals( Collections.singletonList( repository ), configuration.getManagedRepositories() ); + + roleManagerControl.verify(); + archivaConfigurationControl.verify(); + } + + + public void testAddRepositoryExistingLocation() + throws Exception + { + if( !location.exists() ) + { + location.mkdirs(); + } + + action.prepare(); + ManagedRepositoryConfiguration repository = action.getRepository(); + populateRepository( repository ); + + assertTrue( location.exists() ); + String status = action.commit(); + assertEquals( AddManagedRepositoryAction.CONFIRM, status ); + } + + private void populateRepository( ManagedRepositoryConfiguration repository ) + { + repository.setId( REPO_ID ); + repository.setName( "repo name" ); + repository.setLocation( location.getAbsolutePath() ); + repository.setLayout( "default" ); + repository.setRefreshCronExpression( "* 0/5 * * * ?" ); + repository.setDaysOlder( 31 ); + repository.setRetentionCount( 20 ); + repository.setReleases( true ); + repository.setSnapshots( true ); + repository.setScanned( false ); + repository.setDeleteReleasedSnapshots( true ); + } + + // TODO: test errors during add, other actions +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/AddRemoteRepositoryActionTest.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/AddRemoteRepositoryActionTest.java new file mode 100644 index 000000000..8656ebe5a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/AddRemoteRepositoryActionTest.java @@ -0,0 +1,127 @@ +package org.apache.maven.archiva.web.action.admin.repositories; + +/* + * 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 com.opensymphony.xwork.Action; +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.Configuration; +import org.apache.maven.archiva.configuration.RemoteRepositoryConfiguration; +import org.codehaus.plexus.redback.xwork.interceptor.SecureActionBundle; +import org.codehaus.plexus.redback.xwork.interceptor.SecureActionException; +import org.codehaus.plexus.spring.PlexusInSpringTestCase; +import org.easymock.MockControl; + +import java.util.Collections; + +/** + * AddRemoteRepositoryActionTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class AddRemoteRepositoryActionTest + extends PlexusInSpringTestCase +{ + private AddRemoteRepositoryAction action; + + private MockControl archivaConfigurationControl; + + private ArchivaConfiguration archivaConfiguration; + + private static final String REPO_ID = "remote-repo-ident"; + + protected void setUp() + throws Exception + { + super.setUp(); + + action = (AddRemoteRepositoryAction) lookup( Action.class.getName(), "addRemoteRepositoryAction" ); + + archivaConfigurationControl = MockControl.createControl( ArchivaConfiguration.class ); + archivaConfiguration = (ArchivaConfiguration) archivaConfigurationControl.getMock(); + action.setArchivaConfiguration( archivaConfiguration ); + } + + public void testSecureActionBundle() + throws SecureActionException + { + archivaConfiguration.getConfiguration(); + archivaConfigurationControl.setReturnValue( new Configuration() ); + archivaConfigurationControl.replay(); + + action.prepare(); + SecureActionBundle bundle = action.getSecureActionBundle(); + assertTrue( bundle.requiresAuthentication() ); + assertEquals( 1, bundle.getAuthorizationTuples().size() ); + } + + public void testAddRemoteRepositoryInitialPage() + throws Exception + { + archivaConfiguration.getConfiguration(); + archivaConfigurationControl.setReturnValue( new Configuration() ); + archivaConfigurationControl.replay(); + + action.prepare(); + RemoteRepositoryConfiguration configuration = action.getRepository(); + assertNotNull( configuration ); + assertNull( configuration.getId() ); + + String status = action.input(); + assertEquals( Action.INPUT, status ); + } + + public void testAddRemoteRepository() + throws Exception + { + Configuration configuration = new Configuration(); + archivaConfiguration.getConfiguration(); + archivaConfigurationControl.setReturnValue( configuration ); + + archivaConfiguration.save( configuration ); + + archivaConfigurationControl.replay(); + + action.prepare(); + RemoteRepositoryConfiguration repository = action.getRepository(); + populateRepository( repository ); + + assertEquals("url ", repository.getUrl()); + + String status = action.commit(); + assertEquals( Action.SUCCESS, status ); + + assertEquals( Collections.singletonList( repository ), configuration.getRemoteRepositories() ); + + assertEquals("url", repository.getUrl()); + + archivaConfigurationControl.verify(); + } + + private void populateRepository( RemoteRepositoryConfiguration repository ) + { + repository.setId( REPO_ID ); + repository.setName( "repo name" ); + repository.setUrl( "url " ); + repository.setLayout( "default" ); + } + + // TODO: test errors during add, other actions +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/ArchivaDAOStub.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/ArchivaDAOStub.java new file mode 100644 index 000000000..7141af57c --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/ArchivaDAOStub.java @@ -0,0 +1,87 @@ +package org.apache.maven.archiva.web.action.admin.repositories; + +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.database.ArchivaDAO; +import org.apache.maven.archiva.database.ArtifactDAO; +import org.apache.maven.archiva.database.ProjectModelDAO; +import org.apache.maven.archiva.database.RepositoryContentStatisticsDAO; +import org.apache.maven.archiva.database.RepositoryProblemDAO; +import org.apache.maven.archiva.database.SimpleConstraint; +import org.apache.maven.archiva.model.RepositoryContentStatistics; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +import junit.framework.Assert; + +/* + * 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. + */ + +/** + * Stub class for Archiva DAO to avoid having to set up a database for tests. + * + * @todo a mock would be better, but that won't play nicely with Plexus injection. + */ +public class ArchivaDAOStub + implements ArchivaDAO +{ + private ArchivaConfiguration configuration; + + public List query( SimpleConstraint constraint ) + { + Assert.assertEquals( RepositoryContentStatistics.class, constraint.getResultClass() ); + + + List stats = new ArrayList(); + for ( String repo : configuration.getConfiguration().getManagedRepositoriesAsMap().keySet() ) + { + RepositoryContentStatistics statistics = new RepositoryContentStatistics(); + statistics.setRepositoryId( repo ); + stats.add( statistics ); + } + return stats; + } + + public Object save( Serializable obj ) + { + throw new UnsupportedOperationException( "query not implemented for stub" ); + } + + public ArtifactDAO getArtifactDAO() + { + throw new UnsupportedOperationException( "method not implemented for stub" ); + } + + public ProjectModelDAO getProjectModelDAO() + { + throw new UnsupportedOperationException( "method not implemented for stub" ); + } + + public RepositoryProblemDAO getRepositoryProblemDAO() + { + throw new UnsupportedOperationException( "method not implemented for stub" ); + } + + public RepositoryContentStatisticsDAO getRepositoryContentStatisticsDAO() + { + throw new UnsupportedOperationException( "method not implemented for stub" ); + } + +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/ArtifactDAOStub.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/ArtifactDAOStub.java new file mode 100644 index 000000000..61e2f8bd3 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/ArtifactDAOStub.java @@ -0,0 +1,90 @@ +package org.apache.maven.archiva.web.action.admin.repositories; + +/* + * 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.List; + +import org.apache.maven.archiva.database.ArchivaDatabaseException; +import org.apache.maven.archiva.database.ArtifactDAO; +import org.apache.maven.archiva.database.Constraint; +import org.apache.maven.archiva.database.ObjectNotFoundException; +import org.apache.maven.archiva.model.ArchivaArtifact; +import org.apache.maven.archiva.model.ArchivaArtifactModel; + +/** + * ArtifactDAOStub + * + * @author Maria Odea Ching + * @version + */ +public class ArtifactDAOStub + implements ArtifactDAO +{ + + public ArchivaArtifact createArtifact( String groupId, String artifactId, String version, String classifier, + String type ) + { + // TODO Auto-generated method stub + return null; + } + + public void deleteArtifact( ArchivaArtifact artifact ) + throws ArchivaDatabaseException + { + // TODO Auto-generated method stub + + } + + public ArchivaArtifact getArtifact( String groupId, String artifactId, String version, String classifier, + String type ) + throws ObjectNotFoundException, ArchivaDatabaseException + { + // TODO Auto-generated method stub + return null; + } + + public List queryArtifacts( Constraint constraint ) + throws ObjectNotFoundException, ArchivaDatabaseException + { + + List artifacts = new ArrayList(); + + ArchivaArtifactModel model = new ArchivaArtifactModel(); + model.setGroupId( "org.apache.maven.archiva" ); + model.setArtifactId( "test-artifact" ); + model.setVersion( "1.0" ); + model.setType( "jar" ); + model.setRepositoryId( "repo-ident" ); + + ArchivaArtifact artifact = new ArchivaArtifact( model ); + artifacts.add( artifact ); + + return artifacts; + } + + public ArchivaArtifact saveArtifact( ArchivaArtifact artifact ) + throws ArchivaDatabaseException + { + // TODO Auto-generated method stub + return null; + } + +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteManagedRepositoryActionTest.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteManagedRepositoryActionTest.java new file mode 100644 index 000000000..41536c1c7 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteManagedRepositoryActionTest.java @@ -0,0 +1,333 @@ +package org.apache.maven.archiva.web.action.admin.repositories; + +/* + * 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 com.opensymphony.xwork.Action; +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.Configuration; +import org.apache.maven.archiva.configuration.IndeterminateConfigurationException; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.configuration.ProxyConnectorConfiguration; +import org.apache.maven.archiva.configuration.RemoteRepositoryConfiguration; +import org.apache.maven.archiva.configuration.RepositoryGroupConfiguration; +import org.apache.maven.archiva.model.ArchivaProjectModel; +import org.apache.maven.archiva.security.ArchivaRoleConstants; +import org.codehaus.plexus.redback.role.RoleManager; +import org.codehaus.plexus.redback.role.RoleManagerException; +import org.codehaus.plexus.redback.xwork.interceptor.SecureActionBundle; +import org.codehaus.plexus.redback.xwork.interceptor.SecureActionException; +import org.codehaus.plexus.registry.RegistryException; +import org.codehaus.plexus.spring.PlexusInSpringTestCase; +import org.easymock.MockControl; + +import java.io.File; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +/** + * DeleteManagedRepositoryActionTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class DeleteManagedRepositoryActionTest + extends PlexusInSpringTestCase +{ + private DeleteManagedRepositoryAction action; + + private RoleManager roleManager; + + private MockControl roleManagerControl; + + private MockControl archivaConfigurationControl; + + private ArchivaConfiguration archivaConfiguration; + + private static final String REPO_ID = "repo-ident"; + + private File location; + + @Override + protected String getPlexusConfigLocation() + { + return AbstractManagedRepositoriesAction.class.getName().replace( '.', '/' ) + "Test.xml"; + } + + protected void setUp() + throws Exception + { + super.setUp(); + + action = (DeleteManagedRepositoryAction) lookup( Action.class.getName(), "deleteManagedRepositoryAction" ); + + archivaConfigurationControl = MockControl.createControl( ArchivaConfiguration.class ); + archivaConfiguration = (ArchivaConfiguration) archivaConfigurationControl.getMock(); + action.setArchivaConfiguration( archivaConfiguration ); + + roleManagerControl = MockControl.createControl( RoleManager.class ); + roleManager = (RoleManager) roleManagerControl.getMock(); + action.setRoleManager( roleManager ); + location = getTestFile( "target/test/location" ); + } + + public void testSecureActionBundle() + throws SecureActionException + { + archivaConfiguration.getConfiguration(); + archivaConfigurationControl.setReturnValue( new Configuration() ); + archivaConfigurationControl.replay(); + + action.prepare(); + SecureActionBundle bundle = action.getSecureActionBundle(); + assertTrue( bundle.requiresAuthentication() ); + assertEquals( 1, bundle.getAuthorizationTuples().size() ); + } + + public void testDeleteRepositoryConfirmation() + throws Exception + { + ManagedRepositoryConfiguration originalRepository = createRepository(); + Configuration configuration = createConfigurationForEditing( originalRepository ); + + archivaConfiguration.getConfiguration(); + archivaConfigurationControl.setReturnValue( configuration ); + archivaConfigurationControl.replay(); + + action.setRepoid( REPO_ID ); + + action.prepare(); + assertEquals( REPO_ID, action.getRepoid() ); + ManagedRepositoryConfiguration repository = action.getRepository(); + assertNotNull( repository ); + assertRepositoryEquals( repository, createRepository() ); + + String status = action.execute(); + assertEquals( Action.SUCCESS, status ); + repository = action.getRepository(); + assertRepositoryEquals( repository, createRepository() ); + assertEquals( Collections.singletonList( originalRepository ), configuration.getManagedRepositories() ); + } + + public void testDeleteRepositoryKeepContent() + throws Exception + { + prepareRoleManagerMock(); + + Configuration configuration = prepDeletionTest( createRepository(), 4 ); + + String status = action.deleteEntry(); + + assertEquals( Action.SUCCESS, status ); + + assertTrue( configuration.getManagedRepositories().isEmpty() ); + + assertTrue( location.exists() ); + } + + public void testDeleteRepositoryDeleteContent() + throws Exception + { + prepareRoleManagerMock(); + + Configuration configuration = prepDeletionTest( createRepository(), 4 ); + + String status = action.deleteContents(); + + assertEquals( Action.SUCCESS, status ); + + assertTrue( configuration.getManagedRepositories().isEmpty() ); + + assertFalse( location.exists() ); + } + + public void testDeleteRepositoryAndAssociatedProxyConnectors() + throws Exception + { + Configuration configuration = prepDeletionTest( createRepository(), 5 ); + configuration.addRemoteRepository( createRemoteRepository( "codehaus", "http://repository.codehaus.org" ) ); + configuration.addRemoteRepository( createRemoteRepository( "java.net", "http://dev.java.net/maven2" ) ); + configuration.addProxyConnector( createProxyConnector( REPO_ID, "codehaus" ) ); + + prepareRoleManagerMock(); + + assertEquals( 1, configuration.getProxyConnectors().size() ); + + String status = action.deleteContents(); + assertEquals( Action.SUCCESS, status ); + + assertTrue( configuration.getManagedRepositories().isEmpty() ); + assertEquals( 0, configuration.getProxyConnectors().size() ); + + assertFalse( location.exists() ); + } + + public void testDeleteRepositoryCancelled() + throws Exception + { + ManagedRepositoryConfiguration originalRepository = createRepository(); + Configuration configuration = prepDeletionTest( originalRepository, 3 ); + String status = action.execute(); + assertEquals( Action.SUCCESS, status ); + + ManagedRepositoryConfiguration repository = action.getRepository(); + assertRepositoryEquals( repository, createRepository() ); + assertEquals( Collections.singletonList( originalRepository ), configuration.getManagedRepositories() ); + + assertTrue( location.exists() ); + } + + public void testDeleteRepositoryAndReposUnderRepoGroup() + throws Exception + { + Configuration configuration = prepDeletionTest( createRepository(), 5 ); + List repoIds = new ArrayList(); + repoIds.add( REPO_ID ); + configuration.addRepositoryGroup( createRepoGroup( repoIds, "repo.group" ) ); + + prepareRoleManagerMock(); + + assertEquals( 1, configuration.getRepositoryGroups().size() ); + + String status = action.deleteContents(); + assertEquals( Action.SUCCESS, status ); + + assertTrue( configuration.getManagedRepositories().isEmpty() ); + assertEquals( 0, ( ( RepositoryGroupConfiguration ) configuration.getRepositoryGroups().get( 0 ) ).getRepositories().size() ); + + assertFalse( location.exists() ); + } + + private Configuration prepDeletionTest( ManagedRepositoryConfiguration originalRepository, int expectCountGetConfig ) + throws RegistryException, IndeterminateConfigurationException + { + location.mkdirs(); + + Configuration configuration = createConfigurationForEditing( originalRepository ); + + archivaConfiguration.getConfiguration(); + archivaConfigurationControl.setReturnValue( configuration, expectCountGetConfig ); + + archivaConfiguration.save( configuration ); + archivaConfigurationControl.replay(); + + action.setRepoid( REPO_ID ); + + action.prepare(); + assertEquals( REPO_ID, action.getRepoid() ); + ManagedRepositoryConfiguration repository = action.getRepository(); + assertNotNull( repository ); + assertRepositoryEquals( repository, createRepository() ); + + assertTrue( location.exists() ); + return configuration; + } + + private void assertRepositoryEquals( ManagedRepositoryConfiguration expectedRepository, + ManagedRepositoryConfiguration actualRepository ) + { + assertEquals( expectedRepository.getDaysOlder(), actualRepository.getDaysOlder() ); + assertEquals( expectedRepository.getId(), actualRepository.getId() ); + assertEquals( expectedRepository.getIndexDir(), actualRepository.getIndexDir() ); + assertEquals( expectedRepository.getLayout(), actualRepository.getLayout() ); + assertEquals( expectedRepository.getLocation(), actualRepository.getLocation() ); + assertEquals( expectedRepository.getName(), actualRepository.getName() ); + assertEquals( expectedRepository.getRefreshCronExpression(), actualRepository.getRefreshCronExpression() ); + assertEquals( expectedRepository.getRetentionCount(), actualRepository.getRetentionCount() ); + assertEquals( expectedRepository.isDeleteReleasedSnapshots(), actualRepository.isDeleteReleasedSnapshots() ); + assertEquals( expectedRepository.isScanned(), actualRepository.isScanned() ); + assertEquals( expectedRepository.isReleases(), actualRepository.isReleases() ); + assertEquals( expectedRepository.isSnapshots(), actualRepository.isSnapshots() ); + } + + private Configuration createConfigurationForEditing( ManagedRepositoryConfiguration repositoryConfiguration ) + { + Configuration configuration = new Configuration(); + configuration.addManagedRepository( repositoryConfiguration ); + return configuration; + } + + private ManagedRepositoryConfiguration createRepository() + { + ManagedRepositoryConfiguration r = new ManagedRepositoryConfiguration(); + r.setId( REPO_ID ); + r.setName( "repo name" ); + r.setLocation( location.getAbsolutePath() ); + r.setLayout( "default" ); + r.setRefreshCronExpression( "* 0/5 * * * ?" ); + r.setDaysOlder( 0 ); + r.setRetentionCount( 0 ); + r.setReleases( true ); + r.setSnapshots( true ); + r.setScanned( false ); + r.setDeleteReleasedSnapshots( false ); + return r; + } + + private RemoteRepositoryConfiguration createRemoteRepository(String id, String url) + { + RemoteRepositoryConfiguration r = new RemoteRepositoryConfiguration(); + r.setId( id ); + r.setUrl( url ); + r.setLayout( "default" ); + + return r; + } + + private ProxyConnectorConfiguration createProxyConnector( String managedRepoId, String remoteRepoId ) + { + ProxyConnectorConfiguration connector = new ProxyConnectorConfiguration(); + connector.setSourceRepoId( managedRepoId ); + connector.setTargetRepoId( remoteRepoId ); + + return connector; + } + + private RepositoryGroupConfiguration createRepoGroup( List repoIds, String repoGroupId ) + { + RepositoryGroupConfiguration repoGroup = new RepositoryGroupConfiguration(); + repoGroup.setId( repoGroupId ); + repoGroup.setRepositories( repoIds ); + + return repoGroup; + } + + private void prepareRoleManagerMock() + throws RoleManagerException + { + roleManager.templatedRoleExists( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER, REPO_ID ); + roleManagerControl.setReturnValue( true ); + roleManager.removeTemplatedRole( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER, REPO_ID ); + roleManager.templatedRoleExists( ArchivaRoleConstants.TEMPLATE_REPOSITORY_MANAGER, REPO_ID ); + roleManagerControl.setReturnValue( true ); + roleManager.removeTemplatedRole( ArchivaRoleConstants.TEMPLATE_REPOSITORY_MANAGER, REPO_ID ); + roleManagerControl.replay(); + } + + protected ArchivaProjectModel createProjectModel( String groupId, String artifactId, String version ) + { + ArchivaProjectModel projectModel = new ArchivaProjectModel(); + projectModel.setGroupId( groupId ); + projectModel.setArtifactId( artifactId ); + projectModel.setVersion( version ); + + return projectModel; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteRemoteRepositoryActionTest.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteRemoteRepositoryActionTest.java new file mode 100644 index 000000000..1457f5952 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteRemoteRepositoryActionTest.java @@ -0,0 +1,207 @@ +package org.apache.maven.archiva.web.action.admin.repositories; + +/* + * 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 com.opensymphony.xwork.Action; +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.Configuration; +import org.apache.maven.archiva.configuration.IndeterminateConfigurationException; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.configuration.ProxyConnectorConfiguration; +import org.apache.maven.archiva.configuration.RemoteRepositoryConfiguration; +import org.codehaus.plexus.registry.RegistryException; +import org.codehaus.plexus.spring.PlexusInSpringTestCase; +import org.easymock.MockControl; + +import java.util.Collections; + +/** + * DeleteRemoteRepositoryActionTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class DeleteRemoteRepositoryActionTest + extends PlexusInSpringTestCase +{ + private static final String REPO_ID = "remote-repo-ident"; + + private DeleteRemoteRepositoryAction action; + + private MockControl archivaConfigurationControl; + + private ArchivaConfiguration archivaConfiguration; + + protected void setUp() + throws Exception + { + super.setUp(); + + action = (DeleteRemoteRepositoryAction) lookup( Action.class.getName(), "deleteRemoteRepositoryAction" ); + + archivaConfigurationControl = MockControl.createControl( ArchivaConfiguration.class ); + archivaConfiguration = (ArchivaConfiguration) archivaConfigurationControl.getMock(); + action.setArchivaConfiguration( archivaConfiguration ); + } + + public void testDeleteRemoteRepositoryConfirmation() + throws Exception + { + RemoteRepositoryConfiguration originalRepository = createRepository(); + Configuration configuration = createConfigurationForEditing( originalRepository ); + + archivaConfiguration.getConfiguration(); + archivaConfigurationControl.setReturnValue( configuration ); + archivaConfigurationControl.replay(); + + action.setRepoid( REPO_ID ); + + action.prepare(); + assertEquals( REPO_ID, action.getRepoid() ); + RemoteRepositoryConfiguration repository = action.getRepository(); + assertNotNull( repository ); + assertRepositoryEquals( repository, createRepository() ); + + String status = action.confirmDelete(); + assertEquals( Action.INPUT, status ); + repository = action.getRepository(); + assertRepositoryEquals( repository, createRepository() ); + assertEquals( Collections.singletonList( originalRepository ), configuration.getRemoteRepositories() ); + } + + public void testDeleteRemoteRepository() + throws RegistryException, IndeterminateConfigurationException + { + Configuration configuration = createConfigurationForEditing( createRepository() ); + configuration.addManagedRepository( createManagedRepository( "internal", getTestPath( "target/repo/internal" ) ) ); + configuration.addManagedRepository( createManagedRepository( "snapshots", getTestPath( "target/repo/snapshots" ) ) ); + configuration.addProxyConnector( createProxyConnector( "internal", REPO_ID) ); + + archivaConfiguration.getConfiguration(); + archivaConfigurationControl.setReturnValue( configuration, 4 ); + + archivaConfiguration.save( configuration ); + archivaConfigurationControl.replay(); + + action.setRepoid( REPO_ID ); + + action.prepare(); + assertEquals( REPO_ID, action.getRepoid() ); + RemoteRepositoryConfiguration repository = action.getRepository(); + assertNotNull( repository ); + assertRepositoryEquals( repository, createRepository() ); + + assertEquals( 1, configuration.getProxyConnectors().size() ); + + String status = action.delete(); + assertEquals( Action.SUCCESS, status ); + + assertTrue( configuration.getRemoteRepositories().isEmpty() ); + assertEquals( 0, configuration.getProxyConnectors().size() ); + } + + public void testDeleteRemoteRepositoryCancelled() + throws Exception + { + RemoteRepositoryConfiguration originalRepository = createRepository(); + Configuration configuration = createConfigurationForEditing( originalRepository ); + + archivaConfiguration.getConfiguration(); + archivaConfigurationControl.setReturnValue( configuration, 2 ); + + archivaConfiguration.save( configuration ); + archivaConfigurationControl.replay(); + + action.setRepoid( REPO_ID ); + + action.prepare(); + assertEquals( REPO_ID, action.getRepoid() ); + RemoteRepositoryConfiguration repositoryConfiguration = action.getRepository(); + assertNotNull( repositoryConfiguration ); + assertRepositoryEquals( repositoryConfiguration, createRepository() ); + + String status = action.execute(); + assertEquals( Action.SUCCESS, status ); + + RemoteRepositoryConfiguration repository = action.getRepository(); + assertRepositoryEquals( repository, createRepository() ); + assertEquals( Collections.singletonList( originalRepository ), configuration.getRemoteRepositories() ); + } + + private Configuration createConfigurationForEditing( RemoteRepositoryConfiguration repositoryConfiguration ) + { + Configuration configuration = new Configuration(); + configuration.addRemoteRepository( repositoryConfiguration ); + return configuration; + } + + private RemoteRepositoryConfiguration createRepository() + { + RemoteRepositoryConfiguration r = new RemoteRepositoryConfiguration(); + r.setId( REPO_ID ); + populateRepository( r ); + return r; + } + + private void assertRepositoryEquals( RemoteRepositoryConfiguration expectedRepository, + RemoteRepositoryConfiguration actualRepository ) + { + assertEquals( expectedRepository.getId(), actualRepository.getId() ); + assertEquals( expectedRepository.getLayout(), actualRepository.getLayout() ); + assertEquals( expectedRepository.getUrl(), actualRepository.getUrl() ); + assertEquals( expectedRepository.getName(), actualRepository.getName() ); + } + + private ManagedRepositoryConfiguration createManagedRepository( String string, String testPath ) + { + ManagedRepositoryConfiguration r = new ManagedRepositoryConfiguration(); + r.setId( REPO_ID ); + r.setName( "repo name" ); + r.setLocation( testPath ); + r.setLayout( "default" ); + r.setRefreshCronExpression( "* 0/5 * * * ?" ); + r.setDaysOlder( 0 ); + r.setRetentionCount( 0 ); + r.setReleases( true ); + r.setSnapshots( true ); + r.setScanned( false ); + r.setDeleteReleasedSnapshots( false ); + return r; + } + + private ProxyConnectorConfiguration createProxyConnector( String managedRepoId, String remoteRepoId ) + { + ProxyConnectorConfiguration connector = new ProxyConnectorConfiguration(); + connector.setSourceRepoId( managedRepoId ); + connector.setTargetRepoId( remoteRepoId ); + + return connector; + } + + private void populateRepository( RemoteRepositoryConfiguration repository ) + { + repository.setId( REPO_ID ); + repository.setName( "repo name" ); + repository.setUrl( "url" ); + repository.setLayout( "default" ); + } + + // TODO: what about removing proxied content if a proxy is removed? +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteRepositoryGroupActionTest.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteRepositoryGroupActionTest.java new file mode 100644 index 000000000..46efd31ae --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteRepositoryGroupActionTest.java @@ -0,0 +1,156 @@ +package org.apache.maven.archiva.web.action.admin.repositories; + +/* + * 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.Collections; + +import com.opensymphony.xwork.Action; +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.Configuration; +import org.apache.maven.archiva.configuration.RepositoryGroupConfiguration; +import org.codehaus.plexus.redback.xwork.interceptor.SecureActionBundle; +import org.codehaus.plexus.redback.xwork.interceptor.SecureActionException; +import org.codehaus.plexus.spring.PlexusInSpringTestCase; +import org.easymock.MockControl; + +/** + * DeleteRepositoryGroupActionTest + * + * @author + * @version + */ +public class DeleteRepositoryGroupActionTest + extends PlexusInSpringTestCase +{ + private static final String REPO_GROUP_ID = "repo-group-ident"; + + private DeleteRepositoryGroupAction action; + + private MockControl archivaConfigurationControl; + + private ArchivaConfiguration archivaConfiguration; + + protected void setUp() + throws Exception + { + super.setUp(); + + action = (DeleteRepositoryGroupAction) lookup ( Action.class.getName(), "deleteRepositoryGroupAction" ); + + archivaConfigurationControl = MockControl.createControl( ArchivaConfiguration.class ); + archivaConfiguration = (ArchivaConfiguration) archivaConfigurationControl.getMock(); + action.setArchivaConfiguration( archivaConfiguration ); + } + + public void testSecureActionBundle() + throws SecureActionException + { + archivaConfiguration.getConfiguration(); + archivaConfigurationControl.setReturnValue( new Configuration() ); + archivaConfigurationControl.replay(); + + action.prepare(); + SecureActionBundle bundle = action.getSecureActionBundle(); + assertTrue( bundle.requiresAuthentication() ); + assertEquals( 1, bundle.getAuthorizationTuples().size() ); + } + + public void testDeleteRepositoryGroupConfirmation() + throws Exception + { + RepositoryGroupConfiguration origRepoGroup = createRepositoryGroup(); + Configuration configuration = createConfigurationForEditing( origRepoGroup ); + + archivaConfiguration.getConfiguration(); + archivaConfigurationControl.setReturnValue( configuration ); + archivaConfigurationControl.replay(); + + action.setRepoGroupId( REPO_GROUP_ID ); + + action.prepare(); + assertEquals( REPO_GROUP_ID, action.getRepoGroupId() ); + RepositoryGroupConfiguration repoGroup = action.getRepositoryGroup(); + assertNotNull( repoGroup ); + assertEquals( repoGroup.getId(), action.getRepoGroupId() ); + assertEquals( Collections.singletonList( origRepoGroup ), configuration.getRepositoryGroups() ); + } + + public void testDeleteRepositoryGroup() + throws Exception + { + Configuration configuration = createConfigurationForEditing( createRepositoryGroup() ); + + archivaConfiguration.getConfiguration(); + archivaConfigurationControl.setReturnValue( configuration, 3 ); + archivaConfiguration.save( configuration ); + archivaConfigurationControl.replay(); + + action.setRepoGroupId( REPO_GROUP_ID ); + + action.prepare(); + assertEquals( REPO_GROUP_ID, action.getRepoGroupId() ); + RepositoryGroupConfiguration repoGroup = action.getRepositoryGroup(); + assertNotNull( repoGroup ); + assertEquals( Collections.singletonList( repoGroup ), configuration.getRepositoryGroups() ); + + String status = action.delete(); + assertEquals( Action.SUCCESS, status ); + assertTrue( configuration.getRepositoryGroups().isEmpty() ); + } + + public void testDeleteRepositoryGroupCancelled() + throws Exception + { + RepositoryGroupConfiguration origRepoGroup = createRepositoryGroup(); + Configuration configuration = createConfigurationForEditing ( origRepoGroup ); + + archivaConfiguration.getConfiguration(); + archivaConfigurationControl.setReturnValue( configuration, 2 ); + + archivaConfiguration.save( configuration ); + archivaConfigurationControl.replay(); + + action.setRepoGroupId( REPO_GROUP_ID ); + + action.prepare(); + assertEquals( REPO_GROUP_ID, action.getRepoGroupId() ); + RepositoryGroupConfiguration repoGroup = action.getRepositoryGroup(); + assertNotNull( repoGroup ); + + String status = action.execute(); + assertEquals( Action.SUCCESS, status ); + assertEquals( Collections.singletonList( repoGroup ), configuration.getRepositoryGroups() ); + } + + private Configuration createConfigurationForEditing( RepositoryGroupConfiguration repoGroup ) + { + Configuration configuration = new Configuration(); + configuration.addRepositoryGroup( repoGroup ); + return configuration; + } + + private RepositoryGroupConfiguration createRepositoryGroup() + { + RepositoryGroupConfiguration repoGroup = new RepositoryGroupConfiguration(); + repoGroup.setId( REPO_GROUP_ID ); + + return repoGroup; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/EditManagedRepositoryActionTest.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/EditManagedRepositoryActionTest.java new file mode 100644 index 000000000..5c944f8d6 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/EditManagedRepositoryActionTest.java @@ -0,0 +1,211 @@ +package org.apache.maven.archiva.web.action.admin.repositories; + +/* + * 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 com.opensymphony.xwork.Action; +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.security.ArchivaRoleConstants; +import org.codehaus.plexus.redback.role.RoleManager; +import org.codehaus.plexus.redback.xwork.interceptor.SecureActionBundle; +import org.codehaus.plexus.redback.xwork.interceptor.SecureActionException; +import org.codehaus.plexus.spring.PlexusInSpringTestCase; +import org.easymock.MockControl; + +import java.io.File; +import java.io.IOException; +import java.util.Collections; + +/** + * EditManagedRepositoryActionTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class EditManagedRepositoryActionTest + extends PlexusInSpringTestCase +{ + private EditManagedRepositoryAction action; + + private RoleManager roleManager; + + private MockControl roleManagerControl; + + private MockControl archivaConfigurationControl; + + private ArchivaConfiguration archivaConfiguration; + + private static final String REPO_ID = "repo-ident"; + + private File location; + + @Override + protected String getPlexusConfigLocation() + { + return AbstractManagedRepositoriesAction.class.getName().replace( '.', '/' ) + "Test.xml"; + } + + protected void setUp() + throws Exception + { + super.setUp(); + + action = (EditManagedRepositoryAction) lookup( Action.class.getName(), "editManagedRepositoryAction" ); + + archivaConfigurationControl = MockControl.createControl( ArchivaConfiguration.class ); + archivaConfiguration = (ArchivaConfiguration) archivaConfigurationControl.getMock(); + action.setArchivaConfiguration( archivaConfiguration ); + + roleManagerControl = MockControl.createControl( RoleManager.class ); + roleManager = (RoleManager) roleManagerControl.getMock(); + action.setRoleManager( roleManager ); + location = getTestFile( "target/test/location" ); + } + + public void testSecureActionBundle() + throws SecureActionException + { + archivaConfiguration.getConfiguration(); + archivaConfigurationControl.setReturnValue( new Configuration() ); + archivaConfigurationControl.replay(); + + action.prepare(); + SecureActionBundle bundle = action.getSecureActionBundle(); + assertTrue( bundle.requiresAuthentication() ); + assertEquals( 1, bundle.getAuthorizationTuples().size() ); + } + + public void testEditRepositoryInitialPage() + throws Exception + { + Configuration configuration = createConfigurationForEditing( createRepository() ); + + archivaConfiguration.getConfiguration(); + archivaConfigurationControl.setReturnValue( configuration ); + archivaConfigurationControl.replay(); + + action.setRepoid( REPO_ID ); + + action.prepare(); + assertEquals( REPO_ID, action.getRepoid() ); + ManagedRepositoryConfiguration repository = action.getRepository(); + assertNotNull( repository ); + assertRepositoryEquals( repository, createRepository() ); + + String status = action.input(); + assertEquals( Action.INPUT, status ); + repository = action.getRepository(); + assertRepositoryEquals( repository, createRepository() ); + } + + public void testEditRepository() + throws Exception + { + roleManager.templatedRoleExists( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER, REPO_ID ); + roleManagerControl.setReturnValue( false ); + roleManager.createTemplatedRole( ArchivaRoleConstants.TEMPLATE_REPOSITORY_OBSERVER, REPO_ID ); + roleManagerControl.setVoidCallable(); + roleManager.templatedRoleExists( ArchivaRoleConstants.TEMPLATE_REPOSITORY_MANAGER, REPO_ID ); + roleManagerControl.setReturnValue( false ); + roleManager.createTemplatedRole( ArchivaRoleConstants.TEMPLATE_REPOSITORY_MANAGER, REPO_ID ); + roleManagerControl.setVoidCallable(); + + roleManagerControl.replay(); + + Configuration configuration = createConfigurationForEditing( createRepository() ); + archivaConfiguration.getConfiguration(); + archivaConfigurationControl.setReturnValue( configuration ); + archivaConfigurationControl.setReturnValue( configuration ); + archivaConfigurationControl.setReturnValue( configuration ); + + archivaConfiguration.save( configuration ); + + archivaConfigurationControl.replay(); + + action.setRepoid( REPO_ID ); + action.prepare(); + assertEquals( REPO_ID, action.getRepoid() ); + ManagedRepositoryConfiguration repository = action.getRepository(); + populateRepository( repository ); + repository.setName( "new repo name" ); + + String status = action.commit(); + assertEquals( Action.SUCCESS, status ); + + ManagedRepositoryConfiguration newRepository = createRepository(); + newRepository.setName( "new repo name" ); + assertRepositoryEquals( repository, newRepository ); + assertEquals( Collections.singletonList( repository ), configuration.getManagedRepositories() ); + + roleManagerControl.verify(); + archivaConfigurationControl.verify(); + } + + private void assertRepositoryEquals( ManagedRepositoryConfiguration expectedRepository, + ManagedRepositoryConfiguration actualRepository ) + { + assertEquals( expectedRepository.getDaysOlder(), actualRepository.getDaysOlder() ); + assertEquals( expectedRepository.getId(), actualRepository.getId() ); + assertEquals( expectedRepository.getIndexDir(), actualRepository.getIndexDir() ); + assertEquals( expectedRepository.getLayout(), actualRepository.getLayout() ); + assertEquals( expectedRepository.getLocation(), actualRepository.getLocation() ); + assertEquals( expectedRepository.getName(), actualRepository.getName() ); + assertEquals( expectedRepository.getRefreshCronExpression(), actualRepository.getRefreshCronExpression() ); + assertEquals( expectedRepository.getRetentionCount(), actualRepository.getRetentionCount() ); + assertEquals( expectedRepository.isDeleteReleasedSnapshots(), actualRepository.isDeleteReleasedSnapshots() ); + assertEquals( expectedRepository.isScanned(), actualRepository.isScanned() ); + assertEquals( expectedRepository.isReleases(), actualRepository.isReleases() ); + assertEquals( expectedRepository.isSnapshots(), actualRepository.isSnapshots() ); + } + + private Configuration createConfigurationForEditing( ManagedRepositoryConfiguration repositoryConfiguration ) + { + Configuration configuration = new Configuration(); + configuration.addManagedRepository( repositoryConfiguration ); + return configuration; + } + + private ManagedRepositoryConfiguration createRepository() + throws IOException + { + ManagedRepositoryConfiguration r = new ManagedRepositoryConfiguration(); + r.setId( REPO_ID ); + populateRepository( r ); + return r; + } + + private void populateRepository( ManagedRepositoryConfiguration repository ) + throws IOException + { + repository.setId( REPO_ID ); + repository.setName( "repo name" ); + repository.setLocation( location.getCanonicalPath() ); + repository.setLayout( "default" ); + repository.setRefreshCronExpression( "* 0/5 * * * ?" ); + repository.setDaysOlder( 31 ); + repository.setRetentionCount( 20 ); + repository.setReleases( true ); + repository.setSnapshots( true ); + repository.setScanned( false ); + repository.setDeleteReleasedSnapshots( true ); + } + +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/EditRemoteRepositoryActionTest.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/EditRemoteRepositoryActionTest.java new file mode 100644 index 000000000..eb8a92920 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/EditRemoteRepositoryActionTest.java @@ -0,0 +1,157 @@ +package org.apache.maven.archiva.web.action.admin.repositories; + +/* + * 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 com.opensymphony.xwork.Action; +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.Configuration; +import org.apache.maven.archiva.configuration.RemoteRepositoryConfiguration; +import org.codehaus.plexus.redback.xwork.interceptor.SecureActionBundle; +import org.codehaus.plexus.redback.xwork.interceptor.SecureActionException; +import org.codehaus.plexus.spring.PlexusInSpringTestCase; +import org.easymock.MockControl; + +import java.util.Collections; + +/** + * EditRemoteRepositoryActionTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class EditRemoteRepositoryActionTest + extends PlexusInSpringTestCase +{ + private static final String REPO_ID = "remote-repo-ident"; + + private EditRemoteRepositoryAction action; + + private MockControl archivaConfigurationControl; + + private ArchivaConfiguration archivaConfiguration; + + public void testEditRemoteRepository() + throws Exception + { + Configuration configuration = createConfigurationForEditing( createRepository() ); + archivaConfiguration.getConfiguration(); + archivaConfigurationControl.setReturnValue( configuration ); + archivaConfigurationControl.setReturnValue( configuration ); + archivaConfiguration.save( configuration ); + archivaConfigurationControl.replay(); + + action.setRepoid( REPO_ID ); + action.prepare(); + assertEquals( REPO_ID, action.getRepoid() ); + RemoteRepositoryConfiguration repository = action.getRepository(); + populateRepository( repository ); + repository.setName( "new repo name" ); + + String status = action.commit(); + assertEquals( Action.SUCCESS, status ); + + RemoteRepositoryConfiguration newRepository = createRepository(); + newRepository.setName( "new repo name" ); + assertRepositoryEquals( repository, newRepository ); + assertEquals( Collections.singletonList( repository ), configuration.getRemoteRepositories() ); + + archivaConfigurationControl.verify(); + } + + public void testEditRemoteRepositoryInitialPage() + throws Exception + { + Configuration configuration = createConfigurationForEditing( createRepository() ); + + archivaConfiguration.getConfiguration(); + archivaConfigurationControl.setReturnValue( configuration ); + archivaConfigurationControl.replay(); + + action.setRepoid( REPO_ID ); + + action.prepare(); + assertEquals( REPO_ID, action.getRepoid() ); + RemoteRepositoryConfiguration repository = action.getRepository(); + assertNotNull( repository ); + assertRepositoryEquals( repository, createRepository() ); + + String status = action.input(); + assertEquals( Action.INPUT, status ); + repository = action.getRepository(); + assertRepositoryEquals( repository, createRepository() ); + } + + public void testSecureActionBundle() + throws SecureActionException + { + archivaConfiguration.getConfiguration(); + archivaConfigurationControl.setReturnValue( new Configuration() ); + archivaConfigurationControl.replay(); + + action.prepare(); + SecureActionBundle bundle = action.getSecureActionBundle(); + assertTrue( bundle.requiresAuthentication() ); + assertEquals( 1, bundle.getAuthorizationTuples().size() ); + } + + private void assertRepositoryEquals( RemoteRepositoryConfiguration expectedRepository, + RemoteRepositoryConfiguration actualRepository ) + { + assertEquals( expectedRepository.getId(), actualRepository.getId() ); + assertEquals( expectedRepository.getLayout(), actualRepository.getLayout() ); + assertEquals( expectedRepository.getUrl(), actualRepository.getUrl() ); + assertEquals( expectedRepository.getName(), actualRepository.getName() ); + } + + private Configuration createConfigurationForEditing( RemoteRepositoryConfiguration repositoryConfiguration ) + { + Configuration configuration = new Configuration(); + configuration.addRemoteRepository( repositoryConfiguration ); + return configuration; + } + + private RemoteRepositoryConfiguration createRepository() + { + RemoteRepositoryConfiguration r = new RemoteRepositoryConfiguration(); + r.setId( REPO_ID ); + populateRepository( r ); + return r; + } + + private void populateRepository( RemoteRepositoryConfiguration repository ) + { + repository.setId( REPO_ID ); + repository.setName( "repo name" ); + repository.setUrl( "url" ); + repository.setLayout( "default" ); + } + + protected void setUp() + throws Exception + { + super.setUp(); + + action = (EditRemoteRepositoryAction) lookup( Action.class.getName(), "editRemoteRepositoryAction" ); + + archivaConfigurationControl = MockControl.createControl( ArchivaConfiguration.class ); + archivaConfiguration = (ArchivaConfiguration) archivaConfigurationControl.getMock(); + action.setArchivaConfiguration( archivaConfiguration ); + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/ProjectModelDAOStub.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/ProjectModelDAOStub.java new file mode 100644 index 000000000..7414ebd8c --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/ProjectModelDAOStub.java @@ -0,0 +1,78 @@ +package org.apache.maven.archiva.web.action.admin.repositories; + +/* + * 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.archiva.database.ArchivaDatabaseException; +import org.apache.maven.archiva.database.Constraint; +import org.apache.maven.archiva.database.ObjectNotFoundException; +import org.apache.maven.archiva.database.ProjectModelDAO; +import org.apache.maven.archiva.model.ArchivaProjectModel; + +/** + * ProjectModelDAOStub + * + * @author Maria Odea Ching + * @version + */ +public class ProjectModelDAOStub + implements ProjectModelDAO +{ + + public ArchivaProjectModel createProjectModel( String groupId, String artifactId, String version ) + { + // TODO Auto-generated method stub + return null; + } + + public void deleteProjectModel( ArchivaProjectModel model ) + throws ArchivaDatabaseException + { + // TODO Auto-generated method stub + + } + + public ArchivaProjectModel getProjectModel( String groupId, String artifactId, String version ) + throws ObjectNotFoundException, ArchivaDatabaseException + { + ArchivaProjectModel projectModel = new ArchivaProjectModel(); + projectModel.setGroupId( groupId ); + projectModel.setArtifactId( artifactId ); + projectModel.setVersion( version ); + + return projectModel; + } + + public List queryProjectModels( Constraint constraint ) + throws ObjectNotFoundException, ArchivaDatabaseException + { + // TODO Auto-generated method stub + return null; + } + + public ArchivaProjectModel saveProjectModel( ArchivaProjectModel model ) + throws ArchivaDatabaseException + { + // TODO Auto-generated method stub + return null; + } + +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoriesActionTest.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoriesActionTest.java new file mode 100644 index 000000000..1b372a1da --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoriesActionTest.java @@ -0,0 +1,78 @@ +package org.apache.maven.archiva.web.action.admin.repositories; + +/* + * 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 com.meterware.servletunit.ServletRunner; +import com.meterware.servletunit.ServletUnitClient; +import com.opensymphony.xwork.Action; +import org.codehaus.plexus.redback.xwork.interceptor.SecureActionBundle; +import org.codehaus.plexus.redback.xwork.interceptor.SecureActionException; +import org.codehaus.plexus.spring.PlexusInSpringTestCase; + +/** + * Test the repositories action returns the correct data. + */ +public class RepositoriesActionTest + extends PlexusInSpringTestCase +{ + private RepositoriesAction action; + + protected void setUp() + throws Exception + { + super.setUp(); + + // TODO: purely to quiet logging - shouldn't be needed + String appserverBase = getTestFile( "target/appserver-base" ).getAbsolutePath(); + System.setProperty( "appserver.base", appserverBase ); + action = (RepositoriesAction) lookup( Action.class.getName(), "repositoriesAction" ); + } + + public void testGetRepositories() + throws Exception + { + ServletRunner sr = new ServletRunner(); + ServletUnitClient sc = sr.newClient(); + + action.setServletRequest( sc.newInvocation( "http://localhost/admin/repositories.action" ).getRequest() ); + action.prepare(); + String result = action.execute(); + assertEquals( Action.SUCCESS, result ); + + // TODO: for some reason servletunit is not populating the port of the servlet request + assertEquals( "http://localhost:0/repository", action.getBaseUrl() ); + + assertNotNull( action.getManagedRepositories() ); + assertNotNull( action.getRemoteRepositories() ); + assertNotNull( action.getRepositoryStatistics() ); + + assertEquals( 2, action.getManagedRepositories().size() ); + assertEquals( 2, action.getRemoteRepositories().size() ); + assertEquals( 2, action.getRepositoryStatistics().size() ); + } + + public void testSecureActionBundle() + throws SecureActionException + { + SecureActionBundle bundle = action.getSecureActionBundle(); + assertTrue( bundle.requiresAuthentication() ); + assertEquals( 1, bundle.getAuthorizationTuples().size() ); + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoryContentStatisticsDAOStub.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoryContentStatisticsDAOStub.java new file mode 100644 index 000000000..70996905d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoryContentStatisticsDAOStub.java @@ -0,0 +1,68 @@ +package org.apache.maven.archiva.web.action.admin.repositories; + +/* + * 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.List; + +import junit.framework.Assert; + +import org.apache.maven.archiva.database.ArchivaDatabaseException; +import org.apache.maven.archiva.database.Constraint; +import org.apache.maven.archiva.database.ObjectNotFoundException; +import org.apache.maven.archiva.database.RepositoryContentStatisticsDAO; +import org.apache.maven.archiva.database.constraints.RepositoryContentStatisticsByRepositoryConstraint; +import org.apache.maven.archiva.model.RepositoryContentStatistics; + +/** + * RepositoryContentStatisticsDAOStub + * + * @author Maria Odea Ching + * @version + */ +public class RepositoryContentStatisticsDAOStub + implements RepositoryContentStatisticsDAO +{ + + public void deleteRepositoryContentStatistics( RepositoryContentStatistics stats ) + throws ArchivaDatabaseException + { + Assert.assertEquals( "repo-ident", stats.getRepositoryId() ); + } + + public List queryRepositoryContentStatistics( Constraint constraint ) + throws ObjectNotFoundException, ArchivaDatabaseException + { + Assert.assertTrue( constraint instanceof RepositoryContentStatisticsByRepositoryConstraint ); + + List stats = new ArrayList(); + RepositoryContentStatistics statistics = new RepositoryContentStatistics(); + statistics.setRepositoryId( "repo-ident" ); + stats.add( statistics ); + + return stats; + } + + public RepositoryContentStatistics saveRepositoryContentStatistics( RepositoryContentStatistics stats ) + { + return null; + } + +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoryGroupsActionTest.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoryGroupsActionTest.java new file mode 100644 index 000000000..5b12e8ea2 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/RepositoryGroupsActionTest.java @@ -0,0 +1,380 @@ +package org.apache.maven.archiva.web.action.admin.repositories; + +/* + * 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.Collections; + +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.configuration.RepositoryGroupConfiguration; +import org.codehaus.plexus.redback.xwork.interceptor.SecureActionBundle; +import org.codehaus.plexus.redback.xwork.interceptor.SecureActionException; +import org.codehaus.plexus.spring.PlexusInSpringTestCase; +import org.easymock.MockControl; + +import com.meterware.servletunit.ServletRunner; +import com.meterware.servletunit.ServletUnitClient; +import com.opensymphony.xwork.Action; + +/** + * RepositoryGroupsActionTest + * + * @author + * @version + */ +public class RepositoryGroupsActionTest + extends PlexusInSpringTestCase +{ + private static final String REPO_GROUP_ID = "repo-group-ident"; + + private static final String REPO1_ID = "managed-repo-ident-1"; + + private static final String REPO2_ID = "managed-repo-ident-2"; + + private RepositoryGroupsAction action; + + private MockControl archivaConfigurationControl; + + private ArchivaConfiguration archivaConfiguration; + + protected void setUp() + throws Exception + { + super.setUp(); + + action = (RepositoryGroupsAction) lookup( Action.class.getName(), "repositoryGroupsAction" ); + + archivaConfigurationControl = MockControl.createControl( ArchivaConfiguration.class ); + archivaConfiguration = (ArchivaConfiguration) archivaConfigurationControl.getMock(); + action.setArchivaConfiguration( archivaConfiguration ); + } + + public void testSecureActionBundle() + throws SecureActionException + { + archivaConfiguration.getConfiguration(); + archivaConfigurationControl.setReturnValue( new Configuration() ); + archivaConfigurationControl.replay(); + + action.prepare(); + SecureActionBundle bundle = action.getSecureActionBundle(); + assertTrue( bundle.requiresAuthentication() ); + assertEquals( 1, bundle.getAuthorizationTuples().size() ); + } + + public void testAddRepositoryGroup() + throws Exception + { + Configuration configuration = new Configuration(); + archivaConfiguration.getConfiguration(); + archivaConfigurationControl.setReturnValue( configuration, 2 ); + + archivaConfiguration.save( configuration ); + archivaConfigurationControl.replay(); + + action.prepare(); + RepositoryGroupConfiguration repositoryGroup = action.getRepositoryGroup(); + repositoryGroup.setId( REPO_GROUP_ID ); + + String status = action.addRepositoryGroup(); + assertEquals( Action.SUCCESS, status ); + + assertEquals( Collections.singletonList( repositoryGroup ), configuration.getRepositoryGroups() ); + + archivaConfigurationControl.verify(); + } + + public void testAddEmptyRepositoryGroup() + throws Exception + { + Configuration configuration = new Configuration(); + archivaConfiguration.getConfiguration(); + archivaConfigurationControl.setReturnValue( configuration, 2 ); + + archivaConfiguration.save( configuration ); + + archivaConfigurationControl.replay(); + + action.prepare(); + + String status = action.addRepositoryGroup(); + assertEquals( Action.ERROR, status ); + + assertEquals( 0, configuration.getRepositoryGroups().size() ); + } + + public void testAddDuplicateRepositoryGroup() + throws Exception + { + Configuration configuration = new Configuration(); + archivaConfiguration.getConfiguration(); + archivaConfigurationControl.setReturnValue( configuration, 3 ); + + archivaConfiguration.save( configuration ); + + archivaConfigurationControl.replay(); + + action.prepare(); + RepositoryGroupConfiguration repositoryGroup = action.getRepositoryGroup(); + repositoryGroup.setId( REPO_GROUP_ID ); + + String status = action.addRepositoryGroup(); + assertEquals( Action.SUCCESS, status ); + + assertEquals( Collections.singletonList( repositoryGroup ), configuration.getRepositoryGroups() ); + + repositoryGroup.setId( REPO_GROUP_ID ); + status = action.addRepositoryGroup(); + + assertEquals( Action.ERROR, status ); + assertEquals( Collections.singletonList( repositoryGroup ), configuration.getRepositoryGroups() ); + } + + public void testGetRepositoryGroups() + throws Exception + { + ServletRunner sr = new ServletRunner(); + ServletUnitClient sc = sr.newClient(); + + Configuration configuration = createInitialConfiguration(); + + archivaConfiguration.getConfiguration(); + archivaConfigurationControl.setReturnValue( configuration ); + archivaConfigurationControl.replay(); + + action.setServletRequest( sc.newInvocation( "http://localhost/admin/repositoryGroups.action" ).getRequest() ); + action.prepare(); + String result = action.execute(); + assertEquals( Action.SUCCESS, result ); + + assertEquals( "http://localhost:0/repository", action.getBaseUrl() ); + + assertNotNull( action.getRepositoryGroups() ); + assertEquals( 1, action.getRepositoryGroups().size() ); + assertEquals( 2, action.getManagedRepositories().size() ); + + RepositoryGroupConfiguration repoGroup = action.getRepositoryGroups().get( REPO_GROUP_ID ); + + assertEquals( 1, repoGroup.getRepositories().size() ); + assertEquals( REPO1_ID, repoGroup.getRepositories().get( 0 ) ); + assertNotNull( action.getGroupToRepositoryMap() ); + assertEquals( 1, action.getGroupToRepositoryMap().size() ); + + java.util.List repos = action.getGroupToRepositoryMap().get( repoGroup.getId() ); + assertEquals( 1, repos.size() ); + assertEquals( REPO2_ID, repos.get( 0 ) ); + } + + public void testAddRepositoryToGroup() + throws Exception + { + Configuration configuration = createInitialConfiguration(); + + archivaConfiguration.getConfiguration(); + archivaConfigurationControl.setReturnValue( configuration, 6 ); + archivaConfiguration.save( configuration ); + archivaConfigurationControl.replay(); + + action.prepare(); + String result = action.execute(); + assertEquals( Action.SUCCESS, result ); + + assertNotNull( action.getRepositoryGroups() ); + assertEquals( 1, action.getRepositoryGroups().size() ); + assertEquals( 2, action.getManagedRepositories().size() ); + + RepositoryGroupConfiguration repoGroup = action.getRepositoryGroups().get( REPO_GROUP_ID ); + assertEquals( 1 , repoGroup.getRepositories().size() ); + assertEquals( REPO1_ID, repoGroup.getRepositories().get( 0 ) ); + + assertNotNull( action.getGroupToRepositoryMap() ); + assertEquals( 1, action.getGroupToRepositoryMap().size() ); + + java.util.List repos = action.getGroupToRepositoryMap().get( repoGroup.getId() ); + assertEquals( 1, repos.size() ); + assertEquals( REPO2_ID, repos.get( 0 ) ); + + action.setRepoGroupId( REPO_GROUP_ID ); + action.setRepoId( REPO2_ID ); + + result = action.addRepositoryToGroup(); + assertEquals( Action.SUCCESS, result ); + + action.prepare(); + result = action.execute(); + assertEquals( Action.SUCCESS, result ); + + assertEquals( 1, action.getRepositoryGroups().size() ); + repoGroup = action.getRepositoryGroups().get( REPO_GROUP_ID ); + assertEquals( 2, repoGroup.getRepositories().size() ); + assertEquals( REPO1_ID, repoGroup.getRepositories().get( 0 ) ); + assertEquals( REPO2_ID, repoGroup.getRepositories().get( 1 ) ); + + assertEquals( 0, action.getGroupToRepositoryMap().size() ); + assertNull( action.getGroupToRepositoryMap().get( repoGroup.getId() ) ); + } + + public void testRemoveRepositoryFromGroup() + throws Exception + { + Configuration configuration = createInitialConfiguration(); + + archivaConfiguration.getConfiguration(); + archivaConfigurationControl.setReturnValue( configuration, 6 ); + archivaConfiguration.save( configuration ); + archivaConfigurationControl.replay(); + + action.prepare(); + String result = action.execute(); + assertEquals( Action.SUCCESS, result ); + + assertNotNull( action.getRepositoryGroups() ); + assertEquals( 1, action.getRepositoryGroups().size() ); + assertEquals( 2, action.getManagedRepositories().size() ); + + RepositoryGroupConfiguration repoGroup = action.getRepositoryGroups().get( REPO_GROUP_ID ); + assertEquals( 1 , repoGroup.getRepositories().size() ); + assertEquals( REPO1_ID, repoGroup.getRepositories().get( 0 ) ); + + assertNotNull( action.getGroupToRepositoryMap() ); + assertEquals( 1, action.getGroupToRepositoryMap().size() ); + + java.util.List repos = action.getGroupToRepositoryMap().get( repoGroup.getId() ); + assertEquals( 1, repos.size() ); + assertEquals( REPO2_ID, repos.get( 0 ) ); + + action.setRepoGroupId( REPO_GROUP_ID ); + action.setRepoId( REPO1_ID ); + + result = action.removeRepositoryFromGroup(); + assertEquals( Action.SUCCESS, result ); + + action.prepare(); + result = action.execute(); + assertEquals( Action.SUCCESS, result ); + + repoGroup = action.getRepositoryGroups().get( REPO_GROUP_ID ); + assertEquals( 0, repoGroup.getRepositories().size() ); + + assertNotNull( action.getGroupToRepositoryMap() ); + assertEquals( 1, action.getGroupToRepositoryMap().size() ); + + repos = action.getGroupToRepositoryMap().get( repoGroup.getId() ); + assertEquals( 2, repos.size() ); + assertEquals( REPO1_ID, repos.get( 0 ) ); + assertEquals( REPO2_ID, repos.get( 1 ) ); + } + + public void testAddDuplicateRepositoryToGroup() + throws Exception + { + Configuration configuration = createInitialConfiguration(); + + archivaConfiguration.getConfiguration(); + archivaConfigurationControl.setReturnValue( configuration, 6 ); + archivaConfiguration.save( configuration ); + archivaConfigurationControl.replay(); + + action.prepare(); + String result = action.execute(); + assertEquals( Action.SUCCESS, result ); + + assertNotNull( action.getRepositoryGroups() ); + assertEquals( 1, action.getRepositoryGroups().size() ); + assertEquals( 2, action.getManagedRepositories().size() ); + + RepositoryGroupConfiguration repoGroup = action.getRepositoryGroups().get( REPO_GROUP_ID ); + assertEquals( 1 , repoGroup.getRepositories().size() ); + assertEquals( REPO1_ID, repoGroup.getRepositories().get( 0 ) ); + + assertNotNull( action.getGroupToRepositoryMap() ); + assertEquals( 1, action.getGroupToRepositoryMap().size() ); + + java.util.List repos = action.getGroupToRepositoryMap().get( repoGroup.getId() ); + assertEquals( 1, repos.size() ); + assertEquals( REPO2_ID, repos.get( 0 ) ); + + action.setRepoGroupId( REPO_GROUP_ID ); + action.setRepoId( REPO1_ID ); + + result = action.addRepositoryToGroup(); + assertEquals( Action.ERROR, result ); + } + + public void testRemoveRepositoryNotInGroup() + throws Exception + { + Configuration configuration = createInitialConfiguration(); + + archivaConfiguration.getConfiguration(); + archivaConfigurationControl.setReturnValue( configuration, 6 ); + archivaConfiguration.save( configuration ); + archivaConfigurationControl.replay(); + + action.prepare(); + String result = action.execute(); + assertEquals( Action.SUCCESS, result ); + + assertNotNull( action.getRepositoryGroups() ); + assertEquals( 1, action.getRepositoryGroups().size() ); + assertEquals( 2, action.getManagedRepositories().size() ); + + RepositoryGroupConfiguration repoGroup = action.getRepositoryGroups().get( REPO_GROUP_ID ); + assertEquals( 1 , repoGroup.getRepositories().size() ); + assertEquals( REPO1_ID, repoGroup.getRepositories().get( 0 ) ); + + assertNotNull( action.getGroupToRepositoryMap() ); + assertEquals( 1, action.getGroupToRepositoryMap().size() ); + + java.util.List repos = action.getGroupToRepositoryMap().get( repoGroup.getId() ); + assertEquals( 1, repos.size() ); + assertEquals( REPO2_ID, repos.get( 0 ) ); + + action.setRepoGroupId( REPO_GROUP_ID ); + action.setRepoId( REPO2_ID ); + + result = action.removeRepositoryFromGroup(); + assertEquals( Action.ERROR, result ); + } + + private Configuration createInitialConfiguration() + { + Configuration config = new Configuration(); + + ManagedRepositoryConfiguration managedRepo1 = new ManagedRepositoryConfiguration(); + managedRepo1.setId( REPO1_ID ); + + config.addManagedRepository( managedRepo1 ); + + ManagedRepositoryConfiguration managedRepo2 = new ManagedRepositoryConfiguration(); + managedRepo2.setId( REPO2_ID ); + + config.addManagedRepository( managedRepo2 ); + + RepositoryGroupConfiguration repoGroup = new RepositoryGroupConfiguration(); + repoGroup.setId( REPO_GROUP_ID ); + repoGroup.addRepository( REPO1_ID ); + + config.addRepositoryGroup( repoGroup ); + + return config; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/SortRepositoriesActionTest.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/SortRepositoriesActionTest.java new file mode 100644 index 000000000..9cd360640 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/SortRepositoriesActionTest.java @@ -0,0 +1,225 @@ +package org.apache.maven.archiva.web.action.admin.repositories; + +/* + * 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.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.Configuration; +import org.apache.maven.archiva.configuration.RepositoryGroupConfiguration; +import org.codehaus.plexus.redback.xwork.interceptor.SecureActionBundle; +import org.codehaus.plexus.redback.xwork.interceptor.SecureActionException; +import org.codehaus.plexus.spring.PlexusInSpringTestCase; +import org.easymock.MockControl; + +import com.opensymphony.xwork.Action; + +/** + * SortRepositoriesActionTest + * + * @author + * @version + */ +public class SortRepositoriesActionTest + extends PlexusInSpringTestCase +{ + private static final String REPO_GROUP_ID = "repo-group-ident"; + + private static final String REPO1_ID = "managed-repo-ident-1"; + + private static final String REPO2_ID = "managed-repo-ident-2"; + + private static final String REPO3_ID = "managed-repo-ident-3"; + + private MockControl archivaConfigurationControl; + + private ArchivaConfiguration archivaConfiguration; + + private SortRepositoriesAction action; + + protected void setUp() + throws Exception + { + super.setUp(); + + action = (SortRepositoriesAction) lookup( Action.class.getName(), "sortRepositoriesAction" ); + + archivaConfigurationControl = MockControl.createControl( ArchivaConfiguration.class ); + archivaConfiguration = (ArchivaConfiguration) archivaConfigurationControl.getMock(); + action.setArchivaConfiguration( archivaConfiguration ); + } + + public void testSecureActionBundle() + throws SecureActionException + { + archivaConfiguration.getConfiguration(); + archivaConfigurationControl.setReturnValue( new Configuration() ); + archivaConfigurationControl.replay(); + + SecureActionBundle bundle = action.getSecureActionBundle(); + assertTrue( bundle.requiresAuthentication() ); + assertEquals( 1, bundle.getAuthorizationTuples().size() ); + } + + public void testSortDownFirstRepository() + throws Exception + { + Configuration configuration = createInitialConfiguration(); + + archivaConfiguration.getConfiguration(); + archivaConfigurationControl.setReturnValue( configuration, 4 ); + archivaConfiguration.save( configuration ); + archivaConfigurationControl.replay(); + + RepositoryGroupConfiguration repoGroup = (RepositoryGroupConfiguration) configuration.getRepositoryGroups().get( 0 ); + java.util.List repositories = repoGroup.getRepositories(); + + assertEquals( 3, repositories.size() ); + assertEquals( REPO1_ID, repositories.get( 0 ) ); + assertEquals( REPO2_ID, repositories.get( 1 ) ); + assertEquals( REPO3_ID, repositories.get( 2 ) ); + + // sort down first repo + action.setRepoGroupId( repoGroup.getId() ); + action.setTargetRepo( REPO1_ID ); + + String result = action.sortDown(); + assertEquals( Action.SUCCESS, result ); + + repoGroup = (RepositoryGroupConfiguration) configuration.getRepositoryGroups().get( 0 ); + repositories = repoGroup.getRepositories(); + assertEquals( 3, repositories.size() ); + assertEquals( REPO2_ID, repositories.get( 0 ) ); + assertEquals( REPO1_ID, repositories.get( 1 ) ); + assertEquals( REPO3_ID, repositories.get( 2 ) ); + } + + public void testSortDownLastRepository() + throws Exception + { + Configuration configuration = createInitialConfiguration(); + + archivaConfiguration.getConfiguration(); + archivaConfigurationControl.setReturnValue( configuration, 4 ); + archivaConfiguration.save( configuration ); + archivaConfigurationControl.replay(); + + RepositoryGroupConfiguration repoGroup = (RepositoryGroupConfiguration) configuration.getRepositoryGroups().get( 0 ); + java.util.List repositories = repoGroup.getRepositories(); + + assertEquals( 3, repositories.size() ); + assertEquals( REPO1_ID, repositories.get( 0 ) ); + assertEquals( REPO2_ID, repositories.get( 1 ) ); + assertEquals( REPO3_ID, repositories.get( 2 ) ); + + // sort down last repo + action.setRepoGroupId( repoGroup.getId() ); + action.setTargetRepo( REPO3_ID ); + + String result = action.sortDown(); + assertEquals( Action.SUCCESS, result ); + + repoGroup = (RepositoryGroupConfiguration) configuration.getRepositoryGroups().get( 0 ); + repositories = repoGroup.getRepositories(); + assertEquals( 3, repositories.size() ); + assertEquals( REPO1_ID, repositories.get( 0 ) ); + assertEquals( REPO2_ID, repositories.get( 1 ) ); + assertEquals( REPO3_ID, repositories.get( 2 ) ); + } + + public void testSortUpLastRepository() + throws Exception + { + Configuration configuration = createInitialConfiguration(); + + archivaConfiguration.getConfiguration(); + archivaConfigurationControl.setReturnValue( configuration, 4 ); + archivaConfiguration.save( configuration ); + archivaConfigurationControl.replay(); + + RepositoryGroupConfiguration repoGroup = (RepositoryGroupConfiguration) configuration.getRepositoryGroups().get( 0 ); + java.util.List repositories = repoGroup.getRepositories(); + + assertEquals( 3, repositories.size() ); + assertEquals( REPO1_ID, repositories.get( 0 ) ); + assertEquals( REPO2_ID, repositories.get( 1 ) ); + assertEquals( REPO3_ID, repositories.get( 2 ) ); + + // sort up last repo + action.setRepoGroupId( repoGroup.getId() ); + action.setTargetRepo( REPO3_ID ); + + String result = action.sortUp(); + assertEquals( Action.SUCCESS, result ); + + repoGroup = (RepositoryGroupConfiguration) configuration.getRepositoryGroups().get( 0 ); + repositories = repoGroup.getRepositories(); + assertEquals( 3, repositories.size() ); + assertEquals( REPO1_ID, repositories.get( 0 ) ); + assertEquals( REPO3_ID, repositories.get( 1 ) ); + assertEquals( REPO2_ID, repositories.get( 2 ) ); + } + + public void testSortUpFirstRepository() + throws Exception + { + Configuration configuration = createInitialConfiguration(); + + archivaConfiguration.getConfiguration(); + archivaConfigurationControl.setReturnValue( configuration, 4 ); + archivaConfiguration.save( configuration ); + archivaConfigurationControl.replay(); + + RepositoryGroupConfiguration repoGroup = (RepositoryGroupConfiguration) configuration.getRepositoryGroups().get( 0 ); + java.util.List repositories = repoGroup.getRepositories(); + + assertEquals( 3, repositories.size() ); + assertEquals( REPO1_ID, repositories.get( 0 ) ); + assertEquals( REPO2_ID, repositories.get( 1 ) ); + assertEquals( REPO3_ID, repositories.get( 2 ) ); + + // sort up first repo + action.setRepoGroupId( repoGroup.getId() ); + action.setTargetRepo( REPO1_ID ); + + String result = action.sortUp(); + assertEquals( Action.SUCCESS, result ); + + repoGroup = (RepositoryGroupConfiguration) configuration.getRepositoryGroups().get( 0 ); + repositories = repoGroup.getRepositories(); + assertEquals( 3, repositories.size() ); + assertEquals( REPO1_ID, repositories.get( 0 ) ); + assertEquals( REPO2_ID, repositories.get( 1 ) ); + assertEquals( REPO3_ID, repositories.get( 2 ) ); + } + + private Configuration createInitialConfiguration() + { + Configuration config = new Configuration(); + + RepositoryGroupConfiguration repoGroup = new RepositoryGroupConfiguration(); + repoGroup.setId( REPO_GROUP_ID ); + repoGroup.addRepository( REPO1_ID ); + repoGroup.addRepository( REPO2_ID ); + repoGroup.addRepository( REPO3_ID ); + + config.addRepositoryGroup( repoGroup ); + + return config; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/rss/ArtifactDAOStub.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/rss/ArtifactDAOStub.java new file mode 100644 index 000000000..5a9bae67f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/rss/ArtifactDAOStub.java @@ -0,0 +1,123 @@ +package org.apache.maven.archiva.web.rss; + +/* + * 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.Calendar; +import java.util.Date; +import java.util.List; + +import org.apache.maven.archiva.database.ArchivaDatabaseException; +import org.apache.maven.archiva.database.ArtifactDAO; +import org.apache.maven.archiva.database.Constraint; +import org.apache.maven.archiva.database.ObjectNotFoundException; +import org.apache.maven.archiva.model.ArchivaArtifact; + +/** + * Stub used for RssFeedServlet unit test. + * + * @author Maria Odea Ching + * @version + */ +public class ArtifactDAOStub + implements ArtifactDAO +{ + + public ArchivaArtifact createArtifact( String groupId, String artifactId, String version, String classifier, + String type ) + { + // TODO Auto-generated method stub + return null; + } + + public void deleteArtifact( ArchivaArtifact artifact ) + throws ArchivaDatabaseException + { + // TODO Auto-generated method stub + + } + + public ArchivaArtifact getArtifact( String groupId, String artifactId, String version, String classifier, + String type ) + throws ObjectNotFoundException, ArchivaDatabaseException + { + // TODO Auto-generated method stub + return null; + } + + public List queryArtifacts( Constraint constraint ) + throws ObjectNotFoundException, ArchivaDatabaseException + { + List artifacts = new ArrayList(); + + Date whenGathered = Calendar.getInstance().getTime(); + whenGathered.setTime( 123456789 ); + + ArchivaArtifact artifact = new ArchivaArtifact( "org.apache.archiva", "artifact-one", "1.0", "", "jar" ); + artifact.getModel().setRepositoryId( "test-repo" ); + artifact.getModel().setWhenGathered( whenGathered ); + artifacts.add( artifact ); + + artifact = new ArchivaArtifact( "org.apache.archiva", "artifact-one", "1.1", "", "jar" ); + artifact.getModel().setRepositoryId( "test-repo" ); + artifact.getModel().setWhenGathered( whenGathered ); + artifacts.add( artifact ); + + artifact = new ArchivaArtifact( "org.apache.archiva", "artifact-one", "2.0", "", "jar" ); + artifact.getModel().setRepositoryId( "test-repo" ); + artifact.getModel().setWhenGathered( whenGathered ); + artifacts.add( artifact ); + + artifact = new ArchivaArtifact( "org.apache.archiva", "artifact-two", "1.0.1", "", "jar" ); + artifact.getModel().setRepositoryId( "test-repo" ); + artifact.getModel().setWhenGathered( whenGathered ); + artifacts.add( artifact ); + + artifact = new ArchivaArtifact( "org.apache.archiva", "artifact-two", "1.0.2", "", "jar" ); + artifact.getModel().setRepositoryId( "test-repo" ); + artifact.getModel().setWhenGathered( whenGathered ); + artifacts.add( artifact ); + + artifact = new ArchivaArtifact( "org.apache.archiva", "artifact-two", "1.0.3-SNAPSHOT", "", "jar" ); + artifact.getModel().setRepositoryId( "test-repo" ); + artifact.getModel().setWhenGathered( whenGathered ); + artifacts.add( artifact ); + + artifact = new ArchivaArtifact( "org.apache.archiva", "artifact-three", "2.0-SNAPSHOT", "", "jar" ); + artifact.getModel().setRepositoryId( "test-repo" ); + artifact.getModel().setWhenGathered( whenGathered ); + artifacts.add( artifact ); + + artifact = new ArchivaArtifact( "org.apache.archiva", "artifact-four", "1.1-beta-2", "", "jar" ); + artifact.getModel().setRepositoryId( "test-repo" ); + artifact.getModel().setWhenGathered( whenGathered ); + artifacts.add( artifact ); + + return artifacts; + } + + public ArchivaArtifact saveArtifact( ArchivaArtifact artifact ) + throws ArchivaDatabaseException + { + // TODO Auto-generated method stub + return null; + } + +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/rss/RssFeedServletTest.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/rss/RssFeedServletTest.java new file mode 100644 index 000000000..df208f0b9 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/rss/RssFeedServletTest.java @@ -0,0 +1,200 @@ +package org.apache.maven.archiva.web.rss; + +/* + * 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.IOException; + +import javax.servlet.http.HttpServletResponse; + +import org.apache.commons.codec.Encoder; +import org.apache.commons.codec.binary.Base64; +import org.codehaus.plexus.spring.PlexusInSpringTestCase; + +import sun.misc.BASE64Encoder; + +import com.meterware.httpunit.GetMethodWebRequest; +import com.meterware.httpunit.HttpException; +import com.meterware.httpunit.WebRequest; +import com.meterware.httpunit.WebResponse; +import com.meterware.servletunit.ServletRunner; +import com.meterware.servletunit.ServletUnitClient; + +/** + * + * @author Maria Odea Ching + * @version + */ +public class RssFeedServletTest + extends PlexusInSpringTestCase +{ + private ServletRunner sr; + + private ServletUnitClient client; + + public void setUp() + throws Exception + { + sr = new ServletRunner( getTestFile( "src/test/webapp/WEB-INF/feedServletTest-web.xml" ) ); + client = sr.newClient(); + } + + public void testRetrieveServlet() + throws Exception + { + RssFeedServlet servlet = + (RssFeedServlet) client.newInvocation( "http://localhost/rss/rss_feeds?repoId=test-repo" ).getServlet(); + assertNotNull( servlet ); + } + + public void testRequestNewArtifactsInRepo() + throws Exception + { + RssFeedServlet servlet = + (RssFeedServlet) client.newInvocation( "http://localhost/rss/rss_feeds?repoId=test-repo" ).getServlet(); + assertNotNull( servlet ); + + WebRequest request = new GetMethodWebRequest( "http://localhost/rss/rss_feeds?repoId=test-repo" ); + + BASE64Encoder encoder = new BASE64Encoder(); + String userPass = "user1:password1"; + String encodedUserPass = encoder.encode( userPass.getBytes() ); + request.setHeaderField( "Authorization", "BASIC " + encodedUserPass ); + + WebResponse response = client.getResponse( request ); + assertEquals( RssFeedServlet.MIME_TYPE, response.getHeaderField( "CONTENT-TYPE" ) ); + assertNotNull( "Should have recieved a response", response ); + assertEquals( "Should have been an OK response code.", HttpServletResponse.SC_OK, response.getResponseCode() ); + } + + public void testRequestNewVersionsOfArtifact() + throws Exception + { + RssFeedServlet servlet = + (RssFeedServlet) client.newInvocation( + "http://localhost/rss/rss_feeds?groupId=org.apache.archiva&artifactId=artifact-two" ).getServlet(); + assertNotNull( servlet ); + + WebRequest request = new GetMethodWebRequest( "http://localhost/rss/rss_feeds?groupId=org.apache.archiva&artifactId=artifact-two" ); + + BASE64Encoder encoder = new BASE64Encoder(); + String userPass = "user1:password1"; + String encodedUserPass = encoder.encode( userPass.getBytes() ); + request.setHeaderField( "Authorization", "BASIC " + encodedUserPass ); + + WebResponse response = client.getResponse( request ); + assertEquals( RssFeedServlet.MIME_TYPE, response.getHeaderField( "CONTENT-TYPE" ) ); + assertNotNull( "Should have recieved a response", response ); + assertEquals( "Should have been an OK response code.", HttpServletResponse.SC_OK, response.getResponseCode() ); + } + + public void testInvalidRequest() + throws Exception + { + RssFeedServlet servlet = + (RssFeedServlet) client.newInvocation( + "http://localhost/rss/rss_feeds?invalid_param=xxx" ).getServlet(); + assertNotNull( servlet ); + + try + { + WebResponse response = client.getResponse( "http://localhost/rss/rss_feeds?invalid_param=xxx" ); + } + catch ( HttpException he ) + { + assertEquals( "Should have been a bad request response code.", HttpServletResponse.SC_BAD_REQUEST, he.getResponseCode() ); + } + } + + public void testInvalidAuthenticationRequest() + throws Exception + { + RssFeedServlet servlet = + (RssFeedServlet) client.newInvocation( + "http://localhost/rss/rss_feeds?repoId=unauthorized-repo" ).getServlet(); + assertNotNull( servlet ); + + + WebRequest request = new GetMethodWebRequest( "http://localhost/rss/rss_feeds?repoId=unauthorized-repo" ); + + Encoder encoder = new Base64(); + String userPass = "unauthUser:unauthPass"; + String encodedUserPass = new String( ( byte[] ) encoder.encode( userPass.getBytes() ) ); + request.setHeaderField( "Authorization", "BASIC " + encodedUserPass ); + + try + { + WebResponse response = client.getResponse( request ); + } + catch ( HttpException he ) + { + assertEquals( "Should have been a unauthorized response.", HttpServletResponse.SC_UNAUTHORIZED, he.getResponseCode() ); + } + } + + public void testUnauthorizedRequest() + throws Exception + { + RssFeedServlet servlet = + (RssFeedServlet) client.newInvocation( + "http://localhost/rss/rss_feeds?repoId=unauthorized-repo" ).getServlet(); + assertNotNull( servlet ); + + + WebRequest request = new GetMethodWebRequest( "http://localhost/rss/rss_feeds?repoId=unauthorized-repo" ); + + BASE64Encoder encoder = new BASE64Encoder(); + String userPass = "user1:password1"; + String encodedUserPass = encoder.encode( userPass.getBytes() ); + request.setHeaderField( "Authorization", "BASIC " + encodedUserPass ); + + try + { + WebResponse response = client.getResponse( request ); + } + catch ( HttpException he ) + { + assertEquals( "Should have been a unauthorized response.", HttpServletResponse.SC_UNAUTHORIZED, he.getResponseCode() ); + } + } + + @Override + protected String getPlexusConfigLocation() + { + return "org/apache/maven/archiva/web/rss/RssFeedServletTest.xml"; + } + + @Override + protected void tearDown() + throws Exception + { + if ( client != null ) + { + client.clearContents(); + } + + if ( sr != null ) + { + sr.shutDown(); + } + + super.tearDown(); + } + +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/rss/SecuritySystemStub.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/rss/SecuritySystemStub.java new file mode 100644 index 000000000..96dc95e7b --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/rss/SecuritySystemStub.java @@ -0,0 +1,164 @@ +package org.apache.maven.archiva.web.rss; + +/* + * 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.HashMap; +import java.util.List; +import java.util.Map; + +import org.codehaus.plexus.redback.authentication.AuthenticationDataSource; +import org.codehaus.plexus.redback.authentication.AuthenticationException; +import org.codehaus.plexus.redback.authentication.AuthenticationResult; +import org.codehaus.plexus.redback.authorization.AuthorizationException; +import org.codehaus.plexus.redback.authorization.AuthorizationResult; +import org.codehaus.plexus.redback.keys.KeyManager; +import org.codehaus.plexus.redback.policy.AccountLockedException; +import org.codehaus.plexus.redback.policy.UserSecurityPolicy; +import org.codehaus.plexus.redback.system.DefaultSecuritySession; +import org.codehaus.plexus.redback.system.SecuritySession; +import org.codehaus.plexus.redback.system.SecuritySystem; +import org.codehaus.plexus.redback.users.User; +import org.codehaus.plexus.redback.users.UserManager; +import org.codehaus.plexus.redback.users.UserNotFoundException; +import org.codehaus.plexus.redback.users.jdo.JdoUser; + +/** + * SecuritySystem stub used for testing. + * + * @author Maria Odea Ching + * @version $Id$ + */ +public class SecuritySystemStub + implements SecuritySystem +{ + Map users = new HashMap(); + + List repoIds = new ArrayList(); + + public SecuritySystemStub() + { + users.put( "user1", "password1" ); + users.put( "user2", "password2" ); + users.put( "user3", "password3" ); + + repoIds.add( "test-repo" ); + } + + public SecuritySession authenticate( AuthenticationDataSource source ) + throws AuthenticationException, UserNotFoundException, AccountLockedException + { + AuthenticationResult result = null; + SecuritySession session = null; + + if ( users.get( source.getPrincipal() ) != null ) + { + result = new AuthenticationResult( true, source.getPrincipal(), null ); + + User user = new JdoUser(); + user.setUsername( source.getPrincipal() ); + user.setPassword( users.get( source.getPrincipal() ) ); + + session = new DefaultSecuritySession( result, user ); + } + else + { + result = new AuthenticationResult( false, source.getPrincipal(), null ); + session = new DefaultSecuritySession( result ); + } + return session; + } + + public AuthorizationResult authorize( SecuritySession arg0, Object arg1 ) + throws AuthorizationException + { + return null; + } + + public AuthorizationResult authorize( SecuritySession arg0, Object arg1, Object arg2 ) + throws AuthorizationException + { + AuthorizationResult result = new AuthorizationResult( true, arg1, null); + + return result; + } + + public String getAuthenticatorId() + { + // TODO Auto-generated method stub + return null; + } + + public String getAuthorizerId() + { + // TODO Auto-generated method stub + return null; + } + + public KeyManager getKeyManager() + { + // TODO Auto-generated method stub + return null; + } + + public UserSecurityPolicy getPolicy() + { + // TODO Auto-generated method stub + return null; + } + + public String getUserManagementId() + { + // TODO Auto-generated method stub + return null; + } + + public UserManager getUserManager() + { + // TODO Auto-generated method stub + return null; + } + + public boolean isAuthenticated( AuthenticationDataSource arg0 ) + throws AuthenticationException, UserNotFoundException, AccountLockedException + { + // TODO Auto-generated method stub + return false; + } + + public boolean isAuthorized( SecuritySession arg0, Object arg1 ) + throws AuthorizationException + { + // TODO Auto-generated method stub + return false; + } + + public boolean isAuthorized( SecuritySession arg0, Object arg1, Object arg2 ) + throws AuthorizationException + { + if ( repoIds.contains( arg2 ) ) + { + return true; + } + + return false; + } + +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/rss/UserRepositoriesStub.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/rss/UserRepositoriesStub.java new file mode 100644 index 000000000..6876fa4a5 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/rss/UserRepositoriesStub.java @@ -0,0 +1,63 @@ +package org.apache.maven.archiva.web.rss; + +/* + * 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.List; + +import org.apache.maven.archiva.security.AccessDeniedException; +import org.apache.maven.archiva.security.ArchivaSecurityException; +import org.apache.maven.archiva.security.PrincipalNotFoundException; +import org.apache.maven.archiva.security.UserRepositories; + +/** + * UserRepositories stub used for testing. + * + * @author Maria Odea Ching + * @version $Id$ + */ +public class UserRepositoriesStub + implements UserRepositories +{ + + public void createMissingRepositoryRoles( String repoId ) + throws ArchivaSecurityException + { + // TODO Auto-generated method stub + + } + + public List getObservableRepositoryIds( String principal ) + throws PrincipalNotFoundException, AccessDeniedException, ArchivaSecurityException + { + List repoIds = new ArrayList(); + repoIds.add( "test-repo" ); + + return repoIds; + } + + public boolean isAuthorizedToUploadArtifacts( String principal, String repoId ) + throws PrincipalNotFoundException, ArchivaSecurityException + { + // TODO Auto-generated method stub + return false; + } + +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/startup/BannerTest.java b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/startup/BannerTest.java new file mode 100644 index 000000000..125a3b621 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/startup/BannerTest.java @@ -0,0 +1,90 @@ +package org.apache.maven.archiva.web.startup; + +/* + * 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.io.IOUtils; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.util.zip.GZIPInputStream; + +import junit.framework.TestCase; + +/** + * BannerTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class BannerTest + extends TestCase +{ + private void assertEncodeDecode( String encoded, String decoded ) + { + assertEquals( "Encoding: ", encoded, Banner.encode( decoded ) ); + assertEquals( "Decoding: ", decoded, Banner.decode( encoded ) ); + } + + public void testEncodeDecode() + { + assertEncodeDecode( "[$10 ]", "[ ]" ); + assertEncodeDecode( "$$$5_$n$5_", "$_____\n_____" ); + assertEncodeDecode( "$${Refgjuvyr}", "${Erstwhile}" ); + } + + public void testInjectVersion() + { + assertEquals( "[ 1.0 ]", Banner.injectVersion( "[#####]", "1.0" ) ); + assertEquals( ".\\ 1.0-SNAPSHOT \\._____", Banner.injectVersion( ".\\################\\._____", + "1.0-SNAPSHOT" ) ); + assertEquals( "Archiva:\n ( 1.0-alpha-1 )", Banner + .injectVersion( "Archiva:\n (##############)", "1.0-alpha-1" ) ); + } + + public void testGetBanner() + throws IOException + { + String version = "1.0-alpha-1-SNAPSHOT"; + String banner = Banner.getBanner( version ); + assertNotNull( "Banner should not be null.", banner ); + assertTrue( "Banner contains version.", banner.indexOf( version ) > 0 ); + + /* Want to make a new banner? + * Steps to do it. + * 1) Edit the src/test/resources/banner.gz file. + * 2) Save it compressed. + * 3) Add (to this test method) ... + * System.out.println( "\"" + Banner.encode( getRawBanner() ) + "\"" ); + * 4) Run the test + * 5) Copy / Paste the encoded form into the Banner.getBanner() method. + */ + } + + public String getRawBanner() + throws IOException + { + File gzBanner = new File( "src/test/resources/banner.gz" ); + assertTrue( "File [" + gzBanner.getPath() + "] not found.", gzBanner.exists() ); + FileInputStream fis = new FileInputStream( gzBanner ); + GZIPInputStream gzis = new GZIPInputStream( fis ); + return IOUtils.toString( gzis ); + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/resources/META-INF/plexus/components.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/resources/META-INF/plexus/components.xml new file mode 100644 index 000000000..921c1cca1 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/resources/META-INF/plexus/components.xml @@ -0,0 +1,33 @@ + + + + + + + + org.apache.maven.archiva.webdav.util.MimeTypes + org.apache.maven.archiva.webdav.util.MimeTypes + MimeTypes + + archiva-mime-types.txt + + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/resources/artifact.jar b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/resources/artifact.jar new file mode 100644 index 000000000..e6f67ee94 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/resources/artifact.jar @@ -0,0 +1 @@ +artifact.jar diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/resources/banner.gz b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/resources/banner.gz new file mode 100755 index 000000000..9715c46e7 Binary files /dev/null and b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/resources/banner.gz differ diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/resources/log4j.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/resources/log4j.xml new file mode 100644 index 000000000..a2e7ea23d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/resources/log4j.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/resources/org/apache/maven/archiva/web/action/admin/connectors/proxy/AddProxyConnectorActionTest.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/resources/org/apache/maven/archiva/web/action/admin/connectors/proxy/AddProxyConnectorActionTest.xml new file mode 100644 index 000000000..924f07f7c --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/resources/org/apache/maven/archiva/web/action/admin/connectors/proxy/AddProxyConnectorActionTest.xml @@ -0,0 +1,50 @@ + + + + + + org.codehaus.plexus.logging.LoggerManager + org.codehaus.plexus.logging.slf4j.Slf4jLoggerManager + basic + + + + org.codehaus.plexus.cache.Cache + url-failures-cache + org.codehaus.plexus.cache.ehcache.EhcacheCache + URL Failure Cache + + 600 + false + ${java.io.tmpdir}/archiva/urlcache + false + 1000 + LRU + url-failures-cache + false + + 2700 + + 1800 + + + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/resources/org/apache/maven/archiva/web/action/admin/connectors/proxy/EditProxyConnectorActionTest.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/resources/org/apache/maven/archiva/web/action/admin/connectors/proxy/EditProxyConnectorActionTest.xml new file mode 100644 index 000000000..924f07f7c --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/resources/org/apache/maven/archiva/web/action/admin/connectors/proxy/EditProxyConnectorActionTest.xml @@ -0,0 +1,50 @@ + + + + + + org.codehaus.plexus.logging.LoggerManager + org.codehaus.plexus.logging.slf4j.Slf4jLoggerManager + basic + + + + org.codehaus.plexus.cache.Cache + url-failures-cache + org.codehaus.plexus.cache.ehcache.EhcacheCache + URL Failure Cache + + 600 + false + ${java.io.tmpdir}/archiva/urlcache + false + 1000 + LRU + url-failures-cache + false + + 2700 + + 1800 + + + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/resources/org/apache/maven/archiva/web/action/admin/repositories/AbstractManagedRepositoriesActionTest.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/resources/org/apache/maven/archiva/web/action/admin/repositories/AbstractManagedRepositoriesActionTest.xml new file mode 100644 index 000000000..ba213da8e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/resources/org/apache/maven/archiva/web/action/admin/repositories/AbstractManagedRepositoriesActionTest.xml @@ -0,0 +1,98 @@ + + + + + + org.codehaus.plexus.logging.LoggerManager + org.codehaus.plexus.logging.slf4j.Slf4jLoggerManager + basic + + + + com.opensymphony.xwork.Action + addManagedRepositoryAction + org.apache.maven.archiva.web.action.admin.repositories.AddManagedRepositoryAction + per-lookup + + + + + com.opensymphony.xwork.Action + deleteManagedRepositoryAction + org.apache.maven.archiva.web.action.admin.repositories.DeleteManagedRepositoryAction + per-lookup + + + org.apache.maven.archiva.database.ArchivaDAO + jdo + archivaDAO + + + + + + com.opensymphony.xwork.Action + editManagedRepositoryAction + org.apache.maven.archiva.web.action.admin.repositories.EditManagedRepositoryAction + per-lookup + + + + + + org.apache.maven.archiva.database.ArchivaDAO + jdo + org.apache.maven.archiva.web.action.admin.repositories.AbstractManagedRepositoryArchivaDAOStub + + + org.apache.maven.archiva.database.ArtifactDAO + jdo + artifactDAO + + + org.apache.maven.archiva.database.ProjectModelDAO + jdo + projectModelDAO + + + org.apache.maven.archiva.database.RepositoryContentStatisticsDAO + jdo + repoContentStatisticsDAO + + + + + org.apache.maven.archiva.database.ArtifactDAO + jdo + org.apache.maven.archiva.web.action.admin.repositories.ArtifactDAOStub + + + org.apache.maven.archiva.database.ProjectModelDAO + jdo + org.apache.maven.archiva.web.action.admin.repositories.ProjectModelDAOStub + + + org.apache.maven.archiva.database.RepositoryContentStatisticsDAO + jdo + org.apache.maven.archiva.web.action.admin.repositories.RepositoryContentStatisticsDAOStub + + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/resources/org/apache/maven/archiva/web/action/admin/repositories/DeleteManagedRepositoryActionTest.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/resources/org/apache/maven/archiva/web/action/admin/repositories/DeleteManagedRepositoryActionTest.xml new file mode 100644 index 000000000..43c1eae54 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/resources/org/apache/maven/archiva/web/action/admin/repositories/DeleteManagedRepositoryActionTest.xml @@ -0,0 +1,83 @@ + + + + + + org.codehaus.plexus.logging.LoggerManager + org.codehaus.plexus.logging.slf4j.Slf4jLoggerManager + basic + + + org.codehaus.plexus.redback.role.RoleManager + default + org.apache.maven.archiva.web.action.admin.repositories.RoleManagerStub + + + com.opensymphony.xwork.Action + deleteManagedRepositoryAction + org.apache.maven.archiva.web.action.admin.repositories.DeleteManagedRepositoryAction + per-lookup + + + org.apache.maven.archiva.database.ArchivaDAO + jdo + archivaDAO + + + + + org.apache.maven.archiva.database.ArchivaDAO + jdo + org.apache.maven.archiva.web.action.admin.repositories.DeleteManagedRepositoryArchivaDAOStub + + + org.apache.maven.archiva.database.ArtifactDAO + jdo + artifactDAO + + + org.apache.maven.archiva.database.ProjectModelDAO + jdo + projectModelDAO + + + org.apache.maven.archiva.database.RepositoryContentStatisticsDAO + jdo + repoContentStatisticsDAO + + + + + org.apache.maven.archiva.database.ArtifactDAO + jdo + org.apache.maven.archiva.web.action.admin.repositories.ArtifactDAOStub + + + org.apache.maven.archiva.database.ProjectModelDAO + jdo + org.apache.maven.archiva.web.action.admin.repositories.ProjectModelDAOStub + + + org.apache.maven.archiva.database.RepositoryContentStatisticsDAO + jdo + org.apache.maven.archiva.web.action.admin.repositories.RepositoryContentStatisticsDAOStub + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/resources/org/apache/maven/archiva/web/action/admin/repositories/RepositoriesActionTest.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/resources/org/apache/maven/archiva/web/action/admin/repositories/RepositoriesActionTest.xml new file mode 100644 index 000000000..d6c868254 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/resources/org/apache/maven/archiva/web/action/admin/repositories/RepositoriesActionTest.xml @@ -0,0 +1,57 @@ + + + + + + org.codehaus.plexus.logging.LoggerManager + org.codehaus.plexus.logging.slf4j.Slf4jLoggerManager + basic + + + com.opensymphony.xwork.Action + repositoriesAction + org.apache.maven.archiva.web.action.admin.repositories.RepositoriesAction + per-lookup + Shows the Repositories Tab for the administrator. + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + archivaConfiguration + + + org.apache.maven.archiva.database.ArchivaDAO + stub + dao + + + + + org.apache.maven.archiva.database.ArchivaDAO + stub + org.apache.maven.archiva.web.action.admin.repositories.ArchivaDAOStub + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + configuration + + + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/resources/org/apache/maven/archiva/web/rss/RssFeedServletTest.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/resources/org/apache/maven/archiva/web/rss/RssFeedServletTest.xml new file mode 100644 index 000000000..138ffec62 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/resources/org/apache/maven/archiva/web/rss/RssFeedServletTest.xml @@ -0,0 +1,50 @@ + + + + + + + + org.codehaus.plexus.logging.LoggerManager + org.codehaus.plexus.logging.slf4j.Slf4jLoggerManager + basic + + + + org.apache.maven.archiva.database.ArtifactDAO + jdo + org.apache.maven.archiva.web.rss.ArtifactDAOStub + + + + org.codehaus.plexus.redback.system.SecuritySystem + default + org.apache.maven.archiva.web.rss.SecuritySystemStub + + + + org.apache.maven.archiva.security.UserRepositories + default + org.apache.maven.archiva.web.rss.UserRepositoriesStub + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/webapp/WEB-INF/feedServletTest-web.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/webapp/WEB-INF/feedServletTest-web.xml new file mode 100644 index 000000000..fcdd3503f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/webapp/WEB-INF/feedServletTest-web.xml @@ -0,0 +1,55 @@ + + + + + + Apache Archiva + + + org.springframework.web.context.ContextLoaderListener + + + + RssFeedServlet + org.apache.maven.archiva.web.rss.RssFeedServlet + + + + RssFeedServlet + /rss/* + + + + contextClass + org.codehaus.plexus.spring.PlexusWebApplicationContext + + + + contextConfigLocation + + classpath*:/META-INF/plexus/components.xml + classpath*:/META-INF/spring-context.xml + target/test-classes/org/apache/maven/archiva/web/rss/RssFeedServletTest.xml + + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/webapp/WEB-INF/web.xml b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/webapp/WEB-INF/web.xml new file mode 100644 index 000000000..f47bd657f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webapp/src/test/webapp/WEB-INF/web.xml @@ -0,0 +1,45 @@ + + + + + + Apache Archiva + + + org.springframework.web.context.ContextLoaderListener + + + + contextClass + org.codehaus.plexus.spring.PlexusWebApplicationContext + + + + contextConfigLocation + + classpath*:/META-INF/plexus/components.xml + classpath*:/META-INF/spring-context.xml + target/test-classes/org/apache/maven/archiva/web/repository/RepositoryServletTest.xml + + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/pom.xml b/MRM-541/archiva-modules/archiva-web/archiva-webdav/pom.xml new file mode 100644 index 000000000..99142b078 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/pom.xml @@ -0,0 +1,133 @@ + + + + + 4.0.0 + + org.apache.archiva + archiva-web + 1.2-SNAPSHOT + + + archiva-webdav + Archiva Web :: WebDAV + + + + org.apache.archiva + archiva-configuration + + + org.apache.archiva + archiva-repository-layer + + + org.apache.archiva + archiva-proxy + + + org.apache.archiva + archiva-security + + + org.apache.jackrabbit + jackrabbit-webdav + + + joda-time + joda-time + + + org.springframework + spring-web + + + commons-io + commons-io + + + org.slf4j + slf4j-api + + + javax.servlet + servlet-api + provided + + + org.codehaus.plexus + plexus-spring + + + org.apache.maven + maven-model + + + org.codehaus.plexus.redback + redback-xwork-integration + + + org.codehaus.plexus.redback + redback-keys-memory + test + + + org.codehaus.plexus.redback + redback-rbac-memory + test + + + org.codehaus.plexus.redback + redback-users-memory + test + + + xmlunit + xmlunit + test + + + org.mortbay.jetty + jetty + test + + + org.codehaus.plexus + plexus-slf4j-logging + test + + + org.apache.maven.wagon + wagon-http-lightweight + test + + + + nekohtml + nekohtml + + + nekohtml + xercesMinimal + + + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavLocatorFactory.java b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavLocatorFactory.java new file mode 100644 index 000000000..e2d7fa19a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavLocatorFactory.java @@ -0,0 +1,73 @@ +package org.apache.maven.archiva.webdav; + +/* + * 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.jackrabbit.webdav.DavLocatorFactory; +import org.apache.jackrabbit.webdav.DavResourceLocator; +import org.apache.jackrabbit.util.Text; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang.ArrayUtils; +import org.apache.maven.archiva.webdav.util.RepositoryPathUtil; + +/** + * @author James William Dumay + */ +public class ArchivaDavLocatorFactory + implements DavLocatorFactory +{ + public DavResourceLocator createResourceLocator( String prefix, String href ) + { + // build prefix string and remove all prefixes from the given href. + StringBuilder b = new StringBuilder(); + if ( prefix != null && prefix.length() > 0 ) + { + b.append( prefix ); + if ( !prefix.endsWith( "/" ) ) + { + b.append( '/' ); + } + if ( href.startsWith( prefix ) ) + { + href = href.substring( prefix.length() ); + } + } + + // special treatment for root item, that has no name but '/' path. + if ( href == null || "".equals( href ) ) + { + href = "/"; + } + + final String repository = RepositoryPathUtil.getRepositoryName( href ); + return new ArchivaDavResourceLocator( b.toString(), Text.unescape( href ), repository, this ); + } + + public DavResourceLocator createResourceLocator( String prefix, String workspacePath, String resourcePath ) + { + return createResourceLocator( prefix, workspacePath, resourcePath, true ); + } + + public DavResourceLocator createResourceLocator( String prefix, String workspacePath, String path, + boolean isResourcePath ) + { + final String repository = RepositoryPathUtil.getRepositoryName( path ); + return new ArchivaDavResourceLocator( prefix, path, repository, this ); + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResource.java b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResource.java new file mode 100644 index 000000000..0472b7f68 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResource.java @@ -0,0 +1,626 @@ +package org.apache.maven.archiva.webdav; + +/* + * 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; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import javax.servlet.http.HttpServletResponse; + +import org.apache.commons.io.FileUtils; +import org.apache.commons.io.IOUtils; +import org.apache.jackrabbit.util.Text; +import org.apache.jackrabbit.webdav.DavException; +import org.apache.jackrabbit.webdav.DavResource; +import org.apache.jackrabbit.webdav.DavResourceFactory; +import org.apache.jackrabbit.webdav.DavResourceIterator; +import org.apache.jackrabbit.webdav.DavResourceIteratorImpl; +import org.apache.jackrabbit.webdav.DavResourceLocator; +import org.apache.jackrabbit.webdav.DavServletResponse; +import org.apache.jackrabbit.webdav.DavSession; +import org.apache.jackrabbit.webdav.MultiStatusResponse; +import org.apache.jackrabbit.webdav.io.InputContext; +import org.apache.jackrabbit.webdav.io.OutputContext; +import org.apache.jackrabbit.webdav.lock.ActiveLock; +import org.apache.jackrabbit.webdav.lock.LockInfo; +import org.apache.jackrabbit.webdav.lock.LockManager; +import org.apache.jackrabbit.webdav.lock.Scope; +import org.apache.jackrabbit.webdav.lock.Type; +import org.apache.jackrabbit.webdav.property.DavProperty; +import org.apache.jackrabbit.webdav.property.DavPropertyName; +import org.apache.jackrabbit.webdav.property.DavPropertyNameSet; +import org.apache.jackrabbit.webdav.property.DavPropertySet; +import org.apache.jackrabbit.webdav.property.DefaultDavProperty; +import org.apache.jackrabbit.webdav.property.ResourceType; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.repository.audit.AuditEvent; +import org.apache.maven.archiva.repository.audit.AuditListener; +import org.apache.maven.archiva.repository.scanner.RepositoryContentConsumers; +import org.apache.maven.archiva.security.ArchivaXworkUser; +import org.apache.maven.archiva.webdav.util.IndexWriter; +import org.apache.maven.archiva.webdav.util.MimeTypes; +import org.joda.time.DateTime; +import org.joda.time.format.DateTimeFormatter; +import org.joda.time.format.ISODateTimeFormat; + +import com.opensymphony.xwork.ActionContext; + +/** + * @author James William Dumay Portions from the Apache Jackrabbit Project + */ +public class ArchivaDavResource + implements DavResource +{ + public static final String HIDDEN_PATH_PREFIX = "."; + + private final ArchivaDavResourceLocator locator; + + private final DavResourceFactory factory; + + private final File localResource; + + private final String logicalResource; + + private DavPropertySet properties = null; + + private LockManager lockManager; + + private final DavSession session; + + private String remoteAddr; + + private final ManagedRepositoryConfiguration repository; + + private final RepositoryContentConsumers consumers; + + private final MimeTypes mimeTypes; + + private List auditListeners; + + public ArchivaDavResource( String localResource, String logicalResource, ManagedRepositoryConfiguration repository, + DavSession session, ArchivaDavResourceLocator locator, DavResourceFactory factory, + MimeTypes mimeTypes, List auditListeners, + RepositoryContentConsumers consumers ) + { + this.localResource = new File( localResource ); + this.logicalResource = logicalResource; + this.locator = locator; + this.factory = factory; + this.session = session; + + // TODO: push into locator as well as moving any references out of the resource factory + this.repository = repository; + + // TODO: these should be pushed into the repository layer, along with the physical file operations in this class + this.mimeTypes = mimeTypes; + this.consumers = consumers; + this.auditListeners = auditListeners; + } + + public ArchivaDavResource( String localResource, String logicalResource, ManagedRepositoryConfiguration repository, + String remoteAddr, DavSession session, ArchivaDavResourceLocator locator, + DavResourceFactory factory, MimeTypes mimeTypes, List auditListeners, + RepositoryContentConsumers consumers ) + { + this( localResource, logicalResource, repository, session, locator, factory, mimeTypes, auditListeners, + consumers ); + + this.remoteAddr = remoteAddr; + } + + public String getComplianceClass() + { + return COMPLIANCE_CLASS; + } + + public String getSupportedMethods() + { + return METHODS; + } + + public boolean exists() + { + return localResource.exists(); + } + + public boolean isCollection() + { + return localResource.isDirectory(); + } + + public String getDisplayName() + { + String resPath = getResourcePath(); + return ( resPath != null ) ? Text.getName( resPath ) : resPath; + } + + public DavResourceLocator getLocator() + { + return locator; + } + + public File getLocalResource() + { + return localResource; + } + + public String getResourcePath() + { + return locator.getResourcePath(); + } + + public String getHref() + { + return locator.getHref( isCollection() ); + } + + public long getModificationTime() + { + return localResource.lastModified(); + } + + public void spool( OutputContext outputContext ) + throws IOException + { + if ( !isCollection()) + { + outputContext.setContentLength( localResource.length() ); + outputContext.setContentType( mimeTypes.getMimeType( localResource.getName() ) ); + } + + if ( !isCollection() && outputContext.hasStream() ) + { + FileInputStream is = null; + try + { + // Write content to stream + is = new FileInputStream( localResource ); + IOUtils.copy( is, outputContext.getOutputStream() ); + } + finally + { + IOUtils.closeQuietly( is ); + } + } + else if (outputContext.hasStream()) + { + IndexWriter writer = new IndexWriter( this, localResource, logicalResource ); + writer.write( outputContext ); + } + } + + public DavPropertyName[] getPropertyNames() + { + return getProperties().getPropertyNames(); + } + + public DavProperty getProperty( DavPropertyName name ) + { + return getProperties().get( name ); + } + + public DavPropertySet getProperties() + { + return initProperties(); + } + + public void setProperty( DavProperty property ) + throws DavException + { + } + + public void removeProperty( DavPropertyName propertyName ) + throws DavException + { + } + + public MultiStatusResponse alterProperties( DavPropertySet setProperties, DavPropertyNameSet removePropertyNames ) + throws DavException + { + return null; + } + + @SuppressWarnings("unchecked") + public MultiStatusResponse alterProperties( List changeList ) + throws DavException + { + return null; + } + + public DavResource getCollection() + { + DavResource parent = null; + if ( getResourcePath() != null && !getResourcePath().equals( "/" ) ) + { + String parentPath = Text.getRelativeParent( getResourcePath(), 1 ); + if ( parentPath.equals( "" ) ) + { + parentPath = "/"; + } + DavResourceLocator parentloc = locator.getFactory().createResourceLocator( locator.getPrefix(), parentPath ); + try + { + parent = factory.createResource( parentloc, session ); + } + catch ( DavException e ) + { + // should not occur + } + } + return parent; + } + + public void addMember( DavResource resource, InputContext inputContext ) + throws DavException + { + File localFile = new File( localResource, resource.getDisplayName() ); + boolean exists = localFile.exists(); + + if ( isCollection() && inputContext.hasStream() ) // New File + { + FileOutputStream stream = null; + try + { + stream = new FileOutputStream( localFile ); + IOUtils.copy( inputContext.getInputStream(), stream ); + } + catch ( IOException e ) + { + throw new DavException( HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e ); + } + finally + { + IOUtils.closeQuietly( stream ); + } + + if ( inputContext.getContentLength() != localFile.length() ) + { + FileUtils.deleteQuietly( localFile ); + + throw new DavException( HttpServletResponse.SC_BAD_REQUEST, "Content Header length was " + + inputContext.getContentLength() + " but was " + localFile.length() ); + } + + // Just-in-time update of the index and database by executing the consumers for this artifact + consumers.executeConsumers( repository, localFile ); + + triggerAuditEvent( resource, exists ? AuditEvent.MODIFY_FILE : AuditEvent.CREATE_FILE ); + } + else if ( !inputContext.hasStream() && isCollection() ) // New directory + { + localFile.mkdir(); + + triggerAuditEvent( resource, AuditEvent.CREATE_DIR ); + } + else + { + throw new DavException( HttpServletResponse.SC_BAD_REQUEST, "Could not write member " + + resource.getResourcePath() + " at " + getResourcePath() ); + } + } + + public DavResourceIterator getMembers() + { + List list = new ArrayList(); + if ( exists() && isCollection() ) + { + for ( String item : localResource.list() ) + { + try + { + if ( !item.startsWith( HIDDEN_PATH_PREFIX ) ) + { + String path = locator.getResourcePath() + '/' + item; + DavResourceLocator resourceLocator = + locator.getFactory().createResourceLocator( locator.getPrefix(), path ); + DavResource resource = factory.createResource( resourceLocator, session ); + if ( resource != null ) + { + list.add( resource ); + } + } + } + catch ( DavException e ) + { + // Should not occur + } + } + } + return new DavResourceIteratorImpl( list ); + } + + public void removeMember( DavResource member ) + throws DavException + { + File resource = checkDavResourceIsArchivaDavResource( member ).getLocalResource(); + + if ( resource.exists() ) + { + try + { + if ( resource.isDirectory() ) + { + FileUtils.deleteDirectory( resource ); + + triggerAuditEvent( member, AuditEvent.REMOVE_DIR ); + } + else + { + if ( !resource.delete() ) + { + throw new IOException( "Could not remove file" ); + } + + triggerAuditEvent( member, AuditEvent.REMOVE_FILE ); + } + } + catch ( IOException e ) + { + throw new DavException( HttpServletResponse.SC_INTERNAL_SERVER_ERROR ); + } + } + else + { + throw new DavException( HttpServletResponse.SC_NOT_FOUND ); + } + } + + private void triggerAuditEvent( DavResource member, String event ) throws DavException + { + String path = logicalResource + "/" + member.getDisplayName(); + + triggerAuditEvent( checkDavResourceIsArchivaDavResource( member ).remoteAddr, locator.getRepositoryId(), path, + event ); + } + + public void move( DavResource destination ) + throws DavException + { + if ( !exists() ) + { + throw new DavException( HttpServletResponse.SC_NOT_FOUND, "Resource to copy does not exist." ); + } + + try + { + ArchivaDavResource resource = checkDavResourceIsArchivaDavResource( destination ); + if ( isCollection() ) + { + FileUtils.moveDirectory( getLocalResource(), resource.getLocalResource() ); + + triggerAuditEvent( remoteAddr, locator.getRepositoryId(), logicalResource, AuditEvent.MOVE_DIRECTORY ); + } + else + { + FileUtils.moveFile( getLocalResource(), resource.getLocalResource() ); + + triggerAuditEvent( remoteAddr, locator.getRepositoryId(), logicalResource, AuditEvent.MOVE_FILE ); + } + } + catch ( IOException e ) + { + throw new DavException( HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e ); + } + } + + public void copy( DavResource destination, boolean shallow ) + throws DavException + { + if ( !exists() ) + { + throw new DavException( HttpServletResponse.SC_NOT_FOUND, "Resource to copy does not exist." ); + } + + if ( shallow && isCollection() ) + { + throw new DavException( DavServletResponse.SC_FORBIDDEN, "Unable to perform shallow copy for collection" ); + } + + try + { + ArchivaDavResource resource = checkDavResourceIsArchivaDavResource( destination ); + if ( isCollection() ) + { + FileUtils.copyDirectory( getLocalResource(), resource.getLocalResource() ); + + triggerAuditEvent( remoteAddr, locator.getRepositoryId(), logicalResource, AuditEvent.COPY_DIRECTORY ); + } + else + { + FileUtils.copyFile( getLocalResource(), resource.getLocalResource() ); + + triggerAuditEvent( remoteAddr, locator.getRepositoryId(), logicalResource, AuditEvent.COPY_FILE ); + } + } + catch ( IOException e ) + { + throw new DavException( HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e ); + } + } + + public boolean isLockable( Type type, Scope scope ) + { + return Type.WRITE.equals(type) && Scope.EXCLUSIVE.equals(scope); + } + + public boolean hasLock( Type type, Scope scope ) + { + return getLock(type, scope) != null; + } + + public ActiveLock getLock( Type type, Scope scope ) + { + ActiveLock lock = null; + if (exists() && Type.WRITE.equals(type) && Scope.EXCLUSIVE.equals(scope)) + { + lock = lockManager.getLock(type, scope, this); + } + return lock; + } + + public ActiveLock[] getLocks() + { + ActiveLock writeLock = getLock(Type.WRITE, Scope.EXCLUSIVE); + return (writeLock != null) ? new ActiveLock[]{writeLock} : new ActiveLock[0]; + } + + public ActiveLock lock( LockInfo lockInfo ) + throws DavException + { + ActiveLock lock = null; + if (isLockable(lockInfo.getType(), lockInfo.getScope())) + { + lock = lockManager.createLock(lockInfo, this); + } + else + { + throw new DavException(DavServletResponse.SC_PRECONDITION_FAILED, "Unsupported lock type or scope."); + } + return lock; + } + + public ActiveLock refreshLock( LockInfo lockInfo, String lockToken ) + throws DavException + { + if (!exists()) { + throw new DavException(DavServletResponse.SC_NOT_FOUND); + } + ActiveLock lock = getLock(lockInfo.getType(), lockInfo.getScope()); + if (lock == null) { + throw new DavException(DavServletResponse.SC_PRECONDITION_FAILED, "No lock with the given type/scope present on resource " + getResourcePath()); + } + + lock = lockManager.refreshLock(lockInfo, lockToken, this); + + return lock; + } + + public void unlock( String lockToken ) + throws DavException + { + ActiveLock lock = getLock(Type.WRITE, Scope.EXCLUSIVE); + if (lock == null) + { + throw new DavException(HttpServletResponse.SC_PRECONDITION_FAILED); + } + else if (lock.isLockedByToken(lockToken)) + { + lockManager.releaseLock(lockToken, this); + } + else + { + throw new DavException(DavServletResponse.SC_LOCKED); + } + } + + public void addLockManager( LockManager lockManager ) + { + this.lockManager = lockManager; + } + + public DavResourceFactory getFactory() + { + return factory; + } + + public DavSession getSession() + { + return session; + } + + /** + * Fill the set of properties + */ + protected DavPropertySet initProperties() + { + if ( !exists() ) + { + properties = new DavPropertySet(); + } + + if ( properties != null ) + { + return properties; + } + + DavPropertySet properties = new DavPropertySet(); + + // set (or reset) fundamental properties + if ( getDisplayName() != null ) + { + properties.add( new DefaultDavProperty( DavPropertyName.DISPLAYNAME, getDisplayName() ) ); + } + if ( isCollection() ) + { + properties.add( new ResourceType( ResourceType.COLLECTION ) ); + // Windows XP support + properties.add( new DefaultDavProperty( DavPropertyName.ISCOLLECTION, "1" ) ); + } + else + { + properties.add( new ResourceType( ResourceType.DEFAULT_RESOURCE ) ); + + // Windows XP support + properties.add( new DefaultDavProperty( DavPropertyName.ISCOLLECTION, "0" ) ); + } + + // Need to get the ISO8601 date for properties + DateTime dt = new DateTime( localResource.lastModified() ); + DateTimeFormatter fmt = ISODateTimeFormat.dateTime(); + String modifiedDate = fmt.print( dt ); + + properties.add( new DefaultDavProperty( DavPropertyName.GETLASTMODIFIED, modifiedDate ) ); + + properties.add( new DefaultDavProperty( DavPropertyName.CREATIONDATE, modifiedDate ) ); + + properties.add( new DefaultDavProperty( DavPropertyName.GETCONTENTLENGTH, localResource.length() ) ); + + this.properties = properties; + + return properties; + } + + private ArchivaDavResource checkDavResourceIsArchivaDavResource( DavResource resource ) + throws DavException + { + if ( !( resource instanceof ArchivaDavResource ) ) + { + throw new DavException( HttpServletResponse.SC_INTERNAL_SERVER_ERROR, + "DavResource is not instance of ArchivaDavResource" ); + } + return (ArchivaDavResource) resource; + } + + private void triggerAuditEvent( String remoteIP, String repositoryId, String resource, String action ) + { + String activePrincipal = ArchivaXworkUser.getActivePrincipal( ActionContext.getContext().getSession() ); + AuditEvent event = new AuditEvent( repositoryId, activePrincipal, resource, action ); + event.setRemoteIP( remoteIP ); + + for ( AuditListener listener : auditListeners ) + { + listener.auditEvent( event ); + } + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactory.java b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactory.java new file mode 100644 index 000000000..da69aa7bc --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactory.java @@ -0,0 +1,956 @@ +package org.apache.maven.archiva.webdav; + +/* + * 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; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.servlet.http.HttpServletResponse; + +import org.apache.commons.io.FileUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.jackrabbit.webdav.DavException; +import org.apache.jackrabbit.webdav.DavResource; +import org.apache.jackrabbit.webdav.DavResourceFactory; +import org.apache.jackrabbit.webdav.DavResourceLocator; +import org.apache.jackrabbit.webdav.DavServletRequest; +import org.apache.jackrabbit.webdav.DavServletResponse; +import org.apache.jackrabbit.webdav.DavSession; +import org.apache.jackrabbit.webdav.lock.LockManager; +import org.apache.jackrabbit.webdav.lock.SimpleLockManager; +import org.apache.maven.archiva.common.utils.PathUtil; +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.maven.archiva.model.ProjectReference; +import org.apache.maven.archiva.model.VersionedReference; +import org.apache.maven.archiva.policies.ProxyDownloadException; +import org.apache.maven.archiva.proxy.RepositoryProxyConnectors; +import org.apache.maven.archiva.repository.ManagedRepositoryContent; +import org.apache.maven.archiva.repository.RepositoryContentFactory; +import org.apache.maven.archiva.repository.RepositoryException; +import org.apache.maven.archiva.repository.RepositoryNotFoundException; +import org.apache.maven.archiva.repository.audit.AuditEvent; +import org.apache.maven.archiva.repository.audit.AuditListener; +import org.apache.maven.archiva.repository.audit.Auditable; +import org.apache.maven.archiva.repository.content.RepositoryRequest; +import org.apache.maven.archiva.repository.layout.LayoutException; +import org.apache.maven.archiva.repository.metadata.MetadataTools; +import org.apache.maven.archiva.repository.metadata.RepositoryMetadataException; +import org.apache.maven.archiva.repository.metadata.RepositoryMetadataMerge; +import org.apache.maven.archiva.repository.metadata.RepositoryMetadataReader; +import org.apache.maven.archiva.repository.metadata.RepositoryMetadataWriter; +import org.apache.maven.archiva.repository.scanner.RepositoryContentConsumers; +import org.apache.maven.archiva.security.ArchivaXworkUser; +import org.apache.maven.archiva.security.ServletAuthenticator; +import org.apache.maven.archiva.webdav.util.MimeTypes; +import org.apache.maven.archiva.webdav.util.RepositoryPathUtil; +import org.apache.maven.archiva.webdav.util.WebdavMethodUtil; +import org.apache.maven.model.DistributionManagement; +import org.apache.maven.model.Model; +import org.apache.maven.model.Relocation; +import org.apache.maven.model.io.xpp3.MavenXpp3Reader; +import org.codehaus.plexus.digest.ChecksumFile; +import org.codehaus.plexus.digest.Digester; +import org.codehaus.plexus.digest.DigesterException; +import org.codehaus.plexus.redback.authentication.AuthenticationException; +import org.codehaus.plexus.redback.authentication.AuthenticationResult; +import org.codehaus.plexus.redback.authorization.AuthorizationException; +import org.codehaus.plexus.redback.authorization.UnauthorizedException; +import org.codehaus.plexus.redback.policy.AccountLockedException; +import org.codehaus.plexus.redback.policy.MustChangePasswordException; +import org.codehaus.plexus.redback.system.SecuritySession; +import org.codehaus.plexus.redback.system.SecuritySystemConstants; +import org.codehaus.plexus.redback.xwork.filter.authentication.HttpAuthenticator; +import org.codehaus.plexus.util.xml.pull.XmlPullParserException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.opensymphony.xwork.ActionContext; + +/** + * @author James William Dumay + * @plexus.component role="org.apache.maven.archiva.webdav.ArchivaDavResourceFactory" + */ +public class ArchivaDavResourceFactory + implements DavResourceFactory, Auditable +{ + private static final String PROXIED_SUFFIX = " (proxied)"; + + private static final String HTTP_PUT_METHOD = "PUT"; + + private Logger log = LoggerFactory.getLogger( ArchivaDavResourceFactory.class ); + + /** + * @plexus.requirement role="org.apache.maven.archiva.repository.audit.AuditListener" + */ + private List auditListeners = new ArrayList(); + + /** + * @plexus.requirement + */ + private RepositoryContentFactory repositoryFactory; + + /** + * @plexus.requirement + */ + private RepositoryRequest repositoryRequest; + + /** + * @plexus.requirement role-hint="default" + */ + private RepositoryProxyConnectors connectors; + + /** + * @plexus.requirement + */ + private MetadataTools metadataTools; + + /** + * @plexus.requirement + */ + private MimeTypes mimeTypes; + + /** + * @plexus.requirement + */ + private ArchivaConfiguration archivaConfiguration; + + /** + * @plexus.requirement + */ + private ServletAuthenticator servletAuth; + + /** + * @plexus.requirement role-hint="basic" + */ + private HttpAuthenticator httpAuth; + + /** + * Lock Manager - use simple implementation from JackRabbit + */ + private final LockManager lockManager = new SimpleLockManager(); + + /** + * @plexus.requirement + */ + private RepositoryContentConsumers consumers; + + /** + * @plexus.requirement + */ + private ChecksumFile checksum; + + /** + * @plexus.requirement role-hint="sha1" + */ + private Digester digestSha1; + + /** + * @plexus.requirement role-hint="md5"; + */ + private Digester digestMd5; + + public DavResource createResource( final DavResourceLocator locator, final DavServletRequest request, + final DavServletResponse response ) + throws DavException + { + checkLocatorIsInstanceOfRepositoryLocator( locator ); + ArchivaDavResourceLocator archivaLocator = (ArchivaDavResourceLocator) locator; + + RepositoryGroupConfiguration repoGroupConfig = + archivaConfiguration.getConfiguration().getRepositoryGroupsAsMap().get( archivaLocator.getRepositoryId() ); + List repositories = new ArrayList(); + + boolean isGet = WebdavMethodUtil.isReadMethod( request.getMethod() ); + boolean isPut = WebdavMethodUtil.isWriteMethod( request.getMethod() ); + + if ( repoGroupConfig != null ) + { + if( WebdavMethodUtil.isWriteMethod( request.getMethod() ) ) + { + throw new DavException( HttpServletResponse.SC_METHOD_NOT_ALLOWED, + "Write method not allowed for repository groups." ); + } + repositories.addAll( repoGroupConfig.getRepositories() ); + + // handle browse requests for virtual repos + if ( RepositoryPathUtil.getLogicalResource( locator.getResourcePath() ).endsWith( "/" ) ) + { + return getResource( request, repositories, archivaLocator ); + } + } + else + { + repositories.add( archivaLocator.getRepositoryId() ); + } + + //MRM-419 - Windows Webdav support. Should not 404 if there is no content. + if (StringUtils.isEmpty(archivaLocator.getRepositoryId())) + { + throw new DavException(HttpServletResponse.SC_NO_CONTENT); + } + + List availableResources = new ArrayList(); + List resourcesInAbsolutePath = new ArrayList(); + DavException e = null; + + for ( String repositoryId : repositories ) + { + ManagedRepositoryContent managedRepository = null; + + try + { + managedRepository = getManagedRepository( repositoryId ); + } + catch ( DavException de ) + { + throw new DavException( HttpServletResponse.SC_NOT_FOUND, "Invalid managed repository <" + + repositoryId + ">" ); + } + + DavResource resource = null; + + if ( !locator.getResourcePath().startsWith( ArchivaDavResource.HIDDEN_PATH_PREFIX ) ) + { + if ( managedRepository != null ) + { + try + { + if( isAuthorized( request, repositoryId ) ) + { + LogicalResource logicalResource = + new LogicalResource( RepositoryPathUtil.getLogicalResource( locator.getResourcePath() ) ); + + if ( isGet ) + { + resource = doGet( managedRepository, request, archivaLocator, logicalResource ); + } + + if ( isPut ) + { + resource = doPut( managedRepository, request, archivaLocator, logicalResource ); + } + } + } + catch ( DavException de ) + { + e = de; + continue; + } + + if( resource == null ) + { + e = new DavException( HttpServletResponse.SC_NOT_FOUND, "Resource does not exist" ); + } + else + { + availableResources.add( resource ); + + String logicalResource = RepositoryPathUtil.getLogicalResource( locator.getResourcePath() ); + resourcesInAbsolutePath.add( managedRepository.getRepoRoot() + logicalResource ); + } + } + else + { + e = new DavException( HttpServletResponse.SC_NOT_FOUND, "Repository does not exist" ); + } + } + } + + if ( availableResources.isEmpty() ) + { + throw e; + } + + String requestedResource = request.getRequestURI(); + + // MRM-872 : merge all available metadata + // merge metadata only when requested via the repo group + if ( ( repositoryRequest.isMetadata( requestedResource ) || ( requestedResource.endsWith( "metadata.xml.sha1" ) || requestedResource.endsWith( "metadata.xml.md5" ) ) ) && + repoGroupConfig != null ) + { + // this should only be at the project level not version level! + if( isProjectReference( requestedResource ) ) + { + String artifactId = StringUtils.substringBeforeLast( requestedResource.replace( '\\', '/' ), "/" ); + artifactId = StringUtils.substringAfterLast( artifactId, "/" ); + + ArchivaDavResource res = ( ArchivaDavResource ) availableResources.get( 0 ); + String filePath = StringUtils.substringBeforeLast( res.getLocalResource().getAbsolutePath().replace( '\\', '/' ), "/" ); + filePath = filePath + "/maven-metadata-" + repoGroupConfig.getId() + ".xml"; + + // for MRM-872 handle checksums of the merged metadata files + if( repositoryRequest.isSupportFile( requestedResource ) ) + { + File metadataChecksum = new File( filePath + "." + + StringUtils.substringAfterLast( requestedResource, "." ) ); + if( metadataChecksum.exists() ) + { + LogicalResource logicalResource = + new LogicalResource( RepositoryPathUtil.getLogicalResource( locator.getResourcePath() ) ); + + ArchivaDavResource metadataChecksumResource = + new ArchivaDavResource( metadataChecksum.getAbsolutePath(), logicalResource.getPath(), null, + request.getRemoteAddr(), request.getDavSession(), archivaLocator, this, + mimeTypes, auditListeners, consumers ); + availableResources.add( 0, metadataChecksumResource ); + } + } + else + { // merge the metadata of all repos under group + ArchivaRepositoryMetadata mergedMetadata = new ArchivaRepositoryMetadata(); + for ( String resourceAbsPath : resourcesInAbsolutePath ) + { + try + { + File metadataFile = new File( resourceAbsPath ); + ArchivaRepositoryMetadata repoMetadata = RepositoryMetadataReader.read( metadataFile ); + mergedMetadata = RepositoryMetadataMerge.merge( mergedMetadata, repoMetadata ); + } + catch ( RepositoryMetadataException r ) + { + throw new DavException( HttpServletResponse.SC_INTERNAL_SERVER_ERROR, + "Error occurred while reading metadata file." ); + } + } + + try + { + File resourceFile = writeMergedMetadataToFile( mergedMetadata, filePath ); + + LogicalResource logicalResource = + new LogicalResource( RepositoryPathUtil.getLogicalResource( locator.getResourcePath() ) ); + + ArchivaDavResource metadataResource = + new ArchivaDavResource( resourceFile.getAbsolutePath(), logicalResource.getPath(), null, + request.getRemoteAddr(), request.getDavSession(), archivaLocator, this, + mimeTypes, auditListeners, consumers ); + availableResources.add( 0, metadataResource ); + } + catch ( RepositoryMetadataException r ) + { + throw new DavException( HttpServletResponse.SC_INTERNAL_SERVER_ERROR, + "Error occurred while writing metadata file." ); + } + catch ( IOException ie ) + { + throw new DavException( HttpServletResponse.SC_INTERNAL_SERVER_ERROR, + "Error occurred while generating checksum files." ); + } + catch ( DigesterException de ) + { + throw new DavException( HttpServletResponse.SC_INTERNAL_SERVER_ERROR, + "Error occurred while generating checksum files." ); + } + } + } + } + + DavResource resource = availableResources.get( 0 ); + setHeaders(response, locator, resource ); + + // compatibility with MRM-440 to ensure browsing the repository works ok + if ( resource.isCollection() && !request.getRequestURI().endsWith("/" ) ) + { + throw new BrowserRedirectException( resource.getHref() ); + } + resource.addLockManager(lockManager); + return resource; + } + + public DavResource createResource( final DavResourceLocator locator, final DavSession davSession ) + throws DavException + { + checkLocatorIsInstanceOfRepositoryLocator( locator ); + ArchivaDavResourceLocator archivaLocator = (ArchivaDavResourceLocator) locator; + + DavResource resource = null; + if ( !locator.getResourcePath().startsWith( ArchivaDavResource.HIDDEN_PATH_PREFIX ) ) + { + ManagedRepositoryContent managedRepository = getManagedRepository( archivaLocator.getRepositoryId() ); + String logicalResource = RepositoryPathUtil.getLogicalResource( locator.getResourcePath() ); + File resourceFile = new File( managedRepository.getRepoRoot(), logicalResource ); + resource = + new ArchivaDavResource( resourceFile.getAbsolutePath(), logicalResource, + managedRepository.getRepository(), davSession, archivaLocator, this, mimeTypes, + auditListeners, consumers ); + } + resource.addLockManager(lockManager); + return resource; + } + + private DavResource doGet( ManagedRepositoryContent managedRepository, DavServletRequest request, + ArchivaDavResourceLocator locator, LogicalResource logicalResource ) + throws DavException + { + File resourceFile = new File( managedRepository.getRepoRoot(), logicalResource.getPath() ); + + //MRM-893, dont send back a file when user intentionally wants a directory + if ( locator.getHref( false ).endsWith( "/" ) ) + { + if ( ! resourceFile.isDirectory() ) + { + //force a resource not found + return null; + } + } + + ArchivaDavResource resource = + new ArchivaDavResource( resourceFile.getAbsolutePath(), logicalResource.getPath(), + managedRepository.getRepository(), request.getRemoteAddr(), + request.getDavSession(), locator, this, mimeTypes, auditListeners, consumers ); + + if ( !resource.isCollection() ) + { + boolean previouslyExisted = resourceFile.exists(); + + // At this point the incoming request can either be in default or + // legacy layout format. + boolean fromProxy = fetchContentFromProxies( managedRepository, request, logicalResource ); + + try + { + // Perform an adjustment of the resource to the managed + // repository expected path. + String localResourcePath = + repositoryRequest.toNativePath( logicalResource.getPath(), managedRepository ); + resourceFile = new File( managedRepository.getRepoRoot(), localResourcePath ); + } + catch ( LayoutException e ) + { + if ( previouslyExisted ) + { + return resource; + } + throw new DavException( HttpServletResponse.SC_NOT_FOUND, e ); + } + + // Attempt to fetch the resource from any defined proxy. + if ( fromProxy ) + { + String repositoryId = locator.getRepositoryId(); + String event = ( previouslyExisted ? AuditEvent.MODIFY_FILE : AuditEvent.CREATE_FILE ) + PROXIED_SUFFIX; + triggerAuditEvent( request.getRemoteAddr(), repositoryId, logicalResource.getPath(), event ); + } + + if ( !resourceFile.exists() ) + { + resource = null; + } + else + { + resource = + new ArchivaDavResource( resourceFile.getAbsolutePath(), logicalResource.getPath(), + managedRepository.getRepository(), request.getRemoteAddr(), + request.getDavSession(), locator, this, mimeTypes, auditListeners, + consumers ); + } + } + return resource; + } + + private DavResource doPut( ManagedRepositoryContent managedRepository, DavServletRequest request, + ArchivaDavResourceLocator locator, LogicalResource logicalResource ) + throws DavException + { + /* + * Create parent directories that don't exist when writing a file This actually makes this implementation not + * compliant to the WebDAV RFC - but we have enough knowledge about how the collection is being used to do this + * reasonably and some versions of Maven's WebDAV don't correctly create the collections themselves. + */ + + File rootDirectory = new File( managedRepository.getRepoRoot() ); + File destDir = new File( rootDirectory, logicalResource.getPath() ).getParentFile(); + if ( request.getMethod().equals(HTTP_PUT_METHOD) && !destDir.exists() ) + { + destDir.mkdirs(); + String relPath = PathUtil.getRelative( rootDirectory.getAbsolutePath(), destDir ); + triggerAuditEvent( request.getRemoteAddr(), logicalResource.getPath(), relPath, AuditEvent.CREATE_DIR ); + } + + File resourceFile = new File( managedRepository.getRepoRoot(), logicalResource.getPath() ); + + return new ArchivaDavResource( resourceFile.getAbsolutePath(), logicalResource.getPath(), + managedRepository.getRepository(), request.getRemoteAddr(), + request.getDavSession(), locator, this, mimeTypes, auditListeners, consumers ); + } + + private boolean fetchContentFromProxies( ManagedRepositoryContent managedRepository, DavServletRequest request, + LogicalResource resource ) + throws DavException + { + if ( repositoryRequest.isSupportFile( resource.getPath() ) ) + { + File proxiedFile = connectors.fetchFromProxies( managedRepository, resource.getPath() ); + + return ( proxiedFile != null ); + } + + // Is it a Metadata resource? + if ( repositoryRequest.isDefault( resource.getPath() ) && repositoryRequest.isMetadata( resource.getPath() ) ) + { + return connectors.fetchMetatadaFromProxies(managedRepository, resource.getPath()) != null; + } + + // Not any of the above? Then it's gotta be an artifact reference. + try + { + // Get the artifact reference in a layout neutral way. + ArtifactReference artifact = repositoryRequest.toArtifactReference( resource.getPath() ); + + if ( artifact != null ) + { + applyServerSideRelocation( managedRepository, artifact ); + + File proxiedFile = connectors.fetchFromProxies( managedRepository, artifact ); + + resource.setPath( managedRepository.toPath( artifact ) ); + + return ( proxiedFile != null ); + } + } + catch ( LayoutException e ) + { + /* eat it */ + } + catch ( ProxyDownloadException e ) + { + log.error( e.getMessage(), e ); + throw new DavException( HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Unable to fetch artifact resource." ); + } + return false; + } + + /** + * A relocation capable client will request the POM prior to the artifact, and will then read meta-data and do + * client side relocation. A simplier client (like maven 1) will only request the artifact and not use the + * metadatas. + *

    + * For such clients, archiva does server-side relocation by reading itself the <relocation> element in + * metadatas and serving the expected artifact. + */ + protected void applyServerSideRelocation( ManagedRepositoryContent managedRepository, ArtifactReference artifact ) + throws ProxyDownloadException + { + if ( "pom".equals( artifact.getType() ) ) + { + return; + } + + // Build the artifact POM reference + ArtifactReference pomReference = new ArtifactReference(); + pomReference.setGroupId( artifact.getGroupId() ); + pomReference.setArtifactId( artifact.getArtifactId() ); + pomReference.setVersion( artifact.getVersion() ); + pomReference.setType( "pom" ); + + // Get the artifact POM from proxied repositories if needed + connectors.fetchFromProxies( managedRepository, pomReference ); + + // Open and read the POM from the managed repo + File pom = managedRepository.toFile( pomReference ); + + if ( !pom.exists() ) + { + return; + } + + try + { + Model model = new MavenXpp3Reader().read( new FileReader( pom ) ); + DistributionManagement dist = model.getDistributionManagement(); + if ( dist != null ) + { + Relocation relocation = dist.getRelocation(); + if ( relocation != null ) + { + // artifact is relocated : update the repositoryPath + if ( relocation.getGroupId() != null ) + { + artifact.setGroupId( relocation.getGroupId() ); + } + if ( relocation.getArtifactId() != null ) + { + artifact.setArtifactId( relocation.getArtifactId() ); + } + if ( relocation.getVersion() != null ) + { + artifact.setVersion( relocation.getVersion() ); + } + } + } + } + catch ( FileNotFoundException e ) + { + // Artifact has no POM in repo : ignore + } + catch ( IOException e ) + { + // Unable to read POM : ignore. + } + catch ( XmlPullParserException e ) + { + // Invalid POM : ignore + } + } + + // TODO: remove? + private void triggerAuditEvent( String remoteIP, String repositoryId, String resource, String action ) + { + String activePrincipal = ArchivaXworkUser.getActivePrincipal( ActionContext.getContext().getSession() ); + AuditEvent event = new AuditEvent( repositoryId, activePrincipal, resource, action ); + event.setRemoteIP( remoteIP ); + + for ( AuditListener listener : auditListeners ) + { + listener.auditEvent( event ); + } + } + + public void addAuditListener( AuditListener listener ) + { + this.auditListeners.add( listener ); + } + + public void clearAuditListeners() + { + this.auditListeners.clear(); + } + + public void removeAuditListener( AuditListener listener ) + { + this.auditListeners.remove( listener ); + } + + private void setHeaders( DavServletResponse response, DavResourceLocator locator, DavResource resource ) + { + // [MRM-503] - Metadata file need Pragma:no-cache response + // header. + if ( locator.getResourcePath().endsWith( "/maven-metadata.xml" ) ) + { + response.addHeader( "Pragma", "no-cache" ); + response.addHeader( "Cache-Control", "no-cache" ); + } + + //We need to specify this so connecting wagons can work correctly + response.addDateHeader("last-modified", resource.getModificationTime()); + + // TODO: [MRM-524] determine http caching options for other types of files (artifacts, sha1, md5, snapshots) + } + + private ManagedRepositoryContent getManagedRepository( String respositoryId ) + throws DavException + { + if ( respositoryId != null ) + { + try + { + return repositoryFactory.getManagedRepositoryContent( respositoryId ); + } + catch ( RepositoryNotFoundException e ) + { + throw new DavException( HttpServletResponse.SC_NOT_FOUND, e ); + } + catch ( RepositoryException e ) + { + throw new DavException( HttpServletResponse.SC_NOT_FOUND, e ); + } + } + return null; + } + + private void checkLocatorIsInstanceOfRepositoryLocator( DavResourceLocator locator ) + throws DavException + { + if ( !( locator instanceof RepositoryLocator ) ) + { + throw new DavException( HttpServletResponse.SC_INTERNAL_SERVER_ERROR, + "Locator does not implement RepositoryLocator" ); + } + } + + class LogicalResource + { + private String path; + + public LogicalResource( String path ) + { + this.path = path; + } + + public String getPath() + { + return path; + } + + public void setPath( String path ) + { + this.path = path; + } + } + + protected boolean isAuthorized( DavServletRequest request, String repositoryId ) + throws DavException + { + try + { + AuthenticationResult result = httpAuth.getAuthenticationResult( request, null ); + SecuritySession securitySession = httpAuth.getSecuritySession(); + + return servletAuth.isAuthenticated( request, result ) && + servletAuth.isAuthorized( request, securitySession, repositoryId, + WebdavMethodUtil.isWriteMethod( request.getMethod() ) ); + } + catch ( AuthenticationException e ) + { + throw new UnauthorizedDavException( repositoryId, "You are not authenticated" ); + } + catch ( MustChangePasswordException e ) + { + throw new UnauthorizedDavException( repositoryId, "You must change your password." ); + } + catch ( AccountLockedException e ) + { + throw new UnauthorizedDavException( repositoryId, "User account is locked." ); + } + catch ( AuthorizationException e ) + { + throw new DavException( HttpServletResponse.SC_INTERNAL_SERVER_ERROR, + "Fatal Authorization Subsystem Error." ); + } + catch ( UnauthorizedException e ) + { + throw new UnauthorizedDavException( repositoryId, e.getMessage() ); + } + } + + private DavResource getResource( DavServletRequest request, List repositories, ArchivaDavResourceLocator locator ) + throws DavException + { + List mergedRepositoryContents = new ArrayList(); + LogicalResource logicalResource = + new LogicalResource( RepositoryPathUtil.getLogicalResource( locator.getResourcePath() ) ); + + // flow: + // if the current user logged in has permission to any of the repositories, allow user to + // browse the repo group but displaying only the repositories which the user has permission to access. + // otherwise, prompt for authentication. + + // put the current session in the session map which will be passed to ArchivaXworkUser + Map sessionMap = new HashMap(); + if( request.getSession().getAttribute( SecuritySystemConstants.SECURITY_SESSION_KEY ) != null ) + { + sessionMap.put( SecuritySystemConstants.SECURITY_SESSION_KEY, + request.getSession().getAttribute( SecuritySystemConstants.SECURITY_SESSION_KEY ) ); + } + + String activePrincipal = ArchivaXworkUser.getActivePrincipal( sessionMap ); + boolean allow = isAllowedToContinue( request, repositories, activePrincipal ); + + if( allow ) + { + for( String repository : repositories ) + { + // for prompted authentication + if( httpAuth.getSecuritySession() != null ) + { + try + { + if( isAuthorized( request, repository ) ) + { + getResource( locator, mergedRepositoryContents, logicalResource, repository ); + } + } + catch ( DavException e ) + { + continue; + } + } + else + { + // for the current user logged in + try + { + if( servletAuth.isAuthorizedToAccessVirtualRepository( activePrincipal, repository ) ) + { + getResource( locator, mergedRepositoryContents, logicalResource, repository ); + } + } + catch ( UnauthorizedException e ) + { + continue; + } + } + } + } + else + { + throw new UnauthorizedDavException( locator.getRepositoryId(), "User not authorized." ); + } + + ArchivaVirtualDavResource resource = + new ArchivaVirtualDavResource( mergedRepositoryContents, logicalResource.getPath(), mimeTypes, locator, this ); + + // compatibility with MRM-440 to ensure browsing the repository group works ok + if ( resource.isCollection() && !request.getRequestURI().endsWith("/" ) ) + { + throw new BrowserRedirectException( resource.getHref() ); + } + + return resource; + } + + private void getResource( ArchivaDavResourceLocator locator, List mergedRepositoryContents, + LogicalResource logicalResource, String repository ) + throws DavException + { + ManagedRepositoryContent managedRepository = null; + + try + { + managedRepository = getManagedRepository( repository ); + } + catch ( DavException de ) + { + throw new DavException( HttpServletResponse.SC_NOT_FOUND, "Invalid managed repository <" + + repository + ">" ); + } + + if ( !locator.getResourcePath().startsWith( ArchivaVirtualDavResource.HIDDEN_PATH_PREFIX ) ) + { + if( managedRepository != null ) + { + File resourceFile = new File( managedRepository.getRepoRoot(), logicalResource.getPath() ); + if( resourceFile.exists() ) + { + mergedRepositoryContents.add( resourceFile ); + } + } + } + } + + /** + * Check if the current user is authorized to access any of the repos + * + * @param request + * @param repositories + * @param activePrincipal + * @return + */ + private boolean isAllowedToContinue( DavServletRequest request, List repositories, String activePrincipal ) + { + boolean allow = false; + + + // if securitySession != null, it means that the user was prompted for authentication + if( httpAuth.getSecuritySession() != null ) + { + for( String repository : repositories ) + { + try + { + if( isAuthorized( request, repository ) ) + { + allow = true; + break; + } + } + catch( DavException e ) + { + continue; + } + } + } + else + { + for( String repository : repositories ) + { + try + { + if( servletAuth.isAuthorizedToAccessVirtualRepository( activePrincipal, repository ) ) + { + allow = true; + break; + } + } + catch ( UnauthorizedException e ) + { + continue; + } + } + } + + return allow; + } + + private File writeMergedMetadataToFile( ArchivaRepositoryMetadata mergedMetadata, String outputFilename ) + throws RepositoryMetadataException, DigesterException, IOException + { + File outputFile = new File( outputFilename ); + if( outputFile.exists() ) + { + FileUtils.deleteQuietly( outputFile ); + } + + outputFile.getParentFile().mkdirs(); + RepositoryMetadataWriter.write( mergedMetadata, outputFile ); + + createChecksumFile( outputFilename, digestSha1 ); + createChecksumFile( outputFilename, digestMd5 ); + + return outputFile; + } + + private void createChecksumFile( String path, Digester digester ) + throws DigesterException, IOException + { + File checksumFile = new File( path + digester.getFilenameExtension() ); + if ( !checksumFile.exists() ) + { + FileUtils.deleteQuietly( checksumFile ); + checksum.createChecksum( new File( path ), digester ); + } + else if ( !checksumFile.isFile() ) + { + log.error( "Checksum file is not a file." ); + } + } + + private boolean isProjectReference( String requestedResource ) + { + try + { + VersionedReference versionRef = metadataTools.toVersionedReference( requestedResource ); + return false; + } + catch ( RepositoryMetadataException re ) + { + return true; + } + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceLocator.java b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceLocator.java new file mode 100644 index 000000000..a6b758a35 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceLocator.java @@ -0,0 +1,159 @@ +package org.apache.maven.archiva.webdav; + +/* + * 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.jackrabbit.webdav.DavResourceLocator; +import org.apache.jackrabbit.webdav.DavLocatorFactory; +import org.apache.jackrabbit.util.Text; + +/** + * @author James William Dumay + */ +public class ArchivaDavResourceLocator + implements DavResourceLocator, RepositoryLocator +{ + private final String prefix; + + private final String resourcePath; + + private final String href; + + private final String repositoryId; + + private final DavLocatorFactory davLocatorFactory; + + public ArchivaDavResourceLocator( String prefix, String resourcePath, String repositoryId, + DavLocatorFactory davLocatorFactory ) + { + this.prefix = prefix; + this.repositoryId = repositoryId; + this.davLocatorFactory = davLocatorFactory; + + String path = resourcePath; + + if (!resourcePath.startsWith("/")) + { + path = "/" + resourcePath; + } + + String escapedPath = Text.escapePath( resourcePath ); + String hrefPrefix = prefix; + + // Ensure no extra slashes when href is joined + if ( hrefPrefix.endsWith( "/" ) && escapedPath.startsWith( "/" ) ) + { + hrefPrefix = hrefPrefix.substring( 0, hrefPrefix.length() - 1 ); + } + + href = hrefPrefix + escapedPath; + + //Remove trailing slashes otherwise Text.getRelativeParent fails + if (resourcePath.endsWith("/") && resourcePath.length() > 1) + { + path = resourcePath.substring( 0, resourcePath.length() - 1 ); + } + + this.resourcePath = path; + } + + public String getRepositoryId() + { + return repositoryId; + } + + public String getPrefix() + { + return prefix; + } + + public String getResourcePath() + { + return resourcePath; + } + + public String getWorkspacePath() + { + return ""; + } + + public String getWorkspaceName() + { + return ""; + } + + public boolean isSameWorkspace( DavResourceLocator locator ) + { + return isSameWorkspace( locator.getWorkspaceName() ); + } + + public boolean isSameWorkspace( String workspaceName ) + { + return getWorkspaceName().equals( workspaceName ); + } + + public String getHref( boolean isCollection ) + { + // avoid doubled trailing '/' for the root item + String suffix = ( isCollection && !isRootLocation() && !href.endsWith("/") ) ? "/" : ""; + return href + suffix; + } + + public boolean isRootLocation() + { + return "/".equals( resourcePath ); + } + + public DavLocatorFactory getFactory() + { + return davLocatorFactory; + } + + public String getRepositoryPath() + { + return getResourcePath(); + } + + /** + * Computes the hash code from the href, which is built using the final fields prefix and resourcePath. + * + * @return the hash code + */ + public int hashCode() + { + return href.hashCode(); + } + + /** + * Equality of path is achieved if the specified object is a DavResourceLocator object with the same + * hash code. + * + * @param obj the object to compare to + * @return true if the 2 objects are equal; false otherwise + */ + public boolean equals( Object obj ) + { + if ( obj instanceof DavResourceLocator ) + { + DavResourceLocator other = (DavResourceLocator) obj; + return hashCode() == other.hashCode(); + } + return false; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavSession.java b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavSession.java new file mode 100644 index 000000000..95d75805c --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavSession.java @@ -0,0 +1,53 @@ +package org.apache.maven.archiva.webdav; + +/* + * 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.HashSet; +import org.apache.jackrabbit.webdav.DavSession; + +public class ArchivaDavSession implements DavSession +{ + private final HashSet lockTokens = new HashSet(); + + public void addLockToken(String token) + { + lockTokens.add(token); + } + + public String[] getLockTokens() + { + return (String[]) lockTokens.toArray(new String[lockTokens.size()]); + } + + public void removeLockToken(String token) + { + lockTokens.remove(token); + } + + public void removeReference(Object reference) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void addReference(Object reference) + { + throw new UnsupportedOperationException("Not supported yet."); + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavSessionProvider.java b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavSessionProvider.java new file mode 100644 index 000000000..ad96939d1 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavSessionProvider.java @@ -0,0 +1,97 @@ +package org.apache.maven.archiva.webdav; + +/* + * 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.jackrabbit.webdav.DavSessionProvider; +import org.apache.jackrabbit.webdav.WebdavRequest; +import org.apache.jackrabbit.webdav.DavException; +import org.apache.jackrabbit.webdav.DavServletRequest; +import org.apache.maven.archiva.webdav.util.RepositoryPathUtil; +import org.apache.maven.archiva.security.ServletAuthenticator; +import org.codehaus.plexus.redback.authentication.AuthenticationException; +import org.codehaus.plexus.redback.authentication.AuthenticationResult; +import org.codehaus.plexus.redback.policy.MustChangePasswordException; +import org.codehaus.plexus.redback.policy.AccountLockedException; +import org.codehaus.plexus.redback.xwork.filter.authentication.HttpAuthenticator; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * @author James William Dumay + */ +public class ArchivaDavSessionProvider + implements DavSessionProvider +{ + private Logger log = LoggerFactory.getLogger( ArchivaDavSessionProvider.class ); + + private ServletAuthenticator servletAuth; + + private HttpAuthenticator httpAuth; + + public ArchivaDavSessionProvider( ServletAuthenticator servletAuth, HttpAuthenticator httpAuth ) + { + this.servletAuth = servletAuth; + this.httpAuth = httpAuth; + } + + public boolean attachSession( WebdavRequest request ) + throws DavException + { + final String repositoryId = RepositoryPathUtil.getRepositoryName( removeContextPath( request ) ); + + try + { + AuthenticationResult result = httpAuth.getAuthenticationResult( request, null ); + + //Create a dav session + request.setDavSession(new ArchivaDavSession()); + + return servletAuth.isAuthenticated( request, result ); + } + catch ( AuthenticationException e ) + { + throw new UnauthorizedDavException( repositoryId, "You are not authenticated" ); + } + catch ( MustChangePasswordException e ) + { + throw new UnauthorizedDavException( repositoryId, "You must change your password." ); + } + catch ( AccountLockedException e ) + { + throw new UnauthorizedDavException( repositoryId, "User account is locked." ); + } + } + + public void releaseSession( WebdavRequest request ) + { + request.setDavSession(null); + } + + private String removeContextPath( final DavServletRequest request ) + { + String path = request.getRequestURI(); + String ctx = request.getContextPath(); + if ( path.startsWith( ctx ) ) + { + path = path.substring( ctx.length() ); + } + return path; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaVirtualDavResource.java b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaVirtualDavResource.java new file mode 100644 index 000000000..f5ada0b72 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaVirtualDavResource.java @@ -0,0 +1,351 @@ +package org.apache.maven.archiva.webdav; + +/* + * 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; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import org.apache.jackrabbit.util.Text; +import org.apache.jackrabbit.webdav.DavException; +import org.apache.jackrabbit.webdav.DavResource; +import org.apache.jackrabbit.webdav.DavResourceFactory; +import org.apache.jackrabbit.webdav.DavResourceIterator; +import org.apache.jackrabbit.webdav.DavResourceLocator; +import org.apache.jackrabbit.webdav.DavSession; +import org.apache.jackrabbit.webdav.MultiStatusResponse; +import org.apache.jackrabbit.webdav.io.InputContext; +import org.apache.jackrabbit.webdav.io.OutputContext; +import org.apache.jackrabbit.webdav.lock.ActiveLock; +import org.apache.jackrabbit.webdav.lock.LockInfo; +import org.apache.jackrabbit.webdav.lock.LockManager; +import org.apache.jackrabbit.webdav.lock.Scope; +import org.apache.jackrabbit.webdav.lock.Type; +import org.apache.jackrabbit.webdav.property.DavProperty; +import org.apache.jackrabbit.webdav.property.DavPropertyName; +import org.apache.jackrabbit.webdav.property.DavPropertyNameSet; +import org.apache.jackrabbit.webdav.property.DavPropertySet; +import org.apache.jackrabbit.webdav.property.DefaultDavProperty; +import org.apache.jackrabbit.webdav.property.ResourceType; +import org.apache.maven.archiva.webdav.util.IndexWriter; +import org.apache.maven.archiva.webdav.util.MimeTypes; +import org.joda.time.DateTime; +import org.joda.time.format.DateTimeFormatter; +import org.joda.time.format.ISODateTimeFormat; + +/** + * DavResource for virtual repositories + * + * @author Maria Odea Ching + */ +public class ArchivaVirtualDavResource + implements DavResource +{ + public static final String HIDDEN_PATH_PREFIX = "."; + + private static final String COMPLIANCE_CLASS = "1"; + + private MimeTypes mimeTypes; + + private ArchivaDavResourceLocator locator; + + private DavResourceFactory factory; + + private String logicalResource; + + private DavPropertySet properties; + + private boolean propsInitialized = false; + + private static final String METHODS = "OPTIONS, GET, HEAD, POST, TRACE, PROPFIND, PROPPATCH, MKCOL"; + + private final List localResources; + + public ArchivaVirtualDavResource( List localResources, String logicalResource, MimeTypes mimeTypes, + ArchivaDavResourceLocator locator, DavResourceFactory factory ) + { + this.localResources = localResources; + this.logicalResource = logicalResource; + this.mimeTypes = mimeTypes; + this.locator = locator; + this.factory = factory; + this.properties = new DavPropertySet(); + } + + public void spool( OutputContext outputContext ) + throws IOException + { + if (outputContext.hasStream()) + { + Collections.sort( localResources ); + List localResourceFiles = new ArrayList(); + + for ( File resourceFile : localResources ) + { + if ( resourceFile.exists() ) + { + localResourceFiles.add( resourceFile ); + } + } + + IndexWriter writer = new IndexWriter( this, localResourceFiles, logicalResource ); + writer.write( outputContext ); + } + } + + public void addLockManager( LockManager arg0 ) + { + + } + + public void addMember( DavResource arg0, InputContext arg1 ) + throws DavException + { + + } + + public MultiStatusResponse alterProperties( List arg0 ) + throws DavException + { + return null; + } + + public MultiStatusResponse alterProperties( DavPropertySet arg0, DavPropertyNameSet arg1 ) + throws DavException + { + return null; + } + + public void copy( DavResource arg0, boolean arg1 ) + throws DavException + { + + } + + public boolean exists() + { + // localResources are already filtered (all files in the list are already existing) + return true; + } + + public ActiveLock getLock( Type arg0, Scope arg1 ) + { + return null; + } + + public ActiveLock[] getLocks() + { + return null; + } + + public DavResourceIterator getMembers() + { + return null; + } + + public String getSupportedMethods() + { + return METHODS; + } + + public long getModificationTime() + { + return 0; + } + + public boolean hasLock( Type arg0, Scope arg1 ) + { + return false; + } + + public boolean isCollection() + { + return true; + } + + public boolean isLockable( Type arg0, Scope arg1 ) + { + return false; + } + + public ActiveLock lock( LockInfo arg0 ) + throws DavException + { + return null; + } + + public void move( DavResource arg0 ) + throws DavException + { + + } + + public ActiveLock refreshLock( LockInfo arg0, String arg1 ) + throws DavException + { + return null; + } + + public void removeMember( DavResource arg0 ) + throws DavException + { + + } + + public void unlock( String arg0 ) + throws DavException + { + + } + + public String getComplianceClass() + { + return COMPLIANCE_CLASS; + } + + public DavResourceLocator getLocator() + { + return locator; + } + + public String getResourcePath() + { + return locator.getResourcePath(); + } + + public String getHref() + { + return locator.getHref( isCollection() ); + } + + public DavResourceFactory getFactory() + { + return factory; + } + + public String getDisplayName() + { + String resPath = getResourcePath(); + + return ( resPath != null ) ? Text.getName( resPath ) : resPath; + } + + public DavSession getSession() + { + return null; + } + + public DavPropertyName[] getPropertyNames() + { + return getProperties().getPropertyNames(); + } + + public DavProperty getProperty( DavPropertyName name ) + { + initProperties(); + return properties.get( name ); + } + + public DavPropertySet getProperties() + { + initProperties(); + return properties; + } + + public void setProperty( DavProperty property ) + throws DavException + { + } + + public void removeProperty( DavPropertyName propertyName ) + throws DavException + { + } + + public DavResource getCollection() + { + DavResource parent = null; + if ( getResourcePath() != null && !getResourcePath().equals( "/" ) ) + { + String parentPath = Text.getRelativeParent( getResourcePath(), 1 ); + if ( parentPath.equals( "" ) ) + { + parentPath = "/"; + } + DavResourceLocator parentloc = locator.getFactory().createResourceLocator( locator.getPrefix(), parentPath ); + try + { + // go back to ArchivaDavResourceFactory! + parent = factory.createResource( parentloc, null ); + } + catch ( DavException e ) + { + // should not occur + } + } + return parent; + } + + /** + * Fill the set of properties + */ + protected void initProperties() + { + if ( !exists() || propsInitialized ) + { + return; + } + + // set (or reset) fundamental properties + if ( getDisplayName() != null ) + { + properties.add( new DefaultDavProperty( DavPropertyName.DISPLAYNAME, getDisplayName() ) ); + } + if ( isCollection() ) + { + properties.add( new ResourceType( ResourceType.COLLECTION ) ); + // Windows XP support + properties.add( new DefaultDavProperty( DavPropertyName.ISCOLLECTION, "1" ) ); + } + else + { + properties.add( new ResourceType( ResourceType.DEFAULT_RESOURCE ) ); + + // Windows XP support + properties.add( new DefaultDavProperty( DavPropertyName.ISCOLLECTION, "0" ) ); + } + + // Need to get the ISO8601 date for properties + DateTime dt = new DateTime( 0 ); + DateTimeFormatter fmt = ISODateTimeFormat.dateTime(); + String modifiedDate = fmt.print( dt ); + + properties.add( new DefaultDavProperty( DavPropertyName.GETLASTMODIFIED, modifiedDate ) ); + + properties.add( new DefaultDavProperty( DavPropertyName.CREATIONDATE, modifiedDate ) ); + + properties.add( new DefaultDavProperty( DavPropertyName.GETCONTENTLENGTH, 0 ) ); + + propsInitialized = true; + } + +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/BrowserRedirectException.java b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/BrowserRedirectException.java new file mode 100644 index 000000000..b6c13dfe0 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/BrowserRedirectException.java @@ -0,0 +1,43 @@ +package org.apache.maven.archiva.webdav; + +/* + * 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.jackrabbit.webdav.DavException; + +import javax.servlet.http.HttpServletResponse; + +/** + * @author James William Dumay + */ +public class BrowserRedirectException extends DavException +{ + final String location; + + public BrowserRedirectException(String location) + { + super(HttpServletResponse.SC_MOVED_PERMANENTLY); + this.location = location; + } + + public String getLocation() + { + return location; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/LogicalResource.java b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/LogicalResource.java new file mode 100644 index 000000000..964fc2e6d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/LogicalResource.java @@ -0,0 +1,38 @@ +package org.apache.maven.archiva.webdav; + +/* + * 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 James William Dumay + */ +public class LogicalResource +{ + private String path; + + public String getPath() + { + return path; + } + + public void setPath(String path) + { + this.path = path; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/RepositoryLocator.java b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/RepositoryLocator.java new file mode 100644 index 000000000..a797e4176 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/RepositoryLocator.java @@ -0,0 +1,28 @@ +package org.apache.maven.archiva.webdav; + +/* + * 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 James William Dumay + */ +public interface RepositoryLocator +{ + String getRepositoryId(); +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/RepositoryServlet.java b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/RepositoryServlet.java new file mode 100644 index 000000000..ca9aa5aed --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/RepositoryServlet.java @@ -0,0 +1,283 @@ +package org.apache.maven.archiva.webdav; + +/* + * 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; +import java.io.IOException; +import java.util.Map; + +import javax.servlet.ServletConfig; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.jackrabbit.webdav.DavException; +import org.apache.jackrabbit.webdav.DavLocatorFactory; +import org.apache.jackrabbit.webdav.DavMethods; +import org.apache.jackrabbit.webdav.DavResource; +import org.apache.jackrabbit.webdav.DavResourceFactory; +import org.apache.jackrabbit.webdav.DavServletResponse; +import org.apache.jackrabbit.webdav.DavSessionProvider; +import org.apache.jackrabbit.webdav.WebdavRequest; +import org.apache.jackrabbit.webdav.WebdavRequestImpl; +import org.apache.jackrabbit.webdav.WebdavResponse; +import org.apache.jackrabbit.webdav.WebdavResponseImpl; +import org.apache.jackrabbit.webdav.server.AbstractWebdavServlet; +import org.apache.maven.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.ConfigurationEvent; +import org.apache.maven.archiva.configuration.ConfigurationListener; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.security.ServletAuthenticator; +import org.codehaus.plexus.redback.xwork.filter.authentication.HttpAuthenticator; +import org.codehaus.plexus.spring.PlexusToSpringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.context.WebApplicationContext; +import org.springframework.web.context.support.WebApplicationContextUtils; + +/** + * RepositoryServlet + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class RepositoryServlet + extends AbstractWebdavServlet + implements ConfigurationListener +{ + private Logger log = LoggerFactory.getLogger( RepositoryServlet.class ); + + private ArchivaConfiguration configuration; + + private Map repositoryMap; + + private DavLocatorFactory locatorFactory; + + private DavResourceFactory resourceFactory; + + private DavSessionProvider sessionProvider; + + private final Object reloadLock = new Object(); + + public void init( javax.servlet.ServletConfig servletConfig ) + throws ServletException + { + super.init( servletConfig ); + initServers( servletConfig ); + } + + /** + * Service the given request. This method has been overridden and copy/pasted to allow better exception handling and + * to support different realms + * + * @param request + * @param response + * @throws ServletException + * @throws java.io.IOException + */ + @Override + protected void service( HttpServletRequest request, HttpServletResponse response ) + throws ServletException, IOException + { + WebdavRequest webdavRequest = new WebdavRequestImpl( request, getLocatorFactory() ); + // DeltaV requires 'Cache-Control' header for all methods except 'VERSION-CONTROL' and 'REPORT'. + int methodCode = DavMethods.getMethodCode( request.getMethod() ); + boolean noCache = + DavMethods.isDeltaVMethod( webdavRequest ) && + !( DavMethods.DAV_VERSION_CONTROL == methodCode || DavMethods.DAV_REPORT == methodCode ); + WebdavResponse webdavResponse = new WebdavResponseImpl( response, noCache ); + DavResource resource = null; + + try + { + // make sure there is a authenticated user + if ( !getDavSessionProvider().attachSession( webdavRequest ) ) + { + return; + } + + // check matching if=header for lock-token relevant operations + resource = + getResourceFactory().createResource( webdavRequest.getRequestLocator(), webdavRequest, webdavResponse ); + + if ( !isPreconditionValid( webdavRequest, resource ) ) + { + webdavResponse.sendError( DavServletResponse.SC_PRECONDITION_FAILED ); + return; + } + if ( !execute( webdavRequest, webdavResponse, methodCode, resource ) ) + { + super.service( request, response ); + } + + } + catch ( UnauthorizedDavException e ) + { + webdavResponse.setHeader( "WWW-Authenticate", getAuthenticateHeaderValue( e.getRepositoryName() ) ); + webdavResponse.sendError( e.getErrorCode(), e.getStatusPhrase() ); + } + catch ( BrowserRedirectException e ) + { + response.sendRedirect( e.getLocation() ); + } + catch ( DavException e ) + { + if ( e.getErrorCode() == HttpServletResponse.SC_UNAUTHORIZED ) + { + final String msg = "Should throw " + UnauthorizedDavException.class.getName(); + log.error( msg ); + webdavResponse.sendError( e.getErrorCode(), msg ); + } + else if ( e.getCause() != null ) + { + webdavResponse.sendError( e.getErrorCode(), e.getCause().getMessage() ); + } + else + { + webdavResponse.sendError( e.getErrorCode(), e.getMessage() ); + } + } + finally + { + getDavSessionProvider().releaseSession( webdavRequest ); + } + } + + public synchronized void initServers( ServletConfig servletConfig ) + { + WebApplicationContext wac = + WebApplicationContextUtils.getRequiredWebApplicationContext( servletConfig.getServletContext() ); + + configuration = + (ArchivaConfiguration) wac.getBean( PlexusToSpringUtils.buildSpringId( ArchivaConfiguration.class.getName() ) ); + configuration.addListener( this ); + + repositoryMap = configuration.getConfiguration().getManagedRepositoriesAsMap(); + + for ( ManagedRepositoryConfiguration repo : repositoryMap.values() ) + { + File repoDir = new File( repo.getLocation() ); + + if ( !repoDir.exists() ) + { + if ( !repoDir.mkdirs() ) + { + // Skip invalid directories. + log( "Unable to create missing directory for " + repo.getLocation() ); + continue; + } + } + } + + resourceFactory = + (DavResourceFactory) wac.getBean( PlexusToSpringUtils.buildSpringId( ArchivaDavResourceFactory.class ) ); + locatorFactory = new ArchivaDavLocatorFactory(); + + ServletAuthenticator servletAuth = + (ServletAuthenticator) wac.getBean( PlexusToSpringUtils.buildSpringId( ServletAuthenticator.class.getName() ) ); + HttpAuthenticator httpAuth = + (HttpAuthenticator) wac.getBean( PlexusToSpringUtils.buildSpringId( HttpAuthenticator.ROLE, "basic" ) ); + + sessionProvider = new ArchivaDavSessionProvider( servletAuth, httpAuth ); + } + + public void configurationEvent( ConfigurationEvent event ) + { + if ( event.getType() == ConfigurationEvent.SAVED ) + { + initRepositories(); + } + } + + private void initRepositories() + { + synchronized ( repositoryMap ) + { + repositoryMap.clear(); + repositoryMap.putAll( configuration.getConfiguration().getManagedRepositoriesAsMap() ); + } + + synchronized ( reloadLock ) + { + initServers( getServletConfig() ); + } + } + + public synchronized ManagedRepositoryConfiguration getRepository( String prefix ) + { + if ( repositoryMap.isEmpty() ) + { + repositoryMap.putAll( configuration.getConfiguration().getManagedRepositoriesAsMap() ); + } + return repositoryMap.get( prefix ); + } + + ArchivaConfiguration getConfiguration() + { + return configuration; + } + + protected boolean isPreconditionValid( final WebdavRequest request, final DavResource davResource ) + { + // check for read or write access to the resource when resource-based permission is implemented + + return true; + } + + public DavSessionProvider getDavSessionProvider() + { + return sessionProvider; + } + + public void setDavSessionProvider( final DavSessionProvider davSessionProvider ) + { + this.sessionProvider = davSessionProvider; + } + + public DavLocatorFactory getLocatorFactory() + { + return locatorFactory; + } + + public void setLocatorFactory( final DavLocatorFactory davLocatorFactory ) + { + locatorFactory = davLocatorFactory; + } + + public DavResourceFactory getResourceFactory() + { + return resourceFactory; + } + + public void setResourceFactory( final DavResourceFactory davResourceFactory ) + { + resourceFactory = davResourceFactory; + } + + public String getAuthenticateHeaderValue() + { + throw new UnsupportedOperationException(); + } + + public String getAuthenticateHeaderValue( String repository ) + { + return "Basic realm=\"Repository Archiva Managed " + repository + " Repository\""; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/UnauthorizedDavException.java b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/UnauthorizedDavException.java new file mode 100644 index 000000000..d26f2f910 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/UnauthorizedDavException.java @@ -0,0 +1,43 @@ +package org.apache.maven.archiva.webdav; + +/* + * 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.jackrabbit.webdav.DavException; + +import javax.servlet.http.HttpServletResponse; + +/** + * @author James William Dumay + */ +public class UnauthorizedDavException extends DavException +{ + final private String repositoryName; + + public UnauthorizedDavException(String repositoryName, String message) + { + super(HttpServletResponse.SC_UNAUTHORIZED, message); + this.repositoryName = repositoryName; + } + + public String getRepositoryName() + { + return repositoryName; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/util/IndexWriter.java b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/util/IndexWriter.java new file mode 100644 index 000000000..9e5149291 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/util/IndexWriter.java @@ -0,0 +1,168 @@ +package org.apache.maven.archiva.webdav.util; + +/* + * 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.jackrabbit.webdav.DavResource; +import org.apache.jackrabbit.webdav.io.OutputContext; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.io.PrintWriter; +import java.io.File; + +/** + * @author James William Dumay + */ +public class IndexWriter +{ + private final DavResource resource; + + private final String logicalResource; + + private final List localResources; + + private final boolean isVirtual; + + public IndexWriter(DavResource resource, File localResource, String logicalResource) + { + this.resource = resource; + this.localResources = new ArrayList(); + this.localResources.add( localResource ); + this.logicalResource = logicalResource; + this.isVirtual = false; + } + + public IndexWriter( DavResource resource, List localResources, String logicalResource ) + { + this.resource = resource; + this.logicalResource = logicalResource; + this.localResources = localResources; + this.isVirtual = true; + } + + public void write(OutputContext outputContext) + { + outputContext.setModificationTime(new Date().getTime()); + outputContext.setContentType("text/html"); + outputContext.setETag(""); + if (outputContext.hasStream()) + { + PrintWriter writer = new PrintWriter(outputContext.getOutputStream()); + writeDocumentStart(writer); + writeHyperlinks(writer); + writeDocumentEnd(writer); + writer.flush(); + writer.close(); + } + } + + private void writeDocumentStart(PrintWriter writer) + { + writer.println(""); + writer.println(""); + writer.println("Collection: " + logicalResource + ""); + writer.println(""); + writer.println(""); + writer.println("

    Collection: " + logicalResource + "

    "); + + //Check if not root + if (!"/".equals(logicalResource)) + { + File file = new File(logicalResource); + String parentName = file.getParent().equals("") ? "/" : file.getParent(); + + //convert to unix path in case archiva is hosted on windows + parentName = StringUtils.replace(parentName, "\\", "/" ); + + writer.println(""); + } + + writer.println("
      "); + } + + private void writeDocumentEnd(PrintWriter writer) + { + writer.println("
    "); + writer.println(""); + writer.println(""); + } + + private void writeHyperlinks(PrintWriter writer) + { + if( !isVirtual ) + { + for( File localResource : localResources ) + { + List files = new ArrayList( Arrays.asList( localResource.listFiles() ) ); + Collections.sort( files ); + + for ( File file : files ) + { + writeHyperlink( writer, file.getName(), file.isDirectory() ); + } + } + } + else + { + // virtual repository - filter unique directories + Map uniqueChildFiles = new HashMap(); + List sortedList = new ArrayList(); + for( File resource : localResources ) + { + List files = new ArrayList( Arrays.asList( resource.listFiles() ) ); + + for ( File file : files ) + { + if( uniqueChildFiles.get( file.getName() ) == null ) + { + uniqueChildFiles.put( file.getName(), file ); + sortedList.add( file.getName() ); + } + } + } + + Collections.sort( sortedList ); + for ( String fileName : sortedList ) + { + writeHyperlink( writer, fileName, ( (File) uniqueChildFiles.get( fileName ) ).isDirectory()); + } + } + } + + private void writeHyperlink(PrintWriter writer, String resourceName, boolean directory ) + { + if (directory) + { + writer.println("
  • " + resourceName + "
  • "); + } + else + { + writer.println("
  • " + resourceName + "
  • "); + } + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/util/MimeTypes.java b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/util/MimeTypes.java new file mode 100644 index 000000000..1df7ae8a5 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/util/MimeTypes.java @@ -0,0 +1,197 @@ +package org.apache.maven.archiva.webdav.util; + +/* + * 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.io.IOUtils; +import org.apache.commons.lang.StringUtils; +import org.codehaus.plexus.logging.AbstractLogEnabled; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.net.URL; +import java.util.HashMap; +import java.util.Map; +import java.util.StringTokenizer; + +/** + * MimeTypes + * + * @author Joakim Erdfelt + * @version $Id: MimeTypes.java 7010 2007-10-25 23:35:02Z joakime $ + * + * @plexus.component role="org.apache.maven.archiva.webdav.util.MimeTypes" + */ +public class MimeTypes + extends AbstractLogEnabled + implements Initializable +{ + private static final String DEFAULT_MIME_TYPE = "application/octet-stream"; + + private String resource = "org/apache/maven/archiva/webdav/util/mime.types"; + + private Map mimeMap = new HashMap(); + + /** + * Get the Mime Type for the provided filename. + * + * @param filename the filename to obtain the mime type for. + * @return a mime type String, or null if filename is null, has no extension, or no mime type is associated with it. + */ + public String getMimeType( String filename ) + { + String value = null; + if ( !StringUtils.isEmpty( filename ) ) + { + int index = filename.lastIndexOf( '.' ); + + if ( index >= 0 ) + { + value = (String) mimeMap.get( filename.substring( index + 1 ).toLowerCase() ); + } + } + + + if (value == null) + { + value = DEFAULT_MIME_TYPE; + } + + return value; + + } + + public void initialize() + throws InitializationException + { + load( resource ); + } + + public void load( File file ) + { + if ( !file.exists() || !file.isFile() || !file.canRead() ) + { + getLogger().error( "Unable to load mime types from file " + file.getAbsolutePath() + " : not a readable file." ); + return; + } + + FileInputStream fis = null; + + try + { + fis = new FileInputStream( file ); + } + catch ( FileNotFoundException e ) + { + getLogger().error( "Unable to load mime types from file " + file.getAbsolutePath() + " : " + e.getMessage(), e ); + } + finally + { + IOUtils.closeQuietly( fis ); + } + } + + public void load( String resourceName ) + { + ClassLoader cloader = this.getClass().getClassLoader(); + + /* Load up the mime types table */ + URL mimeURL = cloader.getResource( resourceName ); + + if ( mimeURL == null ) + { + throw new IllegalStateException( "Unable to find resource " + resourceName ); + } + + InputStream mimeStream = null; + + try + { + mimeStream = mimeURL.openStream(); + load( mimeStream ); + } + catch ( IOException e ) + { + getLogger().error( "Unable to load mime map " + resourceName + " : " + e.getMessage(), e ); + } + finally + { + IOUtils.closeQuietly( mimeStream ); + } + } + + public void load( InputStream mimeStream ) + { + mimeMap.clear(); + + InputStreamReader reader = null; + BufferedReader buf = null; + + try + { + reader = new InputStreamReader( mimeStream ); + buf = new BufferedReader( reader ); + String line = null; + + while ( ( line = buf.readLine() ) != null ) + { + line = line.trim(); + + if ( line.length() == 0 ) + { + // empty line. skip it + continue; + } + + if ( line.startsWith( "#" ) ) + { + // Comment. skip it + continue; + } + + StringTokenizer tokenizer = new StringTokenizer( line ); + if ( tokenizer.countTokens() > 1 ) + { + String type = tokenizer.nextToken(); + while ( tokenizer.hasMoreTokens() ) + { + String extension = tokenizer.nextToken().toLowerCase(); + this.mimeMap.put( extension, type ); + } + } + } + } + catch ( IOException e ) + { + getLogger().error( "Unable to read mime types from input stream : " + e.getMessage(), e ); + } + finally + { + IOUtils.closeQuietly( buf ); + IOUtils.closeQuietly( reader ); + } + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/util/RepositoryPathUtil.java b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/util/RepositoryPathUtil.java new file mode 100644 index 000000000..5071dc3da --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/util/RepositoryPathUtil.java @@ -0,0 +1,111 @@ +package org.apache.maven.archiva.webdav.util; + +/* + * 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.commons.lang.ArrayUtils; + +/** + * @author James William Dumay + */ +public class RepositoryPathUtil +{ + public static String getLogicalResource(final String href) + { + String logicalResource = null; + String requestPathInfo = StringUtils.defaultString( href ); + + //remove prefix ie /repository/blah becomes /blah + requestPathInfo = removePrefix(requestPathInfo); + + // Remove prefixing slash as the repository id doesn't contain it; + if ( requestPathInfo.startsWith( "/" ) ) + { + requestPathInfo = requestPathInfo.substring( 1 ); + } + + int slash = requestPathInfo.indexOf( '/' ); + if ( slash > 0 ) + { + logicalResource = requestPathInfo.substring( slash ); + + if (logicalResource.endsWith( "/.." ) ) + { + logicalResource += "/"; + } + + if ( logicalResource != null && logicalResource.startsWith( "//" ) ) + { + logicalResource = logicalResource.substring( 1 ); + } + + if ( logicalResource == null ) + { + logicalResource = "/"; + } + } + else + { + logicalResource = "/"; + } + return logicalResource; + } + + public static String getRepositoryName(final String href) + { + String requestPathInfo = StringUtils.defaultString( href ); + + //remove prefix ie /repository/blah becomes /blah + requestPathInfo = removePrefix(requestPathInfo); + + // Remove prefixing slash as the repository id doesn't contain it; + if ( requestPathInfo.startsWith( "/" ) ) + { + requestPathInfo = requestPathInfo.substring( 1 ); + } + + // Find first element, if slash exists. + int slash = requestPathInfo.indexOf( '/' ); + if ( slash > 0 ) + { + // Filtered: "central/org/apache/maven/" -> "central" + return requestPathInfo.substring( 0, slash ); + } + return requestPathInfo; + } + + private static String removePrefix(final String href) + { + String[] parts = StringUtils.split(href, '/'); + parts = (String[]) ArrayUtils.subarray(parts, 1, parts.length); + if (parts == null || parts.length == 0) + { + return "/"; + } + + String joinedString = StringUtils.join(parts, '/'); + if( href.endsWith( "/" ) ) + { + joinedString = joinedString + "/"; + } + + return joinedString; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/util/WebdavMethodUtil.java b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/util/WebdavMethodUtil.java new file mode 100644 index 000000000..2560b82c3 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/util/WebdavMethodUtil.java @@ -0,0 +1,66 @@ +package org.apache.maven.archiva.webdav.util; + +/* + * 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 java.util.ArrayList; +import java.util.List; + +/** + * WebdavMethodUtil + * + * @author Joakim Erdfelt + * @version $Id: WebdavMethodUtil.java 5412 2007-01-13 01:18:47Z joakime $ + */ +public class WebdavMethodUtil +{ + private static final List READ_METHODS; + + static + { + READ_METHODS = new ArrayList(); + READ_METHODS.add( "HEAD" ); + READ_METHODS.add( "GET" ); + READ_METHODS.add( "PROPFIND" ); + READ_METHODS.add( "OPTIONS" ); + READ_METHODS.add( "REPORT" ); + } + + public static boolean isReadMethod( String method ) + { + if ( StringUtils.isBlank( method ) ) + { + return false; + } + + return READ_METHODS.contains( method.toUpperCase() ); + } + + public static boolean isWriteMethod( String method ) + { + if ( StringUtils.isBlank( method ) ) + { + return false; + } + + return !READ_METHODS.contains( method.toUpperCase() ); + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/main/resources/org/apache/maven/archiva/webdav/util/mime.types b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/main/resources/org/apache/maven/archiva/webdav/util/mime.types new file mode 100644 index 000000000..c479bb54b --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/main/resources/org/apache/maven/archiva/webdav/util/mime.types @@ -0,0 +1,127 @@ +# This file controls what Internet media types are sent to the client for +# given file extension(s). Sending the correct media type to the client +# is important so they know how to handle the content of the file. +# Extra types can either be added here or by using an AddType directive +# in your config files. For more information about Internet media types, +# please read RFC 2045, 2046, 2047, 2048, and 2077. The Internet media type +# registry is at . + +# MIME type Extensions + +application/andrew-inset ez +application/atom+xml atom +application/java-archive jar +application/mac-binhex40 hqx +application/mac-compactpro cpt +application/mathml+xml mathml +application/msword doc +application/octet-stream bin dms lha lzh exe class so dll dmg +application/oda oda +application/ogg ogg +application/pdf pdf +application/pgp-encrypted pgp +application/postscript ai eps ps +application/rdf+xml rdf +application/smil smi smil +application/srgs gram +application/srgs+xml grxml +application/vnd.mif mif +application/vnd.mozilla.xul+xml xul +application/vnd.ms-excel xls +application/vnd.ms-powerpoint ppt +application/vnd.rn-realmedia rm +application/vnd.wap.wbxml wbxml +application/vnd.wap.wmlc wmlc +application/vnd.wap.wmlscriptc wmlsc +application/voicexml+xml vxml +application/x-bcpio bcpio +application/x-cdlink vcd +application/x-chess-pgn pgn +application/x-cpio cpio +application/x-csh csh +application/x-director dcr dir dxr +application/x-dvi dvi +application/x-futuresplash spl +application/x-gtar gtar +application/x-hdf hdf +application/x-java-jnlp-file jnlp +application/x-javascript js +application/x-koan skp skd skt skm +application/x-latex latex +application/x-netcdf nc cdf +application/x-sh sh +application/x-shar shar +application/x-shockwave-flash swf +application/x-stuffit sit +application/x-sv4cpio sv4cpio +application/x-sv4crc sv4crc +application/x-tar tar +application/x-tcl tcl +application/x-tex tex +application/x-texinfo texinfo texi +application/x-troff t tr roff +application/x-troff-man man +application/x-troff-me me +application/x-troff-ms ms +application/x-ustar ustar +application/x-wais-source src +application/xhtml+xml xhtml xht +application/xml xml xsl pom +application/xml-dtd dtd +application/xslt+xml xslt +application/zip zip +audio/basic au snd +audio/midi mid midi kar +audio/mpeg mpga mp2 mp3 +audio/x-aiff aif aiff aifc +audio/x-mpegurl m3u +audio/x-pn-realaudio ram ra +audio/x-wav wav +chemical/x-pdb pdb +chemical/x-xyz xyz +image/bmp bmp +image/cgm cgm +image/gif gif +image/ief ief +image/jp2 jp2 +image/jpeg jpeg jpg jpe +image/pict pict pic pct +image/png png +image/svg+xml svg +image/tiff tiff tif +image/vnd.djvu djvu djv +image/vnd.wap.wbmp wbmp +image/x-cmu-raster ras +image/x-icon ico +image/x-macpaint pntg pnt mac +image/x-portable-anymap pnm +image/x-portable-bitmap pbm +image/x-portable-graymap pgm +image/x-portable-pixmap ppm +image/x-quicktime qtif qti +image/x-rgb rgb +image/x-xbitmap xbm +image/x-xpixmap xpm +image/x-xwindowdump xwd +model/iges igs iges +model/mesh msh mesh silo +model/vrml wrl vrml +text/calendar ics ifb +text/css css +text/html html htm +text/plain asc txt sha1 md5 +text/richtext rtx +text/rtf rtf +text/sgml sgml sgm +text/tab-separated-values tsv +text/vnd.wap.wml wml +text/vnd.wap.wmlscript wmls +text/x-setext etx +video/mp4 mp4 +video/mpeg mpeg mpg mpe +video/quicktime qt mov +video/vnd.mpegurl mxu m4u +video/x-dv dv dif +video/x-msvideo avi +video/x-sgi-movie movie +x-conference/x-cooltalk ice diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/AbstractRepositoryServletProxiedMetadataTestCase.java b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/AbstractRepositoryServletProxiedMetadataTestCase.java new file mode 100644 index 000000000..c11da99c1 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/AbstractRepositoryServletProxiedMetadataTestCase.java @@ -0,0 +1,253 @@ +package org.apache.maven.archiva.webdav; + +/* + * 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 com.meterware.httpunit.GetMethodWebRequest; +import com.meterware.httpunit.HttpUnitOptions; +import com.meterware.httpunit.WebRequest; +import com.meterware.httpunit.WebResponse; +import org.apache.commons.lang.ArrayUtils; +import org.apache.commons.lang.StringUtils; +import org.custommonkey.xmlunit.DetailedDiff; +import org.custommonkey.xmlunit.Diff; + +/** + * Abstract TestCase for RepositoryServlet Tests, Proxied, Get of Metadata. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public abstract class AbstractRepositoryServletProxiedMetadataTestCase + extends AbstractRepositoryServletProxiedTestCase +{ + protected RemoteRepoInfo remotePrivateSnapshots; + + protected void assertExpectedMetadata( String expectedMetadata, String actualMetadata ) + throws Exception + { + DetailedDiff detailedDiff = new DetailedDiff( new Diff( expectedMetadata, actualMetadata ) ); + if ( !detailedDiff.similar() ) + { + // If it isn't similar, dump the difference. + assertEquals( expectedMetadata, actualMetadata ); + } + // XMLAssert.assertXMLEqual( "Expected Metadata:", expectedMetadata, actualMetadata ); + } + + protected String requestMetadataOK( String path ) + throws Exception + { + // process the response code later, not via an exception. + HttpUnitOptions.setExceptionsThrownOnErrorStatus( false ); + + WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/internal/" + path ); + WebResponse response = sc.getResponse( request ); + assertResponseOK( response ); + return response.getText(); + } + + protected String createVersionMetadata( String groupId, String artifactId, String version ) + { + return createVersionMetadata( groupId, artifactId, version, null, null, null ); + } + + protected String createVersionMetadata( String groupId, String artifactId, String version, String timestamp, + String buildNumber, String lastUpdated ) + { + StringBuffer buf = new StringBuffer(); + + buf.append( "\n\n" ); + buf.append( "\n" ); + buf.append( " " ).append( groupId ).append( "\n" ); + buf.append( " " ).append( artifactId ).append( "\n" ); + buf.append( " " ).append( version ).append( "\n" ); + + boolean hasSnapshot = StringUtils.isNotBlank( timestamp ) || StringUtils.isNotBlank( buildNumber ); + boolean hasLastUpdated = StringUtils.isNotBlank( lastUpdated ); + + if ( hasSnapshot || hasLastUpdated ) + { + buf.append( " \n" ); + if ( hasSnapshot ) + { + buf.append( " \n" ); + buf.append( " " ).append( buildNumber ).append( "\n" ); + buf.append( " " ).append( timestamp ).append( "\n" ); + buf.append( " \n" ); + } + if ( hasLastUpdated ) + { + buf.append( " " ).append( lastUpdated ).append( "\n" ); + } + buf.append( " \n" ); + } + buf.append( "" ); + + return buf.toString(); + } + + protected String createProjectMetadata( String groupId, String artifactId, String latest, String release, + String[] versions ) + { + StringBuffer buf = new StringBuffer(); + + buf.append( "\n\n" ); + buf.append( "\n" ); + buf.append( " " ).append( groupId ).append( "\n" ); + buf.append( " " ).append( artifactId ).append( "\n" ); + + boolean hasLatest = StringUtils.isNotBlank( latest ); + boolean hasRelease = StringUtils.isNotBlank( release ); + boolean hasVersions = !ArrayUtils.isEmpty( versions ); + + if ( hasLatest || hasRelease || hasVersions ) + { + buf.append( " \n" ); + if ( hasLatest ) + { + buf.append( " " ).append( latest ).append( "\n" ); + } + if ( hasRelease ) + { + buf.append( " " ).append( release ).append( "\n" ); + } + if ( hasVersions ) + { + buf.append( " \n" ); + for ( String availVersion : versions ) + { + buf.append( " " ).append( availVersion ).append( "\n" ); + } + buf.append( " \n" ); + } + buf.append( " \n" ); + } + buf.append( "" ); + + return buf.toString(); + } + + protected String createGroupMetadata( String groupId, String[] plugins ) + { + StringBuffer buf = new StringBuffer(); + + buf.append( "\n\n" ); + buf.append( "\n" ); + buf.append( " " ).append( groupId ).append( "\n" ); + + boolean hasPlugins = !ArrayUtils.isEmpty( plugins ); + + if ( hasPlugins ) + { + buf.append( " \n" ); + for ( String plugin : plugins ) + { + buf.append( " \n" ); + buf.append( " " ).append( plugin ).append( "\n" ); + buf.append( " " ).append( plugin + "-maven-plugin" ).append( "\n" ); + buf.append( " " ).append( "The " + plugin + " Plugin" ).append( "\n" ); + buf.append( " \n" ); + } + buf.append( " \n" ); + } + buf.append( "" ); + + return buf.toString(); + } + + protected void setupPrivateSnapshotsRemoteRepo() + throws Exception + { + remotePrivateSnapshots = createServer( "private-snapshots" ); + + assertServerSetupCorrectly( remotePrivateSnapshots ); + archivaConfiguration.getConfiguration().addRemoteRepository( remotePrivateSnapshots.config ); + setupCleanRepo( remotePrivateSnapshots.root ); + } + +// private void assertGetProxiedSnapshotMetadata( int expectation, boolean hasManagedCopy, +// long deltaManagedToRemoteTimestamp ) +// throws Exception +// { +// // --- Setup +// setupSnapshotsRemoteRepo(); +// setupCleanInternalRepo(); +// +// String resourcePath = "org/apache/archiva/archivatest-maven-plugin/4.0-alpha-1-SNAPSHOT/maven-metadata.xml"; +// String expectedRemoteContents = "\n" + "\n" +// + " org.apache.maven.plugins\n" + " maven-assembly-plugin\n" +// + " 2.2-beta-2-SNAPSHOT\n" + " \n" + " \n" +// + " 20071017.162810\n" + " 20\n" +// + " \n" + " 20071017162814\n" + " \n" +// + ""; +// String expectedManagedContents = null; +// File remoteFile = populateRepo( remoteSnapshots, resourcePath, expectedRemoteContents ); +// +// if ( hasManagedCopy ) +// { +// expectedManagedContents = "\n" + " org.apache.maven.plugins\n" +// + " maven-assembly-plugin\n" + " 2.2-beta-2-SNAPSHOT\n" +// + ""; +// +// File managedFile = populateRepo( repoRootInternal, resourcePath, expectedManagedContents ); +// managedFile.setLastModified( remoteFile.lastModified() + deltaManagedToRemoteTimestamp ); +// } +// +// setupConnector( REPOID_INTERNAL, remoteSnapshots ); +// saveConfiguration(); +// +// // --- Execution +// // process the response code later, not via an exception. +// HttpUnitOptions.setExceptionsThrownOnErrorStatus( false ); +// +// WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/internal/" + resourcePath ); +// WebResponse response = sc.getResponse( request ); +// +// // --- Verification +// +// switch ( expectation ) +// { +// case EXPECT_MANAGED_CONTENTS: +// assertResponseOK( response ); +// assertTrue( "Invalid Test Case: Can't expect managed contents with " +// + "test that doesn't have a managed copy in the first place.", hasManagedCopy ); +// String actualContents = response.getText(); +// XMLAssert.assertXMLEqual( expectedManagedContents, actualContents ); +// // assertEquals( "Expected managed file contents", expectedManagedContents, response.getText() ); +// break; +// case EXPECT_REMOTE_CONTENTS: +// assertResponseOK( response ); +// assertEquals( "Expected remote file contents", expectedRemoteContents, response.getText() ); +// break; +// case EXPECT_NOT_FOUND: +// assertResponseNotFound( response ); +// assertManagedFileNotExists( repoRootInternal, resourcePath ); +// break; +// } +// } + + protected void tearDown() + throws Exception + { + shutdownServer( remotePrivateSnapshots ); + + super.tearDown(); + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/AbstractRepositoryServletProxiedTestCase.java b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/AbstractRepositoryServletProxiedTestCase.java new file mode 100644 index 000000000..1c1233748 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/AbstractRepositoryServletProxiedTestCase.java @@ -0,0 +1,252 @@ +package org.apache.maven.archiva.webdav; + +/* + * 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 com.meterware.httpunit.WebConversation; +import com.meterware.httpunit.WebResponse; + +import org.apache.commons.io.FileUtils; +import org.apache.maven.archiva.configuration.ProxyConnectorConfiguration; +import org.apache.maven.archiva.configuration.RemoteRepositoryConfiguration; +import org.apache.maven.archiva.policies.CachedFailuresPolicy; +import org.apache.maven.archiva.policies.ChecksumPolicy; +import org.apache.maven.archiva.policies.ReleasesPolicy; +import org.apache.maven.archiva.policies.SnapshotsPolicy; +import org.mortbay.jetty.Connector; +import org.mortbay.jetty.Server; +import org.mortbay.jetty.bio.SocketConnector; +import org.mortbay.jetty.handler.ContextHandler; +import org.mortbay.jetty.handler.ContextHandlerCollection; +import org.mortbay.jetty.servlet.DefaultServlet; +import org.mortbay.jetty.servlet.ServletHandler; + +import java.io.File; + +/** + * AbstractRepositoryServletProxiedTestCase + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public abstract class AbstractRepositoryServletProxiedTestCase + extends AbstractRepositoryServletTestCase +{ + class RemoteRepoInfo + { + public String id; + + public String url; + + public String context; + + public Server server; + + public File root; + + public RemoteRepositoryConfiguration config; + } + + protected static final long ONE_SECOND = ( 1000 /* milliseconds */ ); + + protected static final long ONE_MINUTE = ( ONE_SECOND * 60 ); + + protected static final long ONE_HOUR = ( ONE_MINUTE * 60 ); + + protected static final long ONE_DAY = ( ONE_HOUR * 24 ); + + protected static final long OVER_ONE_HOUR = ( ONE_HOUR + ONE_MINUTE ); + + protected static final long OVER_ONE_DAY = ( ONE_DAY + ONE_HOUR ); + + protected static final long OLDER = ( -1 ); + + protected static final long NEWER = 0; + + protected static final int EXPECT_MANAGED_CONTENTS = 1; + + protected static final int EXPECT_REMOTE_CONTENTS = 2; + + protected static final int EXPECT_NOT_FOUND = 3; + + protected static final boolean HAS_MANAGED_COPY = true; + + protected static final boolean NO_MANAGED_COPY = false; + + protected RemoteRepoInfo remoteCentral; + + protected RemoteRepoInfo remoteSnapshots; + + protected RemoteRepoInfo remotePrivateSnapshots; + + @Override + protected void setUp() + throws Exception + { + super.setUp(); + } + + protected RemoteRepoInfo createServer( String id ) + throws Exception + { + RemoteRepoInfo repo = new RemoteRepoInfo(); + repo.id = id; + repo.context = "/" + id; + repo.root = getTestFile( "target/remote-repos/" + id + "/" ); + + // Remove exising root contents. + if ( repo.root.exists() ) + { + FileUtils.deleteDirectory( repo.root ); + } + + // Establish root directory. + if ( !repo.root.exists() ) + { + repo.root.mkdirs(); + } + + repo.server = new Server(); + ContextHandlerCollection contexts = new ContextHandlerCollection(); + repo.server.setHandler( contexts ); + + SocketConnector connector = new SocketConnector(); + connector.setPort( 0 ); // 0 means, choose and empty port. (we'll find out which, later) + + repo.server.setConnectors( new Connector[] { connector } ); + + ContextHandler context = new ContextHandler(); + context.setContextPath( repo.context ); + context.setResourceBase( repo.root.getAbsolutePath() ); + context.setAttribute( "dirAllowed", true ); + context.setAttribute( "maxCacheSize", 0 ); + ServletHandler servlet = new ServletHandler(); + servlet.addServletWithMapping( DefaultServlet.class.getName(), "/" ); + context.setHandler( servlet ); + contexts.addHandler( context ); + + repo.server.start(); + + int port = connector.getLocalPort(); + repo.url = "http://localhost:" + port + repo.context; + System.out.println( "Remote HTTP Server started on " + repo.url ); + + repo.config = createRemoteRepository( repo.id, "Testable [" + repo.id + "] Remote Repo", repo.url ); + + return repo; + } + + protected void assertServerSetupCorrectly( RemoteRepoInfo remoteRepo ) + throws Exception + { + WebConversation wc = new WebConversation(); + WebResponse response = wc.getResponse( remoteRepo.url ); + assertResponseOK( response ); + } + + private void setupConnector( String repoId, RemoteRepoInfo remoteRepo, String releasesPolicy, String snapshotsPolicy ) + { + ProxyConnectorConfiguration connector = new ProxyConnectorConfiguration(); + connector.setSourceRepoId( repoId ); + connector.setTargetRepoId( remoteRepo.id ); + connector.addPolicy( ProxyConnectorConfiguration.POLICY_RELEASES, releasesPolicy ); + connector.addPolicy( ProxyConnectorConfiguration.POLICY_SNAPSHOTS, snapshotsPolicy ); + connector.addPolicy( ProxyConnectorConfiguration.POLICY_CHECKSUM, ChecksumPolicy.IGNORE ); + connector.addPolicy( ProxyConnectorConfiguration.POLICY_CACHE_FAILURES, CachedFailuresPolicy.NO ); + + archivaConfiguration.getConfiguration().addProxyConnector( connector ); + } + + protected void shutdownServer( RemoteRepoInfo remoteRepo ) + { + if ( remoteRepo != null ) + { + if ( remoteRepo.server != null ) + { + if ( remoteRepo.server.isRunning() ) + { + try + { + remoteRepo.server.stop(); + // int graceful = remoteRepo.server.getGracefulShutdown(); + // System.out.println( "server set to graceful shutdown: " + graceful ); + // remoteRepo = null; + } + catch ( Exception e ) + { + e.printStackTrace( System.err ); + } + } + } + } + } + + protected File populateRepo( RemoteRepoInfo remoteRepo, String path, String contents ) + throws Exception + { + File destFile = new File( remoteRepo.root, path ); + destFile.getParentFile().mkdirs(); + FileUtils.writeStringToFile( destFile, contents, null ); + return destFile; + } + + protected void setupCentralRemoteRepo() + throws Exception + { + remoteCentral = createServer( "central" ); + + assertServerSetupCorrectly( remoteCentral ); + archivaConfiguration.getConfiguration().addRemoteRepository( remoteCentral.config ); + setupCleanRepo( remoteCentral.root ); + } + + protected void setupConnector( String repoId, RemoteRepoInfo remoteRepo ) + { + setupConnector( repoId, remoteRepo, ReleasesPolicy.ALWAYS, SnapshotsPolicy.ALWAYS ); + } + + protected void setupReleaseConnector( String managedRepoId, RemoteRepoInfo remoteRepo, String releasePolicy ) + { + setupConnector( managedRepoId, remoteRepo, releasePolicy, SnapshotsPolicy.ALWAYS ); + } + + protected void setupSnapshotConnector( String managedRepoId, RemoteRepoInfo remoteRepo, String snapshotsPolicy ) + { + setupConnector( managedRepoId, remoteRepo, ReleasesPolicy.ALWAYS, snapshotsPolicy ); + } + + protected void setupSnapshotsRemoteRepo() + throws Exception + { + remoteSnapshots = createServer( "snapshots" ); + + assertServerSetupCorrectly( remoteSnapshots ); + archivaConfiguration.getConfiguration().addRemoteRepository( remoteSnapshots.config ); + setupCleanRepo( remoteSnapshots.root ); + } + + @Override + protected void tearDown() + throws Exception + { + shutdownServer( remoteCentral ); + shutdownServer( remoteSnapshots ); + super.tearDown(); + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/AbstractRepositoryServletTestCase.java b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/AbstractRepositoryServletTestCase.java new file mode 100644 index 000000000..e2af9da72 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/AbstractRepositoryServletTestCase.java @@ -0,0 +1,235 @@ +package org.apache.maven.archiva.webdav; + +/* + * 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 com.meterware.httpunit.WebResponse; +import com.meterware.httpunit.HttpUnitOptions; +import com.meterware.servletunit.ServletRunner; +import com.meterware.servletunit.ServletUnitClient; +import net.sf.ehcache.CacheManager; +import org.apache.commons.io.FileUtils; +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.configuration.RemoteRepositoryConfiguration; +import org.apache.maven.archiva.webdav.RepositoryServlet; +import org.codehaus.plexus.spring.PlexusInSpringTestCase; + +import javax.servlet.http.HttpServletResponse; +import java.io.File; +import java.io.IOException; + +import junit.framework.Assert; + +/** + * AbstractRepositoryServletTestCase + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public abstract class AbstractRepositoryServletTestCase + extends PlexusInSpringTestCase +{ + protected static final String REPOID_INTERNAL = "internal"; + + protected ServletUnitClient sc; + + protected File repoRootInternal; + + private ServletRunner sr; + + protected ArchivaConfiguration archivaConfiguration; + + protected void saveConfiguration() + throws Exception + { + saveConfiguration( archivaConfiguration ); + } + + protected void assertFileContents( String expectedContents, File repoRoot, String path ) + throws IOException + { + File actualFile = new File( repoRoot, path ); + assertTrue( "File <" + actualFile.getAbsolutePath() + "> should exist.", actualFile.exists() ); + assertTrue( "File <" + actualFile.getAbsolutePath() + "> should be a file (not a dir/link/device/etc).", + actualFile.isFile() ); + + String actualContents = FileUtils.readFileToString( actualFile, null ); + assertEquals( "File Contents of <" + actualFile.getAbsolutePath() + ">", expectedContents, actualContents ); + } + + protected void assertRepositoryValid( RepositoryServlet servlet, String repoId ) + { + ManagedRepositoryConfiguration repository = servlet.getRepository( repoId ); + assertNotNull( "Archiva Managed Repository id:<" + repoId + "> should exist.", repository ); + File repoRoot = new File( repository.getLocation() ); + assertTrue( "Archiva Managed Repository id:<" + repoId + "> should have a valid location on disk.", repoRoot + .exists() + && repoRoot.isDirectory() ); + } + + protected void assertResponseOK( WebResponse response ) + { + assertNotNull( "Should have recieved a response", response ); + Assert.assertEquals( "Should have been an OK response code.", HttpServletResponse.SC_OK, response.getResponseCode() ); + } + + protected void assertResponseNotFound( WebResponse response ) + { + assertNotNull( "Should have recieved a response", response ); + Assert.assertEquals( "Should have been an 404/Not Found response code.", HttpServletResponse.SC_NOT_FOUND, response + .getResponseCode() ); + } + + protected ManagedRepositoryConfiguration createManagedRepository( String id, String name, File location ) + { + ManagedRepositoryConfiguration repo = new ManagedRepositoryConfiguration(); + repo.setId( id ); + repo.setName( name ); + repo.setLocation( location.getAbsolutePath() ); + return repo; + } + + protected RemoteRepositoryConfiguration createRemoteRepository( String id, String name, String url ) + { + RemoteRepositoryConfiguration repo = new RemoteRepositoryConfiguration(); + repo.setId( id ); + repo.setName( name ); + repo.setUrl( url ); + return repo; + } + + protected void dumpResponse( WebResponse response ) + { + System.out.println( "---(response)---" ); + System.out.println( "" + response.getResponseCode() + " " + response.getResponseMessage() ); + + String headerNames[] = response.getHeaderFieldNames(); + for ( String headerName : headerNames ) + { + System.out.println( "[header] " + headerName + ": " + response.getHeaderField( headerName ) ); + } + + System.out.println( "---(text)---" ); + try + { + System.out.println( response.getText() ); + } + catch ( IOException e ) + { + System.err.print( "[Exception] : " ); + e.printStackTrace( System.err ); + } + } + + protected void saveConfiguration( ArchivaConfiguration archivaConfiguration ) + throws Exception + { + archivaConfiguration.save( archivaConfiguration.getConfiguration() ); + } + + protected void setUp() + throws Exception + { + super.setUp(); + + String appserverBase = getTestFile( "target/appserver-base" ).getAbsolutePath(); + System.setProperty( "appserver.base", appserverBase ); + + File testConf = getTestFile( "src/test/resources/repository-archiva.xml" ); + File testConfDest = new File( appserverBase, "conf/archiva.xml" ); + FileUtils.copyFile( testConf, testConfDest ); + + archivaConfiguration = (ArchivaConfiguration) lookup( ArchivaConfiguration.class ); + repoRootInternal = new File( appserverBase, "data/repositories/internal" ); + Configuration config = archivaConfiguration.getConfiguration(); + + config.addManagedRepository( createManagedRepository( REPOID_INTERNAL, "Internal Test Repo", repoRootInternal ) ); + saveConfiguration( archivaConfiguration ); + + CacheManager.getInstance().removeCache( "url-failures-cache" ); + + HttpUnitOptions.setExceptionsThrownOnErrorStatus( false ); + + sr = new ServletRunner( getTestFile( "src/test/resources/WEB-INF/web.xml" ) ); + sr.registerServlet( "/repository/*", UnauthenticatedRepositoryServlet.class.getName() ); + sc = sr.newClient(); + } + + @Override + protected String getPlexusConfigLocation() + { + return "org/apache/maven/archiva/webdav/RepositoryServletTest.xml"; + } + + @Override + protected void tearDown() + throws Exception + { + if ( sc != null ) + { + sc.clearContents(); + } + + if ( sr != null ) + { + sr.shutDown(); + } + + if (repoRootInternal.exists()) + { + FileUtils.deleteDirectory(repoRootInternal); + } + + super.tearDown(); + } + + protected void setupCleanRepo( File repoRootDir ) + throws IOException + { + FileUtils.deleteDirectory( repoRootDir ); + if ( !repoRootDir.exists() ) + { + repoRootDir.mkdirs(); + } + } + + protected void assertManagedFileNotExists( File repoRootInternal, String resourcePath ) + { + File repoFile = new File( repoRootInternal, resourcePath ); + assertFalse( "Managed Repository File <" + repoFile.getAbsolutePath() + "> should not exist.", repoFile + .exists() ); + } + + protected void setupCleanInternalRepo() + throws Exception + { + setupCleanRepo( repoRootInternal ); + } + + protected File populateRepo( File repoRootManaged, String path, String contents ) + throws Exception + { + File destFile = new File( repoRootManaged, path ); + destFile.getParentFile().mkdirs(); + FileUtils.writeStringToFile( destFile, contents, null ); + return destFile; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/ArchivaDavResourceLocatorTest.java b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/ArchivaDavResourceLocatorTest.java new file mode 100644 index 000000000..e81c134e5 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/ArchivaDavResourceLocatorTest.java @@ -0,0 +1,111 @@ +package org.apache.maven.archiva.webdav; + +/* + * 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; + +/** + * @author James William Dumay + */ +public class ArchivaDavResourceLocatorTest extends TestCase +{ + ArchivaDavLocatorFactory factory; + + @Override + protected void setUp() + throws Exception + { + super.setUp(); + factory = new ArchivaDavLocatorFactory(); + } + + public void testAvoidDoubleSlashInHref() + throws Exception + { + String prefix = "http://myproxy/"; + String href = "/repository/internal/"; + ArchivaDavResourceLocator locator = getLocator(prefix, href); + + assertEquals("internal", locator.getRepositoryId()); + assertEquals("", locator.getWorkspaceName()); + assertEquals("", locator.getWorkspacePath()); + assertEquals("http://myproxy/", locator.getPrefix()); + assertEquals("http://myproxy/repository/internal/", locator.getHref(false)); + assertEquals("http://myproxy/repository/internal/", locator.getHref(true)); + assertEquals("/repository/internal", locator.getResourcePath()); + assertEquals("/repository/internal", locator.getRepositoryPath()); + } + + public void testLocatorWithPrefixHref() + throws Exception + { + String prefix = "http://myproxy/"; + String href = "/repository/internal"; + ArchivaDavResourceLocator locator = getLocator(prefix, href); + + assertEquals("internal", locator.getRepositoryId()); + assertEquals("", locator.getWorkspaceName()); + assertEquals("", locator.getWorkspacePath()); + assertEquals("http://myproxy/", locator.getPrefix()); + assertEquals("http://myproxy/repository/internal", locator.getHref(false)); + assertEquals("http://myproxy/repository/internal/", locator.getHref(true)); + assertEquals("/repository/internal", locator.getResourcePath()); + assertEquals("/repository/internal", locator.getRepositoryPath()); + } + + public void testLocatorWithHrefThatContainsPrefix() + throws Exception + { + String prefix = "http://myproxy/"; + String href = "http://myproxy/repository/internal"; + ArchivaDavResourceLocator locator = getLocator(prefix, href); + + assertEquals("internal", locator.getRepositoryId()); + assertEquals("", locator.getWorkspaceName()); + assertEquals("", locator.getWorkspacePath()); + assertEquals("http://myproxy/", locator.getPrefix()); + assertEquals("http://myproxy/repository/internal", locator.getHref(false)); + assertEquals("http://myproxy/repository/internal/", locator.getHref(true)); + assertEquals("/repository/internal", locator.getResourcePath()); + assertEquals("/repository/internal", locator.getRepositoryPath()); + } + + public void testLocatorWithRootHref() + throws Exception + { + String prefix = "http://myproxy/"; + String href = "/"; + ArchivaDavResourceLocator locator = getLocator(prefix, href); + + assertEquals("", locator.getRepositoryId()); + assertEquals("", locator.getWorkspaceName()); + assertEquals("", locator.getWorkspacePath()); + assertEquals("http://myproxy/", locator.getPrefix()); + assertEquals("http://myproxy/", locator.getHref(false)); + assertEquals("http://myproxy/", locator.getHref(true)); + assertEquals("/", locator.getResourcePath()); + assertEquals("/", locator.getRepositoryPath()); + } + + private ArchivaDavResourceLocator getLocator( String prefix, String href ) + { + return (ArchivaDavResourceLocator)factory.createResourceLocator(prefix, href); + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/ArchivaDavSessionProviderTest.java b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/ArchivaDavSessionProviderTest.java new file mode 100644 index 000000000..2a53bf99d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/ArchivaDavSessionProviderTest.java @@ -0,0 +1,444 @@ +package org.apache.maven.archiva.webdav; + +/* + * 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.BufferedReader; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.security.Principal; +import java.util.Enumeration; +import java.util.Locale; +import java.util.Map; +import javax.servlet.RequestDispatcher; +import javax.servlet.ServletInputStream; +import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; +import junit.framework.TestCase; +import org.apache.jackrabbit.webdav.DavSessionProvider; +import org.apache.jackrabbit.webdav.WebdavRequest; +import org.apache.jackrabbit.webdav.WebdavRequestImpl; +import org.apache.maven.archiva.security.ServletAuthenticator; +import org.codehaus.plexus.redback.authentication.AuthenticationDataSource; +import org.codehaus.plexus.redback.authentication.AuthenticationException; +import org.codehaus.plexus.redback.authentication.AuthenticationResult; +import org.codehaus.plexus.redback.authorization.AuthorizationException; +import org.codehaus.plexus.redback.authorization.UnauthorizedException; +import org.codehaus.plexus.redback.policy.AccountLockedException; +import org.codehaus.plexus.redback.policy.MustChangePasswordException; +import org.codehaus.plexus.redback.system.SecuritySession; +import org.codehaus.plexus.redback.users.User; +import org.codehaus.plexus.redback.xwork.filter.authentication.HttpAuthenticator; + +public class ArchivaDavSessionProviderTest extends TestCase +{ + private DavSessionProvider sessionProvider; + + private WebdavRequest request; + + @Override + protected void setUp() + throws Exception + { + super.setUp(); + sessionProvider = new ArchivaDavSessionProvider(new ServletAuthenticatorMock(), new HttpAuthenticatorMock()); + request = new WebdavRequestImpl(new HttpServletRequestMock(), null); + } + + public void testAttachSession() + throws Exception + { + assertNull(request.getDavSession()); + sessionProvider.attachSession(request); + assertNotNull(request.getDavSession()); + } + + public void testReleaseSession() + throws Exception + { + assertNull(request.getDavSession()); + sessionProvider.attachSession(request); + assertNotNull(request.getDavSession()); + + sessionProvider.releaseSession(request); + assertNull(request.getDavSession()); + } + + private class HttpServletRequestMock implements HttpServletRequest + { + public Object getAttribute(String arg0) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public Enumeration getAttributeNames() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public String getCharacterEncoding() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public int getContentLength() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public String getContentType() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public ServletInputStream getInputStream() + throws IOException + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public String getLocalAddr() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public String getLocalName() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public int getLocalPort() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public Locale getLocale() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public Enumeration getLocales() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public String getParameter(String arg0) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public Map getParameterMap() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public Enumeration getParameterNames() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public String[] getParameterValues(String arg0) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public String getProtocol() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public BufferedReader getReader() + throws IOException + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public String getRealPath(String arg0) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public String getRemoteAddr() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public String getRemoteHost() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public int getRemotePort() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public RequestDispatcher getRequestDispatcher(String arg0) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public String getScheme() + { + return ""; + } + + public String getServerName() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public int getServerPort() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public boolean isSecure() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void removeAttribute(String arg0) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void setAttribute(String arg0, Object arg1) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void setCharacterEncoding(String arg0) + throws UnsupportedEncodingException + { + throw new UnsupportedOperationException("Not supported yet."); + } + + + public String getAuthType() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public String getContextPath() + { + return "/"; + } + + public Cookie[] getCookies() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public long getDateHeader(String arg0) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public String getHeader(String arg0) { + return ""; + } + + public Enumeration getHeaderNames() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public Enumeration getHeaders(String arg0) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public int getIntHeader(String arg0) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public String getMethod() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public String getPathInfo() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public String getPathTranslated() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public String getQueryString() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public String getRemoteUser() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public String getRequestURI() + { + return "/"; + } + + public StringBuffer getRequestURL() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public String getRequestedSessionId() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public String getServletPath() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public HttpSession getSession(boolean arg0) + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public HttpSession getSession() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public Principal getUserPrincipal() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public boolean isRequestedSessionIdFromCookie() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public boolean isRequestedSessionIdFromURL() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public boolean isRequestedSessionIdFromUrl() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public boolean isRequestedSessionIdValid() + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public boolean isUserInRole(String arg0) + { + throw new UnsupportedOperationException("Not supported yet."); + } + } + + private class ServletAuthenticatorMock implements ServletAuthenticator + { + public boolean isAuthenticated(HttpServletRequest arg0, AuthenticationResult arg1) + throws AuthenticationException, AccountLockedException, MustChangePasswordException + { + return true; + } + + public boolean isAuthorized(HttpServletRequest arg0, SecuritySession arg1, String arg2, boolean arg3) + throws AuthorizationException, UnauthorizedException + { + return true; + } + + public boolean isAuthorizedToAccessVirtualRepository(String arg0, String arg1) + throws UnauthorizedException + { + return true; + } + } + + private class HttpAuthenticatorMock extends HttpAuthenticator + { + @Override + public void challenge(HttpServletRequest arg0, HttpServletResponse arg1, String arg2, AuthenticationException arg3) + throws IOException + { + //Do nothing + } + + @Override + public AuthenticationResult getAuthenticationResult(HttpServletRequest arg0, HttpServletResponse arg1) + throws AuthenticationException, AccountLockedException, MustChangePasswordException + { + return new AuthenticationResult(); + } + + + @Override + public AuthenticationResult authenticate(AuthenticationDataSource arg0) + throws AuthenticationException, AccountLockedException, MustChangePasswordException + { + return new AuthenticationResult(); + } + + @Override + public void authenticate(HttpServletRequest arg0, HttpServletResponse arg1) + throws AuthenticationException + { + //Do nothing + } + + @Override + public Map getContextSession() + { + return super.getContextSession(); + } + + @Override + public SecuritySession getSecuritySession() + { + return super.getSecuritySession(); + } + + @Override + public User getSessionUser() + { + return super.getSessionUser(); + } + + @Override + public boolean isAlreadyAuthenticated() + { + return super.isAlreadyAuthenticated(); + } + + @Override + public void setSecuritySession(SecuritySession session) + { + super.setSecuritySession(session); + } + + @Override + public void setSessionUser(User user) { + super.setSessionUser(user); + } + + @Override + public String storeDefaultUser(String user) { + return super.storeDefaultUser(user); + } + + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/ArchivaDavSessionTest.java b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/ArchivaDavSessionTest.java new file mode 100644 index 000000000..61348bc24 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/ArchivaDavSessionTest.java @@ -0,0 +1,66 @@ +package org.apache.maven.archiva.webdav; + +/* + * 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; + +public class ArchivaDavSessionTest extends TestCase +{ + public void testTokens() + { + ArchivaDavSession session = new ArchivaDavSession(); + final String myToken = "thisisadavtoken"; + + session.addLockToken(myToken); + assertEquals(1, session.getLockTokens().length); + assertEquals(myToken, session.getLockTokens()[0]); + + session.removeLockToken(myToken); + assertEquals(0, session.getLockTokens().length); + } + + public void testAddReferencesThrowsUnsupportedOperationException() + { + ArchivaDavSession session = new ArchivaDavSession(); + try + { + session.addReference(new Object()); + fail("Did not throw UnsupportedOperationException"); + } + catch (UnsupportedOperationException e) + { + assertTrue(true); + } + } + + public void testRemoveReferencesThrowsUnsupportedOperationException() + { + ArchivaDavSession session = new ArchivaDavSession(); + try + { + session.removeReference(new Object()); + fail("Did not throw UnsupportedOperationException"); + } + catch (UnsupportedOperationException e) + { + assertTrue(true); + } + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/BypassSecuritySystem.java b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/BypassSecuritySystem.java new file mode 100644 index 000000000..9ad1ae6f9 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/BypassSecuritySystem.java @@ -0,0 +1,134 @@ +package org.apache.maven.archiva.webdav; + +/* + * 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.codehaus.plexus.redback.authentication.AuthenticationDataSource; +import org.codehaus.plexus.redback.authentication.AuthenticationException; +import org.codehaus.plexus.redback.authentication.AuthenticationResult; +import org.codehaus.plexus.redback.authorization.AuthorizationException; +import org.codehaus.plexus.redback.authorization.AuthorizationResult; +import org.codehaus.plexus.redback.keys.KeyManager; +import org.codehaus.plexus.redback.keys.memory.MemoryKeyManager; +import org.codehaus.plexus.redback.policy.AccountLockedException; +import org.codehaus.plexus.redback.policy.DefaultUserSecurityPolicy; +import org.codehaus.plexus.redback.policy.UserSecurityPolicy; +import org.codehaus.plexus.redback.system.DefaultSecuritySession; +import org.codehaus.plexus.redback.system.DefaultSecuritySystem; +import org.codehaus.plexus.redback.system.SecuritySession; +import org.codehaus.plexus.redback.system.SecuritySystem; +import org.codehaus.plexus.redback.users.UserManager; +import org.codehaus.plexus.redback.users.UserNotFoundException; +import org.codehaus.plexus.redback.users.memory.MemoryUserManager; + +/** + * BypassSecuritySystem - used to bypass the security system for testing reasons and allow + * for every request to respond as success / true. + * + * @author Joakim Erdfelt + * @version $Id$ + * + * @plexus.component + * role="org.codehaus.plexus.redback.system.SecuritySystem" + */ +public class BypassSecuritySystem + extends DefaultSecuritySystem + implements SecuritySystem +{ + private KeyManager bypassKeyManager; + private UserSecurityPolicy bypassPolicy; + private UserManager bypassUserManager; + + public BypassSecuritySystem() + { + bypassKeyManager = new MemoryKeyManager(); + bypassPolicy = new DefaultUserSecurityPolicy(); + bypassUserManager = new MemoryUserManager(); + } + + public SecuritySession authenticate( AuthenticationDataSource source ) + throws AuthenticationException, UserNotFoundException, AccountLockedException + { + AuthenticationResult result = new AuthenticationResult( true, source.getPrincipal(), null ); + return new DefaultSecuritySession( result ); + } + + public AuthorizationResult authorize( SecuritySession session, Object permission ) + throws AuthorizationException + { + return new AuthorizationResult( true, session.getUser(), null ); + } + + public AuthorizationResult authorize( SecuritySession session, Object permission, Object resource ) + throws AuthorizationException + { + return new AuthorizationResult( true, session.getUser(), null ); + } + + public String getAuthenticatorId() + { + return "bypass-authenticator"; + } + + public String getAuthorizerId() + { + return "bypass-authorizer"; + } + + public KeyManager getKeyManager() + { + return bypassKeyManager; + } + + public UserSecurityPolicy getPolicy() + { + return bypassPolicy; + } + + public String getUserManagementId() + { + return "bypass-managementid"; + } + + public UserManager getUserManager() + { + return bypassUserManager; + } + + public boolean isAuthenticated( AuthenticationDataSource source ) + throws AuthenticationException, UserNotFoundException, AccountLockedException + { + // Always true + return true; + } + + public boolean isAuthorized( SecuritySession session, Object permission ) + throws AuthorizationException + { + // Always true + return true; + } + + public boolean isAuthorized( SecuritySession session, Object permission, Object resource ) + throws AuthorizationException + { + // Always true + return true; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/DavResourceTest.java b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/DavResourceTest.java new file mode 100644 index 000000000..cbbc8f589 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/DavResourceTest.java @@ -0,0 +1,308 @@ +package org.apache.maven.archiva.webdav; + +/* + * 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; +import java.util.List; + +import org.apache.commons.io.FileUtils; +import org.apache.jackrabbit.webdav.DavException; +import org.apache.jackrabbit.webdav.DavResource; +import org.apache.jackrabbit.webdav.DavResourceFactory; +import org.apache.jackrabbit.webdav.DavResourceLocator; +import org.apache.jackrabbit.webdav.DavServletRequest; +import org.apache.jackrabbit.webdav.DavServletResponse; +import org.apache.jackrabbit.webdav.DavSession; +import org.apache.jackrabbit.webdav.lock.ActiveLock; +import org.apache.jackrabbit.webdav.lock.LockInfo; +import org.apache.jackrabbit.webdav.lock.LockManager; +import org.apache.jackrabbit.webdav.lock.Scope; +import org.apache.jackrabbit.webdav.lock.SimpleLockManager; +import org.apache.jackrabbit.webdav.lock.Type; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.repository.audit.AuditListener; +import org.apache.maven.archiva.repository.scanner.RepositoryContentConsumers; +import org.apache.maven.archiva.webdav.util.MimeTypes; +import org.codehaus.plexus.spring.PlexusInSpringTestCase; +import org.codehaus.plexus.spring.PlexusToSpringUtils; +import org.easymock.MockControl; + +import edu.emory.mathcs.backport.java.util.Collections; + +public class DavResourceTest extends PlexusInSpringTestCase +{ + private DavSession session; + + private MimeTypes mimeTypes; + + private ArchivaDavResourceLocator resourceLocator; + + private DavResourceFactory resourceFactory; + + private File baseDir; + + private final String REPOPATH = "myresource.jar"; + + private File myResource; + + private DavResource resource; + + private LockManager lockManager; + + private RepositoryContentConsumers consumers; + + private ManagedRepositoryConfiguration repository = new ManagedRepositoryConfiguration(); + + @Override + protected void setUp() + throws Exception + { + super.setUp(); + session = new ArchivaDavSession(); + mimeTypes = (MimeTypes)getApplicationContext().getBean(PlexusToSpringUtils.buildSpringId(MimeTypes.class)); + baseDir = getTestFile("target/DavResourceTest"); + baseDir.mkdirs(); + myResource = new File(baseDir, "myresource.jar"); + assertTrue("Could not create " + myResource.getAbsolutePath(), myResource.createNewFile()); + resourceFactory = new RootContextDavResourceFactory(); + resourceLocator = (ArchivaDavResourceLocator)new ArchivaDavLocatorFactory().createResourceLocator("/", REPOPATH); + resource = getDavResource(resourceLocator.getHref(false), myResource); + lockManager = new SimpleLockManager(); + resource.addLockManager(lockManager); + consumers = new RepositoryContentConsumers(); + } + + @Override + protected void tearDown() + throws Exception + { + super.tearDown(); + release(mimeTypes); + FileUtils.deleteDirectory(baseDir); + } + + private DavResource getDavResource(String logicalPath, File file) + { + return new ArchivaDavResource( file.getAbsolutePath(), logicalPath, repository, session, resourceLocator, + resourceFactory, mimeTypes, Collections.emptyList(), consumers ); + } + + public void testDeleteNonExistantResourceShould404() + throws Exception + { + File dir = new File(baseDir, "testdir"); + try + { + DavResource directoryResource = getDavResource("/testdir", dir); + directoryResource.getCollection().removeMember(directoryResource); + fail("Did not throw DavException"); + } + catch (DavException e) + { + assertEquals(DavServletResponse.SC_NOT_FOUND, e.getErrorCode()); + } + } + + public void testDeleteCollection() + throws Exception + { + File dir = new File(baseDir, "testdir"); + try + { + assertTrue(dir.mkdir()); + DavResource directoryResource = getDavResource("/testdir", dir); + directoryResource.getCollection().removeMember(directoryResource); + assertFalse(dir.exists()); + } + finally + { + FileUtils.deleteDirectory(dir); + } + } + + public void testDeleteResource() + throws Exception + { + assertTrue(myResource.exists()); + resource.getCollection().removeMember(resource); + assertFalse(myResource.exists()); + } + + public void testIsLockable() + { + assertTrue(resource.isLockable(Type.WRITE, Scope.EXCLUSIVE)); + assertFalse(resource.isLockable(Type.WRITE, Scope.SHARED)); + } + + public void testLock() + throws Exception + { + assertEquals(0, resource.getLocks().length); + + LockInfo info = new LockInfo(Scope.EXCLUSIVE, Type.WRITE, "/", 0, false); + lockManager.createLock(info, resource); + + assertEquals(1, resource.getLocks().length); + } + + public void testLockIfResourceUnlockable() + throws Exception + { + assertEquals(0, resource.getLocks().length); + + LockInfo info = new LockInfo(Scope.SHARED, Type.WRITE, "/", 0, false); + try + { + lockManager.createLock(info, resource); + fail("Did not throw dav exception"); + } + catch (Exception e) + { + //Simple lock manager will die + } + assertEquals(0, resource.getLocks().length); + } + + public void testGetLock() + throws Exception + { + LockInfo info = new LockInfo(Scope.EXCLUSIVE, Type.WRITE, "/", 0, false); + lockManager.createLock(info, resource); + + assertEquals(1, resource.getLocks().length); + + //Lock should exist + assertNotNull(resource.getLock(Type.WRITE, Scope.EXCLUSIVE)); + + //Lock should not exist + assertNull(resource.getLock(Type.WRITE, Scope.SHARED)); + } + + + public void testRefreshLockThrowsExceptionIfNoLockIsPresent() + throws Exception + { + LockInfo info = new LockInfo(Scope.EXCLUSIVE, Type.WRITE, "/", 0, false); + + assertEquals(0, resource.getLocks().length); + + try + { + lockManager.refreshLock(info, "notoken", resource); + fail("Did not throw dav exception"); + } + catch (DavException e) + { + assertEquals(DavServletResponse.SC_PRECONDITION_FAILED, e.getErrorCode()); + } + + assertEquals(0, resource.getLocks().length); + } + + public void testRefreshLock() + throws Exception + { + LockInfo info = new LockInfo(Scope.EXCLUSIVE, Type.WRITE, "/", 0, false); + + assertEquals(0, resource.getLocks().length); + + lockManager.createLock(info, resource); + + assertEquals(1, resource.getLocks().length); + + ActiveLock lock = resource.getLocks()[0]; + + lockManager.refreshLock(info, lock.getToken(), resource); + + assertEquals(1, resource.getLocks().length); + } + + public void testUnlock() + throws Exception + { + LockInfo info = new LockInfo(Scope.EXCLUSIVE, Type.WRITE, "/", 0, false); + + assertEquals(0, resource.getLocks().length); + + lockManager.createLock(info, resource); + + assertEquals(1, resource.getLocks().length); + + ActiveLock lock = resource.getLocks()[0]; + + lockManager.releaseLock(lock.getToken(), resource); + + assertEquals(0, resource.getLocks().length); + } + + public void testUnlockThrowsDavExceptionIfNotLocked() + throws Exception + { + LockInfo info = new LockInfo(Scope.EXCLUSIVE, Type.WRITE, "/", 0, false); + + assertEquals(0, resource.getLocks().length); + + lockManager.createLock(info, resource); + + assertEquals(1, resource.getLocks().length); + + try + { + lockManager.releaseLock("BLAH", resource); + fail("Did not throw DavException"); + } + catch (DavException e) + { + assertEquals(DavServletResponse.SC_LOCKED, e.getErrorCode()); + } + + assertEquals(1, resource.getLocks().length); + } + + public void testUnlockThrowsDavExceptionIfResourceNotLocked() + throws Exception + { + assertEquals(0, resource.getLocks().length); + + try + { + lockManager.releaseLock("BLAH", resource); + fail("Did not throw DavException"); + } + catch (DavException e) + { + assertEquals(DavServletResponse.SC_PRECONDITION_FAILED, e.getErrorCode()); + } + + assertEquals(0, resource.getLocks().length); + } + + private class RootContextDavResourceFactory implements DavResourceFactory + { + public DavResource createResource(DavResourceLocator locator, DavServletRequest request, DavServletResponse response) throws DavException { + throw new UnsupportedOperationException("Not supported yet."); + } + + public DavResource createResource(DavResourceLocator locator, DavSession session) throws DavException { + return new ArchivaDavResource( baseDir.getAbsolutePath(), "/", repository, session, resourceLocator, + resourceFactory, mimeTypes, Collections.emptyList(), consumers ); + } + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/MimeTypesLoaderTest.java b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/MimeTypesLoaderTest.java new file mode 100644 index 000000000..49c10b9c3 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/MimeTypesLoaderTest.java @@ -0,0 +1,48 @@ +package org.apache.maven.archiva.webdav; + +/* + * 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.archiva.webdav.util.MimeTypes; +import org.codehaus.plexus.spring.PlexusInSpringTestCase; + +/** + * ArchivaMimeTypesTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class MimeTypesLoaderTest + extends PlexusInSpringTestCase +{ + public void testArchivaTypes() + throws Exception + { + lookup( MimeTypes.class ); + MimeTypes mimeTypes = (MimeTypes) lookup( MimeTypes.class ); + assertNotNull( mimeTypes ); + + // Test for some added types. + assertEquals( "sha1", "text/plain", mimeTypes.getMimeType( "foo.sha1" ) ); + assertEquals( "md5", "text/plain", mimeTypes.getMimeType( "foo.md5" ) ); + assertEquals( "pgp", "application/pgp-encrypted", mimeTypes.getMimeType( "foo.pgp" ) ); + assertEquals( "jar", "application/java-archive", mimeTypes.getMimeType( "foo.jar" ) ); + assertEquals( "Default", "application/octet-stream", mimeTypes.getMimeType(".SomeUnknownExtension")); + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletBrowseTest.java b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletBrowseTest.java new file mode 100644 index 000000000..169c90fab --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletBrowseTest.java @@ -0,0 +1,108 @@ +package org.apache.maven.archiva.webdav; + +/* + * 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 com.meterware.httpunit.GetMethodWebRequest; +import com.meterware.httpunit.WebLink; +import com.meterware.httpunit.WebRequest; +import com.meterware.httpunit.WebResponse; + +import java.io.File; + +import javax.servlet.http.HttpServletResponse; + +/** + * RepositoryServletBrowseTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class RepositoryServletBrowseTest + extends AbstractRepositoryServletTestCase +{ + @Override + protected void setUp() + throws Exception + { + super.setUp(); + + new File( repoRootInternal, "org/apache/archiva" ).mkdirs(); + new File( repoRootInternal, "org/codehaus/mojo/" ).mkdirs(); + new File( repoRootInternal, "net/sourceforge" ).mkdirs(); + new File( repoRootInternal, "commons-lang" ).mkdirs(); + } + + public void testBrowse() + throws Exception + { + WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/internal/" ); + WebResponse response = sc.getResponse( request ); + assertEquals( "Response", HttpServletResponse.SC_OK, response.getResponseCode() ); + + // dumpResponse( response ); + + String expectedLinks[] = new String[] { "commons-lang/", "net/", "org/" }; + assertLinks(expectedLinks, response.getLinks()); + } + + public void testBrowseSubdirectory() + throws Exception + { + WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/internal/org" ); + WebResponse response = sc.getResponse( request ); + assertEquals( "Response", HttpServletResponse.SC_OK, response.getResponseCode() ); + + String expectedLinks[] = new String[] { "../", "apache/", "codehaus/" }; + assertLinks(expectedLinks, response.getLinks()); + } + + public void testGetDirectoryWhichHasMatchingFile() //MRM-893 + throws Exception + { + new File( repoRootInternal, "org/apache/archiva/artifactId/1.0" ).mkdirs(); + new File( repoRootInternal, "org/apache/archiva/artifactId/1.0/artifactId-1.0.jar" ).createNewFile(); + + WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/internal/org/apache/archiva/artifactId" ); + WebResponse response = sc.getResponse( request ); + assertEquals( "Response", HttpServletResponse.SC_OK, response.getResponseCode() ); + + request = new GetMethodWebRequest( "http://machine.com/repository/internal/org/apache/archiva/artifactId/" ); + response = sc.getResponse( request ); + assertEquals( "Response", HttpServletResponse.SC_OK, response.getResponseCode() ); + + request = new GetMethodWebRequest( "http://machine.com/repository/internal/org/apache/archiva/artifactId/1.0/artifactId-1.0.jar" ); + response = sc.getResponse( request ); + assertEquals( "Response", HttpServletResponse.SC_OK, response.getResponseCode() ); + + request = new GetMethodWebRequest( "http://machine.com/repository/internal/org/apache/archiva/artifactId/1.0/artifactId-1.0.jar/" ); + response = sc.getResponse( request ); + assertEquals( "Response", HttpServletResponse.SC_NOT_FOUND, response.getResponseCode() ); + } + + + private void assertLinks(String expectedLinks[], WebLink actualLinks[]) + { + assertEquals( "Links.length", expectedLinks.length, actualLinks.length ); + for ( int i = 0; i < actualLinks.length; i++ ) + { + assertEquals( "Link[" + i + "]", expectedLinks[i], actualLinks[i].getURLString() ); + } + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletDeployTest.java b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletDeployTest.java new file mode 100644 index 000000000..05c0db18d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletDeployTest.java @@ -0,0 +1,81 @@ +package org.apache.maven.archiva.webdav; + +/* + * 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 com.meterware.httpunit.PutMethodWebRequest; +import com.meterware.httpunit.WebRequest; +import com.meterware.httpunit.WebResponse; + +import java.io.File; +import java.io.InputStream; + +import javax.servlet.http.HttpServletResponse; +import org.apache.maven.archiva.webdav.httpunit.MkColMethodWebRequest; + + +/** + * Deploy / Put Test cases for RepositoryServlet. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class RepositoryServletDeployTest + extends AbstractRepositoryServletTestCase +{ + public void testPutWithMissingParentCollection() + throws Exception + { + setupCleanRepo( repoRootInternal ); + + String putUrl = "http://machine.com/repository/internal/path/to/artifact.jar"; + InputStream is = getClass().getResourceAsStream( "/artifact.jar" ); + assertNotNull( "artifact.jar inputstream", is ); + + WebRequest request = new PutMethodWebRequest( putUrl, is, "application/octet-stream" ); + + WebResponse response = sc.getResponse( request ); + assertResponseCreated( response ); + assertFileContents( "artifact.jar\n", repoRootInternal, "path/to/artifact.jar" ); + } + + public void testMkColWithMissingParentCollectionFails() + throws Exception + { + setupCleanRepo( repoRootInternal ); + + String putUrl = "http://machine.com/repository/internal/path/to/"; + + WebRequest request = new MkColMethodWebRequest( putUrl ); + + WebResponse response = sc.getResponse( request ); + + assertEquals(HttpServletResponse.SC_CONFLICT, response.getResponseCode()); + + File mkColLocalPath = new File(repoRootInternal, "path/to/"); + assertFalse(mkColLocalPath.exists()); + } + + protected void assertResponseCreated( WebResponse response ) + { + assertNotNull( "Should have recieved a response", response ); + assertEquals( "Should have been a 201/CREATED response code.", HttpServletResponse.SC_CREATED, response + .getResponseCode() ); + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletNoProxyMetadataTest.java b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletNoProxyMetadataTest.java new file mode 100644 index 000000000..5efdb52eb --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletNoProxyMetadataTest.java @@ -0,0 +1,110 @@ +package org.apache.maven.archiva.webdav; + +/* + * 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 com.meterware.httpunit.GetMethodWebRequest; +import com.meterware.httpunit.WebRequest; +import com.meterware.httpunit.WebResponse; +import org.apache.commons.io.FileUtils; + +import java.io.File; + +/** + * RepositoryServletTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class RepositoryServletNoProxyMetadataTest + extends AbstractRepositoryServletTestCase +{ + public void testGetVersionMetadataDefaultLayout() + throws Exception + { + String commonsLangMetadata = "commons-lang/commons-lang/2.1/maven-metadata.xml"; + String expectedMetadataContents = "metadata-for-commons-lang-version-2.1"; + + File checksumFile = new File( repoRootInternal, commonsLangMetadata ); + checksumFile.getParentFile().mkdirs(); + + FileUtils.writeStringToFile( checksumFile, expectedMetadataContents, null ); + + WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/internal/" + commonsLangMetadata ); + WebResponse response = sc.getResponse( request ); + assertResponseOK( response ); + + assertEquals( "Expected file contents", expectedMetadataContents, response.getText() ); + } + + public void testGetProjectMetadataDefaultLayout() + throws Exception + { + String commonsLangMetadata = "commons-lang/commons-lang/maven-metadata.xml"; + String expectedMetadataContents = "metadata-for-commons-lang-version-for-project"; + + File checksumFile = new File( repoRootInternal, commonsLangMetadata ); + checksumFile.getParentFile().mkdirs(); + + FileUtils.writeStringToFile( checksumFile, expectedMetadataContents, null ); + + WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/internal/" + commonsLangMetadata ); + WebResponse response = sc.getResponse( request ); + assertResponseOK( response ); + + assertEquals( "Expected file contents", expectedMetadataContents, response.getText() ); + } + + public void testGetGroupMetadataDefaultLayout() + throws Exception + { + String commonsLangMetadata = "commons-lang/maven-metadata.xml"; + String expectedMetadataContents = "metadata-for-commons-lang-group"; + + File checksumFile = new File( repoRootInternal, commonsLangMetadata ); + checksumFile.getParentFile().mkdirs(); + + FileUtils.writeStringToFile( checksumFile, expectedMetadataContents, null ); + + WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/internal/" + commonsLangMetadata ); + WebResponse response = sc.getResponse( request ); + assertResponseOK( response ); + + assertEquals( "Expected file contents", expectedMetadataContents, response.getText() ); + } + + public void testGetSnapshotVersionMetadataDefaultLayout() + throws Exception + { + String assemblyPluginMetadata = "org/apache/maven/plugins/maven-assembly-plugin/2.2-beta-2-SNAPSHOT/maven-metadata.xml"; + String expectedMetadataContents = "metadata-for-assembly-plugin-version-2.2-beta-2-SNAPSHOT"; + + File checksumFile = new File( repoRootInternal, assemblyPluginMetadata ); + checksumFile.getParentFile().mkdirs(); + + FileUtils.writeStringToFile( checksumFile, expectedMetadataContents, null ); + + WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/internal/" + assemblyPluginMetadata ); + WebResponse response = sc.getResponse( request ); + assertResponseOK( response ); + + assertEquals( "Expected file contents", expectedMetadataContents, response.getText() ); + } + +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletNoProxyTest.java b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletNoProxyTest.java new file mode 100644 index 000000000..b6b0094b3 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletNoProxyTest.java @@ -0,0 +1,274 @@ +package org.apache.maven.archiva.webdav; + +/* + * 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 com.meterware.httpunit.GetMethodWebRequest; +import com.meterware.httpunit.WebRequest; +import com.meterware.httpunit.WebResponse; +import org.apache.commons.io.FileUtils; + +import java.io.File; + +/** + * RepositoryServletTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class RepositoryServletNoProxyTest + extends AbstractRepositoryServletTestCase +{ + public void testLastModifiedHeaderExists() + throws Exception + { + String commonsLangSha1 = "commons-lang/commons-lang/2.1/commons-lang-2.1.jar.sha1"; + + File checksumFile = new File( repoRootInternal, commonsLangSha1 ); + checksumFile.getParentFile().mkdirs(); + + FileUtils.writeStringToFile( checksumFile, "dummy-checksum", null ); + + WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/internal/" + commonsLangSha1 ); + WebResponse response = sc.getResponse( request ); + + assertNotNull(response.getHeaderField("last-modified")); + } + + public void testGetNoProxyChecksumDefaultLayout() + throws Exception + { + String commonsLangSha1 = "commons-lang/commons-lang/2.1/commons-lang-2.1.jar.sha1"; + + File checksumFile = new File( repoRootInternal, commonsLangSha1 ); + checksumFile.getParentFile().mkdirs(); + + FileUtils.writeStringToFile( checksumFile, "dummy-checksum", null ); + + WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/internal/" + commonsLangSha1 ); + WebResponse response = sc.getResponse( request ); + assertResponseOK( response ); + + assertEquals( "Expected file contents", "dummy-checksum", response.getText() ); + } + + public void testGetNoProxyChecksumLegacyLayout() + throws Exception + { + String commonsLangSha1 = "commons-lang/commons-lang/2.1/commons-lang-2.1.jar.sha1"; + + File checksumFile = new File( repoRootInternal, commonsLangSha1 ); + checksumFile.getParentFile().mkdirs(); + + FileUtils.writeStringToFile( checksumFile, "dummy-checksum", null ); + + WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/internal/" + + "commons-lang/jars/commons-lang-2.1.jar.sha1" ); + WebResponse response = sc.getResponse( request ); + assertResponseOK( response ); + + assertEquals( "Expected file contents", "dummy-checksum", response.getText() ); + } + + public void testGetNoProxyVersionedMetadataDefaultLayout() + throws Exception + { + String commonsLangMetadata = "commons-lang/commons-lang/2.1/maven-metadata.xml"; + String expectedMetadataContents = "dummy-versioned-metadata"; + + File metadataFile = new File( repoRootInternal, commonsLangMetadata ); + metadataFile.getParentFile().mkdirs(); + + FileUtils.writeStringToFile( metadataFile, expectedMetadataContents, null ); + + WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/internal/" + commonsLangMetadata ); + WebResponse response = sc.getResponse( request ); + assertResponseOK( response ); + + assertEquals( "Expected file contents", expectedMetadataContents, response.getText() ); + } + + public void testGetNoProxyProjectMetadataDefaultLayout() + throws Exception + { + String commonsLangMetadata = "commons-lang/commons-lang/maven-metadata.xml"; + String expectedMetadataContents = "dummy-project-metadata"; + + File metadataFile = new File( repoRootInternal, commonsLangMetadata ); + metadataFile.getParentFile().mkdirs(); + + FileUtils.writeStringToFile( metadataFile, expectedMetadataContents, null ); + + WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/internal/" + commonsLangMetadata ); + WebResponse response = sc.getResponse( request ); + assertResponseOK( response ); + + assertEquals( "Expected file contents", expectedMetadataContents, response.getText() ); + } + + public void testGetNoProxyGroupMetadataDefaultLayout() + throws Exception + { + String commonsLangMetadata = "commons-lang/maven-metadata.xml"; + String expectedMetadataContents = "dummy-group-metadata"; + + File metadataFile = new File( repoRootInternal, commonsLangMetadata ); + metadataFile.getParentFile().mkdirs(); + + FileUtils.writeStringToFile( metadataFile, expectedMetadataContents, null ); + + WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/internal/" + commonsLangMetadata ); + WebResponse response = sc.getResponse( request ); + assertResponseOK( response ); + + assertEquals( "Expected file contents", expectedMetadataContents, response.getText() ); + } + + public void testGetNoProxyArtifactDefaultLayout() + throws Exception + { + String commonsLangJar = "commons-lang/commons-lang/2.1/commons-lang-2.1.jar"; + String expectedArtifactContents = "dummy-commons-lang-artifact"; + + File artifactFile = new File( repoRootInternal, commonsLangJar ); + artifactFile.getParentFile().mkdirs(); + + FileUtils.writeStringToFile( artifactFile, expectedArtifactContents, null ); + + WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/internal/" + commonsLangJar ); + WebResponse response = sc.getResponse( request ); + assertResponseOK( response ); + + assertEquals( "Expected file contents", expectedArtifactContents, response.getText() ); + } + + public void testGetNoProxyArtifactLegacyLayout() + throws Exception + { + String commonsLangJar = "commons-lang/commons-lang/2.1/commons-lang-2.1.jar"; + String expectedArtifactContents = "dummy-commons-lang-artifact"; + + File artifactFile = new File( repoRootInternal, commonsLangJar ); + artifactFile.getParentFile().mkdirs(); + + FileUtils.writeStringToFile( artifactFile, expectedArtifactContents, null ); + + WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/internal/" + + "commons-lang/jars/commons-lang-2.1.jar" ); + WebResponse response = sc.getResponse( request ); + assertResponseOK( response ); + + assertEquals( "Expected file contents", expectedArtifactContents, response.getText() ); + } + + public void testGetNoProxySnapshotArtifactDefaultLayout() + throws Exception + { + String commonsLangJar = "commons-lang/commons-lang/2.1-SNAPSHOT/commons-lang-2.1-SNAPSHOT.jar"; + String expectedArtifactContents = "dummy-commons-lang-snapshot-artifact"; + + File artifactFile = new File( repoRootInternal, commonsLangJar ); + artifactFile.getParentFile().mkdirs(); + + FileUtils.writeStringToFile( artifactFile, expectedArtifactContents, null ); + + WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/internal/" + commonsLangJar ); + WebResponse response = sc.getResponse( request ); + assertResponseOK( response ); + + assertEquals( "Expected file contents", expectedArtifactContents, response.getText() ); + } + + public void testGetNoProxySnapshotArtifactLegacyLayout() + throws Exception + { + String commonsLangJar = "commons-lang/commons-lang/2.1-SNAPSHOT/commons-lang-2.1-SNAPSHOT.jar"; + String expectedArtifactContents = "dummy-commons-lang-snapshot-artifact"; + + File artifactFile = new File( repoRootInternal, commonsLangJar ); + artifactFile.getParentFile().mkdirs(); + + FileUtils.writeStringToFile( artifactFile, expectedArtifactContents, null ); + + WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/internal/" + + "commons-lang/jars/commons-lang-2.1-SNAPSHOT.jar" ); + WebResponse response = sc.getResponse( request ); + assertResponseOK( response ); + + assertEquals( "Expected file contents", expectedArtifactContents, response.getText() ); + } + + public void testGetNoProxyTimestampedSnapshotArtifactDefaultLayout() + throws Exception + { + String commonsLangJar = "commons-lang/commons-lang/2.1-SNAPSHOT/commons-lang-2.1-20050821.023400-1.jar"; + String expectedArtifactContents = "dummy-commons-lang-snapshot-artifact"; + + File artifactFile = new File( repoRootInternal, commonsLangJar ); + artifactFile.getParentFile().mkdirs(); + + FileUtils.writeStringToFile( artifactFile, expectedArtifactContents, null ); + + WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/internal/" + commonsLangJar ); + WebResponse response = sc.getResponse( request ); + assertResponseOK( response ); + + assertEquals( "Expected file contents", expectedArtifactContents, response.getText() ); + } + + public void testGetNoProxyTimestampedSnapshotArtifactLegacyLayout() + throws Exception + { + String commonsLangJar = "commons-lang/commons-lang/2.1-SNAPSHOT/commons-lang-2.1-20050821.023400-1.jar"; + String expectedArtifactContents = "dummy-commons-lang-snapshot-artifact"; + + File artifactFile = new File( repoRootInternal, commonsLangJar ); + artifactFile.getParentFile().mkdirs(); + + FileUtils.writeStringToFile( artifactFile, expectedArtifactContents, null ); + + WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/internal/" + + "commons-lang/jars/commons-lang-2.1-20050821.023400-1.jar" ); + WebResponse response = sc.getResponse( request ); + assertResponseOK( response ); + + assertEquals( "Expected file contents", expectedArtifactContents, response.getText() ); + } + + /** + * [MRM-481] Artifact requests with a .xml.zip extension fail with a 404 Error + */ + public void testGetNoProxyDualExtensionDefaultLayout() + throws Exception + { + String expectedContents = "the-contents-of-the-dual-extension"; + String dualExtensionPath = "org/project/example-presentation/3.2/example-presentation-3.2.xml.zip"; + + File checksumFile = new File( repoRootInternal, dualExtensionPath ); + checksumFile.getParentFile().mkdirs(); + + FileUtils.writeStringToFile( checksumFile, expectedContents, null ); + + WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/internal/" + dualExtensionPath ); + WebResponse response = sc.getResponse( request ); + assertResponseOK( response ); + + assertEquals( "Expected file contents", expectedContents, response.getText() ); + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletProxiedMetadataLocalOnlyTest.java b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletProxiedMetadataLocalOnlyTest.java new file mode 100644 index 000000000..6c9d7dac8 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletProxiedMetadataLocalOnlyTest.java @@ -0,0 +1,118 @@ +package org.apache.maven.archiva.webdav; + +/* + * 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. + */ + +/** + * RepositoryServlet Tests, Proxied, Get of Metadata, exists on local managed repository only. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class RepositoryServletProxiedMetadataLocalOnlyTest + extends AbstractRepositoryServletProxiedMetadataTestCase +{ + public void testGetProxiedSnapshotVersionMetadataLocalOnly() + throws Exception + { + // --- Setup + setupSnapshotsRemoteRepo(); + setupPrivateSnapshotsRemoteRepo(); + setupCleanInternalRepo(); + + String path = "org/apache/archiva/archivatest-maven-plugin/4.0-alpha-1-SNAPSHOT/maven-metadata.xml"; + String expectedMetadata = createVersionMetadata( "org.apache.archiva", "archivatest-maven-plugin", + "4.0-alpha-1-SNAPSHOT" ); + + populateRepo( repoRootInternal, path, expectedMetadata ); + + setupConnector( REPOID_INTERNAL, remoteSnapshots ); + setupConnector( REPOID_INTERNAL, remotePrivateSnapshots ); + + // --- Execution + String actualMetadata = requestMetadataOK( path ); + + // --- Verification + assertExpectedMetadata( expectedMetadata, actualMetadata ); + } + + public void testGetProxiedVersionMetadataLocalOnly() + throws Exception + { + // --- Setup + setupSnapshotsRemoteRepo(); + setupPrivateSnapshotsRemoteRepo(); + setupCleanInternalRepo(); + + String path = "org/apache/archiva/archivatest-maven-plugin/4.0-alpha-2/maven-metadata.xml"; + String expectedMetadata = createVersionMetadata( "org.apache.archiva", "archivatest-maven-plugin", + "4.0-alpha-2" ); + + populateRepo( repoRootInternal, path, expectedMetadata ); + + // --- Execution + String actualMetadata = requestMetadataOK( path ); + + // --- Verification + assertExpectedMetadata( expectedMetadata, actualMetadata ); + } + + public void testGetProxiedProjectMetadataLocalOnly() + throws Exception + { + // --- Setup + setupSnapshotsRemoteRepo(); + setupPrivateSnapshotsRemoteRepo(); + setupCleanInternalRepo(); + + String path = "org/apache/archiva/archivatest-maven-plugin/maven-metadata.xml"; + String version = "1.0-alpha-4"; + String release = "1.0-alpha-4"; + String expectedMetadata = createProjectMetadata( "org.apache.archiva", "archivatest-maven-plugin", version, + release, new String[] { "1.0-alpha-4" } ); + + populateRepo( repoRootInternal, path, expectedMetadata ); + + // --- Execution + String actualMetadata = requestMetadataOK( path ); + + // --- Verification + assertExpectedMetadata( expectedMetadata, actualMetadata ); + } + + public void testGetProxiedGroupMetadataLocalOnly() + throws Exception + { + // --- Setup + setupSnapshotsRemoteRepo(); + setupPrivateSnapshotsRemoteRepo(); + setupCleanInternalRepo(); + + String path = "org/apache/archiva/maven-metadata.xml"; + String expectedMetadata = createGroupMetadata( "org.apache.archiva", new String[] { "archivatest-maven-plugin" } ); + + populateRepo( repoRootInternal, path, expectedMetadata ); + + // --- Execution + String actualMetadata = requestMetadataOK( path ); + + // --- Verification + assertExpectedMetadata( expectedMetadata, actualMetadata ); + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletProxiedMetadataRemoteOnlyTest.java b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletProxiedMetadataRemoteOnlyTest.java new file mode 100644 index 000000000..9a2af21c8 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletProxiedMetadataRemoteOnlyTest.java @@ -0,0 +1,166 @@ +package org.apache.maven.archiva.webdav; + +/* + * 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; + +/** + * RepositoryServlet Tests, Proxied, Get of Metadata, exists on remote repository only. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class RepositoryServletProxiedMetadataRemoteOnlyTest + extends AbstractRepositoryServletProxiedMetadataTestCase +{ + public void testGetProxiedSnapshotVersionMetadataRemoteOnly() + throws Exception + { + // --- Setup + setupSnapshotsRemoteRepo(); + setupPrivateSnapshotsRemoteRepo(); + setupCleanInternalRepo(); + + String path = "org/apache/archiva/archivatest-maven-plugin/4.0-alpha-1-SNAPSHOT/maven-metadata.xml"; + String version = "4.0-alpha-1-SNAPSHOT"; + String timestamp = "20040305.112233"; + String buildNumber = "2"; + String lastUpdated = "20040305112233"; + String expectedMetadata = createVersionMetadata( "org.apache.archiva", "archivatest-maven-plugin", + version, timestamp, buildNumber, lastUpdated); + + File metadataFile = populateRepo( remoteSnapshots, path, expectedMetadata ); + + setupConnector( REPOID_INTERNAL, remoteSnapshots ); + setupConnector( REPOID_INTERNAL, remotePrivateSnapshots ); + saveConfiguration(); + + // --- Execution + String actualMetadata = requestMetadataOK( path ); + + // --- Verification + assertExpectedMetadata( expectedMetadata, actualMetadata ); + } + + public void testGetProxiedPluginSnapshotVersionMetadataRemoteOnly() + throws Exception + { + // --- Setup + setupSnapshotsRemoteRepo(); + setupPrivateSnapshotsRemoteRepo(); + setupCleanInternalRepo(); + + String path = "org/apache/maven/plugins/maven-assembly-plugin/2.2-beta-2-SNAPSHOT/maven-metadata.xml"; + String version = "2.2-beta-2-SNAPSHOT"; + String timestamp = "20071017.162810"; + String buildNumber = "20"; + String lastUpdated = "20071017162810"; + String expectedMetadata = createVersionMetadata( "org.apache.maven.plugins", "maven-assembly-plugin", version, + timestamp, buildNumber, lastUpdated ); + + File metadataFile = populateRepo( remoteSnapshots, path, expectedMetadata ); + + setupConnector( REPOID_INTERNAL, remoteSnapshots ); + setupConnector( REPOID_INTERNAL, remotePrivateSnapshots ); + saveConfiguration(); + + // --- Execution + String actualMetadata = requestMetadataOK( path ); + + // --- Verification + assertExpectedMetadata( expectedMetadata, actualMetadata ); + } + + public void testGetProxiedVersionMetadataRemoteOnly() + throws Exception + { + // --- Setup + setupSnapshotsRemoteRepo(); + setupPrivateSnapshotsRemoteRepo(); + setupCleanInternalRepo(); + + String path = "org/apache/archiva/archivatest-maven-plugin/4.0-alpha-2/maven-metadata.xml"; + String expectedMetadata = createVersionMetadata( "org.apache.archiva", "archivatest-maven-plugin", + "4.0-alpha-2" ); + + File managedFile = populateRepo( remoteSnapshots, path, expectedMetadata ); + + setupConnector( REPOID_INTERNAL, remoteSnapshots ); + setupConnector( REPOID_INTERNAL, remotePrivateSnapshots ); + saveConfiguration(); + + // --- Execution + String actualMetadata = requestMetadataOK( path ); + + // --- Verification + assertExpectedMetadata( expectedMetadata, actualMetadata ); + } + + public void testGetProxiedProjectMetadataRemoteOnly() + throws Exception + { + // --- Setup + setupSnapshotsRemoteRepo(); + setupPrivateSnapshotsRemoteRepo(); + setupCleanInternalRepo(); + + String path = "org/apache/archiva/archivatest-maven-plugin/maven-metadata.xml"; + String latest = "1.0-alpha-4"; + String release = "1.0-alpha-4"; + String expectedMetadata = createProjectMetadata( "org.apache.archiva", "archivatest-maven-plugin", + latest, release, new String[] { "1.0-alpha-4" } ); + + File managedFile = populateRepo( remoteSnapshots, path, expectedMetadata ); + + setupConnector( REPOID_INTERNAL, remoteSnapshots ); + setupConnector( REPOID_INTERNAL, remotePrivateSnapshots ); + saveConfiguration(); + + // --- Execution + String actualMetadata = requestMetadataOK( path ); + + // --- Verification + assertExpectedMetadata( expectedMetadata, actualMetadata ); + } + + public void testGetProxiedGroupMetadataRemoteOnly() + throws Exception + { + // --- Setup + setupSnapshotsRemoteRepo(); + setupPrivateSnapshotsRemoteRepo(); + setupCleanInternalRepo(); + + String path = "org/apache/archiva/maven-metadata.xml"; + String expectedMetadata = createGroupMetadata( "org.apache.archiva", new String[] { "archivatest-maven-plugin" } ); + + File managedFile = populateRepo( remoteSnapshots, path, expectedMetadata ); + + setupConnector( REPOID_INTERNAL, remoteSnapshots ); + setupConnector( REPOID_INTERNAL, remotePrivateSnapshots ); + saveConfiguration(); + + // --- Execution + String actualMetadata = requestMetadataOK( path ); + + // --- Verification + assertExpectedMetadata( expectedMetadata, actualMetadata ); + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletProxiedPassthroughTest.java b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletProxiedPassthroughTest.java new file mode 100644 index 000000000..2de368b6b --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletProxiedPassthroughTest.java @@ -0,0 +1,156 @@ +package org.apache.maven.archiva.webdav; + +/* + * 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; + +import com.meterware.httpunit.GetMethodWebRequest; +import com.meterware.httpunit.HttpUnitOptions; +import com.meterware.httpunit.WebRequest; +import com.meterware.httpunit.WebResponse; + +/** + * RepositoryServlet Tests, Proxied, Get of resources that are not artifacts or metadata, with varying policy settings. + * + * @author Joakim Erdfelt + * @version $Id: RepositoryServletProxiedReleasePolicyTest.java 661174 2008-05-29 01:49:41Z jdumay $ + */ +public class RepositoryServletProxiedPassthroughTest + extends AbstractRepositoryServletProxiedTestCase +{ + private static final String CONTENT_SHA1 = "2aab0a51c04c9023636852f3e63a68034ba10142"; + + private static final String PATH_SHA1 = "org/apache/archiva/test/1.0/test-1.0.jar.sha1"; + + private static final String CONTENT_ASC = + "-----BEGIN PGP SIGNATURE-----\n" + "Version: GnuPG v1.4.8 (Darwin)\n" + "\n" + + "iEYEABECAAYFAkiAIVgACgkQxbsDNW2stZZjyACeK3LW+ZDeawCyJj4XgvUaJkNh\n" + + "qIEAoIUiijY4Iw82RWOT75Rt3yZuY6ZI\n" + "=WLkm\n" + "-----END PGP SIGNATURE-----\n"; + + private static final String PATH_ASC = "org/apache/archiva/test/1.0/test-1.0.jar.asc"; + + public void testGetProxiedManagedNewerSha1() + throws Exception + { + assertGetProxiedResource( EXPECT_MANAGED_CONTENTS, HAS_MANAGED_COPY, ( NEWER * OVER_ONE_DAY ), PATH_SHA1, + CONTENT_SHA1 ); + } + + public void testGetProxiedManagedOlderSha1() + throws Exception + { + assertGetProxiedResource( EXPECT_REMOTE_CONTENTS, HAS_MANAGED_COPY, ( OLDER * OVER_ONE_DAY ), PATH_SHA1, + CONTENT_SHA1 ); + } + + public void testGetProxiedNoManagedContentSha1() + throws Exception + { + assertGetProxiedResource( EXPECT_REMOTE_CONTENTS, NO_MANAGED_COPY, PATH_SHA1, CONTENT_SHA1 ); + } + + public void testGetProxiedEqualSha1() + throws Exception + { + assertGetProxiedResource( EXPECT_MANAGED_CONTENTS, HAS_MANAGED_COPY, PATH_SHA1, CONTENT_SHA1 ); + } + + public void testGetProxiedManagedNewerAsc() + throws Exception + { + assertGetProxiedResource( EXPECT_MANAGED_CONTENTS, HAS_MANAGED_COPY, ( NEWER * OVER_ONE_DAY ), PATH_ASC, + CONTENT_ASC ); + } + + public void testGetProxiedManagedOlderAsc() + throws Exception + { + assertGetProxiedResource( EXPECT_REMOTE_CONTENTS, HAS_MANAGED_COPY, ( OLDER * OVER_ONE_DAY ), PATH_ASC, + CONTENT_ASC ); + } + + public void testGetProxiedNoManagedContentAsc() + throws Exception + { + assertGetProxiedResource( EXPECT_REMOTE_CONTENTS, NO_MANAGED_COPY, PATH_ASC, CONTENT_ASC ); + } + + public void testGetProxiedEqualAsc() + throws Exception + { + assertGetProxiedResource( EXPECT_MANAGED_CONTENTS, HAS_MANAGED_COPY, PATH_ASC, CONTENT_ASC ); + } + + private void assertGetProxiedResource( int expectation, boolean hasManagedCopy, String path, String content ) + throws Exception + { + assertGetProxiedResource( expectation, hasManagedCopy, 0, path, content ); + } + + private void assertGetProxiedResource( int expectation, boolean hasManagedCopy, long deltaManagedToRemoteTimestamp, + String path, String contents ) + throws Exception + { + // --- Setup + setupCentralRemoteRepo(); + setupCleanInternalRepo(); + + String expectedRemoteContents = contents; + String expectedManagedContents = null; + File remoteFile = populateRepo( remoteCentral, path, expectedRemoteContents ); + + if ( hasManagedCopy ) + { + expectedManagedContents = contents; + File managedFile = populateRepo( repoRootInternal, path, expectedManagedContents ); + managedFile.setLastModified( remoteFile.lastModified() + deltaManagedToRemoteTimestamp ); + } + + setupConnector( REPOID_INTERNAL, remoteCentral ); + saveConfiguration(); + + // --- Execution + // process the response code later, not via an exception. + HttpUnitOptions.setExceptionsThrownOnErrorStatus( false ); + + WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/internal/" + path ); + WebResponse response = sc.getResponse( request ); + + // --- Verification + + switch ( expectation ) + { + case EXPECT_MANAGED_CONTENTS: + assertResponseOK( response ); + assertTrue( "Invalid Test Case: Can't expect managed contents with " + + "test that doesn't have a managed copy in the first place.", hasManagedCopy ); + assertEquals( "Expected managed file contents", expectedManagedContents, response.getText() ); + break; + case EXPECT_REMOTE_CONTENTS: + assertResponseOK( response ); + assertEquals( "Expected remote file contents", expectedRemoteContents, response.getText() ); + break; + case EXPECT_NOT_FOUND: + assertResponseNotFound( response ); + assertManagedFileNotExists( repoRootInternal, path ); + break; + } + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletProxiedPluginSnapshotPolicyTest.java b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletProxiedPluginSnapshotPolicyTest.java new file mode 100644 index 000000000..a776b5dce --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletProxiedPluginSnapshotPolicyTest.java @@ -0,0 +1,195 @@ +package org.apache.maven.archiva.webdav; + +/* + * 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 com.meterware.httpunit.GetMethodWebRequest; +import com.meterware.httpunit.HttpUnitOptions; +import com.meterware.httpunit.WebRequest; +import com.meterware.httpunit.WebResponse; + +import org.apache.maven.archiva.policies.SnapshotsPolicy; + +import java.io.File; + +/** + * RepositoryServlet Tests, Proxied, Get of Timestamped Snapshot Artifacts, with varying policy settings. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class RepositoryServletProxiedPluginSnapshotPolicyTest + extends AbstractRepositoryServletProxiedTestCase +{ + public void testGetProxiedSnapshotsArtifactPolicyAlwaysManagedNewer() + throws Exception + { + assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, SnapshotsPolicy.ALWAYS, + HAS_MANAGED_COPY, ( NEWER * OVER_ONE_DAY ) ); + } + + public void testGetProxiedSnapshotsArtifactPolicyAlwaysManagedOlder() + throws Exception + { + assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, SnapshotsPolicy.ALWAYS, HAS_MANAGED_COPY, + ( OLDER * OVER_ONE_DAY ) ); + } + + public void testGetProxiedSnapshotsArtifactPolicyAlwaysNoManagedContent() + throws Exception + { + assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, SnapshotsPolicy.ALWAYS, NO_MANAGED_COPY ); + } + + public void testGetProxiedSnapshotsArtifactPolicyDailyFail() + throws Exception + { + assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, SnapshotsPolicy.DAILY, HAS_MANAGED_COPY, + ( NEWER * ONE_MINUTE ) ); + } + + public void testGetProxiedSnapshotsArtifactPolicyDailyNoManagedContent() + throws Exception + { + assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, SnapshotsPolicy.DAILY, NO_MANAGED_COPY ); + } + + public void testGetProxiedSnapshotsArtifactPolicyDailyPass() + throws Exception + { + assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, SnapshotsPolicy.DAILY, HAS_MANAGED_COPY, + ( OLDER * OVER_ONE_DAY ) ); + } + + public void testGetProxiedSnapshotsArtifactPolicyRejectFail() + throws Exception + { + assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, SnapshotsPolicy.NEVER, + HAS_MANAGED_COPY ); + } + + public void testGetProxiedSnapshotsArtifactPolicyRejectNoManagedContentFail() + throws Exception + { + assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_NOT_FOUND, SnapshotsPolicy.NEVER, NO_MANAGED_COPY ); + } + + public void testGetProxiedSnapshotsArtifactPolicyRejectPass() + throws Exception + { + assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, SnapshotsPolicy.NEVER, + HAS_MANAGED_COPY ); + } + + public void testGetProxiedSnapshotsArtifactPolicyHourlyFail() + throws Exception + { + assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, SnapshotsPolicy.HOURLY, HAS_MANAGED_COPY, + ( NEWER * ONE_MINUTE ) ); + } + + public void testGetProxiedSnapshotsArtifactPolicyHourlyNoManagedContent() + throws Exception + { + assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, SnapshotsPolicy.HOURLY, NO_MANAGED_COPY ); + } + + public void testGetProxiedSnapshotsArtifactPolicyHourlyPass() + throws Exception + { + assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, SnapshotsPolicy.HOURLY, HAS_MANAGED_COPY, + ( OLDER * OVER_ONE_HOUR ) ); + } + + public void testGetProxiedSnapshotsArtifactPolicyOnceFail() + throws Exception + { + assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, SnapshotsPolicy.ONCE, HAS_MANAGED_COPY ); + } + + public void testGetProxiedSnapshotsArtifactPolicyOnceNoManagedContent() + throws Exception + { + assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, SnapshotsPolicy.ONCE, NO_MANAGED_COPY ); + } + + public void testGetProxiedSnapshotsArtifactPolicyOncePass() + throws Exception + { + assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, SnapshotsPolicy.ONCE, NO_MANAGED_COPY ); + } + + private void assertGetProxiedSnapshotsArtifactWithPolicy( int expectation, String snapshotsPolicy, + boolean hasManagedCopy ) + throws Exception + { + assertGetProxiedSnapshotsArtifactWithPolicy( expectation, snapshotsPolicy, hasManagedCopy, 0 ); + } + + private void assertGetProxiedSnapshotsArtifactWithPolicy( int expectation, String snapshotsPolicy, + boolean hasManagedCopy, long deltaManagedToRemoteTimestamp ) + throws Exception + { + // --- Setup + setupSnapshotsRemoteRepo(); + setupCleanInternalRepo(); + + String resourcePath = "org/apache/archiva/archivatest-maven-plugin/4.0-alpha-1-SNAPSHOT/archivatest-maven-plugin-4.0-alpha-1-20070822.033400-42.jar"; + String expectedRemoteContents = "archivatest-maven-plugin-4.0-alpha-1-20070822.033400-42|jar-remote-contents"; + String expectedManagedContents = null; + File remoteFile = populateRepo( remoteSnapshots, resourcePath, expectedRemoteContents ); + + if ( hasManagedCopy ) + { + expectedManagedContents = "archivatest-maven-plugin-4.0-alpha-1-20070822.033400-42|jar-managed-contents"; + File managedFile = populateRepo( repoRootInternal, resourcePath, expectedManagedContents ); + managedFile.setLastModified( remoteFile.lastModified() + deltaManagedToRemoteTimestamp ); + } + + setupSnapshotConnector( REPOID_INTERNAL, remoteSnapshots, snapshotsPolicy ); + saveConfiguration(); + + // --- Execution + // process the response code later, not via an exception. + HttpUnitOptions.setExceptionsThrownOnErrorStatus( false ); + + WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/internal/" + resourcePath ); + WebResponse response = sc.getResponse( request ); + + // --- Verification + + switch ( expectation ) + { + case EXPECT_MANAGED_CONTENTS: + assertResponseOK( response ); + assertTrue( "Invalid Test Case: Can't expect managed contents with " + + "test that doesn't have a managed copy in the first place.", hasManagedCopy ); + assertEquals( "Expected managed file contents", expectedManagedContents, response.getText() ); + break; + case EXPECT_REMOTE_CONTENTS: + assertResponseOK( response ); + assertEquals( "Expected remote file contents", expectedRemoteContents, response.getText() ); + break; + case EXPECT_NOT_FOUND: + assertResponseNotFound( response ); + assertManagedFileNotExists( repoRootInternal, resourcePath ); + break; + } + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletProxiedReleasePolicyTest.java b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletProxiedReleasePolicyTest.java new file mode 100644 index 000000000..144d49bb9 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletProxiedReleasePolicyTest.java @@ -0,0 +1,193 @@ +package org.apache.maven.archiva.webdav; + +/* + * 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 com.meterware.httpunit.GetMethodWebRequest; +import com.meterware.httpunit.HttpUnitOptions; +import com.meterware.httpunit.WebRequest; +import com.meterware.httpunit.WebResponse; + +import org.apache.maven.archiva.policies.ReleasesPolicy; + +import java.io.File; + +/** + * RepositoryServlet Tests, Proxied, Get of Release Artifacts, with varying policy settings. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class RepositoryServletProxiedReleasePolicyTest + extends AbstractRepositoryServletProxiedTestCase +{ + public void testGetProxiedReleaseArtifactPolicyAlwaysManagedNewer() + throws Exception + { + assertGetProxiedReleaseArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, ReleasesPolicy.ALWAYS, HAS_MANAGED_COPY, + ( NEWER * OVER_ONE_DAY ) ); + } + + public void testGetProxiedReleaseArtifactPolicyAlwaysManagedOlder() + throws Exception + { + assertGetProxiedReleaseArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, ReleasesPolicy.ALWAYS, HAS_MANAGED_COPY, + ( OLDER * OVER_ONE_DAY ) ); + } + + public void testGetProxiedReleaseArtifactPolicyAlwaysNoManagedContent() + throws Exception + { + assertGetProxiedReleaseArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, ReleasesPolicy.ALWAYS, NO_MANAGED_COPY ); + } + + public void testGetProxiedReleaseArtifactPolicyDailyFail() + throws Exception + { + assertGetProxiedReleaseArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, ReleasesPolicy.DAILY, HAS_MANAGED_COPY, + ( NEWER * ONE_MINUTE ) ); + } + + public void testGetProxiedReleaseArtifactPolicyDailyNoManagedContent() + throws Exception + { + assertGetProxiedReleaseArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, ReleasesPolicy.DAILY, NO_MANAGED_COPY ); + } + + public void testGetProxiedReleaseArtifactPolicyDailyPass() + throws Exception + { + assertGetProxiedReleaseArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, ReleasesPolicy.DAILY, HAS_MANAGED_COPY, + ( OLDER * OVER_ONE_DAY ) ); + } + + public void testGetProxiedReleaseArtifactPolicyRejectFail() + throws Exception + { + assertGetProxiedReleaseArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, ReleasesPolicy.NEVER, HAS_MANAGED_COPY ); + } + + public void testGetProxiedReleaseArtifactPolicyRejectNoManagedContentFail() + throws Exception + { + assertGetProxiedReleaseArtifactWithPolicy( EXPECT_NOT_FOUND, ReleasesPolicy.NEVER, NO_MANAGED_COPY ); + } + + public void testGetProxiedReleaseArtifactPolicyRejectPass() + throws Exception + { + assertGetProxiedReleaseArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, ReleasesPolicy.NEVER, HAS_MANAGED_COPY ); + } + + public void testGetProxiedReleaseArtifactPolicyHourlyFail() + throws Exception + { + assertGetProxiedReleaseArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, ReleasesPolicy.HOURLY, HAS_MANAGED_COPY, + ( NEWER * ONE_MINUTE ) ); + } + + public void testGetProxiedReleaseArtifactPolicyHourlyNoManagedContent() + throws Exception + { + assertGetProxiedReleaseArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, ReleasesPolicy.HOURLY, NO_MANAGED_COPY ); + } + + public void testGetProxiedReleaseArtifactPolicyHourlyPass() + throws Exception + { + assertGetProxiedReleaseArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, ReleasesPolicy.HOURLY, HAS_MANAGED_COPY, + ( OLDER * OVER_ONE_HOUR ) ); + } + + public void testGetProxiedReleaseArtifactPolicyOnceFail() + throws Exception + { + assertGetProxiedReleaseArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, ReleasesPolicy.ONCE, HAS_MANAGED_COPY ); + } + + public void testGetProxiedReleaseArtifactPolicyOnceNoManagedContent() + throws Exception + { + assertGetProxiedReleaseArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, ReleasesPolicy.ONCE, NO_MANAGED_COPY ); + } + + public void testGetProxiedReleaseArtifactPolicyOncePass() + throws Exception + { + assertGetProxiedReleaseArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, ReleasesPolicy.ONCE, NO_MANAGED_COPY ); + } + + private void assertGetProxiedReleaseArtifactWithPolicy( int expectation, String releasePolicy, + boolean hasManagedCopy ) + throws Exception + { + assertGetProxiedReleaseArtifactWithPolicy( expectation, releasePolicy, hasManagedCopy, 0 ); + } + + private void assertGetProxiedReleaseArtifactWithPolicy( int expectation, String releasePolicy, + boolean hasManagedCopy, long deltaManagedToRemoteTimestamp ) + throws Exception + { + // --- Setup + setupCentralRemoteRepo(); + setupCleanInternalRepo(); + + String resourcePath = "org/apache/archiva/test/1.0/test-1.0.jar"; + String expectedRemoteContents = "archiva-test-1.0|jar-remote-contents"; + String expectedManagedContents = null; + File remoteFile = populateRepo( remoteCentral, resourcePath, expectedRemoteContents ); + + if ( hasManagedCopy ) + { + expectedManagedContents = "archiva-test-1.0|jar-managed-contents"; + File managedFile = populateRepo( repoRootInternal, resourcePath, expectedManagedContents ); + managedFile.setLastModified( remoteFile.lastModified() + deltaManagedToRemoteTimestamp ); + } + + setupReleaseConnector( REPOID_INTERNAL, remoteCentral, releasePolicy ); + saveConfiguration(); + + // --- Execution + // process the response code later, not via an exception. + HttpUnitOptions.setExceptionsThrownOnErrorStatus( false ); + + WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/internal/" + resourcePath ); + WebResponse response = sc.getResponse( request ); + + // --- Verification + + switch ( expectation ) + { + case EXPECT_MANAGED_CONTENTS: + assertResponseOK( response ); + assertTrue( "Invalid Test Case: Can't expect managed contents with " + + "test that doesn't have a managed copy in the first place.", hasManagedCopy ); + assertEquals( "Expected managed file contents", expectedManagedContents, response.getText() ); + break; + case EXPECT_REMOTE_CONTENTS: + assertResponseOK( response ); + assertEquals( "Expected remote file contents", expectedRemoteContents, response.getText() ); + break; + case EXPECT_NOT_FOUND: + assertResponseNotFound( response ); + assertManagedFileNotExists( repoRootInternal, resourcePath ); + break; + } + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletProxiedRelocatedTest.java b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletProxiedRelocatedTest.java new file mode 100644 index 000000000..2303836b6 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletProxiedRelocatedTest.java @@ -0,0 +1,79 @@ +package org.apache.maven.archiva.webdav; + +/* + * 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 com.meterware.httpunit.GetMethodWebRequest; +import com.meterware.httpunit.HttpUnitOptions; +import com.meterware.httpunit.WebRequest; +import com.meterware.httpunit.WebResponse; + +import org.apache.maven.archiva.policies.ReleasesPolicy; + +/** + * RepositoryServlet Tests, Proxied, Get of Release Artifacts, with varying policy settings. + * + * @author Joakim Erdfelt + * @version $Id: RepositoryServletProxiedReleasePolicyTest.java 590908 2007-11-01 06:21:26Z joakime $ + */ +public class RepositoryServletProxiedRelocatedTest + extends AbstractRepositoryServletProxiedTestCase +{ + public void testGetProxiedReleaseArtifactPolicyOncePass() + throws Exception + { + // --- Setup + setupCentralRemoteRepo(); + setupCleanInternalRepo(); + + String resourcePath = "org/apache/archiva/test/1.0/test-1.0.jar"; + String expectedRemoteContents = "archiva-test-1.0|jar-remote-contents"; + populateRepo( remoteCentral, resourcePath, expectedRemoteContents ); + + resourcePath = "archiva/test/1.0/test-1.0.pom"; + String pom = "" + + "4.0.0" + + "archiva" + + "test" + + "1.0" + + "" + + "" + + "org.apache.archiva" + + "" + + "" + + ""; + populateRepo( remoteCentral, resourcePath, pom ); + + resourcePath = "archiva/jars/test-1.0.jar"; + + setupReleaseConnector( REPOID_INTERNAL, remoteCentral, ReleasesPolicy.ONCE ); + saveConfiguration(); + + // --- Execution + // process the response code later, not via an exception. + HttpUnitOptions.setExceptionsThrownOnErrorStatus( false ); + + WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/internal/" + resourcePath ); + WebResponse response = sc.getResponse( request ); + + // --- Verification + assertResponseOK( response ); + assertEquals( "Expected remote file contents", expectedRemoteContents, response.getText() ); + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletProxiedSnapshotPolicyTest.java b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletProxiedSnapshotPolicyTest.java new file mode 100644 index 000000000..da944d9f2 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletProxiedSnapshotPolicyTest.java @@ -0,0 +1,195 @@ +package org.apache.maven.archiva.webdav; + +/* + * 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 com.meterware.httpunit.GetMethodWebRequest; +import com.meterware.httpunit.HttpUnitOptions; +import com.meterware.httpunit.WebRequest; +import com.meterware.httpunit.WebResponse; + +import org.apache.maven.archiva.policies.SnapshotsPolicy; + +import java.io.File; + +/** + * RepositoryServlet Tests, Proxied, Get of Snapshot Artifacts, with varying policy settings. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class RepositoryServletProxiedSnapshotPolicyTest + extends AbstractRepositoryServletProxiedTestCase +{ + public void testGetProxiedSnapshotsArtifactPolicyAlwaysManagedNewer() + throws Exception + { + assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, SnapshotsPolicy.ALWAYS, + HAS_MANAGED_COPY, ( NEWER * OVER_ONE_DAY ) ); + } + + public void testGetProxiedSnapshotsArtifactPolicyAlwaysManagedOlder() + throws Exception + { + assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, SnapshotsPolicy.ALWAYS, HAS_MANAGED_COPY, + ( OLDER * OVER_ONE_DAY ) ); + } + + public void testGetProxiedSnapshotsArtifactPolicyAlwaysNoManagedContent() + throws Exception + { + assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, SnapshotsPolicy.ALWAYS, NO_MANAGED_COPY ); + } + + public void testGetProxiedSnapshotsArtifactPolicyDailyFail() + throws Exception + { + assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, SnapshotsPolicy.DAILY, HAS_MANAGED_COPY, + ( NEWER * ONE_MINUTE ) ); + } + + public void testGetProxiedSnapshotsArtifactPolicyDailyNoManagedContent() + throws Exception + { + assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, SnapshotsPolicy.DAILY, NO_MANAGED_COPY ); + } + + public void testGetProxiedSnapshotsArtifactPolicyDailyPass() + throws Exception + { + assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, SnapshotsPolicy.DAILY, HAS_MANAGED_COPY, + ( OLDER * OVER_ONE_DAY ) ); + } + + public void testGetProxiedSnapshotsArtifactPolicyRejectFail() + throws Exception + { + assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, SnapshotsPolicy.NEVER, + HAS_MANAGED_COPY ); + } + + public void testGetProxiedSnapshotsArtifactPolicyRejectNoManagedContentFail() + throws Exception + { + assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_NOT_FOUND, SnapshotsPolicy.NEVER, NO_MANAGED_COPY ); + } + + public void testGetProxiedSnapshotsArtifactPolicyRejectPass() + throws Exception + { + assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, SnapshotsPolicy.NEVER, + HAS_MANAGED_COPY ); + } + + public void testGetProxiedSnapshotsArtifactPolicyHourlyFail() + throws Exception + { + assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, SnapshotsPolicy.HOURLY, HAS_MANAGED_COPY, + ( NEWER * ONE_MINUTE ) ); + } + + public void testGetProxiedSnapshotsArtifactPolicyHourlyNoManagedContent() + throws Exception + { + assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, SnapshotsPolicy.HOURLY, NO_MANAGED_COPY ); + } + + public void testGetProxiedSnapshotsArtifactPolicyHourlyPass() + throws Exception + { + assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, SnapshotsPolicy.HOURLY, HAS_MANAGED_COPY, + ( OLDER * OVER_ONE_HOUR ) ); + } + + public void testGetProxiedSnapshotsArtifactPolicyOnceFail() + throws Exception + { + assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, SnapshotsPolicy.ONCE, HAS_MANAGED_COPY ); + } + + public void testGetProxiedSnapshotsArtifactPolicyOnceNoManagedContent() + throws Exception + { + assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, SnapshotsPolicy.ONCE, NO_MANAGED_COPY ); + } + + public void testGetProxiedSnapshotsArtifactPolicyOncePass() + throws Exception + { + assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, SnapshotsPolicy.ONCE, NO_MANAGED_COPY ); + } + + private void assertGetProxiedSnapshotsArtifactWithPolicy( int expectation, String snapshotsPolicy, + boolean hasManagedCopy ) + throws Exception + { + assertGetProxiedSnapshotsArtifactWithPolicy( expectation, snapshotsPolicy, hasManagedCopy, 0 ); + } + + private void assertGetProxiedSnapshotsArtifactWithPolicy( int expectation, String snapshotsPolicy, + boolean hasManagedCopy, long deltaManagedToRemoteTimestamp ) + throws Exception + { + // --- Setup + setupSnapshotsRemoteRepo(); + setupCleanInternalRepo(); + + String resourcePath = "org/apache/archiva/test/2.0-SNAPSHOT/test-2.0-SNAPSHOT.jar"; + String expectedRemoteContents = "archiva-test-2.0-SNAPSHOT|jar-remote-contents"; + String expectedManagedContents = null; + File remoteFile = populateRepo( remoteSnapshots, resourcePath, expectedRemoteContents ); + + if ( hasManagedCopy ) + { + expectedManagedContents = "archiva-test-2.0-SNAPSHOT|jar-managed-contents"; + File managedFile = populateRepo( repoRootInternal, resourcePath, expectedManagedContents ); + managedFile.setLastModified( remoteFile.lastModified() + deltaManagedToRemoteTimestamp ); + } + + setupSnapshotConnector( REPOID_INTERNAL, remoteSnapshots, snapshotsPolicy ); + saveConfiguration(); + + // --- Execution + // process the response code later, not via an exception. + HttpUnitOptions.setExceptionsThrownOnErrorStatus( false ); + + WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/internal/" + resourcePath ); + WebResponse response = sc.getResponse( request ); + + // --- Verification + + switch ( expectation ) + { + case EXPECT_MANAGED_CONTENTS: + assertResponseOK( response ); + assertTrue( "Invalid Test Case: Can't expect managed contents with " + + "test that doesn't have a managed copy in the first place.", hasManagedCopy ); + assertEquals( "Expected managed file contents", expectedManagedContents, response.getText() ); + break; + case EXPECT_REMOTE_CONTENTS: + assertResponseOK( response ); + assertEquals( "Expected remote file contents", expectedRemoteContents, response.getText() ); + break; + case EXPECT_NOT_FOUND: + assertResponseNotFound( response ); + assertManagedFileNotExists( repoRootInternal, resourcePath ); + break; + } + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletProxiedTimestampedSnapshotPolicyTest.java b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletProxiedTimestampedSnapshotPolicyTest.java new file mode 100644 index 000000000..2a34b9ab0 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletProxiedTimestampedSnapshotPolicyTest.java @@ -0,0 +1,195 @@ +package org.apache.maven.archiva.webdav; + +/* + * 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 com.meterware.httpunit.GetMethodWebRequest; +import com.meterware.httpunit.HttpUnitOptions; +import com.meterware.httpunit.WebRequest; +import com.meterware.httpunit.WebResponse; + +import org.apache.maven.archiva.policies.SnapshotsPolicy; + +import java.io.File; + +/** + * RepositoryServlet Tests, Proxied, Get of Timestamped Snapshot Artifacts, with varying policy settings. + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class RepositoryServletProxiedTimestampedSnapshotPolicyTest + extends AbstractRepositoryServletProxiedTestCase +{ + public void testGetProxiedSnapshotsArtifactPolicyAlwaysManagedNewer() + throws Exception + { + assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, SnapshotsPolicy.ALWAYS, + HAS_MANAGED_COPY, ( NEWER * OVER_ONE_DAY ) ); + } + + public void testGetProxiedSnapshotsArtifactPolicyAlwaysManagedOlder() + throws Exception + { + assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, SnapshotsPolicy.ALWAYS, HAS_MANAGED_COPY, + ( OLDER * OVER_ONE_DAY ) ); + } + + public void testGetProxiedSnapshotsArtifactPolicyAlwaysNoManagedContent() + throws Exception + { + assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, SnapshotsPolicy.ALWAYS, NO_MANAGED_COPY ); + } + + public void testGetProxiedSnapshotsArtifactPolicyDailyFail() + throws Exception + { + assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, SnapshotsPolicy.DAILY, HAS_MANAGED_COPY, + ( NEWER * ONE_MINUTE ) ); + } + + public void testGetProxiedSnapshotsArtifactPolicyDailyNoManagedContent() + throws Exception + { + assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, SnapshotsPolicy.DAILY, NO_MANAGED_COPY ); + } + + public void testGetProxiedSnapshotsArtifactPolicyDailyPass() + throws Exception + { + assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, SnapshotsPolicy.DAILY, HAS_MANAGED_COPY, + ( OLDER * OVER_ONE_DAY ) ); + } + + public void testGetProxiedSnapshotsArtifactPolicyRejectFail() + throws Exception + { + assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, SnapshotsPolicy.NEVER, + HAS_MANAGED_COPY ); + } + + public void testGetProxiedSnapshotsArtifactPolicyRejectNoManagedContentFail() + throws Exception + { + assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_NOT_FOUND, SnapshotsPolicy.NEVER, NO_MANAGED_COPY ); + } + + public void testGetProxiedSnapshotsArtifactPolicyRejectPass() + throws Exception + { + assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, SnapshotsPolicy.NEVER, + HAS_MANAGED_COPY ); + } + + public void testGetProxiedSnapshotsArtifactPolicyHourlyFail() + throws Exception + { + assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, SnapshotsPolicy.HOURLY, HAS_MANAGED_COPY, + ( NEWER * ONE_MINUTE ) ); + } + + public void testGetProxiedSnapshotsArtifactPolicyHourlyNoManagedContent() + throws Exception + { + assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, SnapshotsPolicy.HOURLY, NO_MANAGED_COPY ); + } + + public void testGetProxiedSnapshotsArtifactPolicyHourlyPass() + throws Exception + { + assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, SnapshotsPolicy.HOURLY, HAS_MANAGED_COPY, + ( OLDER * OVER_ONE_HOUR ) ); + } + + public void testGetProxiedSnapshotsArtifactPolicyOnceFail() + throws Exception + { + assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, SnapshotsPolicy.ONCE, HAS_MANAGED_COPY ); + } + + public void testGetProxiedSnapshotsArtifactPolicyOnceNoManagedContent() + throws Exception + { + assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, SnapshotsPolicy.ONCE, NO_MANAGED_COPY ); + } + + public void testGetProxiedSnapshotsArtifactPolicyOncePass() + throws Exception + { + assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, SnapshotsPolicy.ONCE, NO_MANAGED_COPY ); + } + + private void assertGetProxiedSnapshotsArtifactWithPolicy( int expectation, String snapshotsPolicy, + boolean hasManagedCopy ) + throws Exception + { + assertGetProxiedSnapshotsArtifactWithPolicy( expectation, snapshotsPolicy, hasManagedCopy, 0 ); + } + + private void assertGetProxiedSnapshotsArtifactWithPolicy( int expectation, String snapshotsPolicy, + boolean hasManagedCopy, long deltaManagedToRemoteTimestamp ) + throws Exception + { + // --- Setup + setupSnapshotsRemoteRepo(); + setupCleanInternalRepo(); + + String resourcePath = "org/apache/archiva/test/3.0-SNAPSHOT/test-3.0-20070822.033400-42.jar"; + String expectedRemoteContents = "archiva-test-3.0-20070822.033400-42|jar-remote-contents"; + String expectedManagedContents = null; + File remoteFile = populateRepo( remoteSnapshots, resourcePath, expectedRemoteContents ); + + if ( hasManagedCopy ) + { + expectedManagedContents = "archiva-test-3.0-20070822.033400-42|jar-managed-contents"; + File managedFile = populateRepo( repoRootInternal, resourcePath, expectedManagedContents ); + managedFile.setLastModified( remoteFile.lastModified() + deltaManagedToRemoteTimestamp ); + } + + setupSnapshotConnector( REPOID_INTERNAL, remoteSnapshots, snapshotsPolicy ); + saveConfiguration(); + + // --- Execution + // process the response code later, not via an exception. + HttpUnitOptions.setExceptionsThrownOnErrorStatus( false ); + + WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/internal/" + resourcePath ); + WebResponse response = sc.getResponse( request ); + + // --- Verification + + switch ( expectation ) + { + case EXPECT_MANAGED_CONTENTS: + assertResponseOK( response ); + assertTrue( "Invalid Test Case: Can't expect managed contents with " + + "test that doesn't have a managed copy in the first place.", hasManagedCopy ); + assertEquals( "Expected managed file contents", expectedManagedContents, response.getText() ); + break; + case EXPECT_REMOTE_CONTENTS: + assertResponseOK( response ); + assertEquals( "Expected remote file contents", expectedRemoteContents, response.getText() ); + break; + case EXPECT_NOT_FOUND: + assertResponseNotFound( response ); + assertManagedFileNotExists( repoRootInternal, resourcePath ); + break; + } + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletRepositoryGroupTest.java b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletRepositoryGroupTest.java new file mode 100644 index 000000000..7acf05969 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletRepositoryGroupTest.java @@ -0,0 +1,305 @@ +package org.apache.maven.archiva.webdav; + +/* + * 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; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; + +import javax.servlet.http.HttpServletResponse; + +import org.apache.commons.io.FileUtils; +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.maven.archiva.repository.metadata.RepositoryMetadataReader; + +import com.meterware.httpunit.GetMethodWebRequest; +import com.meterware.httpunit.PutMethodWebRequest; +import com.meterware.httpunit.WebRequest; +import com.meterware.httpunit.WebResponse; + + +/** + * RepositoryServletRepositoryGroupTest + * + * Test Case 1. Accessing a valid repository group root url (e.g. http://machine.com/repository/repository-group/) returns a Bad Request (HTTP 400) + * Test Case 2. Accessing an invalid repository group root url is forwarded to managed repository checking (this is not covered here) + * Test Case 3. Accessing an artifact in a valid repository group will iterate over the managed repositories in the repository group + * Test Case 3.a. If an invalid managed repository is encountered (managed repository doesn't exist), + * a Not Found (HTTP 404) is returned and the iteration is broken + * Test Case 3.b. If an artifact is not found in a valid managed repository (after proxying, etc.), + * a Not Found (HTTP 404) is set but not returned yet, the iteration continues to the next managed repository. + * The Not Found (HTTP 404) is returned after exhausting all valid managed repositories + * Test Case 3.c. If an artifact is found in a valid managed repository, + * the artifact is returned, the iteration is broken and any Not Found (HTTP 404) is disregarded + * Test Case 4. Accessing a valid repository group with any http write method returns a Bad Request (HTTP 400) + * + * @author + * + */ +public class RepositoryServletRepositoryGroupTest + extends AbstractRepositoryServletTestCase +{ + protected File repoRootFirst; + + protected File repoRootLast; + + protected File repoRootInvalid; + + protected static final String MANAGED_REPO_FIRST = "first"; + + protected static final String MANAGED_REPO_LAST = "last"; + + protected static final String MANAGED_REPO_INVALID = "invalid"; + + protected static final String REPO_GROUP_WITH_VALID_REPOS = "group-with-valid-repos"; + + protected static final String REPO_GROUP_WITH_INVALID_REPOS = "group-with-invalid-repos"; + + + @Override + protected void setUp() + throws Exception + { + super.setUp(); + + String appserverBase = System.getProperty( "appserver.base" ); + + Configuration configuration = archivaConfiguration.getConfiguration(); + + repoRootFirst = new File( appserverBase, "data/repositories/" + MANAGED_REPO_FIRST ); + repoRootLast = new File( appserverBase, "data/repositories/" + MANAGED_REPO_LAST ); + + configuration.addManagedRepository( createManagedRepository( MANAGED_REPO_FIRST, "First Test Repo", repoRootFirst ) ); + configuration.addManagedRepository( createManagedRepository( MANAGED_REPO_LAST, "Last Test Repo", repoRootLast ) ); + + List managedRepoIds = new ArrayList(); + managedRepoIds.add( MANAGED_REPO_FIRST ); + managedRepoIds.add( MANAGED_REPO_LAST ); + + configuration.addRepositoryGroup( createRepositoryGroup( REPO_GROUP_WITH_VALID_REPOS, managedRepoIds ) ); + + // Create the repository group with an invalid managed repository + repoRootInvalid = new File( appserverBase, "data/repositories/" + MANAGED_REPO_INVALID ); + ManagedRepositoryConfiguration managedRepositoryConfiguration = createManagedRepository( MANAGED_REPO_INVALID, "Invalid Test Repo", repoRootInvalid ); + + configuration.addManagedRepository( createManagedRepository( MANAGED_REPO_FIRST, "First Test Repo", repoRootFirst ) ); + configuration.addManagedRepository( managedRepositoryConfiguration ); + configuration.addManagedRepository( createManagedRepository( MANAGED_REPO_LAST, "Last Test Repo", repoRootLast ) ); + + List invalidManagedRepoIds = new ArrayList(); + invalidManagedRepoIds.add( MANAGED_REPO_FIRST ); + invalidManagedRepoIds.add( MANAGED_REPO_INVALID ); + invalidManagedRepoIds.add( MANAGED_REPO_LAST ); + + configuration.addRepositoryGroup( createRepositoryGroup( REPO_GROUP_WITH_INVALID_REPOS, invalidManagedRepoIds ) ); + + configuration.removeManagedRepository( managedRepositoryConfiguration ); + FileUtils.deleteDirectory( repoRootInvalid ); + + saveConfiguration( archivaConfiguration ); + } + + @Override + protected void tearDown() + throws Exception + { + setupCleanRepo( repoRootFirst ); + setupCleanRepo( repoRootLast ); + + super.tearDown(); + } + + /* + * Test Case 3.c + */ + public void testGetFromFirstManagedRepositoryReturnOk() + throws Exception + { + String resourceName = "dummy/dummy-first-resource/1.0/dummy-first-resource-1.0.txt"; + + File dummyInternalResourceFile = new File( repoRootFirst, resourceName ); + dummyInternalResourceFile.getParentFile().mkdirs(); + FileUtils.writeStringToFile( dummyInternalResourceFile, "first", null ); + + WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/" + REPO_GROUP_WITH_VALID_REPOS + "/" + resourceName ); + WebResponse response = sc.getResponse( request ); + + assertResponseOK( response ); + assertEquals( "Expected file contents", "first", response.getText() ); + } + + /* + * Test Case 3.c + */ + public void testGetFromLastManagedRepositoryReturnOk() + throws Exception + { + String resourceName = "dummy/dummy-last-resource/1.0/dummy-last-resource-1.0.txt"; + + File dummyReleasesResourceFile = new File( repoRootLast, resourceName ); + dummyReleasesResourceFile.getParentFile().mkdirs(); + FileUtils.writeStringToFile( dummyReleasesResourceFile, "last", null ); + + WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/" + REPO_GROUP_WITH_VALID_REPOS + "/" + resourceName ); + WebResponse response = sc.getResponse( request ); + + assertResponseOK( response ); + assertEquals( "Expected file contents", "last", response.getText() ); + } + + /* + * Test Case 3.b + */ + public void testGetFromValidRepositoryGroupReturnNotFound() + throws Exception + { + String resourceName = "dummy/dummy-no-resource/1.0/dummy-no-resource-1.0.txt"; + + WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/" + REPO_GROUP_WITH_VALID_REPOS + "/" + resourceName ); + WebResponse response = sc.getResponse( request ); + + assertResponseNotFound( response ); + } + + /* + * Test Case 3.a + */ + public void testGetInvalidManagedRepositoryInGroupReturnNotFound() + throws Exception + { + String resourceName = "dummy/dummy-no-resource/1.0/dummy-no-resource-1.0.txt"; + + WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/" + REPO_GROUP_WITH_INVALID_REPOS + "/" + resourceName ); + WebResponse response = sc.getResponse( request ); + + assertResponseNotFound( response ); + } + + /* + * Test Case 4 + */ + public void testPutValidRepositoryGroupReturnBadRequest() + throws Exception + { + String resourceName = "dummy/dummy-put-resource/1.0/dummy-put-resource-1.0.txt"; + String putUrl = "http://machine.com/repository/" + REPO_GROUP_WITH_VALID_REPOS + "/" + resourceName; + InputStream is = getClass().getResourceAsStream( "/artifact.jar" ); + + WebRequest request = new PutMethodWebRequest( putUrl, is, "text/plain" ); + WebResponse response = sc.getResponse( request ); + + assertResponseMethodNotAllowed( response ); + } + + public void testBrowseRepositoryGroup() + throws Exception + { + WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/" + REPO_GROUP_WITH_VALID_REPOS ); + WebResponse response = sc.getResponse( request ); + + assertNotNull( "Should have received a response", response ); + assertEquals( "Should have been an 401 response code.", HttpServletResponse.SC_UNAUTHORIZED, response.getResponseCode() ); + } + + // MRM-872 + public void testGetMergedMetadata() + throws Exception + { + // first metadata file + String resourceName = "dummy/dummy-merged-metadata-resource/maven-metadata.xml"; + + File dummyInternalResourceFile = new File( repoRootFirst, resourceName ); + dummyInternalResourceFile.getParentFile().mkdirs(); + FileUtils.writeStringToFile( dummyInternalResourceFile, "\n" + + "\ndummy\ndummy-merged-metadata-resource\n" + + "\n1.0\n1.0\n\n1.0\n" + + "2.5\n\n20080708095554\n\n", null ); + + //second metadata file + resourceName = "dummy/dummy-merged-metadata-resource/maven-metadata.xml"; + dummyInternalResourceFile = new File( repoRootLast, resourceName ); + dummyInternalResourceFile.getParentFile().mkdirs(); + FileUtils.writeStringToFile( dummyInternalResourceFile, "" + + "dummydummy-merged-metadata-resource" + + "2.02.01.0" + + "1.52.020080709095554" + + "", null ); + + WebRequest request = new GetMethodWebRequest( "http://machine.com/repository/" + REPO_GROUP_WITH_VALID_REPOS + "/dummy/" + + "dummy-merged-metadata-resource/maven-metadata.xml" ); + WebResponse response = sc.getResource( request ); + + File returnedMetadata = new File( getBasedir(), "/target/test-classes/retrievedMetadataFile.xml"); + FileUtils.writeStringToFile( returnedMetadata, response.getText() ); + ArchivaRepositoryMetadata metadata = RepositoryMetadataReader.read( returnedMetadata ); + + assertResponseOK( response ); + assertEquals( "Versions list size", 4, metadata.getAvailableVersions().size() ); + assertTrue( "Versions list contains version 1.0", metadata.getAvailableVersions().contains( "1.0" ) ); + assertTrue( "Versions list contains version 1.5", metadata.getAvailableVersions().contains( "1.5" ) ); + assertTrue( "Versions list contains version 2.0", metadata.getAvailableVersions().contains( "2.0" ) ); + assertTrue( "Versions list contains version 2.5", metadata.getAvailableVersions().contains( "2.5" ) ); + + //check if the checksum files were generated + File checksumFileSha1 = new File( repoRootFirst, resourceName + ".sha1" ); + checksumFileSha1.getParentFile().mkdirs(); + FileUtils.writeStringToFile( checksumFileSha1, "3290853214d3687134", null ); + + File checksumFileMd5 = new File( repoRootFirst, resourceName + ".md5" ); + checksumFileMd5.getParentFile().mkdirs(); + FileUtils.writeStringToFile( checksumFileMd5, "98745897234eda12836423", null ); + + // request the sha1 checksum of the metadata + request = + new GetMethodWebRequest( "http://machine.com/repository/" + REPO_GROUP_WITH_VALID_REPOS + "/dummy/" + + "dummy-merged-metadata-resource/maven-metadata.xml.sha1" ); + response = sc.getResource( request ); + + assertResponseOK( response ); + assertEquals( "add113b0d7f8c6adb92a5015a7a3701081edf998 maven-metadata-group-with-valid-repos.xml", response.getText() ); + + // request the md5 checksum of the metadata + request = + new GetMethodWebRequest( "http://machine.com/repository/" + REPO_GROUP_WITH_VALID_REPOS + "/dummy/" + + "dummy-merged-metadata-resource/maven-metadata.xml.md5" ); + response = sc.getResource( request ); + + assertResponseOK( response ); + assertEquals( "5b85ea4aa5f52bb76760041a52f98de8 maven-metadata-group-with-valid-repos.xml", response.getText().trim() ); + } + + protected void assertResponseMethodNotAllowed( WebResponse response ) + { + assertNotNull( "Should have recieved a response", response ); + assertEquals( "Should have been an 405/Method Not Allowed response code.", HttpServletResponse.SC_METHOD_NOT_ALLOWED, response.getResponseCode() ); + } + + protected RepositoryGroupConfiguration createRepositoryGroup( String id, List repositories ) + { + RepositoryGroupConfiguration repoGroupConfiguration = new RepositoryGroupConfiguration(); + repoGroupConfiguration.setId( id ); + repoGroupConfiguration.setRepositories( repositories ); + return repoGroupConfiguration; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletSecurityTest.java b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletSecurityTest.java new file mode 100644 index 000000000..badd20cb6 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletSecurityTest.java @@ -0,0 +1,21 @@ +package org.apache.maven.archiva.webdav; + +/** + * RepositoryServletSecurityTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class RepositoryServletSecurityTest + extends AbstractRepositoryServletTestCase +{ + public void testSecuredGet() + { + + } + + public void testSecuredBrowse() + { + + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletTest.java b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletTest.java new file mode 100644 index 000000000..41b0b09fc --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletTest.java @@ -0,0 +1,123 @@ +package org.apache.maven.archiva.webdav; + +/* + * 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.archiva.configuration.ArchivaConfiguration; +import org.apache.maven.archiva.configuration.Configuration; +import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; +import org.apache.maven.archiva.webdav.RepositoryServlet; + +import com.meterware.httpunit.GetMethodWebRequest; +import com.meterware.httpunit.WebRequest; +import com.meterware.httpunit.WebResponse; + +import java.io.File; + +/** + * RepositoryServletTest + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class RepositoryServletTest + extends AbstractRepositoryServletTestCase +{ + private static final String REQUEST_PATH = "http://machine.com/repository/internal/"; + + private static final String NEW_REPOSITORY_ID = "new-id"; + + private static final String NEW_REPOSITORY_NAME = "New Repository"; + + public void testGetRepository() + throws Exception + { + RepositoryServlet servlet = (RepositoryServlet) sc.newInvocation( REQUEST_PATH ).getServlet(); + assertNotNull( servlet ); + + assertRepositoryValid( servlet, REPOID_INTERNAL ); + } + + public void testGetRepositoryAfterDelete() + throws Exception + { + RepositoryServlet servlet = (RepositoryServlet) sc.newInvocation( REQUEST_PATH ).getServlet(); + assertNotNull( servlet ); + + ArchivaConfiguration archivaConfiguration = servlet.getConfiguration(); + Configuration c = archivaConfiguration.getConfiguration(); + c.removeManagedRepository( c.findManagedRepositoryById( REPOID_INTERNAL ) ); + saveConfiguration( archivaConfiguration ); + + ManagedRepositoryConfiguration repository = servlet.getRepository( REPOID_INTERNAL ); + assertNull( repository ); + } + + public void testGetRepositoryAfterAdd() + throws Exception + { + RepositoryServlet servlet = (RepositoryServlet) sc.newInvocation( REQUEST_PATH ).getServlet(); + assertNotNull( servlet ); + + ArchivaConfiguration archivaConfiguration = servlet.getConfiguration(); + Configuration c = archivaConfiguration.getConfiguration(); + ManagedRepositoryConfiguration repo = new ManagedRepositoryConfiguration(); + repo.setId( NEW_REPOSITORY_ID ); + repo.setName( NEW_REPOSITORY_NAME ); + File repoRoot = new File( getBasedir(), "target/test-repository-root" ); + if ( !repoRoot.exists() ) + { + repoRoot.mkdirs(); + } + repo.setLocation( repoRoot.getAbsolutePath() ); + c.addManagedRepository( repo ); + saveConfiguration( archivaConfiguration ); + + ManagedRepositoryConfiguration repository = servlet.getRepository( NEW_REPOSITORY_ID ); + assertNotNull( repository ); + assertEquals( NEW_REPOSITORY_NAME, repository.getName() ); + + // check other is still intact + assertRepositoryValid( servlet, REPOID_INTERNAL ); + } + + public void testGetRepositoryInvalidPathPassthroughPresent() + throws Exception + { + String path = REQUEST_PATH + ".index/filecontent/segments.gen"; + + populateRepo( repoRootInternal, ".index/filecontent/segments.gen", "index file" ); + + WebRequest request = new GetMethodWebRequest( path ); + WebResponse response = sc.getResponse( request ); + assertResponseOK( response ); + assertEquals( "index file", response.getText() ); + } + + public void testGetRepositoryInvalidPathPassthroughMissing() + throws Exception + { + String path = REQUEST_PATH + ".index/filecontent/foo.bar"; + + WebRequest request = new GetMethodWebRequest( path ); + WebResponse response = sc.getResponse( request ); + assertResponseNotFound( response ); + assertEquals( "Invalid path to Artifact: legacy paths should have an expected type ending in [s] in the second part of the path.", response.getResponseMessage() ); + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/StubRepositoryContentConsumers.java b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/StubRepositoryContentConsumers.java new file mode 100644 index 000000000..ff9dbd237 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/StubRepositoryContentConsumers.java @@ -0,0 +1,21 @@ +package org.apache.maven.archiva.webdav; + +import org.apache.maven.archiva.consumers.InvalidRepositoryContentConsumer; +import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer; +import org.apache.maven.archiva.repository.scanner.RepositoryContentConsumers; + +import java.util.List; + +public class StubRepositoryContentConsumers + extends RepositoryContentConsumers +{ + public List getSelectedKnownConsumers() + { + return getAvailableKnownConsumers(); + } + + public synchronized List getSelectedInvalidConsumers() + { + return getAvailableInvalidConsumers(); + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/UnauthenticatedDavResourceFactory.java b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/UnauthenticatedDavResourceFactory.java new file mode 100644 index 000000000..81d739d3a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/UnauthenticatedDavResourceFactory.java @@ -0,0 +1,41 @@ +package org.apache.maven.archiva.webdav; + +/* + * 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.jackrabbit.webdav.DavException; +import org.apache.jackrabbit.webdav.DavServletRequest; +import org.apache.maven.archiva.webdav.ArchivaDavResourceFactory; + +/** + * UnauthenticatedDavResourceFactory + * + * @author Maria Odea Ching + * @version $Id: + */ +public class UnauthenticatedDavResourceFactory + extends ArchivaDavResourceFactory +{ + @Override + protected boolean isAuthorized( DavServletRequest request, String repositoryId ) + throws DavException + { + return true; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/UnauthenticatedDavSessionProvider.java b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/UnauthenticatedDavSessionProvider.java new file mode 100644 index 000000000..13082cf4d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/UnauthenticatedDavSessionProvider.java @@ -0,0 +1,42 @@ +package org.apache.maven.archiva.webdav; + +/* + * 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.jackrabbit.webdav.DavException; +import org.apache.jackrabbit.webdav.WebdavRequest; + +/** + * @author James William Dumay + */ +public class UnauthenticatedDavSessionProvider extends ArchivaDavSessionProvider +{ + public UnauthenticatedDavSessionProvider() + { + super(null, null); + } + + @Override + public boolean attachSession( WebdavRequest request ) + throws DavException + { + request.setDavSession(new ArchivaDavSession()); + return true; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/UnauthenticatedRepositoryServlet.java b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/UnauthenticatedRepositoryServlet.java new file mode 100644 index 000000000..d62ddf9ac --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/UnauthenticatedRepositoryServlet.java @@ -0,0 +1,41 @@ +package org.apache.maven.archiva.webdav; + +/* + * 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 javax.servlet.ServletConfig; + +/** + * UnauthenticatedRepositoryServlet + * + * @author Joakim Erdfelt + * @version $Id$ + */ +public class UnauthenticatedRepositoryServlet + extends RepositoryServlet +{ + @Override + public synchronized void initServers( ServletConfig servletConfig ) + { + super.initServers(servletConfig); + + UnauthenticatedDavSessionProvider sessionProvider = new UnauthenticatedDavSessionProvider(); + setDavSessionProvider(sessionProvider); + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/httpunit/MkColMethodWebRequest.java b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/httpunit/MkColMethodWebRequest.java new file mode 100644 index 000000000..39cdd3b34 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/httpunit/MkColMethodWebRequest.java @@ -0,0 +1,41 @@ +package org.apache.maven.archiva.webdav.httpunit; + +/* + * 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 com.meterware.httpunit.HeaderOnlyWebRequest; +import java.net.URL; + +/** + * MkColMethodWebRequest + * See RFC-2518 Section 8.3 + * @author James William Dumay + */ +public class MkColMethodWebRequest extends HeaderOnlyWebRequest +{ + public MkColMethodWebRequest( String urlString ) + { + super(urlString); + } + + @Override + public String getMethod() { + return "MKCOL"; + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/util/MimeTypesTest.java b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/util/MimeTypesTest.java new file mode 100644 index 000000000..addefe168 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/util/MimeTypesTest.java @@ -0,0 +1,42 @@ +package org.apache.maven.archiva.webdav.util; + +/* + * 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.codehaus.plexus.spring.PlexusInSpringTestCase; + +/** + * MimeTypesTest + * + * @author Joakim Erdfelt + * @version $Id: MimeTypesTest.java 6556 2007-06-20 20:44:46Z joakime $ + */ +public class MimeTypesTest extends PlexusInSpringTestCase +{ + public void testGetMimeType() throws Exception + { + MimeTypes mime = (MimeTypes) lookup( MimeTypes.class ); + assertNotNull( "MimeTypes should not be null.", mime ); + + assertEquals( "application/pdf", mime.getMimeType( "big-book.pdf" ) ); + assertEquals( "application/octet-stream", mime.getMimeType( "BookMaker.class" ) ); + assertEquals( "application/vnd.ms-powerpoint", mime.getMimeType( "TypeSetting.ppt" ) ); + assertEquals( "application/java-archive", mime.getMimeType( "BookViewer.jar" ) ); + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/util/RepositoryPathUtilTest.java b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/util/RepositoryPathUtilTest.java new file mode 100644 index 000000000..11a845c46 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/util/RepositoryPathUtilTest.java @@ -0,0 +1,52 @@ +package org.apache.maven.archiva.webdav.util; + +/* + * 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; + +/** + * @author James William Dumay + */ +public class RepositoryPathUtilTest extends TestCase +{ + public void testGetRepositoryId() + { + String href = "/path/to/my/resource"; + assertEquals("to", RepositoryPathUtil.getRepositoryName(href)); + + href = "path/to/my/resource"; + assertEquals("to", RepositoryPathUtil.getRepositoryName(href)); + + href = "mypath"; + assertEquals("/", RepositoryPathUtil.getLogicalResource(href)); + } + + public void testGetLogicalPath() + { + String href = "/repository/internal/org/apache/maven/someartifact.jar"; + assertEquals("/org/apache/maven/someartifact.jar", RepositoryPathUtil.getLogicalResource(href)); + + href = "repository/internal/org/apache/maven/someartifact.jar"; + assertEquals("/org/apache/maven/someartifact.jar", RepositoryPathUtil.getLogicalResource(href)); + + href = "repository/internal/org/apache/maven/"; + assertEquals( "/org/apache/maven/", RepositoryPathUtil.getLogicalResource( href ) ); + } +} diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/resources/META-INF/plexus/components.xml b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/resources/META-INF/plexus/components.xml new file mode 100644 index 000000000..921c1cca1 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/resources/META-INF/plexus/components.xml @@ -0,0 +1,33 @@ + + + + + + + + org.apache.maven.archiva.webdav.util.MimeTypes + org.apache.maven.archiva.webdav.util.MimeTypes + MimeTypes + + archiva-mime-types.txt + + + + \ No newline at end of file diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/resources/WEB-INF/web.xml b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/resources/WEB-INF/web.xml new file mode 100644 index 000000000..cfe7c5fbe --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/resources/WEB-INF/web.xml @@ -0,0 +1,45 @@ + + + + + + Apache Archiva + + + org.springframework.web.context.ContextLoaderListener + + + + contextClass + org.codehaus.plexus.spring.PlexusWebApplicationContext + + + + contextConfigLocation + + classpath*:/META-INF/plexus/components.xml + classpath*:/META-INF/spring-context.xml + target/test-classes/org/apache/maven/archiva/webdav/RepositoryServletTest.xml + + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/resources/archiva-mime-types.txt b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/resources/archiva-mime-types.txt new file mode 100644 index 000000000..43e6cb24f --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/resources/archiva-mime-types.txt @@ -0,0 +1,127 @@ +# This file controls what Internet media types are sent to the client for +# given file extension(s). Sending the correct media type to the client +# is important so they know how to handle the content of the file. +# Extra types can either be added here or by using an AddType directive +# in your config files. For more information about Internet media types, +# please read RFC 2045, 2046, 2047, 2048, and 2077. The Internet media type +# registry is at . + +# MIME type Extensions + +application/andrew-inset ez +application/atom+xml atom +application/java-archive jar +application/mac-binhex40 hqx +application/mac-compactpro cpt +application/mathml+xml mathml +application/msword doc +application/octet-stream bin dms lha lzh exe class so dll dmg +application/oda oda +application/ogg ogg +application/pdf pdf +application/pgp-encrypted pgp +application/postscript ai eps ps +application/rdf+xml rdf +application/smil smi smil +application/srgs gram +application/srgs+xml grxml +application/vnd.mif mif +application/vnd.mozilla.xul+xml xul +application/vnd.ms-excel xls +application/vnd.ms-powerpoint ppt +application/vnd.rn-realmedia rm +application/vnd.wap.wbxml wbxml +application/vnd.wap.wmlc wmlc +application/vnd.wap.wmlscriptc wmlsc +application/voicexml+xml vxml +application/x-bcpio bcpio +application/x-cdlink vcd +application/x-chess-pgn pgn +application/x-cpio cpio +application/x-csh csh +application/x-director dcr dir dxr +application/x-dvi dvi +application/x-futuresplash spl +application/x-gtar gtar +application/x-hdf hdf +application/x-java-jnlp-file jnlp +application/x-javascript js +application/x-koan skp skd skt skm +application/x-latex latex +application/x-netcdf nc cdf +application/x-sh sh +application/x-shar shar +application/x-shockwave-flash swf +application/x-stuffit sit +application/x-sv4cpio sv4cpio +application/x-sv4crc sv4crc +application/x-tar tar +application/x-tcl tcl +application/x-tex tex +application/x-texinfo texinfo texi +application/x-troff t tr roff +application/x-troff-man man +application/x-troff-me me +application/x-troff-ms ms +application/x-ustar ustar +application/x-wais-source src +application/xhtml+xml xhtml xht +application/xml xml xsl pom +application/xml-dtd dtd +application/xslt+xml xslt +application/zip zip +audio/basic au snd +audio/midi mid midi kar +audio/mpeg mpga mp2 mp3 +audio/x-aiff aif aiff aifc +audio/x-mpegurl m3u +audio/x-pn-realaudio ram ra +audio/x-wav wav +chemical/x-pdb pdb +chemical/x-xyz xyz +image/bmp bmp +image/cgm cgm +image/gif gif +image/ief ief +image/jp2 jp2 +image/jpeg jpeg jpg jpe +image/pict pict pic pct +image/png png +image/svg+xml svg +image/tiff tiff tif +image/vnd.djvu djvu djv +image/vnd.wap.wbmp wbmp +image/x-cmu-raster ras +image/x-icon ico +image/x-macpaint pntg pnt mac +image/x-portable-anymap pnm +image/x-portable-bitmap pbm +image/x-portable-graymap pgm +image/x-portable-pixmap ppm +image/x-quicktime qtif qti +image/x-rgb rgb +image/x-xbitmap xbm +image/x-xpixmap xpm +image/x-xwindowdump xwd +model/iges igs iges +model/mesh msh mesh silo +model/vrml wrl vrml +text/calendar ics ifb +text/css css +text/html html htm +text/plain asc txt sha1 md5 +text/richtext rtx +text/rtf rtf +text/sgml sgml sgm +text/tab-separated-values tsv +text/vnd.wap.wml wml +text/vnd.wap.wmlscript wmls +text/x-setext etx +video/mp4 mp4 +video/mpeg mpeg mpg mpe +video/quicktime qt mov +video/vnd.mpegurl mxu m4u +video/x-dv dv dif +video/x-msvideo avi +video/x-sgi-movie movie +x-conference/x-cooltalk ice diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/resources/artifact.jar b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/resources/artifact.jar new file mode 100644 index 000000000..e6f67ee94 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/resources/artifact.jar @@ -0,0 +1 @@ +artifact.jar diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/resources/log4j.xml b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/resources/log4j.xml new file mode 100644 index 000000000..a2e7ea23d --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/resources/log4j.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/resources/org/apache/maven/archiva/webdav/RepositoryServletSecurityTest.xml b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/resources/org/apache/maven/archiva/webdav/RepositoryServletSecurityTest.xml new file mode 100644 index 000000000..d7087095a --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/resources/org/apache/maven/archiva/webdav/RepositoryServletSecurityTest.xml @@ -0,0 +1,273 @@ + + + + + + + + org.codehaus.plexus.logging.LoggerManager + org.codehaus.plexus.logging.slf4j.Slf4jLoggerManager + basic + + + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + org.apache.maven.archiva.configuration.DefaultArchivaConfiguration + + + org.codehaus.plexus.registry.Registry + configured + + + org.apache.maven.archiva.policies.PreDownloadPolicy + prePolicies + + + org.apache.maven.archiva.policies.PostDownloadPolicy + postPolicies + + + + + org.codehaus.plexus.registry.Registry + configured + org.codehaus.plexus.registry.commons.CommonsConfigurationRegistry + + + + + + + + + + org.apache.maven.archiva.webdav.DavServerManager + default + org.apache.maven.archiva.webdav.DefaultDavServerManager + DefaultDavServerManager + + proxied + + + + + org.codehaus.plexus.cache.Cache + url-failures-cache + org.codehaus.plexus.cache.ehcache.EhcacheCache + URL Failure Cache + + 600 + false + ${java.io.tmpdir}/archiva/urlcache + false + 1000 + LRU + url-failures-cache + false + + 2700 + + 1800 + + + + + + + org.apache.maven.archiva.repository.scanner.RepositoryContentConsumers + default + org.apache.maven.archiva.web.repository.StubRepositoryContentConsumers + + + + + org.codehaus.plexus.redback.system.SecuritySystem + default + org.codehaus.plexus.redback.system.DefaultSecuritySystem + + + org.codehaus.plexus.redback.authentication.AuthenticationManager + authnManager + + + org.codehaus.plexus.redback.authorization.Authorizer + rbac + authorizer + + + org.codehaus.plexus.redback.users.UserManager + memory + userManager + + + org.codehaus.plexus.redback.keys.KeyManager + memory + keyManager + + + org.codehaus.plexus.redback.policy.UserSecurityPolicy + policy + + + + + + org.codehaus.plexus.redback.authentication.Authenticator + user-manager + org.codehaus.plexus.redback.authentication.users.UserManagerAuthenticator + + + org.codehaus.plexus.redback.users.UserManager + memory + userManager + + + org.codehaus.plexus.redback.policy.UserSecurityPolicy + securityPolicy + + + + + + org.codehaus.plexus.redback.authentication.Authenticator + keystore + org.codehaus.plexus.redback.authentication.keystore.KeyStoreAuthenticator + + + org.codehaus.plexus.redback.keys.KeyManager + memory + keystore + + + org.codehaus.plexus.redback.users.UserManager + memory + userManager + + + + + + org.codehaus.plexus.redback.authorization.rbac.evaluator.PermissionEvaluator + default + org.codehaus.plexus.redback.authorization.rbac.evaluator.DefaultPermissionEvaluator + + + + org.codehaus.plexus.redback.users.UserManager + memory + userManager + + + + + + org.codehaus.plexus.redback.authorization.Authorizer + rbac + org.codehaus.plexus.redback.authorization.rbac.RbacAuthorizer + + + org.codehaus.plexus.redback.rbac.RBACManager + memory + manager + + + org.codehaus.plexus.redback.users.UserManager + memory + userManager + + + org.codehaus.plexus.redback.authorization.rbac.evaluator.PermissionEvaluator + default + evaluator + + + + + + org.codehaus.plexus.redback.role.RoleManager + default + org.codehaus.plexus.redback.role.DefaultRoleManager + singleton + + + org.codehaus.plexus.redback.role.merger.RoleModelMerger + default + modelMerger + + + org.codehaus.plexus.redback.role.validator.RoleModelValidator + default + modelValidator + + + org.codehaus.plexus.redback.role.processor.RoleModelProcessor + default + modelProcessor + + + org.codehaus.plexus.redback.role.template.RoleTemplateProcessor + default + templateProcessor + + + org.codehaus.plexus.redback.rbac.RBACManager + memory + rbacManager + + + org.codehaus.plexus.PlexusContainer + container + + + + + + org.codehaus.plexus.redback.role.processor.RoleModelProcessor + default + org.codehaus.plexus.redback.role.processor.DefaultRoleModelProcessor + + + org.codehaus.plexus.redback.rbac.RBACManager + memory + rbacManager + + + + + + org.codehaus.plexus.redback.role.template.RoleTemplateProcessor + default + org.codehaus.plexus.redback.role.template.DefaultRoleTemplateProcessor + + + org.codehaus.plexus.redback.rbac.RBACManager + memory + rbacManager + + + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/resources/org/apache/maven/archiva/webdav/RepositoryServletTest.xml b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/resources/org/apache/maven/archiva/webdav/RepositoryServletTest.xml new file mode 100644 index 000000000..83fd2a4e6 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/resources/org/apache/maven/archiva/webdav/RepositoryServletTest.xml @@ -0,0 +1,172 @@ + + + + + + + + org.codehaus.plexus.logging.LoggerManager + org.codehaus.plexus.logging.slf4j.Slf4jLoggerManager + basic + + + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + org.apache.maven.archiva.configuration.DefaultArchivaConfiguration + + + org.codehaus.plexus.registry.Registry + configured + + + org.apache.maven.archiva.policies.PreDownloadPolicy + prePolicies + + + org.apache.maven.archiva.policies.PostDownloadPolicy + postPolicies + + + + + org.codehaus.plexus.registry.Registry + configured + org.codehaus.plexus.registry.commons.CommonsConfigurationRegistry + + + + + + + + + + org.apache.maven.archiva.webdav.DavServerManager + default + org.apache.maven.archiva.webdav.DefaultDavServerManager + DefaultDavServerManager + + + org.apache.maven.archiva.webdav.DavServerComponent + proxied + + + + + + org.codehaus.plexus.cache.Cache + url-failures-cache + org.codehaus.plexus.cache.ehcache.EhcacheCache + URL Failure Cache + + 600 + false + ${java.io.tmpdir}/archiva/urlcache + false + 1000 + LRU + url-failures-cache + false + + 2700 + + 1800 + + + + + + + org.apache.maven.archiva.repository.scanner.RepositoryContentConsumers + default + org.apache.maven.archiva.webdav.StubRepositoryContentConsumers + + + + org.codehaus.plexus.redback.system.SecuritySystem + default + org.apache.maven.archiva.webdav.BypassSecuritySystem + + + + org.apache.maven.archiva.webdav.ArchivaDavResourceFactory + org.apache.maven.archiva.webdav.UnauthenticatedDavResourceFactory + + + org.apache.maven.archiva.configuration.ArchivaConfiguration + archivaConfiguration + + + org.apache.maven.archiva.repository.RepositoryContentFactory + repositoryFactory + + + org.apache.maven.archiva.repository.content.RepositoryRequest + repositoryRequest + + + org.apache.maven.archiva.proxy.RepositoryProxyConnectors + connectors + + + org.apache.maven.archiva.repository.metadata.MetadataTools + metadataTools + + + org.apache.maven.archiva.security.ServletAuthenticator + servletAuth + + + org.apache.maven.archiva.webdav.util.MimeTypes + mimeTypes + + + org.codehaus.plexus.redback.xwork.filter.authentication.HttpAuthenticator + basic + httpAuth + + + org.apache.maven.archiva.repository.scanner.RepositoryContentConsumers + default + + + org.codehaus.plexus.digest.ChecksumFile + checksum + + + org.codehaus.plexus.digest.Digester + sha1 + digestSha1 + + + org.codehaus.plexus.digest.Digester + md5 + digestMd5 + + + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/resources/org/apache/maven/archiva/webdav/repository-archiva.xml b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/resources/org/apache/maven/archiva/webdav/repository-archiva.xml new file mode 100644 index 000000000..997d62b00 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/resources/org/apache/maven/archiva/webdav/repository-archiva.xml @@ -0,0 +1,111 @@ + + + + + + 2 + + + + + artifacts + + **/*.pom + **/*.jar + **/*.ear + **/*.war + **/*.car + **/*.sar + **/*.mar + **/*.rar + **/*.dtd + **/*.tld + **/*.tar.gz + **/*.tar.bz2 + **/*.zip + + + + indexable-content + + **/*.txt + **/*.TXT + **/*.block + **/*.config + **/*.pom + **/*.xml + **/*.xsd + **/*.dtd + **/*.tld + + + + auto-remove + + **/*.bak + **/*~ + **/*- + + + + ignored + + **/.htaccess + **/KEYS + **/*.rb + **/*.sh + **/.svn/** + **/.DAV/** + + + + + update-db-artifact + create-missing-checksums + update-db-repository-metadata + validate-checksum + validate-signature + index-content + auto-remove + auto-rename + + + update-db-bad-content + + + + + 0 0 * * * ? + + index-artifact + update-db-project + validate-repository-metadata + index-archive-toc + update-db-bytecode-stats + index-public-methods + + + not-present-remove-db-artifact + not-present-remove-db-project + not-present-remove-indexed + + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/resources/org/apache/maven/archiva/webdav/simple/SimpleDavServerComponentBasicTest.xml b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/resources/org/apache/maven/archiva/webdav/simple/SimpleDavServerComponentBasicTest.xml new file mode 100644 index 000000000..323862265 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/resources/org/apache/maven/archiva/webdav/simple/SimpleDavServerComponentBasicTest.xml @@ -0,0 +1,38 @@ + + + + + + + + org.apache.maven.archiva.webdav.DavServerManager + simple + org.apache.maven.archiva.webdav.DefaultDavServerManager + DefaultDavServerManager + + + org.apache.maven.archiva.webdav.DavServerComponent + simple + + + + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/resources/org/apache/maven/archiva/webdav/simple/SimpleDavServerComponentIndexHtmlTest.xml b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/resources/org/apache/maven/archiva/webdav/simple/SimpleDavServerComponentIndexHtmlTest.xml new file mode 100644 index 000000000..323862265 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/resources/org/apache/maven/archiva/webdav/simple/SimpleDavServerComponentIndexHtmlTest.xml @@ -0,0 +1,38 @@ + + + + + + + + org.apache.maven.archiva.webdav.DavServerManager + simple + org.apache.maven.archiva.webdav.DefaultDavServerManager + DefaultDavServerManager + + + org.apache.maven.archiva.webdav.DavServerComponent + simple + + + + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/resources/org/apache/maven/archiva/webdav/simple/SimpleDavServerComponentMultiTest.xml b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/resources/org/apache/maven/archiva/webdav/simple/SimpleDavServerComponentMultiTest.xml new file mode 100644 index 000000000..323862265 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/resources/org/apache/maven/archiva/webdav/simple/SimpleDavServerComponentMultiTest.xml @@ -0,0 +1,38 @@ + + + + + + + + org.apache.maven.archiva.webdav.DavServerManager + simple + org.apache.maven.archiva.webdav.DefaultDavServerManager + DefaultDavServerManager + + + org.apache.maven.archiva.webdav.DavServerComponent + simple + + + + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/resources/org/apache/maven/archiva/webdav/simple/SimpleWebdavServer.xml b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/resources/org/apache/maven/archiva/webdav/simple/SimpleWebdavServer.xml new file mode 100644 index 000000000..323862265 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/resources/org/apache/maven/archiva/webdav/simple/SimpleWebdavServer.xml @@ -0,0 +1,38 @@ + + + + + + + + org.apache.maven.archiva.webdav.DavServerManager + simple + org.apache.maven.archiva.webdav.DefaultDavServerManager + DefaultDavServerManager + + + org.apache.maven.archiva.webdav.DavServerComponent + simple + + + + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/resources/repository-archiva.xml b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/resources/repository-archiva.xml new file mode 100644 index 000000000..997d62b00 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/resources/repository-archiva.xml @@ -0,0 +1,111 @@ + + + + + + 2 + + + + + artifacts + + **/*.pom + **/*.jar + **/*.ear + **/*.war + **/*.car + **/*.sar + **/*.mar + **/*.rar + **/*.dtd + **/*.tld + **/*.tar.gz + **/*.tar.bz2 + **/*.zip + + + + indexable-content + + **/*.txt + **/*.TXT + **/*.block + **/*.config + **/*.pom + **/*.xml + **/*.xsd + **/*.dtd + **/*.tld + + + + auto-remove + + **/*.bak + **/*~ + **/*- + + + + ignored + + **/.htaccess + **/KEYS + **/*.rb + **/*.sh + **/.svn/** + **/.DAV/** + + + + + update-db-artifact + create-missing-checksums + update-db-repository-metadata + validate-checksum + validate-signature + index-content + auto-remove + auto-rename + + + update-db-bad-content + + + + + 0 0 * * * ? + + index-artifact + update-db-project + validate-repository-metadata + index-archive-toc + update-db-bytecode-stats + index-public-methods + + + not-present-remove-db-artifact + not-present-remove-db-project + not-present-remove-indexed + + + + diff --git a/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/webapp/WEB-INF/web.xml b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/webapp/WEB-INF/web.xml new file mode 100644 index 000000000..93634b40e --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/archiva-webdav/src/test/webapp/WEB-INF/web.xml @@ -0,0 +1,43 @@ + + + + + + Apache Archiva + + + org.springframework.web.context.ContextLoaderListener + + + + contextClass + org.codehaus.plexus.spring.PlexusWebApplicationContext + + + + contextConfigLocation + + classpath*:/META-INF/plexus/components.xml + + + + diff --git a/MRM-541/archiva-modules/archiva-web/pom.xml b/MRM-541/archiva-modules/archiva-web/pom.xml new file mode 100644 index 000000000..a46196010 --- /dev/null +++ b/MRM-541/archiva-modules/archiva-web/pom.xml @@ -0,0 +1,45 @@ + + + 4.0.0 + + org.apache.archiva + archiva-modules + 1.2-SNAPSHOT + ../pom.xml + + + archiva-web + Archiva Web + pom + + + archiva-applet + archiva-security + archiva-webapp + archiva-webdav + archiva-rss + + + + + webapp-test + + archiva-webapp-test + + + + diff --git a/MRM-541/archiva-modules/pom.xml b/MRM-541/archiva-modules/pom.xml new file mode 100644 index 000000000..65a1868ae --- /dev/null +++ b/MRM-541/archiva-modules/pom.xml @@ -0,0 +1,207 @@ + + + + + + + archiva + org.apache.archiva + 1.2-SNAPSHOT + + 4.0.0 + archiva-modules + pom + Archiva :: Modules + http://archiva.apache.org/ref/${project.version} + + archiva-base + archiva-database + archiva-reporting + archiva-scheduled + archiva-web + + + + + org.codehaus.mojo + cobertura-maven-plugin + 2.2 + + + org.apache.maven.plugins + maven-checkstyle-plugin + 2.1 + + true + config/maven_checks.xml + + + + + + org.codehaus.mojo + changelog-maven-plugin + + + org.codehaus.mojo + taglist-maven-plugin + + + maven-jxr-plugin + + true + + + + maven-surefire-report-plugin + 2.4.2 + + + maven-javadoc-plugin + 2.4 + + 1.5 + true + gr.spinellis.umlgraph.doclet.UmlGraphDoc + + gr.spinellis + UmlGraph + 4.6 + + + -inferrel -inferdep -quiet -hide java.* + -collpackages java.util.* -qualify + -postfixpackage -nodefontsize 9 + -nodefontpackagesize 7 + + + http://java.sun.com/j2se/1.4.2/docs/api + http://java.sun.com/j2ee/1.4/docs/api + http://java.sun.com/j2se/1.5.0/docs/api + http://commons.apache.org/collections/apidocs-COLLECTIONS_3_0/ + http://commons.apache.org/dbcp/apidocs/ + http://commons.apache.org/fileupload/apidocs/ + http://commons.apache.org/httpclient/apidocs/ + http://commons.apache.org/logging/apidocs/ + http://commons.apache.org/pool/apidocs/ + http://junit.sourceforge.net/javadoc/ + http://logging.apache.org/log4j/1.2/apidocs/ + http://jakarta.apache.org/regexp/apidocs/ + http://velocity.apache.org/engine/releases/velocity-1.5/apidocs/ + + + + + org.apache.maven.plugins + maven-pmd-plugin + + + 1.5 + + + + org.codehaus.mojo + clirr-maven-plugin + + + + + + ci + + + + org.apache.maven.plugins + maven-pmd-plugin + + + + + cpd-check + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + + + + + + + + + + org.codehaus.mojo + cobertura-maven-plugin + 2.2 + + + + 77 + 95 + + + + **/*$* + + + + + + clean + + clean + + + + check + + check + + + + + + + + + + + apache.website + ${siteBaseDeployment}/ref/${project.version} + + + diff --git a/MRM-541/archiva-modules/src/site/site.xml b/MRM-541/archiva-modules/src/site/site.xml new file mode 100644 index 000000000..8f7ecf05d --- /dev/null +++ b/MRM-541/archiva-modules/src/site/site.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/MRM-541/pom-4.1.0.xml b/MRM-541/pom-4.1.0.xml new file mode 100644 index 000000000..c19624797 --- /dev/null +++ b/MRM-541/pom-4.1.0.xml @@ -0,0 +1,410 @@ + + + + + + 4.1.0 + + + + + Archiva + archiva + pom + 1.1-SNAPSHOT + + + http://maven.apache.org/archiva/ + + + + + + + descriptor + + + + + + + + 1.5 + 1.5 + + + + + 1.5 + + + + + + + + process + + + + org.apache:apache-jar-resource-bundle:1.3 + + + + + + + + + + + 1.4 + + + + + https://svn.apache.org/repos/asf/archiva/tags + clean install + + + + + + + + archiva-base + archiva-database + archiva-reporting + archiva-scheduled + archiva-web + archiva-cli + archiva-docs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + config/maven_checks.xml + + + + + + + + true + + + + + + 1.5 + true + gr.spinellis.umlgraph.doclet.UmlGraphDoc + + gr.spinellis + UmlGraph + 4.6 + + + -inferrel -inferdep -quiet -hide java.* + -collpackages java.util.* -qualify + -postfixpackage -nodefontsize 9 + -nodefontpackagesize 7 + + + + + + + 1.5 + + + + + + + + + + + + + + + + + cpd-check + + + + + + + + + + + + + + + + + + 77 + 95 + + + + **/*$* + + + + + + + clean + + + + + check + + + + + + + + + + + + + + + + src/main/assembly/src.xml + + gnu + false + apache-archiva-${project.version}-src + + + + + single + + + + + + + + + + 2.0.5 + 1.0-rc1-SNAPSHOT + 1.0-alpha-4 + + + + + diff --git a/MRM-541/pom.xml b/MRM-541/pom.xml new file mode 100644 index 000000000..4b7541a34 --- /dev/null +++ b/MRM-541/pom.xml @@ -0,0 +1,1055 @@ + + + + + + 4.0.0 + + 2.0.6 + + + + org.apache.archiva + archiva-parent + 3 + ../parent/pom.xml + + Archiva + archiva + pom + 1.2-SNAPSHOT + http://archiva.apache.org + + scm:svn:http://svn.apache.org/repos/asf/archiva/trunk + scm:svn:https://svn.apache.org/repos/asf/archiva/trunk + http://svn.apache.org/viewvc/archiva/trunk + + + + + + + org.apache.maven.plugins + maven-remote-resources-plugin + + + + process + + + + org.apache:apache-jar-resource-bundle:1.3 + + + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 1.0-alpha-3 + + + + enforce + + + + + + org.codehaus.plexus:plexus-container-default + commons-logging:commons-logging + velocity:velocity-dep + classworlds:classworlds + javax.transaction:jta + javax.sql:jdbc-stdext + ant:ant-optional + + xom:xom + + + + + + + + + org.codehaus.plexus + plexus-maven-plugin + 1.3.5 + + + generate + + descriptor + + + + + + + + + org.codehaus.modello + modello-maven-plugin + 1.0-alpha-15 + + + org.apache.maven.plugins + maven-compiler-plugin + 2.0.2 + + 1.5 + 1.5 + + + + org.apache.maven.plugins + maven-remote-resources-plugin + 1.0-beta-2 + + + org.apache.maven.plugins + maven-deploy-plugin + 2.3 + + + org.apache.maven.plugins + maven-gpg-plugin + 1.0-alpha-4 + + + org.apache.maven.plugins + maven-install-plugin + 2.2 + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + org.apache.maven.plugins + maven-release-plugin + 2.0-beta-7 + + https://svn.apache.org/repos/asf/archiva/tags + false + deploy + clean install + -Prelease + + + + org.apache.maven.plugins + maven-resources-plugin + 2.2 + + + org.apache.maven.plugins + maven-surefire-plugin + 2.4.2 + + true + + + + maven-idea-plugin + + 1.5 + + + + + + + archiva-cli + archiva-docs + archiva-jetty + archiva-modules + + + + junit + junit + 3.8.1 + test + + + httpunit + httpunit + 1.6.2 + test + + + easymock + easymock + 1.2_Java1.3 + test + + + org.slf4j + jcl104-over-slf4j + test + + + org.slf4j + slf4j-log4j12 + test + + + + + + org.apache.jackrabbit + jackrabbit-webdav + 1.4 + + + commons-logging + commons-logging + + + + + xerces + xercesImpl + 2.8.1 + + + javax.activation + activation + 1.1 + + + org.apache.archiva + archiva-applet + 1.2-SNAPSHOT + + + org.apache.archiva + archiva-artifact-converter + 1.2-SNAPSHOT + + + org.apache.archiva + archiva-artifact-reports + 1.2-SNAPSHOT + + + org.apache.archiva + archiva-checksum + 1.2-SNAPSHOT + + + org.apache.archiva + archiva-common + 1.2-SNAPSHOT + + + org.apache.archiva + archiva-configuration + 1.2-SNAPSHOT + + + org.apache.archiva + archiva-consumer-api + 1.2-SNAPSHOT + + + org.apache.archiva + archiva-converter + 1.2-SNAPSHOT + + + org.apache.archiva + archiva-dependency-graph + 1.2-SNAPSHOT + + + org.apache.archiva + archiva-core + ${pom.version} + + + org.apache.archiva + archiva-core-consumers + 1.2-SNAPSHOT + + + org.apache.archiva + archiva-database + 1.2-SNAPSHOT + + + org.apache.archiva + archiva-database-consumers + 1.2-SNAPSHOT + + + org.apache.archiva + archiva-indexer + 1.2-SNAPSHOT + + + org.apache.archiva + archiva-lucene-consumers + 1.2-SNAPSHOT + + + org.apache.archiva + archiva-model + 1.2-SNAPSHOT + + + org.apache.archiva + archiva-policies + 1.2-SNAPSHOT + + + org.apache.archiva + archiva-proxy + 1.2-SNAPSHOT + + + org.apache.archiva + archiva-report-manager + 1.2-SNAPSHOT + + + org.apache.archiva + archiva-repository-layer + 1.2-SNAPSHOT + + + org.apache.archiva + archiva-scheduled + 1.2-SNAPSHOT + + + org.apache.archiva + archiva-security + 1.2-SNAPSHOT + + + org.apache.archiva + archiva-signature-consumers + 1.2-SNAPSHOT + + + org.apache.archiva + archiva-transaction + 1.2-SNAPSHOT + + + org.apache.archiva + archiva-docs + 1.2-SNAPSHOT + zip + docs + + + org.apache.archiva + archiva-webapp + 1.2-SNAPSHOT + war + + + org.apache.archiva + archiva-xml-tools + 1.2-SNAPSHOT + + + org.apache.archiva + archiva-webdav + 1.2-SNAPSHOT + + + org.apache.archiva + archiva-rss + 1.2-SNAPSHOT + + + org.codehaus.plexus + plexus-spring + 1.0 + + + org.codehaus.plexus + plexus-container-default + + + + + stax + stax + 1.2.0 + + + commons-codec + commons-codec + 1.3 + + + commons-collections + commons-collections + 3.2 + + + commons-fileupload + commons-fileupload + 1.2 + + + commons-io + commons-io + 1.4 + + + commons-lang + commons-lang + 2.2 + + + org.apache.derby + derby + 10.1.3.1 + + + org.apache.derby + derbytools + 10.1.3.1 + + + dom4j + dom4j + 1.6.1 + + + hsqldb + hsqldb + 1.8.0.7 + test + + + jaxen + jaxen + 1.1 + + + xom + xom + + + + + javax.jdo + jdo2-api + 2.0 + + + jpox + jpox + 1.1.9 + + + javax.transaction + jta + + + + + javax.servlet + jsp-api + 2.0 + provided + + + javax.servlet + jstl + 1.1.2 + + + log4j + log4j + 1.2.14 + + + org.apache.lucene + lucene-core + 2.3.1 + + + javax.mail + mail + 1.4 + + + org.apache.maven + maven-artifact-manager + ${maven.version} + + + org.codehaus.plexus + plexus-container-default + + + + + org.apache.maven + maven-model + ${maven.version} + + + org.apache.maven + maven-repository-metadata + ${maven.version} + + + org.codehaus.plexus + plexus-component-api + 1.0-alpha-22 + + + org.codehaus.plexus + plexus-digest + 1.1 + + + org.codehaus.plexus + plexus-expression-evaluator + 1.0-rc1 + + + org.codehaus.plexus + plexus-container-default + + + + + org.codehaus.plexus + plexus-i18n + 1.0-beta-6 + + + org.codehaus.plexus + plexus-container-default + + + + + org.codehaus.plexus + plexus-jdo2 + 1.0-alpha-8 + + + org.codehaus.plexus + plexus-container-default + + + + + org.codehaus.plexus + plexus-quartz + 1.0-alpha-3 + + + commons-logging + commons-logging + + + org.codehaus.plexus + plexus-container-default + + + + + org.codehaus.plexus + plexus-slf4j-logging + 1.1-alpha-1 + + + org.slf4j + slf4j-simple + + + org.codehaus.plexus + plexus-container-default + + + + + org.codehaus.plexus + plexus-taskqueue + 1.0-alpha-8 + + + org.codehaus.plexus + plexus-utils + 1.4.5 + + + org.codehaus.plexus.cache + plexus-cache-api + 1.0-alpha-2 + + + org.codehaus.plexus + plexus-container-default + + + + + org.codehaus.plexus.cache + plexus-cache-ehcache + 1.0-alpha-2 + + + org.codehaus.plexus + plexus-container-default + + + + + org.codehaus.plexus.redback + redback-rbac-memory + ${redback.version} + test + + + org.codehaus.plexus + plexus-container-default + + + + + org.codehaus.plexus.redback + redback-users-memory + ${redback.version} + test + + + org.codehaus.plexus + plexus-container-default + + + + + org.codehaus.plexus.redback + redback-keys-memory + ${redback.version} + test + + + org.codehaus.plexus + plexus-container-default + + + + + org.codehaus.plexus.redback + redback-rbac-model + ${redback.version} + + + org.codehaus.plexus + plexus-container-default + + + + + org.codehaus.plexus.redback + redback-authorization-rbac + ${redback.version} + + + org.codehaus.plexus + plexus-container-default + + + + + org.codehaus.plexus.redback + redback-rbac-role-manager + ${redback.version} + + + org.codehaus.plexus + plexus-container-default + + + + + org.codehaus.plexus.redback + redback-system + ${redback.version} + + + org.codehaus.plexus + plexus-container-default + + + + + org.codehaus.plexus.redback + redback-taglib + ${redback.version} + + + org.codehaus.plexus + plexus-container-default + + + + + org.codehaus.plexus.redback + redback-xwork-content + ${redback.version} + war + + + classworlds + classworlds + + + + + org.codehaus.plexus.redback + redback-xwork-integration + ${redback.version} + + + classworlds + classworlds + + + velocity + velocity-dep + + + commons-logging + commons-logging + + + org.codehaus.plexus + plexus-container-default + + + + + org.codehaus.plexus.registry + plexus-registry-api + 1.0-alpha-2 + + + org.codehaus.plexus + plexus-container-default + + + + + org.codehaus.plexus.registry + plexus-registry-commons + 1.0-alpha-2 + + + ant + ant-optional + + + jdom + jdom + + + commons-logging + commons-logging-api + + + commons-logging + commons-logging + + + + + javax.servlet + servlet-api + 2.4 + + + opensymphony + sitemesh + 2.2.1 + + + org.slf4j + jcl104-over-slf4j + 1.5.0 + + + org.slf4j + slf4j-api + 1.5.0 + + + org.slf4j + slf4j-simple + 1.5.0 + + + org.slf4j + slf4j-log4j12 + 1.5.0 + + + taglibs + standard + 1.1.2 + + + org.apache.maven.wagon + wagon-file + ${wagon.version} + + + org.apache.maven.wagon + wagon-http-lightweight + ${wagon.version} + + + nekohtml + xercesMinimal + + + + + org.apache.maven.wagon + wagon-provider-api + ${wagon.version} + + + com.opensymphony + webwork + 2.2.6 + + + commons-logging + commons-logging + + + + + xmlunit + xmlunit + 1.0 + + + joda-time + joda-time + 1.5.2 + + + org.mortbay.jetty + jetty + ${jetty.version} + + + + + org.springframework + spring-context + 2.5.1 + + + commons-logging + commons-logging + + + + + org.springframework + spring-web + 2.5.1 + + + commons-logging + commons-logging + + + + + org.apache.maven + maven-artifact + ${maven.version} + + + org.apache.maven + maven-project + ${maven.version} + + + org.codehaus.plexus + plexus-container-default + + + + + jdom + jdom + 1.0 + + + org.apache.maven.shared + maven-model-converter + 2.1 + + + org.codehaus.plexus + plexus-container-default + + + + + org.codehaus.plexus + plexus-xwork-integration + 1.0-alpha-7 + + + velocity + velocity-dep + + + + + net.sf.ehcache + ehcache + 1.3.0 + + + commons-logging + commons-logging + + + + + + + 2.0.8 + 1.0-beta-4 + 1.0.3 + 6.1.6 + + + + release + + + + maven-assembly-plugin + 2.2-beta-2 + false + + + src/main/assembly/src.xml + + gnu + apache-archiva-${project.version}-src + + + + make-assembly + package + + single + + + + + + + org.apache.maven.plugins + maven-gpg-plugin + + ${gpg.passphrase} + + + + + sign + + + + + + + true + org.apache.maven.plugins + maven-deploy-plugin + + ${deploy.altRepository} + true + + + + org.apache.maven.plugins + maven-source-plugin + 2.0.4 + + + attach-sources + + jar + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.4 + + + attach-javadocs + + jar + + + + + + + + + buildWithSnapshots + + + + false + + + true + + codehaus.org.snapshots + Codehaus Snapshots Repository + http://snapshots.repository.codehaus.org + + + + + diff --git a/MRM-541/src/main/assembly/src.xml b/MRM-541/src/main/assembly/src.xml new file mode 100644 index 000000000..ff66e9a6f --- /dev/null +++ b/MRM-541/src/main/assembly/src.xml @@ -0,0 +1,67 @@ + + + + + + src + + zip + + + + false + . + / + + **/CVS/** + + + + . + / + + **/target/** + **/archiva-webapp/src/main/webapp/archiva-applet.jar + **/archiva-webapp/src/main/webapp/META-INF/** + **/archiva-webapp/src/main/webapp/images/redback/** + **/archiva-webapp/src/main/webapp/template/redback/** + **/archiva-webapp/src/main/webapp/WEB-INF/classes/** + **/archiva-webapp/src/main/webapp/WEB-INF/lib/** + **/archiva-webapp/src/main/webapp/WEB-INF/database/** + **/archiva-webapp/src/main/webapp/WEB-INF/logs/** + **/archiva-webapp/src/main/webapp/redback/** + **/archiva-webapp/src/main/webapp/css/redback/** + **/archiva-webapp/src/main/webapp/WEB-INF/jsp/redback/** + **/archiva-webapp/src/main/webapp/WEB-INF/template/redback/** + **/archiva-webapp/src/main/webapp/WEB-INF/logs/** + **/archiva-webapp/src/main/webapp/WEB-INF/temp/** + + + + target/maven-shared-archive-resources/META-INF/ + / + + NOTICE + LICENSE + + + + +