Skip to content

Commit

Permalink
fix(maven): rework module names and plugins
Browse files Browse the repository at this point in the history
* shorten folder names by removing `fpi-msgr-api-` prefix for each
module directory name
* add `lib-only` & `all-modules` profile for dev & main
* skip deployment of core module
  • Loading branch information
vincejv committed Nov 15, 2022
1 parent 5f45055 commit 4ba4e81
Show file tree
Hide file tree
Showing 55 changed files with 71 additions and 39 deletions.
8 changes: 4 additions & 4 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
*
!*core/target/*-runner
!*core/target/*-runner.jar
!*core/target/lib/*
!*core/target/quarkus-app/*
!core/target/*-runner
!core/target/*-runner.jar
!core/target/lib/*
!core/target/quarkus-app/*
6 changes: 3 additions & 3 deletions .github/workflows/release-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=${{ env.SONAR_PROJECT_KEY }} -Dsonar.qualitygate.wait=true -P allow-snapshots
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=${{ env.SONAR_PROJECT_KEY }} -Dsonar.qualitygate.wait=true -Pallow-snapshots

deploy_to_cloud:
name: Deploy to Cloud Run
Expand Down Expand Up @@ -102,7 +102,7 @@ jobs:
echo "service_image_path=${{ env.REGISTRY }}/${{ env.PROJECT_ID }}/${{ env.GHUB_REPO_NAME }}/${{ env.SERVICE }}:${{ steps.gen_ver.outputs.artifact_version }}" >> $GITHUB_OUTPUT
- name: Create JVM package
run: mvn -B package -P allow-snapshots
run: mvn -B package -Pallow-snapshots

- name: Google Auth
id: gcp-auth
Expand Down Expand Up @@ -214,7 +214,7 @@ jobs:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
run: mvn -B deploy -P release-for-oss,allow-snapshots
run: mvn -B deploy -Dlib-only -Prelease-for-oss,allow-snapshots

pr_update:
name: Pull request update
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -256,4 +256,4 @@ jobs:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
run: mvn -B deploy -Prelease-for-oss
run: mvn -B deploy -Dlib-only -Prelease-for-oss
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ WORKDIR /work/
RUN chown 1001 /work \
&& chmod "g+rwX" /work \
&& chown 1001:root /work
COPY --chown=1001:root *core/target/*-runner /work/application
COPY --chown=1001:root core/target/*-runner /work/application

EXPOSE 8080
USER 1001
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 12 additions & 8 deletions fpi-bot-api-core/pom.xml → core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@
<version>0</version>

<parent>
<artifactId>fpi-bot-api</artifactId>
<artifactId>fpi-bot-api-parent</artifactId>
<groupId>com.abavilla</groupId>
<version>0</version>
<relativePath>../pom.xml</relativePath>
</parent>

<properties>
Expand All @@ -64,12 +65,12 @@

<dependency>
<groupId>com.abavilla</groupId>
<artifactId>fpi-bot-api-lib</artifactId>
<artifactId>fpi-bot-api</artifactId>
</dependency>

<dependency>
<groupId>com.abavilla</groupId>
<artifactId>fpi-meta-plugin-lib</artifactId>
<artifactId>fpi-meta-plugin</artifactId>
</dependency>

<dependency>
Expand All @@ -79,22 +80,22 @@

<dependency>
<groupId>com.abavilla</groupId>
<artifactId>fpi-login-api-lib</artifactId>
<artifactId>fpi-login-api</artifactId>
</dependency>

<dependency>
<groupId>com.abavilla</groupId>
<artifactId>fpi-load-api-lib</artifactId>
<artifactId>fpi-load-api</artifactId>
</dependency>

<dependency>
<groupId>com.abavilla</groupId>
<artifactId>fpi-msgr-api-lib</artifactId>
<artifactId>fpi-msgr-api</artifactId>
</dependency>

<dependency>
<groupId>com.abavilla</groupId>
<artifactId>fpi-telco-plugin-lib</artifactId>
<artifactId>fpi-telco-plugin</artifactId>
</dependency>

<dependency>
Expand All @@ -104,7 +105,7 @@

<dependency>
<groupId>com.abavilla</groupId>
<artifactId>fpi-viber-plugin-lib</artifactId>
<artifactId>fpi-viber-plugin</artifactId>
</dependency>

</dependencies>
Expand All @@ -118,6 +119,7 @@
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>

Expand All @@ -127,10 +129,12 @@
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
</plugin>

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 6 additions & 2 deletions fpi-bot-api-lib/pom.xml → lib/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
<inceptionYear>2022</inceptionYear>

<modelVersion>4.0.0</modelVersion>
<artifactId>fpi-bot-api-lib</artifactId>
<artifactId>fpi-bot-api</artifactId>
<version>0</version>

<parent>
<artifactId>fpi-bot-api</artifactId>
<artifactId>fpi-bot-api-parent</artifactId>
<groupId>com.abavilla</groupId>
<version>0</version>
<relativePath>../pom.xml</relativePath>
Expand All @@ -46,10 +46,12 @@
<dependencies>

</dependencies>

<build>
<plugins>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>

Expand All @@ -59,10 +61,12 @@
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
</plugin>

Expand Down
64 changes: 44 additions & 20 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,14 @@
<parent>
<groupId>com.abavilla</groupId>
<artifactId>fpi-framework-pom</artifactId>
<version>1.5.2</version>
<version>1.5.4</version>
</parent>

<modelVersion>4.0.0</modelVersion>
<artifactId>fpi-bot-api</artifactId>
<artifactId>fpi-bot-api-parent</artifactId>
<packaging>pom</packaging>
<version>0</version>

<modules>
<module>fpi-bot-api-lib</module>
<module>fpi-bot-api-core</module>
</modules>

<properties>

</properties>
Expand All @@ -71,38 +66,38 @@

<dependency>
<groupId>com.abavilla</groupId>
<artifactId>fpi-bot-api-lib</artifactId>
<artifactId>fpi-bot-api</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>com.abavilla</groupId>
<artifactId>fpi-meta-plugin-lib</artifactId>
<version>1.0.16</version>
<artifactId>fpi-meta-plugin</artifactId>
<version>1.0.19</version>
</dependency>

<dependency>
<groupId>com.abavilla</groupId>
<artifactId>fpi-login-api-lib</artifactId>
<version>1.2.3</version>
<artifactId>fpi-login-api</artifactId>
<version>1.3.4</version>
</dependency>

<dependency>
<groupId>com.abavilla</groupId>
<artifactId>fpi-load-api-lib</artifactId>
<version>1.2.3</version>
<artifactId>fpi-load-api</artifactId>
<version>1.3.2</version>
</dependency>

<dependency>
<groupId>com.abavilla</groupId>
<artifactId>fpi-msgr-api-lib</artifactId>
<version>1.3.0</version>
<artifactId>fpi-msgr-api</artifactId>
<version>1.3.1</version>
</dependency>

<dependency>
<groupId>com.abavilla</groupId>
<artifactId>fpi-telco-plugin-lib</artifactId>
<version>1.2.0</version>
<artifactId>fpi-telco-plugin</artifactId>
<version>1.2.3</version>
</dependency>

<dependency>
Expand All @@ -113,11 +108,40 @@

<dependency>
<groupId>com.abavilla</groupId>
<artifactId>fpi-viber-plugin-lib</artifactId>
<version>1.1.4</version>
<artifactId>fpi-viber-plugin</artifactId>
<version>1.1.6</version>
</dependency>

</dependencies>
</dependencyManagement>

<profiles>

<profile>
<id>lib-only</id>
<activation>
<property>
<name>lib-only</name>
</property>
</activation>
<modules>
<module>lib</module>
</modules>
</profile>

<profile>
<id>all-modules</id>
<activation>
<property>
<name>!lib-only</name>
</property>
</activation>
<modules>
<module>lib</module>
<module>core</module>
</modules>
</profile>

</profiles>

</project>

0 comments on commit 4ba4e81

Please sign in to comment.