maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvan...@apache.org
Subject svn commit: r543753 - in /maven/components/trunk: ./ maven-core/ maven-core/src/main/java/org/apache/maven/core/ maven-core/src/main/java/org/apache/maven/execution/ maven-core/src/main/java/org/apache/maven/monitor/event/ maven-core/src/main/java/org/...
Date Sat, 02 Jun 2007 15:35:58 GMT
Author: jvanzyl
Date: Sat Jun  2 08:35:57 2007
New Revision: 543753

URL: http://svn.apache.org/viewvc?view=rev&rev=543753
Log:
Reverting the package changes 
Issue id: MNG-2943

Removed:
    maven/components/trunk/maven-core/src/main/java/org/apache/maven/core/
    maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/DefaultMavenTools.java
    maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/MavenTools.java
    maven/components/trunk/maven-settings/src/main/java/org/apache/maven/settings/SettingsConfigurationException.java
Modified:
    maven/components/trunk/make-embedder.sh
    maven/components/trunk/maven-core/pom.xml
    maven/components/trunk/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequest.java
    maven/components/trunk/maven-core/src/main/java/org/apache/maven/monitor/event/DefaultEventMonitor.java
    maven/components/trunk/maven-core/src/main/java/org/apache/maven/monitor/logging/DefaultLog.java
    maven/components/trunk/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java
    maven/components/trunk/maven-embedder/pom.xml
    maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedder.java
    maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/embedder/execution/DefaultMavenExecutionRequestDefaultsPopulator.java
    maven/components/trunk/maven-embedder/src/test/java/org/apache/maven/embedder/MavenEmbedderTest.java
    maven/components/trunk/maven-project/pom.xml
    maven/components/trunk/maven-project/src/main/java/org/apache/maven/DefaultMavenTools.java
    maven/components/trunk/maven-project/src/main/java/org/apache/maven/MavenTools.java
    maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
    maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/build/model/DefaultModelLineageBuilder.java
    maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/build/profile/DefaultProfileAdvisor.java
    maven/components/trunk/maven-project/src/main/resources/META-INF/plexus/components.xml
    maven/components/trunk/maven-project/src/test/resources/org/apache/maven/project/ProjectClasspathTest.xml
    maven/components/trunk/maven-project/src/test/resources/org/apache/maven/project/canonical/CanonicalProjectBuilderTest.xml
    maven/components/trunk/maven-settings/pom.xml
    maven/components/trunk/maven-settings/src/main/java/org/apache/maven/SettingsConfigurationException.java
    maven/components/trunk/pom.xml

Modified: maven/components/trunk/make-embedder.sh
URL: http://svn.apache.org/viewvc/maven/components/trunk/make-embedder.sh?view=diff&rev=543753&r1=543752&r2=543753
==============================================================================
--- maven/components/trunk/make-embedder.sh (original)
+++ maven/components/trunk/make-embedder.sh Sat Jun  2 08:35:57 2007
@@ -11,5 +11,5 @@
   cd maven-embedder
   sed "s@<bundleVersion>.*</bundleVersion>@<bundleVersion>$ds</bundleVersion>@"
pom.xml > tmp; mv tmp pom.xml
   mvn clean install
-  mv target/maven-embedder-*-ueber.jar $dir/maven-embedder-$ds-dep.jar
+  mv target/maven-embedder-*-uber.jar $dir/maven-embedder-$ds-dep.jar
 )

Modified: maven/components/trunk/maven-core/pom.xml
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-core/pom.xml?view=diff&rev=543753&r1=543752&r2=543753
==============================================================================
--- maven/components/trunk/maven-core/pom.xml (original)
+++ maven/components/trunk/maven-core/pom.xml Sat Jun  2 08:35:57 2007
@@ -150,18 +150,4 @@
       <scope>test</scope>
     </dependency>      
   </dependencies>
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <configuration>
-          <instructions>
-            <!-- do not export deprecated packages -->
-            <Export-Package>!org.apache.maven.monitor.*,*</Export-Package>
-          </instructions>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
 </project>

Modified: maven/components/trunk/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequest.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequest.java?view=diff&rev=543753&r1=543752&r2=543753
==============================================================================
--- maven/components/trunk/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequest.java
(original)
+++ maven/components/trunk/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequest.java
Sat Jun  2 08:35:57 2007
@@ -89,6 +89,7 @@
 
     // Properties
     MavenExecutionRequest setProperties( Properties properties );
