Differences in Maven builds between local (Windows / IntelliJ) and remote (Linux)? - java

I'm seeing something odd where I'm doing a Maven build that is implementing the swagger doclet for our API documentation (https://github.com/ryankennedy/swagger-jaxrs-doclet). When I do the build as reccommended there on the github page it builds fine locally on my Windows machine. The strangeness occurs when I try to do the exact same build on my Lunix vm and I get an error about unparsable POM files. A big difference I'm noticing is on the local machine there's a jar being pulled in that doesn't exist on the linux box: jaxrs-doclet-parent. This I'm assuming has something to do with the unparseable pom file error on the vm. Does anyone have an idea why a build would execute successfully on Windows (built via IntelliJ) but not on Linux?
Maven version is 3.0.3 on linux box and version is 3.2.1 on local windows machine
Here's the build error I am referring to:
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 37.339s
[INFO] Finished at: Thu Jul 24 12:38:36 EDT 2014
[INFO] Final Memory: 32M/76M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.9.1:javadoc (generate-service-docs) on project scapi-ws: An error has occurred in JavaDocs report generation: Unable to build the Maven project for the artifact:groupId = 'com.hypnoticocelot'
[ERROR] artifactId = 'jaxrs-doclet'
[ERROR] version = '0.0.4-SNAPSHOT': 1 problem was encountered while building the effective model
[ERROR] [FATAL] Non-parseable POM /home/gwalker/.m2/repository/com/hypnoticocelot/jaxrs-doclet/0.0.4-SNAPSHOT/jaxrs-doclet-0.0.4-SNAPSHOT.pom: end tag name </body> must match start tag name <hr> from line 5 (position: TEXT seen ...</center>\r\n</body>... #6:8) # line 6, column 8

Turns out it was the maven version. On the linux box it was 3.0.3 and needed to be upgraded. Once I upgraded to 3.2.1 it built ok.

Related

SeekTool - what can that be?

When doing a mvn test on a Java project on Win10 I get 2 failure notes:
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[ERROR] SeekTools: Seek for the Project Tool Folder (give option '-h' for help)
[ERROR] ERROR: reached root of filesystem
... test runs smoothly, but Surefire reports:
[INFO] Results:
[INFO]
[INFO] Tests run: 5, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[ERROR] There are test failures.
I am using Maven 3.6.3 and Java 11.0.10 on Win10.
When doing the same to the same project on Debian-10, I get no such errors. Here I am using Maven 3.6.0 and Java 11.0.9.
I doubt that the small version difference causes the failures. But I got no clue how to start to solve them. Google did not help.
I am applying the plugins
maven-compiler-plugin 3.8.1
maven-surefire-plugin 3.0.0-M5
Do you got any hint for me how to approach this problem?
The complete output is here.
The pom.xml is here
#ngong
<forkCount>0</forkCount> and <forkMode>never</forkMode> is not a fix.
You are using JDK11. I guess you do not use JPMS.
We have a bug in Surefire and you can workaround it by <useModulePath>false</useModulePath>.
Setting forkCount to zero or forkMode to never is inherently wrong idea in this case because any changes in the environment may affect your tests on any machine.
Please see https://stackoverflow.com/a/65806777/2758738

Maven install fails with my IntelliJ setting

I'm using this basic maven command :
mvn install
It stops, with the following error :
[WARNING] File /home/vagrant/MyProject/application/declic2Parent/.idea/encodings.xml contains prohibited string.
[...]
[INFO]------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO]------------------------------------------------------------------------
[INFO] Total time: 5.575s
[INFO] Finished at: Fri Jun 29 17:09:42 CEST 2018
[INFO] Final Memory: 24M/737M
[INFO]------------------------------------------------------------------------
[ERROR] Failed to execute goal com.rte.maven.plugin:encoding-maven-plugin:1.0.0.1:descriptor (executionEncoding) on project declic2Parent: We detect encoding errors on various files - see log! -> [Help 1]
What settings do I have to add in my pom.xml to tell him to stop looking in the IntelliJ directory ?
If I delete the file automatically created by IntelliJ the maven install succeeds.
It's never a good idea to play with auto-generated files.
If you use characters like ñ, é, etc you may get this errors.
It may get fixed if you add a encoding.
Like this:
<configuration>
<encoding>UTF-8</encoding>
</configuration>

Error while running maven project via Jenkins

I'm getting the following error while trying to build my maven project in Jenkins.
[ERROR] Failed to execute goal com.oracle.adf.plugin:ojmake:12.2.1-0-0:compile (default) on project TestApp: Execution default of goal com.oracle.adf.plugin:ojmake:12.2.1-0-0:compile failed: Unable to load the mojo 'compile' in the plugin 'com.oracle.adf.plugin:ojmake:12.2.1-0-0' due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLookupException: oracle/jdeveloper/deploy/maven/OjmakeMojo : Unsupported major.minor version 52.0
[ERROR] -----------------------------------------------------
[JENKINS] Archiving C:\test\pom.xml to com.test/test/3.7.2/TestApp-3.7.2.pom
[ERROR] realm = plugin>com.oracle.adf.plugin:ojmake:12.2.1-0-0
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/maven-repository/com/oracle/adf/plugin/ojmake/12.2.1-0-0/ojmake-12.2.1-0-0.jar
[ERROR] urls[1] = file:/C:/maven-repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------
Jenkins version : 2.19.2
Maven version : 3.3.9
jdk version : 1.7.0_79
I'm using maven compiler plugin in my pom.xml file, the target and source set is 1.7. I'm working in Windows Environment. Ensured that the PATH variable is set as required. However, still the Jenkins job fails.
How to overcome this error?
The version number shown describes the version of the JRE the class file is compatible with.
Java SE 8 = 52
Might be you have a dependency that need java 1.8
Refernce - https://maven.apache.org/plugins/maven-compiler-plugin/examples/compile-using-different-jdk.html
This seems to be a java mismatch.
Configure you're Jenkins Jobs to use JDK 8.
It can be done under "Manage Jenkins" option or you can make it specific to job under "configure" option inside the jobs.
The issue is resolved by replacing the ojmake.exe with ojmake file in all the pom.xml files in the source code.
JDeveloper provides multiple types of ojmake files, check the type of file with Linux command 'file' and check if it is Linux executable.

Maven: Failed to parse plugin descriptor for org.codehaus.mojo:exec-maven-plugin:1.1.1

I have configured maven 3.2.2 and JBoss EAP 6.1 in centos 6.1;I have installed these things in a remote vm machine and accessing them using PuTTY
I have tried to run a quick start program helloworld-jms program using the command
`mvn clean compile exec:java`
it is giving the error saying
`[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:43 min
[INFO] Finished at: 2014-07-22T03:32:32+05:30
[INFO] Final Memory: 7M/171M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to parse plugin descriptor for org.codehaus.mojo:exec-maven-plugin:1.1.1 (/root/.m2/repository/org/codehaus/mojo/exec-maven-plugin/1.1.1/exec-maven-plugin-1.1.1.jar): error in opening zip file`
i thought problem is with the proxy settings and i went to /root/.m2/settings.xml and changed the proxy settings also still this problem is remaining
I have also removed the repository under .m2 folder and clean installed maven using the command
`mvn -U clean install`
it gave me a message build successful; and new repository appeared
again I tried to run the program with the command mvn clean compile exec:java
I couldn't locate the error
Please help me what could be the error and how to solve it; I have checked earlier posts and tried the best I could

Maven Error No POM in this Project when performing archetype:generate

I am trying my hands on the Akka Pi java tutorials
I am trying to creaate a maven project as stated in the tutorial
but any time I enter the command to create a maven project I get an error.
Below are the command and the Error.
C:\Program Files\akka-2.0.2>mvn archetype:generate \
C:\Program Files\akka-2.0.2>mvn archetype:generate \
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.206s
[INFO] Finished at: Wed Sep 26 02:50:38 BST 2012
[INFO] Final Memory: 11M/245M
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM
in this directory (C:\Program Files\akka-2.0.2). Please verify you invoked Mave
n from the correct directory. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[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 rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MissingProject
Exception
looks like maven is requesting for the POM file but it is not stated in the tutrials that I have to create a POM before generating the project.
I am actually new too maven so pardon me.
I am using maven version :3.0.4
and akka version 2.0.2
but the tutorial uses akka version 2.0.1 but i donn't think that is the problem
any suggestion please.
thank you
remove the \ then it should start to query for more informations.
I have no windows here, but on linux it shows the same behavior with
mvn archetype:generate /
HTH R
When some tutorials describes a mvn command to be executed that is covered in two rows or more, they might add an extra backslash at the new line (of the instruction) to indicate that the same command continues on next line.
This backslash should be removed BEFORE executing the command. For instance the command for setting up a Jersey Web Application might look like this:
mvn archetype:generate -DarchetypeGroupId=org.glassfish.jersey.archetypes \
-DarchetypeArtifactId=jersey-quickstart-webapp -DarchetypeVersion=2.2
but should be launched as below, without backslash:
mvn archetype:generate -DarchetypeGroupId=org.glassfish.jersey.archetypes -DarchetypeArtifactId=jersey-quickstart-webapp -DarchetypeVersion=2.2
If NOT removing this extra backslash you might get the error you described above.

Categories