VGalaxies commented on PR #2277:
URL: 
https://github.com/apache/incubator-hugegraph/pull/2277#issuecomment-1689943936

   Following this 
[discussion](https://github.com/apache/incubator-hugegraph/pull/2277#discussion_r1302507017):
   
   Through researching relevant information, we found that the semantics of 
`activeByDefault` are somewhat counterintuitive. In a particular pom, if a 
profile is activated through:
   
   1. Specifying it via the command line using `-Pxxx`
   2. Defining it in the Maven settings using `<activeProfiles>`
   3. Implicit profile activation, such as `jdk`, `os`, `property`, `file`
   
   Then, within the **same** pom, a profile configured with `activeByDefault` 
set to true will NOT be activated.
   
   To avoid explicitly specifying profiles suppressed from activation due to 
the aforementioned mechanisms via `-Pxxx` in the command line, we referred to 
the approach outlined in the official documentation:
   
   ```xml
   <profiles>
     <profile>
       <id>xxx</id>
       <activation>
         <property>
           <name>!skip-xxx</name>
         </property>
       </activation>
       ...
     </profile>
   </profiles>
   ```
   
   Using the property mechanism within implicit profile activation to activate 
profiles configured with `activeByDefault` set to true.
   
   Additionally, it's important to minimize occurrences of identical property 
names across different profiles. For example:
   
   
![img_v2_97f89063-b734-4fa1-932f-0bf74c69867g](https://github.com/apache/incubator-hugegraph/assets/79143929/37dc95a1-4ed4-4a67-a5c2-aac658705ba8)
   
   In a scenario where both profiles are activated, the value of `env` is 
`test` (`dev` is loaded and then overridden). Explicitly specifying `-Pdev` 
could result in the value of `env` becoming `dev`, which might introduce 
potential issues.
   
   References:
   
   1. [Maven Introduction to Profiles - Property 
Activation](https://maven.apache.org/guides/introduction/introduction-to-profiles.html#Property)
   2. [Stack Overflow - How to Keep Maven Profiles which are activeByDefault 
active](https://stackoverflow.com/questions/5309379/how-to-keep-maven-profiles-which-are-activebydefault-active-even-if-another-prof)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to