pom.xml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  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>web-ui</artifactId>
  23. <packaging>pom</packaging>
  24. <name>ThingsBoard Web UI Microservice</name>
  25. <url>https://thingsboard.io</url>
  26. <description>Service for hosting ThingsBoard Web UI</description>
  27. <properties>
  28. <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  29. <main.dir>${basedir}/../..</main.dir>
  30. <pkg.name>tb-web-ui</pkg.name>
  31. <pkg.type>js</pkg.type>
  32. <docker.name>tb-web-ui</docker.name>
  33. <pkg.name>tb-web-ui</pkg.name>
  34. <pkg.type>js</pkg.type>
  35. <pkg.disabled>false</pkg.disabled>
  36. <pkg.process-resources.phase>process-resources</pkg.process-resources.phase>
  37. <pkg.package.phase>package</pkg.package.phase>
  38. <pkg.linux.dist>${project.build.directory}/package/linux</pkg.linux.dist>
  39. <pkg.win.dist>${project.build.directory}/package/windows</pkg.win.dist>
  40. <docker.push-arm-amd-image.phase>pre-integration-test</docker.push-arm-amd-image.phase>
  41. </properties>
  42. <dependencies>
  43. <dependency>
  44. <groupId>org.thingsboard</groupId>
  45. <artifactId>ui-ngx</artifactId>
  46. <version>${project.version}</version>
  47. <type>jar</type>
  48. <scope>provided</scope>
  49. </dependency>
  50. <dependency>
  51. <groupId>com.sun.winsw</groupId>
  52. <artifactId>winsw</artifactId>
  53. <classifier>bin</classifier>
  54. <type>exe</type>
  55. <scope>provided</scope>
  56. </dependency>
  57. </dependencies>
  58. <build>
  59. <plugins>
  60. <plugin>
  61. <groupId>com.github.eirslett</groupId>
  62. <artifactId>frontend-maven-plugin</artifactId>
  63. <configuration>
  64. <installDirectory>target</installDirectory>
  65. <workingDirectory>${basedir}</workingDirectory>
  66. </configuration>
  67. <executions>
  68. <execution>
  69. <id>install node and yarn</id>
  70. <goals>
  71. <goal>install-node-and-yarn</goal>
  72. </goals>
  73. <configuration>
  74. <nodeVersion>v12.16.1</nodeVersion>
  75. <yarnVersion>v1.22.4</yarnVersion>
  76. </configuration>
  77. </execution>
  78. <execution>
  79. <id>yarn install</id>
  80. <goals>
  81. <goal>yarn</goal>
  82. </goals>
  83. <configuration>
  84. <arguments>install</arguments>
  85. </configuration>
  86. </execution>
  87. <execution>
  88. <id>yarn pkg</id>
  89. <goals>
  90. <goal>yarn</goal>
  91. </goals>
  92. <configuration>
  93. <arguments>run pkg</arguments>
  94. </configuration>
  95. </execution>
  96. </executions>
  97. </plugin>
  98. <plugin>
  99. <groupId>org.apache.maven.plugins</groupId>
  100. <artifactId>maven-dependency-plugin</artifactId>
  101. <executions>
  102. <execution>
  103. <id>extract-web-ui</id>
  104. <goals>
  105. <goal>unpack</goal>
  106. </goals>
  107. <configuration>
  108. <artifactItems>
  109. <artifactItem>
  110. <groupId>org.thingsboard</groupId>
  111. <artifactId>ui-ngx</artifactId>
  112. <type>jar</type>
  113. <overWrite>false</overWrite>
  114. <outputDirectory>${project.build.directory}/web</outputDirectory>
  115. </artifactItem>
  116. </artifactItems>
  117. </configuration>
  118. </execution>
  119. <execution>
  120. <id>copy-winsw-service</id>
  121. <phase>package</phase>
  122. <goals>
  123. <goal>copy</goal>
  124. </goals>
  125. <configuration>
  126. <artifactItems>
  127. <artifactItem>
  128. <groupId>com.sun.winsw</groupId>
  129. <artifactId>winsw</artifactId>
  130. <classifier>bin</classifier>
  131. <type>exe</type>
  132. <destFileName>service.exe</destFileName>
  133. </artifactItem>
  134. </artifactItems>
  135. <outputDirectory>${pkg.win.dist}</outputDirectory>
  136. </configuration>
  137. </execution>
  138. </executions>
  139. </plugin>
  140. <plugin>
  141. <groupId>org.apache.maven.plugins</groupId>
  142. <artifactId>maven-resources-plugin</artifactId>
  143. <executions>
  144. <execution>
  145. <id>copy-src-root</id>
  146. <phase>process-resources</phase>
  147. <goals>
  148. <goal>copy-resources</goal>
  149. </goals>
  150. <configuration>
  151. <outputDirectory>${project.build.directory}/src</outputDirectory>
  152. <resources>
  153. <resource>
  154. <directory>${basedir}</directory>
  155. <includes>
  156. <include>server.js</include>
  157. <include>package.json</include>
  158. <include>yarn.lock</include>
  159. </includes>
  160. <filtering>false</filtering>
  161. </resource>
  162. </resources>
  163. </configuration>
  164. </execution>
  165. </executions>
  166. </plugin>
  167. <plugin>
  168. <groupId>org.thingsboard</groupId>
  169. <artifactId>gradle-maven-plugin</artifactId>
  170. </plugin>
  171. <plugin>
  172. <groupId>org.apache.maven.plugins</groupId>
  173. <artifactId>maven-assembly-plugin</artifactId>
  174. </plugin>
  175. <plugin>
  176. <groupId>com.spotify</groupId>
  177. <artifactId>dockerfile-maven-plugin</artifactId>
  178. <executions>
  179. <execution>
  180. <id>build-docker-image</id>
  181. <phase>pre-integration-test</phase>
  182. <goals>
  183. <goal>build</goal>
  184. </goals>
  185. <configuration>
  186. <skip>${dockerfile.skip}</skip>
  187. <repository>${docker.repo}/${docker.name}</repository>
  188. <verbose>true</verbose>
  189. <googleContainerRegistryEnabled>false</googleContainerRegistryEnabled>
  190. <contextDirectory>${project.build.directory}</contextDirectory>
  191. </configuration>
  192. </execution>
  193. <execution>
  194. <id>tag-docker-image</id>
  195. <phase>pre-integration-test</phase>
  196. <goals>
  197. <goal>tag</goal>
  198. </goals>
  199. <configuration>
  200. <skip>${dockerfile.skip}</skip>
  201. <repository>${docker.repo}/${docker.name}</repository>
  202. <tag>${project.version}</tag>
  203. </configuration>
  204. </execution>
  205. </executions>
  206. </plugin>
  207. </plugins>
  208. </build>
  209. <profiles>
  210. <profile>
  211. <id>yarn-start</id>
  212. <activation>
  213. <property>
  214. <name>yarn-start</name>
  215. </property>
  216. </activation>
  217. <build>
  218. <plugins>
  219. <plugin>
  220. <groupId>com.github.eirslett</groupId>
  221. <artifactId>frontend-maven-plugin</artifactId>
  222. <configuration>
  223. <installDirectory>target</installDirectory>
  224. <workingDirectory>${basedir}</workingDirectory>
  225. </configuration>
  226. <executions>
  227. <execution>
  228. <id>yarn start</id>
  229. <goals>
  230. <goal>yarn</goal>
  231. </goals>
  232. <configuration>
  233. <arguments>start</arguments>
  234. </configuration>
  235. </execution>
  236. </executions>
  237. </plugin>
  238. </plugins>
  239. </build>
  240. </profile>
  241. <profile>
  242. <id>push-docker-image</id>
  243. <activation>
  244. <property>
  245. <name>push-docker-image</name>
  246. </property>
  247. </activation>
  248. <build>
  249. <plugins>
  250. <plugin>
  251. <groupId>com.spotify</groupId>
  252. <artifactId>dockerfile-maven-plugin</artifactId>
  253. <executions>
  254. <execution>
  255. <id>push-latest-docker-image</id>
  256. <phase>pre-integration-test</phase>
  257. <goals>
  258. <goal>push</goal>
  259. </goals>
  260. <configuration>
  261. <tag>latest</tag>
  262. <repository>${docker.repo}/${docker.name}</repository>
  263. </configuration>
  264. </execution>
  265. <execution>
  266. <id>push-version-docker-image</id>
  267. <phase>pre-integration-test</phase>
  268. <goals>
  269. <goal>push</goal>
  270. </goals>
  271. <configuration>
  272. <tag>${project.version}</tag>
  273. <repository>${docker.repo}/${docker.name}</repository>
  274. </configuration>
  275. </execution>
  276. </executions>
  277. </plugin>
  278. </plugins>
  279. </build>
  280. </profile>
  281. </profiles>
  282. <repositories>
  283. <repository>
  284. <id>jenkins</id>
  285. <name>Jenkins Repository</name>
  286. <url>https://repo.jenkins-ci.org/releases</url>
  287. <snapshots>
  288. <enabled>false</enabled>
  289. </snapshots>
  290. </repository>
  291. </repositories>
  292. </project>