You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Gary Gregory <ga...@gmail.com> on 2016/05/20 17:05:45 UTC

Fwd: svn commit: r1744720 - /commons/proper/codec/trunk/pom.xml

Hi,

Can't the shade plugin could do the pruning with its minimize feature?

Gary

---------- Forwarded message ----------
From: <se...@apache.org>
Date: Fri, May 20, 2016 at 4:42 AM
Subject: svn commit: r1744720 - /commons/proper/codec/trunk/pom.xml
To: commits@commons.apache.org


Author: sebb
Date: Fri May 20 11:42:18 2016
New Revision: 1744720

URL: http://svn.apache.org/viewvc?rev=1744720&view=rev
Log:
Add support for creating cli jar (currently only Digest)

Modified:
    commons/proper/codec/trunk/pom.xml

Modified: commons/proper/codec/trunk/pom.xml
URL:
http://svn.apache.org/viewvc/commons/proper/codec/trunk/pom.xml?rev=1744720&r1=1744719&r2=1744720&view=diff
==============================================================================
--- commons/proper/codec/trunk/pom.xml (original)
+++ commons/proper/codec/trunk/pom.xml Fri May 20 11:42:18 2016
@@ -252,6 +252,101 @@ limitations under the License.
       </plugins>
     </pluginManagement>
     <plugins>
