svn commit: r743319 - /maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/packaging/WarProjectPackagingTask.java
Author: dennisl Date: Wed Feb 11 13:06:59 2009 New Revision: 743319 URL: http://svn.apache.org/viewvc?rev=743319view=rev Log: [MWAR-183] filteringDeploymentDescriptors should honor the encoding specified in web.xml Modified: maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/packaging/WarProjectPackagingTask.java Modified: maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/packaging/WarProjectPackagingTask.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/packaging/WarProjectPackagingTask.java?rev=743319r1=743318r2=743319view=diff == --- maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/packaging/WarProjectPackagingTask.java (original) +++ maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/packaging/WarProjectPackagingTask.java Wed Feb 11 13:06:59 2009 @@ -31,6 +31,7 @@ import org.apache.maven.shared.filtering.MavenFilteringException; import org.codehaus.plexus.util.DirectoryScanner; import org.codehaus.plexus.util.StringUtils; +import org.codehaus.plexus.util.xml.XmlStreamReader; /** * Handles the project own resources, that is: @@ -220,9 +221,8 @@ } if ( context.isFilteringDeploymentDescriptors() ) { -// TODO: web.xml encoding can be different from UTF-8 context.getMavenFileFilter().copyFile( webXml, new File( webinfDir, web.xml ), true, - context.getFilterWrappers(), UTF-8 ); + context.getFilterWrappers(), getEncoding( webXml ) ); } else { @@ -238,9 +238,8 @@ // if exists we can filter it if ( defaultWebXml.exists() context.isFilteringDeploymentDescriptors() ) { -// TODO: web.xml encoding can be different from UTF-8 context.getMavenFileFilter().copyFile( defaultWebXml, new File( webinfDir, web.xml ), true, - context.getFilterWrappers(), UTF-8 ); + context.getFilterWrappers(), getEncoding( defaultWebXml ) ); context.getWebappStructure().getFullStructure().add( WEB_INF_PATH + /web.xml ); } } @@ -250,9 +249,9 @@ String xmlFileName = containerConfigXML.getName(); if ( context.isFilteringDeploymentDescriptors() ) { -// TODO: XML config file encoding can be different from UTF-8 context.getMavenFileFilter().copyFile( containerConfigXML, new File( metainfDir, xmlFileName ), - true, context.getFilterWrappers(), UTF-8 ); + true, context.getFilterWrappers(), + getEncoding( containerConfigXML ) ); } else { @@ -272,6 +271,19 @@ } } +/** + * Get the encoding from an XML-file. + * + * @param webXml the XML-file + * @return The encoding of the XML-file, or UTF-8 if it's not specified in the file + * @throws IOException if an error occurred while reading the file + */ +private String getEncoding( File webXml ) +throws IOException +{ +XmlStreamReader xmlReader = new XmlStreamReader( webXml ); +return xmlReader.getEncoding(); +} /** * Copies webapp webResources from the specified directory.
svn commit: r743348 - in /maven/plugins/trunk/maven-war-plugin/src: main/java/org/apache/maven/plugin/war/util/WarUtils.java test/java/org/apache/maven/plugin/war/util/WarUtilsTest.java
Author: dennisl Date: Wed Feb 11 14:40:19 2009 New Revision: 743348 URL: http://svn.apache.org/viewvc?rev=743348view=rev Log: [MWAR-160] Strange behaviour of org.apache.maven.plugin.war.util.WarUtils.dependencyEquals(Dependency, Dependency) o Fixed two logical errors and added tests to verify them. Added: maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/util/WarUtilsTest.java (with props) Modified: maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/util/WarUtils.java Modified: maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/util/WarUtils.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/util/WarUtils.java?rev=743348r1=743347r2=743348view=diff == --- maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/util/WarUtils.java (original) +++ maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/util/WarUtils.java Wed Feb 11 14:40:19 2009 @@ -113,7 +113,7 @@ { return false; } -if ( !!StringUtils.equals( first.getArtifactId(), second.getArtifactId() ) ) +if ( !StringUtils.equals( first.getArtifactId(), second.getArtifactId() ) ) { return false; } @@ -127,7 +127,7 @@ { return false; } -if ( !!StringUtils.equals( first.getGroupId(), second.getGroupId() ) ) +if ( !StringUtils.equals( first.getGroupId(), second.getGroupId() ) ) { return false; } Added: maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/util/WarUtilsTest.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/util/WarUtilsTest.java?rev=743348view=auto == --- maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/util/WarUtilsTest.java (added) +++ maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/util/WarUtilsTest.java Wed Feb 11 14:40:19 2009 @@ -0,0 +1,65 @@ +package org.apache.maven.plugin.war.util; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * License); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import junit.framework.TestCase; +import org.apache.maven.model.Dependency; + +/** + * Test the WarUtils. + * + * @author Dennis Lundberg + * @version $Id$ + */ +public class WarUtilsTest +extends TestCase +{ +/** + * Test for MWAR-160. + */ +public void testDependencyEquals() +{ +Dependency firstDependency = new Dependency(); +firstDependency.setGroupId( 1 ); +firstDependency.setArtifactId( a ); +Dependency secondDependency = new Dependency(); +secondDependency.setGroupId( 2 ); +secondDependency.setArtifactId( b ); +Dependency thirdDependency = new Dependency(); +thirdDependency.setGroupId( 1 ); +thirdDependency.setArtifactId( c ); +Dependency fourthDependency = new Dependency(); +fourthDependency.setGroupId( 4 ); +fourthDependency.setArtifactId( a ); + +assertFalse( dependencies 1:a and 2:b should not be equal, WarUtils.dependencyEquals( firstDependency, + secondDependency ) ); +assertFalse( dependencies 1:a and 1:c should not be equal, WarUtils.dependencyEquals( firstDependency, + thirdDependency ) ); +assertFalse( dependencies 1:a and 4:a should not be equal, WarUtils.dependencyEquals( firstDependency, + fourthDependency ) ); +assertFalse( dependencies 2:b and 1:c should not be equal, WarUtils.dependencyEquals( secondDependency, +
svn commit: r743374 - in /maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war: AbstractWarMojo.java packaging/ClassesPackagingTask.java packaging/WarPackagingContext.java
Author: dennisl Date: Wed Feb 11 16:28:01 2009 New Revision: 743374 URL: http://svn.apache.org/viewvc?rev=743374view=rev Log: [MWAR-163] The outputFilenameMapping does not apply to the artifact of the current project Submitted by: Michael McCallum Reviewed by: Dennis Lundberg o Needed to catch an exception, that wasn't handled by the patch o Reformated the code to our style Modified: maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/AbstractWarMojo.java maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/packaging/ClassesPackagingTask.java maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/packaging/WarPackagingContext.java Modified: maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/AbstractWarMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/AbstractWarMojo.java?rev=743374r1=743373r2=743374view=diff == --- maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/AbstractWarMojo.java (original) +++ maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/AbstractWarMojo.java Wed Feb 11 16:28:01 2009 @@ -28,6 +28,7 @@ import java.util.List; import org.apache.maven.archiver.MavenArchiveConfiguration; +import org.apache.maven.artifact.factory.ArtifactFactory; import org.apache.maven.execution.MavenSession; import org.apache.maven.model.Resource; import org.apache.maven.plugin.AbstractMojo; @@ -175,6 +176,13 @@ private boolean useCache = true; /** + * @component role=org.apache.maven.artifact.factory.ArtifactFactory + * @required + * @readonly + */ +private ArtifactFactory artifactFactory; + +/** * To look up Archiver/UnArchiver implementations * * @component role=org.codehaus.plexus.archiver.manager.ArchiverManager @@ -274,22 +282,22 @@ * @since 2.1-alpha-2 */ private boolean filteringDeploymentDescriptors = false; - + /** - * To escape interpolated value with windows path + * To escape interpolated value with windows path * c:\foo\bar will be replaced with c:\\foo\\bar * @parameter expression=${maven.war.escapedBackslashesInFilePath} default-value=false * @since 2.1-alpha-2 - */ + */ private boolean escapedBackslashesInFilePath = false; - + /** - * Expression preceded with the String won't be interpolated + * Expression preceded with the String won't be interpolated * \${foo} will be replaced with ${foo} * @parameter expression=${maven.war.escapeString} * @since 2.1-beta-1 - */ -protected String escapeString; + */ +protected String escapeString; /** * The archive configuration to use. @@ -428,11 +436,11 @@ { MavenResourcesExecution mavenResourcesExecution = new MavenResourcesExecution(); mavenResourcesExecution.setEscapeString( escapeString ); - + defaultFilterWrappers = mavenFileFilter.getDefaultFilterWrappers( project, filters, escapedBackslashesInFilePath, this.session, mavenResourcesExecution ); - + } catch ( MavenFilteringException e ) { @@ -443,7 +451,8 @@ final WarPackagingContext context = new DefaultWarPackagingContext( webappDirectory, cache, overlayManager, defaultFilterWrappers, getNonFilteredFileExtensions(), - filteringDeploymentDescriptors ); + filteringDeploymentDescriptors, + this.artifactFactory); final Iterator it = packagingTasks.iterator(); while ( it.hasNext() ) { @@ -523,6 +532,7 @@ implements WarPackagingContext { +private final ArtifactFactory artifactFactory; private final WebappStructure webappStructure; @@ -538,12 +548,14 @@ public DefaultWarPackagingContext( File webappDirectory, final WebappStructure webappStructure, final OverlayManager overlayManager, List filterWrappers, - List nonFilteredFileExtensions, boolean filteringDeploymentDescriptors ) + List nonFilteredFileExtensions, boolean
svn commit: r743470 - /maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0553SettingsAuthzEncryptionTest.java
Author: ogusakov Date: Wed Feb 11 19:56:34 2009 New Revision: 743470 URL: http://svn.apache.org/viewvc?rev=743470view=rev Log: [MNG-553] security dispatched fixed to pass the relocation test, test enabled Modified: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0553SettingsAuthzEncryptionTest.java Modified: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0553SettingsAuthzEncryptionTest.java URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0553SettingsAuthzEncryptionTest.java?rev=743470r1=743469r2=743470view=diff == --- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0553SettingsAuthzEncryptionTest.java (original) +++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0553SettingsAuthzEncryptionTest.java Wed Feb 11 19:56:34 2009 @@ -66,7 +66,7 @@ * Test that the encrypted auth infos given in the settings.xml are decrypted when the master password resides * in an external file. */ -/* FIXME: Outstanding bugs in plexus-sec-dispatcher prevent this from passing +// FIXME: Outstanding bugs in plexus-sec-dispatcher prevent this from passing public void testitRelocation() throws Exception { @@ -97,6 +97,6 @@ assertEquals( testuser, props.getProperty( test.username ) ); assertEquals( testtest, props.getProperty( test.password ) ); } -//*/ +// }
svn commit: r743475 - /maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0553SettingsAuthzEncryptionTest.java
Author: bentmann Date: Wed Feb 11 20:11:49 2009 New Revision: 743475 URL: http://svn.apache.org/viewvc?rev=743475view=rev Log: o Removed superfluous comment Modified: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0553SettingsAuthzEncryptionTest.java Modified: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0553SettingsAuthzEncryptionTest.java URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0553SettingsAuthzEncryptionTest.java?rev=743475r1=743474r2=743475view=diff == --- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0553SettingsAuthzEncryptionTest.java (original) +++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng0553SettingsAuthzEncryptionTest.java Wed Feb 11 20:11:49 2009 @@ -66,7 +66,6 @@ * Test that the encrypted auth infos given in the settings.xml are decrypted when the master password resides * in an external file. */ -// FIXME: Outstanding bugs in plexus-sec-dispatcher prevent this from passing public void testitRelocation() throws Exception { @@ -97,6 +96,5 @@ assertEquals( testuser, props.getProperty( test.username ) ); assertEquals( testtest, props.getProperty( test.password ) ); } -// }
svn commit: r743489 - /maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InvokerMojo.java
Author: bentmann Date: Wed Feb 11 20:32:28 2009 New Revision: 743489 URL: http://svn.apache.org/viewvc?rev=743489view=rev Log: [MINVOKER-76] Have invoker:run generate report files to allow reporting on the results of running invoker o Added parameter disableReports Modified: maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InvokerMojo.java Modified: maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InvokerMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InvokerMojo.java?rev=743489r1=743488r2=743489view=diff == --- maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InvokerMojo.java (original) +++ maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InvokerMojo.java Wed Feb 11 20:32:28 2009 @@ -140,6 +140,14 @@ private File reportsDirectory; /** + * A flag to disable the generation of build reports. + * + * @parameter expression=${invoker.disableReports} default-value=false + * @since 1.4 + */ +private boolean disableReports; + +/** * Directory to which projects should be cloned prior to execution. If not specified, each integration test will be * run in the directory in which the corresponding IT POM was found. In this case, you most likely want to configure * your SCM to ignore codetarget/code and codebuild.log/code in the test's base directory. @@ -584,8 +592,6 @@ getLog().warn( Filtering of parent/child POMs is not supported without cloning the projects ); } -reportsDirectory.mkdirs(); - List failures = runBuilds( projectsDir, buildJobs ); if ( !suppressSummaries ) @@ -1093,7 +1099,7 @@ } /** - * Writes the XML report for the specified build job. + * Writes the XML report for the specified build job unless report generation has been disabled. * * @param buildJob The build job whose report should be written, must not be codenull/code. * @throws MojoExecutionException If the report could not be written. @@ -1101,6 +1107,16 @@ private void writeBuildReport( BuildJob buildJob ) throws MojoExecutionException { +if ( disableReports ) +{ +return; +} + +if ( !reportsDirectory.exists() ) +{ +reportsDirectory.mkdirs(); +} + String safeFileName = buildJob.getProject().replace( '/', '_' ).replace( '\\', '_' ).replace( ' ', '_' ); if ( safeFileName.endsWith( _pom.xml ) ) {
svn commit: r743577 - /maven/plugins/trunk/maven-ejb-plugin/src/main/java/org/apache/maven/plugin/ejb/EjbMojo.java
Author: dennisl Date: Thu Feb 12 00:01:07 2009 New Revision: 743577 URL: http://svn.apache.org/viewvc?rev=743577view=rev Log: o Restore parameter expressions that were removed in r742375 - we need both default-value and expression. o Add more parameter expressions. Modified: maven/plugins/trunk/maven-ejb-plugin/src/main/java/org/apache/maven/plugin/ejb/EjbMojo.java Modified: maven/plugins/trunk/maven-ejb-plugin/src/main/java/org/apache/maven/plugin/ejb/EjbMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-ejb-plugin/src/main/java/org/apache/maven/plugin/ejb/EjbMojo.java?rev=743577r1=743576r2=743577view=diff == --- maven/plugins/trunk/maven-ejb-plugin/src/main/java/org/apache/maven/plugin/ejb/EjbMojo.java (original) +++ maven/plugins/trunk/maven-ejb-plugin/src/main/java/org/apache/maven/plugin/ejb/EjbMojo.java Thu Feb 12 00:01:07 2009 @@ -68,7 +68,7 @@ /** * Directory that resources are copied to during the build. * - * @parameter default-value=${project.build.outputDirectory} + * @parameter default-value=${project.build.outputDirectory} expression=${outputDirectory} * @required */ private String outputDirectory; @@ -76,7 +76,7 @@ /** * The name of the EJB file to generate. * - * @parameter default-value=${project.build.finalName} + * @parameter default-value=${project.build.finalName} expression=${jarName} * @required */ private String jarName; @@ -85,14 +85,14 @@ * Classifier to add to the artifact generated. If given, the artifact will * be an attachment instead. * - * @parameter + * @parameter expression=${ejb.classifier} */ private String classifier; /** * Whether the EJB client jar should be generated or not. * - * @parameter default-value=false + * @parameter default-value=false expression=${ejb.generateClient} */ private boolean generateClient;
svn commit: r743583 - in /maven/plugin-tools/trunk: maven-plugin-tools-ant/src/main/java/org/apache/maven/tools/plugin/extractor/ant/ maven-plugin-tools-ant/src/test/ maven-plugin-tools-ant/src/test/j
Author: jdcasey Date: Thu Feb 12 01:00:40 2009 New Revision: 743583 URL: http://svn.apache.org/viewvc?rev=743583view=rev Log: Injecting plugin parameters necessary to provide standard classpaths currently available in the antrun plugin, and also plugin-style expression evaluation within the Ant script itself. Added: maven/plugin-tools/trunk/maven-plugin-tools-ant/src/test/ maven/plugin-tools/trunk/maven-plugin-tools-ant/src/test/java/ maven/plugin-tools/trunk/maven-plugin-tools-ant/src/test/java/org/ maven/plugin-tools/trunk/maven-plugin-tools-ant/src/test/java/org/apache/ maven/plugin-tools/trunk/maven-plugin-tools-ant/src/test/java/org/apache/maven/ maven/plugin-tools/trunk/maven-plugin-tools-ant/src/test/java/org/apache/maven/tools/ maven/plugin-tools/trunk/maven-plugin-tools-ant/src/test/java/org/apache/maven/tools/plugin/ maven/plugin-tools/trunk/maven-plugin-tools-ant/src/test/java/org/apache/maven/tools/plugin/extractor/ maven/plugin-tools/trunk/maven-plugin-tools-ant/src/test/java/org/apache/maven/tools/plugin/extractor/ant/ maven/plugin-tools/trunk/maven-plugin-tools-ant/src/test/java/org/apache/maven/tools/plugin/extractor/ant/AntMojoDescriptorExtractorTest.java (with props) maven/plugin-tools/trunk/maven-plugin-tools-ant/src/test/resources/ maven/plugin-tools/trunk/maven-plugin-tools-ant/src/test/resources/basic/ maven/plugin-tools/trunk/maven-plugin-tools-ant/src/test/resources/basic/test.build.xml (with props) maven/plugin-tools/trunk/maven-plugin-tools-ant/src/test/resources/basic/test.mojos.xml (with props) maven/plugin-tools/trunk/maven-plugin-tools-model/src/test/ maven/plugin-tools/trunk/maven-plugin-tools-model/src/test/java/ maven/plugin-tools/trunk/maven-plugin-tools-model/src/test/java/org/ maven/plugin-tools/trunk/maven-plugin-tools-model/src/test/java/org/apache/ maven/plugin-tools/trunk/maven-plugin-tools-model/src/test/java/org/apache/maven/ maven/plugin-tools/trunk/maven-plugin-tools-model/src/test/java/org/apache/maven/plugin/ maven/plugin-tools/trunk/maven-plugin-tools-model/src/test/java/org/apache/maven/plugin/tools/ maven/plugin-tools/trunk/maven-plugin-tools-model/src/test/java/org/apache/maven/plugin/tools/model/ maven/plugin-tools/trunk/maven-plugin-tools-model/src/test/java/org/apache/maven/plugin/tools/model/PluginMetadataParserTest.java (with props) maven/plugin-tools/trunk/maven-plugin-tools-model/src/test/resources/ maven/plugin-tools/trunk/maven-plugin-tools-model/src/test/resources/test.mojos.xml (with props) maven/plugin-tools/trunk/maven-plugin-tools-model/src/test/resources/test2.mojos.xml (with props) Modified: maven/plugin-tools/trunk/maven-plugin-tools-ant/src/main/java/org/apache/maven/tools/plugin/extractor/ant/AntMojoDescriptorExtractor.java maven/plugin-tools/trunk/maven-plugin-tools-model/src/main/java/org/apache/maven/plugin/tools/model/PluginMetadataParser.java Modified: maven/plugin-tools/trunk/maven-plugin-tools-ant/src/main/java/org/apache/maven/tools/plugin/extractor/ant/AntMojoDescriptorExtractor.java URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-tools-ant/src/main/java/org/apache/maven/tools/plugin/extractor/ant/AntMojoDescriptorExtractor.java?rev=743583r1=743582r2=743583view=diff == --- maven/plugin-tools/trunk/maven-plugin-tools-ant/src/main/java/org/apache/maven/tools/plugin/extractor/ant/AntMojoDescriptorExtractor.java (original) +++ maven/plugin-tools/trunk/maven-plugin-tools-ant/src/main/java/org/apache/maven/tools/plugin/extractor/ant/AntMojoDescriptorExtractor.java Thu Feb 12 01:00:40 2009 @@ -25,12 +25,16 @@ import org.apache.maven.plugin.descriptor.PluginDescriptor; import org.apache.maven.plugin.tools.model.PluginMetadataParseException; import org.apache.maven.plugin.tools.model.PluginMetadataParser; +import org.apache.maven.project.MavenProject; +import org.apache.maven.project.path.PathTranslator; import org.apache.maven.tools.plugin.extractor.AbstractScriptedMojoDescriptorExtractor; import org.apache.maven.tools.plugin.extractor.ExtractionException; +import org.codehaus.plexus.component.repository.ComponentRequirement; import org.codehaus.plexus.util.StringUtils; import java.io.File; import java.util.ArrayList; +import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; @@ -44,12 +48,12 @@ public class AntMojoDescriptorExtractor extends AbstractScriptedMojoDescriptorExtractor { -/** Default metada file extension */ +/** Default metadata file extension */ private static final String METADATA_FILE_EXTENSION = .mojos.xml; /** Default Ant build file extension */ private static final String SCRIPT_FILE_EXTENSION = .build.xml; - + /** {...@inheritdoc} */ protected List
svn commit: r743587 - in /maven/components/branches/maven-2.1.x: maven-core/src/main/java/org/apache/maven/plugin/ maven-plugin-descriptor/src/main/java/org/apache/maven/plugin/descriptor/ maven-scrip
Author: jdcasey Date: Thu Feb 12 01:32:50 2009 New Revision: 743587 URL: http://svn.apache.org/viewvc?rev=743587view=rev Log: [MNG-3971] Updating Ant-mojo support to provide the standard Maven classpath refs and plugin-style expression evaluation available in the antrun plugin. This depends on the newest (as-yet unreleased) maven-plugin-tools-ant to enable the new functionality, though it is still backward compatible. Ant-based plugins build using the plugin-tools-ant versions that are older will work, but won't have access to maven.compile.classpath, etc. Added: maven/components/branches/maven-2.1.x/maven-script/maven-script-ant/src/main/java/org/apache/maven/script/ant/AntPropertyHelper.java (with props) maven/components/branches/maven-2.1.x/maven-script/maven-script-ant/src/test/ maven/components/branches/maven-2.1.x/maven-script/maven-script-ant/src/test/java/ maven/components/branches/maven-2.1.x/maven-script/maven-script-ant/src/test/java/org/ maven/components/branches/maven-2.1.x/maven-script/maven-script-ant/src/test/java/org/apache/ maven/components/branches/maven-2.1.x/maven-script/maven-script-ant/src/test/java/org/apache/maven/ maven/components/branches/maven-2.1.x/maven-script/maven-script-ant/src/test/java/org/apache/maven/script/ maven/components/branches/maven-2.1.x/maven-script/maven-script-ant/src/test/java/org/apache/maven/script/ant/ maven/components/branches/maven-2.1.x/maven-script/maven-script-ant/src/test/java/org/apache/maven/script/ant/AntMojoWrapperTest.java (with props) maven/components/branches/maven-2.1.x/maven-script/maven-script-ant/src/test/resources/ maven/components/branches/maven-2.1.x/maven-script/maven-script-ant/src/test/resources/META-INF/ maven/components/branches/maven-2.1.x/maven-script/maven-script-ant/src/test/resources/META-INF/maven/ maven/components/branches/maven-2.1.x/maven-script/maven-script-ant/src/test/resources/META-INF/maven/plugin-2.0.xml (with props) maven/components/branches/maven-2.1.x/maven-script/maven-script-ant/src/test/resources/META-INF/maven/plugin-2.1.xml (with props) maven/components/branches/maven-2.1.x/maven-script/maven-script-ant/src/test/resources/test.build.xml (with props) Modified: maven/components/branches/maven-2.1.x/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java maven/components/branches/maven-2.1.x/maven-plugin-descriptor/src/main/java/org/apache/maven/plugin/descriptor/MojoDescriptor.java maven/components/branches/maven-2.1.x/maven-plugin-descriptor/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java maven/components/branches/maven-2.1.x/maven-script/maven-script-ant/pom.xml maven/components/branches/maven-2.1.x/maven-script/maven-script-ant/src/main/java/org/apache/maven/script/ant/AntMojoWrapper.java Modified: maven/components/branches/maven-2.1.x/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.1.x/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java?rev=743587r1=743586r2=743587view=diff == --- maven/components/branches/maven-2.1.x/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java (original) +++ maven/components/branches/maven-2.1.x/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java Thu Feb 12 01:32:50 2009 @@ -80,14 +80,8 @@ import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.xml.Xpp3Dom; -import org.codehaus.plexus.util.xml.Xpp3DomBuilder; -import org.codehaus.plexus.util.xml.Xpp3DomWriter; -import org.codehaus.plexus.util.xml.pull.XmlPullParserException; import java.io.File; -import java.io.IOException; -import java.io.StringReader; -import java.io.StringWriter; import java.net.URL; import java.util.ArrayList; import java.util.Collection; @@ -338,6 +332,7 @@ // later when the plugin is first invoked. Retrieving this artifact will in turn allow us to // transitively resolve its dependencies, and add them to the plugin container... addedPlugin.setArtifacts( Collections.singletonList( pluginArtifact ) ); +addedPlugin.setPluginArtifact( pluginArtifact ); try { Modified: maven/components/branches/maven-2.1.x/maven-plugin-descriptor/src/main/java/org/apache/maven/plugin/descriptor/MojoDescriptor.java URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.1.x/maven-plugin-descriptor/src/main/java/org/apache/maven/plugin/descriptor/MojoDescriptor.java?rev=743587r1=743586r2=743587view=diff == ---
svn propchange: r743583 - svn:log
Author: jdcasey Revision: 743583 Modified property: svn:log Modified: svn:log at Thu Feb 12 01:33:30 2009 -- --- svn:log (original) +++ svn:log Thu Feb 12 01:33:30 2009 @@ -1 +1 @@ -Injecting plugin parameters necessary to provide standard classpaths currently available in the antrun plugin, and also plugin-style expression evaluation within the Ant script itself. +[MNG-3971] Injecting plugin parameters necessary to provide standard classpaths currently available in the antrun plugin, and also plugin-style expression evaluation within the Ant script itself.
svn commit: r743590 - /maven/mercury/trunk/mercury-ant-tasks/mercury.xml
Author: jvanzyl Date: Thu Feb 12 01:48:09 2009 New Revision: 743590 URL: http://svn.apache.org/viewvc?rev=743590view=rev Log: o a model of how i would like the mercury ant tasks to behave Added: maven/mercury/trunk/mercury-ant-tasks/mercury.xml (with props) Added: maven/mercury/trunk/mercury-ant-tasks/mercury.xml URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-ant-tasks/mercury.xml?rev=743590view=auto == --- maven/mercury/trunk/mercury-ant-tasks/mercury.xml (added) +++ maven/mercury/trunk/mercury-ant-tasks/mercury.xml Thu Feb 12 01:48:09 2009 @@ -0,0 +1,124 @@ +project name=build default=default xmlns:mercury=urn:mercury + + target name=initialize +path id=boot.classpath path=mercury-all-1.0.jar / +typedef resource=org/apache/maven/mercury/ant/antlib.xml uri=urn:mercury classpathref=boot.classpath/ + /target + + !-- + | These are the things the user may want to control, for which we will provide defaults where possible: + | + | a) Remote artifact repositories for retrieval + | 1) Repository layout + | 2) Repository authentication + | 3) Checksum validation + | i) When on allow exclusions so that you don't get blocked by one bad checksum + | 4) PGP key validation + | i) When on allow exclusions so that you don't get blocked by one bad PGP key + | ii) Location of keyring + | b) Local artifact repository for storage + | 1) Repository layout + | c) Classpath for runtime scoped artifacts + | d) Classpath for runtime scoped artifacts + | e) Classpath for test scoped artifacts (yes, i know this is mavenesque) + | f) Classpath for compile scoped artifacts (yes, i know this is mavenesqe) + | g) Fileset for runtime scoped artifacts + | h) Fileset for runtime scoped artifacts + | i) Fileset for test scoped artifacts (yes, i know this is mavenesque) + | j) Fileset for compile scoped artifacts (yes, i know this is mavenesqe) + | k) transitivity + | + | authentication + | keystore + -- + + target name=download + +!-- + | a) Maven Central + | 1) Maven 2.x layout + | 2) none + | 3) warn + | 4) none + | b) ~/.m2/repository + | c) mercury.classpath + | d) mercury.classpath.runtime + | e) mercury.classpath.test + | f) mercury.classpath.compile + | g) mercury.fileset + | h) mercury.fileset.runtime + | i) mercury.fileset.test + | j) mercury.fileset.compile + | + -- + +!-- (1) -- +!-- + | + | This is the most basic use of the tasks where you specify dependencies with their GAV and all the defaults + | are setup for you. + | + -- +mercury:resolve-dependencies + mercury:dependency id=g0:a0:v0/ + mercury:dependency id=g1:a1:v1/ + mercury:dependency id=g2:a2:v2/ +/mercury:resolve-dependencies + +!-- (2) -- +!-- + | + | This is the most basic use of the tasks where you specify dependencies with a POM and all the defaults + | are setup for you. + | + | NOTE: You will notice that the source is of the form processor:resource. So in this case we're going + | to use the Maven dependency processor and a local pom.xml file. + | + -- +mercury:resolve-dependencies source=maven:pom.xml/ + +mercury:resolve-dependencies source=maven:pom.xml transitive=false/ + +mercury:resolve-dependencies source=maven:pom.xml + mercury:local-repository location=${basedir}/lib layout=flat/ + !-- Control checksum and pgp globally for all remote repositories used -- + mercury:remote-repositories checksum-validation=true pgp-key-validation=true +mercury:remote-repository location=http://repository.sonatype.com/groups/public/ +mercury:remote-repository location=http://repository.sonatype.com/groups/bad; checksum-validation=false pgp-validation=false/ + /mercury:remote-repositories +/mercury:resolve-dependencies + +mercury:resolve-dependencies source=maven:pom.xml + mercury:local-repository location=${basedir}/lib layout=flat/ + mercury:remote-repositories checksum-validation=true +!-- The presence of this element says we want this feature turned on, and allow some configuration -- +mercury:pgp-key-validation keyring-location=${basedir}/pgp/project-keyring.gpg/ +mercury:remote-repository location=http://repository.sonatype.com/groups/public; + !-- Here we can have pluggable providers and we can probably just leverage JSecurity -- + mercury:authentication source=basic:username:password/ +/mercury:remote-repository +mercury:remote-repository location=http://repository.sonatype.com/groups/bad; checksum-validation=false pgp-validation=false/ + /mercury:remote-repositories +/mercury:resolve-dependencies + +mercury:resolve-dependencies
svn commit: r743592 - /maven/mercury/trunk/mercury-ant-tasks/pom.xml
Author: ogusakov Date: Thu Feb 12 01:54:41 2009 New Revision: 743592 URL: http://svn.apache.org/viewvc?rev=743592view=rev Log: switched to mercury-1.0-alpha-5 Modified: maven/mercury/trunk/mercury-ant-tasks/pom.xml Modified: maven/mercury/trunk/mercury-ant-tasks/pom.xml URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-ant-tasks/pom.xml?rev=743592r1=743591r2=743592view=diff == --- maven/mercury/trunk/mercury-ant-tasks/pom.xml (original) +++ maven/mercury/trunk/mercury-ant-tasks/pom.xml Thu Feb 12 01:54:41 2009 @@ -24,7 +24,7 @@ parent groupIdorg.apache.maven.mercury/groupId artifactIdmercury/artifactId -version1.0-alpha-5-SNAPSHOT/version +version1.0-alpha-5/version /parent artifactIdmercury-ant-tasks/artifactId
svn commit: r743597 - in /maven/mercury/trunk: mercury-it/pom.xml mercury-util/src/main/java/org/apache/maven/mercury/util/FileUtil.java
Author: ogusakov Date: Thu Feb 12 02:09:34 2009 New Revision: 743597 URL: http://svn.apache.org/viewvc?rev=743597view=rev Log: [MERCURY-69] fixed locale dependency in the utils Modified: maven/mercury/trunk/mercury-it/pom.xml maven/mercury/trunk/mercury-util/src/main/java/org/apache/maven/mercury/util/FileUtil.java Modified: maven/mercury/trunk/mercury-it/pom.xml URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-it/pom.xml?rev=743597r1=743596r2=743597view=diff == --- maven/mercury/trunk/mercury-it/pom.xml (original) +++ maven/mercury/trunk/mercury-it/pom.xml Thu Feb 12 02:09:34 2009 @@ -23,7 +23,7 @@ parent groupIdorg.apache.maven.mercury/groupId artifactIdmercury/artifactId -version1.0-alpha-5-SNAPSHOT/version +version1.0-alpha-6-SNAPSHOT/version /parent artifactIdmercury-it/artifactId Modified: maven/mercury/trunk/mercury-util/src/main/java/org/apache/maven/mercury/util/FileUtil.java URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-util/src/main/java/org/apache/maven/mercury/util/FileUtil.java?rev=743597r1=743596r2=743597view=diff == --- maven/mercury/trunk/mercury-util/src/main/java/org/apache/maven/mercury/util/FileUtil.java (original) +++ maven/mercury/trunk/mercury-util/src/main/java/org/apache/maven/mercury/util/FileUtil.java Thu Feb 12 02:09:34 2009 @@ -87,7 +87,9 @@ public static final intK = 1024; public static final intDEFAULT_BUFFER_SIZE = 10 * K; - public static final String [] URL_PROTOCOLS = new String [] {http://,https://,file://,dav://,davs://,webdav://,webdavs://,dav+http://,dav+https://}; + public static final String PROTOCOL_DELIM = ://; + public static final intPROTOCOL_DELIM_LEN = PROTOCOL_DELIM.length(); + public static final String [] URL_PROTOCOLS = new String [] {http,https,dav,file,davs,webdav,webdavs,dav+http,dav+https}; //--- private static final IMercuryLogger LOG = MercuryLoggerManager.getLogger( FileUtil.class ); private static final Language LANG = new DefaultLanguage( FileUtil.class ); @@ -981,14 +983,24 @@ public static InputStream toStream( String resource ) throws MalformedURLException, IOException { -if( Util.isEmpty( resource ) ) +if( resource == null ) return null; -String lowerRes = resource.toLowerCase(); +int ind = resource.indexOf( PROTOCOL_DELIM ); -for( String p : URL_PROTOCOLS ) -if( lowerRes.startsWith( p ) ) - return new URL(resource).openStream(); +if( ind 1 ) +{ +String protocol = resource.substring( 0, ind ); +resource = resource.substring( ind + PROTOCOL_DELIM_LEN ); + +for( int i=0; iURL_PROTOCOLS.length; i++ ) +{ +String p = URL_PROTOCOLS[i]; + +if( protocol.regionMatches( true, 0, p, 0, p.length() ) ) + return new URL( p+PROTOCOL_DELIM+resource).openStream(); +} +} return new FileInputStream( new File(resource) ); }
svn commit: r743599 - /maven/mercury/trunk/mercury-wagon/src/main/java/org/apache/maven/wagon/mercury/MercuryWagon.java
Author: ogusakov Date: Thu Feb 12 02:15:51 2009 New Revision: 743599 URL: http://svn.apache.org/viewvc?rev=743599view=rev Log: [MERCURY-63] fixed locale dependent string comparison Modified: maven/mercury/trunk/mercury-wagon/src/main/java/org/apache/maven/wagon/mercury/MercuryWagon.java Modified: maven/mercury/trunk/mercury-wagon/src/main/java/org/apache/maven/wagon/mercury/MercuryWagon.java URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-wagon/src/main/java/org/apache/maven/wagon/mercury/MercuryWagon.java?rev=743599r1=743598r2=743599view=diff == --- maven/mercury/trunk/mercury-wagon/src/main/java/org/apache/maven/wagon/mercury/MercuryWagon.java (original) +++ maven/mercury/trunk/mercury-wagon/src/main/java/org/apache/maven/wagon/mercury/MercuryWagon.java Thu Feb 12 02:15:51 2009 @@ -354,9 +354,9 @@ if( pi != null pi.getHost() != null ) { -String proxyType = pi.getType().toLowerCase(); +String proxyType = pi.getType(); -if( !httpProxyType.equals( proxyType ) ) +if( !httpProxyType.equalsIgnoreCase( proxyType ) ) { throw new ConnectionException( Mercury wagon does not support +proxyType+ proxies at this point. Only +httpProxyType+ proxy is supported ); }
svn commit: r743603 - /maven/mercury/trunk/pom.xml
Author: ogusakov Date: Thu Feb 12 02:39:12 2009 New Revision: 743603 URL: http://svn.apache.org/viewvc?rev=743603view=rev Log: switched to maven-3.0-alpha-2 for ITs Modified: maven/mercury/trunk/pom.xml Modified: maven/mercury/trunk/pom.xml URL: http://svn.apache.org/viewvc/maven/mercury/trunk/pom.xml?rev=743603r1=743602r2=743603view=diff == --- maven/mercury/trunk/pom.xml (original) +++ maven/mercury/trunk/pom.xml Thu Feb 12 02:39:12 2009 @@ -94,7 +94,7 @@ ant.version1.7.1/ant.version !-- maven version: non-modules only !! Never use in Mercury modules!! -- -maven.version3.0-SNAPSHOT/maven.version +maven.version3.0-alpha-2/maven.version !-- mercury-wagon -- wagon.provider.api.version1.0-beta-4/wagon.provider.api.version