Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Importing Maven projects is not adding Maven dependencies
Importing Maven projects is not adding Maven dependencies [message #1793733] Tue, 14 August 2018 20:51 Go to next message
David M. Karr is currently offline David M. KarrFriend
Messages: 801
Registered: July 2009
Senior Member
When I was using Oxygen, I often imported Maven projects, usually from the git repository menu, but also from the "Import Existing Maven Projects" option. This worked well enough.

In Photon, I'm finding that both paths are resulting in a broken project. It seems to configure it as a Maven project, but it omits the "Maven Dependencies" library, resulting in many compile errors. I don't even see any way to manually add that. If I can't fix this with a simple workaround, this will be fatal. I'll have to go back to Oxygen until this is fixed.
Re: Importing Maven projects is not adding Maven dependencies [message #1793734 is a reply to message #1793733] Tue, 14 August 2018 21:05 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1853
Registered: July 2009
Senior Member
If this is reproducible in a fresh installation and a fresh workspace, then please consider filing a bug against m2e (not JDT).
For a workaround please try this: in the Java Build Path dialog, page "Libraries" click "Add Library..." - does it offer "Maven Dependencies"?
Re: Importing Maven projects is not adding Maven dependencies [message #1793746 is a reply to message #1793734] Wed, 15 August 2018 05:05 Go to previous messageGo to next message
David M. Karr is currently offline David M. KarrFriend
Messages: 801
Registered: July 2009
Senior Member
It offers "Maven Managed Dependencies", and when you select it, it brings you to a dialog that says "Use Maven Project Settings to configure Maven dependency resolution".
Re: Importing Maven projects is not adding Maven dependencies [message #1793833 is a reply to message #1793746] Thu, 16 August 2018 16:47 Go to previous messageGo to next message
David M. Karr is currently offline David M. KarrFriend
Messages: 801
Registered: July 2009
Senior Member
I have a feeling this has something to do with Groovy. Note that there was another issue with the imported project as imported, in that it didn't even think it was a Java project. I couldn't see any way to resolve that, except for making it faceted. Once I did that, it made it a Java project, but it still didn't have Maven dependencies.

I have this in the project pom:
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.6.1</version>
				<configuration>
					<compilerId>groovy-eclipse-compiler</compilerId>
				</configuration>
				<dependencies>
					<dependency>
						<groupId>org.codehaus.groovy</groupId>
						<artifactId>groovy-eclipse-compiler</artifactId>
						<version>RELEASE</version>
					</dependency>
					<dependency>
						<groupId>org.codehaus.groovy</groupId>
						<artifactId>groovy-eclipse-batch</artifactId>
						<version>RELEASE</version>
					</dependency>
				</dependencies>
				<executions>
					<execution>
						<phase>compile</phase>
					</execution>
				</executions>
			</plugin>
		</plugins>


I tried picking another existing local maven project that I had that wasn't yet imported. This is a plain Java project, where the "maven-compiler-plugin" did not specify the use of the Groovy compiler. The import of this project didn't show the same problems that the other one did. I also tried importing the problematic project in Oxygen, and it didn't do this.
Re: Importing Maven projects is not adding Maven dependencies [message #1793879 is a reply to message #1793833] Fri, 17 August 2018 20:41 Go to previous message
David M. Karr is currently offline David M. KarrFriend
Messages: 801
Registered: July 2009
Senior Member
Well, I'm not sure what the problem was, and for the moment I'm unable to repeat this again. I started removing and simplifying things in the project that was having the problem. One thing I noticed was that it didn't have a groupId value. At some point after I fixed that, it started importing correctly. I then deleted the project and made sure I deleted the .project and .settings, but now it's not displaying this symptom anymore. I'm guessing this is due to something that is being cached, but I'm not sure what it would be.
Previous Topic:Problem with eclipse upgrade
Next Topic:Jar Files In Referenced Libraries Of A Project Across Computers
Goto Forum:
  


Current Time: Tue Apr 16 08:56:44 GMT 2024

Powered by FUDForum. Page generated in 0.62127 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top