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 2008/07/10 13:19:54 UTC
svn commit: r675513 - in /maven/ant-tasks/trunk: pom.xml
src/main/java/org/apache/maven/artifact/ant/AbstractArtifactTask.java
Author: jvanzyl
Date: Thu Jul 10 04:19:54 2008
New Revision: 675513
URL: http://svn.apache.org/viewvc?rev=675513&view=rev
Log:
o first pass at updating the trunk ant task to using 2.1
Modified:
maven/ant-tasks/trunk/pom.xml
maven/ant-tasks/trunk/src/main/java/org/apache/maven/artifact/ant/AbstractArtifactTask.java
Modified: maven/ant-tasks/trunk/pom.xml
URL: http://svn.apache.org/viewvc/maven/ant-tasks/trunk/pom.xml?rev=675513&r1=675512&r2=675513&view=diff
==============================================================================
--- maven/ant-tasks/trunk/pom.xml (original)
+++ maven/ant-tasks/trunk/pom.xml Thu Jul 10 04:19:54 2008
@@ -1,26 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one
- ~ or more contributor license agreements. See the NOTICE file
- ~ distributed with this work for additional information
- ~ regarding copyright ownership. The ASF licenses this file
- ~ to you under the Apache License, Version 2.0 (the
- ~ "License"); you may not use this file except in compliance
- ~ with the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing,
- ~ software distributed under the License is distributed on an
- ~ "AS IS" BASIS, WITHOUT 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.
+ -->
<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">
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>maven-parent</artifactId>
<groupId>org.apache.maven</groupId>
@@ -30,18 +24,15 @@
<artifactId>maven-ant-tasks</artifactId>
<version>2.1-SNAPSHOT</version>
<name>Maven Ant Task</name>
-
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/maven/ant-tasks/trunk</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/ant-tasks/trunk</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/maven/ant-tasks/trunk</url>
</scm>
-
<issueManagement>
<system>jira</system>
<url>http://jira.codehaus.org/browse/MANTTASKS</url>
</issueManagement>
-
<build>
<pluginManagement>
<plugins>
@@ -113,7 +104,8 @@
<createDependencyReducedPom>false</createDependencyReducedPom>
<keepDependenciesWithProvidedScope>true</keepDependenciesWithProvidedScope>
<transformers>
- <transformer implementation="org.apache.maven.plugins.shade.resource.ComponentsXmlResourceTransformer" />
+ <transformer
+ implementation="org.apache.maven.plugins.shade.resource.ComponentsXmlResourceTransformer" />
</transformers>
<artifactSet>
<excludes>
@@ -123,15 +115,6 @@
<exclude>ant:ant</exclude>
</excludes>
</artifactSet>
- <relocations>
- <relocation>
- <pattern>org.codehaus.plexus.util</pattern>
- <excludes>
- <exclude>org.codehaus.plexus.util.xml.Xpp3Dom</exclude>
- <exclude>org.codehaus.plexus.util.xml.pull.*</exclude>
- </excludes>
- </relocation>
- </relocations>
</configuration>
</execution>
</executions>
@@ -149,17 +132,6 @@
<groupId>org.apache.maven</groupId>
<artifactId>maven-project</artifactId>
<version>${mavenVersion}</version>
- <exclusions>
- <exclusion>
- <artifactId>junit</artifactId>
- <groupId>junit</groupId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-error-diagnostics</artifactId>
- <version>${mavenVersion}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
@@ -184,25 +156,14 @@
<version>1.6.2</version>
</dependency>
<dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-artifact-manager</artifactId>
- <version>${mavenVersion}</version>
- <exclusions>
- <exclusion>
- <artifactId>junit</artifactId>
- <groupId>junit</groupId>
- </exclusion>
- </exclusions>
+ <groupId>org.apache.maven.artifact</groupId>
+ <artifactId>maven-artifact</artifactId>
+ <version>3.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
- <version>1.5.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-artifact</artifactId>
- <version>${mavenVersion}</version>
+ <version>1.5.6-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
@@ -212,10 +173,9 @@
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-container-default</artifactId>
- <version>1.0-alpha-9-stable-1</version>
+ <version>1.0-alpha-48</version>
</dependency>
</dependencies>
-
<profiles>
<profile>
<id>reporting</id>
@@ -232,9 +192,8 @@
</reporting>
</profile>
</profiles>
-
<properties>
- <mavenVersion>2.0.9</mavenVersion>
+ <mavenVersion>2.1-SNAPSHOT</mavenVersion>
<wagonVersion>1.0-beta-2</wagonVersion>
</properties>
</project>
Modified: maven/ant-tasks/trunk/src/main/java/org/apache/maven/artifact/ant/AbstractArtifactTask.java
URL: http://svn.apache.org/viewvc/maven/ant-tasks/trunk/src/main/java/org/apache/maven/artifact/ant/AbstractArtifactTask.java?rev=675513&r1=675512&r2=675513&view=diff
==============================================================================
--- maven/ant-tasks/trunk/src/main/java/org/apache/maven/artifact/ant/AbstractArtifactTask.java (original)
+++ maven/ant-tasks/trunk/src/main/java/org/apache/maven/artifact/ant/AbstractArtifactTask.java Thu Jul 10 04:19:54 2008
@@ -39,19 +39,20 @@
import org.apache.maven.settings.SettingsUtils;
import org.apache.maven.settings.TrackableBase;
import org.apache.maven.settings.io.xpp3.SettingsXpp3Reader;
-import org.apache.maven.usability.diagnostics.ErrorDiagnostics;
import org.apache.maven.wagon.Wagon;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.taskdefs.Execute;
-import org.codehaus.classworlds.ClassWorld;
-import org.codehaus.classworlds.DuplicateRealmException;
+import org.codehaus.plexus.ContainerConfiguration;
+import org.codehaus.plexus.DefaultContainerConfiguration;
+import org.codehaus.plexus.DefaultPlexusContainer;
import org.codehaus.plexus.PlexusContainer;
import org.codehaus.plexus.PlexusContainerException;
+import org.codehaus.plexus.classworlds.ClassWorld;
+import org.codehaus.plexus.classworlds.realm.DuplicateRealmException;
import org.codehaus.plexus.component.repository.exception.ComponentLifecycleException;
import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
-import org.codehaus.plexus.embed.Embedder;
import org.codehaus.plexus.util.IOUtil;
import org.codehaus.plexus.util.ReaderFactory;
import org.codehaus.plexus.util.StringUtils;
@@ -280,7 +281,7 @@
settings.setLocalRepository( location );
}
- profileManager = new DefaultProfileManager( getContainer(), getSettings(), System.getProperties() );
+ profileManager = new DefaultProfileManager( getContainer(), null );
WagonManager wagonManager = (WagonManager) lookup( WagonManager.ROLE );
wagonManager.setDownloadMonitor( new AntDownloadMonitor() );
@@ -376,7 +377,7 @@
RuntimeInfo rtInfo = new RuntimeInfo( settings );
- rtInfo.setFile( settingsFile );
+ //rtInfo.setFile( settingsFile );
settings.setRuntimeInfo( rtInfo );
}
@@ -485,14 +486,10 @@
try
{
ClassWorld classWorld = new ClassWorld();
-
classWorld.newRealm( "plexus.core", getClass().getClassLoader() );
-
- Embedder embedder = new Embedder();
-
- embedder.start( classWorld );
-
- container = embedder.getContainer();
+ ContainerConfiguration configuration = new DefaultContainerConfiguration();
+ configuration.setClassWorld( classWorld );
+ container = new DefaultPlexusContainer( configuration );
}
catch ( PlexusContainerException e )
{
@@ -542,7 +539,7 @@
MavenProject mavenProject;
try
{
- mavenProject = projectBuilder.buildStandaloneSuperProject( localArtifactRepository, getProfileManager() );
+ mavenProject = projectBuilder.buildStandaloneSuperProject();
}
catch ( ProjectBuildingException e )
{
@@ -587,29 +584,6 @@
return StringUtils.join( getSupportedProtocols(), ", " );
}
- public void diagnoseError( Throwable error )
- {
- try
- {
- ErrorDiagnostics diagnostics = (ErrorDiagnostics) container.lookup( ErrorDiagnostics.ROLE );
-
- StringBuffer message = new StringBuffer();
-
- message.append( "An error has occurred while processing the Maven artifact tasks.\n" );
- message.append( " Diagnosis:\n\n" );
-
- message.append( diagnostics.diagnose( error ) );
-
- message.append( "\n\n" );
-
- log( message.toString(), Project.MSG_INFO );
- }
- catch ( ComponentLookupException e )
- {
- log( "Failed to retrieve error diagnoser.", Project.MSG_DEBUG );
- }
- }
-
public void addPom( Pom pom )
{
this.pom = pom;
@@ -673,8 +647,8 @@
}
catch ( BuildException e )
{
- diagnoseError( e );
-
+ e.printStackTrace();
+
throw e;
}
finally