Maven install fails with my IntelliJ setting - java

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>

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

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

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.

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: unmappable character for encoding Cp1251

Can't compile your project in NetBeans, here is the error:
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 4.094s
Finished at: Sat Nov 17 00:23:08 MSK 2012
Final Memory: 8M/247M
------------------------------------------------------------------------
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project AdminCmd: Compilation failure
C:\Users\Максим\Documents\NetBeansProjects\AdminCmd\src\main\java\be\Balor\Tools\Help\String\ACMinecraftFontWidthCalculator.java:[30,33] error: unmappable character for encoding Cp1251
-> [Help 1]
To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.
For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
here's the file maven on that swears
http://pastebin.com/buQEE4Fb
Project to Git - https://github.com/Belphemur/AdminCmd
If someone could put a working draft of NetBeans or Eclipse!
This is interesting, as your pom.xml mentions
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
.. but the error message complains about Cp1251 encoding. Does the maven output mention anything else related to source encodings?
My recommendation is generally to not use any high-ASCII characters in your code, and use the \uxxxx notation instead as needed.
You can make the conversion from UTF-8 to escaped unicode at online conversion sites like http://www.endmemo.com/convert/EMUnicode.php (this particular one seems to strip leading zeroes, I don't think that's legal in Java)
In my case I resolved that problem by setting new environment variable:
JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8
In the command line executing maven, run current command before executing maven command:
SET JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8
You have characters in that file which are likely not mapped in the Windows codepage (which is the reference to Cp1251). Try changing the project encoding to UTF-8 or similar. Look into different encoding schemes.

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