pom.xml 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  3. <modelVersion>4.0.0</modelVersion>
  4. <parent>
  5. <groupId>org.jenkins-ci.main</groupId>
  6. <artifactId>jenkins-parent</artifactId>
  7. <version>${revision}${changelist}</version>
  8. </parent>
  9. <artifactId>cli</artifactId>
  10. <name>Jenkins cli</name>
  11. <description>Command line interface for Jenkins</description>
  12. <url>https://github.com/jenkinsci/jenkins</url>
  13. <properties>
  14. <mina-sshd.version>2.20.0</mina-sshd.version>
  15. <!-- Filled in by jacoco-maven-plugin -->
  16. <jacocoSurefireArgs />
  17. </properties>
  18. <dependencyManagement>
  19. <dependencies>
  20. <dependency>
  21. <groupId>org.jenkins-ci.main</groupId>
  22. <artifactId>jenkins-bom</artifactId>
  23. <version>${project.version}</version>
  24. <type>pom</type>
  25. <scope>import</scope>
  26. </dependency>
  27. </dependencies>
  28. </dependencyManagement>
  29. <dependencies>
  30. <dependency>
  31. <groupId>commons-io</groupId>
  32. <artifactId>commons-io</artifactId>
  33. <optional>true</optional>
  34. </dependency>
  35. <dependency>
  36. <groupId>org.apache.sshd</groupId>
  37. <artifactId>sshd-common</artifactId>
  38. <version>${mina-sshd.version}</version>
  39. <optional>true</optional>
  40. </dependency>
  41. <dependency>
  42. <groupId>org.apache.sshd</groupId>
  43. <artifactId>sshd-core</artifactId>
  44. <version>${mina-sshd.version}</version>
  45. <optional>true</optional>
  46. </dependency>
  47. <dependency>
  48. <groupId>org.bouncycastle</groupId>
  49. <artifactId>bcprov-jdk18on</artifactId>
  50. <version>1.86</version>
  51. <optional>true</optional>
  52. </dependency>
  53. <dependency>
  54. <groupId>org.glassfish.tyrus.bundles</groupId>
  55. <artifactId>tyrus-standalone-client-jdk</artifactId>
  56. <version>2.2.2</version>
  57. <optional>true</optional>
  58. </dependency>
  59. <dependency>
  60. <groupId>org.jenkins-ci</groupId>
  61. <artifactId>annotation-indexer</artifactId>
  62. <optional>true</optional>
  63. </dependency>
  64. <dependency>
  65. <groupId>org.jvnet.localizer</groupId>
  66. <artifactId>localizer</artifactId>
  67. <optional>true</optional>
  68. </dependency>
  69. <dependency>
  70. <groupId>org.slf4j</groupId>
  71. <artifactId>slf4j-jdk14</artifactId>
  72. <optional>true</optional>
  73. </dependency>
  74. <dependency>
  75. <groupId>com.github.spotbugs</groupId>
  76. <artifactId>spotbugs-annotations</artifactId>
  77. <scope>provided</scope>
  78. <optional>true</optional>
  79. <exclusions>
  80. <exclusion>
  81. <groupId>com.google.code.findbugs</groupId>
  82. <artifactId>jsr305</artifactId>
  83. </exclusion>
  84. </exclusions>
  85. </dependency>
  86. <dependency>
  87. <groupId>org.kohsuke</groupId>
  88. <artifactId>access-modifier-annotation</artifactId>
  89. <scope>provided</scope>
  90. </dependency>
  91. <dependency>
  92. <groupId>org.junit.jupiter</groupId>
  93. <artifactId>junit-jupiter</artifactId>
  94. <scope>test</scope>
  95. </dependency>
  96. </dependencies>
  97. <build>
  98. <plugins>
  99. <plugin>
  100. <groupId>org.apache.maven.plugins</groupId>
  101. <artifactId>maven-compiler-plugin</artifactId>
  102. <configuration>
  103. <annotationProcessorPaths>
  104. <!-- Indexes @Restricted; version resolves from dependencyManagement (jenkins-bom) -->
  105. <path>
  106. <groupId>org.jenkins-ci</groupId>
  107. <artifactId>annotation-indexer</artifactId>
  108. </path>
  109. </annotationProcessorPaths>
  110. </configuration>
  111. </plugin>
  112. <plugin>
  113. <artifactId>maven-surefire-plugin</artifactId>
  114. <!-- Version specified in grandparent POM -->
  115. <configuration>
  116. <argLine>@{jacocoSurefireArgs}</argLine>
  117. </configuration>
  118. </plugin>
  119. <plugin>
  120. <groupId>org.apache.maven.plugins</groupId>
  121. <artifactId>maven-shade-plugin</artifactId>
  122. <version>3.6.2</version>
  123. <executions>
  124. <execution>
  125. <goals>
  126. <goal>shade</goal>
  127. </goals>
  128. <phase>package</phase>
  129. <configuration>
  130. <createDependencyReducedPom>false</createDependencyReducedPom>
  131. <relocations>
  132. <relocation>
  133. <pattern>org</pattern>
  134. <shadedPattern>io.jenkins.cli.shaded.org</shadedPattern>
  135. </relocation>
  136. <relocation>
  137. <pattern>net</pattern>
  138. <shadedPattern>io.jenkins.cli.shaded.net</shadedPattern>
  139. </relocation>
  140. <relocation>
  141. <pattern>com</pattern>
  142. <shadedPattern>io.jenkins.cli.shaded.com</shadedPattern>
  143. </relocation>
  144. <relocation>
  145. <pattern>jakarta</pattern>
  146. <shadedPattern>io.jenkins.cli.shaded.jakarta</shadedPattern>
  147. </relocation>
  148. </relocations>
  149. <transformers>
  150. <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
  151. <mainClass>hudson.cli.CLI</mainClass>
  152. <manifestEntries>
  153. <Jenkins-CLI-Version>${project.version}</Jenkins-CLI-Version>
  154. </manifestEntries>
  155. </transformer>
  156. <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
  157. </transformers>
  158. <filters>
  159. <filter>
  160. <!-- signature might cause some trouble -->
  161. <artifact>*:*</artifact>
  162. <excludes>
  163. <exclude>META-INF/*.SF</exclude>
  164. <exclude>META-INF/*.DSA</exclude>
  165. <exclude>META-INF/*.RSA</exclude>
  166. <!--
  167. Multi-release variants are dead code in this uber jar: the shaded manifest does not declare
  168. Multi-Release: true and the versioned classes are not relocated, so the JVM can never load
  169. them. BouncyCastle et al. run on their base classes.
  170. -->
  171. <exclude>META-INF/versions/**</exclude>
  172. <!--
  173. annotation-indexer declares an annotation processor. Relocating it leaves this
  174. uber jar advertising io.jenkins.cli.shaded...AnnotationProcessorImpl, so javac
  175. runs it in every module that compiles against the CLI. It can never match
  176. anything, since the annotations it looks for are relocated too, but it does
  177. defeat compile avoidance. A runtime CLI jar has no compile-time processor.
  178. -->
  179. <exclude>META-INF/services/javax.annotation.processing.Processor</exclude>
  180. </excludes>
  181. </filter>
  182. </filters>
  183. </configuration>
  184. </execution>
  185. </executions>
  186. </plugin>
  187. <plugin>
  188. <groupId>org.jvnet.localizer</groupId>
  189. <artifactId>localizer-maven-plugin</artifactId>
  190. <!-- version specified in grandparent pom -->
  191. <executions>
  192. <execution>
  193. <goals>
  194. <goal>generate</goal>
  195. </goals>
  196. <configuration>
  197. <fileMask>Messages.properties</fileMask>
  198. <outputDirectory>target/generated-sources/localizer</outputDirectory>
  199. <accessModifierAnnotations>true</accessModifierAnnotations>
  200. </configuration>
  201. </execution>
  202. </executions>
  203. </plugin>
  204. <plugin>
  205. <groupId>org.codehaus.mojo</groupId>
  206. <artifactId>build-helper-maven-plugin</artifactId>
  207. <!-- Version specified in grandparent POM -->
  208. <executions>
  209. <execution>
  210. <id>add-source</id>
  211. <goals>
  212. <goal>add-source</goal>
  213. </goals>
  214. <phase>generate-sources</phase>
  215. <configuration>
  216. <sources>
  217. <source>${project.build.directory}/generated-sources/localizer</source>
  218. </sources>
  219. </configuration>
  220. </execution>
  221. </executions>
  222. </plugin>
  223. </plugins>
  224. </build>
  225. <profiles>
  226. <profile>
  227. <id>enable-jacoco</id>
  228. <build>
  229. <plugins>
  230. <plugin>
  231. <groupId>org.jacoco</groupId>
  232. <artifactId>jacoco-maven-plugin</artifactId>
  233. <!-- Version specified in parent POM -->
  234. <executions>
  235. <execution>
  236. <goals>
  237. <goal>prepare-agent</goal>
  238. </goals>
  239. <configuration>
  240. <propertyName>jacocoSurefireArgs</propertyName>
  241. <includes>
  242. <include>hudson/*</include>
  243. <include>hudson/**/*</include>
  244. <include>jenkins/*</include>
  245. <include>jenkins/**/*</include>
  246. <include>org/jenkins/**/*</include>
  247. </includes>
  248. <excludes>
  249. <exclude>**/Messages.class</exclude>
  250. </excludes>
  251. </configuration>
  252. </execution>
  253. </executions>
  254. </plugin>
  255. </plugins>
  256. </build>
  257. </profile>
  258. </profiles>
  259. </project>