Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
97 changes: 97 additions & 0 deletions flow-build-tools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
<packaging>jar</packaging>
<name>Flow Frontend Build Tools</name>
<description>A module to handle frontend build tools common to the plugins and dev server</description>
<properties>
<!-- It appears that sonar does not like shade plugin -->
<sonar.skip>true</sonar.skip>
</properties>

<dependencies>

Expand Down Expand Up @@ -38,4 +42,97 @@

</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.6.1</version>
<executions>
<execution>
<goals>
<goal>shade</goal>
</goals>
<phase>package</phase>
<configuration>
<shadedArtifactAttached>true</shadedArtifactAttached>
<shadedClassifierName>shaded</shadedClassifierName>
<createDependencyReducedPom>true</createDependencyReducedPom>
<dependencyReducedPomLocation>${project.build.directory}/dependency-reduced-pom.xml</dependencyReducedPomLocation>
<artifactSet>
<includes>
<include>org.apache.commons:commons-compress</include>
<include>commons-io:commons-io</include>
<include>commons-codec:commons-codec</include>
<include>org.apache.commons:commons-lang3</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>org.apache.commons.compress</pattern>
<shadedPattern>com.vaadin.frontendtools.internal.commons.compress</shadedPattern>
</relocation>
<relocation>
<pattern>org.apache.commons.io</pattern>
<shadedPattern>com.vaadin.frontendtools.internal.commons.io</shadedPattern>
</relocation>
<relocation>
<pattern>org.apache.commons.codec</pattern>
<shadedPattern>com.vaadin.frontendtools.internal.commons.codec</shadedPattern>
</relocation>
<relocation>
<pattern>org.apache.commons.lang3</pattern>
<shadedPattern>com.vaadin.frontendtools.internal.commons.lang3</shadedPattern>
</relocation>
</relocations>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<!-- Security signatures -->
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
<exclude>META-INF/SIG-*</exclude>
<!-- Duplicate licenses -->
<exclude>META-INF/LICENSE*</exclude>
<exclude>META-INF/NOTICE*</exclude>
<exclude>META-INF/DEPENDENCIES</exclude>
<!-- Module info -->
<exclude>module-info.class</exclude>
<!-- Multi-Release JAR files -->
<exclude>META-INF/versions/**</exclude>
<!-- GraalVM native-image configs (reference unshaded class names) -->
<exclude>META-INF/native-image/**</exclude>
<!-- Dependency Maven metadata -->
<exclude>META-INF/maven/**</exclude>
</excludes>
</filter>
<filter>
<!-- Exclude compressors with optional dependencies we don't need -->
<artifact>org.apache.commons:commons-compress</artifact>
<excludes>
<exclude>org/apache/commons/compress/compressors/xz/**</exclude>
<exclude>org/apache/commons/compress/compressors/lzma/**</exclude>
<exclude>org/apache/commons/compress/compressors/brotli/**</exclude>
<exclude>org/apache/commons/compress/compressors/zstandard/**</exclude>
<exclude>org/apache/commons/compress/compressors/snappy/**</exclude>
<exclude>org/apache/commons/compress/compressors/lz4/**</exclude>
<exclude>org/apache/commons/compress/archivers/sevenz/**</exclude>
</excludes>
</filter>
</filters>
<transformers>
<!-- Merge SPI service files -->
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
<!-- Handle Apache license files -->
<transformer implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer"/>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
11 changes: 11 additions & 0 deletions flow-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,17 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<scope>test</scope>
</dependency>

</dependencies>

<build>
Expand Down
5 changes: 5 additions & 0 deletions flow-data/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@
<scope>provided</scope>
</dependency>

<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
Expand Down
1 change: 1 addition & 0 deletions flow-plugins/flow-plugin-base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<groupId>com.vaadin</groupId>
<artifactId>flow-build-tools</artifactId>
<version>${project.version}</version>
<classifier>shaded</classifier>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
Expand Down
7 changes: 7 additions & 0 deletions flow-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<groupId>com.vaadin</groupId>
<artifactId>flow-build-tools</artifactId>
<version>${project.version}</version>
<classifier>shaded</classifier>
<!-- Note, ideally vaadin-server should not depend this module at all
and development time tooling shared with plugins should end up here.
Temporarily build this way so that commons-compress can be ditched
Expand Down Expand Up @@ -91,6 +92,12 @@
<artifactId>commons-io</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.28.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>tools.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,9 @@ && isBadSubType(clazz)) {

private Stream<String> getExcludedPatterns() {
return Stream.of("com\\.vaadin\\.flow\\..*osgi\\..*",
"com\\.vaadin\\.flow\\.server\\.startup\\.LookupInitializer\\$OsgiLookupImpl");
"com\\.vaadin\\.flow\\.server\\.startup\\.LookupInitializer\\$OsgiLookupImpl",
// Shaded third-party libraries
"com\\.vaadin\\.frontendtools\\.internal\\..*");
}

private boolean isBadSubType(Class<?> clazz) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ public abstract class ClassesSerializableTest extends ClassFinder {
@SuppressWarnings("WeakerAccess")
protected Stream<String> getExcludedPatterns() {
return Stream.of(
// Shaded third-party libraries
"com\\.vaadin\\.frontendtools\\.internal\\..*",
"com\\.vaadin\\.frontendtools\\.installer\\.DefaultArchiveExtractor",
"com\\.vaadin\\.frontendtools\\.installer\\.ArchiveExtractor",
"com\\.vaadin\\.flow\\.data\\.validator\\.BeanValidator\\$LazyFactoryInitializer",
Expand Down
10 changes: 10 additions & 0 deletions flow-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,16 @@
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
Expand Down
4 changes: 4 additions & 0 deletions flow-tests/test-live-reload/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@
<artifactId>flow-test-lumo</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>
</dependencies>

<build>
Expand Down
4 changes: 4 additions & 0 deletions flow-tests/test-root-context/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
Expand Down
9 changes: 9 additions & 0 deletions flow-tests/vaadin-spring-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,15 @@
<artifactId>jakarta.websocket-client-api</artifactId>
</dependency>

<dependency>
<!-- Not directly used, but something in the depths of spring/swagger
is using StringUtils, and we have probably excluded that in some
of our test build configs -->
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.20.0</version>
</dependency>

<dependency>
<groupId>org.apache.httpcomponents.client5</groupId>
<artifactId>httpclient5</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>
</dependencies>

<build>
Expand Down
1 change: 1 addition & 0 deletions vaadin-dev-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<groupId>com.vaadin</groupId>
<artifactId>flow-build-tools</artifactId>
<version>${project.version}</version>
<classifier>shaded</classifier>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import java.net.URI;
import java.net.URL;
import java.net.URLConnection;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.Collections;
import java.util.Enumeration;
Expand All @@ -36,7 +35,6 @@
import java.util.stream.Stream;
import java.util.zip.ZipException;

import org.apache.commons.io.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.io.Resource;
Expand All @@ -46,6 +44,8 @@
import org.springframework.core.io.support.PropertiesLoaderUtils;
import org.springframework.util.ResourceUtils;

import com.vaadin.flow.internal.FileIOUtils;

/**
* A {@link PathMatchingResourcePatternResolver} that allows filtering resources
* by package properties. The resolver reads META-INF/VAADIN/package.properties
Expand Down Expand Up @@ -542,7 +542,7 @@ private void initBlockedJars() {
return;
}
try {
String content = IOUtils.toString(url, StandardCharsets.UTF_8);
String content = FileIOUtils.urlToString(url);
if (content != null) {
if (content.isBlank()) {
blockedJarsList = Collections.emptyList();
Expand Down
Loading