Closed clemensutschig closed 5 years ago
@stitakis - can you please look into that asap...?!
it looks like the sed replace to generate the nexus lines is not working anymore .. below is a working example
ext { springBootVersion = '1.5.15.RELEASE' // fix for not set system variable nexus_url = "${project.findProperty('nexus_url') ?: System.getenv('NEXUS_HOST')}" nexus_user = "${project.findProperty('nexus_user') ?: System.getenv('NEXUS_USERNAME')}" nexus_pw = "${project.findProperty('nexus_pw') ?: System.getenv('NEXUS_PASSWORD')}" }
after adding a project.ext {} block with nexus params - mavenDeployer unknown
` A problem occurred evaluating root project 'be-spring-boot'.
Could not find method mavenDeployer() for arguments [build_8zfjksubn6d5jf11d54agj8rz$_run_closure5$_closure12$_closure13@48a46b0f] on repository container of type org.gradle.api.internal.artifacts.dsl.DefaultRepositoryHandler. `
and then
test { outputs.dir snippetsDir } asciidoctor { inputs.dir snippetsDir dependsOn test }
failing with `
Could not get unknown property 'snippetsDir' for task ':test' of type org.gradle.api.tasks.testing.Test. `
An approach "could be" - to check for the version that is generated ... and for 4.10 copy a template from the context ... and replace group id etc. and leave for 4.9 as is ...
ods-provisioning-app/gradle/wrapper (production_BI_PROD) $ version=$(grep /gradle-. gradle-wrapper.properties | cut -d "-" -f2) $ echo $version 4.9
$ if [ "$version" == 4.10 ]; then echo "4.10"; else echo "not"; fi not
@michaelsauter / @stitakis - thoughts?
I had a look at this... to fix the missing variable definition of "snippetsDir", we need to define the variable and add restdocs dependencies to the dependencies block... this worked for my in test project:
ext {
snippetsDir = file('build/generated-snippets')
}
ext['spring-restdocs.version'] = '2.0.2.RELEASE'
repositories { ... }
2. add in dependencies definition:
testCompile "org.springframework.restdocs:spring-restdocs-webtestclient:${project.ext['spring-restdocs.version']}" asciidoctor "org.springframework.restdocs:spring-restdocs-asciidoctor:${project.ext['spring-restdocs.version']}"
@michaelsauter @stitakis maybe you can grab the branch quickly onto BI X .. and test there (with 4.9)..
[cleke-cd-be-spring-boot-test] Running shell script
Welcome to Gradle 4.10.2!
Here are the highlights of this release:
plugins {}
blockFor more details see https://docs.gradle.org/4.10.2/release-notes.html
FAILURE: Build failed with an exception.
Where: Build file '/tmp/workspace/cleke-cd-be-spring-boot-test/build.gradle' line: 15
What went wrong: A problem occurred evaluating root project 'be-spring-boot'.
Try: Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Exception is: org.gradle.api.GradleScriptException: A problem occurred evaluating root project 'be-spring-boot'. at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:92) at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl$2.run(DefaultScriptPluginFactory.java:206) at org.gradle.configuration.ProjectScriptTarget.addConfiguration(ProjectScriptTarget.java:77) at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:211) at org.gradle.configuration.BuildOperationScriptPlugin$1$1.run(BuildOperationScriptPlugin.java:69)
This is because of https://github.com/opendevstack/ods-project-quickstarters/blob/master/boilerplates/be-springboot/init.sh#L55
which generates the needed lines
the build gradle generated now ...
looks like the whole ext {} section with "springBootVersion = '1.5.15.RELEASE'" is missing when you generate with spring boot 2.0.2 ...
code to generate:
springboot init --build=gradle --java-version=1.8 --groupId=cleke --artifactId=be-spring-boot --package-name=com.bix_digital.cleke.be_spring_boot --packaging=jar --dependencies=web,jersey,data-jpa,h2,lombok,data-rest,restdocs,security be-spring-boot