Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] Creating a shaded/"uber-jar?"

We used the maven-shade-plugin to build the jgit command line app:
https://git.eclipse.org/r/plugins/gitiles/jgit/jgit/+/refs/changes/43/135143/2/org.eclipse.jgit.pgm/pom.xml#175

We switched to the spring-boot-maven-plugin and now use nested jars
since we added Bouncycastle for signing support which is JCE and Eclipse signed.
These signatures would break during shading and we didn't want to re-sign the shaded jar
since the JCE signature is meant to be used for JCE providers only.

See change https://git.eclipse.org/r/#/c/133417
especially
https://git.eclipse.org/r/#/c/133417/31/org.eclipse.jgit.pgm/pom.xml

here are the complete sources of the  pom.xml
https://git.eclipse.org/r/plugins/gitiles/jgit/jgit/+/master/org.eclipse.jgit.pgm/pom.xml
and the shell script we use to start the command line application
https://git.eclipse.org/r/plugins/gitiles/jgit/jgit/+/master/org.eclipse.jgit.pgm/jgit.sh

-Matthias

On Fri, Jun 7, 2019 at 11:03 PM Jay Jay Billings <jayjaybillings@xxxxxxxxx> wrote:
FYI - Greg and I looked at this more. Something like this appears to work:

            <plugin>
                <groupId>org.eclipse.tycho</groupId>
                <artifactId>tycho-p2-repository-plugin</artifactId>
                <version>${tycho-version}</version>
                <configuration>
            <!--        <createArtifactRepository>false</createArtifactRepository>-->
                    <includeAllDependencies>true</includeAllDependencies>
                </configuration>
            </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>2.4.3</version>
        <configuration>
          <!-- put your configurations here -->
        </configuration>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

This produces a single shaded jar that appears to be correct, but I haven't tried it in a program yet.

Jay

On Fri, Jun 7, 2019 at 3:43 PM Jay Jay Billings <jayjaybillings@xxxxxxxxx> wrote:
Hello Tycho team!

Does anyone have a suggestion for how to create a shaded/uber-jar of a project and all of its dependencies? This would be comparable to using the maven-shaded plugin. I have found one good reference for it on the mailing list:


Is that still the best way to do it?

Here's our use case. Greg Watson and I are looking taking some of the backend bundles from Eclipse PTP and Eclipse ICE to use in some new web services we are building. These are Spring+Vaadin web applications, so it would be easiest for us to just put a gigantic jar on the classpath.

Any thoughts or suggestions?

Best,
Jay

--
Jay Jay Billings
Twitter Handle: @jayjaybillings


--
Jay Jay Billings
Twitter Handle: @jayjaybillings
_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/tycho-user

Back to the top