+    MavenExecutionRequest setProperty( String key, String value );
     Properties getProperties();
 
     // Reactor

Modified: maven/components/trunk/maven-core/src/main/java/org/apache/maven/monitor/event/DefaultEventMonitor.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-core/src/main/java/org/apache/maven/monitor/event/DefaultEventMonitor.java?view=diff&rev=543753&r1=543752&r2=543753
==============================================================================
--- maven/components/trunk/maven-core/src/main/java/org/apache/maven/monitor/event/DefaultEventMonitor.java
(original)
+++ maven/components/trunk/maven-core/src/main/java/org/apache/maven/monitor/event/DefaultEventMonitor.java
Sat Jun  2 08:35:57 2007
@@ -23,14 +23,25 @@
 
 /**
  * @author jdcasey
- * @deprecated use {@link org.apache.maven.core.monitor.event.DefaultEventMonitor}
  */
 public class DefaultEventMonitor
-    extends org.apache.maven.core.monitor.event.DefaultEventMonitor
+    extends AbstractSelectiveEventMonitor
 {
 
+    private static final String[] START_EVENTS = {MavenEvents.MOJO_EXECUTION};
+
+    private final Logger logger;
+
     public DefaultEventMonitor( Logger logger )
     {
-        super( logger );
+        super( START_EVENTS, MavenEvents.NO_EVENTS, MavenEvents.NO_EVENTS );
+
+        this.logger = logger;
     }
+
+    protected void doStartEvent( String event, String target, long time )
+    {
+        logger.info( "[" + target + "]" );
+    }
+
 }

Modified: maven/components/trunk/maven-core/src/main/java/org/apache/maven/monitor/logging/DefaultLog.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-core/src/main/java/org/apache/maven/monitor/logging/DefaultLog.java?view=diff&rev=543753&r1=543752&r2=543753
==============================================================================
--- maven/components/trunk/maven-core/src/main/java/org/apache/maven/monitor/logging/DefaultLog.java
(original)
+++ maven/components/trunk/maven-core/src/main/java/org/apache/maven/monitor/logging/DefaultLog.java
Sat Jun  2 08:35:57 2007
@@ -19,19 +19,113 @@
  * under the License.
  */
 
+import org.apache.maven.plugin.logging.Log;
 import org.codehaus.plexus.logging.Logger;
 
 /**
  * @author jdcasey
- * @deprecated use {@link org.apache.maven.core.monitor.logging.DefaultLog}
  */
 public class DefaultLog
-    extends org.apache.maven.core.monitor.logging.DefaultLog
+    implements Log
 {
 
+    private final Logger logger;
+
     public DefaultLog( Logger logger )
     {
-        super( logger );
+        this.logger = logger;
+    }
+
+    public void debug( CharSequence content )
+    {
+        logger.debug( toString( content ) );
+    }
+
+    private String toString( CharSequence content )
+    {
+        if ( content == null )
+        {
+            return "";
+        }
+        else
+        {
+            return content.toString();
+        }
+    }
+
+    public void debug( CharSequence content, Throwable error )
+    {
+        logger.debug( toString( content ), error );
+    }
+
+    public void debug( Throwable error )
+    {
+        logger.debug( "", error );
+    }
+
+    public void info( CharSequence content )
+    {
+        logger.info( toString( content ) );
+    }
+
+    public void info( CharSequence content, Throwable error )
+    {
+        logger.info( toString( content ), error );
+    }
+
+    public void info( Throwable error )
+    {
+        logger.info( "", error );
+    }
+
+    public void warn( CharSequence content )
+    {
+        logger.warn( toString( content ) );
+    }
+
+    public void warn( CharSequence content, Throwable error )
+    {
+        logger.warn( toString( content ), error );
+    }
+
+    public void warn( Throwable error )
+    {
+        logger.warn( "", error );
+    }
+
+    public void error( CharSequence content )
+    {
+        logger.error( toString( content ) );
+    }
+
+    public void error( CharSequence content, Throwable error )
+    {
+        logger.error( toString( content ), error );
+    }
+
+    public void error( Throwable error )
+    {
+        logger.error( "", error );
+    }
+
+    public boolean isDebugEnabled()
+    {
+        return logger.isDebugEnabled();
+    }
+
+    public boolean isInfoEnabled()
+    {
+        return logger.isInfoEnabled();
+    }
+
+    public boolean isWarnEnabled()
+    {
+        return logger.isWarnEnabled();
+    }
+
+    public boolean isErrorEnabled()
+    {
+        return logger.isErrorEnabled();
     }
 
 }

