|
35 | 35 | <build> |
36 | 36 | <finalName>dashboard-war</finalName> |
37 | 37 | <plugins> |
38 | | - <plugin> |
39 | | - <artifactId>maven-clean-plugin</artifactId> |
40 | | - <configuration> |
41 | | - <filesets> |
42 | | - <fileset> |
43 | | - <directory>${basedir}/bower_components</directory> |
44 | | - <followSymlinks>false</followSymlinks> |
45 | | - </fileset> |
46 | | - <fileset> |
47 | | - <directory>${basedir}/node_modules</directory> |
48 | | - <followSymlinks>false</followSymlinks> |
49 | | - </fileset> |
50 | | - <fileset> |
51 | | - <directory>${basedir}/dist</directory> |
52 | | - <followSymlinks>false</followSymlinks> |
53 | | - </fileset> |
54 | | - </filesets> |
55 | | - </configuration> |
56 | | - </plugin> |
57 | | - <plugin> |
58 | | - <artifactId>maven-antrun-plugin</artifactId> |
59 | | - <executions> |
60 | | - <execution> |
61 | | - <id>compile</id> |
62 | | - <phase>compile</phase> |
63 | | - <goals> |
64 | | - <goal>run</goal> |
65 | | - </goals> |
66 | | - <configuration> |
67 | | - <target> |
68 | | - <!-- Download NPM dependencies --> |
69 | | - <exec dir="${basedir}" executable="npm" failonerror="true"> |
70 | | - <arg value="install" /> |
71 | | - </exec> |
72 | | - <!-- Change base HREF of the application that will be hosted on /dashboard --> |
73 | | - <replace file="${basedir}/dist/index.html"> |
74 | | - <replacetoken><![CDATA[<base href="/">]]></replacetoken> |
75 | | - <replacevalue><![CDATA[<base href="/dashboard/">]]></replacevalue> |
76 | | - </replace> |
77 | | - </target> |
78 | | - </configuration> |
79 | | - </execution> |
80 | | - <execution> |
81 | | - <id>compilation</id> |
82 | | - <phase>test</phase> |
83 | | - <goals> |
84 | | - <goal>run</goal> |
85 | | - </goals> |
86 | | - <configuration> |
87 | | - <target unless="skipTests"> |
88 | | - <!-- Run unit tests --> |
89 | | - <exec dir="${basedir}" executable="gulp" failonerror="true"> |
90 | | - <arg value="test" /> |
91 | | - </exec> |
92 | | - </target> |
93 | | - </configuration> |
94 | | - </execution> |
95 | | - </executions> |
96 | | - </plugin> |
97 | 38 | <plugin> |
98 | 39 | <groupId>org.apache.maven.plugins</groupId> |
99 | 40 | <artifactId>maven-war-plugin</artifactId> |
100 | 41 | <configuration> |
101 | 42 | <webResources> |
102 | 43 | <resource> |
103 | | - <directory>dist</directory> |
| 44 | + <directory>target/dist</directory> |
104 | 45 | </resource> |
105 | 46 | </webResources> |
106 | 47 | <webXml>${basedir}/src/webapp/WEB-INF/web.xml</webXml> |
|
129 | 70 | </plugins> |
130 | 71 | </build> |
131 | 72 | <profiles> |
| 73 | + <profile> |
| 74 | + <!-- Docker build used by default, to use native build, use -Pnative --> |
| 75 | + <id>docker</id> |
| 76 | + <activation> |
| 77 | + <activeByDefault>true</activeByDefault> |
| 78 | + </activation> |
| 79 | + <build> |
| 80 | + <plugins> |
| 81 | + <plugin> |
| 82 | + <artifactId>maven-antrun-plugin</artifactId> |
| 83 | + <executions> |
| 84 | + <execution> |
| 85 | + <id>build-image</id> |
| 86 | + <phase>generate-sources</phase> |
| 87 | + <goals> |
| 88 | + <goal>run</goal> |
| 89 | + </goals> |
| 90 | + <configuration> |
| 91 | + <target> |
| 92 | + <!-- build user dashboard with maven --> |
| 93 | + <exec dir="${basedir}" executable="docker" failonerror="true"> |
| 94 | + <arg value="build" /> |
| 95 | + <arg value="-t" /> |
| 96 | + <arg value="eclipse-che-dashboard" /> |
| 97 | + <arg value="." /> |
| 98 | + </exec> |
| 99 | + </target> |
| 100 | + </configuration> |
| 101 | + </execution> |
| 102 | + <execution> |
| 103 | + <id>unpack-docker-build</id> |
| 104 | + <phase>generate-sources</phase> |
| 105 | + <goals> |
| 106 | + <goal>run</goal> |
| 107 | + </goals> |
| 108 | + <configuration> |
| 109 | + <target> |
| 110 | + <!-- build user dashboard with docker --> |
| 111 | + <exec executable="bash"> |
| 112 | + <arg value="-c" /> |
| 113 | + <arg value="docker run --rm eclipse-che-dashboard | tar -C target/ -xf -" /> |
| 114 | + </exec> |
| 115 | + </target> |
| 116 | + </configuration> |
| 117 | + </execution> |
| 118 | + <execution> |
| 119 | + <id>update-href</id> |
| 120 | + <phase>prepare-package</phase> |
| 121 | + <goals> |
| 122 | + <goal>run</goal> |
| 123 | + </goals> |
| 124 | + <configuration> |
| 125 | + <target> |
| 126 | + <!-- Change base HREF of the application that will be hosted on /dashboard --> |
| 127 | + <replace file="${basedir}/target/dist/index.html"> |
| 128 | + <replacetoken><![CDATA[<base href="/">]]></replacetoken> |
| 129 | + <replacevalue><![CDATA[<base href="/dashboard/">]]></replacevalue> |
| 130 | + </replace> |
| 131 | + </target> |
| 132 | + </configuration> |
| 133 | + </execution> |
| 134 | + </executions> |
| 135 | + </plugin> |
| 136 | + </plugins> |
| 137 | + </build> |
| 138 | + </profile> |
| 139 | + <profile> |
| 140 | + <id>native</id> |
| 141 | + <build> |
| 142 | + <plugins> |
| 143 | + <plugin> |
| 144 | + <artifactId>maven-clean-plugin</artifactId> |
| 145 | + <configuration> |
| 146 | + <filesets> |
| 147 | + <fileset> |
| 148 | + <directory>${basedir}/bower_components</directory> |
| 149 | + <followSymlinks>false</followSymlinks> |
| 150 | + </fileset> |
| 151 | + <fileset> |
| 152 | + <directory>${basedir}/node_modules</directory> |
| 153 | + <followSymlinks>false</followSymlinks> |
| 154 | + </fileset> |
| 155 | + </filesets> |
| 156 | + </configuration> |
| 157 | + </plugin> |
| 158 | + <plugin> |
| 159 | + <artifactId>maven-antrun-plugin</artifactId> |
| 160 | + <executions> |
| 161 | + <execution> |
| 162 | + <id>build-dashboard</id> |
| 163 | + <phase>compile</phase> |
| 164 | + <goals> |
| 165 | + <goal>run</goal> |
| 166 | + </goals> |
| 167 | + <configuration> |
| 168 | + <target> |
| 169 | + <!-- build user dashboard --> |
| 170 | + <exec dir="${basedir}" executable="npm" failonerror="true"> |
| 171 | + <arg value="install" /> |
| 172 | + </exec> |
| 173 | + <!-- Change base HREF of the application that will be hosted on /dashboard --> |
| 174 | + <replace file="${basedir}/target/dist/index.html"> |
| 175 | + <replacetoken><![CDATA[<base href="/">]]></replacetoken> |
| 176 | + <replacevalue><![CDATA[<base href="/dashboard/">]]></replacevalue> |
| 177 | + </replace> |
| 178 | + </target> |
| 179 | + </configuration> |
| 180 | + </execution> |
| 181 | + <execution> |
| 182 | + <id>compilation</id> |
| 183 | + <phase>test</phase> |
| 184 | + <goals> |
| 185 | + <goal>run</goal> |
| 186 | + </goals> |
| 187 | + <configuration> |
| 188 | + <target unless="skipTests"> |
| 189 | + <!-- Run unit tests --> |
| 190 | + <exec dir="${basedir}" executable="gulp" failonerror="true"> |
| 191 | + <arg value="test" /> |
| 192 | + </exec> |
| 193 | + </target> |
| 194 | + </configuration> |
| 195 | + </execution> |
| 196 | + </executions> |
| 197 | + </plugin> |
| 198 | + </plugins> |
| 199 | + </build> |
| 200 | + </profile> |
132 | 201 | <profile> |
133 | 202 | <id>qa</id> |
134 | 203 | <build> |
|
0 commit comments