From 323b65f5c4659b0a8075fdc8983d75b4f81a7e25 Mon Sep 17 00:00:00 2001 From: 502647092 Date: Mon, 24 Aug 2015 12:26:41 +0800 Subject: [PATCH] modify pom and use resource filtering... Signed-off-by: 502647092 --- pom.xml | 36 +++++++++++-------- .../citycraft/Yum/utils/DownloadManager.java | 7 +++- src/main/resources/plugin.yml | 9 ++--- 3 files changed, 32 insertions(+), 20 deletions(-) diff --git a/pom.xml b/pom.xml index a09c5d2..7c8cde6 100644 --- a/pom.xml +++ b/pom.xml @@ -1,23 +1,29 @@ 4.0.0 - cn.CityCraft + cn.citycraft Yum - 1.1 + 1.3 Yum - - ${project.name} - - - maven-compiler-plugin - 3.1 - - 1.7 - 1.7 - - - - + + ${project.name} + + + src/main/resources + true + + + + + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + + spigot-repo diff --git a/src/main/java/cn/citycraft/Yum/utils/DownloadManager.java b/src/main/java/cn/citycraft/Yum/utils/DownloadManager.java index bd9822c..14806fe 100644 --- a/src/main/java/cn/citycraft/Yum/utils/DownloadManager.java +++ b/src/main/java/cn/citycraft/Yum/utils/DownloadManager.java @@ -112,7 +112,12 @@ public class DownloadManager { public boolean update(CommandSender sender, Plugin plugin) { String pluginname = plugin.getName(); String filename = PluginsManager.getPluginFile(plugin).getName(); - return run(sender, getUrl(pluginname), new File("plugins/update", filename)); + URL url = getUrl(pluginname); + if (url == null) { + sender.sendMessage("§4错误: §cURL地址解析失败!"); + return false; + } + return run(sender, url, new File("plugins/update", filename)); } public boolean yum(CommandSender sender, String pluginname) { diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 3da7fa4..4bee596 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,7 +1,8 @@ -name: Yum -main: cn.citycraft.Yum.Yum -website: http://ci.citycraft.cn:8800/jenkins/job/Yum/ -version: 1.3 +name: ${project.artifactId} +main: ${project.groupId}.${project.artifactId}.${project.artifactId} +website: http://ci.citycraft.cn:8800/jenkins/job/${project.artifactId}/ +version: ${project.version} + commands: yum: description: MC插件仓库