Modified: maven/components/trunk/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java?view=diff&rev=543753&r1=543752&r2=543753
==============================================================================
--- maven/components/trunk/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java
(original)
+++ maven/components/trunk/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java
Sat Jun  2 08:35:57 2007
@@ -37,7 +37,6 @@
 import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
 import org.apache.maven.artifact.versioning.VersionRange;
 import org.apache.maven.context.BuildContextManager;
-import org.apache.maven.core.monitor.logging.DefaultLog;
 import org.apache.maven.execution.MavenSession;
 import org.apache.maven.execution.RuntimeInformation;
 import org.apache.maven.lifecycle.LifecycleExecutionContext;
@@ -46,6 +45,7 @@
 import org.apache.maven.model.ReportPlugin;
 import org.apache.maven.monitor.event.EventDispatcher;
 import org.apache.maven.monitor.event.MavenEvents;
+import org.apache.maven.monitor.logging.DefaultLog;
 import org.apache.maven.plugin.descriptor.MojoDescriptor;
 import org.apache.maven.plugin.descriptor.Parameter;
 import org.apache.maven.plugin.descriptor.PluginDescriptor;

Modified: maven/components/trunk/maven-embedder/pom.xml
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-embedder/pom.xml?view=diff&rev=543753&r1=543752&r2=543753
==============================================================================
--- maven/components/trunk/maven-embedder/pom.xml (original)
+++ maven/components/trunk/maven-embedder/pom.xml Sat Jun  2 08:35:57 2007
@@ -30,7 +30,7 @@
   <artifactId>maven-embedder</artifactId>
   <name>Maven Embedder</name>
   <properties>
-    <bundleVersion>2.1.0.v20070320-1003</bundleVersion>
+    <bundleVersion>2.1.0.v20070601-0109</bundleVersion>
   </properties>
   <build>
     <resources>

Modified: maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedder.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedder.java?view=diff&rev=543753&r1=543752&r2=543753
==============================================================================
--- maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedder.java
(original)
+++ maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedder.java
Sat Jun  2 08:35:57 2007
@@ -20,6 +20,7 @@
  */
 
 import org.apache.maven.Maven;
+import org.apache.maven.SettingsConfigurationException;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.factory.ArtifactFactory;
 import org.apache.maven.artifact.handler.ArtifactHandler;
@@ -59,7 +60,6 @@
 import org.apache.maven.project.ProjectBuildingException;
 import org.apache.maven.settings.MavenSettingsBuilder;
 import org.apache.maven.settings.Settings;
-import org.apache.maven.settings.SettingsConfigurationException;
 import org.apache.maven.settings.io.jdom.SettingsJDOMWriter;
 import org.apache.maven.settings.io.xpp3.SettingsXpp3Reader;
 import org.apache.maven.settings.validation.DefaultSettingsValidator;

Modified: maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/embedder/execution/DefaultMavenExecutionRequestDefaultsPopulator.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/embedder/execution/DefaultMavenExecutionRequestDefaultsPopulator.java?view=diff&rev=543753&r1=543752&r2=543753
==============================================================================
--- maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/embedder/execution/DefaultMavenExecutionRequestDefaultsPopulator.java
(original)
+++ maven/components/trunk/maven-embedder/src/main/java/org/apache/maven/embedder/execution/DefaultMavenExecutionRequestDefaultsPopulator.java
Sat Jun  2 08:35:57 2007
@@ -19,21 +19,21 @@
  * under the License.
  */
 
+import org.apache.maven.SettingsConfigurationException;
 import org.apache.maven.wagon.repository.RepositoryPermissions;
 import org.apache.maven.artifact.manager.WagonManager;
 import org.apache.maven.artifact.repository.ArtifactRepositoryFactory;
 import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy;
 import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
-import org.apache.maven.core.monitor.event.DefaultEventMonitor;
 import org.apache.maven.embedder.MavenEmbedder;
 import org.apache.maven.embedder.MavenEmbedderException;
 import org.apache.maven.execution.MavenExecutionRequest;
+import org.apache.maven.monitor.event.DefaultEventMonitor;
 import org.apache.maven.plugin.Mojo;
 import org.apache.maven.settings.Mirror;
 import org.apache.maven.settings.Proxy;
 import org.apache.maven.settings.Server;
 import org.apache.maven.settings.Settings;
