Re: Parent POM, properties and scm problem

2007-08-06 Thread Jared Bunting
I'm also experiencing this problem.  As discussed here (under Inheritance v.
Aggregation):

http://www.propellors.net/maven/site/pom.html#POM%20Relationships

it appears to make sense in what is called the "aggregation" use case, but
not in the "inheritance" use case.  I'm wondering if there's some way to
simply disable this functionality (maybe setting a property?  don't know...)
to get these url elements to inherit as one would expect - "as is".

If this functionality isn't currently available, and somebody could point me
to the appropriate code, I would be happy to try and write a patch for it...

Thanks,
Jared


Oscar Picasso
> Thu, 02 Aug 2007 06:31:58 -0700
>
> That's exactly what I am doing.
>
> And it works fine except for the problem that I mention in this thread of
> the project artifactId being added to some urls like the scmConnection.
>
> On 8/1/07, Bryan Loofbourrow <[EMAIL PROTECTED]> wrote:
> >
> > I'm wondering if the following would work:
> >
> > - Make your organizational pom project. Don't define any  entries
> > in
> > it.
> > - Have all of your projects depend on it as a parent
> > - Build and install your organizational pom to a central repository
> > accessible to all of your projects.
> >
> > I'm thinking that you can then independently build and deploy your
> > organizational pom by itself, and have your projects use it, from the
> > repository, as a parent for definition purposes, though not build
> > purposes.
> >
> > I'd be interested to know whether this works. It seems useful.
> >
> > -- Bryan
> >
> > -Original Message-
> > From: Oscar Picasso [EMAIL PROTECTED]
> > Sent: Wednesday, August 01, 2007 10:31 AM
> > To: Maven Users List
> > Subject: Re: Parent POM, properties and scm problem
> >
> > The current Maven behaviour is fine for multimodule projects.
> >
> > However I am trying to write a organizational POM that all my projets
> > would
> > inherited and wanted to avoid duplication of the scm section.
> >
> > So in case of independent projects it does not make sense to put all them
> > inside the same trunk.
> >
> > I guess currently I cannot avoid this duplication.
> >
> > On 7/31/07, Eric Redmond <[EMAIL PROTECTED]> wrote:
> > >
> > > Maven does this so that child module's scm can be defined once in the
> > > parent.
> > >
> > > 
> > >   scm:svn:https://url/project/trunk
> > > 
> > >
> > > 
> > >   Child
> > >
> > > Then the Child module's scm url is automatically set as:
> > >
> > > 
> > >   scm:svn:https://url/project/trunk/Child
> > > 
> > >
> > > Which is the convention for a multi-module project.
> > >
> > > If your "Child" project has to be seperate, with it's own trunk, etc. I
> > > would suggest (if svn) using svn:externals to access the child under the
> > > parent project. Since it ownly appends the name on a multi-module
> > project,
> > > I'm trying to figure out how you locally check out your project...
> > perhaps
> > > create a "trunks"-style setup in your version control would be best?
> > >
> > > Eric
> > >
> > > On 7/30/07, Oscar Picasso <[EMAIL PROTECTED]> wrote:
> > > >
> > > > I have also noticed the same behavior with the project url, the sit
> > url
> > > > and
> > > > the scm url even if in the effective the corresponding properties are
> > > > correct (without the artifactId appended).
> > > >
> > > > On 7/30/07, Oscar Picasso <[EMAIL PROTECTED]> wrote:
> > > > >
> > > > > Hi,
> > > > >
> > > > > In the parent POM I have the following:
> > > > > [...]
> > > > >   
> > > > > 
> > > > http://localhost/repos/repo/${groupId}/${artifactId}/trunk 
> > > > 
> > > > > 
> > > > > 
> > > > >   
> > > > >
> > > > >
> > > > >   
> > > > > ${scmConnection}
> > > > > ${scmConnection}
> > > > >   
> > > > > [...]
> > > > >
> > > > > The child POM has nothing expect mandatory elements and the
> > reference
> > > to
> > > > > the parent POM. Both the child and the parent are snapshots. The
> > > parent
> > > > POM
> > > > > has been deployed to the remote repository.
> > > > >
> > > > > When I run mvn help:effective-pom on the child project, I get:
> > > > > [...]
> > > > >   
> > > > > 
> > > > http://localhost/repos/repo/com.opicasso/Child/trunk/Child
> > > > > 
> > > > > 
> > > > > http://localhost/repos/repo/com.opicasso/Child/trunk/Child
> > > > > 
> > > > >   
> > > > > [..]
> > > > >
> > > > > I would have expected:
> > > > > [...]
> > > > >   
> > > > > http://localhost/repos/repo/com.opicasso/Child/trunk
> > > > > 
> > > > > 
> > > > > http://localhost/repos/repo/com.opicasso/Child/trunk
> > > > 
> > > > >   
> > > > > [..]
> > > > >
> > > > > Why does maven happen the child artifactId to the connections? Does
> > > > maven
> > > > > merge the parent scm connections with the children ones ? But in the
> > > > current
> > > > > case the child has no scm connections defined in its pom.

Re: How to set custom Plugin Parameters?

2006-09-01 Thread Jared Bunting

Sounds like the phase thing might point at the problem - say you had two
executions defined.  This is useful if you want to define the same goal (or
different goals) to be run in different phases.  But, just running it from
the command line, how would maven know which one to use?  Following this
logic, it would make sense that only the base plugin configuration, not the
configuration of individual executions, would apply when running the goal
directly from the command line.

Maybe somebody with a bit more knowledge could confirm whether this makes
sense, or I'm way off base?

On 9/1/06, Alexis Midon <[EMAIL PROTECTED]> wrote:


thanks all for your answers, actually the problem as not due to
'protected'
modifier nor to 'expression' attribute.
Something was wrong with my pom.

The command I use is: mvn mygroupId:foobar:copyfile

Configuration was not taken into account when I write:


mygroupId
maven-foobar-plugin


copy:file

copyfile


target
${project.build.directory
}/toto

*.jar


**




  


But everything works fine if we remove the  tag and move
upward
  like:


murex.maven.plugins
maven-production-plugin

target
${project.build.directory
}/toto

*.jar


**


  


I do not really understand what's wrong, is it the lake of  tag
(the
plugin  does not set a default phase)?
Explanations would be very appreciate.

Thanks all,

Alexis


On 8/31/06, Jared Bunting <[EMAIL PROTECTED]> wrote:
>
> Another thought - the guide here talks about using private fields for
mojo
> configuration - i noticed that yours is protected.  It specifically
> mentions
> that setters can be used in place of private fields, but makes no
mention
> of
> protected fields.  Now, while it would make sense to me that the
protected
> field should work, it might be something worth trying...
>
> On 8/31/06, Ovidio Mallo <[EMAIL PROTECTED]> wrote:
> >
> > Hi Alexis,
> >
> > you may try with
> >
> >@parameter expression="${excludes}"
> >
> > in the annotation of your array. I can't test it right now, but I
> > guess this should work.
> >
> > Regards,
> >Ovidio
> >
> > Alexis Midon wrote:
> > > Hi all,
> > >
> > > I'm currently writting a custom plugin, but I've got a problem with
> the
> > > parameter settings.
> > > Here is it:
> > >
> > > My plugin declares a String array as follow:
> > >
> > >
> > >/**
> > > * The collection of exclude patterns to be applied on the
> > > sourceDirectory
> > > *
> > > * @parameter
> > > */
> > >protected String[] excludes;
> > >
> > >
> > > In the pom file I add the following tag:
> > >
> > >
> > > ...
> > >
> > > ...
> > >
> > >*.jar
> > >**/.foo
> > >
> > >
> > >
> > >
> > >
> > > Unfortunately the String array remains null :(
> > > Where's the hell is the bug please?!
> > >
> > > Thanks a lot for your help,
> > >
> > > Alexis
> > >
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>




Re: [M2] org.apache.maven.plugins: includes not additive?

2006-08-31 Thread Jared Bunting

I know that maven doesn't use ant as of 2.0, but I would assume that the
includes/excludes concepts are inherited from the ant fileset.  The way that
works, ALL files are included, unless one or more include elements are
specified.  If they are specified, than that is your base include.  I'm also
assuming that the compile plugin has some default excludes (.cvs, .svn,
etc).  But, I'm with Wendy, why not just move the properties file to a
resources directory?

On 8/31/06, Wendy Smoak <[EMAIL PROTECTED]> wrote:


On 8/31/06, Andreas Guther <[EMAIL PROTECTED]> wrote:

> To include files to the org.apache.maven.plugins compile process one has
> to specify those files in the configuration/includes section.
...
> Is this a general behavior in Maven with the includes section or is this
> something specific to the compiler plug-in?

I think that's how it always works.  In particular I've noticed that
if you have any includes, then you have to also re-state the default
of src/main/resources if you also want that included.  (It can be
important during a conversion when you may have things in both
places.)

Of course, moving all non-Java files to src/main/resources fixes this. :)

--
Wendy

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




Re: How to set custom Plugin Parameters?

2006-08-31 Thread Jared Bunting

Another thought - the guide here talks about using private fields for mojo
configuration - i noticed that yours is protected.  It specifically mentions
that setters can be used in place of private fields, but makes no mention of
protected fields.  Now, while it would make sense to me that the protected
field should work, it might be something worth trying...

On 8/31/06, Ovidio Mallo <[EMAIL PROTECTED]> wrote:


Hi Alexis,

you may try with

   @parameter expression="${excludes}"

in the annotation of your array. I can't test it right now, but I
guess this should work.

Regards,
   Ovidio

Alexis Midon wrote:
> Hi all,
>
> I'm currently writting a custom plugin, but I've got a problem with the
> parameter settings.
> Here is it:
>
> My plugin declares a String array as follow:
>
>
>/**
> * The collection of exclude patterns to be applied on the
> sourceDirectory
> *
> * @parameter
> */
>protected String[] excludes;
>
>
> In the pom file I add the following tag:
>
>
> ...
>
> ...
>
>*.jar
>**/.foo
>
>
>
>
>
> Unfortunately the String array remains null :(
> Where's the hell is the bug please?!
>
> Thanks a lot for your help,
>
> Alexis
>


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




Re: Packaging 'ear' is invalid. Aggregator projects require 'pom' as packaging

2006-08-31 Thread Jared Bunting

From what I've been able to tell in the past, it seems that the rule is if

your project has the  element, then it has to be of packaging type
"pom".  It looks like you have an ear project that you want to include an
ejbModule and a warModule - I have done this in the past by  having a parent
pom, and the ear file essentially being a sibling of my other modules.  I
can still specify the ejbModule and webModule configurations in the ear.
That make sense?

On 8/31/06, Jeff Mutonho <[EMAIL PROTECTED]> wrote:


I'm getting the following error when I try to build an ear file.

[INFO] Scanning for projects...
[INFO]

[ERROR] FATAL ERROR
[INFO]

[INFO] Error building POM (may not be this project's POM).


Project ID: za.co.telkom.eportal:eportal-ear
POM Location: D:\MAVEN-WORK\eportal-ear\pom.xml
Validation Messages:

[0]  Packaging 'ear' is invalid. Aggregator projects require 'pom' as
packag
ing.


Reason: Failed to validate POM


[INFO]

[DEBUG] Trace
org.apache.maven.reactor.MavenExecutionException: Failed to validate POM
at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java
:365)

--
The pom that causing this is shown below:


  4.0.0
  
   za.co.pragmaticus.eportal
   pragmaticus-eportal
   1.0.0
  
  eportal-ear
  pragmaticus ePortal
  ear
  1.0.0
  Eportal Ear
  
 
  eportal-ejb
  
true
  
  
eportal-services
eportal-messaging
eportal-messaging-support
eportal-domain
eportal-exceptions
  

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

  Eportal EJB Module
  Eportal EJB Module
  1.0.0
  

  za.co.pragmaticus.eportal
  eportal-messaging

  
  eportal-messaging

   
  



  eportal-war
  
true

  enableCiProfile
  true

  
  
   eportal-services
eportal-webservices
eportal-domain
eportal-exceptions
eportal
  
  
 
   
org.apache.maven.plugins
maven-ear-plugin

  Eportal Web
  Eportal Web
  1.0.0
  

  za.co.pragmaticus.eportal
  eportal
  /eportal

  

   
  


  




Jeff  Mutonho

GoogleTalk : ejbengine
Skype: ejbengine
Registered Linux user number 366042




Re: Specifying a pre-existing application.xml

2006-08-31 Thread Jared Bunting


The option I can see that seems to relate to my issue is the
"generateApplicationXml" ,
which one can set to true, to turn off generation of the
application.xml.Butthen how do
I tell the plugin where the pre-existing application.xml file is
located?I'm
looking for something
similar to Maven1's maven.ear.appxml=



http://maven.apache.org/plugins/maven-ear-plugin/ear-mojo.html

The first parameter in there seems to answer this question...

On 8/31/06, Jeff Mutonho <[EMAIL PROTECTED]> wrote:


On 8/31/06, Alexandre Touret <[EMAIL PROTECTED]> wrote:
>
> Hello
> Jeff Mutonho wrote:
> > Q1) How do I specify a pre-existing application.xml to the
> > maven-ear-plugin  ?
> Look at the official documentation of the ear plugin. It seems to have
> one property to set during the ear:generate-application.xml execution
>
>
http://maven.apache.org/plugins/maven-ear-plugin/generate-application-xml-mojo.html
> >


The option I can see that seems to relate to my issue is the
"generateApplicationXml" ,
which one can set to true, to turn off generation of the
application.xml.Butthen how do
I tell the plugin where the pre-existing application.xml file is
located?I'm
looking for something
similar to Maven1's maven.ear.appxml=





> If I have understood, I suppose you ll find the solution in the howto
> http://maven.apache.org/plugins/maven-ear-plugin/howto.html


You're right, this can be done by customizing the name of the file being
added to the ear file.



Kind regards
--


Jeff  Mutonho

GoogleTalk : ejbengine
Skype: ejbengine
Registered Linux user number 366042




Re: Re: mvn2: war packaging

2006-08-31 Thread Jared Bunting

I might be missing what you're trying to do here, and it seems to me that
creating a multi-module project, as suggested, would be the best way to go
about this.  However, what if you bound your source generation to the
"generate-sources" phase.  I'm not sure of how it would be done in ant, but
I know that you can then "add" the generated sources to the list of files to
compile in the compile phase and then they should be included in your
WEB-INF/classes directory in the war file. They won't be in a jar, but
they'll be in your war.

(and you can DEFINITELY guarantee that they will be generated before the war
is created - it seems that they are getting generated after the war because
you are binding to the packaging phase, which is meant to actually package,
and plugin order within a phase is undefined...)

I found an article that mentions doing this with a hibernate ant task here:

http://www.onjava.com/pub/a/onjava/2005/12/14/hibernate-class-generation-with-hbm2java.html?page=4

Maybe this will be helpful?



On 8/31/06, chua <[EMAIL PROTECTED]> wrote:



Hi!

I had more or less the same problem as you.
One of the solutions is to create a project based on modules.

You just have to create a parent pom with:


module_for_jar
module_for_war


Then, you have to create two subfolders with the same name as the modules
and with the m2 folder structure, each one with its own pom.

Now you just have to have in one pom a jar packaging, and in the other a
war
packaging.

The last thing to do is to include the dependency of the jar created in
the
jar module in the pom.xml of the war module.

That´s one solution and it works to me.

Be sure your jar module is declared first, and second, declare your war
module.

I hope I had helped you

--
View this message in context:
http://www.nabble.com/mvn2%3A-war-packaging-tf2186390.html#a6078489
Sent from the Maven - Users forum at Nabble.com.


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




Re: Spring Framework Dependencies

2006-08-30 Thread Jared Bunting

I have attached a zip containing poms and checksums for 1.2.8 to the ticket
you mention.  What else do I need to do to get these uploaded to ibiblio?

Thanks,
Jared

On 8/30/06, Carlos Sanchez <[EMAIL PROTECTED]> wrote:


any questions about spring and their poms must be asked there, or you
provide the poms to be uploaded to ibiblio.

On 8/30/06, Pin Ngee Koh <[EMAIL PROTECTED]> wrote:
> Do I download repository from http://www.ibiblio.org/maven2 and unzip
> spring-pom-1.2.8.zip over it?
> Is there a reason why we are not keeping http://www.ibiblio.org/maven2
>  update to date?
>
> On 8/30/06, Carlos Sanchez <[EMAIL PROTECTED]> wrote:
> > see http://opensource.atlassian.com/projects/spring/browse/SPR-1484
> >
> > On 8/30/06, Pin Ngee Koh <[EMAIL PROTECTED]> wrote:
> > > I have many artifacts which dependent on spring.
> > > What's the best way to declare dependency on Spring - specifically
1.2.8?
> > > I can think of the following ways:
> > >
> > > (1) Declare a parent pom with the right dependencies to spring-core,
> > > spring-orm, ...etc. And have each project pom inherit it
> > >
> > > Issue: some pom does not have the right transtive dependency. E.g.
> > > http://www.ibiblio.org/maven2/org/springframework/spring-core/1.2.8/
> > > does not have dependency declared for commons-logging.
> > >
> > > (2) Declare dependency on org.springframework:spring:1.2.8. But it
> > > does not include the right transitive dependencies
> > >
> > > Somehow, http://www.ibiblio.org/maven2 does not seems to have the
> > > complete dependencies defined. Am I missing something here?
> > >
> > >  /
> > > c=-oo
> > >   \  o
> > >
> > >
-
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> >
> > --
> > I could give you my word as a Spaniard.
> > No good. I've known too many Spaniards.
> > -- The Princess Bride
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
>  /
> c=-oo
>   \  o
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
I could give you my word as a Spaniard.
No good. I've known too many Spaniards.
 -- The Princess Bride

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