Access the path to jacocoagent.jar in gradle using the JaCoCo plugin? - google-app-engine

Is there a way to access the path to the jacocoagent.jar used by the Gradle JaCoCo plugin?
I want to use to use it in JVM arguments to get code coverage when testing a GAE dev instance.
e.g.
jvmFlags = ["-javaagent:${<path to agent jar>}=destfile=${buildDir}/jacoco/jacoco.exec"]
Also, is there a better way of getting jacoco coverage of a GAE?

Related

Configuring Groovy on Jenkins

I'm using Jenkins ver 2.121.2. I'm trying to configure the Groovy plugin to run groovy scripts via a Jenkins job. The plugin documentation provided here
does not appear to match the UI I see in the System Configuration - Groovy section of this version of Jenkins. The various parameters don't match and so far I'm unable to get the plugin to run a simply groovy script. Not being familar with java and how the classpath works I'm not able to loosely interpret the instructions and get it working. If anyone can point me at documentation that more closely matches the Groovy plugin with the most current version of Jenkins I would appreciate it.
First, you need to configure an instance (or instances) of Groovy to run scripts in your builds. You do that on the Global Tool Configuration page.
You should have a least one JDK configured in the Global Tools Configuration (or have JAVA_HOME defined).
You can have Jenkins install the version of Groovy you want (on first use), or you can install Groovy yourself and point to it as in the example below:
Once this is in place, you can use the Execute Groovy Script build step in a build:

Jenkins pipeline Incremental build(maven)

Does anybody know how to get feature "Incremental build - only build changed modules" from Maven Project Plugin available from inside jenkins declarative pipeline (Jenkinsfile)

Packaging Smoke tests as an (additional) executable jar in Gradle build

We have a gradle build creating a SpringBoot web application. The SpringBoot app is tested with a variety of tests including a suite of WebDriver 'journey' tests. We run a subset of these journey tests as 'smoke' tests on different environments.
To make this as simple as possible we want to create an executable FatJar (or similar) consisting of a Main class, the smoke tests and testing dependencies. This artifact should be created in addition to the main application jar and can then be run against an arbitrary environment from the command line.
What's the best way of achieving this? Sub-projects don't seem to fit because we want to package the 'test' output from a single project. The spring-boot gradle plugin seems to be (rightly) geared to producing a single application artifact, is there a way to MacGyver it to create another executable jar with the smoke tests? Is this just crazy talk?

Single page application using grunt and tomcat

We are building single page application, using AngularJS and Spring Rest services along with spring boot. For front end build we are using grunt and for server site build maven. But we are not sure hove to build single WAR file which contains build out put from gunt and our java output.
Deployment server Tomcat.
Regards
Mahesh
You can give a try using maven-grunt plugin.
https://github.com/allegro/grunt-maven-plugin
I have the exact same setup. I am invoking grunt from maven.
From maven I invoke frontend-maven-plugin it actually downloads node binary and all node packages. And invokes grunt and bower. This essentially helps me build my project in any environment without installing node(even in Jekins server). Configure warSourceDirectory to read grunts output.

Java | Maven - Plugins | Is it suggested to use cargo maven plugin in production environment ?

Currently we have a script that does maven build + tomcat deploy.
Deploying to tomcat involves stopping the server (force stop by setting CATALINA_PID), deleting war file and exploded folder from its webapps directory, copying new war file to webapps/ , deleting tomcat work directory and finally starting the server.
Can we achieve all/most of these using cargo-maven2 plugin (cleaning work/webapps ??)
[ I have a basic config that can be used to just stop,deploy and start ]
And is it good to use the plugin in production environment as well ? The documentation mentions that its useful for integration tests.
Can you guys share your thoughts on this?
Thanks,
Gayathri
As you already mentioned from the docs Cargo is for functional testing. For production you should use other things like puppet or chef. Furthermore Maven is not a deployment tool it's a build tool. From a technical point of view it's of course possible to use it in production but it's not intended.

Resources