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