Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Maven commands for improved test execution #7055

Merged
merged 2 commits into from
Jan 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,17 @@
{
"label": "Unit Tests",
"type": "shell",
"command": "mvn",
"command": "xvfb-run",
"args": [
"mvn",
"-B",
"clean",
"install",
"-Pall-modules",
"-DforkMode=once",
"-pl",
"!cia-dist-deb",
"-Dtest='!**ITest*,!**DocumentationTest*'",
"-Dtest=!**ITest*,!**DocumentationTest*",
"-Dmaven.test.failure.ignore=true",
"-DfailIfNoTests=false",
"-Dsurefire.failIfNoSpecifiedTests=false",
Expand All @@ -116,9 +117,8 @@
"-Pall-modules",
"-pl",
"!cia-dist-deb",
"-Dtest=no",
"-DfailIfNoTests=false",
"-Dsurefire.failIfNoSpecifiedTests=false"
"-DskipTests",
"-DfailIfNoTests=false"
],
"options": {
"cwd": "${workspaceFolder}/parent-pom",
Expand Down
161 changes: 2 additions & 159 deletions citizen-intelligence-agency/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,6 @@
<!-- Init -->
<!-- =================================================================== -->
<target name="init">
<echo message="JBOSS_HOME = ${env.JBOSS_HOME}" />
<echo message="M2_HOME = ${env.M2_HOME}" />
<condition property="maven.executable.extension" value=".bat">
<and>
<os family="windows" />
</and>
</condition>
<condition property="maven.executable.extension" value="">
<and>
<os family="unix" />
</and>
</condition>
<property name="maven.binary" value="mvn" />
<echo message="MAVEN binary = ${maven.binary}" />
</target>
Expand Down Expand Up @@ -51,27 +39,14 @@
line="clean install -T 1.5C -pl !cia-dist-deb -Pall-modules -Dhttps.protocols=TLSv1.2 -Dmaven.test.failure.ignore=true" />
</exec>
</target>
<target name="clean-install-service" description="cia-clean-install-service" depends="init">
<exec executable="${maven.binary}" dir="../parent-service-pom/">
<env key="MAVEN_OPTS" value="-server -Xmx2048m -Xms2048m " />
<arg line="clean install -T 1.5C -Dmaven.test.failure.ignore=true" />
</exec>
</target>
<target name="site-all" description="cia-site-all" depends="init">
<exec executable="${maven.binary}" dir="../">
<env key="MAVEN_OPTS" value="-server -Xmx4096m -Xms4096m " />
<arg line="clean install site -Prelease-site -Dmaven.test.failure.ignore=true" />
</exec>
</target>
<target name="clean-install-notest" description="cia-clean-install-notest" depends="init">
<exec executable="${maven.binary}" dir="../">
<env key="MAVEN_OPTS" value="-server -Xmx2048m -Xms2048m " />
<arg
line="clean install -Pall-modules -Dtest=no -DfailIfNoTests=false -Dsurefire.failIfNoSpecifiedTests=false -pl '!cia-dist-deb,!cia-dist-cloudformation'" />
line="clean install -Pall-modules -DskipTests -DfailIfNoTests=false -Dsurefire.failIfNoSpecifiedTests=false -pl '!cia-dist-deb,!cia-dist-cloudformation'" />
</exec>
</target>


<target name="start" description="start" depends="init">
<exec executable="${maven.binary}" dir="../citizen-intelligence-agency/">
<env key="MAVEN_OPTS"
Expand All @@ -81,143 +56,11 @@
</exec>
</target>

<target name="clean-install-notest-javadoc" description="cia-clean-install-notest-javadoc"
depends="init">
<exec executable="${maven.binary}" dir="../parent-pom/">
<env key="MAVEN_OPTS" value="-server -Xmx2048m -Xms2048m " />
<arg line="clean install -Prelease-sign-artifacts -Dtest=no -DfailIfNoTests=false" />
</exec>
</target>
<target name="clean-install-service-offline-notest"
description="cia-clean-install-service-offline-notest" depends="init">
<exec executable="${maven.binary}" dir="../parent-pom/">
<env key="MAVEN_OPTS" value="-server -Xmx2048m -Xms2048m " />
<arg
line="clean install sonar:sonar -Pservice-modules -o -Dtest=no -DfailIfNoTests=false" />
</exec>
</target>
<target name="clean-install-service-notest" description="cia-clean-install-service-notest"
depends="init">
<exec executable="${maven.binary}" dir="../parent-pom/">
<env key="MAVEN_OPTS" value="-server -Xmx2048m -Xms2048m " />
<arg line="clean install -Pservice-modules -Dtest=no -DfailIfNoTests=false" />
</exec>
</target>
<target name="package" description="cia-package" depends="init">
<exec executable="${maven.binary}" dir=".">
<arg line="clean package -Dtest=no -DfailIfNoTests=false" />
</exec>
</target>
<target name="run" description="cia-run" depends="init">
<exec executable="${maven.binary}" dir=".">
<env key="MAVEN_OPTS" value="-server -Xmx12048m -Xms12048m " />
<arg
line="clean compile jetty:run -Dtest=no -DfailIfNoTests=false -Dcom.sun.management.jmxremote.port=9002 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djavamelody.system-actions-enabled=true -Djava.awt.headless=true -Djavamelody.storage-directory=${user.dir}/target/" />
</exec>
</target>
<target name="run-server" description="cia-run-server" depends="init">
<exec executable="${maven.binary}" dir=".">
<env key="MAVEN_OPTS" value="-server -Xmx2048m -Xms2048m" />
<arg
line="exec:java -Dexec.classpathScope=test -Dexec.mainClass=com.hack23.cia.systemintegrationtest.CitizenIntelligenceAgencyServer" />
</exec>
</target>
<target name="site-cia" description="cia-site-cia" depends="init">
<exec executable="${maven.binary}" dir=".">
<env key="MAVEN_OPTS" value="-server -Xmx6048m -Xms6048m " />
<arg
line="clean install site -Prelease-site -Dmaven.test.failure.ignore=true -DforkMode=once -Dannotation.failOnError=false" />
</exec>
</target>
<target name="site-cia-all" description="cia-site-cia-all" depends="init">
<exec executable="${maven.binary}" dir="../parent-pom/">
<env key="MAVEN_OPTS" value="-server -Xmx6048m -Xms6048m " />
<arg
line="clean install -Prelease-site -Dmaven.test.failure.ignore=true -DforkMode=once -Pall-modules" />
</exec>
<exec executable="${maven.binary}" dir="../parent-pom/">
<env key="MAVEN_OPTS" value="-server -Xmx6048m -Xms6048m " />
<arg
line="site -Prelease-site -Dmaven.test.failure.ignore=true -DforkMode=once -Pall-modules" />
</exec>
</target>
<target name="site-deploy" description="cia-site-deploy" depends="init">
<exec executable="${maven.binary}" dir="../parent-pom/">
<env key="MAVEN_OPTS" value="-server -Xmx2048m -Xms2048m " />
<arg line="site:deploy -Psite-run,download-repositories" />
</exec>
</target>
<target name="site-service-modules" description="cia-site-service-modules" depends="init">
<exec executable="${maven.binary}" dir="../parent-pom/">
<env key="MAVEN_OPTS" value="-server -Xmx2048m -Xms2048m " />
<arg
line="clean install site -Pservice-modules,release-site -Dmaven.test.failure.ignore=true" />
</exec>
</target>
<target name="site-deploy-service-modules" description="cia-site-deploy-service-modules"
depends="init">
<exec executable="${maven.binary}" dir="../parent-pom/">
<env key="MAVEN_OPTS" value="-server -Xmx2048m -Xms2048m " />
<arg line="site:deploy -Pservice-modules,download-repositories" />
</exec>
</target>
<target name="site-model-modules" description="cia-site-model-modules" depends="init">
<exec executable="${maven.binary}" dir="../parent-pom/">
<env key="MAVEN_OPTS" value="-server -Xmx2048m -Xms2048m " />
<arg
line="clean install site -Pmodel-modules,release-site -Dmaven.test.failure.ignore=true -DforkMode=once -Dannotation.failOnError=false" />
</exec>
</target>
<target name="site-model-external-worldbank" description="cia-site-model-external-worldbank"
depends="init">
<exec executable="${maven.binary}" dir="../model.external.worldbank/">
<env key="MAVEN_OPTS" value="-server -Xmx2048m -Xms2048m " />
<arg
line="clean install site -Prelease-site -Dmaven.test.failure.ignore=true -DforkMode=once -Dannotation.failOnError=false" />
</exec>
</target>
<target name="site-model-external-riksdagen" description="cia-site-model-external-riksdagen"
depends="init">
<exec executable="${maven.binary}" dir="../model.external.riksdagen/">
<env key="MAVEN_OPTS" value="-server -Xmx2048m -Xms2048m " />
<arg
line="clean install site -Prelease-site -Dmaven.test.failure.ignore=true -DforkMode=once -Dannotation.failOnError=false" />
</exec>
</target>
<target name="site-model-external-val" description="cia-site-model-external-val" depends="init">
<exec executable="${maven.binary}" dir="../model.external.val/">
<env key="MAVEN_OPTS" value="-server -Xmx2048m -Xms2048m " />
<arg
line="clean install site -Prelease-site -Dmaven.test.failure.ignore=true -DforkMode=once -Dannotation.failOnError=false" />
</exec>
</target>
<target name="site-model-internal-application" description="cia-site-model-internal-application"
depends="init">
<exec executable="${maven.binary}" dir="../model.internal.application/">
<env key="MAVEN_OPTS" value="-server -Xmx2048m -Xms2048m " />
<arg
line="clean install site -Prelease-site -Dmaven.test.failure.ignore=true -DforkMode=once -Dannotation.failOnError=false" />
</exec>
</target>
<target name="site-deploy-model-modules" description="cia-site-deploy-model-modules"
depends="init">
<exec executable="${maven.binary}" dir="../parent-pom/">
<env key="MAVEN_OPTS" value="-server -Xmx2048m -Xms2048m " />
<arg
line="site:deploy -Pmodel-modules,download-repositories -DforkMode=once -Dannotation.failOnError=false" />
</exec>
</target>
<target name="site-web-modules" description="cia-site-web-modules" depends="init">
<exec executable="${maven.binary}" dir="../parent-pom/">
<env key="MAVEN_OPTS" value="-server -Xmx2048m -Xms2048m " />
<arg
line="clean install site -Pweb-modules,release-site -Dmaven.test.failure.ignore=true -DforkMode=once -Dannotation.failOnError=false" />
</exec>
</target>
<target name="site-deploy-web-modules" description="cia-site-deploy-web-modules" depends="init">
<exec executable="${maven.binary}" dir="../parent-pom/">
<env key="MAVEN_OPTS" value="-server -Xmx2048m -Xms2048m " />
<arg line="site:deploy -Pweb-modules" />
</exec>
</target>
</project>
</project>
Loading