svn commit: r415930 - in /maven/plugins/trunk/maven-war-plugin/src/test: java/org/apache/maven/plugin/war/WarExplodedMojoTest.java java/org/apache/maven/plugin/war/stub/JarArtifactStub.java resources/
Author: brett Date: Wed Jun 21 00:08:27 2006 New Revision: 415930 URL: http://svn.apache.org/viewvc?rev=415930&view=rev Log: add missing test Added: maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/stub/JarArtifactStub.java (with props) maven/plugins/trunk/maven-war-plugin/src/test/resources/unit/sample_wars/simple.jar Modified: maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/WarExplodedMojoTest.java Modified: maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/WarExplodedMojoTest.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/WarExplodedMojoTest.java?rev=415930&r1=415929&r2=415930&view=diff == --- maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/WarExplodedMojoTest.java (original) +++ maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/WarExplodedMojoTest.java Wed Jun 21 00:08:27 2006 @@ -16,9 +16,12 @@ * limitations under the License. */ +import org.apache.maven.artifact.handler.ArtifactHandler; +import org.apache.maven.plugin.testing.stubs.ArtifactStub; import org.apache.maven.plugin.war.stub.EJBArtifactStub; import org.apache.maven.plugin.war.stub.EJBClientArtifactStub; import org.apache.maven.plugin.war.stub.IncludeExcludeWarArtifactStub; +import org.apache.maven.plugin.war.stub.JarArtifactStub; import org.apache.maven.plugin.war.stub.MavenProjectArtifactsStub; import org.apache.maven.plugin.war.stub.MavenProjectBasicStub; import org.apache.maven.plugin.war.stub.PARArtifactStub; @@ -236,6 +239,37 @@ assertTrue( "source files not found: " + expectedWebSourceFile.toString(), expectedWebSourceFile.exists() ); assertTrue( "source files not found: " + expectedWebSource2File.toString(), expectedWebSource2File.exists() ); assertTrue( "ejb artifact not found: " + expectedEJBArtifact.toString(), expectedEJBArtifact.exists() ); +} + +public void testExplodedWarWithJar() +throws Exception +{ +// setup test data +String testId = "ExplodedWarWithJar"; +MavenProjectArtifactsStub project = new MavenProjectArtifactsStub(); +File webAppDirectory = new File( getTestDirectory(), testId ); +File webAppSource = createWebAppSource( testId ); +File classesDir = createClassesDir( testId, true ); +ArtifactHandler artifactHandler = (ArtifactHandler) lookup( ArtifactHandler.ROLE, "jar" ); +ArtifactStub jarArtifact = new JarArtifactStub( getBasedir(), artifactHandler ); +File jarFile = jarArtifact.getFile(); + +assertTrue( "jar not found: " + jarFile.toString(), jarFile.exists() ); + +// configure mojo +project.addArtifact( jarArtifact ); +this.configureMojo( mojo, new LinkedList(), classesDir, webAppSource, webAppDirectory, project ); +mojo.execute(); + +// validate operation +File expectedWebSourceFile = new File( webAppDirectory, "pansit.jsp" ); +File expectedWebSource2File = new File( webAppDirectory, "org/web/app/last-exile.jsp" ); +// final name form is -. +File expectedJarArtifact = new File( webAppDirectory, "WEB-INF/lib/jarartifact-0.0-Test.jar" ); + +assertTrue( "source files not found: " + expectedWebSourceFile.toString(), expectedWebSourceFile.exists() ); +assertTrue( "source files not found: " + expectedWebSource2File.toString(), expectedWebSource2File.exists() ); +assertTrue( "jar artifact not found: " + expectedJarArtifact.toString(), expectedJarArtifact.exists() ); } /** Added: maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/stub/JarArtifactStub.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/stub/JarArtifactStub.java?rev=415930&view=auto == --- maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/stub/JarArtifactStub.java (added) +++ maven/plugins/trunk/maven-war-plugin/src/test/java/org/apache/maven/plugin/war/stub/JarArtifactStub.java Wed Jun 21 00:08:27 2006 @@ -0,0 +1,72 @@ +package org.apache.maven.plugin.war.stub; + +/* + * Copyright 2001-2006 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. + *
svn commit: r415934 - in /maven/sandbox/plugins/maven-docck-plugin/src/main/java/org/apache/maven/plugin/docck: AbstractCheckDocumentationMojo.java CheckPluginDocumentationMojo.java
Author: epunzalan Date: Wed Jun 21 00:20:29 2006 New Revision: 415934 URL: http://svn.apache.org/viewvc?rev=415934&view=rev Log: PR: MNG-2397 - implemented check for usage.html and faq.html links inside site.xml - removed plugin specific documentation rules from the abstract class Modified: maven/sandbox/plugins/maven-docck-plugin/src/main/java/org/apache/maven/plugin/docck/AbstractCheckDocumentationMojo.java maven/sandbox/plugins/maven-docck-plugin/src/main/java/org/apache/maven/plugin/docck/CheckPluginDocumentationMojo.java Modified: maven/sandbox/plugins/maven-docck-plugin/src/main/java/org/apache/maven/plugin/docck/AbstractCheckDocumentationMojo.java URL: http://svn.apache.org/viewvc/maven/sandbox/plugins/maven-docck-plugin/src/main/java/org/apache/maven/plugin/docck/AbstractCheckDocumentationMojo.java?rev=415934&r1=415933&r2=415934&view=diff == --- maven/sandbox/plugins/maven-docck-plugin/src/main/java/org/apache/maven/plugin/docck/AbstractCheckDocumentationMojo.java (original) +++ maven/sandbox/plugins/maven-docck-plugin/src/main/java/org/apache/maven/plugin/docck/AbstractCheckDocumentationMojo.java Wed Jun 21 00:20:29 2006 @@ -74,7 +74,7 @@ * @parameter expression="${siteDirectory}" default-value="src/site" * @todo should be determined programmatically */ -private File siteDirectory; +protected File siteDirectory; /** * Sets whether this plugin is running in offline or online mode. Also useful when you don't want @@ -114,24 +114,25 @@ { MavenProject project = (MavenProject) it.next(); -if ( !approveProjectPackaging( project.getPackaging() ) ) +if ( approveProjectPackaging( project.getPackaging() ) ) { -getLog().info( "Skipping non-plugin project: " + project.getName() ); -continue; -} +getLog().info( "Checking project: " + project.getName() ); -getLog().info( "Checking project: " + project.getName() ); +DocumentationReporter reporter = new DocumentationReporter(); -DocumentationReporter reporter = new DocumentationReporter(); +checkProject( project, reporter ); -checkProject( project, reporter ); +if ( !hasErrors && reporter.hasErrors() ) +{ +hasErrors = true; +} -if ( !hasErrors && reporter.hasErrors() ) +errors.put( project, reporter ); +} +else { -hasErrors = true; +getLog().info( "Skipping unsupported project: " + project.getName() ); } - -errors.put( project, reporter ); } String messages; @@ -235,8 +236,6 @@ { checkPomRequirements( project, reporter ); -checkProjectSite( project, reporter ); - checkPackagingSpecificDocumentation( project, reporter ); } @@ -346,44 +345,6 @@ //todo plugin report } -private void checkProjectSite( MavenProject project, DocumentationReporter reporter ) -{ -// check for site.xml -File siteXml = new File( siteDirectory, "site.xml" ); - -if ( !siteXml.exists() ) -{ -reporter.error( "site.xml is missing." ); -} - -/* disabled bec site:site generates a duplicate file error -// check for index.(xml|apt|html) -if ( !findFiles( siteDirectory, "index" ) ) -{ -errors.add( "Missing site index.(html|xml|apt)." ); -} -*/ - -// check for usage.(xml|apt|html) -if ( !findFiles( siteDirectory, "usage" ) ) -{ -reporter.error( "Missing base usage.(html|xml|apt)." ); -} - -// check for **/examples/**.(xml|apt|html) -if ( !findFiles( siteDirectory, "**/examples/*" ) && !findFiles( siteDirectory, "**/example*" ) ) -{ -reporter.error( "Missing examples." ); -} - -if ( !findFiles( siteDirectory, "faq" ) ) -{ -reporter.error( "Missing base FAQ.(fml|html|xml|apt)." ); -} - -//todo Project Site Descriptor for usage, faq, examples -} - private void checkProjectLicenses( MavenProject project, DocumentationReporter reporter ) { List licenses = project.getLicenses(); @@ -501,7 +462,7 @@ protected abstract void checkPackagingSpecificDocumentation( MavenProject project, DocumentationReporter reporter ); -private boolean findFiles( File siteDirectory, String pattern ) +protected boolean findFiles( File siteDirectory, String pattern ) { FileSet fs = new FileSet(); fs.setDirectory( siteDirectory.getAbsolutePath() ); Modified: maven/sandbox/plugins/maven-docck-plugin/src/main/java/org/apache/maven
svn commit: r415935 - in /maven/sandbox/plugins/maven-docck-plugin/src/main/java/org/apache/maven/plugin/docck: AbstractCheckDocumentationMojo.java CheckPluginDocumentationMojo.java
Author: epunzalan Date: Wed Jun 21 00:23:01 2006 New Revision: 415935 URL: http://svn.apache.org/viewvc?rev=415935&view=rev Log: removed implemented todos Modified: maven/sandbox/plugins/maven-docck-plugin/src/main/java/org/apache/maven/plugin/docck/AbstractCheckDocumentationMojo.java maven/sandbox/plugins/maven-docck-plugin/src/main/java/org/apache/maven/plugin/docck/CheckPluginDocumentationMojo.java Modified: maven/sandbox/plugins/maven-docck-plugin/src/main/java/org/apache/maven/plugin/docck/AbstractCheckDocumentationMojo.java URL: http://svn.apache.org/viewvc/maven/sandbox/plugins/maven-docck-plugin/src/main/java/org/apache/maven/plugin/docck/AbstractCheckDocumentationMojo.java?rev=415935&r1=415934&r2=415935&view=diff == --- maven/sandbox/plugins/maven-docck-plugin/src/main/java/org/apache/maven/plugin/docck/AbstractCheckDocumentationMojo.java (original) +++ maven/sandbox/plugins/maven-docck-plugin/src/main/java/org/apache/maven/plugin/docck/AbstractCheckDocumentationMojo.java Wed Jun 21 00:23:01 2006 @@ -341,8 +341,6 @@ checkURL( org.getUrl(), org.getName() + " site", reporter ); } } - -//todo plugin report } private void checkProjectLicenses( MavenProject project, DocumentationReporter reporter ) Modified: maven/sandbox/plugins/maven-docck-plugin/src/main/java/org/apache/maven/plugin/docck/CheckPluginDocumentationMojo.java URL: http://svn.apache.org/viewvc/maven/sandbox/plugins/maven-docck-plugin/src/main/java/org/apache/maven/plugin/docck/CheckPluginDocumentationMojo.java?rev=415935&r1=415934&r2=415935&view=diff == --- maven/sandbox/plugins/maven-docck-plugin/src/main/java/org/apache/maven/plugin/docck/CheckPluginDocumentationMojo.java (original) +++ maven/sandbox/plugins/maven-docck-plugin/src/main/java/org/apache/maven/plugin/docck/CheckPluginDocumentationMojo.java Wed Jun 21 00:23:01 2006 @@ -183,8 +183,6 @@ { reporter.error( "Missing base FAQ.(fml|html|xml|apt)." ); } - -//todo Project Site Descriptor for usage, faq, examples } /**
svn commit: r415959 - in /maven/plugins/trunk/maven-deploy-plugin/src: main/java/org/apache/maven/plugin/deploy/ site/ site/apt/ site/apt/examples/ site/apt/examples/deployfile/
Author: aramirez Date: Wed Jun 21 03:55:31 2006 New Revision: 415959 URL: http://svn.apache.org/viewvc?rev=415959&view=rev Log: PR: MDEPLOY-35 added documentation Added: maven/plugins/trunk/maven-deploy-plugin/src/site/apt/examples/ maven/plugins/trunk/maven-deploy-plugin/src/site/apt/examples/deployfile/ maven/plugins/trunk/maven-deploy-plugin/src/site/apt/examples/deployfile/deploying-in-legacy-layout.apt maven/plugins/trunk/maven-deploy-plugin/src/site/apt/examples/deployfile/deploying-with-classifiers.apt maven/plugins/trunk/maven-deploy-plugin/src/site/apt/examples/deployfile/deploying-with-customed-pom.apt maven/plugins/trunk/maven-deploy-plugin/src/site/apt/examples/deployfile/disabling-generic-pom.apt maven/plugins/trunk/maven-deploy-plugin/src/site/apt/examples/deployfile/disabling-timestamps-suffix.apt maven/plugins/trunk/maven-deploy-plugin/src/site/apt/faq.apt maven/plugins/trunk/maven-deploy-plugin/src/site/apt/overview.apt - copied, changed from r415248, maven/plugins/trunk/maven-deploy-plugin/src/site/apt/introduction.apt maven/plugins/trunk/maven-deploy-plugin/src/site/apt/usage.apt Removed: maven/plugins/trunk/maven-deploy-plugin/src/site/apt/howto.apt maven/plugins/trunk/maven-deploy-plugin/src/site/apt/introduction.apt Modified: maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java maven/plugins/trunk/maven-deploy-plugin/src/site/site.xml Modified: maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java?rev=415959&r1=415958&r2=415959&view=diff == --- maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java (original) +++ maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployFileMojo.java Wed Jun 21 03:55:31 2006 @@ -112,6 +112,8 @@ private String repositoryLayout; /** + * Map that contains the layouts + * * @component role="org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout" */ private Map repositoryLayouts; @@ -126,11 +128,15 @@ private String url; /** + * Component used to create an artifact + * * @component */ private ArtifactFactory artifactFactory; /** + * Component used to create a repository + * * @component */ private ArtifactRepositoryFactory repositoryFactory; Modified: maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java?rev=415959&r1=415958&r2=415959&view=diff == --- maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java (original) +++ maven/plugins/trunk/maven-deploy-plugin/src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java Wed Jun 21 03:55:31 2006 @@ -75,6 +75,8 @@ private List attachedArtifacts; /** + * Parameter used to update the metadata to make the artifact as release. + * * @parameter expression="${updateReleaseInfo}" default-value="false" */ private boolean updateReleaseInfo; Added: maven/plugins/trunk/maven-deploy-plugin/src/site/apt/examples/deployfile/deploying-in-legacy-layout.apt URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-deploy-plugin/src/site/apt/examples/deployfile/deploying-in-legacy-layout.apt?rev=415959&view=auto == --- maven/plugins/trunk/maven-deploy-plugin/src/site/apt/examples/deployfile/deploying-in-legacy-layout.apt (added) +++ maven/plugins/trunk/maven-deploy-plugin/src/site/apt/examples/deployfile/deploying-in-legacy-layout.apt Wed Jun 21 03:55:31 2006 @@ -0,0 +1,49 @@ + -- + Maven 2 Deploy Plugin - Examples on using the parameters of the plugin + -- + Allan Ramirez + -- + June 2006 + -- + +Deploying the artifact in a legacy layout of repository + + "Legacy" is the layout used in maven 1 repositories while maven 2 uses "default". They are different + in terms of directory structure, timestamp of snapshots in default and existence of metadata files in default. + + * legacy layout directory structure: + ++---+ + groupId + | + +--artifactId + | + +--jars +| ++--artifact ++---+ + + * default layout directory structure: + ++---+ + groupId + | + +--a
svn commit: r415998 - in /maven/site/trunk/src/site/resources: checkstyle.xml maven_checks.xml
Author: carlos Date: Wed Jun 21 07:43:17 2006 New Revision: 415998 URL: http://svn.apache.org/viewvc?rev=415998&view=rev Log: Removed checkstyle files, will use them from svn Removed: maven/site/trunk/src/site/resources/checkstyle.xml maven/site/trunk/src/site/resources/maven_checks.xml
svn commit: r416001 - in /maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle: CheckstyleReport.java CheckstyleReportGenerator.java CheckstyleViolationCheckMoj
Author: carlos Date: Wed Jun 21 07:55:19 2006 New Revision: 416001 URL: http://svn.apache.org/viewvc?rev=416001&view=rev Log: Checkstyle and PMD refactorings Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReport.java maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReportGenerator.java maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleViolationCheckMojo.java maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/VelocityTemplate.java Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReport.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReport.java?rev=416001&r1=416000&r2=416001&view=diff == --- maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReport.java (original) +++ maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReport.java Wed Jun 21 07:55:19 2006 @@ -551,8 +551,8 @@ { String copyright; int currentYear = Calendar.getInstance().get( Calendar.YEAR ); -if ( StringUtils.isNotEmpty( project.getInceptionYear() ) && -!String.valueOf( currentYear ).equals( project.getInceptionYear() ) ) +if ( StringUtils.isNotEmpty( project.getInceptionYear() ) +&& !String.valueOf( currentYear ).equals( project.getInceptionYear() ) ) { copyright = project.getInceptionYear() + " - " + currentYear; } @@ -688,14 +688,14 @@ throw new MavenReportException( e.getMessage(), e ); } -List URLs = new ArrayList( classPathStrings.size() ); +List urls = new ArrayList( classPathStrings.size() ); Iterator iter = classPathStrings.iterator(); while ( iter.hasNext() ) { try { -URLs.add( new File( ( (String) iter.next() ) ).toURL() ); +urls.add( new File( ( (String) iter.next() ) ).toURL() ); } catch ( MalformedURLException e ) { @@ -703,7 +703,7 @@ } } -URLClassLoader projectClassLoader = new URLClassLoader( (URL[]) URLs.toArray( new URL[URLs.size()] ), null ); +URLClassLoader projectClassLoader = new URLClassLoader( (URL[]) urls.toArray( new URL[urls.size()] ), null ); checker.setClassloader( projectClassLoader ); if ( moduleFactory != null ) Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReportGenerator.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReportGenerator.java?rev=416001&r1=416000&r2=416001&view=diff == --- maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReportGenerator.java (original) +++ maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReportGenerator.java Wed Jun 21 07:55:19 2006 @@ -34,8 +34,6 @@ public class CheckstyleReportGenerator { -private static final String EOL = System.getProperty( "line.separator" ); - private Log log; private ResourceBundle bundle; @@ -615,12 +613,9 @@ AuditEvent event = (AuditEvent) events.next(); SeverityLevel level = event.getSeverityLevel(); -if ( getSeverityLevel() != null ) +if ( ( getSeverityLevel() != null ) && !getSeverityLevel().equals( level ) ) { -if ( !getSeverityLevel().equals( level ) ) -{ -continue; -} +continue; } sink.tableRow(); Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleViolationCheckMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleViolationCheckMojo.java?rev=416001&r1=416000&r2=416001&view=diff == --- maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleViolationCheckMojo.java (original) +++ maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleViolationCheckMojo.java Wed Jun 21 07:55:19 2006 @@ -14,7 +14,6
svn commit: r416056 - /maven/plugins/trunk/maven-checkstyle-plugin/src/site/apt/customize.apt
Author: carlos Date: Wed Jun 21 11:16:42 2006 New Revision: 416056 URL: http://svn.apache.org/viewvc?rev=416056&view=rev Log: Use shorter lines to improve reading Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/site/apt/customize.apt Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/site/apt/customize.apt URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/site/apt/customize.apt?rev=416056&r1=416055&r2=416056&view=diff == --- maven/plugins/trunk/maven-checkstyle-plugin/src/site/apt/customize.apt (original) +++ maven/plugins/trunk/maven-checkstyle-plugin/src/site/apt/customize.apt Wed Jun 21 11:16:42 2006 @@ -6,7 +6,8 @@ * Use a custom Checkstyle checker configuration. - A custom {{{http://checkstyle.sourceforge.net/config.html#Checker}Checker configuration xml file}} can be defined and then referenced via a URL, File, or build classpath resource reference. + A custom {{{http://checkstyle.sourceforge.net/config.html#Checker}Checker configuration xml file}} can + be defined and then referenced via a URL, File, or build classpath resource reference. To reference the a custom Checkstyle Checker configuration, use the <> parameter. @@ -28,9 +29,12 @@ --- - This example causes the Maven 2 Checkstyle plugin to check for a File named <> or a resource named <> within the compile scope of the dependencies or build extensions classpath. + This example causes the Maven 2 Checkstyle plugin to check for a File named <> or a + resource named <> within the compile scope of the dependencies or build extensions + classpath. - There are 4 predefined Checkstyle configuration definitions that ship with the Maven 2 Checkstyle Plugin, the Sun Microsystems Definition is selected by default. + There are 4 predefined Checkstyle configuration definitions that ship with the Maven 2 Checkstyle Plugin, + the Sun Microsystems Definition is selected by default. * <> - Sun Microsystems Definition (default). @@ -44,11 +48,15 @@ * Use custom Checkstyle property expansion definitions. - A custom {{{http://checkstyle.sourceforge.net/config.html#Properties}property expansion definitions}} for the Checker can be defined. + A custom {{{http://checkstyle.sourceforge.net/config.html#Properties}property expansion definitions}} + for the Checker can be defined. - Checkstyle uses the property expansion mechanism to allow injection of specific values into a pre-defined Checker configuration. Using property expansion alone is an insufficient means to customize the checks performed by Checkstyle. + Checkstyle uses the property expansion mechanism to allow injection of specific values into a pre-defined + Checker configuration. Using property expansion alone is an insufficient means to customize the checks + performed by Checkstyle. - Example: <> - only checks the package name in use to ensure that it conforms to the desired scheme, but allows for users of this Checker to specify their own projectname. + Example: <> - only checks the package name in use to ensure that it conforms to the + desired scheme, but allows for users of this Checker to specify their own projectname. --- @@ -67,7 +75,8 @@ --- - Example: <> - Specifies the <> property expansion that Checkstyle will use when encountering such a variable in the above Checker configuration. + Example: <> - Specifies the <> property expansion that Checkstyle will use when + encountering such a variable in the above Checker configuration. --- @@ -90,11 +99,14 @@ --- - The property expansion information can also come from a location using the <> parameter, which can point to a URL, File, or build classpath resource reference. + The property expansion information can also come from a location using the <> + parameter, which can point to a URL, File, or build classpath resource reference. * Using a Suppressions filter. - Checkstyle allows the definition of a list of files and their line ranges that should be suppressed from reporting any violations (known as a {{{http://checkstyle.sourceforge.net/config.html#Filters}supressions filter}} ). + Checkstyle allows the definition of a list of files and their line ranges that should be suppressed + from reporting any violations (known as a + {{{http://checkstyle.sourceforge.net/config.html#Filters}supressions filter}} ). Example: <> @@ -140,9 +152,13 @@ For the really adventurous, custom Checkstyle checks can be used with the Maven 2 Checkstyle Plugin. - The plugin provides the ability to define the {{{http://checkstyle.sourceforge.net/config.html#Packages}package names definition}} required to reference your custom check modules. - - TIP: Create a maven project that produces a jar file of your custom c
svn commit: r416104 - in /maven/plugins/trunk/maven-assembly-plugin: pom.xml src/main/java/org/apache/maven/plugin/assembly/AbstractAssemblyMojo.java
Author: jdcasey Date: Wed Jun 21 13:44:23 2006 New Revision: 416104 URL: http://svn.apache.org/viewvc?rev=416104&view=rev Log: [MASSEMBLY-120] Added implementation of filtering for inside of in the assembly descriptor. Correct usage is same as for dependencySet includes/excludes. Also, altered the pom.xml to use maven-archiver 2.0.4, to enable development to continue prior to the release of Maven 2.1. It seemed to build fine with tests, despite a comment to the contrary in the pom. Modified: maven/plugins/trunk/maven-assembly-plugin/pom.xml maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/AbstractAssemblyMojo.java Modified: maven/plugins/trunk/maven-assembly-plugin/pom.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/pom.xml?rev=416104&r1=416103&r2=416104&view=diff == --- maven/plugins/trunk/maven-assembly-plugin/pom.xml (original) +++ maven/plugins/trunk/maven-assembly-plugin/pom.xml Wed Jun 21 13:44:23 2006 @@ -17,9 +17,11 @@ org.codehaus.modello modello-maven-plugin +1.0-alpha-8 descriptor +generate-sources xpp3-reader xpp3-writer @@ -33,6 +35,7 @@ component +generate-sources xpp3-reader java @@ -102,7 +105,8 @@ org.apache.maven maven-archiver - 2.1-SNAPSHOT + 2.0.4 + Modified: maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/AbstractAssemblyMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/AbstractAssemblyMojo.java?rev=416104&r1=416103&r2=416104&view=diff == --- maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/AbstractAssemblyMojo.java (original) +++ maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/AbstractAssemblyMojo.java Wed Jun 21 13:44:23 2006 @@ -457,15 +457,15 @@ { ModuleSet moduleSet = (ModuleSet) i.next(); -AndArtifactFilter filter = new AndArtifactFilter(); +AndArtifactFilter moduleFilter = new AndArtifactFilter(); if ( !moduleSet.getIncludes().isEmpty() ) { -filter.add( new AssemblyIncludesArtifactFilter( moduleSet.getIncludes() ) ); +moduleFilter.add( new AssemblyIncludesArtifactFilter( moduleSet.getIncludes() ) ); } if ( !moduleSet.getExcludes().isEmpty() ) { -filter.add( new AssemblyExcludesArtifactFilter( moduleSet.getExcludes() ) ); +moduleFilter.add( new AssemblyExcludesArtifactFilter( moduleSet.getExcludes() ) ); } Set set = getModulesFromReactor( getExecutedProject() ); @@ -476,7 +476,7 @@ { MavenProject moduleProject = (MavenProject) j.next(); -if ( filter.include( moduleProject.getArtifact() ) ) +if ( moduleFilter.include( moduleProject.getArtifact() ) ) { String name = moduleProject.getBuild().getFinalName(); @@ -513,9 +513,9 @@ if ( binaries != null ) { -Artifact artifact = moduleProject.getArtifact(); +Artifact moduleArtifact = moduleProject.getArtifact(); -if ( artifact.getFile() == null ) +if ( moduleArtifact.getFile() == null ) { throw new MojoExecutionException( "Included module: " + moduleProject.getId() + " does not have an artifact with a file. Please ensure the package phase is run before the assembly is generated." ); @@ -532,6 +532,32 @@ Integer.toString( archiver.getDefaultDirectoryMode(), 8 ) + " file perms: " + Integer.toString( archiver.getDefaultFileMode(), 8 ) ); +Set binaryDependencies = moduleProject.getArtifacts(); + +List includes = binaries.getIncludes(); +List excludes = binaries.getExcludes(); + +AndArtifactFilter binaryDepsFilter = new AndArtifactFilter(); + +if ( !includes.isEmpty() ) +{ +binaryDepsFilter.add( new AssemblyIncludesArtifactFilter( includes ) ); +} +if ( !excl
svn commit: r416108 - /maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/AbstractAssemblyMojo.java
Author: jdcasey Date: Wed Jun 21 14:01:12 2006 New Revision: 416108 URL: http://svn.apache.org/viewvc?rev=416108&view=rev Log: Fixing concurrent modification exception. Modified: maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/AbstractAssemblyMojo.java Modified: maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/AbstractAssemblyMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/AbstractAssemblyMojo.java?rev=416108&r1=416107&r2=416108&view=diff == --- maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/AbstractAssemblyMojo.java (original) +++ maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/AbstractAssemblyMojo.java Wed Jun 21 14:01:12 2006 @@ -548,13 +548,13 @@ binaryDepsFilter.add( new AssemblyExcludesArtifactFilter( excludes ) ); } -for ( Iterator it = binaryDependencies.iterator(); it.hasNext(); ) +for ( Iterator binaryDepIterator = binaryDependencies.iterator(); binaryDepIterator.hasNext(); ) { -Artifact binaryDepArtifact = (Artifact) it.next(); +Artifact binaryDepArtifact = (Artifact) binaryDepIterator.next(); if ( !binaryDepsFilter.include( binaryDepArtifact ) ) { -binaryDependencies.remove( binaryDepArtifact ); +binaryDepIterator.remove(); } }
svn commit: r416117 - in /maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly: AbstractAssemblyMojo.java filter/AssemblyExcludesArtifactFilter.java filter/Assembly
Author: jdcasey Date: Wed Jun 21 14:33:05 2006 New Revision: 416117 URL: http://svn.apache.org/viewvc?rev=416117&view=rev Log: Adding transitive artifact filtering for the section of a moduleSet, in the includes/excludes. Modified: maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/AbstractAssemblyMojo.java maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/filter/AssemblyExcludesArtifactFilter.java maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/filter/AssemblyIncludesArtifactFilter.java Modified: maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/AbstractAssemblyMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/AbstractAssemblyMojo.java?rev=416117&r1=416116&r2=416117&view=diff == --- maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/AbstractAssemblyMojo.java (original) +++ maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/AbstractAssemblyMojo.java Wed Jun 21 14:33:05 2006 @@ -22,6 +22,7 @@ import org.apache.maven.artifact.DependencyResolutionRequiredException; import org.apache.maven.artifact.handler.ArtifactHandler; import org.apache.maven.artifact.resolver.filter.AndArtifactFilter; +import org.apache.maven.artifact.resolver.filter.ArtifactFilter; import org.apache.maven.model.Build; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; @@ -78,6 +79,7 @@ import java.io.Reader; import java.io.Writer; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; @@ -468,201 +470,176 @@ moduleFilter.add( new AssemblyExcludesArtifactFilter( moduleSet.getExcludes() ) ); } -Set set = getModulesFromReactor( getExecutedProject() ); +Set allModuleProjects = getModulesFromReactor( getExecutedProject() ); + +Set moduleProjects = new HashSet( allModuleProjects ); + +filterProjects( moduleProjects, moduleSet.getIncludes(), moduleSet.getExcludes(), false ); List moduleFileSets = new ArrayList(); -for ( Iterator j = set.iterator(); j.hasNext(); ) +for ( Iterator j = moduleProjects.iterator(); j.hasNext(); ) { MavenProject moduleProject = (MavenProject) j.next(); -if ( moduleFilter.include( moduleProject.getArtifact() ) ) -{ -String name = moduleProject.getBuild().getFinalName(); - -ModuleSources sources = moduleSet.getSources(); +String name = moduleProject.getBuild().getFinalName(); -if ( sources != null ) -{ -String output = sources.getOutputDirectory(); -output = getOutputDirectory( output, moduleProject, includeBaseDirectory ); +ModuleSources sources = moduleSet.getSources(); -FileSet moduleFileSet = new FileSet(); +if ( sources != null ) +{ +String output = sources.getOutputDirectory(); +output = getOutputDirectory( output, moduleProject, includeBaseDirectory ); -moduleFileSet.setDirectory( moduleProject.getBasedir().getAbsolutePath() ); -moduleFileSet.setOutputDirectory( output ); +FileSet moduleFileSet = new FileSet(); -List excludesList = new ArrayList(); -excludesList.add( PathUtils.toRelative( moduleProject.getBasedir(), - moduleProject.getBuild().getDirectory() ) + "/**" ); -excludesList.add( PathUtils.toRelative( moduleProject.getBasedir(), - moduleProject.getBuild().getOutputDirectory() ) + -"/**" ); -excludesList.add( PathUtils.toRelative( moduleProject.getBasedir(), - moduleProject.getBuild().getTestOutputDirectory() ) + -"/**" ); -excludesList.add( PathUtils.toRelative( moduleProject.getBasedir(), - moduleProject.getReporting().getOutputDirectory() ) + -"/**" ); -moduleFileSet.setExcludes( excludesList ); +moduleFileSe
svn commit: r416126 - /maven/maven-1/core/trunk/plugin-profile.xml
Author: ltheussl Date: Wed Jun 21 15:06:14 2006 New Revision: 416126 URL: http://svn.apache.org/viewvc?rev=416126&view=rev Log: Update with latest releases: dist, eclipse, war, xdoc Modified: maven/maven-1/core/trunk/plugin-profile.xml Modified: maven/maven-1/core/trunk/plugin-profile.xml URL: http://svn.apache.org/viewvc/maven/maven-1/core/trunk/plugin-profile.xml?rev=416126&r1=416125&r2=416126&view=diff == --- maven/maven-1/core/trunk/plugin-profile.xml (original) +++ maven/maven-1/core/trunk/plugin-profile.xml Wed Jun 21 15:06:14 2006 @@ -29,11 +29,11 @@ - + - + @@ -105,8 +105,8 @@ - + - +
svn commit: r416173 - in /maven/plugins/trunk/maven-checkstyle-plugin/src/main/resources/config: maven-header.txt maven_checks.xml
Author: carlos Date: Wed Jun 21 16:36:46 2006 New Revision: 416173 URL: http://svn.apache.org/viewvc?rev=416173&view=rev Log: Externalize and improve the header checkings Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/main/resources/config/maven-header.txt maven/plugins/trunk/maven-checkstyle-plugin/src/main/resources/config/maven_checks.xml Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/main/resources/config/maven-header.txt URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/main/resources/config/maven-header.txt?rev=416173&r1=416172&r2=416173&view=diff == --- maven/plugins/trunk/maven-checkstyle-plugin/src/main/resources/config/maven-header.txt (original) +++ maven/plugins/trunk/maven-checkstyle-plugin/src/main/resources/config/maven-header.txt Wed Jun 21 16:36:46 2006 @@ -1,18 +1,18 @@ ^package ^$ ^/\*$ -^ \* Copyright \d\d\d\d-\d\d\d\d The Apache Software Foundation.$ +^ \* Copyright (\d\d\d\d-)?\d\d\d\d The Apache Software Foundation.$ ^ \*$ -^ \* Licensed under the Apache License, Version 2.0 (the "License");$ +^ \* 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. -^ \*/ +^ \* 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.$ +^ \*/$ ^$ Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/main/resources/config/maven_checks.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/main/resources/config/maven_checks.xml?rev=416173&r1=416172&r2=416173&view=diff == --- maven/plugins/trunk/maven-checkstyle-plugin/src/main/resources/config/maven_checks.xml (original) +++ maven/plugins/trunk/maven-checkstyle-plugin/src/main/resources/config/maven_checks.xml Wed Jun 21 16:36:46 2006 @@ -18,8 +18,8 @@ --> http://www.puppycrawl.com/dtds/configuration_1_1.dtd";> +"-//Puppy Crawl//DTD Check Configuration 1.2//EN" +"http://www.puppycrawl.com/dtds/configuration_1_2.dtd";> -http://www.apache.org/licenses/LICENSE-2.0$\n^ \*$\n^ \* Unless required by applicable law or agreed to in writing, software$\n^ \* distributed under the License is distributed on an "AS IS" BASIS,$\n^ \* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.$\n^ \* See the License for the specific language governing permissions and$\n^ \* limitations under the License.$\n^ \*/$\n^$"/> +
svn commit: r416176 - /maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReport.java
Author: carlos Date: Wed Jun 21 16:45:12 2006 New Revision: 416176 URL: http://svn.apache.org/viewvc?rev=416176&view=rev Log: Improve headerLocation javadoc Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReport.java Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReport.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReport.java?rev=416176&r1=416175&r2=416176&view=diff == --- maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReport.java (original) +++ maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleReport.java Wed Jun 21 16:45:12 2006 @@ -231,9 +231,19 @@ private String propertyExpansion; /** - * Specifies the location of the License file (a.k.a. the header file) - * that is used by Checkstyle to verify that source code has the - * correct copyright. + * Specifies the location of the License file (a.k.a. the header file) + * that can be used by Checkstyle to verify that source code has the + * correct copyright. + * You need to use ${checkstyle.header.file} in your checkstyle xml configuration + * to reference the name of this header file. + * For instance: + * + * + *+ * + * + * * * @parameter expression="${checkstyle.header.file}" default-value="LICENSE.txt" * @since 2.0-beta-2+ *
svn commit: r416184 - /maven/pom/maven/pom.xml
Author: carlos Date: Wed Jun 21 17:27:49 2006 New Revision: 416184 URL: http://svn.apache.org/viewvc?rev=416184&view=rev Log: Added checkstyle configuration and pmd check for duplications Modified: maven/pom/maven/pom.xml Modified: maven/pom/maven/pom.xml URL: http://svn.apache.org/viewvc/maven/pom/maven/pom.xml?rev=416184&r1=416183&r2=416184&view=diff == --- maven/pom/maven/pom.xml (original) +++ maven/pom/maven/pom.xml Wed Jun 21 17:27:49 2006 @@ -27,7 +27,7 @@ org.apache.maven maven-parent - 2 + 3-SNAPSHOT pom Apache Maven @@ -215,6 +215,22 @@ + + + +org.apache.maven.plugins +maven-pmd-plugin + + + + cpd-check + + + + + + + @@ -224,6 +240,10 @@ org.apache.maven.plugins maven-checkstyle-plugin + + http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-checkstyle-plugin/src/main/resources/config/maven_checks.xml + http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-checkstyle-plugin/src/main/resources/config/maven-header.txt + org.apache.maven.plugins
svn commit: r416226 - /maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/filter/AssemblyIncludesArtifactFilter.java
Author: jdcasey Date: Wed Jun 21 19:46:22 2006 New Revision: 416226 URL: http://svn.apache.org/viewvc?rev=416226&view=rev Log: Fixing transitive dependency in/exclusions in filter so they don't require a full artifact id for a match. Modified: maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/filter/AssemblyIncludesArtifactFilter.java Modified: maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/filter/AssemblyIncludesArtifactFilter.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/filter/AssemblyIncludesArtifactFilter.java?rev=416226&r1=416225&r2=416226&view=diff == --- maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/filter/AssemblyIncludesArtifactFilter.java (original) +++ maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/filter/AssemblyIncludesArtifactFilter.java Wed Jun 21 19:46:22 2006 @@ -18,8 +18,8 @@ import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.resolver.filter.ArtifactFilter; +import org.codehaus.plexus.util.StringUtils; -import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; import java.util.List; @@ -72,10 +72,18 @@ List depTrail = artifact.getDependencyTrail(); if ( depTrail != null && !depTrail.isEmpty() ) { -depTrail = new ArrayList( depTrail ); -depTrail.retainAll( patterns ); +String trailStr = StringUtils.join( depTrail.iterator(), "," ); -matched = !depTrail.isEmpty(); +for ( Iterator it = patterns.iterator(); it.hasNext(); ) +{ +String pattern = (String) it.next(); + +if ( trailStr.indexOf( pattern ) > -1 ) +{ +matched = true; +break; +} +} } }