Hello
If I have the following from Maven (it works fine)
<properties>
<maven.test.failure.ignore>true</maven.test.failure.ignore>
<logback.version>1.1.2</logback.version>
<slf4j.version>1.7.10</slf4j.version>
</properties>
<dependencies>
<!-- Logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logback.version}</version>
</dependency>
</dependencies>
I have tried the following through Gradle
First:
ext {
slf4jVersion = '1.7.10'
logbackVersion = '1.1.2'
}
Until here I did realize I am not able to define slf4j.version
, it fails if I use a dot. Therefore I must use in this way: slf4jVersion
. No use a dot, and use an uppercase for a better human reading.
Question One: Is there a legal syntax way to keep the dot?
Second:
dependencies {
compile 'org.slf4j:slf4j-api:' + slf4jVersion,
'org.slf4j:jcl-over-slf4j:' + slf4jVersion,
'ch.qos.logback:logback-classic:' + logbackVersion
}
It works only in that way. Just curious if exists other way to avoid the +.
I have tried
dependencies {
compile 'org.slf4j:slf4j-api:slf4jVersion',
'org.slf4j:jcl-over-slf4j:slf4jVersion',
'ch.qos.logback:logback-classic:logbackVersion'
}
and fails. Even using double quotes “”, it fails. I am not an expert in Groovy syntax.
Question two: what could be the elegant way to accomplish this approach without +. Pls I don’t want use the group, name and version attributes.
Thanks in advanced.