Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Maven project import(Unable to successfully import Maven project)
icon9.gif  Maven project import [message #1749416] Tue, 06 December 2016 14:06 Go to next message
Sam Bh is currently offline Sam BhFriend
Messages: 5
Registered: December 2016
Junior Member
I have simple maven project consisting of a single java file and a pom.xml - I have them in a folder. Using Mars 4.5/Jdk8.
I do a File -> Import -> Existing Maven Project- point to my folder. Eclipse does its thing and creates a project with some default (complex) project file structure (I am unable to edit it Confused ).
I see my java file in the file structure (but not in the /src of eclipse). after much doing (open/new (etc etc) ) I am able to 'somehow' compile my java class.
But I cant run it Embarrassed
If I try run as Maven project - it gives error:
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1]
MAVEN/NoGoalSpecifiedException
What is this? Crying or Very Sad

If I try run as Java :
Error: Could not find or load main class Mad
I of course do have main method in my class

I thought this would be easy Surprised
Re: Maven project import [message #1749456 is a reply to message #1749416] Wed, 07 December 2016 00:25 Go to previous messageGo to next message
Sam Bh is currently offline Sam BhFriend
Messages: 5
Registered: December 2016
Junior Member
This problem was finally solved by conforming (submitting) Smile to the default file structure of the eclipse/maven project. I re-created the file structure (as original/default) put/copied my .java and .classes in those directories - it ran fine finally.

I could see this problem when I opened the .classpath file - it had the original /classes and /src directory and not he one I had edited in eclipse (as I indicated in my Question). Even though I was actually successfully compiling into my /classes.
I would certainly not expect this behavior, there is clear edit option for /src and /classes and it should take effect- but maybe not. Confused

So long story short it finally worked after much frustration and effort and loss of a couple of days Mad (And I just had exactly one java file to compile and run - wondering how much pain would be if I had a few more).
Re: Maven project import [message #1749537 is a reply to message #1749456] Wed, 07 December 2016 21:18 Go to previous message
Eric Rizzo is currently offline Eric RizzoFriend
Messages: 3071
Registered: July 2009
Senior Member
It's hard to imagine what was going on without seeing the exact file structure you were trying to import, and the contents of your pom.
Previous Topic:Eclipse client configuration to use Jfrog Artifactory
Next Topic:How do I implement Run->Run
Goto Forum:
  


Current Time: Wed Oct 21 11:22:14 GMT 2020

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

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

Back to the top