Fresh Vaadin 8.1 app "multimodule" app fails to build - maven

When creating a new Vaadin 8.1.0 app named bogus using the archetype vaadin-archetype-application-multimodule, the build fails in IntelliJ 2017.2 when running Maven Projects panel > bogus-ui > Plugins > jetty > jetty:run
I get these error messages on console.
/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/bin/java -Dmaven.multiModuleProjectDirectory=/Users/basilbourque/IdeaProjects/bogus/bogus-ui "-Dmaven.home=/Applications/IntelliJ IDEA.app/Contents/plugins/maven/lib/maven3" "-Dclassworlds.conf=/Applications/IntelliJ IDEA.app/Contents/plugins/maven/lib/maven3/bin/m2.conf" "-javaagent:/Applications/IntelliJ IDEA.app/Contents/lib/idea_rt.jar=55637:/Applications/IntelliJ IDEA.app/Contents/bin" -Dfile.encoding=UTF-8 -classpath "/Applications/IntelliJ IDEA.app/Contents/plugins/maven/lib/maven3/boot/plexus-classworlds-2.5.2.jar" org.codehaus.classworlds.Launcher -Didea.version=2017.2 org.eclipse.jetty:jetty-maven-plugin:9.3.9.v20160517:run
objc[11304]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/bin/java (0x1060bd4c0) and /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre/lib/libinstrument.dylib (0x10712c4e0). One of the two will be used. Which one is undefined.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building bogus-ui 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> jetty-maven-plugin:9.3.9.v20160517:run (default-cli) > test-compile # bogus-ui >>>
Downloading: http://maven.vaadin.com/vaadin-addons/com/example/bogus-backend/1.0-SNAPSHOT/maven-metadata.xml
Downloading: http://maven.vaadin.com/vaadin-addons/com/example/bogus-backend/1.0-SNAPSHOT/bogus-backend-1.0-SNAPSHOT.pom
[WARNING] The POM for com.example:bogus-backend:jar:1.0-SNAPSHOT is missing, no dependency information available
Downloading: http://maven.vaadin.com/vaadin-addons/com/example/bogus-backend/1.0-SNAPSHOT/bogus-backend-1.0-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.334 s
[INFO] Finished at: 2017-07-30T22:58:18-07:00
[INFO] Final Memory: 11M/309M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project bogus-ui: Could not resolve dependencies for project com.example:bogus-ui:war:1.0-SNAPSHOT: Could not find artifact com.example:bogus-backend:jar:1.0-SNAPSHOT in vaadin-addons (http://maven.vaadin.com/vaadin-addons) -> [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
Process finished with exit code 1
Using Java 8 Update 144 on macOS Sierra 10.12.5 with IntelliJ Ultimate edition 2017.2.
The linked Question, Maven: How to use jetty:run in a multi-module Maven project, without needing to install, is not a duplicate of this Question. That one asks about one module (the Web Module) picking up on changes made in other modules and causing a rebuild rather than retrieving built items from local repository. I am asking how to run the app in the first place, long before needing to trigger re-builds.

Lifecycle > install on root/parent module
Maven needs to find dependencies before running.
You need to run 'mvn install' on root (parent) project or on your backend module (and other project that backend depends on).

you need to run mvn clean install command on the the parent project from root directory>

Related

maven copy-dependencies fails on status 403 forbidden

Project I'm working on uses Vaadin framework (old version 7) and java 8. Project is implemented as multiple projects (modules).
Everything worked fine for a few months until yesterday. I did some changes on 'core' part of the project, ran mvn install and jumped into the main project. There I ran
mvn clean
mvn dependency:copy-dependencies
to get my changes and dependencies copied from core to the main project. Last goal (copy-dependencies) always fails with this error
(note that I covered some information in the error message on purpose):
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------< myproject.main >-------------------------
[INFO] Building Main version
[INFO] --------------------------------[ jar ]---------------------------------
Downloading from mvn-repository jetty: https://mvnrepository.com/artifact/com/vaadin/addon/jpacontainer/3.1.1/jpacontainer-3.1.1.pom
Downloading from mvn-repository jetty: https://mvnrepository.com/artifact/com/vaadin/addon/vaadin-touchkit-agpl/3.0.0/vaadin-touchkit-agpl-3.0.0.pom
Downloading from mvn-repository jetty: https://mvnrepository.com/artifact/org/vaadin/resetbuttonfortextfield/1.2.1/resetbuttonfortextfield-1.2.1.pom
Downloading from mvn-repository jetty: https://mvnrepository.com/artifact/org/vaadin/addon/confirmdialog/2.1.2/confirmdialog-2.1.2.pom
Downloading from mvn-repository jetty: https://mvnrepository.com/artifact/com/vaadin/tapio/googlemaps/0.6.1/googlemaps-0.6.1.pom
Downloading from mvn-repository jetty: https://mvnrepository.com/artifact/org/vaadin/addons/contextmenu/4.5/contextmenu-4.5.pom
Downloading from mvn-repository jetty: https://mvnrepository.com/artifact/org/vaadin/addons/lazyquerycontainer/vaadin-lazyquerycontainer/7.3.3.6/vaadin-lazyquerycontainer-7.3.3.6.pom
Downloading from mvn-repository jetty: https://mvnrepository.com/artifact/org/vaadin/addons/popupbutton/2.6.0/popupbutton-2.6.0.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.383 s
[INFO] Finished at: 2021-08-17T11:37:09+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project main: Could not resolve dependencies for project *myproject.core:version*: Failed to collect dependencies at *myproject.core:version* -> com.vaadin.addon:jpacontainer:jar:3.1.1: Failed to read artifact descriptor for com.vaadin.addon:jpacontainer:jar:3.1.1: Could not transfer artifact com.vaadin.addon:jpacontainer:pom:3.1.1 from/to mvn-repository jetty (https://mvnrepository.com/artifact/): authorization failed for https://mvnrepository.com/artifact/com/vaadin/addon/jpacontainer/3.1.1/jpacontainer-3.1.1.pom, status: 403 Forbidden -> [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
The weird thing is that I don't know about any change in the project or my pc that could cause this issue.
I already tried:
mvn -U dependency:copy-dependencies
running mvn package on before trying to copy dependencies (fails with the same error)
Resetting my Intellij environment
Recompiling every dependent projects
I read the wiki article from the error message but I do not consider it to much use - project work before that without me having to set for example proxy or TLS. Do you have any suggestions on how to solve this problem ?
The problem was indeed in the maven repository link. It seems that the dependencies have changed recently.
In my case the solution was to remove the repository in POM that caused trouble, namely
<repository>
<id>mvn-repository jetty</id>
<url>https://mvnrepository.com/artifact/</url>
</repository>

mvn clean command on my Mac OS throws me error

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?

can not create project for opendaylight With Maven Archetype

I want create project for opendaylight with Maven Archetype and import into eclipse but when type this code for create project
mvn archetype:generate -DarchetypeGroupId=org.OpenDaylight.controller -DarchetypeArtifactId=OpenDaylight-startup-archetype -DarchetypeRepository=https://nexus.OpenDaylight.org/content/repositories/public/ -DarchetypeCatalog=https://nexus.OpenDaylight.org/content/repositories/public/archetype-catalog.xml
this will make the error
Generating project in Interactive mode
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.004 s
[INFO] Finished at: 2018-04-30T19:47:52+04:30
[INFO] Final Memory: 14M/138M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-
plugin:3.0.1:generate (default-cli) on project standalone-pom: archetypeCatalog 'https://
nexus.OpenDaylight.org/content/repositories/public/archetype-catalog.xml' is not
supported anymore. Please read the plugin documentation for details. -> [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
how to can resolved this problem ?or create new project?
EDIT: This option is displayed when you check create simple project
I always prefer to start building the ODL application through Eclipse.
Select "Create Maven Project" and click next which will ask you to fill various details. Fill the details as follows:
Artifacts:
Group ID: org.opendaylight.yourprojectname
Artifact ID: yourprojectname
Version: 1.0.0-SNAPSHOT
packaging: pom
Parent
Group ID: org.opendaylight.odlparent
Artifact ID: bundle-parent
Version: 1.8.1-Carbon (or any other stable version)
wait for eclipse to download all related components.
PS: I am assuming you have your settings.xml file updated. If Not use this settings.xml to update your existing settings.xml accordingly
And now you are good to go.
The official documentation for how to use Maven archetype is here: http://docs.opendaylight.org/en/latest/developer-guide/developing-apps-on-the-opendaylight-controller.html
It was more or less broken in previous releases, and has recently been fixed on the master branch for the future Fluorine release; more details here: https://jira.opendaylight.org/browse/DOCS-60 and

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.

OpenTripPlanner getting started tutorial error

I'm trying to install OpenTripPlanner following the official tutorial.
I've correctly cloned the git repository, then I import the project in Eclipse but it is unable to build all the packages. One of the error is "The import org.geotools cannot be resolved"
So I've tryed with the Maven tutorial but when I run "mvn install integration-test -DskipTests -P interactive" I get:
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID: org.geotools:library:pom:null
Reason: Cannot find parent: org.geotools:modules for project: org.geotools:library:pom:null for project org.geotools:library:pom:null
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7 seconds
[INFO] Finished at: Mon May 20 15:53:31 CEST 2013
[INFO] Final Memory: 44M/473M
[INFO] ------------------------------------------------------------------------
Googling, I've not found anything similar, so, what's the matter?
seems that the geotools.version (and other) properties are not set in the main pom (https://github.com/openplans/OpenTripPlanner/blob/master/pom.xml).
Probably the hudson builder is using variables coming from the settings.xml.
Try defining it manually:
mvn install integration-test -DskipTests -Pinteractive -Dgeotools.version=9.1 -Dspring.version=3.1.1.RELEASE

Resources