Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-users] Run As Maven Build vs. Eclipse auto build

See inline


On Tue, Jul 14, 2015, at 09:48 AM, Stephan Herrmann wrote:
> On 07/14/2015 03:33 PM, Igor Fedorenko wrote:
> > Why do you need to run command line maven build on the same projects
> > you've imported in m2e?
> Basically because not all maven plugins are supported by/via m2e
> (i.e., missing connectors).
> And: unconditionally letting m2e invoke all these plugins during
> auto-build is a no-go (long running generators and such).
> So, after pulling big changes from VCS one full maven build needs
> to be triggered, after that Eclipse should take over.
> But they shouldn't both work at the same time :)

You can map these mojos to run during project configuration only and/o
clean project build only. You will still need to manually trigger
configuration update or clean build to get resources regenerated, but I
think this is better than running command line build. 

This is probably what I would do because it would both solve your
immediate problem and make overall developer experience better. This is
how legacy maven-plugin-plugin is supported inside m2e workspace, for
example. Not ideal, but works well enough and many cases.

> > Personally, I only do this when I need to verify
> > my changes didn't break command line build, in which case I just don't
> > touch eclipse while the build is running.
> I'm not sure if not touching is sufficient. Assume you have Eclipse
> configured so that it refreshes resources using native hooks,
> then any generated source files may trigger an auto-build in Eclipse, no?

You are right. I never enable auto workspace refresh. It always results
in unwanted and/or poorly timed workspace builds that interfere with my
development workflow. My projects always have proper m2e lifecycle
mapping for all mojos required to work on the code, so I only need to
refresh workspace after git-pull or build on command line, which I
prefer to do manually.

> > There is no better workaround and I am not even sure what that
> > workaround might be, given overall Eclipse workspace approach, where
> > Eclipse wants to know all details about all resources all the time.
> Could m2e just disable auto-builds while performing a maven build via
> Run As ...?
> Alternatively, if m2e can figure out all projects involved in such a
> build,
> could it actually acquire a scheduling rule for all affected projects??
> I'm not sure which would be better.

I do not think this is m2e specific feature request. All other build
tool and many plain java applications may misbehave if eclipse builder
deletes and recreates classes and resources while the external process
is using them. Which means jdt-debug is a better place to implement this

> cheers,
> Stephan
> PS: and @Bruno: I'm aware that running maven *outside* Eclipse voids any
> warranties made inside Eclipse :)
> _______________________________________________
> m2e-users mailing list
> m2e-users@xxxxxxxxxxx
> To change your delivery options, retrieve your password, or unsubscribe
> from this list, visit

Back to the top