Author: jdcasey Date: Tue May 24 02:16:29 2011 New Revision: 1126824 URL: http://svn.apache.org/viewvc?rev=1126824&view=rev Log: started porting the auto-mirror selector over from EMB...still needs A LOT of work.
Modified: maven/maven-3/branches/mirror-group-routing/maven-core/pom.xml maven/maven-3/branches/mirror-group-routing/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequest.java maven/maven-3/branches/mirror-group-routing/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequest.java maven/maven-3/branches/mirror-group-routing/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java maven/maven-3/branches/mirror-group-routing/pom.xml Modified: maven/maven-3/branches/mirror-group-routing/maven-core/pom.xml URL: http://svn.apache.org/viewvc/maven/maven-3/branches/mirror-group-routing/maven-core/pom.xml?rev=1126824&r1=1126823&r2=1126824&view=diff ============================================================================== --- maven/maven-3/branches/mirror-group-routing/maven-core/pom.xml (original) +++ maven/maven-3/branches/mirror-group-routing/maven-core/pom.xml Tue May 24 02:16:29 2011 @@ -102,6 +102,14 @@ <artifactId>commons-jxpath</artifactId> <scope>test</scope> </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-auto-mirror-model</artifactId> + </dependency> + <dependency> + <groupId>org.apache.httpcomponents</groupId> + <artifactId>httpclient</artifactId> + </dependency> </dependencies> <build> Modified: maven/maven-3/branches/mirror-group-routing/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequest.java URL: http://svn.apache.org/viewvc/maven/maven-3/branches/mirror-group-routing/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequest.java?rev=1126824&r1=1126823&r2=1126824&view=diff ============================================================================== --- maven/maven-3/branches/mirror-group-routing/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequest.java (original) +++ maven/maven-3/branches/mirror-group-routing/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequest.java Tue May 24 02:16:29 2011 @@ -855,6 +855,8 @@ public class DefaultMavenExecutionReques // calculated from request attributes. private ProjectBuildingRequest projectBuildingRequest; + private File extensionConfDir; + public boolean isProjectPresent() { return isProjectPresent; @@ -1076,4 +1078,15 @@ public class DefaultMavenExecutionReques return this; } + public File getUserExtensionConfDir() + { + return extensionConfDir; + } + + public MavenExecutionRequest setUserExtensionConfDir( File extensionConfDir ) + { + this.extensionConfDir = extensionConfDir; + return this; + } + } Modified: maven/maven-3/branches/mirror-group-routing/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequest.java URL: http://svn.apache.org/viewvc/maven/maven-3/branches/mirror-group-routing/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequest.java?rev=1126824&r1=1126823&r2=1126824&view=diff ============================================================================== --- maven/maven-3/branches/mirror-group-routing/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequest.java (original) +++ maven/maven-3/branches/mirror-group-routing/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequest.java Tue May 24 02:16:29 2011 @@ -19,11 +19,6 @@ package org.apache.maven.execution; * under the License. */ -import java.io.File; -import java.util.Date; -import java.util.List; -import java.util.Properties; - import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy; import org.apache.maven.model.Profile; @@ -36,6 +31,11 @@ import org.sonatype.aether.RepositoryCac import org.sonatype.aether.repository.WorkspaceReader; import org.sonatype.aether.transfer.TransferListener; +import java.io.File; +import java.util.Date; +import java.util.List; +import java.util.Properties; + /** * @author Jason van Zyl */ @@ -91,14 +91,17 @@ public interface MavenExecutionRequest // Base directory MavenExecutionRequest setBaseDirectory( File basedir ); + String getBaseDirectory(); // Timing (remove this) MavenExecutionRequest setStartTime( Date start ); + Date getStartTime(); // Goals MavenExecutionRequest setGoals( List<String> goals ); + List<String> getGoals(); // Properties @@ -106,8 +109,9 @@ public interface MavenExecutionRequest /** * Sets the system properties to use for interpolation and profile activation. The system properties are collected * from the runtime environment like {@link System#getProperties()} and environment variables. - * - * @param systemProperties The system properties, may be {@code null}. + * + * @param systemProperties + * The system properties, may be {@code null}. * @return This request, never {@code null}. */ MavenExecutionRequest setSystemProperties( Properties systemProperties ); @@ -115,7 +119,7 @@ public interface MavenExecutionRequest /** * Gets the system properties to use for interpolation and profile activation. The system properties are collected * from the runtime environment like {@link System#getProperties()} and environment variables. - * + * * @return The system properties, never {@code null}. */ Properties getSystemProperties(); @@ -124,8 +128,9 @@ public interface MavenExecutionRequest * Sets the user properties to use for interpolation and profile activation. The user properties have been * configured directly by the user on his discretion, e.g. via the {@code -Dkey=value} parameter on the command * line. - * - * @param userProperties The user properties, may be {@code null}. + * + * @param userProperties + * The user properties, may be {@code null}. * @return This request, never {@code null}. */ MavenExecutionRequest setUserProperties( Properties userProperties ); @@ -134,153 +139,210 @@ public interface MavenExecutionRequest * Gets the user properties to use for interpolation and profile activation. The user properties have been * configured directly by the user on his discretion, e.g. via the {@code -Dkey=value} parameter on the command * line. - * + * * @return The user properties, never {@code null}. */ Properties getUserProperties(); // Reactor MavenExecutionRequest setReactorFailureBehavior( String failureBehavior ); + String getReactorFailureBehavior(); MavenExecutionRequest setSelectedProjects( List<String> projects ); + List<String> getSelectedProjects(); MavenExecutionRequest setResumeFrom( String project ); + String getResumeFrom(); MavenExecutionRequest setMakeBehavior( String makeBehavior ); + String getMakeBehavior(); void setThreadCount( String threadCount ); + String getThreadCount(); + boolean isThreadConfigurationPresent(); + void setPerCoreThreadCount( boolean perCoreThreadCount ); + boolean isPerCoreThreadCount(); // Recursive (really to just process the top-level POM) MavenExecutionRequest setRecursive( boolean recursive ); + boolean isRecursive(); MavenExecutionRequest setPom( File pom ); + File getPom(); // Errors MavenExecutionRequest setShowErrors( boolean showErrors ); + boolean isShowErrors(); // Transfer listeners MavenExecutionRequest setTransferListener( TransferListener transferListener ); + TransferListener getTransferListener(); // Logging MavenExecutionRequest setLoggingLevel( int loggingLevel ); + int getLoggingLevel(); // Update snapshots MavenExecutionRequest setUpdateSnapshots( boolean updateSnapshots ); + boolean isUpdateSnapshots(); MavenExecutionRequest setNoSnapshotUpdates( boolean noSnapshotUpdates ); + boolean isNoSnapshotUpdates(); // Checksum policy MavenExecutionRequest setGlobalChecksumPolicy( String globalChecksumPolicy ); + String getGlobalChecksumPolicy(); // Local repository MavenExecutionRequest setLocalRepositoryPath( String localRepository ); + MavenExecutionRequest setLocalRepositoryPath( File localRepository ); + File getLocalRepositoryPath(); + MavenExecutionRequest setLocalRepository( ArtifactRepository repository ); + ArtifactRepository getLocalRepository(); // Interactive MavenExecutionRequest setInteractiveMode( boolean interactive ); + boolean isInteractiveMode(); // Offline MavenExecutionRequest setOffline( boolean offline ); + boolean isOffline(); boolean isCacheTransferError(); + MavenExecutionRequest setCacheTransferError( boolean cacheTransferError ); boolean isCacheNotFound(); + MavenExecutionRequest setCacheNotFound( boolean cacheNotFound ); // Profiles List<Profile> getProfiles(); + MavenExecutionRequest addProfile( Profile profile ); + MavenExecutionRequest setProfiles( List<Profile> profiles ); + MavenExecutionRequest addActiveProfile( String profile ); + MavenExecutionRequest addActiveProfiles( List<String> profiles ); + MavenExecutionRequest setActiveProfiles( List<String> profiles ); + List<String> getActiveProfiles(); + MavenExecutionRequest addInactiveProfile( String profile ); + MavenExecutionRequest addInactiveProfiles( List<String> profiles ); + MavenExecutionRequest setInactiveProfiles( List<String> profiles ); + List<String> getInactiveProfiles(); // Proxies List<Proxy> getProxies(); + MavenExecutionRequest setProxies( List<Proxy> proxies ); + MavenExecutionRequest addProxy( Proxy proxy ); // Servers List<Server> getServers(); + MavenExecutionRequest setServers( List<Server> servers ); + MavenExecutionRequest addServer( Server server ); // Mirrors List<Mirror> getMirrors(); + MavenExecutionRequest setMirrors( List<Mirror> mirrors ); + MavenExecutionRequest addMirror( Mirror mirror ); // Plugin groups List<String> getPluginGroups(); + MavenExecutionRequest setPluginGroups( List<String> pluginGroups ); + MavenExecutionRequest addPluginGroup( String pluginGroup ); + MavenExecutionRequest addPluginGroups( List<String> pluginGroups ); boolean isProjectPresent(); + MavenExecutionRequest setProjectPresent( boolean isProjectPresent ); File getUserSettingsFile(); + MavenExecutionRequest setUserSettingsFile( File userSettingsFile ); File getGlobalSettingsFile(); + MavenExecutionRequest setGlobalSettingsFile( File globalSettingsFile ); MavenExecutionRequest addRemoteRepository( ArtifactRepository repository ); + MavenExecutionRequest addPluginArtifactRepository( ArtifactRepository repository ); /** * Set a new list of remote repositories to use the execution request. This is necessary if you perform * transformations on the remote repositories being used. For example if you replace existing repositories with * mirrors then it's easier to just replace the whole list with a new list of transformed repositories. - * + * * @param repositories * @return */ MavenExecutionRequest setRemoteRepositories( List<ArtifactRepository> repositories ); + List<ArtifactRepository> getRemoteRepositories(); MavenExecutionRequest setPluginArtifactRepositories( List<ArtifactRepository> repositories ); + List<ArtifactRepository> getPluginArtifactRepositories(); MavenExecutionRequest setRepositoryCache( RepositoryCache repositoryCache ); + RepositoryCache getRepositoryCache(); WorkspaceReader getWorkspaceReader(); + MavenExecutionRequest setWorkspaceReader( WorkspaceReader workspaceReader ); File getUserToolchainsFile(); + MavenExecutionRequest setUserToolchainsFile( File userToolchainsFile ); ExecutionListener getExecutionListener(); + MavenExecutionRequest setExecutionListener( ExecutionListener executionListener ); ProjectBuildingRequest getProjectBuildingRequest(); + File getUserExtensionConfDir(); + + MavenExecutionRequest setUserExtensionConfDir( File extensionConfDir ); + } Modified: maven/maven-3/branches/mirror-group-routing/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java URL: http://svn.apache.org/viewvc/maven/maven-3/branches/mirror-group-routing/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java?rev=1126824&r1=1126823&r2=1126824&view=diff ============================================================================== --- maven/maven-3/branches/mirror-group-routing/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java (original) +++ maven/maven-3/branches/mirror-group-routing/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java Tue May 24 02:16:29 2011 @@ -94,6 +94,8 @@ public class MavenCli new File( System.getProperty( "maven.home", System.getProperty( "user.dir", "" ) ), "conf/settings.xml" ); public static final File DEFAULT_USER_TOOLCHAINS_FILE = new File( userMavenConfigurationHome, "toolchains.xml" ); + + public static final File DEFAULT_USER_EXT_CONF_DIR = new File( userMavenConfigurationHome, "conf" ); private static final String EXT_CLASS_PATH = "maven.ext.class.path"; @@ -926,7 +928,8 @@ public class MavenCli .setUpdateSnapshots( updateSnapshots ) // default: false .setNoSnapshotUpdates( noSnapshotUpdates ) // default: false .setGlobalChecksumPolicy( globalChecksumPolicy ) // default: warn - .setUserToolchainsFile( userToolchainsFile ); + .setUserToolchainsFile( userToolchainsFile ) + .setUserExtensionConfDir( MavenCli.DEFAULT_USER_EXT_CONF_DIR ); if ( alternatePomFile != null ) { Modified: maven/maven-3/branches/mirror-group-routing/pom.xml URL: http://svn.apache.org/viewvc/maven/maven-3/branches/mirror-group-routing/pom.xml?rev=1126824&r1=1126823&r2=1126824&view=diff ============================================================================== --- maven/maven-3/branches/mirror-group-routing/pom.xml (original) +++ maven/maven-3/branches/mirror-group-routing/pom.xml Tue May 24 02:16:29 2011 @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> - - <!-- +<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with @@ -8,9 +7,7 @@ applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - --> - -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + --><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> @@ -143,6 +140,7 @@ <module>maven-model-builder</module> <module>maven-embedder</module> <module>maven-compat</module> + <module>maven-auto-mirror-model</module> </modules> <scm> @@ -173,6 +171,11 @@ <!--bootstrap-start-comment--> <dependency> <groupId>org.apache.maven</groupId> + <artifactId>maven-auto-mirror-model</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> <artifactId>maven-model</artifactId> <version>${project.version}</version> </dependency> @@ -341,6 +344,20 @@ <artifactId>commons-jxpath</artifactId> <version>${jxpathVersion}</version> </dependency> + + <!-- START: Used in auto-mirror handling --> + <dependency> + <groupId>com.google.code.gson</groupId> + <artifactId>gson</artifactId> + <version>1.4</version> + </dependency> + <dependency> + <groupId>org.apache.httpcomponents</groupId> + <artifactId>httpclient</artifactId> + <version>4.0.2</version> + </dependency> + <!-- END: Used in auto-mirror handling --> + <dependency> <groupId>org.sonatype.plexus</groupId> <artifactId>plexus-sec-dispatcher</artifactId> @@ -541,7 +558,7 @@ <reportSets> <reportSet> <!-- Disabled at it kills the site generation via a NoClassDefFoundError --> - <reports /> + <reports/> </reportSet> </reportSets> </plugin> @@ -593,9 +610,9 @@ <configuration> <mappingId>customizable</mappingId> <configurators> - <configurator id="org.maven.ide.eclipse.jdt.javaConfigurator" /> - <configurator id="org.maven.ide.eclipse.modello.modelloConfigurator" /> - <configurator id="org.maven.ide.eclipse.plexus.annotations.plexusConfigurator" /> + <configurator id="org.maven.ide.eclipse.jdt.javaConfigurator"/> + <configurator id="org.maven.ide.eclipse.modello.modelloConfigurator"/> + <configurator id="org.maven.ide.eclipse.plexus.annotations.plexusConfigurator"/> </configurators> <mojoExecutions> <mojoExecution>org.apache.maven.plugins:maven-resources-plugin::</mojoExecution> @@ -606,4 +623,4 @@ </build> </profile> </profiles> -</project> +</project> \ No newline at end of file