It is currently 08 Sep 2025, 16:23
   
Text Size

Eclipse and Maven

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins

Eclipse and Maven

Postby friarsol » 23 Jul 2011, 14:04

Since we got the git depot up and running I had been using Eclipse just as I used to. Letting the dependencies try to be handled by Eclipse.

Today I was attempting to run Forge via Maven and was having some issues. It seems like maven build test works just fine, but any other build was having issues.

I ended up needing to follow the directions in the checkmarked answer here: http://stackoverflow.com/questions/2222 ... dk-problem

So this allows me to run maven build install. But when I try to run just a normal maven build, I get an error about not having any goals. My goal is to run forge in debug mode as I used to, and I would guess the option I'm choosing, but it doesn't seem to work the way I expect.

mavenerror | Open
[ERROR] No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-site, site, post-site, site-deploy, pre-clean, clean, post-clean. -> [Help 1]


It gives me this very unhelpful message and when I open up the properties of maven build and try to select a goal none are available to me. Any help would be appreciated?

Edit: It's possible I'm misunderstanding how maven is used within Eclipse, perhaps the dependency portion it takes care of, but I still run NewGame the same as I used to?
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Eclipse and Maven

Postby Braids » 23 Jul 2011, 17:08

friarsol wrote:. . . Edit: It's possible I'm misunderstanding how maven is used within Eclipse, perhaps the dependency portion it takes care of, but I still run NewGame the same as I used to?
if your Problems view reports no errors, it should work. please report back if it does not.
"That is the dumbest thing I've ever seen." --Rob Cashwalker, regarding Innistrad double-sided cards. One of the first times he and I have ever agreed on something. ;)
User avatar
Braids
Programmer
 
Posts: 556
Joined: 22 Jun 2011, 00:39
Location: Unknown. Hobby: Driving myself and others to constructive madness.
Has thanked: 1 time
Been thanked: 1 time

Re: Eclipse and Maven

Postby jendave » 24 Jul 2011, 08:02

friarsol wrote:
So this allows me to run maven build install. But when I try to run just a normal maven build, I get an error about not having any goals. My goal is to run forge in debug mode as I used to, and I would guess the option I'm choosing, but it doesn't seem to work the way I expect.
Maven has no default goal. You must give it a goal to run. A "normal" maven build is 'mvn clean install'.
jendave
 
Posts: 307
Joined: 01 Jun 2008, 07:19
Has thanked: 8 times
Been thanked: 21 times

Re: Eclipse and Maven

Postby Chris H. » 24 Jul 2011, 12:28

A Maven install gave me a forge-1.1.1-SNAPSHOT-jar-with-dependencies.jar and a forge-1.1.1-SNAPSHOT.jar located in the /cardforge/target/ folder. You might be able to copy and paste the forge-1.1.1-SNAPSHOT-jar-with-dependencies.jar, the forge.properties file and the /res/ folder over to a new folder. Move your pics and decks over to this folder. Launch the jar while increasing the java heap space.

It might work for those who were looking for an updated forge to run and test.

A Maven clean will delete the files from the /cardforge/target/ folder.

A Maven build... with the goal clean install gave me what looks like the same results as the Maven install ?
User avatar
Chris H.
Forge Moderator
 
Posts: 6320
Joined: 04 Nov 2008, 12:11
Location: Mac OS X Yosemite
Has thanked: 644 times
Been thanked: 643 times

Re: Eclipse and Maven

Postby Chris H. » 24 Jul 2011, 12:59

A Maven build... with the goal -U -B clean -P osx,windows-linux install gave me what looks like the two archives that are part of our forge beta releases.
User avatar
Chris H.
Forge Moderator
 
Posts: 6320
Joined: 04 Nov 2008, 12:11
Location: Mac OS X Yosemite
Has thanked: 644 times
Been thanked: 643 times

Re: Eclipse and Maven

Postby Rob Cashwalker » 24 Jul 2011, 17:11

I'm working on adding the mantis integration into a clean copy of the repository. It needs a number of dependencies added, but I can't figure out how to actually add dependencies into Maven. The Add Dependency window doesn't do browsing, nor does it explain what I should be putting in there.
The Force will be with you, Always.
User avatar
Rob Cashwalker
Programmer
 
Posts: 2167
Joined: 09 Sep 2008, 15:09
Location: New York
Has thanked: 5 times
Been thanked: 40 times

Re: Eclipse and Maven

Postby jendave » 24 Jul 2011, 20:54

One thing that is not intuitive is to execute a maven build from eclipse you use the "Run As..." menu item. That will give you a list of Maven goals to run: install, clean, build etc.
jendave
 
Posts: 307
Joined: 01 Jun 2008, 07:19
Has thanked: 8 times
Been thanked: 21 times

Re: Eclipse and Maven

Postby Chris H. » 24 Jul 2011, 21:08

