Skip to content

Commit

Permalink
Shade Eclipse artifacts and minimize. Prevent signing errors when emb…
Browse files Browse the repository at this point in the history
…edding. Smaller Jar.
  • Loading branch information
lincolnthree committed Apr 29, 2014
1 parent 90cc241 commit 4463440
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 2 deletions.
55 changes: 54 additions & 1 deletion impl/pom.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<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">
<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>
<parent>
<groupId>org.jboss.forge.roaster</groupId>
Expand Down Expand Up @@ -56,5 +57,57 @@
</exclusions>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<minimizeJar>true</minimizeJar>
<createSourcesJar>true</createSourcesJar>

<artifactSet>
<excludes>
<exclude>org.jboss.forge.roaster:roaster-api</exclude>
</excludes>
</artifactSet>

<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>

<relocations>
<relocation>
<pattern>org.eclipse</pattern>
<shadedPattern>org.jboss.forge.roaster._shade.org.eclipse</shadedPattern>
</relocation>
<relocation>
<pattern>org.osgi</pattern>
<shadedPattern>org.jboss.forge.roaster._shade.org.osgi</shadedPattern>
</relocation>
</relocations>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public static String format(JavaClassSource javaClass)
public static String format(String source)
{
// TODO locate user's eclipse project settings, use those if we can.
Properties options = readConfig("org.eclipse.jdt.core.prefs");
Properties options = readConfig("eclipse.formatter.prefs");

final CodeFormatter codeFormatter = ToolFactory.createCodeFormatter(options);
return ensureCorrectNewLines(formatFile(source, codeFormatter));
Expand Down

0 comments on commit 4463440

Please sign in to comment.