diff --git a/cli/src/main/java/com/devonfw/tools/ide/tool/ide/PluginDescriptor.java b/cli/src/main/java/com/devonfw/tools/ide/tool/ide/PluginDescriptor.java index 733ec18b9..64b3b957e 100644 --- a/cli/src/main/java/com/devonfw/tools/ide/tool/ide/PluginDescriptor.java +++ b/cli/src/main/java/com/devonfw/tools/ide/tool/ide/PluginDescriptor.java @@ -17,11 +17,6 @@ public interface PluginDescriptor extends Tags { */ String getName(); - /** - * @return the optional plugin version. - */ - String getVersion(); - /** * @return the optional plugin URL (download/update site). */ diff --git a/cli/src/main/java/com/devonfw/tools/ide/tool/ide/PluginDescriptorImpl.java b/cli/src/main/java/com/devonfw/tools/ide/tool/ide/PluginDescriptorImpl.java index 46834e5e2..6b32d1061 100644 --- a/cli/src/main/java/com/devonfw/tools/ide/tool/ide/PluginDescriptorImpl.java +++ b/cli/src/main/java/com/devonfw/tools/ide/tool/ide/PluginDescriptorImpl.java @@ -21,8 +21,6 @@ public class PluginDescriptorImpl implements PluginDescriptor { private final String name; - private final String version; - private final String url; private final boolean active; @@ -34,17 +32,15 @@ public class PluginDescriptorImpl implements PluginDescriptor { * * @param id the {@link #getId() ID}. * @param name the {@link #getName() name}. - * @param version the {@link #getVersion() URL}. * @param url the {@link #getUrl() URL}. * @param active the {@link #isActive() active flag}. * @param tags the {@link #getTags() tags}. */ - public PluginDescriptorImpl(String id, String name, String version, String url, boolean active, Set tags) { + public PluginDescriptorImpl(String id, String name, String url, boolean active, Set tags) { super(); this.id = id; this.name = name; - this.version = version; this.url = url; this.active = active; this.tags = tags; @@ -62,12 +58,6 @@ public String getName() { return this.name; } - @Override - public String getVersion() { - - return this.version; - } - @Override public String getUrl() { @@ -104,7 +94,6 @@ public static PluginDescriptor of(Path propertiesFile, IdeLogger logger, boolean throw new IllegalStateException("Failed to load properties " + propertiesFile, e); } String id = getString(properties, "id", "plugin_id"); - String version = getString(properties, "version", "plugin_version"); String url = getString(properties, "url", "plugin_url"); if (needUrl && ((url == null) || url.isBlank())) { logger.warning("Missing plugin URL in {}", propertiesFile); @@ -112,7 +101,7 @@ public static PluginDescriptor of(Path propertiesFile, IdeLogger logger, boolean boolean active = getBoolean(properties, "active", "plugin_active", propertiesFile, logger); String tagsCsv = getString(properties, "tags", "plugin_tags"); Set tags = Tag.parseCsv(tagsCsv); - return new PluginDescriptorImpl(id, name, version, url, active, tags); + return new PluginDescriptorImpl(id, name, url, active, tags); } private static boolean getBoolean(Properties properties, String key, String legacyKey, Path propertiesFile, diff --git a/cli/src/main/java/com/devonfw/tools/ide/tool/mvn/Mvn.java b/cli/src/main/java/com/devonfw/tools/ide/tool/mvn/Mvn.java index 866fb8942..3f1b32299 100644 --- a/cli/src/main/java/com/devonfw/tools/ide/tool/mvn/Mvn.java +++ b/cli/src/main/java/com/devonfw/tools/ide/tool/mvn/Mvn.java @@ -2,7 +2,6 @@ import java.nio.file.Files; import java.nio.file.Path; -import java.util.Objects; import java.util.Set; import com.devonfw.tools.ide.common.Tag; @@ -38,7 +37,7 @@ public boolean install(boolean silent) { public void installPlugin(PluginDescriptor plugin) { Path mavenPlugin = this.context.getSoftwarePath().resolve(this.tool).resolve("lib/ext/" + plugin.getName() + ".jar"); - this.context.getFileAccess().download(getPluginUrl(plugin), mavenPlugin); + this.context.getFileAccess().download(plugin.getUrl(), mavenPlugin); if (Files.exists(mavenPlugin)) { this.context.success("Successfully added {} to {}", plugin.getName(), mavenPlugin.toString()); } else { @@ -46,19 +45,4 @@ public void installPlugin(PluginDescriptor plugin) { + "Please check the plugin properties file in {}", mavenPlugin.getFileName(), mavenPlugin.toAbsolutePath()); } } - - private String getPluginUrl(PluginDescriptor plugin) { - - if (plugin.getUrl() != null) { - return plugin.getUrl(); - } else { - return "https://repo1.maven.org/maven2/fr/jcgay/maven/" + plugin.getName() + "/" + getPluginVersion(plugin.getVersion()) + "/" + plugin.getName() - + "-" + getPluginVersion(plugin.getVersion()) + ".jar"; - } - } - - private String getPluginVersion(String version) { - - return Objects.requireNonNullElse(version, "latest"); - } }