Skip to content

ci: Add Maven fast profile to skip maven lifecycle plugins#12188

Open
lqiu96 wants to merge 7 commits intomainfrom
maven-fast-profile
Open

ci: Add Maven fast profile to skip maven lifecycle plugins#12188
lqiu96 wants to merge 7 commits intomainfrom
maven-fast-profile

Conversation

@lqiu96
Copy link
Member

@lqiu96 lqiu96 commented Mar 24, 2026

Adding a maven profile that makes it easier to build modules faster locally. Added benefit is to make it easier to run faster builds in the CI.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a new Maven profile, fast, designed to significantly reduce build times for local development and continuous integration environments. By activating this profile, a comprehensive set of code quality and build lifecycle plugins are bypassed, allowing for quicker compilation and testing cycles without performing full static analysis or reporting.

Highlights

  • New Maven Profile: A new Maven profile named 'fast' has been introduced in the parent POMs.
  • Plugin Skipping: This 'fast' profile is configured to skip numerous Maven lifecycle plugins, including checkstyle, enforcer, jacoco, clirr, spotbugs, pmd, animal-sniffer, fmt, flatten, and mdep.analyze.
  • Scope of Application: The 'fast' profile has been added to both google-cloud-pom-parent/pom.xml and sdk-platform-java/pom.xml.
Ignored Files
  • Ignored by pattern: .github/workflows/** (2)
    • .github/workflows/ci.yaml
    • .github/workflows/sdk-platform-java-ci.yaml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@lqiu96 lqiu96 changed the title ci: Add fast profile that skips all maven lifecycle plugins ci: Add Maven fast profile to skip maven lifecycle plugins Mar 24, 2026
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new 'fast' Maven profile in both google-cloud-pom-parent/pom.xml and sdk-platform-java/pom.xml. This profile is designed to skip various build plugins (e.g., checkstyle, Jacoco, SpotBugs) to accelerate build times. A review comment highlights that the 'fast' profile in sdk-platform-java/pom.xml might be redundant if it inherits from google-cloud-pom-parent, suggesting its removal to prevent duplication and enhance maintainability.

@lqiu96
Copy link
Member Author

lqiu96 commented Mar 24, 2026

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new 'fast' Maven profile to centralize the skipping of various Maven plugins (e.g., Checkstyle, Enforcer, JaCoCo, Clirr) across the build system. This profile is then applied to various mvn commands in the Kokoro build scripts (.kokoro/build.sh, .kokoro/common.sh, .kokoro/dependencies.sh), allowing for the removal of individual -D*.skip=true flags. Feedback indicates that the 'fast' profile inadvertently disables the Maven Enforcer plugin and the dependency:analyze goal in .kokoro/dependencies.sh, which contradicts the script's intended purpose for those steps. Additionally, the 'fast' profile is duplicated in two different POM files, suggesting an opportunity for refactoring into a common parent POM for improved maintainability.

Comment on lines +80 to +94
<profile>
<id>fast</id>
<properties>
<checkstyle.skip>true</checkstyle.skip>
<enforcer.skip>true</enforcer.skip>
<jacoco.skip>true</jacoco.skip>
<clirr.skip>true</clirr.skip>
<spotbugs.skip>true</spotbugs.skip>
<pmd.skip>true</pmd.skip>
<animal.sniffer.skip>true</animal.sniffer.skip>
<fmt.skip>true</fmt.skip>
<flatten.skip>true</flatten.skip>
<mdep.analyze.skip>true</mdep.analyze.skip>
</properties>
</profile>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This fast profile is identical to the one defined in google-cloud-pom-parent/pom.xml. To improve maintainability and avoid code duplication, this profile should be defined in a common parent POM and inherited in both places. Please remove this duplicated profile and ensure it's inherited from a single source.

@lqiu96 lqiu96 requested review from blakeli0 and chingor13 March 24, 2026 20:40
@lqiu96 lqiu96 marked this pull request as ready for review March 24, 2026 20:40
@lqiu96 lqiu96 requested a review from a team as a code owner March 24, 2026 20:40
Copy link
Contributor

@chingor13 chingor13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you feel about naming the profiles based on their intent?

For example installOnly for when you want to do a module compile/install into your local maven repository. For this task, you would skip tests, clirr, enforcer, checkstyle etc.

Another separate profile for lint, native, integrationTests, etc. Most of these would be setting similar options (e.g. lint would also skip Tests and clirr)

@lqiu96
Copy link
Member Author

lqiu96 commented Mar 24, 2026

How do you feel about naming the profiles based on their intent?

For example installOnly for when you want to do a module compile/install into your local maven repository. For this task, you would skip tests, clirr, enforcer, checkstyle etc.

Open to a different name. Intention was just to create one simple profile that could be run for whatever maven lifecycle and skip plugin executions. It wasn't aimed to be specific to a maven lifecycle (compile, test, or install) in particular.

Another separate profile for lint, native, integrationTests, etc. Most of these would be setting similar options (e.g. lint would also skip Tests and clirr)

Probably could be added if it's needed, though I think it may be easier to just do something like -Pfast -{plugin}.skip=false to explicitly enable a specific plugin. Perhaps this can be added in a future PR if needed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants