Skip to content

Commit

Permalink
ci(deployment) Fix maven deployment make poms consistent with flatten…
Browse files Browse the repository at this point in the history
… plugin (#28431)

* fix maven deployment and flatten poms

* prevent old files from getting back in

* only flatten currently in ci build process
  • Loading branch information
spbolton authored May 6, 2024
1 parent 36cd9a3 commit 3ab9607
Show file tree
Hide file tree
Showing 32 changed files with 112 additions and 564 deletions.
2 changes: 1 addition & 1 deletion .github/actions/deploy-artifact-artifactory/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,5 @@ runs:
- name: 'Deploy Artifacts'
run: |
JVM_TEST_MAVEN_OPTS="-e -B --no-transfer-progress -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn"
eval ./mvnw -ntp deploy -Dprod=true -DskipTests=true -DskipITs=true $JVM_TEST_MAVEN_OPTS -pl \!:dotcms-integration,\!:dotcms-postman
eval ./mvnw -ntp deploy -Dprod=true -DskipTests=true -DskipITs=true $JVM_TEST_MAVEN_OPTS
shell: bash
6 changes: 4 additions & 2 deletions .github/workflows/cli-release-process.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,10 @@ jobs:
AUXILIARY_BRANCH=version-update-${RELEASE_VERSION}-${{ github.run_id }}
git checkout -b $AUXILIARY_BRANCH
# Update version in pom.xml
./mvnw -B -ntp versions:set versions:commit -DnewVersion=$RELEASE_VERSION
# set version in .mvn/maven.config
echo "-Dprod=true" > .mvn/maven.config
echo "-Drelease=${release_version}" >> .mvn/maven.config
echo "-Dchangelist=" >> .mvn/maven.config
# Commit version changes
git commit --allow-empty -a -m "Update dotCLI version to $RELEASE_VERSION"
Expand Down
25 changes: 8 additions & 17 deletions .github/workflows/maven-release-process.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,20 +111,10 @@ jobs:
fi
git checkout -b ${release_branch}
./mvnw -ntp \
${JVM_TEST_MAVEN_OPTS} \
versions:set \
versions:commit \
-DnewVersion=${release_version} \
-DprocessAllModules=true
./mvnw -ntp \
${JVM_TEST_MAVEN_OPTS} \
versions:set-property \
versions:commit \
-Dproperty=tika.api.version \
-DnewVersion=${release_version} \
--file independent-projects/pom.xml
# set version in .mvn/maven.config
echo "-Dprod=true" > .mvn/maven.config
echo "-Drelease=${release_version}" >> .mvn/maven.config
echo "-Dchangelist=" >> .mvn/maven.config
git status
git commit -a -m "🏁 Publishing release version [${release_version}]"
Expand All @@ -145,6 +135,7 @@ jobs:
./mvnw -ntp \
${JVM_TEST_MAVEN_OPTS} \
-Dprod=true \
-Dflatten.skip=false \
-Ddocker.buildArchiveOnly=${DOCKER_BUILD_CONTEXT} \
-DskipTests=true \
-DskipITs=true \
Expand Down Expand Up @@ -296,18 +287,18 @@ jobs:
./mvnw -ntp \
${JVM_TEST_MAVEN_OPTS} \
-Dprod=true \
-Dflatten.skip=false \
-DskipTests=true \
-DskipITs=true \
deploy \
--file dotCMS/pom.xml
deploy
if: github.event.inputs.deploy_artifact == 'true'

- name: Generate/Push Javadoc
run: |
./mvnw -ntp \
${JVM_TEST_MAVEN_OPTS} \
javadoc:javadoc \
--file dotCMS/pom.xml
-pl :dotcms-core
rc=$?
if [[ $rc != 0 ]]; then
echo "Javadoc generation failed with exit code $rc"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable-ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
run: |
echo "Creating $DOCKER_BUILD_CONTEXT"
mkdir -p $DOCKER_BUILD_CONTEXT
./mvnw -Dprod=true $JVM_TEST_MAVEN_OPTS -Dcoreit.test.skip=true -Dpostman.test.skip=true -Ddocker.buildArchiveOnly=$DOCKER_BUILD_CONTEXT -Ddotcms.image.name=${DOCKER_IMAGE}:${DOCKER_TAG} --show-version -DskipTests=true -DskipITs=true clean install --file pom.xml
./mvnw -Dprod=true -Dflatten.skip=false $JVM_TEST_MAVEN_OPTS -Dcoreit.test.skip=true -Dpostman.test.skip=true -Ddocker.buildArchiveOnly=$DOCKER_BUILD_CONTEXT -Ddotcms.image.name=${DOCKER_IMAGE}:${DOCKER_TAG} --show-version -DskipTests=true -DskipITs=true clean install --file pom.xml
- name: Persist Maven Repo
uses: actions/upload-artifact@v4
with:
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
release.properties
.flattened-pom.xml

/dependencies.txt
/updates.txt
Expand All @@ -161,4 +162,8 @@ dotCMS/src/main/webapp/dotcms-block-editor
dotCMS/src/main/webapp/WEB-INF/classes
# allow build to cache files that are not removed on clean e.g. spotless index
.cache
# prevent old files from other branches getting into the source
dotCMS/settings.gradle
dotCMS/dependencies.gradle

!/examples/nextjs/.npmrc
4 changes: 3 additions & 1 deletion bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
<parent>
<artifactId>dotcms-bom</artifactId>
<groupId>com.dotcms</groupId>
<version>1.0.0-SNAPSHOT</version>
<version>${revision}${sha1}${changelist}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>pom</packaging>
<artifactId>dotcms-application-bom</artifactId>

<properties>
<maven.deploy.skip>false</maven.deploy.skip>
<flatten.mode>bom</flatten.mode>
<aws-java-sdk.version>1.12.488</aws-java-sdk.version>
<twelvemonkeys.version>3.10.1</twelvemonkeys.version>
<swagger.version>2.2.0</swagger.version>
Expand Down
4 changes: 3 additions & 1 deletion bom/logging/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@
<parent>
<artifactId>dotcms-bom</artifactId>
<groupId>com.dotcms</groupId>
<version>1.0.0-SNAPSHOT</version>
<version>${revision}${sha1}${changelist}</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>dotcms-logging-bom</artifactId>
<packaging>pom</packaging>

<properties>
<maven.deploy.skip>false</maven.deploy.skip>
<flatten.mode>bom</flatten.mode>
<log4j.version>2.20.0</log4j.version>
<slf4j.version>2.0.7</slf4j.version>
</properties>
Expand Down
2 changes: 1 addition & 1 deletion bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<groupId>com.dotcms</groupId>
<artifactId>dotcms-parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>${revision}${sha1}${changelist}</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>

Expand Down
4 changes: 2 additions & 2 deletions build-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>com.dotcms</groupId>
<artifactId>dotcms-parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>${revision}${sha1}${changelist}</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>

Expand Down Expand Up @@ -52,7 +52,7 @@
<dependency>
<groupId>com.dotcms</groupId>
<artifactId>dotcms-application-bom</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>${project.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
9 changes: 2 additions & 7 deletions core-web/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
<parent>
<groupId>com.dotcms</groupId>
<artifactId>dotcms-nodejs-parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>${revision}${sha1}${changelist}</version>
<relativePath>../nodejs-parent/pom.xml</relativePath>
</parent>

<artifactId>dotcms-core-web</artifactId>
<packaging>war</packaging>

<properties>
<maven.deploy.skip>false</maven.deploy.skip>
<java.version>11</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
Expand Down Expand Up @@ -52,12 +53,6 @@
<include>**/*</include>
</includes>
</fileset>
<fileset>
<directory>.nx/cache</directory>
<includes>
<include>*/**</include>
</includes>
</fileset>
</filesets>
</configuration>
</plugin>
Expand Down
Loading

0 comments on commit 3ab9607

Please sign in to comment.