pom.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. <!--
  2. Copyright © 2016-2022 The Thingsboard Authors
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. -->
  13. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  14. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  15. <modelVersion>4.0.0</modelVersion>
  16. <parent>
  17. <groupId>org.thingsboard</groupId>
  18. <version>1.0.0-SNAPSHOT</version>
  19. <artifactId>msa</artifactId>
  20. </parent>
  21. <groupId>org.thingsboard.msa</groupId>
  22. <artifactId>js-executor</artifactId>
  23. <packaging>pom</packaging>
  24. <name>ThingsBoard JavaScript Executor Microservice</name>
  25. <url>https://thingsboard.io</url>
  26. <description>Service executing JavaScript functions in sandboxed environment</description>
  27. <properties>
  28. <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  29. <main.dir>${basedir}/../..</main.dir>
  30. <docker.name>tb-js-executor</docker.name>
  31. <pkg.name>tb-js-executor</pkg.name>
  32. <pkg.type>js</pkg.type>
  33. <pkg.disabled>false</pkg.disabled>
  34. <pkg.process-resources.phase>process-resources</pkg.process-resources.phase>
  35. <pkg.package.phase>package</pkg.package.phase>
  36. <pkg.linux.dist>${project.build.directory}/package/linux</pkg.linux.dist>
  37. <pkg.win.dist>${project.build.directory}/package/windows</pkg.win.dist>
  38. <docker.push-arm-amd-image.phase>pre-integration-test</docker.push-arm-amd-image.phase>
  39. </properties>
  40. <dependencies>
  41. <dependency>
  42. <groupId>com.sun.winsw</groupId>
  43. <artifactId>winsw</artifactId>
  44. <classifier>bin</classifier>
  45. <type>exe</type>
  46. <scope>provided</scope>
  47. </dependency>
  48. </dependencies>
  49. <build>
  50. <plugins>
  51. <plugin>
  52. <groupId>com.github.eirslett</groupId>
  53. <artifactId>frontend-maven-plugin</artifactId>
  54. <configuration>
  55. <installDirectory>target</installDirectory>
  56. <workingDirectory>${basedir}</workingDirectory>
  57. </configuration>
  58. <executions>
  59. <execution>
  60. <id>install node and yarn</id>
  61. <goals>
  62. <goal>install-node-and-yarn</goal>
  63. </goals>
  64. <configuration>
  65. <nodeVersion>v12.16.1</nodeVersion>
  66. <yarnVersion>v1.22.4</yarnVersion>
  67. </configuration>
  68. </execution>
  69. <execution>
  70. <id>yarn install</id>
  71. <goals>
  72. <goal>yarn</goal>
  73. </goals>
  74. <configuration>
  75. <arguments>install</arguments>
  76. </configuration>
  77. </execution>
  78. <execution>
  79. <id>yarn pkg</id>
  80. <goals>
  81. <goal>yarn</goal>
  82. </goals>
  83. <configuration>
  84. <arguments>run pkg</arguments>
  85. </configuration>
  86. </execution>
  87. </executions>
  88. </plugin>
  89. <plugin>
  90. <groupId>org.apache.maven.plugins</groupId>
  91. <artifactId>maven-dependency-plugin</artifactId>
  92. </plugin>
  93. <plugin>
  94. <groupId>org.apache.maven.plugins</groupId>
  95. <artifactId>maven-resources-plugin</artifactId>
  96. <executions>
  97. <execution>
  98. <id>copy-src-api</id>
  99. <phase>process-resources</phase>
  100. <goals>
  101. <goal>copy-resources</goal>
  102. </goals>
  103. <configuration>
  104. <outputDirectory>${project.build.directory}/src/api</outputDirectory>
  105. <resources>
  106. <resource>
  107. <directory>api</directory>
  108. <filtering>false</filtering>
  109. </resource>
  110. </resources>
  111. </configuration>
  112. </execution>
  113. <execution>
  114. <id>copy-src-queue</id>
  115. <phase>process-resources</phase>
  116. <goals>
  117. <goal>copy-resources</goal>
  118. </goals>
  119. <configuration>
  120. <outputDirectory>${project.build.directory}/src/queue</outputDirectory>
  121. <resources>
  122. <resource>
  123. <directory>queue</directory>
  124. <filtering>false</filtering>
  125. </resource>
  126. </resources>
  127. </configuration>
  128. </execution>
  129. <execution>
  130. <id>copy-src-root</id>
  131. <phase>process-resources</phase>
  132. <goals>
  133. <goal>copy-resources</goal>
  134. </goals>
  135. <configuration>
  136. <outputDirectory>${project.build.directory}/src</outputDirectory>
  137. <resources>
  138. <resource>
  139. <directory>${basedir}</directory>
  140. <includes>
  141. <include>server.js</include>
  142. <include>package.json</include>
  143. <include>yarn.lock</include>
  144. </includes>
  145. <filtering>false</filtering>
  146. </resource>
  147. </resources>
  148. </configuration>
  149. </execution>
  150. </executions>
  151. </plugin>
  152. <plugin>
  153. <groupId>org.thingsboard</groupId>
  154. <artifactId>gradle-maven-plugin</artifactId>
  155. </plugin>
  156. <plugin>
  157. <groupId>org.apache.maven.plugins</groupId>
  158. <artifactId>maven-assembly-plugin</artifactId>
  159. </plugin>
  160. <plugin>
  161. <groupId>com.spotify</groupId>
  162. <artifactId>dockerfile-maven-plugin</artifactId>
  163. <executions>
  164. <execution>
  165. <id>build-docker-image</id>
  166. <phase>pre-integration-test</phase>
  167. <goals>
  168. <goal>build</goal>
  169. </goals>
  170. <configuration>
  171. <skip>${dockerfile.skip}</skip>
  172. <repository>${docker.repo}/${docker.name}</repository>
  173. <verbose>true</verbose>
  174. <googleContainerRegistryEnabled>false</googleContainerRegistryEnabled>
  175. <contextDirectory>${project.build.directory}</contextDirectory>
  176. </configuration>
  177. </execution>
  178. <execution>
  179. <id>tag-docker-image</id>
  180. <phase>pre-integration-test</phase>
  181. <goals>
  182. <goal>tag</goal>
  183. </goals>
  184. <configuration>
  185. <skip>${dockerfile.skip}</skip>
  186. <repository>${docker.repo}/${docker.name}</repository>
  187. <tag>${project.version}</tag>
  188. </configuration>
  189. </execution>
  190. </executions>
  191. </plugin>
  192. </plugins>
  193. </build>
  194. <profiles>
  195. <profile>
  196. <id>yarn-start</id>
  197. <activation>
  198. <property>
  199. <name>yarn-start</name>
  200. </property>
  201. </activation>
  202. <build>
  203. <plugins>
  204. <plugin>
  205. <groupId>com.github.eirslett</groupId>
  206. <artifactId>frontend-maven-plugin</artifactId>
  207. <configuration>
  208. <installDirectory>target</installDirectory>
  209. <workingDirectory>${basedir}</workingDirectory>
  210. </configuration>
  211. <executions>
  212. <execution>
  213. <id>yarn start</id>
  214. <goals>
  215. <goal>yarn</goal>
  216. </goals>
  217. <configuration>
  218. <arguments>start</arguments>
  219. </configuration>
  220. </execution>
  221. </executions>
  222. </plugin>
  223. </plugins>
  224. </build>
  225. </profile>
  226. <profile>
  227. <id>push-docker-image</id>
  228. <activation>
  229. <property>
  230. <name>push-docker-image</name>
  231. </property>
  232. </activation>
  233. <build>
  234. <plugins>
  235. <plugin>
  236. <groupId>com.spotify</groupId>
  237. <artifactId>dockerfile-maven-plugin</artifactId>
  238. <executions>
  239. <execution>
  240. <id>push-latest-docker-image</id>
  241. <phase>pre-integration-test</phase>
  242. <goals>
  243. <goal>push</goal>
  244. </goals>
  245. <configuration>
  246. <tag>latest</tag>
  247. <repository>${docker.repo}/${docker.name}</repository>
  248. </configuration>
  249. </execution>
  250. <execution>
  251. <id>push-version-docker-image</id>
  252. <phase>pre-integration-test</phase>
  253. <goals>
  254. <goal>push</goal>
  255. </goals>
  256. <configuration>
  257. <tag>${project.version}</tag>
  258. <repository>${docker.repo}/${docker.name}</repository>
  259. </configuration>
  260. </execution>
  261. </executions>
  262. </plugin>
  263. </plugins>
  264. </build>
  265. </profile>
  266. </profiles>
  267. <repositories>
  268. <repository>
  269. <id>jenkins</id>
  270. <name>Jenkins Repository</name>
  271. <url>https://repo.jenkins-ci.org/releases</url>
  272. <snapshots>
  273. <enabled>false</enabled>
  274. </snapshots>
  275. </repository>
  276. </repositories>
  277. </project>