diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..cc9347ea4 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 2a98799b7..000000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,5 +0,0 @@ -Contributing Patches -==================== -Please be sure to read our [contribution guide](http://www.eclipse.org/aether/contribution/) first to avoid running down -the wrong path. Non-conforming contributions are less likely to get accepted or might not be noticed by the committers -at all. diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000..d64569567 --- /dev/null +++ b/LICENSE @@ -0,0 +1,202 @@ + + 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. diff --git a/NOTICE b/NOTICE new file mode 100644 index 000000000..11c3a1a0e --- /dev/null +++ b/NOTICE @@ -0,0 +1,5 @@ +Apache Maven Resolver +Copyright 2016 The Apache Software Foundation + +This product includes software developed at +The Apache Software Foundation (http://www.apache.org/). diff --git a/README.md b/README.md deleted file mode 100644 index 7290af8f1..000000000 --- a/README.md +++ /dev/null @@ -1,7 +0,0 @@ -Homepage -======== - - -License -======= -- [Eclipse Public License, v1.0](http://www.eclipse.org/legal/epl-v10.html) diff --git a/aether-api/pom.xml b/aether-api/pom.xml deleted file mode 100644 index 35dd65be6..000000000 --- a/aether-api/pom.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - 4.0.0 - - - org.eclipse.aether - aether - 1.0.0.v20140518 - - - aether-api - - Aether API - - The application programming interface for the repository system. - - - - org.eclipse.aether.api - - - - - junit - junit - test - - - org.hamcrest - hamcrest-library - test - - - - - - - org.codehaus.mojo - animal-sniffer-maven-plugin - - - org.codehaus.mojo - clirr-maven-plugin - - - org.apache.felix - maven-bundle-plugin - - - - diff --git a/aether-api/src/main/java/org/eclipse/aether/DefaultRepositoryCache.java b/aether-api/src/main/java/org/eclipse/aether/DefaultRepositoryCache.java deleted file mode 100644 index 94664ea9b..000000000 --- a/aether-api/src/main/java/org/eclipse/aether/DefaultRepositoryCache.java +++ /dev/null @@ -1,39 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether; - -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -/** - * A simplistic repository cache backed by a thread-safe map. The simplistic nature of this cache makes it only suitable - * for use with short-lived repository system sessions where pruning of cache data is not required. - */ -public final class DefaultRepositoryCache - implements RepositoryCache -{ - - private final Map cache = new ConcurrentHashMap( 256 ); - - public Object get( RepositorySystemSession session, Object key ) - { - return cache.get( key ); - } - - public void put( RepositorySystemSession session, Object key, Object data ) - { - if ( data != null ) - { - cache.put( key, data ); - } - } - -} diff --git a/aether-api/src/main/java/org/eclipse/aether/RepositoryCache.java b/aether-api/src/main/java/org/eclipse/aether/RepositoryCache.java deleted file mode 100644 index 95dbdfec2..000000000 --- a/aether-api/src/main/java/org/eclipse/aether/RepositoryCache.java +++ /dev/null @@ -1,47 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether; - -/** - * Caches auxiliary data used during repository access like already processed metadata. The data in the cache is meant - * for exclusive consumption by the repository system and is opaque to the cache implementation. Note: - * Actual cache implementations must be thread-safe. - * - * @see RepositorySystemSession#getCache() - */ -public interface RepositoryCache -{ - - /** - * Puts the specified data into the cache. It is entirely up to the cache implementation how long this data will be - * kept before being purged, i.e. callers must not make any assumptions about the lifetime of cached data. - * Warning: The cache will directly save the provided reference. If the cached data is mutable, - * i.e. could be modified after being put into the cache, the caller is responsible for creating a copy of the - * original data and store the copy in the cache. - * - * @param session The repository session during which the cache is accessed, must not be {@code null}. - * @param key The key to use for lookup of the data, must not be {@code null}. - * @param data The data to store in the cache, may be {@code null}. - */ - void put( RepositorySystemSession session, Object key, Object data ); - - /** - * Gets the specified data from the cache. Warning: The cache will directly return the saved - * reference. If the cached data is to be modified after its retrieval, the caller is responsible to create a copy - * of the returned data and use this instead of the cache record. - * - * @param session The repository session during which the cache is accessed, must not be {@code null}. - * @param key The key to use for lookup of the data, must not be {@code null}. - * @return The requested data or {@code null} if none was present in the cache. - */ - Object get( RepositorySystemSession session, Object key ); - -} diff --git a/aether-api/src/main/java/org/eclipse/aether/artifact/ArtifactTypeRegistry.java b/aether-api/src/main/java/org/eclipse/aether/artifact/ArtifactTypeRegistry.java deleted file mode 100644 index 2addff1ea..000000000 --- a/aether-api/src/main/java/org/eclipse/aether/artifact/ArtifactTypeRegistry.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether.artifact; - -/** - * A registry of known artifact types. - * - * @see org.eclipse.aether.RepositorySystemSession#getArtifactTypeRegistry() - */ -public interface ArtifactTypeRegistry -{ - - /** - * Gets the artifact type with the specified identifier. - * - * @param typeId The identifier of the type, must not be {@code null}. - * @return The artifact type or {@code null} if no type with the requested identifier exists. - */ - ArtifactType get( String typeId ); - -} diff --git a/aether-api/src/main/java/org/eclipse/aether/artifact/package-info.java b/aether-api/src/main/java/org/eclipse/aether/artifact/package-info.java deleted file mode 100644 index 6d676d127..000000000 --- a/aether-api/src/main/java/org/eclipse/aether/artifact/package-info.java +++ /dev/null @@ -1,15 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -/** - * The definition of an artifact, that is the primary entity managed by the repository system. - */ -package org.eclipse.aether.artifact; - diff --git a/aether-api/src/main/java/org/eclipse/aether/collection/DependencyGraphTransformer.java b/aether-api/src/main/java/org/eclipse/aether/collection/DependencyGraphTransformer.java deleted file mode 100644 index 22f949849..000000000 --- a/aether-api/src/main/java/org/eclipse/aether/collection/DependencyGraphTransformer.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether.collection; - -import org.eclipse.aether.RepositoryException; -import org.eclipse.aether.graph.DependencyNode; - -/** - * Transforms a given dependency graph. Note: Dependency graphs may contain cycles, as such a graph transformer - * needs to gracefully handle cyclic graphs, e.g. guard against infinite recursion. Implementations must be stateless. - * - * @see org.eclipse.aether.RepositorySystemSession#getDependencyGraphTransformer() - */ -public interface DependencyGraphTransformer -{ - - /** - * Transforms the dependency graph denoted by the specified root node. The transformer may directly change the - * provided input graph or create a new graph, the former is recommended for performance reasons. - * - * @param node The root node of the (possibly cyclic!) graph to transform, must not be {@code null}. - * @param context The graph transformation context, must not be {@code null}. - * @return The result graph of the transformation, never {@code null}. - * @throws RepositoryException If the transformation failed. - */ - DependencyNode transformGraph( DependencyNode node, DependencyGraphTransformationContext context ) - throws RepositoryException; - -} diff --git a/aether-api/src/main/java/org/eclipse/aether/collection/package-info.java b/aether-api/src/main/java/org/eclipse/aether/collection/package-info.java deleted file mode 100644 index dd7df2ed4..000000000 --- a/aether-api/src/main/java/org/eclipse/aether/collection/package-info.java +++ /dev/null @@ -1,16 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -/** - * The types and extension points for collecting the transitive dependencies of an artifact and building a dependency - * graph. - */ -package org.eclipse.aether.collection; - diff --git a/aether-api/src/main/java/org/eclipse/aether/deployment/package-info.java b/aether-api/src/main/java/org/eclipse/aether/deployment/package-info.java deleted file mode 100644 index dd5a35d34..000000000 --- a/aether-api/src/main/java/org/eclipse/aether/deployment/package-info.java +++ /dev/null @@ -1,15 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -/** - * The types supporting the publishing of artifacts to a remote repository. - */ -package org.eclipse.aether.deployment; - diff --git a/aether-api/src/main/java/org/eclipse/aether/graph/package-info.java b/aether-api/src/main/java/org/eclipse/aether/graph/package-info.java deleted file mode 100644 index 70879a3eb..000000000 --- a/aether-api/src/main/java/org/eclipse/aether/graph/package-info.java +++ /dev/null @@ -1,15 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -/** - * The representation of a dependency graph by means of connected dependency nodes. - */ -package org.eclipse.aether.graph; - diff --git a/aether-api/src/main/java/org/eclipse/aether/installation/package-info.java b/aether-api/src/main/java/org/eclipse/aether/installation/package-info.java deleted file mode 100644 index 35b910b83..000000000 --- a/aether-api/src/main/java/org/eclipse/aether/installation/package-info.java +++ /dev/null @@ -1,15 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -/** - * The types supporting the publishing of artifacts to a local repository. - */ -package org.eclipse.aether.installation; - diff --git a/aether-api/src/main/java/org/eclipse/aether/metadata/package-info.java b/aether-api/src/main/java/org/eclipse/aether/metadata/package-info.java deleted file mode 100644 index 141a8377f..000000000 --- a/aether-api/src/main/java/org/eclipse/aether/metadata/package-info.java +++ /dev/null @@ -1,15 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -/** - * The definition of metadata, that is an auxiliary entity managed by the repository system to locate artifacts. - */ -package org.eclipse.aether.metadata; - diff --git a/aether-api/src/main/java/org/eclipse/aether/package-info.java b/aether-api/src/main/java/org/eclipse/aether/package-info.java deleted file mode 100644 index 7268b46f3..000000000 --- a/aether-api/src/main/java/org/eclipse/aether/package-info.java +++ /dev/null @@ -1,15 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -/** - * The primary API of the {@link org.eclipse.aether.RepositorySystem} and its functionality. - */ -package org.eclipse.aether; - diff --git a/aether-api/src/main/java/org/eclipse/aether/repository/ArtifactRepository.java b/aether-api/src/main/java/org/eclipse/aether/repository/ArtifactRepository.java deleted file mode 100644 index 2000f8b07..000000000 --- a/aether-api/src/main/java/org/eclipse/aether/repository/ArtifactRepository.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether.repository; - -/** - * A repository hosting artifacts. - * - * @noimplement This interface is not intended to be implemented by clients. - * @noextend This interface is not intended to be extended by clients. - */ -public interface ArtifactRepository -{ - - /** - * Gets the type of the repository, for example "default". - * - * @return The (case-sensitive) type of the repository, never {@code null}. - */ - String getContentType(); - - /** - * Gets the identifier of this repository. - * - * @return The (case-sensitive) identifier, never {@code null}. - */ - String getId(); - -} diff --git a/aether-api/src/main/java/org/eclipse/aether/repository/AuthenticationSelector.java b/aether-api/src/main/java/org/eclipse/aether/repository/AuthenticationSelector.java deleted file mode 100644 index 46c9bab8d..000000000 --- a/aether-api/src/main/java/org/eclipse/aether/repository/AuthenticationSelector.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether.repository; - -/** - * Selects authentication for a given remote repository. - * - * @see org.eclipse.aether.RepositorySystemSession#getAuthenticationSelector() - */ -public interface AuthenticationSelector -{ - - /** - * Selects authentication for the specified remote repository. - * - * @param repository The repository for which to select authentication, must not be {@code null}. - * @return The selected authentication or {@code null} if none. - */ - Authentication getAuthentication( RemoteRepository repository ); - -} diff --git a/aether-api/src/main/java/org/eclipse/aether/repository/MirrorSelector.java b/aether-api/src/main/java/org/eclipse/aether/repository/MirrorSelector.java deleted file mode 100644 index 1614acc72..000000000 --- a/aether-api/src/main/java/org/eclipse/aether/repository/MirrorSelector.java +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether.repository; - -/** - * Selects a mirror for a given remote repository. - * - * @see org.eclipse.aether.RepositorySystemSession#getMirrorSelector() - */ -public interface MirrorSelector -{ - - /** - * Selects a mirror for the specified repository. - * - * @param repository The repository to select a mirror for, must not be {@code null}. - * @return The selected mirror or {@code null} if none. - * @see RemoteRepository#getMirroredRepositories() - */ - RemoteRepository getMirror( RemoteRepository repository ); - -} diff --git a/aether-api/src/main/java/org/eclipse/aether/repository/ProxySelector.java b/aether-api/src/main/java/org/eclipse/aether/repository/ProxySelector.java deleted file mode 100644 index 680474cba..000000000 --- a/aether-api/src/main/java/org/eclipse/aether/repository/ProxySelector.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether.repository; - -/** - * Selects a proxy for a given remote repository. - * - * @see org.eclipse.aether.RepositorySystemSession#getProxySelector() - */ -public interface ProxySelector -{ - - /** - * Selects a proxy for the specified remote repository. - * - * @param repository The repository for which to select a proxy, must not be {@code null}. - * @return The selected proxy or {@code null} if none. - */ - Proxy getProxy( RemoteRepository repository ); - -} diff --git a/aether-api/src/main/java/org/eclipse/aether/repository/package-info.java b/aether-api/src/main/java/org/eclipse/aether/repository/package-info.java deleted file mode 100644 index 21ab2bc9e..000000000 --- a/aether-api/src/main/java/org/eclipse/aether/repository/package-info.java +++ /dev/null @@ -1,15 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -/** - * The definition of various kinds of repositories that host artifacts. - */ -package org.eclipse.aether.repository; - diff --git a/aether-api/src/main/java/org/eclipse/aether/resolution/package-info.java b/aether-api/src/main/java/org/eclipse/aether/resolution/package-info.java deleted file mode 100644 index 84b825b2e..000000000 --- a/aether-api/src/main/java/org/eclipse/aether/resolution/package-info.java +++ /dev/null @@ -1,15 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -/** - * The types supporting the resolution of artifacts and metadata from repositories. - */ -package org.eclipse.aether.resolution; - diff --git a/aether-api/src/main/java/org/eclipse/aether/transfer/package-info.java b/aether-api/src/main/java/org/eclipse/aether/transfer/package-info.java deleted file mode 100644 index 5ce9ff3ce..000000000 --- a/aether-api/src/main/java/org/eclipse/aether/transfer/package-info.java +++ /dev/null @@ -1,16 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -/** - * A listener and various exception types dealing with the transfer of a resource between the local system and a remote - * repository. - */ -package org.eclipse.aether.transfer; - diff --git a/aether-api/src/main/java/org/eclipse/aether/version/Version.java b/aether-api/src/main/java/org/eclipse/aether/version/Version.java deleted file mode 100644 index 4aceba6c0..000000000 --- a/aether-api/src/main/java/org/eclipse/aether/version/Version.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether.version; - -/** - * A parsed artifact version. - */ -public interface Version - extends Comparable -{ - - /** - * Gets the original string representation of the version. - * - * @return The string representation of the version, never {@code null}. - */ - String toString(); - -} diff --git a/aether-api/src/main/java/org/eclipse/aether/version/VersionConstraint.java b/aether-api/src/main/java/org/eclipse/aether/version/VersionConstraint.java deleted file mode 100644 index d4f6b521e..000000000 --- a/aether-api/src/main/java/org/eclipse/aether/version/VersionConstraint.java +++ /dev/null @@ -1,45 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether.version; - -/** - * A constraint on versions for a dependency. A constraint can either consist of a version range or a single version. In - * the first case, the constraint expresses a hard requirement on a version matching the range. In the second case, the - * constraint expresses a soft requirement on a specific version (i.e. a recommendation). - */ -public interface VersionConstraint -{ - - /** - * Gets the version range of this constraint. - * - * @return The version range or {@code null} if none. - */ - VersionRange getRange(); - - /** - * Gets the version recommended by this constraint. - * - * @return The recommended version or {@code null} if none. - */ - Version getVersion(); - - /** - * Determines whether the specified version satisfies this constraint. In more detail, a version satisfies this - * constraint if it matches its version range or if this constraint has no version range and the specified version - * equals the version recommended by the constraint. - * - * @param version The version to test, must not be {@code null}. - * @return {@code true} if the specified version satisfies this constraint, {@code false} otherwise. - */ - boolean containsVersion( Version version ); - -} diff --git a/aether-api/src/main/java/org/eclipse/aether/version/package-info.java b/aether-api/src/main/java/org/eclipse/aether/version/package-info.java deleted file mode 100644 index 7ef8c85d9..000000000 --- a/aether-api/src/main/java/org/eclipse/aether/version/package-info.java +++ /dev/null @@ -1,15 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -/** - * The definition of a version scheme for parsing and comparing versions. - */ -package org.eclipse.aether.version; - diff --git a/aether-api/src/main/resources/about.html b/aether-api/src/main/resources/about.html deleted file mode 100644 index 03618534b..000000000 --- a/aether-api/src/main/resources/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

September 23, 2011

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - diff --git a/aether-api/src/test/java/org/eclipse/aether/AbstractForwardingRepositorySystemSessionTest.java b/aether-api/src/test/java/org/eclipse/aether/AbstractForwardingRepositorySystemSessionTest.java deleted file mode 100644 index fc73ec561..000000000 --- a/aether-api/src/test/java/org/eclipse/aether/AbstractForwardingRepositorySystemSessionTest.java +++ /dev/null @@ -1,35 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether; - -import static org.junit.Assert.*; - -import java.lang.reflect.Method; - -import org.junit.Test; - -public class AbstractForwardingRepositorySystemSessionTest -{ - - @Test - public void testAllMethodsImplemented() - throws Exception - { - for ( Method method : RepositorySystemSession.class.getMethods() ) - { - Method m = - AbstractForwardingRepositorySystemSession.class.getDeclaredMethod( method.getName(), - method.getParameterTypes() ); - assertNotNull( method.toString(), m ); - } - } - -} diff --git a/aether-api/src/test/java/org/eclipse/aether/AbstractRepositoryListenerTest.java b/aether-api/src/test/java/org/eclipse/aether/AbstractRepositoryListenerTest.java deleted file mode 100644 index abe62400b..000000000 --- a/aether-api/src/test/java/org/eclipse/aether/AbstractRepositoryListenerTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether; - -import static org.junit.Assert.*; - -import java.lang.reflect.Method; - -import org.eclipse.aether.AbstractRepositoryListener; -import org.eclipse.aether.RepositoryListener; -import org.junit.Test; - -/** - */ -public class AbstractRepositoryListenerTest -{ - - @Test - public void testAllEventTypesHandled() - throws Exception - { - for ( Method method : RepositoryListener.class.getMethods() ) - { - assertNotNull( AbstractRepositoryListener.class.getDeclaredMethod( method.getName(), - method.getParameterTypes() ) ); - } - } - -} diff --git a/aether-api/src/test/java/org/eclipse/aether/transfer/AbstractTransferListenerTest.java b/aether-api/src/test/java/org/eclipse/aether/transfer/AbstractTransferListenerTest.java deleted file mode 100644 index 439af1c61..000000000 --- a/aether-api/src/test/java/org/eclipse/aether/transfer/AbstractTransferListenerTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether.transfer; - -import static org.junit.Assert.*; - -import java.lang.reflect.Method; - -import org.eclipse.aether.transfer.AbstractTransferListener; -import org.eclipse.aether.transfer.TransferListener; -import org.junit.Test; - -/** - */ -public class AbstractTransferListenerTest -{ - - @Test - public void testAllEventTypesHandled() - throws Exception - { - for ( Method method : TransferListener.class.getMethods() ) - { - assertNotNull( AbstractTransferListener.class.getDeclaredMethod( method.getName(), - method.getParameterTypes() ) ); - } - } - -} diff --git a/aether-connector-basic/pom.xml b/aether-connector-basic/pom.xml deleted file mode 100644 index ee208a8ed..000000000 --- a/aether-connector-basic/pom.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - 4.0.0 - - - org.eclipse.aether - aether - 1.0.0.v20140518 - - - aether-connector-basic - - Aether Connector Basic - - A repository connector implementation for repositories using URI-based layouts. - - - - org.eclipse.aether.connector.basic - - - - - org.eclipse.aether - aether-api - - - org.eclipse.aether - aether-spi - - - org.eclipse.aether - aether-util - - - javax.inject - javax.inject - provided - true - - - org.sonatype.sisu - sisu-guice - no_aop - test - - - junit - junit - test - - - org.hamcrest - hamcrest-library - test - - - org.eclipse.aether - aether-test-util - test - - - - - - - org.codehaus.mojo - animal-sniffer-maven-plugin - - - org.eclipse.sisu - sisu-maven-plugin - - - org.apache.felix - maven-bundle-plugin - - - - diff --git a/aether-connector-basic/src/main/java/org/eclipse/aether/connector/basic/package-info.java b/aether-connector-basic/src/main/java/org/eclipse/aether/connector/basic/package-info.java deleted file mode 100644 index 3c0c5a992..000000000 --- a/aether-connector-basic/src/main/java/org/eclipse/aether/connector/basic/package-info.java +++ /dev/null @@ -1,15 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -/** - * Support for downloads/uploads using remote repositories that have a URI-based content structure/layout. - */ -package org.eclipse.aether.connector.basic; - diff --git a/aether-connector-basic/src/main/resources/about.html b/aether-connector-basic/src/main/resources/about.html deleted file mode 100644 index 03618534b..000000000 --- a/aether-connector-basic/src/main/resources/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

September 23, 2011

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - diff --git a/aether-impl/pom.xml b/aether-impl/pom.xml deleted file mode 100644 index 9627aff3a..000000000 --- a/aether-impl/pom.xml +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - 4.0.0 - - - org.eclipse.aether - aether - 1.0.0.v20140518 - - - aether-impl - - Aether Implementation - - An implementation of the repository system. - - - - org.eclipse.aether.impl - - - - - org.eclipse.aether - aether-api - - - org.eclipse.aether - aether-spi - - - org.eclipse.aether - aether-util - - - javax.inject - javax.inject - provided - true - - - org.eclipse.sisu - org.eclipse.sisu.inject - provided - true - - - org.sonatype.sisu - sisu-guice - no_aop - provided - true - - - org.slf4j - slf4j-api - provided - true - - - junit - junit - test - - - org.hamcrest - hamcrest-library - test - - - org.eclipse.aether - aether-test-util - test - - - - - - - org.codehaus.mojo - animal-sniffer-maven-plugin - - - org.eclipse.sisu - sisu-maven-plugin - - - org.apache.felix - maven-bundle-plugin - - - - com.google.inject.*;version="[1.3,2)",* - - - - - - diff --git a/aether-impl/src/main/java/org/eclipse/aether/impl/AetherModule.java b/aether-impl/src/main/java/org/eclipse/aether/impl/AetherModule.java deleted file mode 100644 index fcc5b92fe..000000000 --- a/aether-impl/src/main/java/org/eclipse/aether/impl/AetherModule.java +++ /dev/null @@ -1,26 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether.impl; - -/** - * A ready-made Guice module that sets up bindings for all components from this library. To acquire a complete - * repository system, clients need to bind an artifact descriptor reader, a version resolver, a version range resolver, - * zero or more metadata generator factories, some repository connector and transporter factories to access remote - * repositories. - * - * @deprecated Use {@link org.eclipse.aether.impl.guice.AetherModule} instead. - */ -@Deprecated -public final class AetherModule - extends org.eclipse.aether.impl.guice.AetherModule -{ - -} diff --git a/aether-impl/src/main/java/org/eclipse/aether/impl/RepositoryEventDispatcher.java b/aether-impl/src/main/java/org/eclipse/aether/impl/RepositoryEventDispatcher.java deleted file mode 100644 index 8b6bacbdd..000000000 --- a/aether-impl/src/main/java/org/eclipse/aether/impl/RepositoryEventDispatcher.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether.impl; - -import org.eclipse.aether.RepositoryEvent; - -/** - * Dispatches repository events to registered listeners. - * - * @noimplement This interface is not intended to be implemented by clients. - * @noextend This interface is not intended to be extended by clients. - * @provisional This type is provisional and can be changed, moved or removed without prior notice. - */ -public interface RepositoryEventDispatcher -{ - - /** - * Dispatches the specified repository event to all registered listeners. - * - * @param event The event to dispatch, must not be {@code null}. - */ - void dispatch( RepositoryEvent event ); - -} diff --git a/aether-impl/src/main/java/org/eclipse/aether/impl/guice/package-info.java b/aether-impl/src/main/java/org/eclipse/aether/impl/guice/package-info.java deleted file mode 100644 index ee7ed5c73..000000000 --- a/aether-impl/src/main/java/org/eclipse/aether/impl/guice/package-info.java +++ /dev/null @@ -1,15 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -/** - * The integration with the dependency injection framework Google Guice. - */ -package org.eclipse.aether.impl.guice; - diff --git a/aether-impl/src/main/java/org/eclipse/aether/impl/package-info.java b/aether-impl/src/main/java/org/eclipse/aether/impl/package-info.java deleted file mode 100644 index 1a0b6657a..000000000 --- a/aether-impl/src/main/java/org/eclipse/aether/impl/package-info.java +++ /dev/null @@ -1,21 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -/** - * The provisional interfaces defining the various sub components that implement the repository system. Aether Core - * provides stock implementations for most of these components but not all. To obtain a complete/runnable repository - * system, the application needs to provide implementations of the following component contracts: - * {@link org.eclipse.aether.impl.ArtifactDescriptorReader}, {@link org.eclipse.aether.impl.VersionResolver}, - * {@link org.eclipse.aether.impl.VersionRangeResolver} and potentially - * {@link org.eclipse.aether.impl.MetadataGeneratorFactory}. Said components basically define the file format of the - * metadata that is used to reason about an artifact's dependencies and available versions. - */ -package org.eclipse.aether.impl; - diff --git a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultDependencyCollectionContext.java b/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultDependencyCollectionContext.java deleted file mode 100644 index 99c35d219..000000000 --- a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultDependencyCollectionContext.java +++ /dev/null @@ -1,77 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether.internal.impl; - -import java.util.List; - -import org.eclipse.aether.RepositorySystemSession; -import org.eclipse.aether.artifact.Artifact; -import org.eclipse.aether.collection.DependencyCollectionContext; -import org.eclipse.aether.graph.Dependency; - -/** - * @see DefaultDependencyCollector - */ -final class DefaultDependencyCollectionContext - implements DependencyCollectionContext -{ - - private final RepositorySystemSession session; - - private Artifact artifact; - - private Dependency dependency; - - private List managedDependencies; - - public DefaultDependencyCollectionContext( RepositorySystemSession session, Artifact artifact, - Dependency dependency, List managedDependencies ) - { - this.session = session; - this.artifact = ( dependency != null ) ? dependency.getArtifact() : artifact; - this.dependency = dependency; - this.managedDependencies = managedDependencies; - } - - public RepositorySystemSession getSession() - { - return session; - } - - public Artifact getArtifact() - { - return artifact; - } - - public Dependency getDependency() - { - return dependency; - } - - public List getManagedDependencies() - { - return managedDependencies; - } - - public void set( Dependency dependency, List managedDependencies ) - { - artifact = dependency.getArtifact(); - this.dependency = dependency; - this.managedDependencies = managedDependencies; - } - - @Override - public String toString() - { - return String.valueOf( getDependency() ); - } - -} diff --git a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultDependencyCollector.java b/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultDependencyCollector.java deleted file mode 100644 index 404897ca6..000000000 --- a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultDependencyCollector.java +++ /dev/null @@ -1,853 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether.internal.impl; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - -import javax.inject.Inject; -import javax.inject.Named; - -import org.eclipse.aether.DefaultRepositorySystemSession; -import org.eclipse.aether.RepositoryException; -import org.eclipse.aether.RepositorySystemSession; -import org.eclipse.aether.RequestTrace; -import org.eclipse.aether.artifact.Artifact; -import org.eclipse.aether.artifact.ArtifactProperties; -import org.eclipse.aether.collection.CollectRequest; -import org.eclipse.aether.collection.CollectResult; -import org.eclipse.aether.collection.DependencyCollectionException; -import org.eclipse.aether.collection.DependencyGraphTransformer; -import org.eclipse.aether.collection.DependencyManagement; -import org.eclipse.aether.collection.DependencyManager; -import org.eclipse.aether.collection.DependencySelector; -import org.eclipse.aether.collection.DependencyTraverser; -import org.eclipse.aether.collection.VersionFilter; -import org.eclipse.aether.graph.DefaultDependencyNode; -import org.eclipse.aether.graph.Dependency; -import org.eclipse.aether.graph.DependencyNode; -import org.eclipse.aether.impl.ArtifactDescriptorReader; -import org.eclipse.aether.impl.DependencyCollector; -import org.eclipse.aether.impl.RemoteRepositoryManager; -import org.eclipse.aether.impl.VersionRangeResolver; -import org.eclipse.aether.repository.ArtifactRepository; -import org.eclipse.aether.repository.RemoteRepository; -import org.eclipse.aether.resolution.ArtifactDescriptorException; -import org.eclipse.aether.resolution.ArtifactDescriptorRequest; -import org.eclipse.aether.resolution.ArtifactDescriptorResult; -import org.eclipse.aether.resolution.VersionRangeRequest; -import org.eclipse.aether.resolution.VersionRangeResolutionException; -import org.eclipse.aether.resolution.VersionRangeResult; -import org.eclipse.aether.spi.locator.Service; -import org.eclipse.aether.spi.locator.ServiceLocator; -import org.eclipse.aether.spi.log.Logger; -import org.eclipse.aether.spi.log.LoggerFactory; -import org.eclipse.aether.spi.log.NullLoggerFactory; -import org.eclipse.aether.util.ConfigUtils; -import org.eclipse.aether.util.graph.manager.DependencyManagerUtils; -import org.eclipse.aether.util.graph.transformer.TransformationContextKeys; -import org.eclipse.aether.version.Version; - -/** - */ -@Named -public class DefaultDependencyCollector - implements DependencyCollector, Service -{ - - private static final String CONFIG_PROP_MAX_EXCEPTIONS = "aether.dependencyCollector.maxExceptions"; - - private static final String CONFIG_PROP_MAX_CYCLES = "aether.dependencyCollector.maxCycles"; - - private Logger logger = NullLoggerFactory.LOGGER; - - private RemoteRepositoryManager remoteRepositoryManager; - - private ArtifactDescriptorReader descriptorReader; - - private VersionRangeResolver versionRangeResolver; - - public DefaultDependencyCollector() - { - // enables default constructor - } - - @Inject - DefaultDependencyCollector( RemoteRepositoryManager remoteRepositoryManager, - ArtifactDescriptorReader artifactDescriptorReader, - VersionRangeResolver versionRangeResolver, LoggerFactory loggerFactory ) - { - setRemoteRepositoryManager( remoteRepositoryManager ); - setArtifactDescriptorReader( artifactDescriptorReader ); - setVersionRangeResolver( versionRangeResolver ); - setLoggerFactory( loggerFactory ); - } - - public void initService( ServiceLocator locator ) - { - setLoggerFactory( locator.getService( LoggerFactory.class ) ); - setRemoteRepositoryManager( locator.getService( RemoteRepositoryManager.class ) ); - setArtifactDescriptorReader( locator.getService( ArtifactDescriptorReader.class ) ); - setVersionRangeResolver( locator.getService( VersionRangeResolver.class ) ); - } - - public DefaultDependencyCollector setLoggerFactory( LoggerFactory loggerFactory ) - { - this.logger = NullLoggerFactory.getSafeLogger( loggerFactory, getClass() ); - return this; - } - - public DefaultDependencyCollector setRemoteRepositoryManager( RemoteRepositoryManager remoteRepositoryManager ) - { - if ( remoteRepositoryManager == null ) - { - throw new IllegalArgumentException( "remote repository manager has not been specified" ); - } - this.remoteRepositoryManager = remoteRepositoryManager; - return this; - } - - public DefaultDependencyCollector setArtifactDescriptorReader( ArtifactDescriptorReader artifactDescriptorReader ) - { - if ( artifactDescriptorReader == null ) - { - throw new IllegalArgumentException( "artifact descriptor reader has not been specified" ); - } - descriptorReader = artifactDescriptorReader; - return this; - } - - public DefaultDependencyCollector setVersionRangeResolver( VersionRangeResolver versionRangeResolver ) - { - if ( versionRangeResolver == null ) - { - throw new IllegalArgumentException( "version range resolver has not been specified" ); - } - this.versionRangeResolver = versionRangeResolver; - return this; - } - - public CollectResult collectDependencies( RepositorySystemSession session, CollectRequest request ) - throws DependencyCollectionException - { - session = optimizeSession( session ); - - RequestTrace trace = RequestTrace.newChild( request.getTrace(), request ); - - CollectResult result = new CollectResult( request ); - - DependencySelector depSelector = session.getDependencySelector(); - DependencyManager depManager = session.getDependencyManager(); - DependencyTraverser depTraverser = session.getDependencyTraverser(); - VersionFilter verFilter = session.getVersionFilter(); - - Dependency root = request.getRoot(); - List repositories = request.getRepositories(); - List dependencies = request.getDependencies(); - List managedDependencies = request.getManagedDependencies(); - - Map stats = logger.isDebugEnabled() ? new LinkedHashMap() : null; - long time1 = System.currentTimeMillis(); - - DefaultDependencyNode node; - if ( root != null ) - { - List versions; - VersionRangeResult rangeResult; - try - { - VersionRangeRequest rangeRequest = - new VersionRangeRequest( root.getArtifact(), request.getRepositories(), - request.getRequestContext() ); - rangeRequest.setTrace( trace ); - rangeResult = versionRangeResolver.resolveVersionRange( session, rangeRequest ); - versions = filterVersions( root, rangeResult, verFilter, new DefaultVersionFilterContext( session ) ); - } - catch ( VersionRangeResolutionException e ) - { - result.addException( e ); - throw new DependencyCollectionException( result, e.getMessage() ); - } - - Version version = versions.get( versions.size() - 1 ); - root = root.setArtifact( root.getArtifact().setVersion( version.toString() ) ); - - ArtifactDescriptorResult descriptorResult; - try - { - ArtifactDescriptorRequest descriptorRequest = new ArtifactDescriptorRequest(); - descriptorRequest.setArtifact( root.getArtifact() ); - descriptorRequest.setRepositories( request.getRepositories() ); - descriptorRequest.setRequestContext( request.getRequestContext() ); - descriptorRequest.setTrace( trace ); - if ( isLackingDescriptor( root.getArtifact() ) ) - { - descriptorResult = new ArtifactDescriptorResult( descriptorRequest ); - } - else - { - descriptorResult = descriptorReader.readArtifactDescriptor( session, descriptorRequest ); - } - } - catch ( ArtifactDescriptorException e ) - { - result.addException( e ); - throw new DependencyCollectionException( result, e.getMessage() ); - } - - root = root.setArtifact( descriptorResult.getArtifact() ); - - if ( !session.isIgnoreArtifactDescriptorRepositories() ) - { - repositories = remoteRepositoryManager.aggregateRepositories( session, repositories, - descriptorResult.getRepositories(), - true ); - } - dependencies = mergeDeps( dependencies, descriptorResult.getDependencies() ); - managedDependencies = mergeDeps( managedDependencies, descriptorResult.getManagedDependencies() ); - - node = new DefaultDependencyNode( root ); - node.setRequestContext( request.getRequestContext() ); - node.setRelocations( descriptorResult.getRelocations() ); - node.setVersionConstraint( rangeResult.getVersionConstraint() ); - node.setVersion( version ); - node.setAliases( descriptorResult.getAliases() ); - node.setRepositories( request.getRepositories() ); - } - else - { - node = new DefaultDependencyNode( request.getRootArtifact() ); - } - - result.setRoot( node ); - - boolean traverse = root == null || depTraverser == null || depTraverser.traverseDependency( root ); - String errorPath = null; - if ( traverse && !dependencies.isEmpty() ) - { - DataPool pool = new DataPool( session ); - - NodeStack nodes = new NodeStack(); - nodes.push( node ); - - DefaultDependencyCollectionContext context = - new DefaultDependencyCollectionContext( session, request.getRootArtifact(), root, managedDependencies ); - - DefaultVersionFilterContext versionContext = new DefaultVersionFilterContext( session ); - - Args args = new Args( session, trace, pool, nodes, context, versionContext, request ); - Results results = new Results( result, session ); - - process( args, results, dependencies, repositories, - depSelector != null ? depSelector.deriveChildSelector( context ) : null, - depManager != null ? depManager.deriveChildManager( context ) : null, - depTraverser != null ? depTraverser.deriveChildTraverser( context ) : null, - verFilter != null ? verFilter.deriveChildFilter( context ) : null ); - - errorPath = results.errorPath; - } - - long time2 = System.currentTimeMillis(); - - DependencyGraphTransformer transformer = session.getDependencyGraphTransformer(); - if ( transformer != null ) - { - try - { - DefaultDependencyGraphTransformationContext context = - new DefaultDependencyGraphTransformationContext( session ); - context.put( TransformationContextKeys.STATS, stats ); - result.setRoot( transformer.transformGraph( node, context ) ); - } - catch ( RepositoryException e ) - { - result.addException( e ); - } - } - - if ( stats != null ) - { - long time3 = System.currentTimeMillis(); - stats.put( "DefaultDependencyCollector.collectTime", time2 - time1 ); - stats.put( "DefaultDependencyCollector.transformTime", time3 - time2 ); - logger.debug( "Dependency collection stats: " + stats ); - } - - if ( errorPath != null ) - { - throw new DependencyCollectionException( result, "Failed to collect dependencies at " + errorPath ); - } - if ( !result.getExceptions().isEmpty() ) - { - throw new DependencyCollectionException( result ); - } - - return result; - } - - private static RepositorySystemSession optimizeSession( RepositorySystemSession session ) - { - DefaultRepositorySystemSession optimized = new DefaultRepositorySystemSession( session ); - optimized.setArtifactTypeRegistry( CachingArtifactTypeRegistry.newInstance( session ) ); - return optimized; - } - - private List mergeDeps( List dominant, List recessive ) - { - List result; - if ( dominant == null || dominant.isEmpty() ) - { - result = recessive; - } - else if ( recessive == null || recessive.isEmpty() ) - { - result = dominant; - } - else - { - int initialCapacity = dominant.size() + recessive.size(); - result = new ArrayList( initialCapacity ); - Collection ids = new HashSet(initialCapacity, 1.0f); - for ( Dependency dependency : dominant ) - { - ids.add( getId( dependency.getArtifact() ) ); - result.add( dependency ); - } - for ( Dependency dependency : recessive ) - { - if ( !ids.contains( getId( dependency.getArtifact() ) ) ) - { - result.add( dependency ); - } - } - } - return result; - } - - private static String getId( Artifact a ) - { - return a.getGroupId() + ':' + a.getArtifactId() + ':' + a.getClassifier() + ':' + a.getExtension(); - } - - private void process( final Args args, Results results, List dependencies, - List repositories, DependencySelector depSelector, - DependencyManager depManager, DependencyTraverser depTraverser, VersionFilter verFilter ) - { - for ( Dependency dependency : dependencies ) - { - processDependency( args, results, repositories, depSelector, depManager, depTraverser, verFilter, - dependency ); - } - } - - private void processDependency( Args args, Results results, List repositories, - DependencySelector depSelector, DependencyManager depManager, - DependencyTraverser depTraverser, VersionFilter verFilter, Dependency dependency ) - { - - List relocations = Collections.emptyList(); - boolean disableVersionManagement = false; - processDependency( args, results, repositories, depSelector, depManager, depTraverser, verFilter, dependency, - relocations, disableVersionManagement ); - } - - private void processDependency( Args args, Results results, List repositories, - DependencySelector depSelector, DependencyManager depManager, - DependencyTraverser depTraverser, VersionFilter verFilter, Dependency dependency, - List relocations, boolean disableVersionManagement ) - { - - if ( depSelector != null && !depSelector.selectDependency( dependency ) ) - { - return; - } - - PremanagedDependency preManaged = - PremanagedDependency.create( depManager, dependency, disableVersionManagement, args.premanagedState ); - dependency = preManaged.managedDependency; - - boolean noDescriptor = isLackingDescriptor( dependency.getArtifact() ); - - boolean traverse = !noDescriptor && ( depTraverser == null || depTraverser.traverseDependency( dependency ) ); - - List versions; - VersionRangeResult rangeResult; - try - { - VersionRangeRequest rangeRequest = createVersionRangeRequest( args, repositories, dependency ); - - rangeResult = cachedResolveRangeResult( rangeRequest, args.pool, args.session ); - - versions = filterVersions( dependency, rangeResult, verFilter, args.versionContext ); - } - catch ( VersionRangeResolutionException e ) - { - results.addException( dependency, e, args.nodes ); - return; - } - - for ( Version version : versions ) - { - Artifact originalArtifact = dependency.getArtifact().setVersion( version.toString() ); - Dependency d = dependency.setArtifact( originalArtifact ); - - ArtifactDescriptorRequest descriptorRequest = createArtifactDescriptorRequest( args, repositories, d ); - - final ArtifactDescriptorResult descriptorResult = - getArtifactDescriptorResult( args, results, noDescriptor, d, descriptorRequest ); - if ( descriptorResult != null ) - { - d = d.setArtifact( descriptorResult.getArtifact() ); - - DependencyNode node = args.nodes.top(); - - int cycleEntry = args.nodes.find( d.getArtifact() ); - if ( cycleEntry >= 0 ) - { - results.addCycle( args.nodes, cycleEntry, d ); - DependencyNode cycleNode = args.nodes.get( cycleEntry ); - if ( cycleNode.getDependency() != null ) - { - DefaultDependencyNode child = - createDependencyNode( relocations, preManaged, rangeResult, version, d, descriptorResult, - cycleNode ); - node.getChildren().add( child ); - continue; - } - } - - if ( !descriptorResult.getRelocations().isEmpty() ) - { - boolean disableVersionManagementSubsequently = - originalArtifact.getGroupId().equals( d.getArtifact().getGroupId() ) - && originalArtifact.getArtifactId().equals( d.getArtifact().getArtifactId() ); - - processDependency( args, results, repositories, depSelector, depManager, depTraverser, verFilter, d, - descriptorResult.getRelocations(), disableVersionManagementSubsequently ); - return; - } - else - { - d = args.pool.intern( d.setArtifact( args.pool.intern( d.getArtifact() ) ) ); - - List repos = - getRemoteRepositories( rangeResult.getRepository( version ), repositories ); - - DefaultDependencyNode child = - createDependencyNode( relocations, preManaged, rangeResult, version, d, descriptorResult, repos, - args.request.getRequestContext() ); - - node.getChildren().add( child ); - - boolean recurse = traverse && !descriptorResult.getDependencies().isEmpty(); - if ( recurse ) - { - doRecurse( args, results, repositories, depSelector, depManager, depTraverser, verFilter, d, - descriptorResult, child ); - } - } - } - } - } - - private void doRecurse( Args args, Results results, List repositories, - DependencySelector depSelector, DependencyManager depManager, - DependencyTraverser depTraverser, VersionFilter verFilter, Dependency d, - ArtifactDescriptorResult descriptorResult, DefaultDependencyNode child ) - { - DefaultDependencyCollectionContext context = args.collectionContext; - context.set( d, descriptorResult.getManagedDependencies() ); - - DependencySelector childSelector = depSelector != null ? depSelector.deriveChildSelector( context ) : null; - DependencyManager childManager = depManager != null ? depManager.deriveChildManager( context ) : null; - DependencyTraverser childTraverser = depTraverser != null ? depTraverser.deriveChildTraverser( context ) : null; - VersionFilter childFilter = verFilter != null ? verFilter.deriveChildFilter( context ) : null; - - final List childRepos = args.ignoreRepos - ? repositories - : remoteRepositoryManager.aggregateRepositories( args.session, repositories, - descriptorResult.getRepositories(), true ); - - Object key = - args.pool.toKey( d.getArtifact(), childRepos, childSelector, childManager, childTraverser, childFilter ); - - List children = args.pool.getChildren( key ); - if ( children == null ) - { - args.pool.putChildren( key, child.getChildren() ); - - args.nodes.push( child ); - - process( args, results, descriptorResult.getDependencies(), childRepos, childSelector, childManager, - childTraverser, childFilter ); - - args.nodes.pop(); - } - else - { - child.setChildren( children ); - } - } - - private ArtifactDescriptorResult getArtifactDescriptorResult( Args args, Results results, boolean noDescriptor, - Dependency d, - ArtifactDescriptorRequest descriptorRequest ) - { - return noDescriptor - ? new ArtifactDescriptorResult( descriptorRequest ) - : resolveCachedArtifactDescriptor( args.pool, descriptorRequest, args.session, d, results, args ); - } - - private ArtifactDescriptorResult resolveCachedArtifactDescriptor( DataPool pool, - ArtifactDescriptorRequest descriptorRequest, - RepositorySystemSession session, Dependency d, - Results results, Args args ) - { - Object key = pool.toKey( descriptorRequest ); - ArtifactDescriptorResult descriptorResult = pool.getDescriptor( key, descriptorRequest ); - if ( descriptorResult == null ) - { - try - { - descriptorResult = descriptorReader.readArtifactDescriptor( session, descriptorRequest ); - pool.putDescriptor( key, descriptorResult ); - } - catch ( ArtifactDescriptorException e ) - { - results.addException( d, e, args.nodes ); - pool.putDescriptor( key, e ); - return null; - } - - } - else if ( descriptorResult == DataPool.NO_DESCRIPTOR ) - { - return null; - } - - return descriptorResult; - } - - private static DefaultDependencyNode createDependencyNode( List relocations, - PremanagedDependency preManaged, - VersionRangeResult rangeResult, Version version, - Dependency d, ArtifactDescriptorResult descriptorResult, - List repos, String requestContext ) - { - DefaultDependencyNode child = new DefaultDependencyNode( d ); - preManaged.applyTo( child ); - child.setRelocations( relocations ); - child.setVersionConstraint( rangeResult.getVersionConstraint() ); - child.setVersion( version ); - child.setAliases( descriptorResult.getAliases() ); - child.setRepositories( repos ); - child.setRequestContext( requestContext ); - return child; - } - - private static DefaultDependencyNode createDependencyNode( List relocations, - PremanagedDependency preManaged, - VersionRangeResult rangeResult, Version version, - Dependency d, ArtifactDescriptorResult descriptorResult, - DependencyNode cycleNode ) - { - DefaultDependencyNode child = - createDependencyNode( relocations, preManaged, rangeResult, version, d, descriptorResult, - cycleNode.getRepositories(), cycleNode.getRequestContext() ); - child.setChildren( cycleNode.getChildren() ); - return child; - } - - private static ArtifactDescriptorRequest createArtifactDescriptorRequest( Args args, - List repositories, - Dependency d ) - { - ArtifactDescriptorRequest descriptorRequest = new ArtifactDescriptorRequest(); - descriptorRequest.setArtifact( d.getArtifact() ); - descriptorRequest.setRepositories( repositories ); - descriptorRequest.setRequestContext( args.request.getRequestContext() ); - descriptorRequest.setTrace( args.trace ); - return descriptorRequest; - } - - private static VersionRangeRequest createVersionRangeRequest( Args args, List repositories, - Dependency dependency ) - { - VersionRangeRequest rangeRequest = new VersionRangeRequest(); - rangeRequest.setArtifact( dependency.getArtifact() ); - rangeRequest.setRepositories( repositories ); - rangeRequest.setRequestContext( args.request.getRequestContext() ); - rangeRequest.setTrace( args.trace ); - return rangeRequest; - } - - private VersionRangeResult cachedResolveRangeResult( VersionRangeRequest rangeRequest, DataPool pool, - RepositorySystemSession session ) - throws VersionRangeResolutionException - { - Object key = pool.toKey( rangeRequest ); - VersionRangeResult rangeResult = pool.getConstraint( key, rangeRequest ); - if ( rangeResult == null ) - { - rangeResult = versionRangeResolver.resolveVersionRange( session, rangeRequest ); - pool.putConstraint( key, rangeResult ); - } - return rangeResult; - } - - - private static boolean isLackingDescriptor( Artifact artifact ) - { - return artifact.getProperty( ArtifactProperties.LOCAL_PATH, null ) != null; - } - - private static List getRemoteRepositories( ArtifactRepository repository, - List repositories ) - { - if ( repository instanceof RemoteRepository ) - { - return Collections.singletonList( (RemoteRepository) repository ); - } - if ( repository != null ) - { - return Collections.emptyList(); - } - return repositories; - } - - private static List filterVersions( Dependency dependency, VersionRangeResult rangeResult, - VersionFilter verFilter, - DefaultVersionFilterContext verContext ) - throws VersionRangeResolutionException - { - if ( rangeResult.getVersions().isEmpty() ) - { - throw new VersionRangeResolutionException( rangeResult, - "No versions available for " + dependency.getArtifact() - + " within specified range" ); - } - - List versions; - if ( verFilter != null && rangeResult.getVersionConstraint().getRange() != null ) - { - verContext.set( dependency, rangeResult ); - try - { - verFilter.filterVersions( verContext ); - } - catch ( RepositoryException e ) - { - throw new VersionRangeResolutionException( rangeResult, - "Failed to filter versions for " + dependency.getArtifact() - + ": " + e.getMessage(), e ); - } - versions = verContext.get(); - if ( versions.isEmpty() ) - { - throw new VersionRangeResolutionException( rangeResult, - "No acceptable versions for " + dependency.getArtifact() - + ": " + rangeResult.getVersions() ); - } - } - else - { - versions = rangeResult.getVersions(); - } - return versions; - } - - static class Args - { - - final RepositorySystemSession session; - - final boolean ignoreRepos; - - final boolean premanagedState; - - final RequestTrace trace; - - final DataPool pool; - - final NodeStack nodes; - - final DefaultDependencyCollectionContext collectionContext; - - final DefaultVersionFilterContext versionContext; - - final CollectRequest request; - - - public Args( RepositorySystemSession session, RequestTrace trace, DataPool pool, NodeStack nodes, - DefaultDependencyCollectionContext collectionContext, DefaultVersionFilterContext versionContext, - CollectRequest request ) - { - this.session = session; - this.request = request; - this.ignoreRepos = session.isIgnoreArtifactDescriptorRepositories(); - this.premanagedState = ConfigUtils.getBoolean( session, false, DependencyManagerUtils.CONFIG_PROP_VERBOSE ); - this.trace = trace; - this.pool = pool; - this.nodes = nodes; - this.collectionContext = collectionContext; - this.versionContext = versionContext; - } - - } - - static class Results - { - - private final CollectResult result; - - final int maxExceptions; - - final int maxCycles; - - String errorPath; - - public Results( CollectResult result, RepositorySystemSession session ) - { - this.result = result; - this.maxExceptions = ConfigUtils.getInteger( session, 50, CONFIG_PROP_MAX_EXCEPTIONS ); - this.maxCycles = ConfigUtils.getInteger( session, 10, CONFIG_PROP_MAX_CYCLES ); - } - - public void addException( Dependency dependency, Exception e, NodeStack nodes ) - { - if ( maxExceptions < 0 || result.getExceptions().size() < maxExceptions ) - { - result.addException( e ); - if ( errorPath == null ) - { - StringBuilder buffer = new StringBuilder( 256 ); - for ( int i = 0; i < nodes.size(); i++ ) - { - if ( buffer.length() > 0 ) - { - buffer.append( " -> " ); - } - Dependency dep = nodes.get( i ).getDependency(); - if ( dep != null ) - { - buffer.append( dep.getArtifact() ); - } - } - if ( buffer.length() > 0 ) - { - buffer.append( " -> " ); - } - buffer.append( dependency.getArtifact() ); - errorPath = buffer.toString(); - } - } - } - - public void addCycle( NodeStack nodes, int cycleEntry, Dependency dependency ) - { - if ( maxCycles < 0 || result.getCycles().size() < maxCycles ) - { - result.addCycle( new DefaultDependencyCycle( nodes, cycleEntry, dependency ) ); - } - } - - } - - static class PremanagedDependency - { - final String premanagedVersion; - - final String premanagedScope; - - final Boolean premanagedOptional; - - final int managedBits; - - final Dependency managedDependency; - - final boolean premanagedState; - - PremanagedDependency( String premanagedVersion, String premanagedScope, Boolean premanagedOptional, - int managedBits, Dependency managedDependency, boolean premanagedState ) - { - this.premanagedVersion = premanagedVersion; - this.premanagedScope = premanagedScope; - this.premanagedOptional = premanagedOptional; - this.managedBits = managedBits; - this.managedDependency = managedDependency; - this.premanagedState = premanagedState; - } - - static PremanagedDependency create( DependencyManager depManager, Dependency dependency, - boolean disableVersionManagement, boolean premanagedState ) - { - DependencyManagement depMngt = depManager != null ? depManager.manageDependency( dependency ) : null; - - int managedBits = 0; - String premanagedVersion = null; - String premanagedScope = null; - Boolean premanagedOptional = null; - - if ( depMngt != null ) - { - if ( depMngt.getVersion() != null && !disableVersionManagement ) - { - Artifact artifact = dependency.getArtifact(); - premanagedVersion = artifact.getVersion(); - dependency = dependency.setArtifact( artifact.setVersion( depMngt.getVersion() ) ); - managedBits |= DependencyNode.MANAGED_VERSION; - } - if ( depMngt.getProperties() != null ) - { - Artifact artifact = dependency.getArtifact(); - dependency = dependency.setArtifact( artifact.setProperties( depMngt.getProperties() ) ); - managedBits |= DependencyNode.MANAGED_PROPERTIES; - } - if ( depMngt.getScope() != null ) - { - premanagedScope = dependency.getScope(); - dependency = dependency.setScope( depMngt.getScope() ); - managedBits |= DependencyNode.MANAGED_SCOPE; - } - if ( depMngt.getOptional() != null ) - { - premanagedOptional = dependency.isOptional(); - dependency = dependency.setOptional( depMngt.getOptional() ); - managedBits |= DependencyNode.MANAGED_OPTIONAL; - } - if ( depMngt.getExclusions() != null ) - { - dependency = dependency.setExclusions( depMngt.getExclusions() ); - managedBits |= DependencyNode.MANAGED_EXCLUSIONS; - } - } - return new PremanagedDependency( premanagedVersion, premanagedScope, premanagedOptional, managedBits, - dependency, premanagedState ); - } - - public void applyTo( DefaultDependencyNode child ) - { - child.setManagedBits( managedBits ); - if ( premanagedState ) - { - child.setData( DependencyManagerUtils.NODE_DATA_PREMANAGED_VERSION, premanagedVersion ); - child.setData( DependencyManagerUtils.NODE_DATA_PREMANAGED_SCOPE, premanagedScope ); - child.setData( DependencyManagerUtils.NODE_DATA_PREMANAGED_OPTIONAL, premanagedOptional ); - } - } - } - -} diff --git a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/FailChecksumPolicy.java b/aether-impl/src/main/java/org/eclipse/aether/internal/impl/FailChecksumPolicy.java deleted file mode 100644 index c4e3180b0..000000000 --- a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/FailChecksumPolicy.java +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether.internal.impl; - -import org.eclipse.aether.spi.log.LoggerFactory; -import org.eclipse.aether.transfer.ChecksumFailureException; -import org.eclipse.aether.transfer.TransferResource; - -/** - * Implements {@link org.eclipse.aether.repository.RepositoryPolicy#CHECKSUM_POLICY_FAIL}. - */ -final class FailChecksumPolicy - extends AbstractChecksumPolicy -{ - - public FailChecksumPolicy( LoggerFactory loggerFactory, TransferResource resource ) - { - super( loggerFactory, resource ); - } - - public boolean onTransferChecksumFailure( ChecksumFailureException error ) - { - return false; - } - -} diff --git a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/ObjectPool.java b/aether-impl/src/main/java/org/eclipse/aether/internal/impl/ObjectPool.java deleted file mode 100644 index acbf05595..000000000 --- a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/ObjectPool.java +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether.internal.impl; - -import java.lang.ref.Reference; -import java.lang.ref.WeakReference; -import java.util.Map; -import java.util.WeakHashMap; - -/** - * Pool of immutable object instances, used to avoid excessive memory consumption of (dirty) dependency graph which - * tends to have many duplicate artifacts/dependencies. - */ -class ObjectPool -{ - - private final Map> objects = new WeakHashMap>( 256 ); - - public synchronized T intern( T object ) - { - Reference pooledRef = objects.get( object ); - if ( pooledRef != null ) - { - T pooled = pooledRef.get(); - if ( pooled != null ) - { - return pooled; - } - } - - objects.put( object, new WeakReference( object ) ); - return object; - } - -} diff --git a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/package-info.java b/aether-impl/src/main/java/org/eclipse/aether/internal/impl/package-info.java deleted file mode 100644 index e8299c93d..000000000 --- a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/package-info.java +++ /dev/null @@ -1,15 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -/** - * The various sub components that collectively implement the repository system. - */ -package org.eclipse.aether.internal.impl; - diff --git a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/slf4j/package-info.java b/aether-impl/src/main/java/org/eclipse/aether/internal/impl/slf4j/package-info.java deleted file mode 100644 index c28df8d7c..000000000 --- a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/slf4j/package-info.java +++ /dev/null @@ -1,15 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -/** - * The integration with the logging framework SLF4J. - */ -package org.eclipse.aether.internal.impl.slf4j; - diff --git a/aether-impl/src/main/resources/about.html b/aether-impl/src/main/resources/about.html deleted file mode 100644 index 03618534b..000000000 --- a/aether-impl/src/main/resources/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

September 23, 2011

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - diff --git a/aether-impl/src/test/java/org/eclipse/aether/impl/StubArtifactDescriptorReader.java b/aether-impl/src/test/java/org/eclipse/aether/impl/StubArtifactDescriptorReader.java deleted file mode 100644 index 90c65d468..000000000 --- a/aether-impl/src/test/java/org/eclipse/aether/impl/StubArtifactDescriptorReader.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether.impl; - -import org.eclipse.aether.RepositorySystemSession; -import org.eclipse.aether.impl.ArtifactDescriptorReader; -import org.eclipse.aether.resolution.ArtifactDescriptorException; -import org.eclipse.aether.resolution.ArtifactDescriptorRequest; -import org.eclipse.aether.resolution.ArtifactDescriptorResult; - -public class StubArtifactDescriptorReader - implements ArtifactDescriptorReader -{ - - public ArtifactDescriptorResult readArtifactDescriptor( RepositorySystemSession session, - ArtifactDescriptorRequest request ) - throws ArtifactDescriptorException - { - ArtifactDescriptorResult result = new ArtifactDescriptorResult( request ); - return result; - } - -} diff --git a/aether-impl/src/test/java/org/eclipse/aether/impl/StubVersionRangeResolver.java b/aether-impl/src/test/java/org/eclipse/aether/impl/StubVersionRangeResolver.java deleted file mode 100644 index 133eebe08..000000000 --- a/aether-impl/src/test/java/org/eclipse/aether/impl/StubVersionRangeResolver.java +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether.impl; - -import org.eclipse.aether.RepositorySystemSession; -import org.eclipse.aether.impl.VersionRangeResolver; -import org.eclipse.aether.resolution.VersionRangeRequest; -import org.eclipse.aether.resolution.VersionRangeResolutionException; -import org.eclipse.aether.resolution.VersionRangeResult; - -public class StubVersionRangeResolver - implements VersionRangeResolver -{ - - public VersionRangeResult resolveVersionRange( RepositorySystemSession session, VersionRangeRequest request ) - throws VersionRangeResolutionException - { - VersionRangeResult result = new VersionRangeResult( request ); - return result; - } - -} diff --git a/aether-impl/src/test/java/org/eclipse/aether/impl/StubVersionResolver.java b/aether-impl/src/test/java/org/eclipse/aether/impl/StubVersionResolver.java deleted file mode 100644 index d0790075d..000000000 --- a/aether-impl/src/test/java/org/eclipse/aether/impl/StubVersionResolver.java +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether.impl; - -import org.eclipse.aether.RepositorySystemSession; -import org.eclipse.aether.impl.VersionResolver; -import org.eclipse.aether.resolution.VersionRequest; -import org.eclipse.aether.resolution.VersionResolutionException; -import org.eclipse.aether.resolution.VersionResult; - -public class StubVersionResolver - implements VersionResolver -{ - - public VersionResult resolveVersion( RepositorySystemSession session, VersionRequest request ) - throws VersionResolutionException - { - VersionResult result = new VersionResult( request ); - return result; - } - -} diff --git a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/IniArtifactDescriptorReader.java b/aether-impl/src/test/java/org/eclipse/aether/internal/impl/IniArtifactDescriptorReader.java deleted file mode 100644 index c694769b4..000000000 --- a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/IniArtifactDescriptorReader.java +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether.internal.impl; - -import org.eclipse.aether.impl.ArtifactDescriptorReader; - -/** - */ -public class IniArtifactDescriptorReader - extends org.eclipse.aether.internal.test.util.IniArtifactDescriptorReader - implements ArtifactDescriptorReader -{ - - /** - * Use the given prefix to load the artifact descriptions. - */ - public IniArtifactDescriptorReader( String prefix ) - { - super( prefix ); - } - -} diff --git a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/SafeTransferListenerTest.java b/aether-impl/src/test/java/org/eclipse/aether/internal/impl/SafeTransferListenerTest.java deleted file mode 100644 index d062b68c4..000000000 --- a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/SafeTransferListenerTest.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether.internal.impl; - -import static org.junit.Assert.*; - -import java.lang.reflect.Method; - -import org.eclipse.aether.transfer.TransferListener; -import org.junit.Test; - -/** - */ -public class SafeTransferListenerTest -{ - - @Test - public void testAllEventTypesHandled() - throws Exception - { - Class type = SafeTransferListener.class; - for ( Method method : TransferListener.class.getMethods() ) - { - assertNotNull( type.getDeclaredMethod( method.getName(), method.getParameterTypes() ) ); - } - } - -} diff --git a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/StubSyncContextFactory.java b/aether-impl/src/test/java/org/eclipse/aether/internal/impl/StubSyncContextFactory.java deleted file mode 100644 index 927c68795..000000000 --- a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/StubSyncContextFactory.java +++ /dev/null @@ -1,42 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether.internal.impl; - -import java.util.Collection; - -import org.eclipse.aether.RepositorySystemSession; -import org.eclipse.aether.SyncContext; -import org.eclipse.aether.artifact.Artifact; -import org.eclipse.aether.impl.SyncContextFactory; -import org.eclipse.aether.metadata.Metadata; - -/** - * - */ -public class StubSyncContextFactory - implements SyncContextFactory -{ - - public SyncContext newInstance( RepositorySystemSession session, boolean shared ) - { - return new SyncContext() - { - public void close() - { - } - - public void acquire( Collection artifacts, Collection metadatas ) - { - } - }; - } - -} diff --git a/aether-impl/src/test/resources/artifact-descriptions/expectedPartialSubtreeOnError.txt b/aether-impl/src/test/resources/artifact-descriptions/expectedPartialSubtreeOnError.txt deleted file mode 100644 index badca5eb8..000000000 --- a/aether-impl/src/test/resources/artifact-descriptions/expectedPartialSubtreeOnError.txt +++ /dev/null @@ -1,5 +0,0 @@ -subtree:comparison:ext:error -+- duplicate:transitive:ext:dependency compile - +- gid:aid:ext:ver compile - | \- gid:aid2:ext:ver compile - \- gid:aid2:ext:ver compile diff --git a/aether-spi/pom.xml b/aether-spi/pom.xml deleted file mode 100644 index e9bd9fad4..000000000 --- a/aether-spi/pom.xml +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - 4.0.0 - - - org.eclipse.aether - aether - 1.0.0.v20140518 - - - aether-spi - - Aether SPI - - The service provider interface for repository system implementations and repository connectors. - - - - org.eclipse.aether.spi - - - - - org.eclipse.aether - aether-api - - - junit - junit - test - - - org.hamcrest - hamcrest-library - test - - - - - - - org.codehaus.mojo - animal-sniffer-maven-plugin - - - org.codehaus.mojo - clirr-maven-plugin - - - org.apache.felix - maven-bundle-plugin - - - - diff --git a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/checksum/package-info.java b/aether-spi/src/main/java/org/eclipse/aether/spi/connector/checksum/package-info.java deleted file mode 100644 index 108c39eca..000000000 --- a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/checksum/package-info.java +++ /dev/null @@ -1,16 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -/** - * The support infrastructure for repository connectors to apply checksum policies when validating the integrity of - * downloaded files. - */ -package org.eclipse.aether.spi.connector.checksum; - diff --git a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/layout/package-info.java b/aether-spi/src/main/java/org/eclipse/aether/spi/connector/layout/package-info.java deleted file mode 100644 index cce069d4c..000000000 --- a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/layout/package-info.java +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -/** - * The contract to locate URI-based resources using custom repository layouts. By implementing a - * {@link org.eclipse.aether.spi.connector.layout.RepositoryLayoutFactory} and registering it with the repository - * system, an application enables access to remote repositories that use new content types/layouts. - */ -package org.eclipse.aether.spi.connector.layout; - diff --git a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/package-info.java b/aether-spi/src/main/java/org/eclipse/aether/spi/connector/package-info.java deleted file mode 100644 index 25797eb69..000000000 --- a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/package-info.java +++ /dev/null @@ -1,21 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -/** - * The contract to access artifacts/metadata in remote repositories. By implementing a - * {@link org.eclipse.aether.spi.connector.RepositoryConnectorFactory} and registering it with the repository system, - * an application can enable access to arbitrary remote repositories. It should be noted that a repository connector is - * powerful yet burdensome to implement. In many cases, implementing a - * {@link org.eclipse.aether.spi.connector.transport.TransporterFactory} or - * {@link org.eclipse.aether.spi.connector.layout.RepositoryLayoutFactory} will be sufficient and easier to access a - * custom remote repository. - */ -package org.eclipse.aether.spi.connector; - diff --git a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/transport/PeekTask.java b/aether-spi/src/main/java/org/eclipse/aether/spi/connector/transport/PeekTask.java deleted file mode 100644 index f377ebf4f..000000000 --- a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/transport/PeekTask.java +++ /dev/null @@ -1,41 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether.spi.connector.transport; - -import java.net.URI; - -/** - * A task to check the existence of a resource in the remote repository. Note: The listener returned from - * {@link #getListener()} is always a noop given that none of its event methods are relevant in context of this task. - * - * @see Transporter#peek(PeekTask) - */ -public final class PeekTask - extends TransportTask -{ - - /** - * Creates a new task for the specified remote resource. - * - * @param location The relative location of the resource in the remote repository, must not be {@code null}. - */ - public PeekTask( URI location ) - { - setLocation( location ); - } - - @Override - public String toString() - { - return "?? " + getLocation(); - } - -} diff --git a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/transport/package-info.java b/aether-spi/src/main/java/org/eclipse/aether/spi/connector/transport/package-info.java deleted file mode 100644 index 89873175a..000000000 --- a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/transport/package-info.java +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -/** - * The contract to download/upload URI-based resources using custom transport protocols. By implementing a - * {@link org.eclipse.aether.spi.connector.transport.TransporterFactory} and registering it with the repository system, - * an application enables access to remote repositories that use new URI schemes. - */ -package org.eclipse.aether.spi.connector.transport; - diff --git a/aether-spi/src/main/java/org/eclipse/aether/spi/io/package-info.java b/aether-spi/src/main/java/org/eclipse/aether/spi/io/package-info.java deleted file mode 100644 index 8b5263216..000000000 --- a/aether-spi/src/main/java/org/eclipse/aether/spi/io/package-info.java +++ /dev/null @@ -1,15 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -/** - * I/O related support infrastructure for components. - */ -package org.eclipse.aether.spi.io; - diff --git a/aether-spi/src/main/java/org/eclipse/aether/spi/localrepo/package-info.java b/aether-spi/src/main/java/org/eclipse/aether/spi/localrepo/package-info.java deleted file mode 100644 index 63e5b8e3f..000000000 --- a/aether-spi/src/main/java/org/eclipse/aether/spi/localrepo/package-info.java +++ /dev/null @@ -1,15 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -/** - * The contract for custom local repository implementations. - */ -package org.eclipse.aether.spi.localrepo; - diff --git a/aether-spi/src/main/java/org/eclipse/aether/spi/locator/Service.java b/aether-spi/src/main/java/org/eclipse/aether/spi/locator/Service.java deleted file mode 100644 index acb234dd1..000000000 --- a/aether-spi/src/main/java/org/eclipse/aether/spi/locator/Service.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether.spi.locator; - -/** - * A stateless component of the repository system. The primary purpose of this interface is to provide a convenient - * means to programmatically wire the several components of the repository system together when it is used outside of an - * IoC container. - */ -public interface Service -{ - - /** - * Provides the opportunity to initialize this service and to acquire other services for its operation from the - * locator. A service must not save the reference to the provided service locator. - * - * @param locator The service locator, must not be {@code null}. - */ - void initService( ServiceLocator locator ); - -} diff --git a/aether-spi/src/main/java/org/eclipse/aether/spi/log/LoggerFactory.java b/aether-spi/src/main/java/org/eclipse/aether/spi/log/LoggerFactory.java deleted file mode 100644 index 6fd18a63b..000000000 --- a/aether-spi/src/main/java/org/eclipse/aether/spi/log/LoggerFactory.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether.spi.log; - -/** - * A factory to create loggers. - */ -public interface LoggerFactory -{ - - /** - * Gets a logger for a class with the specified name. - * - * @param name The name of the class requesting a logger, must not be {@code null}. - * @return The requested logger, never {@code null}. - */ - Logger getLogger( String name ); - -} diff --git a/aether-spi/src/main/java/org/eclipse/aether/spi/log/NullLogger.java b/aether-spi/src/main/java/org/eclipse/aether/spi/log/NullLogger.java deleted file mode 100644 index 35b3f2c07..000000000 --- a/aether-spi/src/main/java/org/eclipse/aether/spi/log/NullLogger.java +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether.spi.log; - -/** - * A logger that disables any logging. - */ -final class NullLogger - implements Logger -{ - - public boolean isDebugEnabled() - { - return false; - } - - public void debug( String msg ) - { - } - - public void debug( String msg, Throwable error ) - { - } - - public boolean isWarnEnabled() - { - return false; - } - - public void warn( String msg ) - { - } - - public void warn( String msg, Throwable error ) - { - } - -} diff --git a/aether-spi/src/main/java/org/eclipse/aether/spi/log/package-info.java b/aether-spi/src/main/java/org/eclipse/aether/spi/log/package-info.java deleted file mode 100644 index adf116364..000000000 --- a/aether-spi/src/main/java/org/eclipse/aether/spi/log/package-info.java +++ /dev/null @@ -1,19 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -/** - * A simple logging infrastructure for diagnostic messages. The primary purpose of the - * {@link org.eclipse.aether.spi.log.LoggerFactory} defined here is to avoid a mandatory dependency on a 3rd party - * logging system/facade. Some applications might find the events fired by the repository system sufficient and prefer - * a small footprint. Components that do not share this concern are free to ignore this package and directly employ - * whatever logging system they desire. - */ -package org.eclipse.aether.spi.log; - diff --git a/aether-spi/src/main/resources/about.html b/aether-spi/src/main/resources/about.html deleted file mode 100644 index 03618534b..000000000 --- a/aether-spi/src/main/resources/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

September 23, 2011

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - diff --git a/aether-test-util/pom.xml b/aether-test-util/pom.xml deleted file mode 100644 index 84ec2a479..000000000 --- a/aether-test-util/pom.xml +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - 4.0.0 - - - org.eclipse.aether - aether - 1.0.0.v20140518 - - - aether-test-util - - Aether Test Utilities - - A collection of utility classes to ease testing of the repository system. - - - - org.eclipse.aether.test-util - - - - - org.eclipse.aether - aether-api - - - org.eclipse.aether - aether-spi - - - junit - junit - test - - - org.hamcrest - hamcrest-library - test - - - - - - - org.codehaus.mojo - animal-sniffer-maven-plugin - - - org.apache.felix - maven-bundle-plugin - - - - diff --git a/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/package-info.java b/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/package-info.java deleted file mode 100644 index f63711cab..000000000 --- a/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/package-info.java +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -/** - * Utility classes to ease unit testing. This package supports the needs of Aether's own codebase but implementors of - * extensions might find some of these classes useful, too, as long as they understand that these classes do not denote - * a stable API and are subject to change without prior notice. - */ -package org.eclipse.aether.internal.test.util; - diff --git a/aether-test-util/src/main/resources/about.html b/aether-test-util/src/main/resources/about.html deleted file mode 100644 index 03618534b..000000000 --- a/aether-test-util/src/main/resources/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

September 23, 2011

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - diff --git a/aether-transport-classpath/pom.xml b/aether-transport-classpath/pom.xml deleted file mode 100644 index b980591f6..000000000 --- a/aether-transport-classpath/pom.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - 4.0.0 - - - org.eclipse.aether - aether - 1.0.0.v20140518 - - - aether-transport-classpath - - Aether Transport Classpath - - A transport implementation for repositories using classpath:// URLs. - - - - org.eclipse.aether.transport.classpath - - - - - org.eclipse.aether - aether-api - - - org.eclipse.aether - aether-spi - - - org.eclipse.aether - aether-util - - - javax.inject - javax.inject - provided - true - - - org.sonatype.sisu - sisu-guice - no_aop - test - - - junit - junit - test - - - org.hamcrest - hamcrest-library - test - - - org.eclipse.aether - aether-test-util - test - - - - - - - org.codehaus.mojo - animal-sniffer-maven-plugin - - - org.eclipse.sisu - sisu-maven-plugin - - - org.apache.felix - maven-bundle-plugin - - - - diff --git a/aether-transport-classpath/src/main/java/org/eclipse/aether/transport/classpath/ResourceNotFoundException.java b/aether-transport-classpath/src/main/java/org/eclipse/aether/transport/classpath/ResourceNotFoundException.java deleted file mode 100644 index d0fe0d12e..000000000 --- a/aether-transport-classpath/src/main/java/org/eclipse/aether/transport/classpath/ResourceNotFoundException.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether.transport.classpath; - -import java.io.IOException; - -/** - * Special exception type used instead of {@code FileNotFoundException} to avoid misinterpretation of errors unrelated - * to the remote resource. - */ -class ResourceNotFoundException - extends IOException -{ - - public ResourceNotFoundException( String message ) - { - super( message ); - } - -} diff --git a/aether-transport-classpath/src/main/java/org/eclipse/aether/transport/classpath/package-info.java b/aether-transport-classpath/src/main/java/org/eclipse/aether/transport/classpath/package-info.java deleted file mode 100644 index 51862b985..000000000 --- a/aether-transport-classpath/src/main/java/org/eclipse/aether/transport/classpath/package-info.java +++ /dev/null @@ -1,15 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -/** - * Support for downloads that utilize the classpath as "remote" storage. - */ -package org.eclipse.aether.transport.classpath; - diff --git a/aether-transport-classpath/src/main/resources/about.html b/aether-transport-classpath/src/main/resources/about.html deleted file mode 100644 index 03618534b..000000000 --- a/aether-transport-classpath/src/main/resources/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

September 23, 2011

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - diff --git a/aether-transport-file/pom.xml b/aether-transport-file/pom.xml deleted file mode 100644 index 35bf5b1fb..000000000 --- a/aether-transport-file/pom.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - 4.0.0 - - - org.eclipse.aether - aether - 1.0.0.v20140518 - - - aether-transport-file - - Aether Transport File - - A transport implementation for repositories using file:// URLs. - - - - org.eclipse.aether.transport.file - - - - - org.eclipse.aether - aether-api - - - org.eclipse.aether - aether-spi - - - org.eclipse.aether - aether-util - - - javax.inject - javax.inject - provided - true - - - org.sonatype.sisu - sisu-guice - no_aop - test - - - junit - junit - test - - - org.hamcrest - hamcrest-library - test - - - org.eclipse.aether - aether-test-util - test - - - - - - - org.codehaus.mojo - animal-sniffer-maven-plugin - - - org.eclipse.sisu - sisu-maven-plugin - - - org.apache.felix - maven-bundle-plugin - - - - diff --git a/aether-transport-file/src/main/java/org/eclipse/aether/transport/file/ResourceNotFoundException.java b/aether-transport-file/src/main/java/org/eclipse/aether/transport/file/ResourceNotFoundException.java deleted file mode 100644 index 1874af5a8..000000000 --- a/aether-transport-file/src/main/java/org/eclipse/aether/transport/file/ResourceNotFoundException.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether.transport.file; - -import java.io.IOException; - -/** - * Special exception type used instead of {@code FileNotFoundException} to avoid misinterpretation of errors unrelated - * to the remote resource. - */ -class ResourceNotFoundException - extends IOException -{ - - public ResourceNotFoundException( String message ) - { - super( message ); - } - -} diff --git a/aether-transport-file/src/main/java/org/eclipse/aether/transport/file/package-info.java b/aether-transport-file/src/main/java/org/eclipse/aether/transport/file/package-info.java deleted file mode 100644 index eac71119c..000000000 --- a/aether-transport-file/src/main/java/org/eclipse/aether/transport/file/package-info.java +++ /dev/null @@ -1,15 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -/** - * Support for downloads/uploads using the local filesystem as "remote" storage. - */ -package org.eclipse.aether.transport.file; - diff --git a/aether-transport-file/src/main/resources/about.html b/aether-transport-file/src/main/resources/about.html deleted file mode 100644 index 03618534b..000000000 --- a/aether-transport-file/src/main/resources/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

September 23, 2011

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - diff --git a/aether-transport-http/src/main/java/org/eclipse/aether/transport/http/HttpMkCol.java b/aether-transport-http/src/main/java/org/eclipse/aether/transport/http/HttpMkCol.java deleted file mode 100644 index fb7f2bbf9..000000000 --- a/aether-transport-http/src/main/java/org/eclipse/aether/transport/http/HttpMkCol.java +++ /dev/null @@ -1,35 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether.transport.http; - -import java.net.URI; - -import org.apache.http.client.methods.HttpRequestBase; - -/** - * WebDAV MKCOL request to create parent directories. - */ -final class HttpMkCol - extends HttpRequestBase -{ - - public HttpMkCol( URI uri ) - { - setURI( uri ); - } - - @Override - public String getMethod() - { - return "MKCOL"; - } - -} diff --git a/aether-transport-http/src/main/java/org/eclipse/aether/transport/http/package-info.java b/aether-transport-http/src/main/java/org/eclipse/aether/transport/http/package-info.java deleted file mode 100644 index a55c553d2..000000000 --- a/aether-transport-http/src/main/java/org/eclipse/aether/transport/http/package-info.java +++ /dev/null @@ -1,16 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -/** - * Support for downloads/uploads via the HTTP and HTTPS protocols. The current implementation is backed by - * Apache HttpClient. - */ -package org.eclipse.aether.transport.http; - diff --git a/aether-transport-http/src/main/resources/about.html b/aether-transport-http/src/main/resources/about.html deleted file mode 100644 index 03618534b..000000000 --- a/aether-transport-http/src/main/resources/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

September 23, 2011

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - diff --git a/aether-transport-http/src/test/resources/logback.xml b/aether-transport-http/src/test/resources/logback.xml deleted file mode 100644 index c8ce3dd97..000000000 --- a/aether-transport-http/src/test/resources/logback.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n - - - - - - - - - - diff --git a/aether-transport-wagon/src/main/java/org/eclipse/aether/internal/transport/wagon/package-info.java b/aether-transport-wagon/src/main/java/org/eclipse/aether/internal/transport/wagon/package-info.java deleted file mode 100644 index c5b2d2a97..000000000 --- a/aether-transport-wagon/src/main/java/org/eclipse/aether/internal/transport/wagon/package-info.java +++ /dev/null @@ -1,16 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -/** - * Integration with the Plexus IoC container which is the native runtime environment expected by many wagon - * implementations. - */ -package org.eclipse.aether.internal.transport.wagon; - diff --git a/aether-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/WagonCancelledException.java b/aether-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/WagonCancelledException.java deleted file mode 100644 index e90ef395d..000000000 --- a/aether-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/WagonCancelledException.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether.transport.wagon; - -import org.eclipse.aether.transfer.TransferCancelledException; - -/** - * Unchecked exception to allow the checked {@link TransferCancelledException} to bubble up from a wagon. - */ -class WagonCancelledException - extends RuntimeException -{ - - public WagonCancelledException( TransferCancelledException cause ) - { - super( cause ); - } - - public static Exception unwrap( Exception e ) - { - if ( e instanceof WagonCancelledException ) - { - e = (Exception) e.getCause(); - } - return e; - } - -} diff --git a/aether-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/WagonConfigurator.java b/aether-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/WagonConfigurator.java deleted file mode 100644 index 5540181cc..000000000 --- a/aether-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/WagonConfigurator.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether.transport.wagon; - -import org.apache.maven.wagon.Wagon; - -/** - * A component to configure wagon instances with provider-specific parameters. - */ -public interface WagonConfigurator -{ - - /** - * Configures the specified wagon instance with the given configuration. - * - * @param wagon The wagon instance to configure, must not be {@code null}. - * @param configuration The configuration to apply to the wagon instance, must not be {@code null}. - * @throws Exception If the configuration could not be applied to the wagon. - */ - void configure( Wagon wagon, Object configuration ) - throws Exception; - -} diff --git a/aether-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/package-info.java b/aether-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/package-info.java deleted file mode 100644 index 25bac4af4..000000000 --- a/aether-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/package-info.java +++ /dev/null @@ -1,15 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -/** - * Support for downloads/uploads using Apache Maven Wagon. - */ -package org.eclipse.aether.transport.wagon; - diff --git a/aether-transport-wagon/src/main/resources/about.html b/aether-transport-wagon/src/main/resources/about.html deleted file mode 100644 index 03618534b..000000000 --- a/aether-transport-wagon/src/main/resources/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

September 23, 2011

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - diff --git a/aether-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/Configurable.java b/aether-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/Configurable.java deleted file mode 100644 index 28f0f5ee4..000000000 --- a/aether-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/Configurable.java +++ /dev/null @@ -1,22 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether.transport.wagon; - -/** - */ -public interface Configurable -{ - - Object getConfiguration(); - - void setConfiguration( Object config ); - -} diff --git a/aether-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/StreamWagonTransporterTest.java b/aether-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/StreamWagonTransporterTest.java deleted file mode 100644 index f699e7f08..000000000 --- a/aether-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/StreamWagonTransporterTest.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether.transport.wagon; - -import org.apache.maven.wagon.Wagon; - -/** - */ -public class StreamWagonTransporterTest - extends AbstractWagonTransporterTest -{ - - @Override - protected Wagon newWagon() - { - return new MemStreamWagon(); - } - -} diff --git a/aether-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/WagonTransporterTest.java b/aether-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/WagonTransporterTest.java deleted file mode 100644 index b126ed3bf..000000000 --- a/aether-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/WagonTransporterTest.java +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether.transport.wagon; - -import org.apache.maven.wagon.Wagon; - -/** - */ -public class WagonTransporterTest - extends AbstractWagonTransporterTest -{ - - @Override - protected Wagon newWagon() - { - return new MemWagon(); - } - -} diff --git a/aether-transport-wagon/src/test/resources/logback-test.xml b/aether-transport-wagon/src/test/resources/logback-test.xml deleted file mode 100644 index f44c369a8..000000000 --- a/aether-transport-wagon/src/test/resources/logback-test.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - %d{HH:mm:ss.SSS} [%-18thread] %c{1} [%p] %m%n - - - - - - - - - - - diff --git a/aether-util/pom.xml b/aether-util/pom.xml deleted file mode 100644 index 624f7d4ed..000000000 --- a/aether-util/pom.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - 4.0.0 - - - org.eclipse.aether - aether - 1.0.0.v20140518 - - - aether-util - - Aether Utilities - - A collection of utility classes to ease usage of the repository system. - - - - org.eclipse.aether.util - - - - - org.eclipse.aether - aether-api - - - org.eclipse.aether - aether-test-util - test - - - org.hamcrest - hamcrest-library - test - - - junit - junit - test - - - - - - - org.codehaus.mojo - animal-sniffer-maven-plugin - - - org.codehaus.mojo - clirr-maven-plugin - - - org.apache.felix - maven-bundle-plugin - - - - diff --git a/aether-util/src/main/java/org/eclipse/aether/util/StringUtils.java b/aether-util/src/main/java/org/eclipse/aether/util/StringUtils.java deleted file mode 100644 index 1fcfd931c..000000000 --- a/aether-util/src/main/java/org/eclipse/aether/util/StringUtils.java +++ /dev/null @@ -1,35 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether.util; - -/** - * A utility class to ease string processing. - */ -public final class StringUtils -{ - - private StringUtils() - { - // hide constructor - } - - /** - * Checks whether a string is {@code null} or of zero length. - * - * @param string The string to check, may be {@code null}. - * @return {@code true} if the string is {@code null} or of zero length, {@code false} otherwise. - */ - public static boolean isEmpty( String string ) - { - return string == null || string.length() <= 0; - } - -} diff --git a/aether-util/src/main/java/org/eclipse/aether/util/artifact/DefaultArtifactTypeRegistry.java b/aether-util/src/main/java/org/eclipse/aether/util/artifact/DefaultArtifactTypeRegistry.java deleted file mode 100644 index 57d909500..000000000 --- a/aether-util/src/main/java/org/eclipse/aether/util/artifact/DefaultArtifactTypeRegistry.java +++ /dev/null @@ -1,42 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether.util.artifact; - -import org.eclipse.aether.artifact.ArtifactType; - -/** - * A simple artifact type registry. - */ -public final class DefaultArtifactTypeRegistry - extends SimpleArtifactTypeRegistry -{ - - /** - * Creates a new artifact type registry with initally no registered artifact types. Use {@link #add(ArtifactType)} - * to populate the registry. - */ - public DefaultArtifactTypeRegistry() - { - } - - /** - * Adds the specified artifact type to the registry. - * - * @param type The artifact type to add, must not be {@code null}. - * @return This registry for chaining, never {@code null}. - */ - public DefaultArtifactTypeRegistry add( ArtifactType type ) - { - super.add( type ); - return this; - } - -} diff --git a/aether-util/src/main/java/org/eclipse/aether/util/artifact/JavaScopes.java b/aether-util/src/main/java/org/eclipse/aether/util/artifact/JavaScopes.java deleted file mode 100644 index 4a5a24b7a..000000000 --- a/aether-util/src/main/java/org/eclipse/aether/util/artifact/JavaScopes.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether.util.artifact; - -/** - * The dependency scopes used for Java dependencies. - * - * @see org.eclipse.aether.graph.Dependency#getScope() - */ -public final class JavaScopes -{ - - public static final String COMPILE = "compile"; - - public static final String PROVIDED = "provided"; - - public static final String SYSTEM = "system"; - - public static final String RUNTIME = "runtime"; - - public static final String TEST = "test"; - - private JavaScopes() - { - // hide constructor - } - -} diff --git a/aether-util/src/main/java/org/eclipse/aether/util/artifact/package-info.java b/aether-util/src/main/java/org/eclipse/aether/util/artifact/package-info.java deleted file mode 100644 index 3a6d14712..000000000 --- a/aether-util/src/main/java/org/eclipse/aether/util/artifact/package-info.java +++ /dev/null @@ -1,15 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -/** - * Utilities around artifacts and artifact type registries. - */ -package org.eclipse.aether.util.artifact; - diff --git a/aether-util/src/main/java/org/eclipse/aether/util/concurrency/package-info.java b/aether-util/src/main/java/org/eclipse/aether/util/concurrency/package-info.java deleted file mode 100644 index 6503e6f36..000000000 --- a/aether-util/src/main/java/org/eclipse/aether/util/concurrency/package-info.java +++ /dev/null @@ -1,15 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -/** - * Utilities for concurrent task processing. - */ -package org.eclipse.aether.util.concurrency; - diff --git a/aether-util/src/main/java/org/eclipse/aether/util/filter/package-info.java b/aether-util/src/main/java/org/eclipse/aether/util/filter/package-info.java deleted file mode 100644 index c79d2b189..000000000 --- a/aether-util/src/main/java/org/eclipse/aether/util/filter/package-info.java +++ /dev/null @@ -1,15 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -/** - * Various dependency filters for selecting nodes in a dependency graph. - */ -package org.eclipse.aether.util.filter; - diff --git a/aether-util/src/main/java/org/eclipse/aether/util/graph/manager/package-info.java b/aether-util/src/main/java/org/eclipse/aether/util/graph/manager/package-info.java deleted file mode 100644 index 420111abe..000000000 --- a/aether-util/src/main/java/org/eclipse/aether/util/graph/manager/package-info.java +++ /dev/null @@ -1,15 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -/** - * Various dependency managers for building a dependency graph. - */ -package org.eclipse.aether.util.graph.manager; - diff --git a/aether-util/src/main/java/org/eclipse/aether/util/graph/selector/package-info.java b/aether-util/src/main/java/org/eclipse/aether/util/graph/selector/package-info.java deleted file mode 100644 index 52ca3e1aa..000000000 --- a/aether-util/src/main/java/org/eclipse/aether/util/graph/selector/package-info.java +++ /dev/null @@ -1,15 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -/** - * Various dependency selectors for building a dependency graph. - */ -package org.eclipse.aether.util.graph.selector; - diff --git a/aether-util/src/main/java/org/eclipse/aether/util/graph/transformer/package-info.java b/aether-util/src/main/java/org/eclipse/aether/util/graph/transformer/package-info.java deleted file mode 100644 index d03a11d3f..000000000 --- a/aether-util/src/main/java/org/eclipse/aether/util/graph/transformer/package-info.java +++ /dev/null @@ -1,15 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -/** - * Various dependency graph transformers for post-processing a dependency graph. - */ -package org.eclipse.aether.util.graph.transformer; - diff --git a/aether-util/src/main/java/org/eclipse/aether/util/graph/traverser/package-info.java b/aether-util/src/main/java/org/eclipse/aether/util/graph/traverser/package-info.java deleted file mode 100644 index 0cf2aa23d..000000000 --- a/aether-util/src/main/java/org/eclipse/aether/util/graph/traverser/package-info.java +++ /dev/null @@ -1,15 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -/** - * Various dependency traversers for building a dependency graph. - */ -package org.eclipse.aether.util.graph.traverser; - diff --git a/aether-util/src/main/java/org/eclipse/aether/util/graph/version/package-info.java b/aether-util/src/main/java/org/eclipse/aether/util/graph/version/package-info.java deleted file mode 100644 index 6fbd98826..000000000 --- a/aether-util/src/main/java/org/eclipse/aether/util/graph/version/package-info.java +++ /dev/null @@ -1,15 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -/** - * Various version filters for building a dependency graph. - */ -package org.eclipse.aether.util.graph.version; - diff --git a/aether-util/src/main/java/org/eclipse/aether/util/graph/visitor/package-info.java b/aether-util/src/main/java/org/eclipse/aether/util/graph/visitor/package-info.java deleted file mode 100644 index 223146699..000000000 --- a/aether-util/src/main/java/org/eclipse/aether/util/graph/visitor/package-info.java +++ /dev/null @@ -1,15 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -/** - * Various dependency visitors for inspecting a dependency graph. - */ -package org.eclipse.aether.util.graph.visitor; - diff --git a/aether-util/src/main/java/org/eclipse/aether/util/listener/package-info.java b/aether-util/src/main/java/org/eclipse/aether/util/listener/package-info.java deleted file mode 100644 index f9b041363..000000000 --- a/aether-util/src/main/java/org/eclipse/aether/util/listener/package-info.java +++ /dev/null @@ -1,15 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -/** - * Utilities to build repository and transfer listeners. - */ -package org.eclipse.aether.util.listener; - diff --git a/aether-util/src/main/java/org/eclipse/aether/util/package-info.java b/aether-util/src/main/java/org/eclipse/aether/util/package-info.java deleted file mode 100644 index e9f1c5ba2..000000000 --- a/aether-util/src/main/java/org/eclipse/aether/util/package-info.java +++ /dev/null @@ -1,15 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -/** - * Miscellaneous utility classes. - */ -package org.eclipse.aether.util; - diff --git a/aether-util/src/main/java/org/eclipse/aether/util/repository/DefaultMirrorSelector.java b/aether-util/src/main/java/org/eclipse/aether/util/repository/DefaultMirrorSelector.java deleted file mode 100644 index 9cb83ae4e..000000000 --- a/aether-util/src/main/java/org/eclipse/aether/util/repository/DefaultMirrorSelector.java +++ /dev/null @@ -1,264 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether.util.repository; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import org.eclipse.aether.repository.MirrorSelector; -import org.eclipse.aether.repository.RemoteRepository; - -/** - * A simple mirror selector that selects mirrors based on repository identifiers. - */ -public final class DefaultMirrorSelector - implements MirrorSelector -{ - - private static final String WILDCARD = "*"; - - private static final String EXTERNAL_WILDCARD = "external:*"; - - private final List mirrors = new ArrayList(); - - /** - * Adds the specified mirror to this selector. - * - * @param id The identifier of the mirror, must not be {@code null}. - * @param url The URL of the mirror, must not be {@code null}. - * @param type The content type of the mirror, must not be {@code null}. - * @param repositoryManager A flag whether the mirror is a repository manager or a simple server. - * @param mirrorOfIds The identifier(s) of remote repositories to mirror, must not be {@code null}. Multiple - * identifiers can be separated by comma and additionally the wildcards "*" and "external:*" can be used - * to match all (external) repositories, prefixing a repo id with an exclamation mark allows to express - * an exclusion. For example "external:*,!central". - * @param mirrorOfTypes The content type(s) of remote repositories to mirror, may be {@code null} or empty to match - * any content type. Similar to the repo id specification, multiple types can be comma-separated, the - * wildcard "*" and the "!" negation syntax are supported. For example "*,!p2". - * @return This selector for chaining, never {@code null}. - */ - public DefaultMirrorSelector add( String id, String url, String type, boolean repositoryManager, - String mirrorOfIds, String mirrorOfTypes ) - { - mirrors.add( new MirrorDef( id, url, type, repositoryManager, mirrorOfIds, mirrorOfTypes ) ); - - return this; - } - - public RemoteRepository getMirror( RemoteRepository repository ) - { - MirrorDef mirror = findMirror( repository ); - - if ( mirror == null ) - { - return null; - } - - RemoteRepository.Builder builder = - new RemoteRepository.Builder( mirror.id, repository.getContentType(), mirror.url ); - - builder.setRepositoryManager( mirror.repositoryManager ); - - if ( mirror.type != null && mirror.type.length() > 0 ) - { - builder.setContentType( mirror.type ); - } - - builder.setSnapshotPolicy( repository.getPolicy( true ) ); - builder.setReleasePolicy( repository.getPolicy( false ) ); - - builder.setMirroredRepositories( Collections.singletonList( repository ) ); - - return builder.build(); - } - - private MirrorDef findMirror( RemoteRepository repository ) - { - String repoId = repository.getId(); - - if ( repoId != null && !mirrors.isEmpty() ) - { - for ( MirrorDef mirror : mirrors ) - { - if ( repoId.equals( mirror.mirrorOfIds ) && matchesType( repository.getContentType(), - mirror.mirrorOfTypes ) ) - { - return mirror; - } - } - - for ( MirrorDef mirror : mirrors ) - { - if ( matchPattern( repository, mirror.mirrorOfIds ) && matchesType( repository.getContentType(), - mirror.mirrorOfTypes ) ) - { - return mirror; - } - } - } - - return null; - } - - /** - * This method checks if the pattern matches the originalRepository. Valid patterns: * = everything external:* = - * everything not on the localhost and not file based. repo,repo1 = repo or repo1 *,!repo1 = everything except repo1 - * - * @param repository to compare for a match. - * @param pattern used for match. Currently only '*' is supported. - * @return true if the repository is a match to this pattern. - */ - static boolean matchPattern( RemoteRepository repository, String pattern ) - { - boolean result = false; - String originalId = repository.getId(); - - // simple checks first to short circuit processing below. - if ( WILDCARD.equals( pattern ) || pattern.equals( originalId ) ) - { - result = true; - } - else - { - // process the list - String[] repos = pattern.split( "," ); - for ( String repo : repos ) - { - // see if this is a negative match - if ( repo.length() > 1 && repo.startsWith( "!" ) ) - { - if ( repo.substring( 1 ).equals( originalId ) ) - { - // explicitly exclude. Set result and stop processing. - result = false; - break; - } - } - // check for exact match - else if ( repo.equals( originalId ) ) - { - result = true; - break; - } - // check for external:* - else if ( EXTERNAL_WILDCARD.equals( repo ) && isExternalRepo( repository ) ) - { - result = true; - // don't stop processing in case a future segment explicitly excludes this repo - } - else if ( WILDCARD.equals( repo ) ) - { - result = true; - // don't stop processing in case a future segment explicitly excludes this repo - } - } - } - return result; - } - - /** - * Checks the URL to see if this repository refers to an external repository. - * - * @param repository The repository to check, must not be {@code null}. - * @return {@code true} if external, {@code false} otherwise. - */ - static boolean isExternalRepo( RemoteRepository repository ) - { - boolean local = - "localhost".equals( repository.getHost() ) || "127.0.0.1".equals( repository.getHost() ) - || "file".equalsIgnoreCase( repository.getProtocol() ); - return !local; - } - - /** - * Checks whether the types configured for a mirror match with the type of the repository. - * - * @param repoType The type of the repository, may be {@code null}. - * @param mirrorType The types supported by the mirror, may be {@code null}. - * @return {@code true} if the types associated with the mirror match the type of the original repository, - * {@code false} otherwise. - */ - static boolean matchesType( String repoType, String mirrorType ) - { - boolean result = false; - - // simple checks first to short circuit processing below. - if ( mirrorType == null || mirrorType.length() <= 0 || WILDCARD.equals( mirrorType ) ) - { - result = true; - } - else if ( mirrorType.equals( repoType ) ) - { - result = true; - } - else - { - // process the list - String[] layouts = mirrorType.split( "," ); - for ( String layout : layouts ) - { - // see if this is a negative match - if ( layout.length() > 1 && layout.startsWith( "!" ) ) - { - if ( layout.substring( 1 ).equals( repoType ) ) - { - // explicitly exclude. Set result and stop processing. - result = false; - break; - } - } - // check for exact match - else if ( layout.equals( repoType ) ) - { - result = true; - break; - } - else if ( WILDCARD.equals( layout ) ) - { - result = true; - // don't stop processing in case a future segment explicitly excludes this repo - } - } - } - - return result; - } - - static class MirrorDef - { - - final String id; - - final String url; - - final String type; - - final boolean repositoryManager; - - final String mirrorOfIds; - - final String mirrorOfTypes; - - public MirrorDef( String id, String url, String type, boolean repositoryManager, String mirrorOfIds, - String mirrorOfTypes ) - { - this.id = id; - this.url = url; - this.type = type; - this.repositoryManager = repositoryManager; - this.mirrorOfIds = mirrorOfIds; - this.mirrorOfTypes = mirrorOfTypes; - } - - } - -} diff --git a/aether-util/src/main/java/org/eclipse/aether/util/repository/DefaultProxySelector.java b/aether-util/src/main/java/org/eclipse/aether/util/repository/DefaultProxySelector.java deleted file mode 100644 index c761aa745..000000000 --- a/aether-util/src/main/java/org/eclipse/aether/util/repository/DefaultProxySelector.java +++ /dev/null @@ -1,122 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether.util.repository; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.StringTokenizer; - -import org.eclipse.aether.repository.Proxy; -import org.eclipse.aether.repository.ProxySelector; -import org.eclipse.aether.repository.RemoteRepository; - -/** - * A simple proxy selector that selects the first matching proxy from a list of configured proxies. - */ -public final class DefaultProxySelector - implements ProxySelector -{ - - private List proxies = new ArrayList(); - - /** - * Adds the specified proxy definition to the selector. Proxy definitions are ordered, the first matching proxy for - * a given repository will be used. - * - * @param proxy The proxy definition to add, must not be {@code null}. - * @param nonProxyHosts The list of hosts to exclude from proxying, may be {@code null}. - * @return This proxy selector for chaining, never {@code null}. - */ - public DefaultProxySelector add( Proxy proxy, String nonProxyHosts ) - { - proxies.add( new ProxyDef( proxy, nonProxyHosts ) ); - - return this; - } - - public Proxy getProxy( RemoteRepository repository ) - { - Map candidates = new HashMap(); - - String host = repository.getHost(); - for ( ProxyDef proxy : proxies ) - { - if ( !isNonProxyHosts( host, proxy.nonProxyHosts ) ) - { - String key = proxy.proxy.getType().toLowerCase( Locale.ENGLISH ); - if ( !candidates.containsKey( key ) ) - { - candidates.put( key, proxy ); - } - } - } - - String protocol = repository.getProtocol().toLowerCase( Locale.ENGLISH ); - - if ( "davs".equals( protocol ) ) - { - protocol = "https"; - } - else if ( "dav".equals( protocol ) ) - { - protocol = "http"; - } - else if ( protocol.startsWith( "dav:" ) ) - { - protocol = protocol.substring( "dav:".length() ); - } - - ProxyDef proxy = candidates.get( protocol ); - if ( proxy == null && "https".equals( protocol ) ) - { - proxy = candidates.get( "http" ); - } - - return ( proxy != null ) ? proxy.proxy : null; - } - - static boolean isNonProxyHosts( String host, String nonProxyHosts ) - { - if ( host != null && nonProxyHosts != null && nonProxyHosts.length() > 0 ) - { - for ( StringTokenizer tokenizer = new StringTokenizer( nonProxyHosts, "|" ); tokenizer.hasMoreTokens(); ) - { - String pattern = tokenizer.nextToken(); - pattern = pattern.replace( ".", "\\." ).replace( "*", ".*" ); - if ( host.matches( pattern ) ) - { - return true; - } - } - } - - return false; - } - - static class ProxyDef - { - - final Proxy proxy; - - final String nonProxyHosts; - - public ProxyDef( Proxy proxy, String nonProxyHosts ) - { - this.proxy = proxy; - this.nonProxyHosts = nonProxyHosts; - } - - } - -} diff --git a/aether-util/src/main/java/org/eclipse/aether/util/repository/package-info.java b/aether-util/src/main/java/org/eclipse/aether/util/repository/package-info.java deleted file mode 100644 index 1d348461a..000000000 --- a/aether-util/src/main/java/org/eclipse/aether/util/repository/package-info.java +++ /dev/null @@ -1,15 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -/** - * Ready-to-use selectors for authentication, proxies and mirrors and a few other repository related utilities. - */ -package org.eclipse.aether.util.repository; - diff --git a/aether-util/src/main/java/org/eclipse/aether/util/version/package-info.java b/aether-util/src/main/java/org/eclipse/aether/util/version/package-info.java deleted file mode 100644 index cbba8136b..000000000 --- a/aether-util/src/main/java/org/eclipse/aether/util/version/package-info.java +++ /dev/null @@ -1,15 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -/** - * Ready-to-use version schemes for parsing/comparing versions. - */ -package org.eclipse.aether.util.version; - diff --git a/aether-util/src/main/resources/about.html b/aether-util/src/main/resources/about.html deleted file mode 100644 index 03618534b..000000000 --- a/aether-util/src/main/resources/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

September 23, 2011

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - diff --git a/aether-util/src/test/java/org/eclipse/aether/util/StringUtilsTest.java b/aether-util/src/test/java/org/eclipse/aether/util/StringUtilsTest.java deleted file mode 100644 index d11b4bb02..000000000 --- a/aether-util/src/test/java/org/eclipse/aether/util/StringUtilsTest.java +++ /dev/null @@ -1,32 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether.util; - -import static org.junit.Assert.*; - -import org.eclipse.aether.util.StringUtils; -import org.junit.Test; - -/** - */ -public class StringUtilsTest -{ - - @Test - public void testIsEmpty() - { - assertTrue( StringUtils.isEmpty( null ) ); - assertTrue( StringUtils.isEmpty( "" ) ); - assertFalse( StringUtils.isEmpty( " " ) ); - assertFalse( StringUtils.isEmpty( "test" ) ); - } - -} diff --git a/aether-util/src/test/java/org/eclipse/aether/util/filter/AbstractDependencyFilterTest.java b/aether-util/src/test/java/org/eclipse/aether/util/filter/AbstractDependencyFilterTest.java deleted file mode 100644 index a38fdaf64..000000000 --- a/aether-util/src/test/java/org/eclipse/aether/util/filter/AbstractDependencyFilterTest.java +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether.util.filter; - -import java.util.List; - -import org.eclipse.aether.graph.DependencyFilter; -import org.eclipse.aether.graph.DependencyNode; - -public abstract class AbstractDependencyFilterTest -{ - - protected DependencyFilter getAcceptFilter() - { - return new DependencyFilter() - { - - public boolean accept( DependencyNode node, List parents ) - { - return true; - } - - }; - } - - protected DependencyFilter getDenyFilter() - { - return new DependencyFilter() - { - - public boolean accept( DependencyNode node, List parents ) - { - return false; - } - }; - } - -} diff --git a/aether-util/src/test/java/org/eclipse/aether/util/listener/ChainedRepositoryListenerTest.java b/aether-util/src/test/java/org/eclipse/aether/util/listener/ChainedRepositoryListenerTest.java deleted file mode 100644 index 7547b4a0b..000000000 --- a/aether-util/src/test/java/org/eclipse/aether/util/listener/ChainedRepositoryListenerTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether.util.listener; - -import static org.junit.Assert.*; - -import java.lang.reflect.Method; - -import org.eclipse.aether.RepositoryListener; -import org.eclipse.aether.util.listener.ChainedRepositoryListener; -import org.junit.Test; - -/** - */ -public class ChainedRepositoryListenerTest -{ - - @Test - public void testAllEventTypesHandled() - throws Exception - { - for ( Method method : RepositoryListener.class.getMethods() ) - { - assertNotNull( ChainedRepositoryListener.class.getDeclaredMethod( method.getName(), - method.getParameterTypes() ) ); - } - } - -} diff --git a/aether-util/src/test/java/org/eclipse/aether/util/listener/ChainedTransferListenerTest.java b/aether-util/src/test/java/org/eclipse/aether/util/listener/ChainedTransferListenerTest.java deleted file mode 100644 index 1bf13cd6f..000000000 --- a/aether-util/src/test/java/org/eclipse/aether/util/listener/ChainedTransferListenerTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether.util.listener; - -import static org.junit.Assert.*; - -import java.lang.reflect.Method; - -import org.eclipse.aether.transfer.TransferListener; -import org.eclipse.aether.util.listener.ChainedTransferListener; -import org.junit.Test; - -/** - */ -public class ChainedTransferListenerTest -{ - - @Test - public void testAllEventTypesHandled() - throws Exception - { - for ( Method method : TransferListener.class.getMethods() ) - { - assertNotNull( ChainedTransferListener.class.getDeclaredMethod( method.getName(), - method.getParameterTypes() ) ); - } - } - -} diff --git a/aether-util/src/test/java/org/eclipse/aether/util/repository/DefaultProxySelectorTest.java b/aether-util/src/test/java/org/eclipse/aether/util/repository/DefaultProxySelectorTest.java deleted file mode 100644 index ef25a8609..000000000 --- a/aether-util/src/test/java/org/eclipse/aether/util/repository/DefaultProxySelectorTest.java +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether.util.repository; - -import static org.junit.Assert.*; - -import org.eclipse.aether.util.repository.DefaultProxySelector; -import org.junit.Test; - -/** - */ -public class DefaultProxySelectorTest -{ - - private boolean isNonProxyHosts( String host, String nonProxyHosts ) - { - return DefaultProxySelector.isNonProxyHosts( host, nonProxyHosts ); - } - - @Test - public void testIsNonProxyHosts() - { - assertFalse( isNonProxyHosts( "www.sonatype.org", null ) ); - assertFalse( isNonProxyHosts( "www.sonatype.org", "" ) ); - - assertTrue( isNonProxyHosts( "www.sonatype.org", "*" ) ); - assertTrue( isNonProxyHosts( "www.sonatype.org", "*.org" ) ); - assertTrue( isNonProxyHosts( "www.sonatype.org", "www.*" ) ); - assertTrue( isNonProxyHosts( "www.sonatype.org", "www.*.org" ) ); - - assertFalse( isNonProxyHosts( "www.sonatype.org", "www.sonatype.com" ) ); - assertFalse( isNonProxyHosts( "www.sonatype.org", "*.com" ) ); - assertFalse( isNonProxyHosts( "www.sonatype.org", "sonatype.org" ) ); - - assertTrue( isNonProxyHosts( "www.sonatype.org", "*.com|*.org" ) ); - } - -} diff --git a/class-overview.svg b/class-overview.svg index 75486aee6..be953e19b 100644 --- a/class-overview.svg +++ b/class-overview.svg @@ -1,14 +1,22 @@ -RepositorySystemresolveVersionRange()resolveVersion()readArtifactDescriptor()collectDependencies()resolveDependencies()resolveArtifacts()resolveMetadata()install()deploy()RepositorySystemSessionoffline : booleansystemProperties : MapupdatePolicy : StringchecksumPolicy : String...AuthenticationProxyProxySelectorgetProxy()AuthenticationSelectorgetAuthentication()MirrorSelectorgetMirror()ArtifactRepsositoryid : StringcontentType : StringLocalRepositorybasedir : FileWorkspaceRepositoryRemoteRepositoryurl : StringLocalRepositoryManagergetPathForLocalArtifact()getPathForRemoteArtifact()getPathForLocalMetadata()getPathForRemoteMetadata()WorkspaceReaderfindArtifact()findVersions()RepositoryConnectorget()put()close()RepositoryConnectorFactorypriority : intTransferListenertransferStarted()transferProgressed()transferFailed()...RepositoryListenerartifactResolving()artifactResolved()artifactDeployed()...DependencyGraphTransformertransformGraph()DependencySelectorselectDependency() : booleanDependencyTraversertraverseDependency() : booleanDependencyManagermanageDependency()DependencyNodeDependencyscope : StringArtifactgroupId : StringartifactId : Stringextension : Stringclassifier : Stringversion : Stringfile : Fileproperties : MapScope Inheritance, Conflict ResolutionFat WARsExclusions, Optional Dependencies +RepositorySystemresolveVersionRange()resolveVersion()readArtifactDescriptor()collectDependencies()resolveDependencies()resolveArtifacts()resolveMetadata()install()deploy()RepositorySystemSessionoffline : booleansystemProperties : MapupdatePolicy : StringchecksumPolicy : String...AuthenticationProxyProxySelectorgetProxy()AuthenticationSelectorgetAuthentication()MirrorSelectorgetMirror()ArtifactRepositoryid : StringcontentType : StringLocalRepositorybasedir : FileWorkspaceRepositoryRemoteRepositoryurl : StringLocalRepositoryManagergetPathForLocalArtifact()getPathForRemoteArtifact()getPathForLocalMetadata()getPathForRemoteMetadata()WorkspaceReaderfindArtifact()findVersions()RepositoryConnectorget()put()close()RepositoryConnectorFactorypriority : intTransferListenertransferStarted()transferProgressed()transferFailed()...RepositoryListenerartifactResolving()artifactResolved()artifactDeployed()...DependencyGraphTransformertransformGraph()DependencySelectorselectDependency() : booleanDependencyTraversertraverseDependency() : booleanDependencyManagermanageDependency()DependencyNodeDependencyscope : StringArtifactgroupId : StringartifactId : Stringextension : Stringclassifier : Stringversion : Stringfile : Fileproperties : MapScope Inheritance, Conflict ResolutionFat WARsExclusions, Optional Dependencies diff --git a/epl-v10.html b/epl-v10.html deleted file mode 100644 index fd391227c..000000000 --- a/epl-v10.html +++ /dev/null @@ -1,261 +0,0 @@ - - - - - - -Eclipse Public License - Version 1.0 - - - - - - -

Eclipse Public License - v 1.0

- -

THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE -PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR -DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS -AGREEMENT.

- -

1. DEFINITIONS

- -

"Contribution" means:

- -

a) in the case of the initial Contributor, the initial -code and documentation distributed under this Agreement, and

-

b) in the case of each subsequent Contributor:

-

i) changes to the Program, and

-

ii) additions to the Program;

-

where such changes and/or additions to the Program -originate from and are distributed by that particular Contributor. A -Contribution 'originates' from a Contributor if it was added to the -Program by such Contributor itself or anyone acting on such -Contributor's behalf. Contributions do not include additions to the -Program which: (i) are separate modules of software distributed in -conjunction with the Program under their own license agreement, and (ii) -are not derivative works of the Program.

- -

"Contributor" means any person or entity that distributes -the Program.

- -

"Licensed Patents" mean patent claims licensable by a -Contributor which are necessarily infringed by the use or sale of its -Contribution alone or when combined with the Program.

- -

"Program" means the Contributions distributed in accordance -with this Agreement.

- -

"Recipient" means anyone who receives the Program under -this Agreement, including all Contributors.

- -

2. GRANT OF RIGHTS

- -

a) Subject to the terms of this Agreement, each -Contributor hereby grants Recipient a non-exclusive, worldwide, -royalty-free copyright license to reproduce, prepare derivative works -of, publicly display, publicly perform, distribute and sublicense the -Contribution of such Contributor, if any, and such derivative works, in -source code and object code form.

- -

b) Subject to the terms of this Agreement, each -Contributor hereby grants Recipient a non-exclusive, worldwide, -royalty-free patent license under Licensed Patents to make, use, sell, -offer to sell, import and otherwise transfer the Contribution of such -Contributor, if any, in source code and object code form. This patent -license shall apply to the combination of the Contribution and the -Program if, at the time the Contribution is added by the Contributor, -such addition of the Contribution causes such combination to be covered -by the Licensed Patents. The patent license shall not apply to any other -combinations which include the Contribution. No hardware per se is -licensed hereunder.

- -

c) Recipient understands that although each Contributor -grants the licenses to its Contributions set forth herein, no assurances -are provided by any Contributor that the Program does not infringe the -patent or other intellectual property rights of any other entity. Each -Contributor disclaims any liability to Recipient for claims brought by -any other entity based on infringement of intellectual property rights -or otherwise. As a condition to exercising the rights and licenses -granted hereunder, each Recipient hereby assumes sole responsibility to -secure any other intellectual property rights needed, if any. For -example, if a third party patent license is required to allow Recipient -to distribute the Program, it is Recipient's responsibility to acquire -that license before distributing the Program.

- -

d) Each Contributor represents that to its knowledge it -has sufficient copyright rights in its Contribution, if any, to grant -the copyright license set forth in this Agreement.

- -

3. REQUIREMENTS

- -

A Contributor may choose to distribute the Program in object code -form under its own license agreement, provided that:

- -

a) it complies with the terms and conditions of this -Agreement; and

- -

b) its license agreement:

- -

i) effectively disclaims on behalf of all Contributors -all warranties and conditions, express and implied, including warranties -or conditions of title and non-infringement, and implied warranties or -conditions of merchantability and fitness for a particular purpose;

- -

ii) effectively excludes on behalf of all Contributors -all liability for damages, including direct, indirect, special, -incidental and consequential damages, such as lost profits;

- -

iii) states that any provisions which differ from this -Agreement are offered by that Contributor alone and not by any other -party; and

- -

iv) states that source code for the Program is available -from such Contributor, and informs licensees how to obtain it in a -reasonable manner on or through a medium customarily used for software -exchange.

- -

When the Program is made available in source code form:

- -

a) it must be made available under this Agreement; and

- -

b) a copy of this Agreement must be included with each -copy of the Program.

- -

Contributors may not remove or alter any copyright notices contained -within the Program.

- -

Each Contributor must identify itself as the originator of its -Contribution, if any, in a manner that reasonably allows subsequent -Recipients to identify the originator of the Contribution.

- -

4. COMMERCIAL DISTRIBUTION

- -

Commercial distributors of software may accept certain -responsibilities with respect to end users, business partners and the -like. While this license is intended to facilitate the commercial use of -the Program, the Contributor who includes the Program in a commercial -product offering should do so in a manner which does not create -potential liability for other Contributors. Therefore, if a Contributor -includes the Program in a commercial product offering, such Contributor -("Commercial Contributor") hereby agrees to defend and -indemnify every other Contributor ("Indemnified Contributor") -against any losses, damages and costs (collectively "Losses") -arising from claims, lawsuits and other legal actions brought by a third -party against the Indemnified Contributor to the extent caused by the -acts or omissions of such Commercial Contributor in connection with its -distribution of the Program in a commercial product offering. The -obligations in this section do not apply to any claims or Losses -relating to any actual or alleged intellectual property infringement. In -order to qualify, an Indemnified Contributor must: a) promptly notify -the Commercial Contributor in writing of such claim, and b) allow the -Commercial Contributor to control, and cooperate with the Commercial -Contributor in, the defense and any related settlement negotiations. The -Indemnified Contributor may participate in any such claim at its own -expense.

- -

For example, a Contributor might include the Program in a commercial -product offering, Product X. That Contributor is then a Commercial -Contributor. If that Commercial Contributor then makes performance -claims, or offers warranties related to Product X, those performance -claims and warranties are such Commercial Contributor's responsibility -alone. Under this section, the Commercial Contributor would have to -defend claims against the other Contributors related to those -performance claims and warranties, and if a court requires any other -Contributor to pay any damages as a result, the Commercial Contributor -must pay those damages.

- -

5. NO WARRANTY

- -

EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS -PROVIDED 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. Each Recipient is solely -responsible for determining the appropriateness of using and -distributing the Program and assumes all risks associated with its -exercise of rights under this Agreement , including but not limited to -the risks and costs of program errors, compliance with applicable laws, -damage to or loss of data, programs or equipment, and unavailability or -interruption of operations.

- -

6. DISCLAIMER OF LIABILITY

- -

EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT -NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING -WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR -DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED -HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

- -

7. GENERAL

- -

If any provision of this Agreement is invalid or unenforceable under -applicable law, it shall not affect the validity or enforceability of -the remainder of the terms of this Agreement, and without further action -by the parties hereto, such provision shall be reformed to the minimum -extent necessary to make such provision valid and enforceable.

- -

If Recipient institutes patent litigation against any entity -(including a cross-claim or counterclaim in a lawsuit) alleging that the -Program itself (excluding combinations of the Program with other -software or hardware) infringes such Recipient's patent(s), then such -Recipient's rights granted under Section 2(b) shall terminate as of the -date such litigation is filed.

- -

All Recipient's rights under this Agreement shall terminate if it -fails to comply with any of the material terms or conditions of this -Agreement and does not cure such failure in a reasonable period of time -after becoming aware of such noncompliance. If all Recipient's rights -under this Agreement terminate, Recipient agrees to cease use and -distribution of the Program as soon as reasonably practicable. However, -Recipient's obligations under this Agreement and any licenses granted by -Recipient relating to the Program shall continue and survive.

- -

Everyone is permitted to copy and distribute copies of this -Agreement, but in order to avoid inconsistency the Agreement is -copyrighted and may only be modified in the following manner. The -Agreement Steward reserves the right to publish new versions (including -revisions) of this Agreement from time to time. No one other than the -Agreement Steward has the right to modify this Agreement. The Eclipse -Foundation is the initial Agreement Steward. The Eclipse Foundation may -assign the responsibility to serve as the Agreement Steward to a -suitable separate entity. Each new version of the Agreement will be -given a distinguishing version number. The Program (including -Contributions) may always be distributed subject to the version of the -Agreement under which it was received. In addition, after a new version -of the Agreement is published, Contributor may elect to distribute the -Program (including its Contributions) under the new version. Except as -expressly stated in Sections 2(a) and 2(b) above, Recipient receives no -rights or licenses to the intellectual property of any Contributor under -this Agreement, whether expressly, by implication, estoppel or -otherwise. All rights in the Program not expressly granted under this -Agreement are reserved.

- -

This Agreement is governed by the laws of the State of New York and -the intellectual property laws of the United States of America. No party -to this Agreement will bring a legal action under this Agreement more -than one year after the cause of action arose. Each party waives its -rights to a jury trial in any resulting litigation.

- - - - diff --git a/maven-resolver-api/pom.xml b/maven-resolver-api/pom.xml new file mode 100644 index 000000000..0449970bc --- /dev/null +++ b/maven-resolver-api/pom.xml @@ -0,0 +1,51 @@ + + + + + + 4.0.0 + + + org.apache.maven.resolver + maven-resolver + 1.2.0-SNAPSHOT + + + maven-resolver-api + + Maven Artifact Resolver API + + The application programming interface for the repository system. + + + + + junit + junit + test + + + org.hamcrest + hamcrest-core + test + + + diff --git a/aether-api/src/main/java/org/eclipse/aether/AbstractForwardingRepositorySystemSession.java b/maven-resolver-api/src/main/java/org/eclipse/aether/AbstractForwardingRepositorySystemSession.java similarity index 85% rename from aether-api/src/main/java/org/eclipse/aether/AbstractForwardingRepositorySystemSession.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/AbstractForwardingRepositorySystemSession.java index 590ad28e0..20df43126 100644 --- a/aether-api/src/main/java/org/eclipse/aether/AbstractForwardingRepositorySystemSession.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/AbstractForwardingRepositorySystemSession.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.eclipse.aether.artifact.ArtifactTypeRegistry; diff --git a/aether-api/src/main/java/org/eclipse/aether/AbstractRepositoryListener.java b/maven-resolver-api/src/main/java/org/eclipse/aether/AbstractRepositoryListener.java similarity index 67% rename from aether-api/src/main/java/org/eclipse/aether/AbstractRepositoryListener.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/AbstractRepositoryListener.java index eaaffc198..f42d15e3d 100644 --- a/aether-api/src/main/java/org/eclipse/aether/AbstractRepositoryListener.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/AbstractRepositoryListener.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT 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 skeleton implementation for custom repository listeners. The callback methods in this class do nothing. */ diff --git a/aether-api/src/main/java/org/eclipse/aether/ConfigurationProperties.java b/maven-resolver-api/src/main/java/org/eclipse/aether/ConfigurationProperties.java similarity index 73% rename from aether-api/src/main/java/org/eclipse/aether/ConfigurationProperties.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/ConfigurationProperties.java index 16c483e8d..b96a75400 100644 --- a/aether-api/src/main/java/org/eclipse/aether/ConfigurationProperties.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/ConfigurationProperties.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + /** * The keys and defaults for common configuration properties. * @@ -122,6 +131,28 @@ public final class ConfigurationProperties */ public static final String DEFAULT_HTTP_CREDENTIAL_ENCODING = "ISO-8859-1"; + /** + * An option indicating whether authentication configured for a HTTP repository should also be used with any host + * that the original server might redirect requests to. Unless enabled, credentials are only exchanged with the + * original host from the repository URL and not supplied to different hosts encountered during redirects. The + * option value can either be a boolean flag or a comma-separated list of host names denoting the whitelist of + * original hosts whose redirects can be trusted and should use the configured authentication no matter the + * destination host(s). Alternatively, the suffix {@code .} can be appended to this configuration key to + * control the behavior for a specific repository id. + * + * @see #DEFAULT_HTTP_REDIRECTED_AUTHENTICATION + * @since 1.1.0 + */ + public static final String HTTP_REDIRECTED_AUTHENTICATION = PREFIX_CONNECTOR + "http.redirectedAuthentication"; + + /** + * The default handling of authentication during HTTP redirects if {@link #HTTP_REDIRECTED_AUTHENTICATION} isn't + * set. + * + * @since 1.1.0 + */ + public static final String DEFAULT_HTTP_REDIRECTED_AUTHENTICATION = "false"; + /** * A flag indicating whether checksums which are retrieved during checksum validation should be persisted in the * local filesystem next to the file they provide the checksum for. diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/DefaultRepositoryCache.java b/maven-resolver-api/src/main/java/org/eclipse/aether/DefaultRepositoryCache.java new file mode 100644 index 000000000..b645f43f5 --- /dev/null +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/DefaultRepositoryCache.java @@ -0,0 +1,52 @@ +package org.eclipse.aether; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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 java.util.concurrent.ConcurrentHashMap; + +/** + * A simplistic repository cache backed by a thread-safe map. The simplistic nature of this cache makes it only suitable + * for use with short-lived repository system sessions where pruning of cache data is not required. + */ +public final class DefaultRepositoryCache + implements RepositoryCache +{ + + private final Map cache = new ConcurrentHashMap( 256 ); + + public Object get( RepositorySystemSession session, Object key ) + { + return cache.get( key ); + } + + public void put( RepositorySystemSession session, Object key, Object data ) + { + if ( data != null ) + { + cache.put( key, data ); + } + else + { + cache.remove( key ); + } + } + +} diff --git a/aether-api/src/main/java/org/eclipse/aether/DefaultRepositorySystemSession.java b/maven-resolver-api/src/main/java/org/eclipse/aether/DefaultRepositorySystemSession.java similarity index 93% rename from aether-api/src/main/java/org/eclipse/aether/DefaultRepositorySystemSession.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/DefaultRepositorySystemSession.java index 194a6618f..93ebacac2 100644 --- a/aether-api/src/main/java/org/eclipse/aether/DefaultRepositorySystemSession.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/DefaultRepositorySystemSession.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Map; @@ -36,10 +45,12 @@ import org.eclipse.aether.transfer.TransferListener; /** - * A simple repository system session. Note: This class is not thread-safe. It is assumed that the mutators get - * only called during an initialization phase and that the session itself is not changed when being used by the - * repository system. It is recommended to call {@link #setReadOnly()} once the session has been fully initialized to - * prevent accidental manipulation of it afterwards. + * A simple repository system session. + *

+ * Note: This class is not thread-safe. It is assumed that the mutators get only called during an + * initialization phase and that the session itself is not changed once initialized and being used by the repository + * system. It is recommended to call {@link #setReadOnly()} once the session has been fully initialized to prevent + * accidental manipulation of it afterwards. */ public final class DefaultRepositorySystemSession implements RepositorySystemSession @@ -123,7 +134,9 @@ public DefaultRepositorySystemSession() /** * Creates a shallow copy of the specified session. Actually, the copy is not completely shallow, all maps holding - * properties are copied as well. In other words, mutating the new session has no effect on the original session. + * system/user/config properties are copied as well. In other words, invoking any mutator on the new session itself + * has no effect on the original session. Other mutable objects like the session data and cache (if any) are not + * copied and will be shared with the original session unless reconfigured. * * @param session The session to copy, must not be {@code null}. */ @@ -395,6 +408,7 @@ public Map getSystemProperties() /** * Sets the system properties to use, e.g. for processing of artifact descriptors. System properties are usually * collected from the runtime environment like {@link System#getProperties()} and environment variables. + *

* Note: System properties are of type {@code Map} and any key-value pair in the input map * that doesn't match this type will be silently ignored. * @@ -438,8 +452,10 @@ public Map getUserProperties() /** * Sets the user properties to use, e.g. for processing of artifact descriptors. User properties are similar to * system properties but are set on the discretion of the user and hence are considered of higher priority than - * system properties. Note: User properties are of type {@code Map} and any key-value pair - * in the input map that doesn't match this type will be silently ignored. + * system properties in case of conflicts. + *

+ * Note: User properties are of type {@code Map} and any key-value pair in the input map + * that doesn't match this type will be silently ignored. * * @param userProperties The user properties, may be {@code null} or empty if none. * @return This session for chaining, never {@code null}. @@ -480,9 +496,10 @@ public Map getConfigProperties() /** * Sets the configuration properties used to tweak internal aspects of the repository system (e.g. thread pooling, - * connector-specific behavior, etc.) Note: Configuration properties are of type - * {@code Map} and any key-value pair in the input map that doesn't match this type will be silently - * ignored. + * connector-specific behavior, etc.). + *

+ * Note: Configuration properties are of type {@code Map} and any key-value pair in the + * input map that doesn't match this type will be silently ignored. * * @param configProperties The configuration properties, may be {@code null} or empty if none. * @return This session for chaining, never {@code null}. diff --git a/aether-api/src/main/java/org/eclipse/aether/DefaultSessionData.java b/maven-resolver-api/src/main/java/org/eclipse/aether/DefaultSessionData.java similarity index 61% rename from aether-api/src/main/java/org/eclipse/aether/DefaultSessionData.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/DefaultSessionData.java index 90f11274a..e78df3a42 100644 --- a/aether-api/src/main/java/org/eclipse/aether/DefaultSessionData.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/DefaultSessionData.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; @@ -61,6 +70,10 @@ public boolean set( Object key, Object oldValue, Object newValue ) } else { + if ( oldValue == null ) + { + return !data.containsKey( key ); + } return data.remove( key, oldValue ); } } diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/RepositoryCache.java b/maven-resolver-api/src/main/java/org/eclipse/aether/RepositoryCache.java new file mode 100644 index 000000000..6f9f1144f --- /dev/null +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/RepositoryCache.java @@ -0,0 +1,59 @@ +package org.eclipse.aether; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/** + * Caches auxiliary data used during repository access like already processed metadata. The data in the cache is meant + * for exclusive consumption by the repository system and is opaque to the cache implementation. Note: + * Actual cache implementations must be thread-safe. + * + * @see RepositorySystemSession#getCache() + */ +public interface RepositoryCache +{ + + /** + * Puts the specified data into the cache. It is entirely up to the cache implementation how long this data will be + * kept before being purged, i.e. callers must not make any assumptions about the lifetime of cached data. + *

+ * Warning: The cache will directly save the provided reference. If the cached data is mutable, i.e. could + * be modified after being put into the cache, the caller is responsible for creating a copy of the original data + * and store the copy in the cache. + * + * @param session The repository session during which the cache is accessed, must not be {@code null}. + * @param key The key to use for lookup of the data, must not be {@code null}. + * @param data The data to store in the cache, may be {@code null}. + */ + void put( RepositorySystemSession session, Object key, Object data ); + + /** + * Gets the specified data from the cache. + *

+ * Warning: The cache will directly return the saved reference. If the cached data is to be modified after + * its retrieval, the caller is responsible to create a copy of the returned data and use this instead of the cache + * record. + * + * @param session The repository session during which the cache is accessed, must not be {@code null}. + * @param key The key to use for lookup of the data, must not be {@code null}. + * @return The requested data or {@code null} if none was present in the cache. + */ + Object get( RepositorySystemSession session, Object key ); + +} diff --git a/aether-api/src/main/java/org/eclipse/aether/RepositoryEvent.java b/maven-resolver-api/src/main/java/org/eclipse/aether/RepositoryEvent.java similarity index 93% rename from aether-api/src/main/java/org/eclipse/aether/RepositoryEvent.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/RepositoryEvent.java index 2abd80009..33816bad3 100644 --- a/aether-api/src/main/java/org/eclipse/aether/RepositoryEvent.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/RepositoryEvent.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Collections; import java.util.List; diff --git a/aether-api/src/main/java/org/eclipse/aether/RepositoryException.java b/maven-resolver-api/src/main/java/org/eclipse/aether/RepositoryException.java similarity index 59% rename from aether-api/src/main/java/org/eclipse/aether/RepositoryException.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/RepositoryException.java index bc66ead37..83a6cac10 100644 --- a/aether-api/src/main/java/org/eclipse/aether/RepositoryException.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/RepositoryException.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + /** * The base class for exceptions thrown by the repository system. Note: Unless otherwise noted, instances of * this class and its subclasses will not persist fields carrying extended error information during serialization. @@ -41,6 +50,9 @@ public RepositoryException( String message, Throwable cause ) /** * @noreference This method is not intended to be used by clients. + * @param prefix A message prefix for the cause. + * @param cause The error cause. + * @return The error message for the cause. */ protected static String getMessage( String prefix, Throwable cause ) { diff --git a/aether-api/src/main/java/org/eclipse/aether/RepositoryListener.java b/maven-resolver-api/src/main/java/org/eclipse/aether/RepositoryListener.java similarity index 92% rename from aether-api/src/main/java/org/eclipse/aether/RepositoryListener.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/RepositoryListener.java index 5f8392368..d65463059 100644 --- a/aether-api/src/main/java/org/eclipse/aether/RepositoryListener.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/RepositoryListener.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT 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 listener being notified of events from the repository system. In general, the system sends events upon termination * of an operation like {@link #artifactResolved(RepositoryEvent)} regardless whether it succeeded or failed so diff --git a/aether-api/src/main/java/org/eclipse/aether/RepositorySystem.java b/maven-resolver-api/src/main/java/org/eclipse/aether/RepositorySystem.java similarity index 94% rename from aether-api/src/main/java/org/eclipse/aether/RepositorySystem.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/RepositorySystem.java index debdb7d19..8706f891a 100644 --- a/aether-api/src/main/java/org/eclipse/aether/RepositorySystem.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/RepositorySystem.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import java.util.Collection; import java.util.List; diff --git a/aether-api/src/main/java/org/eclipse/aether/RepositorySystemSession.java b/maven-resolver-api/src/main/java/org/eclipse/aether/RepositorySystemSession.java similarity index 92% rename from aether-api/src/main/java/org/eclipse/aether/RepositorySystemSession.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/RepositorySystemSession.java index 96f51c156..888f29cf0 100644 --- a/aether-api/src/main/java/org/eclipse/aether/RepositorySystemSession.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/RepositorySystemSession.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.eclipse.aether.artifact.ArtifactTypeRegistry; diff --git a/aether-api/src/main/java/org/eclipse/aether/RequestTrace.java b/maven-resolver-api/src/main/java/org/eclipse/aether/RequestTrace.java similarity index 79% rename from aether-api/src/main/java/org/eclipse/aether/RequestTrace.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/RequestTrace.java index c6afa8e81..86aaa78b1 100644 --- a/aether-api/src/main/java/org/eclipse/aether/RequestTrace.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/RequestTrace.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT 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 trace of nested requests that are performed by the repository system. This trace information can be used to * correlate repository events with higher level operations in the application code that eventually caused the events. A diff --git a/aether-api/src/main/java/org/eclipse/aether/SessionData.java b/maven-resolver-api/src/main/java/org/eclipse/aether/SessionData.java similarity index 54% rename from aether-api/src/main/java/org/eclipse/aether/SessionData.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/SessionData.java index a594d4137..b6efeac6d 100644 --- a/aether-api/src/main/java/org/eclipse/aether/SessionData.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/SessionData.java @@ -1,21 +1,32 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT 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 container for data that is specific to a repository system session. Both components within the repository system - * and clients of the system may use this storage to associate arbitrary data with a session. Unlike a cache, this - * session data is not subject to purging. For this same reason, session data should also not be abused as a cache (i.e. - * for storing values that can be re-calculated) to avoid memory exhaustion. Note: Actual - * implementations must be thread-safe. + * and clients of the system may use this storage to associate arbitrary data with a session. + *

+ * Unlike a cache, this session data is not subject to purging. For this same reason, session data should also not be + * abused as a cache (i.e. for storing values that can be re-calculated) to avoid memory exhaustion. + *

+ * Note: Actual implementations must be thread-safe. * * @see RepositorySystemSession#getData() * @noimplement This interface is not intended to be implemented by clients. @@ -39,8 +50,8 @@ public interface SessionData * @param key The key under which to store the session data, must not be {@code null}. * @param oldValue The expected data currently associated with the key, may be {@code null}. * @param newValue The data to associate with the key, may be {@code null} to remove the mapping. - * @return {@code true} if the key mapping was updated to the specified value, {@code false} if the current key - * mapping didn't match the expected value and was not updated. + * @return {@code true} if the key mapping was successfully updated from the old value to the new value, + * {@code false} if the current key mapping didn't match the expected value and was not updated. */ boolean set( Object key, Object oldValue, Object newValue ); diff --git a/aether-api/src/main/java/org/eclipse/aether/SyncContext.java b/maven-resolver-api/src/main/java/org/eclipse/aether/SyncContext.java similarity index 75% rename from aether-api/src/main/java/org/eclipse/aether/SyncContext.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/SyncContext.java index a05d512fd..2d751c047 100644 --- a/aether-api/src/main/java/org/eclipse/aether/SyncContext.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/SyncContext.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Closeable; import java.util.Collection; diff --git a/aether-api/src/main/java/org/eclipse/aether/artifact/AbstractArtifact.java b/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/AbstractArtifact.java similarity index 88% rename from aether-api/src/main/java/org/eclipse/aether/artifact/AbstractArtifact.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/artifact/AbstractArtifact.java index 2944ff889..d89260b79 100644 --- a/aether-api/src/main/java/org/eclipse/aether/artifact/AbstractArtifact.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/AbstractArtifact.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.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.util.Collections; import java.util.HashMap; diff --git a/aether-api/src/main/java/org/eclipse/aether/artifact/Artifact.java b/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/Artifact.java similarity index 84% rename from aether-api/src/main/java/org/eclipse/aether/artifact/Artifact.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/artifact/Artifact.java index 5eef695d0..632324327 100644 --- a/aether-api/src/main/java/org/eclipse/aether/artifact/Artifact.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/Artifact.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.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.util.Map; diff --git a/aether-api/src/main/java/org/eclipse/aether/artifact/ArtifactProperties.java b/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/ArtifactProperties.java similarity index 70% rename from aether-api/src/main/java/org/eclipse/aether/artifact/ArtifactProperties.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/artifact/ArtifactProperties.java index 7fbea0447..11080868b 100644 --- a/aether-api/src/main/java/org/eclipse/aether/artifact/ArtifactProperties.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/ArtifactProperties.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.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. + */ + /** * The keys for common properties of artifacts. * diff --git a/aether-api/src/main/java/org/eclipse/aether/artifact/ArtifactType.java b/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/ArtifactType.java similarity index 66% rename from aether-api/src/main/java/org/eclipse/aether/artifact/ArtifactType.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/artifact/ArtifactType.java index 174c3c5a5..5f8721743 100644 --- a/aether-api/src/main/java/org/eclipse/aether/artifact/ArtifactType.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/ArtifactType.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.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.Map; /** diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/ArtifactTypeRegistry.java b/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/ArtifactTypeRegistry.java new file mode 100644 index 000000000..f3791733e --- /dev/null +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/ArtifactTypeRegistry.java @@ -0,0 +1,38 @@ +package org.eclipse.aether.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. + */ + +/** + * A registry of known artifact types. + * + * @see org.eclipse.aether.RepositorySystemSession#getArtifactTypeRegistry() + */ +public interface ArtifactTypeRegistry +{ + + /** + * Gets the artifact type with the specified identifier. + * + * @param typeId The identifier of the type, must not be {@code null}. + * @return The artifact type or {@code null} if no type with the requested identifier exists. + */ + ArtifactType get( String typeId ); + +} diff --git a/aether-api/src/main/java/org/eclipse/aether/artifact/DefaultArtifact.java b/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/DefaultArtifact.java similarity index 92% rename from aether-api/src/main/java/org/eclipse/aether/artifact/DefaultArtifact.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/artifact/DefaultArtifact.java index 997103419..786af74ca 100644 --- a/aether-api/src/main/java/org/eclipse/aether/artifact/DefaultArtifact.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/DefaultArtifact.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.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.util.Collections; import java.util.HashMap; @@ -48,7 +57,7 @@ public final class DefaultArtifact */ public DefaultArtifact( String coords ) { - this( coords, Collections. emptyMap() ); + this( coords, Collections.emptyMap() ); } /** diff --git a/aether-api/src/main/java/org/eclipse/aether/artifact/DefaultArtifactType.java b/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/DefaultArtifactType.java similarity index 86% rename from aether-api/src/main/java/org/eclipse/aether/artifact/DefaultArtifactType.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/artifact/DefaultArtifactType.java index b30cd12ef..c0d2ad879 100644 --- a/aether-api/src/main/java/org/eclipse/aether/artifact/DefaultArtifactType.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/DefaultArtifactType.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.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.Collections; import java.util.HashMap; import java.util.Map; diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/package-info.java b/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/package-info.java new file mode 100644 index 000000000..1cbfdfdcb --- /dev/null +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/package-info.java @@ -0,0 +1,24 @@ +// CHECKSTYLE_OFF: RegexpHeader +/** + * The definition of an artifact, that is the primary entity managed by the repository system. + */ +package org.eclipse.aether.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. + */ diff --git a/aether-api/src/main/java/org/eclipse/aether/collection/CollectRequest.java b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/CollectRequest.java similarity index 93% rename from aether-api/src/main/java/org/eclipse/aether/collection/CollectRequest.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/collection/CollectRequest.java index 856838513..d9c252733 100644 --- a/aether-api/src/main/java/org/eclipse/aether/collection/CollectRequest.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/CollectRequest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.collection; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Collections; import java.util.List; diff --git a/aether-api/src/main/java/org/eclipse/aether/collection/CollectResult.java b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/CollectResult.java similarity index 81% rename from aether-api/src/main/java/org/eclipse/aether/collection/CollectResult.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/collection/CollectResult.java index 4975190b8..dd9f02e4b 100644 --- a/aether-api/src/main/java/org/eclipse/aether/collection/CollectResult.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/CollectResult.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.collection; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Collections; import java.util.List; diff --git a/aether-api/src/main/java/org/eclipse/aether/collection/DependencyCollectionContext.java b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencyCollectionContext.java similarity index 73% rename from aether-api/src/main/java/org/eclipse/aether/collection/DependencyCollectionContext.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencyCollectionContext.java index 3b8fbc204..671bd2ac1 100644 --- a/aether-api/src/main/java/org/eclipse/aether/collection/DependencyCollectionContext.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencyCollectionContext.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.collection; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.eclipse.aether.RepositorySystemSession; diff --git a/aether-api/src/main/java/org/eclipse/aether/collection/DependencyCollectionException.java b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencyCollectionException.java similarity index 77% rename from aether-api/src/main/java/org/eclipse/aether/collection/DependencyCollectionException.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencyCollectionException.java index 0d26674af..8a04d7952 100644 --- a/aether-api/src/main/java/org/eclipse/aether/collection/DependencyCollectionException.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencyCollectionException.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.collection; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.RepositoryException; /** diff --git a/aether-api/src/main/java/org/eclipse/aether/collection/DependencyGraphTransformationContext.java b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencyGraphTransformationContext.java similarity index 61% rename from aether-api/src/main/java/org/eclipse/aether/collection/DependencyGraphTransformationContext.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencyGraphTransformationContext.java index d3980da74..ba6647472 100644 --- a/aether-api/src/main/java/org/eclipse/aether/collection/DependencyGraphTransformationContext.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencyGraphTransformationContext.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.collection; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.RepositorySystemSession; /** diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencyGraphTransformer.java b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencyGraphTransformer.java new file mode 100644 index 000000000..c47250087 --- /dev/null +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencyGraphTransformer.java @@ -0,0 +1,51 @@ +package org.eclipse.aether.collection; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import org.eclipse.aether.RepositoryException; +import org.eclipse.aether.graph.DependencyNode; + +/** + * Transforms a given dependency graph. + *

+ * Note: Implementations must be stateless. + *

+ * Warning: Dependency graphs may generally contain cycles. As such a graph transformer that cannot assume for + * sure that cycles have already been eliminated must gracefully handle cyclic graphs, e.g. guard against infinite + * recursion. + * + * @see org.eclipse.aether.RepositorySystemSession#getDependencyGraphTransformer() + */ +public interface DependencyGraphTransformer +{ + + /** + * Transforms the dependency graph denoted by the specified root node. The transformer may directly change the + * provided input graph or create a new graph, the former is recommended for performance reasons. + * + * @param node The root node of the (possibly cyclic!) graph to transform, must not be {@code null}. + * @param context The graph transformation context, must not be {@code null}. + * @return The result graph of the transformation, never {@code null}. + * @throws RepositoryException If the transformation failed. + */ + DependencyNode transformGraph( DependencyNode node, DependencyGraphTransformationContext context ) + throws RepositoryException; + +} diff --git a/aether-api/src/main/java/org/eclipse/aether/collection/DependencyManagement.java b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencyManagement.java similarity index 86% rename from aether-api/src/main/java/org/eclipse/aether/collection/DependencyManagement.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencyManagement.java index f0aac7345..054bfe01b 100644 --- a/aether-api/src/main/java/org/eclipse/aether/collection/DependencyManagement.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencyManagement.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.collection; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import java.util.Collection; import java.util.Map; diff --git a/aether-api/src/main/java/org/eclipse/aether/collection/DependencyManager.java b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencyManager.java similarity index 54% rename from aether-api/src/main/java/org/eclipse/aether/collection/DependencyManager.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencyManager.java index 3ee6b0e00..993e388b1 100644 --- a/aether-api/src/main/java/org/eclipse/aether/collection/DependencyManager.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencyManager.java @@ -1,21 +1,33 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.collection; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.graph.Dependency; /** - * Applies dependency management to the dependencies of a dependency node. Implementations must be stateless. - * Note: This hook is called from a hot spot and therefore implementations should pay attention to performance. - * Among others, implementations should provide a semantic {@link Object#equals(Object) equals()} method. + * Applies dependency management to the dependencies of a dependency node. + *

+ * Note: Implementations must be stateless. + *

+ * Warning: This hook is called from a hot spot and therefore implementations should pay attention to + * performance. Among others, implementations should provide a semantic {@link Object#equals(Object) equals()} method. * * @see org.eclipse.aether.RepositorySystemSession#getDependencyManager() * @see org.eclipse.aether.RepositorySystem#collectDependencies(org.eclipse.aether.RepositorySystemSession, diff --git a/aether-api/src/main/java/org/eclipse/aether/collection/DependencySelector.java b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencySelector.java similarity index 55% rename from aether-api/src/main/java/org/eclipse/aether/collection/DependencySelector.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencySelector.java index a555c2f3b..b257ffa43 100644 --- a/aether-api/src/main/java/org/eclipse/aether/collection/DependencySelector.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencySelector.java @@ -1,21 +1,33 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.collection; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.graph.Dependency; /** - * Decides what dependencies to include in the dependency graph. Implementations must be stateless. Note: This - * hook is called from a hot spot and therefore implementations should pay attention to performance. Among others, - * implementations should provide a semantic {@link Object#equals(Object) equals()} method. + * Decides what dependencies to include in the dependency graph. + *

+ * Note: Implementations must be stateless. + *

+ * Warning: This hook is called from a hot spot and therefore implementations should pay attention to + * performance. Among others, implementations should provide a semantic {@link Object#equals(Object) equals()} method. * * @see org.eclipse.aether.RepositorySystemSession#getDependencySelector() * @see org.eclipse.aether.RepositorySystem#collectDependencies(org.eclipse.aether.RepositorySystemSession, diff --git a/aether-api/src/main/java/org/eclipse/aether/collection/DependencyTraverser.java b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencyTraverser.java similarity index 57% rename from aether-api/src/main/java/org/eclipse/aether/collection/DependencyTraverser.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencyTraverser.java index b237213d2..be1887bfd 100644 --- a/aether-api/src/main/java/org/eclipse/aether/collection/DependencyTraverser.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencyTraverser.java @@ -1,21 +1,33 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.collection; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.graph.Dependency; /** - * Decides whether the dependencies of a dependency node should be traversed as well. Implementations must be stateless. - * Note: This hook is called from a hot spot and therefore implementations should pay attention to performance. - * Among others, implementations should provide a semantic {@link Object#equals(Object) equals()} method. + * Decides whether the dependencies of a dependency node should be traversed as well. + *

+ * Note: Implementations must be stateless. + *

+ * Warning: This hook is called from a hot spot and therefore implementations should pay attention to + * performance. Among others, implementations should provide a semantic {@link Object#equals(Object) equals()} method. * * @see org.eclipse.aether.RepositorySystemSession#getDependencyTraverser() * @see org.eclipse.aether.RepositorySystem#collectDependencies(org.eclipse.aether.RepositorySystemSession, diff --git a/aether-api/src/main/java/org/eclipse/aether/collection/UnsolvableVersionConflictException.java b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/UnsolvableVersionConflictException.java similarity index 82% rename from aether-api/src/main/java/org/eclipse/aether/collection/UnsolvableVersionConflictException.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/collection/UnsolvableVersionConflictException.java index 8db55902b..54a700425 100644 --- a/aether-api/src/main/java/org/eclipse/aether/collection/UnsolvableVersionConflictException.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/UnsolvableVersionConflictException.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.collection; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import java.util.Collection; import java.util.Collections; import java.util.Iterator; diff --git a/aether-api/src/main/java/org/eclipse/aether/collection/VersionFilter.java b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/VersionFilter.java similarity index 77% rename from aether-api/src/main/java/org/eclipse/aether/collection/VersionFilter.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/collection/VersionFilter.java index 7d8b7c8f3..fb36747f3 100644 --- a/aether-api/src/main/java/org/eclipse/aether/collection/VersionFilter.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/VersionFilter.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.collection; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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 java.util.List; @@ -22,10 +31,13 @@ import org.eclipse.aether.version.VersionConstraint; /** - * Decides which versions matching a version range should actually be considered for the dependency graph. - * Implementations must be stateless. Note: This hook is called from a hot spot and therefore implementations - * should pay attention to performance. Among others, implementations should provide a semantic - * {@link Object#equals(Object) equals()} method. + * Decides which versions matching a version range should actually be considered for the dependency graph. The version + * filter is not invoked for dependencies that do not declare a version range but a single version. + *

+ * Note: Implementations must be stateless. + *

+ * Warning: This hook is called from a hot spot and therefore implementations should pay attention to + * performance. Among others, implementations should provide a semantic {@link Object#equals(Object) equals()} method. * * @see org.eclipse.aether.RepositorySystemSession#getVersionFilter() * @see org.eclipse.aether.RepositorySystem#collectDependencies(org.eclipse.aether.RepositorySystemSession, diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/collection/package-info.java b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/package-info.java new file mode 100644 index 000000000..6389baa37 --- /dev/null +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/package-info.java @@ -0,0 +1,25 @@ +// CHECKSTYLE_OFF: RegexpHeader +/** + * The types and extension points for collecting the transitive dependencies of an artifact and building a dependency + * graph. + */ +package org.eclipse.aether.collection; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ diff --git a/aether-api/src/main/java/org/eclipse/aether/deployment/DeployRequest.java b/maven-resolver-api/src/main/java/org/eclipse/aether/deployment/DeployRequest.java similarity index 85% rename from aether-api/src/main/java/org/eclipse/aether/deployment/DeployRequest.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/deployment/DeployRequest.java index a5372ddba..637f47da0 100644 --- a/aether-api/src/main/java/org/eclipse/aether/deployment/DeployRequest.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/deployment/DeployRequest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.deployment; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Collection; import java.util.Collections; diff --git a/aether-api/src/main/java/org/eclipse/aether/deployment/DeployResult.java b/maven-resolver-api/src/main/java/org/eclipse/aether/deployment/DeployResult.java similarity index 83% rename from aether-api/src/main/java/org/eclipse/aether/deployment/DeployResult.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/deployment/DeployResult.java index fcda3ca0c..f75705e40 100644 --- a/aether-api/src/main/java/org/eclipse/aether/deployment/DeployResult.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/deployment/DeployResult.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.deployment; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Collection; import java.util.Collections; diff --git a/aether-api/src/main/java/org/eclipse/aether/deployment/DeploymentException.java b/maven-resolver-api/src/main/java/org/eclipse/aether/deployment/DeploymentException.java similarity index 50% rename from aether-api/src/main/java/org/eclipse/aether/deployment/DeploymentException.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/deployment/DeploymentException.java index f631530f2..53252bafb 100644 --- a/aether-api/src/main/java/org/eclipse/aether/deployment/DeploymentException.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/deployment/DeploymentException.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.deployment; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.RepositoryException; /** diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/deployment/package-info.java b/maven-resolver-api/src/main/java/org/eclipse/aether/deployment/package-info.java new file mode 100644 index 000000000..3ceeb2b59 --- /dev/null +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/deployment/package-info.java @@ -0,0 +1,24 @@ +// CHECKSTYLE_OFF: RegexpHeader +/** + * The types supporting the publishing of artifacts to a remote repository. + */ +package org.eclipse.aether.deployment; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ diff --git a/aether-api/src/main/java/org/eclipse/aether/graph/DefaultDependencyNode.java b/maven-resolver-api/src/main/java/org/eclipse/aether/graph/DefaultDependencyNode.java similarity index 84% rename from aether-api/src/main/java/org/eclipse/aether/graph/DefaultDependencyNode.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/graph/DefaultDependencyNode.java index c702d2398..a2ffd0c8f 100644 --- a/aether-api/src/main/java/org/eclipse/aether/graph/DefaultDependencyNode.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/graph/DefaultDependencyNode.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.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 java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -29,6 +38,8 @@ public final class DefaultDependencyNode implements DependencyNode { + private DependencyNode parent; + private List children; private Dependency dependency; @@ -52,30 +63,26 @@ public final class DefaultDependencyNode private Map data; /** - * Creates a new node with the specified dependency. - * + * Creates a new root node with the specified dependency. + * * @param dependency The dependency associated with this node, may be {@code null} for a root node. */ public DefaultDependencyNode( Dependency dependency ) { - this.dependency = dependency; - artifact = ( dependency != null ) ? dependency.getArtifact() : null; - children = new ArrayList( 0 ); - aliases = relocations = Collections.emptyList(); - repositories = Collections.emptyList(); - context = ""; - data = Collections.emptyMap(); + this( null, dependency ); } /** * Creates a new root node with the specified artifact as its label. Note that the new node has no dependency, i.e. * {@link #getDependency()} will return {@code null}. Put differently, the specified artifact will not be subject to * dependency collection/resolution. - * + * * @param artifact The artifact to use as label for this node, may be {@code null}. */ public DefaultDependencyNode( Artifact artifact ) { + super(); + this.parent = null; this.artifact = artifact; children = new ArrayList( 0 ); aliases = relocations = Collections.emptyList(); @@ -87,11 +94,13 @@ public DefaultDependencyNode( Artifact artifact ) /** * Creates a mostly shallow clone of the specified node. The new node has its own copy of any custom data and * initially no children. - * + * * @param node The node to copy, must not be {@code null}. */ public DefaultDependencyNode( DependencyNode node ) { + super(); + parent = node.getParent(); dependency = node.getDependency(); artifact = node.getArtifact(); children = new ArrayList( 0 ); @@ -106,6 +115,37 @@ public DefaultDependencyNode( DependencyNode node ) setData( data.isEmpty() ? null : new HashMap( data ) ); } + /** + * Creates a new node with the specified dependency. + * + * @param parent The parent node of the node or {@code null}. + * @param dependency The dependency associated with this node, may be {@code null} for a root node. + * + * @since 1.2 + */ + public DefaultDependencyNode( DependencyNode parent, Dependency dependency ) + { + super(); + this.parent = parent; + this.dependency = dependency; + artifact = ( dependency != null ) ? dependency.getArtifact() : null; + children = new ArrayList( 0 ); + aliases = relocations = Collections.emptyList(); + repositories = Collections.emptyList(); + context = ""; + data = Collections.emptyMap(); + } + + public long getDepth() + { + return this.getParent() != null ? this.getParent().getDepth() + 1L : 0L; + } + + public DependencyNode getParent() + { + return this.parent; + } + public List getChildren() { return children; @@ -150,7 +190,7 @@ public List getRelocations() /** * Sets the sequence of relocations that was followed to resolve this dependency's artifact. - * + * * @param relocations The sequence of relocations, may be {@code null}. */ public void setRelocations( List relocations ) @@ -172,7 +212,7 @@ public Collection getAliases() /** * Sets the known aliases for this dependency's artifact. - * + * * @param aliases The known aliases, may be {@code null}. */ public void setAliases( Collection aliases ) @@ -194,7 +234,7 @@ public VersionConstraint getVersionConstraint() /** * Sets the version constraint that was parsed from the dependency's version declaration. - * + * * @param versionConstraint The version constraint for this node, may be {@code null}. */ public void setVersionConstraint( VersionConstraint versionConstraint ) @@ -209,7 +249,7 @@ public Version getVersion() /** * Sets the version that was selected for the dependency's target artifact. - * + * * @param version The parsed version, may be {@code null}. */ public void setVersion( Version version ) @@ -242,9 +282,9 @@ public int getManagedBits() /** * Sets a bit field indicating which attributes of this node were subject to dependency management. - * + * * @param managedBits The bit field indicating the managed attributes or {@code 0} if dependency management wasn't - * applied. + * applied. */ public void setManagedBits( int managedBits ) { @@ -258,7 +298,7 @@ public List getRepositories() /** * Sets the remote repositories from which this node's artifact shall be resolved. - * + * * @param repositories The remote repositories to use for artifact resolution, may be {@code null}. */ public void setRepositories( List repositories ) diff --git a/aether-api/src/main/java/org/eclipse/aether/graph/Dependency.java b/maven-resolver-api/src/main/java/org/eclipse/aether/graph/Dependency.java similarity index 92% rename from aether-api/src/main/java/org/eclipse/aether/graph/Dependency.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/graph/Dependency.java index 72ea0f6d8..b9e7cb4fa 100644 --- a/aether-api/src/main/java/org/eclipse/aether/graph/Dependency.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/graph/Dependency.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.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 java.util.AbstractSet; import java.util.Collection; import java.util.Collections; diff --git a/aether-api/src/main/java/org/eclipse/aether/graph/DependencyCycle.java b/maven-resolver-api/src/main/java/org/eclipse/aether/graph/DependencyCycle.java similarity index 62% rename from aether-api/src/main/java/org/eclipse/aether/graph/DependencyCycle.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/graph/DependencyCycle.java index 68f9a3230..1076ab81b 100644 --- a/aether-api/src/main/java/org/eclipse/aether/graph/DependencyCycle.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/graph/DependencyCycle.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.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 java.util.List; /** diff --git a/aether-api/src/main/java/org/eclipse/aether/graph/DependencyFilter.java b/maven-resolver-api/src/main/java/org/eclipse/aether/graph/DependencyFilter.java similarity index 53% rename from aether-api/src/main/java/org/eclipse/aether/graph/DependencyFilter.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/graph/DependencyFilter.java index c776ddc19..41776ff98 100644 --- a/aether-api/src/main/java/org/eclipse/aether/graph/DependencyFilter.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/graph/DependencyFilter.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.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 java.util.List; /** diff --git a/aether-api/src/main/java/org/eclipse/aether/graph/DependencyNode.java b/maven-resolver-api/src/main/java/org/eclipse/aether/graph/DependencyNode.java similarity index 85% rename from aether-api/src/main/java/org/eclipse/aether/graph/DependencyNode.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/graph/DependencyNode.java index 4e345979f..da30124b5 100644 --- a/aether-api/src/main/java/org/eclipse/aether/graph/DependencyNode.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/graph/DependencyNode.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.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 java.util.Collection; import java.util.List; import java.util.Map; @@ -25,7 +34,7 @@ * discover multiple paths leading to the same node instance unless the input graph is known to be a duplicate-free * tree. Note: Unless otherwise noted, implementation classes are not thread-safe and dependency nodes should * not be mutated by concurrent threads. - * + * * @noimplement This interface is not intended to be implemented by clients. * @noextend This interface is not intended to be extended by clients. */ @@ -34,52 +43,70 @@ public interface DependencyNode /** * A bit flag indicating the dependency version was subject to dependency management - * + * * @see #getManagedBits() */ int MANAGED_VERSION = 0x01; /** * A bit flag indicating the dependency scope was subject to dependency management - * + * * @see #getManagedBits() */ int MANAGED_SCOPE = 0x02; /** * A bit flag indicating the optional flag was subject to dependency management - * + * * @see #getManagedBits() */ int MANAGED_OPTIONAL = 0x04; /** * A bit flag indicating the artifact properties were subject to dependency management - * + * * @see #getManagedBits() */ int MANAGED_PROPERTIES = 0x08; /** * A bit flag indicating the exclusions were subject to dependency management - * + * * @see #getManagedBits() */ int MANAGED_EXCLUSIONS = 0x10; + /** + * Gets the depth of the node. + * + * @return The depth of the node. + * + * @since 1.2 + */ + long getDepth(); + + /** + * Gets the parent node of this node. + * + * @return The parent node of this node or {@code null}, if this node is the root of the graph. + * + * @since 1.2 + */ + DependencyNode getParent(); + /** * Gets the child nodes of this node. To conserve memory, dependency nodes with equal dependencies may share the * same child list instance. Hence clients mutating the child list need to be aware that these changes might affect * more than this node. Where this is not desired, the child list should be copied before mutation if the client * cannot be sure whether it might be shared with other nodes in the graph. - * + * * @return The child nodes of this node, never {@code null}. */ List getChildren(); /** * Sets the child nodes of this node. - * + * * @param children The child nodes, may be {@code null} */ void setChildren( List children ); @@ -88,7 +115,7 @@ public interface DependencyNode * Gets the dependency associated with this node. Note: For dependency graphs that have been constructed * without a root dependency, this method will yield {@code null} when invoked on the graph's root node. The root * node of such graphs may however still have a label as returned by {@link #getArtifact()}. - * + * * @return The dependency or {@code null} if none. */ Dependency getDependency(); @@ -97,7 +124,7 @@ public interface DependencyNode * Gets the artifact associated with this node. If this node is associated with a dependency, this is equivalent to * {@code getDependency().getArtifact()}. Otherwise the artifact merely provides a label for this node in which case * the artifact must not be subjected to dependency collection/resolution. - * + * * @return The associated artifact or {@code null} if none. */ Artifact getArtifact(); @@ -106,14 +133,14 @@ public interface DependencyNode * Updates the artifact of the dependency after resolution. The new artifact must have the same coordinates as the * original artifact. This method may only be invoked if this node actually has a dependency, i.e. if * {@link #getDependency()} is not null. - * + * * @param artifact The artifact satisfying the dependency, must not be {@code null}. */ void setArtifact( Artifact artifact ); /** * Gets the sequence of relocations that was followed to resolve the artifact referenced by the dependency. - * + * * @return The (read-only) sequence of relocations, never {@code null}. */ List getRelocations(); @@ -122,21 +149,21 @@ public interface DependencyNode * Gets the known aliases for this dependency's artifact. An alias can be used to mark a patched rebuild of some * other artifact as such, thereby allowing conflict resolution to consider the patched and the original artifact as * a conflict. - * + * * @return The (read-only) set of known aliases, never {@code null}. */ Collection getAliases(); /** * Gets the version constraint that was parsed from the dependency's version declaration. - * + * * @return The version constraint for this node or {@code null}. */ VersionConstraint getVersionConstraint(); /** * Gets the version that was selected for the dependency's target artifact. - * + * * @return The parsed version or {@code null}. */ Version getVersion(); @@ -144,7 +171,7 @@ public interface DependencyNode /** * Sets the scope of the dependency. This method may only be invoked if this node actually has a dependency, i.e. if * {@link #getDependency()} is not null. - * + * * @param scope The scope, may be {@code null}. */ void setScope( String scope ); @@ -152,14 +179,14 @@ public interface DependencyNode /** * Sets the optional flag of the dependency. This method may only be invoked if this node actually has a dependency, * i.e. if {@link #getDependency()} is not null. - * + * * @param optional The optional flag, may be {@code null}. */ void setOptional( Boolean optional ); /** * Gets a bit field indicating which attributes of this node were subject to dependency management. - * + * * @return A bit field containing any of the bits {@link #MANAGED_VERSION}, {@link #MANAGED_SCOPE}, * {@link #MANAGED_OPTIONAL}, {@link #MANAGED_PROPERTIES} and {@link #MANAGED_EXCLUSIONS} if the * corresponding attribute was set via dependency management. @@ -168,21 +195,21 @@ public interface DependencyNode /** * Gets the remote repositories from which this node's artifact shall be resolved. - * + * * @return The (read-only) list of remote repositories to use for artifact resolution, never {@code null}. */ List getRepositories(); /** * Gets the request context in which this dependency node was created. - * + * * @return The request context, never {@code null}. */ String getRequestContext(); /** * Sets the request context in which this dependency node was created. - * + * * @param context The context, may be {@code null}. */ void setRequestContext( String context ); @@ -191,14 +218,14 @@ public interface DependencyNode * Gets the custom data associated with this dependency node. Clients of the repository system can use this data to * annotate dependency nodes with domain-specific information. Note that the returned map is read-only and * {@link #setData(Object, Object)} needs to be used to update the custom data. - * + * * @return The (read-only) key-value mappings, never {@code null}. */ Map getData(); /** * Sets the custom data associated with this dependency node. - * + * * @param data The new custom data, may be {@code null}. */ void setData( Map data ); @@ -206,7 +233,7 @@ public interface DependencyNode /** * Associates the specified dependency node data with the given key. Note: This method must not be called * while {@link #getData()} is being iterated. - * + * * @param key The key under which to store the data, must not be {@code null}. * @param value The data to associate with the key, may be {@code null} to remove the mapping. */ @@ -214,7 +241,7 @@ public interface DependencyNode /** * Traverses this node and potentially its children using the specified visitor. - * + * * @param visitor The visitor to call back, must not be {@code null}. * @return {@code true} to visit siblings nodes of this node as well, {@code false} to skip siblings. */ diff --git a/aether-api/src/main/java/org/eclipse/aether/graph/DependencyVisitor.java b/maven-resolver-api/src/main/java/org/eclipse/aether/graph/DependencyVisitor.java similarity index 55% rename from aether-api/src/main/java/org/eclipse/aether/graph/DependencyVisitor.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/graph/DependencyVisitor.java index d4ba2135b..2a85f2d0f 100644 --- a/aether-api/src/main/java/org/eclipse/aether/graph/DependencyVisitor.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/graph/DependencyVisitor.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.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 visitor for nodes of the dependency graph. * diff --git a/aether-api/src/main/java/org/eclipse/aether/graph/Exclusion.java b/maven-resolver-api/src/main/java/org/eclipse/aether/graph/Exclusion.java similarity index 78% rename from aether-api/src/main/java/org/eclipse/aether/graph/Exclusion.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/graph/Exclusion.java index 4d6b7baea..497cf436e 100644 --- a/aether-api/src/main/java/org/eclipse/aether/graph/Exclusion.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/graph/Exclusion.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.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. + */ + /** * An exclusion of one or more transitive dependencies. Note: Instances of this class are immutable and the * exposed mutators return new objects rather than changing the current instance. diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/graph/package-info.java b/maven-resolver-api/src/main/java/org/eclipse/aether/graph/package-info.java new file mode 100644 index 000000000..2264a618e --- /dev/null +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/graph/package-info.java @@ -0,0 +1,24 @@ +// CHECKSTYLE_OFF: RegexpHeader +/** + * The representation of a dependency graph by means of connected dependency nodes. + */ +package org.eclipse.aether.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. + */ diff --git a/aether-api/src/main/java/org/eclipse/aether/installation/InstallRequest.java b/maven-resolver-api/src/main/java/org/eclipse/aether/installation/InstallRequest.java similarity index 83% rename from aether-api/src/main/java/org/eclipse/aether/installation/InstallRequest.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/installation/InstallRequest.java index 330f85a5b..f9b31636f 100644 --- a/aether-api/src/main/java/org/eclipse/aether/installation/InstallRequest.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/installation/InstallRequest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.installation; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Collection; import java.util.Collections; diff --git a/aether-api/src/main/java/org/eclipse/aether/installation/InstallResult.java b/maven-resolver-api/src/main/java/org/eclipse/aether/installation/InstallResult.java similarity index 83% rename from aether-api/src/main/java/org/eclipse/aether/installation/InstallResult.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/installation/InstallResult.java index fe3ade138..662458541 100644 --- a/aether-api/src/main/java/org/eclipse/aether/installation/InstallResult.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/installation/InstallResult.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.installation; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Collection; import java.util.Collections; diff --git a/aether-api/src/main/java/org/eclipse/aether/installation/InstallationException.java b/maven-resolver-api/src/main/java/org/eclipse/aether/installation/InstallationException.java similarity index 50% rename from aether-api/src/main/java/org/eclipse/aether/installation/InstallationException.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/installation/InstallationException.java index e97666546..9a556bb62 100644 --- a/aether-api/src/main/java/org/eclipse/aether/installation/InstallationException.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/installation/InstallationException.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.installation; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.RepositoryException; /** diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/installation/package-info.java b/maven-resolver-api/src/main/java/org/eclipse/aether/installation/package-info.java new file mode 100644 index 000000000..d5720e018 --- /dev/null +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/installation/package-info.java @@ -0,0 +1,24 @@ +// CHECKSTYLE_OFF: RegexpHeader +/** + * The types supporting the publishing of artifacts to a local repository. + */ +package org.eclipse.aether.installation; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ diff --git a/aether-api/src/main/java/org/eclipse/aether/metadata/AbstractMetadata.java b/maven-resolver-api/src/main/java/org/eclipse/aether/metadata/AbstractMetadata.java similarity index 83% rename from aether-api/src/main/java/org/eclipse/aether/metadata/AbstractMetadata.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/metadata/AbstractMetadata.java index d95eb54a6..49dab3595 100644 --- a/aether-api/src/main/java/org/eclipse/aether/metadata/AbstractMetadata.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/metadata/AbstractMetadata.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.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.io.File; import java.util.Collections; import java.util.HashMap; diff --git a/aether-api/src/main/java/org/eclipse/aether/metadata/DefaultMetadata.java b/maven-resolver-api/src/main/java/org/eclipse/aether/metadata/DefaultMetadata.java similarity index 88% rename from aether-api/src/main/java/org/eclipse/aether/metadata/DefaultMetadata.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/metadata/DefaultMetadata.java index aa9c83055..1efbb72b7 100644 --- a/aether-api/src/main/java/org/eclipse/aether/metadata/DefaultMetadata.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/metadata/DefaultMetadata.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.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.io.File; import java.util.Map; diff --git a/aether-api/src/main/java/org/eclipse/aether/metadata/MergeableMetadata.java b/maven-resolver-api/src/main/java/org/eclipse/aether/metadata/MergeableMetadata.java similarity index 56% rename from aether-api/src/main/java/org/eclipse/aether/metadata/MergeableMetadata.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/metadata/MergeableMetadata.java index 25f15dfbd..deaff701b 100644 --- a/aether-api/src/main/java/org/eclipse/aether/metadata/MergeableMetadata.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/metadata/MergeableMetadata.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.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.io.File; import org.eclipse.aether.RepositoryException; diff --git a/aether-api/src/main/java/org/eclipse/aether/metadata/Metadata.java b/maven-resolver-api/src/main/java/org/eclipse/aether/metadata/Metadata.java similarity index 82% rename from aether-api/src/main/java/org/eclipse/aether/metadata/Metadata.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/metadata/Metadata.java index 328544a5c..84e921231 100644 --- a/aether-api/src/main/java/org/eclipse/aether/metadata/Metadata.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/metadata/Metadata.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.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.io.File; import java.util.Map; diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/metadata/package-info.java b/maven-resolver-api/src/main/java/org/eclipse/aether/metadata/package-info.java new file mode 100644 index 000000000..d8df1d55c --- /dev/null +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/metadata/package-info.java @@ -0,0 +1,24 @@ +// CHECKSTYLE_OFF: RegexpHeader +/** + * The definition of metadata, that is an auxiliary entity managed by the repository system to locate artifacts. + */ +package org.eclipse.aether.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. + */ diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/package-info.java b/maven-resolver-api/src/main/java/org/eclipse/aether/package-info.java new file mode 100644 index 000000000..995f12feb --- /dev/null +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/package-info.java @@ -0,0 +1,24 @@ +// CHECKSTYLE_OFF: RegexpHeader +/** + * The primary API of the {@link org.eclipse.aether.RepositorySystem} and its functionality. + */ +package org.eclipse.aether; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/repository/ArtifactRepository.java b/maven-resolver-api/src/main/java/org/eclipse/aether/repository/ArtifactRepository.java new file mode 100644 index 000000000..c62bf8793 --- /dev/null +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/repository/ArtifactRepository.java @@ -0,0 +1,45 @@ +package org.eclipse.aether.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. + */ + +/** + * A repository hosting artifacts. + * + * @noimplement This interface is not intended to be implemented by clients. + * @noextend This interface is not intended to be extended by clients. + */ +public interface ArtifactRepository +{ + + /** + * Gets the type of the repository, for example "default". + * + * @return The (case-sensitive) type of the repository, never {@code null}. + */ + String getContentType(); + + /** + * Gets the identifier of this repository. + * + * @return The (case-sensitive) identifier, never {@code null}. + */ + String getId(); + +} diff --git a/aether-api/src/main/java/org/eclipse/aether/repository/Authentication.java b/maven-resolver-api/src/main/java/org/eclipse/aether/repository/Authentication.java similarity index 67% rename from aether-api/src/main/java/org/eclipse/aether/repository/Authentication.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/repository/Authentication.java index c1eaac027..d85c2a26e 100644 --- a/aether-api/src/main/java/org/eclipse/aether/repository/Authentication.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/repository/Authentication.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.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.Map; /** diff --git a/aether-api/src/main/java/org/eclipse/aether/repository/AuthenticationContext.java b/maven-resolver-api/src/main/java/org/eclipse/aether/repository/AuthenticationContext.java similarity index 94% rename from aether-api/src/main/java/org/eclipse/aether/repository/AuthenticationContext.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/repository/AuthenticationContext.java index 5b1ba2c0a..bd248a078 100644 --- a/aether-api/src/main/java/org/eclipse/aether/repository/AuthenticationContext.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/repository/AuthenticationContext.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2012, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.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.Closeable; import java.io.File; import java.util.Arrays; diff --git a/aether-api/src/main/java/org/eclipse/aether/repository/AuthenticationDigest.java b/maven-resolver-api/src/main/java/org/eclipse/aether/repository/AuthenticationDigest.java similarity index 86% rename from aether-api/src/main/java/org/eclipse/aether/repository/AuthenticationDigest.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/repository/AuthenticationDigest.java index f702b4aa7..e186060a7 100644 --- a/aether-api/src/main/java/org/eclipse/aether/repository/AuthenticationDigest.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/repository/AuthenticationDigest.java @@ -1,16 +1,25 @@ -/******************************************************************************* - * Copyright (c) 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.repository; -import java.io.UnsupportedEncodingException; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.nio.charset.StandardCharsets; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; @@ -148,14 +157,7 @@ public void update( String... strings ) { if ( string != null ) { - try - { - digest.update( string.getBytes( "UTF-8" ) ); - } - catch ( UnsupportedEncodingException e ) - { - throw new IllegalStateException( e ); - } + digest.update( string.getBytes( StandardCharsets.UTF_8 ) ); } } } diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/repository/AuthenticationSelector.java b/maven-resolver-api/src/main/java/org/eclipse/aether/repository/AuthenticationSelector.java new file mode 100644 index 000000000..0637d1c28 --- /dev/null +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/repository/AuthenticationSelector.java @@ -0,0 +1,38 @@ +package org.eclipse.aether.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. + */ + +/** + * Selects authentication for a given remote repository. + * + * @see org.eclipse.aether.RepositorySystemSession#getAuthenticationSelector() + */ +public interface AuthenticationSelector +{ + + /** + * Selects authentication for the specified remote repository. + * + * @param repository The repository for which to select authentication, must not be {@code null}. + * @return The selected authentication or {@code null} if none. + */ + Authentication getAuthentication( RemoteRepository repository ); + +} diff --git a/aether-api/src/main/java/org/eclipse/aether/repository/LocalArtifactRegistration.java b/maven-resolver-api/src/main/java/org/eclipse/aether/repository/LocalArtifactRegistration.java similarity index 82% rename from aether-api/src/main/java/org/eclipse/aether/repository/LocalArtifactRegistration.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/repository/LocalArtifactRegistration.java index af6ea4e0f..106577902 100644 --- a/aether-api/src/main/java/org/eclipse/aether/repository/LocalArtifactRegistration.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/repository/LocalArtifactRegistration.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.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.Collection; import java.util.Collections; diff --git a/aether-api/src/main/java/org/eclipse/aether/repository/LocalArtifactRequest.java b/maven-resolver-api/src/main/java/org/eclipse/aether/repository/LocalArtifactRequest.java similarity index 80% rename from aether-api/src/main/java/org/eclipse/aether/repository/LocalArtifactRequest.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/repository/LocalArtifactRequest.java index 3cc67f858..8f6eabfa9 100644 --- a/aether-api/src/main/java/org/eclipse/aether/repository/LocalArtifactRequest.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/repository/LocalArtifactRequest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.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.Collections; import java.util.List; diff --git a/aether-api/src/main/java/org/eclipse/aether/repository/LocalArtifactResult.java b/maven-resolver-api/src/main/java/org/eclipse/aether/repository/LocalArtifactResult.java similarity index 83% rename from aether-api/src/main/java/org/eclipse/aether/repository/LocalArtifactResult.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/repository/LocalArtifactResult.java index 065b82358..e611b27f0 100644 --- a/aether-api/src/main/java/org/eclipse/aether/repository/LocalArtifactResult.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/repository/LocalArtifactResult.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.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.File; import org.eclipse.aether.RepositorySystemSession; diff --git a/aether-api/src/main/java/org/eclipse/aether/repository/LocalMetadataRegistration.java b/maven-resolver-api/src/main/java/org/eclipse/aether/repository/LocalMetadataRegistration.java similarity index 81% rename from aether-api/src/main/java/org/eclipse/aether/repository/LocalMetadataRegistration.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/repository/LocalMetadataRegistration.java index a01ba3e4c..dd0d58788 100644 --- a/aether-api/src/main/java/org/eclipse/aether/repository/LocalMetadataRegistration.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/repository/LocalMetadataRegistration.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.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.Collection; import java.util.Collections; diff --git a/aether-api/src/main/java/org/eclipse/aether/repository/LocalMetadataRequest.java b/maven-resolver-api/src/main/java/org/eclipse/aether/repository/LocalMetadataRequest.java similarity index 78% rename from aether-api/src/main/java/org/eclipse/aether/repository/LocalMetadataRequest.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/repository/LocalMetadataRequest.java index 0ee4dc5e7..4c8f270cc 100644 --- a/aether-api/src/main/java/org/eclipse/aether/repository/LocalMetadataRequest.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/repository/LocalMetadataRequest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.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.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.metadata.Metadata; diff --git a/aether-api/src/main/java/org/eclipse/aether/repository/LocalMetadataResult.java b/maven-resolver-api/src/main/java/org/eclipse/aether/repository/LocalMetadataResult.java similarity index 74% rename from aether-api/src/main/java/org/eclipse/aether/repository/LocalMetadataResult.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/repository/LocalMetadataResult.java index 6f3687a5e..29bd045bc 100644 --- a/aether-api/src/main/java/org/eclipse/aether/repository/LocalMetadataResult.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/repository/LocalMetadataResult.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.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.File; import org.eclipse.aether.RepositorySystemSession; diff --git a/aether-api/src/main/java/org/eclipse/aether/repository/LocalRepository.java b/maven-resolver-api/src/main/java/org/eclipse/aether/repository/LocalRepository.java similarity index 77% rename from aether-api/src/main/java/org/eclipse/aether/repository/LocalRepository.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/repository/LocalRepository.java index 91b09d8b1..32dce730b 100644 --- a/aether-api/src/main/java/org/eclipse/aether/repository/LocalRepository.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/repository/LocalRepository.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.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.File; /** diff --git a/aether-api/src/main/java/org/eclipse/aether/repository/LocalRepositoryManager.java b/maven-resolver-api/src/main/java/org/eclipse/aether/repository/LocalRepositoryManager.java similarity index 87% rename from aether-api/src/main/java/org/eclipse/aether/repository/LocalRepositoryManager.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/repository/LocalRepositoryManager.java index d9d8777e6..649707ce9 100644 --- a/aether-api/src/main/java/org/eclipse/aether/repository/LocalRepositoryManager.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/repository/LocalRepositoryManager.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.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.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.metadata.Metadata; diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/repository/MirrorSelector.java b/maven-resolver-api/src/main/java/org/eclipse/aether/repository/MirrorSelector.java new file mode 100644 index 000000000..d50262c08 --- /dev/null +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/repository/MirrorSelector.java @@ -0,0 +1,39 @@ +package org.eclipse.aether.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. + */ + +/** + * Selects a mirror for a given remote repository. + * + * @see org.eclipse.aether.RepositorySystemSession#getMirrorSelector() + */ +public interface MirrorSelector +{ + + /** + * Selects a mirror for the specified repository. + * + * @param repository The repository to select a mirror for, must not be {@code null}. + * @return The selected mirror or {@code null} if none. + * @see RemoteRepository#getMirroredRepositories() + */ + RemoteRepository getMirror( RemoteRepository repository ); + +} diff --git a/aether-api/src/main/java/org/eclipse/aether/repository/NoLocalRepositoryManagerException.java b/maven-resolver-api/src/main/java/org/eclipse/aether/repository/NoLocalRepositoryManagerException.java similarity index 76% rename from aether-api/src/main/java/org/eclipse/aether/repository/NoLocalRepositoryManagerException.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/repository/NoLocalRepositoryManagerException.java index 203ccfb00..c8048216a 100644 --- a/aether-api/src/main/java/org/eclipse/aether/repository/NoLocalRepositoryManagerException.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/repository/NoLocalRepositoryManagerException.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.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.eclipse.aether.RepositoryException; /** diff --git a/aether-api/src/main/java/org/eclipse/aether/repository/Proxy.java b/maven-resolver-api/src/main/java/org/eclipse/aether/repository/Proxy.java similarity index 79% rename from aether-api/src/main/java/org/eclipse/aether/repository/Proxy.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/repository/Proxy.java index b575bbc8e..8e8cba14b 100644 --- a/aether-api/src/main/java/org/eclipse/aether/repository/Proxy.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/repository/Proxy.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.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. + */ + /** * A proxy to use for connections to a repository. */ diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/repository/ProxySelector.java b/maven-resolver-api/src/main/java/org/eclipse/aether/repository/ProxySelector.java new file mode 100644 index 000000000..29b9e4eea --- /dev/null +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/repository/ProxySelector.java @@ -0,0 +1,38 @@ +package org.eclipse.aether.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. + */ + +/** + * Selects a proxy for a given remote repository. + * + * @see org.eclipse.aether.RepositorySystemSession#getProxySelector() + */ +public interface ProxySelector +{ + + /** + * Selects a proxy for the specified remote repository. + * + * @param repository The repository for which to select a proxy, must not be {@code null}. + * @return The selected proxy or {@code null} if none. + */ + Proxy getProxy( RemoteRepository repository ); + +} diff --git a/aether-api/src/main/java/org/eclipse/aether/repository/RemoteRepository.java b/maven-resolver-api/src/main/java/org/eclipse/aether/repository/RemoteRepository.java similarity index 95% rename from aether-api/src/main/java/org/eclipse/aether/repository/RemoteRepository.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/repository/RemoteRepository.java index aaa9acc27..31259caa3 100644 --- a/aether-api/src/main/java/org/eclipse/aether/repository/RemoteRepository.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/repository/RemoteRepository.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.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.Arrays; import java.util.Collections; diff --git a/aether-api/src/main/java/org/eclipse/aether/repository/RepositoryPolicy.java b/maven-resolver-api/src/main/java/org/eclipse/aether/repository/RepositoryPolicy.java similarity index 82% rename from aether-api/src/main/java/org/eclipse/aether/repository/RepositoryPolicy.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/repository/RepositoryPolicy.java index 05224a8a7..18fb850ce 100644 --- a/aether-api/src/main/java/org/eclipse/aether/repository/RepositoryPolicy.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/repository/RepositoryPolicy.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.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. + */ + /** * A policy controlling access to a repository. */ diff --git a/aether-api/src/main/java/org/eclipse/aether/repository/WorkspaceReader.java b/maven-resolver-api/src/main/java/org/eclipse/aether/repository/WorkspaceReader.java similarity index 58% rename from aether-api/src/main/java/org/eclipse/aether/repository/WorkspaceReader.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/repository/WorkspaceReader.java index 570f6b6e7..d1140f3ff 100644 --- a/aether-api/src/main/java/org/eclipse/aether/repository/WorkspaceReader.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/repository/WorkspaceReader.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.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.File; import java.util.List; diff --git a/aether-api/src/main/java/org/eclipse/aether/repository/WorkspaceRepository.java b/maven-resolver-api/src/main/java/org/eclipse/aether/repository/WorkspaceRepository.java similarity index 78% rename from aether-api/src/main/java/org/eclipse/aether/repository/WorkspaceRepository.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/repository/WorkspaceRepository.java index 811c58901..38dc5c52a 100644 --- a/aether-api/src/main/java/org/eclipse/aether/repository/WorkspaceRepository.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/repository/WorkspaceRepository.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.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.UUID; /** diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/repository/package-info.java b/maven-resolver-api/src/main/java/org/eclipse/aether/repository/package-info.java new file mode 100644 index 000000000..dddb3bfb1 --- /dev/null +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/repository/package-info.java @@ -0,0 +1,24 @@ +// CHECKSTYLE_OFF: RegexpHeader +/** + * The definition of various kinds of repositories that host artifacts. + */ +package org.eclipse.aether.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. + */ diff --git a/aether-api/src/main/java/org/eclipse/aether/resolution/ArtifactDescriptorException.java b/maven-resolver-api/src/main/java/org/eclipse/aether/resolution/ArtifactDescriptorException.java similarity index 75% rename from aether-api/src/main/java/org/eclipse/aether/resolution/ArtifactDescriptorException.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/resolution/ArtifactDescriptorException.java index 7dae7f4c5..d645a82c9 100644 --- a/aether-api/src/main/java/org/eclipse/aether/resolution/ArtifactDescriptorException.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/resolution/ArtifactDescriptorException.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.resolution; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.RepositoryException; /** diff --git a/aether-api/src/main/java/org/eclipse/aether/resolution/ArtifactDescriptorPolicy.java b/maven-resolver-api/src/main/java/org/eclipse/aether/resolution/ArtifactDescriptorPolicy.java similarity index 61% rename from aether-api/src/main/java/org/eclipse/aether/resolution/ArtifactDescriptorPolicy.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/resolution/ArtifactDescriptorPolicy.java index ec519fee9..c4de9b224 100644 --- a/aether-api/src/main/java/org/eclipse/aether/resolution/ArtifactDescriptorPolicy.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/resolution/ArtifactDescriptorPolicy.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2012, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.resolution; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.RepositorySystemSession; /** diff --git a/aether-api/src/main/java/org/eclipse/aether/resolution/ArtifactDescriptorPolicyRequest.java b/maven-resolver-api/src/main/java/org/eclipse/aether/resolution/ArtifactDescriptorPolicyRequest.java similarity index 73% rename from aether-api/src/main/java/org/eclipse/aether/resolution/ArtifactDescriptorPolicyRequest.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/resolution/ArtifactDescriptorPolicyRequest.java index 2edf0c538..ffaac16c5 100644 --- a/aether-api/src/main/java/org/eclipse/aether/resolution/ArtifactDescriptorPolicyRequest.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/resolution/ArtifactDescriptorPolicyRequest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.resolution; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.artifact.Artifact; /** diff --git a/aether-api/src/main/java/org/eclipse/aether/resolution/ArtifactDescriptorRequest.java b/maven-resolver-api/src/main/java/org/eclipse/aether/resolution/ArtifactDescriptorRequest.java similarity index 85% rename from aether-api/src/main/java/org/eclipse/aether/resolution/ArtifactDescriptorRequest.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/resolution/ArtifactDescriptorRequest.java index 9a1ba6521..387b1dc74 100644 --- a/aether-api/src/main/java/org/eclipse/aether/resolution/ArtifactDescriptorRequest.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/resolution/ArtifactDescriptorRequest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.resolution; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Collections; import java.util.List; diff --git a/aether-api/src/main/java/org/eclipse/aether/resolution/ArtifactDescriptorResult.java b/maven-resolver-api/src/main/java/org/eclipse/aether/resolution/ArtifactDescriptorResult.java similarity index 94% rename from aether-api/src/main/java/org/eclipse/aether/resolution/ArtifactDescriptorResult.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/resolution/ArtifactDescriptorResult.java index 3de8d5e02..4c53b6ea6 100644 --- a/aether-api/src/main/java/org/eclipse/aether/resolution/ArtifactDescriptorResult.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/resolution/ArtifactDescriptorResult.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.resolution; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Collection; import java.util.Collections; diff --git a/aether-api/src/main/java/org/eclipse/aether/resolution/ArtifactRequest.java b/maven-resolver-api/src/main/java/org/eclipse/aether/resolution/ArtifactRequest.java similarity index 87% rename from aether-api/src/main/java/org/eclipse/aether/resolution/ArtifactRequest.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/resolution/ArtifactRequest.java index 6076ea5df..a22020758 100644 --- a/aether-api/src/main/java/org/eclipse/aether/resolution/ArtifactRequest.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/resolution/ArtifactRequest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.resolution; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Collections; import java.util.List; diff --git a/aether-api/src/main/java/org/eclipse/aether/resolution/ArtifactResolutionException.java b/maven-resolver-api/src/main/java/org/eclipse/aether/resolution/ArtifactResolutionException.java similarity index 84% rename from aether-api/src/main/java/org/eclipse/aether/resolution/ArtifactResolutionException.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/resolution/ArtifactResolutionException.java index 67d051498..bfae4a0bb 100644 --- a/aether-api/src/main/java/org/eclipse/aether/resolution/ArtifactResolutionException.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/resolution/ArtifactResolutionException.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.resolution; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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; @@ -34,7 +43,7 @@ public class ArtifactResolutionException public ArtifactResolutionException( List results ) { super( getMessage( results ), getCause( results ) ); - this.results = ( results != null ) ? results : Collections. emptyList(); + this.results = ( results != null ) ? results : Collections.emptyList(); } /** @@ -46,7 +55,7 @@ public ArtifactResolutionException( List results ) public ArtifactResolutionException( List results, String message ) { super( message, getCause( results ) ); - this.results = ( results != null ) ? results : Collections. emptyList(); + this.results = ( results != null ) ? results : Collections.emptyList(); } /** @@ -59,7 +68,7 @@ public ArtifactResolutionException( List results, String message public ArtifactResolutionException( List results, String message, Throwable cause ) { super( message, cause ); - this.results = ( results != null ) ? results : Collections. emptyList(); + this.results = ( results != null ) ? results : Collections.emptyList(); } /** diff --git a/aether-api/src/main/java/org/eclipse/aether/resolution/ArtifactResult.java b/maven-resolver-api/src/main/java/org/eclipse/aether/resolution/ArtifactResult.java similarity index 86% rename from aether-api/src/main/java/org/eclipse/aether/resolution/ArtifactResult.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/resolution/ArtifactResult.java index 106ffe02b..5ae820b6e 100644 --- a/aether-api/src/main/java/org/eclipse/aether/resolution/ArtifactResult.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/resolution/ArtifactResult.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.resolution; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Collections; import java.util.List; diff --git a/aether-api/src/main/java/org/eclipse/aether/resolution/DependencyRequest.java b/maven-resolver-api/src/main/java/org/eclipse/aether/resolution/DependencyRequest.java similarity index 87% rename from aether-api/src/main/java/org/eclipse/aether/resolution/DependencyRequest.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/resolution/DependencyRequest.java index f55aff7bb..138304ac9 100644 --- a/aether-api/src/main/java/org/eclipse/aether/resolution/DependencyRequest.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/resolution/DependencyRequest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.resolution; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.RequestTrace; diff --git a/aether-api/src/main/java/org/eclipse/aether/resolution/DependencyResolutionException.java b/maven-resolver-api/src/main/java/org/eclipse/aether/resolution/DependencyResolutionException.java similarity index 71% rename from aether-api/src/main/java/org/eclipse/aether/resolution/DependencyResolutionException.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/resolution/DependencyResolutionException.java index 27d9bb2a9..2c12b57df 100644 --- a/aether-api/src/main/java/org/eclipse/aether/resolution/DependencyResolutionException.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/resolution/DependencyResolutionException.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.resolution; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.RepositoryException; /** diff --git a/aether-api/src/main/java/org/eclipse/aether/resolution/DependencyResult.java b/maven-resolver-api/src/main/java/org/eclipse/aether/resolution/DependencyResult.java similarity index 86% rename from aether-api/src/main/java/org/eclipse/aether/resolution/DependencyResult.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/resolution/DependencyResult.java index 3cc8d3a94..030e92363 100644 --- a/aether-api/src/main/java/org/eclipse/aether/resolution/DependencyResult.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/resolution/DependencyResult.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.resolution; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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; diff --git a/aether-api/src/main/java/org/eclipse/aether/resolution/MetadataRequest.java b/maven-resolver-api/src/main/java/org/eclipse/aether/resolution/MetadataRequest.java similarity index 89% rename from aether-api/src/main/java/org/eclipse/aether/resolution/MetadataRequest.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/resolution/MetadataRequest.java index 2f6c5f1d0..86063ff89 100644 --- a/aether-api/src/main/java/org/eclipse/aether/resolution/MetadataRequest.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/resolution/MetadataRequest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.resolution; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.RequestTrace; diff --git a/aether-api/src/main/java/org/eclipse/aether/resolution/MetadataResult.java b/maven-resolver-api/src/main/java/org/eclipse/aether/resolution/MetadataResult.java similarity index 84% rename from aether-api/src/main/java/org/eclipse/aether/resolution/MetadataResult.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/resolution/MetadataResult.java index 3e5a7b874..2bba49956 100644 --- a/aether-api/src/main/java/org/eclipse/aether/resolution/MetadataResult.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/resolution/MetadataResult.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.resolution; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.metadata.Metadata; diff --git a/aether-api/src/main/java/org/eclipse/aether/resolution/ResolutionErrorPolicy.java b/maven-resolver-api/src/main/java/org/eclipse/aether/resolution/ResolutionErrorPolicy.java similarity index 78% rename from aether-api/src/main/java/org/eclipse/aether/resolution/ResolutionErrorPolicy.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/resolution/ResolutionErrorPolicy.java index 50d1a0174..5158fa030 100644 --- a/aether-api/src/main/java/org/eclipse/aether/resolution/ResolutionErrorPolicy.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/resolution/ResolutionErrorPolicy.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2012, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.resolution; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.metadata.Metadata; diff --git a/aether-api/src/main/java/org/eclipse/aether/resolution/ResolutionErrorPolicyRequest.java b/maven-resolver-api/src/main/java/org/eclipse/aether/resolution/ResolutionErrorPolicyRequest.java similarity index 75% rename from aether-api/src/main/java/org/eclipse/aether/resolution/ResolutionErrorPolicyRequest.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/resolution/ResolutionErrorPolicyRequest.java index 6d05cf33e..912691471 100644 --- a/aether-api/src/main/java/org/eclipse/aether/resolution/ResolutionErrorPolicyRequest.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/resolution/ResolutionErrorPolicyRequest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.resolution; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.repository.RemoteRepository; /** diff --git a/aether-api/src/main/java/org/eclipse/aether/resolution/VersionRangeRequest.java b/maven-resolver-api/src/main/java/org/eclipse/aether/resolution/VersionRangeRequest.java similarity index 85% rename from aether-api/src/main/java/org/eclipse/aether/resolution/VersionRangeRequest.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/resolution/VersionRangeRequest.java index b40feb658..d6aa16bef 100644 --- a/aether-api/src/main/java/org/eclipse/aether/resolution/VersionRangeRequest.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/resolution/VersionRangeRequest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.resolution; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Collections; import java.util.List; diff --git a/aether-api/src/main/java/org/eclipse/aether/resolution/VersionRangeResolutionException.java b/maven-resolver-api/src/main/java/org/eclipse/aether/resolution/VersionRangeResolutionException.java similarity index 77% rename from aether-api/src/main/java/org/eclipse/aether/resolution/VersionRangeResolutionException.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/resolution/VersionRangeResolutionException.java index 6e62e3ff9..deb0e5293 100644 --- a/aether-api/src/main/java/org/eclipse/aether/resolution/VersionRangeResolutionException.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/resolution/VersionRangeResolutionException.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.resolution; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.RepositoryException; /** diff --git a/aether-api/src/main/java/org/eclipse/aether/resolution/VersionRangeResult.java b/maven-resolver-api/src/main/java/org/eclipse/aether/resolution/VersionRangeResult.java similarity index 88% rename from aether-api/src/main/java/org/eclipse/aether/resolution/VersionRangeResult.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/resolution/VersionRangeResult.java index fd233f1b2..4749f7c09 100644 --- a/aether-api/src/main/java/org/eclipse/aether/resolution/VersionRangeResult.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/resolution/VersionRangeResult.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.resolution; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Collections; import java.util.HashMap; diff --git a/aether-api/src/main/java/org/eclipse/aether/resolution/VersionRequest.java b/maven-resolver-api/src/main/java/org/eclipse/aether/resolution/VersionRequest.java similarity index 85% rename from aether-api/src/main/java/org/eclipse/aether/resolution/VersionRequest.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/resolution/VersionRequest.java index e18701be9..3dde7dd33 100644 --- a/aether-api/src/main/java/org/eclipse/aether/resolution/VersionRequest.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/resolution/VersionRequest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.resolution; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Collections; import java.util.List; diff --git a/aether-api/src/main/java/org/eclipse/aether/resolution/VersionResolutionException.java b/maven-resolver-api/src/main/java/org/eclipse/aether/resolution/VersionResolutionException.java similarity index 77% rename from aether-api/src/main/java/org/eclipse/aether/resolution/VersionResolutionException.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/resolution/VersionResolutionException.java index 25f381e11..1aca861e0 100644 --- a/aether-api/src/main/java/org/eclipse/aether/resolution/VersionResolutionException.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/resolution/VersionResolutionException.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.resolution; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.RepositoryException; /** diff --git a/aether-api/src/main/java/org/eclipse/aether/resolution/VersionResult.java b/maven-resolver-api/src/main/java/org/eclipse/aether/resolution/VersionResult.java similarity index 80% rename from aether-api/src/main/java/org/eclipse/aether/resolution/VersionResult.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/resolution/VersionResult.java index 2e76b1c32..51257738a 100644 --- a/aether-api/src/main/java/org/eclipse/aether/resolution/VersionResult.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/resolution/VersionResult.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.resolution; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Collections; import java.util.List; diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/resolution/package-info.java b/maven-resolver-api/src/main/java/org/eclipse/aether/resolution/package-info.java new file mode 100644 index 000000000..5b4b4b66c --- /dev/null +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/resolution/package-info.java @@ -0,0 +1,24 @@ +// CHECKSTYLE_OFF: RegexpHeader +/** + * The types supporting the resolution of artifacts and metadata from repositories. + */ +package org.eclipse.aether.resolution; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ diff --git a/aether-api/src/main/java/org/eclipse/aether/transfer/AbstractTransferListener.java b/maven-resolver-api/src/main/java/org/eclipse/aether/transfer/AbstractTransferListener.java similarity index 53% rename from aether-api/src/main/java/org/eclipse/aether/transfer/AbstractTransferListener.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/transfer/AbstractTransferListener.java index 01aff1727..5691e31db 100644 --- a/aether-api/src/main/java/org/eclipse/aether/transfer/AbstractTransferListener.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/transfer/AbstractTransferListener.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.transfer; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT 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 skeleton implementation for custom transfer listeners. The callback methods in this class do nothing. */ diff --git a/aether-api/src/main/java/org/eclipse/aether/transfer/ArtifactNotFoundException.java b/maven-resolver-api/src/main/java/org/eclipse/aether/transfer/ArtifactNotFoundException.java similarity index 80% rename from aether-api/src/main/java/org/eclipse/aether/transfer/ArtifactNotFoundException.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/transfer/ArtifactNotFoundException.java index 381374384..89a50d40c 100644 --- a/aether-api/src/main/java/org/eclipse/aether/transfer/ArtifactNotFoundException.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/transfer/ArtifactNotFoundException.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.transfer; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.artifact.ArtifactProperties; import org.eclipse.aether.repository.RemoteRepository; diff --git a/aether-api/src/main/java/org/eclipse/aether/transfer/ArtifactTransferException.java b/maven-resolver-api/src/main/java/org/eclipse/aether/transfer/ArtifactTransferException.java similarity index 83% rename from aether-api/src/main/java/org/eclipse/aether/transfer/ArtifactTransferException.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/transfer/ArtifactTransferException.java index 5a481eeb3..087040f35 100644 --- a/aether-api/src/main/java/org/eclipse/aether/transfer/ArtifactTransferException.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/transfer/ArtifactTransferException.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.transfer; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.RepositoryException; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.repository.RemoteRepository; diff --git a/aether-api/src/main/java/org/eclipse/aether/transfer/ChecksumFailureException.java b/maven-resolver-api/src/main/java/org/eclipse/aether/transfer/ChecksumFailureException.java similarity index 81% rename from aether-api/src/main/java/org/eclipse/aether/transfer/ChecksumFailureException.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/transfer/ChecksumFailureException.java index e3f248a4b..1dbc6b0c1 100644 --- a/aether-api/src/main/java/org/eclipse/aether/transfer/ChecksumFailureException.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/transfer/ChecksumFailureException.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.transfer; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.RepositoryException; /** diff --git a/aether-api/src/main/java/org/eclipse/aether/transfer/MetadataNotFoundException.java b/maven-resolver-api/src/main/java/org/eclipse/aether/transfer/MetadataNotFoundException.java similarity index 80% rename from aether-api/src/main/java/org/eclipse/aether/transfer/MetadataNotFoundException.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/transfer/MetadataNotFoundException.java index af9a84001..9642621dc 100644 --- a/aether-api/src/main/java/org/eclipse/aether/transfer/MetadataNotFoundException.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/transfer/MetadataNotFoundException.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.transfer; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.metadata.Metadata; import org.eclipse.aether.repository.LocalRepository; import org.eclipse.aether.repository.RemoteRepository; diff --git a/aether-api/src/main/java/org/eclipse/aether/transfer/MetadataTransferException.java b/maven-resolver-api/src/main/java/org/eclipse/aether/transfer/MetadataTransferException.java similarity index 83% rename from aether-api/src/main/java/org/eclipse/aether/transfer/MetadataTransferException.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/transfer/MetadataTransferException.java index f86b9864e..df6374c5f 100644 --- a/aether-api/src/main/java/org/eclipse/aether/transfer/MetadataTransferException.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/transfer/MetadataTransferException.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.transfer; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.RepositoryException; import org.eclipse.aether.metadata.Metadata; import org.eclipse.aether.repository.RemoteRepository; diff --git a/aether-api/src/main/java/org/eclipse/aether/transfer/NoRepositoryConnectorException.java b/maven-resolver-api/src/main/java/org/eclipse/aether/transfer/NoRepositoryConnectorException.java similarity index 77% rename from aether-api/src/main/java/org/eclipse/aether/transfer/NoRepositoryConnectorException.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/transfer/NoRepositoryConnectorException.java index c91be2b1f..314056998 100644 --- a/aether-api/src/main/java/org/eclipse/aether/transfer/NoRepositoryConnectorException.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/transfer/NoRepositoryConnectorException.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.transfer; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.RepositoryException; import org.eclipse.aether.repository.RemoteRepository; diff --git a/aether-api/src/main/java/org/eclipse/aether/transfer/NoRepositoryLayoutException.java b/maven-resolver-api/src/main/java/org/eclipse/aether/transfer/NoRepositoryLayoutException.java similarity index 76% rename from aether-api/src/main/java/org/eclipse/aether/transfer/NoRepositoryLayoutException.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/transfer/NoRepositoryLayoutException.java index 31766018a..3fc05bb70 100644 --- a/aether-api/src/main/java/org/eclipse/aether/transfer/NoRepositoryLayoutException.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/transfer/NoRepositoryLayoutException.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.transfer; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.RepositoryException; import org.eclipse.aether.repository.RemoteRepository; diff --git a/aether-api/src/main/java/org/eclipse/aether/transfer/NoTransporterException.java b/maven-resolver-api/src/main/java/org/eclipse/aether/transfer/NoTransporterException.java similarity index 76% rename from aether-api/src/main/java/org/eclipse/aether/transfer/NoTransporterException.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/transfer/NoTransporterException.java index 895b06608..5d985588d 100644 --- a/aether-api/src/main/java/org/eclipse/aether/transfer/NoTransporterException.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/transfer/NoTransporterException.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.transfer; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.RepositoryException; import org.eclipse.aether.repository.RemoteRepository; diff --git a/aether-api/src/main/java/org/eclipse/aether/transfer/RepositoryOfflineException.java b/maven-resolver-api/src/main/java/org/eclipse/aether/transfer/RepositoryOfflineException.java similarity index 68% rename from aether-api/src/main/java/org/eclipse/aether/transfer/RepositoryOfflineException.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/transfer/RepositoryOfflineException.java index 1115054f4..02d468080 100644 --- a/aether-api/src/main/java/org/eclipse/aether/transfer/RepositoryOfflineException.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/transfer/RepositoryOfflineException.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2012, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.transfer; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.RepositoryException; import org.eclipse.aether.repository.RemoteRepository; diff --git a/aether-api/src/main/java/org/eclipse/aether/transfer/TransferCancelledException.java b/maven-resolver-api/src/main/java/org/eclipse/aether/transfer/TransferCancelledException.java similarity index 56% rename from aether-api/src/main/java/org/eclipse/aether/transfer/TransferCancelledException.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/transfer/TransferCancelledException.java index 5f4ed5b6d..88caa13dc 100644 --- a/aether-api/src/main/java/org/eclipse/aether/transfer/TransferCancelledException.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/transfer/TransferCancelledException.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.transfer; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.RepositoryException; /** diff --git a/aether-api/src/main/java/org/eclipse/aether/transfer/TransferEvent.java b/maven-resolver-api/src/main/java/org/eclipse/aether/transfer/TransferEvent.java similarity index 93% rename from aether-api/src/main/java/org/eclipse/aether/transfer/TransferEvent.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/transfer/TransferEvent.java index 9be298fbe..a78b6e38b 100644 --- a/aether-api/src/main/java/org/eclipse/aether/transfer/TransferEvent.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/transfer/TransferEvent.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.transfer; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.nio.ByteBuffer; import org.eclipse.aether.RepositorySystemSession; @@ -291,7 +300,7 @@ public Builder resetType( EventType type ) { case INITIATED: case STARTED: - transferredBytes = 0; + transferredBytes = 0L; default: } return this; @@ -343,7 +352,7 @@ public Builder setRequestType( RequestType requestType ) */ public Builder setTransferredBytes( long transferredBytes ) { - if ( transferredBytes < 0 ) + if ( transferredBytes < 0L ) { throw new IllegalArgumentException( "number of transferred bytes cannot be negative" ); } @@ -353,14 +362,14 @@ public Builder setTransferredBytes( long transferredBytes ) /** * Increments the total number of bytes that have been transferred so far during the download/upload. - * + * * @param transferredBytes The number of bytes that have been transferred since the last event, must not be * negative. * @return This event builder for chaining, never {@code null}. */ public Builder addTransferredBytes( long transferredBytes ) { - if ( transferredBytes < 0 ) + if ( transferredBytes < 0L ) { throw new IllegalArgumentException( "number of transferred bytes cannot be negative" ); } diff --git a/aether-api/src/main/java/org/eclipse/aether/transfer/TransferListener.java b/maven-resolver-api/src/main/java/org/eclipse/aether/transfer/TransferListener.java similarity index 82% rename from aether-api/src/main/java/org/eclipse/aether/transfer/TransferListener.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/transfer/TransferListener.java index 26c016d89..18019a9f5 100644 --- a/aether-api/src/main/java/org/eclipse/aether/transfer/TransferListener.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/transfer/TransferListener.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.transfer; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT 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 listener being notified of artifact/metadata transfers from/to remote repositories. The listener may be called from * an arbitrary thread. Reusing common regular expression syntax, the sequence of events is roughly as follows: diff --git a/aether-api/src/main/java/org/eclipse/aether/transfer/TransferResource.java b/maven-resolver-api/src/main/java/org/eclipse/aether/transfer/TransferResource.java similarity index 75% rename from aether-api/src/main/java/org/eclipse/aether/transfer/TransferResource.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/transfer/TransferResource.java index b9510fb90..f2e21356a 100644 --- a/aether-api/src/main/java/org/eclipse/aether/transfer/TransferResource.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/transfer/TransferResource.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.transfer; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.eclipse.aether.RequestTrace; @@ -20,6 +29,8 @@ public final class TransferResource { + private final String repositoryId; + private final String repositoryUrl; private final String resourceName; @@ -30,13 +41,14 @@ public final class TransferResource private final RequestTrace trace; - private long contentLength = -1; + private long contentLength = -1L; private long resumeOffset; /** * Creates a new transfer resource with the specified properties. - * + * + * @param repositoryId The ID of the repository used to transfer the resource, may be {@code null} or empty if unknown. * @param repositoryUrl The base URL of the repository, may be {@code null} or empty if unknown. If not empty, a * trailing slash will automatically be added if missing. * @param resourceName The relative path to the resource within the repository, may be {@code null}. A leading slash @@ -44,8 +56,18 @@ public final class TransferResource * @param file The source/target file involved in the transfer, may be {@code null}. * @param trace The trace information, may be {@code null}. */ - public TransferResource( String repositoryUrl, String resourceName, File file, RequestTrace trace ) + public TransferResource( String repositoryId, String repositoryUrl, String resourceName, + File file, RequestTrace trace ) { + if ( repositoryId == null || repositoryId.length() <= 0 ) + { + this.repositoryId = ""; + } + else + { + this.repositoryId = repositoryId; + } + if ( repositoryUrl == null || repositoryUrl.length() <= 0 ) { this.repositoryUrl = ""; @@ -79,10 +101,20 @@ else if ( resourceName.startsWith( "/" ) ) startTime = System.currentTimeMillis(); } + /** + * The ID of the repository, e.g., "central". + * + * @return The ID of the repository or an empty string if unknown, never {@code null}. + */ + public String getRepositoryId() + { + return repositoryId; + } + /** * The base URL of the repository, e.g. "http://repo1.maven.org/maven2/". Unless the URL is unknown, it will be * terminated by a trailing slash. - * + * * @return The base URL of the repository or an empty string if unknown, never {@code null}. */ public String getRepositoryUrl() @@ -92,7 +124,7 @@ public String getRepositoryUrl() /** * The path of the resource relative to the repository's base URL, e.g. "org/apache/maven/maven/3.0/maven-3.0.pom". - * + * * @return The path of the resource, never {@code null}. */ public String getResourceName() @@ -103,7 +135,7 @@ public String getResourceName() /** * Gets the local file being uploaded or downloaded. When the repository system merely checks for the existence of a * remote resource, no local file will be involved in the transfer. - * + * * @return The source/target file involved in the transfer or {@code null} if none. */ public File getFile() @@ -115,7 +147,7 @@ public File getFile() * The size of the resource in bytes. Note that the size of a resource during downloads might be unknown to the * client which is usually the case when transfers employ compression like gzip. In general, the content length is * not known until the transfer has {@link TransferListener#transferStarted(TransferEvent) started}. - * + * * @return The size of the resource in bytes or a negative value if unknown. */ public long getContentLength() @@ -125,7 +157,7 @@ public long getContentLength() /** * Sets the size of the resource in bytes. - * + * * @param contentLength The size of the resource in bytes or a negative value if unknown. * @return This resource for chaining, never {@code null}. */ @@ -138,7 +170,7 @@ public TransferResource setContentLength( long contentLength ) /** * Gets the byte offset within the resource from which the download starts. A positive offset indicates a previous * download attempt is being resumed, {@code 0} means the transfer starts at the first byte. - * + * * @return The zero-based index of the first byte being transferred, never negative. */ public long getResumeOffset() @@ -148,13 +180,13 @@ public long getResumeOffset() /** * Sets the byte offset within the resource at which the download starts. - * + * * @param resumeOffset The zero-based index of the first byte being transferred, must not be negative. * @return This resource for chaining, never {@code null}. */ public TransferResource setResumeOffset( long resumeOffset ) { - if ( resumeOffset < 0 ) + if ( resumeOffset < 0L ) { throw new IllegalArgumentException( "resume offset cannot be negative" ); } @@ -164,7 +196,7 @@ public TransferResource setResumeOffset( long resumeOffset ) /** * Gets the timestamp when the transfer of this resource was started. - * + * * @return The timestamp when the transfer of this resource was started. */ public long getTransferStartTime() @@ -175,7 +207,7 @@ public long getTransferStartTime() /** * Gets the trace information that describes the higher level request/operation during which this resource is * transferred. - * + * * @return The trace information about the higher level operation or {@code null} if none. */ public RequestTrace getTrace() diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/transfer/package-info.java b/maven-resolver-api/src/main/java/org/eclipse/aether/transfer/package-info.java new file mode 100644 index 000000000..e38c1a48b --- /dev/null +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/transfer/package-info.java @@ -0,0 +1,25 @@ +// CHECKSTYLE_OFF: RegexpHeader +/** + * A listener and various exception types dealing with the transfer of a resource between the local system and a remote + * repository. + */ +package org.eclipse.aether.transfer; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ diff --git a/aether-api/src/main/java/org/eclipse/aether/version/InvalidVersionSpecificationException.java b/maven-resolver-api/src/main/java/org/eclipse/aether/version/InvalidVersionSpecificationException.java similarity index 70% rename from aether-api/src/main/java/org/eclipse/aether/version/InvalidVersionSpecificationException.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/version/InvalidVersionSpecificationException.java index b3690c5a0..a57684420 100644 --- a/aether-api/src/main/java/org/eclipse/aether/version/InvalidVersionSpecificationException.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/version/InvalidVersionSpecificationException.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.version; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.RepositoryException; /** diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/version/Version.java b/maven-resolver-api/src/main/java/org/eclipse/aether/version/Version.java new file mode 100644 index 000000000..41c02c008 --- /dev/null +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/version/Version.java @@ -0,0 +1,36 @@ +package org.eclipse.aether.version; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT 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 parsed artifact version. + */ +public interface Version + extends Comparable +{ + + /** + * Gets the original string representation of the version. + * + * @return The string representation of the version, never {@code null}. + */ + String toString(); + +} diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/version/VersionConstraint.java b/maven-resolver-api/src/main/java/org/eclipse/aether/version/VersionConstraint.java new file mode 100644 index 000000000..1c685870e --- /dev/null +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/version/VersionConstraint.java @@ -0,0 +1,54 @@ +package org.eclipse.aether.version; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT 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 constraint on versions for a dependency. A constraint can either consist of a version range (e.g. "[1, ]") or a + * single version (e.g. "1.1"). In the first case, the constraint expresses a hard requirement on a version matching the + * range. In the second case, the constraint expresses a soft requirement on a specific version (i.e. a recommendation). + */ +public interface VersionConstraint +{ + + /** + * Gets the version range of this constraint. + * + * @return The version range or {@code null} if none. + */ + VersionRange getRange(); + + /** + * Gets the version recommended by this constraint. + * + * @return The recommended version or {@code null} if none. + */ + Version getVersion(); + + /** + * Determines whether the specified version satisfies this constraint. In more detail, a version satisfies this + * constraint if it matches its version range or if this constraint has no version range and the specified version + * equals the version recommended by the constraint. + * + * @param version The version to test, must not be {@code null}. + * @return {@code true} if the specified version satisfies this constraint, {@code false} otherwise. + */ + boolean containsVersion( Version version ); + +} diff --git a/aether-api/src/main/java/org/eclipse/aether/version/VersionRange.java b/maven-resolver-api/src/main/java/org/eclipse/aether/version/VersionRange.java similarity index 79% rename from aether-api/src/main/java/org/eclipse/aether/version/VersionRange.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/version/VersionRange.java index cbc2405b0..e355cf5f5 100644 --- a/aether-api/src/main/java/org/eclipse/aether/version/VersionRange.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/version/VersionRange.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.version; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT 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 range of versions. */ diff --git a/aether-api/src/main/java/org/eclipse/aether/version/VersionScheme.java b/maven-resolver-api/src/main/java/org/eclipse/aether/version/VersionScheme.java similarity index 66% rename from aether-api/src/main/java/org/eclipse/aether/version/VersionScheme.java rename to maven-resolver-api/src/main/java/org/eclipse/aether/version/VersionScheme.java index c19177a22..c765a0377 100644 --- a/aether-api/src/main/java/org/eclipse/aether/version/VersionScheme.java +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/version/VersionScheme.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.version; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT 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 version scheme that handles interpretation of version strings to facilitate their comparison. */ diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/version/package-info.java b/maven-resolver-api/src/main/java/org/eclipse/aether/version/package-info.java new file mode 100644 index 000000000..38a6caa8a --- /dev/null +++ b/maven-resolver-api/src/main/java/org/eclipse/aether/version/package-info.java @@ -0,0 +1,24 @@ +// CHECKSTYLE_OFF: RegexpHeader +/** + * The definition of a version scheme for parsing and comparing versions. + */ +package org.eclipse.aether.version; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ diff --git a/maven-resolver-api/src/site/site.xml b/maven-resolver-api/src/site/site.xml new file mode 100644 index 000000000..3a16bf98b --- /dev/null +++ b/maven-resolver-api/src/site/site.xml @@ -0,0 +1,36 @@ + + + + + + +

+ + + + + + + + + + \ No newline at end of file diff --git a/maven-resolver-api/src/test/java/org/eclipse/aether/AbstractForwardingRepositorySystemSessionTest.java b/maven-resolver-api/src/test/java/org/eclipse/aether/AbstractForwardingRepositorySystemSessionTest.java new file mode 100644 index 000000000..5ad24758d --- /dev/null +++ b/maven-resolver-api/src/test/java/org/eclipse/aether/AbstractForwardingRepositorySystemSessionTest.java @@ -0,0 +1,44 @@ +package org.eclipse.aether; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import static org.junit.Assert.*; + +import java.lang.reflect.Method; + +import org.junit.Test; + +public class AbstractForwardingRepositorySystemSessionTest +{ + + @Test + public void testAllMethodsImplemented() + throws Exception + { + for ( Method method : RepositorySystemSession.class.getMethods() ) + { + Method m = + AbstractForwardingRepositorySystemSession.class.getDeclaredMethod( method.getName(), + method.getParameterTypes() ); + assertNotNull( method.toString(), m ); + } + } + +} diff --git a/maven-resolver-api/src/test/java/org/eclipse/aether/AbstractRepositoryListenerTest.java b/maven-resolver-api/src/test/java/org/eclipse/aether/AbstractRepositoryListenerTest.java new file mode 100644 index 000000000..74c617f45 --- /dev/null +++ b/maven-resolver-api/src/test/java/org/eclipse/aether/AbstractRepositoryListenerTest.java @@ -0,0 +1,46 @@ +package org.eclipse.aether; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import static org.junit.Assert.*; + +import java.lang.reflect.Method; + +import org.eclipse.aether.AbstractRepositoryListener; +import org.eclipse.aether.RepositoryListener; +import org.junit.Test; + +/** + */ +public class AbstractRepositoryListenerTest +{ + + @Test + public void testAllEventTypesHandled() + throws Exception + { + for ( Method method : RepositoryListener.class.getMethods() ) + { + assertNotNull( AbstractRepositoryListener.class.getDeclaredMethod( method.getName(), + method.getParameterTypes() ) ); + } + } + +} diff --git a/maven-resolver-api/src/test/java/org/eclipse/aether/DefaultRepositoryCacheTest.java b/maven-resolver-api/src/test/java/org/eclipse/aether/DefaultRepositoryCacheTest.java new file mode 100644 index 000000000..067320e9d --- /dev/null +++ b/maven-resolver-api/src/test/java/org/eclipse/aether/DefaultRepositoryCacheTest.java @@ -0,0 +1,112 @@ +package org.eclipse.aether; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import static org.junit.Assert.*; + +import java.util.UUID; +import java.util.concurrent.atomic.AtomicReference; + +import org.junit.Test; + +public class DefaultRepositoryCacheTest +{ + + private DefaultRepositoryCache cache = new DefaultRepositoryCache(); + + private RepositorySystemSession session = new DefaultRepositorySystemSession(); + + private Object get( Object key ) + { + return cache.get( session, key ); + } + + private void put( Object key, Object value ) + { + cache.put( session, key, value ); + } + + @Test( expected = RuntimeException.class ) + public void testGet_NullKey() + { + get( null ); + } + + @Test( expected = RuntimeException.class ) + public void testPut_NullKey() + { + put( null, "data" ); + } + + @Test + public void testGetPut() + { + Object key = "key"; + assertNull( get( key ) ); + put( key, "value" ); + assertEquals( "value", get( key ) ); + put( key, "changed" ); + assertEquals( "changed", get( key ) ); + put( key, null ); + assertNull( get( key ) ); + } + + @Test( timeout = 10000L ) + public void testConcurrency() + throws Exception + { + final AtomicReference error = new AtomicReference(); + Thread threads[] = new Thread[20]; + for ( int i = 0; i < threads.length; i++ ) + { + threads[i] = new Thread() + { + @Override + public void run() + { + for ( int i = 0; i < 100; i++ ) + { + String key = UUID.randomUUID().toString(); + try + { + put( key, Boolean.TRUE ); + assertEquals( Boolean.TRUE, get( key ) ); + } + catch ( Throwable t ) + { + error.compareAndSet( null, t ); + t.printStackTrace(); + } + } + } + }; + } + for ( Thread thread : threads ) + { + thread.start(); + } + for ( Thread thread : threads ) + { + thread.join(); + } + assertNull( String.valueOf( error.get() ), error.get() ); + } + +} diff --git a/aether-api/src/test/java/org/eclipse/aether/DefaultRepositorySystemSessionTest.java b/maven-resolver-api/src/test/java/org/eclipse/aether/DefaultRepositorySystemSessionTest.java similarity index 81% rename from aether-api/src/test/java/org/eclipse/aether/DefaultRepositorySystemSessionTest.java rename to maven-resolver-api/src/test/java/org/eclipse/aether/DefaultRepositorySystemSessionTest.java index e46c2bf77..91afeb54f 100644 --- a/aether-api/src/test/java/org/eclipse/aether/DefaultRepositorySystemSessionTest.java +++ b/maven-resolver-api/src/test/java/org/eclipse/aether/DefaultRepositorySystemSessionTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import java.util.Map; diff --git a/maven-resolver-api/src/test/java/org/eclipse/aether/DefaultSessionDataTest.java b/maven-resolver-api/src/test/java/org/eclipse/aether/DefaultSessionDataTest.java new file mode 100644 index 000000000..3b886e504 --- /dev/null +++ b/maven-resolver-api/src/test/java/org/eclipse/aether/DefaultSessionDataTest.java @@ -0,0 +1,137 @@ +package org.eclipse.aether; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import static org.junit.Assert.*; + +import java.util.UUID; +import java.util.concurrent.atomic.AtomicReference; + +import org.junit.Test; + +public class DefaultSessionDataTest +{ + + private DefaultSessionData data = new DefaultSessionData(); + + private Object get( Object key ) + { + return data.get( key ); + } + + private void set( Object key, Object value ) + { + data.set( key, value ); + } + + private boolean set( Object key, Object oldValue, Object newValue ) + { + return data.set( key, oldValue, newValue ); + } + + @Test( expected = RuntimeException.class ) + public void testGet_NullKey() + { + get( null ); + } + + @Test( expected = RuntimeException.class ) + public void testSet_NullKey() + { + set( null, "data" ); + } + + @Test + public void testGetSet() + { + Object key = "key"; + assertNull( get( key ) ); + set( key, "value" ); + assertEquals( "value", get( key ) ); + set( key, "changed" ); + assertEquals( "changed", get( key ) ); + set( key, null ); + assertNull( get( key ) ); + } + + @Test + public void testGetSafeSet() + { + Object key = "key"; + assertNull( get( key ) ); + assertFalse( set( key, "wrong", "value" ) ); + assertNull( get( key ) ); + assertTrue( set( key, null, "value" ) ); + assertEquals( "value", get( key ) ); + assertTrue( set( key, "value", "value" ) ); + assertEquals( "value", get( key ) ); + assertFalse( set( key, "wrong", "changed" ) ); + assertEquals( "value", get( key ) ); + assertTrue( set( key, "value", "changed" ) ); + assertEquals( "changed", get( key ) ); + assertFalse( set( key, "wrong", null ) ); + assertEquals( "changed", get( key ) ); + assertTrue( set( key, "changed", null ) ); + assertNull( get( key ) ); + assertTrue( set( key, null, null ) ); + assertNull( get( key ) ); + } + + @Test( timeout = 10000L ) + public void testConcurrency() + throws Exception + { + final AtomicReference error = new AtomicReference(); + Thread threads[] = new Thread[20]; + for ( int i = 0; i < threads.length; i++ ) + { + threads[i] = new Thread() + { + @Override + public void run() + { + for ( int i = 0; i < 100; i++ ) + { + String key = UUID.randomUUID().toString(); + try + { + set( key, Boolean.TRUE ); + assertEquals( Boolean.TRUE, get( key ) ); + } + catch ( Throwable t ) + { + error.compareAndSet( null, t ); + t.printStackTrace(); + } + } + } + }; + } + for ( Thread thread : threads ) + { + thread.start(); + } + for ( Thread thread : threads ) + { + thread.join(); + } + assertNull( String.valueOf( error.get() ), error.get() ); + } +} diff --git a/aether-api/src/test/java/org/eclipse/aether/RepositoryExceptionTest.java b/maven-resolver-api/src/test/java/org/eclipse/aether/RepositoryExceptionTest.java similarity index 90% rename from aether-api/src/test/java/org/eclipse/aether/RepositoryExceptionTest.java rename to maven-resolver-api/src/test/java/org/eclipse/aether/RepositoryExceptionTest.java index a4d2d703d..c3246be07 100644 --- a/aether-api/src/test/java/org/eclipse/aether/RepositoryExceptionTest.java +++ b/maven-resolver-api/src/test/java/org/eclipse/aether/RepositoryExceptionTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2012, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.ByteArrayOutputStream; import java.io.IOException; import java.io.ObjectOutputStream; diff --git a/aether-api/src/test/java/org/eclipse/aether/RequestTraceTest.java b/maven-resolver-api/src/test/java/org/eclipse/aether/RequestTraceTest.java similarity index 55% rename from aether-api/src/test/java/org/eclipse/aether/RequestTraceTest.java rename to maven-resolver-api/src/test/java/org/eclipse/aether/RequestTraceTest.java index 0eb7f5d83..63e5877ff 100644 --- a/aether-api/src/test/java/org/eclipse/aether/RequestTraceTest.java +++ b/maven-resolver-api/src/test/java/org/eclipse/aether/RequestTraceTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import org.junit.Test; diff --git a/aether-api/src/test/java/org/eclipse/aether/artifact/DefaultArtifactTest.java b/maven-resolver-api/src/test/java/org/eclipse/aether/artifact/DefaultArtifactTest.java similarity index 90% rename from aether-api/src/test/java/org/eclipse/aether/artifact/DefaultArtifactTest.java rename to maven-resolver-api/src/test/java/org/eclipse/aether/artifact/DefaultArtifactTest.java index b7956c183..d8ac40cdb 100644 --- a/aether-api/src/test/java/org/eclipse/aether/artifact/DefaultArtifactTest.java +++ b/maven-resolver-api/src/test/java/org/eclipse/aether/artifact/DefaultArtifactTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.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 static org.junit.Assert.*; import java.io.File; diff --git a/aether-api/src/test/java/org/eclipse/aether/graph/DependencyTest.java b/maven-resolver-api/src/test/java/org/eclipse/aether/graph/DependencyTest.java similarity index 67% rename from aether-api/src/test/java/org/eclipse/aether/graph/DependencyTest.java rename to maven-resolver-api/src/test/java/org/eclipse/aether/graph/DependencyTest.java index c62edc01e..c96746d9a 100644 --- a/aether-api/src/test/java/org/eclipse/aether/graph/DependencyTest.java +++ b/maven-resolver-api/src/test/java/org/eclipse/aether/graph/DependencyTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.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 static org.junit.Assert.*; import java.util.Arrays; diff --git a/aether-api/src/test/java/org/eclipse/aether/repository/AuthenticationContextTest.java b/maven-resolver-api/src/test/java/org/eclipse/aether/repository/AuthenticationContextTest.java similarity index 86% rename from aether-api/src/test/java/org/eclipse/aether/repository/AuthenticationContextTest.java rename to maven-resolver-api/src/test/java/org/eclipse/aether/repository/AuthenticationContextTest.java index 4b32593e0..6d579a103 100644 --- a/aether-api/src/test/java/org/eclipse/aether/repository/AuthenticationContextTest.java +++ b/maven-resolver-api/src/test/java/org/eclipse/aether/repository/AuthenticationContextTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.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 static org.junit.Assert.*; import java.io.File; diff --git a/aether-api/src/test/java/org/eclipse/aether/repository/AuthenticationDigestTest.java b/maven-resolver-api/src/test/java/org/eclipse/aether/repository/AuthenticationDigestTest.java similarity index 83% rename from aether-api/src/test/java/org/eclipse/aether/repository/AuthenticationDigestTest.java rename to maven-resolver-api/src/test/java/org/eclipse/aether/repository/AuthenticationDigestTest.java index a91f28c44..387a3da1c 100644 --- a/aether-api/src/test/java/org/eclipse/aether/repository/AuthenticationDigestTest.java +++ b/maven-resolver-api/src/test/java/org/eclipse/aether/repository/AuthenticationDigestTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.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 static org.junit.Assert.*; import java.util.Map; diff --git a/aether-api/src/test/java/org/eclipse/aether/repository/RemoteRepositoryBuilderTest.java b/maven-resolver-api/src/test/java/org/eclipse/aether/repository/RemoteRepositoryBuilderTest.java similarity index 87% rename from aether-api/src/test/java/org/eclipse/aether/repository/RemoteRepositoryBuilderTest.java rename to maven-resolver-api/src/test/java/org/eclipse/aether/repository/RemoteRepositoryBuilderTest.java index 8124fd1c5..a384705ec 100644 --- a/aether-api/src/test/java/org/eclipse/aether/repository/RemoteRepositoryBuilderTest.java +++ b/maven-resolver-api/src/test/java/org/eclipse/aether/repository/RemoteRepositoryBuilderTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.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 static org.junit.Assert.*; import java.util.ArrayList; diff --git a/aether-api/src/test/java/org/eclipse/aether/repository/RemoteRepositoryTest.java b/maven-resolver-api/src/test/java/org/eclipse/aether/repository/RemoteRepositoryTest.java similarity index 76% rename from aether-api/src/test/java/org/eclipse/aether/repository/RemoteRepositoryTest.java rename to maven-resolver-api/src/test/java/org/eclipse/aether/repository/RemoteRepositoryTest.java index d8c1894bc..97f0b3ef7 100644 --- a/aether-api/src/test/java/org/eclipse/aether/repository/RemoteRepositoryTest.java +++ b/maven-resolver-api/src/test/java/org/eclipse/aether/repository/RemoteRepositoryTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.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 static org.junit.Assert.*; import org.eclipse.aether.repository.RemoteRepository; diff --git a/maven-resolver-api/src/test/java/org/eclipse/aether/transfer/AbstractTransferListenerTest.java b/maven-resolver-api/src/test/java/org/eclipse/aether/transfer/AbstractTransferListenerTest.java new file mode 100644 index 000000000..87c1472b7 --- /dev/null +++ b/maven-resolver-api/src/test/java/org/eclipse/aether/transfer/AbstractTransferListenerTest.java @@ -0,0 +1,46 @@ +package org.eclipse.aether.transfer; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import static org.junit.Assert.*; + +import java.lang.reflect.Method; + +import org.eclipse.aether.transfer.AbstractTransferListener; +import org.eclipse.aether.transfer.TransferListener; +import org.junit.Test; + +/** + */ +public class AbstractTransferListenerTest +{ + + @Test + public void testAllEventTypesHandled() + throws Exception + { + for ( Method method : TransferListener.class.getMethods() ) + { + assertNotNull( AbstractTransferListener.class.getDeclaredMethod( method.getName(), + method.getParameterTypes() ) ); + } + } + +} diff --git a/aether-api/src/test/java/org/eclipse/aether/transfer/TransferEventTest.java b/maven-resolver-api/src/test/java/org/eclipse/aether/transfer/TransferEventTest.java similarity index 70% rename from aether-api/src/test/java/org/eclipse/aether/transfer/TransferEventTest.java rename to maven-resolver-api/src/test/java/org/eclipse/aether/transfer/TransferEventTest.java index 9a7bd56a7..7d4c07065 100644 --- a/aether-api/src/test/java/org/eclipse/aether/transfer/TransferEventTest.java +++ b/maven-resolver-api/src/test/java/org/eclipse/aether/transfer/TransferEventTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.transfer; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import java.nio.ByteBuffer; @@ -25,7 +34,7 @@ public class TransferEventTest { - private static TransferResource res = new TransferResource( "file://nil", "void", null, null ); + private static TransferResource res = new TransferResource( "none", "file://nil", "void", null, null ); private static RepositorySystemSession session = new DefaultRepositorySystemSession(); diff --git a/maven-resolver-connector-basic/pom.xml b/maven-resolver-connector-basic/pom.xml new file mode 100644 index 000000000..659742e96 --- /dev/null +++ b/maven-resolver-connector-basic/pom.xml @@ -0,0 +1,89 @@ + + + + + + 4.0.0 + + + org.apache.maven.resolver + maven-resolver + 1.2.0-SNAPSHOT + + + maven-resolver-connector-basic + + Maven Artifact Resolver Connector Basic + + A repository connector implementation for repositories using URI-based layouts. + + + + + org.apache.maven.resolver + maven-resolver-api + + + org.apache.maven.resolver + maven-resolver-spi + + + org.apache.maven.resolver + maven-resolver-util + + + javax.inject + javax.inject + provided + true + + + org.sonatype.sisu + sisu-guice + no_aop + test + + + junit + junit + test + + + org.hamcrest + hamcrest-core + test + + + org.apache.maven.resolver + maven-resolver-test-util + test + + + + + + + org.eclipse.sisu + sisu-maven-plugin + + + + diff --git a/aether-connector-basic/src/main/java/org/eclipse/aether/connector/basic/ArtifactTransportListener.java b/maven-resolver-connector-basic/src/main/java/org/eclipse/aether/connector/basic/ArtifactTransportListener.java similarity index 62% rename from aether-connector-basic/src/main/java/org/eclipse/aether/connector/basic/ArtifactTransportListener.java rename to maven-resolver-connector-basic/src/main/java/org/eclipse/aether/connector/basic/ArtifactTransportListener.java index e1694fac7..f8a9b1c93 100644 --- a/aether-connector-basic/src/main/java/org/eclipse/aether/connector/basic/ArtifactTransportListener.java +++ b/maven-resolver-connector-basic/src/main/java/org/eclipse/aether/connector/basic/ArtifactTransportListener.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.connector.basic; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.spi.connector.ArtifactTransfer; import org.eclipse.aether.spi.connector.transport.Transporter; diff --git a/aether-connector-basic/src/main/java/org/eclipse/aether/connector/basic/BasicRepositoryConnector.java b/maven-resolver-connector-basic/src/main/java/org/eclipse/aether/connector/basic/BasicRepositoryConnector.java similarity index 95% rename from aether-connector-basic/src/main/java/org/eclipse/aether/connector/basic/BasicRepositoryConnector.java rename to maven-resolver-connector-basic/src/main/java/org/eclipse/aether/connector/basic/BasicRepositoryConnector.java index 37e86188d..4f2e37eb3 100644 --- a/aether-connector-basic/src/main/java/org/eclipse/aether/connector/basic/BasicRepositoryConnector.java +++ b/maven-resolver-connector-basic/src/main/java/org/eclipse/aether/connector/basic/BasicRepositoryConnector.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.connector.basic; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.net.URI; @@ -157,7 +166,7 @@ private Executor getExecutor( Collection artifacts, Collection metadatas ) if ( executor == null ) { executor = - new ThreadPoolExecutor( maxThreads, maxThreads, 3, TimeUnit.SECONDS, + new ThreadPoolExecutor( maxThreads, maxThreads, 3L, TimeUnit.SECONDS, new LinkedBlockingQueue(), new WorkerThreadFactory( getClass().getSimpleName() + '-' + repository.getHost() + '-' ) ); @@ -291,12 +300,12 @@ public void put( Collection artifactUploads, private static Collection safe( Collection items ) { - return ( items != null ) ? items : Collections. emptyList(); + return ( items != null ) ? items : Collections.emptyList(); } private TransferResource newTransferResource( URI path, File file, RequestTrace trace ) { - return new TransferResource( repository.getUrl(), path.toString(), file, trace ); + return new TransferResource( repository.getId(), repository.getUrl(), path.toString(), file, trace ); } private TransferEvent.Builder newEventBuilder( TransferResource resource, boolean upload, boolean peek ) diff --git a/aether-connector-basic/src/main/java/org/eclipse/aether/connector/basic/BasicRepositoryConnectorFactory.java b/maven-resolver-connector-basic/src/main/java/org/eclipse/aether/connector/basic/BasicRepositoryConnectorFactory.java similarity index 89% rename from aether-connector-basic/src/main/java/org/eclipse/aether/connector/basic/BasicRepositoryConnectorFactory.java rename to maven-resolver-connector-basic/src/main/java/org/eclipse/aether/connector/basic/BasicRepositoryConnectorFactory.java index b1f0576bb..8338daf4c 100644 --- a/aether-connector-basic/src/main/java/org/eclipse/aether/connector/basic/BasicRepositoryConnectorFactory.java +++ b/maven-resolver-connector-basic/src/main/java/org/eclipse/aether/connector/basic/BasicRepositoryConnectorFactory.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.connector.basic; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.inject.Inject; import javax.inject.Named; diff --git a/aether-connector-basic/src/main/java/org/eclipse/aether/connector/basic/ChecksumCalculator.java b/maven-resolver-connector-basic/src/main/java/org/eclipse/aether/connector/basic/ChecksumCalculator.java similarity index 81% rename from aether-connector-basic/src/main/java/org/eclipse/aether/connector/basic/ChecksumCalculator.java rename to maven-resolver-connector-basic/src/main/java/org/eclipse/aether/connector/basic/ChecksumCalculator.java index 6e5d32622..03868d317 100644 --- a/aether-connector-basic/src/main/java/org/eclipse/aether/connector/basic/ChecksumCalculator.java +++ b/maven-resolver-connector-basic/src/main/java/org/eclipse/aether/connector/basic/ChecksumCalculator.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.connector.basic; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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; @@ -126,7 +135,7 @@ public void init( long dataOffset ) { checksum.reset(); } - if ( dataOffset <= 0 ) + if ( dataOffset <= 0L ) { return; } @@ -135,7 +144,7 @@ public void init( long dataOffset ) FileInputStream fis = new FileInputStream( targetFile ); try { - long total = 0; + long total = 0L; ByteBuffer buffer = ByteBuffer.allocate( 1024 * 32 ); for ( byte[] array = buffer.array(); total < dataOffset; ) { @@ -158,16 +167,21 @@ public void init( long dataOffset ) buffer.limit( read ); update( buffer ); } + fis.close(); + fis = null; } finally { try { - fis.close(); + if ( fis != null ) + { + fis.close(); + } } catch ( IOException e ) { - // irrelevant + // Suppressed } } } diff --git a/aether-connector-basic/src/main/java/org/eclipse/aether/connector/basic/ChecksumValidator.java b/maven-resolver-connector-basic/src/main/java/org/eclipse/aether/connector/basic/ChecksumValidator.java similarity index 90% rename from aether-connector-basic/src/main/java/org/eclipse/aether/connector/basic/ChecksumValidator.java rename to maven-resolver-connector-basic/src/main/java/org/eclipse/aether/connector/basic/ChecksumValidator.java index 93afb28ed..828999705 100644 --- a/aether-connector-basic/src/main/java/org/eclipse/aether/connector/basic/ChecksumValidator.java +++ b/maven-resolver-connector-basic/src/main/java/org/eclipse/aether/connector/basic/ChecksumValidator.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.connector.basic; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.net.URI; diff --git a/aether-connector-basic/src/main/java/org/eclipse/aether/connector/basic/MetadataTransportListener.java b/maven-resolver-connector-basic/src/main/java/org/eclipse/aether/connector/basic/MetadataTransportListener.java similarity index 62% rename from aether-connector-basic/src/main/java/org/eclipse/aether/connector/basic/MetadataTransportListener.java rename to maven-resolver-connector-basic/src/main/java/org/eclipse/aether/connector/basic/MetadataTransportListener.java index 4314d2578..7f8bc6d8c 100644 --- a/aether-connector-basic/src/main/java/org/eclipse/aether/connector/basic/MetadataTransportListener.java +++ b/maven-resolver-connector-basic/src/main/java/org/eclipse/aether/connector/basic/MetadataTransportListener.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.connector.basic; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.spi.connector.MetadataTransfer; import org.eclipse.aether.spi.connector.transport.Transporter; diff --git a/aether-connector-basic/src/main/java/org/eclipse/aether/connector/basic/PartialFile.java b/maven-resolver-connector-basic/src/main/java/org/eclipse/aether/connector/basic/PartialFile.java similarity index 81% rename from aether-connector-basic/src/main/java/org/eclipse/aether/connector/basic/PartialFile.java rename to maven-resolver-connector-basic/src/main/java/org/eclipse/aether/connector/basic/PartialFile.java index 035a63756..5a93a2cf1 100644 --- a/aether-connector-basic/src/main/java/org/eclipse/aether/connector/basic/PartialFile.java +++ b/maven-resolver-connector-basic/src/main/java/org/eclipse/aether/connector/basic/PartialFile.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.connector.basic; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Closeable; import java.io.File; import java.io.IOException; @@ -66,7 +75,7 @@ private static FileLock lock( File lockFile, File partFile, int requestTimeout, boolean interrupted = false; try { - for ( long lastLength = -1, lastTime = 0;; ) + for ( long lastLength = -1L, lastTime = 0L;; ) { FileLock lock = tryLock( lockFile ); if ( lock != null ) @@ -78,7 +87,7 @@ private static FileLock lock( File lockFile, File partFile, int requestTimeout, long currentTime = System.currentTimeMillis(); if ( currentLength != lastLength ) { - if ( lastLength < 0 ) + if ( lastLength < 0L ) { concurrent[0] = true; /* @@ -100,7 +109,7 @@ else if ( requestTimeout > 0 && currentTime - lastTime > Math.max( requestTimeou try { - Thread.sleep( 100 ); + Thread.sleep( 100L ); } catch ( InterruptedException e ) { @@ -120,44 +129,48 @@ else if ( requestTimeout > 0 && currentTime - lastTime > Math.max( requestTimeou private static FileLock tryLock( File lockFile ) throws IOException { - RandomAccessFile raf = new RandomAccessFile( lockFile, "rw" ); + RandomAccessFile raf = null; + FileLock lock = null; try { - FileLock lock = raf.getChannel().tryLock( 0, 1, false ); + raf = new RandomAccessFile( lockFile, "rw" ); + lock = raf.getChannel().tryLock( 0, 1, false ); if ( lock == null ) { - close( raf ); + raf.close(); + raf = null; } return lock; } catch ( OverlappingFileLockException e ) { - close( raf ); return null; } catch ( RuntimeException e ) { - close( raf ); lockFile.delete(); + lock = null; throw e; } catch ( IOException e ) { - close( raf ); lockFile.delete(); + lock = null; throw e; } - } - - private static void close( Closeable file ) - { - try - { - file.close(); - } - catch ( IOException e ) + finally { - // irrelevant + try + { + if ( lock == null && raf != null ) + { + raf.close(); + } + } + catch ( final IOException e ) + { + // Suppressed + } } } @@ -166,9 +179,9 @@ public boolean isConcurrent() return concurrent; } - public void close() + public void close() throws IOException { - close( lock.channel() ); + lock.channel().close(); lockFile.delete(); } @@ -268,7 +281,7 @@ public boolean isResume() return lockFile != null && partFile.length() >= threshold; } - public void close() + public void close() throws IOException { if ( partFile.exists() && !isResume() ) { diff --git a/aether-connector-basic/src/main/java/org/eclipse/aether/connector/basic/TransferTransportListener.java b/maven-resolver-connector-basic/src/main/java/org/eclipse/aether/connector/basic/TransferTransportListener.java similarity index 81% rename from aether-connector-basic/src/main/java/org/eclipse/aether/connector/basic/TransferTransportListener.java rename to maven-resolver-connector-basic/src/main/java/org/eclipse/aether/connector/basic/TransferTransportListener.java index a481d6fa8..bd95577b9 100644 --- a/aether-connector-basic/src/main/java/org/eclipse/aether/connector/basic/TransferTransportListener.java +++ b/maven-resolver-connector-basic/src/main/java/org/eclipse/aether/connector/basic/TransferTransportListener.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.connector.basic; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.nio.ByteBuffer; import java.util.Collections; import java.util.Map; diff --git a/maven-resolver-connector-basic/src/main/java/org/eclipse/aether/connector/basic/package-info.java b/maven-resolver-connector-basic/src/main/java/org/eclipse/aether/connector/basic/package-info.java new file mode 100644 index 000000000..0f48bf653 --- /dev/null +++ b/maven-resolver-connector-basic/src/main/java/org/eclipse/aether/connector/basic/package-info.java @@ -0,0 +1,24 @@ +// CHECKSTYLE_OFF: RegexpHeader +/** + * Support for downloads/uploads using remote repositories that have a URI-based content structure/layout. + */ +package org.eclipse.aether.connector.basic; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ diff --git a/maven-resolver-connector-basic/src/site/site.xml b/maven-resolver-connector-basic/src/site/site.xml new file mode 100644 index 000000000..3a16bf98b --- /dev/null +++ b/maven-resolver-connector-basic/src/site/site.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/aether-connector-basic/src/test/java/org/eclipse/aether/connector/basic/ChecksumCalculatorTest.java b/maven-resolver-connector-basic/src/test/java/org/eclipse/aether/connector/basic/ChecksumCalculatorTest.java similarity index 84% rename from aether-connector-basic/src/test/java/org/eclipse/aether/connector/basic/ChecksumCalculatorTest.java rename to maven-resolver-connector-basic/src/test/java/org/eclipse/aether/connector/basic/ChecksumCalculatorTest.java index 36db84298..616eb1dd2 100644 --- a/aether-connector-basic/src/test/java/org/eclipse/aether/connector/basic/ChecksumCalculatorTest.java +++ b/maven-resolver-connector-basic/src/test/java/org/eclipse/aether/connector/basic/ChecksumCalculatorTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.connector.basic; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import java.io.File; @@ -17,6 +26,7 @@ import java.io.UnsupportedEncodingException; import java.net.URI; import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; import java.security.NoSuchAlgorithmException; import java.util.ArrayList; import java.util.List; @@ -48,14 +58,7 @@ private ChecksumCalculator newCalculator( String... algos ) private ByteBuffer toBuffer( String data ) { - try - { - return ByteBuffer.wrap( data.getBytes( "UTF-8" ) ); - } - catch ( UnsupportedEncodingException e ) - { - throw new IllegalStateException( e ); - } + return ByteBuffer.wrap( data.getBytes( StandardCharsets.UTF_8 ) ); } @Before diff --git a/aether-connector-basic/src/test/java/org/eclipse/aether/connector/basic/ChecksumValidatorTest.java b/maven-resolver-connector-basic/src/test/java/org/eclipse/aether/connector/basic/ChecksumValidatorTest.java similarity index 94% rename from aether-connector-basic/src/test/java/org/eclipse/aether/connector/basic/ChecksumValidatorTest.java rename to maven-resolver-connector-basic/src/test/java/org/eclipse/aether/connector/basic/ChecksumValidatorTest.java index 886909b17..6d677686e 100644 --- a/aether-connector-basic/src/test/java/org/eclipse/aether/connector/basic/ChecksumValidatorTest.java +++ b/maven-resolver-connector-basic/src/test/java/org/eclipse/aether/connector/basic/ChecksumValidatorTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.connector.basic; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import java.io.File; diff --git a/aether-connector-basic/src/test/java/org/eclipse/aether/connector/basic/PartialFileTest.java b/maven-resolver-connector-basic/src/test/java/org/eclipse/aether/connector/basic/PartialFileTest.java similarity index 89% rename from aether-connector-basic/src/test/java/org/eclipse/aether/connector/basic/PartialFileTest.java rename to maven-resolver-connector-basic/src/test/java/org/eclipse/aether/connector/basic/PartialFileTest.java index 55bea7fe9..c6fd022bb 100644 --- a/aether-connector-basic/src/test/java/org/eclipse/aether/connector/basic/PartialFileTest.java +++ b/maven-resolver-connector-basic/src/test/java/org/eclipse/aether/connector/basic/PartialFileTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.connector.basic; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import static org.junit.Assume.*; @@ -102,7 +111,7 @@ public void run() { for ( long start = System.currentTimeMillis(); System.currentTimeMillis() - start < sleep; ) { - Thread.sleep( 10 ); + Thread.sleep( 10L ); } fos.write( 65 ); fos.flush(); @@ -159,7 +168,7 @@ private PartialFile newPartialFile( long resumeThreshold, int requestTimeout ) throws Exception { PartialFile.Factory factory = - new PartialFile.Factory( resumeThreshold >= 0, resumeThreshold, requestTimeout, + new PartialFile.Factory( resumeThreshold >= 0L, resumeThreshold, requestTimeout, new TestLoggerFactory().getLogger( "" ) ); PartialFile partFile = factory.newInstance( dstFile, remoteAccessChecker ); if ( partFile != null ) @@ -248,7 +257,7 @@ public void testResumeThreshold() partialFile.close(); } - @Test( timeout = 10000 ) + @Test( timeout = 10000L ) public void testResumeConcurrently_RequestTimeout() throws Exception { @@ -267,12 +276,12 @@ public void testResumeConcurrently_RequestTimeout() writer.join(); } - @Test( timeout = 10000 ) + @Test( timeout = 10000L ) public void testResumeConcurrently_AwaitCompletion_ConcurrentWriterSucceeds() throws Exception { assumeTrue( PROPER_LOCK_SUPPORT ); - assertTrue( dstFile.setLastModified( System.currentTimeMillis() - 60 * 1000 ) ); + assertTrue( dstFile.setLastModified( System.currentTimeMillis() - 60L * 1000L ) ); ConcurrentWriter writer = new ConcurrentWriter( dstFile, 100, 10 ); assertNull( newPartialFile( 0, 500 ) ); writer.join(); @@ -280,7 +289,7 @@ public void testResumeConcurrently_AwaitCompletion_ConcurrentWriterSucceeds() assertEquals( 1, remoteAccessChecker.invocations ); } - @Test( timeout = 10000 ) + @Test( timeout = 10000L ) public void testResumeConcurrently_AwaitCompletion_ConcurrentWriterFails() throws Exception { @@ -295,7 +304,7 @@ public void testResumeConcurrently_AwaitCompletion_ConcurrentWriterFails() assertEquals( 1, remoteAccessChecker.invocations ); } - @Test( timeout = 10000 ) + @Test( timeout = 10000L ) public void testResumeConcurrently_CheckRemoteAccess() throws Exception { diff --git a/maven-resolver-impl/pom.xml b/maven-resolver-impl/pom.xml new file mode 100644 index 000000000..d2d271ba7 --- /dev/null +++ b/maven-resolver-impl/pom.xml @@ -0,0 +1,102 @@ + + + + + + 4.0.0 + + + org.apache.maven.resolver + maven-resolver + 1.2.0-SNAPSHOT + + + maven-resolver-impl + + Maven Artifact Resolver Implementation + + An implementation of the repository system. + + + + + org.apache.maven.resolver + maven-resolver-api + + + org.apache.maven.resolver + maven-resolver-spi + + + org.apache.maven.resolver + maven-resolver-util + + + javax.inject + javax.inject + provided + true + + + org.eclipse.sisu + org.eclipse.sisu.inject + provided + true + + + org.sonatype.sisu + sisu-guice + no_aop + provided + true + + + org.slf4j + slf4j-api + provided + true + + + junit + junit + test + + + org.hamcrest + hamcrest-core + test + + + org.apache.maven.resolver + maven-resolver-test-util + test + + + + + + + org.eclipse.sisu + sisu-maven-plugin + + + + diff --git a/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/AetherModule.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/AetherModule.java new file mode 100644 index 000000000..4e05ec24d --- /dev/null +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/AetherModule.java @@ -0,0 +1,35 @@ +package org.eclipse.aether.impl; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT 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 ready-made Guice module that sets up bindings for all components from this library. To acquire a complete + * repository system, clients need to bind an artifact descriptor reader, a version resolver, a version range resolver, + * zero or more metadata generator factories, some repository connector and transporter factories to access remote + * repositories. + * + * @deprecated Use {@link org.eclipse.aether.impl.guice.AetherModule} instead. + */ +@Deprecated +public final class AetherModule + extends org.eclipse.aether.impl.guice.AetherModule +{ + +} diff --git a/aether-impl/src/main/java/org/eclipse/aether/impl/ArtifactDescriptorReader.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/ArtifactDescriptorReader.java similarity index 66% rename from aether-impl/src/main/java/org/eclipse/aether/impl/ArtifactDescriptorReader.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/impl/ArtifactDescriptorReader.java index b5c457eeb..66f352867 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/impl/ArtifactDescriptorReader.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/ArtifactDescriptorReader.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.resolution.ArtifactDescriptorException; diff --git a/aether-impl/src/main/java/org/eclipse/aether/impl/ArtifactResolver.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/ArtifactResolver.java similarity index 76% rename from aether-impl/src/main/java/org/eclipse/aether/impl/ArtifactResolver.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/impl/ArtifactResolver.java index 2d88fa999..3b4359232 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/impl/ArtifactResolver.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/ArtifactResolver.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import java.util.Collection; import java.util.List; diff --git a/aether-impl/src/main/java/org/eclipse/aether/impl/DefaultServiceLocator.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/DefaultServiceLocator.java similarity index 93% rename from aether-impl/src/main/java/org/eclipse/aether/impl/DefaultServiceLocator.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/impl/DefaultServiceLocator.java index aef0627d7..69f32ebdc 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/impl/DefaultServiceLocator.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/DefaultServiceLocator.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Constructor; import java.lang.reflect.Modifier; import java.util.ArrayList; @@ -23,7 +32,6 @@ import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.internal.impl.DefaultArtifactResolver; import org.eclipse.aether.internal.impl.DefaultChecksumPolicyProvider; -import org.eclipse.aether.internal.impl.DefaultDependencyCollector; import org.eclipse.aether.internal.impl.DefaultDeployer; import org.eclipse.aether.internal.impl.DefaultFileProcessor; import org.eclipse.aether.internal.impl.DefaultInstaller; @@ -42,6 +50,7 @@ import org.eclipse.aether.internal.impl.EnhancedLocalRepositoryManagerFactory; import org.eclipse.aether.internal.impl.Maven2RepositoryLayoutFactory; import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory; +import org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector; import org.eclipse.aether.internal.impl.slf4j.Slf4jLoggerFactory; import org.eclipse.aether.spi.connector.checksum.ChecksumPolicyProvider; import org.eclipse.aether.spi.connector.layout.RepositoryLayoutFactory; @@ -318,7 +327,7 @@ public void setErrorHandler( ErrorHandler errorHandler ) /** * A hook to customize the handling of errors encountered while locating a service implementation. */ - public static abstract class ErrorHandler + public abstract static class ErrorHandler { /** diff --git a/aether-impl/src/main/java/org/eclipse/aether/impl/DependencyCollector.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/DependencyCollector.java similarity index 71% rename from aether-impl/src/main/java/org/eclipse/aether/impl/DependencyCollector.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/impl/DependencyCollector.java index b8b9c689e..9fa58178c 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/impl/DependencyCollector.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/DependencyCollector.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.collection.CollectRequest; diff --git a/aether-impl/src/main/java/org/eclipse/aether/impl/Deployer.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/Deployer.java similarity index 62% rename from aether-impl/src/main/java/org/eclipse/aether/impl/Deployer.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/impl/Deployer.java index e6d41b345..8f6b8fc36 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/impl/Deployer.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/Deployer.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.deployment.DeployRequest; diff --git a/aether-impl/src/main/java/org/eclipse/aether/impl/Installer.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/Installer.java similarity index 62% rename from aether-impl/src/main/java/org/eclipse/aether/impl/Installer.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/impl/Installer.java index 704d75786..a9ebed638 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/impl/Installer.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/Installer.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.installation.InstallRequest; diff --git a/aether-impl/src/main/java/org/eclipse/aether/impl/LocalRepositoryProvider.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/LocalRepositoryProvider.java similarity index 69% rename from aether-impl/src/main/java/org/eclipse/aether/impl/LocalRepositoryProvider.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/impl/LocalRepositoryProvider.java index 495e09ed3..d5f4be28d 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/impl/LocalRepositoryProvider.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/LocalRepositoryProvider.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.repository.LocalRepository; diff --git a/aether-impl/src/main/java/org/eclipse/aether/impl/MetadataGenerator.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/MetadataGenerator.java similarity index 64% rename from aether-impl/src/main/java/org/eclipse/aether/impl/MetadataGenerator.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/impl/MetadataGenerator.java index e58181a3c..b4356cc67 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/impl/MetadataGenerator.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/MetadataGenerator.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import java.util.Collection; import org.eclipse.aether.artifact.Artifact; diff --git a/aether-impl/src/main/java/org/eclipse/aether/impl/MetadataGeneratorFactory.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/MetadataGeneratorFactory.java similarity index 67% rename from aether-impl/src/main/java/org/eclipse/aether/impl/MetadataGeneratorFactory.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/impl/MetadataGeneratorFactory.java index 1acd2940a..5f2b74052 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/impl/MetadataGeneratorFactory.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/MetadataGeneratorFactory.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.deployment.DeployRequest; import org.eclipse.aether.installation.InstallRequest; diff --git a/aether-impl/src/main/java/org/eclipse/aether/impl/MetadataResolver.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/MetadataResolver.java similarity index 64% rename from aether-impl/src/main/java/org/eclipse/aether/impl/MetadataResolver.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/impl/MetadataResolver.java index 6e0939dbc..886e85686 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/impl/MetadataResolver.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/MetadataResolver.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import java.util.Collection; import java.util.List; diff --git a/aether-impl/src/main/java/org/eclipse/aether/impl/OfflineController.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/OfflineController.java similarity index 69% rename from aether-impl/src/main/java/org/eclipse/aether/impl/OfflineController.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/impl/OfflineController.java index 0b0fc6cd3..22f5a4b33 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/impl/OfflineController.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/OfflineController.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2012, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.transfer.RepositoryOfflineException; diff --git a/aether-impl/src/main/java/org/eclipse/aether/impl/RemoteRepositoryManager.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/RemoteRepositoryManager.java similarity index 78% rename from aether-impl/src/main/java/org/eclipse/aether/impl/RemoteRepositoryManager.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/impl/RemoteRepositoryManager.java index 850f2b352..23685e7d6 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/impl/RemoteRepositoryManager.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/RemoteRepositoryManager.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.eclipse.aether.RepositorySystemSession; diff --git a/aether-impl/src/main/java/org/eclipse/aether/impl/RepositoryConnectorProvider.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/RepositoryConnectorProvider.java similarity index 62% rename from aether-impl/src/main/java/org/eclipse/aether/impl/RepositoryConnectorProvider.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/impl/RepositoryConnectorProvider.java index 237ba9a9b..8d665c0a9 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/impl/RepositoryConnectorProvider.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/RepositoryConnectorProvider.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2012, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.spi.connector.RepositoryConnector; diff --git a/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/RepositoryEventDispatcher.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/RepositoryEventDispatcher.java new file mode 100644 index 000000000..2d29eb7c7 --- /dev/null +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/RepositoryEventDispatcher.java @@ -0,0 +1,41 @@ +package org.eclipse.aether.impl; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import org.eclipse.aether.RepositoryEvent; + +/** + * Dispatches repository events to registered listeners. + * + * @noimplement This interface is not intended to be implemented by clients. + * @noextend This interface is not intended to be extended by clients. + * @provisional This type is provisional and can be changed, moved or removed without prior notice. + */ +public interface RepositoryEventDispatcher +{ + + /** + * Dispatches the specified repository event to all registered listeners. + * + * @param event The event to dispatch, must not be {@code null}. + */ + void dispatch( RepositoryEvent event ); + +} diff --git a/aether-impl/src/main/java/org/eclipse/aether/impl/SyncContextFactory.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/SyncContextFactory.java similarity index 57% rename from aether-impl/src/main/java/org/eclipse/aether/impl/SyncContextFactory.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/impl/SyncContextFactory.java index e6074c30e..95086d19a 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/impl/SyncContextFactory.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/SyncContextFactory.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.SyncContext; diff --git a/aether-impl/src/main/java/org/eclipse/aether/impl/UpdateCheck.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/UpdateCheck.java similarity index 90% rename from aether-impl/src/main/java/org/eclipse/aether/impl/UpdateCheck.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/impl/UpdateCheck.java index 74a025d40..b77d2bcc6 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/impl/UpdateCheck.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/UpdateCheck.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.eclipse.aether.RepositoryException; @@ -18,6 +27,8 @@ /** * A request to check if an update of an artifact/metadata from a remote repository is needed. * + * @param + * @param * @see UpdateCheckManager * @provisional This type is provisional and can be changed, moved or removed without prior notice. */ diff --git a/aether-impl/src/main/java/org/eclipse/aether/impl/UpdateCheckManager.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/UpdateCheckManager.java similarity index 73% rename from aether-impl/src/main/java/org/eclipse/aether/impl/UpdateCheckManager.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/impl/UpdateCheckManager.java index 81d2f58a4..cd35df02d 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/impl/UpdateCheckManager.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/UpdateCheckManager.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.metadata.Metadata; diff --git a/aether-impl/src/main/java/org/eclipse/aether/impl/UpdatePolicyAnalyzer.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/UpdatePolicyAnalyzer.java similarity index 65% rename from aether-impl/src/main/java/org/eclipse/aether/impl/UpdatePolicyAnalyzer.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/impl/UpdatePolicyAnalyzer.java index 27f637503..ce8018a19 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/impl/UpdatePolicyAnalyzer.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/UpdatePolicyAnalyzer.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.RepositorySystemSession; /** diff --git a/aether-impl/src/main/java/org/eclipse/aether/impl/VersionRangeResolver.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/VersionRangeResolver.java similarity index 69% rename from aether-impl/src/main/java/org/eclipse/aether/impl/VersionRangeResolver.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/impl/VersionRangeResolver.java index 277a35ee1..89bf706be 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/impl/VersionRangeResolver.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/VersionRangeResolver.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.resolution.VersionRangeRequest; diff --git a/aether-impl/src/main/java/org/eclipse/aether/impl/VersionResolver.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/VersionResolver.java similarity index 59% rename from aether-impl/src/main/java/org/eclipse/aether/impl/VersionResolver.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/impl/VersionResolver.java index 1f20e405d..e6a8a108f 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/impl/VersionResolver.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/VersionResolver.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.resolution.VersionRequest; diff --git a/aether-impl/src/main/java/org/eclipse/aether/impl/guice/AetherModule.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/guice/AetherModule.java similarity index 90% rename from aether-impl/src/main/java/org/eclipse/aether/impl/guice/AetherModule.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/impl/guice/AetherModule.java index def8761db..80e19a5b8 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/impl/guice/AetherModule.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/guice/AetherModule.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2011, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.impl.guice; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.HashSet; import java.util.Set; @@ -34,7 +43,6 @@ import org.eclipse.aether.impl.UpdatePolicyAnalyzer; import org.eclipse.aether.internal.impl.DefaultArtifactResolver; import org.eclipse.aether.internal.impl.DefaultChecksumPolicyProvider; -import org.eclipse.aether.internal.impl.DefaultDependencyCollector; import org.eclipse.aether.internal.impl.DefaultDeployer; import org.eclipse.aether.internal.impl.DefaultFileProcessor; import org.eclipse.aether.internal.impl.DefaultInstaller; @@ -53,6 +61,7 @@ import org.eclipse.aether.internal.impl.EnhancedLocalRepositoryManagerFactory; import org.eclipse.aether.internal.impl.Maven2RepositoryLayoutFactory; import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory; +import org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector; import org.eclipse.aether.internal.impl.slf4j.Slf4jLoggerFactory; import org.eclipse.aether.spi.connector.checksum.ChecksumPolicyProvider; import org.eclipse.aether.spi.connector.layout.RepositoryLayoutFactory; diff --git a/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/guice/package-info.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/guice/package-info.java new file mode 100644 index 000000000..64764f4a6 --- /dev/null +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/guice/package-info.java @@ -0,0 +1,24 @@ +// CHECKSTYLE_OFF: RegexpHeader +/** + * The integration with the dependency injection framework Google Guice. + */ +package org.eclipse.aether.impl.guice; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ diff --git a/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/package-info.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/package-info.java new file mode 100644 index 000000000..322996915 --- /dev/null +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/package-info.java @@ -0,0 +1,30 @@ +// CHECKSTYLE_OFF: RegexpHeader +/** + * The provisional interfaces defining the various sub components that implement the repository system. Aether Core + * provides stock implementations for most of these components but not all. To obtain a complete/runnable repository + * system, the application needs to provide implementations of the following component contracts: + * {@link org.eclipse.aether.impl.ArtifactDescriptorReader}, {@link org.eclipse.aether.impl.VersionResolver}, + * {@link org.eclipse.aether.impl.VersionRangeResolver} and potentially + * {@link org.eclipse.aether.impl.MetadataGeneratorFactory}. Said components basically define the file format of the + * metadata that is used to reason about an artifact's dependencies and available versions. + */ +package org.eclipse.aether.impl; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ diff --git a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/AbstractChecksumPolicy.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/AbstractChecksumPolicy.java similarity index 66% rename from aether-impl/src/main/java/org/eclipse/aether/internal/impl/AbstractChecksumPolicy.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/AbstractChecksumPolicy.java index 629443b72..368e31b61 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/AbstractChecksumPolicy.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/AbstractChecksumPolicy.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.spi.connector.checksum.ChecksumPolicy; import org.eclipse.aether.spi.log.Logger; import org.eclipse.aether.spi.log.LoggerFactory; diff --git a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/ArtifactRequestBuilder.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/ArtifactRequestBuilder.java similarity index 56% rename from aether-impl/src/main/java/org/eclipse/aether/internal/impl/ArtifactRequestBuilder.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/ArtifactRequestBuilder.java index b1045b58c..f9773dc6c 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/ArtifactRequestBuilder.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/ArtifactRequestBuilder.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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; diff --git a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/CacheUtils.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/CacheUtils.java similarity index 81% rename from aether-impl/src/main/java/org/eclipse/aether/internal/impl/CacheUtils.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/CacheUtils.java index 548daacd9..d7e8f01a5 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/CacheUtils.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/CacheUtils.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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 java.util.List; diff --git a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultArtifactResolver.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultArtifactResolver.java similarity index 96% rename from aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultArtifactResolver.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultArtifactResolver.java index 2426b52e9..37d296e20 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultArtifactResolver.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultArtifactResolver.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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; @@ -410,7 +419,7 @@ else if ( local.getFile() != null ) { group = new ResolutionGroup( repo ); groups.add( group ); - groupIt = Collections. emptyList().iterator(); + groupIt = Collections.emptyList().iterator(); } group.items.add( new ResolutionItem( trace, artifact, resolved, result, local, repo ) ); } diff --git a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultChecksumPolicyProvider.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultChecksumPolicyProvider.java similarity index 79% rename from aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultChecksumPolicyProvider.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultChecksumPolicyProvider.java index b1d2f6aa2..20c04844c 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultChecksumPolicyProvider.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultChecksumPolicyProvider.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.inject.Inject; import javax.inject.Named; diff --git a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultDeployer.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultDeployer.java similarity index 96% rename from aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultDeployer.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultDeployer.java index b349576d1..56951fa12 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultDeployer.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultDeployer.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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; diff --git a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultFileProcessor.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultFileProcessor.java similarity index 67% rename from aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultFileProcessor.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultFileProcessor.java index 04ab2b62b..389a806f8 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultFileProcessor.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultFileProcessor.java @@ -1,16 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl; -import java.io.Closeable; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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; @@ -18,6 +26,7 @@ import java.io.InputStream; import java.io.OutputStream; import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; import javax.inject.Named; @@ -31,21 +40,6 @@ public class DefaultFileProcessor implements FileProcessor { - private static void close( Closeable closeable ) - { - if ( closeable != null ) - { - try - { - closeable.close(); - } - catch ( IOException e ) - { - // too bad but who cares - } - } - } - /** * Thread-safe variant of {@link File#mkdirs()}. Creates the directory named by the given abstract pathname, * including any necessary but nonexistent parent directories. Note that if this operation fails it may have @@ -97,15 +91,26 @@ public void write( File target, String data ) if ( data != null ) { - fos.write( data.getBytes( "UTF-8" ) ); + fos.write( data.getBytes( StandardCharsets.UTF_8 ) ); } // allow output to report any flush/close errors fos.close(); + fos = null; } finally { - close( fos ); + try + { + if ( fos != null ) + { + fos.close(); + } + } + catch ( final IOException e ) + { + // Suppressed + } } } @@ -123,10 +128,21 @@ public void write( File target, InputStream source ) // allow output to report any flush/close errors fos.close(); + fos = null; } finally { - close( fos ); + try + { + if ( fos != null ) + { + fos.close(); + } + } + catch ( final IOException e ) + { + // Suppressed + } } } @@ -139,7 +155,7 @@ public void copy( File source, File target ) public long copy( File source, File target, ProgressListener listener ) throws IOException { - long total = 0; + long total = 0L; InputStream fis = null; OutputStream fos = null; @@ -155,11 +171,38 @@ public long copy( File source, File target, ProgressListener listener ) // allow output to report any flush/close errors fos.close(); + fos = null; + + fis.close(); + fis = null; } finally { - close( fis ); - close( fos ); + try + { + if ( fos != null ) + { + fos.close(); + } + } + catch ( final IOException e ) + { + // Suppressed + } + finally + { + try + { + if ( fis != null ) + { + fis.close(); + } + } + catch ( final IOException e ) + { + // Suppressed + } + } } return total; @@ -168,7 +211,7 @@ public long copy( File source, File target, ProgressListener listener ) private long copy( OutputStream os, InputStream is, ProgressListener listener ) throws IOException { - long total = 0; + long total = 0L; ByteBuffer buffer = ByteBuffer.allocate( 1024 * 32 ); byte[] array = buffer.array(); diff --git a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultInstaller.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultInstaller.java similarity index 94% rename from aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultInstaller.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultInstaller.java index a6e0a294b..ea9537163 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultInstaller.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultInstaller.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Collection; diff --git a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultLocalRepositoryProvider.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultLocalRepositoryProvider.java similarity index 86% rename from aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultLocalRepositoryProvider.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultLocalRepositoryProvider.java index 89a705e24..1f0597af5 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultLocalRepositoryProvider.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultLocalRepositoryProvider.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Collection; import java.util.List; diff --git a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultMetadataResolver.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultMetadataResolver.java similarity index 96% rename from aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultMetadataResolver.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultMetadataResolver.java index c064a0f8b..c751112fb 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultMetadataResolver.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultMetadataResolver.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Arrays; diff --git a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultOfflineController.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultOfflineController.java similarity index 80% rename from aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultOfflineController.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultOfflineController.java index 561ba8c8b..938a9e195 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultOfflineController.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultOfflineController.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2012, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Pattern; import javax.inject.Inject; @@ -26,6 +35,9 @@ import org.eclipse.aether.transfer.RepositoryOfflineException; import org.eclipse.aether.util.ConfigUtils; +/** + * + */ @Named public class DefaultOfflineController implements OfflineController, Service diff --git a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRemoteRepositoryManager.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRemoteRepositoryManager.java similarity index 82% rename from aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRemoteRepositoryManager.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRemoteRepositoryManager.java index ccb618a8a..148bf4dc8 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRemoteRepositoryManager.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRemoteRepositoryManager.java @@ -1,22 +1,33 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.List; import java.util.ListIterator; import javax.inject.Inject; import javax.inject.Named; +import org.eclipse.aether.RepositoryCache; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.impl.RemoteRepositoryManager; import org.eclipse.aether.impl.UpdatePolicyAnalyzer; @@ -42,6 +53,39 @@ public class DefaultRemoteRepositoryManager implements RemoteRepositoryManager, Service { + private static final class LoggedMirror + { + + private final Object[] keys; + + public LoggedMirror( RemoteRepository original, RemoteRepository mirror ) + { + keys = new Object[] { mirror.getId(), mirror.getUrl(), original.getId(), original.getUrl() }; + } + + @Override + public boolean equals( Object obj ) + { + if ( this == obj ) + { + return true; + } + else if ( !( obj instanceof LoggedMirror ) ) + { + return false; + } + LoggedMirror that = (LoggedMirror) obj; + return Arrays.equals( keys, that.keys ); + } + + @Override + public int hashCode() + { + return Arrays.hashCode( keys ); + } + + } + private Logger logger = NullLoggerFactory.LOGGER; private UpdatePolicyAnalyzer updatePolicyAnalyzer; @@ -121,8 +165,7 @@ public List aggregateRepositories( RepositorySystemSession ses if ( mirrorRepository != null ) { - logger.debug( "Using mirror " + mirrorRepository.getId() + " (" + mirrorRepository.getUrl() - + ") for " + recessiveRepository.getId() + " (" + recessiveRepository.getUrl() + ")." ); + logMirror( session, recessiveRepository, mirrorRepository ); repository = mirrorRepository; } } @@ -179,6 +222,26 @@ public List aggregateRepositories( RepositorySystemSession ses return result; } + private void logMirror( RepositorySystemSession session, RemoteRepository original, RemoteRepository mirror ) + { + if ( !logger.isDebugEnabled() ) + { + return; + } + RepositoryCache cache = session.getCache(); + if ( cache != null ) + { + Object key = new LoggedMirror( original, mirror ); + if ( cache.get( session, key ) != null ) + { + return; + } + cache.put( session, key, Boolean.TRUE ); + } + logger.debug( "Using mirror " + mirror.getId() + " (" + mirror.getUrl() + ") for " + original.getId() + " (" + + original.getUrl() + ")." ); + } + private String getKey( RemoteRepository repository ) { return repository.getId(); diff --git a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRepositoryConnectorProvider.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRepositoryConnectorProvider.java similarity index 88% rename from aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRepositoryConnectorProvider.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRepositoryConnectorProvider.java index 40f11006c..10fdc2378 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRepositoryConnectorProvider.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRepositoryConnectorProvider.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2012, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Collection; import java.util.List; diff --git a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRepositoryEventDispatcher.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRepositoryEventDispatcher.java similarity index 88% rename from aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRepositoryEventDispatcher.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRepositoryEventDispatcher.java index 03eabcfbc..2e56c93f7 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRepositoryEventDispatcher.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRepositoryEventDispatcher.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Collection; import java.util.Set; diff --git a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRepositoryLayoutProvider.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRepositoryLayoutProvider.java similarity index 85% rename from aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRepositoryLayoutProvider.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRepositoryLayoutProvider.java index 6fff271a7..9cc6371d4 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRepositoryLayoutProvider.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRepositoryLayoutProvider.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Collection; import java.util.List; diff --git a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRepositorySystem.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRepositorySystem.java similarity index 89% rename from aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRepositorySystem.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRepositorySystem.java index 8882814ac..b2c453c13 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRepositorySystem.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRepositorySystem.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Collection; import java.util.List; @@ -345,35 +354,42 @@ else if ( request.getCollectRequest() != null ) dce = e; collectResult = e.getResult(); } - result.setRoot( collectResult.getRoot() ); - result.setCycles( collectResult.getCycles() ); - result.setCollectExceptions( collectResult.getExceptions() ); + if ( collectResult != null ) + { + result.setRoot( collectResult.getRoot() ); + result.setCycles( collectResult.getCycles() ); + result.setCollectExceptions( collectResult.getExceptions() ); + } } else { throw new IllegalArgumentException( "dependency node or collect request missing" ); } - ArtifactRequestBuilder builder = new ArtifactRequestBuilder( trace ); - DependencyFilter filter = request.getFilter(); - DependencyVisitor visitor = ( filter != null ) ? new FilteringDependencyVisitor( builder, filter ) : builder; - visitor = new TreeDependencyVisitor( visitor ); - result.getRoot().accept( visitor ); - List requests = builder.getRequests(); - - List results; - try - { - results = artifactResolver.resolveArtifacts( session, requests ); - } - catch ( ArtifactResolutionException e ) + if ( result.getRoot() != null ) { - are = e; - results = e.getResults(); - } - result.setArtifactResults( results ); + ArtifactRequestBuilder builder = new ArtifactRequestBuilder( trace ); + DependencyFilter filter = request.getFilter(); + DependencyVisitor visitor = + ( filter != null ) ? new FilteringDependencyVisitor( builder, filter ) : builder; + visitor = new TreeDependencyVisitor( visitor ); + result.getRoot().accept( visitor ); + + List results; + try + { + List requests = builder.getRequests(); + results = artifactResolver.resolveArtifacts( session, requests ); + } + catch ( ArtifactResolutionException e ) + { + are = e; + results = e.getResults(); + } + result.setArtifactResults( results ); - updateNodesWithResolvedArtifacts( results ); + updateNodesWithResolvedArtifacts( results ); + } if ( dce != null ) { diff --git a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultSyncContextFactory.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultSyncContextFactory.java similarity index 55% rename from aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultSyncContextFactory.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultSyncContextFactory.java index 29101316f..69fdbc6eb 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultSyncContextFactory.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultSyncContextFactory.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import java.util.Collection; import javax.inject.Named; diff --git a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultTransporterProvider.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultTransporterProvider.java similarity index 85% rename from aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultTransporterProvider.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultTransporterProvider.java index 60b64b636..133fd8105 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultTransporterProvider.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultTransporterProvider.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Collection; import java.util.List; @@ -145,7 +154,7 @@ public Transporter newTransporter( RepositorySystemSession session, RemoteReposi { buffer.append( "Cannot access " ).append( repository.getUrl() ); buffer.append( " using the registered transporter factories: " ); - factories.list( buffer); + factories.list( buffer ); } throw new NoTransporterException( repository, buffer.toString(), errors.size() == 1 ? errors.get( 0 ) : null ); diff --git a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultUpdateCheckManager.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultUpdateCheckManager.java similarity index 95% rename from aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultUpdateCheckManager.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultUpdateCheckManager.java index 652f026f9..8a07e8490 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultUpdateCheckManager.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultUpdateCheckManager.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Collections; import java.util.HashMap; @@ -150,7 +159,7 @@ public void checkArtifact( RepositorySystemSession session, UpdateCheck implements Comparable> { diff --git a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/PrioritizedComponents.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/PrioritizedComponents.java similarity index 81% rename from aether-impl/src/main/java/org/eclipse/aether/internal/impl/PrioritizedComponents.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/PrioritizedComponents.java index da898a84a..3ec561324 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/PrioritizedComponents.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/PrioritizedComponents.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Collections; import java.util.List; @@ -25,7 +34,7 @@ final class PrioritizedComponents { - private final static String FACTORY_SUFFIX = "Factory"; + private static final String FACTORY_SUFFIX = "Factory"; private final Map configProps; diff --git a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/SafeTransferListener.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/SafeTransferListener.java similarity index 83% rename from aether-impl/src/main/java/org/eclipse/aether/internal/impl/SafeTransferListener.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/SafeTransferListener.java index ec53792d3..1ba8a37f3 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/SafeTransferListener.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/SafeTransferListener.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.spi.log.Logger; import org.eclipse.aether.transfer.AbstractTransferListener; diff --git a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/SimpleDigest.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/SimpleDigest.java similarity index 63% rename from aether-impl/src/main/java/org/eclipse/aether/internal/impl/SimpleDigest.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/SimpleDigest.java index 795c4d488..d948ac353 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/SimpleDigest.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/SimpleDigest.java @@ -1,16 +1,26 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.UnsupportedEncodingException; +import java.nio.charset.StandardCharsets; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; @@ -52,14 +62,7 @@ public void update( String data ) } if ( digest != null ) { - try - { - digest.update( data.getBytes( "UTF-8" ) ); - } - catch ( UnsupportedEncodingException e ) - { - // broken JVM - } + digest.update( data.getBytes( StandardCharsets.UTF_8 ) ); } else { diff --git a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/SimpleLocalRepositoryManager.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/SimpleLocalRepositoryManager.java similarity index 89% rename from aether-impl/src/main/java/org/eclipse/aether/internal/impl/SimpleLocalRepositoryManager.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/SimpleLocalRepositoryManager.java index 0a9a04bc3..97c7bba6a 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/SimpleLocalRepositoryManager.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/SimpleLocalRepositoryManager.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.SortedSet; import java.util.TreeSet; diff --git a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/SimpleLocalRepositoryManagerFactory.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/SimpleLocalRepositoryManagerFactory.java similarity index 75% rename from aether-impl/src/main/java/org/eclipse/aether/internal/impl/SimpleLocalRepositoryManagerFactory.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/SimpleLocalRepositoryManagerFactory.java index bc2122f02..3c2cf6dd9 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/SimpleLocalRepositoryManagerFactory.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/SimpleLocalRepositoryManagerFactory.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.inject.Inject; import javax.inject.Named; diff --git a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/TrackingFileManager.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/TrackingFileManager.java similarity index 78% rename from aether-impl/src/main/java/org/eclipse/aether/internal/impl/TrackingFileManager.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/TrackingFileManager.java index 0e83696f6..79a14b68d 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/TrackingFileManager.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/TrackingFileManager.java @@ -1,22 +1,30 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Closeable; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.RandomAccessFile; +import java.nio.channels.Channels; import java.nio.channels.FileChannel; import java.nio.channels.FileLock; import java.nio.channels.OverlappingFileLockException; @@ -60,6 +68,12 @@ public Properties read( File file ) Properties props = new Properties(); props.load( stream ); + lock.release(); + lock = null; + + stream.close(); + stream = null; + return props; } catch ( IOException e ) @@ -98,13 +112,7 @@ public Properties update( File file, Map updates ) if ( file.canRead() ) { - byte[] buffer = new byte[(int) raf.length()]; - - raf.readFully( buffer ); - - ByteArrayInputStream stream = new ByteArrayInputStream( buffer ); - - props.load( stream ); + props.load( Channels.newInputStream( raf.getChannel() ) ); } for ( Map.Entry update : updates.entrySet() ) @@ -119,15 +127,17 @@ public Properties update( File file, Map updates ) } } - ByteArrayOutputStream stream = new ByteArrayOutputStream( 1024 * 2 ); - logger.debug( "Writing tracking file " + file ); - props.store( stream, "NOTE: This is an Aether internal implementation file" - + ", its format can be changed without prior notice." ); + raf.setLength( 0 ); + props.store( Channels.newOutputStream( raf.getChannel() ), + "NOTE: This is an Aether internal implementation file" + + ", its format can be changed without prior notice." ); + + lock.release(); + lock = null; - raf.seek( 0 ); - raf.write( stream.toByteArray() ); - raf.setLength( raf.getFilePointer() ); + raf.close(); + raf = null; } catch ( IOException e ) { @@ -211,7 +221,7 @@ private FileLock lock( FileChannel channel, long size, boolean shared ) } try { - Thread.sleep( 50 ); + Thread.sleep( 50L ); } catch ( InterruptedException e1 ) { diff --git a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/Utils.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/Utils.java similarity index 83% rename from aether-impl/src/main/java/org/eclipse/aether/internal/impl/Utils.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/Utils.java index df0b20a9d..deb830d02 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/Utils.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/Utils.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Collection; import java.util.List; diff --git a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/WarnChecksumPolicy.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/WarnChecksumPolicy.java similarity index 54% rename from aether-impl/src/main/java/org/eclipse/aether/internal/impl/WarnChecksumPolicy.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/WarnChecksumPolicy.java index 9b388786f..b5e72ecda 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/WarnChecksumPolicy.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/WarnChecksumPolicy.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.spi.log.LoggerFactory; import org.eclipse.aether.transfer.ChecksumFailureException; import org.eclipse.aether.transfer.TransferResource; diff --git a/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/Args.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/Args.java new file mode 100644 index 000000000..0147aa588 --- /dev/null +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/Args.java @@ -0,0 +1,65 @@ +package org.eclipse.aether.internal.impl.collect; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.RequestTrace; +import org.eclipse.aether.collection.CollectRequest; +import org.eclipse.aether.util.ConfigUtils; +import org.eclipse.aether.util.graph.manager.DependencyManagerUtils; + +class Args +{ + + final RepositorySystemSession session; + + final boolean ignoreRepos; + + final boolean premanagedState; + + final RequestTrace trace; + + final DataPool pool; + + final NodeStack nodes; + + final DefaultDependencyCollectionContext collectionContext; + + final DefaultVersionFilterContext versionContext; + + final CollectRequest request; + + + public Args( RepositorySystemSession session, RequestTrace trace, DataPool pool, NodeStack nodes, + DefaultDependencyCollectionContext collectionContext, DefaultVersionFilterContext versionContext, + CollectRequest request ) + { + this.session = session; + this.request = request; + this.ignoreRepos = session.isIgnoreArtifactDescriptorRepositories(); + this.premanagedState = ConfigUtils.getBoolean( session, false, DependencyManagerUtils.CONFIG_PROP_VERBOSE ); + this.trace = trace; + this.pool = pool; + this.nodes = nodes; + this.collectionContext = collectionContext; + this.versionContext = versionContext; + } + +} \ No newline at end of file diff --git a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/CachingArtifactTypeRegistry.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/CachingArtifactTypeRegistry.java similarity index 59% rename from aether-impl/src/main/java/org/eclipse/aether/internal/impl/CachingArtifactTypeRegistry.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/CachingArtifactTypeRegistry.java index fc1b6568c..cbd023e69 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/CachingArtifactTypeRegistry.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/CachingArtifactTypeRegistry.java @@ -1,14 +1,23 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether.internal.impl; +package org.eclipse.aether.internal.impl.collect; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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; diff --git a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DataPool.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/DataPool.java similarity index 68% rename from aether-impl/src/main/java/org/eclipse/aether/internal/impl/DataPool.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/DataPool.java index 545aa4929..d1c5f24be 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DataPool.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/DataPool.java @@ -1,21 +1,33 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether.internal.impl; - -import java.util.Collection; +package org.eclipse.aether.internal.impl.collect; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.WeakHashMap; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; import org.eclipse.aether.RepositoryCache; import org.eclipse.aether.RepositorySystemSession; @@ -33,6 +45,7 @@ import org.eclipse.aether.resolution.ArtifactDescriptorResult; import org.eclipse.aether.resolution.VersionRangeRequest; import org.eclipse.aether.resolution.VersionRangeResult; +import org.eclipse.aether.util.concurrency.FutureResult; import org.eclipse.aether.version.Version; import org.eclipse.aether.version.VersionConstraint; @@ -41,18 +54,14 @@ final class DataPool { - private static final String ARTIFACT_POOL = DataPool.class.getName() + "$Artifact"; - - private static final String DEPENDENCY_POOL = DataPool.class.getName() + "$Dependency"; + private static final String OBJECT_POOL = DataPool.class.getName() + "$Objects"; private static final String DESCRIPTORS = DataPool.class.getName() + "$Descriptors"; - public static final ArtifactDescriptorResult NO_DESCRIPTOR = - new ArtifactDescriptorResult( new ArtifactDescriptorRequest() ); - - private ObjectPool artifacts; + public static final Future NO_DESCRIPTOR = + new FutureResult( new ArtifactDescriptorResult( new ArtifactDescriptorRequest() ) ); - private ObjectPool dependencies; + private ObjectPool objectPool; private Map descriptors; @@ -67,26 +76,16 @@ public DataPool( RepositorySystemSession session ) if ( cache != null ) { - artifacts = (ObjectPool) cache.get( session, ARTIFACT_POOL ); - dependencies = (ObjectPool) cache.get( session, DEPENDENCY_POOL ); + objectPool = (ObjectPool) cache.get( session, OBJECT_POOL ); descriptors = (Map) cache.get( session, DESCRIPTORS ); } - if ( artifacts == null ) - { - artifacts = new ObjectPool(); - if ( cache != null ) - { - cache.put( session, ARTIFACT_POOL, artifacts ); - } - } - - if ( dependencies == null ) + if ( objectPool == null ) { - dependencies = new ObjectPool(); + objectPool = new ObjectPool(); if ( cache != null ) { - cache.put( session, DEPENDENCY_POOL, dependencies ); + cache.put( session, OBJECT_POOL, objectPool ); } } @@ -100,14 +99,9 @@ public DataPool( RepositorySystemSession session ) } } - public Artifact intern( Artifact artifact ) - { - return artifacts.intern( artifact ); - } - public Dependency intern( Dependency dependency ) { - return dependencies.intern( dependency ); + return objectPool.intern( dependency ); } public Object toKey( ArtifactDescriptorRequest request ) @@ -115,7 +109,7 @@ public Object toKey( ArtifactDescriptorRequest request ) return request.getArtifact(); } - public ArtifactDescriptorResult getDescriptor( Object key, ArtifactDescriptorRequest request ) + public Future getDescriptor( Object key, ArtifactDescriptorRequest request ) { Descriptor descriptor = descriptors.get( key ); if ( descriptor != null ) @@ -125,9 +119,9 @@ public ArtifactDescriptorResult getDescriptor( Object key, ArtifactDescriptorReq return null; } - public void putDescriptor( Object key, ArtifactDescriptorResult result ) + public void putDescriptor( Object key, Future futureResult ) { - descriptors.put( key, new GoodDescriptor( result ) ); + descriptors.put( key, new GoodDescriptor( futureResult ) ); } public void putDescriptor( Object key, ArtifactDescriptorException e ) @@ -155,10 +149,10 @@ public void putConstraint( Object key, VersionRangeResult result ) constraints.put( key, new Constraint( result ) ); } - public Object toKey( Artifact artifact, List repositories, DependencySelector selector, - DependencyManager manager, DependencyTraverser traverser, VersionFilter filter ) + public Object toKey( Artifact artifact, DefaultDependencyCollectionContext context ) { - return new GraphKey( artifact, repositories, selector, manager, traverser, filter ); + return new GraphKey( artifact, context.getRepositories(), context.getDepSelector(), + context.getDepManager(), context.getDepTraverser(), context.getVerFilter() ); } public List getChildren( Object key ) @@ -171,51 +165,69 @@ public void putChildren( Object key, List children ) nodes.put( key, children ); } - static abstract class Descriptor + abstract static class Descriptor { - public abstract ArtifactDescriptorResult toResult( ArtifactDescriptorRequest request ); + public abstract Future toResult( ArtifactDescriptorRequest request ); } static final class GoodDescriptor extends Descriptor { + Future futureResult; - final Artifact artifact; + public GoodDescriptor( Future futureResult ) + { + this.futureResult = futureResult; + } - final List relocations; + public Future toResult( final ArtifactDescriptorRequest request ) + { + return new Future() { - final Collection aliases; + public boolean cancel( boolean mayInterruptIfRunning ) + { + return futureResult.cancel( mayInterruptIfRunning ); + } - final List repositories; + public boolean isCancelled() + { + return futureResult.isCancelled(); + } - final List dependencies; + public boolean isDone() + { + return futureResult.isDone(); + } - final List managedDependencies; + public ArtifactDescriptorResult get() + throws InterruptedException, ExecutionException + { + ArtifactDescriptorResult result = futureResult.get(); + return wrap( request, result ); + } - public GoodDescriptor( ArtifactDescriptorResult result ) - { - artifact = result.getArtifact(); - relocations = result.getRelocations(); - aliases = result.getAliases(); - dependencies = result.getDependencies(); - managedDependencies = result.getManagedDependencies(); - repositories = result.getRepositories(); + public ArtifactDescriptorResult get( long timeout, TimeUnit unit ) + throws InterruptedException, ExecutionException, TimeoutException + { + ArtifactDescriptorResult result = futureResult.get( timeout, unit ); + return wrap( request, result ); + } + }; } - public ArtifactDescriptorResult toResult( ArtifactDescriptorRequest request ) + private ArtifactDescriptorResult wrap( ArtifactDescriptorRequest request, ArtifactDescriptorResult result ) { - ArtifactDescriptorResult result = new ArtifactDescriptorResult( request ); - result.setArtifact( artifact ); - result.setRelocations( relocations ); - result.setAliases( aliases ); - result.setDependencies( dependencies ); - result.setManagedDependencies( managedDependencies ); - result.setRepositories( repositories ); - return result; + ArtifactDescriptorResult wrapped = new ArtifactDescriptorResult( request ); + wrapped.setArtifact( result.getArtifact() ); + wrapped.setRelocations( result.getRelocations() ); + wrapped.setAliases( result.getAliases() ); + wrapped.setDependencies( result.getDependencies() ); + wrapped.setManagedDependencies( result.getManagedDependencies() ); + wrapped.setRepositories( result.getRepositories() ); + return wrapped; } - } static final class BadDescriptor @@ -224,11 +236,10 @@ static final class BadDescriptor static final BadDescriptor INSTANCE = new BadDescriptor(); - public ArtifactDescriptorResult toResult( ArtifactDescriptorRequest request ) + public Future toResult( ArtifactDescriptorRequest request ) { return NO_DESCRIPTOR; } - } static final class Constraint diff --git a/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/DefaultDependencyCollectionContext.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/DefaultDependencyCollectionContext.java new file mode 100644 index 000000000..74af2ae30 --- /dev/null +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/DefaultDependencyCollectionContext.java @@ -0,0 +1,258 @@ +package org.eclipse.aether.internal.impl.collect; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.RequestTrace; +import org.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.collection.CollectResult; +import org.eclipse.aether.collection.DependencyCollectionContext; +import org.eclipse.aether.collection.DependencyManager; +import org.eclipse.aether.collection.DependencySelector; +import org.eclipse.aether.collection.DependencyTraverser; +import org.eclipse.aether.collection.VersionFilter; +import org.eclipse.aether.graph.Dependency; +import org.eclipse.aether.repository.RemoteRepository; +import org.eclipse.aether.version.Version; + +/** + * @see DefaultDependencyCollector + */ +class DefaultDependencyCollectionContext + implements DependencyCollectionContext +{ + + private final RepositorySystemSession session; + + private Artifact artifact; + + private Dependency dependency; + + private List managedDependencies; + + private CollectResult collectResult; + + private RequestTrace trace; + + private Args args; + + private Results results; + + private List dependencies; + + private List repositories; + + private DependencySelector depSelector; + + private DependencyManager depManager; + + private DependencyTraverser depTraverser; + + private VersionFilter verFilter; + + private Version version; + + public DefaultDependencyCollectionContext( RepositorySystemSession session, Artifact artifact, + Dependency dependency, List managedDependencies ) + { + this.session = session; + this.artifact = ( dependency != null ) ? dependency.getArtifact() : artifact; + this.dependency = dependency; + this.managedDependencies = managedDependencies; + } + + public void prepareDescent() + { + DependencySelector depSelector = session.getDependencySelector(); + DependencyManager depManager = session.getDependencyManager(); + VersionFilter verFilter = session.getVersionFilter(); + setDepSelector( depSelector != null ? depSelector.deriveChildSelector( this ) : null ); + setDepManager( depManager != null ? depManager.deriveChildManager( this ) : null ); + setDepTraverser( depTraverser != null ? depTraverser.deriveChildTraverser( this ) : null ); + setVerFilter( verFilter != null ? verFilter.deriveChildFilter( this ) : null ); + + } + + public DefaultDependencyCollectionContext createChildContext() + { + DefaultDependencyCollectionContext childContext = + new DefaultDependencyCollectionContext( getSession(), getArtifact(), + getDependency(), getManagedDependencies() ); + childContext.depSelector = + getDepSelector() != null ? getDepSelector().deriveChildSelector( this ) : null; + childContext.depManager = + getDepManager() != null ? getDepManager().deriveChildManager( this ) : null; + childContext.depTraverser = + getDepTraverser() != null ? getDepTraverser().deriveChildTraverser( this ) : null; + childContext.verFilter = + getVerFilter() != null ? getVerFilter().deriveChildFilter( this ) : null; + return childContext; + } + + public RepositorySystemSession getSession() + { + return session; + } + + public Artifact getArtifact() + { + return artifact; + } + + public Dependency getDependency() + { + return dependency; + } + + public List getManagedDependencies() + { + return managedDependencies; + } + + public CollectResult getCollectResult() + { + return collectResult; + } + + public void setCollectResult( CollectResult collectResult ) + { + this.collectResult = collectResult; + } + + public Args getArgs() + { + return args; + } + + public void setArgs( Args args ) + { + this.args = args; + } + + public Results getResults() + { + return results; + } + + public void setResults( Results results ) + { + this.results = results; + } + + public List getDependencies() + { + return dependencies; + } + + public void setDependencies( List dependencies ) + { + this.dependencies = dependencies; + } + + public List getRepositories() + { + return repositories; + } + + public void setRepositories( List repositories ) + { + this.repositories = repositories; + } + + public DependencySelector getDepSelector() + { + return depSelector; + } + + public void setDepSelector( DependencySelector depSelector ) + { + this.depSelector = depSelector; + } + + public DependencyManager getDepManager() + { + return depManager; + } + + public void setDepManager( DependencyManager depManager ) + { + this.depManager = depManager; + } + + public DependencyTraverser getDepTraverser() + { + return depTraverser; + } + + public void setDepTraverser( DependencyTraverser depTraverser ) + { + this.depTraverser = depTraverser; + } + + public VersionFilter getVerFilter() + { + return verFilter; + } + + public void setVerFilter( VersionFilter verFilter ) + { + this.verFilter = verFilter; + } + + public void setDependency( Dependency dependency ) + { + artifact = dependency.getArtifact(); + this.dependency = dependency; + } + + public void setManagedDependencies( List managedDependencies ) + { + this.managedDependencies = managedDependencies; + } + + public RequestTrace getTrace() + { + return trace; + } + + public void setTrace( RequestTrace trace ) + { + this.trace = trace; + } + + public Version getVersion() + { + return version; + } + + public void setVersion( Version version ) + { + this.version = version; + } + + @Override + public String toString() + { + return String.valueOf( getDependency() ); + } + +} diff --git a/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/DefaultDependencyCollector.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/DefaultDependencyCollector.java new file mode 100644 index 000000000..a2cc55246 --- /dev/null +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/DefaultDependencyCollector.java @@ -0,0 +1,728 @@ +package org.eclipse.aether.internal.impl.collect; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import static org.eclipse.aether.internal.impl.collect.DependencyCollectionUtils.addDependencyNode; +import static org.eclipse.aether.internal.impl.collect.DependencyCollectionUtils.createArtifactDescriptorRequest; +import static org.eclipse.aether.internal.impl.collect.DependencyCollectionUtils.createDependencyNode; +import static org.eclipse.aether.internal.impl.collect.DependencyCollectionUtils.createVersionRangeRequest; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.Callable; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; + +import javax.inject.Inject; +import javax.inject.Named; + +import org.eclipse.aether.RepositoryException; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.RequestTrace; +import org.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.artifact.ArtifactProperties; +import org.eclipse.aether.collection.CollectRequest; +import org.eclipse.aether.collection.CollectResult; +import org.eclipse.aether.collection.DependencyCollectionException; +import org.eclipse.aether.collection.DependencyGraphTransformer; +import org.eclipse.aether.collection.DependencyTraverser; +import org.eclipse.aether.collection.VersionFilter; +import org.eclipse.aether.graph.DefaultDependencyNode; +import org.eclipse.aether.graph.Dependency; +import org.eclipse.aether.graph.DependencyNode; +import org.eclipse.aether.impl.ArtifactDescriptorReader; +import org.eclipse.aether.impl.DependencyCollector; +import org.eclipse.aether.impl.RemoteRepositoryManager; +import org.eclipse.aether.impl.VersionRangeResolver; +import org.eclipse.aether.repository.ArtifactRepository; +import org.eclipse.aether.repository.RemoteRepository; +import org.eclipse.aether.resolution.ArtifactDescriptorException; +import org.eclipse.aether.resolution.ArtifactDescriptorRequest; +import org.eclipse.aether.resolution.ArtifactDescriptorResult; +import org.eclipse.aether.resolution.VersionRangeRequest; +import org.eclipse.aether.resolution.VersionRangeResolutionException; +import org.eclipse.aether.resolution.VersionRangeResult; +import org.eclipse.aether.spi.locator.Service; +import org.eclipse.aether.spi.locator.ServiceLocator; +import org.eclipse.aether.spi.log.Logger; +import org.eclipse.aether.spi.log.LoggerFactory; +import org.eclipse.aether.spi.log.NullLoggerFactory; +import org.eclipse.aether.util.concurrency.FutureResult; +import org.eclipse.aether.util.graph.transformer.TransformationContextKeys; +import org.eclipse.aether.version.Version; + +/** + */ +@Named +public class DefaultDependencyCollector + implements DependencyCollector, Service +{ + + static final String CONFIG_PROP_MAX_EXCEPTIONS = "aether.dependencyCollector.maxExceptions"; + + static final String CONFIG_PROP_MAX_CYCLES = "aether.dependencyCollector.maxCycles"; + + private Logger logger = NullLoggerFactory.LOGGER; + + private RemoteRepositoryManager remoteRepositoryManager; + + private ArtifactDescriptorReader descriptorReader; + + private VersionRangeResolver versionRangeResolver; + + private ExecutorService executor = Executors.newFixedThreadPool( 5 ); + + public DefaultDependencyCollector() + { + // enables default constructor + } + + @Inject + DefaultDependencyCollector( RemoteRepositoryManager remoteRepositoryManager, + ArtifactDescriptorReader artifactDescriptorReader, + VersionRangeResolver versionRangeResolver, LoggerFactory loggerFactory ) + { + setRemoteRepositoryManager( remoteRepositoryManager ); + setArtifactDescriptorReader( artifactDescriptorReader ); + setVersionRangeResolver( versionRangeResolver ); + setLoggerFactory( loggerFactory ); + } + + public void initService( ServiceLocator locator ) + { + setLoggerFactory( locator.getService( LoggerFactory.class ) ); + setRemoteRepositoryManager( locator.getService( RemoteRepositoryManager.class ) ); + setArtifactDescriptorReader( locator.getService( ArtifactDescriptorReader.class ) ); + setVersionRangeResolver( locator.getService( VersionRangeResolver.class ) ); + } + + public DefaultDependencyCollector setLoggerFactory( LoggerFactory loggerFactory ) + { + this.logger = NullLoggerFactory.getSafeLogger( loggerFactory, getClass() ); + return this; + } + + public DefaultDependencyCollector setRemoteRepositoryManager( RemoteRepositoryManager remoteRepositoryManager ) + { + if ( remoteRepositoryManager == null ) + { + throw new IllegalArgumentException( "remote repository manager has not been specified" ); + } + this.remoteRepositoryManager = remoteRepositoryManager; + return this; + } + + public DefaultDependencyCollector setArtifactDescriptorReader( ArtifactDescriptorReader artifactDescriptorReader ) + { + if ( artifactDescriptorReader == null ) + { + throw new IllegalArgumentException( "artifact descriptor reader has not been specified" ); + } + descriptorReader = artifactDescriptorReader; + return this; + } + + public DefaultDependencyCollector setVersionRangeResolver( VersionRangeResolver versionRangeResolver ) + { + if ( versionRangeResolver == null ) + { + throw new IllegalArgumentException( "version range resolver has not been specified" ); + } + this.versionRangeResolver = versionRangeResolver; + return this; + } + + public CollectResult collectDependencies( RepositorySystemSession session, CollectRequest request ) + throws DependencyCollectionException + { + session = DependencyCollectionUtils.optimizeSession( session ); + + RequestTrace trace = RequestTrace.newChild( request.getTrace(), request ); + + CollectResult result = new CollectResult( request ); + + Dependency root = request.getRoot(); + List repositories = request.getRepositories(); + List managedDependencies = request.getManagedDependencies(); + + DefaultDependencyCollectionContext context = + new DefaultDependencyCollectionContext( session, request.getRootArtifact(), root, managedDependencies ); + context.setDependencies( request.getDependencies() ); + context.setCollectResult( result ); + context.setTrace( trace ); + Args args = new Args( session, trace, null, null, context, null, request ); + context.setArgs( args ); + + Map stats = logger.isDebugEnabled() ? new LinkedHashMap() : null; + long time1 = System.nanoTime(); + + DefaultDependencyNode node; + if ( root != null ) + { + + VersionRangeResult rangeResult = resolveRootVersionRange( context ); + ArtifactDescriptorResult descriptorResult = readRootArtifactDescriptor( context ); + root = root.setArtifact( descriptorResult.getArtifact() ); + + if ( !session.isIgnoreArtifactDescriptorRepositories() ) + { + repositories = + remoteRepositoryManager.aggregateRepositories( session, repositories, + descriptorResult.getRepositories(), true ); + } + context.setDependencies( mergeDeps( context.getDependencies(), descriptorResult.getDependencies() ) ); + context.setManagedDependencies( mergeDeps( managedDependencies, + descriptorResult.getManagedDependencies() ) ); + + node = new DefaultDependencyNode( root ); + node.setRequestContext( request.getRequestContext() ); + node.setRelocations( descriptorResult.getRelocations() ); + node.setVersionConstraint( rangeResult.getVersionConstraint() ); + node.setVersion( context.getVersion() ); + node.setAliases( descriptorResult.getAliases() ); + node.setRepositories( request.getRepositories() ); + } + else + { + node = new DefaultDependencyNode( request.getRootArtifact() ); + } + + result.setRoot( node ); + + DependencyTraverser depTraverser = session.getDependencyTraverser(); + boolean traverse = root == null || depTraverser == null || depTraverser.traverseDependency( root ); + String errorPath = null; + if ( traverse && !context.getDependencies().isEmpty() ) + { + DataPool pool = new DataPool( session ); + + NodeStack nodes = new NodeStack(); + nodes.push( node ); + + DefaultVersionFilterContext versionContext = new DefaultVersionFilterContext( session ); + + args = new Args( session, trace, pool, nodes, context, versionContext, request ); + Results results = new Results( result, session ); + context.setArgs( args ); + context.setResults( results ); + context.setRepositories( repositories ); + context.setDepTraverser( depTraverser ); + context.prepareDescent(); + + process( context ); + + errorPath = results.errorPath; + } + + long time2 = System.nanoTime(); + + transformDependencyGraph( context, stats ); + + if ( stats != null ) + { + long time3 = System.nanoTime(); + stats.put( "DefaultDependencyCollector.collectTime", time2 - time1 ); + stats.put( "DefaultDependencyCollector.transformTime", time3 - time2 ); + logger.debug( "Dependency collection stats: " + stats ); + } + + if ( errorPath != null ) + { + throw new DependencyCollectionException( result, "Failed to collect dependencies at " + errorPath ); + } + if ( !result.getExceptions().isEmpty() ) + { + throw new DependencyCollectionException( result ); + } + + return result; + } + + private VersionRangeResult resolveRootVersionRange( DefaultDependencyCollectionContext context ) + throws DependencyCollectionException + { + CollectRequest request = context.getArgs().request; + RepositorySystemSession session = context.getSession(); + List versions; + VersionRangeResult rangeResult; + Artifact artifact = request.getRoot().getArtifact(); + try + { + VersionRangeRequest rangeRequest = + new VersionRangeRequest( artifact, request.getRepositories(), request.getRequestContext() ); + rangeRequest.setTrace( context.getTrace() ); + rangeResult = versionRangeResolver.resolveVersionRange( session, rangeRequest ); + versions = filterVersions( context.getDependency(), rangeResult, context.getVerFilter(), + new DefaultVersionFilterContext( session ) ); + } + catch ( VersionRangeResolutionException e ) + { + context.getCollectResult().addException( e ); + throw new DependencyCollectionException( context.getCollectResult(), e.getMessage() ); + } + + Version version = versions.get( versions.size() - 1 ); + context.setVersion( version ); + context.setDependency( request.getRoot().setArtifact( artifact.setVersion( version.toString() ) ) ); + return rangeResult; + } + + private ArtifactDescriptorResult readRootArtifactDescriptor( DefaultDependencyCollectionContext context ) + throws DependencyCollectionException + { + CollectRequest request = context.getArgs().request; + Artifact artifact = request.getRoot().getArtifact(); + try + { + ArtifactDescriptorRequest descriptorRequest = new ArtifactDescriptorRequest(); + descriptorRequest.setArtifact( artifact ); + descriptorRequest.setRepositories( request.getRepositories() ); + descriptorRequest.setRequestContext( request.getRequestContext() ); + descriptorRequest.setTrace( context.getTrace() ); + + ArtifactDescriptorResult descriptorResult = + isLackingDescriptor( artifact ) ? new ArtifactDescriptorResult( descriptorRequest ) + : descriptorReader.readArtifactDescriptor( context.getSession(), descriptorRequest ); + context.setDependency( request.getRoot().setArtifact( descriptorResult.getArtifact() ) ); + return descriptorResult; + } + catch ( ArtifactDescriptorException e ) + { + context.getCollectResult().addException( e ); + throw new DependencyCollectionException( context.getCollectResult(), e.getMessage() ); + } + } + + private void transformDependencyGraph( DefaultDependencyCollectionContext context, Map stats ) + { + RepositorySystemSession session = context.getSession(); + DependencyGraphTransformer transformer = session.getDependencyGraphTransformer(); + if ( transformer != null ) + { + try + { + DefaultDependencyGraphTransformationContext tfContext = + new DefaultDependencyGraphTransformationContext( session ); + tfContext.put( TransformationContextKeys.STATS, stats ); + context.getCollectResult().setRoot( transformer.transformGraph( context.getCollectResult().getRoot(), + tfContext ) ); + } + catch ( RepositoryException e ) + { + context.getCollectResult().addException( e ); + } + } + } + + private List mergeDeps( List dominant, List recessive ) + { + List result; + if ( dominant == null || dominant.isEmpty() ) + { + result = recessive; + } + else if ( recessive == null || recessive.isEmpty() ) + { + result = dominant; + } + else + { + int initialCapacity = dominant.size() + recessive.size(); + result = new ArrayList( initialCapacity ); + Collection ids = new HashSet( initialCapacity, 1.0f ); + for ( Dependency dependency : dominant ) + { + ids.add( getId( dependency.getArtifact() ) ); + result.add( dependency ); + } + for ( Dependency dependency : recessive ) + { + if ( !ids.contains( getId( dependency.getArtifact() ) ) ) + { + result.add( dependency ); + } + } + } + return result; + } + + private static String getId( Artifact a ) + { + return a.getGroupId() + ':' + a.getArtifactId() + ':' + a.getClassifier() + ':' + a.getExtension(); + } + + private void process( DefaultDependencyCollectionContext context ) + { + List depContexts = new ArrayList(); + for ( Dependency d : context.getDependencies() ) + { + depContexts.add( new DependencyContext( context, d ) ); + } + + List> futures = new ArrayList>(); + for ( DependencyContext dc : depContexts ) + { + futures.add( asyncProcessDependency( dc ) ); + } + int pos = 0; + for ( Future future : futures ) + { + try + { + processDependencyNode( future.get() ); + } + catch ( ExecutionException e ) + { + context.getResults().addException( context.getDependencies().get( pos ), (Exception) e.getCause(), + context.getArgs().nodes ); + } + catch ( InterruptedException e ) + { + context.getResults().addException( context.getDependencies().get( pos ), e, context.getArgs().nodes ); + } + pos++; + } + } + + private Future asyncProcessDependency( final DependencyContext dc ) + { + return executor.submit( new Callable() + { + + public DependencyContext call() + throws Exception + { + return processDependency( dc ); + } + } ); + } + + private DependencyContext processDependency( DependencyContext dc ) + { + DefaultDependencyCollectionContext context = dc.context; + Args args = context.getArgs(); + Results results = context.getResults(); + + PremanagedDependency preManaged = + PremanagedDependency.create( context.getDepManager(), dc.origDependency, dc.disableVersionManagement, + args.premanagedState ); + Dependency dependency = preManaged.managedDependency; + + if ( context.getDepSelector() != null && !context.getDepSelector().selectDependency( dependency ) ) + { + return null; + } + + boolean noDescriptor = isLackingDescriptor( dependency.getArtifact() ); + + boolean traverse = !noDescriptor + && ( context.getDepTraverser() == null || context.getDepTraverser().traverseDependency( dependency ) ); + + try + { + VersionRangeRequest rangeRequest = createVersionRangeRequest( args, context.getRepositories(), dependency ); + VersionRangeResult rangeResult = cachedResolveRangeResult( rangeRequest, args.pool, args.session ); + for ( Version version : filterVersions( dependency, rangeResult, context.getVerFilter(), + args.versionContext ) ) + { + + Artifact originalArtifact = dependency.getArtifact().setVersion( version.toString() ); + Dependency d = dependency.setArtifact( originalArtifact ); + + ArtifactDescriptorRequest descriptorRequest = + createArtifactDescriptorRequest( args, context.getRepositories(), d ); + + dc.args = args; + dc.preManaged = preManaged; + dc.traverse = traverse; + dc.rangeResult = rangeResult; + dc.version = version; + dc.originalArtifact = originalArtifact; + dc.managedDependency = d; + dc.futureDescriptorResult = + getArtifactDescriptorResult( args, results, noDescriptor, d, descriptorRequest ); + } + } + catch ( VersionRangeResolutionException e ) + { + results.addException( dependency, e, args.nodes ); + } + return dc; + } + + private void processDependencyNode( DependencyContext dc ) + { + if ( dc == null ) + { + return; + } + try + { + boolean noResult = dc.futureDescriptorResult == null; + if ( !noResult ) + { + dc.descriptorResult = dc.futureDescriptorResult.get(); + noResult = dc.descriptorResult == null; + } + if ( noResult ) + { + List repos = + getRemoteRepositories( dc.rangeResult.getRepository( dc.version ), dc.context.getRepositories() ); + addDependencyNode( dc.args.nodes.top(), dc.relocations, dc.preManaged, dc.rangeResult, dc.version, + dc.managedDependency, null, repos, dc.args.request.getRequestContext() ); + } + else + { + processDependencyVersion( dc ); + } + } + catch ( InterruptedException e ) + { + dc.context.getResults().addException( dc.preManaged.managedDependency, e, dc.args.nodes ); + } + catch ( ExecutionException e ) + { + dc.context.getResults().addException( dc.preManaged.managedDependency, (Exception) e.getCause(), + dc.args.nodes ); + } + } + + private boolean processDependencyVersion( DependencyContext dc ) + { + Args args = dc.context.getArgs(); + Results results = dc.context.getResults(); + Dependency d = dc.managedDependency.setArtifact( dc.descriptorResult.getArtifact() ); + dc.managedDependency = d; + + DependencyNode node = args.nodes.top(); + + int cycleEntry = args.nodes.find( d.getArtifact() ); + if ( cycleEntry >= 0 ) + { + results.addCycle( args.nodes, cycleEntry, d ); + DependencyNode cycleNode = args.nodes.get( cycleEntry ); + if ( cycleNode.getDependency() != null ) + { + createDependencyNode( node, dc.relocations, dc.preManaged, dc.rangeResult, dc.version, d, + dc.descriptorResult, cycleNode ); + return true; + } + } + + if ( !dc.descriptorResult.getRelocations().isEmpty() ) + { + boolean disableVersionManagementSubsequently = + dc.originalArtifact.getGroupId().equals( d.getArtifact().getGroupId() ) + && dc.originalArtifact.getArtifactId().equals( d.getArtifact().getArtifactId() ); + + DependencyContext dc2 = new DependencyContext(); + dc2.context = dc.context; + dc2.origDependency = d; + dc2.relocations = dc.descriptorResult.getRelocations(); + dc2.disableVersionManagement = disableVersionManagementSubsequently; + dc2 = processDependency( dc2 ); + processDependencyNode( dc2 ); + return true; + } + else + { + d = args.pool.intern( d ); + + List repos = + getRemoteRepositories( dc.rangeResult.getRepository( dc.version ), dc.context.getRepositories() ); + + DefaultDependencyNode child = + addDependencyNode( node, dc.relocations, dc.preManaged, dc.rangeResult, dc.version, d, + dc.descriptorResult.getAliases(), repos, args.request.getRequestContext() ); + + if ( dc.traverse && !dc.descriptorResult.getDependencies().isEmpty() ) + { + doRecurse( dc.context, d, dc.descriptorResult, child ); + } + return false; + } + } + + private void doRecurse( DefaultDependencyCollectionContext context, Dependency d, + ArtifactDescriptorResult descriptorResult, DefaultDependencyNode child ) + { + context.setDependency( d ); + context.setManagedDependencies( descriptorResult.getManagedDependencies() ); + + DefaultDependencyCollectionContext childContext = context.createChildContext(); + new DefaultDependencyCollectionContext( context.getSession(), context.getArtifact(), context.getDependency(), + context.getManagedDependencies() ); + Args args = context.getArgs(); + + final List childRepos = args.ignoreRepos ? context.getRepositories() + : remoteRepositoryManager.aggregateRepositories( args.session, context.getRepositories(), + descriptorResult.getRepositories(), true ); + childContext.setRepositories( childRepos ); + + Object key = args.pool.toKey( d.getArtifact(), childContext ); + + List children = args.pool.getChildren( key ); + if ( children == null ) + { + args.pool.putChildren( key, child.getChildren() ); + + args.nodes.push( child ); + + childContext.setArgs( args ); + childContext.setResults( context.getResults() ); + childContext.setDependencies( descriptorResult.getDependencies() ); + + process( childContext ); + + args.nodes.pop(); + } + else + { + child.setChildren( children ); + } + } + + private Future getArtifactDescriptorResult( Args args, Results results, + boolean noDescriptor, Dependency d, + ArtifactDescriptorRequest descriptorRequest ) + { + return noDescriptor + ? new FutureResult( new ArtifactDescriptorResult( descriptorRequest ) ) + : resolveCachedArtifactDescriptor( args.pool, descriptorRequest, args.session, d, results, + args ); + } + + private Future resolveCachedArtifactDescriptor( final DataPool pool, + final ArtifactDescriptorRequest descriptorRequest, + final RepositorySystemSession session, + final Dependency d, final Results results, + final Args args ) + { + final Object key = pool.toKey( descriptorRequest ); + Future descriptorResult = pool.getDescriptor( key, descriptorRequest ); + if ( descriptorResult == null ) + { + descriptorResult = executor.submit( new Callable() + { + + public ArtifactDescriptorResult call() + throws Exception + { + try + { + return descriptorReader.readArtifactDescriptor( session, descriptorRequest ); + } + catch ( ArtifactDescriptorException e ) + { + results.addException( d, e, args.nodes ); + pool.putDescriptor( key, e ); + return null; + } + } + } ); + + pool.putDescriptor( key, descriptorResult ); + } + else if ( descriptorResult == DataPool.NO_DESCRIPTOR ) + { + return new FutureResult( null ); + } + + return descriptorResult; + } + private VersionRangeResult cachedResolveRangeResult( VersionRangeRequest rangeRequest, DataPool pool, + RepositorySystemSession session ) + throws VersionRangeResolutionException + { + Object key = pool.toKey( rangeRequest ); + VersionRangeResult rangeResult = pool.getConstraint( key, rangeRequest ); + if ( rangeResult == null ) + { + rangeResult = versionRangeResolver.resolveVersionRange( session, rangeRequest ); + pool.putConstraint( key, rangeResult ); + } + return rangeResult; + } + + private static boolean isLackingDescriptor( Artifact artifact ) + { + return artifact.getProperty( ArtifactProperties.LOCAL_PATH, null ) != null; + } + + private static List getRemoteRepositories( ArtifactRepository repository, + List repositories ) + { + if ( repository instanceof RemoteRepository ) + { + return Collections.singletonList( (RemoteRepository) repository ); + } + if ( repository != null ) + { + return Collections.emptyList(); + } + return repositories; + } + + private static List filterVersions( Dependency dependency, VersionRangeResult rangeResult, + VersionFilter verFilter, + DefaultVersionFilterContext verContext ) + throws VersionRangeResolutionException + { + if ( rangeResult.getVersions().isEmpty() ) + { + throw new VersionRangeResolutionException( rangeResult, "No versions available for " + + dependency.getArtifact() + " within specified range" ); + } + + List versions; + if ( verFilter != null && rangeResult.getVersionConstraint().getRange() != null ) + { + verContext.set( dependency, rangeResult ); + try + { + verFilter.filterVersions( verContext ); + } + catch ( RepositoryException e ) + { + throw new VersionRangeResolutionException( rangeResult, "Failed to filter versions for " + + dependency.getArtifact() + ": " + e.getMessage(), e ); + } + versions = verContext.get(); + if ( versions.isEmpty() ) + { + throw new VersionRangeResolutionException( rangeResult, "No acceptable versions for " + + dependency.getArtifact() + ": " + rangeResult.getVersions() ); + } + } + else + { + versions = rangeResult.getVersions(); + } + return versions; + } + +} diff --git a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultDependencyCycle.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/DefaultDependencyCycle.java similarity index 71% rename from aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultDependencyCycle.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/DefaultDependencyCycle.java index 94cd344d3..446b94b5a 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultDependencyCycle.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/DefaultDependencyCycle.java @@ -1,14 +1,23 @@ -/******************************************************************************* - * Copyright (c) 2013, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether.internal.impl; +package org.eclipse.aether.internal.impl.collect; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Arrays; import java.util.Collections; diff --git a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultDependencyGraphTransformationContext.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/DefaultDependencyGraphTransformationContext.java similarity index 60% rename from aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultDependencyGraphTransformationContext.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/DefaultDependencyGraphTransformationContext.java index c15ea1f5c..7de17b463 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultDependencyGraphTransformationContext.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/DefaultDependencyGraphTransformationContext.java @@ -1,14 +1,23 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether.internal.impl; +package org.eclipse.aether.internal.impl.collect; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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; diff --git a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultVersionFilterContext.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/DefaultVersionFilterContext.java similarity index 81% rename from aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultVersionFilterContext.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/DefaultVersionFilterContext.java index ecacd52de..156596645 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultVersionFilterContext.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/DefaultVersionFilterContext.java @@ -1,14 +1,23 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether.internal.impl; +package org.eclipse.aether.internal.impl.collect; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Collections; @@ -33,7 +42,7 @@ final class DefaultVersionFilterContext implements VersionFilter.VersionFilterContext { - private final Iterator EMPTY = Collections. emptySet().iterator(); + private final Iterator EMPTY = Collections.emptySet().iterator(); private final RepositorySystemSession session; @@ -63,7 +72,7 @@ public void set( Dependency dependency, VersionRangeResult result ) { for ( int i = count - 1; i >= 0; i-- ) { - deleted[i] = 0; + deleted[i] = (byte) 0; } } } @@ -157,7 +166,7 @@ public VersionIterator() private void advance() { - for ( next = index + 1; next < size && deleted[next] != 0; next++ ) + for ( next = index + 1; next < size && deleted[next] != (byte) 0; next++ ) { // just advancing index } @@ -189,11 +198,11 @@ public void remove() { throw new ConcurrentModificationException(); } - if ( index < 0 || deleted[index] == 1 ) + if ( index < 0 || deleted[index] == (byte) 1 ) { throw new IllegalStateException(); } - deleted[index] = 1; + deleted[index] = (byte) 1; count = --DefaultVersionFilterContext.this.count; } diff --git a/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/DependencyCollectionUtils.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/DependencyCollectionUtils.java new file mode 100644 index 000000000..e919e10d3 --- /dev/null +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/DependencyCollectionUtils.java @@ -0,0 +1,171 @@ +package org.eclipse.aether.internal.impl.collect; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import java.util.Collection; +import java.util.Collections; +import java.util.List; + +import org.eclipse.aether.DefaultRepositorySystemSession; +import org.eclipse.aether.RepositoryException; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.artifact.ArtifactProperties; +import org.eclipse.aether.collection.VersionFilter; +import org.eclipse.aether.graph.DefaultDependencyNode; +import org.eclipse.aether.graph.Dependency; +import org.eclipse.aether.graph.DependencyNode; +import org.eclipse.aether.repository.ArtifactRepository; +import org.eclipse.aether.repository.RemoteRepository; +import org.eclipse.aether.resolution.ArtifactDescriptorRequest; +import org.eclipse.aether.resolution.ArtifactDescriptorResult; +import org.eclipse.aether.resolution.VersionRangeRequest; +import org.eclipse.aether.resolution.VersionRangeResolutionException; +import org.eclipse.aether.resolution.VersionRangeResult; +import org.eclipse.aether.version.Version; + +/** + * Utility methods for dependency collection. + * + */ +public class DependencyCollectionUtils +{ + + static DefaultDependencyNode addDependencyNode( DependencyNode parent, List relocations, + PremanagedDependency preManaged, VersionRangeResult rangeResult, + Version version, Dependency d, Collection aliases, + List repos, String requestContext ) + { + DefaultDependencyNode child = new DefaultDependencyNode( d ); + preManaged.applyTo( child ); + child.setRelocations( relocations ); + child.setVersionConstraint( rangeResult.getVersionConstraint() ); + child.setVersion( version ); + child.setAliases( aliases ); + child.setRepositories( repos ); + child.setRequestContext( requestContext ); + parent.getChildren().add( child ); + return child; + } + + static DefaultDependencyNode createDependencyNode( DependencyNode parent, List relocations, + PremanagedDependency preManaged, VersionRangeResult rangeResult, + Version version, Dependency d, + ArtifactDescriptorResult descriptorResult, + DependencyNode cycleNode ) + { + DefaultDependencyNode child = + addDependencyNode( parent, relocations, preManaged, rangeResult, version, d, descriptorResult.getAliases(), + cycleNode.getRepositories(), cycleNode.getRequestContext() ); + child.setChildren( cycleNode.getChildren() ); + return child; + } + + static ArtifactDescriptorRequest createArtifactDescriptorRequest( Args args, List repositories, + Dependency d ) + { + ArtifactDescriptorRequest descriptorRequest = new ArtifactDescriptorRequest(); + descriptorRequest.setArtifact( d.getArtifact() ); + descriptorRequest.setRepositories( repositories ); + descriptorRequest.setRequestContext( args.request.getRequestContext() ); + descriptorRequest.setTrace( args.trace ); + return descriptorRequest; + } + + static VersionRangeRequest createVersionRangeRequest( Args args, List repositories, + Dependency dependency ) + { + VersionRangeRequest rangeRequest = new VersionRangeRequest(); + rangeRequest.setArtifact( dependency.getArtifact() ); + rangeRequest.setRepositories( repositories ); + rangeRequest.setRequestContext( args.request.getRequestContext() ); + rangeRequest.setTrace( args.trace ); + return rangeRequest; + } + + static boolean isLackingDescriptor( Artifact artifact ) + { + return artifact.getProperty( ArtifactProperties.LOCAL_PATH, null ) != null; + } + + static List getRemoteRepositories( ArtifactRepository repository, + List repositories ) + { + if ( repository instanceof RemoteRepository ) + { + return Collections.singletonList( (RemoteRepository) repository ); + } + if ( repository != null ) + { + return Collections.emptyList(); + } + return repositories; + } + + static List filterVersions( Dependency dependency, VersionRangeResult rangeResult, + VersionFilter verFilter, DefaultVersionFilterContext verContext ) + throws VersionRangeResolutionException + { + if ( rangeResult.getVersions().isEmpty() ) + { + throw new VersionRangeResolutionException( rangeResult, "No versions available for " + + dependency.getArtifact() + " within specified range" ); + } + + List versions; + if ( verFilter != null && rangeResult.getVersionConstraint().getRange() != null ) + { + verContext.set( dependency, rangeResult ); + try + { + verFilter.filterVersions( verContext ); + } + catch ( RepositoryException e ) + { + throw new VersionRangeResolutionException( rangeResult, "Failed to filter versions for " + + dependency.getArtifact() + ": " + e.getMessage(), e ); + } + versions = verContext.get(); + if ( versions.isEmpty() ) + { + throw new VersionRangeResolutionException( rangeResult, "No acceptable versions for " + + dependency.getArtifact() + ": " + rangeResult.getVersions() ); + } + } + else + { + versions = rangeResult.getVersions(); + } + return versions; + } + + static RepositorySystemSession optimizeSession( RepositorySystemSession session ) + { + DefaultRepositorySystemSession optimized = new DefaultRepositorySystemSession( session ); + optimized.setArtifactTypeRegistry( CachingArtifactTypeRegistry.newInstance( session ) ); + return optimized; + } + + static String getId( Dependency d ) + { + Artifact a = d.getArtifact(); + return a.getGroupId() + ':' + a.getArtifactId() + ':' + a.getClassifier() + ':' + a.getExtension(); + } +} \ No newline at end of file diff --git a/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/DependencyContext.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/DependencyContext.java new file mode 100644 index 000000000..d0f20f369 --- /dev/null +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/DependencyContext.java @@ -0,0 +1,74 @@ +package org.eclipse.aether.internal.impl.collect; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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 java.util.concurrent.Future; + +import org.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.graph.Dependency; +import org.eclipse.aether.resolution.ArtifactDescriptorResult; +import org.eclipse.aether.resolution.VersionRangeResult; +import org.eclipse.aether.version.Version; + +class DependencyContext +{ + Dependency origDependency; + + DefaultDependencyCollectionContext context; + + List relocations; + + boolean disableVersionManagement; + + Args args; + + PremanagedDependency preManaged; + + boolean traverse; + + VersionRangeResult rangeResult; + + Version version; + + Artifact originalArtifact; + + Dependency managedDependency; + + Future futureDescriptorResult; + + ArtifactDescriptorResult descriptorResult; + + public DependencyContext() + { + // empty + } + + public DependencyContext( DefaultDependencyCollectionContext context, Dependency dependency ) + { + this.context = context; + this.origDependency = dependency; + this.relocations = Collections.emptyList(); + this.disableVersionManagement = false; + this.args = context.getArgs(); + } + +} \ No newline at end of file diff --git a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/NodeStack.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/NodeStack.java similarity index 74% rename from aether-impl/src/main/java/org/eclipse/aether/internal/impl/NodeStack.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/NodeStack.java index a61bfb4f9..a7cbc7866 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/NodeStack.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/NodeStack.java @@ -1,14 +1,23 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether.internal.impl; +package org.eclipse.aether.internal.impl.collect; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Arrays; diff --git a/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/ObjectPool.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/ObjectPool.java new file mode 100644 index 000000000..b262b6423 --- /dev/null +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/ObjectPool.java @@ -0,0 +1,54 @@ +package org.eclipse.aether.internal.impl.collect; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.ref.Reference; +import java.lang.ref.WeakReference; +import java.util.Map; +import java.util.WeakHashMap; + +import org.eclipse.aether.graph.Dependency; + +/** + * Pool of immutable object instances, used to avoid excessive memory consumption of (dirty) dependency graph which + * tends to have many duplicate artifacts/dependencies. + */ +final class ObjectPool +{ + + private final Map> dependencies = + new WeakHashMap>( 256 ); + + public synchronized Dependency intern( Dependency dependency ) + { + Reference pooledRef = dependencies.get( dependency ); + if ( pooledRef != null ) + { + Dependency pooled = pooledRef.get(); + if ( pooled != null ) + { + return pooled; + } + } + dependencies.put( dependency, new WeakReference( dependency ) ); + return dependency; + } + +} diff --git a/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/PremanagedDependency.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/PremanagedDependency.java new file mode 100644 index 000000000..860a36a18 --- /dev/null +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/PremanagedDependency.java @@ -0,0 +1,112 @@ +package org.eclipse.aether.internal.impl.collect; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import org.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.collection.DependencyManagement; +import org.eclipse.aether.collection.DependencyManager; +import org.eclipse.aether.graph.DefaultDependencyNode; +import org.eclipse.aether.graph.Dependency; +import org.eclipse.aether.graph.DependencyNode; +import org.eclipse.aether.util.graph.manager.DependencyManagerUtils; + +class PremanagedDependency +{ + final String premanagedVersion; + + final String premanagedScope; + + final Boolean premanagedOptional; + + final int managedBits; + + final Dependency managedDependency; + + final boolean premanagedState; + + PremanagedDependency( String premanagedVersion, String premanagedScope, Boolean premanagedOptional, + int managedBits, Dependency managedDependency, boolean premanagedState ) + { + this.premanagedVersion = premanagedVersion; + this.premanagedScope = premanagedScope; + this.premanagedOptional = premanagedOptional; + this.managedBits = managedBits; + this.managedDependency = managedDependency; + this.premanagedState = premanagedState; + } + + static PremanagedDependency create( DependencyManager depManager, Dependency dependency, + boolean disableVersionManagement, boolean premanagedState ) + { + DependencyManagement depMngt = depManager != null ? depManager.manageDependency( dependency ) : null; + + int managedBits = 0; + String premanagedVersion = null; + String premanagedScope = null; + Boolean premanagedOptional = null; + + if ( depMngt != null ) + { + if ( depMngt.getVersion() != null && !disableVersionManagement ) + { + Artifact artifact = dependency.getArtifact(); + premanagedVersion = artifact.getVersion(); + dependency = dependency.setArtifact( artifact.setVersion( depMngt.getVersion() ) ); + managedBits |= DependencyNode.MANAGED_VERSION; + } + if ( depMngt.getProperties() != null ) + { + Artifact artifact = dependency.getArtifact(); + dependency = dependency.setArtifact( artifact.setProperties( depMngt.getProperties() ) ); + managedBits |= DependencyNode.MANAGED_PROPERTIES; + } + if ( depMngt.getScope() != null ) + { + premanagedScope = dependency.getScope(); + dependency = dependency.setScope( depMngt.getScope() ); + managedBits |= DependencyNode.MANAGED_SCOPE; + } + if ( depMngt.getOptional() != null ) + { + premanagedOptional = dependency.isOptional(); + dependency = dependency.setOptional( depMngt.getOptional() ); + managedBits |= DependencyNode.MANAGED_OPTIONAL; + } + if ( depMngt.getExclusions() != null ) + { + dependency = dependency.setExclusions( depMngt.getExclusions() ); + managedBits |= DependencyNode.MANAGED_EXCLUSIONS; + } + } + return new PremanagedDependency( premanagedVersion, premanagedScope, premanagedOptional, managedBits, + dependency, premanagedState ); + } + + public void applyTo( DefaultDependencyNode child ) + { + child.setManagedBits( managedBits ); + if ( premanagedState ) + { + child.setData( DependencyManagerUtils.NODE_DATA_PREMANAGED_VERSION, premanagedVersion ); + child.setData( DependencyManagerUtils.NODE_DATA_PREMANAGED_SCOPE, premanagedScope ); + child.setData( DependencyManagerUtils.NODE_DATA_PREMANAGED_OPTIONAL, premanagedOptional ); + } + } +} \ No newline at end of file diff --git a/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/Results.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/Results.java new file mode 100644 index 000000000..65d7a120d --- /dev/null +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/Results.java @@ -0,0 +1,83 @@ +package org.eclipse.aether.internal.impl.collect; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.collection.CollectResult; +import org.eclipse.aether.graph.Dependency; +import org.eclipse.aether.util.ConfigUtils; + +class Results +{ + + private final CollectResult result; + + final int maxExceptions; + + final int maxCycles; + + String errorPath; + + public Results( CollectResult result, RepositorySystemSession session ) + { + this.result = result; + this.maxExceptions = ConfigUtils.getInteger( session, 50, DefaultDependencyCollector.CONFIG_PROP_MAX_EXCEPTIONS ); + this.maxCycles = ConfigUtils.getInteger( session, 10, DefaultDependencyCollector.CONFIG_PROP_MAX_CYCLES ); + } + + public void addException( Dependency dependency, Exception e, NodeStack nodes ) + { + if ( maxExceptions < 0 || result.getExceptions().size() < maxExceptions ) + { + result.addException( e ); + if ( errorPath == null ) + { + StringBuilder buffer = new StringBuilder( 256 ); + for ( int i = 0; i < nodes.size(); i++ ) + { + if ( buffer.length() > 0 ) + { + buffer.append( " -> " ); + } + Dependency dep = nodes.get( i ).getDependency(); + if ( dep != null ) + { + buffer.append( dep.getArtifact() ); + } + } + if ( buffer.length() > 0 ) + { + buffer.append( " -> " ); + } + buffer.append( dependency.getArtifact() ); + errorPath = buffer.toString(); + } + } + } + + public void addCycle( NodeStack nodes, int cycleEntry, Dependency dependency ) + { + if ( maxCycles < 0 || result.getCycles().size() < maxCycles ) + { + result.addCycle( new DefaultDependencyCycle( nodes, cycleEntry, dependency ) ); + } + } + +} \ No newline at end of file diff --git a/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/package-info.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/package-info.java new file mode 100644 index 000000000..733875b06 --- /dev/null +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/package-info.java @@ -0,0 +1,24 @@ +// CHECKSTYLE_OFF: RegexpHeader +/** + * Internal helper classes for dependency collector. + */ +package org.eclipse.aether.internal.impl.collect; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + diff --git a/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/package-info.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/package-info.java new file mode 100644 index 000000000..8b3065477 --- /dev/null +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/package-info.java @@ -0,0 +1,24 @@ +// CHECKSTYLE_OFF: RegexpHeader +/** + * The various sub components that collectively implement the repository system. + */ +package org.eclipse.aether.internal.impl; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ diff --git a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/slf4j/Slf4jLoggerFactory.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/slf4j/Slf4jLoggerFactory.java similarity index 84% rename from aether-impl/src/main/java/org/eclipse/aether/internal/impl/slf4j/Slf4jLoggerFactory.java rename to maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/slf4j/Slf4jLoggerFactory.java index 24c696a60..840fe21df 100644 --- a/aether-impl/src/main/java/org/eclipse/aether/internal/impl/slf4j/Slf4jLoggerFactory.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/slf4j/Slf4jLoggerFactory.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl.slf4j; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.inject.Inject; import javax.inject.Named; diff --git a/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/slf4j/package-info.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/slf4j/package-info.java new file mode 100644 index 000000000..d31f1ee4d --- /dev/null +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/slf4j/package-info.java @@ -0,0 +1,24 @@ +// CHECKSTYLE_OFF: RegexpHeader +/** + * The integration with the logging framework SLF4J. + */ +package org.eclipse.aether.internal.impl.slf4j; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + diff --git a/maven-resolver-impl/src/site/site.xml b/maven-resolver-impl/src/site/site.xml new file mode 100644 index 000000000..3a16bf98b --- /dev/null +++ b/maven-resolver-impl/src/site/site.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/aether-impl/src/test/java/org/eclipse/aether/impl/DefaultServiceLocatorTest.java b/maven-resolver-impl/src/test/java/org/eclipse/aether/impl/DefaultServiceLocatorTest.java similarity index 75% rename from aether-impl/src/test/java/org/eclipse/aether/impl/DefaultServiceLocatorTest.java rename to maven-resolver-impl/src/test/java/org/eclipse/aether/impl/DefaultServiceLocatorTest.java index ea1b9bc11..657b4ac50 100644 --- a/aether-impl/src/test/java/org/eclipse/aether/impl/DefaultServiceLocatorTest.java +++ b/maven-resolver-impl/src/test/java/org/eclipse/aether/impl/DefaultServiceLocatorTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import java.util.Arrays; diff --git a/maven-resolver-impl/src/test/java/org/eclipse/aether/impl/StubArtifactDescriptorReader.java b/maven-resolver-impl/src/test/java/org/eclipse/aether/impl/StubArtifactDescriptorReader.java new file mode 100644 index 000000000..a5e650f8e --- /dev/null +++ b/maven-resolver-impl/src/test/java/org/eclipse/aether/impl/StubArtifactDescriptorReader.java @@ -0,0 +1,40 @@ +package org.eclipse.aether.impl; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.impl.ArtifactDescriptorReader; +import org.eclipse.aether.resolution.ArtifactDescriptorException; +import org.eclipse.aether.resolution.ArtifactDescriptorRequest; +import org.eclipse.aether.resolution.ArtifactDescriptorResult; + +public class StubArtifactDescriptorReader + implements ArtifactDescriptorReader +{ + + public ArtifactDescriptorResult readArtifactDescriptor( RepositorySystemSession session, + ArtifactDescriptorRequest request ) + throws ArtifactDescriptorException + { + ArtifactDescriptorResult result = new ArtifactDescriptorResult( request ); + return result; + } + +} diff --git a/maven-resolver-impl/src/test/java/org/eclipse/aether/impl/StubVersionRangeResolver.java b/maven-resolver-impl/src/test/java/org/eclipse/aether/impl/StubVersionRangeResolver.java new file mode 100644 index 000000000..81e000e4b --- /dev/null +++ b/maven-resolver-impl/src/test/java/org/eclipse/aether/impl/StubVersionRangeResolver.java @@ -0,0 +1,39 @@ +package org.eclipse.aether.impl; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.impl.VersionRangeResolver; +import org.eclipse.aether.resolution.VersionRangeRequest; +import org.eclipse.aether.resolution.VersionRangeResolutionException; +import org.eclipse.aether.resolution.VersionRangeResult; + +public class StubVersionRangeResolver + implements VersionRangeResolver +{ + + public VersionRangeResult resolveVersionRange( RepositorySystemSession session, VersionRangeRequest request ) + throws VersionRangeResolutionException + { + VersionRangeResult result = new VersionRangeResult( request ); + return result; + } + +} diff --git a/maven-resolver-impl/src/test/java/org/eclipse/aether/impl/StubVersionResolver.java b/maven-resolver-impl/src/test/java/org/eclipse/aether/impl/StubVersionResolver.java new file mode 100644 index 000000000..f59fa11ee --- /dev/null +++ b/maven-resolver-impl/src/test/java/org/eclipse/aether/impl/StubVersionResolver.java @@ -0,0 +1,39 @@ +package org.eclipse.aether.impl; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.impl.VersionResolver; +import org.eclipse.aether.resolution.VersionRequest; +import org.eclipse.aether.resolution.VersionResolutionException; +import org.eclipse.aether.resolution.VersionResult; + +public class StubVersionResolver + implements VersionResolver +{ + + public VersionResult resolveVersion( RepositorySystemSession session, VersionRequest request ) + throws VersionResolutionException + { + VersionResult result = new VersionResult( request ); + return result; + } + +} diff --git a/aether-impl/src/test/java/org/eclipse/aether/impl/guice/AetherModuleTest.java b/maven-resolver-impl/src/test/java/org/eclipse/aether/impl/guice/AetherModuleTest.java similarity index 70% rename from aether-impl/src/test/java/org/eclipse/aether/impl/guice/AetherModuleTest.java rename to maven-resolver-impl/src/test/java/org/eclipse/aether/impl/guice/AetherModuleTest.java index 4a7826e4a..efcda199f 100644 --- a/aether-impl/src/test/java/org/eclipse/aether/impl/guice/AetherModuleTest.java +++ b/maven-resolver-impl/src/test/java/org/eclipse/aether/impl/guice/AetherModuleTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2012, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.impl.guice; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import java.util.Collections; diff --git a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultArtifactResolverTest.java b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultArtifactResolverTest.java similarity index 97% rename from aether-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultArtifactResolverTest.java rename to maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultArtifactResolverTest.java index 2ca37e3b8..f776e9c38 100644 --- a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultArtifactResolverTest.java +++ b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultArtifactResolverTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import java.io.File; diff --git a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultChecksumPolicyProviderTest.java b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultChecksumPolicyProviderTest.java similarity index 83% rename from aether-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultChecksumPolicyProviderTest.java rename to maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultChecksumPolicyProviderTest.java index 892b17805..542e3eae3 100644 --- a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultChecksumPolicyProviderTest.java +++ b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultChecksumPolicyProviderTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import org.eclipse.aether.DefaultRepositorySystemSession; @@ -42,7 +51,7 @@ public void setup() session = TestUtils.newSession(); provider = new DefaultChecksumPolicyProvider(); repository = new RemoteRepository.Builder( "test", "default", "file:/void" ).build(); - resource = new TransferResource( repository.getUrl(), "file.txt", null, null ); + resource = new TransferResource( repository.getId(), repository.getUrl(), "file.txt", null, null ); } @After diff --git a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultDeployerTest.java b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultDeployerTest.java similarity index 93% rename from aether-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultDeployerTest.java rename to maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultDeployerTest.java index 02b14e5dd..9465e873a 100644 --- a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultDeployerTest.java +++ b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultDeployerTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import java.io.File; diff --git a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultFileProcessorTest.java b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultFileProcessorTest.java similarity index 76% rename from aether-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultFileProcessorTest.java rename to maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultFileProcessorTest.java index 0d967bda8..7b482306b 100644 --- a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultFileProcessorTest.java +++ b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultFileProcessorTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import java.io.File; @@ -89,7 +98,7 @@ public void testCopyEmptyFile() File target = new File( targetDir, "testCopyEmptyFile" ); target.delete(); fileProcessor.copy( file, target ); - assertTrue( "empty file was not copied", target.exists() && target.length() == 0 ); + assertTrue( "empty file was not copied", target.exists() && target.length() == 0L ); target.delete(); } @@ -111,7 +120,7 @@ public void progressed( ByteBuffer buffer ) }; fileProcessor.copy( file, target, listener ); assertTrue( "file was not created", target.isFile() ); - assertEquals( "file was not fully copied", 4, target.length() ); + assertEquals( "file was not fully copied", 4L, target.length() ); assertEquals( "listener not called", 4, progressed.intValue() ); target.delete(); } diff --git a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultInstallerTest.java b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultInstallerTest.java similarity index 94% rename from aether-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultInstallerTest.java rename to maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultInstallerTest.java index 391115a35..efabedd36 100644 --- a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultInstallerTest.java +++ b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultInstallerTest.java @@ -1,20 +1,28 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import java.io.File; import java.io.IOException; -import java.io.UnsupportedEncodingException; import java.util.List; import org.eclipse.aether.DefaultRepositorySystemSession; @@ -99,7 +107,7 @@ public void teardown() @Test public void testSuccessfulInstall() - throws InstallationException, UnsupportedEncodingException, IOException + throws InstallationException, IOException { File artifactFile = new File( session.getLocalRepositoryManager().getRepository().getBasedir(), localArtifactPath ); diff --git a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultMetadataResolverTest.java b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultMetadataResolverTest.java similarity index 91% rename from aether-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultMetadataResolverTest.java rename to maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultMetadataResolverTest.java index 8099151fc..d977a7848 100644 --- a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultMetadataResolverTest.java +++ b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultMetadataResolverTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import java.io.File; diff --git a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultOfflineControllerTest.java b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultOfflineControllerTest.java similarity index 79% rename from aether-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultOfflineControllerTest.java rename to maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultOfflineControllerTest.java index 9b698bf24..7e427075c 100644 --- a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultOfflineControllerTest.java +++ b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultOfflineControllerTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2012, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.DefaultRepositorySystemSession; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.repository.RemoteRepository; diff --git a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultRemoteRepositoryManagerTest.java b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultRemoteRepositoryManagerTest.java similarity index 93% rename from aether-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultRemoteRepositoryManagerTest.java rename to maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultRemoteRepositoryManagerTest.java index da4583c7b..8bc50d6a5 100644 --- a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultRemoteRepositoryManagerTest.java +++ b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultRemoteRepositoryManagerTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import java.util.Arrays; diff --git a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultRepositoryEventDispatcherTest.java b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultRepositoryEventDispatcherTest.java similarity index 72% rename from aether-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultRepositoryEventDispatcherTest.java rename to maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultRepositoryEventDispatcherTest.java index 24d4b112c..25e8a87a3 100644 --- a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultRepositoryEventDispatcherTest.java +++ b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultRepositoryEventDispatcherTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import java.lang.reflect.InvocationHandler; diff --git a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultRepositorySystemTest.java b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultRepositorySystemTest.java similarity index 63% rename from aether-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultRepositorySystemTest.java rename to maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultRepositorySystemTest.java index 89c2e1136..9576152ca 100644 --- a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultRepositorySystemTest.java +++ b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultRepositorySystemTest.java @@ -1,25 +1,43 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import java.util.Arrays; import java.util.List; import org.eclipse.aether.DefaultRepositorySystemSession; +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.artifact.DefaultArtifact; +import org.eclipse.aether.collection.CollectRequest; +import org.eclipse.aether.collection.CollectResult; +import org.eclipse.aether.collection.DependencyCollectionException; +import org.eclipse.aether.graph.Dependency; +import org.eclipse.aether.impl.DependencyCollector; import org.eclipse.aether.internal.test.util.TestUtils; import org.eclipse.aether.repository.Authentication; import org.eclipse.aether.repository.Proxy; import org.eclipse.aether.repository.RemoteRepository; +import org.eclipse.aether.resolution.DependencyRequest; +import org.eclipse.aether.resolution.DependencyResolutionException; import org.eclipse.aether.util.repository.AuthenticationBuilder; import org.eclipse.aether.util.repository.DefaultAuthenticationSelector; import org.eclipse.aether.util.repository.DefaultMirrorSelector; @@ -48,7 +66,7 @@ public void testNewResolutionRepositories() { Proxy proxy = new Proxy( "http", "localhost", 8080 ); DefaultProxySelector proxySelector = new DefaultProxySelector(); - proxySelector.add( proxy, null ); + proxySelector.add( proxy, "" ); session.setProxySelector( proxySelector ); Authentication auth = new AuthenticationBuilder().addUsername( "user" ).build(); @@ -84,7 +102,7 @@ public void testNewDeploymentRepository() { Proxy proxy = new Proxy( "http", "localhost", 8080 ); DefaultProxySelector proxySelector = new DefaultProxySelector(); - proxySelector.add( proxy, null ); + proxySelector.add( proxy, "" ); session.setProxySelector( proxySelector ); Authentication auth = new AuthenticationBuilder().addUsername( "user" ).build(); @@ -103,4 +121,29 @@ public void testNewDeploymentRepository() assertSame( auth, deployRepo.getAuthentication() ); } + @Test + public void testResolveDependencies_NoRootNode() + throws Exception + { + DependencyRequest request = new DependencyRequest(); + request.setCollectRequest( new CollectRequest().setRoot( new Dependency( new DefaultArtifact( "g:a:v" ), "" ) ) ); + system.setDependencyCollector( new DependencyCollector() + { + public CollectResult collectDependencies( RepositorySystemSession session, CollectRequest request ) + throws DependencyCollectionException + { + throw new DependencyCollectionException( null ); + } + } ); + try + { + system.resolveDependencies( session, request ); + fail( "Expected exception" ); + } + catch ( DependencyResolutionException e ) + { + assertTrue( e.getCause() instanceof DependencyCollectionException ); + } + } + } diff --git a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultUpdateCheckManagerTest.java b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultUpdateCheckManagerTest.java similarity index 96% rename from aether-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultUpdateCheckManagerTest.java rename to maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultUpdateCheckManagerTest.java index ae994bb4b..85e76effc 100644 --- a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultUpdateCheckManagerTest.java +++ b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultUpdateCheckManagerTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import java.io.File; @@ -44,7 +53,7 @@ public class DefaultUpdateCheckManagerTest { - private static final int HOUR = 60 * 60 * 1000; + private static final long HOUR = 60L * 60L * 1000L; private DefaultUpdateCheckManager manager; @@ -534,7 +543,7 @@ public void testCheckArtifact() throws Exception { UpdateCheck check = newArtifactCheck(); - long fifteenMinutes = new Date().getTime() - ( 15 * 60 * 1000 ); + long fifteenMinutes = new Date().getTime() - ( 15L * 60L * 1000L ); check.getFile().setLastModified( fifteenMinutes ); // time is truncated on setLastModfied fifteenMinutes = check.getFile().lastModified(); @@ -544,7 +553,7 @@ public void testCheckArtifact() assertEquals( true, check.isRequired() ); // just checked - check.setLocalLastUpdated( 0 ); + check.setLocalLastUpdated( 0L ); long lastUpdate = new Date().getTime(); check.getFile().setLastModified( lastUpdate ); lastUpdate = check.getFile().lastModified(); @@ -553,7 +562,7 @@ public void testCheckArtifact() assertEquals( false, check.isRequired() ); // no local file, no repo timestamp - check.setLocalLastUpdated( 0 ); + check.setLocalLastUpdated( 0L ); check.getFile().delete(); manager.checkArtifact( session, check ); assertEquals( true, check.isRequired() ); diff --git a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultUpdatePolicyAnalyzerTest.java b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultUpdatePolicyAnalyzerTest.java similarity index 85% rename from aether-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultUpdatePolicyAnalyzerTest.java rename to maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultUpdatePolicyAnalyzerTest.java index f822d70ff..31bcbaae1 100644 --- a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultUpdatePolicyAnalyzerTest.java +++ b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultUpdatePolicyAnalyzerTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.eclipse.aether.repository.RepositoryPolicy.*; import static org.junit.Assert.*; diff --git a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/DependencyGraphDumper.java b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/DependencyGraphDumper.java similarity index 85% rename from aether-impl/src/test/java/org/eclipse/aether/internal/impl/DependencyGraphDumper.java rename to maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/DependencyGraphDumper.java index aa82bb55c..39bc1ed42 100644 --- a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/DependencyGraphDumper.java +++ b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/DependencyGraphDumper.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.PrintWriter; import java.util.ArrayList; import java.util.IdentityHashMap; diff --git a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/EnhancedLocalRepositoryManagerTest.java b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/EnhancedLocalRepositoryManagerTest.java similarity index 92% rename from aether-impl/src/test/java/org/eclipse/aether/internal/impl/EnhancedLocalRepositoryManagerTest.java rename to maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/EnhancedLocalRepositoryManagerTest.java index 5e3f69141..32a422259 100644 --- a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/EnhancedLocalRepositoryManagerTest.java +++ b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/EnhancedLocalRepositoryManagerTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import java.io.File; @@ -122,13 +131,13 @@ private long addRemoteArtifact( Artifact artifact ) String path = manager.getPathForRemoteArtifact( artifact, repository, testContext ); return copy( artifact, path ); } - + private long copy( Metadata metadata, String path ) throws IOException { if ( metadata.getFile() == null ) { - return -1; + return -1L; } return TestFileUtils.copyFile( metadata.getFile(), new File( basedir, path ) ); } @@ -138,7 +147,7 @@ private long copy( Artifact artifact, String path ) { if ( artifact.getFile() == null ) { - return -1; + return -1L; } File artifactFile = new File( basedir, path ); return TestFileUtils.copyFile( artifact.getFile(), artifactFile ); diff --git a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/FailChecksumPolicyTest.java b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/FailChecksumPolicyTest.java similarity index 67% rename from aether-impl/src/test/java/org/eclipse/aether/internal/impl/FailChecksumPolicyTest.java rename to maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/FailChecksumPolicyTest.java index 5c6adad5b..296f82968 100644 --- a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/FailChecksumPolicyTest.java +++ b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/FailChecksumPolicyTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import org.eclipse.aether.spi.connector.checksum.ChecksumPolicy; @@ -28,7 +37,7 @@ public class FailChecksumPolicyTest @Before public void setup() { - policy = new FailChecksumPolicy( null, new TransferResource( "file:/dev/null", "file.txt", null, null ) ); + policy = new FailChecksumPolicy( null, new TransferResource( "null", "file:/dev/null", "file.txt", null, null ) ); exception = new ChecksumFailureException( "test" ); } diff --git a/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/IniArtifactDescriptorReader.java b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/IniArtifactDescriptorReader.java new file mode 100644 index 000000000..4ae2b9b9d --- /dev/null +++ b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/IniArtifactDescriptorReader.java @@ -0,0 +1,39 @@ +package org.eclipse.aether.internal.impl; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import org.eclipse.aether.impl.ArtifactDescriptorReader; + +/** + */ +public class IniArtifactDescriptorReader + extends org.eclipse.aether.internal.test.util.IniArtifactDescriptorReader + implements ArtifactDescriptorReader +{ + + /** + * Use the given prefix to load the artifact descriptions. + */ + public IniArtifactDescriptorReader( String prefix ) + { + super( prefix ); + } + +} diff --git a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/Maven2RepositoryLayoutFactoryTest.java b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/Maven2RepositoryLayoutFactoryTest.java similarity index 92% rename from aether-impl/src/test/java/org/eclipse/aether/internal/impl/Maven2RepositoryLayoutFactoryTest.java rename to maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/Maven2RepositoryLayoutFactoryTest.java index a66617aa6..7411a1dfa 100644 --- a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/Maven2RepositoryLayoutFactoryTest.java +++ b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/Maven2RepositoryLayoutFactoryTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import java.net.URI; diff --git a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/PrioritizedComponentTest.java b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/PrioritizedComponentTest.java similarity index 71% rename from aether-impl/src/test/java/org/eclipse/aether/internal/impl/PrioritizedComponentTest.java rename to maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/PrioritizedComponentTest.java index 6927e7b5f..989c1adde 100644 --- a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/PrioritizedComponentTest.java +++ b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/PrioritizedComponentTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import org.junit.Test; diff --git a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/PrioritizedComponentsTest.java b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/PrioritizedComponentsTest.java similarity index 83% rename from aether-impl/src/test/java/org/eclipse/aether/internal/impl/PrioritizedComponentsTest.java rename to maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/PrioritizedComponentsTest.java index 58d33aae6..3f5a09378 100644 --- a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/PrioritizedComponentsTest.java +++ b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/PrioritizedComponentsTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertSame; diff --git a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/RecordingRepositoryConnector.java b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/RecordingRepositoryConnector.java similarity index 90% rename from aether-impl/src/test/java/org/eclipse/aether/internal/impl/RecordingRepositoryConnector.java rename to maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/RecordingRepositoryConnector.java index e8133a4c7..80a347ac9 100644 --- a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/RecordingRepositoryConnector.java +++ b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/RecordingRepositoryConnector.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import java.util.ArrayList; @@ -185,7 +194,7 @@ private void fireInitiated( Transfer transfer ) return; } TransferEvent.Builder event = - new TransferEvent.Builder( session, new TransferResource( null, null, null, transfer.getTrace() ) ); + new TransferEvent.Builder( session, new TransferResource( null, null, null, null, transfer.getTrace() ) ); event.setType( TransferEvent.EventType.INITIATED ); listener.transferInitiated( event.build() ); } @@ -199,7 +208,7 @@ private void fireDone( Transfer transfer ) return; } TransferEvent.Builder event = - new TransferEvent.Builder( session, new TransferResource( null, null, null, transfer.getTrace() ) ); + new TransferEvent.Builder( session, new TransferResource( null, null, null, null, transfer.getTrace() ) ); event.setException( transfer.getException() ); if ( transfer.getException() != null ) { diff --git a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/RecordingRepositoryListener.java b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/RecordingRepositoryListener.java similarity index 75% rename from aether-impl/src/test/java/org/eclipse/aether/internal/impl/RecordingRepositoryListener.java rename to maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/RecordingRepositoryListener.java index 6fc3c3f2e..a6f91f124 100644 --- a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/RecordingRepositoryListener.java +++ b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/RecordingRepositoryListener.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Collections; import java.util.List; diff --git a/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/SafeTransferListenerTest.java b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/SafeTransferListenerTest.java new file mode 100644 index 000000000..6d7a6fea1 --- /dev/null +++ b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/SafeTransferListenerTest.java @@ -0,0 +1,45 @@ +package org.eclipse.aether.internal.impl; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import static org.junit.Assert.*; + +import java.lang.reflect.Method; + +import org.eclipse.aether.transfer.TransferListener; +import org.junit.Test; + +/** + */ +public class SafeTransferListenerTest +{ + + @Test + public void testAllEventTypesHandled() + throws Exception + { + Class type = SafeTransferListener.class; + for ( Method method : TransferListener.class.getMethods() ) + { + assertNotNull( type.getDeclaredMethod( method.getName(), method.getParameterTypes() ) ); + } + } + +} diff --git a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/SimpleLocalRepositoryManagerTest.java b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/SimpleLocalRepositoryManagerTest.java similarity index 81% rename from aether-impl/src/test/java/org/eclipse/aether/internal/impl/SimpleLocalRepositoryManagerTest.java rename to maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/SimpleLocalRepositoryManagerTest.java index e1e4f6e55..a301bd409 100644 --- a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/SimpleLocalRepositoryManagerTest.java +++ b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/SimpleLocalRepositoryManagerTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import java.io.File; diff --git a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/StaticUpdateCheckManager.java b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/StaticUpdateCheckManager.java similarity index 69% rename from aether-impl/src/test/java/org/eclipse/aether/internal/impl/StaticUpdateCheckManager.java rename to maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/StaticUpdateCheckManager.java index df6986835..334d54481 100644 --- a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/StaticUpdateCheckManager.java +++ b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/StaticUpdateCheckManager.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.impl.UpdateCheck; @@ -51,7 +60,7 @@ public void checkMetadata( RepositorySystemSession session, UpdateCheck artifacts, Collection metadatas ) + { + } + }; + } + +} diff --git a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/StubVersionRangeResolver.java b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/StubVersionRangeResolver.java similarity index 72% rename from aether-impl/src/test/java/org/eclipse/aether/internal/impl/StubVersionRangeResolver.java rename to maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/StubVersionRangeResolver.java index cb4b14741..ae415d7fb 100644 --- a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/StubVersionRangeResolver.java +++ b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/StubVersionRangeResolver.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.impl.VersionRangeResolver; import org.eclipse.aether.resolution.VersionRangeRequest; diff --git a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/StubVersionResolver.java b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/StubVersionResolver.java similarity index 50% rename from aether-impl/src/test/java/org/eclipse/aether/internal/impl/StubVersionResolver.java rename to maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/StubVersionResolver.java index 1dd98b100..719e5bccc 100644 --- a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/StubVersionResolver.java +++ b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/StubVersionResolver.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.impl.VersionResolver; import org.eclipse.aether.resolution.VersionRequest; diff --git a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/TrackingFileManagerTest.java b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/TrackingFileManagerTest.java similarity index 82% rename from aether-impl/src/test/java/org/eclipse/aether/internal/impl/TrackingFileManagerTest.java rename to maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/TrackingFileManagerTest.java index 5ffb19ba2..a3f4bb8b3 100644 --- a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/TrackingFileManagerTest.java +++ b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/TrackingFileManagerTest.java @@ -1,18 +1,28 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import java.io.File; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -70,7 +80,7 @@ public void testUpdate() TrackingFileManager tfm = new TrackingFileManager(); // NOTE: The excessive repetitions are to check the update properly truncates the file - File propFile = TestFileUtils.createTempFile( "key1=value1\nkey2 : value2\n".getBytes( "UTF-8" ), 1000 ); + File propFile = TestFileUtils.createTempFile( "key1=value1\nkey2 : value2\n".getBytes( StandardCharsets.UTF_8 ), 1000 ); Map updates = new HashMap(); updates.put( "key1", "v" ); diff --git a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/WarnChecksumPolicyTest.java b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/WarnChecksumPolicyTest.java similarity index 67% rename from aether-impl/src/test/java/org/eclipse/aether/internal/impl/WarnChecksumPolicyTest.java rename to maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/WarnChecksumPolicyTest.java index 36bfa5f41..7f64e062b 100644 --- a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/WarnChecksumPolicyTest.java +++ b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/WarnChecksumPolicyTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.impl; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import org.eclipse.aether.spi.connector.checksum.ChecksumPolicy; @@ -28,7 +37,7 @@ public class WarnChecksumPolicyTest @Before public void setup() { - policy = new WarnChecksumPolicy( null, new TransferResource( "file:/dev/null", "file.txt", null, null ) ); + policy = new WarnChecksumPolicy( null, new TransferResource( "null", "file:/dev/null", "file.txt", null, null ) ); exception = new ChecksumFailureException( "test" ); } diff --git a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/DataPoolTest.java b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/collect/DataPoolTest.java similarity index 52% rename from aether-impl/src/test/java/org/eclipse/aether/internal/impl/DataPoolTest.java rename to maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/collect/DataPoolTest.java index 8d140dccb..1df60819f 100644 --- a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/DataPoolTest.java +++ b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/collect/DataPoolTest.java @@ -1,23 +1,37 @@ -/******************************************************************************* - * Copyright (c) 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether.internal.impl; - -import static org.junit.Assert.*; +package org.eclipse.aether.internal.impl.collect; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + +import java.util.concurrent.ExecutionException; +import java.util.concurrent.Future; import org.eclipse.aether.DefaultRepositorySystemSession; import org.eclipse.aether.artifact.DefaultArtifact; import org.eclipse.aether.graph.Dependency; +import org.eclipse.aether.internal.impl.collect.DataPool; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.resolution.ArtifactDescriptorRequest; import org.eclipse.aether.resolution.ArtifactDescriptorResult; +import org.eclipse.aether.util.concurrency.FutureResult; import org.junit.Test; public class DataPoolTest @@ -29,7 +43,7 @@ private DataPool newDataPool() } @Test - public void testArtifactDescriptorCaching() + public void testArtifactDescriptorCaching() throws InterruptedException, ExecutionException { ArtifactDescriptorRequest request = new ArtifactDescriptorRequest(); request.setArtifact( new DefaultArtifact( "gid:aid:1" ) ); @@ -40,12 +54,14 @@ public void testArtifactDescriptorCaching() result.addManagedDependency( new Dependency( new DefaultArtifact( "gid:mdep:3" ), "runtime" ) ); result.addRepository( new RemoteRepository.Builder( "test", "default", "http://localhost" ).build() ); result.addAlias( new DefaultArtifact( "gid:alias:4" ) ); + Future futureResult = new FutureResult( result ); DataPool pool = newDataPool(); Object key = pool.toKey( request ); - pool.putDescriptor( key, result ); - ArtifactDescriptorResult cached = pool.getDescriptor( key, request ); - assertNotNull( cached ); + pool.putDescriptor( key, futureResult ); + Future futureCached = pool.getDescriptor( key, request ); + assertNotNull( futureCached ); + ArtifactDescriptorResult cached = futureCached.get(); assertEquals( result.getArtifact(), cached.getArtifact() ); assertEquals( result.getRelocations(), cached.getRelocations() ); assertEquals( result.getDependencies(), cached.getDependencies() ); diff --git a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultDependencyCollectorTest.java b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/collect/DefaultDependencyCollectorTest.java similarity index 61% rename from aether-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultDependencyCollectorTest.java rename to maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/collect/DefaultDependencyCollectorTest.java index b79e9905a..5eb7baf67 100644 --- a/aether-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultDependencyCollectorTest.java +++ b/maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/collect/DefaultDependencyCollectorTest.java @@ -1,16 +1,29 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.aether.internal.impl; - -import static org.junit.Assert.*; +package org.eclipse.aether.internal.impl.collect; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; import java.io.IOException; import java.util.ArrayList; @@ -34,11 +47,16 @@ import org.eclipse.aether.collection.DependencyCollectionException; import org.eclipse.aether.collection.DependencyManagement; import org.eclipse.aether.collection.DependencyManager; +import org.eclipse.aether.collection.DependencySelector; import org.eclipse.aether.graph.Dependency; import org.eclipse.aether.graph.DependencyCycle; import org.eclipse.aether.graph.DependencyNode; import org.eclipse.aether.graph.Exclusion; import org.eclipse.aether.impl.ArtifactDescriptorReader; +import org.eclipse.aether.internal.impl.IniArtifactDescriptorReader; +import org.eclipse.aether.internal.impl.StubRemoteRepositoryManager; +import org.eclipse.aether.internal.impl.StubVersionRangeResolver; +import org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector; import org.eclipse.aether.internal.test.util.DependencyGraphParser; import org.eclipse.aether.internal.test.util.TestLoggerFactory; import org.eclipse.aether.internal.test.util.TestUtils; @@ -49,6 +67,9 @@ import org.eclipse.aether.util.artifact.ArtifactIdUtils; import org.eclipse.aether.util.graph.manager.ClassicDependencyManager; import org.eclipse.aether.util.graph.manager.DependencyManagerUtils; +import org.eclipse.aether.util.graph.manager.TransitiveDependencyManager; +import org.eclipse.aether.util.graph.selector.OptionalDependencySelector; +import org.eclipse.aether.util.graph.selector.ScopeDependencySelector; import org.eclipse.aether.util.graph.version.HighestVersionFilter; import org.junit.Before; import org.junit.Test; @@ -472,6 +493,157 @@ public void testDependencyManagement_VerboseMode() assertEquals( Boolean.FALSE, DependencyManagerUtils.getPremanagedOptional( node ) ); } + @Test + public void testDependencyManagement_TransitiveDependencyManager() + throws DependencyCollectionException, IOException + { + collector.setArtifactDescriptorReader( newReader( "managed/" ) ); + parser = new DependencyGraphParser( "artifact-descriptions/managed/" ); + session.setDependencyManager( new TransitiveDependencyManager() ); + final Dependency root = newDep( "gid:0:ext:ver" ); + CollectRequest request = new CollectRequest( root, Arrays.asList( repository ) ); + CollectResult result = collector.collectDependencies( session, request ); + + DependencyNode expected = parser.parseResource( "management-tree.txt" ); + assertEqualSubtree( expected, result.getRoot() ); + } + + @Test + public void testDependencyManagement_DependencySelectorProcessesManagedState() + throws DependencyCollectionException, IOException + { + collector.setArtifactDescriptorReader( newReader( "selection/managed/" ) ); + parser = new DependencyGraphParser( "artifact-descriptions/selection/managed/" ); + + final Dependency root = newDep( "gid:root:ext:ver", "root-scope" ); + CollectRequest request = new CollectRequest( root, Arrays.asList( repository ) ); + CollectResult result = collector.collectDependencies( session, request ); + + DependencyNode expected = parser.parseResource( "all-nodes.txt" ); + assertEqualSubtree( expected, result.getRoot() ); + + this.session.setDependencySelector( new DependencySelector() + { + + public boolean selectDependency( final Dependency dependency ) + { + return dependency != null + && !( "managed".equals( dependency.getScope() ) + || "managed".equals( dependency.getArtifact().getVersion() ) + || dependency.isOptional() ); + + } + + public DependencySelector deriveChildSelector( final DependencyCollectionContext context ) + { + return this; + } + + } ); + + // Tests managed scope is processed by selector. + TestDependencyManager depMgmt = new TestDependencyManager(); + depMgmt.scope( "gid:transitive-of-transitive-of-root:ext", "managed" ); + session.setDependencyManager( depMgmt ); + + expected = parser.parseResource( "transitive-of-transitive-of-root.txt" ); + + request = new CollectRequest( root, Arrays.asList( repository ) ); + result = collector.collectDependencies( session, request ); + + assertEqualSubtree( expected, result.getRoot() ); + + depMgmt = new TestDependencyManager(); + depMgmt.scope( "gid:transitive-of-root:ext", "managed" ); + session.setDependencyManager( depMgmt ); + + expected = parser.parseResource( "transitive-of-root.txt" ); + + request = new CollectRequest( root, Arrays.asList( repository ) ); + result = collector.collectDependencies( session, request ); + + assertEqualSubtree( expected, result.getRoot() ); + + depMgmt = new TestDependencyManager(); + depMgmt.scope( "gid:direct-of-root:ext", "managed" ); + session.setDependencyManager( depMgmt ); + + expected = parser.parseResource( "direct-of-root.txt" ); + + request = new CollectRequest( root, Arrays.asList( repository ) ); + result = collector.collectDependencies( session, request ); + + assertEqualSubtree( expected, result.getRoot() ); + + // Tests managed optionality is processed by selector. + depMgmt = new TestDependencyManager(); + depMgmt.optional( "gid:transitive-of-transitive-of-root:ext", Boolean.TRUE ); + session.setDependencyManager( depMgmt ); + + expected = parser.parseResource( "transitive-of-transitive-of-root.txt" ); + + request = new CollectRequest( root, Arrays.asList( repository ) ); + result = collector.collectDependencies( session, request ); + + assertEqualSubtree( expected, result.getRoot() ); + + depMgmt = new TestDependencyManager(); + depMgmt.optional( "gid:transitive-of-root:ext", Boolean.TRUE ); + session.setDependencyManager( depMgmt ); + + expected = parser.parseResource( "transitive-of-root.txt" ); + + request = new CollectRequest( root, Arrays.asList( repository ) ); + result = collector.collectDependencies( session, request ); + + assertEqualSubtree( expected, result.getRoot() ); + + depMgmt = new TestDependencyManager(); + depMgmt.optional( "gid:direct-of-root:ext", Boolean.TRUE ); + session.setDependencyManager( depMgmt ); + + expected = parser.parseResource( "direct-of-root.txt" ); + + request = new CollectRequest( root, Arrays.asList( repository ) ); + result = collector.collectDependencies( session, request ); + + assertEqualSubtree( expected, result.getRoot() ); + + // Tests managed version is processed by selector. + depMgmt = new TestDependencyManager(); + depMgmt.version( "gid:transitive-of-transitive-of-root:ext", "managed" ); + session.setDependencyManager( depMgmt ); + + expected = parser.parseResource( "transitive-of-transitive-of-root.txt" ); + + request = new CollectRequest( root, Arrays.asList( repository ) ); + result = collector.collectDependencies( session, request ); + + assertEqualSubtree( expected, result.getRoot() ); + + depMgmt = new TestDependencyManager(); + depMgmt.version( "gid:transitive-of-root:ext", "managed" ); + session.setDependencyManager( depMgmt ); + + expected = parser.parseResource( "transitive-of-root.txt" ); + + request = new CollectRequest( root, Arrays.asList( repository ) ); + result = collector.collectDependencies( session, request ); + + assertEqualSubtree( expected, result.getRoot() ); + + depMgmt = new TestDependencyManager(); + depMgmt.version( "gid:direct-of-root:ext", "managed" ); + session.setDependencyManager( depMgmt ); + + expected = parser.parseResource( "direct-of-root.txt" ); + + request = new CollectRequest( root, Arrays.asList( repository ) ); + result = collector.collectDependencies( session, request ); + + assertEqualSubtree( expected, result.getRoot() ); + } + @Test public void testVersionFilter() throws Exception @@ -482,6 +654,135 @@ public void testVersionFilter() assertEquals( 1, result.getRoot().getChildren().size() ); } + @Test + public void testSelectionWithScopeDependencySelector() + throws DependencyCollectionException, IOException + { + collector.setArtifactDescriptorReader( newReader( "selection/scope/" ) ); + parser = new DependencyGraphParser( "artifact-descriptions/selection/scope/" ); + + final Dependency root = newDep( "gid:root:ext:ver", "root-scope" ); + CollectRequest request = new CollectRequest( root, Arrays.asList( repository ) ); + CollectResult result = collector.collectDependencies( session, request ); + + DependencyNode expected = parser.parseResource( "all-nodes.txt" ); + assertEqualSubtree( expected, result.getRoot() ); + + /* + A dependency selector that filters transitive dependencies based on their scope. Direct dependencies are always + included regardless of their scope. + */ + // Include all. + this.session.setDependencySelector( new ScopeDependencySelector() ); + + request = new CollectRequest( root, Arrays.asList( repository ) ); + result = collector.collectDependencies( session, request ); + + assertEqualSubtree( expected, result.getRoot() ); + + // Exclude scope of direct dependency of root equals "include all" as direct dependencies are always included. + this.session.setDependencySelector( new ScopeDependencySelector( "direct-of-root-scope" ) ); + + request = new CollectRequest( root, Arrays.asList( repository ) ); + result = collector.collectDependencies( session, request ); + + assertEqualSubtree( expected, result.getRoot() ); + + // Exclude scope of transitive dependency of direct dependency of root. + expected = parser.parseResource( "transitive-of-root-scope-exclusion-tree.txt" ); + this.session.setDependencySelector( new ScopeDependencySelector( "transitive-of-root-scope" ) ); + + request = new CollectRequest( root, Arrays.asList( repository ) ); + result = collector.collectDependencies( session, request ); + + assertEqualSubtree( expected, result.getRoot() ); + + // Exclude scope of transitive dependency of transitive dependency of direct dependency of root. + expected = parser.parseResource( "transitive-of-transitive-of-root-exclusion-tree.txt" ); + this.session.setDependencySelector( new ScopeDependencySelector( "transitive-of-transitive-of-root-scope" ) ); + + request = new CollectRequest( root, Arrays.asList( repository ) ); + result = collector.collectDependencies( session, request ); + + assertEqualSubtree( expected, result.getRoot() ); + } + + @Test + public void testSelectionWithOptionalDependencySelector() + throws DependencyCollectionException, IOException + { + collector.setArtifactDescriptorReader( newReader( "selection/optional/" ) ); + parser = new DependencyGraphParser( "artifact-descriptions/selection/optional/" ); + + final Dependency root = newDep( "gid:root:ext:ver", "root-scope" ); + CollectRequest request = new CollectRequest( root, Arrays.asList( repository ) ); + CollectResult result = collector.collectDependencies( session, request ); + + DependencyNode expected = parser.parseResource( "no-selector-tree.txt" ); + assertEqualSubtree( expected, result.getRoot() ); + + // Exclude optional transitive dependencies. + expected = parser.parseResource( "optional-exclusion-tree.txt" ); + this.session.setDependencySelector( new OptionalDependencySelector() ); + + request = new CollectRequest( root, Arrays.asList( repository ) ); + result = collector.collectDependencies( session, request ); + + assertEqualSubtree( expected, result.getRoot() ); + } + + @Test + public void testResolveRootRelocation() throws Exception + { + Dependency dependency = newDep( "oldgid:aid:ext:ver" ); + CollectRequest request = new CollectRequest( dependency, Arrays.asList( repository ) ); + + session.setDependencyManager( new ClassicDependencyManager() ); + + CollectResult result = collector.collectDependencies( session, request ); + + assertEquals( 0, result.getExceptions().size() ); + + Dependency relocated = newDep( "gid:aid:ext:ver", null ); + DependencyNode root = result.getRoot(); + + assertEquals( relocated, dep( root ) ); + assertEquals( relocated.getArtifact(), dep( root ).getArtifact() ); + + assertEquals( 1, root.getChildren().size() ); + Dependency expect = newDep( "gid:aid2:ext:ver", "compile" ); + assertEquals( expect, dep( root, 0 ) ); + + assertEquals( 0, path( root, 0 ).getChildren().size() ); + } + + @Test + public void testResolveDependencyRelocation() throws Exception + { + Dependency dependency = newDep( "gid:aid3:ext:5" ); + CollectRequest request = new CollectRequest( dependency, Arrays.asList( repository ) ); + + session.setDependencyManager( new ClassicDependencyManager() ); + + CollectResult result = collector.collectDependencies( session, request ); + + assertEquals( 0, result.getExceptions().size() ); + + DependencyNode root = result.getRoot(); + assertEquals( dependency, dep( root ) ); + assertEquals( dependency.getArtifact(), dep( root ).getArtifact() ); + + assertEquals( 1, root.getChildren().size() ); + Dependency expect = newDep( "gid:aid:ext:ver", "compile" ); + assertEquals( expect, dep( root, 0 ) ); + + assertEquals( 1, path( root, 0 ).getChildren().size() ); + expect = newDep( "gid:aid2:ext:ver", "compile" ); + assertEquals( expect, dep( root, 0, 0 ) ); + + assertEquals( 0, path( root, 0, 0 ).getChildren().size() ); + } + static class TestDependencyManager implements DependencyManager { diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_117_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_117_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_117_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_117_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_117_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_117_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_117_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_117_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_11_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_11_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_11_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_11_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_11_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_11_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_11_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_11_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_121_3.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_121_3.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_121_3.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_121_3.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_121_3.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_121_3.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_121_3.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_121_3.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_12_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_12_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_12_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_12_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_12_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_12_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_12_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_12_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_139_3.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_139_3.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_139_3.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_139_3.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_139_3.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_139_3.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_139_3.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_139_3.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_141_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_141_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_141_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_141_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_141_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_141_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_141_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_141_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_145_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_145_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_145_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_145_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_145_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_145_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_145_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_145_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_146_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_146_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_146_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_146_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_146_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_146_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_146_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_146_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_147_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_147_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_147_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_147_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_147_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_147_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_147_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_147_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_148_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_148_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_148_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_148_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_148_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_148_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_148_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_148_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_149_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_149_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_149_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_149_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_149_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_149_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_149_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_149_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_150_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_150_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_150_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_150_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_150_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_150_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_150_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_150_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_152_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_152_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_152_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_152_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_152_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_152_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_152_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_152_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_155_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_155_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_155_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_155_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_155_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_155_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_155_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_155_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_156_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_156_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_156_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_156_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_156_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_156_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_156_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_156_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_160_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_160_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_160_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_160_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_160_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_160_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_160_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_160_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_161_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_161_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_161_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_161_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_161_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_161_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_161_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_161_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_162_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_162_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_162_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_162_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_162_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_162_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_162_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_162_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_163_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_163_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_163_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_163_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_163_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_163_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_163_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_163_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_164_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_164_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_164_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_164_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_164_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_164_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_164_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_164_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_167_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_167_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_167_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_167_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_167_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_167_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_167_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_167_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_172_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_172_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_172_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_172_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_172_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_172_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_172_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_172_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_173_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_173_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_173_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_173_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_173_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_173_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_173_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_173_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_174_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_174_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_174_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_174_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_174_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_174_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_174_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_174_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_175_2.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_175_2.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_175_2.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_175_2.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_175_2.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_175_2.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_175_2.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_175_2.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_176_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_176_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_176_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_176_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_176_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_176_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_176_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_176_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_177_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_177_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_177_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_177_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_177_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_177_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_177_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_177_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_178_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_178_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_178_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_178_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_178_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_178_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_178_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_178_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_179_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_179_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_179_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_179_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_179_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_179_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_179_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_179_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_180_3.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_180_3.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_180_3.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_180_3.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_180_3.2-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_180_3.2-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_180_3.2-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_180_3.2-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_189_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_189_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_189_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_189_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_189_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_189_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_189_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_189_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_202_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_202_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_202_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_202_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_202_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_202_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_202_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_202_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_203_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_203_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_203_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_203_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_203_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_203_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_203_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_203_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_205_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_205_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_205_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_205_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_205_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_205_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_205_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_205_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_206_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_206_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_206_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_206_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_206_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_206_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_206_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_206_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_207_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_207_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_207_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_207_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_207_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_207_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_207_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_207_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_210_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_210_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_210_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_210_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_210_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_210_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_210_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_210_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_212_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_212_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_212_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_212_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_212_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_212_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_212_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_212_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_213_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_213_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_213_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_213_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_213_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_213_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_213_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_213_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_214_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_214_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_214_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_214_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_214_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_214_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_214_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_214_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_215_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_215_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_215_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_215_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_215_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_215_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_215_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_215_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_216_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_216_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_216_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_216_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_216_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_216_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_216_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_216_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_220_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_220_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_220_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_220_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_220_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_220_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_220_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_220_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_224_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_224_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_224_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_224_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_224_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_224_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_224_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_224_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_225_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_225_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_225_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_225_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_225_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_225_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_225_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_225_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_226_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_226_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_226_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_226_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_226_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_226_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_226_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_226_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_228_1.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_228_1.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_228_1.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_228_1.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_229_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_229_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_229_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_229_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_229_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_229_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_229_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_229_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_22_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_22_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_22_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_22_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_22_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_22_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_22_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_22_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_230_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_230_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_230_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_230_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_230_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_230_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_230_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_230_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_231_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_231_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_231_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_231_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_231_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_231_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_231_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_231_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_232_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_232_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_232_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_232_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_232_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_232_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_232_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_232_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_233_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_233_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_233_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_233_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_233_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_233_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_233_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_233_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_235_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_235_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_235_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_235_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_235_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_235_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_235_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_235_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_236_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_236_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_236_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_236_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_236_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_236_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_236_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_236_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_237_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_237_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_237_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_237_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_237_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_237_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_237_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_237_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_238_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_238_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_238_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_238_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_238_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_238_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_238_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_238_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_241_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_241_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_241_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_241_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_241_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_241_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_241_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_241_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_242_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_242_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_242_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_242_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_242_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_242_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_242_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_242_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_243_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_243_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_243_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_243_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_243_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_243_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_243_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_243_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_246_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_246_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_246_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_246_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_246_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_246_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_246_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_246_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_247_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_247_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_247_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_247_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_247_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_247_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_247_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_247_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_251_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_251_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_251_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_251_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_251_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_251_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_251_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_251_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_252_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_252_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_252_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_252_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_252_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_252_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_252_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_252_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_254_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_254_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_254_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_254_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_254_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_254_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_254_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_254_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_255_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_255_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_255_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_255_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_255_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_255_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_255_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_255_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_257_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_257_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_257_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_257_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_257_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_257_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_257_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_257_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_258_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_258_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_258_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_258_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_258_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_258_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_258_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_258_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_261_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_261_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_261_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_261_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_261_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_261_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_261_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_261_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_262_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_262_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_262_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_262_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_262_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_262_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_262_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_262_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_263_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_263_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_263_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_263_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_263_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_263_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_263_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_263_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_265_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_265_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_265_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_265_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_265_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_265_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_265_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_265_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_266_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_266_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_266_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_266_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_266_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_266_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_266_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_266_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_268_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_268_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_268_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_268_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_268_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_268_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_268_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_268_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_269_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_269_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_269_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_269_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_269_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_269_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_269_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_269_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_271_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_271_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_271_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_271_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_271_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_271_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_271_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_271_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_272_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_272_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_272_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_272_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_272_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_272_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_272_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_272_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_275_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_275_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_275_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_275_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_275_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_275_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_275_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_275_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_276_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_276_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_276_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_276_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_276_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_276_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_276_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_276_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_277_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_277_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_277_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_277_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_279_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_279_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_279_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_279_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_280_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_280_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_280_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_280_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_281_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_281_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_281_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_281_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_284_2.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_284_2.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_284_2.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_284_2.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_284_2.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_284_2.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_284_2.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_284_2.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_285_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_285_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_285_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_285_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_285_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_285_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_285_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_285_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_286_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_286_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_286_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_286_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_286_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_286_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_286_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_286_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_288_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_288_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_288_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_288_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_288_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_288_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_288_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_288_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_291_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_291_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_291_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_291_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_291_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_291_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_291_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_291_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_292_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_292_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_292_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_292_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_292_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_292_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_292_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_292_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_294_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_294_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_294_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_294_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_294_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_294_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_294_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_294_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_295_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_295_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_295_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_295_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_295_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_295_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_295_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_295_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_297_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_297_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_297_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_297_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_297_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_297_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_297_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_297_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_298_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_298_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_298_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_298_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_298_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_298_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_298_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_298_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_301_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_301_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_301_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_301_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_301_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_301_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_301_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_301_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_303_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_303_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_303_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_303_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_303_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_303_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_303_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_303_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_305_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_305_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_305_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_305_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_305_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_305_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_305_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_305_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_306_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_306_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_306_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_306_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_306_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_306_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_306_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_306_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_307_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_307_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_307_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_307_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_307_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_307_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_307_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_307_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_315_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_315_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_315_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_315_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_315_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_315_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_315_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_315_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_316_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_316_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_316_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_316_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_316_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_316_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_316_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_316_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_317_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_317_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_317_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_317_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_317_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_317_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_317_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_317_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_318_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_318_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_318_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_318_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_318_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_318_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_318_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_318_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_319_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_319_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_319_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_319_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_319_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_319_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_319_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_319_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_320_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_320_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_320_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_320_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_320_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_320_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_320_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_320_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_321_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_321_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_321_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_321_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_321_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_321_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_321_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_321_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_322_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_322_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_322_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_322_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_322_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_322_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_322_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_322_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_325_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_325_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_325_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_325_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_325_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_325_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_325_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_325_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_327_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_327_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_327_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_327_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_327_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_327_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_327_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_327_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_328_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_328_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_328_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_328_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_328_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_328_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_328_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_328_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_329_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_329_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_329_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_329_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_329_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_329_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_329_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_329_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_330_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_330_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_330_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_330_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_330_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_330_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_330_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_330_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_331_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_331_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_331_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_331_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_331_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_331_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_331_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_331_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_332_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_332_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_332_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_332_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_332_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_332_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_332_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_332_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_333_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_333_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_333_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_333_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_333_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_333_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_333_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_333_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_334_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_334_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_334_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_334_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_334_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_334_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_334_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_334_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_335_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_335_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_335_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_335_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_335_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_335_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_335_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_335_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_336_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_336_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_336_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_336_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_336_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_336_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_336_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_336_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_337_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_337_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_337_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_337_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_337_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_337_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_337_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_337_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_343_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_343_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_343_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_343_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_343_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_343_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_343_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_343_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_345_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_345_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_345_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_345_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_345_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_345_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_345_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_345_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_346_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_346_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_346_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_346_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_346_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_346_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_346_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_346_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_347_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_347_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_347_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_347_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_347_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_347_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_347_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_347_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_349_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_349_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_349_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_349_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_349_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_349_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_349_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_349_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_350_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_350_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_350_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_350_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_350_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_350_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_350_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_350_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_351_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_351_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_351_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_351_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_351_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_351_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_351_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_351_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_356_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_356_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_356_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_356_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_356_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_356_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_356_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_356_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_357_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_357_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_357_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_357_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_359_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_359_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_359_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_359_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_360_1.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_360_1.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_360_1.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_360_1.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_361_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_361_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_361_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_361_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_362_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_362_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_362_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_362_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_363_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_363_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_363_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_363_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_364_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_364_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_364_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_364_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_366_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_366_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_366_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_366_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_42_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_42_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_42_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_42_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_42_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_42_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_42_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_42_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_43_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_43_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_43_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_43_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_43_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_43_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_43_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_43_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_62_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_62_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_62_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_62_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_62_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_62_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_62_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_62_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_72_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_72_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_72_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_72_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_72_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_72_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_72_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_72_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_80_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_80_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_80_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_80_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_80_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_80_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_80_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_80_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_81_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_81_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_81_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_81_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_81_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_81_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_81_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_81_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_90_1.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_90_1.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/10_90_1.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/10_90_1.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_100_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_100_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_100_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_100_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_101_1.0_sap.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_101_1.0_sap.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_101_1.0_sap.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_101_1.0_sap.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_102_1.busObj.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_102_1.busObj.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_102_1.busObj.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_102_1.busObj.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_103_6403-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_103_6403-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_103_6403-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_103_6403-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_104_70-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_104_70-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_104_70-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_104_70-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_105_70-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_105_70-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_105_70-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_105_70-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_106_3.5.5-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_106_3.5.5-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_106_3.5.5-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_106_3.5.5-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_107_1.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_107_1.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_107_1.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_107_1.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_108_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_108_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_108_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_108_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_109_6.0.5-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_109_6.0.5-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_109_6.0.5-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_109_6.0.5-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_110_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_110_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_110_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_110_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_111_1.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_111_1.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_111_1.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_111_1.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_112_1.0.30-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_112_1.0.30-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_112_1.0.30-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_112_1.0.30-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_113_2.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_113_2.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_113_2.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_113_2.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_114_2.50.16.busObj.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_114_2.50.16.busObj.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_114_2.50.16.busObj.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_114_2.50.16.busObj.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_114_2.50.28_sap.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_114_2.50.28_sap.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_114_2.50.28_sap.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_114_2.50.28_sap.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_115_4.2.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_115_4.2.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_115_4.2.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_115_4.2.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_116_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_116_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_116_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_116_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_118_10.2.2.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_118_10.2.2.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_118_10.2.2.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_118_10.2.2.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_118_10.5.3.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_118_10.5.3.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_118_10.5.3.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_118_10.5.3.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_119_1.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_119_1.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_119_1.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_119_1.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_120_1.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_120_1.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_120_1.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_120_1.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_122_3.1.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_122_3.1.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_122_3.1.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_122_3.1.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_123_3.1.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_123_3.1.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_123_3.1.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_123_3.1.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_124_2.2-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_124_2.2-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_124_2.2-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_124_2.2-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_125_8.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_125_8.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_125_8.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_125_8.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_125_9.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_125_9.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_125_9.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_125_9.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_125_9.5-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_125_9.5-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_125_9.5-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_125_9.5-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_126_2.81-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_126_2.81-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_126_2.81-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_126_2.81-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_126_2.90-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_126_2.90-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_126_2.90-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_126_2.90-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_126_3.50-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_126_3.50-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_126_3.50-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_126_3.50-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_127_6.20-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_127_6.20-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_127_6.20-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_127_6.20-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_127_6.30-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_127_6.30-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_127_6.30-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_127_6.30-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_128_2006-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_128_2006-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_128_2006-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_128_2006-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_129_10.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_129_10.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_129_10.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_129_10.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_130_10.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_130_10.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_130_10.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_130_10.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_130_10.2-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_130_10.2-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_130_10.2-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_130_10.2-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_130_11.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_130_11.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_130_11.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_130_11.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_130_9.2-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_130_9.2-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_130_9.2-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_130_9.2-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_131_5.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_131_5.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_131_5.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_131_5.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_131_5.3-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_131_5.3-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_131_5.3-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_131_5.3-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_131_6.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_131_6.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_131_6.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_131_6.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_132_7.7-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_132_7.7-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_132_7.7-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_132_7.7-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_133_12.5-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_133_12.5-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_133_12.5-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_133_12.5-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_133_15.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_133_15.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_133_15.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_133_15.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_133_15.5-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_133_15.5-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_133_15.5-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_133_15.5-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_134_12.6-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_134_12.6-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_134_12.6-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_134_12.6-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_134_12.7-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_134_12.7-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_134_12.7-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_134_12.7-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_135_10.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_135_10.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_135_10.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_135_10.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_135_11.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_135_11.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_135_11.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_135_11.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_136_3.04-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_136_3.04-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_136_3.04-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_136_3.04-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_136_3.06-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_136_3.06-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_136_3.06-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_136_3.06-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_137_2.2.12-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_137_2.2.12-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_137_2.2.12-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_137_2.2.12-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_138_7.7.06-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_138_7.7.06-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_138_7.7.06-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_138_7.7.06-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_13_1.7.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_13_1.7.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_13_1.7.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_13_1.7.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_140_5.5.28-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_140_5.5.28-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_140_5.5.28-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_140_5.5.28-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_140_6.0.18-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_140_6.0.18-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_140_6.0.18-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_140_6.0.18-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_140_6.0.24-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_140_6.0.24-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_140_6.0.24-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_140_6.0.24-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_142_9.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_142_9.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_142_9.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_142_9.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_143_6.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_143_6.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_143_6.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_143_6.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_144_15.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_144_15.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_144_15.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_144_15.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_14_2.5.2-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_14_2.5.2-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_14_2.5.2-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_14_2.5.2-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_151_3.7.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_151_3.7.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_151_3.7.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_151_3.7.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_153_1.1.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_153_1.1.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_153_1.1.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_153_1.1.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_154_3.3-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_154_3.3-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_154_3.3-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_154_3.3-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_157_0.0.356_sap.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_157_0.0.356_sap.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_157_0.0.356_sap.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_157_0.0.356_sap.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_158_3.5-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_158_3.5-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_158_3.5-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_158_3.5-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_159_2.1_03-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_159_2.1_03-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_159_2.1_03-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_159_2.1_03-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_15_1.36.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_15_1.36.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_15_1.36.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_15_1.36.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_165_11.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_165_11.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_165_11.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_165_11.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_165_7.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_165_7.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_165_7.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_165_7.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_165_7.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_165_7.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_165_7.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_165_7.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_165_9.3-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_165_9.3-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_165_9.3-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_165_9.3-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_166_720-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_166_720-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_166_720-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_166_720-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_168_6.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_168_6.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_168_6.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_168_6.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_169_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_169_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_169_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_169_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_16_1.8.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_16_1.8.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_16_1.8.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_16_1.8.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_170_10.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_170_10.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_170_10.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_170_10.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_171_8.45-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_171_8.45-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_171_8.45-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_171_8.45-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_171_8.46-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_171_8.46-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_171_8.46-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_171_8.46-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_17_1.2.3-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_17_1.2.3-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_17_1.2.3-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_17_1.2.3-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_181_1.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_181_1.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_181_1.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_181_1.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_182_3.2-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_182_3.2-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_182_3.2-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_182_3.2-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_183_0.9-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_183_0.9-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_183_0.9-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_183_0.9-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_184_20080807-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_184_20080807-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_184_20080807-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_184_20080807-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_185_1.0_sap.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_185_1.0_sap.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_185_1.0_sap.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_185_1.0_sap.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_185_1.0_sap.2-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_185_1.0_sap.2-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_185_1.0_sap.2-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_185_1.0_sap.2-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_186_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_186_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_186_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_186_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_187_4.3-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_187_4.3-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_187_4.3-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_187_4.3-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_188_1.9-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_188_1.9-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_188_1.9-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_188_1.9-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_18_5.1.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_18_5.1.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_18_5.1.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_18_5.1.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_18_5.1.1.41-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_18_5.1.1.41-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_18_5.1.1.41-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_18_5.1.1.41-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_190_2.0.8-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_190_2.0.8-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_190_2.0.8-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_190_2.0.8-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_191_3.2-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_191_3.2-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_191_3.2-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_191_3.2-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_192_1.8.0.7-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_192_1.8.0.7-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_192_1.8.0.7-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_192_1.8.0.7-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_193_0.8.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_193_0.8.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_193_0.8.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_193_0.8.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_194_2.3.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_194_2.3.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_194_2.3.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_194_2.3.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_195_3.2-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_195_3.2-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_195_3.2-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_195_3.2-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_196_1.2.12-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_196_1.2.12-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_196_1.2.12-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_196_1.2.12-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_197_5.1.3-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_197_5.1.3-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_197_5.1.3-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_197_5.1.3-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_198_9.1.3-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_198_9.1.3-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_198_9.1.3-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_198_9.1.3-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_199_2.2-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_199_2.2-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_199_2.2-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_199_2.2-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_19_6.3-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_19_6.3-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_19_6.3-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_19_6.3-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_200_3.1.12-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_200_3.1.12-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_200_3.1.12-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_200_3.1.12-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_200_5.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_200_5.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_200_5.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_200_5.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_201_3.5.2-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_201_3.5.2-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_201_3.5.2-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_201_3.5.2-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_204_1.6.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_204_1.6.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_204_1.6.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_204_1.6.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_208_10.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_208_10.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_208_10.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_208_10.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_209_3.51-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_209_3.51-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_209_3.51-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_209_3.51-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_20_3.3.2-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_20_3.3.2-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_20_3.3.2-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_20_3.3.2-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_211_1.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_211_1.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_211_1.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_211_1.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_217_1.0_sap.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_217_1.0_sap.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_217_1.0_sap.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_217_1.0_sap.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_218_2.2.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_218_2.2.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_218_2.2.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_218_2.2.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_219_2.3.4-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_219_2.3.4-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_219_2.3.4-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_219_2.3.4-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_21_3.2.1.2-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_21_3.2.1.2-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_21_3.2.1.2-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_21_3.2.1.2-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_221_8.9-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_221_8.9-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_221_8.9-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_221_8.9-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_222_1.1.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_222_1.1.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_222_1.1.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_222_1.1.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_222_beta8-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_222_beta8-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_222_beta8-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_222_beta8-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_223_7.5-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_223_7.5-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_223_7.5-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_223_7.5-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_227_7.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_227_7.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_227_7.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_227_7.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_234_1.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_234_1.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_234_1.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_234_1.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_239_3.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_239_3.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_239_3.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_239_3.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_23_1.2.6_sap.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_23_1.2.6_sap.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_23_1.2.6_sap.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_23_1.2.6_sap.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_240_720-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_240_720-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_240_720-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_240_720-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_244_1.2-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_244_1.2-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_244_1.2-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_244_1.2-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_245_1.0.2-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_245_1.0.2-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_245_1.0.2-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_245_1.0.2-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_248_5.5-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_248_5.5-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_248_5.5-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_248_5.5-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_249_9.2.2-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_249_9.2.2-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_249_9.2.2-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_249_9.2.2-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_24_1.2.10-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_24_1.2.10-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_24_1.2.10-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_24_1.2.10-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_250_1.0_sap.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_250_1.0_sap.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_250_1.0_sap.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_250_1.0_sap.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_253_1.3.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_253_1.3.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_253_1.3.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_253_1.3.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_256_3.2-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_256_3.2-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_256_3.2-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_256_3.2-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_259_2.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_259_2.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_259_2.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_259_2.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_25_0.86-beta1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_25_0.86-beta1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_25_0.86-beta1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_25_0.86-beta1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_260_2.2.5-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_260_2.2.5-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_260_2.2.5-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_260_2.2.5-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_260_2.3.3-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_260_2.3.3-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_260_2.3.3-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_260_2.3.3-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_264_6.2-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_264_6.2-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_264_6.2-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_264_6.2-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_267_3.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_267_3.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_267_3.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_267_3.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_26_3.0.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_26_3.0.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_26_3.0.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_26_3.0.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_26_3.8.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_26_3.8.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_26_3.8.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_26_3.8.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_26_4.2.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_26_4.2.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_26_4.2.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_26_4.2.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_270_1.6.5-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_270_1.6.5-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_270_1.6.5-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_270_1.6.5-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_273_1.0.3-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_273_1.0.3-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_273_1.0.3-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_273_1.0.3-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_274_1.0.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_274_1.0.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_274_1.0.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_274_1.0.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_278_1.8.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_278_1.8.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_278_1.8.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_278_1.8.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_27_6.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_27_6.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_27_6.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_27_6.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_282_2.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_282_2.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_282_2.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_282_2.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_283_1.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_283_1.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_283_1.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_283_1.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_287_1.1.2.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_287_1.1.2.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_287_1.1.2.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_287_1.1.2.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_287_1.3-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_287_1.3-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_287_1.3-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_287_1.3-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_289_2.2.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_289_2.2.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_289_2.2.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_289_2.2.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_28_4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_28_4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_28_4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_28_4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_290_8.0.2.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_290_8.0.2.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_290_8.0.2.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_290_8.0.2.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_293_0.2.5-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_293_0.2.5-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_293_0.2.5-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_293_0.2.5-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_296_1.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_296_1.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_296_1.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_296_1.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_299_7.20-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_299_7.20-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_299_7.20-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_299_7.20-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_29_3.0.5-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_29_3.0.5-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_29_3.0.5-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_29_3.0.5-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_2_5.50-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_2_5.50-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_2_5.50-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_2_5.50-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_300_7.1.8-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_300_7.1.8-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_300_7.1.8-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_300_7.1.8-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_302_1.015-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_302_1.015-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_302_1.015-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_302_1.015-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_304_9.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_304_9.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_304_9.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_304_9.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_308_1.8-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_308_1.8-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_308_1.8-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_308_1.8-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_309_1.15.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_309_1.15.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_309_1.15.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_309_1.15.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_30_0.7.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_30_0.7.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_30_0.7.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_30_0.7.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_310_4.2.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_310_4.2.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_310_4.2.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_310_4.2.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_311_2.3.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_311_2.3.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_311_2.3.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_311_2.3.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_312_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_312_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_312_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_312_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_313_2.2-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_313_2.2-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_313_2.2-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_313_2.2-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_314_6.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_314_6.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_314_6.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_314_6.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_31_2.2-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_31_2.2-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_31_2.2-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_31_2.2-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_323_11.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_323_11.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_323_11.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_323_11.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_324_5.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_324_5.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_324_5.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_324_5.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_326_0.9.7-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_326_0.9.7-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_326_0.9.7-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_326_0.9.7-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_32_720-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_32_720-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_32_720-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_32_720-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_338_2.8-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_338_2.8-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_338_2.8-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_338_2.8-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_338_3.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_338_3.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_338_3.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_338_3.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_339_8.0.1p5-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_339_8.0.1p5-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_339_8.0.1p5-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_339_8.0.1p5-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_33_711-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_33_711-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_33_711-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_33_711-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_340_2.11-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_340_2.11-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_340_2.11-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_340_2.11-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_340_2.9-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_340_2.9-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_340_2.9-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_340_2.9-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_341_0.9-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_341_0.9-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_341_0.9-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_341_0.9-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_341_1.3-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_341_1.3-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_341_1.3-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_341_1.3-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_342_1.2-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_342_1.2-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_342_1.2-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_342_1.2-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_344_1.6.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_344_1.6.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_344_1.6.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_344_1.6.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_348_3.8.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_348_3.8.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_348_3.8.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_348_3.8.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_34_1.13-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_34_1.13-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_34_1.13-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_34_1.13-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_352_6.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_352_6.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_352_6.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_352_6.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_353_1.2.3-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_353_1.2.3-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_353_1.2.3-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_353_1.2.3-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_354_1.6.2-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_354_1.6.2-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_354_1.6.2-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_354_1.6.2-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_355_3.0.5-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_355_3.0.5-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_355_3.0.5-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_355_3.0.5-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_358_1.1.2-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_358_1.1.2-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_358_1.1.2-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_358_1.1.2-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_35_1.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_35_1.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_35_1.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_35_1.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_365_3.4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_365_3.4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_365_3.4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_365_3.4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_367_8.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_367_8.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_367_8.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_367_8.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_368_4.7.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_368_4.7.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_368_4.7.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_368_4.7.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_369_2.4.5-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_369_2.4.5-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_369_2.4.5-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_369_2.4.5-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_36_2.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_36_2.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_36_2.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_36_2.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_370_6.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_370_6.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_370_6.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_370_6.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_371_822-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_371_822-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_371_822-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_371_822-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_37_5.5-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_37_5.5-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_37_5.5-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_37_5.5-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_38_1.3.5-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_38_1.3.5-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_38_1.3.5-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_38_1.3.5-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_38_1.3.6-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_38_1.3.6-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_38_1.3.6-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_38_1.3.6-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_39_0.9.8l-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_39_0.9.8l-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_39_0.9.8l-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_39_0.9.8l-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_3_1.28-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_3_1.28-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_3_1.28-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_3_1.28-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_40_6.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_40_6.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_40_6.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_40_6.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_41_5.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_41_5.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_41_5.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_41_5.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_44_1.3-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_44_1.3-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_44_1.3-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_44_1.3-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_44_1.4-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_44_1.4-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_44_1.4-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_44_1.4-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_45_3.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_45_3.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_45_3.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_45_3.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_46_1.0.2-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_46_1.0.2-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_46_1.0.2-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_46_1.0.2-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_47_2.6.2-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_47_2.6.2-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_47_2.6.2-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_47_2.6.2-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_47_2.9.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_47_2.9.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_47_2.9.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_47_2.9.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_48_1.3-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_48_1.3-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_48_1.3-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_48_1.3-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_49_6.0.5.25-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_49_6.0.5.25-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_49_6.0.5.25-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_49_6.0.5.25-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_4_2.5.4-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_4_2.5.4-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_4_2.5.4-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_4_2.5.4-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_50_3.3-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_50_3.3-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_50_3.3-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_50_3.3-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_50_3.4-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_50_3.4-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_50_3.4-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_50_3.4-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_50_3.4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_50_3.4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_50_3.4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_50_3.4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_50_3.5-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_50_3.5-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_50_3.5-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_50_3.5-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_51_1.6.2-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_51_1.6.2-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_51_1.6.2-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_51_1.6.2-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_52_1.8-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_52_1.8-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_52_1.8-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_52_1.8-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_52_2.5-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_52_2.5-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_52_2.5-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_52_2.5-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_53_2.3.0.677-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_53_2.3.0.677-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_53_2.3.0.677-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_53_2.3.0.677-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_54_0.1.36-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_54_0.1.36-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_54_0.1.36-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_54_0.1.36-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_55_3.8.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_55_3.8.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_55_3.8.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_55_3.8.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_55_4.4-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_55_4.4-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_55_4.4-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_55_4.4-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_55_4.8.2-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_55_4.8.2-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_55_4.8.2-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_55_4.8.2-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_56_1.2-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_56_1.2-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_56_1.2-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_56_1.2-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_57_4.0.5-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_57_4.0.5-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_57_4.0.5-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_57_4.0.5-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_58_2.4.7-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_58_2.4.7-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_58_2.4.7-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_58_2.4.7-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_59_1.0.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_59_1.0.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_59_1.0.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_59_1.0.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_5_1.5-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_5_1.5-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_5_1.5-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_5_1.5-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_5_1.6-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_5_1.6-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_5_1.6-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_5_1.6-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_60_0.2.9-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_60_0.2.9-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_60_0.2.9-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_60_0.2.9-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_61_1.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_61_1.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_61_1.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_61_1.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_61_1.2.12-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_61_1.2.12-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_61_1.2.12-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_61_1.2.12-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_63_1.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_63_1.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_63_1.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_63_1.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_63_1.3-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_63_1.3-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_63_1.3-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_63_1.3-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_64_1.3-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_64_1.3-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_64_1.3-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_64_1.3-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_65_2.1.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_65_2.1.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_65_2.1.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_65_2.1.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_66_0.11-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_66_0.11-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_66_0.11-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_66_0.11-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_67_1.6.5-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_67_1.6.5-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_67_1.6.5-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_67_1.6.5-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_68_3.8.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_68_3.8.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_68_3.8.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_68_3.8.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_69_10.1.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_69_10.1.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_69_10.1.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_69_10.1.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_69_11.1.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_69_11.1.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_69_11.1.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_69_11.1.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_69_8.1.7-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_69_8.1.7-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_69_8.1.7-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_69_8.1.7-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_69_9.0.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_69_9.0.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_69_9.0.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_69_9.0.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_6_1.5.8-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_6_1.5.8-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_6_1.5.8-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_6_1.5.8-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_70_9.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_70_9.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_70_9.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_70_9.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_71_1.1.3.8-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_71_1.1.3.8-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_71_1.1.3.8-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_71_1.1.3.8-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_71_1.1.4.C-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_71_1.1.4.C-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_71_1.1.4.C-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_71_1.1.4.C-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_73_2.3.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_73_2.3.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_73_2.3.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_73_2.3.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_73_2.4.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_73_2.4.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_73_2.4.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_73_2.4.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_74_3.2.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_74_3.2.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_74_3.2.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_74_3.2.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_74_3.5.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_74_3.5.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_74_3.5.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_74_3.5.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_75_25-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_75_25-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_75_25-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_75_25-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_75_26-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_75_26-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_75_26-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_75_26-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_76_1.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_76_1.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_76_1.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_76_1.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_77_1.45-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_77_1.45-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_77_1.45-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_77_1.45-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_78_2.6-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_78_2.6-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_78_2.6-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_78_2.6-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_79_0.7.2-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_79_0.7.2-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_79_0.7.2-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_79_0.7.2-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_7_5.8.8-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_7_5.8.8-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_7_5.8.8-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_7_5.8.8-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_7_5.8.9-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_7_5.8.9-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_7_5.8.9-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_7_5.8.9-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_82_9.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_82_9.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_82_9.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_82_9.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_83_1.10.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_83_1.10.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_83_1.10.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_83_1.10.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_84_2.2.0036-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_84_2.2.0036-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_84_2.2.0036-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_84_2.2.0036-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_85_6.4-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_85_6.4-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_85_6.4-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_85_6.4-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_85_9.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_85_9.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_85_9.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_85_9.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_85_9.53.busObj.CR.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_85_9.53.busObj.CR.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_85_9.53.busObj.CR.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_85_9.53.busObj.CR.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_86_7.13.2-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_86_7.13.2-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_86_7.13.2-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_86_7.13.2-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_87_6b-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_87_6b-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_87_6b-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_87_6b-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_88_3.5-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_88_3.5-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_88_3.5-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_88_3.5-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_89_2.3-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_89_2.3-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_89_2.3-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_89_2.3-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_8_2.1.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_8_2.1.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_8_2.1.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_8_2.1.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_8_2.7.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_8_2.7.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_8_2.7.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_8_2.7.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_91_1.5-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_91_1.5-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_91_1.5-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_91_1.5-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_92_1.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_92_1.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_92_1.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_92_1.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_93_10.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_93_10.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_93_10.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_93_10.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_94_4.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_94_4.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_94_4.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_94_4.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_94_6.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_94_6.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_94_6.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_94_6.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_95_7.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_95_7.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_95_7.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_95_7.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_95_7.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_95_7.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_95_7.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_95_7.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_95_8.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_95_8.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_95_8.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_95_8.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_96_8.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_96_8.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_96_8.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_96_8.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_97_3.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_97_3.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_97_3.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_97_3.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_98_6.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_98_6.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_98_6.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_98_6.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_99_1.0-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_99_1.0-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_99_1.0-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_99_1.0-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_9_3.1-SNAPSHOT.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_9_3.1-SNAPSHOT.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle-big/1_9_3.1-SNAPSHOT.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle-big/1_9_3.1-SNAPSHOT.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle.txt b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle.txt similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle.txt rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle.txt diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle_a_1.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle_a_1.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle_a_1.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle_a_1.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle_b_1.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle_b_1.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle_b_1.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle_b_1.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle_c_1.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle_c_1.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle_c_1.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle_c_1.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/cycle_root_1.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/cycle_root_1.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/cycle_root_1.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/cycle_root_1.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/duplicate_transitive_dependency.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/duplicate_transitive_dependency.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/duplicate_transitive_dependency.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/duplicate_transitive_dependency.ini diff --git a/maven-resolver-impl/src/test/resources/artifact-descriptions/expectedPartialSubtreeOnError.txt b/maven-resolver-impl/src/test/resources/artifact-descriptions/expectedPartialSubtreeOnError.txt new file mode 100644 index 000000000..6ef2faf0a --- /dev/null +++ b/maven-resolver-impl/src/test/resources/artifact-descriptions/expectedPartialSubtreeOnError.txt @@ -0,0 +1,6 @@ +subtree:comparison:ext:error ++- duplicate:transitive:ext:dependency compile +| +- gid:aid:ext:ver compile +| | \- gid:aid2:ext:ver compile +| \- gid:aid2:ext:ver compile +\- git:aid:ext:ver compile diff --git a/aether-impl/src/test/resources/artifact-descriptions/expectedSubtreeComparisonResult.txt b/maven-resolver-impl/src/test/resources/artifact-descriptions/expectedSubtreeComparisonResult.txt similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/expectedSubtreeComparisonResult.txt rename to maven-resolver-impl/src/test/resources/artifact-descriptions/expectedSubtreeComparisonResult.txt diff --git a/aether-impl/src/test/resources/artifact-descriptions/gid_aid2_9.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/gid_aid2_9.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/gid_aid2_9.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/gid_aid2_9.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/gid_aid2_managedVersion.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/gid_aid2_managedVersion.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/gid_aid2_managedVersion.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/gid_aid2_managedVersion.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/gid_aid2_ver.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/gid_aid2_ver.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/gid_aid2_ver.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/gid_aid2_ver.ini diff --git a/maven-resolver-impl/src/test/resources/artifact-descriptions/gid_aid3_5.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/gid_aid3_5.ini new file mode 100644 index 000000000..4a90b23b0 --- /dev/null +++ b/maven-resolver-impl/src/test/resources/artifact-descriptions/gid_aid3_5.ini @@ -0,0 +1,3 @@ +[dependencies] +oldgid:aid:ext:ver + diff --git a/aether-impl/src/test/resources/artifact-descriptions/gid_aid_1.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/gid_aid_1.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/gid_aid_1.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/gid_aid_1.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/gid_aid_ver.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/gid_aid_ver.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/gid_aid_ver.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/gid_aid_ver.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/managed/duplicate_transitive_managed.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/managed/duplicate_transitive_managed.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/managed/duplicate_transitive_managed.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/managed/duplicate_transitive_managed.ini diff --git a/maven-resolver-impl/src/test/resources/artifact-descriptions/managed/gid_0_ver.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/managed/gid_0_ver.ini new file mode 100644 index 000000000..1831746a4 --- /dev/null +++ b/maven-resolver-impl/src/test/resources/artifact-descriptions/managed/gid_0_ver.ini @@ -0,0 +1,4 @@ +[dependencies] +gid:1:ext:ver +[manageddependencies] +gid:2:ext:managed-by-0 \ No newline at end of file diff --git a/maven-resolver-impl/src/test/resources/artifact-descriptions/managed/gid_1_ver.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/managed/gid_1_ver.ini new file mode 100644 index 000000000..805fd9875 --- /dev/null +++ b/maven-resolver-impl/src/test/resources/artifact-descriptions/managed/gid_1_ver.ini @@ -0,0 +1,4 @@ +[dependencies] +gid:2:ext:ver +[manageddependencies] +gid:3:ext:managed-by-1 \ No newline at end of file diff --git a/maven-resolver-impl/src/test/resources/artifact-descriptions/managed/gid_2_managed-by-0.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/managed/gid_2_managed-by-0.ini new file mode 100644 index 000000000..e6cc9a667 --- /dev/null +++ b/maven-resolver-impl/src/test/resources/artifact-descriptions/managed/gid_2_managed-by-0.ini @@ -0,0 +1,4 @@ +[dependencies] +gid:3:ext:ver +[manageddependencies] +gid:4:ext:managed-by-2 \ No newline at end of file diff --git a/maven-resolver-impl/src/test/resources/artifact-descriptions/managed/gid_3_managed-by-1.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/managed/gid_3_managed-by-1.ini new file mode 100644 index 000000000..aa1cea4b6 --- /dev/null +++ b/maven-resolver-impl/src/test/resources/artifact-descriptions/managed/gid_3_managed-by-1.ini @@ -0,0 +1,4 @@ +[dependencies] +gid:4:ext:ver +[manageddependencies] +gid:5:ext:managed-by-3 \ No newline at end of file diff --git a/maven-resolver-impl/src/test/resources/artifact-descriptions/managed/gid_4_managed-by-2.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/managed/gid_4_managed-by-2.ini new file mode 100644 index 000000000..990c92867 --- /dev/null +++ b/maven-resolver-impl/src/test/resources/artifact-descriptions/managed/gid_4_managed-by-2.ini @@ -0,0 +1,2 @@ +[dependencies] +gid:5:ext:ver diff --git a/maven-resolver-impl/src/test/resources/artifact-descriptions/managed/gid_5_managed-by-3.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/managed/gid_5_managed-by-3.ini new file mode 100644 index 000000000..05ba453ac --- /dev/null +++ b/maven-resolver-impl/src/test/resources/artifact-descriptions/managed/gid_5_managed-by-3.ini @@ -0,0 +1 @@ +[dependencies] \ No newline at end of file diff --git a/aether-impl/src/test/resources/artifact-descriptions/managed/gid_aid2_managed.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/managed/gid_aid2_managed.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/managed/gid_aid2_managed.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/managed/gid_aid2_managed.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/managed/gid_aid_ver.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/managed/gid_aid_ver.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/managed/gid_aid_ver.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/managed/gid_aid_ver.ini diff --git a/maven-resolver-impl/src/test/resources/artifact-descriptions/managed/management-tree.txt b/maven-resolver-impl/src/test/resources/artifact-descriptions/managed/management-tree.txt new file mode 100644 index 000000000..7307a195a --- /dev/null +++ b/maven-resolver-impl/src/test/resources/artifact-descriptions/managed/management-tree.txt @@ -0,0 +1,6 @@ +gid:0:ext:ver ++- gid:1:ext:ver compile + +- gid:2:ext:managed-by-0 compile + +- gid:3:ext:managed-by-1 compile + +- gid:4:ext:managed-by-2 compile + +- gid:5:ext:managed-by-3 compile diff --git a/aether-impl/src/test/resources/artifact-descriptions/managed/subtree_comparison_ver.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/managed/subtree_comparison_ver.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/managed/subtree_comparison_ver.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/managed/subtree_comparison_ver.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/managed_aid_ver.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/managed_aid_ver.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/managed_aid_ver.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/managed_aid_ver.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/missing_description_ver.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/missing_description_ver.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/missing_description_ver.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/missing_description_ver.ini diff --git a/maven-resolver-impl/src/test/resources/artifact-descriptions/oldgid_aid_ver.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/oldgid_aid_ver.ini new file mode 100644 index 000000000..89e169a6f --- /dev/null +++ b/maven-resolver-impl/src/test/resources/artifact-descriptions/oldgid_aid_ver.ini @@ -0,0 +1,2 @@ +[relocation] +gid:aid:ext:ver diff --git a/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/managed/all-nodes.txt b/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/managed/all-nodes.txt new file mode 100644 index 000000000..6caeee1d9 --- /dev/null +++ b/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/managed/all-nodes.txt @@ -0,0 +1,4 @@ +gid:root:ext:ver root-scope ++- gid:direct-of-root:ext:ver direct-of-root-scope + +- gid:transitive-of-root:ext:ver transitive-of-root-scope + +- gid:transitive-of-transitive-of-root:ext:ver transitive-of-transitive-of-root-scope diff --git a/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/managed/direct-of-root.txt b/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/managed/direct-of-root.txt new file mode 100644 index 000000000..e7b354d74 --- /dev/null +++ b/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/managed/direct-of-root.txt @@ -0,0 +1 @@ +gid:root:ext:ver root-scope diff --git a/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/managed/gid_direct-of-root_ver.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/managed/gid_direct-of-root_ver.ini new file mode 100644 index 000000000..a801f3f45 --- /dev/null +++ b/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/managed/gid_direct-of-root_ver.ini @@ -0,0 +1,2 @@ +[dependencies] +gid:transitive-of-root:ext:ver:transitive-of-root-scope diff --git a/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/managed/gid_root_ver.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/managed/gid_root_ver.ini new file mode 100644 index 000000000..37fe9ac0b --- /dev/null +++ b/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/managed/gid_root_ver.ini @@ -0,0 +1,2 @@ +[dependencies] +gid:direct-of-root:ext:ver:direct-of-root-scope diff --git a/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/managed/gid_transitive-of-root_ver.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/managed/gid_transitive-of-root_ver.ini new file mode 100644 index 000000000..e34fa0497 --- /dev/null +++ b/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/managed/gid_transitive-of-root_ver.ini @@ -0,0 +1,2 @@ +[dependencies] +gid:transitive-of-transitive-of-root:ext:ver:transitive-of-transitive-of-root-scope diff --git a/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/managed/gid_transitive-of-transitive-of-root_ver.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/managed/gid_transitive-of-transitive-of-root_ver.ini new file mode 100644 index 000000000..61a252c23 --- /dev/null +++ b/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/managed/gid_transitive-of-transitive-of-root_ver.ini @@ -0,0 +1 @@ +[dependencies] diff --git a/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/managed/transitive-of-root.txt b/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/managed/transitive-of-root.txt new file mode 100644 index 000000000..dbee99b23 --- /dev/null +++ b/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/managed/transitive-of-root.txt @@ -0,0 +1,2 @@ +gid:root:ext:ver root-scope ++- gid:direct-of-root:ext:ver direct-of-root-scope diff --git a/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/managed/transitive-of-transitive-of-root.txt b/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/managed/transitive-of-transitive-of-root.txt new file mode 100644 index 000000000..ef3dc7488 --- /dev/null +++ b/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/managed/transitive-of-transitive-of-root.txt @@ -0,0 +1,3 @@ +gid:root:ext:ver root-scope ++- gid:direct-of-root:ext:ver direct-of-root-scope + +- gid:transitive-of-root:ext:ver transitive-of-root-scope diff --git a/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/optional/gid_direct-of-root_ver.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/optional/gid_direct-of-root_ver.ini new file mode 100644 index 000000000..68e32401f --- /dev/null +++ b/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/optional/gid_direct-of-root_ver.ini @@ -0,0 +1,2 @@ +[dependencies] +gid:transitive-of-root:ext:ver:transitive-of-root-scope:optional diff --git a/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/optional/gid_root_ver.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/optional/gid_root_ver.ini new file mode 100644 index 000000000..fbdaab951 --- /dev/null +++ b/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/optional/gid_root_ver.ini @@ -0,0 +1,2 @@ +[dependencies] +gid:direct-of-root:ext:ver:direct-of-root-scope:optional diff --git a/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/optional/gid_transitive-of-root_ver.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/optional/gid_transitive-of-root_ver.ini new file mode 100644 index 000000000..61a252c23 --- /dev/null +++ b/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/optional/gid_transitive-of-root_ver.ini @@ -0,0 +1 @@ +[dependencies] diff --git a/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/optional/no-selector-tree.txt b/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/optional/no-selector-tree.txt new file mode 100644 index 000000000..890216cc8 --- /dev/null +++ b/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/optional/no-selector-tree.txt @@ -0,0 +1,3 @@ +gid:root:ext:ver root-scope ++- gid:direct-of-root:ext:ver direct-of-root-scope optional + +- gid:transitive-of-root:ext:ver transitive-of-root-scope optional diff --git a/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/optional/optional-exclusion-tree.txt b/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/optional/optional-exclusion-tree.txt new file mode 100644 index 000000000..fe87f123f --- /dev/null +++ b/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/optional/optional-exclusion-tree.txt @@ -0,0 +1,2 @@ +gid:root:ext:ver root-scope ++- gid:direct-of-root:ext:ver direct-of-root-scope optional diff --git a/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/scope/all-nodes.txt b/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/scope/all-nodes.txt new file mode 100644 index 000000000..6caeee1d9 --- /dev/null +++ b/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/scope/all-nodes.txt @@ -0,0 +1,4 @@ +gid:root:ext:ver root-scope ++- gid:direct-of-root:ext:ver direct-of-root-scope + +- gid:transitive-of-root:ext:ver transitive-of-root-scope + +- gid:transitive-of-transitive-of-root:ext:ver transitive-of-transitive-of-root-scope diff --git a/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/scope/gid_direct-of-root_ver.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/scope/gid_direct-of-root_ver.ini new file mode 100644 index 000000000..a801f3f45 --- /dev/null +++ b/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/scope/gid_direct-of-root_ver.ini @@ -0,0 +1,2 @@ +[dependencies] +gid:transitive-of-root:ext:ver:transitive-of-root-scope diff --git a/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/scope/gid_root_ver.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/scope/gid_root_ver.ini new file mode 100644 index 000000000..37fe9ac0b --- /dev/null +++ b/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/scope/gid_root_ver.ini @@ -0,0 +1,2 @@ +[dependencies] +gid:direct-of-root:ext:ver:direct-of-root-scope diff --git a/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/scope/gid_transitive-of-root_ver.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/scope/gid_transitive-of-root_ver.ini new file mode 100644 index 000000000..e34fa0497 --- /dev/null +++ b/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/scope/gid_transitive-of-root_ver.ini @@ -0,0 +1,2 @@ +[dependencies] +gid:transitive-of-transitive-of-root:ext:ver:transitive-of-transitive-of-root-scope diff --git a/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/scope/gid_transitive-of-transitive-of-root_ver.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/scope/gid_transitive-of-transitive-of-root_ver.ini new file mode 100644 index 000000000..61a252c23 --- /dev/null +++ b/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/scope/gid_transitive-of-transitive-of-root_ver.ini @@ -0,0 +1 @@ +[dependencies] diff --git a/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/scope/transitive-of-root-scope-exclusion-tree.txt b/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/scope/transitive-of-root-scope-exclusion-tree.txt new file mode 100644 index 000000000..dbee99b23 --- /dev/null +++ b/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/scope/transitive-of-root-scope-exclusion-tree.txt @@ -0,0 +1,2 @@ +gid:root:ext:ver root-scope ++- gid:direct-of-root:ext:ver direct-of-root-scope diff --git a/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/scope/transitive-of-transitive-of-root-exclusion-tree.txt b/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/scope/transitive-of-transitive-of-root-exclusion-tree.txt new file mode 100644 index 000000000..ef3dc7488 --- /dev/null +++ b/maven-resolver-impl/src/test/resources/artifact-descriptions/selection/scope/transitive-of-transitive-of-root-exclusion-tree.txt @@ -0,0 +1,3 @@ +gid:root:ext:ver root-scope ++- gid:direct-of-root:ext:ver direct-of-root-scope + +- gid:transitive-of-root:ext:ver transitive-of-root-scope diff --git a/aether-impl/src/test/resources/artifact-descriptions/subtree_comparison_error.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/subtree_comparison_error.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/subtree_comparison_error.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/subtree_comparison_error.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/subtree_comparison_ver.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/subtree_comparison_ver.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/subtree_comparison_ver.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/subtree_comparison_ver.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/versionless-cycle/test_a_1.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/versionless-cycle/test_a_1.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/versionless-cycle/test_a_1.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/versionless-cycle/test_a_1.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/versionless-cycle/test_a_2.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/versionless-cycle/test_a_2.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/versionless-cycle/test_a_2.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/versionless-cycle/test_a_2.ini diff --git a/aether-impl/src/test/resources/artifact-descriptions/versionless-cycle/test_b_2.ini b/maven-resolver-impl/src/test/resources/artifact-descriptions/versionless-cycle/test_b_2.ini similarity index 100% rename from aether-impl/src/test/resources/artifact-descriptions/versionless-cycle/test_b_2.ini rename to maven-resolver-impl/src/test/resources/artifact-descriptions/versionless-cycle/test_b_2.ini diff --git a/maven-resolver-spi/pom.xml b/maven-resolver-spi/pom.xml new file mode 100644 index 000000000..8f0afe67d --- /dev/null +++ b/maven-resolver-spi/pom.xml @@ -0,0 +1,55 @@ + + + + + + 4.0.0 + + + org.apache.maven.resolver + maven-resolver + 1.2.0-SNAPSHOT + + + maven-resolver-spi + + Maven Artifact Resolver SPI + + The service provider interface for repository system implementations and repository connectors. + + + + + org.apache.maven.resolver + maven-resolver-api + + + junit + junit + test + + + org.hamcrest + hamcrest-core + test + + + diff --git a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/ArtifactDownload.java b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/ArtifactDownload.java similarity index 90% rename from aether-spi/src/main/java/org/eclipse/aether/spi/connector/ArtifactDownload.java rename to maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/ArtifactDownload.java index 908f51041..3d82ac1fc 100644 --- a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/ArtifactDownload.java +++ b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/ArtifactDownload.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.spi.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 java.io.File; import java.util.Collection; import java.util.Collections; diff --git a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/ArtifactTransfer.java b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/ArtifactTransfer.java similarity index 75% rename from aether-spi/src/main/java/org/eclipse/aether/spi/connector/ArtifactTransfer.java rename to maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/ArtifactTransfer.java index a284283bc..83995121e 100644 --- a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/ArtifactTransfer.java +++ b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/ArtifactTransfer.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.spi.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 java.io.File; import org.eclipse.aether.artifact.Artifact; diff --git a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/ArtifactUpload.java b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/ArtifactUpload.java similarity index 69% rename from aether-spi/src/main/java/org/eclipse/aether/spi/connector/ArtifactUpload.java rename to maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/ArtifactUpload.java index fc17fb97a..f85539e75 100644 --- a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/ArtifactUpload.java +++ b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/ArtifactUpload.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.spi.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 java.io.File; import org.eclipse.aether.RequestTrace; diff --git a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/MetadataDownload.java b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/MetadataDownload.java similarity index 84% rename from aether-spi/src/main/java/org/eclipse/aether/spi/connector/MetadataDownload.java rename to maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/MetadataDownload.java index cccceb92f..be3a2d0d7 100644 --- a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/MetadataDownload.java +++ b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/MetadataDownload.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.spi.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 java.io.File; import java.util.Collections; import java.util.List; diff --git a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/MetadataTransfer.java b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/MetadataTransfer.java similarity index 75% rename from aether-spi/src/main/java/org/eclipse/aether/spi/connector/MetadataTransfer.java rename to maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/MetadataTransfer.java index 07fe4be08..94eb46e79 100644 --- a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/MetadataTransfer.java +++ b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/MetadataTransfer.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.spi.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 java.io.File; import org.eclipse.aether.metadata.Metadata; diff --git a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/MetadataUpload.java b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/MetadataUpload.java similarity index 69% rename from aether-spi/src/main/java/org/eclipse/aether/spi/connector/MetadataUpload.java rename to maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/MetadataUpload.java index 70c723e02..d992757c7 100644 --- a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/MetadataUpload.java +++ b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/MetadataUpload.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.spi.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 java.io.File; import org.eclipse.aether.RequestTrace; diff --git a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/RepositoryConnector.java b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/RepositoryConnector.java similarity index 79% rename from aether-spi/src/main/java/org/eclipse/aether/spi/connector/RepositoryConnector.java rename to maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/RepositoryConnector.java index 9f9c79570..51e0627e4 100644 --- a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/RepositoryConnector.java +++ b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/RepositoryConnector.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.spi.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 java.io.Closeable; import java.util.Collection; diff --git a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/RepositoryConnectorFactory.java b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/RepositoryConnectorFactory.java similarity index 72% rename from aether-spi/src/main/java/org/eclipse/aether/spi/connector/RepositoryConnectorFactory.java rename to maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/RepositoryConnectorFactory.java index c54953079..0d401c448 100644 --- a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/RepositoryConnectorFactory.java +++ b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/RepositoryConnectorFactory.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.spi.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.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.transfer.NoRepositoryConnectorException; diff --git a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/Transfer.java b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/Transfer.java similarity index 70% rename from aether-spi/src/main/java/org/eclipse/aether/spi/connector/Transfer.java rename to maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/Transfer.java index 16ca87632..fc77011bc 100644 --- a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/Transfer.java +++ b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/Transfer.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.spi.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.eclipse.aether.RequestTrace; import org.eclipse.aether.transfer.TransferListener; diff --git a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/checksum/ChecksumPolicy.java b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/checksum/ChecksumPolicy.java similarity index 86% rename from aether-spi/src/main/java/org/eclipse/aether/spi/connector/checksum/ChecksumPolicy.java rename to maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/checksum/ChecksumPolicy.java index 1c00fbda0..eb1716dfb 100644 --- a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/checksum/ChecksumPolicy.java +++ b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/checksum/ChecksumPolicy.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.spi.connector.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 org.eclipse.aether.transfer.ChecksumFailureException; /** @@ -59,7 +68,7 @@ public interface ChecksumPolicy /** * Bit flag indicating a checksum which is not part of the official repository layout/structure. */ - static final int KIND_UNOFFICIAL = 0x01; + int KIND_UNOFFICIAL = 0x01; /** * Signals a match between the locally computed checksum value and the checksum value declared by the remote diff --git a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/checksum/ChecksumPolicyProvider.java b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/checksum/ChecksumPolicyProvider.java similarity index 70% rename from aether-spi/src/main/java/org/eclipse/aether/spi/connector/checksum/ChecksumPolicyProvider.java rename to maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/checksum/ChecksumPolicyProvider.java index 3c51301a8..f50230063 100644 --- a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/checksum/ChecksumPolicyProvider.java +++ b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/checksum/ChecksumPolicyProvider.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.spi.connector.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 org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.transfer.TransferResource; diff --git a/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/checksum/package-info.java b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/checksum/package-info.java new file mode 100644 index 000000000..32f2c5df2 --- /dev/null +++ b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/checksum/package-info.java @@ -0,0 +1,25 @@ +// CHECKSTYLE_OFF: RegexpHeader +/** + * The support infrastructure for repository connectors to apply checksum policies when validating the integrity of + * downloaded files. + */ +package org.eclipse.aether.spi.connector.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. + */ diff --git a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/layout/RepositoryLayout.java b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/layout/RepositoryLayout.java similarity index 88% rename from aether-spi/src/main/java/org/eclipse/aether/spi/connector/layout/RepositoryLayout.java rename to maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/layout/RepositoryLayout.java index 1594e10e1..7ae69ac94 100644 --- a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/layout/RepositoryLayout.java +++ b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/layout/RepositoryLayout.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.spi.connector.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 java.net.URI; import java.util.List; import java.util.Locale; @@ -18,8 +27,9 @@ import org.eclipse.aether.metadata.Metadata; /** - * The layout for a remote repository whose artifacts/metadata can be addressed via URIs. Implementations must be - * stateless. + * The layout for a remote repository whose artifacts/metadata can be addressed via URIs. + *

+ * Note: Implementations must be stateless. */ public interface RepositoryLayout { diff --git a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/layout/RepositoryLayoutFactory.java b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/layout/RepositoryLayoutFactory.java similarity index 69% rename from aether-spi/src/main/java/org/eclipse/aether/spi/connector/layout/RepositoryLayoutFactory.java rename to maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/layout/RepositoryLayoutFactory.java index 573b4181f..8aa71d7ab 100644 --- a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/layout/RepositoryLayoutFactory.java +++ b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/layout/RepositoryLayoutFactory.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.spi.connector.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.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.transfer.NoRepositoryLayoutException; diff --git a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/layout/RepositoryLayoutProvider.java b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/layout/RepositoryLayoutProvider.java similarity index 59% rename from aether-spi/src/main/java/org/eclipse/aether/spi/connector/layout/RepositoryLayoutProvider.java rename to maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/layout/RepositoryLayoutProvider.java index 8dce6336e..5cdf53b1b 100644 --- a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/layout/RepositoryLayoutProvider.java +++ b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/layout/RepositoryLayoutProvider.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.spi.connector.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.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.transfer.NoRepositoryLayoutException; diff --git a/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/layout/package-info.java b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/layout/package-info.java new file mode 100644 index 000000000..cd758a74f --- /dev/null +++ b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/layout/package-info.java @@ -0,0 +1,26 @@ +// CHECKSTYLE_OFF: RegexpHeader +/** + * The contract to locate URI-based resources using custom repository layouts. By implementing a + * {@link org.eclipse.aether.spi.connector.layout.RepositoryLayoutFactory} and registering it with the repository + * system, an application enables access to remote repositories that use new content types/layouts. + */ +package org.eclipse.aether.spi.connector.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. + */ diff --git a/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/package-info.java b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/package-info.java new file mode 100644 index 000000000..7fcdad23e --- /dev/null +++ b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/package-info.java @@ -0,0 +1,30 @@ +// CHECKSTYLE_OFF: RegexpHeader +/** + * The contract to access artifacts/metadata in remote repositories. By implementing a + * {@link org.eclipse.aether.spi.connector.RepositoryConnectorFactory} and registering it with the repository system, + * an application can enable access to arbitrary remote repositories. It should be noted that a repository connector is + * powerful yet burdensome to implement. In many cases, implementing a + * {@link org.eclipse.aether.spi.connector.transport.TransporterFactory} or + * {@link org.eclipse.aether.spi.connector.layout.RepositoryLayoutFactory} will be sufficient and easier to access a + * custom remote repository. + */ +package org.eclipse.aether.spi.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. + */ diff --git a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/transport/AbstractTransporter.java b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/transport/AbstractTransporter.java similarity index 71% rename from aether-spi/src/main/java/org/eclipse/aether/spi/connector/transport/AbstractTransporter.java rename to maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/transport/AbstractTransporter.java index c5c4ec554..21488a19c 100644 --- a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/transport/AbstractTransporter.java +++ b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/transport/AbstractTransporter.java @@ -1,16 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.spi.connector.transport; -import java.io.Closeable; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.io.OutputStream; @@ -87,25 +95,47 @@ protected abstract void implGet( GetTask task ) protected void utilGet( GetTask task, InputStream is, boolean close, long length, boolean resume ) throws IOException, TransferCancelledException { + OutputStream os = null; try { - task.getListener().transportStarted( resume ? task.getResumeOffset() : 0, length ); - OutputStream os = task.newOutputStream( resume ); - try - { - copy( os, is, task.getListener() ); - os.close(); - } - finally + os = task.newOutputStream( resume ); + task.getListener().transportStarted( resume ? task.getResumeOffset() : 0L, length ); + copy( os, is, task.getListener() ); + os.close(); + os = null; + + if ( close ) { - close( os ); + is.close(); + is = null; } } finally { - if ( close ) + try { - close( is ); + if ( os != null ) + { + os.close(); + } + } + catch ( final IOException e ) + { + // Suppressed + } + finally + { + try + { + if ( close && is != null ) + { + is.close(); + } + } + catch ( final IOException e ) + { + // Suppressed + } } } } @@ -138,35 +168,56 @@ protected abstract void implPut( PutTask task ) * @throws IOException If the transfer encountered an I/O error. * @throws TransferCancelledException If the transfer was cancelled. */ - protected void utilPut( PutTask task, OutputStream os, boolean close ) + protected void utilPut( PutTask task, OutputStream out, boolean close ) throws IOException, TransferCancelledException { + InputStream in = null; try { + in = task.newInputStream(); task.getListener().transportStarted( 0, task.getDataLength() ); - InputStream is = task.newInputStream(); - try - { - copy( os, is, task.getListener() ); - } - finally - { - close( is ); - } + copy( out, in, task.getListener() ); + if ( close ) { - os.close(); + out.close(); } else { - os.flush(); + out.flush(); } + + out = null; + + in.close(); + in = null; } finally { - if ( close ) + try + { + if ( close && out != null ) + { + out.close(); + } + } + catch ( final IOException e ) + { + // Suppressed + } + finally { - close( os ); + try + { + if ( in != null ) + { + in.close(); + } + } + catch ( final IOException e ) + { + // Suppressed + } } } } @@ -206,19 +257,4 @@ private static void copy( OutputStream os, InputStream is, TransportListener lis } } - private static void close( Closeable file ) - { - if ( file != null ) - { - try - { - file.close(); - } - catch ( IOException e ) - { - // irrelevant - } - } - } - } diff --git a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/transport/GetTask.java b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/transport/GetTask.java similarity index 90% rename from aether-spi/src/main/java/org/eclipse/aether/spi/connector/transport/GetTask.java rename to maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/transport/GetTask.java index 889c2f01d..cef671206 100644 --- a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/transport/GetTask.java +++ b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/transport/GetTask.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.spi.connector.transport; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.ByteArrayOutputStream; import java.io.File; import java.io.FileOutputStream; @@ -17,13 +26,14 @@ import java.io.OutputStream; import java.io.UnsupportedEncodingException; import java.net.URI; +import java.nio.charset.StandardCharsets; import java.util.Collections; import java.util.HashMap; import java.util.Map; /** * A task to download a resource from the remote repository. - * + * * @see Transporter#get(GetTask) */ public final class GetTask @@ -183,19 +193,12 @@ public String getDataString() { return ""; } - try - { - return dataBytes.toString( "UTF-8" ); - } - catch ( UnsupportedEncodingException e ) - { - throw new IllegalStateException( e ); - } + return new String( dataBytes.toByteArray(), StandardCharsets.UTF_8 ); } /** * Sets the listener that is to be notified during the transfer. - * + * * @param listener The listener to notify of progress, may be {@code null}. * @return This task for chaining, never {@code null}. */ diff --git a/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/transport/PeekTask.java b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/transport/PeekTask.java new file mode 100644 index 000000000..d1fb9056d --- /dev/null +++ b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/transport/PeekTask.java @@ -0,0 +1,50 @@ +package org.eclipse.aether.spi.connector.transport; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.URI; + +/** + * A task to check the existence of a resource in the remote repository. Note: The listener returned from + * {@link #getListener()} is always a noop given that none of its event methods are relevant in context of this task. + * + * @see Transporter#peek(PeekTask) + */ +public final class PeekTask + extends TransportTask +{ + + /** + * Creates a new task for the specified remote resource. + * + * @param location The relative location of the resource in the remote repository, must not be {@code null}. + */ + public PeekTask( URI location ) + { + setLocation( location ); + } + + @Override + public String toString() + { + return "?? " + getLocation(); + } + +} diff --git a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/transport/PutTask.java b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/transport/PutTask.java similarity index 78% rename from aether-spi/src/main/java/org/eclipse/aether/spi/connector/transport/PutTask.java rename to maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/transport/PutTask.java index a9613b9ad..a8416faae 100644 --- a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/transport/PutTask.java +++ b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/transport/PutTask.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.spi.connector.transport; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.File; import java.io.FileInputStream; @@ -17,10 +26,11 @@ import java.io.InputStream; import java.io.UnsupportedEncodingException; import java.net.URI; +import java.nio.charset.StandardCharsets; /** * A task to upload a resource to the remote repository. - * + * * @see Transporter#put(PutTask) */ public final class PutTask @@ -111,25 +121,18 @@ public PutTask setDataBytes( byte[] bytes ) /** * Sets the textual data to be uploaded. The text is encoded using UTF-8 before transmission. - * + * * @param str The textual data, may be {@code null}. * @return This task for chaining, never {@code null}. */ public PutTask setDataString( String str ) { - try - { - return setDataBytes( ( str != null ) ? str.getBytes( "UTF-8" ) : null ); - } - catch ( UnsupportedEncodingException e ) - { - throw new IllegalStateException( e ); - } + return setDataBytes( ( str != null ) ? str.getBytes( StandardCharsets.UTF_8 ) : null ); } /** * Sets the listener that is to be notified during the transfer. - * + * * @param listener The listener to notify of progress, may be {@code null}. * @return This task for chaining, never {@code null}. */ diff --git a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/transport/TransportListener.java b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/transport/TransportListener.java similarity index 67% rename from aether-spi/src/main/java/org/eclipse/aether/spi/connector/transport/TransportListener.java rename to maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/transport/TransportListener.java index a813fdc9d..473036b0a 100644 --- a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/transport/TransportListener.java +++ b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/transport/TransportListener.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.spi.connector.transport; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.nio.ByteBuffer; import org.eclipse.aether.transfer.TransferCancelledException; diff --git a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/transport/TransportTask.java b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/transport/TransportTask.java similarity index 66% rename from aether-spi/src/main/java/org/eclipse/aether/spi/connector/transport/TransportTask.java rename to maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/transport/TransportTask.java index 676ccba27..f74b3010f 100644 --- a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/transport/TransportTask.java +++ b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/transport/TransportTask.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.spi.connector.transport; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.URI; /** diff --git a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/transport/Transporter.java b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/transport/Transporter.java similarity index 80% rename from aether-spi/src/main/java/org/eclipse/aether/spi/connector/transport/Transporter.java rename to maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/transport/Transporter.java index 60b38bb77..b8d221c05 100644 --- a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/transport/Transporter.java +++ b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/transport/Transporter.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.spi.connector.transport; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Closeable; /** @@ -34,7 +43,7 @@ public interface Transporter * * @see #classify(Throwable) */ - public static final int ERROR_OTHER = 0; + int ERROR_OTHER = 0; /** * Classification for exceptions that denote a requested resource does not exist in the remote repository. Note that @@ -42,7 +51,7 @@ public interface Transporter * * @see #classify(Throwable) */ - public static final int ERROR_NOT_FOUND = 1; + int ERROR_NOT_FOUND = 1; /** * Classifies the type of exception that has been thrown from a previous request to the transporter. The exception diff --git a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/transport/TransporterFactory.java b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/transport/TransporterFactory.java similarity index 70% rename from aether-spi/src/main/java/org/eclipse/aether/spi/connector/transport/TransporterFactory.java rename to maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/transport/TransporterFactory.java index 1097b1a59..999908af5 100644 --- a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/transport/TransporterFactory.java +++ b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/transport/TransporterFactory.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.spi.connector.transport; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.transfer.NoTransporterException; diff --git a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/transport/TransporterProvider.java b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/transport/TransporterProvider.java similarity index 59% rename from aether-spi/src/main/java/org/eclipse/aether/spi/connector/transport/TransporterProvider.java rename to maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/transport/TransporterProvider.java index 1e4f5e0ca..b855042d9 100644 --- a/aether-spi/src/main/java/org/eclipse/aether/spi/connector/transport/TransporterProvider.java +++ b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/transport/TransporterProvider.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.spi.connector.transport; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.transfer.NoTransporterException; diff --git a/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/transport/package-info.java b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/transport/package-info.java new file mode 100644 index 000000000..e0102133c --- /dev/null +++ b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/connector/transport/package-info.java @@ -0,0 +1,26 @@ +// CHECKSTYLE_OFF: RegexpHeader +/** + * The contract to download/upload URI-based resources using custom transport protocols. By implementing a + * {@link org.eclipse.aether.spi.connector.transport.TransporterFactory} and registering it with the repository system, + * an application enables access to remote repositories that use new URI schemes. + */ +package org.eclipse.aether.spi.connector.transport; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ diff --git a/aether-spi/src/main/java/org/eclipse/aether/spi/io/FileProcessor.java b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/io/FileProcessor.java similarity index 82% rename from aether-spi/src/main/java/org/eclipse/aether/spi/io/FileProcessor.java rename to maven-resolver-spi/src/main/java/org/eclipse/aether/spi/io/FileProcessor.java index f1bb4e3cc..1de21a013 100644 --- a/aether-spi/src/main/java/org/eclipse/aether/spi/io/FileProcessor.java +++ b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/io/FileProcessor.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.spi.io; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.io.InputStream; diff --git a/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/io/package-info.java b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/io/package-info.java new file mode 100644 index 000000000..ff84386cb --- /dev/null +++ b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/io/package-info.java @@ -0,0 +1,24 @@ +// CHECKSTYLE_OFF: RegexpHeader +/** + * I/O related support infrastructure for components. + */ +package org.eclipse.aether.spi.io; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ diff --git a/aether-spi/src/main/java/org/eclipse/aether/spi/localrepo/LocalRepositoryManagerFactory.java b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/localrepo/LocalRepositoryManagerFactory.java similarity index 70% rename from aether-spi/src/main/java/org/eclipse/aether/spi/localrepo/LocalRepositoryManagerFactory.java rename to maven-resolver-spi/src/main/java/org/eclipse/aether/spi/localrepo/LocalRepositoryManagerFactory.java index d9a737d91..518f90e2a 100644 --- a/aether-spi/src/main/java/org/eclipse/aether/spi/localrepo/LocalRepositoryManagerFactory.java +++ b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/localrepo/LocalRepositoryManagerFactory.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.spi.localrepo; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.repository.LocalRepository; import org.eclipse.aether.repository.LocalRepositoryManager; diff --git a/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/localrepo/package-info.java b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/localrepo/package-info.java new file mode 100644 index 000000000..de79d3f4c --- /dev/null +++ b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/localrepo/package-info.java @@ -0,0 +1,24 @@ +// CHECKSTYLE_OFF: RegexpHeader +/** + * The contract for custom local repository implementations. + */ +package org.eclipse.aether.spi.localrepo; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ diff --git a/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/locator/Service.java b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/locator/Service.java new file mode 100644 index 000000000..ffe36b059 --- /dev/null +++ b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/locator/Service.java @@ -0,0 +1,38 @@ +package org.eclipse.aether.spi.locator; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT 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 stateless component of the repository system. The primary purpose of this interface is to provide a convenient + * means to programmatically wire the several components of the repository system together when it is used outside of an + * IoC container. + */ +public interface Service +{ + + /** + * Provides the opportunity to initialize this service and to acquire other services for its operation from the + * locator. A service must not save the reference to the provided service locator. + * + * @param locator The service locator, must not be {@code null}. + */ + void initService( ServiceLocator locator ); + +} diff --git a/aether-spi/src/main/java/org/eclipse/aether/spi/locator/ServiceLocator.java b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/locator/ServiceLocator.java similarity index 63% rename from aether-spi/src/main/java/org/eclipse/aether/spi/locator/ServiceLocator.java rename to maven-resolver-spi/src/main/java/org/eclipse/aether/spi/locator/ServiceLocator.java index 425d06c6b..0160ac9c5 100644 --- a/aether-spi/src/main/java/org/eclipse/aether/spi/locator/ServiceLocator.java +++ b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/locator/ServiceLocator.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.spi.locator; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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; /** diff --git a/aether-spi/src/main/java/org/eclipse/aether/spi/locator/package-info.java b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/locator/package-info.java similarity index 50% rename from aether-spi/src/main/java/org/eclipse/aether/spi/locator/package-info.java rename to maven-resolver-spi/src/main/java/org/eclipse/aether/spi/locator/package-info.java index 12d9f5957..5126d87e7 100644 --- a/aether-spi/src/main/java/org/eclipse/aether/spi/locator/package-info.java +++ b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/locator/package-info.java @@ -1,13 +1,4 @@ -/******************************************************************************* - * Copyright (c) 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ +// CHECKSTYLE_OFF: RegexpHeader /** * A lightweight service locator infrastructure to help components acquire dependent components. The implementation of * the repository system is decomposed into many sub components that interact with each other via interfaces, allowing @@ -16,7 +7,25 @@ * dependencies. While not the most popular approach to component wiring, this service locator enables applications * that do not wish to pull in more sophisticated solutions like dependency injection containers to have a small * footprint. Therefore, all components should implement {@link org.eclipse.aether.spi.locator.Service} to support this - * goal. + * goal. */ package org.eclipse.aether.spi.locator; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ diff --git a/aether-spi/src/main/java/org/eclipse/aether/spi/log/Logger.java b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/log/Logger.java similarity index 66% rename from aether-spi/src/main/java/org/eclipse/aether/spi/log/Logger.java rename to maven-resolver-spi/src/main/java/org/eclipse/aether/spi/log/Logger.java index dbe659510..8b4bfb329 100644 --- a/aether-spi/src/main/java/org/eclipse/aether/spi/log/Logger.java +++ b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/log/Logger.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.spi.log; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT 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 simple logger to facilitate emission of diagnostic messages. In general, unrecoverable errors should be reported * via exceptions and informational notifications should be reported via events, hence this logger interface focuses on diff --git a/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/log/LoggerFactory.java b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/log/LoggerFactory.java new file mode 100644 index 000000000..9f66eb144 --- /dev/null +++ b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/log/LoggerFactory.java @@ -0,0 +1,36 @@ +package org.eclipse.aether.spi.log; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT 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 factory to create loggers. + */ +public interface LoggerFactory +{ + + /** + * Gets a logger for a class with the specified name. + * + * @param name The name of the class requesting a logger, must not be {@code null}. + * @return The requested logger, never {@code null}. + */ + Logger getLogger( String name ); + +} diff --git a/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/log/NullLogger.java b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/log/NullLogger.java new file mode 100644 index 000000000..8fb774596 --- /dev/null +++ b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/log/NullLogger.java @@ -0,0 +1,55 @@ +package org.eclipse.aether.spi.log; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT 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 logger that disables any logging. + */ +final class NullLogger + implements Logger +{ + + public boolean isDebugEnabled() + { + return false; + } + + public void debug( String msg ) + { + } + + public void debug( String msg, Throwable error ) + { + } + + public boolean isWarnEnabled() + { + return false; + } + + public void warn( String msg ) + { + } + + public void warn( String msg, Throwable error ) + { + } + +} diff --git a/aether-spi/src/main/java/org/eclipse/aether/spi/log/NullLoggerFactory.java b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/log/NullLoggerFactory.java similarity index 63% rename from aether-spi/src/main/java/org/eclipse/aether/spi/log/NullLoggerFactory.java rename to maven-resolver-spi/src/main/java/org/eclipse/aether/spi/log/NullLoggerFactory.java index e62045c85..bea659f68 100644 --- a/aether-spi/src/main/java/org/eclipse/aether/spi/log/NullLoggerFactory.java +++ b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/log/NullLoggerFactory.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.spi.log; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT 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 logger factory that disables any logging. */ diff --git a/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/log/package-info.java b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/log/package-info.java new file mode 100644 index 000000000..da047f0ea --- /dev/null +++ b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/log/package-info.java @@ -0,0 +1,28 @@ +// CHECKSTYLE_OFF: RegexpHeader +/** + * A simple logging infrastructure for diagnostic messages. The primary purpose of the + * {@link org.eclipse.aether.spi.log.LoggerFactory} defined here is to avoid a mandatory dependency on a 3rd party + * logging system/facade. Some applications might find the events fired by the repository system sufficient and prefer + * a small footprint. Components that do not share this concern are free to ignore this package and directly employ + * whatever logging system they desire. + */ +package org.eclipse.aether.spi.log; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ diff --git a/maven-resolver-spi/src/site/site.xml b/maven-resolver-spi/src/site/site.xml new file mode 100644 index 000000000..3a16bf98b --- /dev/null +++ b/maven-resolver-spi/src/site/site.xml @@ -0,0 +1,36 @@ + + + + + + +

+ + + + + + + + + + \ No newline at end of file diff --git a/aether-spi/src/test/java/org/eclipse/aether/spi/connector/layout/ChecksumTest.java b/maven-resolver-spi/src/test/java/org/eclipse/aether/spi/connector/layout/ChecksumTest.java similarity index 58% rename from aether-spi/src/test/java/org/eclipse/aether/spi/connector/layout/ChecksumTest.java rename to maven-resolver-spi/src/test/java/org/eclipse/aether/spi/connector/layout/ChecksumTest.java index 37d772bb7..bcd49b4c7 100644 --- a/aether-spi/src/test/java/org/eclipse/aether/spi/connector/layout/ChecksumTest.java +++ b/maven-resolver-spi/src/test/java/org/eclipse/aether/spi/connector/layout/ChecksumTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.spi.connector.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 static org.junit.Assert.*; import java.net.URI; diff --git a/maven-resolver-test-util/pom.xml b/maven-resolver-test-util/pom.xml new file mode 100644 index 000000000..0b814b0ae --- /dev/null +++ b/maven-resolver-test-util/pom.xml @@ -0,0 +1,59 @@ + + + + + + 4.0.0 + + + org.apache.maven.resolver + maven-resolver + 1.2.0-SNAPSHOT + + + maven-resolver-test-util + + Maven Artifact Resolver Test Utilities + + A collection of utility classes to ease testing of the repository system. + + + + + org.apache.maven.resolver + maven-resolver-api + + + org.apache.maven.resolver + maven-resolver-spi + + + junit + junit + test + + + org.hamcrest + hamcrest-core + test + + + diff --git a/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/ArtifactDefinition.java b/maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/ArtifactDefinition.java similarity index 74% rename from aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/ArtifactDefinition.java rename to maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/ArtifactDefinition.java index 5f1c292ee..0a760cc57 100644 --- a/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/ArtifactDefinition.java +++ b/maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/ArtifactDefinition.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.test.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. + */ + class ArtifactDefinition { private String groupId; diff --git a/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/ArtifactDescription.java b/maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/ArtifactDescription.java similarity index 58% rename from aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/ArtifactDescription.java rename to maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/ArtifactDescription.java index 27e4ec148..bdb5c7fd5 100644 --- a/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/ArtifactDescription.java +++ b/maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/ArtifactDescription.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.test.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 java.util.List; import org.eclipse.aether.artifact.Artifact; diff --git a/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/DependencyGraphParser.java b/maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/DependencyGraphParser.java similarity index 91% rename from aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/DependencyGraphParser.java rename to maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/DependencyGraphParser.java index 45fd5266e..3162100d5 100644 --- a/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/DependencyGraphParser.java +++ b/maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/DependencyGraphParser.java @@ -1,21 +1,31 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.test.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 java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.StringReader; import java.net.URL; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -37,7 +47,7 @@ /** * Creates a dependency graph from a text description.

Definition

Each (non-empty) line in the input defines * one node of the resulting graph: - * + * *
  * line      ::= (indent? ("(null)" | node | reference))? comment?
  * comment   ::= "#" rest-of-line
@@ -46,7 +56,7 @@
  * node      ::= coords (range)? space (scope("<" premanagedScope)?)? space "optional"? space ("relocations=" coords ("," coords)*)? ("(" id ")")?
  * coords    ::= groupId ":" artifactId (":" extension (":" classifier)?)? ":" version
  * 
- * + * * The special token {@code (null)} may be used to indicate an "empty" root node with no dependency. *

* If {@code indent} is empty, the line defines the root node. Only one root node may be defined. The level is @@ -55,7 +65,7 @@ * The {@code ^id} syntax allows to reuse a previously built node to share common sub graphs among different parent * nodes. *

Example

- * + * *
  * gid:aid:ver
  * +- gid:aid2:ver scope
@@ -63,7 +73,7 @@
  * +- gid:aid4:ext:ver scope
  * \- ^id1                            # reuse previous node
  * 
- * + * *

Multiple definitions in one resource

*

* By using {@link #parseMultiResource(String)}, definitions divided by a line beginning with "---" can be read from the @@ -74,12 +84,12 @@ * {@link #DependencyGraphParser(String, Collection)}). Every '%s' in the definition will be substituted by the next * String in the defined substitutions. *

Example

- * + * *
  * parser.setSubstitutions( "foo", "bar" );
  * String def = "gid:%s:ext:ver\n" + "+- gid:%s:ext:ver";
  * 
- * + * * The first node will have "foo" as its artifact id, the second node (child to the first) will have "bar" as its * artifact id. */ @@ -94,7 +104,7 @@ public class DependencyGraphParser /** * Create a parser with the given prefix and the given substitution strings. - * + * * @see DependencyGraphParser#parseResource(String) */ public DependencyGraphParser( String prefix, Collection substitutions ) @@ -106,12 +116,12 @@ public DependencyGraphParser( String prefix, Collection substitutions ) /** * Create a parser with the given prefix. - * + * * @see DependencyGraphParser#parseResource(String) */ public DependencyGraphParser( String prefix ) { - this( prefix, Collections. emptyList() ); + this( prefix, Collections.emptyList() ); } /** @@ -161,7 +171,7 @@ public List parseMultiResource( String resource ) throw new IOException( "Could not find classpath resource " + prefix + resource ); } - BufferedReader reader = new BufferedReader( new InputStreamReader( res.openStream(), "UTF-8" ) ); + BufferedReader reader = new BufferedReader( new InputStreamReader( res.openStream(), StandardCharsets.UTF_8 ) ); List ret = new ArrayList(); DependencyNode root = null; @@ -182,13 +192,23 @@ public DependencyNode parse( URL resource ) try { stream = resource.openStream(); - return parse( new BufferedReader( new InputStreamReader( stream, "UTF-8" ) ) ); + final DependencyNode node = parse( new BufferedReader( new InputStreamReader( stream, StandardCharsets.UTF_8 ) ) ); + stream.close(); + stream = null; + return node; } finally { - if ( stream != null ) + try + { + if ( stream != null ) + { + stream.close(); + } + } + catch ( final IOException e ) { - stream.close(); + // Suppressed } } } @@ -319,7 +339,7 @@ else if ( ctx.getLevel() == 0 && parent != null ) { DefaultArtifact artifact = new DefaultArtifact( def.coords, def.properties ); Dependency dependency = new Dependency( artifact, def.scope, def.optional ); - node = new DefaultDependencyNode( dependency ); + node = new DefaultDependencyNode( parent, dependency ); int managedBits = 0; if ( def.premanagedScope != null ) { diff --git a/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/IniArtifactDataReader.java b/maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/IniArtifactDataReader.java similarity index 87% rename from aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/IniArtifactDataReader.java rename to maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/IniArtifactDataReader.java index 4dedc27b5..58d24a2a5 100644 --- a/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/IniArtifactDataReader.java +++ b/maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/IniArtifactDataReader.java @@ -1,21 +1,31 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.test.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 java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.Reader; import java.io.StringReader; import java.net.URL; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; @@ -77,7 +87,7 @@ public ArtifactDescription parse( String resource ) public ArtifactDescription parse( URL res ) throws IOException { - return parse( new InputStreamReader( res.openStream(), "UTF-8" ) ); + return parse( new InputStreamReader( res.openStream(), StandardCharsets.UTF_8 ) ); } /** @@ -98,18 +108,14 @@ private enum State private ArtifactDescription parse( Reader reader ) throws IOException { - String line = null; - State state = State.NONE; - Map> sections = new HashMap>(); - - BufferedReader in = new BufferedReader( reader ); + BufferedReader in = null; try { - while ( ( line = in.readLine() ) != null ) + in = new BufferedReader( reader ); + for ( String line = in.readLine(); line != null; line = in.readLine() ) { - line = cutComment( line ); if ( isEmpty( line ) ) { @@ -140,10 +146,23 @@ private ArtifactDescription parse( Reader reader ) lines.add( line.trim() ); } } + + in.close(); + in = null; } finally { - in.close(); + try + { + if ( in != null ) + { + in.close(); + } + } + catch ( final IOException e ) + { + // Suppressed + } } Artifact relocation = relocation( sections.get( State.RELOCATION ) ); diff --git a/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/IniArtifactDescriptorReader.java b/maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/IniArtifactDescriptorReader.java similarity index 80% rename from aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/IniArtifactDescriptorReader.java rename to maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/IniArtifactDescriptorReader.java index b49282cf4..4efe880fb 100644 --- a/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/IniArtifactDescriptorReader.java +++ b/maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/IniArtifactDescriptorReader.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.test.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.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.resolution.ArtifactDescriptorException; diff --git a/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/NodeBuilder.java b/maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/NodeBuilder.java similarity index 81% rename from aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/NodeBuilder.java rename to maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/NodeBuilder.java index 21d7bcda7..fdd988ac6 100644 --- a/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/NodeBuilder.java +++ b/maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/NodeBuilder.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.test.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 java.io.File; import java.util.ArrayList; import java.util.Collections; @@ -121,7 +130,7 @@ public NodeBuilder reloc( String groupId, String artifactId, String version ) public NodeBuilder properties( Map properties ) { - this.properties = properties != null ? properties : Collections. emptyMap(); + this.properties = properties != null ? properties : Collections.emptyMap(); return this; } diff --git a/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/NodeDefinition.java b/maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/NodeDefinition.java similarity index 80% rename from aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/NodeDefinition.java rename to maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/NodeDefinition.java index 3f2e52e82..64910f1c8 100644 --- a/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/NodeDefinition.java +++ b/maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/NodeDefinition.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.test.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 java.util.ArrayList; import java.util.Collections; import java.util.LinkedHashMap; diff --git a/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestDependencyCollectionContext.java b/maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestDependencyCollectionContext.java similarity index 63% rename from aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestDependencyCollectionContext.java rename to maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestDependencyCollectionContext.java index 778068641..b4f415570 100644 --- a/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestDependencyCollectionContext.java +++ b/maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestDependencyCollectionContext.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.test.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 java.util.List; import org.eclipse.aether.RepositorySystemSession; diff --git a/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestDependencyGraphTransformationContext.java b/maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestDependencyGraphTransformationContext.java similarity index 62% rename from aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestDependencyGraphTransformationContext.java rename to maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestDependencyGraphTransformationContext.java index a81c20cf0..c3da4d9c2 100644 --- a/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestDependencyGraphTransformationContext.java +++ b/maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestDependencyGraphTransformationContext.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.test.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 java.util.HashMap; import java.util.Map; diff --git a/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestFileProcessor.java b/maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestFileProcessor.java similarity index 78% rename from aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestFileProcessor.java rename to maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestFileProcessor.java index e0c11aaa4..7c99171ae 100644 --- a/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestFileProcessor.java +++ b/maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestFileProcessor.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.test.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 java.io.BufferedOutputStream; import java.io.Closeable; import java.io.File; @@ -19,6 +28,7 @@ import java.io.InputStream; import java.io.OutputStream; import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; import org.eclipse.aether.spi.io.FileProcessor; @@ -86,11 +96,12 @@ public void write( File file, String data ) if ( data != null ) { - fos.write( data.getBytes( "UTF-8" ) ); + fos.write( data.getBytes( StandardCharsets.UTF_8 ) ); } // allow output to report any flush/close errors fos.close(); + fos = null; } finally { @@ -112,6 +123,7 @@ public void write( File target, InputStream source ) // allow output to report any flush/close errors fos.close(); + fos = null; } finally { @@ -128,8 +140,6 @@ public void copy( File source, File target ) public long copy( File source, File target, ProgressListener listener ) throws IOException { - long total = 0; - InputStream fis = null; OutputStream fos = null; try @@ -140,24 +150,28 @@ public long copy( File source, File target, ProgressListener listener ) fos = new BufferedOutputStream( new FileOutputStream( target ) ); - total = copy( fos, fis, listener ); + final long total = copy( fos, fis, listener ); // allow output to report any flush/close errors fos.close(); + fos = null; + + fis.close(); + fis = null; + + return total; } finally { close( fis ); close( fos ); } - - return total; } private long copy( OutputStream os, InputStream is, ProgressListener listener ) throws IOException { - long total = 0; + long total = 0L; ByteBuffer buffer = ByteBuffer.allocate( 1024 * 32 ); byte[] array = buffer.array(); diff --git a/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestFileUtils.java b/maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestFileUtils.java similarity index 82% rename from aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestFileUtils.java rename to maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestFileUtils.java index 69744b707..a1715b5b8 100644 --- a/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestFileUtils.java +++ b/maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestFileUtils.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.test.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 java.io.BufferedOutputStream; import java.io.Closeable; import java.io.File; @@ -18,6 +27,7 @@ import java.io.IOException; import java.io.OutputStream; import java.io.RandomAccessFile; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Collection; import java.util.Properties; @@ -142,7 +152,7 @@ public static boolean mkdirs( File directory ) public static File createTempFile( String contents ) throws IOException { - return createTempFile( contents.getBytes( "UTF-8" ), 1 ); + return createTempFile( contents.getBytes( StandardCharsets.UTF_8 ), 1 ); } public static File createTempFile( byte[] pattern, int repeat ) @@ -189,8 +199,6 @@ private static void close( Closeable c ) public static long copyFile( File source, File target ) throws IOException { - long total = 0; - FileInputStream fis = null; OutputStream fos = null; try @@ -201,7 +209,9 @@ public static long copyFile( File source, File target ) fos = new BufferedOutputStream( new FileOutputStream( target ) ); - for ( byte[] buffer = new byte[1024 * 32];; ) + long total = 0L; + + for ( byte[] buffer = new byte[ 1024 * 32 ];; ) { int bytes = fis.read( buffer ); if ( bytes < 0 ) @@ -215,14 +225,18 @@ public static long copyFile( File source, File target ) } fos.close(); + fos = null; + + fis.close(); + fis = null; + + return total; } finally { close( fis ); close( fos ); } - - return total; } public static byte[] readBytes( File file ) @@ -234,6 +248,8 @@ public static byte[] readBytes( File file ) in = new RandomAccessFile( file, "r" ); byte[] actual = new byte[(int) in.length()]; in.readFully( actual ); + in.close(); + in = null; return actual; } finally @@ -256,6 +272,7 @@ public static void writeBytes( File file, byte[] pattern, int repeat ) out.write( pattern ); } out.close(); + out = null; } finally { @@ -267,13 +284,13 @@ public static String readString( File file ) throws IOException { byte[] content = readBytes( file ); - return new String( content, "UTF-8" ); + return new String( content, StandardCharsets.UTF_8 ); } public static void writeString( File file, String content ) throws IOException { - writeBytes( file, content.getBytes( "UTF-8" ), 1 ); + writeBytes( file, content.getBytes( StandardCharsets.UTF_8 ), 1 ); } public static void readProps( File file, Properties props ) @@ -284,6 +301,8 @@ public static void readProps( File file, Properties props ) { fis = new FileInputStream( file ); props.load( fis ); + fis.close(); + fis = null; } finally { @@ -302,6 +321,7 @@ public static void writeProps( File file, Properties props ) fos = new FileOutputStream( file ); props.store( fos, "aether-test" ); fos.close(); + fos = null; } finally { diff --git a/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestLocalRepositoryManager.java b/maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestLocalRepositoryManager.java similarity index 85% rename from aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestLocalRepositoryManager.java rename to maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestLocalRepositoryManager.java index 6642faf29..f97fb7889 100644 --- a/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestLocalRepositoryManager.java +++ b/maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestLocalRepositoryManager.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.test.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 java.io.File; import java.io.IOException; import java.util.HashSet; diff --git a/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestLoggerFactory.java b/maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestLoggerFactory.java similarity index 69% rename from aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestLoggerFactory.java rename to maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestLoggerFactory.java index 8efdfb32d..ea9282566 100644 --- a/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestLoggerFactory.java +++ b/maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestLoggerFactory.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.test.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 java.io.PrintStream; import org.eclipse.aether.spi.log.Logger; diff --git a/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestUtils.java b/maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestUtils.java similarity index 77% rename from aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestUtils.java rename to maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestUtils.java index ee26ddec6..cc0c4cb0f 100644 --- a/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestUtils.java +++ b/maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestUtils.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.test.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 java.util.List; import org.eclipse.aether.DefaultRepositorySystemSession; diff --git a/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestVersion.java b/maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestVersion.java similarity index 57% rename from aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestVersion.java rename to maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestVersion.java index 791eeb83a..0fc9bab6b 100644 --- a/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestVersion.java +++ b/maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestVersion.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.test.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.eclipse.aether.version.Version; /** @@ -44,19 +53,29 @@ public int hashCode() public boolean equals( Object obj ) { if ( this == obj ) + { return true; + } if ( obj == null ) + { return false; + } if ( getClass() != obj.getClass() ) + { return false; + } TestVersion other = (TestVersion) obj; if ( version == null ) { if ( other.version != null ) + { return false; + } } else if ( !version.equals( other.version ) ) + { return false; + } return true; } diff --git a/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestVersionConstraint.java b/maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestVersionConstraint.java similarity index 75% rename from aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestVersionConstraint.java rename to maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestVersionConstraint.java index 370eb8aca..bd84687fa 100644 --- a/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestVersionConstraint.java +++ b/maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestVersionConstraint.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.test.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.eclipse.aether.version.Version; import org.eclipse.aether.version.VersionConstraint; import org.eclipse.aether.version.VersionRange; diff --git a/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestVersionFilterContext.java b/maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestVersionFilterContext.java similarity index 69% rename from aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestVersionFilterContext.java rename to maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestVersionFilterContext.java index 0f1c4ea65..2647c56a5 100644 --- a/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestVersionFilterContext.java +++ b/maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestVersionFilterContext.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.test.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 java.util.ArrayList; import java.util.Collections; import java.util.Iterator; diff --git a/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestVersionRange.java b/maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestVersionRange.java similarity index 88% rename from aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestVersionRange.java rename to maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestVersionRange.java index 53836458c..dd5950edb 100644 --- a/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestVersionRange.java +++ b/maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestVersionRange.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.test.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.eclipse.aether.version.InvalidVersionSpecificationException; import org.eclipse.aether.version.Version; import org.eclipse.aether.version.VersionRange; diff --git a/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestVersionScheme.java b/maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestVersionScheme.java similarity index 77% rename from aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestVersionScheme.java rename to maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestVersionScheme.java index ce1279349..5865f6c5e 100644 --- a/aether-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestVersionScheme.java +++ b/maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/TestVersionScheme.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.test.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 java.util.ArrayList; import java.util.Collection; diff --git a/maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/package-info.java b/maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/package-info.java new file mode 100644 index 000000000..d4dd436cc --- /dev/null +++ b/maven-resolver-test-util/src/main/java/org/eclipse/aether/internal/test/util/package-info.java @@ -0,0 +1,26 @@ +// CHECKSTYLE_OFF: RegexpHeader +/** + * Utility classes to ease unit testing. This package supports the needs of Aether's own codebase but implementors of + * extensions might find some of these classes useful, too, as long as they understand that these classes do not denote + * a stable API and are subject to change without prior notice. + */ +package org.eclipse.aether.internal.test.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. + */ diff --git a/maven-resolver-test-util/src/site/site.xml b/maven-resolver-test-util/src/site/site.xml new file mode 100644 index 000000000..3a16bf98b --- /dev/null +++ b/maven-resolver-test-util/src/site/site.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/aether-test-util/src/test/java/org/eclipse/aether/internal/test/util/DependencyGraphParserTest.java b/maven-resolver-test-util/src/test/java/org/eclipse/aether/internal/test/util/DependencyGraphParserTest.java similarity index 90% rename from aether-test-util/src/test/java/org/eclipse/aether/internal/test/util/DependencyGraphParserTest.java rename to maven-resolver-test-util/src/test/java/org/eclipse/aether/internal/test/util/DependencyGraphParserTest.java index 477a946f5..ac0a36860 100644 --- a/aether-test-util/src/test/java/org/eclipse/aether/internal/test/util/DependencyGraphParserTest.java +++ b/maven-resolver-test-util/src/test/java/org/eclipse/aether/internal/test/util/DependencyGraphParserTest.java @@ -1,19 +1,27 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.test.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 static org.junit.Assert.*; import java.io.IOException; -import java.io.UnsupportedEncodingException; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -173,7 +181,7 @@ public void testId() @Test public void testResourceLoading() - throws UnsupportedEncodingException, IOException + throws IOException { String prefix = "org/eclipse/aether/internal/test/util/"; String name = "testResourceLoading.txt"; @@ -185,7 +193,7 @@ public void testResourceLoading() @Test public void testResourceLoadingWithPrefix() - throws UnsupportedEncodingException, IOException + throws IOException { String prefix = "org/eclipse/aether/internal/test/util/"; parser = new DependencyGraphParser( prefix ); diff --git a/aether-test-util/src/test/java/org/eclipse/aether/internal/test/util/IniArtifactDataReaderTest.java b/maven-resolver-test-util/src/test/java/org/eclipse/aether/internal/test/util/IniArtifactDataReaderTest.java similarity index 90% rename from aether-test-util/src/test/java/org/eclipse/aether/internal/test/util/IniArtifactDataReaderTest.java rename to maven-resolver-test-util/src/test/java/org/eclipse/aether/internal/test/util/IniArtifactDataReaderTest.java index b305fa4b1..4864b32e4 100644 --- a/aether-test-util/src/test/java/org/eclipse/aether/internal/test/util/IniArtifactDataReaderTest.java +++ b/maven-resolver-test-util/src/test/java/org/eclipse/aether/internal/test/util/IniArtifactDataReaderTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.test.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 static org.junit.Assert.*; import java.io.IOException; diff --git a/aether-test-util/src/test/java/org/eclipse/aether/internal/test/util/IniArtifactDescriptorReaderTest.java b/maven-resolver-test-util/src/test/java/org/eclipse/aether/internal/test/util/IniArtifactDescriptorReaderTest.java similarity index 85% rename from aether-test-util/src/test/java/org/eclipse/aether/internal/test/util/IniArtifactDescriptorReaderTest.java rename to maven-resolver-test-util/src/test/java/org/eclipse/aether/internal/test/util/IniArtifactDescriptorReaderTest.java index 6278b9f77..8b6bfa4a9 100644 --- a/aether-test-util/src/test/java/org/eclipse/aether/internal/test/util/IniArtifactDescriptorReaderTest.java +++ b/maven-resolver-test-util/src/test/java/org/eclipse/aether/internal/test/util/IniArtifactDescriptorReaderTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.test.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 static org.junit.Assert.*; import java.io.IOException; diff --git a/aether-test-util/src/test/java/org/eclipse/aether/internal/test/util/NodeDefinitionTest.java b/maven-resolver-test-util/src/test/java/org/eclipse/aether/internal/test/util/NodeDefinitionTest.java similarity index 88% rename from aether-test-util/src/test/java/org/eclipse/aether/internal/test/util/NodeDefinitionTest.java rename to maven-resolver-test-util/src/test/java/org/eclipse/aether/internal/test/util/NodeDefinitionTest.java index 21eb241ab..8f41a5a7e 100644 --- a/aether-test-util/src/test/java/org/eclipse/aether/internal/test/util/NodeDefinitionTest.java +++ b/maven-resolver-test-util/src/test/java/org/eclipse/aether/internal/test/util/NodeDefinitionTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.test.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 static org.junit.Assert.*; import java.util.Arrays; diff --git a/aether-test-util/src/test/resources/org/eclipse/aether/internal/test/util/ArtifactDataReaderTest.ini b/maven-resolver-test-util/src/test/resources/org/eclipse/aether/internal/test/util/ArtifactDataReaderTest.ini similarity index 100% rename from aether-test-util/src/test/resources/org/eclipse/aether/internal/test/util/ArtifactDataReaderTest.ini rename to maven-resolver-test-util/src/test/resources/org/eclipse/aether/internal/test/util/ArtifactDataReaderTest.ini diff --git a/aether-test-util/src/test/resources/org/eclipse/aether/internal/test/util/gid_aid_1.ini b/maven-resolver-test-util/src/test/resources/org/eclipse/aether/internal/test/util/gid_aid_1.ini similarity index 100% rename from aether-test-util/src/test/resources/org/eclipse/aether/internal/test/util/gid_aid_1.ini rename to maven-resolver-test-util/src/test/resources/org/eclipse/aether/internal/test/util/gid_aid_1.ini diff --git a/aether-test-util/src/test/resources/org/eclipse/aether/internal/test/util/gid_aid_ver.ini b/maven-resolver-test-util/src/test/resources/org/eclipse/aether/internal/test/util/gid_aid_ver.ini similarity index 100% rename from aether-test-util/src/test/resources/org/eclipse/aether/internal/test/util/gid_aid_ver.ini rename to maven-resolver-test-util/src/test/resources/org/eclipse/aether/internal/test/util/gid_aid_ver.ini diff --git a/aether-test-util/src/test/resources/org/eclipse/aether/internal/test/util/testResourceLoading.txt b/maven-resolver-test-util/src/test/resources/org/eclipse/aether/internal/test/util/testResourceLoading.txt similarity index 100% rename from aether-test-util/src/test/resources/org/eclipse/aether/internal/test/util/testResourceLoading.txt rename to maven-resolver-test-util/src/test/resources/org/eclipse/aether/internal/test/util/testResourceLoading.txt diff --git a/maven-resolver-transport-classpath/pom.xml b/maven-resolver-transport-classpath/pom.xml new file mode 100644 index 000000000..f94f61d60 --- /dev/null +++ b/maven-resolver-transport-classpath/pom.xml @@ -0,0 +1,89 @@ + + + + + + 4.0.0 + + + org.apache.maven.resolver + maven-resolver + 1.2.0-SNAPSHOT + + + maven-resolver-transport-classpath + + Maven Artifact Resolver Transport Classpath + + A transport implementation for repositories using classpath:// URLs. + + + + + org.apache.maven.resolver + maven-resolver-api + + + org.apache.maven.resolver + maven-resolver-spi + + + org.apache.maven.resolver + maven-resolver-util + + + javax.inject + javax.inject + provided + true + + + org.sonatype.sisu + sisu-guice + no_aop + test + + + junit + junit + test + + + org.hamcrest + hamcrest-core + test + + + org.apache.maven.resolver + maven-resolver-test-util + test + + + + + + + org.eclipse.sisu + sisu-maven-plugin + + + + diff --git a/aether-transport-classpath/src/main/java/org/eclipse/aether/transport/classpath/ClasspathTransporter.java b/maven-resolver-transport-classpath/src/main/java/org/eclipse/aether/transport/classpath/ClasspathTransporter.java similarity index 81% rename from aether-transport-classpath/src/main/java/org/eclipse/aether/transport/classpath/ClasspathTransporter.java rename to maven-resolver-transport-classpath/src/main/java/org/eclipse/aether/transport/classpath/ClasspathTransporter.java index c51cb2357..493c907c6 100644 --- a/aether-transport-classpath/src/main/java/org/eclipse/aether/transport/classpath/ClasspathTransporter.java +++ b/maven-resolver-transport-classpath/src/main/java/org/eclipse/aether/transport/classpath/ClasspathTransporter.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.transport.classpath; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.URI; import java.net.URISyntaxException; import java.net.URL; diff --git a/aether-transport-classpath/src/main/java/org/eclipse/aether/transport/classpath/ClasspathTransporterFactory.java b/maven-resolver-transport-classpath/src/main/java/org/eclipse/aether/transport/classpath/ClasspathTransporterFactory.java similarity index 81% rename from aether-transport-classpath/src/main/java/org/eclipse/aether/transport/classpath/ClasspathTransporterFactory.java rename to maven-resolver-transport-classpath/src/main/java/org/eclipse/aether/transport/classpath/ClasspathTransporterFactory.java index 4a7c47021..18db417d9 100644 --- a/aether-transport-classpath/src/main/java/org/eclipse/aether/transport/classpath/ClasspathTransporterFactory.java +++ b/maven-resolver-transport-classpath/src/main/java/org/eclipse/aether/transport/classpath/ClasspathTransporterFactory.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.transport.classpath; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.inject.Inject; import javax.inject.Named; diff --git a/maven-resolver-transport-classpath/src/main/java/org/eclipse/aether/transport/classpath/ResourceNotFoundException.java b/maven-resolver-transport-classpath/src/main/java/org/eclipse/aether/transport/classpath/ResourceNotFoundException.java new file mode 100644 index 000000000..d30a0ff78 --- /dev/null +++ b/maven-resolver-transport-classpath/src/main/java/org/eclipse/aether/transport/classpath/ResourceNotFoundException.java @@ -0,0 +1,37 @@ +package org.eclipse.aether.transport.classpath; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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; + +/** + * Special exception type used instead of {@code FileNotFoundException} to avoid misinterpretation of errors unrelated + * to the remote resource. + */ +class ResourceNotFoundException + extends IOException +{ + + public ResourceNotFoundException( String message ) + { + super( message ); + } + +} diff --git a/maven-resolver-transport-classpath/src/main/java/org/eclipse/aether/transport/classpath/package-info.java b/maven-resolver-transport-classpath/src/main/java/org/eclipse/aether/transport/classpath/package-info.java new file mode 100644 index 000000000..9d85bf580 --- /dev/null +++ b/maven-resolver-transport-classpath/src/main/java/org/eclipse/aether/transport/classpath/package-info.java @@ -0,0 +1,24 @@ +// CHECKSTYLE_OFF: RegexpHeader +/** + * Support for downloads that utilize the classpath as "remote" storage. + */ +package org.eclipse.aether.transport.classpath; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ diff --git a/maven-resolver-transport-classpath/src/site/site.xml b/maven-resolver-transport-classpath/src/site/site.xml new file mode 100644 index 000000000..3a16bf98b --- /dev/null +++ b/maven-resolver-transport-classpath/src/site/site.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/aether-transport-classpath/src/test/java/org/eclipse/aether/transport/classpath/ClasspathTransporterTest.java b/maven-resolver-transport-classpath/src/test/java/org/eclipse/aether/transport/classpath/ClasspathTransporterTest.java similarity index 86% rename from aether-transport-classpath/src/test/java/org/eclipse/aether/transport/classpath/ClasspathTransporterTest.java rename to maven-resolver-transport-classpath/src/test/java/org/eclipse/aether/transport/classpath/ClasspathTransporterTest.java index 8b3083566..0f7647c29 100644 --- a/aether-transport-classpath/src/test/java/org/eclipse/aether/transport/classpath/ClasspathTransporterTest.java +++ b/maven-resolver-transport-classpath/src/test/java/org/eclipse/aether/transport/classpath/ClasspathTransporterTest.java @@ -1,20 +1,30 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.transport.classpath; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import java.io.File; import java.io.FileNotFoundException; import java.net.URI; +import java.nio.charset.StandardCharsets; import org.eclipse.aether.DefaultRepositorySystemSession; import org.eclipse.aether.internal.test.util.TestFileUtils; @@ -134,11 +144,11 @@ public void testGet_ToMemory() GetTask task = new GetTask( URI.create( "file.txt" ) ).setListener( listener ); transporter.get( task ); assertEquals( "test", task.getDataString() ); - assertEquals( 0, listener.dataOffset ); - assertEquals( 4, listener.dataLength ); + assertEquals( 0L, listener.dataOffset ); + assertEquals( 4L, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); - assertEquals( task.getDataString(), listener.baos.toString( "UTF-8" ) ); + assertEquals( task.getDataString(), new String( listener.baos.toByteArray(), StandardCharsets.UTF_8 ) ); } @Test @@ -150,11 +160,11 @@ public void testGet_ToFile() GetTask task = new GetTask( URI.create( "file.txt" ) ).setDataFile( file ).setListener( listener ); transporter.get( task ); assertEquals( "test", TestFileUtils.readString( file ) ); - assertEquals( 0, listener.dataOffset ); - assertEquals( 4, listener.dataLength ); + assertEquals( 0L, listener.dataOffset ); + assertEquals( 4L, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); - assertEquals( "test", listener.baos.toString( "UTF-8" ) ); + assertEquals( "test", new String( listener.baos.toByteArray(), StandardCharsets.UTF_8 ) ); } @Test @@ -166,11 +176,11 @@ public void testGet_EmptyResource() GetTask task = new GetTask( URI.create( "empty.txt" ) ).setDataFile( file ).setListener( listener ); transporter.get( task ); assertEquals( "", TestFileUtils.readString( file ) ); - assertEquals( 0, listener.dataOffset ); - assertEquals( 0, listener.dataLength ); + assertEquals( 0L, listener.dataOffset ); + assertEquals( 0L, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertEquals( 0, listener.progressedCount ); - assertEquals( "", listener.baos.toString( "UTF-8" ) ); + assertEquals( "", new String( listener.baos.toByteArray(), StandardCharsets.UTF_8 ) ); } @Test @@ -259,8 +269,8 @@ public void testGet_StartCancelled() { assertEquals( Transporter.ERROR_OTHER, transporter.classify( e ) ); } - assertEquals( 0, listener.dataOffset ); - assertEquals( 4, listener.dataLength ); + assertEquals( 0L, listener.dataOffset ); + assertEquals( 4L, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertEquals( 0, listener.progressedCount ); } @@ -281,8 +291,8 @@ public void testGet_ProgressCancelled() { assertEquals( Transporter.ERROR_OTHER, transporter.classify( e ) ); } - assertEquals( 0, listener.dataOffset ); - assertEquals( 4, listener.dataLength ); + assertEquals( 0L, listener.dataOffset ); + assertEquals( 4L, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertEquals( 1, listener.progressedCount ); } diff --git a/aether-transport-classpath/src/test/java/org/eclipse/aether/transport/classpath/RecordingTransportListener.java b/maven-resolver-transport-classpath/src/test/java/org/eclipse/aether/transport/classpath/RecordingTransportListener.java similarity index 62% rename from aether-transport-classpath/src/test/java/org/eclipse/aether/transport/classpath/RecordingTransportListener.java rename to maven-resolver-transport-classpath/src/test/java/org/eclipse/aether/transport/classpath/RecordingTransportListener.java index 07b0fcdbb..9447d394b 100644 --- a/aether-transport-classpath/src/test/java/org/eclipse/aether/transport/classpath/RecordingTransportListener.java +++ b/maven-resolver-transport-classpath/src/test/java/org/eclipse/aether/transport/classpath/RecordingTransportListener.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.transport.classpath; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.ByteArrayOutputStream; import java.nio.ByteBuffer; diff --git a/aether-transport-classpath/src/test/resources/file.txt b/maven-resolver-transport-classpath/src/test/resources/file.txt similarity index 100% rename from aether-transport-classpath/src/test/resources/file.txt rename to maven-resolver-transport-classpath/src/test/resources/file.txt diff --git a/aether-transport-classpath/src/test/resources/repo space/file.txt b/maven-resolver-transport-classpath/src/test/resources/repo space/file.txt similarity index 100% rename from aether-transport-classpath/src/test/resources/repo space/file.txt rename to maven-resolver-transport-classpath/src/test/resources/repo space/file.txt diff --git a/aether-transport-classpath/src/test/resources/repository/empty.txt b/maven-resolver-transport-classpath/src/test/resources/repository/empty.txt similarity index 100% rename from aether-transport-classpath/src/test/resources/repository/empty.txt rename to maven-resolver-transport-classpath/src/test/resources/repository/empty.txt diff --git a/aether-transport-classpath/src/test/resources/repository/file.txt b/maven-resolver-transport-classpath/src/test/resources/repository/file.txt similarity index 100% rename from aether-transport-classpath/src/test/resources/repository/file.txt rename to maven-resolver-transport-classpath/src/test/resources/repository/file.txt diff --git a/aether-transport-classpath/src/test/resources/repository/some space.txt b/maven-resolver-transport-classpath/src/test/resources/repository/some space.txt similarity index 100% rename from aether-transport-classpath/src/test/resources/repository/some space.txt rename to maven-resolver-transport-classpath/src/test/resources/repository/some space.txt diff --git a/maven-resolver-transport-file/pom.xml b/maven-resolver-transport-file/pom.xml new file mode 100644 index 000000000..0f0255465 --- /dev/null +++ b/maven-resolver-transport-file/pom.xml @@ -0,0 +1,89 @@ + + + + + + 4.0.0 + + + org.apache.maven.resolver + maven-resolver + 1.2.0-SNAPSHOT + + + maven-resolver-transport-file + + Maven Artifact Resolver Transport File + + A transport implementation for repositories using file:// URLs. + + + + + org.apache.maven.resolver + maven-resolver-api + + + org.apache.maven.resolver + maven-resolver-spi + + + org.apache.maven.resolver + maven-resolver-util + + + javax.inject + javax.inject + provided + true + + + org.sonatype.sisu + sisu-guice + no_aop + test + + + junit + junit + test + + + org.hamcrest + hamcrest-core + test + + + org.apache.maven.resolver + maven-resolver-test-util + test + + + + + + + org.eclipse.sisu + sisu-maven-plugin + + + + diff --git a/aether-transport-file/src/main/java/org/eclipse/aether/transport/file/FileTransporter.java b/maven-resolver-transport-file/src/main/java/org/eclipse/aether/transport/file/FileTransporter.java similarity index 77% rename from aether-transport-file/src/main/java/org/eclipse/aether/transport/file/FileTransporter.java rename to maven-resolver-transport-file/src/main/java/org/eclipse/aether/transport/file/FileTransporter.java index 1b59ba26b..5c5cfa46c 100644 --- a/aether-transport-file/src/main/java/org/eclipse/aether/transport/file/FileTransporter.java +++ b/maven-resolver-transport-file/src/main/java/org/eclipse/aether/transport/file/FileTransporter.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.transport.file; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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; diff --git a/aether-transport-file/src/main/java/org/eclipse/aether/transport/file/FileTransporterFactory.java b/maven-resolver-transport-file/src/main/java/org/eclipse/aether/transport/file/FileTransporterFactory.java similarity index 76% rename from aether-transport-file/src/main/java/org/eclipse/aether/transport/file/FileTransporterFactory.java rename to maven-resolver-transport-file/src/main/java/org/eclipse/aether/transport/file/FileTransporterFactory.java index 08e337c11..86ae6fcd9 100644 --- a/aether-transport-file/src/main/java/org/eclipse/aether/transport/file/FileTransporterFactory.java +++ b/maven-resolver-transport-file/src/main/java/org/eclipse/aether/transport/file/FileTransporterFactory.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.transport.file; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.inject.Inject; import javax.inject.Named; diff --git a/aether-transport-file/src/main/java/org/eclipse/aether/transport/file/PathUtils.java b/maven-resolver-transport-file/src/main/java/org/eclipse/aether/transport/file/PathUtils.java similarity index 81% rename from aether-transport-file/src/main/java/org/eclipse/aether/transport/file/PathUtils.java rename to maven-resolver-transport-file/src/main/java/org/eclipse/aether/transport/file/PathUtils.java index 0ece6ee26..ac3f8fd3e 100644 --- a/aether-transport-file/src/main/java/org/eclipse/aether/transport/file/PathUtils.java +++ b/maven-resolver-transport-file/src/main/java/org/eclipse/aether/transport/file/PathUtils.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.transport.file; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + /** * URL handling for file URLs. Based on org.apache.maven.wagon.PathUtils. */ diff --git a/maven-resolver-transport-file/src/main/java/org/eclipse/aether/transport/file/ResourceNotFoundException.java b/maven-resolver-transport-file/src/main/java/org/eclipse/aether/transport/file/ResourceNotFoundException.java new file mode 100644 index 000000000..462fa0afa --- /dev/null +++ b/maven-resolver-transport-file/src/main/java/org/eclipse/aether/transport/file/ResourceNotFoundException.java @@ -0,0 +1,37 @@ +package org.eclipse.aether.transport.file; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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; + +/** + * Special exception type used instead of {@code FileNotFoundException} to avoid misinterpretation of errors unrelated + * to the remote resource. + */ +class ResourceNotFoundException + extends IOException +{ + + public ResourceNotFoundException( String message ) + { + super( message ); + } + +} diff --git a/maven-resolver-transport-file/src/main/java/org/eclipse/aether/transport/file/package-info.java b/maven-resolver-transport-file/src/main/java/org/eclipse/aether/transport/file/package-info.java new file mode 100644 index 000000000..f90497bb1 --- /dev/null +++ b/maven-resolver-transport-file/src/main/java/org/eclipse/aether/transport/file/package-info.java @@ -0,0 +1,24 @@ +// CHECKSTYLE_OFF: RegexpHeader +/** + * Support for downloads/uploads using the local filesystem as "remote" storage. + */ +package org.eclipse.aether.transport.file; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ diff --git a/maven-resolver-transport-file/src/site/site.xml b/maven-resolver-transport-file/src/site/site.xml new file mode 100644 index 000000000..3a16bf98b --- /dev/null +++ b/maven-resolver-transport-file/src/site/site.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/aether-transport-file/src/test/java/org/eclipse/aether/transport/file/FileTransporterTest.java b/maven-resolver-transport-file/src/test/java/org/eclipse/aether/transport/file/FileTransporterTest.java similarity index 87% rename from aether-transport-file/src/test/java/org/eclipse/aether/transport/file/FileTransporterTest.java rename to maven-resolver-transport-file/src/test/java/org/eclipse/aether/transport/file/FileTransporterTest.java index c4ce2de5e..dd65bf08a 100644 --- a/aether-transport-file/src/test/java/org/eclipse/aether/transport/file/FileTransporterTest.java +++ b/maven-resolver-transport-file/src/test/java/org/eclipse/aether/transport/file/FileTransporterTest.java @@ -1,20 +1,30 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.transport.file; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import java.io.File; import java.io.FileNotFoundException; import java.net.URI; +import java.nio.charset.StandardCharsets; import org.eclipse.aether.DefaultRepositorySystemSession; import org.eclipse.aether.internal.test.util.TestFileUtils; @@ -140,11 +150,11 @@ public void testGet_ToMemory() GetTask task = new GetTask( URI.create( "file.txt" ) ).setListener( listener ); transporter.get( task ); assertEquals( "test", task.getDataString() ); - assertEquals( 0, listener.dataOffset ); - assertEquals( 4, listener.dataLength ); + assertEquals( 0L, listener.dataOffset ); + assertEquals( 4L, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); - assertEquals( task.getDataString(), listener.baos.toString( "UTF-8" ) ); + assertEquals( task.getDataString(), new String( listener.baos.toByteArray(), StandardCharsets.UTF_8 ) ); } @Test @@ -156,11 +166,11 @@ public void testGet_ToFile() GetTask task = new GetTask( URI.create( "file.txt" ) ).setDataFile( file ).setListener( listener ); transporter.get( task ); assertEquals( "test", TestFileUtils.readString( file ) ); - assertEquals( 0, listener.dataOffset ); - assertEquals( 4, listener.dataLength ); + assertEquals( 0L, listener.dataOffset ); + assertEquals( 4L, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); - assertEquals( "test", listener.baos.toString( "UTF-8" ) ); + assertEquals( "test", new String( listener.baos.toByteArray(), StandardCharsets.UTF_8 ) ); } @Test @@ -172,11 +182,11 @@ public void testGet_EmptyResource() GetTask task = new GetTask( URI.create( "empty.txt" ) ).setDataFile( file ).setListener( listener ); transporter.get( task ); assertEquals( "", TestFileUtils.readString( file ) ); - assertEquals( 0, listener.dataOffset ); - assertEquals( 0, listener.dataLength ); + assertEquals( 0L, listener.dataOffset ); + assertEquals( 0L, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertEquals( 0, listener.progressedCount ); - assertEquals( "", listener.baos.toString( "UTF-8" ) ); + assertEquals( "", new String( listener.baos.toByteArray(), StandardCharsets.UTF_8 ) ); } @Test @@ -265,8 +275,8 @@ public void testGet_StartCancelled() { assertEquals( Transporter.ERROR_OTHER, transporter.classify( e ) ); } - assertEquals( 0, listener.dataOffset ); - assertEquals( 4, listener.dataLength ); + assertEquals( 0L, listener.dataOffset ); + assertEquals( 4L, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertEquals( 0, listener.progressedCount ); } @@ -287,8 +297,8 @@ public void testGet_ProgressCancelled() { assertEquals( Transporter.ERROR_OTHER, transporter.classify( e ) ); } - assertEquals( 0, listener.dataOffset ); - assertEquals( 4, listener.dataLength ); + assertEquals( 0L, listener.dataOffset ); + assertEquals( 4L, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertEquals( 1, listener.progressedCount ); } @@ -300,8 +310,8 @@ public void testPut_FromMemory() RecordingTransportListener listener = new RecordingTransportListener(); PutTask task = new PutTask( URI.create( "file.txt" ) ).setListener( listener ).setDataString( "upload" ); transporter.put( task ); - assertEquals( 0, listener.dataOffset ); - assertEquals( 6, listener.dataLength ); + assertEquals( 0L, listener.dataOffset ); + assertEquals( 6L, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); assertEquals( "upload", TestFileUtils.readString( new File( repoDir, "file.txt" ) ) ); @@ -315,8 +325,8 @@ public void testPut_FromFile() RecordingTransportListener listener = new RecordingTransportListener(); PutTask task = new PutTask( URI.create( "file.txt" ) ).setListener( listener ).setDataFile( file ); transporter.put( task ); - assertEquals( 0, listener.dataOffset ); - assertEquals( 6, listener.dataLength ); + assertEquals( 0L, listener.dataOffset ); + assertEquals( 6L, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); assertEquals( "upload", TestFileUtils.readString( new File( repoDir, "file.txt" ) ) ); @@ -329,8 +339,8 @@ public void testPut_EmptyResource() RecordingTransportListener listener = new RecordingTransportListener(); PutTask task = new PutTask( URI.create( "file.txt" ) ).setListener( listener ); transporter.put( task ); - assertEquals( 0, listener.dataOffset ); - assertEquals( 0, listener.dataLength ); + assertEquals( 0L, listener.dataOffset ); + assertEquals( 0L, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertEquals( 0, listener.progressedCount ); assertEquals( "", TestFileUtils.readString( new File( repoDir, "file.txt" ) ) ); @@ -344,8 +354,8 @@ public void testPut_NonExistentParentDir() PutTask task = new PutTask( URI.create( "dir/sub/dir/file.txt" ) ).setListener( listener ).setDataString( "upload" ); transporter.put( task ); - assertEquals( 0, listener.dataOffset ); - assertEquals( 6, listener.dataLength ); + assertEquals( 0L, listener.dataOffset ); + assertEquals( 6L, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); assertEquals( "upload", TestFileUtils.readString( new File( repoDir, "dir/sub/dir/file.txt" ) ) ); @@ -358,8 +368,8 @@ public void testPut_EncodedResourcePath() RecordingTransportListener listener = new RecordingTransportListener(); PutTask task = new PutTask( URI.create( "some%20space.txt" ) ).setListener( listener ).setDataString( "OK" ); transporter.put( task ); - assertEquals( 0, listener.dataOffset ); - assertEquals( 2, listener.dataLength ); + assertEquals( 0L, listener.dataOffset ); + assertEquals( 2L, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); assertEquals( "OK", TestFileUtils.readString( new File( repoDir, "some space.txt" ) ) ); @@ -411,8 +421,8 @@ public void testPut_StartCancelled() { assertEquals( Transporter.ERROR_OTHER, transporter.classify( e ) ); } - assertEquals( 0, listener.dataOffset ); - assertEquals( 6, listener.dataLength ); + assertEquals( 0L, listener.dataOffset ); + assertEquals( 6L, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertEquals( 0, listener.progressedCount ); assertFalse( new File( repoDir, "file.txt" ).exists() ); @@ -434,8 +444,8 @@ public void testPut_ProgressCancelled() { assertEquals( Transporter.ERROR_OTHER, transporter.classify( e ) ); } - assertEquals( 0, listener.dataOffset ); - assertEquals( 6, listener.dataLength ); + assertEquals( 0L, listener.dataOffset ); + assertEquals( 6L, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertEquals( 1, listener.progressedCount ); assertFalse( new File( repoDir, "file.txt" ).exists() ); diff --git a/aether-transport-file/src/test/java/org/eclipse/aether/transport/file/RecordingTransportListener.java b/maven-resolver-transport-file/src/test/java/org/eclipse/aether/transport/file/RecordingTransportListener.java similarity index 61% rename from aether-transport-file/src/test/java/org/eclipse/aether/transport/file/RecordingTransportListener.java rename to maven-resolver-transport-file/src/test/java/org/eclipse/aether/transport/file/RecordingTransportListener.java index 88ccb60cd..c6331e0ad 100644 --- a/aether-transport-file/src/test/java/org/eclipse/aether/transport/file/RecordingTransportListener.java +++ b/maven-resolver-transport-file/src/test/java/org/eclipse/aether/transport/file/RecordingTransportListener.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.transport.file; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.ByteArrayOutputStream; import java.nio.ByteBuffer; diff --git a/aether-transport-http/pom.xml b/maven-resolver-transport-http/pom.xml similarity index 53% rename from aether-transport-http/pom.xml rename to maven-resolver-transport-http/pom.xml index feb9adb6a..840690756 100644 --- a/aether-transport-http/pom.xml +++ b/maven-resolver-transport-http/pom.xml @@ -1,53 +1,58 @@ - + 4.0.0 - org.eclipse.aether - aether - 1.0.0.v20140518 + org.apache.maven.resolver + maven-resolver + 1.2.0-SNAPSHOT - aether-transport-http + maven-resolver-transport-http - Aether Transport HTTP + Maven Artifact Resolver Transport HTTP A transport implementation for repositories using http:// and https:// URLs. - - org.eclipse.aether.transport.http - - - org.eclipse.aether - aether-api + org.apache.maven.resolver + maven-resolver-api - org.eclipse.aether - aether-spi + org.apache.maven.resolver + maven-resolver-spi - org.eclipse.aether - aether-util + org.apache.maven.resolver + maven-resolver-util org.apache.httpcomponents httpclient - 4.2.6 + 4.5.2 @@ -59,7 +64,7 @@ org.slf4j jcl-over-slf4j - 1.6.2 + 1.7.16 javax.inject @@ -80,47 +85,34 @@ org.hamcrest - hamcrest-library + hamcrest-core test - org.eclipse.aether - aether-test-util + org.apache.maven.resolver + maven-resolver-test-util test org.eclipse.jetty jetty-server - 7.6.14.v20131031 + 7.6.19.v20160209 test ch.qos.logback logback-classic - 1.0.7 + 1.1.7 test - - org.codehaus.mojo - animal-sniffer-maven-plugin - org.eclipse.sisu sisu-maven-plugin - - org.apache.felix - maven-bundle-plugin - - - org.apache.http.*;version="[4.2.1,4.3)",* - - - diff --git a/aether-transport-http/src/main/java/org/eclipse/aether/transport/http/AuthSchemePool.java b/maven-resolver-transport-http/src/main/java/org/eclipse/aether/transport/http/AuthSchemePool.java similarity index 59% rename from aether-transport-http/src/main/java/org/eclipse/aether/transport/http/AuthSchemePool.java rename to maven-resolver-transport-http/src/main/java/org/eclipse/aether/transport/http/AuthSchemePool.java index e6b224aef..9b8625277 100644 --- a/aether-transport-http/src/main/java/org/eclipse/aether/transport/http/AuthSchemePool.java +++ b/maven-resolver-transport-http/src/main/java/org/eclipse/aether/transport/http/AuthSchemePool.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.transport.http; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.LinkedList; import org.apache.http.auth.AuthScheme; diff --git a/aether-transport-http/src/main/java/org/eclipse/aether/transport/http/DeferredCredentialsProvider.java b/maven-resolver-transport-http/src/main/java/org/eclipse/aether/transport/http/DeferredCredentialsProvider.java similarity index 86% rename from aether-transport-http/src/main/java/org/eclipse/aether/transport/http/DeferredCredentialsProvider.java rename to maven-resolver-transport-http/src/main/java/org/eclipse/aether/transport/http/DeferredCredentialsProvider.java index 0ece15012..c0daeaf2c 100644 --- a/aether-transport-http/src/main/java/org/eclipse/aether/transport/http/DeferredCredentialsProvider.java +++ b/maven-resolver-transport-http/src/main/java/org/eclipse/aether/transport/http/DeferredCredentialsProvider.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.transport.http; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.InetAddress; import java.net.UnknownHostException; import java.util.HashMap; diff --git a/maven-resolver-transport-http/src/main/java/org/eclipse/aether/transport/http/DemuxCredentialsProvider.java b/maven-resolver-transport-http/src/main/java/org/eclipse/aether/transport/http/DemuxCredentialsProvider.java new file mode 100644 index 000000000..f16246eb5 --- /dev/null +++ b/maven-resolver-transport-http/src/main/java/org/eclipse/aether/transport/http/DemuxCredentialsProvider.java @@ -0,0 +1,76 @@ +package org.eclipse.aether.transport.http; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import org.apache.http.HttpHost; +import org.apache.http.auth.AuthScope; +import org.apache.http.auth.Credentials; +import org.apache.http.client.CredentialsProvider; + +/** + * Credentials provider that helps to isolate server from proxy credentials. Apache HttpClient uses a single provider + * for both server and proxy auth, using the auth scope (host, port, etc.) to select the proper credentials. With regard + * to redirects, we use an auth scope for server credentials that's not specific enough to not be mistaken for proxy + * auth. This provider helps to maintain the proper isolation. + */ +final class DemuxCredentialsProvider + implements CredentialsProvider +{ + + private final CredentialsProvider serverCredentialsProvider; + + private final CredentialsProvider proxyCredentialsProvider; + + private final HttpHost proxy; + + public DemuxCredentialsProvider( CredentialsProvider serverCredentialsProvider, + CredentialsProvider proxyCredentialsProvider, HttpHost proxy ) + { + this.serverCredentialsProvider = serverCredentialsProvider; + this.proxyCredentialsProvider = proxyCredentialsProvider; + this.proxy = proxy; + } + + private CredentialsProvider getDelegate( AuthScope authScope ) + { + if ( proxy.getPort() == authScope.getPort() && proxy.getHostName().equalsIgnoreCase( authScope.getHost() ) ) + { + return proxyCredentialsProvider; + } + return serverCredentialsProvider; + } + + public Credentials getCredentials( AuthScope authScope ) + { + return getDelegate( authScope ).getCredentials( authScope ); + } + + public void setCredentials( AuthScope authScope, Credentials credentials ) + { + getDelegate( authScope ).setCredentials( authScope, credentials ); + } + + public void clear() + { + serverCredentialsProvider.clear(); + proxyCredentialsProvider.clear(); + } + +} diff --git a/aether-transport-http/src/main/java/org/eclipse/aether/transport/http/GlobalState.java b/maven-resolver-transport-http/src/main/java/org/eclipse/aether/transport/http/GlobalState.java similarity index 87% rename from aether-transport-http/src/main/java/org/eclipse/aether/transport/http/GlobalState.java rename to maven-resolver-transport-http/src/main/java/org/eclipse/aether/transport/http/GlobalState.java index 714d936d0..b3a9d4b15 100644 --- a/aether-transport-http/src/main/java/org/eclipse/aether/transport/http/GlobalState.java +++ b/maven-resolver-transport-http/src/main/java/org/eclipse/aether/transport/http/GlobalState.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.transport.http; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Closeable; import java.util.Arrays; import java.util.Iterator; diff --git a/maven-resolver-transport-http/src/main/java/org/eclipse/aether/transport/http/HttpMkCol.java b/maven-resolver-transport-http/src/main/java/org/eclipse/aether/transport/http/HttpMkCol.java new file mode 100644 index 000000000..7a945eae3 --- /dev/null +++ b/maven-resolver-transport-http/src/main/java/org/eclipse/aether/transport/http/HttpMkCol.java @@ -0,0 +1,44 @@ +package org.eclipse.aether.transport.http; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.URI; + +import org.apache.http.client.methods.HttpRequestBase; + +/** + * WebDAV MKCOL request to create parent directories. + */ +final class HttpMkCol + extends HttpRequestBase +{ + + public HttpMkCol( URI uri ) + { + setURI( uri ); + } + + @Override + public String getMethod() + { + return "MKCOL"; + } + +} diff --git a/aether-transport-http/src/main/java/org/eclipse/aether/transport/http/HttpTransporter.java b/maven-resolver-transport-http/src/main/java/org/eclipse/aether/transport/http/HttpTransporter.java similarity index 79% rename from aether-transport-http/src/main/java/org/eclipse/aether/transport/http/HttpTransporter.java rename to maven-resolver-transport-http/src/main/java/org/eclipse/aether/transport/http/HttpTransporter.java index 1eda25ee1..47b8d2e58 100644 --- a/aether-transport-http/src/main/java/org/eclipse/aether/transport/http/HttpTransporter.java +++ b/maven-resolver-transport-http/src/main/java/org/eclipse/aether/transport/http/HttpTransporter.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.transport.http; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.io.InterruptedIOException; @@ -32,6 +41,7 @@ import org.apache.http.HttpStatus; import org.apache.http.auth.AuthScope; import org.apache.http.auth.params.AuthParams; +import org.apache.http.client.CredentialsProvider; import org.apache.http.client.HttpClient; import org.apache.http.client.HttpResponseException; import org.apache.http.client.methods.HttpGet; @@ -75,6 +85,8 @@ final class HttpTransporter private static final Pattern CONTENT_RANGE_PATTERN = Pattern.compile( "\\s*bytes\\s+([0-9]+)\\s*-\\s*([0-9]+)\\s*/.*" ); + private static final Pattern HOST_SPLIT_PATTERN = Pattern.compile( "\\s*[,]\\s*" ); + private final Logger logger; private final AuthenticationContext repoAuthContext; @@ -134,13 +146,8 @@ public HttpTransporter( RemoteRepository repository, RepositorySystemSession ses configureClient( client.getParams(), session, repository, proxy ); - DeferredCredentialsProvider credsProvider = new DeferredCredentialsProvider(); - addCredentials( credsProvider, server.getHostName(), AuthScope.ANY_PORT, repoAuthContext ); - if ( proxy != null ) - { - addCredentials( credsProvider, proxy.getHostName(), proxy.getPort(), proxyAuthContext ); - } - client.setCredentialsProvider( credsProvider ); + boolean redirectedAuth = getRedirectedAuth( session, repository, server ); + client.setCredentialsProvider( toCredentials( server, repoAuthContext, redirectedAuth, proxy, proxyAuthContext ) ); this.client = new DecompressingHttpClient( client ); } @@ -182,9 +189,49 @@ private static void configureClient( HttpParams params, RepositorySystemSession ConfigurationProperties.USER_AGENT ) ); } - private static void addCredentials( DeferredCredentialsProvider provider, String host, int port, - AuthenticationContext ctx ) + private static boolean getRedirectedAuth( RepositorySystemSession session, RemoteRepository repo, HttpHost server ) { + String mode = + ConfigUtils.getString( session, ConfigurationProperties.DEFAULT_HTTP_REDIRECTED_AUTHENTICATION, + ConfigurationProperties.HTTP_REDIRECTED_AUTHENTICATION + '.' + repo.getId(), + ConfigurationProperties.HTTP_REDIRECTED_AUTHENTICATION ); + if ( "false".equalsIgnoreCase( mode ) ) + { + return false; + } + if ( "true".equalsIgnoreCase( mode ) ) + { + return true; + } + String host = server.getHostName(); + for ( String allowed : HOST_SPLIT_PATTERN.split( mode.trim() ) ) + { + if ( allowed.equalsIgnoreCase( host ) ) + { + return true; + } + } + return false; + } + + private static CredentialsProvider toCredentials( HttpHost server, AuthenticationContext serverAuthCtx, + boolean redirectedAuth, HttpHost proxy, + AuthenticationContext proxyAuthCtx ) + { + CredentialsProvider provider = + toCredentials( redirectedAuth ? AuthScope.ANY_HOST : server.getHostName(), AuthScope.ANY_PORT, + serverAuthCtx ); + if ( proxy != null ) + { + CredentialsProvider p = toCredentials( proxy.getHostName(), proxy.getPort(), proxyAuthCtx ); + provider = new DemuxCredentialsProvider( provider, p, proxy ); + } + return provider; + } + + private static CredentialsProvider toCredentials( String host, int port, AuthenticationContext ctx ) + { + DeferredCredentialsProvider provider = new DeferredCredentialsProvider(); if ( ctx != null ) { AuthScope basicScope = new AuthScope( host, port ); @@ -193,6 +240,7 @@ private static void addCredentials( DeferredCredentialsProvider provider, String AuthScope ntlmScope = new AuthScope( host, port, AuthScope.ANY_REALM, "ntlm" ); provider.setCredentials( ntlmScope, new DeferredCredentialsProvider.NtlmFactory( ctx ) ); } + return provider; } LocalState getState() @@ -304,29 +352,49 @@ private void execute( HttpUriRequest request, EntityGetter getter ) private void prepare( HttpUriRequest request, SharingHttpContext context ) { boolean put = HttpPut.METHOD_NAME.equalsIgnoreCase( request.getMethod() ); - if ( state.getWebDav() == null && ( put || isPayloadPresent( request ) ) ) + if ( ( put || isPayloadPresent( request ) ) && !state.isProbed() ) { - try + synchronized ( state ) { - HttpOptions req = commonHeaders( new HttpOptions( request.getURI() ) ); - HttpResponse response = client.execute( server, req, context ); - state.setWebDav( isWebDav( response ) ); - EntityUtils.consumeQuietly( response.getEntity() ); - } - catch ( IOException e ) - { - logger.debug( "Failed to prepare HTTP context", e ); + if ( !state.isProbed() ) + { + probe( request, context ); + state.setProbed(); + } } } - if ( put && Boolean.TRUE.equals( state.getWebDav() ) ) + if ( put && state.isWebDav() ) { mkdirs( request.getURI(), context ); } } + private void probe( HttpUriRequest request, SharingHttpContext context ) + { + try + { + HttpOptions req = commonHeaders( new HttpOptions( request.getURI() ) ); + HttpResponse response = client.execute( server, req, context ); + state.setWebDav( isWebDav( response ) ); + EntityUtils.consumeQuietly( response.getEntity() ); + } + catch ( IOException e ) + { + logger.debug( "Failed to probe HTTP server", e ); + } + } + private boolean isWebDav( HttpResponse response ) { - return response.containsHeader( HttpHeaders.DAV ); + return response.containsHeader( HttpHeaders.DAV ) && !isWebDavOptional( response ); + } + + private boolean isWebDavOptional( HttpResponse response ) + { + Header header = response.getFirstHeader( HttpHeaders.SERVER ); + String server = ( header != null ) ? header.getValue() : null; + // repository managers don't need webdav mode and work fine with straight puts + return server != null && ( server.startsWith( "Artifactory/" ) || server.startsWith( "Nexus/" ) ); } private void mkdirs( URI uri, SharingHttpContext context ) @@ -344,10 +412,12 @@ private void mkdirs( URI uri, SharingHttpContext context ) int status = response.getStatusLine().getStatusCode(); if ( status < 300 || status == HttpStatus.SC_METHOD_NOT_ALLOWED ) { + // directory was created or already existed break; } else if ( status == HttpStatus.SC_CONFLICT ) { + // parent directory needs to be created first continue; } handleStatus( response ); @@ -439,11 +509,11 @@ private T commonHeaders( T request ) private T resume( T request, GetTask task ) { long resumeOffset = task.getResumeOffset(); - if ( resumeOffset > 0 && task.getDataFile() != null ) + if ( resumeOffset > 0L && task.getDataFile() != null ) { request.setHeader( HttpHeaders.RANGE, "bytes=" + Long.toString( resumeOffset ) + '-' ); request.setHeader( HttpHeaders.IF_UNMODIFIED_SINCE, - DateUtils.formatDate( new Date( task.getDataFile().lastModified() - 60 * 1000 ) ) ); + DateUtils.formatDate( new Date( task.getDataFile().lastModified() - 60L * 1000L ) ) ); request.setHeader( HttpHeaders.ACCEPT_ENCODING, "identity" ); } return request; @@ -486,7 +556,7 @@ public void handle( HttpResponse response ) entity = new ByteArrayEntity( new byte[0] ); } - long offset = 0, length = entity.getContentLength(); + long offset = 0L, length = entity.getContentLength(); String range = getHeader( response, HttpHeaders.CONTENT_RANGE ); if ( range != null ) { @@ -496,8 +566,8 @@ public void handle( HttpResponse response ) throw new IOException( "Invalid Content-Range header for partial download: " + range ); } offset = Long.parseLong( m.group( 1 ) ); - length = Long.parseLong( m.group( 2 ) ) + 1; - if ( offset < 0 || offset >= length || ( offset > 0 && offset != task.getResumeOffset() ) ) + length = Long.parseLong( m.group( 2 ) ) + 1L; + if ( offset < 0L || offset >= length || ( offset > 0L && offset != task.getResumeOffset() ) ) { throw new IOException( "Invalid Content-Range header for partial download from offset " + task.getResumeOffset() + ": " + range ); @@ -505,7 +575,7 @@ public void handle( HttpResponse response ) } InputStream is = entity.getContent(); - utilGet( task, is, true, length, offset > 0 ); + utilGet( task, is, true, length, offset > 0L ); extractChecksums( response ); } diff --git a/aether-transport-http/src/main/java/org/eclipse/aether/transport/http/HttpTransporterFactory.java b/maven-resolver-transport-http/src/main/java/org/eclipse/aether/transport/http/HttpTransporterFactory.java similarity index 75% rename from aether-transport-http/src/main/java/org/eclipse/aether/transport/http/HttpTransporterFactory.java rename to maven-resolver-transport-http/src/main/java/org/eclipse/aether/transport/http/HttpTransporterFactory.java index 2636bdf10..77d2141a9 100644 --- a/aether-transport-http/src/main/java/org/eclipse/aether/transport/http/HttpTransporterFactory.java +++ b/maven-resolver-transport-http/src/main/java/org/eclipse/aether/transport/http/HttpTransporterFactory.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.transport.http; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.inject.Inject; import javax.inject.Named; @@ -35,7 +44,7 @@ public final class HttpTransporterFactory private Logger logger = NullLoggerFactory.LOGGER; - private float priority = 5; + private float priority = 5.0f; /** * Creates an (uninitialized) instance of this transporter factory. Note: In case of manual instantiation diff --git a/aether-transport-http/src/main/java/org/eclipse/aether/transport/http/LocalState.java b/maven-resolver-transport-http/src/main/java/org/eclipse/aether/transport/http/LocalState.java similarity index 72% rename from aether-transport-http/src/main/java/org/eclipse/aether/transport/http/LocalState.java rename to maven-resolver-transport-http/src/main/java/org/eclipse/aether/transport/http/LocalState.java index 8275973c4..176b895ee 100644 --- a/aether-transport-http/src/main/java/org/eclipse/aether/transport/http/LocalState.java +++ b/maven-resolver-transport-http/src/main/java/org/eclipse/aether/transport/http/LocalState.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.transport.http; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Closeable; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; @@ -20,6 +29,7 @@ import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.repository.RemoteRepository; import org.eclipse.aether.transport.http.GlobalState.CompoundKey; +import org.eclipse.aether.util.ConfigUtils; /** * Container for HTTP-related state that can be shared across invocations of the transporter to optimize the @@ -29,6 +39,8 @@ final class LocalState implements Closeable { + private static final String CONFIG_PROP_WEBDAV = "aether.connector.http.webDav"; + private final GlobalState global; private final ClientConnectionManager connMgr; @@ -39,6 +51,8 @@ final class LocalState private final CompoundKey expectContinueKey; + private volatile boolean probed; + private volatile Boolean expectContinue; private volatile Boolean webDav; @@ -63,6 +77,10 @@ public LocalState( RepositorySystemSession session, RemoteRepository repo, SslCo expectContinueKey = new CompoundKey( repo.getUrl(), repo.getProxy() ); authSchemePools = global.getAuthSchemePools(); } + if ( !ConfigUtils.getBoolean( session, true, CONFIG_PROP_WEBDAV + '.' + repo.getId(), CONFIG_PROP_WEBDAV ) ) + { + webDav = false; + } } public ClientConnectionManager getConnectionManager() @@ -88,6 +106,16 @@ public void setUserToken( Object userToken ) } } + public boolean isProbed() + { + return probed; + } + + public void setProbed() + { + probed = true; + } + public boolean isExpectContinue() { if ( expectContinue == null ) @@ -107,14 +135,17 @@ public void setExpectContinue( boolean enabled ) } } - public Boolean getWebDav() + public boolean isWebDav() { - return webDav; + return Boolean.TRUE.equals( webDav ); } public void setWebDav( boolean webDav ) { - this.webDav = webDav; + if ( this.webDav == null ) + { + this.webDav = webDav; + } } public AuthScheme getAuthScheme( HttpHost host ) diff --git a/aether-transport-http/src/main/java/org/eclipse/aether/transport/http/SharingAuthCache.java b/maven-resolver-transport-http/src/main/java/org/eclipse/aether/transport/http/SharingAuthCache.java similarity index 71% rename from aether-transport-http/src/main/java/org/eclipse/aether/transport/http/SharingAuthCache.java rename to maven-resolver-transport-http/src/main/java/org/eclipse/aether/transport/http/SharingAuthCache.java index 93f8e940a..1264d0487 100644 --- a/aether-transport-http/src/main/java/org/eclipse/aether/transport/http/SharingAuthCache.java +++ b/maven-resolver-transport-http/src/main/java/org/eclipse/aether/transport/http/SharingAuthCache.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.transport.http; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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; diff --git a/aether-transport-http/src/main/java/org/eclipse/aether/transport/http/SharingHttpContext.java b/maven-resolver-transport-http/src/main/java/org/eclipse/aether/transport/http/SharingHttpContext.java similarity index 66% rename from aether-transport-http/src/main/java/org/eclipse/aether/transport/http/SharingHttpContext.java rename to maven-resolver-transport-http/src/main/java/org/eclipse/aether/transport/http/SharingHttpContext.java index 0b5861277..4464c2637 100644 --- a/aether-transport-http/src/main/java/org/eclipse/aether/transport/http/SharingHttpContext.java +++ b/maven-resolver-transport-http/src/main/java/org/eclipse/aether/transport/http/SharingHttpContext.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.transport.http; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Closeable; import org.apache.http.client.protocol.ClientContext; diff --git a/aether-transport-http/src/main/java/org/eclipse/aether/transport/http/SslConfig.java b/maven-resolver-transport-http/src/main/java/org/eclipse/aether/transport/http/SslConfig.java similarity index 77% rename from aether-transport-http/src/main/java/org/eclipse/aether/transport/http/SslConfig.java rename to maven-resolver-transport-http/src/main/java/org/eclipse/aether/transport/http/SslConfig.java index 8a0a96a2b..d9917964e 100644 --- a/aether-transport-http/src/main/java/org/eclipse/aether/transport/http/SslConfig.java +++ b/maven-resolver-transport-http/src/main/java/org/eclipse/aether/transport/http/SslConfig.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.transport.http; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Arrays; import javax.net.ssl.HostnameVerifier; diff --git a/aether-transport-http/src/main/java/org/eclipse/aether/transport/http/SslSocketFactory.java b/maven-resolver-transport-http/src/main/java/org/eclipse/aether/transport/http/SslSocketFactory.java similarity index 72% rename from aether-transport-http/src/main/java/org/eclipse/aether/transport/http/SslSocketFactory.java rename to maven-resolver-transport-http/src/main/java/org/eclipse/aether/transport/http/SslSocketFactory.java index 8c3e8053e..5189c87ed 100644 --- a/aether-transport-http/src/main/java/org/eclipse/aether/transport/http/SslSocketFactory.java +++ b/maven-resolver-transport-http/src/main/java/org/eclipse/aether/transport/http/SslSocketFactory.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.transport.http; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.net.ssl.HostnameVerifier; diff --git a/aether-transport-http/src/main/java/org/eclipse/aether/transport/http/UriUtils.java b/maven-resolver-transport-http/src/main/java/org/eclipse/aether/transport/http/UriUtils.java similarity index 67% rename from aether-transport-http/src/main/java/org/eclipse/aether/transport/http/UriUtils.java rename to maven-resolver-transport-http/src/main/java/org/eclipse/aether/transport/http/UriUtils.java index acec264a9..7bc19da1e 100644 --- a/aether-transport-http/src/main/java/org/eclipse/aether/transport/http/UriUtils.java +++ b/maven-resolver-transport-http/src/main/java/org/eclipse/aether/transport/http/UriUtils.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.transport.http; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.URI; import java.net.URISyntaxException; import java.util.ArrayList; diff --git a/aether-transport-http/src/main/java/org/eclipse/aether/transport/http/X509HostnameVerifierAdapter.java b/maven-resolver-transport-http/src/main/java/org/eclipse/aether/transport/http/X509HostnameVerifierAdapter.java similarity index 66% rename from aether-transport-http/src/main/java/org/eclipse/aether/transport/http/X509HostnameVerifierAdapter.java rename to maven-resolver-transport-http/src/main/java/org/eclipse/aether/transport/http/X509HostnameVerifierAdapter.java index b7c343f32..007f660d6 100644 --- a/aether-transport-http/src/main/java/org/eclipse/aether/transport/http/X509HostnameVerifierAdapter.java +++ b/maven-resolver-transport-http/src/main/java/org/eclipse/aether/transport/http/X509HostnameVerifierAdapter.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.transport.http; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.security.cert.X509Certificate; diff --git a/maven-resolver-transport-http/src/main/java/org/eclipse/aether/transport/http/package-info.java b/maven-resolver-transport-http/src/main/java/org/eclipse/aether/transport/http/package-info.java new file mode 100644 index 000000000..afed0b293 --- /dev/null +++ b/maven-resolver-transport-http/src/main/java/org/eclipse/aether/transport/http/package-info.java @@ -0,0 +1,25 @@ +// CHECKSTYLE_OFF: RegexpHeader +/** + * Support for downloads/uploads via the HTTP and HTTPS protocols. The current implementation is backed by + * Apache HttpClient. + */ +package org.eclipse.aether.transport.http; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ diff --git a/maven-resolver-transport-http/src/site/site.xml b/maven-resolver-transport-http/src/site/site.xml new file mode 100644 index 000000000..3a16bf98b --- /dev/null +++ b/maven-resolver-transport-http/src/site/site.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/aether-transport-http/src/test/java/org/eclipse/aether/transport/http/HttpServer.java b/maven-resolver-transport-http/src/test/java/org/eclipse/aether/transport/http/HttpServer.java similarity index 83% rename from aether-transport-http/src/test/java/org/eclipse/aether/transport/http/HttpServer.java rename to maven-resolver-transport-http/src/test/java/org/eclipse/aether/transport/http/HttpServer.java index be97ff1f9..cc85f39b7 100644 --- a/aether-transport-http/src/test/java/org/eclipse/aether/transport/http/HttpServer.java +++ b/maven-resolver-transport-http/src/test/java/org/eclipse/aether/transport/http/HttpServer.java @@ -1,20 +1,30 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.transport.http; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.io.UnsupportedEncodingException; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Collections; import java.util.Enumeration; @@ -39,7 +49,6 @@ import org.eclipse.jetty.server.ssl.SslSelectChannelConnector; import org.eclipse.jetty.util.B64Code; import org.eclipse.jetty.util.IO; -import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.URIUtil; import org.eclipse.jetty.util.ssl.SslContextFactory; import org.slf4j.Logger; @@ -72,9 +81,22 @@ public String toString() } + public enum WebDav + { + /** DAV header advertised, MKCOL required for missing parent directories */ + REQUIRED, + /** DAV header advertised, MKCOL supported but not required */ + OPTIONAL + } + public enum ExpectContinue { - FAIL, PROPER, BROKEN + /** reject request with "Expectation Failed" */ + FAIL, + /** send "Continue" only if request made it past authentication */ + PROPER, + /** send "Continue" before authentication has been checked */ + BROKEN } public enum ChecksumHeader @@ -84,11 +106,13 @@ public enum ChecksumHeader private static final Logger log = LoggerFactory.getLogger( HttpServer.class ); + private String serverHeader = "Dummy"; + private File repoDir; private boolean rangeSupport = true; - private boolean webDav; + private WebDav webDav; private ExpectContinue expectContinue = ExpectContinue.PROPER; @@ -100,6 +124,8 @@ public enum ChecksumHeader private Connector httpsConnector; + private String credentialEncoding = StandardCharsets.ISO_8859_1.name(); + private String username; private String password; @@ -146,14 +172,17 @@ public HttpServer addSslConnector() ssl.setTrustStorePassword( "client-pwd" ); ssl.setNeedClientAuth( true ); httpsConnector = new SslSelectChannelConnector( ssl ); - server.addConnector( httpsConnector ); - try + if ( server != null ) { - httpsConnector.start(); - } - catch ( Exception e ) - { - throw new IllegalStateException( e ); + server.addConnector( httpsConnector ); + try + { + httpsConnector.start(); + } + catch ( Exception e ) + { + throw new IllegalStateException( e ); + } } } return this; @@ -164,6 +193,12 @@ public List getLogEntries() return logEntries; } + public HttpServer setServer( String server ) + { + this.serverHeader = server; + return this; + } + public HttpServer setRepoDir( File repoDir ) { this.repoDir = repoDir; @@ -176,7 +211,7 @@ public HttpServer setRangeSupport( boolean rangeSupport ) return this; } - public HttpServer setWebDav( boolean webDav ) + public HttpServer setWebDav( WebDav webDav ) { this.webDav = webDav; return this; @@ -194,6 +229,12 @@ public HttpServer setChecksumHeader( ChecksumHeader checksumHeader ) return this; } + public HttpServer setCredentialEncoding( String credentialEncoding ) + { + this.credentialEncoding = ( credentialEncoding != null ) ? credentialEncoding : StandardCharsets.ISO_8859_1.name(); + return this; + } + public HttpServer setAuthentication( String username, String password ) { this.username = username; @@ -219,6 +260,7 @@ public HttpServer start() httpConnector = new SelectChannelConnector(); HandlerList handlers = new HandlerList(); + handlers.addHandler( new CommonHandler() ); handlers.addHandler( new LogHandler() ); handlers.addHandler( new ProxyAuthHandler() ); handlers.addHandler( new AuthHandler() ); @@ -227,6 +269,10 @@ public HttpServer start() server = new Server(); server.addConnector( httpConnector ); + if ( httpsConnector != null ) + { + server.addConnector( httpsConnector ); + } server.setHandler( handlers ); server.start(); @@ -245,6 +291,18 @@ public void stop() } } + private class CommonHandler + extends AbstractHandler + { + + public void handle( String target, Request req, HttpServletRequest request, HttpServletResponse response ) + throws IOException + { + response.setHeader( HttpHeaders.SERVER, serverHeader ); + } + + } + private class LogHandler extends AbstractHandler { @@ -313,7 +371,7 @@ public void handle( String target, Request req, HttpServletRequest request, Http response.setStatus( HttpServletResponse.SC_PRECONDITION_FAILED ); return; } - long offset = 0; + long offset = 0L; String range = request.getHeader( HttpHeaders.RANGE ); if ( range != null && rangeSupport ) { @@ -334,12 +392,12 @@ public void handle( String target, Request req, HttpServletRequest request, Http return; } } - response.setStatus( ( offset > 0 ) ? HttpServletResponse.SC_PARTIAL_CONTENT : HttpServletResponse.SC_OK ); + response.setStatus( ( offset > 0L ) ? HttpServletResponse.SC_PARTIAL_CONTENT : HttpServletResponse.SC_OK ); response.setDateHeader( HttpHeaders.LAST_MODIFIED, file.lastModified() ); response.setHeader( HttpHeaders.CONTENT_LENGTH, Long.toString( file.length() - offset ) ); - if ( offset > 0 ) + if ( offset > 0L ) { - response.setHeader( HttpHeaders.CONTENT_RANGE, "bytes " + offset + "-" + ( file.length() - 1 ) + response.setHeader( HttpHeaders.CONTENT_RANGE, "bytes " + offset + "-" + ( file.length() - 1L ) + "/" + file.length() ); } if ( checksumHeader != null ) @@ -359,7 +417,7 @@ public void handle( String target, Request req, HttpServletRequest request, Http FileInputStream is = new FileInputStream( file ); try { - if ( offset > 0 ) + if ( offset > 0L ) { long skipped = is.skip( offset ); while ( skipped < offset && is.read() >= 0 ) @@ -376,7 +434,7 @@ public void handle( String target, Request req, HttpServletRequest request, Http } else if ( HttpMethods.PUT.equals( req.getMethod() ) ) { - if ( !webDav ) + if ( !WebDav.REQUIRED.equals( webDav ) ) { file.getParentFile().mkdirs(); } @@ -408,14 +466,14 @@ else if ( HttpMethods.PUT.equals( req.getMethod() ) ) } else if ( HttpMethods.OPTIONS.equals( req.getMethod() ) ) { - if ( webDav ) + if ( webDav != null ) { response.setHeader( "DAV", "1,2" ); } response.setHeader( HttpHeaders.ALLOW, "GET, PUT, HEAD, OPTIONS" ); response.setStatus( HttpServletResponse.SC_OK ); } - else if ( webDav && "MKCOL".equals( req.getMethod() ) ) + else if ( webDav != null && "MKCOL".equals( req.getMethod() ) ) { if ( file.exists() ) { @@ -453,11 +511,17 @@ public void handle( String target, Request req, HttpServletRequest request, Http req.setHandled( true ); StringBuilder location = new StringBuilder( 128 ); String scheme = req.getParameter( "scheme" ); + String host = req.getParameter( "host" ); + String port = req.getParameter( "port" ); location.append( scheme != null ? scheme : req.getScheme() ); location.append( "://" ); - location.append( req.getServerName() ); + location.append( host != null ? host : req.getServerName() ); location.append( ":" ); - if ( "http".equalsIgnoreCase( scheme ) ) + if ( port != null ) + { + location.append( port ); + } + else if ( "http".equalsIgnoreCase( scheme ) ) { location.append( getHttpPort() ); } @@ -524,7 +588,7 @@ public void handle( String target, Request req, HttpServletRequest request, Http } - static boolean checkBasicAuth( String credentials, String username, String password ) + boolean checkBasicAuth( String credentials, String username, String password ) { if ( credentials != null ) { @@ -537,7 +601,7 @@ static boolean checkBasicAuth( String credentials, String username, String passw credentials = credentials.substring( space + 1 ); try { - credentials = B64Code.decode( credentials, StringUtil.__ISO_8859_1 ); + credentials = B64Code.decode( credentials, credentialEncoding ); } catch ( UnsupportedEncodingException e ) { diff --git a/aether-transport-http/src/test/java/org/eclipse/aether/transport/http/HttpTransporterTest.java b/maven-resolver-transport-http/src/test/java/org/eclipse/aether/transport/http/HttpTransporterTest.java similarity index 75% rename from aether-transport-http/src/test/java/org/eclipse/aether/transport/http/HttpTransporterTest.java rename to maven-resolver-transport-http/src/test/java/org/eclipse/aether/transport/http/HttpTransporterTest.java index 16fe0c4fe..7ca6bb042 100644 --- a/aether-transport-http/src/test/java/org/eclipse/aether/transport/http/HttpTransporterTest.java +++ b/maven-resolver-transport-http/src/test/java/org/eclipse/aether/transport/http/HttpTransporterTest.java @@ -1,29 +1,39 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.transport.http; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import java.io.File; import java.io.FileNotFoundException; +import java.net.ConnectException; import java.net.ServerSocket; import java.net.SocketTimeoutException; import java.net.URI; +import java.nio.charset.StandardCharsets; import java.util.HashMap; import java.util.Map; import java.util.concurrent.atomic.AtomicReference; import org.apache.http.client.HttpResponseException; import org.apache.http.conn.ConnectTimeoutException; -import org.apache.http.conn.HttpHostConnectException; import org.apache.http.pool.ConnPoolControl; import org.apache.http.pool.PoolStats; import org.eclipse.aether.ConfigurationProperties; @@ -64,6 +74,8 @@ public class HttpTransporterTest System.setProperty( "javax.net.ssl.keyStorePassword", "client-pwd" ); } + private static final String REPO_ID = "test"; + @Rule public TestName testName = new TestName(); @@ -83,7 +95,7 @@ public class HttpTransporterTest private RemoteRepository newRepo( String url ) { - return new RemoteRepository.Builder( "test", "default", url ).setAuthentication( auth ).setProxy( proxy ).build(); + return new RemoteRepository.Builder( REPO_ID, "default", url ).setAuthentication( auth ).setProxy( proxy ).build(); } private void newTransporter( String url ) @@ -264,11 +276,11 @@ public void testGet_ToMemory() GetTask task = new GetTask( URI.create( "repo/file.txt" ) ).setListener( listener ); transporter.get( task ); assertEquals( "test", task.getDataString() ); - assertEquals( 0, listener.dataOffset ); - assertEquals( 4, listener.dataLength ); + assertEquals( 0L, listener.dataOffset ); + assertEquals( 4L, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); - assertEquals( task.getDataString(), listener.baos.toString( "UTF-8" ) ); + assertEquals( task.getDataString(), new String( listener.baos.toByteArray(), StandardCharsets.UTF_8 ) ); } @Test @@ -280,11 +292,11 @@ public void testGet_ToFile() GetTask task = new GetTask( URI.create( "repo/file.txt" ) ).setDataFile( file ).setListener( listener ); transporter.get( task ); assertEquals( "test", TestFileUtils.readString( file ) ); - assertEquals( 0, listener.dataOffset ); - assertEquals( 4, listener.dataLength ); + assertEquals( 0L, listener.dataOffset ); + assertEquals( 4L, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); - assertEquals( "test", listener.baos.toString( "UTF-8" ) ); + assertEquals( "test", new String( listener.baos.toByteArray(), StandardCharsets.UTF_8 ) ); } @Test @@ -296,11 +308,11 @@ public void testGet_EmptyResource() GetTask task = new GetTask( URI.create( "repo/empty.txt" ) ).setDataFile( file ).setListener( listener ); transporter.get( task ); assertEquals( "", TestFileUtils.readString( file ) ); - assertEquals( 0, listener.dataOffset ); - assertEquals( 0, listener.dataLength ); + assertEquals( 0L, listener.dataOffset ); + assertEquals( 0L, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertEquals( 0, listener.progressedCount ); - assertEquals( "", listener.baos.toString( "UTF-8" ) ); + assertEquals( "", new String( listener.baos.toByteArray(), StandardCharsets.UTF_8 ) ); } @Test @@ -323,11 +335,11 @@ public void testGet_Authenticated() GetTask task = new GetTask( URI.create( "repo/file.txt" ) ).setListener( listener ); transporter.get( task ); assertEquals( "test", task.getDataString() ); - assertEquals( 0, listener.dataOffset ); - assertEquals( 4, listener.dataLength ); + assertEquals( 0L, listener.dataOffset ); + assertEquals( 4L, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); - assertEquals( task.getDataString(), listener.baos.toString( "UTF-8" ) ); + assertEquals( task.getDataString(), new String( listener.baos.toByteArray(), StandardCharsets.UTF_8 ) ); } @Test @@ -359,11 +371,11 @@ public void testGet_ProxyAuthenticated() GetTask task = new GetTask( URI.create( "repo/file.txt" ) ).setListener( listener ); transporter.get( task ); assertEquals( "test", task.getDataString() ); - assertEquals( 0, listener.dataOffset ); - assertEquals( 4, listener.dataLength ); + assertEquals( 0L, listener.dataOffset ); + assertEquals( 4L, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); - assertEquals( task.getDataString(), listener.baos.toString( "UTF-8" ) ); + assertEquals( task.getDataString(), new String( listener.baos.toByteArray(), StandardCharsets.UTF_8 ) ); } @Test @@ -395,28 +407,28 @@ public void testGet_SSL() GetTask task = new GetTask( URI.create( "repo/file.txt" ) ).setListener( listener ); transporter.get( task ); assertEquals( "test", task.getDataString() ); - assertEquals( 0, listener.dataOffset ); - assertEquals( 4, listener.dataLength ); + assertEquals( 0L, listener.dataOffset ); + assertEquals( 4L, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); - assertEquals( task.getDataString(), listener.baos.toString( "UTF-8" ) ); + assertEquals( task.getDataString(), new String( listener.baos.toByteArray(), StandardCharsets.UTF_8 ) ); } @Test public void testGet_WebDav() throws Exception { - httpServer.setWebDav( true ); + httpServer.setWebDav( HttpServer.WebDav.REQUIRED ); RecordingTransportListener listener = new RecordingTransportListener(); GetTask task = new GetTask( URI.create( "repo/dir/file.txt" ) ).setListener( listener ); ( (HttpTransporter) transporter ).getState().setWebDav( true ); transporter.get( task ); assertEquals( "test", task.getDataString() ); - assertEquals( 0, listener.dataOffset ); - assertEquals( 4, listener.dataLength ); + assertEquals( 0L, listener.dataOffset ); + assertEquals( 4L, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); - assertEquals( task.getDataString(), listener.baos.toString( "UTF-8" ) ); + assertEquals( task.getDataString(), new String( listener.baos.toByteArray(), StandardCharsets.UTF_8 ) ); assertEquals( httpServer.getLogEntries().toString(), 1, httpServer.getLogEntries().size() ); } @@ -429,11 +441,11 @@ public void testGet_Redirect() GetTask task = new GetTask( URI.create( "redirect/file.txt?scheme=https" ) ).setListener( listener ); transporter.get( task ); assertEquals( "test", task.getDataString() ); - assertEquals( 0, listener.dataOffset ); - assertEquals( 4, listener.dataLength ); + assertEquals( 0L, listener.dataOffset ); + assertEquals( 4L, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); - assertEquals( task.getDataString(), listener.baos.toString( "UTF-8" ) ); + assertEquals( task.getDataString(), new String( listener.baos.toByteArray(), StandardCharsets.UTF_8 ) ); } @Test @@ -445,11 +457,11 @@ public void testGet_Resume() GetTask task = new GetTask( URI.create( "repo/resume.txt" ) ).setDataFile( file, true ).setListener( listener ); transporter.get( task ); assertEquals( "resumable", TestFileUtils.readString( file ) ); - assertEquals( 1, listener.startedCount ); - assertEquals( 2, listener.dataOffset ); + assertEquals( 1L, listener.startedCount ); + assertEquals( 2L, listener.dataOffset ); assertEquals( 9, listener.dataLength ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); - assertEquals( "sumable", listener.baos.toString( "UTF-8" ) ); + assertEquals( "sumable", new String( listener.baos.toByteArray(), StandardCharsets.UTF_8 ) ); } @Test @@ -462,11 +474,11 @@ public void testGet_ResumeLocalContentsOutdated() GetTask task = new GetTask( URI.create( "repo/resume.txt" ) ).setDataFile( file, true ).setListener( listener ); transporter.get( task ); assertEquals( "resumable", TestFileUtils.readString( file ) ); - assertEquals( 1, listener.startedCount ); - assertEquals( 0, listener.dataOffset ); + assertEquals( 1L, listener.startedCount ); + assertEquals( 0L, listener.dataOffset ); assertEquals( 9, listener.dataLength ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); - assertEquals( "resumable", listener.baos.toString( "UTF-8" ) ); + assertEquals( "resumable", new String( listener.baos.toByteArray(), StandardCharsets.UTF_8 ) ); } @Test @@ -479,11 +491,11 @@ public void testGet_ResumeRangesNotSupportedByServer() GetTask task = new GetTask( URI.create( "repo/resume.txt" ) ).setDataFile( file, true ).setListener( listener ); transporter.get( task ); assertEquals( "resumable", TestFileUtils.readString( file ) ); - assertEquals( 1, listener.startedCount ); - assertEquals( 0, listener.dataOffset ); + assertEquals( 1L, listener.startedCount ); + assertEquals( 0L, listener.dataOffset ); assertEquals( 9, listener.dataLength ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); - assertEquals( "resumable", listener.baos.toString( "UTF-8" ) ); + assertEquals( "resumable", new String( listener.baos.toByteArray(), StandardCharsets.UTF_8 ) ); } @Test @@ -557,8 +569,8 @@ public void testGet_StartCancelled() { assertEquals( Transporter.ERROR_OTHER, transporter.classify( e ) ); } - assertEquals( 0, listener.dataOffset ); - assertEquals( 4, listener.dataLength ); + assertEquals( 0L, listener.dataOffset ); + assertEquals( 4L, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertEquals( 0, listener.progressedCount ); } @@ -579,8 +591,8 @@ public void testGet_ProgressCancelled() { assertEquals( Transporter.ERROR_OTHER, transporter.classify( e ) ); } - assertEquals( 0, listener.dataOffset ); - assertEquals( 4, listener.dataLength ); + assertEquals( 0L, listener.dataOffset ); + assertEquals( 4L, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertEquals( 1, listener.progressedCount ); } @@ -592,8 +604,8 @@ public void testPut_FromMemory() RecordingTransportListener listener = new RecordingTransportListener(); PutTask task = new PutTask( URI.create( "repo/file.txt" ) ).setListener( listener ).setDataString( "upload" ); transporter.put( task ); - assertEquals( 0, listener.dataOffset ); - assertEquals( 6, listener.dataLength ); + assertEquals( 0L, listener.dataOffset ); + assertEquals( 6L, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); assertEquals( "upload", TestFileUtils.readString( new File( repoDir, "file.txt" ) ) ); @@ -607,8 +619,8 @@ public void testPut_FromFile() RecordingTransportListener listener = new RecordingTransportListener(); PutTask task = new PutTask( URI.create( "repo/file.txt" ) ).setListener( listener ).setDataFile( file ); transporter.put( task ); - assertEquals( 0, listener.dataOffset ); - assertEquals( 6, listener.dataLength ); + assertEquals( 0L, listener.dataOffset ); + assertEquals( 6L, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); assertEquals( "upload", TestFileUtils.readString( new File( repoDir, "file.txt" ) ) ); @@ -621,8 +633,8 @@ public void testPut_EmptyResource() RecordingTransportListener listener = new RecordingTransportListener(); PutTask task = new PutTask( URI.create( "repo/file.txt" ) ).setListener( listener ); transporter.put( task ); - assertEquals( 0, listener.dataOffset ); - assertEquals( 0, listener.dataLength ); + assertEquals( 0L, listener.dataOffset ); + assertEquals( 0L, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertEquals( 0, listener.progressedCount ); assertEquals( "", TestFileUtils.readString( new File( repoDir, "file.txt" ) ) ); @@ -636,8 +648,8 @@ public void testPut_EncodedResourcePath() PutTask task = new PutTask( URI.create( "repo/some%20space.txt" ) ).setListener( listener ).setDataString( "OK" ); transporter.put( task ); - assertEquals( 0, listener.dataOffset ); - assertEquals( 2, listener.dataLength ); + assertEquals( 0L, listener.dataOffset ); + assertEquals( 2L, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); assertEquals( "OK", TestFileUtils.readString( new File( repoDir, "some space.txt" ) ) ); @@ -653,8 +665,8 @@ public void testPut_Authenticated_ExpectContinue() RecordingTransportListener listener = new RecordingTransportListener(); PutTask task = new PutTask( URI.create( "repo/file.txt" ) ).setListener( listener ).setDataString( "upload" ); transporter.put( task ); - assertEquals( 0, listener.dataOffset ); - assertEquals( 6, listener.dataLength ); + assertEquals( 0L, listener.dataOffset ); + assertEquals( 6L, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); assertEquals( "upload", TestFileUtils.readString( new File( repoDir, "file.txt" ) ) ); @@ -671,8 +683,8 @@ public void testPut_Authenticated_ExpectContinueBroken() RecordingTransportListener listener = new RecordingTransportListener(); PutTask task = new PutTask( URI.create( "repo/file.txt" ) ).setListener( listener ).setDataString( "upload" ); transporter.put( task ); - assertEquals( 0, listener.dataOffset ); - assertEquals( 6, listener.dataLength ); + assertEquals( 0L, listener.dataOffset ); + assertEquals( 6L, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); assertEquals( "upload", TestFileUtils.readString( new File( repoDir, "file.txt" ) ) ); @@ -689,8 +701,8 @@ public void testPut_Authenticated_ExpectContinueRejected() RecordingTransportListener listener = new RecordingTransportListener(); PutTask task = new PutTask( URI.create( "repo/file.txt" ) ).setListener( listener ).setDataString( "upload" ); transporter.put( task ); - assertEquals( 0, listener.dataOffset ); - assertEquals( 6, listener.dataLength ); + assertEquals( 0L, listener.dataOffset ); + assertEquals( 6L, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); assertEquals( "upload", TestFileUtils.readString( new File( repoDir, "file.txt" ) ) ); @@ -710,8 +722,8 @@ public void testPut_Authenticated_ExpectContinueRejected_ExplicitlyConfiguredHea RecordingTransportListener listener = new RecordingTransportListener(); PutTask task = new PutTask( URI.create( "repo/file.txt" ) ).setListener( listener ).setDataString( "upload" ); transporter.put( task ); - assertEquals( 0, listener.dataOffset ); - assertEquals( 6, listener.dataLength ); + assertEquals( 0L, listener.dataOffset ); + assertEquals( 6L, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); assertEquals( "upload", TestFileUtils.readString( new File( repoDir, "file.txt" ) ) ); @@ -749,8 +761,8 @@ public void testPut_ProxyAuthenticated() RecordingTransportListener listener = new RecordingTransportListener(); PutTask task = new PutTask( URI.create( "repo/file.txt" ) ).setListener( listener ).setDataString( "upload" ); transporter.put( task ); - assertEquals( 0, listener.dataOffset ); - assertEquals( 6, listener.dataLength ); + assertEquals( 0L, listener.dataOffset ); + assertEquals( 6L, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); assertEquals( "upload", TestFileUtils.readString( new File( repoDir, "file.txt" ) ) ); @@ -790,8 +802,8 @@ public void testPut_SSL() RecordingTransportListener listener = new RecordingTransportListener(); PutTask task = new PutTask( URI.create( "repo/file.txt" ) ).setListener( listener ).setDataString( "upload" ); transporter.put( task ); - assertEquals( 0, listener.dataOffset ); - assertEquals( 6, listener.dataLength ); + assertEquals( 0L, listener.dataOffset ); + assertEquals( 6L, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); assertEquals( "upload", TestFileUtils.readString( new File( repoDir, "file.txt" ) ) ); @@ -801,13 +813,13 @@ public void testPut_SSL() public void testPut_WebDav() throws Exception { - httpServer.setWebDav( true ); + httpServer.setWebDav( HttpServer.WebDav.REQUIRED ); RecordingTransportListener listener = new RecordingTransportListener(); PutTask task = new PutTask( URI.create( "repo/dir1/dir2/file.txt" ) ).setListener( listener ).setDataString( "upload" ); transporter.put( task ); - assertEquals( 0, listener.dataOffset ); - assertEquals( 6, listener.dataLength ); + assertEquals( 0L, listener.dataOffset ); + assertEquals( 6L, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); assertEquals( "upload", TestFileUtils.readString( new File( repoDir, "dir1/dir2/file.txt" ) ) ); @@ -823,6 +835,62 @@ public void testPut_WebDav() assertEquals( "PUT", httpServer.getLogEntries().get( 4 ).method ); } + @Test + public void testPut_WebDavOptional_ManuallyDisabled() + throws Exception + { + session.setConfigProperty( "aether.connector.http.webDav." + REPO_ID, "false" ); + httpServer.setWebDav( HttpServer.WebDav.OPTIONAL ); + newTransporter( httpServer.getHttpUrl() ); + RecordingTransportListener listener = new RecordingTransportListener(); + PutTask task = + new PutTask( URI.create( "repo/dir1/dir2/file.txt" ) ).setListener( listener ).setDataString( "upload" ); + transporter.put( task ); + assertEquals( 0L, listener.dataOffset ); + assertEquals( 6L, listener.dataLength ); + assertEquals( 1, listener.startedCount ); + assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); + assertEquals( "upload", TestFileUtils.readString( new File( repoDir, "dir1/dir2/file.txt" ) ) ); + + assertEquals( httpServer.getLogEntries().toString(), 2, httpServer.getLogEntries().size() ); + assertEquals( "OPTIONS", httpServer.getLogEntries().get( 0 ).method ); + assertEquals( "PUT", httpServer.getLogEntries().get( 1 ).method ); + } + + @Test + public void testPut_WebDavOptional_AutomaticallyDisabled_Artifactory() + throws Exception + { + testPut_WebDavOptional_AutomaticallyDisabled( "Artifactory/3.3.0" ); + } + + @Test + public void testPut_WebDavOptional_AutomaticallyDisabled_Nexus() + throws Exception + { + testPut_WebDavOptional_AutomaticallyDisabled( "Nexus/2.9.0-02" ); + } + + private void testPut_WebDavOptional_AutomaticallyDisabled( String server ) + throws Exception + { + httpServer.setServer( server ); + httpServer.setWebDav( HttpServer.WebDav.OPTIONAL ); + RecordingTransportListener listener = new RecordingTransportListener(); + PutTask task = + new PutTask( URI.create( "repo/dir1/dir2/file.txt" ) ).setListener( listener ).setDataString( "upload" ); + transporter.put( task ); + assertEquals( 0L, listener.dataOffset ); + assertEquals( 6L, listener.dataLength ); + assertEquals( 1, listener.startedCount ); + assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); + assertEquals( "upload", TestFileUtils.readString( new File( repoDir, "dir1/dir2/file.txt" ) ) ); + + assertEquals( httpServer.getLogEntries().toString(), 2, httpServer.getLogEntries().size() ); + assertEquals( "OPTIONS", httpServer.getLogEntries().get( 0 ).method ); + assertEquals( "PUT", httpServer.getLogEntries().get( 1 ).method ); + } + @Test public void testPut_FileHandleLeak() throws Exception @@ -869,8 +937,8 @@ public void testPut_StartCancelled() { assertEquals( Transporter.ERROR_OTHER, transporter.classify( e ) ); } - assertEquals( 0, listener.dataOffset ); - assertEquals( 6, listener.dataLength ); + assertEquals( 0L, listener.dataOffset ); + assertEquals( 6L, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertEquals( 0, listener.progressedCount ); } @@ -891,8 +959,8 @@ public void testPut_ProgressCancelled() { assertEquals( Transporter.ERROR_OTHER, transporter.classify( e ) ); } - assertEquals( 0, listener.dataOffset ); - assertEquals( 6, listener.dataLength ); + assertEquals( 0L, listener.dataOffset ); + assertEquals( 6L, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertEquals( 1, listener.progressedCount ); } @@ -912,7 +980,7 @@ public void testGetPut_AuthCache() assertEquals( 1, listener.startedCount ); } - @Test( timeout = 10000 ) + @Test( timeout = 20000L ) public void testConcurrency() throws Exception { @@ -959,7 +1027,7 @@ public void run() assertNull( String.valueOf( error.get() ), error.get() ); } - @Test( timeout = 1000 ) + @Test( timeout = 1000L ) public void testConnectTimeout() throws Exception { @@ -975,13 +1043,13 @@ public void testConnectTimeout() { assertEquals( Transporter.ERROR_OTHER, transporter.classify( e ) ); } - catch ( HttpHostConnectException e ) + catch ( ConnectException e ) { assertEquals( Transporter.ERROR_OTHER, transporter.classify( e ) ); } } - @Test( timeout = 1000 ) + @Test( timeout = 1000L ) public void testRequestTimeout() throws Exception { @@ -1041,6 +1109,135 @@ public void testCustomHeaders() } } + @Test + public void testCredentialEncoding_Default() + throws Exception + { + testCredentialEncoding( null ); + } + + @Test + public void testCredentialEncoding_Utf8() + throws Exception + { + testCredentialEncoding( StandardCharsets.UTF_8.name() ); + } + + private void testCredentialEncoding( String encoding ) + throws Exception + { + session.setConfigProperty( ConfigurationProperties.HTTP_CREDENTIAL_ENCODING, encoding ); + String username = "testuser", password = "\u00e4\u00f6\u00fc"; + httpServer.setAuthentication( username, password ); + httpServer.setCredentialEncoding( encoding ); + auth = new AuthenticationBuilder().addUsername( username ).addPassword( password ).build(); + newTransporter( httpServer.getHttpUrl() ); + transporter.get( new GetTask( URI.create( "repo/file.txt" ) ) ); + } + + @Test + public void testServerAuthScope_FollowsSslRedirect() + throws Exception + { + String username = "testuser", password = "testpass"; + httpServer.setAuthentication( username, password ); + httpServer.addSslConnector(); + auth = new AuthenticationBuilder().addUsername( username ).addPassword( password ).build(); + newTransporter( httpServer.getHttpUrl() ); + transporter.get( new GetTask( URI.create( "redirect/file.txt?scheme=https" ) ) ); + } + + @Test + public void testServerAuthScope_FollowsRedirectToDifferentHost_EnabledByRepoId() + throws Exception + { + session.setConfigProperty( ConfigurationProperties.HTTP_REDIRECTED_AUTHENTICATION + "." + REPO_ID, "true" ); + String username = "testuser", password = "testpass"; + httpServer.setAuthentication( username, password ); + auth = new AuthenticationBuilder().addUsername( username ).addPassword( password ).build(); + proxy = new Proxy( Proxy.TYPE_HTTP, httpServer.getHost(), httpServer.getHttpPort() ); + newTransporter( "http://redirect.localhost:1/" ); + GetTask task = new GetTask( URI.create( "redirect/file.txt?host=" + httpServer.getHost() ) ); + transporter.get( task ); + assertEquals( "test", task.getDataString() ); + } + + @Test + public void testServerAuthScope_FollowsRedirectToDifferentHost_EnabledByHostName() + throws Exception + { + session.setConfigProperty( ConfigurationProperties.HTTP_REDIRECTED_AUTHENTICATION, " REDIRECT.localhost , foo" ); + String username = "testuser", password = "testpass"; + httpServer.setAuthentication( username, password ); + auth = new AuthenticationBuilder().addUsername( username ).addPassword( password ).build(); + proxy = new Proxy( Proxy.TYPE_HTTP, httpServer.getHost(), httpServer.getHttpPort() ); + newTransporter( "http://redirect.localhost:1/" ); + GetTask task = new GetTask( URI.create( "redirect/file.txt?host=" + httpServer.getHost() ) ); + transporter.get( task ); + assertEquals( "test", task.getDataString() ); + } + + @Test + public void testServerAuthScope_FollowsRedirectToDifferentHost_DisabledByDefault() + throws Exception + { + String username = "testuser", password = "testpass"; + httpServer.setAuthentication( username, password ); + auth = new AuthenticationBuilder().addUsername( username ).addPassword( password ).build(); + proxy = new Proxy( Proxy.TYPE_HTTP, httpServer.getHost(), httpServer.getHttpPort() ); + newTransporter( "http://redirect.localhost:1/" ); + GetTask task = new GetTask( URI.create( "redirect/file.txt?host=" + httpServer.getHost() ) ); + try + { + transporter.get( task ); + fail( "Server auth must not be used for redirect destination" ); + } + catch ( HttpResponseException e ) + { + assertEquals( 401, e.getStatusCode() ); + } + } + + @Test + public void testServerAuthScope_NotUsedForProxy() + throws Exception + { + String username = "testuser", password = "testpass"; + httpServer.setProxyAuthentication( username, password ); + auth = new AuthenticationBuilder().addUsername( username ).addPassword( password ).build(); + proxy = new Proxy( Proxy.TYPE_HTTP, httpServer.getHost(), httpServer.getHttpPort() ); + newTransporter( "http://" + httpServer.getHost() + ":12/" ); + try + { + transporter.get( new GetTask( URI.create( "repo/file.txt" ) ) ); + fail( "Server auth must not be used as proxy auth" ); + } + catch ( HttpResponseException e ) + { + assertEquals( 407, e.getStatusCode() ); + } + } + + @Test + public void testProxyAuthScope_NotUsedForServer() + throws Exception + { + String username = "testuser", password = "testpass"; + httpServer.setAuthentication( username, password ); + Authentication auth = new AuthenticationBuilder().addUsername( username ).addPassword( password ).build(); + proxy = new Proxy( Proxy.TYPE_HTTP, httpServer.getHost(), httpServer.getHttpPort(), auth ); + newTransporter( "http://" + httpServer.getHost() + ":12/" ); + try + { + transporter.get( new GetTask( URI.create( "repo/file.txt" ) ) ); + fail( "Proxy auth must not be used as server auth" ); + } + catch ( HttpResponseException e ) + { + assertEquals( 401, e.getStatusCode() ); + } + } + @Test public void testAuthSchemeReuse() throws Exception diff --git a/aether-transport-http/src/test/java/org/eclipse/aether/transport/http/RecordingTransportListener.java b/maven-resolver-transport-http/src/test/java/org/eclipse/aether/transport/http/RecordingTransportListener.java similarity index 61% rename from aether-transport-http/src/test/java/org/eclipse/aether/transport/http/RecordingTransportListener.java rename to maven-resolver-transport-http/src/test/java/org/eclipse/aether/transport/http/RecordingTransportListener.java index 8558d3203..d88a32081 100644 --- a/aether-transport-http/src/test/java/org/eclipse/aether/transport/http/RecordingTransportListener.java +++ b/maven-resolver-transport-http/src/test/java/org/eclipse/aether/transport/http/RecordingTransportListener.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.transport.http; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.ByteArrayOutputStream; import java.nio.ByteBuffer; diff --git a/aether-transport-http/src/test/java/org/eclipse/aether/transport/http/UriUtilsTest.java b/maven-resolver-transport-http/src/test/java/org/eclipse/aether/transport/http/UriUtilsTest.java similarity index 85% rename from aether-transport-http/src/test/java/org/eclipse/aether/transport/http/UriUtilsTest.java rename to maven-resolver-transport-http/src/test/java/org/eclipse/aether/transport/http/UriUtilsTest.java index b26d53a91..e3ea9fa76 100644 --- a/aether-transport-http/src/test/java/org/eclipse/aether/transport/http/UriUtilsTest.java +++ b/maven-resolver-transport-http/src/test/java/org/eclipse/aether/transport/http/UriUtilsTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.transport.http; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import java.net.URI; diff --git a/maven-resolver-transport-http/src/test/resources/logback.xml b/maven-resolver-transport-http/src/test/resources/logback.xml new file mode 100644 index 000000000..699084035 --- /dev/null +++ b/maven-resolver-transport-http/src/test/resources/logback.xml @@ -0,0 +1,35 @@ + + + + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + + + diff --git a/aether-transport-http/src/test/resources/ssl/README.txt b/maven-resolver-transport-http/src/test/resources/ssl/README.txt similarity index 100% rename from aether-transport-http/src/test/resources/ssl/README.txt rename to maven-resolver-transport-http/src/test/resources/ssl/README.txt diff --git a/aether-transport-http/src/test/resources/ssl/client-store b/maven-resolver-transport-http/src/test/resources/ssl/client-store similarity index 100% rename from aether-transport-http/src/test/resources/ssl/client-store rename to maven-resolver-transport-http/src/test/resources/ssl/client-store diff --git a/aether-transport-http/src/test/resources/ssl/server-store b/maven-resolver-transport-http/src/test/resources/ssl/server-store similarity index 100% rename from aether-transport-http/src/test/resources/ssl/server-store rename to maven-resolver-transport-http/src/test/resources/ssl/server-store diff --git a/aether-transport-wagon/pom.xml b/maven-resolver-transport-wagon/pom.xml similarity index 56% rename from aether-transport-wagon/pom.xml rename to maven-resolver-transport-wagon/pom.xml index c021c935e..0fdacb609 100644 --- a/aether-transport-wagon/pom.xml +++ b/maven-resolver-transport-wagon/pom.xml @@ -1,49 +1,57 @@ - + 4.0.0 - org.eclipse.aether - aether - 1.0.0.v20140518 + org.apache.maven.resolver + maven-resolver + 1.2.0-SNAPSHOT - aether-transport-wagon + maven-resolver-transport-wagon - Aether Transport Wagon + Maven Artifact Resolver Transport Wagon A transport implementation based on Maven Wagon. - 1.0 - org.eclipse.aether.transport.wagon + 2.10 - org.eclipse.aether - aether-api + org.apache.maven.resolver + maven-resolver-api - org.eclipse.aether - aether-spi + org.apache.maven.resolver + maven-resolver-spi - org.eclipse.aether - aether-util + org.apache.maven.resolver + maven-resolver-util org.apache.maven.wagon @@ -65,13 +73,13 @@ org.codehaus.plexus plexus-classworlds - 2.4 + 2.5.2 true org.codehaus.plexus plexus-utils - 2.1 + 3.0.24 true @@ -92,22 +100,18 @@ org.hamcrest - hamcrest-library + hamcrest-core test - org.eclipse.aether - aether-test-util + org.apache.maven.resolver + maven-resolver-test-util test - - org.codehaus.mojo - animal-sniffer-maven-plugin - org.codehaus.plexus plexus-component-metadata @@ -116,10 +120,6 @@ org.eclipse.sisu sisu-maven-plugin - - org.apache.felix - maven-bundle-plugin - diff --git a/aether-transport-wagon/src/main/java/org/eclipse/aether/internal/transport/wagon/PlexusWagonConfigurator.java b/maven-resolver-transport-wagon/src/main/java/org/eclipse/aether/internal/transport/wagon/PlexusWagonConfigurator.java similarity index 81% rename from aether-transport-wagon/src/main/java/org/eclipse/aether/internal/transport/wagon/PlexusWagonConfigurator.java rename to maven-resolver-transport-wagon/src/main/java/org/eclipse/aether/internal/transport/wagon/PlexusWagonConfigurator.java index e6a006a0a..808d2b717 100644 --- a/aether-transport-wagon/src/main/java/org/eclipse/aether/internal/transport/wagon/PlexusWagonConfigurator.java +++ b/maven-resolver-transport-wagon/src/main/java/org/eclipse/aether/internal/transport/wagon/PlexusWagonConfigurator.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.transport.wagon; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 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.PlexusContainer; import org.codehaus.plexus.classworlds.realm.ClassRealm; diff --git a/aether-transport-wagon/src/main/java/org/eclipse/aether/internal/transport/wagon/PlexusWagonProvider.java b/maven-resolver-transport-wagon/src/main/java/org/eclipse/aether/internal/transport/wagon/PlexusWagonProvider.java similarity index 68% rename from aether-transport-wagon/src/main/java/org/eclipse/aether/internal/transport/wagon/PlexusWagonProvider.java rename to maven-resolver-transport-wagon/src/main/java/org/eclipse/aether/internal/transport/wagon/PlexusWagonProvider.java index 5ca6a6e86..6f40f0d3b 100644 --- a/aether-transport-wagon/src/main/java/org/eclipse/aether/internal/transport/wagon/PlexusWagonProvider.java +++ b/maven-resolver-transport-wagon/src/main/java/org/eclipse/aether/internal/transport/wagon/PlexusWagonProvider.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.internal.transport.wagon; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 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.PlexusContainer; import org.codehaus.plexus.component.annotations.Component; diff --git a/maven-resolver-transport-wagon/src/main/java/org/eclipse/aether/internal/transport/wagon/package-info.java b/maven-resolver-transport-wagon/src/main/java/org/eclipse/aether/internal/transport/wagon/package-info.java new file mode 100644 index 000000000..abe358bcb --- /dev/null +++ b/maven-resolver-transport-wagon/src/main/java/org/eclipse/aether/internal/transport/wagon/package-info.java @@ -0,0 +1,25 @@ +// CHECKSTYLE_OFF: RegexpHeader +/** + * Integration with the Plexus IoC container which is the native runtime environment expected by many wagon + * implementations. + */ +package org.eclipse.aether.internal.transport.wagon; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ diff --git a/maven-resolver-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/WagonCancelledException.java b/maven-resolver-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/WagonCancelledException.java new file mode 100644 index 000000000..105917f60 --- /dev/null +++ b/maven-resolver-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/WagonCancelledException.java @@ -0,0 +1,45 @@ +package org.eclipse.aether.transport.wagon; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import org.eclipse.aether.transfer.TransferCancelledException; + +/** + * Unchecked exception to allow the checked {@link TransferCancelledException} to bubble up from a wagon. + */ +class WagonCancelledException + extends RuntimeException +{ + + public WagonCancelledException( TransferCancelledException cause ) + { + super( cause ); + } + + public static Exception unwrap( Exception e ) + { + if ( e instanceof WagonCancelledException ) + { + e = (Exception) e.getCause(); + } + return e; + } + +} diff --git a/maven-resolver-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/WagonConfigurator.java b/maven-resolver-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/WagonConfigurator.java new file mode 100644 index 000000000..42399cba9 --- /dev/null +++ b/maven-resolver-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/WagonConfigurator.java @@ -0,0 +1,40 @@ +package org.eclipse.aether.transport.wagon; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 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; + +/** + * A component to configure wagon instances with provider-specific parameters. + */ +public interface WagonConfigurator +{ + + /** + * Configures the specified wagon instance with the given configuration. + * + * @param wagon The wagon instance to configure, must not be {@code null}. + * @param configuration The configuration to apply to the wagon instance, must not be {@code null}. + * @throws Exception If the configuration could not be applied to the wagon. + */ + void configure( Wagon wagon, Object configuration ) + throws Exception; + +} diff --git a/aether-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/WagonProvider.java b/maven-resolver-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/WagonProvider.java similarity index 54% rename from aether-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/WagonProvider.java rename to maven-resolver-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/WagonProvider.java index c8e9166af..77bf9d6b0 100644 --- a/aether-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/WagonProvider.java +++ b/maven-resolver-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/WagonProvider.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.transport.wagon; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 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; /** diff --git a/aether-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/WagonTransferListener.java b/maven-resolver-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/WagonTransferListener.java similarity index 64% rename from aether-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/WagonTransferListener.java rename to maven-resolver-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/WagonTransferListener.java index e18cc6193..3c3120e4c 100644 --- a/aether-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/WagonTransferListener.java +++ b/maven-resolver-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/WagonTransferListener.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.transport.wagon; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.nio.ByteBuffer; import org.apache.maven.wagon.events.TransferEvent; diff --git a/aether-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/WagonTransporter.java b/maven-resolver-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/WagonTransporter.java similarity index 90% rename from aether-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/WagonTransporter.java rename to maven-resolver-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/WagonTransporter.java index 7e4feae3b..635f211e5 100644 --- a/aether-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/WagonTransporter.java +++ b/maven-resolver-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/WagonTransporter.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.transport.wagon; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Closeable; import java.io.File; import java.io.FileInputStream; @@ -448,6 +457,7 @@ private void delTempFile( File path ) { if ( path != null && !path.delete() && path.exists() ) { + path.deleteOnExit(); logger.debug( "Could not delete temorary file " + path ); } } @@ -495,7 +505,7 @@ public void close() private interface TaskRunner { - public void run( Wagon wagon ) + void run( Wagon wagon ) throws Exception; } @@ -585,23 +595,22 @@ public void run( Wagon wagon ) private void readTempFile( File dst ) throws IOException { - FileInputStream fis = new FileInputStream( dst ); + FileInputStream in = null; + OutputStream out = null; try { - OutputStream os = task.newOutputStream(); - try - { - copy( os, fis ); - os.close(); - } - finally - { - close( os ); - } + in = new FileInputStream( dst ); + out = task.newOutputStream(); + copy( out, in ); + out.close(); + out = null; + in.close(); + in = null; } finally { - close( fis ); + close( out ); + close( in ); } } @@ -625,11 +634,14 @@ public void run( Wagon wagon ) File file = task.getDataFile(); if ( file == null && wagon instanceof StreamingWagon ) { - InputStream src = task.newInputStream(); + InputStream src = null; try { + src = task.newInputStream(); // StreamingWagon uses an internal buffer on src input stream. ( (StreamingWagon) wagon ).putFromStream( src, dst, task.getDataLength(), -1 ); + src.close(); + src = null; } finally { @@ -656,34 +668,31 @@ public void run( Wagon wagon ) private File createTempFile() throws IOException { - File tmp = newTempFile(); + File tmp = null; + FileOutputStream out = null; + InputStream in = null; try { - FileOutputStream fos = new FileOutputStream( tmp ); - try - { - InputStream is = task.newInputStream(); - try - { - copy( fos, is ); - fos.close(); - } - finally - { - close( is ); - } - } - finally - { - close( fos ); - } + tmp = newTempFile(); + in = task.newInputStream(); + out = new FileOutputStream( tmp ); + copy( out, in ); + out.close(); + out = null; + in.close(); + in = null; + return tmp; } catch ( IOException e ) { delTempFile( tmp ); throw e; } - return tmp; + finally + { + close( out ); + close( in ); + } } } diff --git a/aether-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/WagonTransporterFactory.java b/maven-resolver-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/WagonTransporterFactory.java similarity index 83% rename from aether-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/WagonTransporterFactory.java rename to maven-resolver-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/WagonTransporterFactory.java index 5d913583c..bff3406ec 100644 --- a/aether-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/WagonTransporterFactory.java +++ b/maven-resolver-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/WagonTransporterFactory.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.transport.wagon; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.inject.Inject; import javax.inject.Named; @@ -40,7 +49,7 @@ public final class WagonTransporterFactory private WagonConfigurator wagonConfigurator; - private float priority = -1; + private float priority = -1.0f; /** * Creates an (uninitialized) instance of this transporter factory. Note: In case of manual instantiation diff --git a/maven-resolver-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/package-info.java b/maven-resolver-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/package-info.java new file mode 100644 index 000000000..05edfe96d --- /dev/null +++ b/maven-resolver-transport-wagon/src/main/java/org/eclipse/aether/transport/wagon/package-info.java @@ -0,0 +1,24 @@ +// CHECKSTYLE_OFF: RegexpHeader +/** + * Support for downloads/uploads using Apache Maven Wagon. + */ +package org.eclipse.aether.transport.wagon; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ diff --git a/maven-resolver-transport-wagon/src/site/site.xml b/maven-resolver-transport-wagon/src/site/site.xml new file mode 100644 index 000000000..3a16bf98b --- /dev/null +++ b/maven-resolver-transport-wagon/src/site/site.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/aether-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/AbstractWagonTransporterTest.java b/maven-resolver-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/AbstractWagonTransporterTest.java similarity index 88% rename from aether-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/AbstractWagonTransporterTest.java rename to maven-resolver-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/AbstractWagonTransporterTest.java index d3f205ba7..2a58de3bd 100644 --- a/aether-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/AbstractWagonTransporterTest.java +++ b/maven-resolver-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/AbstractWagonTransporterTest.java @@ -1,21 +1,31 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.transport.wagon; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import java.io.File; import java.net.URI; +import java.nio.charset.StandardCharsets; import java.util.Map; import java.util.UUID; @@ -182,11 +192,11 @@ public void testGet_ToMemory() GetTask task = new GetTask( URI.create( "file.txt" ) ).setListener( listener ); transporter.get( task ); assertEquals( "test", task.getDataString() ); - assertEquals( 0, listener.dataOffset ); - assertEquals( 4, listener.dataLength ); + assertEquals( 0L, listener.dataOffset ); + assertEquals( 4L, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); - assertEquals( task.getDataString(), listener.baos.toString( "UTF-8" ) ); + assertEquals( task.getDataString(), new String( listener.baos.toByteArray(), StandardCharsets.UTF_8 ) ); } @Test @@ -198,11 +208,11 @@ public void testGet_ToFile() GetTask task = new GetTask( URI.create( "file.txt" ) ).setDataFile( file ).setListener( listener ); transporter.get( task ); assertEquals( "test", TestFileUtils.readString( file ) ); - assertEquals( 0, listener.dataOffset ); - assertEquals( 4, listener.dataLength ); + assertEquals( 0L, listener.dataOffset ); + assertEquals( 4L, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); - assertEquals( "test", listener.baos.toString( "UTF-8" ) ); + assertEquals( "test", new String( listener.baos.toByteArray(), StandardCharsets.UTF_8 ) ); } @Test @@ -215,11 +225,11 @@ public void testGet_EmptyResource() GetTask task = new GetTask( URI.create( "empty.txt" ) ).setDataFile( file ).setListener( listener ); transporter.get( task ); assertEquals( "", TestFileUtils.readString( file ) ); - assertEquals( 0, listener.dataOffset ); - assertEquals( 0, listener.dataLength ); + assertEquals( 0L, listener.dataOffset ); + assertEquals( 0L, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertEquals( 0, listener.progressedCount ); - assertEquals( "", listener.baos.toString( "UTF-8" ) ); + assertEquals( "", new String( listener.baos.toByteArray(), StandardCharsets.UTF_8 ) ); } @Test @@ -301,8 +311,8 @@ public void testGet_ProgressCancelled() { assertEquals( Transporter.ERROR_OTHER, transporter.classify( e ) ); } - assertEquals( 0, listener.dataOffset ); - assertEquals( 4, listener.dataLength ); + assertEquals( 0L, listener.dataOffset ); + assertEquals( 4L, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertEquals( 1, listener.progressedCount ); } @@ -314,8 +324,8 @@ public void testPut_FromMemory() RecordingTransportListener listener = new RecordingTransportListener(); PutTask task = new PutTask( URI.create( "file.txt" ) ).setListener( listener ).setDataString( "upload" ); transporter.put( task ); - assertEquals( 0, listener.dataOffset ); - assertEquals( 6, listener.dataLength ); + assertEquals( 0L, listener.dataOffset ); + assertEquals( 6L, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); assertEquals( "upload", fs.get( "file.txt" ) ); @@ -329,8 +339,8 @@ public void testPut_FromFile() RecordingTransportListener listener = new RecordingTransportListener(); PutTask task = new PutTask( URI.create( "file.txt" ) ).setListener( listener ).setDataFile( file ); transporter.put( task ); - assertEquals( 0, listener.dataOffset ); - assertEquals( 6, listener.dataLength ); + assertEquals( 0L, listener.dataOffset ); + assertEquals( 6L, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); assertEquals( "upload", fs.get( "file.txt" ) ); @@ -343,8 +353,8 @@ public void testPut_EmptyResource() RecordingTransportListener listener = new RecordingTransportListener(); PutTask task = new PutTask( URI.create( "file.txt" ) ).setListener( listener ); transporter.put( task ); - assertEquals( 0, listener.dataOffset ); - assertEquals( 0, listener.dataLength ); + assertEquals( 0L, listener.dataOffset ); + assertEquals( 0L, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertEquals( 0, listener.progressedCount ); assertEquals( "", fs.get( "file.txt" ) ); @@ -358,8 +368,8 @@ public void testPut_NonExistentParentDir() PutTask task = new PutTask( URI.create( "dir/sub/dir/file.txt" ) ).setListener( listener ).setDataString( "upload" ); transporter.put( task ); - assertEquals( 0, listener.dataOffset ); - assertEquals( 6, listener.dataLength ); + assertEquals( 0L, listener.dataOffset ); + assertEquals( 6L, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); assertEquals( "upload", fs.get( "dir/sub/dir/file.txt" ) ); @@ -372,8 +382,8 @@ public void testPut_EncodedResourcePath() RecordingTransportListener listener = new RecordingTransportListener(); PutTask task = new PutTask( URI.create( "some%20space.txt" ) ).setListener( listener ).setDataString( "OK" ); transporter.put( task ); - assertEquals( 0, listener.dataOffset ); - assertEquals( 2, listener.dataLength ); + assertEquals( 0L, listener.dataOffset ); + assertEquals( 2L, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertTrue( "Count: " + listener.progressedCount, listener.progressedCount > 0 ); assertEquals( "OK", fs.get( "some space.txt" ) ); @@ -434,8 +444,8 @@ public void testPut_ProgressCancelled() { assertEquals( Transporter.ERROR_OTHER, transporter.classify( e ) ); } - assertEquals( 0, listener.dataOffset ); - assertEquals( 6, listener.dataLength ); + assertEquals( 0L, listener.dataOffset ); + assertEquals( 6L, listener.dataLength ); assertEquals( 1, listener.startedCount ); assertEquals( 1, listener.progressedCount ); } diff --git a/maven-resolver-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/Configurable.java b/maven-resolver-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/Configurable.java new file mode 100644 index 000000000..9a90f6ffc --- /dev/null +++ b/maven-resolver-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/Configurable.java @@ -0,0 +1,31 @@ +package org.eclipse.aether.transport.wagon; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT 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 interface Configurable +{ + + Object getConfiguration(); + + void setConfiguration( Object config ); + +} diff --git a/aether-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/MemStreamWagon.java b/maven-resolver-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/MemStreamWagon.java similarity index 73% rename from aether-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/MemStreamWagon.java rename to maven-resolver-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/MemStreamWagon.java index c0d6fe47c..6b4be8ffb 100644 --- a/aether-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/MemStreamWagon.java +++ b/maven-resolver-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/MemStreamWagon.java @@ -1,21 +1,30 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.transport.wagon; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.ByteArrayOutputStream; import java.io.InputStream; import java.io.OutputStream; -import java.io.UnsupportedEncodingException; import java.net.URI; +import java.nio.charset.StandardCharsets; import java.util.Map; import java.util.Properties; @@ -95,15 +104,7 @@ public void fillInputData( InputData inputData ) { throw new ResourceDoesNotExistException( "Missing resource: " + inputData.getResource().getName() ); } - byte[] bytes; - try - { - bytes = data.getBytes( "UTF-8" ); - } - catch ( UnsupportedEncodingException e ) - { - throw new TransferFailedException( e.getMessage(), e ); - } + byte[] bytes = data.getBytes( StandardCharsets.UTF_8 ); inputData.getResource().setContentLength( bytes.length ); inputData.setInputStream( new ByteArrayInputStream( bytes ) ); } @@ -119,15 +120,7 @@ public void fillOutputData( OutputData outputData ) protected void finishPutTransfer( Resource resource, InputStream input, OutputStream output ) throws TransferFailedException, AuthorizationException, ResourceDoesNotExistException { - String data; - try - { - data = ( (ByteArrayOutputStream) output ).toString( "UTF-8" ); - } - catch ( UnsupportedEncodingException e ) - { - throw new TransferFailedException( e.getMessage(), e ); - } + String data = new String( ( (ByteArrayOutputStream) output ).toByteArray(), StandardCharsets.UTF_8 ); fs.put( URI.create( resource.getName() ).getSchemeSpecificPart(), data ); } diff --git a/aether-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/MemWagon.java b/maven-resolver-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/MemWagon.java similarity index 84% rename from aether-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/MemWagon.java rename to maven-resolver-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/MemWagon.java index 16650d72d..17c82f23a 100644 --- a/aether-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/MemWagon.java +++ b/maven-resolver-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/MemWagon.java @@ -1,22 +1,31 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.transport.wagon; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.ByteArrayOutputStream; import java.io.File; import java.io.InputStream; import java.io.OutputStream; -import java.io.UnsupportedEncodingException; import java.net.URI; +import java.nio.charset.StandardCharsets; import java.util.Map; import java.util.Properties; @@ -149,15 +158,7 @@ protected void fillInputData( InputData inputData ) { throw new ResourceDoesNotExistException( "Missing resource: " + inputData.getResource().getName() ); } - byte[] bytes; - try - { - bytes = data.getBytes( "UTF-8" ); - } - catch ( UnsupportedEncodingException e ) - { - throw new TransferFailedException( e.getMessage(), e ); - } + byte[] bytes = data.getBytes( StandardCharsets.UTF_8 ); inputData.getResource().setContentLength( bytes.length ); inputData.setInputStream( new ByteArrayInputStream( bytes ) ); } @@ -208,15 +209,7 @@ protected void fillOutputData( OutputData outputData ) protected void finishPutTransfer( Resource resource, InputStream input, OutputStream output ) throws TransferFailedException, AuthorizationException, ResourceDoesNotExistException { - String data; - try - { - data = ( (ByteArrayOutputStream) output ).toString( "UTF-8" ); - } - catch ( UnsupportedEncodingException e ) - { - throw new TransferFailedException( e.getMessage(), e ); - } + String data = new String( ( (ByteArrayOutputStream) output ).toByteArray(), StandardCharsets.UTF_8 ); fs.put( URI.create( resource.getName() ).getSchemeSpecificPart(), data ); } diff --git a/aether-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/MemWagonUtils.java b/maven-resolver-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/MemWagonUtils.java similarity index 80% rename from aether-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/MemWagonUtils.java rename to maven-resolver-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/MemWagonUtils.java index ee2b18681..86d2cc7a4 100644 --- a/aether-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/MemWagonUtils.java +++ b/maven-resolver-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/MemWagonUtils.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.transport.wagon; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.URI; import java.util.Map; import java.util.Properties; diff --git a/aether-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/PlexusSupportTest.java b/maven-resolver-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/PlexusSupportTest.java similarity index 54% rename from aether-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/PlexusSupportTest.java rename to maven-resolver-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/PlexusSupportTest.java index 0238246f0..231fa95f8 100644 --- a/aether-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/PlexusSupportTest.java +++ b/maven-resolver-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/PlexusSupportTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.transport.wagon; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR 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.ContainerConfiguration; import org.codehaus.plexus.PlexusTestCase; import org.eclipse.aether.internal.test.util.TestLoggerFactory; diff --git a/aether-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/RecordingTransportListener.java b/maven-resolver-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/RecordingTransportListener.java similarity index 61% rename from aether-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/RecordingTransportListener.java rename to maven-resolver-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/RecordingTransportListener.java index c2687b98f..7f6198574 100644 --- a/aether-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/RecordingTransportListener.java +++ b/maven-resolver-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/RecordingTransportListener.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.transport.wagon; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.ByteArrayOutputStream; import java.nio.ByteBuffer; diff --git a/maven-resolver-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/StreamWagonTransporterTest.java b/maven-resolver-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/StreamWagonTransporterTest.java new file mode 100644 index 000000000..c3f3fd47c --- /dev/null +++ b/maven-resolver-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/StreamWagonTransporterTest.java @@ -0,0 +1,36 @@ +package org.eclipse.aether.transport.wagon; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 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; + +/** + */ +public class StreamWagonTransporterTest + extends AbstractWagonTransporterTest +{ + + @Override + protected Wagon newWagon() + { + return new MemStreamWagon(); + } + +} diff --git a/maven-resolver-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/WagonTransporterTest.java b/maven-resolver-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/WagonTransporterTest.java new file mode 100644 index 000000000..5a1039960 --- /dev/null +++ b/maven-resolver-transport-wagon/src/test/java/org/eclipse/aether/transport/wagon/WagonTransporterTest.java @@ -0,0 +1,36 @@ +package org.eclipse.aether.transport.wagon; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 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; + +/** + */ +public class WagonTransporterTest + extends AbstractWagonTransporterTest +{ + + @Override + protected Wagon newWagon() + { + return new MemWagon(); + } + +} diff --git a/maven-resolver-transport-wagon/src/test/resources/logback-test.xml b/maven-resolver-transport-wagon/src/test/resources/logback-test.xml new file mode 100644 index 000000000..d031998b7 --- /dev/null +++ b/maven-resolver-transport-wagon/src/test/resources/logback-test.xml @@ -0,0 +1,36 @@ + + + + + + + + %d{HH:mm:ss.SSS} [%-18thread] %c{1} [%p] %m%n + + + + + + + + + + + diff --git a/maven-resolver-util/pom.xml b/maven-resolver-util/pom.xml new file mode 100644 index 000000000..543a9b0b8 --- /dev/null +++ b/maven-resolver-util/pom.xml @@ -0,0 +1,59 @@ + + + + + + 4.0.0 + + + org.apache.maven.resolver + maven-resolver + 1.2.0-SNAPSHOT + + + maven-resolver-util + + Maven Artifact Resolver Utilities + + A collection of utility classes to ease usage of the repository system. + + + + + org.apache.maven.resolver + maven-resolver-api + + + org.apache.maven.resolver + maven-resolver-test-util + test + + + org.hamcrest + hamcrest-core + test + + + junit + junit + test + + + diff --git a/aether-util/src/main/java/org/eclipse/aether/util/ChecksumUtils.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/ChecksumUtils.java similarity index 71% rename from aether-util/src/main/java/org/eclipse/aether/util/ChecksumUtils.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/ChecksumUtils.java index f14fd4327..dee0650e2 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/ChecksumUtils.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/ChecksumUtils.java @@ -1,20 +1,30 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.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 java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; +import java.nio.charset.StandardCharsets; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.Collection; @@ -43,49 +53,34 @@ public static String read( File checksumFile ) throws IOException { String checksum = ""; - - FileInputStream fis = new FileInputStream( checksumFile ); + BufferedReader reader = null; try { - BufferedReader br = new BufferedReader( new InputStreamReader( fis, "UTF-8" ), 512 ); - try - { - while ( true ) - { - String line = br.readLine(); - if ( line == null ) - { - break; - } - line = line.trim(); - if ( line.length() > 0 ) - { - checksum = line; - break; - } - } - } - finally + reader = new BufferedReader( new InputStreamReader( new FileInputStream( checksumFile ), StandardCharsets.UTF_8 ), 512 ); + for ( String line = reader.readLine(); line != null; line = reader.readLine() ) { - try + line = line.trim(); + if ( line.length() > 0 ) { - br.close(); - } - catch ( IOException e ) - { - // ignored + checksum = line; + break; } } + reader.close(); + reader = null; } finally { try { - fis.close(); + if ( reader != null ) + { + reader.close(); + } } catch ( IOException e ) { - // ignored + // Suppressed } } @@ -135,12 +130,13 @@ public static Map calc( File dataFile, Collection algos } } - FileInputStream fis = new FileInputStream( dataFile ); + FileInputStream in = null; try { - for ( byte[] buffer = new byte[32 * 1024];; ) + in = new FileInputStream( dataFile ); + for ( byte[] buffer = new byte[ 32 * 1024 ];; ) { - int read = fis.read( buffer ); + int read = in.read( buffer ); if ( read < 0 ) { break; @@ -150,16 +146,21 @@ public static Map calc( File dataFile, Collection algos digest.update( buffer, 0, read ); } } + in.close(); + in = null; } finally { try { - fis.close(); + if ( in != null ) + { + in.close(); + } } catch ( IOException e ) { - // ignored + // Suppressed } } diff --git a/aether-util/src/main/java/org/eclipse/aether/util/ConfigUtils.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/ConfigUtils.java similarity index 81% rename from aether-util/src/main/java/org/eclipse/aether/util/ConfigUtils.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/ConfigUtils.java index 821bfa3de..c19c11354 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/ConfigUtils.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/ConfigUtils.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.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 java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -32,7 +41,7 @@ private ConfigUtils() } /** - * Gets the specified configuration property. + * Gets the specified configuration property as is. * * @param properties The configuration properties to read, must not be {@code null}. * @param defaultValue The default value to return in case none of the property keys are set, may be {@code null}. @@ -56,7 +65,7 @@ public static Object getObject( Map properties, Object defaultValue, Strin } /** - * Gets the specified configuration property. + * Gets the specified configuration property as is. * * @param session The repository system session from which to read the configuration property, must not be * {@code null}. @@ -71,11 +80,11 @@ public static Object getObject( RepositorySystemSession session, Object defaultV } /** - * Gets the specified configuration property. + * Gets the specified configuration property as a string value. * * @param properties The configuration properties to read, must not be {@code null}. - * @param defaultValue The default value to return in case none of the property keys is set to a string, may be - * {@code null}. + * @param defaultValue The default value to return in case none of the property keys is set to a + * string/boolean/number, may be {@code null}. * @param keys The property keys to read, must not be {@code null}. The specified keys are read one after one until * a string value is found. * @return The property value or {@code null} if none. @@ -86,9 +95,9 @@ public static String getString( Map properties, String defaultValue, Strin { Object value = properties.get( key ); - if ( value instanceof String ) + if ( value instanceof String || value instanceof Boolean || value instanceof Number ) { - return (String) value; + return value.toString(); } } @@ -96,12 +105,12 @@ public static String getString( Map properties, String defaultValue, Strin } /** - * Gets the specified configuration property. + * Gets the specified configuration property as a string value. * * @param session The repository system session from which to read the configuration property, must not be * {@code null}. - * @param defaultValue The default value to return in case none of the property keys is set to a string, may be - * {@code null}. + * @param defaultValue The default value to return in case none of the property keys is set to a + * string/boolean/number, may be {@code null}. * @param keys The property keys to read, must not be {@code null}. The specified keys are read one after one until * a string value is found. * @return The property value or {@code null} if none. @@ -112,10 +121,11 @@ public static String getString( RepositorySystemSession session, String defaultV } /** - * Gets the specified configuration property. + * Gets the specified configuration property as an integer number. * * @param properties The configuration properties to read, must not be {@code null}. - * @param defaultValue The default value to return in case none of the property keys is set to a number. + * @param defaultValue The default value to return in case none of the property keys is set to a number or numeric + * string. * @param keys The property keys to read, must not be {@code null}. The specified keys are read one after one until * a {@link Number} or a string representation of an {@link Integer} is found. * @return The property value. @@ -145,11 +155,12 @@ public static int getInteger( Map properties, int defaultValue, String... } /** - * Gets the specified configuration property. + * Gets the specified configuration property as an integer number. * * @param session The repository system session from which to read the configuration property, must not be * {@code null}. - * @param defaultValue The default value to return in case none of the property keys is set to a number. + * @param defaultValue The default value to return in case none of the property keys is set to a number or numeric + * string. * @param keys The property keys to read, must not be {@code null}. The specified keys are read one after one until * a {@link Number} or a string representation of an {@link Integer} is found. * @return The property value. @@ -160,10 +171,11 @@ public static int getInteger( RepositorySystemSession session, int defaultValue, } /** - * Gets the specified configuration property. + * Gets the specified configuration property as a long number. * * @param properties The configuration properties to read, must not be {@code null}. - * @param defaultValue The default value to return in case none of the property keys is set to a number. + * @param defaultValue The default value to return in case none of the property keys is set to a number or numeric + * string. * @param keys The property keys to read, must not be {@code null}. The specified keys are read one after one until * a {@link Number} or a string representation of a {@link Long} is found. * @return The property value. @@ -193,11 +205,12 @@ public static long getLong( Map properties, long defaultValue, String... k } /** - * Gets the specified configuration property. + * Gets the specified configuration property as a long number. * * @param session The repository system session from which to read the configuration property, must not be * {@code null}. - * @param defaultValue The default value to return in case none of the property keys is set to a number. + * @param defaultValue The default value to return in case none of the property keys is set to a number or numeric + * string. * @param keys The property keys to read, must not be {@code null}. The specified keys are read one after one until * a {@link Number} or a string representation of a {@link Long} is found. * @return The property value. @@ -208,10 +221,11 @@ public static long getLong( RepositorySystemSession session, long defaultValue, } /** - * Gets the specified configuration property. + * Gets the specified configuration property as a single-precision floating point number. * * @param properties The configuration properties to read, must not be {@code null}. - * @param defaultValue The default value to return in case none of the property keys is set to a number. + * @param defaultValue The default value to return in case none of the property keys is set to a number or numeric + * string. * @param keys The property keys to read, must not be {@code null}. The specified keys are read one after one until * a {@link Number} or a string representation of a {@link Float} is found. * @return The property value. @@ -241,11 +255,12 @@ public static float getFloat( Map properties, float defaultValue, String.. } /** - * Gets the specified configuration property. + * Gets the specified configuration property as a single-precision floating point number. * * @param session The repository system session from which to read the configuration property, must not be * {@code null}. - * @param defaultValue The default value to return in case none of the property keys is set to a number. + * @param defaultValue The default value to return in case none of the property keys is set to a number or numeric + * string. * @param keys The property keys to read, must not be {@code null}. The specified keys are read one after one until * a {@link Number} or a string representation of a {@link Float} is found. * @return The property value. @@ -256,10 +271,10 @@ public static float getFloat( RepositorySystemSession session, float defaultValu } /** - * Gets the specified configuration property. + * Gets the specified configuration property as boolean flag. * * @param properties The configuration properties to read, must not be {@code null}. - * @param defaultValue The default value to return in case none of the property keys is set to a boolean. + * @param defaultValue The default value to return in case none of the property keys is set to a boolean or string. * @param keys The property keys to read, must not be {@code null}. The specified keys are read one after one until * a {@link Boolean} or a string (to be {@link Boolean#parseBoolean(String) parsed as boolean}) is found. * @return The property value. @@ -284,11 +299,11 @@ else if ( value instanceof String ) } /** - * Gets the specified configuration property. + * Gets the specified configuration property as a boolean flag. * * @param session The repository system session from which to read the configuration property, must not be * {@code null}. - * @param defaultValue The default value to return in case none of the property keys is set to a boolean. + * @param defaultValue The default value to return in case none of the property keys is set to a boolean or string. * @param keys The property keys to read, must not be {@code null}. The specified keys are read one after one until * a {@link Boolean} or a string (to be {@link Boolean#parseBoolean(String) parsed as boolean}) is found. * @return The property value. @@ -299,7 +314,7 @@ public static boolean getBoolean( RepositorySystemSession session, boolean defau } /** - * Gets the specified configuration property. + * Gets the specified configuration property as a list of objects. * * @param properties The configuration properties to read, must not be {@code null}. * @param defaultValue The default value to return in case none of the property keys is set to a collection. @@ -327,7 +342,7 @@ else if ( value instanceof Collection ) } /** - * Gets the specified configuration property. + * Gets the specified configuration property as a list of objects. * * @param session The repository system session from which to read the configuration property, must not be * {@code null}. @@ -342,7 +357,7 @@ public static List getList( RepositorySystemSession session, List defaultV } /** - * Gets the specified configuration property. + * Gets the specified configuration property as a map or key value pairs. * * @param properties The configuration properties to read, must not be {@code null}. * @param defaultValue The default value to return in case none of the property keys is set to a map. @@ -366,7 +381,7 @@ public static List getList( RepositorySystemSession session, List defaultV } /** - * Gets the specified configuration property. + * Gets the specified configuration property as map of key value pairs. * * @param session The repository system session from which to read the configuration property, must not be * {@code null}. diff --git a/maven-resolver-util/src/main/java/org/eclipse/aether/util/StringUtils.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/StringUtils.java new file mode 100644 index 000000000..e0ed12aa3 --- /dev/null +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/StringUtils.java @@ -0,0 +1,44 @@ +package org.eclipse.aether.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. + */ + +/** + * A utility class to ease string processing. + */ +public final class StringUtils +{ + + private StringUtils() + { + // hide constructor + } + + /** + * Checks whether a string is {@code null} or of zero length. + * + * @param string The string to check, may be {@code null}. + * @return {@code true} if the string is {@code null} or of zero length, {@code false} otherwise. + */ + public static boolean isEmpty( String string ) + { + return string == null || string.length() <= 0; + } + +} diff --git a/aether-util/src/main/java/org/eclipse/aether/util/artifact/ArtifactIdUtils.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/artifact/ArtifactIdUtils.java similarity index 91% rename from aether-util/src/main/java/org/eclipse/aether/util/artifact/ArtifactIdUtils.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/artifact/ArtifactIdUtils.java index 65f3bbcd2..54ffc644f 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/artifact/ArtifactIdUtils.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/artifact/ArtifactIdUtils.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.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.eclipse.aether.artifact.Artifact; /** diff --git a/maven-resolver-util/src/main/java/org/eclipse/aether/util/artifact/DefaultArtifactTypeRegistry.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/artifact/DefaultArtifactTypeRegistry.java new file mode 100644 index 000000000..9fb29af82 --- /dev/null +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/artifact/DefaultArtifactTypeRegistry.java @@ -0,0 +1,51 @@ +package org.eclipse.aether.util.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.eclipse.aether.artifact.ArtifactType; + +/** + * A simple artifact type registry. + */ +public final class DefaultArtifactTypeRegistry + extends SimpleArtifactTypeRegistry +{ + + /** + * Creates a new artifact type registry with initally no registered artifact types. Use {@link #add(ArtifactType)} + * to populate the registry. + */ + public DefaultArtifactTypeRegistry() + { + } + + /** + * Adds the specified artifact type to the registry. + * + * @param type The artifact type to add, must not be {@code null}. + * @return This registry for chaining, never {@code null}. + */ + public DefaultArtifactTypeRegistry add( ArtifactType type ) + { + super.add( type ); + return this; + } + +} diff --git a/aether-util/src/main/java/org/eclipse/aether/util/artifact/DelegatingArtifact.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/artifact/DelegatingArtifact.java similarity index 81% rename from aether-util/src/main/java/org/eclipse/aether/util/artifact/DelegatingArtifact.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/artifact/DelegatingArtifact.java index e164bb4b8..8816ae52d 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/artifact/DelegatingArtifact.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/artifact/DelegatingArtifact.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.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.util.Map; diff --git a/maven-resolver-util/src/main/java/org/eclipse/aether/util/artifact/JavaScopes.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/artifact/JavaScopes.java new file mode 100644 index 000000000..bf4894cf7 --- /dev/null +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/artifact/JavaScopes.java @@ -0,0 +1,45 @@ +package org.eclipse.aether.util.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. + */ + +/** + * The dependency scopes used for Java dependencies. + * + * @see org.eclipse.aether.graph.Dependency#getScope() + */ +public final class JavaScopes +{ + + public static final String COMPILE = "compile"; + + public static final String PROVIDED = "provided"; + + public static final String SYSTEM = "system"; + + public static final String RUNTIME = "runtime"; + + public static final String TEST = "test"; + + private JavaScopes() + { + // hide constructor + } + +} diff --git a/aether-util/src/main/java/org/eclipse/aether/util/artifact/OverlayArtifactTypeRegistry.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/artifact/OverlayArtifactTypeRegistry.java similarity index 63% rename from aether-util/src/main/java/org/eclipse/aether/util/artifact/OverlayArtifactTypeRegistry.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/artifact/OverlayArtifactTypeRegistry.java index abcaf5499..6768b1691 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/artifact/OverlayArtifactTypeRegistry.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/artifact/OverlayArtifactTypeRegistry.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.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.eclipse.aether.artifact.ArtifactType; import org.eclipse.aether.artifact.ArtifactTypeRegistry; diff --git a/aether-util/src/main/java/org/eclipse/aether/util/artifact/SimpleArtifactTypeRegistry.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/artifact/SimpleArtifactTypeRegistry.java similarity index 60% rename from aether-util/src/main/java/org/eclipse/aether/util/artifact/SimpleArtifactTypeRegistry.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/artifact/SimpleArtifactTypeRegistry.java index d1e6d9f18..b0bfc9f85 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/artifact/SimpleArtifactTypeRegistry.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/artifact/SimpleArtifactTypeRegistry.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.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.HashMap; import java.util.Map; diff --git a/aether-util/src/main/java/org/eclipse/aether/util/artifact/SubArtifact.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/artifact/SubArtifact.java similarity index 90% rename from aether-util/src/main/java/org/eclipse/aether/util/artifact/SubArtifact.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/artifact/SubArtifact.java index 1d579bfcc..ed4d55b85 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/artifact/SubArtifact.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/artifact/SubArtifact.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.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.util.Map; diff --git a/maven-resolver-util/src/main/java/org/eclipse/aether/util/artifact/package-info.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/artifact/package-info.java new file mode 100644 index 000000000..760380d03 --- /dev/null +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/artifact/package-info.java @@ -0,0 +1,24 @@ +// CHECKSTYLE_OFF: RegexpHeader +/** + * Utilities around artifacts and artifact type registries. + */ +package org.eclipse.aether.util.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. + */ diff --git a/maven-resolver-util/src/main/java/org/eclipse/aether/util/concurrency/FutureResult.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/concurrency/FutureResult.java new file mode 100644 index 000000000..dbbe1df54 --- /dev/null +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/concurrency/FutureResult.java @@ -0,0 +1,69 @@ +package org.eclipse.aether.util.concurrency; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.concurrent.Future; +import java.util.concurrent.TimeUnit; + +/** + * Wraps a result value as a Future. + * + * @param result type + */ +public class FutureResult + implements Future +{ + private final T value; + + public FutureResult( T value ) + { + this.value = value; + } + + @Override + public boolean cancel( boolean mayInterruptIfRunning ) + { + return false; + } + + @Override + public boolean isCancelled() + { + return false; + } + + @Override + public boolean isDone() + { + return true; + } + + @Override + public T get() + { + return value; + } + + @Override + public T get( long timeout, TimeUnit unit ) + { + return value; + } +} diff --git a/aether-util/src/main/java/org/eclipse/aether/util/concurrency/RunnableErrorForwarder.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/concurrency/RunnableErrorForwarder.java similarity index 82% rename from aether-util/src/main/java/org/eclipse/aether/util/concurrency/RunnableErrorForwarder.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/concurrency/RunnableErrorForwarder.java index 8144f9a0b..270ea8214 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/concurrency/RunnableErrorForwarder.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/concurrency/RunnableErrorForwarder.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.concurrency; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.locks.LockSupport; diff --git a/aether-util/src/main/java/org/eclipse/aether/util/concurrency/WorkerThreadFactory.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/concurrency/WorkerThreadFactory.java similarity index 63% rename from aether-util/src/main/java/org/eclipse/aether/util/concurrency/WorkerThreadFactory.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/concurrency/WorkerThreadFactory.java index d0f1f18d1..26d0fb69c 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/concurrency/WorkerThreadFactory.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/concurrency/WorkerThreadFactory.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.concurrency; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.concurrent.Executors; import java.util.concurrent.ThreadFactory; import java.util.concurrent.atomic.AtomicInteger; @@ -27,7 +36,7 @@ public final class WorkerThreadFactory private final AtomicInteger threadIndex; - private static final AtomicInteger poolIndex = new AtomicInteger(); + private static final AtomicInteger POOL_INDEX = new AtomicInteger(); /** * Creates a new thread factory whose threads will have names using the specified prefix. @@ -40,7 +49,7 @@ public WorkerThreadFactory( String namePrefix ) this.factory = Executors.defaultThreadFactory(); this.namePrefix = ( ( namePrefix != null && namePrefix.length() > 0 ) ? namePrefix : getCallerSimpleClassName() + '-' ) - + poolIndex.getAndIncrement() + '-'; + + POOL_INDEX.getAndIncrement() + '-'; threadIndex = new AtomicInteger(); } diff --git a/maven-resolver-util/src/main/java/org/eclipse/aether/util/concurrency/package-info.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/concurrency/package-info.java new file mode 100644 index 000000000..83c397a36 --- /dev/null +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/concurrency/package-info.java @@ -0,0 +1,24 @@ +// CHECKSTYLE_OFF: RegexpHeader +/** + * Utilities for concurrent task processing. + */ +package org.eclipse.aether.util.concurrency; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ diff --git a/aether-util/src/main/java/org/eclipse/aether/util/filter/AbstractPatternDependencyFilter.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/filter/AbstractPatternDependencyFilter.java similarity index 89% rename from aether-util/src/main/java/org/eclipse/aether/util/filter/AbstractPatternDependencyFilter.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/filter/AbstractPatternDependencyFilter.java index a4eaff32c..d707d2661 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/filter/AbstractPatternDependencyFilter.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/filter/AbstractPatternDependencyFilter.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.filter; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Arrays; import java.util.Collection; import java.util.HashSet; diff --git a/aether-util/src/main/java/org/eclipse/aether/util/filter/AndDependencyFilter.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/filter/AndDependencyFilter.java similarity index 78% rename from aether-util/src/main/java/org/eclipse/aether/util/filter/AndDependencyFilter.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/filter/AndDependencyFilter.java index b1036fee5..9997c9488 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/filter/AndDependencyFilter.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/filter/AndDependencyFilter.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.filter; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import java.util.Collection; import java.util.Collections; import java.util.LinkedHashSet; diff --git a/aether-util/src/main/java/org/eclipse/aether/util/filter/DependencyFilterUtils.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/filter/DependencyFilterUtils.java similarity index 88% rename from aether-util/src/main/java/org/eclipse/aether/util/filter/DependencyFilterUtils.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/filter/DependencyFilterUtils.java index b47dc9699..887c4b1b0 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/filter/DependencyFilterUtils.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/filter/DependencyFilterUtils.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.filter; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Arrays; import java.util.Collection; import java.util.Collections; diff --git a/aether-util/src/main/java/org/eclipse/aether/util/filter/ExclusionsDependencyFilter.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/filter/ExclusionsDependencyFilter.java similarity index 72% rename from aether-util/src/main/java/org/eclipse/aether/util/filter/ExclusionsDependencyFilter.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/filter/ExclusionsDependencyFilter.java index b88bbed52..2de4ae831 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/filter/ExclusionsDependencyFilter.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/filter/ExclusionsDependencyFilter.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.filter; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import java.util.Collection; import java.util.HashSet; import java.util.List; diff --git a/aether-util/src/main/java/org/eclipse/aether/util/filter/NotDependencyFilter.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/filter/NotDependencyFilter.java similarity index 63% rename from aether-util/src/main/java/org/eclipse/aether/util/filter/NotDependencyFilter.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/filter/NotDependencyFilter.java index 904eb5f5d..d5fdb24b1 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/filter/NotDependencyFilter.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/filter/NotDependencyFilter.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.filter; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.eclipse.aether.graph.DependencyFilter; diff --git a/aether-util/src/main/java/org/eclipse/aether/util/filter/OrDependencyFilter.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/filter/OrDependencyFilter.java similarity index 76% rename from aether-util/src/main/java/org/eclipse/aether/util/filter/OrDependencyFilter.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/filter/OrDependencyFilter.java index ce70db001..665f6e771 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/filter/OrDependencyFilter.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/filter/OrDependencyFilter.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.filter; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import java.util.Collection; import java.util.Collections; import java.util.LinkedHashSet; diff --git a/aether-util/src/main/java/org/eclipse/aether/util/filter/PatternExclusionsDependencyFilter.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/filter/PatternExclusionsDependencyFilter.java similarity index 76% rename from aether-util/src/main/java/org/eclipse/aether/util/filter/PatternExclusionsDependencyFilter.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/filter/PatternExclusionsDependencyFilter.java index 3081c4a6d..e7686147a 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/filter/PatternExclusionsDependencyFilter.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/filter/PatternExclusionsDependencyFilter.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.filter; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import java.util.Collection; import org.eclipse.aether.artifact.Artifact; diff --git a/aether-util/src/main/java/org/eclipse/aether/util/filter/PatternInclusionsDependencyFilter.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/filter/PatternInclusionsDependencyFilter.java similarity index 75% rename from aether-util/src/main/java/org/eclipse/aether/util/filter/PatternInclusionsDependencyFilter.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/filter/PatternInclusionsDependencyFilter.java index 130c9292f..e30600b0d 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/filter/PatternInclusionsDependencyFilter.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/filter/PatternInclusionsDependencyFilter.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.filter; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import java.util.Collection; import org.eclipse.aether.version.VersionScheme; diff --git a/aether-util/src/main/java/org/eclipse/aether/util/filter/ScopeDependencyFilter.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/filter/ScopeDependencyFilter.java similarity index 77% rename from aether-util/src/main/java/org/eclipse/aether/util/filter/ScopeDependencyFilter.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/filter/ScopeDependencyFilter.java index ed76b7b18..bc60c4197 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/filter/ScopeDependencyFilter.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/filter/ScopeDependencyFilter.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.filter; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Arrays; import java.util.Collection; import java.util.HashSet; diff --git a/maven-resolver-util/src/main/java/org/eclipse/aether/util/filter/package-info.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/filter/package-info.java new file mode 100644 index 000000000..fde8529a4 --- /dev/null +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/filter/package-info.java @@ -0,0 +1,24 @@ +// CHECKSTYLE_OFF: RegexpHeader +/** + * Various dependency filters for selecting nodes in a dependency graph. + */ +package org.eclipse.aether.util.filter; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ diff --git a/aether-util/src/main/java/org/eclipse/aether/util/graph/manager/ClassicDependencyManager.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/manager/ClassicDependencyManager.java similarity index 90% rename from aether-util/src/main/java/org/eclipse/aether/util/graph/manager/ClassicDependencyManager.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/manager/ClassicDependencyManager.java index f4448e837..fefb9fbb5 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/graph/manager/ClassicDependencyManager.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/manager/ClassicDependencyManager.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.manager; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import java.util.Collection; import java.util.Collections; import java.util.HashMap; @@ -51,9 +60,9 @@ public final class ClassicDependencyManager */ public ClassicDependencyManager() { - this( 0, Collections. emptyMap(), Collections. emptyMap(), - Collections. emptyMap(), Collections. emptyMap(), - Collections.> emptyMap() ); + this( 0, Collections.emptyMap(), Collections.emptyMap(), + Collections.emptyMap(), Collections.emptyMap(), + Collections.>emptyMap() ); } private ClassicDependencyManager( int depth, Map managedVersions, diff --git a/aether-util/src/main/java/org/eclipse/aether/util/graph/manager/DependencyManagerUtils.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/manager/DependencyManagerUtils.java similarity index 82% rename from aether-util/src/main/java/org/eclipse/aether/util/graph/manager/DependencyManagerUtils.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/manager/DependencyManagerUtils.java index e88e46b60..771909608 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/graph/manager/DependencyManagerUtils.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/manager/DependencyManagerUtils.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.manager; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.graph.DependencyNode; diff --git a/aether-util/src/main/java/org/eclipse/aether/util/graph/manager/NoopDependencyManager.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/manager/NoopDependencyManager.java similarity index 64% rename from aether-util/src/main/java/org/eclipse/aether/util/graph/manager/NoopDependencyManager.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/manager/NoopDependencyManager.java index 61b5b4c77..ae8ee40af 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/graph/manager/NoopDependencyManager.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/manager/NoopDependencyManager.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.manager; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.collection.DependencyCollectionContext; import org.eclipse.aether.collection.DependencyManagement; import org.eclipse.aether.collection.DependencyManager; diff --git a/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/manager/TransitiveDependencyManager.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/manager/TransitiveDependencyManager.java new file mode 100644 index 000000000..aeac09fad --- /dev/null +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/manager/TransitiveDependencyManager.java @@ -0,0 +1,321 @@ +package org.eclipse.aether.util.graph.manager; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.LinkedHashSet; +import java.util.Map; +import org.eclipse.aether.artifact.Artifact; +import org.eclipse.aether.artifact.ArtifactProperties; +import org.eclipse.aether.collection.DependencyCollectionContext; +import org.eclipse.aether.collection.DependencyManagement; +import org.eclipse.aether.collection.DependencyManager; +import org.eclipse.aether.graph.Dependency; +import org.eclipse.aether.graph.Exclusion; +import org.eclipse.aether.util.artifact.JavaScopes; + +/** + * A dependency manager supporting transitive dependency management. + * + * @author Christian Schulte + * @since 1.2 + */ +public final class TransitiveDependencyManager + implements DependencyManager +{ + + private final int depth; + + private final Map managedVersions; + + private final Map managedScopes; + + private final Map managedOptionals; + + private final Map managedLocalPaths; + + private final Map> managedExclusions; + + private int hashCode; + + /** + * Creates a new dependency manager without any management information. + */ + public TransitiveDependencyManager() + { + this( 0, Collections.emptyMap(), Collections.emptyMap(), + Collections.emptyMap(), Collections.emptyMap(), + Collections.>emptyMap() ); + } + + private TransitiveDependencyManager( final int depth, + final Map managedVersions, + final Map managedScopes, + final Map managedOptionals, + final Map managedLocalPaths, + final Map> managedExclusions ) + { + super(); + this.depth = depth; + this.managedVersions = managedVersions; + this.managedScopes = managedScopes; + this.managedOptionals = managedOptionals; + this.managedLocalPaths = managedLocalPaths; + this.managedExclusions = managedExclusions; + } + + public DependencyManager deriveChildManager( final DependencyCollectionContext context ) + { + Map versions = this.managedVersions; + Map scopes = this.managedScopes; + Map optionals = this.managedOptionals; + Map localPaths = this.managedLocalPaths; + Map> exclusions = this.managedExclusions; + + for ( Dependency managedDependency : context.getManagedDependencies() ) + { + Artifact artifact = managedDependency.getArtifact(); + Object key = getKey( artifact ); + + String version = artifact.getVersion(); + if ( version.length() > 0 && !versions.containsKey( key ) ) + { + if ( versions == this.managedVersions ) + { + versions = new HashMap( this.managedVersions ); + } + versions.put( key, version ); + } + + String scope = managedDependency.getScope(); + if ( scope.length() > 0 && !scopes.containsKey( key ) ) + { + if ( scopes == this.managedScopes ) + { + scopes = new HashMap( this.managedScopes ); + } + scopes.put( key, scope ); + } + + Boolean optional = managedDependency.getOptional(); + if ( optional != null && !optionals.containsKey( key ) ) + { + if ( optionals == this.managedOptionals ) + { + optionals = new HashMap( this.managedOptionals ); + } + optionals.put( key, optional ); + } + + String localPath = managedDependency.getArtifact().getProperty( ArtifactProperties.LOCAL_PATH, null ); + if ( localPath != null && !localPaths.containsKey( key ) ) + { + if ( localPaths == this.managedLocalPaths ) + { + localPaths = new HashMap( this.managedLocalPaths ); + } + localPaths.put( key, localPath ); + } + + if ( !managedDependency.getExclusions().isEmpty() ) + { + if ( exclusions == this.managedExclusions ) + { + exclusions = new HashMap>( this.managedExclusions ); + } + Collection managed = exclusions.get( key ); + if ( managed == null ) + { + managed = new LinkedHashSet(); + exclusions.put( key, managed ); + } + managed.addAll( managedDependency.getExclusions() ); + } + } + + return new TransitiveDependencyManager( this.depth + 1, versions, scopes, optionals, localPaths, exclusions ); + } + + public DependencyManagement manageDependency( Dependency dependency ) + { + DependencyManagement management = null; + + Object key = getKey( dependency.getArtifact() ); + + if ( depth >= 2 ) + { + String version = managedVersions.get( key ); + if ( version != null ) + { + if ( management == null ) + { + management = new DependencyManagement(); + } + management.setVersion( version ); + } + + String scope = managedScopes.get( key ); + if ( scope != null ) + { + if ( management == null ) + { + management = new DependencyManagement(); + } + management.setScope( scope ); + + if ( !JavaScopes.SYSTEM.equals( scope ) + && dependency.getArtifact().getProperty( ArtifactProperties.LOCAL_PATH, null ) != null ) + { + Map properties = + new HashMap( dependency.getArtifact().getProperties() ); + properties.remove( ArtifactProperties.LOCAL_PATH ); + management.setProperties( properties ); + } + } + + if ( ( scope != null && JavaScopes.SYSTEM.equals( scope ) ) + || ( scope == null && JavaScopes.SYSTEM.equals( dependency.getScope() ) ) ) + { + String localPath = managedLocalPaths.get( key ); + if ( localPath != null ) + { + if ( management == null ) + { + management = new DependencyManagement(); + } + Map properties = + new HashMap( dependency.getArtifact().getProperties() ); + properties.put( ArtifactProperties.LOCAL_PATH, localPath ); + management.setProperties( properties ); + } + } + + Boolean optional = managedOptionals.get( key ); + if ( optional != null ) + { + if ( management == null ) + { + management = new DependencyManagement(); + } + management.setOptional( optional ); + } + } + + Collection exclusions = managedExclusions.get( key ); + if ( exclusions != null ) + { + if ( management == null ) + { + management = new DependencyManagement(); + } + Collection result = new LinkedHashSet( dependency.getExclusions() ); + result.addAll( exclusions ); + management.setExclusions( result ); + } + + return management; + } + + private Object getKey( Artifact a ) + { + return new Key( a ); + } + + @Override + public boolean equals( final Object obj ) + { + boolean equal = obj instanceof TransitiveDependencyManager; + + if ( equal ) + { + final TransitiveDependencyManager that = (TransitiveDependencyManager) obj; + return this.depth == that.depth + && this.managedVersions.equals( that.managedVersions ) + && this.managedScopes.equals( that.managedScopes ) + && this.managedOptionals.equals( that.managedOptionals ) + && this.managedExclusions.equals( that.managedExclusions ); + + } + + return equal; + } + + @Override + public int hashCode() + { + if ( this.hashCode == 0 ) + { + int hash = 17; + hash = hash * 31 + this.depth; + hash = hash * 31 + this.managedVersions.hashCode(); + hash = hash * 31 + this.managedScopes.hashCode(); + hash = hash * 31 + this.managedOptionals.hashCode(); + hash = hash * 31 + this.managedExclusions.hashCode(); + this.hashCode = hash; + } + return this.hashCode; + } + + static class Key + { + + private final Artifact artifact; + + private final int hashCode; + + public Key( final Artifact artifact ) + { + this.artifact = artifact; + + int hash = 17; + hash = hash * 31 + artifact.getGroupId().hashCode(); + hash = hash * 31 + artifact.getArtifactId().hashCode(); + this.hashCode = hash; + } + + @Override + public boolean equals( final Object obj ) + { + boolean equal = obj instanceof Key; + + if ( equal ) + { + final Key that = (Key) obj; + return this.artifact.getArtifactId().equals( that.artifact.getArtifactId() ) + && this.artifact.getGroupId().equals( that.artifact.getGroupId() ) + && this.artifact.getExtension().equals( that.artifact.getExtension() ) + && this.artifact.getClassifier().equals( that.artifact.getClassifier() ); + + } + + return equal; + } + + @Override + public int hashCode() + { + return this.hashCode; + } + + } + +} diff --git a/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/manager/package-info.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/manager/package-info.java new file mode 100644 index 000000000..d39277b9e --- /dev/null +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/manager/package-info.java @@ -0,0 +1,24 @@ +// CHECKSTYLE_OFF: RegexpHeader +/** + * Various dependency managers for building a dependency graph. + */ +package org.eclipse.aether.util.graph.manager; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ diff --git a/aether-util/src/main/java/org/eclipse/aether/util/graph/selector/AndDependencySelector.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/selector/AndDependencySelector.java similarity index 87% rename from aether-util/src/main/java/org/eclipse/aether/util/graph/selector/AndDependencySelector.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/selector/AndDependencySelector.java index 70ee08c5b..f2a7e38cd 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/graph/selector/AndDependencySelector.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/selector/AndDependencySelector.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.selector; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Arrays; import java.util.Collection; import java.util.Collections; diff --git a/aether-util/src/main/java/org/eclipse/aether/util/graph/selector/ExclusionDependencySelector.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/selector/ExclusionDependencySelector.java similarity index 88% rename from aether-util/src/main/java/org/eclipse/aether/util/graph/selector/ExclusionDependencySelector.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/selector/ExclusionDependencySelector.java index 645c38699..221cf4f22 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/graph/selector/ExclusionDependencySelector.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/selector/ExclusionDependencySelector.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.selector; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Arrays; import java.util.Collection; import java.util.Comparator; diff --git a/aether-util/src/main/java/org/eclipse/aether/util/graph/selector/OptionalDependencySelector.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/selector/OptionalDependencySelector.java similarity index 66% rename from aether-util/src/main/java/org/eclipse/aether/util/graph/selector/OptionalDependencySelector.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/selector/OptionalDependencySelector.java index 3f48da027..69bbda488 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/graph/selector/OptionalDependencySelector.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/selector/OptionalDependencySelector.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.selector; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.collection.DependencyCollectionContext; import org.eclipse.aether.collection.DependencySelector; import org.eclipse.aether.graph.Dependency; diff --git a/aether-util/src/main/java/org/eclipse/aether/util/graph/selector/ScopeDependencySelector.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/selector/ScopeDependencySelector.java similarity index 65% rename from aether-util/src/main/java/org/eclipse/aether/util/graph/selector/ScopeDependencySelector.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/selector/ScopeDependencySelector.java index 202f79bc0..2640c4241 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/graph/selector/ScopeDependencySelector.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/selector/ScopeDependencySelector.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.selector; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Collection; @@ -31,7 +40,7 @@ public final class ScopeDependencySelector implements DependencySelector { - private final boolean transitive; + private final int depth; private final Collection included; @@ -45,7 +54,8 @@ public final class ScopeDependencySelector */ public ScopeDependencySelector( Collection included, Collection excluded ) { - transitive = false; + super(); + this.depth = 0; this.included = clone( included ); this.excluded = clone( excluded ); } @@ -80,32 +90,31 @@ public ScopeDependencySelector( String... excluded ) this( null, ( excluded != null ) ? Arrays.asList( excluded ) : null ); } - private ScopeDependencySelector( boolean transitive, Collection included, Collection excluded ) + private ScopeDependencySelector( int depth, Collection included, Collection excluded ) { - this.transitive = transitive; + super(); + this.depth = depth; this.included = included; this.excluded = excluded; } public boolean selectDependency( Dependency dependency ) { - if ( !transitive ) - { - return true; - } + // depth < 2 == direct dependency + // assert this.depth > 0 : "Unexpected depth."; + return this.depth < 2 + || ( ( included == null || included.contains( dependency.getScope() ) ) + && ( excluded == null || !excluded.contains( dependency.getScope() ) ) ); - String scope = dependency.getScope(); - return ( included == null || included.contains( scope ) ) && ( excluded == null || !excluded.contains( scope ) ); } public DependencySelector deriveChildSelector( DependencyCollectionContext context ) { - if ( this.transitive || context.getDependency() == null ) - { - return this; - } + // First call is for direct dependencies, successive calls are for transitive dependencies. + return this.depth >= 2 + ? this + : new ScopeDependencySelector( this.depth + 1, this.included, this.excluded ); - return new ScopeDependencySelector( true, included, excluded ); } @Override @@ -121,7 +130,7 @@ else if ( null == obj || !getClass().equals( obj.getClass() ) ) } ScopeDependencySelector that = (ScopeDependencySelector) obj; - return transitive == that.transitive && eq( included, that.included ) && eq( excluded, that.excluded ); + return this.depth == that.depth && eq( included, that.included ) && eq( excluded, that.excluded ); } private static boolean eq( T o1, T o2 ) @@ -133,7 +142,7 @@ private static boolean eq( T o1, T o2 ) public int hashCode() { int hash = 17; - hash = hash * 31 + ( transitive ? 1 : 0 ); + hash = hash * 31 + ( this.depth ); hash = hash * 31 + ( included != null ? included.hashCode() : 0 ); hash = hash * 31 + ( excluded != null ? excluded.hashCode() : 0 ); return hash; diff --git a/aether-util/src/main/java/org/eclipse/aether/util/graph/selector/StaticDependencySelector.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/selector/StaticDependencySelector.java similarity index 64% rename from aether-util/src/main/java/org/eclipse/aether/util/graph/selector/StaticDependencySelector.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/selector/StaticDependencySelector.java index 0393b9df4..41ce0e090 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/graph/selector/StaticDependencySelector.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/selector/StaticDependencySelector.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.selector; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.collection.DependencyCollectionContext; import org.eclipse.aether.collection.DependencySelector; import org.eclipse.aether.graph.Dependency; diff --git a/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/selector/package-info.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/selector/package-info.java new file mode 100644 index 000000000..6eed36bc7 --- /dev/null +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/selector/package-info.java @@ -0,0 +1,24 @@ +// CHECKSTYLE_OFF: RegexpHeader +/** + * Various dependency selectors for building a dependency graph. + */ +package org.eclipse.aether.util.graph.selector; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ diff --git a/aether-util/src/main/java/org/eclipse/aether/util/graph/transformer/ChainedDependencyGraphTransformer.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/ChainedDependencyGraphTransformer.java similarity index 73% rename from aether-util/src/main/java/org/eclipse/aether/util/graph/transformer/ChainedDependencyGraphTransformer.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/ChainedDependencyGraphTransformer.java index d5f597bbb..d7f177129 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/graph/transformer/ChainedDependencyGraphTransformer.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/ChainedDependencyGraphTransformer.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.transformer; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.RepositoryException; import org.eclipse.aether.collection.DependencyGraphTransformationContext; import org.eclipse.aether.collection.DependencyGraphTransformer; diff --git a/aether-util/src/main/java/org/eclipse/aether/util/graph/transformer/ConflictIdSorter.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/ConflictIdSorter.java similarity index 91% rename from aether-util/src/main/java/org/eclipse/aether/util/graph/transformer/ConflictIdSorter.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/ConflictIdSorter.java index 81f07c2b3..5cc6432d7 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/graph/transformer/ConflictIdSorter.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/ConflictIdSorter.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.transformer; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Collection; import java.util.Collections; @@ -54,7 +63,7 @@ public DependencyNode transformGraph( DependencyNode node, DependencyGraphTransf @SuppressWarnings( "unchecked" ) Map stats = (Map) context.get( TransformationContextKeys.STATS ); - long time1 = System.currentTimeMillis(); + long time1 = System.nanoTime(); Map ids = new LinkedHashMap( 256 ); @@ -72,13 +81,13 @@ public DependencyNode transformGraph( DependencyNode node, DependencyGraphTransf buildConflitIdDAG( ids, node, id, 0, visited, conflictIds ); } - long time2 = System.currentTimeMillis(); + long time2 = System.nanoTime(); int cycles = topsortConflictIds( ids.values(), context ); if ( stats != null ) { - long time3 = System.currentTimeMillis(); + long time3 = System.nanoTime(); stats.put( "ConflictIdSorter.graphTime", time2 - time1 ); stats.put( "ConflictIdSorter.topsortTime", time3 - time2 ); stats.put( "ConflictIdSorter.conflictIdCount", ids.size() ); diff --git a/aether-util/src/main/java/org/eclipse/aether/util/graph/transformer/ConflictMarker.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/ConflictMarker.java similarity index 90% rename from aether-util/src/main/java/org/eclipse/aether/util/graph/transformer/ConflictMarker.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/ConflictMarker.java index 7aba1ffb8..fe2f5d58a 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/graph/transformer/ConflictMarker.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/ConflictMarker.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.transformer; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import java.util.Collection; import java.util.Collections; import java.util.HashMap; @@ -46,14 +55,14 @@ public DependencyNode transformGraph( DependencyNode node, DependencyGraphTransf { @SuppressWarnings( "unchecked" ) Map stats = (Map) context.get( TransformationContextKeys.STATS ); - long time1 = System.currentTimeMillis(); + long time1 = System.nanoTime(); Map nodes = new IdentityHashMap( 1024 ); Map groups = new HashMap( 1024 ); analyze( node, nodes, groups, new int[] { 0 } ); - long time2 = System.currentTimeMillis(); + long time2 = System.nanoTime(); Map conflictIds = mark( nodes.keySet(), groups ); @@ -61,7 +70,7 @@ public DependencyNode transformGraph( DependencyNode node, DependencyGraphTransf if ( stats != null ) { - long time3 = System.currentTimeMillis(); + long time3 = System.nanoTime(); stats.put( "ConflictMarker.analyzeTime", time2 - time1 ); stats.put( "ConflictMarker.markTime", time3 - time2 ); stats.put( "ConflictMarker.nodeCount", nodes.size() ); diff --git a/aether-util/src/main/java/org/eclipse/aether/util/graph/transformer/ConflictResolver.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/ConflictResolver.java similarity index 96% rename from aether-util/src/main/java/org/eclipse/aether/util/graph/transformer/ConflictResolver.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/ConflictResolver.java index 7ce968554..6ccc5086f 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/graph/transformer/ConflictResolver.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/ConflictResolver.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2012, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.transformer; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Collection; @@ -135,7 +144,7 @@ public DependencyNode transformGraph( DependencyNode node, DependencyGraphTransf @SuppressWarnings( "unchecked" ) Map stats = (Map) context.get( TransformationContextKeys.STATS ); - long time1 = System.currentTimeMillis(); + long time1 = System.nanoTime(); @SuppressWarnings( "unchecked" ) Collection> conflictIdCycles = @@ -222,7 +231,7 @@ public DependencyNode transformGraph( DependencyNode node, DependencyGraphTransf if ( stats != null ) { - long time2 = System.currentTimeMillis(); + long time2 = System.nanoTime(); stats.put( "ConflictResolver.totalTime", time2 - time1 ); stats.put( "ConflictResolver.conflictItemCount", state.totalConflictItems ); } @@ -292,7 +301,7 @@ private void removeLosers( State state ) loser.setData( NODE_DATA_ORIGINAL_SCOPE, loser.getDependency().getScope() ); loser.setData( NODE_DATA_ORIGINAL_OPTIONALITY, loser.getDependency().isOptional() ); loser.setScope( item.getScopes().iterator().next() ); - loser.setChildren( Collections. emptyList() ); + loser.setChildren( Collections.emptyList() ); childIt.set( loser ); } else @@ -1144,9 +1153,11 @@ public String toString() * An extension point of {@link ConflictResolver} that determines the winner among conflicting dependencies. The * winning node (and its children) will be retained in the dependency graph, the other nodes will get removed. The * version selector does not need to deal with potential scope conflicts, these will be addressed afterwards by the - * {@link ScopeSelector}. Implementations must be stateless. + * {@link ScopeSelector}. + *

+ * Note: Implementations must be stateless. */ - public static abstract class VersionSelector + public abstract static class VersionSelector { /** @@ -1154,7 +1165,7 @@ public static abstract class VersionSelector * this method once per * {@link ConflictResolver#transformGraph(DependencyNode, DependencyGraphTransformationContext)} invocation to * allow implementations to prepare any auxiliary data that is needed for their operation. Given that - * implementations need to be stateless, a new instance needs to be returned to hold such auxiliary data. The + * implementations must be stateless, a new instance needs to be returned to hold such auxiliary data. The * default implementation simply returns the current instance which is appropriate for implementations which do * not require auxiliary data. * @@ -1186,9 +1197,11 @@ public abstract void selectVersion( ConflictContext context ) /** * An extension point of {@link ConflictResolver} that determines the effective scope of a dependency from a * potentially conflicting set of {@link ScopeDeriver derived scopes}. The scope selector gets invoked after the - * {@link VersionSelector} has picked the winning node. Implementations must be stateless. + * {@link VersionSelector} has picked the winning node. + *

+ * Note: Implementations must be stateless. */ - public static abstract class ScopeSelector + public abstract static class ScopeSelector { /** @@ -1196,7 +1209,7 @@ public static abstract class ScopeSelector * this method once per * {@link ConflictResolver#transformGraph(DependencyNode, DependencyGraphTransformationContext)} invocation to * allow implementations to prepare any auxiliary data that is needed for their operation. Given that - * implementations need to be stateless, a new instance needs to be returned to hold such auxiliary data. The + * implementations must be stateless, a new instance needs to be returned to hold such auxiliary data. The * default implementation simply returns the current instance which is appropriate for implementations which do * not require auxiliary data. * @@ -1227,9 +1240,11 @@ public abstract void selectScope( ConflictContext context ) /** * An extension point of {@link ConflictResolver} that determines the scope of a dependency in relation to the scope - * of its parent. Implementations must be stateless. + * of its parent. + *

+ * Note: Implementations must be stateless. */ - public static abstract class ScopeDeriver + public abstract static class ScopeDeriver { /** @@ -1237,7 +1252,7 @@ public static abstract class ScopeDeriver * this method once per * {@link ConflictResolver#transformGraph(DependencyNode, DependencyGraphTransformationContext)} invocation to * allow implementations to prepare any auxiliary data that is needed for their operation. Given that - * implementations need to be stateless, a new instance needs to be returned to hold such auxiliary data. The + * implementations must be stateless, a new instance needs to be returned to hold such auxiliary data. The * default implementation simply returns the current instance which is appropriate for implementations which do * not require auxiliary data. * @@ -1268,9 +1283,11 @@ public abstract void deriveScope( ScopeContext context ) /** * An extension point of {@link ConflictResolver} that determines the effective optional flag of a dependency from a * potentially conflicting set of derived optionalities. The optionality selector gets invoked after the - * {@link VersionSelector} has picked the winning node. Implementations must be stateless. + * {@link VersionSelector} has picked the winning node. + *

+ * Note: Implementations must be stateless. */ - public static abstract class OptionalitySelector + public abstract static class OptionalitySelector { /** @@ -1278,7 +1295,7 @@ public static abstract class OptionalitySelector * calls this method once per * {@link ConflictResolver#transformGraph(DependencyNode, DependencyGraphTransformationContext)} invocation to * allow implementations to prepare any auxiliary data that is needed for their operation. Given that - * implementations need to be stateless, a new instance needs to be returned to hold such auxiliary data. The + * implementations must be stateless, a new instance needs to be returned to hold such auxiliary data. The * default implementation simply returns the current instance which is appropriate for implementations which do * not require auxiliary data. * diff --git a/aether-util/src/main/java/org/eclipse/aether/util/graph/transformer/JavaDependencyContextRefiner.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/JavaDependencyContextRefiner.java similarity index 72% rename from aether-util/src/main/java/org/eclipse/aether/util/graph/transformer/JavaDependencyContextRefiner.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/JavaDependencyContextRefiner.java index 0f0781a14..d96e04e27 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/graph/transformer/JavaDependencyContextRefiner.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/JavaDependencyContextRefiner.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.transformer; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.RepositoryException; import org.eclipse.aether.collection.DependencyGraphTransformationContext; import org.eclipse.aether.collection.DependencyGraphTransformer; diff --git a/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/JavaDependencyMediator.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/JavaDependencyMediator.java new file mode 100644 index 000000000..441b6dfba --- /dev/null +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/JavaDependencyMediator.java @@ -0,0 +1,389 @@ +package org.eclipse.aether.util.graph.transformer; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +import org.eclipse.aether.RepositoryException; +import org.eclipse.aether.collection.DependencyGraphTransformationContext; +import org.eclipse.aether.collection.DependencyGraphTransformer; +import org.eclipse.aether.graph.DependencyNode; +import org.eclipse.aether.util.artifact.JavaScopes; + +/** + * A {@code DependencyGraphTransformer} applying the Maven dependency mediation mechanism. + * + * @author Christian Schulte + * @since 1.2 + * @see Introduction to the Dependency Mechanism + */ +public final class JavaDependencyMediator + implements DependencyGraphTransformer +{ + + private static final Map APPLICATION_SCOPE_PRIORITIES = new HashMap( 5 ); + + private static final Map TEST_SCOPE_PRIORITIES = new HashMap( 5 ); + + static + { + APPLICATION_SCOPE_PRIORITIES.put( JavaScopes.TEST, 0 ); + APPLICATION_SCOPE_PRIORITIES.put( JavaScopes.RUNTIME, 1 ); + APPLICATION_SCOPE_PRIORITIES.put( JavaScopes.PROVIDED, 2 ); + APPLICATION_SCOPE_PRIORITIES.put( JavaScopes.COMPILE, 3 ); + APPLICATION_SCOPE_PRIORITIES.put( JavaScopes.SYSTEM, 4 ); + + TEST_SCOPE_PRIORITIES.put( JavaScopes.RUNTIME, 0 ); + TEST_SCOPE_PRIORITIES.put( JavaScopes.PROVIDED, 1 ); + TEST_SCOPE_PRIORITIES.put( JavaScopes.COMPILE, 2 ); + TEST_SCOPE_PRIORITIES.put( JavaScopes.TEST, 3 ); + TEST_SCOPE_PRIORITIES.put( JavaScopes.SYSTEM, 4 ); + } + + /** + * Application scope nodes are prioritized over non application scope nodes. + */ + public static final int APPLICATION_SCOPE_PRIORITIZATION = 1 << 1; + + /** + * Test scope nodes are prioritized over non test scope nodes. + */ + public static final int TEST_SCOPE_PRIORITIZATION = 1 << 2; + + /** + * Nearest wins only strategy. No scopes are prioritized. + */ + public static final int NO_PRIORITIZATION = 1 << 3; + + /** + * The prioritization to apply. + */ + private final int prioritization; + + /** + * Creates a new {@code DependencyGraphTransformer}. + * + * @param prioritization The prioritization to apply. + * + * @see #APPLICATION_SCOPE_PRIORITIZATION + * @see #TEST_SCOPE_PRIORITIZATION + * @see #NO_PRIORITIZATION + */ + public JavaDependencyMediator( final int prioritization ) + { + super(); + this.prioritization = prioritization; + } + + @Override + public DependencyNode transformGraph( final DependencyNode node, + final DependencyGraphTransformationContext context ) + throws RepositoryException + { + DependencyNode result = node; + result = this.removeNonTransitiveNodes( result ); + result = this.updateTransitiveScopes( result ); + + for ( ;; ) + { + if ( this.removeDuplicateNodes( result, result, new HashMap( 8192 ), + new HashMap( 8192 ) ) ) + { + break; + } + } + + return result; + } + + private DependencyNode removeNonTransitiveNodes( final DependencyNode parent ) + { + final String parentScope = parent.getDependency() != null + ? parent.getDependency().getScope() != null + && parent.getDependency().getScope().length() >= 0 + ? parent.getDependency().getScope() + : JavaScopes.COMPILE + : null; + + for ( final Iterator it = parent.getChildren().iterator(); it.hasNext(); ) + { + final DependencyNode child = it.next(); + + recurse: + { + if ( parentScope != null ) + { + String childScope = child.getDependency().getScope() != null + && child.getDependency().getScope().length() >= 0 + ? child.getDependency().getScope() + : JavaScopes.COMPILE; + + // Provided and test scopes are non-transitive. + // Optional dependencies are non-transitive. + if ( JavaScopes.PROVIDED.equals( childScope ) + || JavaScopes.TEST.equals( childScope ) + || child.getDependency().isOptional() ) + { + it.remove(); + break recurse; + } + } + + this.removeNonTransitiveNodes( child ); + } + } + + return parent; + } + + private DependencyNode updateTransitiveScopes( final DependencyNode parent ) + { + final String parentScope = parent.getDependency() != null + ? parent.getDependency().getScope() != null + && parent.getDependency().getScope().length() >= 0 + ? parent.getDependency().getScope() + : JavaScopes.COMPILE + : null; + + for ( final DependencyNode child : parent.getChildren() ) + { + if ( parentScope != null ) + { + String childScope = child.getDependency().getScope() != null + && child.getDependency().getScope().length() >= 0 + ? child.getDependency().getScope() + : JavaScopes.COMPILE; + + if ( ( child.getManagedBits() & DependencyNode.MANAGED_SCOPE ) == 0 ) + { + // Non-managed child scopes are updated according to the table in the "Dependency Scope" section + // of the "Introduction to the Dependency Mechanism" document. + + if ( JavaScopes.PROVIDED.equals( parentScope ) ) + { + // Compile and runtime become provided. + if ( JavaScopes.COMPILE.equals( childScope ) + || JavaScopes.RUNTIME.equals( childScope ) ) + { + childScope = JavaScopes.PROVIDED; + child.setScope( childScope ); + } + } + else if ( JavaScopes.RUNTIME.equals( parentScope ) ) + { + // Compile becomes runtime. + if ( JavaScopes.COMPILE.equals( childScope ) ) + { + childScope = JavaScopes.RUNTIME; + child.setScope( childScope ); + } + } + else if ( JavaScopes.TEST.equals( parentScope ) ) + { + // Compile and runtime become test. + if ( JavaScopes.COMPILE.equals( childScope ) + || JavaScopes.RUNTIME.equals( childScope ) ) + { + childScope = JavaScopes.TEST; + child.setScope( childScope ); + } + } + } + } + + this.updateTransitiveScopes( child ); + } + + return parent; + } + + private boolean removeDuplicateNodes( final DependencyNode rootNode, + final DependencyNode candidateNode, + final Map winnerNodes, + final Map looserNodes ) + { + boolean restart = false; + + recurse: + { + if ( candidateNode.getDependency() != null ) + { + final ConflictMarker.Key candidateKey = new ConflictMarker.Key( candidateNode.getArtifact() ); + final DependencyNode winnerNode = winnerNodes.get( candidateKey ); + + if ( winnerNode == null ) + { + // Conflict not yet seen. Candidate is selected. + winnerNodes.put( candidateKey, candidateNode ); + } + else if ( this.isPreferredNode( winnerNode, candidateNode ) ) + { + // Conflict already seen. Candidate is preferred. + winnerNodes.put( candidateKey, candidateNode ); + looserNodes.put( candidateNode, winnerNode ); + + if ( winnerNode.getParent() != null ) + { + winnerNode.getParent().getChildren().remove( winnerNode ); + } + else + { + rootNode.getChildren().remove( winnerNode ); + } + + final DependencyNode winningChild = getWinningChild( winnerNode, winnerNodes.values() ); + + if ( winningChild != null ) + { + // The node eliminated by the current candidate node contains a child node which has been + // selected the winner in a previous iteration. As that winner is eliminated in this iteration, + // the former looser needs to be re-added and the whole transformation re-started (undo and + // restart). No need to maintain the maps here because they are thrown away when restarting. + // Doing it for completeness, however. + final DependencyNode looserNode = looserNodes.remove( winningChild ); // Can be get(). + + if ( looserNode != null ) + { + if ( looserNode.getParent() != null ) + { + if ( !looserNode.getParent().getChildren().contains( looserNode ) ) + { + looserNode.getParent().getChildren().add( looserNode ); + } + } + else if ( !rootNode.getChildren().contains( looserNode ) ) + { + rootNode.getChildren().add( looserNode ); + } + + // Not needed, but... + final DependencyNode winner = + winnerNodes.remove( new ConflictMarker.Key( looserNode.getArtifact() ) ); + + if ( winner != null ) + { + looserNodes.remove( winner ); + } + } + + restart = true; + break recurse; + } + } + else + { + // Conflict already seen. Candidate is not preferred. + looserNodes.put( winnerNode, candidateNode ); + if ( candidateNode.getParent() != null ) + { + candidateNode.getParent().getChildren().remove( candidateNode ); + } + else + { + rootNode.getChildren().remove( candidateNode ); + } + // No need to inspect children. + break recurse; + } + } + + for ( final DependencyNode child : new ArrayList( candidateNode.getChildren() ) ) + { + if ( !this.removeDuplicateNodes( rootNode, child, winnerNodes, looserNodes ) ) + { + restart = true; + break recurse; + } + } + } + + return !restart; + } + + private boolean isPreferredNode( final DependencyNode existing, final DependencyNode candidate ) + { + boolean preferred = false; + Integer p1 = null; + Integer p2 = null; + boolean prioritize = true; + + if ( this.prioritization == APPLICATION_SCOPE_PRIORITIZATION ) + { + p1 = APPLICATION_SCOPE_PRIORITIES.get( existing.getDependency().getScope() ); + p2 = APPLICATION_SCOPE_PRIORITIES.get( candidate.getDependency().getScope() ); + } + else if ( this.prioritization == TEST_SCOPE_PRIORITIZATION ) + { + p1 = TEST_SCOPE_PRIORITIES.get( existing.getDependency().getScope() ); + p2 = TEST_SCOPE_PRIORITIES.get( candidate.getDependency().getScope() ); + } + else if ( this.prioritization == NO_PRIORITIZATION ) + { + prioritize = false; + } + else + { + throw new AssertionError( this.prioritization ); + } + + final Boolean candidateScopePrioritized = p1 != null && p2 != null ? p2 > p1 : false; + final boolean equalPriority = + existing.getDependency().getScope().equals( candidate.getDependency().getScope() ); + + if ( candidate.getDepth() < existing.getDepth() ) + { + preferred = !prioritize || equalPriority || candidateScopePrioritized; + } + else if ( candidate.getDepth() == existing.getDepth() ) + { + preferred = prioritize && !equalPriority && candidateScopePrioritized; + } + + return preferred; + } + + private static DependencyNode getWinningChild( final DependencyNode node, + final Collection winnerNodes ) + { + DependencyNode winningChild = winnerNodes.contains( node ) + ? node + : null; + + if ( winningChild == null ) + { + for ( final DependencyNode child : node.getChildren() ) + { + winningChild = getWinningChild( child, winnerNodes ); + + if ( winningChild != null ) + { + break; + } + } + } + + return winningChild; + } + +} diff --git a/aether-util/src/main/java/org/eclipse/aether/util/graph/transformer/JavaScopeDeriver.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/JavaScopeDeriver.java similarity index 67% rename from aether-util/src/main/java/org/eclipse/aether/util/graph/transformer/JavaScopeDeriver.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/JavaScopeDeriver.java index 06b3a4cbc..4c5fd3e2a 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/graph/transformer/JavaScopeDeriver.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/JavaScopeDeriver.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2012, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.transformer; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.RepositoryException; import org.eclipse.aether.util.artifact.JavaScopes; import org.eclipse.aether.util.graph.transformer.ConflictResolver.ScopeContext; diff --git a/aether-util/src/main/java/org/eclipse/aether/util/graph/transformer/JavaScopeSelector.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/JavaScopeSelector.java similarity index 76% rename from aether-util/src/main/java/org/eclipse/aether/util/graph/transformer/JavaScopeSelector.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/JavaScopeSelector.java index 17db0040f..93edf05a5 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/graph/transformer/JavaScopeSelector.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/JavaScopeSelector.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2012, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.transformer; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import java.util.Collection; import java.util.HashSet; import java.util.Set; diff --git a/aether-util/src/main/java/org/eclipse/aether/util/graph/transformer/NearestVersionSelector.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/NearestVersionSelector.java similarity index 86% rename from aether-util/src/main/java/org/eclipse/aether/util/graph/transformer/NearestVersionSelector.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/NearestVersionSelector.java index 68c35041e..c1ffa858e 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/graph/transformer/NearestVersionSelector.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/NearestVersionSelector.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2012, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.transformer; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Collection; import java.util.HashSet; diff --git a/aether-util/src/main/java/org/eclipse/aether/util/graph/transformer/NoopDependencyGraphTransformer.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/NoopDependencyGraphTransformer.java similarity index 57% rename from aether-util/src/main/java/org/eclipse/aether/util/graph/transformer/NoopDependencyGraphTransformer.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/NoopDependencyGraphTransformer.java index c3ac32e24..55b61755b 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/graph/transformer/NoopDependencyGraphTransformer.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/NoopDependencyGraphTransformer.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.transformer; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.RepositoryException; import org.eclipse.aether.collection.DependencyGraphTransformationContext; import org.eclipse.aether.collection.DependencyGraphTransformer; diff --git a/aether-util/src/main/java/org/eclipse/aether/util/graph/transformer/SimpleOptionalitySelector.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/SimpleOptionalitySelector.java similarity index 65% rename from aether-util/src/main/java/org/eclipse/aether/util/graph/transformer/SimpleOptionalitySelector.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/SimpleOptionalitySelector.java index f6a5157dc..0cc7a730f 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/graph/transformer/SimpleOptionalitySelector.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/SimpleOptionalitySelector.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.transformer; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import java.util.Collection; import org.eclipse.aether.RepositoryException; diff --git a/aether-util/src/main/java/org/eclipse/aether/util/graph/transformer/TransformationContextKeys.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/TransformationContextKeys.java similarity index 69% rename from aether-util/src/main/java/org/eclipse/aether/util/graph/transformer/TransformationContextKeys.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/TransformationContextKeys.java index 4abe2d350..a9ebf68de 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/graph/transformer/TransformationContextKeys.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/TransformationContextKeys.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.transformer; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT 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 collection of keys used by the dependency graph transformers when exchanging information via the graph * transformation context. diff --git a/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/package-info.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/package-info.java new file mode 100644 index 000000000..ffa55149e --- /dev/null +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/transformer/package-info.java @@ -0,0 +1,24 @@ +// CHECKSTYLE_OFF: RegexpHeader +/** + * Various dependency graph transformers for post-processing a dependency graph. + */ +package org.eclipse.aether.util.graph.transformer; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ diff --git a/aether-util/src/main/java/org/eclipse/aether/util/graph/traverser/AndDependencyTraverser.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/traverser/AndDependencyTraverser.java similarity index 87% rename from aether-util/src/main/java/org/eclipse/aether/util/graph/traverser/AndDependencyTraverser.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/traverser/AndDependencyTraverser.java index 9d286eac1..fb08b3b53 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/graph/traverser/AndDependencyTraverser.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/traverser/AndDependencyTraverser.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.traverser; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Arrays; import java.util.Collection; import java.util.Collections; diff --git a/aether-util/src/main/java/org/eclipse/aether/util/graph/traverser/FatArtifactTraverser.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/traverser/FatArtifactTraverser.java similarity index 65% rename from aether-util/src/main/java/org/eclipse/aether/util/graph/traverser/FatArtifactTraverser.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/traverser/FatArtifactTraverser.java index dbafa2126..40ce61692 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/graph/traverser/FatArtifactTraverser.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/traverser/FatArtifactTraverser.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.traverser; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.artifact.ArtifactProperties; import org.eclipse.aether.collection.DependencyCollectionContext; import org.eclipse.aether.collection.DependencyTraverser; diff --git a/aether-util/src/main/java/org/eclipse/aether/util/graph/traverser/StaticDependencyTraverser.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/traverser/StaticDependencyTraverser.java similarity index 64% rename from aether-util/src/main/java/org/eclipse/aether/util/graph/traverser/StaticDependencyTraverser.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/traverser/StaticDependencyTraverser.java index 01c103af7..5e2a703b9 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/graph/traverser/StaticDependencyTraverser.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/traverser/StaticDependencyTraverser.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.traverser; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.collection.DependencyCollectionContext; import org.eclipse.aether.collection.DependencyTraverser; import org.eclipse.aether.graph.Dependency; diff --git a/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/traverser/package-info.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/traverser/package-info.java new file mode 100644 index 000000000..9ae8cafde --- /dev/null +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/traverser/package-info.java @@ -0,0 +1,24 @@ +// CHECKSTYLE_OFF: RegexpHeader +/** + * Various dependency traversers for building a dependency graph. + */ +package org.eclipse.aether.util.graph.traverser; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ diff --git a/aether-util/src/main/java/org/eclipse/aether/util/graph/version/ChainedVersionFilter.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/version/ChainedVersionFilter.java similarity index 85% rename from aether-util/src/main/java/org/eclipse/aether/util/graph/version/ChainedVersionFilter.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/version/ChainedVersionFilter.java index 679c0256e..7d13555e5 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/graph/version/ChainedVersionFilter.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/version/ChainedVersionFilter.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.version; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Arrays; import java.util.Collection; diff --git a/aether-util/src/main/java/org/eclipse/aether/util/graph/version/ContextualSnapshotVersionFilter.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/version/ContextualSnapshotVersionFilter.java similarity index 78% rename from aether-util/src/main/java/org/eclipse/aether/util/graph/version/ContextualSnapshotVersionFilter.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/version/ContextualSnapshotVersionFilter.java index 1c7caf8d0..569bf4cbe 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/graph/version/ContextualSnapshotVersionFilter.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/version/ContextualSnapshotVersionFilter.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.version; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.collection.DependencyCollectionContext; diff --git a/aether-util/src/main/java/org/eclipse/aether/util/graph/version/HighestVersionFilter.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/version/HighestVersionFilter.java similarity index 61% rename from aether-util/src/main/java/org/eclipse/aether/util/graph/version/HighestVersionFilter.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/version/HighestVersionFilter.java index da5df9c32..902e08d86 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/graph/version/HighestVersionFilter.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/version/HighestVersionFilter.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.version; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.eclipse.aether.collection.DependencyCollectionContext; diff --git a/aether-util/src/main/java/org/eclipse/aether/util/graph/version/SnapshotVersionFilter.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/version/SnapshotVersionFilter.java similarity index 63% rename from aether-util/src/main/java/org/eclipse/aether/util/graph/version/SnapshotVersionFilter.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/version/SnapshotVersionFilter.java index 69fc7bbdd..6af7cf57d 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/graph/version/SnapshotVersionFilter.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/version/SnapshotVersionFilter.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.version; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.eclipse.aether.collection.DependencyCollectionContext; diff --git a/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/version/package-info.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/version/package-info.java new file mode 100644 index 000000000..c64c2cb2d --- /dev/null +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/version/package-info.java @@ -0,0 +1,24 @@ +// CHECKSTYLE_OFF: RegexpHeader +/** + * Various version filters for building a dependency graph. + */ +package org.eclipse.aether.util.graph.version; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ diff --git a/aether-util/src/main/java/org/eclipse/aether/util/graph/visitor/AbstractDepthFirstNodeListGenerator.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/visitor/AbstractDepthFirstNodeListGenerator.java similarity index 87% rename from aether-util/src/main/java/org/eclipse/aether/util/graph/visitor/AbstractDepthFirstNodeListGenerator.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/visitor/AbstractDepthFirstNodeListGenerator.java index dcda7f173..70fc7d438 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/graph/visitor/AbstractDepthFirstNodeListGenerator.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/visitor/AbstractDepthFirstNodeListGenerator.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.visitor; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.graph.Dependency; import org.eclipse.aether.graph.DependencyNode; diff --git a/aether-util/src/main/java/org/eclipse/aether/util/graph/visitor/CloningDependencyVisitor.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/visitor/CloningDependencyVisitor.java similarity index 75% rename from aether-util/src/main/java/org/eclipse/aether/util/graph/visitor/CloningDependencyVisitor.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/visitor/CloningDependencyVisitor.java index 8aa421940..a39fc84af 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/graph/visitor/CloningDependencyVisitor.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/visitor/CloningDependencyVisitor.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.visitor; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.IdentityHashMap; import java.util.Map; diff --git a/aether-util/src/main/java/org/eclipse/aether/util/graph/visitor/FilteringDependencyVisitor.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/visitor/FilteringDependencyVisitor.java similarity index 75% rename from aether-util/src/main/java/org/eclipse/aether/util/graph/visitor/FilteringDependencyVisitor.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/visitor/FilteringDependencyVisitor.java index 4113b8b2a..49f779c86 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/graph/visitor/FilteringDependencyVisitor.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/visitor/FilteringDependencyVisitor.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.visitor; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.graph.DependencyFilter; import org.eclipse.aether.graph.DependencyNode; import org.eclipse.aether.graph.DependencyVisitor; diff --git a/aether-util/src/main/java/org/eclipse/aether/util/graph/visitor/PathRecordingDependencyVisitor.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/visitor/PathRecordingDependencyVisitor.java similarity index 82% rename from aether-util/src/main/java/org/eclipse/aether/util/graph/visitor/PathRecordingDependencyVisitor.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/visitor/PathRecordingDependencyVisitor.java index 7633a114d..d1814edb8 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/graph/visitor/PathRecordingDependencyVisitor.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/visitor/PathRecordingDependencyVisitor.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.visitor; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.IdentityHashMap; diff --git a/aether-util/src/main/java/org/eclipse/aether/util/graph/visitor/PostorderNodeListGenerator.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/visitor/PostorderNodeListGenerator.java similarity index 60% rename from aether-util/src/main/java/org/eclipse/aether/util/graph/visitor/PostorderNodeListGenerator.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/visitor/PostorderNodeListGenerator.java index 1c36c71da..47897a72b 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/graph/visitor/PostorderNodeListGenerator.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/visitor/PostorderNodeListGenerator.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.visitor; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.graph.DependencyNode; /** diff --git a/aether-util/src/main/java/org/eclipse/aether/util/graph/visitor/PreorderNodeListGenerator.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/visitor/PreorderNodeListGenerator.java similarity index 54% rename from aether-util/src/main/java/org/eclipse/aether/util/graph/visitor/PreorderNodeListGenerator.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/visitor/PreorderNodeListGenerator.java index 1e43447a0..bd9b52abf 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/graph/visitor/PreorderNodeListGenerator.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/visitor/PreorderNodeListGenerator.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.visitor; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.graph.DependencyNode; /** diff --git a/aether-util/src/main/java/org/eclipse/aether/util/graph/visitor/Stack.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/visitor/Stack.java similarity index 65% rename from aether-util/src/main/java/org/eclipse/aether/util/graph/visitor/Stack.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/visitor/Stack.java index 81c4ba58d..27fbb4b32 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/graph/visitor/Stack.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/visitor/Stack.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.visitor; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.AbstractList; import java.util.NoSuchElementException; import java.util.RandomAccess; diff --git a/aether-util/src/main/java/org/eclipse/aether/util/graph/visitor/TreeDependencyVisitor.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/visitor/TreeDependencyVisitor.java similarity index 67% rename from aether-util/src/main/java/org/eclipse/aether/util/graph/visitor/TreeDependencyVisitor.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/visitor/TreeDependencyVisitor.java index 501eab171..f1658a894 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/graph/visitor/TreeDependencyVisitor.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/visitor/TreeDependencyVisitor.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.visitor; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.IdentityHashMap; import java.util.Map; diff --git a/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/visitor/package-info.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/visitor/package-info.java new file mode 100644 index 000000000..15ca26276 --- /dev/null +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/visitor/package-info.java @@ -0,0 +1,24 @@ +// CHECKSTYLE_OFF: RegexpHeader +/** + * Various dependency visitors for inspecting a dependency graph. + */ +package org.eclipse.aether.util.graph.visitor; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ diff --git a/aether-util/src/main/java/org/eclipse/aether/util/listener/ChainedRepositoryListener.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/listener/ChainedRepositoryListener.java similarity index 93% rename from aether-util/src/main/java/org/eclipse/aether/util/listener/ChainedRepositoryListener.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/listener/ChainedRepositoryListener.java index 15b050334..c654510d4 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/listener/ChainedRepositoryListener.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/listener/ChainedRepositoryListener.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.listener; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Arrays; import java.util.Collection; import java.util.List; diff --git a/aether-util/src/main/java/org/eclipse/aether/util/listener/ChainedTransferListener.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/listener/ChainedTransferListener.java similarity index 88% rename from aether-util/src/main/java/org/eclipse/aether/util/listener/ChainedTransferListener.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/listener/ChainedTransferListener.java index e9d8df650..d9431053e 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/listener/ChainedTransferListener.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/listener/ChainedTransferListener.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.listener; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Arrays; import java.util.Collection; import java.util.List; diff --git a/maven-resolver-util/src/main/java/org/eclipse/aether/util/listener/package-info.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/listener/package-info.java new file mode 100644 index 000000000..dce94364e --- /dev/null +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/listener/package-info.java @@ -0,0 +1,24 @@ +// CHECKSTYLE_OFF: RegexpHeader +/** + * Utilities to build repository and transfer listeners. + */ +package org.eclipse.aether.util.listener; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ diff --git a/maven-resolver-util/src/main/java/org/eclipse/aether/util/package-info.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/package-info.java new file mode 100644 index 000000000..53163109d --- /dev/null +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/package-info.java @@ -0,0 +1,24 @@ +// CHECKSTYLE_OFF: RegexpHeader +/** + * Miscellaneous utility classes. + */ +package org.eclipse.aether.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. + */ diff --git a/aether-util/src/main/java/org/eclipse/aether/util/repository/AuthenticationBuilder.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/repository/AuthenticationBuilder.java similarity index 90% rename from aether-util/src/main/java/org/eclipse/aether/util/repository/AuthenticationBuilder.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/repository/AuthenticationBuilder.java index fad05287d..bc69e851b 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/repository/AuthenticationBuilder.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/repository/AuthenticationBuilder.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2012, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.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.List; diff --git a/aether-util/src/main/java/org/eclipse/aether/util/repository/ChainedAuthentication.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/repository/ChainedAuthentication.java similarity index 76% rename from aether-util/src/main/java/org/eclipse/aether/util/repository/ChainedAuthentication.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/repository/ChainedAuthentication.java index 96968a0e7..40dae3f04 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/repository/ChainedAuthentication.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/repository/ChainedAuthentication.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2012, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.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.Arrays; import java.util.Collection; import java.util.Map; diff --git a/aether-util/src/main/java/org/eclipse/aether/util/repository/ChainedWorkspaceReader.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/repository/ChainedWorkspaceReader.java similarity index 83% rename from aether-util/src/main/java/org/eclipse/aether/util/repository/ChainedWorkspaceReader.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/repository/ChainedWorkspaceReader.java index 913a42076..0a9b8f69a 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/repository/ChainedWorkspaceReader.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/repository/ChainedWorkspaceReader.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.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.File; import java.util.ArrayList; import java.util.Collection; diff --git a/aether-util/src/main/java/org/eclipse/aether/util/repository/ComponentAuthentication.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/repository/ComponentAuthentication.java similarity index 71% rename from aether-util/src/main/java/org/eclipse/aether/util/repository/ComponentAuthentication.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/repository/ComponentAuthentication.java index da822f0f3..af83c9d92 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/repository/ComponentAuthentication.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/repository/ComponentAuthentication.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.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.Map; import org.eclipse.aether.repository.Authentication; diff --git a/aether-util/src/main/java/org/eclipse/aether/util/repository/ConservativeAuthenticationSelector.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/repository/ConservativeAuthenticationSelector.java similarity index 62% rename from aether-util/src/main/java/org/eclipse/aether/util/repository/ConservativeAuthenticationSelector.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/repository/ConservativeAuthenticationSelector.java index 498f7dc2b..6e727e5c4 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/repository/ConservativeAuthenticationSelector.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/repository/ConservativeAuthenticationSelector.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.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.eclipse.aether.repository.Authentication; import org.eclipse.aether.repository.AuthenticationSelector; import org.eclipse.aether.repository.RemoteRepository; diff --git a/aether-util/src/main/java/org/eclipse/aether/util/repository/ConservativeProxySelector.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/repository/ConservativeProxySelector.java similarity index 59% rename from aether-util/src/main/java/org/eclipse/aether/util/repository/ConservativeProxySelector.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/repository/ConservativeProxySelector.java index b23d85470..437c719bd 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/repository/ConservativeProxySelector.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/repository/ConservativeProxySelector.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.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.eclipse.aether.repository.Proxy; import org.eclipse.aether.repository.ProxySelector; import org.eclipse.aether.repository.RemoteRepository; diff --git a/aether-util/src/main/java/org/eclipse/aether/util/repository/DefaultAuthenticationSelector.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/repository/DefaultAuthenticationSelector.java similarity index 61% rename from aether-util/src/main/java/org/eclipse/aether/util/repository/DefaultAuthenticationSelector.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/repository/DefaultAuthenticationSelector.java index 45164eca7..a5d4ce3c9 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/repository/DefaultAuthenticationSelector.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/repository/DefaultAuthenticationSelector.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.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.HashMap; import java.util.Map; diff --git a/maven-resolver-util/src/main/java/org/eclipse/aether/util/repository/DefaultMirrorSelector.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/repository/DefaultMirrorSelector.java new file mode 100644 index 000000000..7a775990b --- /dev/null +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/repository/DefaultMirrorSelector.java @@ -0,0 +1,300 @@ +package org.eclipse.aether.util.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.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.List; + +import org.eclipse.aether.repository.MirrorSelector; +import org.eclipse.aether.repository.RemoteRepository; + +/** + * A simple mirror selector that selects mirrors based on repository identifiers. + */ +public final class DefaultMirrorSelector + implements MirrorSelector +{ + + private static final String WILDCARD = "*"; + + private static final String EXTERNAL_WILDCARD = "external:*"; + + private final List mirrors = new ArrayList(); + + /** + * Adds the specified mirror to this selector. + * + * @param id The identifier of the mirror, may be {@code null}. + * @param url The URL of the mirror, may be {@code null}. + * @param type The content type of the mirror, may be {@code null}. + * @param repositoryManager A flag whether the mirror is a repository manager or a simple server. + * @param mirrorOfIds The identifier(s) of remote repositories to mirror, may be {@code null}. Multiple identifiers + * can be separated by comma (',') and surrounding whitespace is trimmed. Additionally the wildcards "*" + * and "external:*" can be used to match all (external) repositories, prefixing a repo id with an + * exclamation mark allows to express an exclusion. For example "external:*,!central". + * @param mirrorOfTypes The content type(s) of remote repositories to mirror, may be {@code null} or empty to match + * any content type. Multiple types can be separated by comma (',') and surrounding whitespace is + * trimmed. The wildcard "*" and the "!" negation syntax are also supported. For example "*,!p2". + * @return This selector for chaining, never {@code null}. + */ + public DefaultMirrorSelector add( String id, String url, String type, boolean repositoryManager, + String mirrorOfIds, String mirrorOfTypes ) + { + return add( id, url, type, repositoryManager, split( mirrorOfIds ), split( mirrorOfTypes ) ); + } + + /** + * Adds the specified mirror to this selector. + * + * @param id The identifier of the mirror, may be {@code null}. + * @param url The URL of the mirror, may be {@code null}. + * @param type The content type of the mirror, may be {@code null}. + * @param repositoryManager A flag whether the mirror is a repository manager or a simple server. + * @param mirrorOfIds The identifier(s) of remote repositories to mirror, may be {@code null}. The wildcards "*" and + * "external:*" can be used to match all (external) repositories, prefixing a repo id with an exclamation + * mark allows to express an exclusion. For example "external:*", "!central". + * @param mirrorOfTypes The content type(s) of remote repositories to mirror, may be {@code null} or empty to match + * any content type. The wildcard "*" and the "!" negation syntax are also supported. For example "*", + * "!p2". + * @return This selector for chaining, never {@code null}. + * @since 1.1.0 + */ + public DefaultMirrorSelector add( String id, String url, String type, boolean repositoryManager, + Collection mirrorOfIds, Collection mirrorOfTypes ) + { + mirrors.add( new MirrorDef( id, url, type, repositoryManager, mirrorOfIds, mirrorOfTypes ) ); + + return this; + } + + public RemoteRepository getMirror( RemoteRepository repository ) + { + MirrorDef mirror = findMirror( repository ); + + if ( mirror == null ) + { + return null; + } + + RemoteRepository.Builder builder = + new RemoteRepository.Builder( mirror.id, repository.getContentType(), mirror.url ); + + builder.setRepositoryManager( mirror.repositoryManager ); + + if ( mirror.type != null && mirror.type.length() > 0 ) + { + builder.setContentType( mirror.type ); + } + + builder.setSnapshotPolicy( repository.getPolicy( true ) ); + builder.setReleasePolicy( repository.getPolicy( false ) ); + + builder.setMirroredRepositories( Collections.singletonList( repository ) ); + + return builder.build(); + } + + private MirrorDef findMirror( RemoteRepository repository ) + { + if ( !mirrors.isEmpty() ) + { + String repoId = repository.getId(); + String repoType = repository.getContentType(); + + for ( MirrorDef mirror : mirrors ) + { + if ( mirror.idMatcher.isExactMatch( repoId ) && mirror.typeMatcher.isMatch( repoType ) ) + { + return mirror; + } + } + + for ( MirrorDef mirror : mirrors ) + { + if ( mirror.idMatcher.isMatch( repository ) && mirror.typeMatcher.isMatch( repoType ) ) + { + return mirror; + } + } + } + + return null; + } + + static List split( String list ) + { + List tokens = null; + if ( list != null ) + { + tokens = Arrays.asList( list.trim().split( "\\s*,\\s*" ) ); + } + return tokens; + } + + static String[] clean( Collection tokens ) + { + List cleaned = new ArrayList(); + if ( tokens != null ) + { + for ( String token : tokens ) + { + if ( token != null && token.length() > 0 ) + { + cleaned.add( token ); + } + } + } + return cleaned.toArray( new String[cleaned.size()] ); + } + + static final class IdMatcher + { + + final String[] mirrorOfIds; + + public IdMatcher( Collection mirrorOfIds ) + { + this.mirrorOfIds = clean( mirrorOfIds ); + } + + boolean isExactMatch( String repoId ) + { + return mirrorOfIds.length == 1 && mirrorOfIds[0].equals( repoId ); + } + + boolean isMatch( RemoteRepository repository ) + { + boolean result = false; + if ( mirrorOfIds.length <= 0 ) + { + result = false; + } + else + { + String repoId = repository.getId(); + for ( String mirrorOfId : mirrorOfIds ) + { + if ( mirrorOfId.equals( repoId ) ) + { + result = true; + break; + } + else if ( mirrorOfId.startsWith( "!" ) && mirrorOfId.substring( 1 ).equals( repoId ) ) + { + result = false; + break; + } + else if ( EXTERNAL_WILDCARD.equals( mirrorOfId ) && isExternalRepo( repository ) ) + { + result = true; + } + else if ( WILDCARD.equals( mirrorOfId ) ) + { + result = true; + } + } + } + return result; + } + + static boolean isExternalRepo( RemoteRepository repository ) + { + boolean local = + "localhost".equals( repository.getHost() ) || "127.0.0.1".equals( repository.getHost() ) + || "file".equalsIgnoreCase( repository.getProtocol() ); + return !local; + } + + } + + static final class TypeMatcher + { + + final String[] mirrorOfTypes; + + public TypeMatcher( Collection mirrorOfTypes ) + { + this.mirrorOfTypes = clean( mirrorOfTypes ); + } + + boolean isMatch( String repoType ) + { + boolean result = false; + if ( mirrorOfTypes.length <= 0 ) + { + result = true; + } + else + { + for ( String mirrorOfType : mirrorOfTypes ) + { + if ( mirrorOfType.equals( repoType ) ) + { + result = true; + break; + } + else if ( mirrorOfType.startsWith( "!" ) && mirrorOfType.substring( 1 ).equals( repoType ) ) + { + result = false; + break; + } + else if ( WILDCARD.equals( mirrorOfType ) ) + { + result = true; + } + } + } + return result; + } + + } + + static final class MirrorDef + { + + final String id; + + final String url; + + final String type; + + final boolean repositoryManager; + + final IdMatcher idMatcher; + + final TypeMatcher typeMatcher; + + public MirrorDef( String id, String url, String type, boolean repositoryManager, + Collection mirrorOfIds, Collection mirrorOfTypes ) + { + this.id = id; + this.url = url; + this.type = type; + this.repositoryManager = repositoryManager; + this.idMatcher = new IdMatcher( mirrorOfIds ); + this.typeMatcher = new TypeMatcher( mirrorOfTypes ); + } + + } + +} diff --git a/maven-resolver-util/src/main/java/org/eclipse/aether/util/repository/DefaultProxySelector.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/repository/DefaultProxySelector.java new file mode 100644 index 000000000..522b0d761 --- /dev/null +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/repository/DefaultProxySelector.java @@ -0,0 +1,188 @@ +package org.eclipse.aether.util.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.Arrays; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.regex.Pattern; + +import org.eclipse.aether.repository.Proxy; +import org.eclipse.aether.repository.ProxySelector; +import org.eclipse.aether.repository.RemoteRepository; + +/** + * A simple proxy selector that selects the first matching proxy from a list of configured proxies. + */ +public final class DefaultProxySelector + implements ProxySelector +{ + + private List proxies = new ArrayList(); + + /** + * Adds the specified proxy definition to the selector. Proxy definitions are ordered, the first matching proxy for + * a given repository will be used. + * + * @param proxy The proxy definition to add, must not be {@code null}. + * @param nonProxyHosts The list of (case-insensitive) host names to exclude from proxying, may be {@code null}. The + * syntax of this list resembles that of the property "http.nonProxyHosts" from the JRE, i.e. the + * asterisk character ('*') serves as a wildcard for pattern matching. Multiple entries are separated by + * the pipe character ('|') or comma (',') and surrounding whitespace is trimmed. + * @return This proxy selector for chaining, never {@code null}. + */ + public DefaultProxySelector add( Proxy proxy, String nonProxyHosts ) + { + return add( proxy, NonProxyHosts.split( nonProxyHosts ) ); + } + + /** + * Adds the specified proxy definition to the selector. Proxy definitions are ordered, the first matching proxy for + * a given repository will be used. + * + * @param proxy The proxy definition to add, must not be {@code null}. + * @param nonProxyHosts The list of (case-insensitive) host names to exclude from proxying, may be {@code null}. The + * asterisk character ('*') may be used as wildcard in a host name. + * @return This proxy selector for chaining, never {@code null}. + * @since 1.1.0 + */ + public DefaultProxySelector add( Proxy proxy, Collection nonProxyHosts ) + { + if ( proxy == null ) + { + throw new IllegalArgumentException( "proxy not specified" ); + } + proxies.add( new ProxyDef( proxy, nonProxyHosts ) ); + + return this; + } + + public Proxy getProxy( RemoteRepository repository ) + { + Map candidates = new HashMap(); + + String host = repository.getHost(); + for ( ProxyDef proxy : proxies ) + { + if ( !proxy.nonProxyHosts.isNonProxyHost( host ) ) + { + String key = proxy.proxy.getType().toLowerCase( Locale.ENGLISH ); + if ( !candidates.containsKey( key ) ) + { + candidates.put( key, proxy ); + } + } + } + + String protocol = repository.getProtocol().toLowerCase( Locale.ENGLISH ); + + if ( "davs".equals( protocol ) ) + { + protocol = "https"; + } + else if ( "dav".equals( protocol ) ) + { + protocol = "http"; + } + else if ( protocol.startsWith( "dav:" ) ) + { + protocol = protocol.substring( "dav:".length() ); + } + + ProxyDef proxy = candidates.get( protocol ); + if ( proxy == null && "https".equals( protocol ) ) + { + proxy = candidates.get( "http" ); + } + + return ( proxy != null ) ? proxy.proxy : null; + } + + static class NonProxyHosts + { + + private final Pattern[] patterns; + + public NonProxyHosts( Collection nonProxyHosts ) + { + List patterns = new ArrayList(); + if ( nonProxyHosts != null ) + { + for ( String nonProxyHost : nonProxyHosts ) + { + if ( nonProxyHost == null || nonProxyHost.length() <= 0 ) + { + continue; + } + String pattern = nonProxyHost; + pattern = pattern.replace( ".", "\\." ).replace( "*", ".*" ); + patterns.add( Pattern.compile( pattern, Pattern.CASE_INSENSITIVE ) ); + } + } + this.patterns = patterns.toArray( new Pattern[patterns.size()] ); + } + + static List split( String nonProxyHosts ) + { + List hosts = null; + if ( nonProxyHosts != null ) + { + hosts = Arrays.asList( nonProxyHosts.trim().split( "\\s*[|,]\\s*" ) ); + } + return hosts; + } + + boolean isNonProxyHost( String host ) + { + if ( host != null ) + { + for ( Pattern pattern : patterns ) + { + if ( pattern.matcher( host ).matches() ) + { + return true; + } + } + } + return false; + } + + } + + static class ProxyDef + { + + final Proxy proxy; + + final NonProxyHosts nonProxyHosts; + + public ProxyDef( Proxy proxy, Collection nonProxyHosts ) + { + this.proxy = proxy; + this.nonProxyHosts = new NonProxyHosts( nonProxyHosts ); + } + + } + +} diff --git a/aether-util/src/main/java/org/eclipse/aether/util/repository/JreProxySelector.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/repository/JreProxySelector.java similarity index 87% rename from aether-util/src/main/java/org/eclipse/aether/util/repository/JreProxySelector.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/repository/JreProxySelector.java index 4179a8c3f..a09b435e1 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/repository/JreProxySelector.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/repository/JreProxySelector.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.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.net.Authenticator; import java.net.InetSocketAddress; import java.net.PasswordAuthentication; diff --git a/aether-util/src/main/java/org/eclipse/aether/util/repository/SecretAuthentication.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/repository/SecretAuthentication.java similarity index 83% rename from aether-util/src/main/java/org/eclipse/aether/util/repository/SecretAuthentication.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/repository/SecretAuthentication.java index 8d528fa56..8b3b0959c 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/repository/SecretAuthentication.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/repository/SecretAuthentication.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2012, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.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.Arrays; import java.util.Map; diff --git a/aether-util/src/main/java/org/eclipse/aether/util/repository/SimpleArtifactDescriptorPolicy.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/repository/SimpleArtifactDescriptorPolicy.java similarity index 62% rename from aether-util/src/main/java/org/eclipse/aether/util/repository/SimpleArtifactDescriptorPolicy.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/repository/SimpleArtifactDescriptorPolicy.java index b0eb40d99..ccf1ba8ac 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/repository/SimpleArtifactDescriptorPolicy.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/repository/SimpleArtifactDescriptorPolicy.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.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.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.resolution.ArtifactDescriptorPolicy; import org.eclipse.aether.resolution.ArtifactDescriptorPolicyRequest; diff --git a/aether-util/src/main/java/org/eclipse/aether/util/repository/SimpleResolutionErrorPolicy.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/repository/SimpleResolutionErrorPolicy.java similarity index 73% rename from aether-util/src/main/java/org/eclipse/aether/util/repository/SimpleResolutionErrorPolicy.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/repository/SimpleResolutionErrorPolicy.java index 3f1fb6df5..4fa905946 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/repository/SimpleResolutionErrorPolicy.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/repository/SimpleResolutionErrorPolicy.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.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.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.metadata.Metadata; diff --git a/aether-util/src/main/java/org/eclipse/aether/util/repository/StringAuthentication.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/repository/StringAuthentication.java similarity index 68% rename from aether-util/src/main/java/org/eclipse/aether/util/repository/StringAuthentication.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/repository/StringAuthentication.java index e43b28261..843808298 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/repository/StringAuthentication.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/repository/StringAuthentication.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.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.Map; import org.eclipse.aether.repository.Authentication; diff --git a/maven-resolver-util/src/main/java/org/eclipse/aether/util/repository/package-info.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/repository/package-info.java new file mode 100644 index 000000000..bea0b2a4b --- /dev/null +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/repository/package-info.java @@ -0,0 +1,24 @@ +// CHECKSTYLE_OFF: RegexpHeader +/** + * Ready-to-use selectors for authentication, proxies and mirrors and a few other repository related utilities. + */ +package org.eclipse.aether.util.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. + */ diff --git a/aether-util/src/main/java/org/eclipse/aether/util/version/GenericVersion.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/version/GenericVersion.java similarity index 93% rename from aether-util/src/main/java/org/eclipse/aether/util/version/GenericVersion.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/version/GenericVersion.java index 8152aad10..3596a29fe 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/version/GenericVersion.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/version/GenericVersion.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.version; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.math.BigInteger; import java.util.ArrayList; import java.util.Arrays; @@ -329,6 +338,7 @@ else if ( "max".equalsIgnoreCase( token ) ) case 'm': case 'M': return new Item( Item.KIND_QUALIFIER, QUALIFIER_MILESTONE ); + default: } } Integer qualifier = QUALIFIERS.get( token ); diff --git a/aether-util/src/main/java/org/eclipse/aether/util/version/GenericVersionConstraint.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/version/GenericVersionConstraint.java similarity index 75% rename from aether-util/src/main/java/org/eclipse/aether/util/version/GenericVersionConstraint.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/version/GenericVersionConstraint.java index 53c3b761d..bfcd455de 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/version/GenericVersionConstraint.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/version/GenericVersionConstraint.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.version; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.version.Version; import org.eclipse.aether.version.VersionConstraint; import org.eclipse.aether.version.VersionRange; diff --git a/aether-util/src/main/java/org/eclipse/aether/util/version/GenericVersionRange.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/version/GenericVersionRange.java similarity index 88% rename from aether-util/src/main/java/org/eclipse/aether/util/version/GenericVersionRange.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/version/GenericVersionRange.java index 75c6ee4ff..832dd9440 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/version/GenericVersionRange.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/version/GenericVersionRange.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.version; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import org.eclipse.aether.version.InvalidVersionSpecificationException; import org.eclipse.aether.version.Version; import org.eclipse.aether.version.VersionRange; diff --git a/aether-util/src/main/java/org/eclipse/aether/util/version/GenericVersionScheme.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/version/GenericVersionScheme.java similarity index 84% rename from aether-util/src/main/java/org/eclipse/aether/util/version/GenericVersionScheme.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/version/GenericVersionScheme.java index 2e1419233..8fc0488e5 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/version/GenericVersionScheme.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/version/GenericVersionScheme.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.version; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Collection; diff --git a/aether-util/src/main/java/org/eclipse/aether/util/version/UnionVersionRange.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/version/UnionVersionRange.java similarity index 82% rename from aether-util/src/main/java/org/eclipse/aether/util/version/UnionVersionRange.java rename to maven-resolver-util/src/main/java/org/eclipse/aether/util/version/UnionVersionRange.java index 7295bdfe0..c54a4b479 100644 --- a/aether-util/src/main/java/org/eclipse/aether/util/version/UnionVersionRange.java +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/version/UnionVersionRange.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2011, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.version; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Arrays; import java.util.Collection; import java.util.Collections; @@ -36,7 +45,7 @@ public static VersionRange from( VersionRange... ranges ) { if ( ranges == null ) { - return from( Collections. emptySet() ); + return from( Collections.emptySet() ); } return from( Arrays.asList( ranges ) ); } diff --git a/maven-resolver-util/src/main/java/org/eclipse/aether/util/version/package-info.java b/maven-resolver-util/src/main/java/org/eclipse/aether/util/version/package-info.java new file mode 100644 index 000000000..84cccf6ee --- /dev/null +++ b/maven-resolver-util/src/main/java/org/eclipse/aether/util/version/package-info.java @@ -0,0 +1,24 @@ +// CHECKSTYLE_OFF: RegexpHeader +/** + * Ready-to-use version schemes for parsing/comparing versions. + */ +package org.eclipse.aether.util.version; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ diff --git a/maven-resolver-util/src/site/site.xml b/maven-resolver-util/src/site/site.xml new file mode 100644 index 000000000..3a16bf98b --- /dev/null +++ b/maven-resolver-util/src/site/site.xml @@ -0,0 +1,36 @@ + + + + + + +

+ + + + + + + + + + \ No newline at end of file diff --git a/aether-util/src/test/java/org/eclipse/aether/util/ChecksumUtilTest.java b/maven-resolver-util/src/test/java/org/eclipse/aether/util/ChecksumUtilTest.java similarity index 85% rename from aether-util/src/test/java/org/eclipse/aether/util/ChecksumUtilTest.java rename to maven-resolver-util/src/test/java/org/eclipse/aether/util/ChecksumUtilTest.java index 1b02d4605..b249e822a 100644 --- a/aether-util/src/test/java/org/eclipse/aether/util/ChecksumUtilTest.java +++ b/maven-resolver-util/src/test/java/org/eclipse/aether/util/ChecksumUtilTest.java @@ -1,20 +1,30 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.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 static org.eclipse.aether.internal.test.util.TestFileUtils.*; import static org.junit.Assert.*; import java.io.File; import java.io.IOException; +import java.nio.charset.StandardCharsets; import java.util.Arrays; import java.util.HashMap; import java.util.Map; @@ -66,7 +76,7 @@ public void before() createTempFile( new byte[] { 0, 1, 2, 4, 8, 16, 32, 64, 127, -1, -2, -4, -8, -16, -32, -64, -127 }, 1000 ); sums.put( patternFile, patternFileChecksums ); - textFile = createTempFile( "the quick brown fox jumps over the lazy dog\n".getBytes( "UTF-8" ), 500 ); + textFile = createTempFile( "the quick brown fox jumps over the lazy dog\n".getBytes( StandardCharsets.UTF_8 ), 500 ); sums.put( textFile, textFileChecksums ); } diff --git a/aether-util/src/test/java/org/eclipse/aether/util/ConfigUtilsTest.java b/maven-resolver-util/src/test/java/org/eclipse/aether/util/ConfigUtilsTest.java similarity index 77% rename from aether-util/src/test/java/org/eclipse/aether/util/ConfigUtilsTest.java rename to maven-resolver-util/src/test/java/org/eclipse/aether/util/ConfigUtilsTest.java index 6be04762e..912e55a19 100644 --- a/aether-util/src/test/java/org/eclipse/aether/util/ConfigUtilsTest.java +++ b/maven-resolver-util/src/test/java/org/eclipse/aether/util/ConfigUtilsTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.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 static org.junit.Assert.*; import java.util.ArrayList; @@ -96,6 +105,24 @@ public void testGetString_AlternativeKeys() assertEquals( "passed", ConfigUtils.getString( config, "default", "no-string", "some-string" ) ); } + @Test + public void testGetString_BooleanConversion() + { + config.put( "some-string", Boolean.TRUE ); + assertEquals( "true", ConfigUtils.getString( config, "default", "some-string" ) ); + config.put( "some-string", Boolean.FALSE ); + assertEquals( "false", ConfigUtils.getString( config, "default", "some-string" ) ); + } + + @Test + public void testGetString_NumberConversion() + { + config.put( "some-string", Integer.valueOf( -7 ) ); + assertEquals( "-7", ConfigUtils.getString( config, "default", "some-string" ) ); + config.put( "some-string", new Float( -1.5f ) ); + assertEquals( "-1.5", ConfigUtils.getString( config, "default", "some-string" ) ); + } + @Test public void testGetBoolean_Default() { @@ -159,16 +186,16 @@ public void testGetInteger_NumberConversion() public void testGetLong_Default() { config.put( "no-long", new Object() ); - assertEquals( -17, ConfigUtils.getLong( config, -17L, "no-value" ) ); - assertEquals( 43, ConfigUtils.getLong( config, 43L, "no-long" ) ); + assertEquals( -17L, ConfigUtils.getLong( config, -17L, "no-value" ) ); + assertEquals( 43L, ConfigUtils.getLong( config, 43L, "no-long" ) ); } @Test public void testGetLong_AlternativeKeys() { config.put( "no-long", "text" ); - config.put( "some-long", 23 ); - assertEquals( 23, ConfigUtils.getLong( config, 0, "no-long", "some-long" ) ); + config.put( "some-long", 23L ); + assertEquals( 23L, ConfigUtils.getLong( config, 0, "no-long", "some-long" ) ); } @Test @@ -213,7 +240,7 @@ public void testGetFloat_StringConversion() @Test public void testGetFloat_NumberConversion() { - config.put( "some-number", -1234 ); + config.put( "some-number", -1234f ); assertEquals( -1234f, ConfigUtils.getFloat( config, 0, "some-number" ), 0.1f ); } diff --git a/maven-resolver-util/src/test/java/org/eclipse/aether/util/StringUtilsTest.java b/maven-resolver-util/src/test/java/org/eclipse/aether/util/StringUtilsTest.java new file mode 100644 index 000000000..4ac2f7e70 --- /dev/null +++ b/maven-resolver-util/src/test/java/org/eclipse/aether/util/StringUtilsTest.java @@ -0,0 +1,41 @@ +package org.eclipse.aether.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 static org.junit.Assert.*; + +import org.eclipse.aether.util.StringUtils; +import org.junit.Test; + +/** + */ +public class StringUtilsTest +{ + + @Test + public void testIsEmpty() + { + assertTrue( StringUtils.isEmpty( null ) ); + assertTrue( StringUtils.isEmpty( "" ) ); + assertFalse( StringUtils.isEmpty( " " ) ); + assertFalse( StringUtils.isEmpty( "test" ) ); + } + +} diff --git a/aether-util/src/test/java/org/eclipse/aether/util/artifact/ArtifactIdUtilsTest.java b/maven-resolver-util/src/test/java/org/eclipse/aether/util/artifact/ArtifactIdUtilsTest.java similarity index 91% rename from aether-util/src/test/java/org/eclipse/aether/util/artifact/ArtifactIdUtilsTest.java rename to maven-resolver-util/src/test/java/org/eclipse/aether/util/artifact/ArtifactIdUtilsTest.java index 2b39fd595..36193f347 100644 --- a/aether-util/src/test/java/org/eclipse/aether/util/artifact/ArtifactIdUtilsTest.java +++ b/maven-resolver-util/src/test/java/org/eclipse/aether/util/artifact/ArtifactIdUtilsTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.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 static org.junit.Assert.*; import org.eclipse.aether.artifact.Artifact; diff --git a/aether-util/src/test/java/org/eclipse/aether/util/artifact/SubArtifactTest.java b/maven-resolver-util/src/test/java/org/eclipse/aether/util/artifact/SubArtifactTest.java similarity index 84% rename from aether-util/src/test/java/org/eclipse/aether/util/artifact/SubArtifactTest.java rename to maven-resolver-util/src/test/java/org/eclipse/aether/util/artifact/SubArtifactTest.java index 93e4f7aa6..dc0e47257 100644 --- a/aether-util/src/test/java/org/eclipse/aether/util/artifact/SubArtifactTest.java +++ b/maven-resolver-util/src/test/java/org/eclipse/aether/util/artifact/SubArtifactTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.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 static org.junit.Assert.*; import java.io.File; diff --git a/maven-resolver-util/src/test/java/org/eclipse/aether/util/filter/AbstractDependencyFilterTest.java b/maven-resolver-util/src/test/java/org/eclipse/aether/util/filter/AbstractDependencyFilterTest.java new file mode 100644 index 000000000..835c1ce50 --- /dev/null +++ b/maven-resolver-util/src/test/java/org/eclipse/aether/util/filter/AbstractDependencyFilterTest.java @@ -0,0 +1,55 @@ +package org.eclipse.aether.util.filter; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.eclipse.aether.graph.DependencyFilter; +import org.eclipse.aether.graph.DependencyNode; + +public abstract class AbstractDependencyFilterTest +{ + + protected DependencyFilter getAcceptFilter() + { + return new DependencyFilter() + { + + public boolean accept( DependencyNode node, List parents ) + { + return true; + } + + }; + } + + protected DependencyFilter getDenyFilter() + { + return new DependencyFilter() + { + + public boolean accept( DependencyNode node, List parents ) + { + return false; + } + }; + } + +} diff --git a/aether-util/src/test/java/org/eclipse/aether/util/filter/AndDependencyFilterTest.java b/maven-resolver-util/src/test/java/org/eclipse/aether/util/filter/AndDependencyFilterTest.java similarity index 83% rename from aether-util/src/test/java/org/eclipse/aether/util/filter/AndDependencyFilterTest.java rename to maven-resolver-util/src/test/java/org/eclipse/aether/util/filter/AndDependencyFilterTest.java index f5a9c2010..45a7f3df5 100644 --- a/aether-util/src/test/java/org/eclipse/aether/util/filter/AndDependencyFilterTest.java +++ b/maven-resolver-util/src/test/java/org/eclipse/aether/util/filter/AndDependencyFilterTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.filter; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import java.util.Collection; diff --git a/aether-util/src/test/java/org/eclipse/aether/util/filter/DependencyFilterUtilsTest.java b/maven-resolver-util/src/test/java/org/eclipse/aether/util/filter/DependencyFilterUtilsTest.java similarity index 87% rename from aether-util/src/test/java/org/eclipse/aether/util/filter/DependencyFilterUtilsTest.java rename to maven-resolver-util/src/test/java/org/eclipse/aether/util/filter/DependencyFilterUtilsTest.java index d97cd0f0a..28bde572f 100644 --- a/aether-util/src/test/java/org/eclipse/aether/util/filter/DependencyFilterUtilsTest.java +++ b/maven-resolver-util/src/test/java/org/eclipse/aether/util/filter/DependencyFilterUtilsTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.filter; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import java.util.Collections; diff --git a/aether-util/src/test/java/org/eclipse/aether/util/filter/ExclusionDependencyFilterTest.java b/maven-resolver-util/src/test/java/org/eclipse/aether/util/filter/ExclusionDependencyFilterTest.java similarity index 65% rename from aether-util/src/test/java/org/eclipse/aether/util/filter/ExclusionDependencyFilterTest.java rename to maven-resolver-util/src/test/java/org/eclipse/aether/util/filter/ExclusionDependencyFilterTest.java index 30629767f..a0be5927e 100644 --- a/aether-util/src/test/java/org/eclipse/aether/util/filter/ExclusionDependencyFilterTest.java +++ b/maven-resolver-util/src/test/java/org/eclipse/aether/util/filter/ExclusionDependencyFilterTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.filter; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import java.util.Arrays; diff --git a/aether-util/src/test/java/org/eclipse/aether/util/filter/OrDependencyFilterTest.java b/maven-resolver-util/src/test/java/org/eclipse/aether/util/filter/OrDependencyFilterTest.java similarity index 82% rename from aether-util/src/test/java/org/eclipse/aether/util/filter/OrDependencyFilterTest.java rename to maven-resolver-util/src/test/java/org/eclipse/aether/util/filter/OrDependencyFilterTest.java index 1043a23f1..03b80ea35 100644 --- a/aether-util/src/test/java/org/eclipse/aether/util/filter/OrDependencyFilterTest.java +++ b/maven-resolver-util/src/test/java/org/eclipse/aether/util/filter/OrDependencyFilterTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.filter; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import java.util.Collection; diff --git a/aether-util/src/test/java/org/eclipse/aether/util/filter/PatternExclusionsDependencyFilterTest.java b/maven-resolver-util/src/test/java/org/eclipse/aether/util/filter/PatternExclusionsDependencyFilterTest.java similarity index 91% rename from aether-util/src/test/java/org/eclipse/aether/util/filter/PatternExclusionsDependencyFilterTest.java rename to maven-resolver-util/src/test/java/org/eclipse/aether/util/filter/PatternExclusionsDependencyFilterTest.java index 1ea5158f5..b5b307e7c 100644 --- a/aether-util/src/test/java/org/eclipse/aether/util/filter/PatternExclusionsDependencyFilterTest.java +++ b/maven-resolver-util/src/test/java/org/eclipse/aether/util/filter/PatternExclusionsDependencyFilterTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.filter; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import java.util.LinkedList; diff --git a/aether-util/src/test/java/org/eclipse/aether/util/filter/PatternInclusionsDependencyFilterTest.java b/maven-resolver-util/src/test/java/org/eclipse/aether/util/filter/PatternInclusionsDependencyFilterTest.java similarity index 91% rename from aether-util/src/test/java/org/eclipse/aether/util/filter/PatternInclusionsDependencyFilterTest.java rename to maven-resolver-util/src/test/java/org/eclipse/aether/util/filter/PatternInclusionsDependencyFilterTest.java index 1eb7e996f..cb8543111 100644 --- a/aether-util/src/test/java/org/eclipse/aether/util/filter/PatternInclusionsDependencyFilterTest.java +++ b/maven-resolver-util/src/test/java/org/eclipse/aether/util/filter/PatternInclusionsDependencyFilterTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.filter; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import java.util.LinkedList; diff --git a/aether-util/src/test/java/org/eclipse/aether/util/filter/ScopeDependencyFilterTest.java b/maven-resolver-util/src/test/java/org/eclipse/aether/util/filter/ScopeDependencyFilterTest.java similarity index 74% rename from aether-util/src/test/java/org/eclipse/aether/util/filter/ScopeDependencyFilterTest.java rename to maven-resolver-util/src/test/java/org/eclipse/aether/util/filter/ScopeDependencyFilterTest.java index 854580a91..e943df933 100644 --- a/aether-util/src/test/java/org/eclipse/aether/util/filter/ScopeDependencyFilterTest.java +++ b/maven-resolver-util/src/test/java/org/eclipse/aether/util/filter/ScopeDependencyFilterTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.filter; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import java.util.Arrays; diff --git a/aether-util/src/test/java/org/eclipse/aether/util/graph/manager/ClassicDependencyManagerTest.java b/maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/manager/ClassicDependencyManagerTest.java similarity index 72% rename from aether-util/src/test/java/org/eclipse/aether/util/graph/manager/ClassicDependencyManagerTest.java rename to maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/manager/ClassicDependencyManagerTest.java index 9e3386345..25935858f 100644 --- a/aether-util/src/test/java/org/eclipse/aether/util/graph/manager/ClassicDependencyManagerTest.java +++ b/maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/manager/ClassicDependencyManagerTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.manager; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import java.util.Arrays; diff --git a/aether-util/src/test/java/org/eclipse/aether/util/graph/selector/AndDependencySelectorTest.java b/maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/selector/AndDependencySelectorTest.java similarity index 85% rename from aether-util/src/test/java/org/eclipse/aether/util/graph/selector/AndDependencySelectorTest.java rename to maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/selector/AndDependencySelectorTest.java index 976b6088a..b0f2b09fe 100644 --- a/aether-util/src/test/java/org/eclipse/aether/util/graph/selector/AndDependencySelectorTest.java +++ b/maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/selector/AndDependencySelectorTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.selector; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import org.eclipse.aether.artifact.DefaultArtifact; diff --git a/aether-util/src/test/java/org/eclipse/aether/util/graph/transformer/AbstractDependencyGraphTransformerTest.java b/maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/transformer/AbstractDependencyGraphTransformerTest.java similarity index 78% rename from aether-util/src/test/java/org/eclipse/aether/util/graph/transformer/AbstractDependencyGraphTransformerTest.java rename to maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/transformer/AbstractDependencyGraphTransformerTest.java index 5847172b8..b5947edac 100644 --- a/aether-util/src/test/java/org/eclipse/aether/util/graph/transformer/AbstractDependencyGraphTransformerTest.java +++ b/maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/transformer/AbstractDependencyGraphTransformerTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.transformer; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import java.util.LinkedList; diff --git a/aether-util/src/test/java/org/eclipse/aether/util/graph/transformer/ConflictIdSorterTest.java b/maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/transformer/ConflictIdSorterTest.java similarity index 79% rename from aether-util/src/test/java/org/eclipse/aether/util/graph/transformer/ConflictIdSorterTest.java rename to maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/transformer/ConflictIdSorterTest.java index 937a562c0..b24a920bf 100644 --- a/aether-util/src/test/java/org/eclipse/aether/util/graph/transformer/ConflictIdSorterTest.java +++ b/maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/transformer/ConflictIdSorterTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.transformer; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import java.util.Collection; diff --git a/aether-util/src/test/java/org/eclipse/aether/util/graph/transformer/ConflictMarkerTest.java b/maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/transformer/ConflictMarkerTest.java similarity index 81% rename from aether-util/src/test/java/org/eclipse/aether/util/graph/transformer/ConflictMarkerTest.java rename to maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/transformer/ConflictMarkerTest.java index 07ed5cd89..550a0c673 100644 --- a/aether-util/src/test/java/org/eclipse/aether/util/graph/transformer/ConflictMarkerTest.java +++ b/maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/transformer/ConflictMarkerTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.transformer; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import java.util.Map; diff --git a/aether-util/src/test/java/org/eclipse/aether/util/graph/transformer/JavaDependencyContextRefinerTest.java b/maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/transformer/JavaDependencyContextRefinerTest.java similarity index 78% rename from aether-util/src/test/java/org/eclipse/aether/util/graph/transformer/JavaDependencyContextRefinerTest.java rename to maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/transformer/JavaDependencyContextRefinerTest.java index 3dd39ab3c..bb0d65a36 100644 --- a/aether-util/src/test/java/org/eclipse/aether/util/graph/transformer/JavaDependencyContextRefinerTest.java +++ b/maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/transformer/JavaDependencyContextRefinerTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.transformer; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import org.eclipse.aether.collection.DependencyGraphTransformer; diff --git a/aether-util/src/test/java/org/eclipse/aether/util/graph/transformer/JavaScopeSelectorTest.java b/maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/transformer/JavaScopeSelectorTest.java similarity index 89% rename from aether-util/src/test/java/org/eclipse/aether/util/graph/transformer/JavaScopeSelectorTest.java rename to maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/transformer/JavaScopeSelectorTest.java index 74431e122..27378030d 100644 --- a/aether-util/src/test/java/org/eclipse/aether/util/graph/transformer/JavaScopeSelectorTest.java +++ b/maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/transformer/JavaScopeSelectorTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.transformer; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import java.util.Locale; diff --git a/aether-util/src/test/java/org/eclipse/aether/util/graph/transformer/NearestVersionSelectorTest.java b/maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/transformer/NearestVersionSelectorTest.java similarity index 90% rename from aether-util/src/test/java/org/eclipse/aether/util/graph/transformer/NearestVersionSelectorTest.java rename to maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/transformer/NearestVersionSelectorTest.java index d407a3557..b71adab2b 100644 --- a/aether-util/src/test/java/org/eclipse/aether/util/graph/transformer/NearestVersionSelectorTest.java +++ b/maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/transformer/NearestVersionSelectorTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.transformer; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import java.util.List; diff --git a/aether-util/src/test/java/org/eclipse/aether/util/graph/transformer/RootQueueTest.java b/maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/transformer/RootQueueTest.java similarity index 75% rename from aether-util/src/test/java/org/eclipse/aether/util/graph/transformer/RootQueueTest.java rename to maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/transformer/RootQueueTest.java index a59ff258a..f609ed726 100644 --- a/aether-util/src/test/java/org/eclipse/aether/util/graph/transformer/RootQueueTest.java +++ b/maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/transformer/RootQueueTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.transformer; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import org.eclipse.aether.util.graph.transformer.ConflictIdSorter.ConflictId; diff --git a/aether-util/src/test/java/org/eclipse/aether/util/graph/transformer/SimpleConflictMarker.java b/maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/transformer/SimpleConflictMarker.java similarity index 70% rename from aether-util/src/test/java/org/eclipse/aether/util/graph/transformer/SimpleConflictMarker.java rename to maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/transformer/SimpleConflictMarker.java index 416abab3d..df303680f 100644 --- a/aether-util/src/test/java/org/eclipse/aether/util/graph/transformer/SimpleConflictMarker.java +++ b/maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/transformer/SimpleConflictMarker.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.transformer; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.IdentityHashMap; import java.util.Map; diff --git a/aether-util/src/test/java/org/eclipse/aether/util/graph/transformer/SimpleOptionalitySelectorTest.java b/maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/transformer/SimpleOptionalitySelectorTest.java similarity index 74% rename from aether-util/src/test/java/org/eclipse/aether/util/graph/transformer/SimpleOptionalitySelectorTest.java rename to maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/transformer/SimpleOptionalitySelectorTest.java index 2a8dff311..f6d268fd5 100644 --- a/aether-util/src/test/java/org/eclipse/aether/util/graph/transformer/SimpleOptionalitySelectorTest.java +++ b/maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/transformer/SimpleOptionalitySelectorTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.transformer; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import org.eclipse.aether.collection.DependencyGraphTransformer; diff --git a/aether-util/src/test/java/org/eclipse/aether/util/graph/traverser/AndDependencyTraverserTest.java b/maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/traverser/AndDependencyTraverserTest.java similarity index 86% rename from aether-util/src/test/java/org/eclipse/aether/util/graph/traverser/AndDependencyTraverserTest.java rename to maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/traverser/AndDependencyTraverserTest.java index f895f8a44..74d744ed0 100644 --- a/aether-util/src/test/java/org/eclipse/aether/util/graph/traverser/AndDependencyTraverserTest.java +++ b/maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/traverser/AndDependencyTraverserTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.traverser; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import org.eclipse.aether.artifact.DefaultArtifact; diff --git a/aether-util/src/test/java/org/eclipse/aether/util/graph/traverser/FatArtifactTraverserTest.java b/maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/traverser/FatArtifactTraverserTest.java similarity index 73% rename from aether-util/src/test/java/org/eclipse/aether/util/graph/traverser/FatArtifactTraverserTest.java rename to maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/traverser/FatArtifactTraverserTest.java index 108ce00a5..641e593ca 100644 --- a/aether-util/src/test/java/org/eclipse/aether/util/graph/traverser/FatArtifactTraverserTest.java +++ b/maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/traverser/FatArtifactTraverserTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.traverser; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import java.util.Collections; diff --git a/aether-util/src/test/java/org/eclipse/aether/util/graph/traverser/StaticDependencyTraverserTest.java b/maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/traverser/StaticDependencyTraverserTest.java similarity index 68% rename from aether-util/src/test/java/org/eclipse/aether/util/graph/traverser/StaticDependencyTraverserTest.java rename to maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/traverser/StaticDependencyTraverserTest.java index ae6eb8e8f..0ac1d9137 100644 --- a/aether-util/src/test/java/org/eclipse/aether/util/graph/traverser/StaticDependencyTraverserTest.java +++ b/maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/traverser/StaticDependencyTraverserTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2014 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.traverser; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import org.eclipse.aether.artifact.DefaultArtifact; diff --git a/aether-util/src/test/java/org/eclipse/aether/util/graph/versions/AbstractVersionFilterTest.java b/maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/versions/AbstractVersionFilterTest.java similarity index 76% rename from aether-util/src/test/java/org/eclipse/aether/util/graph/versions/AbstractVersionFilterTest.java rename to maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/versions/AbstractVersionFilterTest.java index 5d22b1932..13fd4b01b 100644 --- a/aether-util/src/test/java/org/eclipse/aether/util/graph/versions/AbstractVersionFilterTest.java +++ b/maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/versions/AbstractVersionFilterTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.versions; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import java.util.Iterator; diff --git a/aether-util/src/test/java/org/eclipse/aether/util/graph/versions/ChainedVersionFilterTest.java b/maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/versions/ChainedVersionFilterTest.java similarity index 73% rename from aether-util/src/test/java/org/eclipse/aether/util/graph/versions/ChainedVersionFilterTest.java rename to maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/versions/ChainedVersionFilterTest.java index a07d11330..1e8a5bda1 100644 --- a/aether-util/src/test/java/org/eclipse/aether/util/graph/versions/ChainedVersionFilterTest.java +++ b/maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/versions/ChainedVersionFilterTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.versions; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import org.eclipse.aether.collection.DependencyCollectionContext; diff --git a/aether-util/src/test/java/org/eclipse/aether/util/graph/versions/ContextualSnapshotVersionFilterTest.java b/maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/versions/ContextualSnapshotVersionFilterTest.java similarity index 71% rename from aether-util/src/test/java/org/eclipse/aether/util/graph/versions/ContextualSnapshotVersionFilterTest.java rename to maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/versions/ContextualSnapshotVersionFilterTest.java index f798cafb3..dd88a66ee 100644 --- a/aether-util/src/test/java/org/eclipse/aether/util/graph/versions/ContextualSnapshotVersionFilterTest.java +++ b/maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/versions/ContextualSnapshotVersionFilterTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.versions; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import org.eclipse.aether.collection.VersionFilter; diff --git a/aether-util/src/test/java/org/eclipse/aether/util/graph/versions/HighestVersionFilterTest.java b/maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/versions/HighestVersionFilterTest.java similarity index 57% rename from aether-util/src/test/java/org/eclipse/aether/util/graph/versions/HighestVersionFilterTest.java rename to maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/versions/HighestVersionFilterTest.java index 5c005d842..3926c6684 100644 --- a/aether-util/src/test/java/org/eclipse/aether/util/graph/versions/HighestVersionFilterTest.java +++ b/maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/versions/HighestVersionFilterTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.versions; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import org.eclipse.aether.collection.VersionFilter.VersionFilterContext; diff --git a/aether-util/src/test/java/org/eclipse/aether/util/graph/versions/SnapshotVersionFilterTest.java b/maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/versions/SnapshotVersionFilterTest.java similarity index 58% rename from aether-util/src/test/java/org/eclipse/aether/util/graph/versions/SnapshotVersionFilterTest.java rename to maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/versions/SnapshotVersionFilterTest.java index 4e46d3f4c..70c26f903 100644 --- a/aether-util/src/test/java/org/eclipse/aether/util/graph/versions/SnapshotVersionFilterTest.java +++ b/maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/versions/SnapshotVersionFilterTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.versions; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import org.eclipse.aether.collection.VersionFilter.VersionFilterContext; diff --git a/aether-util/src/test/java/org/eclipse/aether/util/graph/visitor/FilteringDependencyVisitorTest.java b/maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/visitor/FilteringDependencyVisitorTest.java similarity index 63% rename from aether-util/src/test/java/org/eclipse/aether/util/graph/visitor/FilteringDependencyVisitorTest.java rename to maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/visitor/FilteringDependencyVisitorTest.java index 5e73ef502..65a02a87f 100644 --- a/aether-util/src/test/java/org/eclipse/aether/util/graph/visitor/FilteringDependencyVisitorTest.java +++ b/maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/visitor/FilteringDependencyVisitorTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.visitor; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import java.util.List; diff --git a/aether-util/src/test/java/org/eclipse/aether/util/graph/visitor/PathRecordingDependencyVisitorTest.java b/maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/visitor/PathRecordingDependencyVisitorTest.java similarity index 84% rename from aether-util/src/test/java/org/eclipse/aether/util/graph/visitor/PathRecordingDependencyVisitorTest.java rename to maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/visitor/PathRecordingDependencyVisitorTest.java index b22f67d65..cd766a036 100644 --- a/aether-util/src/test/java/org/eclipse/aether/util/graph/visitor/PathRecordingDependencyVisitorTest.java +++ b/maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/visitor/PathRecordingDependencyVisitorTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.visitor; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import java.util.List; diff --git a/aether-util/src/test/java/org/eclipse/aether/util/graph/visitor/PostorderNodeListGeneratorTest.java b/maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/visitor/PostorderNodeListGeneratorTest.java similarity index 65% rename from aether-util/src/test/java/org/eclipse/aether/util/graph/visitor/PostorderNodeListGeneratorTest.java rename to maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/visitor/PostorderNodeListGeneratorTest.java index ad1c713c3..8d6f525f9 100644 --- a/aether-util/src/test/java/org/eclipse/aether/util/graph/visitor/PostorderNodeListGeneratorTest.java +++ b/maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/visitor/PostorderNodeListGeneratorTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.visitor; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import java.util.List; diff --git a/aether-util/src/test/java/org/eclipse/aether/util/graph/visitor/PreorderNodeListGeneratorTest.java b/maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/visitor/PreorderNodeListGeneratorTest.java similarity index 65% rename from aether-util/src/test/java/org/eclipse/aether/util/graph/visitor/PreorderNodeListGeneratorTest.java rename to maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/visitor/PreorderNodeListGeneratorTest.java index e0d90ea24..200dd3bad 100644 --- a/aether-util/src/test/java/org/eclipse/aether/util/graph/visitor/PreorderNodeListGeneratorTest.java +++ b/maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/visitor/PreorderNodeListGeneratorTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.visitor; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import java.util.List; diff --git a/aether-util/src/test/java/org/eclipse/aether/util/graph/visitor/TreeDependencyVisitorTest.java b/maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/visitor/TreeDependencyVisitorTest.java similarity index 64% rename from aether-util/src/test/java/org/eclipse/aether/util/graph/visitor/TreeDependencyVisitorTest.java rename to maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/visitor/TreeDependencyVisitorTest.java index a3c9c88a9..36cb6ace4 100644 --- a/aether-util/src/test/java/org/eclipse/aether/util/graph/visitor/TreeDependencyVisitorTest.java +++ b/maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/visitor/TreeDependencyVisitorTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.graph.visitor; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import org.eclipse.aether.graph.DependencyNode; diff --git a/maven-resolver-util/src/test/java/org/eclipse/aether/util/listener/ChainedRepositoryListenerTest.java b/maven-resolver-util/src/test/java/org/eclipse/aether/util/listener/ChainedRepositoryListenerTest.java new file mode 100644 index 000000000..6eaa25b8c --- /dev/null +++ b/maven-resolver-util/src/test/java/org/eclipse/aether/util/listener/ChainedRepositoryListenerTest.java @@ -0,0 +1,46 @@ +package org.eclipse.aether.util.listener; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import static org.junit.Assert.*; + +import java.lang.reflect.Method; + +import org.eclipse.aether.RepositoryListener; +import org.eclipse.aether.util.listener.ChainedRepositoryListener; +import org.junit.Test; + +/** + */ +public class ChainedRepositoryListenerTest +{ + + @Test + public void testAllEventTypesHandled() + throws Exception + { + for ( Method method : RepositoryListener.class.getMethods() ) + { + assertNotNull( ChainedRepositoryListener.class.getDeclaredMethod( method.getName(), + method.getParameterTypes() ) ); + } + } + +} diff --git a/maven-resolver-util/src/test/java/org/eclipse/aether/util/listener/ChainedTransferListenerTest.java b/maven-resolver-util/src/test/java/org/eclipse/aether/util/listener/ChainedTransferListenerTest.java new file mode 100644 index 000000000..7e7e96947 --- /dev/null +++ b/maven-resolver-util/src/test/java/org/eclipse/aether/util/listener/ChainedTransferListenerTest.java @@ -0,0 +1,46 @@ +package org.eclipse.aether.util.listener; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import static org.junit.Assert.*; + +import java.lang.reflect.Method; + +import org.eclipse.aether.transfer.TransferListener; +import org.eclipse.aether.util.listener.ChainedTransferListener; +import org.junit.Test; + +/** + */ +public class ChainedTransferListenerTest +{ + + @Test + public void testAllEventTypesHandled() + throws Exception + { + for ( Method method : TransferListener.class.getMethods() ) + { + assertNotNull( ChainedTransferListener.class.getDeclaredMethod( method.getName(), + method.getParameterTypes() ) ); + } + } + +} diff --git a/aether-util/src/test/java/org/eclipse/aether/util/repository/ComponentAuthenticationTest.java b/maven-resolver-util/src/test/java/org/eclipse/aether/util/repository/ComponentAuthenticationTest.java similarity index 78% rename from aether-util/src/test/java/org/eclipse/aether/util/repository/ComponentAuthenticationTest.java rename to maven-resolver-util/src/test/java/org/eclipse/aether/util/repository/ComponentAuthenticationTest.java index 4b5ea1041..25d53f287 100644 --- a/aether-util/src/test/java/org/eclipse/aether/util/repository/ComponentAuthenticationTest.java +++ b/maven-resolver-util/src/test/java/org/eclipse/aether/util/repository/ComponentAuthenticationTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.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 static org.junit.Assert.*; import org.eclipse.aether.DefaultRepositorySystemSession; diff --git a/maven-resolver-util/src/test/java/org/eclipse/aether/util/repository/DefaultMirrorSelectorTest.java b/maven-resolver-util/src/test/java/org/eclipse/aether/util/repository/DefaultMirrorSelectorTest.java new file mode 100644 index 000000000..d4366580d --- /dev/null +++ b/maven-resolver-util/src/test/java/org/eclipse/aether/util/repository/DefaultMirrorSelectorTest.java @@ -0,0 +1,194 @@ +package org.eclipse.aether.util.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 static org.junit.Assert.*; + +import java.util.Arrays; + +import org.eclipse.aether.repository.RemoteRepository; +import org.eclipse.aether.util.repository.DefaultMirrorSelector.*; +import org.junit.Test; + +/** + */ +public class DefaultMirrorSelectorTest +{ + + private RemoteRepository newRepo( String id, String type, String url ) + { + return new RemoteRepository.Builder( id, type, url ).build(); + } + + private static boolean matchesType( String repoType, String mirrorType ) + { + return new TypeMatcher( DefaultMirrorSelector.split( mirrorType ) ).isMatch( repoType ); + } + + private boolean matchesPattern( RemoteRepository repository, String pattern ) + { + return new IdMatcher( DefaultMirrorSelector.split( pattern ) ).isMatch( repository ); + } + + private static boolean isExternalRepo( RemoteRepository repository ) + { + return IdMatcher.isExternalRepo( repository ); + } + + @Test + public void testIsExternalRepo() + { + assertEquals( false, isExternalRepo( newRepo( "", "", "http://localhost/path" ) ) ); + assertEquals( false, isExternalRepo( newRepo( "", "", "http://127.0.0.1/path" ) ) ); + assertEquals( false, isExternalRepo( newRepo( "", "", "file:/path" ) ) ); + assertEquals( true, isExternalRepo( newRepo( "", "", "http://eclipse.org/" ) ) ); + assertEquals( true, isExternalRepo( newRepo( "", "", "" ) ) ); + } + + @Test + public void testMatchesType() + { + assertEquals( true, matchesType( null, null ) ); + assertEquals( true, matchesType( "any", null ) ); + assertEquals( true, matchesType( "any", "" ) ); + assertEquals( true, matchesType( "any", "*" ) ); + + assertEquals( false, matchesType( null, "default" ) ); + assertEquals( false, matchesType( "", "default" ) ); + assertEquals( false, matchesType( "any", "default" ) ); + + assertEquals( true, matchesType( "default", "default" ) ); + + assertEquals( false, matchesType( "default", "DEFAULT" ) ); + assertEquals( false, matchesType( "DEFAULT", "default" ) ); + + assertEquals( true, matchesType( "default", "default,foo" ) ); + assertEquals( true, matchesType( "default", "foo,default" ) ); + + assertEquals( true, matchesType( "default", "*,foo" ) ); + assertEquals( true, matchesType( "default", "foo,*" ) ); + + assertEquals( false, matchesType( "p2", "*,!p2" ) ); + assertEquals( false, matchesType( "p2", "!p2,*" ) ); + } + + @Test + public void testMatchesType_Trimming() + { + assertEquals( true, matchesType( "any", " " ) ); + assertEquals( true, matchesType( "default", " default " ) ); + assertEquals( true, matchesType( "default", "foo, default ,bar" ) ); + assertEquals( true, matchesType( "default", " default ,bar" ) ); + assertEquals( true, matchesType( "default", "foo, default " ) ); + } + + @Test + public void testMatchesPattern() + { + assertEquals( false, matchesPattern( newRepo( "id", "type", "url" ), null ) ); + assertEquals( false, matchesPattern( newRepo( "id", "type", "url" ), "" ) ); + assertEquals( false, matchesPattern( newRepo( "id", "type", "url" ), "central" ) ); + + assertEquals( true, matchesPattern( newRepo( "central", "type", "url" ), "central" ) ); + + assertEquals( false, matchesPattern( newRepo( "central", "type", "url" ), "CENTRAL" ) ); + assertEquals( false, matchesPattern( newRepo( "CENTRAL", "type", "url" ), "central" ) ); + + assertEquals( true, matchesPattern( newRepo( "central", "type", "url" ), "central,foo" ) ); + assertEquals( true, matchesPattern( newRepo( "central", "type", "url" ), "foo,central" ) ); + + assertEquals( true, matchesPattern( newRepo( "central", "type", "url" ), "*,foo" ) ); + assertEquals( true, matchesPattern( newRepo( "central", "type", "url" ), "foo,*" ) ); + + assertEquals( false, matchesPattern( newRepo( "central", "type", "url" ), "*,!central" ) ); + assertEquals( false, matchesPattern( newRepo( "central", "type", "url" ), "!central,*" ) ); + } + + @Test + public void testMatchesPattern_Trimming() + { + assertEquals( false, matchesPattern( newRepo( "central", "type", "url" ), " " ) ); + assertEquals( true, matchesPattern( newRepo( "central", "type", "url" ), " central " ) ); + assertEquals( true, matchesPattern( newRepo( "central", "type", "url" ), "foo, central ,bar" ) ); + assertEquals( true, matchesPattern( newRepo( "central", "type", "url" ), " central ,bar" ) ); + assertEquals( true, matchesPattern( newRepo( "central", "type", "url" ), "foo, central " ) ); + } + + @Test + public void testGetMirror_FirstMatchWins() + { + DefaultMirrorSelector selector = new DefaultMirrorSelector(); + selector.add( "mirror1", "http://host1", "default", false, "*", "*" ); + selector.add( "mirror2", "http://host2", "default", false, "*", "*" ); + RemoteRepository mirror = selector.getMirror( newRepo( "central", "default", "http://localhost" ) ); + assertNotNull( mirror ); + assertEquals( "mirror1", mirror.getId() ); + assertEquals( "http://host1", mirror.getUrl() ); + } + + @Test + public void testGetMirror_ExactMatchWins() + { + DefaultMirrorSelector selector = new DefaultMirrorSelector(); + selector.add( "mirror1", "http://host1", "default", false, "*", "*" ); + selector.add( "mirror2", "http://host2", "default", false, "central", "*" ); + selector.add( "mirror3", "http://host3", "default", false, "*", "*" ); + RemoteRepository mirror = selector.getMirror( newRepo( "central", "default", "http://localhost" ) ); + assertNotNull( mirror ); + assertEquals( "mirror2", mirror.getId() ); + assertEquals( "http://host2", mirror.getUrl() ); + } + + @Test + public void testGetMirror_WithoutMirrorLayout() + { + DefaultMirrorSelector selector = new DefaultMirrorSelector(); + selector.add( "mirror", "http://host", "", false, "*", "*" ); + RemoteRepository mirror = selector.getMirror( newRepo( "central", "default", "http://localhost" ) ); + assertNotNull( mirror ); + assertEquals( "mirror", mirror.getId() ); + assertEquals( "http://host", mirror.getUrl() ); + assertEquals( "default", mirror.getContentType() ); + } + + @Test + public void testGetMirror_WithMirrorLayout() + { + DefaultMirrorSelector selector = new DefaultMirrorSelector(); + selector.add( "mirror", "http://host", "layout", false, "*", "*" ); + RemoteRepository mirror = selector.getMirror( newRepo( "central", "default", "http://localhost" ) ); + assertNotNull( mirror ); + assertEquals( "mirror", mirror.getId() ); + assertEquals( "http://host", mirror.getUrl() ); + assertEquals( "layout", mirror.getContentType() ); + } + + @Test + public void testGetMirror_MirroredRepos() + { + DefaultMirrorSelector selector = new DefaultMirrorSelector(); + selector.add( "mirror", "http://host", "layout", false, "*", "*" ); + RemoteRepository repo = newRepo( "central", "default", "http://localhost" ); + RemoteRepository mirror = selector.getMirror( repo ); + assertNotNull( mirror ); + assertEquals( Arrays.asList( repo ), mirror.getMirroredRepositories() ); + } + +} diff --git a/maven-resolver-util/src/test/java/org/eclipse/aether/util/repository/DefaultProxySelectorTest.java b/maven-resolver-util/src/test/java/org/eclipse/aether/util/repository/DefaultProxySelectorTest.java new file mode 100644 index 000000000..02a665a09 --- /dev/null +++ b/maven-resolver-util/src/test/java/org/eclipse/aether/util/repository/DefaultProxySelectorTest.java @@ -0,0 +1,177 @@ +package org.eclipse.aether.util.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 static org.junit.Assert.*; + +import java.util.Arrays; + +import org.eclipse.aether.repository.Proxy; +import org.eclipse.aether.repository.RemoteRepository; +import org.eclipse.aether.util.repository.DefaultProxySelector.NonProxyHosts; +import org.junit.Test; + +/** + */ +public class DefaultProxySelectorTest +{ + + private RemoteRepository newRepo( String url ) + { + return new RemoteRepository.Builder( "id", "type", url ).build(); + } + + private boolean isNonProxyHost( String host, String nonProxyHosts ) + { + return new NonProxyHosts( NonProxyHosts.split( nonProxyHosts ) ).isNonProxyHost( host ); + } + + private boolean isNonProxyHost( String host, String... nonProxyHosts ) + { + return new NonProxyHosts( nonProxyHosts != null ? Arrays.asList( nonProxyHosts ) : null ).isNonProxyHost( host ); + } + + @Test + public void testIsNonProxyHost_Blank() + { + assertFalse( isNonProxyHost( "www.eclipse.org", (String) null ) ); + assertFalse( isNonProxyHost( "www.eclipse.org", "" ) ); + assertFalse( isNonProxyHost( "", "" ) ); + + assertFalse( isNonProxyHost( "www.eclipse.org", (String[]) null ) ); + assertFalse( isNonProxyHost( "www.eclipse.org", new String[0] ) ); + assertFalse( isNonProxyHost( "", new String[0] ) ); + assertFalse( isNonProxyHost( "", new String[] { null } ) ); + assertFalse( isNonProxyHost( "", new String[] { "" } ) ); + } + + @Test + public void testIsNonProxyHost_Wildcard() + { + assertTrue( isNonProxyHost( "www.eclipse.org", "*" ) ); + assertTrue( isNonProxyHost( "www.eclipse.org", "*.org" ) ); + assertFalse( isNonProxyHost( "www.eclipse.org", "*.com" ) ); + assertTrue( isNonProxyHost( "www.eclipse.org", "www.*" ) ); + assertTrue( isNonProxyHost( "www.eclipse.org", "www.*.org" ) ); + } + + @Test + public void testIsNonProxyHost_Multiple() + { + assertTrue( isNonProxyHost( "eclipse.org", "eclipse.org|host2" ) ); + assertTrue( isNonProxyHost( "eclipse.org", "host1|eclipse.org" ) ); + assertTrue( isNonProxyHost( "eclipse.org", "host1|eclipse.org|host2" ) ); + + assertTrue( isNonProxyHost( "eclipse.org", "eclipse.org,host2" ) ); + assertTrue( isNonProxyHost( "eclipse.org", "host1,eclipse.org" ) ); + assertTrue( isNonProxyHost( "eclipse.org", "host1,eclipse.org,host2" ) ); + + assertFalse( isNonProxyHost( "", "||host||" ) ); + assertFalse( isNonProxyHost( "", ",,host,," ) ); + } + + @Test + public void testIsNonProxyHost_Trimming() + { + assertFalse( isNonProxyHost( "", " " ) ); + assertTrue( isNonProxyHost( "eclipse.org", " eclipse.org " ) ); + assertTrue( isNonProxyHost( "eclipse.org", "host1| eclipse.org |host2" ) ); + assertTrue( isNonProxyHost( "eclipse.org", "host1|eclipse.org " ) ); + assertTrue( isNonProxyHost( "eclipse.org", " eclipse.org|host2" ) ); + } + + @Test + public void testIsNonProxyHost_Misc() + { + assertFalse( isNonProxyHost( "www.eclipse.org", "www.eclipse.com" ) ); + assertFalse( isNonProxyHost( "www.eclipse.org", "eclipse.org" ) ); + } + + @Test + public void testIsNonProxyHost_CaseInsensitivity() + { + assertTrue( isNonProxyHost( "www.eclipse.org", "www.ECLIPSE.org" ) ); + assertTrue( isNonProxyHost( "www.ECLIPSE.org", "www.eclipse.org" ) ); + } + + @Test + public void testGetProxy_FirstMatchWins() + { + DefaultProxySelector selector = new DefaultProxySelector(); + Proxy proxy1 = new Proxy( Proxy.TYPE_HTTP, "proxy", 88 ); + selector.add( proxy1, "localhost" ); + Proxy proxy2 = new Proxy( Proxy.TYPE_HTTP, "other", 8888 ); + selector.add( proxy2, "" ); + + assertSame( proxy1, selector.getProxy( newRepo( "http://eclipse.org/" ) ) ); + assertSame( proxy2, selector.getProxy( newRepo( "http://localhost/" ) ) ); + } + + @Test + public void testGetProxy_Http() + { + DefaultProxySelector selector = new DefaultProxySelector(); + Proxy proxy1 = new Proxy( Proxy.TYPE_HTTP, "proxy", 88 ); + selector.add( proxy1, "localhost" ); + + assertSame( proxy1, selector.getProxy( newRepo( "http://eclipse.org/" ) ) ); + assertSame( proxy1, selector.getProxy( newRepo( "HTTP://eclipse.org/" ) ) ); + + assertSame( proxy1, selector.getProxy( newRepo( "https://eclipse.org/" ) ) ); + assertSame( proxy1, selector.getProxy( newRepo( "HTTPS://eclipse.org/" ) ) ); + + assertNull( selector.getProxy( newRepo( "http://localhost/" ) ) ); + + Proxy proxy2 = new Proxy( Proxy.TYPE_HTTPS, "sproxy", 888 ); + selector.add( proxy2, "localhost" ); + + assertSame( proxy1, selector.getProxy( newRepo( "http://eclipse.org/" ) ) ); + assertSame( proxy1, selector.getProxy( newRepo( "HTTP://eclipse.org/" ) ) ); + + assertSame( proxy2, selector.getProxy( newRepo( "https://eclipse.org/" ) ) ); + assertSame( proxy2, selector.getProxy( newRepo( "HTTPS://eclipse.org/" ) ) ); + } + + @Test + public void testGetProxy_WebDav() + { + DefaultProxySelector selector = new DefaultProxySelector(); + Proxy proxy1 = new Proxy( Proxy.TYPE_HTTP, "proxy", 88 ); + selector.add( proxy1, "localhost" ); + + assertSame( proxy1, selector.getProxy( newRepo( "dav://eclipse.org/" ) ) ); + assertSame( proxy1, selector.getProxy( newRepo( "dav:http://eclipse.org/" ) ) ); + + assertSame( proxy1, selector.getProxy( newRepo( "davs://eclipse.org/" ) ) ); + assertSame( proxy1, selector.getProxy( newRepo( "dav:https://eclipse.org/" ) ) ); + + assertNull( selector.getProxy( newRepo( "dav://localhost/" ) ) ); + + Proxy proxy2 = new Proxy( Proxy.TYPE_HTTPS, "sproxy", 888 ); + selector.add( proxy2, "localhost" ); + + assertSame( proxy1, selector.getProxy( newRepo( "dav://eclipse.org/" ) ) ); + assertSame( proxy1, selector.getProxy( newRepo( "dav:http://eclipse.org/" ) ) ); + + assertSame( proxy2, selector.getProxy( newRepo( "davs://eclipse.org/" ) ) ); + assertSame( proxy2, selector.getProxy( newRepo( "dav:https://eclipse.org/" ) ) ); + } + +} diff --git a/aether-util/src/test/java/org/eclipse/aether/util/repository/JreProxySelectorTest.java b/maven-resolver-util/src/test/java/org/eclipse/aether/util/repository/JreProxySelectorTest.java similarity index 87% rename from aether-util/src/test/java/org/eclipse/aether/util/repository/JreProxySelectorTest.java rename to maven-resolver-util/src/test/java/org/eclipse/aether/util/repository/JreProxySelectorTest.java index 59fba80ac..8eac55b59 100644 --- a/aether-util/src/test/java/org/eclipse/aether/util/repository/JreProxySelectorTest.java +++ b/maven-resolver-util/src/test/java/org/eclipse/aether/util/repository/JreProxySelectorTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.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 static org.junit.Assert.*; import java.io.IOException; diff --git a/aether-util/src/test/java/org/eclipse/aether/util/repository/SecretAuthenticationTest.java b/maven-resolver-util/src/test/java/org/eclipse/aether/util/repository/SecretAuthenticationTest.java similarity index 78% rename from aether-util/src/test/java/org/eclipse/aether/util/repository/SecretAuthenticationTest.java rename to maven-resolver-util/src/test/java/org/eclipse/aether/util/repository/SecretAuthenticationTest.java index ab3f9da01..df4afafff 100644 --- a/aether-util/src/test/java/org/eclipse/aether/util/repository/SecretAuthenticationTest.java +++ b/maven-resolver-util/src/test/java/org/eclipse/aether/util/repository/SecretAuthenticationTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.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 static org.junit.Assert.*; import org.eclipse.aether.DefaultRepositorySystemSession; diff --git a/aether-util/src/test/java/org/eclipse/aether/util/repository/StringAuthenticationTest.java b/maven-resolver-util/src/test/java/org/eclipse/aether/util/repository/StringAuthenticationTest.java similarity index 77% rename from aether-util/src/test/java/org/eclipse/aether/util/repository/StringAuthenticationTest.java rename to maven-resolver-util/src/test/java/org/eclipse/aether/util/repository/StringAuthenticationTest.java index e44799395..8f89299fe 100644 --- a/aether-util/src/test/java/org/eclipse/aether/util/repository/StringAuthenticationTest.java +++ b/maven-resolver-util/src/test/java/org/eclipse/aether/util/repository/StringAuthenticationTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.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 static org.junit.Assert.*; import org.eclipse.aether.DefaultRepositorySystemSession; diff --git a/aether-util/src/test/java/org/eclipse/aether/util/version/AbstractVersionTest.java b/maven-resolver-util/src/test/java/org/eclipse/aether/util/version/AbstractVersionTest.java similarity index 72% rename from aether-util/src/test/java/org/eclipse/aether/util/version/AbstractVersionTest.java rename to maven-resolver-util/src/test/java/org/eclipse/aether/util/version/AbstractVersionTest.java index 388a4076a..52541dba4 100644 --- a/aether-util/src/test/java/org/eclipse/aether/util/version/AbstractVersionTest.java +++ b/maven-resolver-util/src/test/java/org/eclipse/aether/util/version/AbstractVersionTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.version; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.assertEquals; import org.eclipse.aether.version.Version; diff --git a/aether-util/src/test/java/org/eclipse/aether/util/version/GenericVersionRangeTest.java b/maven-resolver-util/src/test/java/org/eclipse/aether/util/version/GenericVersionRangeTest.java similarity index 83% rename from aether-util/src/test/java/org/eclipse/aether/util/version/GenericVersionRangeTest.java rename to maven-resolver-util/src/test/java/org/eclipse/aether/util/version/GenericVersionRangeTest.java index 681941309..85d007f6a 100644 --- a/aether-util/src/test/java/org/eclipse/aether/util/version/GenericVersionRangeTest.java +++ b/maven-resolver-util/src/test/java/org/eclipse/aether/util/version/GenericVersionRangeTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2013 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.version; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import org.eclipse.aether.util.version.GenericVersion; diff --git a/aether-util/src/test/java/org/eclipse/aether/util/version/GenericVersionSchemeTest.java b/maven-resolver-util/src/test/java/org/eclipse/aether/util/version/GenericVersionSchemeTest.java similarity index 78% rename from aether-util/src/test/java/org/eclipse/aether/util/version/GenericVersionSchemeTest.java rename to maven-resolver-util/src/test/java/org/eclipse/aether/util/version/GenericVersionSchemeTest.java index 7ec442462..f52f73dce 100644 --- a/aether-util/src/test/java/org/eclipse/aether/util/version/GenericVersionSchemeTest.java +++ b/maven-resolver-util/src/test/java/org/eclipse/aether/util/version/GenericVersionSchemeTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.version; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import org.eclipse.aether.util.version.GenericVersion; diff --git a/aether-util/src/test/java/org/eclipse/aether/util/version/GenericVersionTest.java b/maven-resolver-util/src/test/java/org/eclipse/aether/util/version/GenericVersionTest.java similarity index 93% rename from aether-util/src/test/java/org/eclipse/aether/util/version/GenericVersionTest.java rename to maven-resolver-util/src/test/java/org/eclipse/aether/util/version/GenericVersionTest.java index 60d1f5d0b..ae891af67 100644 --- a/aether-util/src/test/java/org/eclipse/aether/util/version/GenericVersionTest.java +++ b/maven-resolver-util/src/test/java/org/eclipse/aether/util/version/GenericVersionTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2010, 2011 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.version; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES 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.Locale; import org.eclipse.aether.util.version.GenericVersion; diff --git a/aether-util/src/test/java/org/eclipse/aether/util/version/UnionVersionRangeTest.java b/maven-resolver-util/src/test/java/org/eclipse/aether/util/version/UnionVersionRangeTest.java similarity index 77% rename from aether-util/src/test/java/org/eclipse/aether/util/version/UnionVersionRangeTest.java rename to maven-resolver-util/src/test/java/org/eclipse/aether/util/version/UnionVersionRangeTest.java index ea00b7aa7..570b6b778 100644 --- a/aether-util/src/test/java/org/eclipse/aether/util/version/UnionVersionRangeTest.java +++ b/maven-resolver-util/src/test/java/org/eclipse/aether/util/version/UnionVersionRangeTest.java @@ -1,15 +1,24 @@ -/******************************************************************************* - * Copyright (c) 2012 Sonatype, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Sonatype, Inc. - initial API and implementation - *******************************************************************************/ package org.eclipse.aether.util.version; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + import static org.junit.Assert.*; import java.util.Collections; diff --git a/aether-util/src/test/resources/transformer/conflict-id-sorter/cycle.txt b/maven-resolver-util/src/test/resources/transformer/conflict-id-sorter/cycle.txt similarity index 100% rename from aether-util/src/test/resources/transformer/conflict-id-sorter/cycle.txt rename to maven-resolver-util/src/test/resources/transformer/conflict-id-sorter/cycle.txt diff --git a/aether-util/src/test/resources/transformer/conflict-id-sorter/cycles.txt b/maven-resolver-util/src/test/resources/transformer/conflict-id-sorter/cycles.txt similarity index 100% rename from aether-util/src/test/resources/transformer/conflict-id-sorter/cycles.txt rename to maven-resolver-util/src/test/resources/transformer/conflict-id-sorter/cycles.txt diff --git a/aether-util/src/test/resources/transformer/conflict-id-sorter/no-conflicts.txt b/maven-resolver-util/src/test/resources/transformer/conflict-id-sorter/no-conflicts.txt similarity index 100% rename from aether-util/src/test/resources/transformer/conflict-id-sorter/no-conflicts.txt rename to maven-resolver-util/src/test/resources/transformer/conflict-id-sorter/no-conflicts.txt diff --git a/aether-util/src/test/resources/transformer/conflict-id-sorter/simple.txt b/maven-resolver-util/src/test/resources/transformer/conflict-id-sorter/simple.txt similarity index 100% rename from aether-util/src/test/resources/transformer/conflict-id-sorter/simple.txt rename to maven-resolver-util/src/test/resources/transformer/conflict-id-sorter/simple.txt diff --git a/aether-util/src/test/resources/transformer/conflict-marker/relocation1.txt b/maven-resolver-util/src/test/resources/transformer/conflict-marker/relocation1.txt similarity index 100% rename from aether-util/src/test/resources/transformer/conflict-marker/relocation1.txt rename to maven-resolver-util/src/test/resources/transformer/conflict-marker/relocation1.txt diff --git a/aether-util/src/test/resources/transformer/conflict-marker/relocation2.txt b/maven-resolver-util/src/test/resources/transformer/conflict-marker/relocation2.txt similarity index 100% rename from aether-util/src/test/resources/transformer/conflict-marker/relocation2.txt rename to maven-resolver-util/src/test/resources/transformer/conflict-marker/relocation2.txt diff --git a/aether-util/src/test/resources/transformer/conflict-marker/relocation3.txt b/maven-resolver-util/src/test/resources/transformer/conflict-marker/relocation3.txt similarity index 100% rename from aether-util/src/test/resources/transformer/conflict-marker/relocation3.txt rename to maven-resolver-util/src/test/resources/transformer/conflict-marker/relocation3.txt diff --git a/aether-util/src/test/resources/transformer/conflict-marker/simple.txt b/maven-resolver-util/src/test/resources/transformer/conflict-marker/simple.txt similarity index 100% rename from aether-util/src/test/resources/transformer/conflict-marker/simple.txt rename to maven-resolver-util/src/test/resources/transformer/conflict-marker/simple.txt diff --git a/aether-util/src/test/resources/transformer/optionality-selector/conflict-direct-dep.txt b/maven-resolver-util/src/test/resources/transformer/optionality-selector/conflict-direct-dep.txt similarity index 100% rename from aether-util/src/test/resources/transformer/optionality-selector/conflict-direct-dep.txt rename to maven-resolver-util/src/test/resources/transformer/optionality-selector/conflict-direct-dep.txt diff --git a/aether-util/src/test/resources/transformer/optionality-selector/conflict.txt b/maven-resolver-util/src/test/resources/transformer/optionality-selector/conflict.txt similarity index 100% rename from aether-util/src/test/resources/transformer/optionality-selector/conflict.txt rename to maven-resolver-util/src/test/resources/transformer/optionality-selector/conflict.txt diff --git a/aether-util/src/test/resources/transformer/optionality-selector/derive.txt b/maven-resolver-util/src/test/resources/transformer/optionality-selector/derive.txt similarity index 100% rename from aether-util/src/test/resources/transformer/optionality-selector/derive.txt rename to maven-resolver-util/src/test/resources/transformer/optionality-selector/derive.txt diff --git a/aether-util/src/test/resources/transformer/scope-calculator/conflict-and-inheritance.txt b/maven-resolver-util/src/test/resources/transformer/scope-calculator/conflict-and-inheritance.txt similarity index 100% rename from aether-util/src/test/resources/transformer/scope-calculator/conflict-and-inheritance.txt rename to maven-resolver-util/src/test/resources/transformer/scope-calculator/conflict-and-inheritance.txt diff --git a/aether-util/src/test/resources/transformer/scope-calculator/conflicting-direct-nodes.txt b/maven-resolver-util/src/test/resources/transformer/scope-calculator/conflicting-direct-nodes.txt similarity index 100% rename from aether-util/src/test/resources/transformer/scope-calculator/conflicting-direct-nodes.txt rename to maven-resolver-util/src/test/resources/transformer/scope-calculator/conflicting-direct-nodes.txt diff --git a/aether-util/src/test/resources/transformer/scope-calculator/cycle-a.txt b/maven-resolver-util/src/test/resources/transformer/scope-calculator/cycle-a.txt similarity index 100% rename from aether-util/src/test/resources/transformer/scope-calculator/cycle-a.txt rename to maven-resolver-util/src/test/resources/transformer/scope-calculator/cycle-a.txt diff --git a/aether-util/src/test/resources/transformer/scope-calculator/cycle-b.txt b/maven-resolver-util/src/test/resources/transformer/scope-calculator/cycle-b.txt similarity index 100% rename from aether-util/src/test/resources/transformer/scope-calculator/cycle-b.txt rename to maven-resolver-util/src/test/resources/transformer/scope-calculator/cycle-b.txt diff --git a/aether-util/src/test/resources/transformer/scope-calculator/cycle-c.txt b/maven-resolver-util/src/test/resources/transformer/scope-calculator/cycle-c.txt similarity index 100% rename from aether-util/src/test/resources/transformer/scope-calculator/cycle-c.txt rename to maven-resolver-util/src/test/resources/transformer/scope-calculator/cycle-c.txt diff --git a/aether-util/src/test/resources/transformer/scope-calculator/cycle-d.txt b/maven-resolver-util/src/test/resources/transformer/scope-calculator/cycle-d.txt similarity index 100% rename from aether-util/src/test/resources/transformer/scope-calculator/cycle-d.txt rename to maven-resolver-util/src/test/resources/transformer/scope-calculator/cycle-d.txt diff --git a/aether-util/src/test/resources/transformer/scope-calculator/direct-nodes-winning.txt b/maven-resolver-util/src/test/resources/transformer/scope-calculator/direct-nodes-winning.txt similarity index 100% rename from aether-util/src/test/resources/transformer/scope-calculator/direct-nodes-winning.txt rename to maven-resolver-util/src/test/resources/transformer/scope-calculator/direct-nodes-winning.txt diff --git a/aether-util/src/test/resources/transformer/scope-calculator/direct-with-conflict-and-inheritance.txt b/maven-resolver-util/src/test/resources/transformer/scope-calculator/direct-with-conflict-and-inheritance.txt similarity index 100% rename from aether-util/src/test/resources/transformer/scope-calculator/direct-with-conflict-and-inheritance.txt rename to maven-resolver-util/src/test/resources/transformer/scope-calculator/direct-with-conflict-and-inheritance.txt diff --git a/aether-util/src/test/resources/transformer/scope-calculator/dueling-scopes.txt b/maven-resolver-util/src/test/resources/transformer/scope-calculator/dueling-scopes.txt similarity index 100% rename from aether-util/src/test/resources/transformer/scope-calculator/dueling-scopes.txt rename to maven-resolver-util/src/test/resources/transformer/scope-calculator/dueling-scopes.txt diff --git a/aether-util/src/test/resources/transformer/scope-calculator/inheritance.txt b/maven-resolver-util/src/test/resources/transformer/scope-calculator/inheritance.txt similarity index 100% rename from aether-util/src/test/resources/transformer/scope-calculator/inheritance.txt rename to maven-resolver-util/src/test/resources/transformer/scope-calculator/inheritance.txt diff --git a/aether-util/src/test/resources/transformer/scope-calculator/multiple-inheritance.txt b/maven-resolver-util/src/test/resources/transformer/scope-calculator/multiple-inheritance.txt similarity index 100% rename from aether-util/src/test/resources/transformer/scope-calculator/multiple-inheritance.txt rename to maven-resolver-util/src/test/resources/transformer/scope-calculator/multiple-inheritance.txt diff --git a/aether-util/src/test/resources/transformer/scope-calculator/system-1.txt b/maven-resolver-util/src/test/resources/transformer/scope-calculator/system-1.txt similarity index 100% rename from aether-util/src/test/resources/transformer/scope-calculator/system-1.txt rename to maven-resolver-util/src/test/resources/transformer/scope-calculator/system-1.txt diff --git a/aether-util/src/test/resources/transformer/scope-calculator/system-2.txt b/maven-resolver-util/src/test/resources/transformer/scope-calculator/system-2.txt similarity index 100% rename from aether-util/src/test/resources/transformer/scope-calculator/system-2.txt rename to maven-resolver-util/src/test/resources/transformer/scope-calculator/system-2.txt diff --git a/aether-util/src/test/resources/transformer/version-resolver/conflict-id-cycle.txt b/maven-resolver-util/src/test/resources/transformer/version-resolver/conflict-id-cycle.txt similarity index 100% rename from aether-util/src/test/resources/transformer/version-resolver/conflict-id-cycle.txt rename to maven-resolver-util/src/test/resources/transformer/version-resolver/conflict-id-cycle.txt diff --git a/aether-util/src/test/resources/transformer/version-resolver/cycle.txt b/maven-resolver-util/src/test/resources/transformer/version-resolver/cycle.txt similarity index 100% rename from aether-util/src/test/resources/transformer/version-resolver/cycle.txt rename to maven-resolver-util/src/test/resources/transformer/version-resolver/cycle.txt diff --git a/aether-util/src/test/resources/transformer/version-resolver/dead-conflict-group.txt b/maven-resolver-util/src/test/resources/transformer/version-resolver/dead-conflict-group.txt similarity index 100% rename from aether-util/src/test/resources/transformer/version-resolver/dead-conflict-group.txt rename to maven-resolver-util/src/test/resources/transformer/version-resolver/dead-conflict-group.txt diff --git a/aether-util/src/test/resources/transformer/version-resolver/loop.txt b/maven-resolver-util/src/test/resources/transformer/version-resolver/loop.txt similarity index 100% rename from aether-util/src/test/resources/transformer/version-resolver/loop.txt rename to maven-resolver-util/src/test/resources/transformer/version-resolver/loop.txt diff --git a/aether-util/src/test/resources/transformer/version-resolver/nearest-underneath-loser-a.txt b/maven-resolver-util/src/test/resources/transformer/version-resolver/nearest-underneath-loser-a.txt similarity index 100% rename from aether-util/src/test/resources/transformer/version-resolver/nearest-underneath-loser-a.txt rename to maven-resolver-util/src/test/resources/transformer/version-resolver/nearest-underneath-loser-a.txt diff --git a/aether-util/src/test/resources/transformer/version-resolver/nearest-underneath-loser-b.txt b/maven-resolver-util/src/test/resources/transformer/version-resolver/nearest-underneath-loser-b.txt similarity index 100% rename from aether-util/src/test/resources/transformer/version-resolver/nearest-underneath-loser-b.txt rename to maven-resolver-util/src/test/resources/transformer/version-resolver/nearest-underneath-loser-b.txt diff --git a/aether-util/src/test/resources/transformer/version-resolver/overlapping-cycles.txt b/maven-resolver-util/src/test/resources/transformer/version-resolver/overlapping-cycles.txt similarity index 100% rename from aether-util/src/test/resources/transformer/version-resolver/overlapping-cycles.txt rename to maven-resolver-util/src/test/resources/transformer/version-resolver/overlapping-cycles.txt diff --git a/aether-util/src/test/resources/transformer/version-resolver/range-backtracking.txt b/maven-resolver-util/src/test/resources/transformer/version-resolver/range-backtracking.txt similarity index 100% rename from aether-util/src/test/resources/transformer/version-resolver/range-backtracking.txt rename to maven-resolver-util/src/test/resources/transformer/version-resolver/range-backtracking.txt diff --git a/aether-util/src/test/resources/transformer/version-resolver/ranges.txt b/maven-resolver-util/src/test/resources/transformer/version-resolver/ranges.txt similarity index 100% rename from aether-util/src/test/resources/transformer/version-resolver/ranges.txt rename to maven-resolver-util/src/test/resources/transformer/version-resolver/ranges.txt diff --git a/aether-util/src/test/resources/transformer/version-resolver/scope-vs-version.txt b/maven-resolver-util/src/test/resources/transformer/version-resolver/scope-vs-version.txt similarity index 100% rename from aether-util/src/test/resources/transformer/version-resolver/scope-vs-version.txt rename to maven-resolver-util/src/test/resources/transformer/version-resolver/scope-vs-version.txt diff --git a/aether-util/src/test/resources/transformer/version-resolver/sibling-versions.txt b/maven-resolver-util/src/test/resources/transformer/version-resolver/sibling-versions.txt similarity index 100% rename from aether-util/src/test/resources/transformer/version-resolver/sibling-versions.txt rename to maven-resolver-util/src/test/resources/transformer/version-resolver/sibling-versions.txt diff --git a/aether-util/src/test/resources/transformer/version-resolver/soft-vs-range.txt b/maven-resolver-util/src/test/resources/transformer/version-resolver/soft-vs-range.txt similarity index 100% rename from aether-util/src/test/resources/transformer/version-resolver/soft-vs-range.txt rename to maven-resolver-util/src/test/resources/transformer/version-resolver/soft-vs-range.txt diff --git a/aether-util/src/test/resources/transformer/version-resolver/unsolvable-with-cycle.txt b/maven-resolver-util/src/test/resources/transformer/version-resolver/unsolvable-with-cycle.txt similarity index 100% rename from aether-util/src/test/resources/transformer/version-resolver/unsolvable-with-cycle.txt rename to maven-resolver-util/src/test/resources/transformer/version-resolver/unsolvable-with-cycle.txt diff --git a/aether-util/src/test/resources/transformer/version-resolver/unsolvable.txt b/maven-resolver-util/src/test/resources/transformer/version-resolver/unsolvable.txt similarity index 100% rename from aether-util/src/test/resources/transformer/version-resolver/unsolvable.txt rename to maven-resolver-util/src/test/resources/transformer/version-resolver/unsolvable.txt diff --git a/aether-util/src/test/resources/transformer/version-resolver/verbose.txt b/maven-resolver-util/src/test/resources/transformer/version-resolver/verbose.txt similarity index 100% rename from aether-util/src/test/resources/transformer/version-resolver/verbose.txt rename to maven-resolver-util/src/test/resources/transformer/version-resolver/verbose.txt diff --git a/aether-util/src/test/resources/visitor/filtering/parents.txt b/maven-resolver-util/src/test/resources/visitor/filtering/parents.txt similarity index 100% rename from aether-util/src/test/resources/visitor/filtering/parents.txt rename to maven-resolver-util/src/test/resources/visitor/filtering/parents.txt diff --git a/aether-util/src/test/resources/visitor/ordered-list/cycles.txt b/maven-resolver-util/src/test/resources/visitor/ordered-list/cycles.txt similarity index 100% rename from aether-util/src/test/resources/visitor/ordered-list/cycles.txt rename to maven-resolver-util/src/test/resources/visitor/ordered-list/cycles.txt diff --git a/aether-util/src/test/resources/visitor/ordered-list/simple.txt b/maven-resolver-util/src/test/resources/visitor/ordered-list/simple.txt similarity index 100% rename from aether-util/src/test/resources/visitor/ordered-list/simple.txt rename to maven-resolver-util/src/test/resources/visitor/ordered-list/simple.txt diff --git a/aether-util/src/test/resources/visitor/path-recorder/cycle.txt b/maven-resolver-util/src/test/resources/visitor/path-recorder/cycle.txt similarity index 100% rename from aether-util/src/test/resources/visitor/path-recorder/cycle.txt rename to maven-resolver-util/src/test/resources/visitor/path-recorder/cycle.txt diff --git a/aether-util/src/test/resources/visitor/path-recorder/nested.txt b/maven-resolver-util/src/test/resources/visitor/path-recorder/nested.txt similarity index 100% rename from aether-util/src/test/resources/visitor/path-recorder/nested.txt rename to maven-resolver-util/src/test/resources/visitor/path-recorder/nested.txt diff --git a/aether-util/src/test/resources/visitor/path-recorder/parents.txt b/maven-resolver-util/src/test/resources/visitor/path-recorder/parents.txt similarity index 100% rename from aether-util/src/test/resources/visitor/path-recorder/parents.txt rename to maven-resolver-util/src/test/resources/visitor/path-recorder/parents.txt diff --git a/aether-util/src/test/resources/visitor/path-recorder/simple.txt b/maven-resolver-util/src/test/resources/visitor/path-recorder/simple.txt similarity index 100% rename from aether-util/src/test/resources/visitor/path-recorder/simple.txt rename to maven-resolver-util/src/test/resources/visitor/path-recorder/simple.txt diff --git a/aether-util/src/test/resources/visitor/tree/cycles.txt b/maven-resolver-util/src/test/resources/visitor/tree/cycles.txt similarity index 100% rename from aether-util/src/test/resources/visitor/tree/cycles.txt rename to maven-resolver-util/src/test/resources/visitor/tree/cycles.txt diff --git a/notice.html b/notice.html deleted file mode 100644 index c3d34c3c2..000000000 --- a/notice.html +++ /dev/null @@ -1,107 +0,0 @@ - - - - - -Eclipse Foundation Software User Agreement - - - -

Eclipse Foundation Software User Agreement

-

April 9, 2014

- -

Usage Of Content

- -

THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS - (COLLECTIVELY "CONTENT"). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND - CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE - OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR - NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND - CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.

- -

Applicable Licenses

- -

Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0 - ("EPL"). A copy of the EPL is provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html. - For purposes of the EPL, "Program" will mean the Content.

- -

Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse Foundation source code - repository ("Repository") in software modules ("Modules") and made available as downloadable archives ("Downloads").

- -
    -
  • Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"), plug-in fragments ("Fragments"), and features ("Features").
  • -
  • Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java™ ARchive) in a directory named "plugins".
  • -
  • A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named "features". Within a Feature, files named "feature.xml" may contain a list of the names and version numbers of the Plug-ins - and/or Fragments associated with that Feature.
  • -
  • Features may also include other Features ("Included Features"). Within a Feature, files named "feature.xml" may contain a list of the names and version numbers of Included Features.
  • -
- -

The terms and conditions governing Plug-ins and Fragments should be contained in files named "about.html" ("Abouts"). The terms and conditions governing Features and -Included Features should be contained in files named "license.html" ("Feature Licenses"). Abouts and Feature Licenses may be located in any directory of a Download or Module -including, but not limited to the following locations:

- -
    -
  • The top-level (root) directory
  • -
  • Plug-in and Fragment directories
  • -
  • Inside Plug-ins and Fragments packaged as JARs
  • -
  • Sub-directories of the directory named "src" of certain Plug-ins
  • -
  • Feature directories
  • -
- -

Note: if a Feature made available by the Eclipse Foundation is installed using the Provisioning Technology (as defined below), you must agree to a license ("Feature Update License") during the -installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or -inform you where you can locate them. Feature Update Licenses may be found in the "license" property of files named "feature.properties" found within a Feature. -Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in -that directory.

- -

THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE -OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):

- - - -

IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please -contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.

- - -

Use of Provisioning Technology

- -

The Eclipse Foundation makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse - Update Manager ("Provisioning Technology") for the purpose of allowing users to install software, documentation, information and/or - other materials (collectively "Installable Software"). This capability is provided with the intent of allowing such users to - install, extend and update Eclipse-based products. Information about packaging Installable Software is available at http://eclipse.org/equinox/p2/repository_packaging.html - ("Specification").

- -

You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the - applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology - in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the - Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:

- -
    -
  1. A series of actions may occur ("Provisioning Process") in which a user may execute the Provisioning Technology - on a machine ("Target Machine") with the intent of installing, extending or updating the functionality of an Eclipse-based - product.
  2. -
  3. During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be - accessed and copied to the Target Machine.
  4. -
  5. Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable - Software ("Installable Software Agreement") and such Installable Software Agreement shall be accessed from the Target - Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern - the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such - indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.
  6. -
- -

Cryptography

- -

Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to - another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import, - possession, or use, and re-export of encryption software, to see if this is permitted.

- -

Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.

- - diff --git a/pom.xml b/pom.xml index 753916b9d..78d671b96 100644 --- a/pom.xml +++ b/pom.xml @@ -1,171 +1,119 @@ - + 4.0.0 - org.eclipse.aether - aether - 1.0.0.v20140518 + + org.apache.maven + maven-parent + 30 + + + org.apache.maven.resolver + maven-resolver + 1.2.0-SNAPSHOT pom - Aether + Maven Artifact Resolver The parent and aggregator for the repository system. - http://www.eclipse.org/aether/ + http://maven.apache.org/resolver/ 2010 - - The Eclipse Foundation - http://www.eclipse.org/ - - - - - Aether Developer List - https://dev.eclipse.org/mailman/listinfo/aether-dev - https://dev.eclipse.org/mailman/listinfo/aether-dev - aether-dev@eclipse.org - http://dev.eclipse.org/mhonarc/lists/aether-dev/ - - - Aether User List - https://dev.eclipse.org/mailman/listinfo/aether-users - https://dev.eclipse.org/mailman/listinfo/aether-users - aether-users@eclipse.org - http://dev.eclipse.org/mhonarc/lists/aether-users/ - - - Aether Commit Notification List - https://dev.eclipse.org/mailman/listinfo/aether-commit - https://dev.eclipse.org/mailman/listinfo/aether-commit - http://dev.eclipse.org/mhonarc/lists/aether-commit/ - - - Aether CI Notification List - https://dev.eclipse.org/mailman/listinfo/aether-build - https://dev.eclipse.org/mailman/listinfo/aether-build - http://dev.eclipse.org/mhonarc/lists/aether-build/ - - - - scm:git:git://git.eclipse.org/gitroot/aether/aether-core.git - scm:git:ssh://git.eclipse.org/gitroot/aether/aether-core.git - http://git.eclipse.org/c/aether/aether-core.git/tree/ + scm:git:https://git-wip-us.apache.org/repos/asf/maven-resolver.git + scm:git:https://git-wip-us.apache.org/repos/asf/maven-resolver.git + https://github.com/apache/maven-resolver/tree/${project.scm.tag} + master - - bugzilla - https://bugs.eclipse.org/bugs/buglist.cgi?query_format=specific&bug_status=__open__&product=Aether + jira + https://issues.apache.org/jira/browse/MRESOLVER - - Hudson - https://hudson.eclipse.org/aether/job/aether-core/ + Jenkins + https://builds.apache.org/job/maven-resolver/ - - - sonatype-nexus-staging - https://oss.sonatype.org/service/local/staging/deploy/maven2/ - - - ${sonatypeOssDistMgmtSnapshotsId} - ${sonatypeOssDistMgmtSnapshotsUrl} - + + apache.website + scm:svn:https://svn.apache.org/repos/infra/websites/production/maven/components/${maven.site.path} + - - - Eclipse Public License, Version 1.0 - http://www.eclipse.org/legal/epl-v10.html - repo - - - - - - bbentmann - Benjamin Bentmann - - Project Lead - - - - jvanzyl - Jason Van Zyl - - Project Lead - - - + + 7 + true + resolver-archives/resolver-LATEST + UnusedImports,LineLength,InnerAssignment,MagicNumber,AvoidNestedBlocks,ParameterNumber,MethodLength,MemberName + 0.3.3 + - aether-api - aether-spi - aether-util - aether-impl - aether-test-util - aether-connector-basic - aether-transport-classpath - aether-transport-file - aether-transport-http - aether-transport-wagon + maven-resolver-api + maven-resolver-spi + maven-resolver-util + maven-resolver-impl + maven-resolver-test-util + maven-resolver-connector-basic + maven-resolver-transport-classpath + maven-resolver-transport-file + maven-resolver-transport-http + maven-resolver-transport-wagon - - J2SE-1.5 - Eclipse Aether - UTF-8 - UTF-8 - true - sonatype-nexus-snapshots - https://oss.sonatype.org/content/repositories/snapshots/ - - - org.eclipse.aether - aether-api + org.apache.maven.resolver + maven-resolver-api ${project.version} - org.eclipse.aether - aether-spi + org.apache.maven.resolver + maven-resolver-spi ${project.version} - org.eclipse.aether - aether-util + org.apache.maven.resolver + maven-resolver-util ${project.version} - org.eclipse.aether - aether-impl + org.apache.maven.resolver + maven-resolver-impl ${project.version} - org.eclipse.aether - aether-connector-basic + org.apache.maven.resolver + maven-resolver-connector-basic ${project.version} - org.eclipse.aether - aether-test-util + org.apache.maven.resolver + maven-resolver-test-util ${project.version} test @@ -173,7 +121,7 @@ junit junit - 4.11 + 4.12 test @@ -182,12 +130,6 @@ 1.3 test - - org.hamcrest - hamcrest-library - 1.3 - test - javax.inject @@ -198,19 +140,19 @@ org.codehaus.plexus plexus-component-annotations - 1.5.5 + 1.7.1 provided org.eclipse.sisu org.eclipse.sisu.inject - 0.1.1 + ${sisu.version} org.eclipse.sisu org.eclipse.sisu.plexus - 0.1.1 + ${sisu.version} javax.enterprise @@ -221,7 +163,7 @@ org.sonatype.sisu sisu-guice - 3.1.6 + 3.2.6 no_aop @@ -238,7 +180,7 @@ org.slf4j slf4j-api - 1.6.2 + 1.7.16 @@ -246,85 +188,9 @@ - - org.apache.felix - maven-bundle-plugin - 2.4.0 - - - ${project.url} - ${project.name} - ${bundle.env} - ${bundle.symbolicName} - ${bundle.vendor} - ${bundle.osgiVersion} - org.eclipse.aether.internal.*;x-internal:=true,org.eclipse.aether.* - - - - - create-manifest - process-test-classes - - manifest - - - - - - org.apache.maven.plugins - maven-assembly-plugin - 2.2.1 - - - org.apache.maven.plugins - maven-clean-plugin - 2.5 - - - org.apache.maven.plugins - maven-compiler-plugin - 2.5.1 - - 1.5 - 1.5 - - - - org.apache.maven.plugins - maven-deploy-plugin - 2.5 - - - org.apache.maven.plugins - maven-enforcer-plugin - 1.2 - - - org.apache.maven.plugins - maven-gpg-plugin - 1.2 - - - org.apache.maven.plugins - maven-install-plugin - 2.3.1 - - - org.apache.maven.plugins - maven-jar-plugin - - 2.3.2 - - - ${project.build.outputDirectory}/META-INF/MANIFEST.MF - - - org.apache.maven.plugins maven-javadoc-plugin - 2.8.1 false @@ -394,51 +260,9 @@ - - org.apache.maven.plugins - maven-release-plugin - 2.1 - - true - forked-path - false - deploy javadoc:aggregate-jar assembly:attached - -Psonatype-oss-release - - - - org.apache.maven.plugins - maven-resources-plugin - 2.6 - - - org.apache.maven.plugins - maven-site-plugin - 3.0 - - - org.apache.maven.plugins - maven-source-plugin - 2.1.2 - - - - 2 - ${project.name} Sources - http://www.eclipse.org/legal/epl-v10.html - ${bundle.env} - ${bundle.symbolicName}.source - ${bundle.vendor} - ${bundle.osgiVersion} - ${bundle.symbolicName};version="${bundle.osgiVersion}";roots:="." - - - - org.apache.maven.plugins maven-surefire-plugin - 2.9 -Xmx128m ${surefire.redirectTestOutputToFile} @@ -447,36 +271,9 @@ - - org.codehaus.mojo - animal-sniffer-maven-plugin - 1.9 - - - org.codehaus.mojo.signature - java15 - 1.0 - - - - - check-java-1.5-compat - process-classes - - check - - - - - - org.codehaus.mojo - clirr-maven-plugin - 2.3 - org.codehaus.plexus plexus-component-metadata - 1.5.5 generate-components-xml @@ -490,7 +287,7 @@ org.eclipse.sisu sisu-maven-plugin - 0.0.0.M2 + ${sisu.version} generate-index @@ -501,240 +298,81 @@ + + org.apache.rat + apache-rat-plugin + + + src/test/resources/**/*.ini + src/test/resources/**/*.txt + + src/test/resources/ssl/server-store + src/test/resources/ssl/client-store + + + - - - org.apache.maven.plugins - maven-enforcer-plugin - - - qa - verify - - enforce - - - - - - project.version - [0-9]+\.[0-9]+\.[0-9]+((.*-SNAPSHOT)|(\.M[0-9]+)|(\.RC[0-9]+)|(\.v[0-9]{8})) - Project version must be either X.Y.Z.M#, X.Y.Z.RC# or X.Y.Z.v######## - - - - true - - *:* - - - org.eclipse.aether - org.eclipse.sisu - org.eclipse.jetty:*:*:*:test - - org.slf4j:slf4j-api:[1.6.2] - - org.codehaus.plexus:plexus-component-annotations:[1.5.5] - - org.codehaus.plexus:plexus-utils:[2.1] - - org.codehaus.plexus:plexus-classworlds:[2.4] - - org.apache.maven.wagon:wagon-provider-api:[1.0] - - org.sonatype.sisu:sisu-guice:[3.1.6] - - com.google.guava:guava:[11.0.2] - - javax.inject:javax.inject:[1] - - org.apache.httpcomponents:httpclient:[4.2.6] - - org.apache.httpcomponents:httpcore:[4.2.5] - - commons-codec:commons-codec:[1.6] - - org.slf4j:jcl-over-slf4j:[1.6.2] - - junit:junit:[4.11]:*:test - org.hamcrest:hamcrest-core:[1.3]:*:test - org.hamcrest:hamcrest-library:[1.3]:*:test - com.googlecode.jmockit:jmockit:[1.3]:*:test - ch.qos.logback:logback-core:[1.0.7]:*:test - ch.qos.logback:logback-classic:[1.0.7]:*:test - org.eclipse.jetty.orbit:javax.servlet:[2.5.0.v201103041518]:*:test - - - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 1.7 - - - osgi-timestamp - initialize - - timestamp-property - - - bundle.osgiTimestamp - yyyyMMdd-HHmm - UTC - en - - - - osgi-version - initialize - - regex-property - - - bundle.osgiVersion - ${project.version} - -SNAPSHOT - .${bundle.osgiTimestamp} - false - - - - - - sonatype-oss-release + clirr - org.apache.maven.plugins - maven-source-plugin - - - attach-sources - package - - jar-no-fork - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - - - attach-javadocs - package - - jar - - - - default-cli - - false - - - - - - org.apache.maven.plugins - maven-gpg-plugin + org.codehaus.mojo + clirr-maven-plugin - sign-artifacts + check-api-compat verify - sign + check-no-fork - - org.apache.maven.plugins - maven-assembly-plugin - - - org.apache.apache.resources - apache-source-release-assembly-descriptor - 1.0.2 - - - - - attach-source-release-distro - package - - single - - - true - - source-release - - gnu - - - - default-cli - - false - - src/main/assembly/bin.xml - - - - - - snapshot-sources - + reporting + org.apache.maven.plugins - maven-source-plugin - - - attach-sources - - jar-no-fork - - - + maven-javadoc-plugin + + true + true + true + + + + aggregate + false + + aggregate + + + - - - - - clirr - - - org.codehaus.mojo - clirr-maven-plugin - - - check-api-compat - verify - - check-no-fork - - - + org.apache.maven.plugins + maven-jxr-plugin + + + aggregate + false + + aggregate + + + - + m2e @@ -757,7 +395,7 @@ org.eclipse.sisu sisu-maven-plugin - [0.0.0.M2,) + [${sisu.version},) test-index main-index @@ -767,33 +405,10 @@ - - - org.codehaus.mojo - build-helper-maven-plugin - [1.7,) - - regex-property - timestamp-property - - - - - - - - org.apache.felix - maven-bundle-plugin - - - $(replace;${project.version};-SNAPSHOT;.qualifier) - - - diff --git a/src/main/assembly/bin.xml b/src/main/assembly/bin.xml index 24f2c1fc7..240eb666a 100644 --- a/src/main/assembly/bin.xml +++ b/src/main/assembly/bin.xml @@ -1,24 +1,32 @@ - bin-incubation + bin zip - aether-api/target + maven-resolver-api/target . *.jar @@ -30,7 +38,7 @@ - aether-spi/target + maven-resolver-spi/target . *.jar @@ -42,7 +50,7 @@ - aether-util/target + maven-resolver-util/target . *.jar @@ -54,7 +62,7 @@ - aether-impl/target + maven-resolver-impl/target . *.jar @@ -66,7 +74,7 @@ - aether-connector-basic/target + maven-resolver-connector-basic/target . *.jar @@ -78,7 +86,7 @@ - aether-transport-classpath/target + maven-resolver-transport-classpath/target . *.jar @@ -90,7 +98,7 @@ - aether-transport-file/target + maven-resolver-transport-file/target . *.jar @@ -102,7 +110,7 @@ - aether-transport-http/target + maven-resolver-transport-http/target . *.jar @@ -114,7 +122,7 @@ - aether-transport-wagon/target + maven-resolver-transport-wagon/target . *.jar diff --git a/src/site/resources/images/maven-resolver-deps.png b/src/site/resources/images/maven-resolver-deps.png new file mode 100644 index 000000000..955a7cecd Binary files /dev/null and b/src/site/resources/images/maven-resolver-deps.png differ diff --git a/src/site/site.xml b/src/site/site.xml new file mode 100644 index 000000000..4eb944edd --- /dev/null +++ b/src/site/site.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/site/xdoc/index.xml b/src/site/xdoc/index.xml new file mode 100644 index 000000000..8faae8092 --- /dev/null +++ b/src/site/xdoc/index.xml @@ -0,0 +1,58 @@ + + + + + + + + Introduction + Hervé Boutemy + + + + +
+ +

Apache Maven Artifact Resolver is a library for working with artifact repositories and dependency resolution. + Maven Artifact Resolver deals with the specification of local repository, remote repository, developer workspaces, artifact transports and artifact resolution. +

+ +

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

+
+ + + +
diff --git a/src/site/xdoc/maven-resolver-deps.odg b/src/site/xdoc/maven-resolver-deps.odg new file mode 100644 index 000000000..9ffe7d0e7 Binary files /dev/null and b/src/site/xdoc/maven-resolver-deps.odg differ