Skip to content

Commit

Permalink
Autogenerate settings file required by the generate-from-project, and…
Browse files Browse the repository at this point in the history
… updates the stackscli to use them
  • Loading branch information
guillermogutierrez committed Dec 21, 2021
1 parent 1fadfda commit 654f899
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 1 deletion.
15 changes: 14 additions & 1 deletion stackscli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,18 @@ init:
args: process-resources
-f stacksclipom.xml
-P copy-devops-resources
-P generate-settings-file
-Dtarget.dir={{ .Project.Directory.WorkingDir }}
--quiet
desc: Coping build and deploy pipelines into the project structure
desc: Copying build and deploy pipelines into the project structure

# Build archetype for the main code
- action: cmd
cmd: mvn
args: clean archetype:create-from-project
-f ./java/pom.xml
-DpropertyFile=./java/archetype.properties
-s {{ .Project.Directory.WorkingDir }}/settings.xml
--quiet
desc: Creating the archetype resources using the web-api source code

Expand Down Expand Up @@ -119,6 +121,7 @@ init:
args: clean archetype:create-from-project
-f ./api-tests/pom-temp.xml
-DpropertyFile=./api-tests/archetype.properties
-s {{ .Project.Directory.WorkingDir }}/settings.xml
--quiet
desc: Creating the archetype resources using the api-test source code

Expand Down Expand Up @@ -182,6 +185,7 @@ init:
args: clean archetype:create-from-project
-f ./api-tests-karate/pom.xml
-DpropertyFile=./api-tests-karate/archetype.properties
-s {{ .Project.Directory.WorkingDir }}/settings.xml
--quiet
desc: Creating the archetype resources using the api-test-karate source code

Expand Down Expand Up @@ -218,3 +222,12 @@ init:
-f {{ .Project.Directory.WorkingDir }}/api-tests-karate/pom.xml
--quiet
desc: Downloading maven dependencies for the api-tests-karate project

- action: cmd
cmd: mvn
args: clean
-f stacksclipom.xml
-P clean-workload
-Dtarget.dir={{ .Project.Directory.WorkingDir }}
--quiet
desc: Cleaning the project folder
56 changes: 56 additions & 0 deletions stacksclipom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,39 @@
</build>
</profile>

<profile>
<id>generate-settings-file</id>
<build>
<plugins>
<plugin>
<groupId>ru.yaal.maven</groupId>
<artifactId>write-text-files-maven-plugin</artifactId>
<version>1.1</version>
<configuration>
<charset>UTF-8</charset>
<files>
<file>
<path>${output.basedir}/settings.xml</path>
<lines>
<line><![CDATA[<settings></settings>]]></line>
</lines>
</file>
</files>
</configuration>
<executions>
<execution>
<id>generate-settings-file</id>
<phase>generate-sources</phase>
<goals>
<goal>write-text-files</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>

<profile>
<id>rename-source-folder</id>
<build>
Expand All @@ -113,6 +146,29 @@
</build>
</profile>

<profile>
<id>clean-workload</id>
<build>
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<filesets>
<fileset>
<directory>${output.basedir}</directory>
<includes>
<include>**/settings.xml</include>
</includes>
<followSymlinks>false</followSymlinks>
</fileset>
</filesets>
</configuration>
</plugin>
</plugins>
</build>
</profile>

</profiles>

</project>

0 comments on commit 654f899

Please sign in to comment.