|
|
@@ -22,15 +22,18 @@ import java.util.Map; |
|
|
|
* 读取Idea信息的工具类 |
|
|
|
*/ |
|
|
|
public class IdeaUtil { |
|
|
|
private final static int MODE_POM = 1; |
|
|
|
//获取工程中的Module文件 |
|
|
|
public static Map<String, String> getModules(String ideaPath) { |
|
|
|
File file = new File(ideaPath + "/pom.xml"); |
|
|
|
if (file.exists()) { |
|
|
|
return getModulesFromPom(ideaPath, file); |
|
|
|
public static Map<String, String> getModules(String ideaPath, int mode) { |
|
|
|
if (mode == MODE_POM) { |
|
|
|
File file = new File(ideaPath + "/pom.xml"); |
|
|
|
if (file.exists()) { |
|
|
|
return getModulesFromPom(ideaPath, file); |
|
|
|
} |
|
|
|
} else { |
|
|
|
File file = new File(ideaPath + "/.idea/modules.xml"); |
|
|
|
if (file.exists()) return getModulesFromModule(ideaPath, file); |
|
|
|
} |
|
|
|
|
|
|
|
file = new File(ideaPath + "/.idea/modules.xml"); |
|
|
|
if (file.exists()) return getModulesFromModule(ideaPath, file); |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
@@ -62,14 +65,6 @@ public class IdeaUtil { |
|
|
|
return map; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static void main(String args[]) throws Exception { |
|
|
|
Map<String, String> list = getModules("e:/jujia/git/6.0/smtweb2/smtweb-framework"); |
|
|
|
for (Map.Entry<String, String> s : list.entrySet()) { |
|
|
|
System.out.println(s.getKey() + "=" + s.getValue()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Data |
|
|
|
@JsonIgnoreProperties(ignoreUnknown = true) |
|
|
|
@JacksonXmlRootElement(localName = "project") |
|
|
|