Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OC-102: use shade plugin to repack and trim jars #256

Merged
merged 21 commits into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
8748cef
OC-102: do not create repacked libraries of clover-antlr, clover-cajo…
marek-parfianowicz Apr 9, 2024
6bb1fb8
OC-102: disabled maven-jar-plugin as we use the assembly plugin to cr…
marek-parfianowicz Apr 10, 2024
b4c92e6
OC-102: third party libraries are being packed into clover-core inste…
marek-parfianowicz Apr 11, 2024
a3e26a0
OC-102: removed even more repacked clover-core-libs as third party li…
marek-parfianowicz Jun 24, 2024
1112ffd
OC-102: removed empty shade filters (were invalid, broke hardcoded st…
marek-parfianowicz Jun 24, 2024
071d205
OC-102: upgraded jtreemap to 1.1.3 (as it's pom.xml is not broken) an…
marek-parfianowicz Jun 24, 2024
ddd45ca
OC-102: more relocation patterns in clover-core, restored missing ant…
marek-parfianowicz Jun 25, 2024
e8c180a
OC-102: decouple eclipse DashboardGenerator from core HtmlReportUtil …
marek-parfianowicz Jun 25, 2024
16d46b2
OC-102: decouple eclipse DashboardGenerator from core HtmlReportUtil …
marek-parfianowicz Jun 25, 2024
6f7ec28
OC-102: extracted RenderTreeMapJsonActionTest
marek-parfianowicz Jun 25, 2024
f94affb
OC-102: added missing (non-shaded) third party libraries to test path
marek-parfianowicz Jun 25, 2024
b61b4fb
OC-102: exclude lombok transitive dependency
marek-parfianowicz Jun 25, 2024
1c14a7a
OC-102: update asm to 9.7 in all places, add asm to test classpath in…
marek-parfianowicz Jun 25, 2024
da9f190
OC-102: the maven-shade-plugin is unable to update *.properties files…
marek-parfianowicz Jun 28, 2024
347f225
OC-102: removed all usages of AccessController as it's deprecated in …
marek-parfianowicz Jun 28, 2024
8598743
OC-102: add jarjar to maven-antrun-plugin classpath
marek-parfianowicz Jun 29, 2024
66ed9c3
OC-102: don't repack velocity dependencies (commons, jdom) as this wi…
marek-parfianowicz Jun 30, 2024
8b838e7
OC-102: bumped asm version in another places found
marek-parfianowicz Jul 1, 2024
d35cfe6
OC-102: refreshed BOM
marek-parfianowicz Jul 1, 2024
86aad96
OC-102: removed usages of AccessController as it's deprecated in JDK17
marek-parfianowicz Jul 1, 2024
ef18f9f
OC-102: added logging
marek-parfianowicz Jul 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/A-build-and-test-jdk11.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ jobs:
mvn --batch-mode install -f clover-core-libs/jarjar/pom.xml
mvn --batch-mode install -Pworkspace-setup -f clover-core-libs/pom.xml
mvn --batch-mode install -Pworkspace-setup -f clover-eclipse-libs/pom.xml
mvn --batch-mode install -Pworkspace-setup -f clover-jtreemap/pom.xml
mvn --batch-mode install -Pworkspace-setup -f clover-idea-libs/pom.xml

- name: Download KTreemap fork
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/A-build-and-test-jdk17.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ jobs:
mvn --batch-mode install -f clover-core-libs/jarjar/pom.xml
mvn --batch-mode install -Pworkspace-setup -f clover-core-libs/pom.xml
mvn --batch-mode install -Pworkspace-setup -f clover-eclipse-libs/pom.xml
mvn --batch-mode install -Pworkspace-setup -f clover-jtreemap/pom.xml
mvn --batch-mode install -Pworkspace-setup -f clover-idea-libs/pom.xml

- name: Download KTreemap fork
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/A-build-and-test-jdk21.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ jobs:
mvn --batch-mode install -f clover-core-libs/jarjar/pom.xml
mvn --batch-mode install -Pworkspace-setup -f clover-core-libs/pom.xml
mvn --batch-mode install -Pworkspace-setup -f clover-eclipse-libs/pom.xml
mvn --batch-mode install -Pworkspace-setup -f clover-jtreemap/pom.xml
mvn --batch-mode install -Pworkspace-setup -f clover-idea-libs/pom.xml

- name: Download KTreemap fork
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/A-build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ jobs:
mvn --batch-mode install -f clover-core-libs/jarjar/pom.xml
mvn --batch-mode install -Pworkspace-setup -f clover-core-libs/pom.xml
mvn --batch-mode install -Pworkspace-setup -f clover-eclipse-libs/pom.xml
mvn --batch-mode install -Pworkspace-setup -f clover-jtreemap/pom.xml
mvn --batch-mode install -Pworkspace-setup -f clover-idea-libs/pom.xml

- name: Download KTreemap fork
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/B-combatibility-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ jobs:
mvn --batch-mode install -f clover-core-libs/jarjar/pom.xml
mvn --batch-mode install -Pworkspace-setup -f clover-core-libs/pom.xml
mvn --batch-mode install -Pworkspace-setup -f clover-eclipse-libs/pom.xml
mvn --batch-mode install -Pworkspace-setup -f clover-jtreemap/pom.xml
mvn --batch-mode install -Pworkspace-setup -f clover-idea-libs/pom.xml

- name: Download KTreemap fork
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/D-release-openclover.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ jobs:
mvn --batch-mode install -f clover-core-libs/jarjar/pom.xml
mvn --batch-mode install -Pworkspace-setup -f clover-core-libs/pom.xml
mvn --batch-mode install -Pworkspace-setup -f clover-eclipse-libs/pom.xml
mvn --batch-mode install -Pworkspace-setup -f clover-jtreemap/pom.xml
mvn --batch-mode install -Pworkspace-setup -f clover-idea-libs/pom.xml

- name: Download KTreemap fork
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ See also:
mvn install -f clover-core-libs/jarjar/pom.xml
mvn install -Pworkspace-setup -f clover-core-libs/pom.xml
mvn install -Pworkspace-setup -f clover-eclipse-libs/pom.xml
mvn install -Pworkspace-setup -f clover-jtreemap/pom.xml
mvn install -Pworkspace-setup -f clover-idea-libs/pom.xml
```

Expand Down
77 changes: 45 additions & 32 deletions clover-all/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,60 +61,52 @@
</dependency>
<!-- packaging into clover.jar via assembly plugin -->
<dependency>
<groupId>org.openclover</groupId>
<artifactId>clover-annotations</artifactId>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
</dependency>
<dependency>
<groupId>org.openclover</groupId>
<artifactId>clover-antlr</artifactId>
<groupId>gnu.cajo</groupId>
<artifactId>cajo</artifactId>
</dependency>
<dependency>
<groupId>org.openclover</groupId>
<artifactId>clover-cajo</artifactId>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</dependency>
<dependency>
<groupId>org.openclover</groupId>
<artifactId>clover-commons-codec</artifactId>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
</dependency>
<dependency>
<groupId>org.openclover</groupId>
<artifactId>clover-commons-collections</artifactId>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
</dependency>
<dependency>
<groupId>org.openclover</groupId>
<artifactId>clover-commons-lang</artifactId>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>org.openclover</groupId>
<artifactId>clover-commons-lang3</artifactId>
<groupId>it.unimi.dsi</groupId>
<artifactId>fastutil</artifactId>
</dependency>
<dependency>
<groupId>org.openclover</groupId>
<artifactId>clover-fastutil</artifactId>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
<dependency>
<groupId>org.openclover</groupId>
<artifactId>clover-gson</artifactId>
<groupId>com.lowagie</groupId>
<artifactId>itext</artifactId>
</dependency>
<dependency>
<groupId>org.openclover</groupId>
<artifactId>clover-itext</artifactId>
<groupId>org.jfree</groupId>
<artifactId>jcommon</artifactId>
</dependency>
<dependency>
<groupId>org.openclover</groupId>
<artifactId>clover-jcommon</artifactId>
<groupId>jdom</groupId>
<artifactId>jdom</artifactId>
</dependency>
<dependency>
<groupId>org.openclover</groupId>
<artifactId>clover-jdom</artifactId>
</dependency>
<dependency>
<groupId>org.openclover</groupId>
<artifactId>clover-jfreechart</artifactId>
</dependency>
<dependency>
<groupId>org.openclover</groupId>
<artifactId>clover-slf4j</artifactId>
<groupId>org.jfree</groupId>
<artifactId>jfreechart</artifactId>
</dependency>
<dependency>
<groupId>org.openclover</groupId>
Expand All @@ -130,6 +122,17 @@
</extension>
</extensions>
<plugins>
<!-- use assembly plugin instead of jar plugin to create an artifact -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>default-jar</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
<!-- generate clover.jar, a combination of clover-ant + clover-core + clover-runtime + clover+groovy +
repacked clover-* third-party libraries -->
<plugin>
Expand Down Expand Up @@ -220,6 +223,16 @@
<artifactId>junit-platform-launcher</artifactId>
<version>1.9.2</version>
</additionalDependency>
<additionalDependency>
<groupId>antlr</groupId>
<artifactId>antlr</artifactId>
<version>2.7.7</version>
</additionalDependency>
<additionalDependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.36</version>
</additionalDependency>
</additionalDependencies>
<!-- clover-runtime contains a package in a folder different from package name, leading to warning -->
<excludePackageNames>annotations.*</excludePackageNames>
Expand Down
28 changes: 0 additions & 28 deletions clover-all/src/assembly/clover-jar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,34 +63,6 @@
</includes>
<unpack>false</unpack>
</dependencySet>
<dependencySet>
<outputDirectory>.</outputDirectory>
<includes>
<include>org.openclover:clover-annotations</include>
<include>org.openclover:clover-antlr</include>
<include>org.openclover:clover-cajo</include>
<include>org.openclover:clover-commons-codec</include>
<include>org.openclover:clover-commons-collections</include>
<include>org.openclover:clover-commons-lang</include>
<include>org.openclover:clover-commons-lang3</include>
<include>org.openclover:clover-fastutil</include>
<include>org.openclover:clover-gson</include>
<include>org.openclover:clover-itext</include>
<include>org.openclover:clover-jcommon</include>
<include>org.openclover:clover-jdom</include>
<include>org.openclover:clover-jfreechart</include>
<include>org.openclover:clover-slf4j</include>
<include>org.openclover:clover-velocity</include>
</includes>
<unpack>true</unpack>
<unpackOptions>
<excludes>
<exclude>licenses/*.TXT</exclude>
<exclude>LICENSE.txt</exclude>
<exclude>META-INF/MANIFEST.MF</exclude>
</excludes>
</unpackOptions>
</dependencySet>
</dependencySets>
<fileSets>
<fileSet>
Expand Down
44 changes: 42 additions & 2 deletions clover-ant/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.openclover</groupId>
<artifactId>clover-jdom</artifactId>
<groupId>jdom</groupId>
<artifactId>jdom</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down Expand Up @@ -116,6 +116,46 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.6.0</version>
<executions>
<execution>
<id>package-jar</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
<includes>
<include>org.apache.commons:commons-lang3</include>
</includes>
</artifactSet>
<filters>
<filter>
<artifact>org.apache.commons:commons-lang3</artifact>
<excludes>
<exclude>META-INF/LICENSE.txt</exclude>
<exclude>META-INF/MANIFEST.MF</exclude>
<exclude>META-INF/NOTICE.txt</exclude>
</excludes>
</filter>
</filters>
<relocations>
<relocation>
<pattern>org.apache.commons.lang3</pattern>
<shadedPattern>clover.org.apache.commons.lang3</shadedPattern>
<includes>
<include>org.apache.commons.lang3.**</include>
</includes>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>
<!-- don't deploy jar, clover-ant-zip is distributed via website -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.openclover.ant;

import clover.org.apache.commons.lang3.ArrayUtils;
import clover.org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.types.FileSet;
import org.apache.tools.ant.types.PatternSet;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.openclover.ant;

import clover.org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.types.FileSet;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.openclover.ant.taskdefs;

import clover.org.apache.commons.lang3.reflect.FieldUtils;
import org.apache.commons.lang3.reflect.FieldUtils;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.taskdefs.Javac;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.openclover.ant.tasks;

import clover.org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.types.FileSet;
import org.openclover.ant.AntCloverProfile;
Expand Down
17 changes: 7 additions & 10 deletions clover-ant/src/main/java/org/openclover/ci/AntIntegrator.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import org.openclover.runtime.CloverNames;
import org.openclover.runtime.Logger;

import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.List;

/**
Expand Down Expand Up @@ -73,14 +71,13 @@ private String addQuotesIfNecessary(String input) {
}

private static boolean isWindows() {
final String osName = AccessController.doPrivileged((PrivilegedAction<String>) () -> {
try {
return System.getProperty("os.name");
} catch (SecurityException ex) {
return null;
}
});
return osName != null && osName.toLowerCase().indexOf("windows") == 0;
try {
final String osName = System.getProperty("os.name");
return osName != null && osName.toLowerCase().indexOf("windows") == 0;
} catch (SecurityException ex) {
Logger.getInstance().debug("Unable to read os.name property");
return false;
}
}

}
55 changes: 55 additions & 0 deletions clover-core-libs/cajo/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<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>gnu.cajo</groupId>
<artifactId>cajo</artifactId>
<version>1.117</version>
<packaging>jar</packaging>
<licenses>
<license>
<name>LGPL v3</name>
<url>http://java.net/projects/cajo/pages/Home</url>
</license>
</licenses>
<name>Cajo Library</name>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<skipIfEmpty>true</skipIfEmpty>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<executions>
<execution>
<id>default-install</id>
<phase>none</phase>
</execution>
<execution>
<id>install-file</id>
<phase>install</phase>
<goals>
<goal>install-file</goal>
</goals>
<configuration>
<file>src/main/resources/cajo-1.117.jar</file>
<pomFile>pom.xml</pomFile>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Loading