You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by jv...@apache.org on 2006/09/05 03:40:14 UTC
svn commit: r440215 [1/2] - in /maven/components/branches/maven-2.1-jvz: ./
maven-cli/src/bin/ maven-cli/src/main/java/org/apache/maven/cli/
maven-core/src/main/java/org/apache/maven/
maven-core/src/main/java/org/apache/maven/execution/ maven-core/src/...
Author: jvanzyl
Date: Mon Sep 4 18:40:13 2006
New Revision: 440215
URL: http://svn.apache.org/viewvc?view=rev&rev=440215
Log:
o work i'm doing on the core for the embedder and creating a single configuration model that is passed
though the core
Added:
maven/components/branches/maven-2.1-jvz/
- copied from r429536, maven/components/trunk/
maven/components/branches/maven-2.1-jvz/maven-cli/src/bin/mvnt (with props)
maven/components/branches/maven-2.1-jvz/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionResult.java (with props)
maven/components/branches/maven-2.1-jvz/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionResult.java (with props)
maven/components/branches/maven-2.1-jvz/maven-embedder/src/main/java/org/apache/maven/embedder/DefaultMavenEmbedderConfiguration.java (contents, props changed)
- copied, changed from r429536, maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/embedder/DefaultMavenEmbedRequest.java
maven/components/branches/maven-2.1-jvz/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedderConfiguration.java (contents, props changed)
- copied, changed from r429536, maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedRequest.java
maven/components/branches/maven-2.1-jvz/maven-embedder/src/main/java/org/apache/maven/embedder/user/
maven/components/branches/maven-2.1-jvz/maven-embedder/src/main/java/org/apache/maven/embedder/user/SettingsAdapter.java (with props)
maven/components/branches/maven-2.1-jvz/maven.ipr
maven/components/branches/maven-2.1-jvz/maven.iws
Removed:
maven/components/branches/maven-2.1-jvz/maven-embedder/Plugin.java
maven/components/branches/maven-2.1-jvz/maven-embedder/run.sh
maven/components/branches/maven-2.1-jvz/maven-embedder/src/main/java/org/apache/maven/embedder/DefaultMavenEmbedRequest.java
maven/components/branches/maven-2.1-jvz/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedRequest.java
maven/components/branches/maven-2.1-jvz/maven-meeper/
Modified:
maven/components/branches/maven-2.1-jvz/maven-cli/src/main/java/org/apache/maven/cli/MavenCli.java
maven/components/branches/maven-2.1-jvz/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
maven/components/branches/maven-2.1-jvz/maven-core/src/main/java/org/apache/maven/Maven.java
maven/components/branches/maven-2.1-jvz/maven-core/src/main/java/org/apache/maven/MavenArtifactFilterManager.java
maven/components/branches/maven-2.1-jvz/maven-core/src/main/java/org/apache/maven/MavenTransferListener.java
maven/components/branches/maven-2.1-jvz/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequest.java
maven/components/branches/maven-2.1-jvz/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequest.java
maven/components/branches/maven-2.1-jvz/maven-core/src/main/java/org/apache/maven/plugin/MavenPluginCollector.java
maven/components/branches/maven-2.1-jvz/maven-core/src/test/java/org/apache/maven/MavenTestUtils.java
maven/components/branches/maven-2.1-jvz/maven-embedder-it/src/main/java/org/apache/maven/embedder/it/MockPlugin.java
maven/components/branches/maven-2.1-jvz/maven-embedder-it/src/test/java/org/apache/maven/embedder/it/MockPluginTest.java
maven/components/branches/maven-2.1-jvz/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedder.java
maven/components/branches/maven-2.1-jvz/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedderException.java
maven/components/branches/maven-2.1-jvz/maven-embedder/src/test/java/org/apache/maven/embedder/MavenEmbedderTest.java
maven/components/branches/maven-2.1-jvz/pom.xml
Added: maven/components/branches/maven-2.1-jvz/maven-cli/src/bin/mvnt
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.1-jvz/maven-cli/src/bin/mvnt?view=auto&rev=440215
==============================================================================
--- maven/components/branches/maven-2.1-jvz/maven-cli/src/bin/mvnt (added)
+++ maven/components/branches/maven-2.1-jvz/maven-cli/src/bin/mvnt Mon Sep 4 18:40:13 2006
@@ -0,0 +1,146 @@
+#!/bin/sh
+# ----------------------------------------------------------------------------
+# Copyright 2001-2004 The Apache Software Foundation.
+#
+# 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.
+# ----------------------------------------------------------------------------
+
+# Copyright (c) 2001-2002 The Apache Software Foundation. All rights
+# reserved.
+
+QUOTED_ARGS=""
+while [ "$1" != "" ] ; do
+
+ QUOTED_ARGS="$QUOTED_ARGS \"$1\""
+ shift
+
+done
+
+if [ -f /etc/mavenrc ] ; then
+ . /etc/mavenrc
+fi
+
+if [ -f "$HOME/.mavenrc" ] ; then
+ . "$HOME/.mavenrc"
+fi
+
+# OS specific support. $var _must_ be set to either true or false.
+cygwin=false;
+darwin=false;
+case "`uname`" in
+ CYGWIN*) cygwin=true ;;
+ Darwin*) darwin=true
+ if [ -z "$JAVA_VERSION" ] ; then
+ JAVA_VERSION="CurrentJDK"
+ else
+ echo "Using Java version: $JAVA_VERSION"
+ fi
+ if [ -z "$JAVA_HOME" ] ; then
+ JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/${JAVA_VERSION}/Home
+ fi
+ ;;
+esac
+
+if [ -z "$JAVA_HOME" ] ; then
+ if [ -e /etc/gentoo-release ] ; then
+ JAVA_HOME=`java-config --jre-home`
+ fi
+fi
+
+if [ -z "$M2TEST_HOME" ] ; then
+ # try to find MAVEN
+ if [ -d /opt/m2 ] ; then
+ MAVEN_HOME=/opt/m2
+ fi
+
+ if [ -d "$HOME/m2" ] ; then
+ MAVEN_HOME="$HOME/m2"
+ fi
+
+ ## resolve links - $0 may be a link to maven's home
+ PRG="$0"
+
+ # need this for relative symlinks
+ while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG="`dirname "$PRG"`/$link"
+ fi
+ done
+
+ saveddir=`pwd`
+
+ M2TEST_HOME=`dirname "$PRG"`/..
+
+ # make it fully qualified
+ M2TEST_HOME=`cd "$M2TEST_HOME" && pwd`
+
+ cd "$saveddir"
+ # echo Using m2 at $M2TEST_HOME
+fi
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched
+if $cygwin ; then
+ [ -n "$M2TEST_HOME" ] &&
+ M2TEST_HOME=`cygpath --unix "$M2TEST_HOME"`
+ [ -n "$JAVA_HOME" ] &&
+ JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+ [ -n "$CLASSPATH" ] &&
+ CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
+fi
+
+if [ -z "$JAVACMD" ] ; then
+ if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ else
+ JAVACMD=java
+ fi
+fi
+
+if [ ! -x "$JAVACMD" ] ; then
+ echo "Error: JAVA_HOME is not defined correctly."
+ echo " We cannot execute $JAVACMD"
+ exit 1
+fi
+
+if [ -z "$JAVA_HOME" ] ; then
+ echo "Warning: JAVA_HOME environment variable is not set."
+fi
+
+CLASSWORLDS_LAUNCHER=org.codehaus.classworlds.Launcher
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin; then
+ [ -n "$M2TEST_HOME" ] &&
+ M2TEST_HOME=`cygpath --path --windows "$M2TEST_HOME"`
+ [ -n "$JAVA_HOME" ] &&
+ JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
+ [ -n "$HOME" ] &&
+ HOME=`cygpath --path --windows "$HOME"`
+fi
+
+exec "$JAVACMD" \
+ $MAVEN_OPTS \
+ -classpath "${M2TEST_HOME}"/core/boot/classworlds-*.jar \
+ "-Dclassworlds.conf=${M2TEST_HOME}/bin/m2.conf" \
+ "-Dmaven.home=${M2TEST_HOME}" \
+ ${CLASSWORLDS_LAUNCHER} $QUOTED_ARGS
+
Propchange: maven/components/branches/maven-2.1-jvz/maven-cli/src/bin/mvnt
------------------------------------------------------------------------------
svn:executable = *
Modified: maven/components/branches/maven-2.1-jvz/maven-cli/src/main/java/org/apache/maven/cli/MavenCli.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.1-jvz/maven-cli/src/main/java/org/apache/maven/cli/MavenCli.java?view=diff&rev=440215&r1=429536&r2=440215
==============================================================================
--- maven/components/branches/maven-2.1-jvz/maven-cli/src/main/java/org/apache/maven/cli/MavenCli.java (original)
+++ maven/components/branches/maven-2.1-jvz/maven-cli/src/main/java/org/apache/maven/cli/MavenCli.java Mon Sep 4 18:40:13 2006
@@ -113,13 +113,11 @@
//** use CLI option values directly in request where possible
- MavenEmbedder mavenEmbedder = new MavenEmbedder();
+ MavenEmbedder mavenEmbedder;
try
{
- mavenEmbedder.setClassWorld( classWorld );
-
- mavenEmbedder.start();
+ mavenEmbedder = new MavenEmbedder( classWorld );
}
catch ( MavenEmbedderException e )
{
@@ -162,15 +160,8 @@
{
List goals = commandLine.getArgList();
- boolean recursive = true;
-
String reactorFailureBehaviour = null;
- if ( commandLine.hasOption( CLIManager.NON_RECURSIVE ) )
- {
- recursive = false;
- }
-
if ( commandLine.hasOption( CLIManager.FAIL_FAST ) )
{
reactorFailureBehaviour = MavenExecutionRequest.REACTOR_FAIL_FAST;
@@ -353,21 +344,19 @@
.setGoals( goals )
.setLocalRepositoryPath( localRepositoryPath )
.setProperties( executionProperties )
- .setFailureBehavior( reactorFailureBehaviour )
- .setRecursive( recursive )
- .setReactorActive( reactorActive )
+ .setReactorFailureBehavior( reactorFailureBehaviour )
+ .setUseReactor( reactorActive )
.setPomFile( alternatePomFile )
.setShowErrors( showErrors )
- .setInteractive( interactive )
+ .setInteractiveMode( interactive )
.addActiveProfiles( activeProfiles )
.addInactiveProfiles( inactiveProfiles )
.setLoggingLevel( loggingLevel )
- .activateDefaultEventMonitor()
.setSettings( settings )
.setTransferListener( transferListener )
.setOffline( offline )
.setUpdateSnapshots( updateSnapshots )
- .setGlobalChecksumPolicy( globalChecksumPolicy );
+ .setGlobalChecksumPolicy( globalChecksumPolicy );
mavenEmbedder.execute( request );
}
Modified: maven/components/branches/maven-2.1-jvz/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.1-jvz/maven-core/src/main/java/org/apache/maven/DefaultMaven.java?view=diff&rev=440215&r1=429536&r2=440215
==============================================================================
--- maven/components/branches/maven-2.1-jvz/maven-core/src/main/java/org/apache/maven/DefaultMaven.java (original)
+++ maven/components/branches/maven-2.1-jvz/maven-core/src/main/java/org/apache/maven/DefaultMaven.java Mon Sep 4 18:40:13 2006
@@ -28,9 +28,10 @@
import org.apache.maven.execution.MavenSession;
import org.apache.maven.execution.ReactorManager;
import org.apache.maven.execution.RuntimeInformation;
+import org.apache.maven.execution.MavenExecutionResult;
+import org.apache.maven.execution.DefaultMavenExecutionResult;
import org.apache.maven.lifecycle.LifecycleExecutionException;
import org.apache.maven.lifecycle.LifecycleExecutor;
-import org.apache.maven.model.Profile;
import org.apache.maven.monitor.event.DefaultEventDispatcher;
import org.apache.maven.monitor.event.DefaultEventMonitor;
import org.apache.maven.monitor.event.EventDispatcher;
@@ -48,7 +49,6 @@
import org.apache.maven.settings.Proxy;
import org.apache.maven.settings.Server;
import org.apache.maven.settings.Settings;
-import org.apache.maven.settings.SettingsUtils;
import org.apache.maven.usability.SystemWarnings;
import org.apache.maven.usability.diagnostics.ErrorDiagnostics;
import org.codehaus.plexus.PlexusConstants;
@@ -119,7 +119,7 @@
// Project execution
// ----------------------------------------------------------------------
- public void execute( MavenExecutionRequest request )
+ public MavenExecutionResult execute( MavenExecutionRequest request )
throws MavenExecutionException
{
boolean snapshotPolicySet = false;
@@ -142,8 +142,8 @@
}
Logger logger = loggerManager.getLoggerForComponent( Mojo.ROLE );
-
- if ( request.isDefaultEventMonitorActive() )
+
+ if ( request.getEventMonitors() == null )
{
request.addEventMonitor( new DefaultEventMonitor( logger ) );
}
@@ -152,7 +152,7 @@
request.setStartTime( new Date() );
- wagonManager.setInteractive( request.isInteractive() );
+ wagonManager.setInteractive( request.isInteractiveMode() );
wagonManager.setDownloadMonitor( request.getTransferListener() );
@@ -242,7 +242,9 @@
line();
- dispatcher.dispatchEnd( event, request.getBaseDirectory() );
+ dispatcher.dispatchEnd( event, request.getBaseDirectory() );
+
+ return new DefaultMavenExecutionResult( rm.getTopLevelProject(), null );
}
private void logErrors( ReactorManager rm, boolean showErrors )
@@ -347,7 +349,7 @@
{
rm = new ReactorManager( projects );
- String requestFailureBehavior = request.getFailureBehavior();
+ String requestFailureBehavior = request.getReactorFailureBehavior();
if ( requestFailureBehavior != null )
{
@@ -414,7 +416,7 @@
request.isRecursive(),
request.getSettings(),
globalProfileManager,
- !request.isReactorActive() );
+ !request.useReactor() );
}
catch ( IOException e )
@@ -878,7 +880,7 @@
List files = Collections.EMPTY_LIST;
File userDir = new File( System.getProperty( "user.dir" ) );
- if ( request.isReactorActive() )
+ if ( request.useReactor() )
{
// TODO: should we now include the pom.xml in the current directory?
// String includes = System.getProperty( "maven.reactor.includes", "**/" + POMv4 );
Modified: maven/components/branches/maven-2.1-jvz/maven-core/src/main/java/org/apache/maven/Maven.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.1-jvz/maven-core/src/main/java/org/apache/maven/Maven.java?view=diff&rev=440215&r1=429536&r2=440215
==============================================================================
--- maven/components/branches/maven-2.1-jvz/maven-core/src/main/java/org/apache/maven/Maven.java (original)
+++ maven/components/branches/maven-2.1-jvz/maven-core/src/main/java/org/apache/maven/Maven.java Mon Sep 4 18:40:13 2006
@@ -17,6 +17,7 @@
*/
import org.apache.maven.execution.MavenExecutionRequest;
+import org.apache.maven.execution.MavenExecutionResult;
import org.apache.maven.reactor.MavenExecutionException;
/**
@@ -47,8 +48,6 @@
static final int LOGGING_LEVEL_DISABLE = 5;
-
-
- void execute( MavenExecutionRequest request )
+ MavenExecutionResult execute( MavenExecutionRequest request )
throws MavenExecutionException;
}
Modified: maven/components/branches/maven-2.1-jvz/maven-core/src/main/java/org/apache/maven/MavenArtifactFilterManager.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.1-jvz/maven-core/src/main/java/org/apache/maven/MavenArtifactFilterManager.java?view=diff&rev=440215&r1=429536&r2=440215
==============================================================================
--- maven/components/branches/maven-2.1-jvz/maven-core/src/main/java/org/apache/maven/MavenArtifactFilterManager.java (original)
+++ maven/components/branches/maven-2.1-jvz/maven-core/src/main/java/org/apache/maven/MavenArtifactFilterManager.java Mon Sep 4 18:40:13 2006
@@ -24,7 +24,7 @@
/**
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
- * @version $Id:$
+ * @version $Id$
* @todo this should probably be a component with some dynamic control of filtering
*/
public class MavenArtifactFilterManager
Modified: maven/components/branches/maven-2.1-jvz/maven-core/src/main/java/org/apache/maven/MavenTransferListener.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.1-jvz/maven-core/src/main/java/org/apache/maven/MavenTransferListener.java?view=diff&rev=440215&r1=429536&r2=440215
==============================================================================
--- maven/components/branches/maven-2.1-jvz/maven-core/src/main/java/org/apache/maven/MavenTransferListener.java (original)
+++ maven/components/branches/maven-2.1-jvz/maven-core/src/main/java/org/apache/maven/MavenTransferListener.java Mon Sep 4 18:40:13 2006
@@ -4,7 +4,7 @@
/**
* @author Jason van Zyl
- * @version $Revision:$
+ * @version $Revision$
*/
public interface MavenTransferListener
extends TransferListener
Modified: maven/components/branches/maven-2.1-jvz/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequest.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.1-jvz/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequest.java?view=diff&rev=440215&r1=429536&r2=440215
==============================================================================
--- maven/components/branches/maven-2.1-jvz/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequest.java (original)
+++ maven/components/branches/maven-2.1-jvz/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequest.java Mon Sep 4 18:40:13 2006
@@ -34,34 +34,51 @@
public class DefaultMavenExecutionRequest
implements MavenExecutionRequest
{
- private File basedir;
+ // ----------------------------------------------------------------------------
+ // Settings equivalents
+ // ----------------------------------------------------------------------------
- /**
- * @todo [BP] is this required? This hands off to MavenSession, but could be passed through the handler.handle function (+ createSession).
- */
private ArtifactRepository localRepository;
-
+
private File localRepositoryPath;
- private List goals;
+ private boolean offline;
+
+ private boolean interactiveMode;
+
+ private List proxies;
+
+ private List servers;
- protected MavenSession session;
+ private List mirrors;
+
+ private List profiles;
+
+ private List pluginGroups;
+
+ private boolean usePluginRegistry;
+
+ // ----------------------------------------------------------------------------
+ // Request
+ // ----------------------------------------------------------------------------
+
+ private File basedir;
- private Settings settings;
+ private List goals;
- private boolean recursive = true;
+ private Settings settings;
- private boolean reactorActive;
+ private boolean useReactor;
- private String pomFilename;
+ private String pomFile;
- private String failureBehavior;
+ private String reactorFailureBehavior;
- private Properties properties;
+ private Properties properties;
- private Date startTime;
+ private Date startTime;
- private boolean showErrors;
+ private boolean showErrors;
private List eventMonitors;
@@ -69,16 +86,10 @@
private List inactiveProfiles;
- private boolean interactive;
-
private TransferListener transferListener;
private int loggingLevel;
- private boolean activateDefaultEventMonitor;
-
- private boolean offline;
-
private boolean updateSnapshots;
private String globalChecksumPolicy;
@@ -97,11 +108,6 @@
return settings;
}
- public boolean isRecursive()
- {
- return recursive;
- }
-
public ArtifactRepository getLocalRepository()
{
return localRepository;
@@ -122,19 +128,14 @@
return properties;
}
- public MavenSession getSession()
- {
- return session;
- }
-
public String getPomFile()
{
- return pomFilename;
+ return pomFile;
}
- public String getFailureBehavior()
+ public String getReactorFailureBehavior()
{
- return failureBehavior;
+ return reactorFailureBehavior;
}
public Date getStartTime()
@@ -147,9 +148,9 @@
return showErrors;
}
- public boolean isInteractive()
+ public boolean isInteractiveMode()
{
- return interactive;
+ return interactiveMode;
}
public List getEventMonitors()
@@ -180,21 +181,11 @@
return transferListener;
}
- public boolean isDefaultEventMonitorActivated()
- {
- return activateDefaultEventMonitor;
- }
-
public int getLoggingLevel()
{
return loggingLevel;
}
- public boolean isDefaultEventMonitorActive()
- {
- return activateDefaultEventMonitor;
- }
-
public boolean isOffline()
{
return offline;
@@ -223,7 +214,7 @@
public MavenExecutionRequest setStartTime( Date startTime )
{
- this.startTime= startTime;
+ this.startTime = startTime;
return this;
}
@@ -277,16 +268,9 @@
return this;
}
- public MavenExecutionRequest setFailureBehavior( String failureBehavior )
- {
- this.failureBehavior = failureBehavior;
-
- return this;
- }
-
- public MavenExecutionRequest setSession( MavenSession session )
+ public MavenExecutionRequest setReactorFailureBehavior( String failureBehavior )
{
- this.session = session;
+ this.reactorFailureBehavior = failureBehavior;
return this;
}
@@ -319,7 +303,6 @@
return this;
}
-
public MavenExecutionRequest addEventMonitor( EventMonitor monitor )
{
if ( eventMonitors == null )
@@ -332,42 +315,28 @@
return this;
}
- public MavenExecutionRequest activateDefaultEventMonitor()
+ public MavenExecutionRequest setUseReactor( boolean reactorActive )
{
- activateDefaultEventMonitor = true;
+ this.useReactor = reactorActive;
return this;
}
- public MavenExecutionRequest setReactorActive( boolean reactorActive )
+ public boolean useReactor()
{
- this.reactorActive = reactorActive;
-
- return this;
- }
-
- public boolean isReactorActive()
- {
- return reactorActive;
+ return useReactor;
}
public MavenExecutionRequest setPomFile( String pomFilename )
{
- this.pomFilename = pomFilename;
+ this.pomFile = pomFilename;
return this;
}
- public MavenExecutionRequest setRecursive( boolean recursive )
+ public MavenExecutionRequest setInteractiveMode( boolean interactive )
{
- this.recursive = recursive;
-
- return this;
- }
-
- public MavenExecutionRequest setInteractive( boolean interactive )
- {
- this.interactive = interactive;
+ this.interactiveMode = interactive;
return this;
}
@@ -403,6 +372,82 @@
public MavenExecutionRequest setGlobalChecksumPolicy( String globalChecksumPolicy )
{
this.globalChecksumPolicy = globalChecksumPolicy;
+
+ return this;
+ }
+
+ // ----------------------------------------------------------------------------
+ // Settings equivalents
+ // ----------------------------------------------------------------------------
+
+ public List getProxies()
+ {
+ return proxies;
+ }
+
+ public MavenExecutionRequest setProxies( List proxies )
+ {
+ this.proxies = proxies;
+
+ return this;
+ }
+
+ public List getServers()
+ {
+ return servers;
+ }
+
+ public MavenExecutionRequest setServers( List servers )
+ {
+ this.servers = servers;
+
+ return this;
+ }
+
+ public List getMirrors()
+ {
+ return mirrors;
+ }
+
+ public MavenExecutionRequest setMirrors( List mirrors )
+ {
+ this.mirrors = mirrors;
+
+ return this;
+ }
+
+ public List getProfiles()
+ {
+ return profiles;
+ }
+
+ public MavenExecutionRequest setProfiles( List profiles )
+ {
+ this.profiles = profiles;
+
+ return this;
+ }
+
+ public List getPluginGroups()
+ {
+ return pluginGroups;
+ }
+
+ public MavenExecutionRequest setPluginGroups( List pluginGroups )
+ {
+ this.pluginGroups = pluginGroups;
+
+ return this;
+ }
+
+ public boolean isUsePluginRegistry()
+ {
+ return usePluginRegistry;
+ }
+
+ public MavenExecutionRequest setUsePluginRegistry( boolean usePluginRegistry )
+ {
+ this.usePluginRegistry = usePluginRegistry;
return this;
}
Added: maven/components/branches/maven-2.1-jvz/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionResult.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.1-jvz/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionResult.java?view=auto&rev=440215
==============================================================================
--- maven/components/branches/maven-2.1-jvz/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionResult.java (added)
+++ maven/components/branches/maven-2.1-jvz/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionResult.java Mon Sep 4 18:40:13 2006
@@ -0,0 +1,33 @@
+package org.apache.maven.execution;
+
+import org.apache.maven.project.MavenProject;
+
+import java.util.List;
+
+/**
+ * @author Jason van Zyl
+ */
+public class DefaultMavenExecutionResult
+ implements MavenExecutionResult
+{
+ private MavenProject mavenProject;
+
+ private List exceptions;
+
+ public DefaultMavenExecutionResult( MavenProject project,
+ List exceptions )
+ {
+ this.mavenProject = project;
+ this.exceptions = exceptions;
+ }
+
+ public MavenProject getMavenProject()
+ {
+ return mavenProject;
+ }
+
+ public List getExceptions()
+ {
+ return exceptions;
+ }
+}
Propchange: maven/components/branches/maven-2.1-jvz/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionResult.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/components/branches/maven-2.1-jvz/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionResult.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Modified: maven/components/branches/maven-2.1-jvz/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequest.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.1-jvz/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequest.java?view=diff&rev=440215&r1=429536&r2=440215
==============================================================================
--- maven/components/branches/maven-2.1-jvz/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequest.java (original)
+++ maven/components/branches/maven-2.1-jvz/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequest.java Mon Sep 4 18:40:13 2006
@@ -31,53 +31,10 @@
/**
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
* @version $Id$
+ * @todo merge Settings,RuntimeInfo,MavenSession into this. make adapters for everything
*/
public interface MavenExecutionRequest
{
- File getLocalRepositoryPath();
-
- ArtifactRepository getLocalRepository();
-
- List getGoals();
-
- Settings getSettings();
-
- String getBaseDirectory();
-
- boolean isRecursive();
-
- boolean isInteractive();
-
- boolean isReactorActive();
-
- String getPomFile();
-
- String getFailureBehavior();
-
- Properties getProperties();
-
- Date getStartTime();
-
- boolean isShowErrors();
-
- List getEventMonitors();
-
- List getActiveProfiles();
-
- List getInactiveProfiles();
-
- TransferListener getTransferListener();
-
- int getLoggingLevel();
-
- boolean isDefaultEventMonitorActive();
-
- boolean isOffline();
-
- boolean isUpdateSnapshots();
-
- String getGlobalChecksumPolicy();
-
// ----------------------------------------------------------------------
// Logging
// ----------------------------------------------------------------------
@@ -107,7 +64,7 @@
// ----------------------------------------------------------------------
// Artifactr repository policies
// ----------------------------------------------------------------------
-
+
static final String CHECKSUM_POLICY_FAIL = ArtifactRepositoryPolicy.CHECKSUM_POLICY_FAIL;
static final String CHECKSUM_POLICY_WARN = ArtifactRepositoryPolicy.CHECKSUM_POLICY_WARN;
@@ -116,55 +73,141 @@
//
// ----------------------------------------------------------------------
+ // Base directory
+
MavenExecutionRequest setBasedir( File basedir );
+ String getBaseDirectory();
+
+ // Settings
MavenExecutionRequest setSettings( Settings settings );
- MavenExecutionRequest setStartTime( Date start );
+ Settings getSettings();
- MavenExecutionRequest setGoals( List goals );
+ // Timing (remove this)
+ MavenExecutionRequest setStartTime( Date start );
- MavenExecutionRequest setLocalRepository( ArtifactRepository localRepository );
+ Date getStartTime();
- MavenExecutionRequest setLocalRepositoryPath( String localRepository );
+ // Goals
+ MavenExecutionRequest setGoals( List goals );
- MavenExecutionRequest setLocalRepositoryPath( File localRepository );
+ List getGoals();
+ // Properties
MavenExecutionRequest setProperties( Properties properties );
- MavenExecutionRequest setFailureBehavior( String failureBehavior );
-
- MavenExecutionRequest setSession( MavenSession session );
+ Properties getProperties();
- MavenExecutionRequest addActiveProfile( String profile );
+ // Reactor
+ MavenExecutionRequest setReactorFailureBehavior( String failureBehavior );
- MavenExecutionRequest addInactiveProfile( String profile );
+ String getReactorFailureBehavior();
- MavenExecutionRequest addActiveProfiles( List profiles );
+ MavenExecutionRequest setUseReactor( boolean useReactor );
- MavenExecutionRequest addInactiveProfiles( List profiles );
+ boolean useReactor();
+ // Event monitors
MavenExecutionRequest addEventMonitor( EventMonitor monitor );
- MavenExecutionRequest setReactorActive( boolean reactorActive );
+ List getEventMonitors();
+ // Pom
MavenExecutionRequest setPomFile( String pomFilename );
- MavenExecutionRequest setRecursive( boolean recursive );
+ String getPomFile();
+ // Errors
MavenExecutionRequest setShowErrors( boolean showErrors );
- MavenExecutionRequest setInteractive( boolean interactive );
+ boolean isShowErrors();
+ // Transfer listeners
MavenExecutionRequest setTransferListener( TransferListener transferListener );
- MavenExecutionRequest setLoggingLevel( int loggingLevel );
+ TransferListener getTransferListener();
- MavenExecutionRequest activateDefaultEventMonitor();
+ // Logging
+ MavenExecutionRequest setLoggingLevel( int loggingLevel );
- MavenExecutionRequest setOffline( boolean offline );
+ int getLoggingLevel();
+ // Update snapshots
MavenExecutionRequest setUpdateSnapshots( boolean updateSnapshots );
+ boolean isUpdateSnapshots();
+
+ // Checksum policy
MavenExecutionRequest setGlobalChecksumPolicy( String globalChecksumPolicy );
+
+ String getGlobalChecksumPolicy();
+
+ // ----------------------------------------------------------------------------
+ // Settings equivalents
+ // ----------------------------------------------------------------------------
+
+ // 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();
+
+ // Profiles
+ List getProfiles();
+
+ MavenExecutionRequest setProfiles( List profiles );
+
+ MavenExecutionRequest addActiveProfile( String profile );
+
+ MavenExecutionRequest addActiveProfiles( List profiles );
+
+ List getActiveProfiles();
+
+ MavenExecutionRequest addInactiveProfile( String profile );
+
+ MavenExecutionRequest addInactiveProfiles( List profiles );
+
+ List getInactiveProfiles();
+
+ // Proxies
+ List getProxies();
+
+ MavenExecutionRequest setProxies( List proxies );
+
+ // Servers
+ List getServers();
+
+ MavenExecutionRequest setServers( List servers );
+
+ // Mirrors
+ List getMirrors();
+
+ MavenExecutionRequest setMirrors( List mirrors );
+
+ // Plugin groups
+ List getPluginGroups();
+
+ MavenExecutionRequest setPluginGroups( List pluginGroups );
+
+ // Plugin registry
+ boolean isUsePluginRegistry();
+
+ MavenExecutionRequest setUsePluginRegistry( boolean usePluginRegistry );
}
Added: maven/components/branches/maven-2.1-jvz/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionResult.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.1-jvz/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionResult.java?view=auto&rev=440215
==============================================================================
--- maven/components/branches/maven-2.1-jvz/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionResult.java (added)
+++ maven/components/branches/maven-2.1-jvz/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionResult.java Mon Sep 4 18:40:13 2006
@@ -0,0 +1,20 @@
+package org.apache.maven.execution;
+
+import org.apache.maven.project.MavenProject;
+
+import java.util.List;
+
+/**
+ * @author Jason van Zyl
+ */
+public interface MavenExecutionResult
+{
+ MavenProject getMavenProject();
+
+ // for each exception
+ // - knowing what artifacts are missing
+ // - project building exception
+ // - invalid project model exception: list of markers
+ // - xmlpull parser exception
+ List getExceptions();
+}
Propchange: maven/components/branches/maven-2.1-jvz/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionResult.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/components/branches/maven-2.1-jvz/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionResult.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Modified: maven/components/branches/maven-2.1-jvz/maven-core/src/main/java/org/apache/maven/plugin/MavenPluginCollector.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.1-jvz/maven-core/src/main/java/org/apache/maven/plugin/MavenPluginCollector.java?view=diff&rev=440215&r1=429536&r2=440215
==============================================================================
--- maven/components/branches/maven-2.1-jvz/maven-core/src/main/java/org/apache/maven/plugin/MavenPluginCollector.java (original)
+++ maven/components/branches/maven-2.1-jvz/maven-core/src/main/java/org/apache/maven/plugin/MavenPluginCollector.java Mon Sep 4 18:40:13 2006
@@ -33,7 +33,6 @@
extends AbstractLogEnabled
implements ComponentDiscoveryListener
{
-
private Set pluginsInProcess = new HashSet();
private Map pluginDescriptors = new HashMap();
@@ -49,11 +48,13 @@
if ( componentSetDescriptor instanceof PluginDescriptor )
{
+ System.out.println( "event = " + event.getComponentSetDescriptor() );
+
PluginDescriptor pluginDescriptor = (PluginDescriptor) componentSetDescriptor;
// TODO: see comment in getPluginDescriptor
String key = Plugin.constructKey( pluginDescriptor.getGroupId(), pluginDescriptor.getArtifactId() );
-
+
if ( !pluginsInProcess.contains( key ) )
{
pluginsInProcess.add( key );
@@ -72,6 +73,10 @@
public PluginDescriptor getPluginDescriptor( Plugin plugin )
{
+ System.out.println( "this = " + this );
+
+ System.out.println( "pluginDescriptors = " + pluginDescriptors );
+
// TODO: include version, but can't do this in the plugin manager as it is not resolved to the right version
// at that point. Instead, move the duplication check to the artifact container, or store it locally based on
// the unresolved version?
@@ -105,4 +110,8 @@
}
}
+ public String getId()
+ {
+ return MavenPluginCollector.class.getName();
+ }
}
Modified: maven/components/branches/maven-2.1-jvz/maven-core/src/test/java/org/apache/maven/MavenTestUtils.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.1-jvz/maven-core/src/test/java/org/apache/maven/MavenTestUtils.java?view=diff&rev=440215&r1=429536&r2=440215
==============================================================================
--- maven/components/branches/maven-2.1-jvz/maven-core/src/test/java/org/apache/maven/MavenTestUtils.java (original)
+++ maven/components/branches/maven-2.1-jvz/maven-core/src/test/java/org/apache/maven/MavenTestUtils.java Mon Sep 4 18:40:13 2006
@@ -20,6 +20,7 @@
import org.codehaus.classworlds.ClassWorld;
import org.codehaus.plexus.DefaultPlexusContainer;
import org.codehaus.plexus.PlexusContainer;
+import org.codehaus.plexus.PlexusContainerException;
import java.io.File;
@@ -36,6 +37,7 @@
}
public static PlexusContainer getContainerInstance()
+ throws PlexusContainerException
{
return new DefaultPlexusContainer();
}
Modified: maven/components/branches/maven-2.1-jvz/maven-embedder-it/src/main/java/org/apache/maven/embedder/it/MockPlugin.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.1-jvz/maven-embedder-it/src/main/java/org/apache/maven/embedder/it/MockPlugin.java?view=diff&rev=440215&r1=429536&r2=440215
==============================================================================
--- maven/components/branches/maven-2.1-jvz/maven-embedder-it/src/main/java/org/apache/maven/embedder/it/MockPlugin.java (original)
+++ maven/components/branches/maven-2.1-jvz/maven-embedder-it/src/main/java/org/apache/maven/embedder/it/MockPlugin.java Mon Sep 4 18:40:13 2006
@@ -23,7 +23,7 @@
* A mock tool plugin that uses the Maven Embedder API
*
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
- * @version $Id:$
+ * @version $Id$
*/
public class MockPlugin
{
Modified: maven/components/branches/maven-2.1-jvz/maven-embedder-it/src/test/java/org/apache/maven/embedder/it/MockPluginTest.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.1-jvz/maven-embedder-it/src/test/java/org/apache/maven/embedder/it/MockPluginTest.java?view=diff&rev=440215&r1=429536&r2=440215
==============================================================================
--- maven/components/branches/maven-2.1-jvz/maven-embedder-it/src/test/java/org/apache/maven/embedder/it/MockPluginTest.java (original)
+++ maven/components/branches/maven-2.1-jvz/maven-embedder-it/src/test/java/org/apache/maven/embedder/it/MockPluginTest.java Mon Sep 4 18:40:13 2006
@@ -21,7 +21,7 @@
/**
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
- * @version $Id:$
+ * @version $Id$
*/
public class MockPluginTest
extends TestCase
Copied: maven/components/branches/maven-2.1-jvz/maven-embedder/src/main/java/org/apache/maven/embedder/DefaultMavenEmbedderConfiguration.java (from r429536, maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/embedder/DefaultMavenEmbedRequest.java)
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.1-jvz/maven-embedder/src/main/java/org/apache/maven/embedder/DefaultMavenEmbedderConfiguration.java?view=diff&rev=440215&p1=maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/embedder/DefaultMavenEmbedRequest.java&r1=429536&p2=maven/components/branches/maven-2.1-jvz/maven-embedder/src/main/java/org/apache/maven/embedder/DefaultMavenEmbedderConfiguration.java&r2=440215
==============================================================================
--- maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/embedder/DefaultMavenEmbedRequest.java (original)
+++ maven/components/branches/maven-2.1-jvz/maven-embedder/src/main/java/org/apache/maven/embedder/DefaultMavenEmbedderConfiguration.java Mon Sep 4 18:40:13 2006
@@ -16,7 +16,6 @@
*/
import java.io.File;
-import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
@@ -24,14 +23,13 @@
import org.apache.maven.settings.Settings;
/**
- * Default implementation of MavenEmbedRequest intefrace.
+ * Default implementation of MavenEmbedderConfiguration intefrace.
*
* @author mkleint
*/
-public class DefaultMavenEmbedRequest
- implements MavenEmbedRequest
+public class DefaultMavenEmbedderConfiguration
+ implements MavenEmbedderConfiguration
{
-
private List inactives;
private List actives;
@@ -47,31 +45,31 @@
private Properties systemProperties;
/**
- * Creates a new instance of DefaultMavenEmbedRequest
+ * Creates a new instance of DefaultMavenEmbedderConfiguration
*/
- public DefaultMavenEmbedRequest()
+ public DefaultMavenEmbedderConfiguration()
{
}
- public MavenEmbedRequest addActiveProfile( String profile )
+ public MavenEmbedderConfiguration addActiveProfile( String profile )
{
getActiveProfiles().add( profile );
return this;
}
- public MavenEmbedRequest addInactiveProfile( String profile )
+ public MavenEmbedderConfiguration addInactiveProfile( String profile )
{
getInactiveProfiles().add( profile );
return this;
}
- public MavenEmbedRequest addActiveProfiles( List profiles )
+ public MavenEmbedderConfiguration addActiveProfiles( List profiles )
{
getActiveProfiles().addAll( profiles );
return this;
}
- public MavenEmbedRequest addInactiveProfiles( List profiles )
+ public MavenEmbedderConfiguration addInactiveProfiles( List profiles )
{
getInactiveProfiles().addAll( profiles );
return this;
@@ -95,13 +93,13 @@
return inactives;
}
- public MavenEmbedRequest setUserSettingsFile( File user )
+ public MavenEmbedderConfiguration setUserSettingsFile( File user )
{
userSettings = user;
return this;
}
- public MavenEmbedRequest setGlobalSettingsFile( File global )
+ public MavenEmbedderConfiguration setGlobalSettingsFile( File global )
{
globalSettings = global;
return this;
@@ -117,7 +115,7 @@
return globalSettings;
}
- public MavenEmbedRequest setConfigurationCustomizer( ContainerCustomizer customizer )
+ public MavenEmbedderConfiguration setConfigurationCustomizer( ContainerCustomizer customizer )
{
this.customizer = customizer;
return this;
@@ -128,15 +126,14 @@
return customizer;
}
- public MavenEmbedRequest setSystemProperties(Properties properties)
+ public MavenEmbedderConfiguration setSystemProperties( Properties properties )
{
systemProperties = properties;
return this;
}
- public Properties getSystemProperties()
+ public Properties getSystemProperties()
{
return systemProperties != null ? systemProperties : System.getProperties();
}
-
}
Propchange: maven/components/branches/maven-2.1-jvz/maven-embedder/src/main/java/org/apache/maven/embedder/DefaultMavenEmbedderConfiguration.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/components/branches/maven-2.1-jvz/maven-embedder/src/main/java/org/apache/maven/embedder/DefaultMavenEmbedderConfiguration.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Modified: maven/components/branches/maven-2.1-jvz/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedder.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.1-jvz/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedder.java?view=diff&rev=440215&r1=429536&r2=440215
==============================================================================
--- maven/components/branches/maven-2.1-jvz/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedder.java (original)
+++ maven/components/branches/maven-2.1-jvz/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedder.java Mon Sep 4 18:40:13 2006
@@ -29,12 +29,13 @@
import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
import org.apache.maven.artifact.resolver.ArtifactResolutionException;
import org.apache.maven.artifact.resolver.ArtifactResolver;
+import org.apache.maven.execution.DefaultMavenExecutionResult;
import org.apache.maven.execution.MavenExecutionRequest;
+import org.apache.maven.execution.MavenExecutionResult;
import org.apache.maven.lifecycle.LifecycleExecutor;
import org.apache.maven.model.Model;
import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
import org.apache.maven.model.io.xpp3.MavenXpp3Writer;
-import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.descriptor.PluginDescriptor;
import org.apache.maven.plugin.descriptor.PluginDescriptorBuilder;
import org.apache.maven.profiles.DefaultProfileManager;
@@ -44,30 +45,32 @@
import org.apache.maven.project.ProjectBuildingException;
import org.apache.maven.reactor.MavenExecutionException;
import org.apache.maven.settings.Settings;
-import org.apache.maven.wagon.events.TransferListener;
import org.codehaus.classworlds.ClassWorld;
-import org.codehaus.classworlds.DuplicateRealmException;
+import org.codehaus.plexus.DefaultPlexusContainer;
+import org.codehaus.plexus.PlexusContainer;
import org.codehaus.plexus.PlexusContainerException;
import org.codehaus.plexus.component.repository.ComponentDescriptor;
import org.codehaus.plexus.component.repository.exception.ComponentLifecycleException;
import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
import org.codehaus.plexus.configuration.PlexusConfiguration;
import org.codehaus.plexus.configuration.PlexusConfigurationException;
-import org.codehaus.plexus.embed.Embedder;
-import org.codehaus.plexus.util.DirectoryScanner;
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
import java.io.File;
-import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Writer;
import java.util.ArrayList;
-import java.util.Iterator;
+import java.util.Collections;
import java.util.List;
+// collapse embed request into request
+// take the stuff out of the start() and make it part of the request
+// remove settings from the core
+// there should be a general interaction listener and a noop by default
+
/**
* Class intended to be used by clients who wish to embed Maven into their applications
*
@@ -81,18 +84,19 @@
// Embedder
// ----------------------------------------------------------------------
- private Embedder embedder;
+ private PlexusContainer container;
// ----------------------------------------------------------------------
// Components
// ----------------------------------------------------------------------
- private MavenProjectBuilder mavenProjectBuilder;
+ private Maven maven;
- private ArtifactRepositoryFactory artifactRepositoryFactory;
+ private MavenTools mavenTools;
+ private MavenProjectBuilder mavenProjectBuilder;
- private LifecycleExecutor lifecycleExecutor;
+ private ArtifactRepositoryFactory artifactRepositoryFactory;
private WagonManager wagonManager;
@@ -110,133 +114,36 @@
private ArtifactRepositoryLayout defaultArtifactRepositoryLayout;
- // ----------------------------------------------------------------------
- //
- // ----------------------------------------------------------------------
-
- private Maven maven;
+ private Settings settings;
- private MavenTools mavenTools;
+ private ArtifactRepository localRepository;
// ----------------------------------------------------------------------
// Configuration
// ----------------------------------------------------------------------
- private Settings settings;
-
- private ArtifactRepository localRepository;
-
- private File localRepositoryDirectory;
-
- private ClassLoader classLoader;
-
private ClassWorld classWorld;
private MavenEmbedderLogger logger;
- // ----------------------------------------------------------------------
- // User options
- // ----------------------------------------------------------------------
-
- // release plugin uses this but in IDE there will probably always be some form of interaction.
- private boolean interactiveMode;
+ // ----------------------------------------------------------------------------
+ // Constructor
+ // ----------------------------------------------------------------------------
- private boolean offline;
+ public MavenEmbedder( ClassWorld classWorld, MavenEmbedderLogger logger )
+ throws MavenEmbedderException
+ {
+ this.classWorld = classWorld;
- private String globalChecksumPolicy;
+ this.logger = logger;
- /**
- * This option determines whether the embedder is to be aligned to the user
- * installation.
- * @deprecated not used
- */
- private boolean alignWithUserInstallation;
-
- private boolean started = false;
+ start();
+ }
// ----------------------------------------------------------------------
// Accessors
// ----------------------------------------------------------------------
- /**
- * @deprecated not used.
- */
- public void setInteractiveMode( boolean interactiveMode )
- {
- this.interactiveMode = interactiveMode;
- }
-
- /**
- * @deprecated not used.
- */
- public boolean isInteractiveMode()
- {
- return interactiveMode;
- }
-
- /**
- * @deprecated not used.
- */
- public void setOffline( boolean offline )
- {
- this.offline = offline;
- }
-
- /**
- * @deprecated not used.
- */
- public boolean isOffline()
- {
- return offline;
- }
-
- /**
- * @deprecated not used.
- */
- public void setGlobalChecksumPolicy( String globalChecksumPolicy )
- {
- this.globalChecksumPolicy = globalChecksumPolicy;
- }
-
- /**
- * @deprecated not used.
- */
- public String getGlobalChecksumPolicy()
- {
- return globalChecksumPolicy;
- }
-
- /**
- * @deprecated not used.
- */
- public boolean isAlignWithUserInstallation()
- {
- return alignWithUserInstallation;
- }
-
- /**
- * @deprecated not used
- */
- public void setAlignWithUserInstallation( boolean alignWithUserInstallation )
- {
- this.alignWithUserInstallation = alignWithUserInstallation;
- }
-
- /**
- * Set the classloader to use with the maven embedder.
- *
- * @param classLoader
- */
- public void setClassLoader( ClassLoader classLoader )
- {
- this.classLoader = classLoader;
- }
-
- public ClassLoader getClassLoader()
- {
- return classLoader;
- }
-
public void setClassWorld( ClassWorld classWorld )
{
this.classWorld = classWorld;
@@ -247,20 +154,9 @@
return classWorld;
}
- /**
- * @deprecated not used.
- */
- public void setLocalRepositoryDirectory( File localRepositoryDirectory )
- {
- this.localRepositoryDirectory = localRepositoryDirectory;
- }
-
- /**
- *
- */
public File getLocalRepositoryDirectory()
{
- return new File(getLocalRepositoryPath(settings));
+ return new File( getLocalRepositoryPath( settings ) );
}
public ArtifactRepository getLocalRepository()
@@ -273,11 +169,6 @@
return logger;
}
- public void setLogger( MavenEmbedderLogger logger )
- {
- this.logger = logger;
- }
-
// ----------------------------------------------------------------------
// Embedder Client Contract
// ----------------------------------------------------------------------
@@ -288,23 +179,20 @@
/**
* read the model.
- * requires a start()-ed embedder.
*/
public Model readModel( File model )
- throws XmlPullParserException, FileNotFoundException, IOException
+ throws XmlPullParserException, IOException
{
- checkStarted();
return modelReader.read( new FileReader( model ) );
}
/**
* write the model.
- * requires a start()-ed embedder.
*/
- public void writeModel( Writer writer, Model model )
+ public void writeModel( Writer writer,
+ Model model )
throws IOException
{
- checkStarted();
modelWriter.write( writer, model );
}
@@ -314,77 +202,82 @@
/**
* read the project.
- * requires a start()-ed embedder.
*/
public MavenProject readProject( File mavenProject )
throws ProjectBuildingException
{
- checkStarted();
return mavenProjectBuilder.build( mavenProject, localRepository, profileManager );
}
- public MavenProject readProjectWithDependencies( File mavenProject, TransferListener transferListener )
- throws ProjectBuildingException, ArtifactResolutionException, ArtifactNotFoundException
- {
- checkStarted();
- return mavenProjectBuilder.buildWithDependencies( mavenProject, localRepository, profileManager, transferListener );
- }
-
- public MavenProject readProjectWithDependencies( File mavenProject )
- throws ProjectBuildingException, ArtifactResolutionException, ArtifactNotFoundException
- {
- checkStarted();
- return mavenProjectBuilder.buildWithDependencies( mavenProject, localRepository, profileManager );
- }
-
- public List collectProjects( File basedir, String[] includes, String[] excludes )
- throws MojoExecutionException
+ /**
+ * This method is used to grab the list of dependencies that belong to a project so that a UI
+ * can be populated. For example, a list of libraries that are used by an Eclipse, Netbeans, or
+ * IntelliJ project.
+ */
+ // Not well formed exceptions to point people at errors
+ // line number in the originating POM so that errors can be shown
+ // Need to walk down the tree of dependencies and find all the errors and report in the result
+ // validate the request
+ // for dependency errors: identifier, path
+ // unable to see why you can't get a resource from the repository
+ // short message or error id
+ // completely obey the same settings used by the CLI, should work exactly the same as the
+ // command line. right now they are very different
+ public MavenExecutionResult readProjectWithDependencies( MavenExecutionRequest request )
{
- checkStarted();
- List projects = new ArrayList();
+ MavenProject project = null;
- List poms = getPomFiles( basedir, includes, excludes );
+ // How can we get rid of the profile manager from the request
- for ( Iterator i = poms.iterator(); i.hasNext(); )
+ try
{
- File pom = (File) i.next();
-
- try
- {
- MavenProject p = readProject( pom );
-
- projects.add( p );
-
- }
- catch ( ProjectBuildingException e )
- {
- throw new MojoExecutionException( "Error loading " + pom, e );
- }
+ project = mavenProjectBuilder.buildWithDependencies( new File( request.getPomFile() ),
+ request.getLocalRepository(),
+ profileManager, request.getTransferListener() );
+ }
+ catch ( ProjectBuildingException e )
+ {
+ return new DefaultMavenExecutionResult( project, Collections.singletonList( e ) );
+ }
+ catch ( ArtifactResolutionException e )
+ {
+ return new DefaultMavenExecutionResult( project, Collections.singletonList( e ) );
+ }
+ catch ( ArtifactNotFoundException e )
+ {
+ return new DefaultMavenExecutionResult( project, Collections.singletonList( e ) );
}
- return projects;
+ return new DefaultMavenExecutionResult( project, Collections.EMPTY_LIST );
}
// ----------------------------------------------------------------------
// Artifacts
// ----------------------------------------------------------------------
- public Artifact createArtifact( String groupId, String artifactId, String version, String scope, String type )
+ public Artifact createArtifact( String groupId,
+ String artifactId,
+ String version,
+ String scope,
+ String type )
{
- checkStarted();
return artifactFactory.createArtifact( groupId, artifactId, version, scope, type );
}
- public Artifact createArtifactWithClassifier( String groupId, String artifactId, String version, String type, String classifier )
+ public Artifact createArtifactWithClassifier( String groupId,
+ String artifactId,
+ String version,
+ String type,
+ String classifier )
{
- checkStarted();
return artifactFactory.createArtifactWithClassifier( groupId, artifactId, version, type, classifier );
}
- public void resolve( Artifact artifact, List remoteRepositories, ArtifactRepository localRepository )
+ public void resolve( Artifact artifact,
+ List remoteRepositories,
+ ArtifactRepository localRepository )
throws ArtifactResolutionException, ArtifactNotFoundException
{
- checkStarted();
artifactResolver.resolve( artifact, remoteRepositories, localRepository );
}
@@ -410,7 +303,8 @@
try
{
- InputStream is = classLoader.getResourceAsStream( "/plugins/" + summaryPluginDescriptor.getArtifactId() + ".xml" );
+ InputStream is =
+ container.getContainerRealm().getResourceAsStream( "/plugins/" + summaryPluginDescriptor.getArtifactId() + ".xml" );
pluginDescriptor = pluginDescriptorBuilder.build( new InputStreamReader( is ) );
}
@@ -422,7 +316,9 @@
return pluginDescriptor;
}
- private SummaryPluginDescriptor makeMockPlugin( String groupId, String artifactId, String name )
+ private SummaryPluginDescriptor makeMockPlugin( String groupId,
+ String artifactId,
+ String name )
{
return new SummaryPluginDescriptor( groupId, artifactId, name );
}
@@ -438,14 +334,14 @@
public List getLifecyclePhases()
throws MavenEmbedderException
{
- checkStarted();
List phases = new ArrayList();
- ComponentDescriptor descriptor = embedder.getContainer().getComponentDescriptor( LifecycleExecutor.ROLE );
+ ComponentDescriptor descriptor = container.getComponentDescriptor( LifecycleExecutor.ROLE );
PlexusConfiguration configuration = descriptor.getConfiguration();
- PlexusConfiguration[] phasesConfigurations = configuration.getChild( "lifecycles" ).getChild( 0 ).getChild( "phases" ).getChildren( "phase" );
+ PlexusConfiguration[] phasesConfigurations =
+ configuration.getChild( "lifecycles" ).getChild( 0 ).getChild( "phases" ).getChildren( "phase" );
try
{
@@ -485,7 +381,8 @@
return createLocalRepository( mavenTools.getLocalRepositoryPath( settings ), DEFAULT_LOCAL_REPO_ID );
}
- public ArtifactRepository createLocalRepository( String url, String repositoryId )
+ public ArtifactRepository createLocalRepository( String url,
+ String repositoryId )
{
if ( !url.startsWith( "file:" ) )
{
@@ -495,9 +392,9 @@
return createRepository( url, repositoryId );
}
- public ArtifactRepository createRepository( String url, String repositoryId )
+ public ArtifactRepository createRepository( String url,
+ String repositoryId )
{
- checkStarted();
// snapshots vs releases
// offline = to turning the update policy off
@@ -507,154 +404,111 @@
String checksumPolicyFlag = ArtifactRepositoryPolicy.CHECKSUM_POLICY_WARN;
- ArtifactRepositoryPolicy snapshotsPolicy = new ArtifactRepositoryPolicy( true, updatePolicyFlag, checksumPolicyFlag );
+ ArtifactRepositoryPolicy snapshotsPolicy =
+ new ArtifactRepositoryPolicy( true, updatePolicyFlag, checksumPolicyFlag );
- ArtifactRepositoryPolicy releasesPolicy = new ArtifactRepositoryPolicy( true, updatePolicyFlag, checksumPolicyFlag );
+ ArtifactRepositoryPolicy releasesPolicy =
+ new ArtifactRepositoryPolicy( true, updatePolicyFlag, checksumPolicyFlag );
- return artifactRepositoryFactory.createArtifactRepository( repositoryId, url, defaultArtifactRepositoryLayout, snapshotsPolicy, releasesPolicy );
- }
-
- // ----------------------------------------------------------------------
- // Internal utility code
- // ----------------------------------------------------------------------
-
- private List getPomFiles( File basedir, String[] includes, String[] excludes )
- {
- DirectoryScanner scanner = new DirectoryScanner();
-
- scanner.setBasedir( basedir );
-
- scanner.setIncludes( includes );
-
- scanner.setExcludes( excludes );
-
- scanner.scan();
-
- List poms = new ArrayList();
-
- for ( int i = 0; i < scanner.getIncludedFiles().length; i++ )
- {
- poms.add( new File( basedir, scanner.getIncludedFiles()[i] ) );
- }
-
- return poms;
+ return artifactRepositoryFactory.createArtifactRepository( repositoryId, url, defaultArtifactRepositoryLayout,
+ snapshotsPolicy, releasesPolicy );
}
// ----------------------------------------------------------------------
// Lifecycle
// ----------------------------------------------------------------------
- public void start()
- throws MavenEmbedderException
- {
- start(new DefaultMavenEmbedRequest());
-
- }
-
- public void start(MavenEmbedRequest req)
+ protected void start()
throws MavenEmbedderException
{
+ // As the PlexusContainer is optimized we can do more things up front here
+ // but in order to be threadsafe we'll need to look things up everytime
+ // Maven is invoked. We'll go the safe route first, write tests, and then
+ // start optimizing.
// ----------------------------------------------------------------------
// Set the maven.home system property which is need by components like
// the plugin registry builder.
// ----------------------------------------------------------------------
- if ( classWorld == null && classLoader == null )
+ if ( classWorld == null )
+ {
+ throw new IllegalStateException(
+ "A classWorld or classloader must be specified using setClassLoader|World(ClassLoader)." );
+ }
+ }
+
+ public MavenExecutionResult execute( MavenExecutionRequest request )
+ throws MavenEmbedderException, MavenExecutionException
+ {
+ try
{
- throw new IllegalStateException( "A classWorld or classloader must be specified using setClassLoader|World(ClassLoader)." );
+ container = new DefaultPlexusContainer( null, null, null, classWorld );
+ }
+ catch ( PlexusContainerException e )
+ {
+ throw new MavenEmbedderException( "Error starting Maven embedder.", e );
}
- embedder = new Embedder();
if ( logger != null )
{
- embedder.setLoggerManager( new MavenEmbedderLoggerManager( new PlexusLoggerAdapter( logger ) ) );
+ container.setLoggerManager( new MavenEmbedderLoggerManager( new PlexusLoggerAdapter( logger ) ) );
}
try
{
- if ( classWorld == null )
- {
- classWorld = new ClassWorld();
-
- classWorld.newRealm( "plexus.core", classLoader );
- }
-
- embedder.start( classWorld );
-
- if (req.getContainerCustomizer() != null)
- {
- req.getContainerCustomizer().customize(embedder.getContainer());
- }
-
// ----------------------------------------------------------------------
// Lookup each of the components we need to provide the desired
// client interface.
// ----------------------------------------------------------------------
+ //TODO needs to be a component
modelReader = new MavenXpp3Reader();
+ //TODO needs to be a component
modelWriter = new MavenXpp3Writer();
- maven = (Maven) embedder.lookup( Maven.ROLE );
+ maven = (Maven) container.lookup( Maven.ROLE );
- mavenTools = (MavenTools) embedder.lookup( MavenTools.ROLE );
+ mavenTools = (MavenTools) container.lookup( MavenTools.ROLE );
+ //TODO needs to be a component
pluginDescriptorBuilder = new PluginDescriptorBuilder();
- profileManager = new DefaultProfileManager( embedder.getContainer(), req.getSystemProperties() );
-
- profileManager.explicitlyActivate(req.getActiveProfiles());
-
- profileManager.explicitlyDeactivate(req.getInactiveProfiles());
+ profileManager = new DefaultProfileManager( container, request.getProperties() );
- mavenProjectBuilder = (MavenProjectBuilder) embedder.lookup( MavenProjectBuilder.ROLE );
+ mavenProjectBuilder = (MavenProjectBuilder) container.lookup( MavenProjectBuilder.ROLE );
// ----------------------------------------------------------------------
// Artifact related components
// ----------------------------------------------------------------------
- artifactRepositoryFactory = (ArtifactRepositoryFactory) embedder.lookup( ArtifactRepositoryFactory.ROLE );
+ artifactRepositoryFactory = (ArtifactRepositoryFactory) container.lookup( ArtifactRepositoryFactory.ROLE );
- artifactFactory = (ArtifactFactory) embedder.lookup( ArtifactFactory.ROLE );
+ artifactFactory = (ArtifactFactory) container.lookup( ArtifactFactory.ROLE );
- artifactResolver = (ArtifactResolver) embedder.lookup( ArtifactResolver.ROLE );
+ artifactResolver = (ArtifactResolver) container.lookup( ArtifactResolver.ROLE );
- defaultArtifactRepositoryLayout = (ArtifactRepositoryLayout) embedder.lookup( ArtifactRepositoryLayout.ROLE, DEFAULT_LAYOUT_ID );
+ defaultArtifactRepositoryLayout =
+ (ArtifactRepositoryLayout) container.lookup( ArtifactRepositoryLayout.ROLE, DEFAULT_LAYOUT_ID );
- lifecycleExecutor = (LifecycleExecutor) embedder.lookup( LifecycleExecutor.ROLE );
-
- wagonManager = (WagonManager) embedder.lookup( WagonManager.ROLE );
-
- settings = mavenTools.buildSettings( req.getUserSettingsFile(),
- req.getGlobalSettingsFile(),
- null );
+ wagonManager = (WagonManager) container.lookup( WagonManager.ROLE );
profileManager.loadSettingsProfiles( settings );
-
- started = true;
-
+
localRepository = createLocalRepository( settings );
-
- }
- catch ( PlexusContainerException e )
- {
- throw new MavenEmbedderException( "Cannot start Plexus embedder.", e );
- }
- catch ( DuplicateRealmException e )
- {
- throw new MavenEmbedderException( "Cannot create Classworld realm for the embedder.", e );
+
+ profileManager.explicitlyActivate( request.getActiveProfiles() );
+
+ profileManager.explicitlyDeactivate( request.getInactiveProfiles() );
}
catch ( ComponentLookupException e )
{
throw new MavenEmbedderException( "Cannot lookup required component.", e );
- }
- catch (SettingsConfigurationException e )
- {
- throw new MavenEmbedderException( "Cannot create settings configuration", e );
}
- }
+ return maven.execute( request );
+ }
// ----------------------------------------------------------------------
// Lifecycle
@@ -663,14 +517,11 @@
public void stop()
throws MavenEmbedderException
{
- started = false;
try
{
- embedder.release( mavenProjectBuilder );
-
- embedder.release( artifactRepositoryFactory );
+ container.release( mavenProjectBuilder );
- embedder.release( lifecycleExecutor );
+ container.release( artifactRepositoryFactory );
}
catch ( ComponentLifecycleException e )
{
@@ -682,13 +533,6 @@
// Start of new embedder API
// ----------------------------------------------------------------------
- public void execute( MavenExecutionRequest request )
- throws MavenExecutionException
- {
- checkStarted();
- maven.execute( request );
- }
-
public Settings buildSettings( File userSettingsPath,
File globalSettingsPath,
boolean interactive,
@@ -697,48 +541,30 @@
Boolean pluginUpdateOverride )
throws SettingsConfigurationException
{
- checkStarted();
- return mavenTools.buildSettings( userSettingsPath,
- globalSettingsPath,
- interactive,
- offline,
- usePluginRegistry,
- pluginUpdateOverride );
+ return mavenTools.buildSettings( userSettingsPath, globalSettingsPath, interactive, offline, usePluginRegistry,
+ pluginUpdateOverride );
}
-
+
public Settings buildSettings( File userSettingsPath,
File globalSettingsPath,
Boolean pluginUpdateOverride )
throws SettingsConfigurationException
{
- checkStarted();
- return mavenTools.buildSettings( userSettingsPath,
- globalSettingsPath,
- pluginUpdateOverride );
+ return mavenTools.buildSettings( userSettingsPath, globalSettingsPath, pluginUpdateOverride );
}
-
public File getUserSettingsPath( String optionalSettingsPath )
{
- checkStarted();
return mavenTools.getUserSettingsPath( optionalSettingsPath );
}
public File getGlobalSettingsPath()
{
- checkStarted();
return mavenTools.getGlobalSettingsPath();
}
public String getLocalRepositoryPath( Settings settings )
{
- checkStarted();
return mavenTools.getLocalRepositoryPath( settings );
- }
-
- private void checkStarted() {
- if (!started) {
- throw new IllegalStateException("The embedder is not started, you need to call start() on the embedder prior to calling this method");
- }
}
}
Copied: maven/components/branches/maven-2.1-jvz/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedderConfiguration.java (from r429536, maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedRequest.java)
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.1-jvz/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedderConfiguration.java?view=diff&rev=440215&p1=maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedRequest.java&r1=429536&p2=maven/components/branches/maven-2.1-jvz/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedderConfiguration.java&r2=440215
==============================================================================
--- maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedRequest.java (original)
+++ maven/components/branches/maven-2.1-jvz/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedderConfiguration.java Mon Sep 4 18:40:13 2006
@@ -16,67 +16,68 @@
*/
import java.io.File;
-import java.net.URL;
import java.util.List;
import java.util.Properties;
-import org.apache.maven.settings.Settings;
/**
* Configuration of embedder, used when starting up.
+ *
* @author mkleint
*/
-public interface MavenEmbedRequest {
-
+public interface MavenEmbedderConfiguration
+{
/*
- * Add profile to activate.
- */
- MavenEmbedRequest addActiveProfile( String profile );
+ * Add profile to activate.
+ */
+ MavenEmbedderConfiguration addActiveProfile( String profile );
/*
* Add profile to inactivate.
*/
- MavenEmbedRequest addInactiveProfile( String profile );
+ MavenEmbedderConfiguration addInactiveProfile( String profile );
+
/*
- * Add a list of String instances with names of profiles to activate.
- */
- MavenEmbedRequest addActiveProfiles( List profiles );
+ * Add a list of String instances with names of profiles to activate.
+ */
+ MavenEmbedderConfiguration addActiveProfiles( List profiles );
+
/*
- * Add a list of String instances with names of profiles to inactivate.
- */
- MavenEmbedRequest addInactiveProfiles( List profiles );
-
+ * Add a list of String instances with names of profiles to inactivate.
+ */
+ MavenEmbedderConfiguration addInactiveProfiles( List profiles );
+
/*
- * Set location of the user settings file to use for the embedder.
- */
- MavenEmbedRequest setUserSettingsFile(File user);
+ * Set location of the user settings file to use for the embedder.
+ */
+ MavenEmbedderConfiguration setUserSettingsFile( File user );
/*
* Set location of the global settings file to use for the embedder.
*/
- MavenEmbedRequest setGlobalSettingsFile(File global);
-
+ MavenEmbedderConfiguration setGlobalSettingsFile( File global );
+
/**
* Set a customizer callback implemetation that will be given a chance to modify the plexus container
* on startup.
*/
- MavenEmbedRequest setConfigurationCustomizer(ContainerCustomizer customizer);
-
+ MavenEmbedderConfiguration setConfigurationCustomizer( ContainerCustomizer customizer );
+
/**
* set the system properties to be used during the lifecycle of the embedder. Excluding the time when executing the project, then the properties from MavenExecutionRequestare used.
*/
- MavenEmbedRequest setSystemProperties( Properties properties );
-
+ MavenEmbedderConfiguration setSystemProperties( Properties properties );
+
List getActiveProfiles();
List getInactiveProfiles();
-
+
File getUserSettingsFile();
-
+
File getGlobalSettingsFile();
-
+
ContainerCustomizer getContainerCustomizer();
-
+
Properties getSystemProperties();
-
-
+
+
}
Propchange: maven/components/branches/maven-2.1-jvz/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedderConfiguration.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/components/branches/maven-2.1-jvz/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedderConfiguration.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Modified: maven/components/branches/maven-2.1-jvz/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedderException.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.1-jvz/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedderException.java?view=diff&rev=440215&r1=429536&r2=440215
==============================================================================
--- maven/components/branches/maven-2.1-jvz/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedderException.java (original)
+++ maven/components/branches/maven-2.1-jvz/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedderException.java Mon Sep 4 18:40:13 2006
@@ -18,7 +18,7 @@
/**
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
- * @version $Id:$
+ * @version $Id$
*/
public class MavenEmbedderException
extends Exception
Added: maven/components/branches/maven-2.1-jvz/maven-embedder/src/main/java/org/apache/maven/embedder/user/SettingsAdapter.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.1-jvz/maven-embedder/src/main/java/org/apache/maven/embedder/user/SettingsAdapter.java?view=auto&rev=440215
==============================================================================
--- maven/components/branches/maven-2.1-jvz/maven-embedder/src/main/java/org/apache/maven/embedder/user/SettingsAdapter.java (added)
+++ maven/components/branches/maven-2.1-jvz/maven-embedder/src/main/java/org/apache/maven/embedder/user/SettingsAdapter.java Mon Sep 4 18:40:13 2006
@@ -0,0 +1,72 @@
+package org.apache.maven.embedder.user;
+
+import org.apache.maven.execution.MavenExecutionRequest;
+import org.apache.maven.settings.Settings;
+
+import java.util.List;
+
+/**
+ * Adapt a {@link MavenExecutionRequest} to a {@link Settings} object for use in the Maven core.
+ *
+ * @author Jason van Zyl
+ */
+public class SettingsAdapter
+ extends Settings
+{
+ private MavenExecutionRequest request;
+
+ public SettingsAdapter( MavenExecutionRequest request )
+ {
+ this.request = request;
+ }
+
+ public String getLocalRepository()
+ {
+ return request.getLocalRepositoryPath().getAbsolutePath();
+ }
+
+ public boolean isInteractiveMode()
+ {
+ return request.isInteractiveMode();
+ }
+
+ public boolean isUsePluginRegistry()
+ {
+ return request.isUsePluginRegistry();
+ }
+
+ public boolean isOffline()
+ {
+ return request.isOffline();
+ }
+
+ public List getProxies()
+ {
+ return request.getProxies();
+ }
+
+ public List getServers()
+ {
+ return request.getServers();
+ }
+
+ public List getMirrors()
+ {
+ return request.getMirrors();
+ }
+
+ public List getProfiles()
+ {
+ return request.getProfiles();
+ }
+
+ public List getActiveProfiles()
+ {
+ return request.getActiveProfiles();
+ }
+
+ public List getPluginGroups()
+ {
+ return request.getPluginGroups();
+ }
+}
Propchange: maven/components/branches/maven-2.1-jvz/maven-embedder/src/main/java/org/apache/maven/embedder/user/SettingsAdapter.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/components/branches/maven-2.1-jvz/maven-embedder/src/main/java/org/apache/maven/embedder/user/SettingsAdapter.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision