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

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

    Description: 
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}



  was:
Adds an includePom option that will result in inclusion of the project's pom 
file into the generates sources jar file.

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();




> Add a 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
>            Reporter: Moritz Havelock
>            Priority: Minor
>
> 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

        

Reply via email to