Could you please help with correct params for skipping failed test in mvn sonar:sonar for multicompoment repo in GitLap?
maven-surfire plugin version is 2.4.2
I tried to add below params, but job completed in all case with error and skipped all other test
-Dmaven.test.failure.ignore=true (or -DtestFailureIgnore=true) - will ignore any failures occurred during test execution
-Dmaven.test.error.ignore=true ( deprecated ) - will ignore any errors occurred during test execution
error below
[INFO] app1 SUCCESS [10:22 min]
[INFO] app2 SUCCESS [ 0.003 s]
[INFO] app3 FAILURE [ 32.564 s]
[INFO] app4 SKIPPED
[INFO] app5 SKIPPED
[INFO]
[INFO] BUILD FAILURE
TINFOT
TINFO] Total time: 44:26 min
TINFO1 Finished at: 2022-03-22T13:19:222
TINFOT
[ERROR] Failed to execute goal org.apache. maven.plugins: maven-compiler-plugin:3.6.0:compile (default-compile) on project app3: Compilation failure
[ERROR]/builds/app3.java:[99,105]error:LoggerConfigisabstract;cannot be
instantiated
Related
I'm using JHipster 7.6.0 (Spring boot + React), when I run integration tests I got the following error. I searched on the internet but I have found nothing
Thanks in advance!
[ERROR] MailServiceIT.testSendEmailFromTemplate:143
expected: "test title"
but was: "Activation de votre compte gestionUtilisateurs"
[INFO]
[ERROR] Tests run: 225, Failures: 1, Errors: 0, Skipped: 0
[INFO]
[INFO]
[INFO] --- jacoco-maven-plugin:0.8.7:report-integration (post-integration-tests) # gestion-utilisateurs ---
[INFO] Loading execution data file C:\Users\ASUS\.jenkins\workspace\apisation portnet\target\jacoco-it.exec
[INFO] Analyzed bundle 'Gestion Utilisateurs' with 83 classes
[INFO]
[INFO] --- maven-checkstyle-plugin:3.1.2:check (default) # gestion-utilisateurs ---
[INFO] You have 0 Checkstyle violations.
[INFO]
[INFO] --- maven-failsafe-plugin:3.0.0-M5:verify (verify) # gestion-utilisateurs ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 03:20 min
[INFO] Finished at: 2022-02-21T14:36:42+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-failsafe-plugin:3.0.0-M5:verify (verify) on project gestion-utilisateurs: There are test failures.
[ERROR]
This failure happens if you choose French as a native language of the application. I reported this on JHipster GitHub repository. Also I mentioned how did I solve it so that the integration test won't fail.
here is the details of the failure:
https://github.com/jhipster/generator-jhipster/issues/17946
You can find my solution for the problem in Suggest a Fix
section in the link above
UPDATE
this issue is fixed since JHipster versoin 7.9.0
I'm trying to install Giraph 1.1 but ran into an issue. According to this thread I should apply a patch to my installation. Unfortunately, my problem stems from that. I downloaded and copied the .patch file linked in there to the source folder and added the following to the pom.xml:
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-patch-plugin</artifactId>
<version>1.2</version>
<configuration>
<patches>
<patch>GIRAPH-1110.02.patch</patch>
</patches>
...
</plugins>
Unfortunately when I run Maven with:
sudo mvn -Phadoop_yarn -Dhadoop.version=2.8.1 clean package -DskipTests
it still fails with the same error as it did before:
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /usr/local/giraph/giraph-core/target/munged/main/org/apache/giraph/job/GiraphJob.java:[213,11] setPingInterval(org.apache.hadoop.conf.Configuration,int) is not public in org.apache.hadoop.ipc.Client; cannot be accessed from outside package
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Apache Giraph Parent ............................... SUCCESS [ 6.298 s]
[INFO] Apache Giraph Core ................................. FAILURE [ 9.359 s]
[INFO] Apache Giraph Examples ............................. SKIPPED
[INFO] Apache Giraph Distribution ......................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 16.062 s
[INFO] Finished at: 2018-02-06T22:53:00+02:00
[INFO] Final Memory: 51M/640M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.0:compile (default-compile) on project giraph-core: Compilation failure
[ERROR] /usr/local/giraph/giraph-core/target/munged/main/org/apache/giraph/job/GiraphJob.java:[213,11] setPingInterval(org.apache.hadoop.conf.Configuration,int) is not public in org.apache.hadoop.ipc.Client; cannot be accessed from outside package
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
which clearly shows that the issue has not been patched. When I check the file manually, I can confirm that there's no change. If I change the file manually before compilation, the changes get discarded (I'm guessing the file gets redownloaded). Also can't run the installation with offline flag since it depends on downloading some dependencies. I'm at my wits end here.
My Maven version is 3.3.9.
I am trying to build Apache Tez (Both 0.6.1 and 0.7.0 version) for hadoop-2.6.0 in windows using below command
mvn clean package -Dhadoop.version=2.6.0 -DskipTests -Dmaven.javadoc.skip
But i am getting below exception
[INFO]
[INFO] --- exec-maven-plugin:1.3.2:exec (Bower install) # tez-ui ---bower FileSaver.js#24b303f49213b905ec9062b708f7cd43d56a5dde ENOGIT git is not installed or not in the PATH
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] tez ................................................ SUCCESS [ 0.924 s]
[INFO] tez-api ............................................ SUCCESS [ 11.585 s]
[INFO] tez-common ......................................... SUCCESS [ 1.421 s]
[INFO] tez-runtime-internals .............................. SUCCESS [ 2.029 s]
[INFO] tez-runtime-library ................................ SUCCESS [ 4.751 s]
[INFO] tez-mapreduce ...................................... SUCCESS [ 2.553 s]
[INFO] tez-examples ....................................... SUCCESS [ 0.862 s]
[INFO] tez-dag ............................................ SUCCESS [ 8.363 s]
[INFO] tez-tests .......................................... SUCCESS [ 2.044 s]
[INFO] tez-ui ............................................. FAILURE [ 3.105 s]
[INFO] tez-plugins ........................................ SKIPPED
[INFO] tez-yarn-timeline-history .......................... SKIPPED
[INFO] tez-yarn-timeline-history-with-acls ................ SKIPPED
[INFO] tez-mbeans-resource-calculator ..................... SKIPPED
[INFO] tez-tools .......................................... SKIPPED
[INFO] tez-dist ........................................... SKIPPED
[INFO] Tez ................................................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 38.169 s
[INFO] Finished at: 2015-07-13T15:07:23+05:30
[INFO] Final Memory: 76M/1049M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.3.2:exec (Bower install) on project tez-ui: Command execution failed. Process exited with an error: 1 (Exit value: 1) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :tez-ui
How to solve this?
Based on the error, it seems like you need git installed:
ENOGIT git is not installed or not in the PATH
Also, this might be helpful for other errors: https://cwiki.apache.org/confluence/display/TEZ/Build+errors+and+solutions
Once look at this... this may help you.
Reason: You are running as root or with superuser permissions.
Solutions:
Recommended: Run without superuser permission, or as a non-root user.
Alternate: If you want to continue as root, add --allow-root to arguments tag of exec-maven-plugin in tez-ui/pom.xml.
Thank you.
Like hadoop_user proposed, I would firstly check this website and try all the fixes but with one remark: in 3rd fix (clearing folder node_tmp) - if you cannot find that folder try clearing the following folder: $TEZ_PATH/tez-X.Y.Z/ tez-ui/src/main/webapp/node_modules/
I tried deleting that folder once I tried everything else and then it worked.
Install git, node & npn. This worked in my case.
Installing git, node and npm worked for me as well.Before building install all the three and try to run the mvn package -DskipTests.This works.
Context: I want to compile and test all modules in a multi-module project but if any fail either compilation or tests I want the overall build to fail.
Default configurations either stop on the first failure or skip modules after a test failure
Running:
mvn clean install
stops at the first failing module.
If you add:
mvn clean install -fae //fail at end
then all modules are run, but if tests fail then any dependent modules are skpped:
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] ------------------------------------------------------------------------
[INFO] Module A ............................................. SUCCESS [15.210s]
[INFO] Module B ............................................. SUCCESS [10.923s]
[INFO] Module C ............................................. FAILED [1.731s]
[INFO] Module D ............................................. SUCCESS [3.791s]
[INFO] Module E ............................................. SUCCESS [1.488s]
[INFO] Module F ............................................. SKIPPED (dependency build failed or was skipped)
[INFO] Module G ............................................. SKIPPED (dependency build failed or was skipped)
[INFO] Module H ............................................. SKIPPED (dependency build failed or was skipped)
[INFO] Module I ............................................. SUCCESS [1.690s]
[INFO] -----------------------------------------
Another option to force all modules to compile is:
mvn clean install -fn //fail never
but this results in the build passing when tests fail
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] ------------------------------------------------------------------------
[INFO] Module A ............................................. SUCCESS [15.210s]
[INFO] Module B ............................................. SUCCESS [10.923s]
[INFO] Module C ............................................. FAILED [1.731s]
[INFO] Module D ............................................. SUCCESS [3.791s]
[INFO] Module E ............................................. SUCCESS [1.488s]
[INFO] Module F ............................................. SUCCESS [9.062s]
[INFO] Module G ............................................. SUCCESS [16.324s]
[INFO] Module H ............................................. SUCCESS [4.032s]
[INFO] Module I ............................................. SUCCESS [1.690s]
[INFO] ------------------------------------------------------------------------
[INFO] Error for project: Module C (during install)
[INFO] ------------------------------------------------------------------------
[INFO] There are test failures.
Please refer to C:\MavenBuildDir\ModuleC\surefire-reports for the
individual test results.
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] + Ignoring failures
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 30 minutes 38 seconds
[INFO] Finished at: Fri May 23 16:42:08 BST 2014
[INFO] Final Memory: 39M/185M
Can anyone advise a set of options to achieve the following:
compile all modules
run tests on all modules
If a module's tests fail but the code compiles dependent modules still get compiled and tested
Responses much appreciated - otherwise we have to run the tests repeatedly on the build server if there are multiple issues - burning a lot of time.
I would suggest to use:
mvn -Dmaven.test.failure.ignore=true --fail-at-end clean install
I would suggest to split it into two mvn calls:
mvn clean compile
mvn -fae install
The first call will fail, if there are compile errors. The second call will reuse the compiled .class-files, since "clean" is omitted. It will fail at the end, if there are test failures. But compilation has already been finished for ALL modules.
Here is a different approach: parse maven output. So either you
pipe it into some grep like command:
mvn clean install -fn | perl -pe 'END { exit $status } $status=1 if /BUILD FAILURE/;'
See https://github.com/backuitist/maven-fae-seriously
configure your CI server to do it:
See https://stackoverflow.com/a/28683700/303737
I am using Gitlab_ci to trigger a maven script when code is pushed.
The script executes:
mvn compile
[...]
[INFO] project ............................................ SUCCESS [1.312s]
[INFO] project-api ........................................ SUCCESS [1.416s]
[INFO] project-api-impl ................................... SUCCESS [0.329s]
[INFO] project-webapp ..................................... SUCCESS [0.192s]
[INFO] project-webapp-exec ................................ SUCCESS [0.026s]
[INFO] project-webapp-it .................................. SUCCESS [2.052s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
mvn tomcat7:deploy
[INFO] project............................................ SUCCESS [1.840s]
[INFO] project-api ........................................ SUCCESS [2.524s]
[INFO] project-api-impl ................................... FAILURE [0.257s]
[INFO] project-webapp ..................................... SKIPPED
[INFO] project-webapp-exec ................................ SKIPPED
[INFO] project-webapp-it .................................. SKIPPED
And I get the following error:
[ERROR] Failed to execute goal on project project-api-impl: Could not resolve dependencies for project eu.project:project-api-impl:jar:0.6-DEVELOPMENT: Failure to find eu.project:project-api:jar:0.6-DEVELOPMENT in http://repo.maven.apache.org/maven2
Since the project builds successfuly (the WAR is created), I can't understand why when executing deploy, build fails.
[Also, I am not sure whether to mark this as homework. The assignment's goal is to create a tomcat web application and manually deploy to a server to test. Since maven / continuous integration wasn't a requisit, I believe this should not be marked as a homework question]