-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug Report: Maven regex-profile-activator extension seems not to work in Maven 3.9/FISH-9752 #93
Comments
Hello @sroughley, I can confirm that the plugin does not seem to function at all based on your reproducer. I tried using older versions of Mavenm an older JDK and different combinations of regular expressions, without any success. I have raised an internal issue, codename Thank you very much for your report! Best regards, |
Hi Felix, Thanks for the update! Steve |
I had a further thought recently about this issue, and have now resolved it. The solution is as follows, for anyone else looking in the future. Although this is sort of "maven obvious" (with hindsight!), maybe worth adding to the product documentation? The <extensions>
<extension>
<groupId>fish.payara.maven.extensions</groupId>
<artifactId>regex-profile-activator</artifactId>
<version>0.5</version>
</extension>
</extensions> works. So, the output of $ mvn clean
[INFO] Scanning for projects...
[INFO]
[INFO] -----------------------< com.vernalis:bugreport >-----------------------
[INFO] Building bugreport 0.0.1-SNAPSHOT
[INFO] from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- clean:3.2.0:clean (default-clean) @ bugreport ---
[INFO] Deleting ...\mvn-regex-profile-activator-test\target
[INFO]
[INFO] --- antrun:3.1.0:run (version-print) @ bugreport ---
[INFO] Executing tasks
[WARNING] [echo] Keyword: 5.2
[INFO] Executed tasks
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.567 s
[INFO] Finished at: 2024-12-17T11:15:41Z
[INFO] ------------------------------------------------------------------------ But with e.g. $ mvn clean -Dkeyword=testing
[INFO] Scanning for projects...
[INFO]
[INFO] -----------------------< com.vernalis:bugreport >-----------------------
[INFO] Building bugreport 0.0.1-SNAPSHOT
[INFO] from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- clean:3.2.0:clean (default-clean) @ bugreport ---
[INFO] Deleting ...\mvn-regex-profile-activator-test\target
[INFO]
[INFO] --- antrun:3.1.0:run (version-print) @ bugreport ---
[INFO] Executing tasks
[WARNING] [echo] Keyword: testing
[INFO] Executed tasks
[INFO]
[INFO] --- antrun:3.1.0:run (test-print) @ bugreport ---
[INFO] Executing tasks
[WARNING] [echo] TEST Profile active
[INFO] Executed tasks
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.612 s
[INFO] Finished at: 2024-12-17T11:18:31Z
[INFO] ------------------------------------------------------------------------ |
Brief Summary
Regex-based profile activation appears not to work using regex-profile-activator with Mavn 3.9.9
Expected Outcome
A maven profile should be activated when using this plugin during compilation
Current Outcome
The profile activation appears not to be happening
Reproducer
Creating a simple empty Maven project with the following pom.xml file:
and running the following command:
Should activate the
test-keyword
profile as shown by the phraseTEST Profile active
appearing in the console output, however this does not happen, e.g.:However, changing the
<value>
entry to a simple<value>testing</value>
in the pom.x,ml and repeating shows the profile activated by the conventional means:Maven / JDK version as shown:
Operating System
Win11 Pro 23H2
JDK Version
Eclips Adoptium 21.0.3
Ecosystem Tool
Maven Regex Extension
The text was updated successfully, but these errors were encountered: