You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ol...@apache.org on 2013/01/23 23:22:38 UTC

svn commit: r1437781 - in /maven/plugins/trunk/maven-source-plugin/src: it/MSOURCES-64/ it/MSOURCES-64/pom.xml it/MSOURCES-64/verify.groovy main/java/org/apache/maven/plugin/source/AbstractSourceJarMojo.java

Author: olamy
Date: Wed Jan 23 22:22:37 2013
New Revision: 1437781

URL: http://svn.apache.org/viewvc?rev=1437781&view=rev
Log:
[MSOURCES-64] forceCreation=true doesn't create test source package when src/test missing

Added:
    maven/plugins/trunk/maven-source-plugin/src/it/MSOURCES-64/
    maven/plugins/trunk/maven-source-plugin/src/it/MSOURCES-64/pom.xml   (with props)
    maven/plugins/trunk/maven-source-plugin/src/it/MSOURCES-64/verify.groovy   (with props)
Modified:
    maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugin/source/AbstractSourceJarMojo.java

Added: maven/plugins/trunk/maven-source-plugin/src/it/MSOURCES-64/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/it/MSOURCES-64/pom.xml?rev=1437781&view=auto
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/it/MSOURCES-64/pom.xml (added)
+++ maven/plugins/trunk/maven-source-plugin/src/it/MSOURCES-64/pom.xml Wed Jan 23 22:22:37 2013
@@ -0,0 +1,37 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>msources</groupId>
+  <artifactId>64</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>jar</packaging>
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-source-plugin</artifactId>
+          <version>@project.version@</version>
+          <configuration>
+            <forceCreation>true</forceCreation>
+          </configuration>
+          <executions>
+            <execution>
+              <id>attach-test-sources</id>
+              <goals>
+                <goal>test-jar-no-fork</goal>
+              </goals>
+            </execution>
+          </executions>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-source-plugin</artifactId>
+        <version>@project.version@</version>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Propchange: maven/plugins/trunk/maven-source-plugin/src/it/MSOURCES-64/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-source-plugin/src/it/MSOURCES-64/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugins/trunk/maven-source-plugin/src/it/MSOURCES-64/verify.groovy
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/it/MSOURCES-64/verify.groovy?rev=1437781&view=auto
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/it/MSOURCES-64/verify.groovy (added)
+++ maven/plugins/trunk/maven-source-plugin/src/it/MSOURCES-64/verify.groovy Wed Jan 23 22:22:37 2013
@@ -0,0 +1,22 @@
+
+/*
+ * 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.
+ */
+
+assert new File(basedir,"target/64-1.0-SNAPSHOT-test-sources.jar").exists()
+

Propchange: maven/plugins/trunk/maven-source-plugin/src/it/MSOURCES-64/verify.groovy
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-source-plugin/src/it/MSOURCES-64/verify.groovy
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugin/source/AbstractSourceJarMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugin/source/AbstractSourceJarMojo.java?rev=1437781&r1=1437780&r2=1437781&view=diff
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugin/source/AbstractSourceJarMojo.java (original)
+++ maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugin/source/AbstractSourceJarMojo.java Wed Jan 23 22:22:37 2013
@@ -267,7 +267,7 @@ public abstract class AbstractSourceJarM
             archiveProjectContent( subProject, archiver.getArchiver() );
         }
 
-        if ( !archiver.getArchiver().getFiles().isEmpty() )
+        if ( !archiver.getArchiver().getFiles().isEmpty() || forceCreation )
         {
 
             if ( useDefaultManifestFile && defaultManifestFile.exists() && archive.getManifestFile() == null )