Working out the multi-module maven setup
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
Re: Working out the multi-module maven setup
by jendave » 08 Nov 2013, 18:41
Hi Chris,
Just checked in changes to the Eclipse setup. Please update and let me know.
Thanks
Dave
Just checked in changes to the Eclipse setup. Please update and let me know.
Thanks
Dave
Last edited by Chris H. on 10 Nov 2013, 16:49, edited 1 time in total.
Reason: subject change
Reason: subject change
Re: Working out the multi-module maven setup
by Max mtg » 08 Nov 2013, 21:38
Import to eclipse - successful,
build (the what eclipse performs in background) - worked after updating maven
run from eclipse - failed. Looks like gui module is missing .classpath file, that's why Eclipse won't offer classes from that module to choose whose Main method to use.
UPD: made a few commits to make it compile and run.
build (the what eclipse performs in background) - worked after updating maven
run from eclipse - failed. Looks like gui module is missing .classpath file, that's why Eclipse won't offer classes from that module to choose whose Main method to use.
UPD: made a few commits to make it compile and run.
Last edited by Chris H. on 10 Nov 2013, 16:50, edited 1 time in total.
Reason: subject change
Reason: subject change
Single class for single responsibility.
- Max mtg
- Programmer
- Posts: 1997
- Joined: 02 Jul 2011, 14:26
- Has thanked: 173 times
- Been thanked: 334 times
Re: Working out the multi-module maven setup
by Max mtg » 08 Nov 2013, 22:03
Tried to move a package to core class - that won't work.
Looks like Eclipse does not see the referenced modules, they appear in the package explorer as empty folders and contain no classes
Looks like Eclipse does not see the referenced modules, they appear in the package explorer as empty folders and contain no classes
Last edited by Chris H. on 10 Nov 2013, 16:51, edited 1 time in total.
Reason: subject change
Reason: subject change
Single class for single responsibility.
- Max mtg
- Programmer
- Posts: 1997
- Joined: 02 Jul 2011, 14:26
- Has thanked: 173 times
- Been thanked: 334 times
Re: Working out the multi-module maven setup
by jendave » 08 Nov 2013, 22:36
Let me know a package to move to core and one to move to AI. I can then adjust the Eclipse settings. Eclipse is not so good with refreshing its Maven settings.
Last edited by Chris H. on 10 Nov 2013, 16:51, edited 1 time in total.
Reason: subject change
Reason: subject change
Re: Working out the multi-module maven setup
by Chris H. » 08 Nov 2013, 22:50
jendave wrote:Hi Chris,
Just checked in changes to the Eclipse setup. Please update and let me know.
Thanks
Dave
I Time-Machined a copy of yesterday's worksapce folder over my current workspace folder. I then entered this into my terminal window as Eclipse does not want to sync with so many changes:
- Code: Select all
#!/bin/sh
cd /Users/me/Workspace_SVN/ForgeSVN/
svn up
At the end of the update my terminal window states:
Updated to revision 23609.
I then launched Eclipse and had it open my workspace folder. I then used a Maven command to build a local copy and it worked. The archive does not include the CHANGES.txt, LICENSE.txt, forge.profile.properties.example and README.txt files.
When I attempt to run Forge from within Eclipse I get:
Error: Could not find or load main class forge.view.Main
Do we need to adjust the Run Configurations -> Main class: text box too?
Last edited by Chris H. on 10 Nov 2013, 16:52, edited 1 time in total.
Reason: subject change
Reason: subject change
-
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: Working out the multi-module maven setup
by Max mtg » 08 Nov 2013, 22:53
Just try to move a single class forge.card.CardRarity to core modulejendave wrote:Let me know a package to move to core and one to move to AI. I can then adjust the Eclipse settings. Eclipse is not so good with refreshing its Maven settings.
as for AI - take just any enum that has no dependencies to test it out.
Last edited by Chris H. on 10 Nov 2013, 16:52, edited 1 time in total.
Reason: subject change
Reason: subject change
Single class for single responsibility.
- Max mtg
- Programmer
- Posts: 1997
- Joined: 02 Jul 2011, 14:26
- Has thanked: 173 times
- Been thanked: 334 times
Re: Working out the multi-module maven setup
by jendave » 08 Nov 2013, 23:22
Moved the files into the modules. The build via Maven cli worked. I also ran compiled and ran the app in Eclipse. I had to set the Main class in the run config though. I have checked in the changes.
Last edited by Chris H. on 10 Nov 2013, 16:53, edited 1 time in total.
Reason: subject change
Reason: subject change
Re: Working out the multi-module maven setup
by Max mtg » 09 Nov 2013, 00:33
Now works for me too.
It's just Wonderful!
There's a lot to be done now
It's just Wonderful!
There's a lot to be done now
Last edited by Chris H. on 10 Nov 2013, 16:53, edited 1 time in total.
Reason: subject change
Reason: subject change
Single class for single responsibility.
- Max mtg
- Programmer
- Posts: 1997
- Joined: 02 Jul 2011, 14:26
- Has thanked: 173 times
- Been thanked: 334 times
Re: Working out the multi-module maven setup
by Chris H. » 09 Nov 2013, 00:55
I have changed my Main class in the run config to:
and then tried to fun forge from this run config and I get:
What are other people using?
- Code: Select all
forge-gui.src.main.java.forge.view.Main
and then tried to fun forge from this run config and I get:
Error: Could not find or load main class forge-gui.src.main.java.forge.view.Main
What are other people using?
Last edited by Chris H. on 10 Nov 2013, 16:54, edited 1 time in total.
Reason: subject change
Reason: subject change
-
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: Working out the multi-module maven setup
by Max mtg » 09 Nov 2013, 01:55
project: forge-guiChris H. wrote:What are other people using?
Main class: forge.view.Main
Last edited by Chris H. on 10 Nov 2013, 16:55, edited 1 time in total.
Reason: subject change
Reason: subject change
Single class for single responsibility.
- Max mtg
- Programmer
- Posts: 1997
- Joined: 02 Jul 2011, 14:26
- Has thanked: 173 times
- Been thanked: 334 times
Re: Working out the multi-module maven setup
by friarsol » 09 Nov 2013, 02:27
For anyone else having problems, I ended up having better luck reimporting the new project than trying to resolve issues with the old one. Additionally, your profile is now in the wrong location (forge folder instead of the forge-gui folder), so you'll probably need to move it (at least I needed to). Is this going to be an issue for our user base?
Last edited by Chris H. on 10 Nov 2013, 16:56, edited 1 time in total.
Reason: subject change
Reason: subject change
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Working out the multi-module maven setup
by Chris H. » 09 Nov 2013, 02:49
I changed the Project: text box from "ForgeSVN" to "forge-gui" and pressed the Apply button. I am told that Project forge-gui does not exist in the top left corner. The Run button is greyed out.
Last edited by Chris H. on 10 Nov 2013, 16:57, edited 1 time in total.
Reason: subject change
Reason: subject change
-
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: Working out the multi-module maven setup
by swordshine » 09 Nov 2013, 08:31
File->Import->Maven: Exsiting Maven Projects, select forge-gui to import.Chris H. wrote:I changed the Project: text box from "ForgeSVN" to "forge-gui" and pressed the Apply button. I am told that Project forge-gui does not exist in the top left corner. The Run button is greyed out.
Last edited by Chris H. on 10 Nov 2013, 16:58, edited 1 time in total.
Reason: subject change
Reason: subject change
- swordshine
- Posts: 682
- Joined: 11 Jul 2010, 02:37
- Has thanked: 116 times
- Been thanked: 87 times
Re: Working out the multi-module maven setup
by Max mtg » 09 Nov 2013, 08:34
Sol is right about cleaning workspace.Chris H. wrote:I changed the Project: text box from "ForgeSVN" to "forge-gui" and pressed the Apply button. I am told that Project forge-gui does not exist in the top left corner. The Run button is greyed out.
You have to delete all projects from eclipse workspace, svn up, then import the root maven project
Last edited by Chris H. on 10 Nov 2013, 16:59, edited 1 time in total.
Reason: subject change
Reason: subject change
Single class for single responsibility.
- Max mtg
- Programmer
- Posts: 1997
- Joined: 02 Jul 2011, 14:26
- Has thanked: 173 times
- Been thanked: 334 times
Re: Working out the multi-module maven setup
by Chris H. » 09 Nov 2013, 15:05
Thank you everyone for your help
and I seem to now have everything up to date and running. I can run forge from within Eclipse. I can execute the maven command from within Eclipse to do a local build and archive. So my run configs are good.
I deleted the previous project from Eclipse and the workspace.
I then imported the SVN project into Eclipse using the same project name as I was using before.
I had to follow Swordshine's advice and:
At this point I was able to set up my run configs.

I deleted the previous project from Eclipse and the workspace.
I then imported the SVN project into Eclipse using the same project name as I was using before.
I had to follow Swordshine's advice and:
File->Import->Maven: Existing Maven Projects, select forge-gui to import.
At this point I was able to set up my run configs.
Last edited by Chris H. on 10 Nov 2013, 16:59, edited 1 time in total.
Reason: subject change
Reason: subject change
-
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
Who is online
Users browsing this forum: No registered users and 30 guests