I'm trying to import and resolve the developer projects for the NatTable project as explained in their Getting Started tutorial.
I'm getting the following error on mvn -f [path to pom] clean install:
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.maven.execution.MavenSession.getRepositorySession()Lorg/sonatype/aether/RepositorySystemSession;
More details:
mvn --version works fine
%MAVEN_HOME% points to [devel]/maven-3.1.0
The NatTable project seems to have configured the Tycho build extension in a version which is not compatible with Maven 3.1.
Either ask the project to switch to a Tycho version which works with Maven 3.1 (0.18.1 or later), or downgrade your local Maven installation to 3.0.5.
The NatTable project recently updated to use Maven Tycho 0.19.0.
Thanks for the hint.
Related
I'm evaluating Citrus framework and I have problems with the setup. Following the documentation, I ran mvn archetype:generate -Dfilter=com.consol.citrus.mvn:citrus, selected option "Citrus quickstart project" and defined values for groupId and the others. Then I ran mvn clean verify and it failed with java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException. It seems that not all dependencies are included in the archetype, or that I need to choose another archetype. What is the recommended way to add the JAX-B APIs in my case? Should I use another archetype maybe?
OS: Windows 10 Enterprise amd64; JDK: RedHat OpenJDK 11; IDE: VS Code 1.50.1; Maven: 3.6.3; Citrus version: 2.7.3
Fixed my Citrus framework setup on Java 11 by adding the JAXB Maven dependencies javax.xml.bind:jaxb-api and org.glassfish.jaxb:jaxb-runtime. Plus, I have upgraded maven-failsafe-plugin to version 2.22.2. Now, I can run mvn clean verify without errors and get build success.
See also Java: How to resolve java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException and https://maven.apache.org/surefire/maven-failsafe-plugin/java9.html
I have an instruction manual with just the following picture.
I figured it required the following plugin after searching which is a maven plugin. I have already installed maven
http://maven.apache.org/plugins/maven-ear-plugin/
SO i think I will get the above EAR/WAT settings in my Eclipse->pfreferences after i install this maven plugin. But how do i install a plugin for maven? The above website does not say how to install that plugin. Most searches are leading me to maven eclipse plugin installation instead of this particular installation.
I am installing it for the first time and have not worked with maven before.
I'm new to Grails development and would like to set up a new project, so I can use Eclipse as IDE and build it on my CI (Jenkins) with Maven. This is my environment:
Java 1.6.0
Grails 2.1.0
Maven 2.2.1
Eclipse Juno with the m2e and egit plugins
I used the following commands from
http://grails.org/doc/latest/guide/commandLine.html#antAndMaven:
mvn archetype:generate -DarchetypeGroupId=org.grails \
-DarchetypeArtifactId=grails-maven-archetype -DarchetypeVersion=2.1.0 \
-DgroupId=com.company.dep -DartifactId=project
mvn initialize
But after importing it as a maven project in Eclipse, there were erros about slf4j and com.sun.tools not found and lifecycle phases not mapped.
What steps are necessary to get this running in Eclipse?
Plugins, Plugins, Plugins... you can add the maven plugin / Grails plugin for eclipse and just build a new project.
Select the option to create a maven project (it will auto generate the pom files for you) then you can add Grails to it...
Similarly you can start a new grails project and then add maven to it. It will download all the dependencies automatically.
Most plugins are free to download from : http://marketplace.eclipse.org
com.sun.tools error is commonly caused when Eclipse uses a JRE and not JDK.
Grails has its own mechanism for creating projects, use it. Since Grails 2.1 you can generate the maven stuff afterwards.
You can follow this proces:
Get STS - Springsrouce Tool Suite (actual 3.0), based on Eclipse
Install the Grails plugin into STS.
Get the Grails FW, unpack it and configure the path to it in STS.
Create new project via Grails command: grails create-app
Import it into Git.
About maven integration, there is a good article:
http://www.znetdevelopment.com/blogs/2012/07/11/grails-2-1-and-maven-integration-simple-project/
I was trying to build eclipse plug-in using Tycho and while executing following command
mvn org.codehaus.tycho:maven-tycho-plugin:generate-poms -DgroupId=tycho.demo -Dtycho.targetPlatform=D:\practice\java\eclipse_galilio
I got error like
java.lang.NoSuchMethodError: org.codehaus.plexus.PlexusContainer.lookup(Ljava/lang/Class;)Ljava/lang/Object;
can anyone tell me what should be done to resolve this error. I am stuck at this point and not able to proceed.
What version of maven are you running? Tycho requires Maven 3. I can get that error trying to run on maven 2.1.0.
I've just set up a brand new installation of Eclipse Helios and have configured M2Eclipse to use an external (v 2.2.1) installation of Maven.
The system compiles fine on the command line, but from within M2Eclipse several of my project modules have an error:
Missing artifact javax.jms:jms:jar:1.1:test
I can get past the error by excluding the jms artifact from the Atomikos dependencies. But my main question is how can the two provide different results!
Even more odd is that I have another installation of Eclipse Helios and everything works fine.
The dependency resolver in m2eclipse is not using the external Maven installation, it has to use the embedded Maven version. So, I'd recommend to get the latest version of m2eclipse, as well as Maven 3.x version to minimize the difference in dependency resolution.
Additionally, it is possible that you had some alternative repositories defined in your maven 2.2.1 conf/settings.xml file. If you use the embedded maven3 these will be ignored.
You also can specify your maven 2.2.1 installation as the maven installation for m2eclipse.
I posted a similar question and finally found an answer. See m2eclipse says "Missing artifact" but I can build from cmdline!
You can find a different solution at http://getsatisfaction.com/sonatype/topics/_missing_artifact_from_m2eclipse_but_it_is_not_true
Same problem here: I use maven 2.2.1 as the installation to use from eclipse, as it is the one which works on the command line. Maven 3 does not work for this concrete project, complaining about some missing dependencies which, after much research, in my case turned out to come from old maven 1 repositories with legacy layout. Maven 3 hates these and will burst burst into cry when it finds them.
So maven 2 works just fine on the command line, but maven 3 does not. The problem with eclipse is that even if you specify maven 2 as the installation to build your projects, it uses maven 3 (the embedded installation) for dependency resolution, so if you are so unlucky to require a legacy repository you are screwed (I mean, eclipse won't help).