×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: XML
Posted by: usere4d07
Added: Apr 1, 2020 5:00 PM
Modified: Apr 1, 2020 5:00 PM
Views: 4307
Tags: no tags
  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"
  3.         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  4.  
  5.     <modelVersion>4.0.0</modelVersion>
  6.     <groupId>test.demo</groupId>
  7.     <artifactId>demo</artifactId>
  8.     <name>demo</name>
  9.     <version>1.0-SNAPSHOT</version>
  10.     <packaging>jar</packaging>
  11.  
  12.     <properties>
  13.         <maven.compiler.source>1.8</maven.compiler.source>
  14.         <maven.compiler.target>1.8</maven.compiler.target>
  15.         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  16.         <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
  17.  
  18.         <vaadin.version>14.1.21</vaadin.version>
  19.         <kotlin.version>1.3.71</kotlin.version>
  20.     </properties>
  21.  
  22.     <parent>
  23.         <groupId>org.springframework.boot</groupId>
  24.         <artifactId>spring-boot-starter-parent</artifactId>
  25.         <version>2.2.6.RELEASE</version>
  26.     </parent>
  27.  
  28.     <pluginRepositories>
  29.         <pluginRepository>
  30.             <id>central</id>
  31.             <url>https://repo1.maven.org/maven2/</url>
  32.             <snapshots>
  33.                 <enabled>false</enabled>
  34.             </snapshots>
  35.         </pluginRepository>
  36.     </pluginRepositories>
  37.  
  38.     <repositories>
  39.         <repository>
  40.             <id>central</id>
  41.             <url>https://repo1.maven.org/maven2/</url>
  42.             <snapshots>
  43.                 <enabled>false</enabled>
  44.             </snapshots>
  45.         </repository>
  46.         <!-- Repository used by many Vaadin add-ons -->
  47.         <repository>
  48.             <id>Vaadin Directory</id>
  49.             <url>https://maven.vaadin.com/vaadin-addons</url>
  50.             <snapshots>
  51.                 <enabled>false</enabled>
  52.             </snapshots>
  53.         </repository>
  54.     </repositories>
  55.  
  56.     <dependencyManagement>
  57.         <dependencies>
  58.             <dependency>
  59.                 <groupId>com.vaadin</groupId>
  60.                 <artifactId>vaadin-bom</artifactId>
  61.                 <version>${vaadin.version}</version>
  62.                 <type>pom</type>
  63.                 <scope>import</scope>
  64.             </dependency>
  65.         </dependencies>
  66.     </dependencyManagement>
  67.  
  68.     <dependencies>
  69.         <dependency>
  70.             <groupId>com.vaadin</groupId>
  71.             <!-- Replace artifactId with vaadin-core to use only free components -->
  72.             <artifactId>vaadin</artifactId>
  73.             <exclusions>
  74.                 <!-- Webjars are only needed when running in Vaadin 13 compatibility mode -->
  75.                 <exclusion>
  76.                     <groupId>com.vaadin.webjar</groupId>
  77.                     <artifactId>*</artifactId>
  78.                 </exclusion>
  79.                 <exclusion>
  80.                     <groupId>org.webjars.bowergithub.insites</groupId>
  81.                     <artifactId>*</artifactId>
  82.                 </exclusion>
  83.                 <exclusion>
  84.                     <groupId>org.webjars.bowergithub.polymer</groupId>
  85.                     <artifactId>*</artifactId>
  86.                 </exclusion>
  87.                 <exclusion>
  88.                     <groupId>org.webjars.bowergithub.polymerelements</groupId>
  89.                     <artifactId>*</artifactId>
  90.                 </exclusion>
  91.                 <exclusion>
  92.                     <groupId>org.webjars.bowergithub.vaadin</groupId>
  93.                     <artifactId>*</artifactId>
  94.                 </exclusion>
  95.                 <exclusion>
  96.                     <groupId>org.webjars.bowergithub.webcomponents</groupId>
  97.                     <artifactId>*</artifactId>
  98.                 </exclusion>
  99.             </exclusions>
  100.         </dependency>
  101.         <dependency>
  102.             <groupId>com.vaadin</groupId>
  103.             <artifactId>vaadin-spring-boot-starter</artifactId>
  104.             <exclusions>
  105.                 <!-- Excluding so that webjars are not included. -->
  106.                 <exclusion>
  107.                     <groupId>com.vaadin</groupId>
  108.                     <artifactId>vaadin-core</artifactId>
  109.                 </exclusion>
  110.             </exclusions>
  111.         </dependency>
  112.         <dependency>
  113.             <groupId>org.springframework.boot</groupId>
  114.             <artifactId>spring-boot-devtools</artifactId>
  115.             <optional>true</optional>
  116.         </dependency>
  117.         <dependency>
  118.             <groupId>com.vaadin</groupId>
  119.             <artifactId>vaadin-testbench</artifactId>
  120.             <scope>test</scope>
  121.         </dependency>
  122.         <dependency>
  123.             <groupId>org.jetbrains.kotlin</groupId>
  124.             <artifactId>kotlin-stdlib</artifactId>
  125.             <version>${kotlin.version}</version>
  126.         </dependency>
  127.         <dependency>
  128.             <groupId>com.fasterxml.jackson.module</groupId>
  129.             <artifactId>jackson-module-kotlin</artifactId>
  130.         </dependency>
  131.         <dependency>
  132.             <groupId>org.jetbrains.kotlin</groupId>
  133.             <artifactId>kotlin-reflect</artifactId>
  134.         </dependency>
  135. <!--        <dependency>-->
  136. <!--            <groupId>org.springframework.boot</groupId>-->
  137. <!--            <artifactId>spring-boot-starter-data-jpa</artifactId>-->
  138. <!--        </dependency>-->
  139.     </dependencies>
  140.  
  141.     <build>
  142.         <defaultGoal>spring-boot:run</defaultGoal>
  143.  
  144.         <plugins>
  145.             <plugin>
  146.                 <groupId>org.jetbrains.kotlin</groupId>
  147.                 <artifactId>kotlin-maven-plugin</artifactId>
  148.                 <version>${kotlin.version}</version>
  149. <!--                <configuration>-->
  150. <!--                    <compilerPlugins>-->
  151. <!--                        <plugin>jpa</plugin>-->
  152. <!--                        <plugin>spring</plugin>-->
  153. <!--                    </compilerPlugins>-->
  154. <!--                    <args>-->
  155. <!--                        <arg>-Xjsr305=strict</arg>-->
  156. <!--                    </args>-->
  157. <!--                </configuration>-->
  158.                 <dependencies>
  159.                     <dependency>
  160.                         <groupId>org.jetbrains.kotlin</groupId>
  161.                         <artifactId>kotlin-maven-noarg</artifactId>
  162.                         <version>${kotlin.version}</version>
  163.                     </dependency>
  164.                     <dependency>
  165.                         <groupId>org.jetbrains.kotlin</groupId>
  166.                         <artifactId>kotlin-maven-allopen</artifactId>
  167.                         <version>${kotlin.version}</version>
  168.                     </dependency>
  169.                 </dependencies>
  170.                 <executions>
  171.                     <execution>
  172.                         <id>compile</id>
  173.                         <goals>
  174.                             <goal>compile</goal>
  175.                         </goals>
  176.                         <configuration>
  177.                             <sourceDirs>
  178.                                 <sourceDir>${project.basedir}/src/main/kotlin</sourceDir>
  179.                                 <sourceDir>${project.basedir}/src/main/java</sourceDir>
  180.                             </sourceDirs>
  181.                         </configuration>
  182.                     </execution>
  183.                     <execution>
  184.                         <id>test-compile</id>
  185.                         <goals>
  186.                             <goal>test-compile</goal>
  187.                         </goals>
  188.                         <configuration>
  189.                             <sourceDirs>
  190.                                 <sourceDir>${project.basedir}/src/test/kotlin</sourceDir>
  191.                                 <sourceDir>${project.basedir}/src/test/java</sourceDir>
  192.                             </sourceDirs>
  193.                         </configuration>
  194.                     </execution>
  195.                 </executions>
  196.             </plugin>
  197.             <plugin>
  198.                 <groupId>org.apache.maven.plugins</groupId>
  199.                 <artifactId>maven-compiler-plugin</artifactId>
  200.                 <version>3.5.1</version>
  201.                 <executions>
  202.                     <!-- Replacing default-compile as it is treated specially by maven -->
  203.                     <execution>
  204.                         <id>default-compile</id>
  205.                         <phase>none</phase>
  206.                     </execution>
  207.                     <!-- Replacing default-testCompile as it is treated specially by maven -->
  208.                     <execution>
  209.                         <id>default-testCompile</id>
  210.                         <phase>none</phase>
  211.                     </execution>
  212.                     <execution>
  213.                         <id>java-compile</id>
  214.                         <phase>compile</phase>
  215.                         <goals>
  216.                             <goal>compile</goal>
  217.                         </goals>
  218.                     </execution>
  219.                     <execution>
  220.                         <id>java-test-compile</id>
  221.                         <phase>test-compile</phase>
  222.                         <goals>
  223.                             <goal>testCompile</goal>
  224.                         </goals>
  225.                     </execution>
  226.                 </executions>
  227.             </plugin>
  228.  
  229.             <plugin>
  230.                 <groupId>org.springframework.boot</groupId>
  231.                 <artifactId>spring-boot-maven-plugin</artifactId>
  232.                 <!-- Clean build and startup time for Vaadin apps sometimes may exceed
  233.                     the default Spring Boot's 30sec timeout.  -->
  234.                 <configuration>
  235.                     <wait>500</wait>
  236.                     <maxAttempts>240</maxAttempts>
  237.                 </configuration>
  238.             </plugin>
  239.  
  240.             <!--
  241.                Take care of synchronizing java dependencies and imports in
  242.                package.json and main.js files.
  243.                It also creates webpack.config.js if not exists yet.
  244.            -->
  245.             <plugin>
  246.                 <groupId>com.vaadin</groupId>
  247.                 <artifactId>vaadin-maven-plugin</artifactId>
  248.                 <version>${vaadin.version}</version>
  249.                 <executions>
  250.                     <execution>
  251.                         <goals>
  252.                             <goal>prepare-frontend</goal>
  253.                         </goals>
  254.                     </execution>
  255.                 </executions>
  256.             </plugin>
  257.             <plugin>
  258.                 <groupId>com.github.eirslett</groupId>
  259.                 <artifactId>frontend-maven-plugin</artifactId>
  260.                 <!-- Use the latest released version:
  261.                https://repo1.maven.org/maven2/com/github/eirslett/frontend-maven-plugin/ -->
  262.                 <version>1.8.0</version>
  263.  
  264.                 <executions>
  265.                     <execution>
  266.                         <!-- optional: you don't really need execution ids, but it looks nice in your build log. -->
  267.                         <id>install node and npm</id>
  268.                         <goals>
  269.                             <goal>install-node-and-npm</goal>
  270.                         </goals>
  271.                         <!-- optional: default phase is "generate-resources" -->
  272.                         <phase>generate-resources</phase>
  273.                     </execution>
  274.                 </executions>
  275.                 <configuration>
  276.                     <nodeVersion>v10.16.2</nodeVersion>
  277.  
  278.                     <!-- optional: with node version greater than 4.0.0 will use npm provided by node distribution -->
  279.                     <!--                    <npmVersion>2.15.9</npmVersion>-->
  280.  
  281.                     <!-- optional: where to download node and npm from. Defaults to https://nodejs.org/dist/ -->
  282.                     <!--                    <downloadRoot>http://myproxy.example.org/nodejs/</downloadRoot>-->
  283.                 </configuration>
  284.             </plugin>
  285.         </plugins>
  286.     </build>
  287.  
  288.     <profiles>
  289.         <profile>
  290.             <!-- Production mode is activated using -Pproduction -->
  291.             <id>production</id>
  292.             <properties>
  293.                 <vaadin.productionMode>true</vaadin.productionMode>
  294.             </properties>
  295.  
  296.             <dependencies>
  297.                 <dependency>
  298.                     <groupId>com.vaadin</groupId>
  299.                     <artifactId>flow-server-production-mode</artifactId>
  300.                 </dependency>
  301.             </dependencies>
  302.  
  303.             <build>
  304.                 <plugins>
  305.                     <plugin>
  306.                         <groupId>org.springframework.boot</groupId>
  307.                         <artifactId>spring-boot-maven-plugin</artifactId>
  308.                         <configuration>
  309.                             <jvmArguments>-Dvaadin.productionMode</jvmArguments>
  310.                         </configuration>
  311.                     </plugin>
  312.                     <plugin>
  313.                         <groupId>com.vaadin</groupId>
  314.                         <artifactId>vaadin-maven-plugin</artifactId>
  315.                         <executions>
  316.                             <execution>
  317.                                 <goals>
  318.                                     <goal>prepare-frontend</goal>
  319.                                     <goal>build-frontend</goal>
  320.                                 </goals>
  321.                                 <phase>compile</phase>
  322.                             </execution>
  323.                         </executions>
  324.                     </plugin>
  325.                     <plugin>
  326.                         <groupId>com.heroku.sdk</groupId>
  327.                         <artifactId>heroku-maven-plugin</artifactId>
  328.                         <version>2.0.13</version>
  329.                         <configuration>
  330.                             <appName>demo</appName>
  331.                             <processTypes>
  332.                                 <web>java $JAVA_OPTS -jar target/demo-2.0-SNAPSHOT.jar --server.port=$PORT</web>
  333.                             </processTypes>
  334.                         </configuration>
  335.                     </plugin>
  336.                 </plugins>
  337.             </build>
  338.         </profile>
  339.     </profiles>
  340. </project>