RE: I get an Cannot create virtual machine error when trying to Install maven

2008-06-29 Thread Bernhard David
Hello,

what's your MAVEN_OPTS env variable set to? Maven passes that as arguments to 
the java VM when executing.

Yours,

David Bernhard 

> -Original Message-
> From: James Davis [mailto:[EMAIL PROTECTED] 
> Sent: 29 June 2008 00:20
> To: users@maven.apache.org
> Subject: I get an Cannot create virtual machine error when 
> trying to Install maven
> 
> Hello,
>  
> I have follow the step for installation word for word and I 
> still can install mavem. When I run the test "mvn --version" 
> in the command prompt I get the following error:
>  
> Unrecognized option: -
> Could not create the Java virtual machine.
>  
> Does anyone know what this means? I have copied and pasted my 
> JAVA_HOME variable striaght from the address bar of my 
> browser where I installed java. I must have went thorught the 
> instructions a hundred times can someone please help.
> 
> 
>   
> 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Do maven plugin (mojo) developers have access to a classloader based on ${project.artifacts}, or do we need to build it up ourselves?

2008-06-23 Thread Bernhard David
Hello,

I hit the same problem a while ago, what I did was  

List classpath = m_project.getRuntimeClasspathElements();

where m_project is of course the parameter ${project} (MavenProject).

>From there, it's no problem to construct an UrlClassLoader and run a new
thread with it as context class loader. 

Yours,

David Bernhard

> -Original Message-
> From: upstreamnet [mailto:[EMAIL PROTECTED] 
> Sent: 23 June 2008 08:39
> To: users@maven.apache.org
> Subject: Do maven plugin (mojo) developers have access to a 
> classloader based on ${project.artifacts}, or do we need to 
> build it up ourselves?
> 
> 
> Hi, I'm interested in using the spring beandoc mojo, but it 
> has some issues,
> which I believe were previously touched on  in this
> forum.
> 
> Basically, my problem is that the spring bean doc plugin is 
> failing for me
> when i try to process
> spring beans that use imports the reference other bean files 
> by class path.  
>   e.g.:
> 
>
> 
> 
> This seems to be a result of the fact that when the mojo executes it's
> Thread's currentContextClassLoader 
> doesn't have references to the artifacts (jars) that are used 
> at compile
> time.
> 
> There seems to be  a bug related to this issue that was 
> closed as wontFix
> 
>   http://jira.codehaus.org/browse/MNG-697
> 
> The question which launched the original thread of discussion 
> (which I think
> was sent by the original developer of the spring bean doc 
> mojo) is here:
> 
>   
> http://www.nabble.com/-m2--plugin-classpath-question-to662848.
html#a662848
> 
> 
> The response to the question was basically 
>   >>You can get the JARs for the project's artifacts using the
> ${project.artifacts} expression.
> 
> 
> I found some plugin code (at the URL below)
> that seems to (more or less) follow this approach... 
> 
> http://metagenome.ncl.ac.uk/websvn/filedetails.php?repname=flu
xion&path=%2Ftrunk%2Fstack%2Fgenerate-beans-plugin%2Fsrc%2Fmain%>
2Fjava%2Forg%2Fcomparagrid%2Ffluxion%2Fplugins%2Fbeangen%2FGen
> erateBeansMojo.java&rev=532&sc=1
> 
> 
> I guess I'll fix the spring bean doc plugin using this 
> approach, unless
> someone suggests a better one.  
> 
> 
> The code that I'm planning to write to do mostly borrows from
> GenerateBeansMojo.java (in the link above)..
> Any comments or suggestions are most welcome>>>
> 
> 
> class  MyMojo.  extends AbstractMojo {
> 
>   /**
>* The set of artifact artifacts
>*
>* @parameter expression = "${project.artifacts}"
>* @readonly
>*/
>   private Collection artifacts;
> 
> 
> 
>   /**
>* Resolve Maven artifacts from "${project.artifacts}" and 
> set up the
> current
>* context class loader to load the classes from these artifacts. 
> 
>*  Calling class should restore original classloader... this method
> should probably
>*  return the original (before the current threads' 
> context class loader
> was changed)
>* 
>* 
>* NOTE that this seems to be necessary to work around a 
> maven bug.  The
>* plugin should have these dependencies available to it's 
> classloader,
> but
>* the classloader seems to be persistent from previous 
> invocations, and
> as
>* such I'm having to load the classes myself.
>*
>* @throws MojoExecutionException
>*/
>   private void resolveDependencies() throws MojoExecutionException
>   {
> try
> {
>   List allURLs = new ArrayList();
>   for (Object o : artifacts)
>   {
> Artifact artifact = (Artifact) o;
> allURLs.add(artifact.getFile().toURL());
> 
>   }
> 
>   // TO FIX CLASSLOADER BUG
>   // Set up the classloader to load from all declared 
> artifacts in this
> project
>   URL[] urls = new URL[allURLs.size()];
>   urls = allURLs.toArray(urls);
>   URLClassLoader loader = new URLClassLoader(urls,
> Thread.currentThread().getContextClassLoader());
>   Thread.currentThread().setContextClassLoader(loader);
> 
> //// TODO - this fix is definately NOT a 
> desirable solution
> //// the plugin classloader will gradually 
> accumulate more and
> more redundant stuff
> //// but it works for now, although there are 
> duplicates being
> loaded and it isn't right!
> }
> catch (MalformedURLException e)
> {
>   throw new MojoExecutionException(
>   "Unable to access " + classDir.getAbsolutePath());
> }
> 
>   }
> 
> 
>   thanks -- Chris
> 
> -- 
> View this message in context: 
> http://www.nabble.com/Do-maven-plugin-%28mojo%29-developers-ha
ve-access-to-a-classloader-based-on-%24%7Bproject.artifacts%7D%>
2C-or-do-we-need-to-build-it-up-ourselves--tp18063356p18063356.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

--

RE: location of application.xml?

2008-06-17 Thread Bernhard David
Hello,

I think you just need to declare src/main/application as a resource
folder in your pom -



src/main/application


and it should work exactly as src/main/resources does.

Yours,

David Bernhard

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> Sent: 18 June 2008 07:54
> To: Maven Users List
> Subject: location of application.xml?
> 
> I'm not sure when you put META-INF\application.xml.
> 
> Does it go under src\main\resources or src\main\application?
> 
> mvn eclipse:eclipse generates a source dir reference to 
> src\main\application, and that is what it appears to need to 
> be able to 
> run the test app in the environment.
> 
> However, although maven generates a correct application.xml 
> (one that uses 
> the correct version numbers from the war/ejb modules) it does 
> not put it 
> in the generated ear file - not if I use 
> src\main\application. If I use 
> src\main\application then it uses what is in the file system and not 
> generate one.
> 
> Which almost makes me take the approach of using both 
> src\main\resources 
> and src\main\application - yuk!
> 
> Which is correct?
> 
> -Chris
> 
> 
> **
> CAUTION - This message is intended for the addressee named 
> above. It may contain privileged or confidential information. 
> 
> If you are not the intended recipient of this message you must: 
> - Not use, copy, distribute or disclose it to anyone other 
> than the addressee;
> - Notify the sender via return email; and
> - Delete the message (and any related attachments) from your 
> computer immediately.
> 
> Internet emails are not necessarily secure. Australian 
> Associated Motors Insurers Limited ABN 92 004 791 744 (AAMI), 
> and its related entities, do not accept responsibility for 
> changes made to this message after it was sent.
> 
> Unless otherwise stated, views expressed within this email 
> are the author's own and do not represent those of AAMI.
> **
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Plugin goalPrefix : Deprecated?

2008-06-12 Thread Bernhard David
Hello,

basically I was investigating why whenever we build our existing plugins
we get that warning. Two of them use a goalPrefix that is in fact
different to their artifactId and I was wondering if that's likely to
cause a problem in future.

I was also a bit confused by the line

> [WARNING] Goal prefix is specified as: 'beans'. Maven 
> currently expects
> it to be 'beans'.

wondering where on earth I'd misspelt something :) 

Yours,

David Bernhard

> -Original Message-
> From: Brian E. Fox [mailto:[EMAIL PROTECTED] 
> Sent: 12 June 2008 12:34
> To: Maven Users List
> Subject: RE: Plugin goalPrefix : Deprecated?
> 
> I'm not sure why you need to do that. If you name your plugin 
> artifactId
> maven-beans-plugin, then you don't need to override the goalPrefix.
> 
> -Original Message-
> From: Bernhard David [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, June 12, 2008 5:30 AM
> To: Maven Users List
> Subject: Plugin goalPrefix : Deprecated?
> 
> Hello,
> 
> when I create a plugin called "maven-beans-plugin" and specify in the
> pom
> 
> 
>   org.apache.maven.plugins
>   maven-plugin-plugin
>   
>   beans
>   
> 
> 
> I get the rather odd warning 
> [WARNING] Goal prefix is specified as: 'beans'. Maven 
> currently expects
> it to be 'beans'.
> 
> I've found out that this warning is broadcast by the 
> maven-plugin-plugin
> as soon as you specify any goalPrefix at all. 
> 
> Does this mean  is discouraged or deprecated? Can it cause
> problems?
> 
> Yours,
> 
> David Bernhard
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Plugin goalPrefix : Deprecated?

2008-06-12 Thread Bernhard David
Hello,

when I create a plugin called "maven-beans-plugin" and specify in the
pom


org.apache.maven.plugins
maven-plugin-plugin

beans



I get the rather odd warning 
[WARNING] Goal prefix is specified as: 'beans'. Maven currently expects
it to be 'beans'.

I've found out that this warning is broadcast by the maven-plugin-plugin
as soon as you specify any goalPrefix at all. 

Does this mean  is discouraged or deprecated? Can it cause
problems?

Yours,

David Bernhard

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Binding a plugin with a phase.

2008-06-09 Thread Bernhard David
Hello,

there is a phase "process-classes" in the maven build lifecycle which
comes just after "compile" and is intended for post-compile work on your
classes. Maybe that's what you're looking for?

Though, as Niranjan said, binding it to compile should work too (if it
doesn't execute, you might need to add a  definition).

Yours,

David Bernhard

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> Sent: 09 June 2008 09:08
> To: Maven Users List
> Subject: Re: Binding a plugin with a phase.
> 
> Niranjan Deshpande schrieb:
> > I want to bind the maven-antrun-plugin with maven's compile 
> phase. I did it
> > by saying this in the plugin:
> >
> > compile
> >
> > Does this this mean that my plugin will run, after maven 
> has executed the
> > compile phase of the life cycle? My plugin's task is 
> dependent on the
> > compiled classes.
> >   
> It will run *during* the compile phase, but after other plugins which
> are bound to the same phase, and which were "declared earlier". The
> implicit maven-compiler-plugin is "declared earlier" so your ant task
> can safely assume that the code has been compiled before it runs.
> 
> Regards, Simon
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: How to enable logging of plugin execution

2008-06-09 Thread Bernhard David
Hello,

is it possible to use the plugin logging facility? You can call getLog()
in your mojo to get the plugin logger. It's not log4j (it's a plexus
logger) but it does pretty much the same.

I tried myself to get log4j and maven to work together, I'd be
interested if anyone else succeeds. 

Yours,

David Bernhard

> -Original Message-
> From: Jon Seymour [mailto:[EMAIL PROTECTED] 
> Sent: 09 June 2008 03:30
> To: users@maven.apache.org
> Subject: How to enable logging of plugin execution
> 
> I am trying to enable log4j output in order to capture diagnostics
> from the execution of a Maven plugin.
> 
> The execution environment is Maven 2.0.7, running under cygwin.
> 
> I do the following:
> 
>export 
> MAVEN_OPTS="-Dlog4j.configuration='c:\temp\log4j.properties'"
>mvn clean install
> 
> However, I don't get any logging output from the maven build.
> 
> I searched the maven website and user archives for clues, but 
> haven't found any.
> 
> What am I doing wrong?
> 
> jon seymour.
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Priorities of properties

2008-05-19 Thread Bernhard David
Hello,

You're right - I've had this issue before too. IMO, the order of loading
is this (higher numbers override lower)

1. System and command-line properties
2. Local pom.xml
3. Global settings.xml

I guess the issue is that system and command-line properties cannot be
distinguished at the moment, and it is desirable to have explicitly set
pom properties override system ones.

Yours,

David 

> -Original Message-
> From: Clifton [mailto:[EMAIL PROTECTED] 
> Sent: 16 May 2008 15:12
> To: users@maven.apache.org
> Subject: Priorities of properties
> 
> 
> AM I confused or does Maven override command line properties 
> with profile
> properties in the pom and profiles.xml? Shouldn't command 
> line properties
> always take precedence? Could somebody explain the priority order of
> properties in Maven? I've been trying to do things like have 
> a switch in one
> profile activate another but this doesn't seem to work well. 
> I've also run
> into issues where profiles.xml properties collide with or 
> shadow pom.xml
> properties. Is there an in depth explanation of how all this 
> is supposed to
> work?
> -- 
> View this message in context: 
> http://www.nabble.com/Priorities-of-properties-tp17274343p1727
4343.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Output to console and file at the same time?

2008-05-13 Thread Bernhard David
Hello,

there's a windows port (non-cygwin, works in CMD.EXE) of tee and others
- google "gnuwin32".

I'd still love to see maven use a logging system like log4j, though.

David 

> -Original Message-
> From: Andrew Robinson [mailto:[EMAIL PROTECTED] 
> Sent: 13 May 2008 17:24
> To: Maven Users List
> Subject: Re: Output to console and file at the same time?
> 
> Use tee (linux command):
> 
> mvn install | tee myfile.log
> 
> If you are on windows, I'm sure there is a port, or at least it would
> work with cygwin.
> 
> -Andrew
> 
> On Tue, May 13, 2008 at 7:41 AM, Mick Knutson 
> <[EMAIL PROTECTED]> wrote:
> > Is there a way I can get the output to the console and a 
> file on the same
> > run?
> >
> >  --
> >
> >  ---
> >  Thank You...
> >
> >  Mick Knutson
> >  BASE Logic, inc.
> >
> >  Website: http://www.baselogic.com
> >  Blog: http://www.baselogic.com/blog
> >  BLiNC Magazine: http://www.blincmagazine.com
> >  Linked IN: http://www.linkedin.com/in/mickknutson
> >  DJ Mick: http://www.djmick.com
> >  MySpace: http://www.myspace.com/mickknutson
> >  Tahoe: http://tahoe.baselogic.com
> >  ---
> >
> >
> >  
> -
> >  To unsubscribe, e-mail: [EMAIL PROTECTED]
> >  For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Global settings for a plugin

2008-04-30 Thread Bernhard David
Hello,

I believe the usual thing to do is declare one parent pom for all
projects in your organization and put "globals" in there. Then, all your
poms need to declare it or one of its children as .

That's how we do it at elca.

Yours,

David 

> -Original Message-
> From: Olivier Dehon [mailto:[EMAIL PROTECTED] 
> Sent: 30 April 2008 14:05
> To: Maven Users List
> Subject: Re: Global settings for a plugin
> 
> I haven't tried, but I believe you could have a look at the
>  section, and add the global configuration for the
> eclipse plugin in your super pom.
> 
> -Olivier
> 
> On Wed, 2008-04-30 at 11:19 +0300, Eugeny N Dzhurinsky wrote:
> > Hello everybody!
> > 
> > Could you please explain how can I provide some specific 
> settings for a
> > plugin, which would apply to any Maven project? For 
> instance, I need to
> > configure the Eclipse plugin to add the project version to 
> a generated
> > project, currently I need to provide each and every POM 
> file with the settings
> > like below:
> > 
> > 
> > org.apache.maven.plugins
> > maven-eclipse-plugin
> > 
> > 
> true
> > 
> > 
> > 
> > and this is a bit annoying.
> > 
> > I learned settings.xml description and found there's no way 
> to specify plugin
> > settings in it. Any advice?
> > 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: batch script halts after mvn command

2008-04-30 Thread Bernhard David
Hello,

I believe if you call one batch file from another you need to use "CALL"
- see "help call" if you have it. "start.exe" (with some parameters)
might also work. Or, if that fails, "command.com /c file.bat".

Yours,

David

> -Original Message-
> From: Ramunas [mailto:[EMAIL PROTECTED] 
> Sent: 30 April 2008 10:11
> To: Maven Users List
> Subject: batch script halts after mvn command
> 
> Hi,
> I use maven 2.0.7.
> I wrote a *.bat file to execute maven command (and some other 
> commands). 
> But when mvn script finishes, the *.bat file do not process any other 
> commands which follows mvn.
> Any solutions to fix that?
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Execute Integration/Unit Tests Separately

2008-04-29 Thread Bernhard David
Hello,

unit tests we just put in src/test/java instead of src/main/java and
surefire runs them automatically in phase "test". You can do a "mvn
test" on the command-line to run only up to and including these tests. 

Integration tests - here's an example (that you can also adapt for unit
tests)


org.apache.maven.plugins
maven-surefire-plugin


integration-tests
integration-test

test




**/*IntegrationTest.java






They'll be run in the regular build in phase integration-test. If you
don't want them to run automatically, you can put this in a 
section and then you'd start them with "mvn -P profilename
integration-test".

Yours,

David


> -Original Message-
> From: Campano, Troy [mailto:[EMAIL PROTECTED] 
> Sent: 30 April 2008 02:14
> To: users@maven.apache.org
> Subject: Execute Integration/Unit Tests Separately
> 
> 
> Hello, 
> I am new to Maven 2 (trying to convert from Maven 1). I want 
> to be able
> to run my Unit Tests and Integration Tests separately. I have named my
> unit tests **UnitTest.java and my integration tests
> **IntegrationTest.java. In Maven 1 I would define two custom goals in
> maven.xml, one for each type of test, and also define the "include"
> filter to include the correct tests in the corresponding custom goal
> (the "test-unit" goal would run all my **UnitTest.java files and
> "test-integration" would run all of my **IntegrationTest.java files).
> 
> How do I do this with Maven 2? I just read through the whole 
> "lifecycle"
> concept. Does this mean I would define the SureFire plugin to 
> run in the
> "test" phase and the "integration-test" phase and each 
> definition in my
> pom.xml would be tied to one of those lifecycle phases (each 
> with their
> own separate "include" definition)?
> 
> Thank you for the help, it's appreciated!
> 
> ~ T r o y ~ 
> 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: dependencyManagement help

2008-04-24 Thread Bernhard David
Hello,

I think dep.mgmt. is meant to declare "if an artifact with this 
groupId/artifactId appears somewhere in the dependency tree, include the 
version stated here; but don't include it by default".

For instance, if your module A depends on module B which in turn depends on 
module C 1.0 but you'd like to use C 2.0, you can put it in A's 
dependencyManagement. This is probably good practice as C is not a direct 
dependency of A. (In particular, if a new version of B comes out that no longer 
requires C, C will be dropped altogether and not included from A).

Greetings,

David

> -Original Message-
> From: Lachlan Deck [mailto:[EMAIL PROTECTED] 
> Sent: 24 April 2008 08:55
> To: Maven Users List
> Subject: Re: dependencyManagement help
> 
> Hi there,
> 
> On 24/04/2008, at 4:37 PM, Jörg Schaible wrote:
> 
> >> -- root parent pom --
> >> 
> >>   
> >> 
> >>   ...
> >>   ...
> >>   ...
> >>   ...
> >> 
> >>   
> >> 
> >>
> >> -- /frameworks/pom.xml --
> >> 
> >>
> >>...
> >>...
> >>provided
> >>
> >> 
> >>
> >> And so forth. Previously I had no dependencyManagement at
> >> all. So the
> >> only mention of the version of a dependency is in the management
> >> section. However, now when I do a 'mvn clean' I get the following.
> >
> > The two artifacts to not match. An artifact is defined by groupId,  
> > artifactId, type and optional classifier. The type defaults to  
> > "jar". This might give you an idea ;-)
> 
> Then I'm not seeing what purpose the dependencyManagement section  
> serves if I've still gotta declare pretty much everything apart from  
> 'version' in other dependency declarations?
> 
> with regards,
> --
> 
> Lachlan Deck
> 
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Explicitly deactivated profiles activated by default - bug ?

2008-04-23 Thread Bernhard David
Hello,

I am using maven 2.0.9.

suppose I run "mvn -P-it install" to explicitly deactivate profile "it".
It is included in my pom with activeByDefault=true.
In DefaultMavenPluginManager.java: 227ff as long as no other profiles
are explicitly activated, all such default-activated profiles are
activated, in other words "-P-it" does not work.

Shouldn't a deactivate on the command line override a "by default"
activation?

Greetings,

David

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Order of executing plugins changed in 2.0.9 ?

2008-04-16 Thread Bernhard David
Hello,

the problem occurs when merging the two definitions of the same plugin into 
one. John Casey from the maven team just commented on the JIRA issue I 
submitted on this that two definitions of the same plugin in one pom should be 
a validation error. 

As far as two different plugins go, I haven't tested it but I imagine, as they 
are not merged, that the execution order is the order they are defined in the 
pom.

I'd be thankful if anyone could confirm or refute that statement though.

David

> -Original Message-
> From: VUB Stefan Seidel [mailto:[EMAIL PROTECTED] 
> Sent: 16 April 2008 17:08
> To: Maven Users List
> Subject: Re: Order of executing plugins changed in 2.0.9 ?
> 
> Wendy Smoak wrote:
> > On Wed, Apr 16, 2008 at 7:22 AM, Bernhard David 
> <[EMAIL PROTECTED]> wrote:
> >> Hello,
> >>
> >>  after some long hours with the debugger, I discovered the 
> following.
> >>
> >>  If I define a plugin twice like this:
> > 
> > What happens if you put both s in the same ?
> > 
> > I see you've already solved it by consolidating even further, to one
> > execution with two goals.
> > 
> > I'm trying to think of a situation where you'd need to declare a
> > plugin twice in one phase-- usually multiple executions are fine.
> > 
> 
> The problem is: if it doesn't work with the same plugin 
> twice, it will 
> most probably not work with two different plugins - that's 
> what I had here.
> 
> Stefan
> -- 
> best regards,
> 
> Stefan Seidel
> software developer
> 
> VUB Printmedia GmbH
> Chopinstraße 4
> D-04103 Leipzig
> Germany
> tel.+49 (341) 9 60 50 07
> fax.+49 (341) 9 60 50 92
> mail.   [EMAIL PROTECTED]
> web.www.vub.de
> 
> HRB Köln 24015
> UStID DE 122 649 251
> GF Dr. Achim Preuss Neudorf,
> Dr. Christian Preuss Neudorf
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Order of executing plugins changed in 2.0.9 ?

2008-04-16 Thread Bernhard David
Hello,

due to the way merging is done (a plugin can have many executions, but
there cannot be two plugin definitions with the same name and phase) if
you add two s no merging is done and all is fine.

This issue arose because in EL4J we used to have two definitions in our
pom file which worked fine up until 2.0.8 - I've changed that now. I
suppose you might need two if they are both in different profiles or
different pom files.


David

> -Original Message-
> From: Wendy Smoak [mailto:[EMAIL PROTECTED] 
> Sent: 16 April 2008 16:29
> To: Maven Users List
> Subject: Re: Order of executing plugins changed in 2.0.9 ?
> 
> On Wed, Apr 16, 2008 at 7:22 AM, Bernhard David 
> <[EMAIL PROTECTED]> wrote:
> > Hello,
> >
> >  after some long hours with the debugger, I discovered the 
> following.
> >
> >  If I define a plugin twice like this:
> 
> What happens if you put both s in the same ?
> 
> I see you've already solved it by consolidating even further, to one
> execution with two goals.
> 
> I'm trying to think of a situation where you'd need to declare a
> plugin twice in one phase-- usually multiple executions are fine.
> 
> -- 
> Wendy
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Order of executing plugins changed in 2.0.9 ?

2008-04-16 Thread Bernhard David
Thanks - it should be reconstructable from my last mail too, but I'll
make a test case anyway to simplify things.

David 

> -Original Message-
> From: Wayne Fay [mailto:[EMAIL PROTECTED] 
> Sent: 16 April 2008 16:23
> To: Maven Users List
> Subject: Re: Order of executing plugins changed in 2.0.9 ?
> 
> > In practice and to my knowledge and experiences, it has 
> never been like
> > that.
> 
> If you can make a simple test case that demonstrates this bug and
> upload to JIRA, I'm sure someone will take a look at it.
> 
> Wayne
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Order of executing plugins changed in 2.0.9 ?

2008-04-16 Thread Bernhard David
Hello,

after some long hours with the debugger, I discovered the following.

If I define a plugin twice like this:


org.codehaus.cargo
cargo-maven2-plugin


start-container
pre-integration-test

start





org.codehaus.cargo
cargo-maven2-plugin


deploy
pre-integration-test

deploy



 

Maven executes the plugins backwards. (Deploy first)

However, this can be fixed with 


org.codehaus.cargo
cargo-maven2-plugin


start-container-and-deploy
pre-integration-test

start
deploy





which solves my problem.

The backwards issue does seem odd to me - I've posted to the dev list
too, asking about it. The point is that the merging is done with the new
definition as "parent" and the old one as "child", resulting in the
parent coming first.

Apart from this, you're right about the ordering. 

Yours,

David Bernhard

> -Original Message-
> From: Max Bowsher [mailto:[EMAIL PROTECTED] 
> Sent: 16 April 2008 16:10
> To: Maven Users List
> Subject: Re: Order of executing plugins changed in 2.0.9 ?
> 
> > Bernhard David wrote:
> >> in maven 2.0.8 I can put the following in a pom to execute first
> >> cargo:start then cargo:deploy in the pre-integration-test phase. In
> >> 2.0.9, maven executes deploy first, which breaks the build.
> 
> VUB Stefan Seidel wrote:
>  > AFAIK, the execution of plugins in the same phase is not 
> consistent.
> 
> I was under the impression that there was ordering of lifecycle bound 
> executions first, then executions from each pom in a parent-child 
> hierarchy in that order, and within each pom, in declaration order.
> 
> Am I just imagining things?
> 
> Max.
> 
> 
> 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Order of executing plugins changed in 2.0.9 ?

2008-04-15 Thread Bernhard David
Hello,

in maven 2.0.8 I can put the following in a pom to execute first
cargo:start then cargo:deploy in the pre-integration-test phase. In
2.0.9, maven executes deploy first, which breaks the build. Declaring
the plugin once and having two  entries in the  doesn't
help.


org.codehaus.cargo
cargo-maven2-plugin


start-container
pre-integration-test

start






org.codehaus.cargo
cargo-maven2-plugin


deploy
pre-integration-test

deploy





**

Shouldn't an entry like


start
deploy


force maven to do start first, then deploy? Is there a way to influence
this - or, what are the rules for execution order of plugins in a phase?

David

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Executing a hook before reading a POM

2008-04-15 Thread Bernhard David
It appears my attachment didn't work. So here's the script once again: 



#!/bin/bash -e

#* %box% Go through all the pom.xml and set the version number (if
present). E.g. =1.1.1-SNAPSHOT= -> =1.1.1= and correct the version of
the parent.
#   * %box% Update the version of all modules to indicate that they
changed.
#  * Remove the =-SNAPSHOT= for modules and plugins that weren't
changed. E.g. 1.6-SNAPSHOT -> 1.6

# make sure you are in right folder
if ! [ -e external ] ; then
echo "Error: Folder 'external' not found. Go to its parent
folder (el4j)!"
exit
fi

echo "Update framework (external and internal)"
el4jCurrent=$(cat external/pom.xml | grep
"" -A 1 | tail -n 1 | tr -d ' \t\r\n' |
sed 's/-SNAPSHOT//')
echo "Current version is $el4jCurrent-SNAPSHOT, OK?"
read dummy
echo "Enter next el4j version number"
read el4jNext

el4jCurrent=$el4jCurrent-SNAPSHOT

echo "Replacing '$el4jCurrent' by '$el4jNext', OK?"
read dummy

echo "Searching for pom.xml files..."


# list pom files
find ./ -name "pom.xml" > pom.files.txt
find ./ -name "site.xml" >> pom.files.txt


# el4j x.y-SNAPSHOT -> x.y #

for i in $(cat pom.files.txt) ; do
if [ $(grep -c "$el4jCurrent" $i) -eq 1 ] ;
then
cat $i | sed "s/$el4jCurrent/$el4jNext/" > $i.new
mv $i.new $i
echo "FOUND $i"
else
echo "- $i"
fi
done

##
# el4j modules: remove -SNAPSHOT #
##
search="external/pom.xml"
if [ -e internal ] ; then
search="$search internal/pom.xml"
fi
for i in $search ; do
cat $i | sed "s/-SNAPSHOT$//" > $i.new
mv $i.new $i
done

echo ""
echo
"###
##"
echo "#Work is not finished yet! Search in all pom.xml and site.xml
files for the String SNAPSHOT.#"
echo "#It's also a good practice to go through the changes this script
made (use svn diff).   #"
echo
"###
##"
echo ""

echo "Searching for SNAPSHOT:"
cat pom.files.txt | xargs grep "SNAPSHOT"

echo ""
echo "Correct these files manually if necessary!"
rm pom.files.txt

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: classpath property

2008-04-15 Thread Bernhard David
Hello,

in a plugin, you can get the classpath like this:

/**
* The project we are dealing with.
* @parameter expression="${project}"
*/
private MavenProject m_project;


List classPath = m_project.getRuntimeClasspathElements();


Greetings,

David

> -Original Message-
> From: Eric White [mailto:[EMAIL PROTECTED] 
> Sent: 15 April 2008 21:46
> To: users@maven.apache.org
> Subject: classpath property
> 
> 
> Is there a plain old maven property equivalent to the antrun
> maven.runtime.classpath reference?
> I need to filter some resources I'm adding to an assembly, 
> and really don't
> want to take the long way around with antrun if I can get 
> there directly.
> Thanks!
> -- 
> View this message in context: 
> http://www.nabble.com/classpath-property-tp16706768s177p16706768.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Executing a hook before reading a POM

2008-04-15 Thread Bernhard David
Hello,

yes, you're right there - you could, as Cynthia mentioned, use 
${env.parentversion} and pass the env variable on the command line or set it as 
an environment variable in the system.

What we do is use a shell script to update the versions every time we make a 
new release - I'll send it as attachment.

 
David



> -Original Message-
> From: Joshua ChaitinPollak [mailto:[EMAIL PROTECTED] 
> Sent: 15 April 2008 19:22
> To: Maven Users List
> Subject: Re: Executing a hook before reading a POM
> 
> In this setup, you still need to refer to the version of the parent  
> pom, right?
> 
> We are just starting to use  multi-module pom, and are 
> realizing that  
> all of our modules are going to need to be updated with the parent- 
> pom's version every time we release a new version. Is there any way  
> around this?
> 
> 
> On Apr 15, 2008, at 7:22 AM, Bernhard David wrote:
> 
> > Hi,
> >
> > what we do is declare all global constants (version numbers 
> etc.) in  
> > one parent pom like this:
> >
> > 
> > 1.0
> > 
> >
> > then in the modules' pom declare it (or a descendent of it) as  
> > . Then you can just write
> >
> > module-xxx
> > ${version.module-xxx}
> >
> > in the actual module pom.
> >
> > Maybe that will help solve your problem.
> >
> > Regards,
> >
> > David
> >
> >> -Original Message-
> >> From: VUB Stefan Seidel [mailto:[EMAIL PROTECTED]
> >> Sent: 15 April 2008 12:30
> >> To: Maven Users List
> >> Subject: Re: Executing a hook before reading a POM
> >>
> >> Hi,
> >>
> >> use
> >>   
> >> myValue
> >>   
> >> if you want to set fixed properties for the build process.
> >>
> >> You may also want to have a look at how to use profiles.
> >>
> >> regards,
> >>
> >> Stefan
> >>
> >> [EMAIL PROTECTED] wrote:
> >>> Hi to all,
> >>>
> >>> I am trying to find out how I can get maven to execute a
> >> hook before it reads the POM file. But it seems that unless
> >> you go in and modify the maven source code, at a user level,
> >> there is nothing to be done. I am trying to execute the hook
> >> since maven doesn't replace variables within the POM. And I
> >> need this information to be statically available within our
> >> internal repositories.
> >>>
> >>> 1. Is there a "smart" way to get maven to execute hooks?
> >>>
> >>> 2. Am I a little far fetched for trying to implement a hook
> >> to do something that Ant could do to pre-process the POM file?
> >>>
> >>> Thanks in advance,
> >>> Fernando
> >>>
> >>>
> >> 
> -
> >>> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>> For additional commands, e-mail: [EMAIL PROTECTED]
> >>>
> >>
> >> -- 
> >> best regards,
> >>
> >> Stefan Seidel
> >> software developer
> >> 
> >> VUB Printmedia GmbH
> >> Chopinstraße 4
> >> D-04103 Leipzig
> >> Germany
> >> tel.+49 (341) 9 60 50 07
> >> fax.+49 (341) 9 60 50 92
> >> mail.   [EMAIL PROTECTED]
> >> web.www.vub.de
> >>
> >> HRB Köln 24015
> >> UStID DE 122 649 251
> >> GF Dr. Achim Preuss Neudorf,
> >> Dr. Christian Preuss Neudorf
> >>
> >> 
> -
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >
> > 
> -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> -- 
> Joshua ChaitinPollak | Software Engineer
> Kiva Systems, Inc., 225 Wildwood Ave, Woburn, MA 01970
> 
> 
> 
> 
> 
> 
> 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

RE: Executing a hook before reading a POM

2008-04-15 Thread Bernhard David
Hi,

what we do is declare all global constants (version numbers etc.) in one parent 
pom like this:


1.0
 

then in the modules' pom declare it (or a descendent of it) as . Then 
you can just write

module-xxx
${version.module-xxx}

in the actual module pom.

Maybe that will help solve your problem.

Regards,

David 

> -Original Message-
> From: VUB Stefan Seidel [mailto:[EMAIL PROTECTED] 
> Sent: 15 April 2008 12:30
> To: Maven Users List
> Subject: Re: Executing a hook before reading a POM
> 
> Hi,
> 
> use
>
>  myValue
>
> if you want to set fixed properties for the build process.
> 
> You may also want to have a look at how to use profiles.
> 
> regards,
> 
> Stefan
> 
> [EMAIL PROTECTED] wrote:
> > Hi to all,
> > 
> > I am trying to find out how I can get maven to execute a 
> hook before it reads the POM file. But it seems that unless 
> you go in and modify the maven source code, at a user level, 
> there is nothing to be done. I am trying to execute the hook 
> since maven doesn't replace variables within the POM. And I 
> need this information to be statically available within our 
> internal repositories.
> > 
> > 1. Is there a "smart" way to get maven to execute hooks?
> > 
> > 2. Am I a little far fetched for trying to implement a hook 
> to do something that Ant could do to pre-process the POM file?
> > 
> > Thanks in advance,
> > Fernando
> > 
> > 
> -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> 
> -- 
> best regards,
> 
> Stefan Seidel
> software developer
> 
> VUB Printmedia GmbH
> Chopinstraße 4
> D-04103 Leipzig
> Germany
> tel.+49 (341) 9 60 50 07
> fax.+49 (341) 9 60 50 92
> mail.   [EMAIL PROTECTED]
> web.www.vub.de
> 
> HRB Köln 24015
> UStID DE 122 649 251
> GF Dr. Achim Preuss Neudorf,
> Dr. Christian Preuss Neudorf
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: filtering resources - switching whole files

2008-04-09 Thread Bernhard David
Hi,

I think this'll do the trick:

make differrent directories like src/main/dev, src/main/prod etc. and
set up the POM:


  
dev

  

  src/main/dev

  



and so on. Then with "mvn -P dev" you choose a profile, and only the
files from that profile will be copied. Any resources you declare
outside of the profiles (regular ) will be copied for all
profiles.

David

> -Original Message-
> From: Nick Stolwijk [mailto:[EMAIL PROTECTED] 
> Sent: 10 April 2008 00:10
> To: Maven Users List
> Subject: Re: filtering resources - switching whole files
> 
> For different config files I often do it with an include. I.e. spring 
> configuration for production, test, dev, make a main 
> applicationContext.xml which includes 
> database-${environment}.xml. Now 
> you can switch config files between builds. (Or at runtime, 
> if you don't 
> filter.
> 
> Hth,
> 
> Nick S.
> 
> Jan Zelenka wrote:
> > Hi,
> > I have different config files for various build targets 
> (dev, test, prod), 
> > but I cannot use standard resource filtering because whole 
> portions of the 
> > files are diferrent, not just simple strings. In Ant I have 
> a copy of the 
> > file for each target and just copy/rename them during 
> build. What would be 
> > the best way to do this in maven? Preferably using profiles 
> to choose 
> > targets.
> >
> > Thank you,
> > Jan
> >  
> >   
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: licenses report

2008-04-09 Thread Bernhard David
Hi,

the first part I can answer - im our pom, we just put


   
  LGPL version 2.1
http://www.gnu.org/licenses/lgpl.txt
   
 


David

> -Original Message-
> From: news [mailto:[EMAIL PROTECTED] On Behalf Of Jan Torben Heuer
> Sent: 09 April 2008 14:57
> To: users@maven.apache.org
> Subject: licenses report
> 
> How can I define my project's license and how can I generate 
> a report of all
> dependencies includeing their license? (plain text or html preferred)
> 
> Jan
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]