1 | |
package org.apache.maven.plugins.patchtracker; |
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.plugins.patchtracker.tracking.PatchTracker; |
24 | |
import org.apache.maven.plugins.patchtracker.tracking.PatchTrackerException; |
25 | |
import org.apache.maven.plugins.patchtracker.tracking.PatchTrackerRequest; |
26 | |
import org.apache.maven.plugins.patchtracker.tracking.PatchTrackerResult; |
27 | |
import org.codehaus.plexus.component.repository.exception.ComponentLookupException; |
28 | |
|
29 | |
|
30 | |
|
31 | |
|
32 | |
|
33 | |
|
34 | |
|
35 | |
|
36 | 0 | public class CreatePatchMojo |
37 | |
extends AbstractPatchMojo |
38 | |
{ |
39 | |
|
40 | |
|
41 | |
public void execute() |
42 | |
throws MojoExecutionException |
43 | |
{ |
44 | |
|
45 | |
|
46 | 0 | String patchContent = getPatchContent(); |
47 | |
|
48 | 0 | PatchTrackerRequest patchTrackerRequest = buidPatchTrackerRequest( true ); |
49 | |
|
50 | 0 | patchTrackerRequest.setPatchContent( patchContent ); |
51 | |
|
52 | 0 | getLog().debug( patchTrackerRequest.toString() ); |
53 | |
|
54 | |
try |
55 | |
{ |
56 | 0 | PatchTracker patchTracker = getPatchTracker(); |
57 | 0 | PatchTrackerResult result = patchTracker.createPatch( patchTrackerRequest, getLog() ); |
58 | 0 | getLog().info( "issue created with id:" + result.getPatchId() + ", url:" + result.getPatchUrl() ); |
59 | |
} |
60 | 0 | catch ( ComponentLookupException e ) |
61 | |
{ |
62 | 0 | throw new MojoExecutionException( e.getMessage(), e ); |
63 | |
} |
64 | 0 | catch ( PatchTrackerException e ) |
65 | |
{ |
66 | 0 | throw new MojoExecutionException( e.getMessage(), e ); |
67 | 0 | } |
68 | |
|
69 | |
|
70 | 0 | } |
71 | |
|
72 | |
|
73 | |
} |