I now recall that Maven stopped including system properties into its
properties list, we had few annoying issues in dependency resolution
when it wasn't done.
So, without global settings that would allow you to specify
Eclipse-specific properties for Maven your only option is to create
separate settings-eclipse.xml, put your properties and/or profiles in
there and specify location of that settings-eclipse.xml instead of the
standard settings.xml. Basically you'll have to maintain two copies of
pretty much the same file, that would allow you to have Eclipse-specific
stuff in one of them.
regards,
Eugene
stug23 wrote:
It's generally more of a problem for the cases where the user doesn't launch
the build.
For bug mentioned earlier in this note, importing the project into Maven or
checking it out of source code control will trigger a build. It's these
cases that are most important, however the ideal solution would be to be
able detect that the build was originated from Eclipse in all cases.
As I mentioned earlier this is a workaround until the Maven Embedder gets
updated in m2eclipse - that's the real solution for the bug.
Eugene Kuleshov wrote:
Can you clarify which build launched from Eclipse you are talking
about? There is at least 3 major cases when m2eclipse launches Maven.
Only one of them corresponds to manual launch by the user, but for that
scenario you can actually select Maven runtime, so it would work exactly
as in the command line.
There been several enhancement requests to allow to specify global
default properties to be used when launching Maven in various cases, but
we haven't implemented those enhancements yet.
Probably the best you could do right now is to specify special profile
name in your projects configuration and then use that profile to do
eclipse-specific stuff.
regards,
Eugene
stug23 wrote:
Yes, that is exactly what I was trying to do. However none of these
Eclipse
properties appear to be available at runtime.
For example, in my Eclipse Configuration Details dialog the first few
"System properties" are as shown below. I can access all of the Java
System
properties, however the Eclipse properties (e.g., eclipse.buildId) are
not
available at runtime so I can't use them in my Maven profile.
This seems like such a standard situation I was a bit surprised that
there
doesn't appear to be an easy way to tell that a Maven build has been
launched from within Eclipse. Is there any way to detect this and use a
property to activate (or not activate) a Maven profile?
This is the first part of my Eclipse Configuration Details -- note that
the
properties are listed as System properties. I suspect that the reason I
don't see these during Maven build execution is because Eclipse is
launching
the build independently of the Eclipse execution per se.
*** Date: Friday, January 9, 2009 7:57:38 AM PT
*** Platform Details:
*** System properties:
awt.toolkit=sun.awt.windows.WToolkit
eclipse.buildId=M20080221-1800
eclipse.commands=-os
win32
-ws
win32
-arch
x86
Eugene Kuleshov wrote:
You can look at the active system properties in the Eclipse
configuration details from Help / About Eclipse SDK / Configuration
Details. There is several properties named like eclipse.*, e.g.
eclipse.buildId
regards,
Eugene
stug23 wrote:
I am trying to work around a bug related to the Maven embedder. I would
like
to define a profile wherein activation is controlled by a property
which
is
intrinsically available in Eclipse so that I can disable the profile
when
running a Maven build in Eclipse.
I tried to use 'eclipse.product=org.eclipse.platform.ide' which is
available
in the Eclipse Configuration Details but can't seem to get Maven to
pickup
this property. I want the activation to be based solely on a property
so
that the profile doesn't need to set outside of Eclipse.
Is there a way to do this?
Note that I would rather not do this at all however the bug
(NoClassDefFoundError: com/sun/mirror/apt/AnnotationProcessorFactory):
<http://jira.codehaus.org/browse/MNGECLIPSE-847>
has not yet been fixed and users are running into problems where
resources
don't get copied because of this bug.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email