redmine使用的版本為 2.3.01、打開rest web service2、jar依賴 3、代碼 ...
redmine使用的版本為 2.3.0
1、打開rest web service
2、jar依賴
<dependency> <groupId>com.taskadapter</groupId> <artifactId>redmine-java-api</artifactId> <version>1.17</version> </dependency>
3、代碼
public class test { public static void main(String[] args) { // TODO Auto-generated method stub RedmineManager mgr = new RedmineManager("http://xxxxxx/redmine", "kongxianghao", "12345678"); try { tryGetIssues(mgr); } catch (Exception e) { e.printStackTrace(); } } private static void tryGetIssues(RedmineManager mgr) throws Exception { // List<Project> list = mgr.getProjects(); Project project = mgr.getProjectByKey("143"); // 項目跟者 for (Tracker tk : project.getTrackers()) { System.out.println(tk.getId() + "-->" + tk.getName()); } // 項目的問題 List<Issue> issues = mgr.getIssues("143", null); for (Issue issue : issues) { System.out.println(issue.getId() + issue.toString()); } } }