Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagobento committed Oct 1, 2024
1 parent 6b45ecf commit 954d8a8
Show file tree
Hide file tree
Showing 15 changed files with 33 additions and 99 deletions.
7 changes: 5 additions & 2 deletions examples/drools-process-usertasks-quarkus-example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@
<version>${revision}</version>
<relativePath>./node_modules/@kie-tools/maven-base/pom.xml</relativePath>
</parent>

<artifactId>drools-process-usertasks-quarkus-example</artifactId>
<version>${revision}</version>

<name>Kie-Tools Example :: Process with Usertasks Quarkus</name>
<description>Kogito user tasks orchestration - Quarkus</description>

Expand Down Expand Up @@ -76,10 +79,10 @@

<profiles>
<profile>
<id>kie-tools--maven-profile--1st-party-dependencies</id>
<id>include-1st-party-dependencies</id>
<activation>
<property>
<name>ignore--kie-tools--maven-profile--1st-party-dependencies</name>
<name>kieTools.do-not-use-this-property.ignore1stPartyDependencies</name>
<value>!true</value>
</property>
</activation>
Expand Down
2 changes: 2 additions & 0 deletions examples/jbpm-compact-architecture-example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
</parent>

<artifactId>jbpm-compact-architecture-quarkus-example</artifactId>
<version>${revision}</version>

<name>Kie-Tools Example :: jBPM Compact Architecture Quarkus Example</name>

<properties>
Expand Down
4 changes: 2 additions & 2 deletions examples/sonataflow-greeting-quarkus-example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@
</build>
<profiles>
<profile>
<id>kie-tools--maven-profile--1st-party-dependencies</id>
<id>include-1st-party-dependencies</id>
<activation>
<property>
<name>ignore--kie-tools--maven-profile--1st-party-dependencies</name>
<name>kieTools.do-not-use-this-property.ignore1stPartyDependencies</name>
<value>!true</value>
</property>
</activation>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ COPY --chown=$USER_ID:$USER_ID dist-dev/quarkus-app $HOME_PATH/app/
COPY --chown=$USER_ID:$USER_ID dist-dev/settings.xml /tmp/kogito/.m2/settings.xml

# Pre-populate local Maven repository for faster startup
RUN ./mvnw clean package -B --settings /tmp/kogito/.m2/settings.xml -Dmaven.test.skip -Dmaven.repo.local=/tmp/kogito/.m2/repository -Dquarkus.http.non-application-root-path=${ROOT_PATH}/q -Dquarkus.http.root-path=${ROOT_PATH} \
RUN ./mvnw clean package -B -nsu --settings /tmp/kogito/.m2/settings.xml -Dmaven.test.skip -Dmaven.repo.local=/tmp/kogito/.m2/repository -Dquarkus.http.non-application-root-path=${ROOT_PATH}/q -Dquarkus.http.root-path=${ROOT_PATH} \
&& chgrp -R 0 $HOME_PATH/app && chmod -R g=u $HOME_PATH/app && chgrp -R 0 /tmp/kogito && chmod -R g=u /tmp/kogito && chgrp -R 0 /.m2 && chmod -R g=u /.m2

USER $USER_ID
Expand Down
25 changes: 0 additions & 25 deletions packages/dev-deployment-kogito-quarkus-blank-app-image/install.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"create-test-image:minikube": "kie-tools--image-builder minikube -r \"$(build-env devDeploymentKogitoQuarkusBlankAppImage.registry)\" -a \"$(build-env devDeploymentKogitoQuarkusBlankAppImage.account)\" -n \"$(build-env devDeploymentKogitoQuarkusBlankAppImage.name)\" -t \"$(build-env devDeploymentKogitoQuarkusBlankAppImage.buildTag)\" --build-arg BUILDER_IMAGE_ARG=\"$(build-env devDeploymentKogitoQuarkusBlankAppImage.builderImage)\" --build-arg ROOT_PATH=/",
"create-test-image:openshift": "kie-tools--image-builder openshift -r \"$(build-env devDeploymentKogitoQuarkusBlankAppImage.registry)\" -a \"$(build-env devDeploymentKogitoQuarkusBlankAppImage.account)\" -n \"$(build-env devDeploymentKogitoQuarkusBlankAppImage.name)\" -t \"$(build-env devDeploymentKogitoQuarkusBlankAppImage.buildTag)\" --build-arg BUILDER_IMAGE_ARG=\"$(build-env devDeploymentKogitoQuarkusBlankAppImage.builderImage)\" --build-arg ROOT_PATH=/",
"image:docker:build": "kie-tools--image-builder build --allowHostNetworkAccess -r \"$(build-env devDeploymentKogitoQuarkusBlankAppImage.registry)\" -a \"$(build-env devDeploymentKogitoQuarkusBlankAppImage.account)\" -n \"$(build-env devDeploymentKogitoQuarkusBlankAppImage.name)\" -t \"$(build-env devDeploymentKogitoQuarkusBlankAppImage.buildTag)\" --build-arg BUILDER_IMAGE_ARG=\"$(build-env devDeploymentKogitoQuarkusBlankAppImage.builderImage)\" --build-arg ROOT_PATH=/",
"install": "node install.js",
"m2-repo-via-http:container:kill": "(docker container kill m2-repo-via-http || true) && (docker container rm m2-repo-via-http || true)",
"m2-repo-via-http:container:prepare-m2-repo-volume": "node -e 'require(`@kie-tools/maven-base`).prepareHardLinkedM2ForPackage(`./dist/tmp-m2/repository`, `./node_modules/@kie-tools/dev-deployment-kogito-quarkus-blank-app`)'",
"m2-repo-via-http:container:run": "(pnpm m2-repo-via-http:container:kill || true) && pnpm m2-repo-via-http:container:prepare-m2-repo-volume && docker run -p 8888:80 --name m2-repo-via-http -v \"./dist/tmp-m2/repository:/var/www/html\" -dit $(build-env devDeploymentKogitoQuarkusBlankAppImage.dev.mavenM2RepoViaHttpImage)",
Expand Down
54 changes: 0 additions & 54 deletions packages/dev-deployment-kogito-quarkus-blank-app-image/pom.xml

This file was deleted.

4 changes: 2 additions & 2 deletions packages/dev-deployment-kogito-quarkus-blank-app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,10 @@

