lanking520 closed pull request #11681: [MXNET-531] improvement of adding 
source.jar to assembly
URL: https://github.com/apache/incubator-mxnet/pull/11681
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/scala-package/assembly/linux-x86_64-cpu/pom.xml 
b/scala-package/assembly/linux-x86_64-cpu/pom.xml
index 45e69ee706e..ce66fb4a43b 100644
--- a/scala-package/assembly/linux-x86_64-cpu/pom.xml
+++ b/scala-package/assembly/linux-x86_64-cpu/pom.xml
@@ -46,6 +46,7 @@
         <artifactId>maven-assembly-plugin</artifactId>
         <executions>
           <execution>
+            <id>binary-jar</id>
             <phase>package</phase>
             <goals>
               <goal>single</goal>
@@ -57,6 +58,34 @@
               </descriptors>
             </configuration>
           </execution>
+          <execution>
+            <id>sources-jar</id>
+            <phase>package</phase>
+            <goals>
+              <goal>single</goal>
+            </goals>
+            <configuration>
+              <finalName>${artifactId}-${version}-sources</finalName>
+              <appendAssemblyId>false</appendAssemblyId>
+              <descriptors>
+                
<descriptor>${project.parent.basedir}/src/source.xml</descriptor>
+              </descriptors>
+            </configuration>
+          </execution>
+          <execution>
+            <id>javadoc-jar</id>
+            <phase>package</phase>
+            <goals>
+              <goal>single</goal>
+            </goals>
+            <configuration>
+              <finalName>${artifactId}-${version}-javadoc</finalName>
+              <appendAssemblyId>false</appendAssemblyId>
+              <descriptors>
+                
<descriptor>${project.parent.basedir}/src/javadoc.xml</descriptor>
+              </descriptors>
+            </configuration>
+          </execution>
         </executions>
       </plugin>
     </plugins>
diff --git a/scala-package/assembly/linux-x86_64-gpu/pom.xml 
b/scala-package/assembly/linux-x86_64-gpu/pom.xml
index aca4db0a548..577575a646c 100644
--- a/scala-package/assembly/linux-x86_64-gpu/pom.xml
+++ b/scala-package/assembly/linux-x86_64-gpu/pom.xml
@@ -46,6 +46,7 @@
         <artifactId>maven-assembly-plugin</artifactId>
         <executions>
           <execution>
+            <id>binary-jar</id>
             <phase>package</phase>
             <goals>
               <goal>single</goal>
@@ -57,6 +58,34 @@
               </descriptors>
             </configuration>
           </execution>
+          <execution>
+            <id>sources-jar</id>
+            <phase>package</phase>
+            <goals>
+              <goal>single</goal>
+            </goals>
+            <configuration>
+              <finalName>${artifactId}-${version}-sources</finalName>
+              <appendAssemblyId>false</appendAssemblyId>
+              <descriptors>
+                
<descriptor>${project.parent.basedir}/src/source.xml</descriptor>
+              </descriptors>
+            </configuration>
+          </execution>
+          <execution>
+            <id>javadoc-jar</id>
+            <phase>package</phase>
+            <goals>
+              <goal>single</goal>
+            </goals>
+            <configuration>
+              <finalName>${artifactId}-${version}-javadoc</finalName>
+              <appendAssemblyId>false</appendAssemblyId>
+              <descriptors>
+                
<descriptor>${project.parent.basedir}/src/javadoc.xml</descriptor>
+              </descriptors>
+            </configuration>
+          </execution>
         </executions>
       </plugin>
     </plugins>
diff --git a/scala-package/assembly/osx-x86_64-cpu/pom.xml 
b/scala-package/assembly/osx-x86_64-cpu/pom.xml
index c8c21eba7b3..eb536611abe 100644
--- a/scala-package/assembly/osx-x86_64-cpu/pom.xml
+++ b/scala-package/assembly/osx-x86_64-cpu/pom.xml
@@ -35,6 +35,7 @@
         <artifactId>maven-assembly-plugin</artifactId>
         <executions>
           <execution>
+            <id>binary-jar</id>
             <phase>package</phase>
             <goals>
               <goal>single</goal>
@@ -46,6 +47,34 @@
               </descriptors>
             </configuration>
           </execution>
+          <execution>
+            <id>sources-jar</id>
+            <phase>package</phase>
+            <goals>
+              <goal>single</goal>
+            </goals>
+            <configuration>
+              <finalName>${artifactId}-${version}-sources</finalName>
+              <appendAssemblyId>false</appendAssemblyId>
+              <descriptors>
+                
<descriptor>${project.parent.basedir}/src/source.xml</descriptor>
+              </descriptors>
+            </configuration>
+          </execution>
+          <execution>
+            <id>javadoc-jar</id>
+            <phase>package</phase>
+            <goals>
+              <goal>single</goal>
+            </goals>
+            <configuration>
+              <finalName>${artifactId}-${version}-javadoc</finalName>
+              <appendAssemblyId>false</appendAssemblyId>
+              <descriptors>
+                
<descriptor>${project.parent.basedir}/src/javadoc.xml</descriptor>
+              </descriptors>
+            </configuration>
+          </execution>
         </executions>
       </plugin>
     </plugins>
