Removed jacoco from the build on circle

This commit is contained in:
Marcin Grzejszczak
2019-08-13 15:11:12 +02:00
parent 2419b53362
commit f1731e018e
2 changed files with 8 additions and 5 deletions

View File

@@ -32,7 +32,7 @@ jobs:
command: rm -rf ~/.m2/repository/org/springframework/cloud/contract && rm -rf ~/.m2/repository/com/example
- run:
name: "Running build"
command: ./mvnw -s .settings.xml clean org.jacoco:jacoco-maven-plugin:prepare-agent install -U -Pdocs,fast,integration,sonar -nsu --batch-mode -Dmaven.test.redirectTestOutputToFile=true -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
command: ./mvnw -s .settings.xml clean install -U -Pdocs,fast,integration -nsu --batch-mode -Dmaven.test.redirectTestOutputToFile=true -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
- run:
name: "Aggregate test results"
when: always

View File

@@ -128,16 +128,19 @@ class ContractVerifierDslConverter implements ContractConverter<Collection<Contr
private static Object toObject(ClassLoader cl, File rootFolder, File dsl) {
if (isJava(dsl)) {
try {
return parseJavaFile(dsl)
return parseJavaFile(cl, dsl)
}
catch (Exception ex) {
throw new DslParseException("Exception occurred while trying to parse the file [" + dsl + "] as a contract. Will not parse it.", ex)
if (log.isWarnEnabled()) {
log.warn("Exception occurred while trying to parse the file [" + dsl + "] as a contract. Will not parse it.", ex)
}
return null
}
}
return groovyShell(cl, rootFolder).evaluate(dsl)
}
private static Object parseJavaFile(File dsl) {
private static Object parseJavaFile(ClassLoader cl, File dsl) {
Constructor<?> constructor = classConstructor(dsl)
Object newInstance = constructor.newInstance()
if (!newInstance instanceof Supplier) {
@@ -158,7 +161,7 @@ class ContractVerifierDslConverter implements ContractConverter<Collection<Contr
if (!compilationResult.wasSuccessful()) {
throw new IllegalStateException("Exceptions occurred while trying to compile the file " + compilationResult.compilationMessages)
}
Class<?> clazz = compilationResult.compiledClasses.find { it.name == fqn }
Class<?> clazz = compilationResult.compiledClasses.find { it.name == fqn}
if (clazz == null) {
throw new IllegalStateException("Class with name [" + fqn + "] not found")
}