Skip to content

Commit a135372

Browse files
authored
fix: Read Hilla version from correct file (#18807)
* fix: Read Hilla version from correct file Fixes vaadin/platform#5014 * Update Platform.java
1 parent 89b1a03 commit a135372

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

flow-server/src/main/java/com/vaadin/flow/server/Platform.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
* @since 23.0
3030
*/
3131
public class Platform implements Serializable {
32+
static final String HILLA_POM_PROPERTIES = "META-INF/maven/com.vaadin/hilla/pom.properties";
3233
private static final Logger LOGGER = LoggerFactory
3334
.getLogger(Platform.class);
3435
/**
@@ -87,15 +88,15 @@ public static Optional<String> getHillaVersion() {
8788
// immutable and thread-safe.
8889
if (hillaVersion == null) {
8990
try (final InputStream hillaPomProperties = Thread.currentThread()
90-
.getContextClassLoader().getResourceAsStream(
91-
"META-INF/maven/com.vaadin.hilla/hilla/pom.properties")) {
91+
.getContextClassLoader()
92+
.getResourceAsStream(HILLA_POM_PROPERTIES)) {
9293
if (hillaPomProperties != null) {
9394
final Properties properties = new Properties();
9495
properties.load(hillaPomProperties);
9596
hillaVersion = properties.getProperty("version", "");
9697
} else {
9798
LOGGER.info("Unable to determine Hilla version. "
98-
+ "No META-INF/maven/com.vaadin.hilla/hilla/pom.properties found");
99+
+ "No {} found", HILLA_POM_PROPERTIES);
99100
hillaVersion = "";
100101
}
101102
} catch (Exception e) {

flow-server/src/test/java/com/vaadin/flow/server/PlatformTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ private void fakeVaadinHilla(String vaadinVersion, String hillaVersion)
6464

6565
if (hillaVersion != null) {
6666
final Path hillaJar = temporary.newFolder().toPath();
67-
final Path pomProperties = hillaJar.resolve(
68-
"META-INF/maven/com.vaadin.hilla/hilla/pom.properties");
67+
final Path pomProperties = hillaJar
68+
.resolve(Platform.HILLA_POM_PROPERTIES);
6969
Files.createDirectories(pomProperties.getParent());
7070
Files.writeString(pomProperties, "version=" + hillaVersion);
7171
classPath.add(hillaJar.toUri().toURL());

0 commit comments

Comments
 (0)