1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
|
20 | |
package org.apache.maven.plugin.jira; |
21 | |
|
22 | |
import org.apache.maven.plugin.MojoExecutionException; |
23 | |
import org.apache.maven.plugin.issues.Issue; |
24 | |
|
25 | |
import java.util.List; |
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | |
|
32 | |
|
33 | |
|
34 | 0 | public class AdaptiveJiraDownloader extends AbstractJiraDownloader |
35 | |
{ |
36 | |
private AbstractJiraDownloader effectiveDownloader; |
37 | |
private boolean forceClassic; |
38 | |
|
39 | |
|
40 | |
public void doExecute() |
41 | |
throws Exception |
42 | |
{ |
43 | 0 | effectiveDownloader = new RestJiraDownloader(); |
44 | 0 | copySettings( effectiveDownloader ); |
45 | |
try |
46 | |
{ |
47 | 0 | effectiveDownloader.doExecute(); |
48 | |
} |
49 | 0 | catch( RestJiraDownloader.NoRest nre ) |
50 | |
{ |
51 | 0 | getLog().info( "Falling back to RSS for issue download: " + nre.getMessage() ); |
52 | 0 | effectiveDownloader = new ClassicJiraDownloader(); |
53 | 0 | copySettings( effectiveDownloader ); |
54 | 0 | effectiveDownloader.doExecute(); |
55 | 0 | } |
56 | 0 | } |
57 | |
|
58 | |
private void copySettings( AbstractJiraDownloader target ) |
59 | |
{ |
60 | 0 | target.setLog( getLog() ); |
61 | 0 | target.setMavenProject( project ); |
62 | 0 | target.setOutput( output ); |
63 | 0 | target.setNbEntries( nbEntriesMax ); |
64 | 0 | target.setComponent( component ); |
65 | 0 | target.setFixVersionIds( fixVersionIds ); |
66 | 0 | target.setStatusIds( statusIds ); |
67 | 0 | target.setResolutionIds( resolutionIds ); |
68 | 0 | target.setPriorityIds( priorityIds ); |
69 | 0 | target.setSortColumnNames( sortColumnNames ); |
70 | 0 | target.setFilter( filter ); |
71 | 0 | target.setJiraDatePattern( jiraDatePattern ); |
72 | 0 | target.setJiraUser( jiraUser ); |
73 | 0 | target.setJiraPassword( jiraPassword ); |
74 | 0 | target.setTypeIds( typeIds ); |
75 | 0 | target.setWebUser( webUser ); |
76 | 0 | target.setWebPassword( webPassword ); |
77 | 0 | target.setSettings( settings ); |
78 | 0 | target.setUseJql( useJql ); |
79 | 0 | target.setOnlyCurrentVersion( onlyCurrentVersion ); |
80 | 0 | target.setVersionPrefix( versionPrefix ); |
81 | 0 | } |
82 | |
|
83 | |
|
84 | |
public List<Issue> getIssueList() |
85 | |
throws MojoExecutionException |
86 | |
{ |
87 | 0 | return effectiveDownloader.getIssueList(); |
88 | |
} |
89 | |
|
90 | |
public boolean isForceClassic() |
91 | |
{ |
92 | 0 | return forceClassic; |
93 | |
} |
94 | |
|
95 | |
public void setForceClassic( boolean forceClassic ) |
96 | |
{ |
97 | 0 | this.forceClassic = forceClassic; |
98 | 0 | } |
99 | |
} |