Skip to content

Commit

Permalink
fixed upgrade problem
Browse files Browse the repository at this point in the history
  • Loading branch information
thevpc committed Jan 4, 2025
1 parent 6883734 commit 2ec4ca6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public abstract class AbstractNSearchCmd extends DefaultNQueryBaseOptions<NSearc
protected boolean sorted = false;
protected Boolean defaultVersions = null;
protected String execType = null;
protected NVersion targetApiVersion = null;
protected NVersion targetApiVersion;
protected NInstallStatusFilter installStatus;

public AbstractNSearchCmd(NSession session) {
Expand Down
28 changes: 17 additions & 11 deletions core/nuts/src/main/java/net/thevpc/nuts/boot/NBootWorkspace.java
Original file line number Diff line number Diff line change
Expand Up @@ -448,20 +448,23 @@ private NIdCache getFallbackCache(NId baseId, boolean lastWorkspace, boolean cop
for (Path path : stream.collect(Collectors.toList())) {
NVersion version = NVersion.of(path.getFileName().toString()).orNull();
if (version != null) {
if (Files.isDirectory(path)) {
NId rId = baseId.builder().setVersion(version).build();
Path jar = ss.resolve(version.toString()).resolve(NIdUtils.resolveFileName(
rId,
"jar"
));
if (Files.isRegularFile(jar)) {
if (bestVersion == null || bestVersion.compareTo(version) < 0) {
bestVersion = version;
bestPath = jar;
bestId = rId;
if (!(baseId.equals(NId.RUNTIME_ID) && !version.toString().startsWith(Nuts.getVersion() + "."))) {
if (Files.isDirectory(path)) {
NId rId = baseId.builder().setVersion(version).build();
Path jar = ss.resolve(version.toString()).resolve(NIdUtils.resolveFileName(
rId,
"jar"
));
if (Files.isRegularFile(jar)) {
if (bestVersion == null || bestVersion.compareTo(version) < 0) {
bestVersion = version;
bestPath = jar;
bestId = rId;
}
}
}
}

}
}
} catch (Exception ex) {
Expand Down Expand Up @@ -1054,6 +1057,9 @@ public NSession openWorkspace() {
for (URL url : bootClassWorldURLs) {
bLog.log(Level.SEVERE, NLogVerb.FAIL, NMsg.ofC("\t %s", NReservedIOUtils.formatURL(url)));
}
if (exceptions.isEmpty()) {
bLog.log(Level.SEVERE, NLogVerb.FAIL, NMsg.ofC("current classpath does not any Nuts Workspace implementation at %s", computedOptions.getWorkspace().orNull()));
}
for (Throwable exception : exceptions) {
bLog.log(Level.SEVERE, NLogVerb.FAIL, NMsg.ofC("%s", exception), exception);
}
Expand Down

0 comments on commit 2ec4ca6

Please sign in to comment.