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 7.1KB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
Provision libraries in 'lib' automatically Upon special request by Andy Clement, I included 'lib' as a child module in the parent POM again, making several modules which refer to downloaded library files dependent the 'lib' module. I am not sure I caught all of them, but I hope so. Now after cloning the project and configuring the token for reading from GitHub Packages (sorry!), you can just run a Maven build for the main project and no longer need to fail the first build, read the Maven Enforcer message and run 'cd lib && mvn compile' as a first step. This convenience comes at the price of a more complex POM and two new profiles: - Profile 'provision-libs' is auto-activated by the absence of a marker file, kicking off the library provisioning process and creating same marker file at the end, if successful. Therefore, during subsequent builds libraries will not be re-provisioned, because the marker file exists and Maven skips all download and (un)zip steps, which saves build time and bandwidth. Otherwise offline builds would not work either. - Profile 'clean-libs' needs to be activated manually, because by default 'mvn clean' will not erase provisioned libraries. In most cases, even after a clean a developer does not want to re-provision all libraries if they have not changed (e.g. new JDT Core build). But if you do wish too erase the libraries and the marker file, just call 'cd lib && mvn -P clean-libs clean'. Please note: The Maven Enforcer build step, which additionally checks for existence of other files, still exists and was moved from the parent POM to 'libs'. No matter if provisioning was just done or skipped because the main marker file exists, a quick heuristic check for that list of files is done during each build, failing the build with a comprehensive message if an inconsistency was found. The error message says which files are missing and tells the user: "There is an inconsistency in module subdirectory 'lib'. Please run 'mvn --projects lib -P clean-libs clean compile'. This should take care of cleaning and freshly downloading all necessary libraries to that directory, where some tests expect them to be." This should cover the topic. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
Make all tests run on Java 16 via '-add-opens' JVM option Due to JEP 260 (Encapsulate Most Internal APIs), aspect weaving on Java 16 now requires '--add-opens java.base/java.lang=ALL-UNNAMED' on the command line. Otherwise there will be illegal access exceptions for some internal API calls AspectJ needs, most prominently when trying to define classes in other packages or modules. This had to be done on several levels: - Maven Surefire: running tests in a JVM directly forked by Surefire. In order to make this backwards compatible, I added two profiles with JDK-level-dependent auto-activation, one 8-15 and one 16+. In the latter a property containing the JVM parameter is defined, in the former it is empty, i.e. the JVM is started without the parameter. In Java 8 the parameter did not even exist, in Java 9+ we could use it, but we need to test how users use AspectJ. - RunSpec: Whenever an XML test is declared to use '<run>', we need to determine the current JVM version and again dynamically add the parameter when forking the target JVM. - AntSpec: Whenever an XML test is declared to use '<ant>', we need to determine the current JVM version dynamically add two properties usable from within Ant scripts: 'aj.addOpensKey' and 'aj.addOpensValue'. Unfortunately, Ant needs to use two '<argLine>' parameters, because the two parts of the option are separated by a space character. - Ant scripts: When triggered by an AntSpec, each Ant target using LTW needs to manually set <jvmarg value="${aj.addOpensKey}"/> <jvmarg value="${aj.addOpensValue}"/> for each '<java>' task. It was quite tedious to find all(?) of them. TODO: In the AspectJ 1.9.7 release notes we need to document that this parameter is now needed for LTW. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
3 years ago
5 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. <project xmlns="http://maven.apache.org/POM/4.0.0"
  2. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  4. <modelVersion>4.0.0</modelVersion>
  5. <parent>
  6. <groupId>org.aspectj</groupId>
  7. <artifactId>aspectj-parent</artifactId>
  8. <version>1.9.10-SNAPSHOT</version>
  9. </parent>
  10. <artifactId>run-all-junit-tests</artifactId>
  11. <dependencies>
  12. <dependency>
  13. <!-- All modules referencing files inside 'lib' need this dependency -->
  14. <groupId>org.aspectj</groupId>
  15. <artifactId>lib</artifactId>
  16. <scope>test</scope>
  17. </dependency>
  18. <dependency>
  19. <groupId>org.aspectj</groupId>
  20. <artifactId>util</artifactId>
  21. <version>${project.version}</version>
  22. <type>test-jar</type>
  23. <scope>test</scope>
  24. </dependency>
  25. <dependency>
  26. <groupId>org.aspectj</groupId>
  27. <artifactId>ajde</artifactId>
  28. <version>${project.version}</version>
  29. <type>test-jar</type>
  30. <scope>test</scope>
  31. </dependency>
  32. <dependency>
  33. <groupId>org.aspectj</groupId>
  34. <artifactId>ajde.core</artifactId>
  35. <version>${project.version}</version>
  36. <type>test-jar</type>
  37. <scope>test</scope>
  38. </dependency>
  39. <dependency>
  40. <groupId>org.aspectj</groupId>
  41. <artifactId>asm</artifactId>
  42. <version>${project.version}</version>
  43. <type>test-jar</type>
  44. <scope>test</scope>
  45. </dependency>
  46. <dependency>
  47. <groupId>org.aspectj</groupId>
  48. <artifactId>bridge</artifactId>
  49. <version>${project.version}</version>
  50. <type>test-jar</type>
  51. <scope>test</scope>
  52. </dependency>
  53. <dependency>
  54. <groupId>org.aspectj</groupId>
  55. <artifactId>loadtime</artifactId>
  56. <version>${project.version}</version>
  57. <type>test-jar</type>
  58. <scope>test</scope>
  59. </dependency>
  60. <dependency>
  61. <groupId>org.aspectj</groupId>
  62. <artifactId>runtime</artifactId>
  63. <version>${project.version}</version>
  64. <type>test-jar</type>
  65. <scope>test</scope>
  66. </dependency>
  67. <dependency>
  68. <groupId>org.aspectj</groupId>
  69. <artifactId>ajdoc</artifactId>
  70. <version>${project.version}</version>
  71. <type>test-jar</type>
  72. <scope>test</scope>
  73. </dependency>
  74. <dependency>
  75. <groupId>org.aspectj</groupId>
  76. <artifactId>weaver</artifactId>
  77. <version>${project.version}</version>
  78. <type>test-jar</type>
  79. <scope>test</scope>
  80. </dependency>
  81. <dependency>
  82. <groupId>org.aspectj</groupId>
  83. <artifactId>taskdefs</artifactId>
  84. <version>${project.version}</version>
  85. <type>test-jar</type>
  86. <scope>test</scope>
  87. </dependency>
  88. <dependency>
  89. <groupId>org.aspectj</groupId>
  90. <artifactId>testing-client</artifactId>
  91. <version>${project.version}</version>
  92. <type>test-jar</type>
  93. <scope>test</scope>
  94. </dependency>
  95. <dependency>
  96. <groupId>org.aspectj</groupId>
  97. <artifactId>testing-drivers</artifactId>
  98. <version>${project.version}</version>
  99. <type>test-jar</type>
  100. <scope>test</scope>
  101. </dependency>
  102. <dependency>
  103. <groupId>org.aspectj</groupId>
  104. <artifactId>testing-util</artifactId>
  105. <version>${project.version}</version>
  106. <type>test-jar</type>
  107. <scope>test</scope>
  108. </dependency>
  109. <dependency>
  110. <groupId>org.aspectj</groupId>
  111. <artifactId>org.aspectj.matcher</artifactId>
  112. <version>${project.version}</version>
  113. <type>test-jar</type>
  114. <scope>test</scope>
  115. </dependency>
  116. <dependency>
  117. <groupId>org.aspectj</groupId>
  118. <artifactId>build</artifactId>
  119. <version>${project.version}</version>
  120. <type>test-jar</type>
  121. <scope>test</scope>
  122. </dependency>
  123. <dependency>
  124. <groupId>org.aspectj</groupId>
  125. <artifactId>tests</artifactId>
  126. <version>${project.version}</version>
  127. <type>test-jar</type>
  128. <scope>test</scope>
  129. </dependency>
  130. <dependency>
  131. <groupId>org.aspectj</groupId>
  132. <artifactId>org.aspectj.ajdt.core</artifactId>
  133. <version>${project.version}</version>
  134. <type>test-jar</type>
  135. <scope>test</scope>
  136. </dependency>
  137. <dependency>
  138. <groupId>org.aspectj</groupId>
  139. <artifactId>testing</artifactId>
  140. <version>${project.version}</version>
  141. <type>test-jar</type>
  142. <scope>test</scope>
  143. </dependency>
  144. <!--
  145. The tests need these during runtime, even though no direct usage is in our classes.
  146. See also 'usedDependencies' in maven-dependency-plugin configuration.
  147. -->
  148. <dependency>
  149. <groupId>ant</groupId>
  150. <artifactId>ant-launcher</artifactId>
  151. <version>${lib.ant.version}</version>
  152. <scope>test</scope>
  153. </dependency>
  154. <dependency>
  155. <groupId>org.ow2.asm</groupId>
  156. <artifactId>asm</artifactId>
  157. <scope>test</scope>
  158. </dependency>
  159. <dependency>
  160. <groupId>org.aspectj</groupId>
  161. <artifactId>ajde</artifactId>
  162. <version>${project.version}</version>
  163. <scope>test</scope>
  164. </dependency>
  165. <dependency>
  166. <groupId>org.aspectj</groupId>
  167. <artifactId>build</artifactId>
  168. <version>${project.version}</version>
  169. <scope>test</scope>
  170. </dependency>
  171. <dependency>
  172. <groupId>org.aspectj</groupId>
  173. <artifactId>tests</artifactId>
  174. <version>${project.version}</version>
  175. <scope>test</scope>
  176. </dependency>
  177. </dependencies>
  178. <profiles>
  179. <profile>
  180. <!--
  181. ATTENTION: This profile is inactive by default, because when active and running a full reactor build, it makes
  182. almost all tests run 2x, doubling the build time without any added value. This Maven module only exists for
  183. convenience: As a developer, your IDE can detect and run 'RunTheseBeforeYouCommitTests'. That way, you do not
  184. have to use Maven and get the test results reported within the IDE's JUnit user interface.
  185. -->
  186. <id>repeat-all-unit-tests</id>
  187. <build>
  188. <plugins>
  189. <plugin>
  190. <groupId>org.apache.maven.plugins</groupId>
  191. <artifactId>maven-surefire-plugin</artifactId>
  192. <configuration>
  193. <testFailureIgnore>true</testFailureIgnore>
  194. <argLine>
  195. ${jvm.arg.addOpens}
  196. ${jvm.arg.allowSecurityManager}
  197. </argLine>
  198. </configuration>
  199. <executions>
  200. <execution>
  201. <id>extra-test-run</id>
  202. <phase>test</phase>
  203. <goals>
  204. <goal>test</goal>
  205. </goals>
  206. </execution>
  207. </executions>
  208. </plugin>
  209. </plugins>
  210. </build>
  211. </profile>
  212. </profiles>
  213. <build>
  214. <plugins>
  215. <plugin>
  216. <groupId>org.apache.maven.plugins</groupId>
  217. <artifactId>maven-surefire-plugin</artifactId>
  218. <configuration>
  219. <testFailureIgnore>true</testFailureIgnore>
  220. <argLine>${jvm.arg.addOpens}</argLine>
  221. </configuration>
  222. <executions>
  223. <execution>
  224. <id>default-test</id>
  225. <!-- By default, do not run any tests -->
  226. <phase>none</phase>
  227. <goals>
  228. <goal>test</goal>
  229. </goals>
  230. </execution>
  231. </executions>
  232. </plugin>
  233. <plugin>
  234. <groupId>org.apache.maven.plugins</groupId>
  235. <artifactId>maven-dependency-plugin</artifactId>
  236. <configuration>
  237. <usedDependencies>
  238. <!-- The tests need these during runtime, even though no direct usage is in our classes -->
  239. <usedDependency>ant:ant-launcher</usedDependency>
  240. <usedDependency>org.ow2.asm:asm</usedDependency>
  241. <usedDependency>org.aspectj:ajde</usedDependency>
  242. <usedDependency>org.aspectj:build</usedDependency>
  243. <usedDependency>org.aspectj:tests</usedDependency>
  244. </usedDependencies>
  245. </configuration>
  246. </plugin>
  247. </plugins>
  248. </build>
  249. </project>