You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am migrating from spring boot 2.2.4 to 2.3.0.
We have written our custom layout factory and we are repackaging the jar through spring boot maven plugin.
But we started failing when migrated to spring boot 2.3.0 version. Everything works fine when we lower down the version from 2.3.0.
Before returning Module we are just verifying the content of the source jar. Earlier we were able to verify the resources but now the source jar is empty.
publicclassModuleLayoutFactoryimplementsLayoutFactory {
@OverridepublicLayoutgetLayout(Filefile) {
System.out.println("file path is " + file.getAbsolutePath() + "file Size" + file.length());
checkJarHasModuleConfigEntryWithLabelName(file);
returnnewModule();
}
/** * verify if module has a configuration file with the label name which defines the module. * @param file the jar file of the module */privatevoidcheckJarHasModuleConfigEntryWithLabelName(Filefile) {
try(InputStreamin = Files.newInputStream(file.toPath());
JarInputStreamjarInputStream = newJarInputStream(in)) {
booleanhasConfig = false;
JarEntryjarEntry;
while ((jarEntry = jarInputStream.getNextJarEntry()) != null) {
if (jarEntry.getName()
.equals("MODULE-INF/module-properties.yaml")) {
try(InputStreamReaderreader = newInputStreamReader(jarInputStream, StandardCharsets.UTF_8);
BufferedReaderbuffer = newBufferedReader(reader);) {
if (buffer.lines()
.noneMatch(line -> line.startsWith(" name: "))) {
thrownewIllegalArgumentException("Module does not contain a name tag in MODULE-INF/module-properties.yaml");
}
}
hasConfig = true;
break;
}
}
if (!hasConfig) {
thrownewIllegalArgumentException("Configuration file module-properties.yaml could not be found under MODULE-INF/");
}
}
catch (IOExceptione) {
thrownewUncheckedIOException(String.format(
"Cannot read jar '%s': %s", file, e), e);
}
}
}
philwebb
changed the title
Spring boot maven plugin 2.3.0 is not loading the resource folder in jar
LayoutFactory can be presented with 0 byte source file
Aug 18, 2020
philwebb
changed the title
LayoutFactory can be presented with 0 byte source file
LayoutFactory can be presented with empty source file
Aug 18, 2020
I am migrating from spring boot 2.2.4 to 2.3.0.
We have written our custom layout factory and we are repackaging the jar through spring boot maven plugin.
But we started failing when migrated to spring boot 2.3.0 version. Everything works fine when we lower down the version from 2.3.0.
Before returning Module we are just verifying the content of the source jar. Earlier we were able to verify the resources but now the source jar is empty.
Below is the sample example
https://github.com/skpandey91/sample
The text was updated successfully, but these errors were encountered: