Last active
May 16, 2024 11:14
-
-
Save sterlp/213d37ebd83d3cc8d0a43993f36d62b5 to your computer and use it in GitHub Desktop.
Angular Integration into maven build, CLEAN, INSTALL, TEST
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<build> | |
<sourceDirectory>src/app</sourceDirectory> | |
<resources> | |
<resource> | |
<directory>src</directory> | |
</resource> | |
<resource> | |
<directory>e2e</directory> | |
</resource> | |
</resources> | |
<!-- DELETE everything in case of maven clean --> | |
<plugins> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-clean-plugin</artifactId> | |
<configuration> | |
<filesets> | |
<fileset> | |
<directory>dist</directory> | |
</fileset> | |
<fileset> | |
<directory>node_modules</directory> | |
</fileset> | |
</filesets> | |
</configuration> | |
</plugin> | |
<!-- INSTALL everything --> | |
<plugin> | |
<artifactId>exec-maven-plugin</artifactId> | |
<groupId>org.codehaus.mojo</groupId> | |
<version>3.0.0</version> | |
<executions> | |
<execution> | |
<id>npm install</id> | |
<goals> | |
<goal>exec</goal> | |
</goals> | |
<phase>generate-resources</phase> | |
<configuration> | |
<executable>npm</executable> | |
<arguments> | |
<argument>install</argument> | |
</arguments> | |
</configuration> | |
</execution> | |
<!-- BUILD Web Jar for Spring Boot --> | |
<execution> | |
<id>angular-cli build</id> | |
<goals> | |
<goal>exec</goal> | |
</goals> | |
<phase>compile</phase> | |
<configuration> | |
<executable>ng</executable> | |
<arguments> | |
<argument>build</argument> | |
<argument>--base-href</argument> | |
<argument>/ui/</argument> | |
<argument>--output-path</argument> | |
<argument>${project.build.outputDirectory}/META-INF/resources/webjars/${project.artifactId}/${project.version}</argument> | |
</arguments> | |
</configuration> | |
</execution> | |
<!-- RUN TESTS --> | |
<execution> | |
<id>angular-cli test</id> | |
<goals> | |
<goal>exec</goal> | |
</goals> | |
<phase>test</phase> | |
<configuration> | |
<executable>ng</executable> | |
<arguments> | |
<argument>test</argument> | |
<argument>--watch=false</argument> | |
<argument>--code-coverage</argument> | |
<argument>--browsers=ChromeHeadless</argument> | |
<!-- | |
<argument>--no-sandbox</argument> | |
--> | |
</arguments> | |
</configuration> | |
</execution> | |
</executions> | |
</plugin> | |
</plugins> | |
</build> | |
</project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment