
import com.sap.custdev.projects.fbs.slc.cfg.IConfigSession
Collection<URL> findSscMavenPomProperties() {
return IConfigSession.class.getClassLoader().getResources("META-INF/maven/com.sap.custdev.projects.fbs.slc/com.sap.custdev.projects.fbs.slc.ssc/pom.properties").collect()
}
Set<String> findSscVersions() {
return findSscMavenPomProperties().collect {
it.withInputStream {
final Properties pomProperties = new Properties()
pomProperties.load(it)
return pomProperties.getProperty("version")
}
}.unique()
}
List<URL> findSscJars() {
return findSscMavenPomProperties().findAll { "jar".equalsIgnoreCase(it.protocol) }.collect { new URL(it.path.substring(0, it.path.indexOf('!'))) }
}
def sscVersions = findSscVersions()
if (sscVersions.size() > 1) {
println "Multiple versions of SAP Product/Solution Configuration Runtime Engine found: ${sscVersions.join(", ")}"
println "Mutliple SAP Product/Solution Configuration Runtime Engine JARs found:"
findSscJars().each {
println " - ${it.toExternalForm()}"
}
} else if (sscVersions.size() == 1) {
println "SAP Product/Solution Configuration Runtime Engine version is ${sscVersions.iterator().next()}"
} else {
println "No SAP Product/Solution Configuration Runtime Engine found"
}
SAP Product/Solution Configuration Runtime Engine version is 3.2.21
Multiple versions of SAP Product/Solution Configuration Runtime Engine found: 3.2.24, 3.2.21
Mutliple SAP Product/Solution Configuration Runtime Engine JARs found:
- file:/[...]/hybris/bin/modules/sap-product-configuration-on-premise-edition/sapproductconfigruntimessc/lib/com.sap.custdev.projects.fbs.slc.ssc-3.2.24.jar
- file:/[...]/hybris/bin/modules/sap-product-configuration-on-premise-edition/sapproductconfigruntimessc/lib/com.sap.custdev.projects.fbs.slc.ssc-3.2.21.jar
IConfigSession
interface. Consequently, if the script detects multiple versions of the 2.x release, ensure to remove the unwanted version(s) for all JARs, not only the JAR(s) returned by the script.You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
3 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |