|
33 | 33 |
|
34 | 34 | <properties> |
35 | 35 | <ui-resources.relative-path>META-INF/spring-boot-admin-server-ui</ui-resources.relative-path> |
| 36 | + |
| 37 | + <npm.install.args>ci --prefer-offline --no-progress --no-audit --silent</npm.install.args> |
| 38 | + <npm.build.args>run build</npm.build.args> |
| 39 | + <npm.lint.args>run lint</npm.lint.args> |
| 40 | + <npm.test.args>run test</npm.test.args> |
| 41 | + <!-- To be overridden with -Dnpm.registry=https://foo.bar if the standard registry is not wanted or not accessible --> |
| 42 | + <npm.registry>https://registry.npmjs.org/</npm.registry> |
36 | 43 | </properties> |
37 | 44 |
|
38 | 45 | <dependencies> |
|
122 | 129 | </plugins> |
123 | 130 | </build> |
124 | 131 | </profile> |
| 132 | + <!-- |
| 133 | + Profile: localNpm |
| 134 | + Set this profile to run frontend related build steps using the local NPM installation. |
| 135 | + Skipping frontend tests can be achieved by using default flag -D skipTests. |
| 136 | + --> |
| 137 | + <profile> |
| 138 | + <id>localNpm</id> |
| 139 | + <build> |
| 140 | + <plugins> |
| 141 | + <plugin> |
| 142 | + <groupId>com.github.eirslett</groupId> |
| 143 | + <artifactId>frontend-maven-plugin</artifactId> |
| 144 | + <configuration> |
| 145 | + <skip>true</skip> |
| 146 | + </configuration> |
| 147 | + </plugin> |
| 148 | + |
| 149 | + <plugin> |
| 150 | + <groupId>org.codehaus.mojo</groupId> |
| 151 | + <artifactId>exec-maven-plugin</artifactId> |
| 152 | + <executions> |
| 153 | + <execution> |
| 154 | + <id>npm-install</id> |
| 155 | + <phase>generate-resources</phase> |
| 156 | + <goals> |
| 157 | + <goal>exec</goal> |
| 158 | + </goals> |
| 159 | + <configuration> |
| 160 | + <executable>npm</executable> |
| 161 | + <commandlineArgs>${npm.install.args}</commandlineArgs> |
| 162 | + <environmentVariables> |
| 163 | + <NPM_CONFIG_REGISTRY>${npm.registry}</NPM_CONFIG_REGISTRY> |
| 164 | + </environmentVariables> |
| 165 | + </configuration> |
| 166 | + </execution> |
| 167 | + <execution> |
| 168 | + <id>npm-build</id> |
| 169 | + <phase>generate-resources</phase> |
| 170 | + <goals> |
| 171 | + <goal>exec</goal> |
| 172 | + </goals> |
| 173 | + <configuration> |
| 174 | + <executable>npm</executable> |
| 175 | + <commandlineArgs>${npm.build.args}</commandlineArgs> |
| 176 | + <environmentVariables> |
| 177 | + <PROJECT_VERSION>${project.version}</PROJECT_VERSION> |
| 178 | + </environmentVariables> |
| 179 | + </configuration> |
| 180 | + </execution> |
| 181 | + <execution> |
| 182 | + <id>npm-lint</id> |
| 183 | + <phase>verify</phase> |
| 184 | + <goals> |
| 185 | + <goal>exec</goal> |
| 186 | + </goals> |
| 187 | + <configuration> |
| 188 | + <executable>npm</executable> |
| 189 | + <commandlineArgs>${npm.lint.args}</commandlineArgs> |
| 190 | + </configuration> |
| 191 | + </execution> |
| 192 | + <execution> |
| 193 | + <id>npm-test</id> |
| 194 | + <phase>test</phase> |
| 195 | + <goals> |
| 196 | + <goal>exec</goal> |
| 197 | + </goals> |
| 198 | + <configuration> |
| 199 | + <skip>${skipTests}</skip> |
| 200 | + <executable>npm</executable> |
| 201 | + <commandlineArgs>${npm.test.args}</commandlineArgs> |
| 202 | + </configuration> |
| 203 | + </execution> |
| 204 | + </executions> |
| 205 | + </plugin> |
| 206 | + </plugins> |
| 207 | + </build> |
| 208 | + </profile> |
125 | 209 | </profiles> |
126 | 210 |
|
127 | 211 | <build> |
|
155 | 239 | <goal>npm</goal> |
156 | 240 | </goals> |
157 | 241 | <configuration> |
158 | | - <arguments>ci --prefer-offline --no-progress --no-audit --silent</arguments> |
| 242 | + <arguments>${npm.install.args}</arguments> |
159 | 243 | </configuration> |
160 | 244 | </execution> |
161 | 245 | <execution> |
|
164 | 248 | <goal>npm</goal> |
165 | 249 | </goals> |
166 | 250 | <configuration> |
167 | | - <arguments>run build</arguments> |
| 251 | + <arguments>${npm.build.args}</arguments> |
168 | 252 | <environmentVariables> |
169 | 253 | <PROJECT_VERSION>${project.version}</PROJECT_VERSION> |
170 | 254 | </environmentVariables> |
|
177 | 261 | </goals> |
178 | 262 | <phase>verify</phase> |
179 | 263 | <configuration> |
180 | | - <arguments>run lint</arguments> |
| 264 | + <arguments>${npm.lint.args}</arguments> |
181 | 265 | </configuration> |
182 | 266 | </execution> |
183 | 267 | <execution> |
|
187 | 271 | </goals> |
188 | 272 | <phase>test</phase> |
189 | 273 | <configuration> |
190 | | - <arguments>run test</arguments> |
| 274 | + <arguments>${npm.test.args}</arguments> |
191 | 275 | </configuration> |
192 | 276 | </execution> |
193 | 277 | </executions> |
|
0 commit comments