Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/maven/maven.version-3.9.8
Browse files Browse the repository at this point in the history
  • Loading branch information
mcollovati authored Jun 21, 2024
2 parents bc37ce7 + 5842a04 commit 02fb8e2
Show file tree
Hide file tree
Showing 20 changed files with 155 additions and 29 deletions.
2 changes: 1 addition & 1 deletion flow-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.4.1</version>
<version>3.4.2</version>
<configuration>
<!-- Exclude all source files and classes so only the
compile result ends up in the JAR -->
Expand Down
2 changes: 1 addition & 1 deletion flow-jandex/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.4.1</version>
<version>3.4.2</version>
<configuration>
<excludes>
<exclude>com</exclude>
Expand Down
12 changes: 12 additions & 0 deletions flow-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@
<groupId>org.apache.commons</groupId>
<artifactId>commons-fileupload2-jakarta</artifactId>
<version>2.0.0-M1</version>
<exclusions>
<exclusion>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>commons-io</groupId>
Expand Down Expand Up @@ -135,6 +141,12 @@
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.26.2</version>
<exclusions>
<exclusion>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- TESTING DEPENDENCIES -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,9 @@ default File getProjectFolder() {
*/
String baseDirCandidate = System.getProperty("user.dir", ".");
Path path = Paths.get(baseDirCandidate);
if (path.toFile().isDirectory()
&& (path.resolve("pom.xml").toFile().exists()
|| path.resolve("build.gradle").toFile().exists())) {
if (path.toFile().isDirectory() && (path.resolve("pom.xml").toFile()
.exists() || path.resolve("build.gradle").toFile().exists()
|| path.resolve("build.gradle.kts").toFile().exists())) {
return path.toAbsolutePath().toFile();
} else {
throw new IllegalStateException(String.format(
Expand Down
2 changes: 1 addition & 1 deletion flow-server/src/main/resources/vite.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,7 @@ export const vaadinConfig: UserConfigFn = (env) => {
if (devMode) {
scripts.push({
tag: 'script',
attrs: { type: 'module', src: `/generated/vite-devmode.ts` },
attrs: { type: 'module', src: `/generated/vite-devmode.ts`, onerror: "document.location.reload()" },
injectTo: 'head'
});
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
/*
* Copyright 2000-2024 Vaadin Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/

package com.vaadin.flow.server;

import java.io.File;
import java.io.IOException;

import org.junit.Assert;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;

public class AbstractConfigurationTest {

@Rule
public TemporaryFolder temporaryFolder = new TemporaryFolder();

AbstractConfiguration configuration = new AbstractConfiguration() {
@Override
public boolean isProductionMode() {
return false;
}

@Override
public String getStringProperty(String name, String defaultValue) {
return null;
}

@Override
public boolean getBooleanProperty(String name, boolean defaultValue) {
return false;
}
};

@Test
public void getProjectFolder_mavenProject_detected() throws IOException {
assertProjectFolderDetected("pom.xml");
}

@Test
public void getProjectFolder_gradleProject_detected() throws IOException {
assertProjectFolderDetected("build.gradle");
}

@Test
public void getProjectFolder_gradleKotlinProject_detected()
throws IOException {
assertProjectFolderDetected("build.gradle.kts");
}

@Test
public void getProjectFolder_unknownProject_throws() throws IOException {
withTemporaryUserDir(() -> {
IllegalStateException exception = Assert.assertThrows(
IllegalStateException.class,
configuration::getProjectFolder);
Assert.assertTrue(exception.getMessage().contains(
"Failed to determine project directory for dev mode"));
Assert.assertTrue(exception.getMessage()
.contains(temporaryFolder.getRoot().getAbsolutePath()));
});
}

private void assertProjectFolderDetected(String projectFile)
throws IOException {
temporaryFolder.newFile(projectFile);
withTemporaryUserDir(() -> {
File projectFolder = configuration.getProjectFolder();
Assert.assertEquals(temporaryFolder.getRoot(), projectFolder);
});
}

private void withTemporaryUserDir(Runnable test) throws IOException {
String userDir = System.getProperty("user.dir");
try {
System.setProperty("user.dir",
temporaryFolder.getRoot().getAbsolutePath());
test.run();
} finally {
if (userDir != null) {
System.setProperty("user.dir", userDir);
} else {
System.clearProperty("user.dir");
}
}
}

}
2 changes: 1 addition & 1 deletion flow-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.4.1</version>
<version>3.4.2</version>
<configuration>
<archive>
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
Expand Down
4 changes: 2 additions & 2 deletions flow-tests/test-express-build/frontend-add-on/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.4.1</version>
<version>3.4.2</version>
<configuration>
<archive>
<index>true</index>
Expand Down Expand Up @@ -117,7 +117,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.4.1</version>
<version>3.4.2</version>
<configuration>
<!-- Generated file that shouldn't be included in add-ons -->
<excludes>
Expand Down
4 changes: 2 additions & 2 deletions flow-tests/test-express-build/java-add-on/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.4.1</version>
<version>3.4.2</version>
<configuration>
<archive>
<index>true</index>
Expand Down Expand Up @@ -112,7 +112,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.4.1</version>
<version>3.4.2</version>
<configuration>
<!-- Generated file that shouldn't be included in add-ons -->
<excludes>
Expand Down
2 changes: 1 addition & 1 deletion flow-tests/test-express-build/test-dev-bundle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.4.1</version>
<version>3.4.2</version>
<configuration>
<excludes>
<exclude>**/*Fake*</exclude>
Expand Down
2 changes: 1 addition & 1 deletion flow-tests/test-express-build/test-prod-bundle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.4.1</version>
<version>3.4.2</version>
<configuration>
<excludes>
<exclude>**/*Fake*</exclude>
Expand Down
4 changes: 2 additions & 2 deletions flow-tests/vaadin-spring-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

<properties>
<maven.deploy.skip>true</maven.deploy.skip>
<component.version>24.4.2</component.version>
<component.version>24.4.3</component.version>
<nimbus-jose-jwt.version>9.40</nimbus-jose-jwt.version>
</properties>

Expand Down Expand Up @@ -202,7 +202,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.4.1</version>
<version>3.4.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.4.1</version>
<version>3.4.2</version>
<executions>
<execution>
<goals>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.4.1</version>
<version>3.4.2</version>
<executions>
<execution>
<goals>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.4.1</version>
<version>3.4.2</version>
<executions>
<execution>
<goals>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.4.1</version>
<version>3.4.2</version>
<executions>
<execution>
<goals>
Expand Down
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@
<!-- Plugins -->
<frontend.maven.plugin.version>1.5</frontend.maven.plugin.version>
<maven.surefire.plugin.version>3.3.0</maven.surefire.plugin.version>
<maven.failsafe.plugin.version>3.2.5</maven.failsafe.plugin.version>
<maven.failsafe.plugin.version>3.3.0</maven.failsafe.plugin.version>
<maven.war.plugin.version>3.4.0</maven.war.plugin.version>
<maven.resources.plugin.version>3.0.2</maven.resources.plugin.version>
<maven.clean.plugin.version>3.3.2</maven.clean.plugin.version>
<maven.clean.plugin.version>3.4.0</maven.clean.plugin.version>
<maven.exec.plugin.version>1.6.0</maven.exec.plugin.version>
<testbench.version>9.3.0</testbench.version>
<testbench.version>9.3.1</testbench.version>
<jetty.version>12.0.10</jetty.version>
<properties-maven-plugin.version>1.2.1</properties-maven-plugin.version>
<build-helper-maven-plugin.version>3.6.0</build-helper-maven-plugin.version>
Expand Down Expand Up @@ -251,7 +251,7 @@
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>license-checker</artifactId>
<version>1.12.12</version>
<version>1.12.13</version>
</dependency>

<!-- Test dependencies -->
Expand Down Expand Up @@ -508,7 +508,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.4.1</version>
<version>3.4.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
2 changes: 1 addition & 1 deletion vaadin-dev-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>open</artifactId>
<version>8.5.0</version>
<version>8.5.0.1</version>
</dependency>

<dependency>
Expand Down
13 changes: 11 additions & 2 deletions vaadin-spring/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,18 @@
<groupId>org.reflections</groupId>
<artifactId>reflections</artifactId>
<version>0.10.2</version>
<exclusions>
<exclusion>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.30.2-GA</version>
</dependency>


</dependencies>

<dependencyManagement>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,11 @@ public void onApplicationEvent(ClassPathChangedEvent event) {

private String convertToClassName(String fileName) {
if (fileName.endsWith(".class")) {
return fileName.replace(".class", "").replace(File.separatorChar,
'.');
String name = fileName.replace(".class", "").replace('/', '.');
if (File.separatorChar != '/') {
return name.replace(File.separatorChar, '.');
}
return name;
} else {
return null;
}
Expand Down

0 comments on commit 02fb8e2

Please sign in to comment.