-import org.apache.maven.settings.SettingsConfigurationException;
 import org.apache.maven.usability.SystemWarnings;
 import org.codehaus.plexus.PlexusConstants;
 import org.codehaus.plexus.PlexusContainer;

Modified: maven/components/trunk/maven-embedder/src/test/java/org/apache/maven/embedder/MavenEmbedderTest.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-embedder/src/test/java/org/apache/maven/embedder/MavenEmbedderTest.java?view=diff&rev=543753&r1=543752&r2=543753
==============================================================================
--- maven/components/trunk/maven-embedder/src/test/java/org/apache/maven/embedder/MavenEmbedderTest.java
(original)
+++ maven/components/trunk/maven-embedder/src/test/java/org/apache/maven/embedder/MavenEmbedderTest.java
Sat Jun  2 08:35:57 2007
@@ -20,6 +20,7 @@
  */
 
 import junit.framework.TestCase;
+import org.apache.maven.SettingsConfigurationException;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.handler.ArtifactHandler;
 import org.apache.maven.execution.DefaultMavenExecutionRequest;
@@ -33,7 +34,6 @@
 import org.apache.maven.settings.Profile;
 import org.apache.maven.settings.Repository;
 import org.apache.maven.settings.Settings;
-import org.apache.maven.settings.SettingsConfigurationException;
 import org.apache.maven.settings.io.xpp3.SettingsXpp3Reader;
 import org.apache.maven.settings.io.xpp3.SettingsXpp3Writer;
 import org.codehaus.plexus.util.FileUtils;

Modified: maven/components/trunk/maven-project/pom.xml
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/pom.xml?view=diff&rev=543753&r1=543752&r2=543753
==============================================================================
--- maven/components/trunk/maven-project/pom.xml (original)
+++ maven/components/trunk/maven-project/pom.xml Sat Jun  2 08:35:57 2007
@@ -19,9 +19,8 @@
 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/maven-v4_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/maven-v4_0_0.xsd">
   <parent>
     <artifactId>maven</artifactId>
     <groupId>org.apache.maven</groupId>
@@ -72,19 +71,4 @@
       <scope>test</scope>
     </dependency>    
   </dependencies>
-
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <configuration>
-          <instructions>
-            <!-- do not export deprecated packages -->
-            <Export-Package>!org.apache.maven,*</Export-Package>
-          </instructions>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
 </project>

Modified: maven/components/trunk/maven-project/src/main/java/org/apache/maven/DefaultMavenTools.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/main/java/org/apache/maven/DefaultMavenTools.java?view=diff&rev=543753&r1=543752&r2=543753
==============================================================================
--- maven/components/trunk/maven-project/src/main/java/org/apache/maven/DefaultMavenTools.java
(original)
+++ maven/components/trunk/maven-project/src/main/java/org/apache/maven/DefaultMavenTools.java
Sat Jun  2 08:35:57 2007
@@ -1,70 +1,171 @@
 package org.apache.maven;
 
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
- * agreements. See the NOTICE file distributed with this work for additional information
regarding
- * copyright ownership. The ASF licenses this file to you under the Apache License, Version
2.0 (the
- * "License"); you may not use this file except in compliance with the License. You may obtain
a
- * copy of the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software distributed under
the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
express
- * or implied. See the License for the specific language governing permissions and limitations
under
- * the License.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
  */
 
-import java.util.List;
-
 import org.apache.maven.artifact.InvalidRepositoryException;
 import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.artifact.repository.ArtifactRepositoryFactory;
+import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy;
+import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
 import org.apache.maven.model.DeploymentRepository;
 import org.apache.maven.model.Repository;
+import org.apache.maven.model.RepositoryBase;
+import org.apache.maven.model.RepositoryPolicy;
+import org.codehaus.plexus.PlexusConstants;
+import org.codehaus.plexus.PlexusContainer;
+import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
+import org.codehaus.plexus.context.Context;
+import org.codehaus.plexus.context.ContextException;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable;
 
-/**
- * @deprecated use {@link org.apache.maven.project.DefaultMavenTools}
- * @author Jason van Zyl
- */
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+/** @author Jason van Zyl */
 public class DefaultMavenTools
