You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

pom.xml 8.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  3. <modelVersion>4.0.0</modelVersion>
  4. <parent>
  5. <groupId>org.sonarsource.sonarqube</groupId>
  6. <artifactId>sonarqube</artifactId>
  7. <version>7.1-SNAPSHOT</version>
  8. </parent>
  9. <artifactId>sonar-plugin-api</artifactId>
  10. <packaging>jar</packaging>
  11. <name>SonarQube :: Plugin API</name>
  12. <properties>
  13. <!--
  14. version as stored in JAR and displayed in webapp. It is
  15. overridden on Travis when replacing SNAPSHOT version by
  16. build unique version, for instance "6.3.0.12345".
  17. -->
  18. <buildVersion>${project.version}</buildVersion>
  19. <!--
  20. a truncated version on three fields is kept for backward-compatibility
  21. with scanners
  22. -->
  23. <buildVersionOnThreeFields>${buildVersion}</buildVersionOnThreeFields>
  24. </properties>
  25. <dependencies>
  26. <!--
  27. The following artifacts are shaded and relocated in an internal package.
  28. They are not visible by plugins
  29. -->
  30. <dependency>
  31. <groupId>com.google.code.gson</groupId>
  32. <artifactId>gson</artifactId>
  33. </dependency>
  34. <dependency>
  35. <groupId>com.google.guava</groupId>
  36. <artifactId>guava</artifactId>
  37. </dependency>
  38. <dependency>
  39. <groupId>commons-codec</groupId>
  40. <artifactId>commons-codec</artifactId>
  41. </dependency>
  42. <dependency>
  43. <groupId>commons-io</groupId>
  44. <artifactId>commons-io</artifactId>
  45. </dependency>
  46. <dependency>
  47. <groupId>commons-lang</groupId>
  48. <artifactId>commons-lang</artifactId>
  49. </dependency>
  50. <!--
  51. The following artifacts are shaded but not relocated. They
  52. are provided at runtime, so plugins can use them but
  53. can not change their version.
  54. Long-term target is to remove them from API. They should be
  55. embedded by plugins.
  56. -->
  57. <dependency>
  58. <groupId>${project.groupId}</groupId>
  59. <artifactId>sonar-check-api</artifactId>
  60. <version>${project.version}</version>
  61. </dependency>
  62. <dependency>
  63. <groupId>${project.groupId}</groupId>
  64. <artifactId>sonar-duplications</artifactId>
  65. <version>${project.version}</version>
  66. <exclusions>
  67. <exclusion>
  68. <groupId>org.slf4j</groupId>
  69. <artifactId>slf4j-api</artifactId>
  70. </exclusion>
  71. </exclusions>
  72. </dependency>
  73. <!--
  74. Transitive dependencies available at runtime. They are not shaded with API
  75. as they are not managed by SonarSource. Versions should not be
  76. overridden by plugins though.
  77. -->
  78. <dependency>
  79. <groupId>org.codehaus.woodstox</groupId>
  80. <artifactId>woodstox-core-lgpl</artifactId>
  81. <exclusions>
  82. <exclusion>
  83. <groupId>stax</groupId>
  84. <artifactId>stax-api</artifactId>
  85. </exclusion>
  86. </exclusions>
  87. </dependency>
  88. <dependency>
  89. <groupId>org.codehaus.woodstox</groupId>
  90. <artifactId>stax2-api</artifactId>
  91. </dependency>
  92. <dependency>
  93. <groupId>org.codehaus.staxmate</groupId>
  94. <artifactId>staxmate</artifactId>
  95. </dependency>
  96. <dependency>
  97. <groupId>com.google.code.findbugs</groupId>
  98. <artifactId>jsr305</artifactId>
  99. <scope>provided</scope>
  100. </dependency>
  101. <dependency>
  102. <groupId>org.slf4j</groupId>
  103. <artifactId>slf4j-api</artifactId>
  104. <optional>true</optional>
  105. <scope>provided</scope>
  106. </dependency>
  107. <dependency>
  108. <groupId>javax.servlet</groupId>
  109. <artifactId>javax.servlet-api</artifactId>
  110. <version>3.0.1</version>
  111. <scope>provided</scope>
  112. <optional>true</optional>
  113. </dependency>
  114. <dependency>
  115. <groupId>ch.qos.logback</groupId>
  116. <artifactId>logback-classic</artifactId>
  117. <scope>provided</scope>
  118. <optional>true</optional>
  119. </dependency>
  120. <dependency>
  121. <groupId>ch.qos.logback</groupId>
  122. <artifactId>logback-core</artifactId>
  123. <scope>provided</scope>
  124. <optional>true</optional>
  125. </dependency>
  126. <dependency>
  127. <groupId>junit</groupId>
  128. <artifactId>junit</artifactId>
  129. <scope>provided</scope>
  130. <optional>true</optional>
  131. </dependency>
  132. <!-- unit tests -->
  133. <dependency>
  134. <groupId>com.tngtech.java</groupId>
  135. <artifactId>junit-dataprovider</artifactId>
  136. <scope>test</scope>
  137. </dependency>
  138. <dependency>
  139. <groupId>org.assertj</groupId>
  140. <artifactId>assertj-core</artifactId>
  141. <scope>test</scope>
  142. </dependency>
  143. <dependency>
  144. <groupId>org.mockito</groupId>
  145. <artifactId>mockito-core</artifactId>
  146. <scope>test</scope>
  147. </dependency>
  148. <dependency>
  149. <groupId>${project.groupId}</groupId>
  150. <artifactId>sonar-testing-harness</artifactId>
  151. <scope>test</scope>
  152. </dependency>
  153. </dependencies>
  154. <build>
  155. <plugins>
  156. <plugin>
  157. <groupId>org.apache.maven.plugins</groupId>
  158. <artifactId>maven-shade-plugin</artifactId>
  159. <executions>
  160. <execution>
  161. <phase>package</phase>
  162. <goals>
  163. <goal>shade</goal>
  164. </goals>
  165. <configuration>
  166. <minimizeJar>true</minimizeJar>
  167. <createDependencyReducedPom>true</createDependencyReducedPom>
  168. <artifactSet>
  169. <excludes>
  170. <exclude>org.codehaus.woodstox:woodstox-core-lgpl</exclude>
  171. <exclude>org.codehaus.woodstox:stax2-api</exclude>
  172. <exclude>org.codehaus.staxmate:staxmate</exclude>
  173. </excludes>
  174. </artifactSet>
  175. <filters>
  176. <!-- The following deps are used transitively, so make sure they are not minimized -->
  177. <filter>
  178. <artifact>${project.groupId}:sonar-duplications</artifact>
  179. <includes>
  180. <include>**</include>
  181. </includes>
  182. </filter>
  183. <filter>
  184. <artifact>org.codehaus.sonar:sonar-channel</artifact>
  185. <includes>
  186. <include>**</include>
  187. </includes>
  188. </filter>
  189. <filter>
  190. <artifact>org.sonarsource.sonarqube:sonar-check-api</artifact>
  191. <includes>
  192. <include>**</include>
  193. </includes>
  194. </filter>
  195. </filters>
  196. <relocations>
  197. <relocation>
  198. <pattern>com.google</pattern>
  199. <shadedPattern>org.sonar.api.internal.google</shadedPattern>
  200. </relocation>
  201. <relocation>
  202. <pattern>org.apache.commons</pattern>
  203. <shadedPattern>org.sonar.api.internal.apachecommons</shadedPattern>
  204. </relocation>
  205. </relocations>
  206. </configuration>
  207. </execution>
  208. </executions>
  209. </plugin>
  210. <plugin>
  211. <groupId>org.apache.maven.plugins</groupId>
  212. <artifactId>maven-jar-plugin</artifactId>
  213. <executions>
  214. <execution>
  215. <goals>
  216. <goal>test-jar</goal>
  217. </goals>
  218. <configuration>
  219. <excludes>
  220. <exclude>logback-test.xml</exclude>
  221. </excludes>
  222. </configuration>
  223. </execution>
  224. </executions>
  225. </plugin>
  226. <plugin>
  227. <groupId>com.github.genthaler</groupId>
  228. <artifactId>beanshell-maven-plugin</artifactId>
  229. <executions>
  230. <execution>
  231. <id>compute-version-on-three-fields</id>
  232. <phase>generate-resources</phase>
  233. <goals>
  234. <goal>run</goal>
  235. </goals>
  236. <configuration>
  237. <script>
  238. <![CDATA[
  239. if (! "${buildVersion}".endsWith("-SNAPSHOT")) {
  240. // example: "6.3.0.1234". To be backward-compatible with scanners, only "6.3.0" must be kept
  241. fields = "${buildVersion}".split("\\.");
  242. sj = new StringJoiner(".");
  243. i = 0;
  244. for (String field : fields) {
  245. if (i == 3) {
  246. break;
  247. }
  248. sj.add(field);
  249. ++i;
  250. }
  251. project.getProperties().setProperty("buildVersionOnThreeFields", sj.toString());
  252. }
  253. ]]>
  254. </script>
  255. </configuration>
  256. </execution>
  257. </executions>
  258. </plugin>
  259. </plugins>
  260. <resources>
  261. <resource>
  262. <!-- Used to resolve variables in files sq-version.txt and sonar-api-version.txt -->
  263. <directory>src/main/resources</directory>
  264. <filtering>true</filtering>
  265. </resource>
  266. </resources>
  267. </build>
  268. </project>