+
+      <!-- Exclude cli from source jar -->
+      <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-source-plugin</artifactId>
+          <configuration>
+              <excludes>
+                  <exclude>**/cli/**</exclude>
+              </excludes>
+          </configuration>
+      </plugin>
+
+      <!-- Exclude cli from binary jar -->
+      <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-jar-plugin</artifactId>
+          <configuration>
+              <excludes>
+                  <exclude>**/cli/**</exclude>
+              </excludes>
+          </configuration>
+      </plugin>
+
+      <!-- Create CLI jar -->
+      <plugin>
+          <artifactId>maven-antrun-plugin</artifactId>
+          <executions>
+              <execution>
+                  <phase>package</phase>
+                  <configuration>
+                      <target>
+                          <!--
+                              Create the binary cli jar, which will be
added to the binary zip/tgz,
+                              but not deployed independently to Maven
+                          -->
+                          <jar
destfile="target/commons-codec-cli-${project.version}.jar">
+                              <metainf dir="${basedir}"
includes="NOTICE.txt,LICENSE.txt" />
+                              <manifest>
+                                  <attribute name="Extension-Name" value="
org.apache.commons.net" />
+                                  <attribute name="Specification-Title"
value="${project.name}" />
+                                  <attribute name="Implementation-Title"
value="${project.name}" />
+                                  <attribute name="Implementation-Vendor"
value="${project.organization.name}" />
+                                  <attribute name="Implementation-Version"
value="${project.version}" />
+                                  <attribute
name="Implementation-Vendor-Id" value="org.apache" />
+                                  <attribute name="Implementation-Build"
value="${implementation.build}"/>
+                                  <attribute name="X-Compile-Source-JDK"
value="${maven.compiler.source}" />
+                                  <attribute name="X-Compile-Target-JDK"
value="${maven.compiler.target}" />
+                                  <attribute name="Main-Class"
value="org.apache.commons.codec.cli.Digest" />
+                              </manifest>
+                              <fileset dir="target/classes"
includes="org/apache/commons/codec/cli/**"/>
+                              <fileset dir="target/classes"
includes="org/apache/commons/codec/BinaryDecoder.class"/>
+                              <fileset dir="target/classes"
includes="org/apache/commons/codec/BinaryEncoder.class"/>
+                              <fileset dir="target/classes"
includes="org/apache/commons/codec/Charsets.class"/>
+                              <fileset dir="target/classes"
includes="org/apache/commons/codec/Decoder.class"/>
+                              <fileset dir="target/classes"
includes="org/apache/commons/codec/DecoderException.class"/>
+                              <fileset dir="target/classes"
includes="org/apache/commons/codec/Encoder.class"/>
+                              <fileset dir="target/classes"
includes="org/apache/commons/codec/EncoderException.class"/>
+                              <fileset dir="target/classes"
includes="org/apache/commons/codec/binary/Hex.class"/>
+                              <fileset dir="target/classes"
includes="org/apache/commons/codec/digest/DigestUtils.class"/>
+                              <fileset dir="target/classes"
includes="org/apache/commons/codec/digest/MessageDigestAlgorithms.class"/>
+                          </jar>
+                      </target>
+                  </configuration>
+                  <goals>
+                      <goal>run</goal>
+                  </goals>
+              </execution>
+          </executions>
+      </plugin>
+
+      <!--  Attaches the cli JAR to the Maven lifecycle
+            to ensure it will be signed and deployed as normal -->
+      <plugin>
+          <groupId>org.codehaus.mojo</groupId>
+          <artifactId>build-helper-maven-plugin</artifactId>
+          <executions>
+              <execution>
+                  <id>attach-artifacts</id>
+                  <phase>package</phase>
+                  <goals>
+                      <goal>attach-artifact</goal>
+                  </goals>
+                  <configuration>
+                      <artifacts>
+                          <artifact>
+
<file>target/commons-codec-cli-${project.version}.jar</file>
+                              <type>jar</type>
+                              <classifier>cli</classifier>
+                          </artifact>
+                      </artifacts>
+                  </configuration>
+              </execution>
+          </executions>
+      </plugin>
+
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>





-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: svn commit: r1744720 - /commons/proper/codec/trunk/pom.xml

Posted by Gary Gregory <ga...@gmail.com>.
On Fri, May 20, 2016 at 10:13 AM, sebb <se...@gmail.com> wrote:

> On 20 May 2016 at 18:05, Gary Gregory <ga...@gmail.com> wrote:
> > Hi,
> >
> > Can't the shade plugin could do the pruning with its minimize feature?
>
> It's more than just a prune; the manifest also needs to be updated
> with the main class.
>
> But if you want to try it, go ahead.
>
> Note that you would still need much of the above patch.
> The new jar still needs to be signed, and the code dropped from normal
> jars.
>

Hm, seems just as tricky as what you have now. Let's stick with what you've
got.

Gary

>
> > Gary
> >
> > ---------- Forwarded message ----------
> > From: <se...@apache.org>
> > Date: Fri, May 20, 2016 at 4:42 AM
> > Subject: svn commit: r1744720 - /commons/proper/codec/trunk/pom.xml
> > To: commits@commons.apache.org
> >
> >
> > Author: sebb
> > Date: Fri May 20 11:42:18 2016
> > New Revision: 1744720
> >
> > URL: http://svn.apache.org/viewvc?rev=1744720&view=rev
> > Log:
> > Add support for creating cli jar (currently only Digest)
> >
> > Modified:
> >     commons/proper/codec/trunk/pom.xml
> >
> > Modified: commons/proper/codec/trunk/pom.xml
> > URL:
> >
> http://svn.apache.org/viewvc/commons/proper/codec/trunk/pom.xml?rev=1744720&r1=1744719&r2=1744720&view=diff
> >
> ==============================================================================
> > --- commons/proper/codec/trunk/pom.xml (original)
> > +++ commons/proper/codec/trunk/pom.xml Fri May 20 11:42:18 2016
> > @@ -252,6 +252,101 @@ limitations under the License.
> >        </plugins>
> >      </pluginManagement>
> >      <plugins>
> > +
> > +      <!-- Exclude cli from source jar -->
> > +      <plugin>
> > +          <groupId>org.apache.maven.plugins</groupId>
> > +          <artifactId>maven-source-plugin</artifactId>
> > +          <configuration>
> > +              <excludes>
> > +                  <exclude>**/cli/**</exclude>
> > +              </excludes>
> > +          </configuration>
> > +      </plugin>
> > +
> > +      <!-- Exclude cli from binary jar -->
> > +      <plugin>
> > +          <groupId>org.apache.maven.plugins</groupId>
> > +          <artifactId>maven-jar-plugin</artifactId>
> > +          <configuration>
> > +              <excludes>
> > +                  <exclude>**/cli/**</exclude>
> > +              </excludes>
> > +          </configuration>
> > +      </plugin>
> > +
> > +      <!-- Create CLI jar -->
> > +      <plugin>
> > +          <artifactId>maven-antrun-plugin</artifactId>
> > +          <executions>
> > +              <execution>
> > +                  <phase>package</phase>
> > +                  <configuration>
> > +                      <target>
> > +                          <!--
> > +                              Create the binary cli jar, which will be
> > added to the binary zip/tgz,
> > +                              but not deployed independently to Maven
> > +                          -->
> > +                          <jar
> > destfile="target/commons-codec-cli-${project.version}.jar">
> > +                              <metainf dir="${basedir}"
> > includes="NOTICE.txt,LICENSE.txt" />
> > +                              <manifest>
> > +                                  <attribute name="Extension-Name"
> value="
> > org.apache.commons.net" />
> > +                                  <attribute name="Specification-Title"
> > value="${project.name}" />
> > +                                  <attribute name="Implementation-Title"
> > value="${project.name}" />
> > +                                  <attribute
> name="Implementation-Vendor"
> > value="${project.organization.name}" />
> > +                                  <attribute
> name="Implementation-Version"
> > value="${project.version}" />
> > +                                  <attribute
> > name="Implementation-Vendor-Id" value="org.apache" />
> > +                                  <attribute name="Implementation-Build"
> > value="${implementation.build}"/>
> > +                                  <attribute name="X-Compile-Source-JDK"
> > value="${maven.compiler.source}" />
> > +                                  <attribute name="X-Compile-Target-JDK"
> > value="${maven.compiler.target}" />
> > +                                  <attribute name="Main-Class"
> > value="org.apache.commons.codec.cli.Digest" />
> > +                              </manifest>
> > +                              <fileset dir="target/classes"
> > includes="org/apache/commons/codec/cli/**"/>
> > +                              <fileset dir="target/classes"
> > includes="org/apache/commons/codec/BinaryDecoder.class"/>
> > +                              <fileset dir="target/classes"
> > includes="org/apache/commons/codec/BinaryEncoder.class"/>
> > +                              <fileset dir="target/classes"
> > includes="org/apache/commons/codec/Charsets.class"/>
> > +                              <fileset dir="target/classes"
> > includes="org/apache/commons/codec/Decoder.class"/>
> > +                              <fileset dir="target/classes"
> > includes="org/apache/commons/codec/DecoderException.class"/>
> > +                              <fileset dir="target/classes"
> > includes="org/apache/commons/codec/Encoder.class"/>
> > +                              <fileset dir="target/classes"
> > includes="org/apache/commons/codec/EncoderException.class"/>
> > +                              <fileset dir="target/classes"
> > includes="org/apache/commons/codec/binary/Hex.class"/>
> > +                              <fileset dir="target/classes"
> > includes="org/apache/commons/codec/digest/DigestUtils.class"/>
> > +                              <fileset dir="target/classes"
> >
> includes="org/apache/commons/codec/digest/MessageDigestAlgorithms.class"/>
> > +                          </jar>
> > +                      </target>
> > +                  </configuration>
> > +                  <goals>
> > +                      <goal>run</goal>
> > +                  </goals>
> > +              </execution>
> > +          </executions>
> > +      </plugin>
> > +
> > +      <!--  Attaches the cli JAR to the Maven lifecycle
> > +            to ensure it will be signed and deployed as normal -->
> > +      <plugin>
> > +          <groupId>org.codehaus.mojo</groupId>
> > +          <artifactId>build-helper-maven-plugin</artifactId>
> > +          <executions>
> > +              <execution>
> > +                  <id>attach-artifacts</id>
> > +                  <phase>package</phase>
> > +                  <goals>
> > +                      <goal>attach-artifact</goal>
> > +                  </goals>
> > +                  <configuration>
> > +                      <artifacts>
> > +                          <artifact>
> > +
> > <file>target/commons-codec-cli-${project.version}.jar</file>
> > +                              <type>jar</type>
> > +                              <classifier>cli</classifier>
> > +                          </artifact>
> > +                      </artifacts>
> > +                  </configuration>
> > +              </execution>
> > +          </executions>
> > +      </plugin>
> > +
> >        <plugin>
> >          <groupId>org.apache.maven.plugins</groupId>
> >          <artifactId>maven-surefire-plugin</artifactId>
> >
> >
> >
> >
> >
> > --
> > E-Mail: garydgregory@gmail.com | ggregory@apache.org
> > Java Persistence with Hibernate, Second Edition
> > <http://www.manning.com/bauer3/>
> > JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> > Spring Batch in Action <http://www.manning.com/templier/>
> > Blog: http://garygregory.wordpress.com
> > Home: http://garygregory.com/
> > Tweet! http://twitter.com/GaryGregory
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>


-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: svn commit: r1744720 - /commons/proper/codec/trunk/pom.xml

Posted by sebb <se...@gmail.com>.
On 20 May 2016 at 18:05, Gary Gregory <ga...@gmail.com> wrote:
> Hi,
>
> Can't the shade plugin could do the pruning with its minimize feature?

It's more than just a prune; the manifest also needs to be updated
with the main class.

But if you want to try it, go ahead.

Note that you would still need much of the above patch.
The new jar still needs to be signed, and the code dropped from normal jars.

> Gary
>
> ---------- Forwarded message ----------
> From: <se...@apache.org>
> Date: Fri, May 20, 2016 at 4:42 AM
> Subject: svn commit: r1744720 - /commons/proper/codec/trunk/pom.xml
> To: commits@commons.apache.org
>
>
> Author: sebb
> Date: Fri May 20 11:42:18 2016
> New Revision: 1744720
>
> URL: http://svn.apache.org/viewvc?rev=1744720&view=rev
> Log:
> Add support for creating cli jar (currently only Digest)
>
> Modified:
>     commons/proper/codec/trunk/pom.xml
>
> Modified: commons/proper/codec/trunk/pom.xml
> URL:
> http://svn.apache.org/viewvc/commons/proper/codec/trunk/pom.xml?rev=1744720&r1=1744719&r2=1744720&view=diff
> ==============================================================================
> --- commons/proper/codec/trunk/pom.xml (original)
> +++ commons/proper/codec/trunk/pom.xml Fri May 20 11:42:18 2016
> @@ -252,6 +252,101 @@ limitations under the License.
>        </plugins>
>      </pluginManagement>
>      <plugins>
> +
> +      <!-- Exclude cli from source jar -->
> +      <plugin>
> +          <groupId>org.apache.maven.plugins</groupId>
> +          <artifactId>maven-source-plugin</artifactId>
> +          <configuration>
> +              <excludes>
> +                  <exclude>**/cli/**</exclude>
> +              </excludes>
> +          </configuration>
> +      </plugin>
> +
> +      <!-- Exclude cli from binary jar -->
> +      <plugin>
> +          <groupId>org.apache.maven.plugins</groupId>
> +          <artifactId>maven-jar-plugin</artifactId>
> +          <configuration>
> +              <excludes>
> +                  <exclude>**/cli/**</exclude>
> +              </excludes>
> +          </configuration>
> +      </plugin>
> +
> +      <!-- Create CLI jar -->
> +      <plugin>
> +          <artifactId>maven-antrun-plugin</artifactId>
> +          <executions>
> +              <execution>
> +                  <phase>package</phase>
> +                  <configuration>
> +                      <target>
> +                          <!--
> +                              Create the binary cli jar, which will be
> added to the binary zip/tgz,
> +                              but not deployed independently to Maven
> +                          -->
> +                          <jar
> destfile="target/commons-codec-cli-${project.version}.jar">
> +                              <metainf dir="${basedir}"
> includes="NOTICE.txt,LICENSE.txt" />
> +                              <manifest>
> +                                  <attribute name="Extension-Name" value="
> org.apache.commons.net" />
> +                                  <attribute name="Specification-Title"
> value="${project.name}" />
> +                                  <attribute name="Implementation-Title"
> value="${project.name}" />
> +                                  <attribute name="Implementation-Vendor"
> value="${project.organization.name}" />
> +                                  <attribute name="Implementation-Version"
> value="${project.version}" />
> +                                  <attribute
> name="Implementation-Vendor-Id" value="org.apache" />
> +                                  <attribute name="Implementation-Build"
> value="${implementation.build}"/>
> +                                  <attribute name="X-Compile-Source-JDK"
> value="${maven.compiler.source}" />
> +                                  <attribute name="X-Compile-Target-JDK"
> value="${maven.compiler.target}" />
> +                                  <attribute name="Main-Class"
> value="org.apache.commons.codec.cli.Digest" />
> +                              </manifest>
> +                              <fileset dir="target/classes"
> includes="org/apache/commons/codec/cli/**"/>
> +                              <fileset dir="target/classes"
> includes="org/apache/commons/codec/BinaryDecoder.class"/>
> +                              <fileset dir="target/classes"
> includes="org/apache/commons/codec/BinaryEncoder.class"/>
> +                              <fileset dir="target/classes"
> includes="org/apache/commons/codec/Charsets.class"/>
> +                              <fileset dir="target/classes"
> includes="org/apache/commons/codec/Decoder.class"/>
> +                              <fileset dir="target/classes"
> includes="org/apache/commons/codec/DecoderException.class"/>
> +                              <fileset dir="target/classes"
> includes="org/apache/commons/codec/Encoder.class"/>
> +                              <fileset dir="target/classes"
> includes="org/apache/commons/codec/EncoderException.class"/>
> +                              <fileset dir="target/classes"
> includes="org/apache/commons/codec/binary/Hex.class"/>
> +                              <fileset dir="target/classes"
> includes="org/apache/commons/codec/digest/DigestUtils.class"/>
> +                              <fileset dir="target/classes"
> includes="org/apache/commons/codec/digest/MessageDigestAlgorithms.class"/>
> +                          </jar>
> +                      </target>
> +                  </configuration>
> +                  <goals>
> +                      <goal>run</goal>
> +                  </goals>
> +              </execution>
> +          </executions>
> +      </plugin>
> +
> +      <!--  Attaches the cli JAR to the Maven lifecycle
> +            to ensure it will be signed and deployed as normal -->
> +      <plugin>
> +          <groupId>org.codehaus.mojo</groupId>
> +          <artifactId>build-helper-maven-plugin</artifactId>
> +          <executions>
> +              <execution>
> +                  <id>attach-artifacts</id>
> +                  <phase>package</phase>
> +                  <goals>
> +                      <goal>attach-artifact</goal>
> +                  </goals>
> +                  <configuration>
> +                      <artifacts>
> +                          <artifact>
> +
> <file>target/commons-codec-cli-${project.version}.jar</file>
> +                              <type>jar</type>
> +                              <classifier>cli</classifier>
> +                          </artifact>
> +                      </artifacts>
> +                  </configuration>
> +              </execution>
> +          </executions>
> +      </plugin>
> +
>        <plugin>
>          <groupId>org.apache.maven.plugins</groupId>
>          <artifactId>maven-surefire-plugin</artifactId>
>
>
>
>
>
> --
> E-Mail: garydgregory@gmail.com | ggregory@apache.org
> Java Persistence with Hibernate, Second Edition
> <http://www.manning.com/bauer3/>
> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> Spring Batch in Action <http://www.manning.com/templier/>
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org