It is currently 20 May 2025, 03:08
   
Text Size

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

Postby jendave » 08 Nov 2013, 18:41

Hi Chris,

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
jendave
 
Posts: 307
Joined: 01 Jun 2008, 07:19
Has thanked: 8 times
Been thanked: 21 times

Re: Working out the multi-module maven setup

Postby 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.
Last edited by Chris H. on 10 Nov 2013, 16:50, edited 1 time in total.
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

Postby 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
Last edited by Chris H. on 10 Nov 2013, 16:51, edited 1 time in total.
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

Postby 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
jendave
 
Posts: 307
Joined: 01 Jun 2008, 07:19
Has thanked: 8 times
Been thanked: 21 times

Re: Working out the multi-module maven setup

Postby 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
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: Working out the multi-module maven setup

Postby Max mtg » 08 Nov 2013, 22:53

jendave 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.
Just try to move a single class forge.card.CardRarity to core module

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
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

Postby 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
jendave
 
Posts: 307
Joined: 01 Jun 2008, 07:19
Has thanked: 8 times
Been thanked: 21 times

Re: Working out the multi-module maven setup

Postby Max mtg » 09 Nov 2013, 00:33

Now works for me too.
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
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

Postby Chris H. » 09 Nov 2013, 00:55

I have changed my Main class in the run config to:

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
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: Working out the multi-module maven setup

Postby Max mtg » 09 Nov 2013, 01:55

Chris H. wrote:What are other people using?
project: forge-gui
Main class: forge.view.Main
Attachments
forgerun.png
Last edited by Chris H. on 10 Nov 2013, 16:55, edited 1 time in total.
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

Postby 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
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

Postby 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.
 
Attachments
Screen Shot.jpg
Last edited by Chris H. on 10 Nov 2013, 16:57, edited 1 time in total.
Reason: subject change
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: Working out the multi-module maven setup

Postby swordshine » 09 Nov 2013, 08:31

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.
 
File->Import->Maven: Exsiting Maven Projects, select forge-gui to import.
Last edited by Chris H. on 10 Nov 2013, 16:58, edited 1 time in total.
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

Postby Max mtg » 09 Nov 2013, 08:34

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.
 
Sol is right about cleaning workspace.
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
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

Postby Chris H. » 09 Nov 2013, 15:05

Thank you everyone for your help :D 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:

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
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

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 38 guests


Who is online

In total there are 38 users online :: 0 registered, 0 hidden and 38 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 38 guests

Login Form