<profiles>
<profile>
<id>kie-tools--maven-profile--1st-party-dependencies</id>
<id>include-1st-party-dependencies</id>
<activation>
<property>
<name>ignore--kie-tools--maven-profile--1st-party-dependencies</name>
<name>kieTools.do-not-use-this-property.ignore1stPartyDependencies</name>
<value>!true</value>
</property>
</activation>
Expand Down
3 changes: 3 additions & 0 deletions packages/maven-base/env/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ module.exports = composeEnv([require("@kie-tools/root-env/env")], {
mavenBase: {
version: require("../package.json").version,
},
mvnw: {
version: "3.3.0",
},
maven: {
deploy: {
skip: getOrDefault(this.vars.KIE_TOOLS_BUILD__mavenDeploySkip),
Expand Down
16 changes: 11 additions & 5 deletions packages/maven-base/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
const cp = require("child_process");
const fs = require("fs");
const path = require("path");
const { env } = require("./env");

// Constants relative to consumer packages.
const MVN_CONFIG_ORIGINAL_FILE_PATH = path.join(".mvn", "maven.config.original");
const MVN_CONFIG_FILE_PATH = path.join(".mvn", "maven.config");

// This package's constants.
const MVNW_VERSION = "3.3.0";
const EMPTY_POM_XML_PATH = path.join(__dirname, "empty-pom.xml");
const SETTINGS_XML_PATH = path.join(__dirname, "settings.xml");

Expand All @@ -43,7 +43,7 @@ const DEFAULT_LOCAL_REPO = String(
})
).trim();

const BOOTSTRAP_CLI_ARGS = `-P'!kie-tools--maven-profile--1st-party-dependencies' --settings=${SETTINGS_XML_PATH}`;
const BOOTSTRAP_CLI_ARGS = `-P-include-1st-party-dependencies --settings=${SETTINGS_XML_PATH}`;

module.exports = {
/**
Expand All @@ -67,9 +67,15 @@ module.exports = {
installMvnw: () => {
console.info(`[maven-base] Installing mvnw...`);
console.time(`[maven-base] Installing mvnw...`);
cp.execSync(`mvn -e org.apache.maven.plugins:maven-wrapper-plugin:${MVNW_VERSION}:wrapper ${BOOTSTRAP_CLI_ARGS}`, {
stdio: "inherit",
});

const cmd = `mvn -e org.apache.maven.plugins:maven-wrapper-plugin:${env.mvnw.version}:wrapper ${BOOTSTRAP_CLI_ARGS}`;

if (process.platform === "win32") {
cp.execSync(cmd.replaceAll(" -", " `-"), { stdio: "inherit", shell: "powershell.exe" });

Check warning

Code scanning / CodeQL

Shell command built from environment values Medium

This shell command depends on an uncontrolled
absolute path
.
} else {
cp.execSync(cmd, { stdio: "inherit" });

Check warning

Code scanning / CodeQL

Shell command built from environment values Medium

This shell command depends on an uncontrolled
absolute path
.
}

console.timeEnd(`[maven-base] Installing mvnw...`);
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,10 @@

<profiles>
<profile>
<id>kie-tools--maven-profile--1st-party-dependencies</id>
<id>include-1st-party-dependencies</id>
<activation>
<property>
<name>ignore--kie-tools--maven-profile--1st-party-dependencies</name>
<name>kieTools.do-not-use-this-property.ignore1stPartyDependencies</name>
<value>!true</value>
</property>
</activation>
Expand Down
2 changes: 1 addition & 1 deletion packages/sonataflow-builder-image/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"url": "https://github.com/apache/incubator-kie-tools/issues"
},
"scripts": {
"build": "run-script-if --bool \"$(build-env containerImages.build)\" --then \"pnpm m2-repo-via-http:container:run\" \"pnpm copy-assets\" \"pnpm test\" \"pnpm image:build\" --finally \"pnpm m2-repo-via-http:container:kill\"",
"build": "run-script-if --bool \"$(build-env containerImages.build)\" --then \"pnpm m2-repo-via-http:container:run\" \"pnpm copy-assets\" \"pnpm test\" \"pnpm image:build\" --finally \"pnpm m2-repo-via-http:container:kill\" \"rimraf ./dist/tmp-m2\"",
"build:dev": "pnpm build",
"build:prod": "pnpm build && pnpm image:test",
"copy:maven-m2-repo-via-http-image--settings-xml": "run-script-os",
Expand Down
2 changes: 1 addition & 1 deletion packages/sonataflow-devmode-image/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"url": "https://github.com/apache/incubator-kie-tools/issues"
},
"scripts": {
"build": "run-script-if --bool \"$(build-env containerImages.build)\" --then \"pnpm m2-repo-via-http:container:run\" \"pnpm copy-assets\" \"pnpm image:build\" --finally \"pnpm m2-repo-via-http:container:kill\"",
"build": "run-script-if --bool \"$(build-env containerImages.build)\" --then \"pnpm m2-repo-via-http:container:run\" \"pnpm copy-assets\" \"pnpm image:build\" --finally \"pnpm m2-repo-via-http:container:kill\" \"rimraf ./dist/tmp-m2\"",
"build:dev": "pnpm build",
"build:prod": "pnpm build && pnpm image:test",
"copy:maven-m2-repo-via-http-image--settings-xml": "run-script-os",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ shift $#
script_dir_path=$(cd `dirname "${BASH_SOURCE[0]}"`; pwd -P)

export NODE_OPTIONS="${NODE_OPTIONS} --max_old_space_size=4096"
APPS_MAVEN_OPTIONS="-Dquarkus.package.type=fast-jar -Dquarkus.build.image=false"
APPS_MAVEN_OPTIONS="-Dquarkus.package.type=fast-jar -Dquarkus.build.image=false -B"
# used for all-in-one image
extended_context=""

Expand Down
4 changes: 2 additions & 2 deletions packages/yard-validator-worker/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@

<profiles>
<profile>
<id>kie-tools--maven-profile--1st-party-dependencies</id>
<id>include-1st-party-dependencies</id>
<activation>
<property>
<name>ignore--kie-tools--maven-profile--1st-party-dependencies</name>
<name>kieTools.do-not-use-this-property.ignore1stPartyDependencies</name>
<value>!true</value>
</property>
</activation>
Expand Down

0 comments on commit 954d8a8

Please sign in to comment.