-    extends org.apache.maven.project.DefaultMavenTools
-    implements MavenTools
+    implements MavenTools, Contextualizable
 {
-    private org.apache.maven.project.MavenTools mavenTools;
+    private ArtifactRepositoryLayout repositoryLayout;
+
+    private ArtifactRepositoryFactory artifactRepositoryFactory;
+
+    private PlexusContainer container;
+
+    // ----------------------------------------------------------------------------
+    // Code snagged from ProjectUtils: this will have to be moved somewhere else
+    // but just trying to collect it all in one place right now.
+    // ----------------------------------------------------------------------------
 
-    /**
-     * @see org.apache.maven.project.MavenTools#buildArtifactRepositories(java.util.List)
-     */
     public List buildArtifactRepositories( List repositories )
         throws InvalidRepositoryException
     {
-        return getMavenTools().buildArtifactRepositories( repositories );
+        List repos = new ArrayList();
+
+        for ( Iterator i = repositories.iterator(); i.hasNext(); )
+        {
+            Repository mavenRepo = (Repository) i.next();
+
+            ArtifactRepository artifactRepo = buildArtifactRepository( mavenRepo );
+
+            if ( !repos.contains( artifactRepo ) )
+            {
+                repos.add( artifactRepo );
+            }
+        }
+        return repos;
     }
 
-    /**
-     * @see org.apache.maven.project.MavenTools#buildArtifactRepository(org.apache.maven.model.Repository)
-     */
-    public ArtifactRepository buildArtifactRepository( Repository repo )
+    public ArtifactRepository buildDeploymentArtifactRepository( DeploymentRepository repo
)
         throws InvalidRepositoryException
     {
-        return getMavenTools().buildArtifactRepository( repo );
+        if ( repo != null )
+        {
+            String id = repo.getId();
+            String url = repo.getUrl();
+
+            // TODO: make this a map inside the factory instead, so no lookup needed
+            ArtifactRepositoryLayout layout = getRepositoryLayout( repo );
+
+            return artifactRepositoryFactory.createDeploymentArtifactRepository( id, url,
layout,
+                                                                                 repo.isUniqueVersion()
);
+        }
+        else
+        {
+            return null;
+        }
     }
 
-    /**
-     * @see org.apache.maven.project.MavenTools#buildDeploymentArtifactRepository(org.apache.maven.model.DeploymentRepository)
-     */
-    public ArtifactRepository buildDeploymentArtifactRepository( DeploymentRepository repo
)
+    public ArtifactRepository buildArtifactRepository( Repository repo )
         throws InvalidRepositoryException
     {
-        return getMavenTools().buildDeploymentArtifactRepository( repo );
+        if ( repo != null )
+        {
+            String id = repo.getId();
+            String url = repo.getUrl();
+
+            // TODO: make this a map inside the factory instead, so no lookup needed
+            ArtifactRepositoryLayout layout = getRepositoryLayout( repo );
+
+            ArtifactRepositoryPolicy snapshots = buildArtifactRepositoryPolicy( repo.getSnapshots()
);
+
+            ArtifactRepositoryPolicy releases = buildArtifactRepositoryPolicy( repo.getReleases()
);
+
+            return artifactRepositoryFactory.createArtifactRepository( id, url, layout, snapshots,
releases );
+        }
+        else
+        {
+            return null;
+        }
+    }
+
+    public ArtifactRepositoryPolicy buildArtifactRepositoryPolicy( RepositoryPolicy policy
)
+    {
+        boolean enabled = true;
+
+        String updatePolicy = null;
+
+        String checksumPolicy = null;
+
+        if ( policy != null )
+        {
+            enabled = policy.isEnabled();
+
+            if ( policy.getUpdatePolicy() != null )
+            {
+                updatePolicy = policy.getUpdatePolicy();
+            }
+            if ( policy.getChecksumPolicy() != null )
+            {
+                checksumPolicy = policy.getChecksumPolicy();
+            }
+        }
+
+        return new ArtifactRepositoryPolicy( enabled, updatePolicy, checksumPolicy );
     }
 
-    private org.apache.maven.project.MavenTools getMavenTools()
+    private ArtifactRepositoryLayout getRepositoryLayout( RepositoryBase mavenRepo )
+        throws InvalidRepositoryException
     {
-        if ( mavenTools == null )
+        String layout = mavenRepo.getLayout();
+
+        ArtifactRepositoryLayout repositoryLayout;
+        try
         {
-            mavenTools = new org.apache.maven.project.DefaultMavenTools();
+            repositoryLayout = (ArtifactRepositoryLayout) container.lookup( ArtifactRepositoryLayout.ROLE,
layout );
         }
-        return mavenTools;
+        catch ( ComponentLookupException e )
+        {
+            throw new InvalidRepositoryException( "Cannot find layout implementation corresponding
to: \'" + layout +
+                "\' for remote repository with id: \'" + mavenRepo.getId() + "\'.", e );
+        }
+        return repositoryLayout;
+    }
+
+    // ----------------------------------------------------------------------------
+    // Lifecycle
+    // ----------------------------------------------------------------------------
+
+    public void contextualize( Context context )
+        throws ContextException
+    {
+        container = (PlexusContainer) context.get( PlexusConstants.PLEXUS_KEY );
     }
 }

