Howdy,

I am just shooting in the dark, but why not:
* activate profile on Java 22+
* release on Java 22?

(assuming the other module have maven.compiler.release=21 or some
reasonable value)

HTH
T

On Fri, Sep 13, 2024 at 11:41 AM Niels Basjes <ni...@basjes.nl> wrote:
>
> Hi,
>
> I have in my project a maven module that is only activated if a specific
> profile is active (by default it is not active).
> Side note: It is an part that requires Java 22, optional during development
> and I do want to release it with the maven-release-plugin
>
> I have put this profile into both the list of profiles that need to be
> active during preparation and release  (see sketch below).
>
> When I do "mvn release:prepare" it does not update the module2/pom.xml with
> the new version.
> I found that I need to explicitly activate it on the commandline as well to
> activate it there too "mvn release:prepare -PActivateModule2"
>
> I expected this profile to be active during the entire prepare phase (i.e.
> including the "update the version" part).
>
> Is this an omission/bug or is this as intended?
>
> Niels Basjes
>
> <build>
>   <plugins>
>     <plugin>
>       <groupId>org.apache.maven.plugins</groupId>
>       <artifactId>maven-release-plugin</artifactId>
>       <version>3.1.1</version>
>       <configuration>
>         <preparationProfiles>ActivateModule2</preparationProfiles>
>         <releaseProfiles>ActivateModule2</releaseProfiles>
>       </configuration>
>     </plugin>
>   </plugins>
> </build>
>
> <modules>
>   <module>module1</module>
> </modules>
>
> <profiles>
>   <profile>
>     <id>ActivateModule2</id>
>     <modules>
>       <module>module2</module>
>     </modules>
>   </profile>
> </profiles>
>
>
>
> --
> Best regards / Met vriendelijke groeten,
>
> Niels Basjes

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to