diff --git a/scala-package/assembly/src/javadoc.xml 
b/scala-package/assembly/src/javadoc.xml
new file mode 100644
index 00000000000..9d0be80e769
--- /dev/null
+++ b/scala-package/assembly/src/javadoc.xml
@@ -0,0 +1,24 @@
+<assembly>
+    <id>bundle</id>
+    <formats>
+        <format>jar</format>
+    </formats>
+    <includeBaseDirectory>false</includeBaseDirectory>
+
+    <moduleSets>
+        <moduleSet>
+            <!-- Collect javadoc -->
+            <includes>
+                <!--Please put your module defs here-->
+                
<include>org.apache.mxnet:mxnet-core_${scala.binary.version}</include>
+            </includes>
+            <useAllReactorProjects>true</useAllReactorProjects>
+            <binaries>
+                <includeDependencies>false</includeDependencies>
+                <attachmentClassifier>javadoc</attachmentClassifier>
+                <outputDirectory>/</outputDirectory>
+                <unpack>true</unpack>
+            </binaries>
+        </moduleSet>
+    </moduleSets>
+</assembly>
\ No newline at end of file
diff --git a/scala-package/assembly/src/source.xml 
b/scala-package/assembly/src/source.xml
new file mode 100644
index 00000000000..0cbdcadf8d8
--- /dev/null
+++ b/scala-package/assembly/src/source.xml
@@ -0,0 +1,32 @@
+<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0";
+          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+          xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 
http://maven.apache.org/xsd/assembly-2.0.0.xsd";>
+  <id>src</id>
+  <!--This is the source jar generation config-->
+  <formats>
+    <format>jar</format>
+  </formats>
+  <includeBaseDirectory>false</includeBaseDirectory>
+  <moduleSets>
+    <moduleSet>
+      <useAllReactorProjects>true</useAllReactorProjects>
+      <includes>
+        <!--Please put your module defs here-->
+        <include>org.apache.mxnet:mxnet-core_${scala.binary.version}</include>
+      </includes>
+      <sources>
+        <includeModuleDirectory>false</includeModuleDirectory>
+        <fileSets>
+          <fileSet>
+            <!--This helps clean the directory from src/main/scala/org/ -> 
org/-->
+            <directory>src/main/scala</directory>
+            <includes>
+              <include>**\/*.scala</include>
+            </includes>
+            <outputDirectory>/</outputDirectory>
+          </fileSet>
+        </fileSets>
+      </sources>
+    </moduleSet>
+  </moduleSets>
+</assembly>
\ No newline at end of file
diff --git a/scala-package/core/pom.xml b/scala-package/core/pom.xml
index 631b6bd3810..79da63b7c98 100644
--- a/scala-package/core/pom.xml
+++ b/scala-package/core/pom.xml
@@ -82,23 +82,6 @@
         <groupId>org.scalastyle</groupId>
         <artifactId>scalastyle-maven-plugin</artifactId>
       </plugin>
-      <plugin>
-        <groupId>net.alchim31.maven</groupId>
-        <artifactId>scala-maven-plugin</artifactId>
-        <version>3.3.2</version>
-        <configuration>
-          <skip>${skiptest}</skip>
-        </configuration>
-        <executions>
-          <execution>
-            <phase>package</phase>
-            <id>attach-javadocs</id>
-            <goals>
-              <goal>doc-jar</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
     </plugins>
   </build>
   <dependencies>
diff --git a/scala-package/examples/pom.xml b/scala-package/examples/pom.xml
index 0d751323a93..9a98f74e4e2 100644
--- a/scala-package/examples/pom.xml
+++ b/scala-package/examples/pom.xml
@@ -55,13 +55,6 @@
               <skipSource>true</skipSource>
             </configuration>
           </plugin>
-          <plugin>
-            <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-javadoc-plugin</artifactId>
-            <configuration>
-              <skip>true</skip>
-            </configuration>
-          </plugin>
           <plugin>
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-gpg-plugin</artifactId>
diff --git a/scala-package/infer/pom.xml b/scala-package/infer/pom.xml
index 8ff08c3de2d..573684d2dd1 100644
--- a/scala-package/infer/pom.xml
+++ b/scala-package/infer/pom.xml
@@ -78,22 +78,6 @@
                 <groupId>org.scalastyle</groupId>
                 <artifactId>scalastyle-maven-plugin</artifactId>
             </plugin>
-            <plugin>
-                <groupId>net.alchim31.maven</groupId>
-                <artifactId>scala-maven-plugin</artifactId>
-                <version>3.3.2</version>
-                <configuration>
-                </configuration>
-                <executions>
-                    <execution>
-                        <phase>package</phase>
-                        <id>attach-javadocs</id>
-                        <goals>
-                            <goal>doc-jar</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
         </plugins>
     </build>
     <dependencies>
diff --git a/scala-package/pom.xml b/scala-package/pom.xml
index 043aaae5e9e..d931a82a664 100644
--- a/scala-package/pom.xml
+++ b/scala-package/pom.xml
@@ -208,27 +208,6 @@
         <artifactId>maven-dependency-plugin</artifactId>
         <version>2.9</version>
       </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-jar-plugin</artifactId>
-        <version>3.0.2</version>
-        <executions>
-          <execution>
-            <id>empty-javadoc-jar</id>
-            <phase>package</phase>
-            <goals>
-              <goal>jar</goal>
-            </goals>
-            <configuration>
-              <includes>
-                <include>**/*</include>
-              </includes>
-              <classifier>javadoc</classifier>
-              <classesDirectory>${basedir}/javadoc</classesDirectory>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-assembly-plugin</artifactId>
@@ -324,22 +303,6 @@
           </execution>
         </executions>
       </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-javadoc-plugin</artifactId>
-        <version>2.9.1</version>
-        <configuration>
-          <excludePackageNames>org.kohsuke.*</excludePackageNames>
-        </configuration>
-        <executions>
-          <execution>
-            <id>attach-javadocs</id>
-            <goals>
-              <goal>jar</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
       <plugin>
         <groupId>net.alchim31.maven</groupId>
         <artifactId>scala-maven-plugin</artifactId>


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to