mirror of
https://github.com/apache/maven-mvnd.git
synced 2025-09-10 21:22:03 +00:00
@@ -151,6 +151,7 @@ public class DefaultClient implements Client {
|
|||||||
" --add-opens java.base/java.io=ALL-UNNAMED"
|
" --add-opens java.base/java.io=ALL-UNNAMED"
|
||||||
+ " --add-opens java.base/java.lang=ALL-UNNAMED"
|
+ " --add-opens java.base/java.lang=ALL-UNNAMED"
|
||||||
+ " --add-opens java.base/java.util=ALL-UNNAMED"
|
+ " --add-opens java.base/java.util=ALL-UNNAMED"
|
||||||
|
+ " --add-opens java.base/sun.net.www.protocol.jar=ALL-UNNAMED"
|
||||||
+ " --add-opens java.base/sun.nio.fs=ALL-UNNAMED");
|
+ " --add-opens java.base/sun.nio.fs=ALL-UNNAMED");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -15,7 +15,6 @@
|
|||||||
*/
|
*/
|
||||||
package org.mvndaemon.mvnd.common;
|
package org.mvndaemon.mvnd.common;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.net.URLClassLoader;
|
import java.net.URLClassLoader;
|
||||||
@@ -26,10 +25,6 @@ import java.util.stream.Stream;
|
|||||||
public class MavenDaemon {
|
public class MavenDaemon {
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
// Disable URL caching so that the JVM does not try to cache resources
|
|
||||||
// loaded from jars that are built by a previous run
|
|
||||||
new File("txt").toURI().toURL().openConnection().setDefaultUseCaches(false);
|
|
||||||
|
|
||||||
final Path mvndHome = Environment.MVND_HOME.asPath();
|
final Path mvndHome = Environment.MVND_HOME.asPath();
|
||||||
URL[] classpath = Stream.concat(
|
URL[] classpath = Stream.concat(
|
||||||
/* jars */
|
/* jars */
|
||||||
|
@@ -168,14 +168,7 @@ public class Server implements AutoCloseable, Runnable {
|
|||||||
try {
|
try {
|
||||||
registry.close();
|
registry.close();
|
||||||
} finally {
|
} finally {
|
||||||
try {
|
|
||||||
socket.close();
|
socket.close();
|
||||||
} finally {
|
|
||||||
if (!noDaemon) {
|
|
||||||
clearCache("sun.net.www.protocol.jar.JarFileFactory", "urlCache");
|
|
||||||
clearCache("sun.net.www.protocol.jar.JarFileFactory", "fileCache");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -193,6 +186,7 @@ public class Server implements AutoCloseable, Runnable {
|
|||||||
cache.clear();
|
cache.clear();
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
// ignore
|
// ignore
|
||||||
|
LOGGER.warn("Error clearing cache {}.{}", clazzName, fieldName, t);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -263,6 +257,11 @@ public class Server implements AutoCloseable, Runnable {
|
|||||||
}
|
}
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
LOGGER.error("Error reading request", t);
|
LOGGER.error("Error reading request", t);
|
||||||
|
} finally {
|
||||||
|
if (!noDaemon) {
|
||||||
|
clearCache("sun.net.www.protocol.jar.JarFileFactory", "urlCache");
|
||||||
|
clearCache("sun.net.www.protocol.jar.JarFileFactory", "fileCache");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user