Is there a Java continuous testing plugin for Maven?
Asked Answered
B

4

18

I'm looking for a plugin that would run in a console continuously to scan a Maven project's test sources directory, and when it detects a change kicks off a test cycle. Something analogous to mvn scala:cc or the Scala Build Tool, but for Java. Can anyone point me towards one?

Bricker answered 5/7, 2012 at 15:30 Comment(5)
This might be obvious but, you are aware that there are continuous integration servers with good support for maven, right? e.g. Jenkins-CICachet
Yeah, I do. I am looking for something simple out of the box to run in a console alongside a text editor when I don't have access to a full-blown IDE.Bricker
Ok, all clear. You want eclipse's autobuild functionality minus eclipse :)Cachet
That's pretty much it :)Bricker
but jenkins offer a consloe command interface to manipulate itDisused
A
8

I have personally used sbt even for a java only project just for continuous test feature.

I added a sbt build file to a maven based project and use sbt when developing, but use maven when building the final package, starting embedded jetty etc and this has worked out quite well.

Agan answered 5/7, 2012 at 15:47 Comment(2)
That's certainly one way to do it, but I'm looking for something that wouldn't require me to introduce sbt.Bricker
It's quite possible that there isn't actually a Maven continuous compilation plugin, so this is the best answer that I received. Thanks!Bricker
B
4

I've just discovered that the scala-maven-plugin supports both continuous compilation & testing, as well as cross-compilation (Java + Scala). So it's possible to use it over a pure Java build and get all the continuous build goodness.

Bricker answered 10/8, 2012 at 12:47 Comment(1)
You're a genius, sir! :D It worked. see also https://mcmap.net/q/716188/-is-there-a-scala-unit-test-tool-that-integrates-well-with-mavenUrnfield
B
3

Recently, I have had a need for a solution to this. Having been learning scala and finding about the goodness of sbt ~test, I want to apply it to Java projects that do not have continuous test.

Using the scala-maven-plugin that you mentioned, I have created a github seed that will run Java Junit tests everytime I save a Java source or a Java test.

Check it out: https://github.com/ailveen/maven-scala-java-continuous-test

The project is very simple right now (contains only Java files because that is my current need) but in the future I hope to add scala test (or specs2 or scalacheck) so it works with mixed java and scala files.

Hope you find it useful.

Brainsick answered 20/2, 2015 at 20:18 Comment(0)
R
1

It is not exactly for Maven, but JUnit Max does continuous testing and if you're on Eclipse it might be the tool you would like to check out

Rascon answered 15/7, 2012 at 22:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.