Modified: maven/components/trunk/maven-project/src/main/java/org/apache/maven/MavenTools.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/main/java/org/apache/maven/MavenTools.java?view=diff&rev=543753&r1=543752&r2=543753
==============================================================================
--- maven/components/trunk/maven-project/src/main/java/org/apache/maven/MavenTools.java (original)
+++ maven/components/trunk/maven-project/src/main/java/org/apache/maven/MavenTools.java Sat
Jun  2 08:35:57 2007
@@ -19,11 +19,30 @@
  * under the License.
  */
 
+import org.apache.maven.artifact.InvalidRepositoryException;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.model.DeploymentRepository;
+import org.apache.maven.model.Repository;
+
+import java.util.List;
 
 /**
- * @deprecated use {@link org.apache.maven.project.MavenTools}
  * @author Jason van Zyl
  */
-public interface MavenTools extends org.apache.maven.project.MavenTools
+public interface MavenTools
 {
+    String ROLE = MavenTools.class.getName();
+
+    // ----------------------------------------------------------------------------
+    // Methods taken from ProjectUtils
+    // ----------------------------------------------------------------------------
+
+    List buildArtifactRepositories( List repositories )
+        throws InvalidRepositoryException;
+
+    ArtifactRepository buildDeploymentArtifactRepository( DeploymentRepository repo )
+        throws InvalidRepositoryException;
+
+    ArtifactRepository buildArtifactRepository( Repository repo )
+        throws InvalidRepositoryException;
 }

Modified: maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java?view=diff&rev=543753&r1=543752&r2=543753
==============================================================================
--- maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
(original)
+++ maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
Sat Jun  2 08:35:57 2007
@@ -19,6 +19,7 @@
  * under the License.
  */
 
+import org.apache.maven.MavenTools;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.ArtifactStatus;
 import org.apache.maven.artifact.ArtifactUtils;

Modified: maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/build/model/DefaultModelLineageBuilder.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/build/model/DefaultModelLineageBuilder.java?view=diff&rev=543753&r1=543752&r2=543753
==============================================================================
--- maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/build/model/DefaultModelLineageBuilder.java
(original)
+++ maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/build/model/DefaultModelLineageBuilder.java
Sat Jun  2 08:35:57 2007
@@ -19,6 +19,7 @@
  * under the License.
  */
 
+import org.apache.maven.MavenTools;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.InvalidRepositoryException;
 import org.apache.maven.artifact.factory.ArtifactFactory;
@@ -31,7 +32,6 @@
 import org.apache.maven.model.Parent;
 import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
 import org.apache.maven.profiles.ProfileManager;
-import org.apache.maven.project.MavenTools;
 import org.apache.maven.project.ProjectBuildingException;
 import org.apache.maven.project.build.ProjectBuildCache;
 import org.apache.maven.project.build.profile.ProfileAdvisor;

Modified: maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/build/profile/DefaultProfileAdvisor.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/build/profile/DefaultProfileAdvisor.java?view=diff&rev=543753&r1=543752&r2=543753
==============================================================================
--- maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/build/profile/DefaultProfileAdvisor.java
(original)
+++ maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/build/profile/DefaultProfileAdvisor.java
Sat Jun  2 08:35:57 2007
@@ -19,6 +19,7 @@
  * under the License.
  */
 
+import org.apache.maven.MavenTools;
 import org.apache.maven.artifact.ArtifactUtils;
 import org.apache.maven.artifact.InvalidRepositoryException;
 import org.apache.maven.artifact.repository.ArtifactRepository;
@@ -31,7 +32,6 @@
 import org.apache.maven.profiles.ProfilesConversionUtils;
 import org.apache.maven.profiles.ProfilesRoot;
 import org.apache.maven.profiles.activation.ProfileActivationException;
-import org.apache.maven.project.MavenTools;
 import org.apache.maven.project.ProjectBuildingException;
 import org.apache.maven.project.injection.ProfileInjector;
 import org.codehaus.plexus.PlexusConstants;

