Skip to content

Commit

Permalink
fix(maven): rework modules and plugins
Browse files Browse the repository at this point in the history
* shorten folder names by removing `fpi-sms-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 8066fb1 commit 5220d50
Show file tree
Hide file tree
Showing 81 changed files with 69 additions and 28 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 @@ -209,7 +209,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
4 changes: 2 additions & 2 deletions .github/workflows/release-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ jobs:
cache: maven

- name: Generate native image
run: mvn -B package -Pnative -Dquarkus.native.container-build=true -Dquarkus.native.builder-image=${{ env.NATIVE_IMAGE_BUILDER }} -P allow-snapshots
run: mvn -B package -Pnative -Dquarkus.native.container-build=true -Dquarkus.native.builder-image=${{ env.NATIVE_IMAGE_BUILDER }}

- name: Google Auth
id: gcp-auth
Expand Down Expand Up @@ -251,4 +251,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.
File renamed without changes.
File renamed without changes.
15 changes: 12 additions & 3 deletions fpi-sms-api-core/pom.xml → core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

<parent>
<groupId>com.abavilla</groupId>
<artifactId>fpi-sms-api</artifactId>
<artifactId>fpi-sms-api-parent</artifactId>
<version>0</version>
<relativePath>../pom.xml</relativePath>
</parent>
Expand All @@ -60,7 +60,7 @@

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

<dependency>
Expand All @@ -76,30 +76,39 @@

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

</dependencies>

<build>
<plugins>

<plugin>
<groupId>${quarkus.platform.group-id}</groupId>
<artifactId>quarkus-maven-plugin</artifactId>
</plugin>

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

<plugin>
<groupId>io.smallrye</groupId>
<artifactId>jandex-maven-plugin</artifactId>
</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>

</plugins>
</build>

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.
File renamed without changes.
File renamed without changes.
14 changes: 11 additions & 3 deletions fpi-sms-api-lib/pom.xml → lib/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@
<inceptionYear>2022</inceptionYear>

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

<parent>
<groupId>com.abavilla</groupId>
<artifactId>fpi-sms-api</artifactId>
<artifactId>fpi-sms-api-parent</artifactId>
<version>0</version>
<relativePath>../pom.xml</relativePath>
</parent>
Expand All @@ -58,25 +58,33 @@
<dependencies>
<dependency>
<groupId>com.abavilla</groupId>
<artifactId>fpi-login-api-lib</artifactId>
<artifactId>fpi-login-api</artifactId>
</dependency>
</dependencies>

<build>
<plugins>

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

<plugin>
<groupId>io.smallrye</groupId>
<artifactId>jandex-maven-plugin</artifactId>
</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>

</plugins>
</build>
</project>
48 changes: 36 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,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-sms-api</artifactId>
<artifactId>fpi-sms-api-parent</artifactId>
<version>0</version>
<packaging>pom</packaging>

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

<properties>

</properties>
Expand All @@ -77,7 +72,7 @@

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

Expand All @@ -90,17 +85,46 @@

<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-telco-plugin-lib</artifactId>
<version>1.2.0</version>
<artifactId>fpi-telco-plugin</artifactId>
<version>1.2.3</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 5220d50

Please sign in to comment.