jendave wrote:One thing that is not intuitive is to execute a maven build from eclipse you use the "Run As..." menu item. That will give you a list of Maven goals to run: install, clean, build etc.
`
I peeked at the Run Configurations and I see that I have three of them already. Granted, m2 num cardforge (num) is not informative in the Run History. But I guess that I could edit the Name: text box and this would make it easier for me to understand.

Thank you for the heads up. It will take us awhile to figure this out. Do we have a workable build and release goal yet? Will this form work as the goal?

Code: Select all
-U -B clean -P osx,windows-linux install release:clean release:prepare release:perform
User avatar
Chris H.
Forge Moderator
 
Posts: 6320
Joined: 04 Nov 2008, 12:11
Location: Mac OS X Yosemite
Has thanked: 644 times
Been thanked: 643 times

Re: Eclipse and Maven

Postby friarsol » 24 Jul 2011, 21:09

So I guess my main question is: I want to run Forge through the debugger using Maven for dependencies. How do I go about doing that? I have Forge through the debugger working just fine now, I just can't tell if it's using Maven or not.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Eclipse and Maven

Postby jendave » 24 Jul 2011, 22:32

I have created a new page in the wiki describing full Maven/Git/Eclipse integration.
http://www.slightlymagic.net/wiki/Forge ... ntegration

Please take a look. It is still a little rough.

Dave
jendave
 
Posts: 307
Joined: 01 Jun 2008, 07:19
Has thanked: 8 times
Been thanked: 21 times

Re: Eclipse and Maven

Postby Rob Cashwalker » 25 Jul 2011, 00:45

I tried this procedure, I got "Invalid remote: origin" while trying to checkout from SCM.

Mind you, the normal git clone has the maven run configs and runs fine... not sure what this process is necessary for.

I'm still trying to figure out the adding of dependencies. I was able to search for "*mantis*" and found a couple libraries, but they're not the ones I'm trying to use, and I can't find documentation on how they're supposed to work. If I sent you the jars that I need can you get them included?
The Force will be with you, Always.
User avatar
Rob Cashwalker
Programmer
 
Posts: 2167
Joined: 09 Sep 2008, 15:09
Location: New York
Has thanked: 5 times
Been thanked: 40 times

Re: Eclipse and Maven

Postby jendave » 25 Jul 2011, 07:35

Rob Cashwalker wrote:I tried this procedure, I got "Invalid remote: origin" while trying to checkout from SCM.

Mind you, the normal git clone has the maven run configs and runs fine... not sure what this process is necessary for.

I'm still trying to figure out the adding of dependencies. I was able to search for "*mantis*" and found a couple libraries, but they're not the ones I'm trying to use, and I can't find documentation on how they're supposed to work. If I sent you the jars that I need can you get them included?
When you use the Team menu item, what do you see? I was not seeing the Git commands using the other way, so I did it the way I have in my doc and was able to see both Maven and Git commands in Eclipse menus.

Adding dependencies is fairly straightforward. Double-click on the pom.xml. Eclipse will bring it up in the editor window. Select the "Dependencies" tab in the editor. You can add deps via the buttons.

Not sure about the error you are getting. That usually happens when you do not select the proper remote repo, but that seems unlikely in this case.
jendave
 
Posts: 307
Joined: 01 Jun 2008, 07:19
Has thanked: 8 times
Been thanked: 21 times

Re: Eclipse and Maven

Postby Rob Cashwalker » 25 Jul 2011, 13:07

The Add Dependencies window expects me to provide fully qualified names.. its not like I can just browse for the local file. I can't find matching libraries for the set of libraries I had downloaded from the MantisConnect project. I can see a number of other libraries that match "mantis" but none are the correct one. One of the ones listed seems like it comes from the correct organization - "biz.futureware.mantis.rpc.soap.client". However they don't have documentation for this particular library, they documented the library I had downloaded from their sourceforge.

With all of the libraries we've added, were all of them already present in Maven?
The Force will be with you, Always.
User avatar
Rob Cashwalker
Programmer
 
Posts: 2167
Joined: 09 Sep 2008, 15:09
Location: New York
Has thanked: 5 times
Been thanked: 40 times

Re: Eclipse and Maven

Postby jendave » 25 Jul 2011, 15:28

Rob Cashwalker wrote:The Add Dependencies window expects me to provide fully qualified names.. its not like I can just browse for the local file. I can't find matching libraries for the set of libraries I had downloaded from the MantisConnect project. I can see a number of other libraries that match "mantis" but none are the correct one. One of the ones listed seems like it comes from the correct organization - "biz.futureware.mantis.rpc.soap.client". However they don't have documentation for this particular library, they documented the library I had downloaded from their sourceforge.

With all of the libraries we've added, were all of them already present in Maven?
Please send me the jars. Most of the ones that Forge depends on are on in a standard Maven repo (http://mvnrepository.com), but the ones that were not (jyield), I put into a repo I maintain at http://arcane.googlecode.com/svn/trunk/repository. Since my repo is already a part of the current Forge Maven build, all we have to do is add your mantis jars and we should be good.
jendave
 
Posts: 307
Joined: 01 Jun 2008, 07:19
Has thanked: 8 times
Been thanked: 21 times

Re: Eclipse and Maven

Postby Rob Cashwalker » 25 Jul 2011, 18:20

Ahh-Hah... I knew there must be a trick like that...
The Force will be with you, Always.
User avatar
Rob Cashwalker
Programmer
 
Posts: 2167
Joined: 09 Sep 2008, 15:09
Location: New York
Has thanked: 5 times
Been thanked: 40 times

Next

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 35 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 35 users online :: 0 registered, 0 hidden and 35 guests (based on users active over the past 10 minutes)
Most users ever online was 7303 on 15 Jul 2025, 20:46

Users browsing this forum: No registered users and 35 guests

Login Form