View Javadoc
1   package net.avcompris.devops;
2   
3   import javax.annotation.Nullable;
4   
5   import net.avcompris.binding.annotation.Namespaces;
6   import net.avcompris.binding.annotation.XPath;
7   
8   @Namespaces("xmlns:pom=http://maven.apache.org/POM/4.0.0")
9   @XPath("/pom:project")
10  public interface Pom {
11  
12  	@XPath("pom:modelVersion")
13  	String getModelVersion();
14  
15  	@Nullable
16  	@XPath("pom:groupId")
17  	String getGroupId();
18  
19  	boolean isNullGroupId();
20  
21  	@XPath("pom:artifactId")
22  	String getArtifactId();
23  
24  	@Nullable
25  	@XPath("pom:version")
26  	String getVersion();
27  
28  	@Nullable
29  	@XPath("pom:packaging")
30  	String getPackaging();
31  
32  	@Nullable
33  	@XPath("pom:parent")
34  	Parent getParent();
35  
36  	interface Parent extends Dependency {
37  
38  		@XPath("pom:groupId")
39  		String getGroupId();
40  
41  		@XPath("pom:artifactId")
42  		String getArtifactId();
43  
44  		@XPath("pom:version")
45  		String getVersion();
46  	}
47  
48  	@XPath("pom:name")
49  	@Nullable
50  	String getName();
51  
52  	@XPath("pom:url")
53  	@Nullable
54  	String getUrl();
55  
56  	@XPath("pom:scm")
57  	@Nullable
58  	Scm getScm();
59  
60  	interface Scm {
61  
62  		@XPath("pom:connection")
63  		String getConnection();
64  
65  		@XPath("pom:developerConnection")
66  		String getDeveloperConnection();
67  
68  		@XPath("pom:url")
69  		String getUrl();
70  	}
71  
72  	@XPath("pom:ciManagement")
73  	@Nullable
74  	CiManagement getCiManagement();
75  
76  	interface CiManagement {
77  
78  		@XPath("pom:system")
79  		String getSystem();
80  
81  		@XPath("pom:url")
82  		String getUrl();
83  	}
84  
85  	@Nullable
86  	@XPath("pom:modules/pom:module")
87  	String[] getModules();
88  
89  	@XPath("pom:dependencies/pom:dependency")
90  	Dependency[] getDependencies();
91  
92  	interface Dependency {
93  
94  		@XPath("pom:groupId")
95  		String getGroupId();
96  
97  		@XPath("pom:artifactId")
98  		String getArtifactId();
99  
100 		@Nullable
101 		@XPath("pom:version")
102 		String getVersion();
103 	}
104 
105 	@XPath("pom:dependencyManagement")
106 	DependencyManagement getDependencyManagement();
107 
108 	boolean isNullDependencyManagement();
109 
110 	interface DependencyManagement {
111 
112 		@XPath("pom:dependencies/pom:dependency")
113 		Dependency[] getDependencies();
114 	}
115 
116 	@XPath("pom:repositories/pom:repository")
117 	Repository[] getRepositories();
118 
119 	@XPath("pom:repositories/pom:repository[pom:id = $arg0]")
120 	@Nullable
121 	Repository getRepository(String id);
122 
123 	interface Repository {
124 
125 		@XPath("pom:id")
126 		String getId();
127 
128 		@XPath("pom:url")
129 		String getUrl();
130 
131 		@XPath("pom:releases/pom:enabled = 'true'")
132 		boolean hasReleasesEnabled();
133 
134 		@XPath("pom:snapshots/pom:enabled = 'true'")
135 		boolean hasSnapshotsEnabled();
136 	}
137 
138 	@XPath("pom:distributionManagement")
139 	@Nullable
140 	DistributionManagement getDistributionManagement();
141 
142 	boolean isNullDistributionManagement();
143 
144 	interface DistributionManagement {
145 
146 		@Nullable
147 		@XPath("pom:snapshotRepository")
148 		DistributionRepository getSnapshotRepository();
149 
150 		@Nullable
151 		@XPath("pom:repository")
152 		DistributionRepository getRepository();
153 
154 		@XPath("pom:site")
155 		Site getSite();
156 	}
157 
158 	interface DistributionRepository {
159 
160 		@XPath("name()")
161 		String getElementName();
162 
163 		@XPath("pom:id")
164 		String getId();
165 
166 		@XPath("pom:name")
167 		String getName();
168 
169 		@XPath("pom:url")
170 		String getUrl();
171 
172 		@XPath("pom:uniqueVersion = 'true'")
173 		boolean hasUniqueVersion();
174 	}
175 
176 	interface Site {
177 
178 		@XPath("pom:id")
179 		String getId();
180 
181 		@XPath("pom:url")
182 		String getUrl();
183 	}
184 
185 	@XPath("pom:reporting/pom:plugins/pom:plugin")
186 	Plugin[] getReportingPlugins();
187 
188 	@XPath("pom:reporting/pom:plugins/pom:plugin[pom:artifactId = $arg0]")
189 	@Nullable
190 	Plugin getPlugin(String artifactId);
191 
192 	@XPath("pom:reporting/pom:plugins/pom:plugin[pom:artifactId = $arg0]")
193 	boolean isNullPlugin(String artifactId);
194 
195 	interface Plugin {
196 
197 		@XPath("pom:groupId")
198 		String getGroupId();
199 
200 		@XPath("pom:artifactId")
201 		String getArtifactId();
202 
203 		@XPath("pom:configuration")
204 		Configuration getConfiguration();
205 	}
206 
207 	interface Configuration {
208 
209 		@XPath("pom:encoding")
210 		String getEncoding();
211 
212 		@XPath("pom:links/pom:link")
213 		String[] getLinks();
214 	}
215 
216 	@Nullable
217 	@XPath("pom:licenses/pom:license")
218 	License[] getLicenses();
219 
220 	interface License {
221 
222 		@XPath("pom:name")
223 		String getName();
224 
225 		@XPath("pom:url")
226 		String getUrl();
227 
228 		@XPath("pom:distribution")
229 		String getDistribution();
230 
231 		@XPath("pom:comments")
232 		String getComments();
233 	}
234 }