Modified: maven/components/trunk/maven-project/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/main/resources/META-INF/plexus/components.xml?view=diff&rev=543753&r1=543752&r2=543753
==============================================================================
--- maven/components/trunk/maven-project/src/main/resources/META-INF/plexus/components.xml
(original)
+++ maven/components/trunk/maven-project/src/main/resources/META-INF/plexus/components.xml
Sat Jun  2 08:35:57 2007
@@ -58,7 +58,7 @@
       <implementation>org.apache.maven.project.build.profile.DefaultProfileAdvisor</implementation>
       <requirements>
         <requirement>
-          <role>org.apache.maven.project.MavenTools</role>
+          <role>org.apache.maven.MavenTools</role>
         </requirement>
         <requirement>
           <role>org.apache.maven.profiles.MavenProfilesBuilder</role>
@@ -85,7 +85,7 @@
           <role>org.apache.maven.artifact.factory.ArtifactFactory</role>
         </requirement>
         <requirement>
-          <role>org.apache.maven.project.MavenTools</role>
+          <role>org.apache.maven.MavenTools</role>
         </requirement>
         <requirement>
           <role>org.apache.maven.artifact.resolver.ArtifactResolver</role>
@@ -188,7 +188,7 @@
           <role>org.apache.maven.artifact.manager.WagonManager</role>
         </requirement>
         <requirement>
-          <role>org.apache.maven.project.MavenTools</role>
+          <role>org.apache.maven.MavenTools</role>
         </requirement>
       </requirements>
     </component>
@@ -351,20 +351,9 @@
       </requirements>
     </component>
 
-    <!-- @deprecated use org.apache.maven.project.MavenTools -->
     <component>
       <role>org.apache.maven.MavenTools</role>
       <implementation>org.apache.maven.DefaultMavenTools</implementation>
-      <requirements>
-        <requirement>
-          <role>org.apache.maven.project.MavenTools</role>
-        </requirement>
-      </requirements>
-    </component>
-
-    <component>
-      <role>org.apache.maven.project.MavenTools</role>
-      <implementation>org.apache.maven.project.DefaultMavenTools</implementation>
       <requirements>
         <requirement>
           <role>org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout</role>

Modified: maven/components/trunk/maven-project/src/test/resources/org/apache/maven/project/ProjectClasspathTest.xml
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/test/resources/org/apache/maven/project/ProjectClasspathTest.xml?view=diff&rev=543753&r1=543752&r2=543753
==============================================================================
--- maven/components/trunk/maven-project/src/test/resources/org/apache/maven/project/ProjectClasspathTest.xml
(original)
+++ maven/components/trunk/maven-project/src/test/resources/org/apache/maven/project/ProjectClasspathTest.xml
Sat Jun  2 08:35:57 2007
@@ -44,7 +44,7 @@
       <implementation>org.apache.maven.project.build.profile.DefaultProfileAdvisor</implementation>
       <requirements>
         <requirement>
-          <role>org.apache.maven.project.MavenTools</role>
+          <role>org.apache.maven.MavenTools</role>
         </requirement>
         <requirement>
           <role>org.apache.maven.profiles.MavenProfilesBuilder</role>
@@ -117,7 +117,7 @@
           <role-hint>default</role-hint>
         </requirement>
         <requirement>
-          <role>org.apache.maven.project.MavenTools</role>
+          <role>org.apache.maven.MavenTools</role>
         </requirement>
       </requirements>
     </component>

Modified: maven/components/trunk/maven-project/src/test/resources/org/apache/maven/project/canonical/CanonicalProjectBuilderTest.xml
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/test/resources/org/apache/maven/project/canonical/CanonicalProjectBuilderTest.xml?view=diff&rev=543753&r1=543752&r2=543753
==============================================================================
--- maven/components/trunk/maven-project/src/test/resources/org/apache/maven/project/canonical/CanonicalProjectBuilderTest.xml
(original)
+++ maven/components/trunk/maven-project/src/test/resources/org/apache/maven/project/canonical/CanonicalProjectBuilderTest.xml
Sat Jun  2 08:35:57 2007
@@ -62,7 +62,7 @@
       <implementation>org.apache.maven.project.build.profile.DefaultProfileAdvisor</implementation>
       <requirements>
         <requirement>
