PorterZhang2021 commented on PR #6305:
URL: https://github.com/apache/kyuubi/pull/6305#issuecomment-2060193417

   Hello, everyone @pan3793 @yikf, I have tried two solutions, and the 
following is my train of thought:
   # Solution 1
   ## Steps
   I found a way to use `<profiles>`, roughly as follows:
   ```xml
   <profiles>
           <profile>
               <id>scala-2.12</id>
               <activation>
                   <activeByDefault>true</activeByDefault>
               </activation>
               <properties>
                   <scala.binary.version>2.12</scala.binary.version>
               </properties>
           </profile>
           <profile>
               <id>scala-2.13</id>
               <properties>
                   <scala.binary.version>2.13</scala.binary.version>
               </properties>
           </profile>
       </profiles>
   ```
   After specifying, I attempted to use 
   1. `/ Build/mvn install - DskipTests - Dmaven. savadoc. skip=true - Dmaven. 
scaladoc. skip=true - Dmaven. source. skip - Pscala-2.12- Pscala-2.13- pl: 
kyuubi spark SQL engine - am ` 
   2. `/ Build/mvn install - DskipTests - Dmaven. savadoc. skip=true - Dmaven. 
scaladoc. skip=true - Dmaven. source. skip - Pscala-2.13- Pscala-2.12- pl: 
kyuubi spark SQL engine - am ` 
   ## Problem
   But in the end, it was found that if both '- Pscala2.12' and '- Pscala2.13' 
are used at the same time, '- Pscala2.13' will be selected by default, which 
may not be a good solution to this problem.
   # Solution 2
   Later, I thought about whether it was possible to filter the parameter '$@' 
internally. I tried writing the following code
   ## Steps
   
   1. code
   ```sh
   filtered_args=()
   for arg in "$@"; do
       if [ "$arg" != "-Pscala2.12" ]; then
           filtered_args+=("$arg")
       fi
   done
   
   echo "mvn install ${filtered_args[@]}"
   ```
   2. test
   then I try it, after using the ` /test-shell.sh -Pscala2.12 -Etest` command, 
the final result is as follows:
   
![image](https://github.com/apache/kyuubi/assets/96274454/5dc378d2-732d-4c6e-93a0-94a65c90bc69)
   
   This approach seems to meet our requirements. If you think this solution can 
be tried, I will conduct testing. At the same time, I also hope that you can 
provide me with some parameters that may be needed for `$@`, so that I can 
conduct some testing to prevent any problems from occurring.
   
   Thank you for your help and review.
   
   


-- 
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