When I'm running the maven tests from my IntelliJ environment i can see all the application setup logs. I'm working with logback.
But when I'm running same maven tests on jenkins, there is no output for application logs.
Thus I have some tests that fails on linux and i have no idea why.
How can I make the logs be printed when i'm running:
mvn clean -DskipTests=false test
Related
I have a big java project. Using maven to automate the build and manage dependencies and JUnit for the unit testing.
When i'm running mvn clean install from Intellij the build fails because of one unit test that fails.
The test succeeds when ran manually.
Also, executing mvn clean install from the terminal succeeds. (all tests pass)
I'm not sure where to look for the problem here.
Thanks!
I have a very simple autotest method with sout and logger records.
If I run the test with Maven then autotest logs are not printed:
However, if I run test with IntelliJ Idea runner by clicking a green triangle then logs are there:
Obviously this has to do with Maven and with the way maven reads/prints logs from my autotests. Perhaps I need to add some configuration somewhere.
Worth noticing that I'm using Lombok and Surefire plugin.
I have a maven project that I run it using TomEE. I had to modify the source code, then wanted to run the project again on TomEE. The class files got updated, however, TomEE is still running the older version of the project. I noticed that too when I run test in debug it works fine, but when I run TomEE in debug the new source code lines are not recognized during debug. What is the command I should call to make TomEE get the updated class files to run it?
Note that I used: mvn clean install, mvn build and mvn clean package, and to run or debug I used: mvn tomee:run and mvn tomee:debug
After some research into running Cucumber on Jenkins I have come to a dead end, I have read some post here about Running Cucumber but most are error not the process.
Running via command line the problem here is that I don't know how to call this in Jenkins after building.
I have Jenkins running on an Ubuntu server. Everything for building a maven project is setup, but how would one run the Runcukes file or setup the pom file in a way to call cucumber to start running?
Wire up a Maven task to run cucumber. As cucumber generates stubs for junit, maven's surefire plugin will run the tests nicely.
Jenkins has full support for running maven builds, so you won't have any issues there.
I'm working with a multi-artifact Maven project where artifacts in the project have a few dependencies on each other. I am using IntelliJ 9. I'd like to be able to set breakpoints in my unit tests, but when I right-click on the unit tests folder for my artifact and choose "Debug 'All Tests'", I get a Class not found exception referring to a class in a separate Maven artifact.
I can run the Maven "test" goal on the parent artifact and it works fine.
Any ideas? Thanks.
In you run Maven from command line, you will be able to run it with debugger enabled and just attach Idea as remote debugger. That's how I usually use it.
mvn -Dmaven.surefire.debug="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -Xnoagent -Djava.compiler=NONE" test
See http://maven.apache.org/plugins/maven-surefire-plugin/examples/debugging.html
This will allow debugger connection to port 8000 and wait for you to attach before execution.
I wanted to run the unit tests for a specific package.
I was able to get this to work by making a new JUnit run/debug configuration in IntelliJ. I told it to run the tests in the specific package and for "Use classpath and JDK of module", I picked the root Maven artifact.