-          <role>org.apache.maven.project.MavenTools</role>
+          <role>org.apache.maven.MavenTools</role>
         </requirement>
         <requirement>
           <role>org.apache.maven.profiles.MavenProfilesBuilder</role>
@@ -111,7 +111,7 @@
           <role>org.apache.maven.artifact.resolver.ArtifactResolver</role>
         </requirement>
         <requirement>
-          <role>org.apache.maven.project.MavenTools</role>
+          <role>org.apache.maven.MavenTools</role>
         </requirement>
         <requirement>
           <role>org.apache.maven.context.BuildContextManager</role>

Modified: maven/components/trunk/maven-settings/pom.xml
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-settings/pom.xml?view=diff&rev=543753&r1=543752&r2=543753
==============================================================================
--- maven/components/trunk/maven-settings/pom.xml (original)
+++ maven/components/trunk/maven-settings/pom.xml Sat Jun  2 08:35:57 2007
@@ -47,16 +47,6 @@
           </execution>
         </executions>
       </plugin>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <configuration>
-          <instructions>
-            <!-- do not export deprecated packages -->
-            <Export-Package>!org.apache.maven,*</Export-Package>
-          </instructions>
-        </configuration>
-      </plugin>
     </plugins>
   </build>
   <dependencies>

Modified: maven/components/trunk/maven-settings/src/main/java/org/apache/maven/SettingsConfigurationException.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-settings/src/main/java/org/apache/maven/SettingsConfigurationException.java?view=diff&rev=543753&r1=543752&r2=543753
==============================================================================
--- maven/components/trunk/maven-settings/src/main/java/org/apache/maven/SettingsConfigurationException.java
(original)
+++ maven/components/trunk/maven-settings/src/main/java/org/apache/maven/SettingsConfigurationException.java
Sat Jun  2 08:35:57 2007
@@ -21,15 +21,17 @@
 
 /**
  * If there was an error in the settings file.
- * 
- * @deprecated use {@link org.apache.maven.settings.SettingsConfigurationException}
  *
  * @author <a href="mailto:brett@apache.org">Brett Porter</a>
  * @version $Id$
  */
 public class SettingsConfigurationException
-    extends org.apache.maven.settings.SettingsConfigurationException
+    extends Exception
 {
+    private int lineNumber;
+
+    private int columnNumber;
+
     public SettingsConfigurationException( String message )
     {
         super( message );
@@ -42,7 +44,21 @@
 
     public SettingsConfigurationException( String message, Throwable cause, int lineNumber,
int columnNumber )
     {
-        super( message, cause, lineNumber, columnNumber );
+        super( message + ( lineNumber > 0 ? "\n  Line:   " + lineNumber : "" ) +
+            ( columnNumber > 0 ? "\n  Column: " + columnNumber : "" ), cause );
+        this.lineNumber = lineNumber;
+        this.columnNumber = columnNumber;
+    }
+
+    public int getColumnNumber()
+    {
+        return columnNumber;
+    }
+
+    public int getLineNumber()
+    {
+        return lineNumber;
     }
+    
 
 }

Modified: maven/components/trunk/pom.xml
URL: http://svn.apache.org/viewvc/maven/components/trunk/pom.xml?view=diff&rev=543753&r1=543752&r2=543753
==============================================================================
--- maven/components/trunk/pom.xml (original)
+++ maven/components/trunk/pom.xml Sat Jun  2 08:35:57 2007
@@ -100,25 +100,21 @@
             </execution>
           </executions>
         </plugin>
-        <plugin>
-          <groupId>org.apache.felix</groupId>
-          <artifactId>maven-bundle-plugin</artifactId>
-          <!-- if plugin not released at maven release time the manifests generated could
be checked in by hand -->
-          <version>0.9.0-incubator-SNAPSHOT</version>
-          <executions>
-            <execution>
-              <goals>
-                <goal>manifest</goal>
-              </goals>
-            </execution>
-          </executions>
-        </plugin>
       </plugins>
     </pluginManagement>
     <plugins>
+      <!-- if plugin not released at maven release time the manifests generated could
be checked in by hand -->
       <plugin>
         <groupId>org.apache.felix</groupId>
         <artifactId>maven-bundle-plugin</artifactId>
+        <version>0.9.0-incubator-SNAPSHOT</version>
+        <executions>
+          <execution>
+            <goals>
+              <goal>manifest</goal>
+            </goals>
+          </execution>
+        </executions>
       </plugin>
       <!-- Needed for including the manifest, see MJAR-71 -->
       <plugin>



Mime
View raw message