I have a Maven Project which has a module 'AddUser'. This module is basically a sam application.
When trying to run the command 'sam build' from the project root path. I am getting the below error:-
in-iftekhar-04eb:UserPlanning iftekhar.khan$ sam build
2019-07-14 16:55:00 Building resource 'AddUserFunction'
2019-07-14 16:55:00 Running JavaMavenWorkflow:CopySource
2019-07-14 16:55:00 Running JavaMavenWorkflow:MavenBuild
Build Failed
Error: JavaMavenWorkflow:MavenBuild - Maven Failed: [INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.054 s
[INFO] Finished at: 2019-07-14T16:55:01+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (/private/var/folders/f8/jgg9tzq97q39c_c2z1sn4blm0000gn/T/tmprn_uvw70). 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 Complete Code can be found here - https://github.com/training-session-101/UserPlanning
Can anyone who has faced similar issue help me in this!
Thanks!
I had this problem. First I ran mvn clean install, then I changed the SAM template so that it didn't point to the jar but to the location of the pom.xml file, like so:
CodeUri: .
and then ran sam build.
Related
Given an archetype cmd -
mvn archetype:generate -DarchetypeGroupId=io.confluent.maven.archetypes -DarchetypeArtifactId=kafka-connect-quickstart \
-DarchetypeVersion=0.10.0.0
When I run this in a new, empty directory, it should create a source code folder structure for me.
Instead, I get the following -
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.113 s
[INFO] Finished at: 2019-04-05T14:37:19+13:00
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (D:\Dev\sandpit\connect-quickstart). 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
It appears to me that it's looking for a pom file, which I won't have, because this is a new project.
Any clues? Any help?
Environment: Windows. java -v == OpenJDK version "11.0.2"
The command
mvn archetype:generate -DarchetypeGroupId=io.confluent.maven.archetypes -DarchetypeArtifactId=kafka-connect-quickstart -DarchetypeVersion=0.10.0.0
runs all right on my computer. If I include the backslash, though, (which is present in your question), I get an error like the one you showed.
mvn archetype:generate -DarchetypeGroupId=io.confluent.maven -DarchetypeArtifactId=kafka-connect-quickstart -DarchetypeVersion=0.10.0.0
you need to delete archetypes from io.confluent.maven.archetypes because there is not any groupId like it. worked on my computer
you can reference here
https://mvnrepository.com/artifact/io.confluent.maven/kafka-connect-quickstart/0.10.0.0
I have a complete angular7 project and want to integrate with java.
is there any way to do it?
I am using eclipse maven + ibm websphere. (not spring boot)
I referred this post(by #TimeTraveler) and tried to follow...
however when I run command mvn clean package, I encounter this error
[INFO] --- frontend-maven-plugin:1.0:npm (npm install) # angular7test ---
[INFO] Running 'npm install' in C:\Users\eclipse-workspace\angular7test\angular-project
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:01 min
[INFO] Finished at: 2018-11-29T23:16:03+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.0:npm (npm install) on project angular7test: Failed to run task: 'npm install' failed. java.io.IOException: Cannot run program "C:\Users\eclipse-workspace\angular7test\node_installation\node\node.exe" (in directory "C:\Users\eclipse-workspace\angular7test\angular-project"): CreateProcess error=267, The directory name is 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/MojoFailureException
and I also have a question .. based on that post, maven project looks like below
Maven Project -
src
main
java
resources
webapp
WEB-INF
web.xml
angular-project (I paste my angular project here)
node_installation ========>what is this?????
pom.xml
what is node_installation? .. is that a folder? do i need to create?
this is my package..
The error you posted indicates that Maven can't find the node.js executable node.exe in order to build your Angular project. Make sure you configure your pom as indicated on the frontend-maven-plugin readme page so that it will install node and npm into your project dir where maven expects to find it. This will create the node_installation directory you are missing and populate it with the node.exe executable, which should resolve the error.
I am trying to create a new Maven project in the terminal, using the following command:
mvn archetype:generate -DgroupId=com.my.domain -DartifactId=myproject -DarchetypeArtifactId=wildfly-javaee7-webapp-archetype -DinteractiveMode=false
So I am trying to use the Wildfly archetype wildfly-javaee7-webapp-archetype.
I am getting the following error...
[INFO] Generating project in Batch mode
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/archetypes/wildfly-javaee7-webapp-archetype/1.0/wildfly-javaee7-webapp-archetype-1.0.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 17.860 s
[INFO] Finished at: 2016-03-31T14:35:27+02:00
[INFO] Final Memory: 16M/188M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.4:generate (default-cli) on project standalone-pom: The desired archetype does not exist (org.apache.maven.archetypes:wildfly-javaee7-webapp-archetype:1.0) -> [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/MojoFailureException
... which means, that Maven is trying to download the archetype at https://repo.maven.apache.org which is not correct, because the archetype is provided by http://mvnrepository.com/artifact/org.wildfly.archetype.
How can I change the source or how can I add additional sources? Or am I missing something different?
You need to define the archetypeGroupId, otherwise, it will default to groupId of Maven default archetypes. Also, you need to define the archetypeVersion.
In this case, you need to have archetypeGroupId=org.wildfly.archetype and archetypeVersion=8.2.0.Final (for example).
Thus, you should have:
mvn archetype:generate -DgroupId=com.my.domain -DartifactId=myproject -DarchetypeGroupId=org.wildfly.archetype -DarchetypeArtifactId=wildfly-javaee7-webapp-archetype -DarchetypeVersion=8.2.0.Final -DinteractiveMode=false
As a side-note, repo.maven.apache.org and mvnrepository.com both are Maven Central and contain the same artifacts.
If anybody else is having problems following the accepted answer try to decrement the version to -DarchetypeVersion=8.1.0.Final
I'm trying to setup a simple java rest service with spring boot and maven and I've downloaded maven and have my pom.xml located in the same folder as src so it's
src & pom.xml -> main -> java -> hello
when I'm inside the hello folder and try to run maven clean package to build my jar file it says command maven not found.
I'm still relatively new to java web dev so making sure everything is configured correctly is difficult for me. I've downloaded maven but do I need to have the actual maven files in my project?
Any help is truly appreciated.
-Adam
UPDATE:
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.124s
[INFO] Finished at: Fri Oct 04 11:47:08 PDT 2013
[INFO] Final Memory: 4M/89M
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (/Users/adam419/Desktop/Programming/Java/dd-servlet/src). 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
Edit:
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /Users/adam419/Desktop/Programming/Java/dd-servlet/src/main/java/hello/GreetingController.java:[3,7] error: class Greeting is public, should be declared in a file named Greeting.java
[ERROR] /Users/adam419/Desktop/Programming/Java/dd- servlet/src/main/java/hello/Greeting.java:[3,7] error: duplicate class: hello.Greeting
[INFO] 2 errors
The pom.xml must be in the "root" folder.
/yourApp:
- pom.xml
- /src
- /main/java
...
- /test/java
...
Although you are making the mistake #Ralph has given in his answer, I don't think this mistake would give the error message you're getting. To me it sounds like you haven't installed maven correctly. The install steps are at the bottom of this page. Make sure you've followed the directions correctly.
The error you've added on says there's no pom at the directory you ran the command from. You need to run the command in the same directory that the "pom.xml" file is in.
when run the command:mvn jetty:run in the web directory,it's the error message:
[WARNING] The POM for com.mycompany:core:jar:1.0-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.015s
[INFO] Finished at: Mon Sep 05 23:31:23 CST 2011
[INFO] Final Memory: 5M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project web: Could not resolve dependencies for project com.mycompany:web:war:1.0-SNAPSHOT: Failure to find com.myco
mpany:core:jar:1.0-SNAPSHOT in http://oss.sonatype.org/content/repositories/appfuse-snapshots was cached in the local repository, resolution will not
be reattempted until the update interval of appfuse-snapshots has elapsed or updates are forced -> [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/DependencyResolutionException
It looks like you have appfuse multi-module web project and you are building the web module without having built/installed the core module.
Quoting the instruction from appfuse quickstart, highlighting relevant portion in bold.
To view your application run mvn jetty:run from your project's
directory (for a modular project, you'll need to run mvn jetty:run
from your project's web directory (after installing the core module)).
You need to run mvn install from the project's root directory also!
In your situation, you definitely need to mvn install from your core directory. If this does not help, then run the same command from root directory. The problem is that one of Your modules needs to be installed and only after that the error you are encountering will be removed.