With the below pom.xml,
a) if I do "mvn clean package -P 1x,2x", will maven do
"clean-compile-test-package" twice back to back using different dependency each
time and produce two different jar files?
b) is it better to have explicit <dependencies/> & <build/> in each profile
than tokenized <dependencies/> & <build/> outside <profles/>?
<?xml version="1.0" encoding="UTF-8"?>
<project>
<groupId>com.mycompany</groupId>
<artifactId>mything</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_${scala.compact}</artifactId>
<version>2.2.1</version>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}-${project.version}-${scala.compact}</finalName>
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>3.3.1</version>
<executions>
...
</executions>
<configuration>
<scalaCompatVersion>${scala.compact}</scalaCompatVersion>
<scalaVersion>${scala.version}</scalaVersion>
<recompileMode>incremental</recompileMode>
<useZincServer>false</useZincServer>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>1x</id>
<properties>
<scala.compact>2.10</scala.compact>
<scala.version>${scala.compact}.6</scala.version>
</properties>
</profile>
<profile>
<id>2x</id>
<properties>
<scala.compact>2.11</scala.compact>
<scala.version>${scala.compact}.8</scala.version>
</properties>
</profile>
</profiles>
</project>
Thanks,
Kyunam