mvn clean command on my Mac OS throws me error - maven

I am trying to delete documents which are created by doorstop and getting error as "Multiple Root documents" Please refer to below link for more information
https://github.com/doorstop-dev/doorstop/issues/293
Solution for that is to run "mvn clean" command but I am getting below error for "mvn clean" command. Any possible solutions regarding this.
(base) MANOJs-MacBook-Air:~ manojdeshpande$ mvn clean
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.090 s
[INFO] Finished at: 2019-11-21T23:01:40+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (/Users/manojdeshpande). Please verify you invoked Maven from the correct directory. -> [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/MissingProjectException

The error message is pretty clear:
The goal you specified requires a project to execute but there is no
POM in this directory (/Users/manojdeshpande). Please verify you
invoked Maven from the correct directory
The problem is that Maven can't find a pom file (pom.xml is the maven project configuration file) where you are running the maven clean command, so it's impossible for Maven to know what to do, even if you specified the clean goal.
Maybe your pom file is somewhere else than /Users/manojdeshpande?

Related

im trying To deploy my artifact under nexus but get an error :The parameters 'file' are missing or invalid

the full error :
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 25.959 s
[INFO] Finished at: 2022-07-18T10:49:26+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy-file (default-cli) on project projectt: The parameters 'file' for goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy-file are missing or invalid -> [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/PluginParameterException
and this is my commande :
mvn clean package -Dmaven.test.failure.ignore=true deploy:deploy-file -Durl=file://C:\Users\username\.m2\repository -DgroupId=com.projectt.api -DartifactId=projectt -Dversion=1.1 -DgeneratePom=true
-Dpackaging=jar -DrepositoryId=deploymentRepo -Durl=http://localhost:8081/repository/maven-releases/ -Dfile=target/projectt-1.1.jar
*im deploying locally
You're either referring to a missing file target/projectt-1.1.jar or you're missing a backslash at end of the first line.
Tip: you shouldn't need to specify groupId/artifactId/version if the jar file is built with maven (i.e. contains a pom.xml file) and you're not overriding the values in the pom.xml file. Haven't tested this, I'm merely assuming on the working of the maven-install-plugin:install-file task. Give it a try and let me know.

Maven Returning 0 Even on Success in Cygwin

We use Apache maven for building our java code. We use a Windows Desktop, but I'm running it under Cygwin (I use Cygwin as my main command line - and we have some scripting to make life easier which is done in Bash since then they work in our Linux environments too).
Anyway, the mvn command (the Linux shell script variant) seems to always return 0 whether it succeeds or not under Cygwin! The file itself contains code designed to support Cygwin, so I assume it should work.
I spotted it first when it couldn't clean (as the app was running) but easiest way to reproduce is just to run a mvn command in a folder that doesn't contain a .pom file
On Cygwin:
$ mvn clean compile; RC=$?; echo "Exit value: $RC"
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.145 s
[INFO] Finished at: 2021-07-12T13:30:20+03:00
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (C:\cygwin64\home\foo.bar). Please verify you invoked Maven from
the correct directory. -> [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/MissingProjectException
Exit value: 0
If I run the same command on a CentOS machine it works as expected:
[adam#dev-adco-carc ~]$ mvn clean compile; RC=$?; echo "Exit value: $RC"
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.641 s
[INFO] Finished at: 2021-07-06T02:52:18+03:00
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (/home/foo). Please verify you invoked Maven from the correct directory. -> [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/MissingProjectException
Exit value: 1
If I run the mvn.cmd (windows cmd file, not the linux sh file) then the return value works but the output is not good
$ mvn.cmd clean compile; RC=$?; echo "Exit value: $RC"
[←[1;34mINFO←[m] Scanning for projects...
[←[1;34mINFO←[m] ←[1m------------------------------------------------------------------------←[m
[←[1;34mINFO←[m] ←[1;31mBUILD FAILURE←[m
[←[1;34mINFO←[m] ←[1m------------------------------------------------------------------------←[m
[←[1;34mINFO←[m] Total time: 0.156 s
[←[1;34mINFO←[m] Finished at: 2021-07-12T18:20:43+03:00
[←[1;34mINFO←[m] ←[1m------------------------------------------------------------------------←[m
[←[1;31mERROR←[m] The goal you specified requires a project to execute but there is no POM in this directory (C:\cygwin64\home\foo.bar). Please verify you invoked M
aven from the correct directory. -> ←[1m[Help 1]←[m
[←[1;31mERROR←[m]
[←[1;31mERROR←[m] To see the full stack trace of the errors, re-run Maven with the ←[1m-e←[m switch.
[←[1;31mERROR←[m] Re-run Maven using the ←[1m-X←[m switch to enable full debug logging.
[←[1;31mERROR←[m]
[←[1;31mERROR←[m] For more information about the errors and possible solutions, please read the following articles:
[←[1;31mERROR←[m] ←[1m[Help 1]←[m http://cwiki.apache.org/confluence/display/MAVEN/MissingProjectException
Exit value: 1
Using Apache Maven version 3.6.3 on both Windows and Linux
I found this question but it just explains how to test the return code - and in my case the return code is wrong. It refers to a bug fixed in 2.0.9 with the mvn.cmd but it seems Cygwin does something similar to this in 3.6.3.
Is anyone running in Cygwin and testing for success? Am I missing something obvious or have I found a bug?

IzPack - Execute shell script file to launch mvn command

First, I have db_migration.sh with content like this
#!/bin/sh
eval "mvn compile flyway:migrate"
So, simple. Just to ease users from executing this command in the terminal by themselves. Due to 'mvn', Of course, this command need to be executed with pom file, which I already place them together in the same directory.
Second, I have this code segment in install.xml file. To mark as executable file after the installation, fix permission denied issue in Unix system
<executable targetfile="$INSTALL_PATH/Database/orchestra-db/db_migration.sh" os="unix" stage="never" failure="warn" keep="true" />
Then, in the ProcessPanel I have this; To run my db_migration.sh
<job name="do xyz">
<executeForPack name="Orchestra Runtime"/>
<os family="unix" />
<executefile name="$INSTALL_PATH/Database/orchestra-db/db_migration.sh">
<arg>doit</arg>
</executefile>
</job>
However, when I test my installer, I got this error message in the ProcessPanel
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.300 s
[INFO] Finished at: 2018-07-19T15:51:52+02:00
[INFO] Final Memory: 5M/121M
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (/home/tanyagorn/Documents/OrchestraInstaller/installer/target). Please verify you invoked Maven from the correct directory. -> [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/MissingProjectException
Seem like IzPack is looking for pom file and try to execute .sh file in 'target' directory. But, I need this script to be executed at the user's install path. Can anyone tell me what did I do wrong?
Thank you in advance.
The continued discussion and right place to discuss IzPack issues is the user forum:
https://groups.google.com/d/msg/izpack-user/eN8wdvE-UIc/Verjnuh0BAAJ

Build failure when running “mvn clean” for the first time while installing

I'm new to Maven and trying to use this for the first time in my project.
I've set the system variables;
JAVA_HOME System Variable
M2_HOME System Variable
%JAVA_HOME%\bin;%M2_HOME%\bin; to System Path
In cmd prompt using "mvn -version" i can see all relevant details.
But when I run "mvn clean”, I get the following error
C:\Users\Naina Mantry>mvn clean
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.105 s
[INFO] Finished at: 2016-02-15T08:00:48+05:30
[INFO] Final Memory: 5M/86M
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (C:\Users\Naina
Mantry). Please verify you invoked Maven from the correct directory. -> [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/MissingProjectException
I'm not able to understand, how to fix it. kindly help me please...
Thanks in advance :)
when you run Maven, you need to run it from your proyect directory, where you have your workspace. You need to have a pom.xml file on that Directory.
For example:
C:\Users\Naina Mantry\workspace\proyect
and on that directory you run mvn clean
You seem to be executing mvn clean from a wrong directory. Make sure there is a relevant pom.xml. Maven by default refers to the current working directory. Alternately, you can use -f option to specify a pom.xml located in a different directory.

Maven gives “Resolving Version for Plugin” Error when trying to create a project

I am a newbie to both Linux and Maven. I am trying to get maven working so I can install Mahout. I am having more than just one problem with the process but I will focus on the most basic one:
I am trying to follow this guide
to learn how to get started with maven. when I run the following command in the terminal
mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
I get the following error:
dave#CodeKingdom:~/workspace/maven_test$ mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
[INFO] Scanning for projects...
[WARNING] The metadata /home/dave/.m2/repository/org/apache/maven/plugins/maven-archetype-plugin/maven-metadata-central.xml is invalid: end tag name </HEAD> must be the same as start tag <META> from line 1 (position: START_TAG seen ...e/maven/plugins/maven-archetype-plugin/maven-metadata.xml"></HEAD>... #1:385)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.446s
[INFO] Finished at: Thu Apr 10 17:43:57 PDT 2014
[INFO] Final Memory: 8M/310M
[INFO] ------------------------------------------------------------------------
[ERROR] Error resolving version for plugin 'org.apache.maven.plugins:maven-archetype-plugin' from the repositories [local (/home/dave/.m2/repository), central (http://repo.maven.apache.org/maven2)]: Plugin not found in any plugin repository -> [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/PluginVersionResolutionException
I can't make much sense of the resources out there. What I gather based on my googling is that maven is unable to connect to internet to download the necessary artifacts. But I am not sure whether I should modify setting.xml or pom.xml to fix this or whether I should do something completely different. Plus I can't seem to find a pom.xml file in my maven folder. There is a settings.xml file but I am not clear on how or if I should modify it.
Any help is appreciated.

Resources