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

Web fragments (attempt #2) #10227

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

Conversation

Vlatombe
Copy link
Member

@Vlatombe Vlatombe commented Jan 31, 2025

Tested with mvn -pl war jetty:run.

For running plugins with mvn hpi:run, jenkinsci/maven-hpi-plugin#710 is necessary and should be referred through the plugin parent pom before this gets merged.

See JENKINS-XXXXX.

Testing done

Proposed changelog entries

  • human-readable text

Proposed upgrade guidelines

N/A

Submitter checklist

Preview Give feedback

Desired reviewers

@mention

Before the changes are marked as ready-for-merge:

Maintainer checklist

Preview Give feedback

* Remove core classes from extra classpath, as when running `mvn -pl war
  jetty:run` it automatically gets added.
<!-- Allows resources to be reloaded, and enable nicer console logging. -->
<extraClasspath>${project.basedir}/../core/src/main/resources,${project.basedir}/../core/target/classes,${project.build.directory}/support-log-formatter.jar</extraClasspath>
<!-- Enable nicer console logging. -->
<extraClasspath>${project.build.directory}/support-log-formatter.jar</extraClasspath>
Copy link
Member Author

@Vlatombe Vlatombe Jan 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While investigating some warnings during the startup, I realised that the jetty-maven-plugin already include core classes and resources from the module itself and not from the local maven repository (as long as mvn -pl war jetty:run is used).

Which means these extra classpath entries shouldn't be necessary to get live updates through hot reload.

Unfortunately, hot reload currently fails with

java.nio.file.ClosedFileSystemException
    at jdk.nio.zipfs.ZipFileSystem.ensureOpen (ZipFileSystem.java:1635)
    at jdk.nio.zipfs.ZipFileSystem.exists (ZipFileSystem.java:657)
    at jdk.nio.zipfs.ZipPath.exists (ZipPath.java:905)
    at jdk.nio.zipfs.ZipFileSystemProvider.exists (ZipFileSystemProvider.java:197)
    at java.nio.file.Files.exists (Files.java:2515)
    at org.eclipse.jetty.util.resource.PathResource.exists (PathResource.java:187)
    at org.eclipse.jetty.ee9.webapp.WebAppClassLoader.addClassPath (WebAppClassLoader.java:225)
    at org.eclipse.jetty.ee9.webapp.WebAppClassLoader.<init> (WebAppClassLoader.java:192)
    at org.eclipse.jetty.ee9.webapp.WebAppContext.configureClassLoader (WebAppContext.java:504)
    at org.eclipse.jetty.ee9.webapp.WebAppContext.preConfigure (WebAppContext.java:477)
    at org.eclipse.jetty.ee9.webapp.WebAppContext.doStart (WebAppContext.java:527)
    at org.eclipse.jetty.ee9.maven.plugin.MavenWebAppContext.doStart (MavenWebAppContext.java:313)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:93)
    at org.eclipse.jetty.ee9.maven.plugin.JettyEmbedder.redeployWebApp (JettyEmbedder.java:64)
    at org.eclipse.jetty.ee9.maven.plugin.JettyRunMojo.restartWebApp (JettyRunMojo.java:362)
    at org.eclipse.jetty.ee9.maven.plugin.JettyRunMojo$2.consoleEvent (JettyRunMojo.java:198)
    at org.eclipse.jetty.maven.ConsoleReader.signalEvent (ConsoleReader.java:64)
    at org.eclipse.jetty.maven.ConsoleReader.run (ConsoleReader.java:57)
    at java.lang.Thread.run (Thread.java:1583)

that seems to be caused by a JDK bug? (see jetty/jetty.project#11548)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant