Getting eclipse working seamlessly with generated-sourcec etc?

View: New views
5 Messages — Rating Filter:   Alert me  

Getting eclipse working seamlessly with generated-sourcec etc?

by Kent Narling :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I am new to this mailing list, so excuse me if this question is old... (I did search the mailing list though)

We have just started using maven and m2eclipse, but one issue that is annoying is with generated-sources not being refreshed properly automatically, not when checking out or when changing the files generating the sources (right now mostly XSD files compiled by JAXB compiler).

I have tried to configure this in eclipse with builders and refresh setting, but not managed to get it working nicely (you have to manually refresh and "fiddle" etc before it builds without errors)
Anyone else had more success with this?

Also, irritatingly, when I check out , many times Eclipse simply modifies the classpath file and removes the reference to generated sources!! (maybe because the folder does not exist before running the build?) In this case, I always have to sync and then select "Override and update"...

I have not always used "Create maven project", maybe this is part of the issue? many of the projects were simply converted to maven by adding a pom file and doing "maven->Enable dependency management", is there a better recommendation regarding migrating projects?

//Kent



Re: Getting eclipse working seamlessly with generated-sourcec etc?

by Igor Fedorenko-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Kent Närling wrote:

> Hi,
>
> I am new to this mailing list, so excuse me if this question is old...
> (I did search the mailing list though)
>
> We have just started using maven and m2eclipse, but one issue that is
> annoying is with generated-sources not being refreshed properly
> automatically, not when checking out or when changing the files
> generating the sources (right now mostly XSD files compiled by JAXB
> compiler).
>
> I have tried to configure this in eclipse with builders and refresh
> setting, but not managed to get it working nicely (you have to manually
> refresh and "fiddle" etc before it builds without errors)
> Anyone else had more success with this?

Unfortunately, m2eclipse can't detect if/when source generation is
necessary, because Maven does not provide APIs to support this. You have
to manually clean the project (i.e. Project menu, Clean...) to
regenerate the sources. This is not pretty, so ideas/suggestions how to
improve this are welcome and appreciated.

>
> Also, irritatingly, when I check out , many times Eclipse simply
> modifies the classpath file and removes the reference to generated
> sources!! (maybe because the folder does not exist before running the
> build?) In this case, I always have to sync and then select "Override
> and update"...

Do you use "Checkout Maven projects from SCM" as described in [1] or use
something else? Does setting Goals to run on project import to
"process-test-resources" in Window->Preferences->Maven make it work better?

> I have not always used "Create maven project", maybe this is part of the
> issue? many of the projects were simply converted to maven by adding a
> pom file and doing "maven->Enable dependency management", is there a
> better recommendation regarding migrating projects?

For projects that already have pom.xml file, I find using one of maven
import wizard (see [1]) more convenient, but "maven->Enable dependency
management" should work too.


[1] http://docs.codehaus.org/display/M2ECLIPSE/Importing+Maven+projects

--
Regards,
Igor

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Getting eclipse working seamlessly with generated-sourcec etc?

by Kent Narling :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

HI,

Unfortunately, m2eclipse can't detect if/when source generation is necessary, because Maven does not provide APIs to support this. You have to manually clean the project (i.e. Project menu, Clean...) to regenerate the sources. This is not pretty, so ideas/suggestions how to improve this are welcome and appreciated.

Well, actually, I kind of did manage a better solution by defining a maven builder (project->settings->builders) that executes the specific goal for xjv. 

Unfortunately there is one feature from "Ant build" in the "Maven build" that is missing for this to work seamlessly...
Under "Ant build"->Build options there is a setting "Specify working set of relevant resources" which will monitor the relevant resources and if they change execute the build.

So maybe it is possible to add this feature to the "Maven build" and then solve this in a fairly elegant way?




Also, irritatingly, when I check out , many times Eclipse simply modifies the classpath file and removes the reference to generated sources!! (maybe because the folder does not exist before running the build?) In this case, I always have to sync and then select "Override and update"...

Do you use "Checkout Maven projects from SCM" as described in [1] or use something else? Does setting Goals to run on project import to "process-test-resources" in Window->Preferences->Maven make it work better?
Normally I use "Checkout as maven project", yes
 


I have not always used "Create maven project", maybe this is part of the issue? many of the projects were simply converted to maven by adding a pom file and doing "maven->Enable dependency management", is there a better recommendation regarding migrating projects?

For projects that already have pom.xml file, I find using one of maven import wizard (see [1]) more convenient, but "maven->Enable dependency management" should work too.
Ok, great



[1] http://docs.codehaus.org/display/M2ECLIPSE/Importing+Maven+projects

--
Regards,
Igor

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

  http://xircles.codehaus.org/manage_email





--
Kent Närling

System Architect
SEAMLESS
Dalagatan 100, 8 tr, 113 43 Stockholm, Sweden
Phone: +46 8 5648 7800, fax: +46 8 5648 7823
Mobile: +46 70 836 9925
Mail: kent.narling@...
www.seamless.se

Re: Getting eclipse working seamlessly with generated-sourcec etc?

by Igor Fedorenko-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Kent,

I've filed enhancement request MNGECLIPSE-708 about better support for
incremental resource changes. Unfortunately, I cannot provide any
implementation timeframe.

Kent Närling wrote:

> HI,
>
>     Unfortunately, m2eclipse can't detect if/when source generation is
>     necessary, because Maven does not provide APIs to support this. You
>     have to manually clean the project (i.e. Project menu, Clean...) to
>     regenerate the sources. This is not pretty, so ideas/suggestions how
>     to improve this are welcome and appreciated.
>
>
> Well, actually, I kind of did manage a better solution by defining a
> maven builder (project->settings->builders) that executes the specific
> goal for xjv.
>
> Unfortunately there is one feature from "Ant build" in the "Maven build"
> that is missing for this to work seamlessly...
> Under "Ant build"->Build options there is a setting "Specify working set
> of relevant resources" which will monitor the relevant resources and if
> they change execute the build.
>
> So maybe it is possible to add this feature to the "Maven build" and
> then solve this in a fairly elegant way?
>
>
>
>
>         Also, irritatingly, when I check out , many times Eclipse simply
>         modifies the classpath file and removes the reference to
>         generated sources!! (maybe because the folder does not exist
>         before running the build?) In this case, I always have to sync
>         and then select "Override and update"...
>
>
>     Do you use "Checkout Maven projects from SCM" as described in [1] or
>     use something else? Does setting Goals to run on project import to
>     "process-test-resources" in Window->Preferences->Maven make it work
>     better?
>
> Normally I use "Checkout as maven project", yes
>  
>
>
>
>         I have not always used "Create maven project", maybe this is
>         part of the issue? many of the projects were simply converted to
>         maven by adding a pom file and doing "maven->Enable dependency
>         management", is there a better recommendation regarding
>         migrating projects?
>
>
>     For projects that already have pom.xml file, I find using one of
>     maven import wizard (see [1]) more convenient, but "maven->Enable
>     dependency management" should work too.
>
> Ok, great
>
>
>
>
>     [1] http://docs.codehaus.org/display/M2ECLIPSE/Importing+Maven+projects
>
>     --
>     Regards,
>     Igor
>
>     ---------------------------------------------------------------------
>     To unsubscribe from this list, please visit:
>
>       http://xircles.codehaus.org/manage_email
>
>
>
>
>
> --
> Kent Närling
>
> System Architect
> SEAMLESS
> Dalagatan 100, 8 tr, 113 43 Stockholm, Sweden
> Phone: +46 8 5648 7800, fax: +46 8 5648 7823
> Mobile: +46 70 836 9925
> Mail: kent.narling@... <mailto:kent.narling@...>
> www.seamless.se <http://www.seamless.se>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Getting eclipse working seamlessly with generated-sourcec etc?

by Kent Narling :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Well, I am just happy that you filed an enhancement request! :-)

However I guess this does sound like a quite useful feature and it doesn't sound like it should be so hard to put in?
So I can always hope for some attention to it... ;-)


2008/7/3 Igor Fedorenko <igor@...>:
Kent,

I've filed enhancement request MNGECLIPSE-708 about better support for incremental resource changes. Unfortunately, I cannot provide any implementation timeframe.

Kent Närling wrote:
HI,

   Unfortunately, m2eclipse can't detect if/when source generation is
   necessary, because Maven does not provide APIs to support this. You
   have to manually clean the project (i.e. Project menu, Clean...) to
   regenerate the sources. This is not pretty, so ideas/suggestions how
   to improve this are welcome and appreciated.


Well, actually, I kind of did manage a better solution by defining a maven builder (project->settings->builders) that executes the specific goal for xjv.
Unfortunately there is one feature from "Ant build" in the "Maven build" that is missing for this to work seamlessly...
Under "Ant build"->Build options there is a setting "Specify working set of relevant resources" which will monitor the relevant resources and if they change execute the build.

So maybe it is possible to add this feature to the "Maven build" and then solve this in a fairly elegant way?




       Also, irritatingly, when I check out , many times Eclipse simply
       modifies the classpath file and removes the reference to
       generated sources!! (maybe because the folder does not exist
       before running the build?) In this case, I always have to sync
       and then select "Override and update"...


   Do you use "Checkout Maven projects from SCM" as described in [1] or
   use something else? Does setting Goals to run on project import to
   "process-test-resources" in Window->Preferences->Maven make it work
   better?

Normally I use "Checkout as maven project", yes
 


       I have not always used "Create maven project", maybe this is
       part of the issue? many of the projects were simply converted to
       maven by adding a pom file and doing "maven->Enable dependency
       management", is there a better recommendation regarding
       migrating projects?


   For projects that already have pom.xml file, I find using one of
   maven import wizard (see [1]) more convenient, but "maven->Enable
   dependency management" should work too.

Ok, great




   [1] http://docs.codehaus.org/display/M2ECLIPSE/Importing+Maven+projects

   --
   Regards,
   Igor

   ---------------------------------------------------------------------
   To unsubscribe from this list, please visit:

     http://xircles.codehaus.org/manage_email





--
Kent Närling

System Architect
SEAMLESS
Dalagatan 100, 8 tr, 113 43 Stockholm, Sweden
Phone: +46 8 5648 7800, fax: +46 8 5648 7823
Mobile: +46 70 836 9925
Mail: kent.narling@... <mailto:kent.narling@...>
www.seamless.se <http://www.seamless.se>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

  http://xircles.codehaus.org/manage_email





--
Kent Närling

System Architect
SEAMLESS
Dalagatan 100, 8 tr, 113 43 Stockholm, Sweden
Phone: +46 8 5648 7800, fax: +46 8 5648 7823
Mobile: +46 70 836 9925
Mail: kent.narling@...
www.seamless.se
LightInTheBox - Buy quality products at wholesale price