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 @XPath("pom:artifactId") 20 String getArtifactId(); 21 22 @Nullable 23 @XPath("pom:version") 24 String getVersion(); 25 26 @Nullable 27 @XPath("pom:packaging") 28 String getPackaging(); 29 30 @Nullable 31 @XPath("pom:parent") 32 Parent getParent(); 33 34 interface Parent extends Dependency { 35 36 @XPath("pom:groupId") 37 String getGroupId(); 38 39 @XPath("pom:artifactId") 40 String getArtifactId(); 41 42 @XPath("pom:version") 43 String getVersion(); 44 } 45 46 @XPath("pom:name") 47 @Nullable 48 String getName(); 49 50 @XPath("pom:url") 51 @Nullable 52 String getUrl(); 53 54 @XPath("pom:scm") 55 @Nullable 56 Scm getScm(); 57 58 interface Scm { 59 60 @XPath("pom:connection") 61 String getConnection(); 62 63 @XPath("pom:developerConnection") 64 String getDeveloperConnection(); 65 66 @XPath("pom:url") 67 String getUrl(); 68 } 69 70 @XPath("pom:ciManagement") 71 @Nullable 72 CiManagement getCiManagement(); 73 74 interface CiManagement { 75 76 @XPath("pom:system") 77 String getSystem(); 78 79 @XPath("pom:url") 80 String getUrl(); 81 } 82 83 @Nullable 84 @XPath("pom:modules/pom:module") 85 String[] getModules(); 86 87 @XPath("pom:dependencies/pom:dependency") 88 Dependency[] getDependencies(); 89 90 interface Dependency { 91 92 @XPath("pom:groupId") 93 String getGroupId(); 94 95 @XPath("pom:artifactId") 96 String getArtifactId(); 97 98 @Nullable 99 @XPath("pom:version") 100 String getVersion(); 101 } 102 103 @XPath("pom:repositories/pom:repository") 104 Repository[] getRepositories(); 105 106 @XPath("pom:repositories/pom:repository[pom:id = $arg0]") 107 Repository getRepository(String id); 108 109 interface Repository { 110 111 @XPath("pom:id") 112 String getId(); 113 114 @XPath("pom:url") 115 String getUrl(); 116 117 @XPath("pom:releases/pom:enabled = 'true'") 118 boolean hasReleasesEnabled(); 119 120 @XPath("pom:snapshots/pom:enabled = 'true'") 121 boolean hasSnapshotsEnabled(); 122 } 123 124 @XPath("pom:distributionManagement") 125 DistributionManagement getDistributionManagement(); 126 127 interface DistributionManagement { 128 129 @XPath("pom:site") 130 Site getSite(); 131 } 132 133 interface Site { 134 135 @XPath("pom:id") 136 String getId(); 137 138 @XPath("pom:url") 139 String getUrl(); 140 } 141 142 @XPath("pom:reporting/pom:plugins/pom:plugin") 143 Plugin[] getReportingPlugins(); 144 145 @XPath("pom:reporting/pom:plugins/pom:plugin[pom:artifactId = $arg0]") 146 @Nullable 147 Plugin getPlugin(String artifactId); 148 149 @XPath("pom:reporting/pom:plugins/pom:plugin[pom:artifactId = $arg0]") 150 boolean isNullPlugin(String artifactId); 151 152 interface Plugin { 153 154 @XPath("pom:groupId") 155 String getGroupId(); 156 157 @XPath("pom:artifactId") 158 String getArtifactId(); 159 160 @XPath("pom:configuration") 161 Configuration getConfiguration(); 162 } 163 164 interface Configuration { 165 166 @XPath("pom:encoding") 167 String getEncoding(); 168 169 @XPath("pom:links/pom:link") 170 String[] getLinks(); 171 } 172 173 @Nullable 174 @XPath("pom:licenses/pom:license") 175 License[] getLicenses(); 176 177 interface License { 178 179 @XPath("pom:name") 180 String getName(); 181 182 @XPath("pom:url") 183 String getUrl(); 184 185 @XPath("pom:distribution") 186 String getDistribution(); 187 188 @XPath("pom:comments") 189 String getComments(); 190 } 191 }