[ 
https://issues.apache.org/jira/browse/FLINK-7058?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16091356#comment-16091356
 ] 

Chesnay Schepler commented on FLINK-7058:
-----------------------------------------

I've reverted 09a4a4bdfb03887387d47f366193d1216a66257c. I don't think we can 
solve this properly in 1.3 based on profiles.

In 1.3, scala 2.10 is the default. As such we want users to be able to compile 
Flink without specifying any profiles or properties related to scala 2.10; i.e 
"mvn clean install" should just work. This requires the {{quasiquotes}} 
dependency to be present by default. Currently, this is achieved with the 2.10 
profile that is activated when user specify either "-Pscala-2.10" (activating 
the profile directly) or does NOT specifiy "-Dscala-2.11" (indirectly 
activating the profile by fulfilling the {{!scala-2.11}} condition).

However, for 2.11 we don't want this dependency. For that we would have to 
disable the above dependency in the 2.11 profile, i.e. prevent the 2.10 profile 
from being activated. If we activate the 2.11 profile directly with 
"-Pscala-2.11", which is what the IDE does, we still however fulfill the 
condition for activating the 2.10 profile.

TL;DR: We cannot deactivate default dependencies with profiles, nor can we 
disable profiles from another profile.

> flink-scala-shell unintended dependencies for scala 2.11
> --------------------------------------------------------
>
>                 Key: FLINK-7058
>                 URL: https://issues.apache.org/jira/browse/FLINK-7058
>             Project: Flink
>          Issue Type: Bug
>          Components: Build System
>    Affects Versions: 1.3.0, 1.3.1
>            Reporter: Piotr Nowojski
>            Assignee: Piotr Nowojski
>            Priority: Critical
>             Fix For: 1.4.0, 1.3.2
>
>
> Activation of profile scala-2.10 in `flink-scala-shell` and `flink-scala` do 
> not work as intended. 
> {code:xml}
>       <profiles>
>               <profile>
>                       <id>scala-2.10</id>
>                       <activation>    
>                               <property>
>                                       <name>!scala-2.11</name>
>                               </property>
>                       </activation>
>                       <dependencies>
>                               <dependency>
>                                       <groupId>org.scalamacros</groupId>
>                                       
> <artifactId>quasiquotes_2.10</artifactId>
>                                       
> <version>${scala.macros.version}</version>
>                               </dependency>
>                               <dependency>
>                                       <groupId>org.scala-lang</groupId>
>                                       <artifactId>jline</artifactId>
>                                       <version>2.10.4</version>
>                               </dependency>
>                       </dependencies>
>               </profile>
>       </profiles>
> <activation>
> </activation>
> {code}
> This activation IMO have nothing to do with `-Pscala-2.11` profile switch 
> used in our build. "properties" are defined by `-Dproperty` switches. As far 
> as I understand that, those additional dependencies would be added only if 
> nobody defined property named `scala-2.11`, which means, they would be added 
> only if switch `-Dscala-2.11` was not used, so it seems like those 
> dependencies were basically added always. This quick test proves that I'm 
> correct:
> {code:bash}
> $ mvn dependency:tree -pl flink-scala | grep quasi
> [INFO] +- org.scalamacros:quasiquotes_2.10:jar:2.1.0:compile
> $ mvn dependency:tree -pl flink-scala -Pscala-2.11 | grep quasi
> [INFO] +- org.scalamacros:quasiquotes_2.10:jar:2.1.0:compile
> $ mvn dependency:tree -pl flink-scala -Pscala-2.10 | grep quasi
> [INFO] +- org.scalamacros:quasiquotes_2.10:jar:2.1.0:compile
> {code}
> regardless of the selected profile those dependencies are always there.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to