Skip to content

Comments

Add maven build profiles#2411

Open
vl-leon wants to merge 6 commits intomainfrom
add/java/build-profiles
Open

Add maven build profiles#2411
vl-leon wants to merge 6 commits intomainfrom
add/java/build-profiles

Conversation

@vl-leon
Copy link
Contributor

@vl-leon vl-leon commented Feb 23, 2026

No description provided.

@vl-leon vl-leon requested a review from smahati as a code owner February 23, 2026 14:13
@renejeglinsky renejeglinsky added AI Review AI generated suggestions labels Feb 24, 2026
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Here's a collaborative code review enhanced by AI assistance. These insights offer suggestions and patterns we've identified, though your expertise and judgment remain essential. Consider these recommendations as starting points for discussion rather than definitive solutions. You know your project best, so please adapt any suggestions to fit your specific needs and goals. We're here to support your development process.
Model: claude-sonnet-4-20250514 | Prompt Tokens: 1689 | Completion Tokens: 319

@renejeglinsky renejeglinsky removed the AI Review AI generated suggestions label Feb 24, 2026
....
<profiles>
<profile>
<id>production</id>
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't we add the local profile (as activated by default) as well?
Example command:
deploy --to h2 --with-mocks --dry --out "${project.basedir}/src/main/resources/schema-h2.sql"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point - we can add the global elements with "deploy --to ha2...".
By not providing a profile it takes by default the global commands as they are up to now - no changes.
In addition we have the production profile which does partial overwriting of cds.build only.
Docu: "All profile elements in a POM from active profiles overwrite the global elements with the same name of the POM or extend those in case of collections"

Using Maven profiles allows you to distinguish between builds for local development and production deployment. This flexibility is valuable in several scenarios:

* Generating [H2 database artifacts](../cqn-services/persistence-services#h2) for local development
* Creating database-specific artifacts for different target databases
Copy link
Contributor

Choose a reason for hiding this comment

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

we should also name the possibility to add additional Maven dependencies for production context (e.g. DwC)

<groupId>com.sap.cds</groupId>
<artifactId>cds-maven-plugin</artifactId>
<executions>
<execution>
Copy link
Contributor

Choose a reason for hiding this comment

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

[...]

there are usually many more executions

Copy link
Contributor Author

Choose a reason for hiding this comment

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

see prev.: partial overwriting

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.

3 participants