Hi everyone,

when I build my project, Maven tells me the following:

[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.hannobraun:scalable-dynamics_2.8.0:jar:0.3-SNAPSHOT [WARNING] 'artifactId' contains an expression but should be a constant. @ com.hannobraun:scalable-dynamics_${scala.version}:0.3-SNAPSHOT, /home/hanno/Projects/ScalableDynamics/pom.xml
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]


I think the ability to have an expression in the artifactId is very useful for Scala projects built with Maven. Due to binary incompatibility between code that was compiled with different versions of the Scala compiler, Scala projects have adopted the convention of adding the Scala version used to the artifact id. See this for example: http://mvnrepository.com/artifact/org.scala-tools.testing


Due to the ability to use an expression in the artifact id I can do something like this:

<properties>
<scala.version>2.8.0</scala.version>
</properties>

<artifactId>scalable-dynamics_${scala.version}</artifactId>

...

<dependencies>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>${scala.version}</version>
</dependency>

<dependency>
<groupId>org.scala-tools.testing</groupId>
<artifactId>specs_${scala.version}</artifactId>
<version>1.6.5</version>
<scope>test</scope>
</dependency>
</dependencies>


This approach is pretty much error-proof and low-maintenance. Requiring a constant artifactId would introduce the possibility of errors every time I update to another Scala version.

While I understand the notion of wanting to restrict what a user can do for safety reasons, I think it would be a shame to take power away from the users. You'll never be able to anticipate what kind of productive uses people will find for this power.

Regards,
Hanno

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

Reply via email to