Author: bentmann
Date: Sat Jul 17 13:20:51 2010
New Revision: 965071

URL: http://svn.apache.org/viewvc?rev=965071&view=rev
Log:
[MREPOSITORY-24] bundle-create mojos emits bogus warning about missing 
sources/javadocs if main artifact is not a jar

Modified:
    maven/plugins/trunk/maven-repository-plugin/pom.xml
    
maven/plugins/trunk/maven-repository-plugin/src/main/java/org/apache/maven/plugins/repository/BundleCreateMojo.java

Modified: maven/plugins/trunk/maven-repository-plugin/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-repository-plugin/pom.xml?rev=965071&r1=965070&r2=965071&view=diff
==============================================================================
--- maven/plugins/trunk/maven-repository-plugin/pom.xml (original)
+++ maven/plugins/trunk/maven-repository-plugin/pom.xml Sat Jul 17 13:20:51 2010
@@ -29,7 +29,7 @@ under the License.
   </parent>
 
   <artifactId>maven-repository-plugin</artifactId>
-  <version>2.4-SNAPSHOT</version>
+  <version>2.3.1-SNAPSHOT</version>
   <packaging>maven-plugin</packaging>
 
   <name>Maven Repository Plugin</name>
@@ -75,6 +75,7 @@ under the License.
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-artifact-manager</artifactId>
       <version>2.0.6</version>
+      <scope>test</scope>
     </dependency>
     <dependency>
       <groupId>org.apache.maven</groupId>
@@ -100,6 +101,7 @@ under the License.
       <groupId>org.apache.maven.shared</groupId>
       <artifactId>maven-plugin-testing-harness</artifactId>
       <version>1.0-beta-1</version>
+      <scope>test</scope>
     </dependency>
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
@@ -169,23 +171,23 @@ under the License.
                     <goal>test</goal>
                   </goals>
                   <configuration>
-                   <includes>
-                     <include>**/*IT.java</include>
-                   </includes>
+                    <includes>
+                      <include>**/*IT.java</include>
+                    </includes>
                     <systemProperties>
                       <property>
                         <name>maven.repo.local</name>
                         <value>${project.build.directory}/it-repo</value>
                       </property>
                     </systemProperties>
-                 </configuration>
-               </execution>
-             </executions>
-               </plugin>
-             </plugins>
-           </pluginManagement>
-           
-           <plugins>
+                  </configuration>
+                </execution>
+              </executions>
+            </plugin>
+          </plugins>
+        </pluginManagement>
+        
+        <plugins>
           <plugin>
             <artifactId>maven-invoker-plugin</artifactId>
             <version>1.4</version>
@@ -225,7 +227,7 @@ under the License.
               </execution>
             </executions>
           </plugin>
-           </plugins>
+        </plugins>
       </build>
     </profile>
   </profiles>

Modified: 
maven/plugins/trunk/maven-repository-plugin/src/main/java/org/apache/maven/plugins/repository/BundleCreateMojo.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-repository-plugin/src/main/java/org/apache/maven/plugins/repository/BundleCreateMojo.java?rev=965071&r1=965070&r2=965071&view=diff
==============================================================================
--- 
maven/plugins/trunk/maven-repository-plugin/src/main/java/org/apache/maven/plugins/repository/BundleCreateMojo.java
 (original)
+++ 
maven/plugins/trunk/maven-repository-plugin/src/main/java/org/apache/maven/plugins/repository/BundleCreateMojo.java
 Sat Jul 17 13:20:51 2010
@@ -19,7 +19,6 @@ package org.apache.maven.plugins.reposit
  * under the License.
  */
 
-import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.project.MavenProject;
@@ -78,11 +77,6 @@ public class BundleCreateMojo
     /**
      * @component
      */
-    private ArtifactHandlerManager artifactHandlerManager;
-
-    /**
-     * @component
-     */
     protected InputHandler inputHandler;
     
     /**
@@ -172,8 +166,6 @@ public class BundleCreateMojo
         boolean batchMode = settings == null ? false : 
!settings.isInteractiveMode();
         List<File> files = BundleUtils.selectProjectFiles( new File( 
outputDirectory ), inputHandler, finalName, pom, getLog(), batchMode );
 
-        String extension = artifactHandlerManager.getArtifactHandler( 
project.getPackaging() ).getExtension();
-
         File bundle = new File( outputDirectory, finalName + "-bundle.jar" );
 
         try
@@ -186,11 +178,11 @@ public class BundleCreateMojo
             
             for ( File f : files )
             {
-                if ( artifactChecks && f.getName().endsWith( finalName + 
"-sources." + extension ) )
+                if ( artifactChecks && f.getName().endsWith( finalName + 
"-sources.jar" ) )
                 {
                     sourcesFound = true;
                 }
-                else if ( artifactChecks && f.getName().equals( finalName + 
"-javadoc." + extension ) )
+                else if ( artifactChecks && f.getName().equals( finalName + 
"-javadoc.jar" ) )
                 {
                     javadocsFound = true;
                 }


Reply via email to