showing results for - "angular json to war"
Lilli
06 Mar 2019
1 <properties>
2    <angular.project.location>angular-project</angular.project.location>
3    <angular.project.nodeinstallation>node_installation</angular.project.nodeinstallation>
4</properties>
5
6 <plugin>
7            <groupId>com.github.eirslett</groupId>
8            <artifactId>frontend-maven-plugin</artifactId>
9            <version>1.0</version>
10            <configuration>
11                <workingDirectory>${angular.project.location}</workingDirectory>
12                <installDirectory>${angular.project.nodeinstallation}</installDirectory>
13            </configuration>
14            <executions>
15                <!-- It will install nodejs and npm -->
16                <execution>
17                    <id>install node and npm</id>
18                    <goals>
19                        <goal>install-node-and-npm</goal>
20                    </goals>
21                    <configuration>
22                        <nodeVersion>v6.10.0</nodeVersion>
23                        <npmVersion>3.10.10</npmVersion>
24                    </configuration>
25                </execution>
26
27                <!-- It will execute command "npm install" inside "/e2e-angular2" directory -->
28                <execution>
29                    <id>npm install</id>
30                    <goals>
31                        <goal>npm</goal>
32                    </goals>
33                    <configuration>
34                        <arguments>install</arguments>
35                    </configuration>
36                </execution>
37                <!-- It will execute command "npm build" inside "/e2e-angular2" directory 
38                    to clean and create "/dist" directory -->
39                <execution>
40                    <id>npm build</id>
41                    <goals>
42                        <goal>npm</goal>
43                    </goals>
44                    <configuration>
45                        <arguments>run build</arguments>
46                    </configuration>
47                </execution>
48            </executions>
49        </plugin>
50
51        <!-- Plugin to copy the content of /angular/dist/ directory to output 
52            directory (ie/ /target/transactionManager-1.0/) -->
53        <plugin>
54            <groupId>org.apache.maven.plugins</groupId>
55            <artifactId>maven-resources-plugin</artifactId>
56            <version>2.4.2</version>
57            <executions>
58                <execution>
59                    <id>default-copy-resources</id>
60                    <phase>process-resources</phase>
61                    <goals>
62                        <goal>copy-resources</goal>
63                    </goals>
64                    <configuration>
65                        <overwrite>true</overwrite>
66                        <!-- This folder is the folder where your angular files 
67                        will be copied to. It must match the resulting war-file name.
68                        So if you have customized the name of war-file for ex. as "app.war"
69                        then below value should be ${project.build.directory}/app/ 
70                        Value given below is as per default war-file name -->
71                        <outputDirectory>${project.build.directory}/${project.artifactId}-${project.version}/</outputDirectory>
72                        <resources>
73                            <resource>
74                                <directory>${project.basedir}/${angular.project.location}/dist</directory>
75                            </resource>
76                        </resources>
77                    </configuration>
78                </execution>
79            </executions>
80        </plugin>
81