You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Dennis Lundberg (JIRA)" <ji...@codehaus.org> on 2009/02/24 22:57:19 UTC

[jira] Updated: (MSOURCES-39) Add an includePom option to the sources:jar goal

     [ http://jira.codehaus.org/browse/MSOURCES-39?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dennis Lundberg updated MSOURCES-39:
------------------------------------

             Assignee: Dennis Lundberg
    Affects Version/s: 2.0.4
        Fix Version/s: 2.1
              Summary: Add an includePom option to the sources:jar goal  (was: Add a includePom option to the sources:jar goal)

> Add an includePom option to the sources:jar goal
> ------------------------------------------------
>
>                 Key: MSOURCES-39
>                 URL: http://jira.codehaus.org/browse/MSOURCES-39
>             Project: Maven 2.x Source Plugin
>          Issue Type: Improvement
>    Affects Versions: 2.0.4
>            Reporter: Moritz Havelock
>            Assignee: Dennis Lundberg
>            Priority: Minor
>             Fix For: 2.1
>
>
> Adds an includePom option that will result in inclusion of the project's pom file into the generates sources jar file.
> {noformat}
> Index:
> src/main/java/org/apache/maven/plugin/source/AbstractSourceJarMojo.java
> ===================================================================
> --- src/main/java/org/apache/maven/plugin/source/AbstractSourceJarMojo.java
> (revision 691652)
> +++ src/main/java/org/apache/maven/plugin/source/AbstractSourceJarMojo.j
> +++ ava
> (working copy)
> @@ -69,6 +69,14 @@
>       * @since 2.0.4
>       */
>      protected boolean excludeResources;
> +    
> +    /**
> +     * Specifies whether or not to include the pom file in the sources-jar.
> +     * 
> +     * @parameter expression="${includePom}" default-value="false"
> +     * @since 2.0.5
> +     */
> +    protected boolean includePom;
>  
>      /**
>       * Used for attaching the source jar to the project.
> @@ -186,6 +194,15 @@
>      protected void archiveProjectContent( MavenProject project, Archiver archiver )
>          throws MojoExecutionException
>      {
> +    	
> +    	if (includePom) {
> +	    	try {
> +				archiver.addFile(project.getFile(),
> project.getFile().getName());
> +			} catch (ArchiverException e) {
> +				throw new MojoExecutionException("Error
> adding pom file to target jar file.", e);
> +			}
> +    	}
> +    	
>          for ( Iterator i = getSources( project ).iterator(); i.hasNext(); )
>          {
>              String s = (String) i.next();
> {noformat}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira