maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Saritha SV <saritha.ma...@gmail.com>
Subject Re: Referencing properties in archetype-metadata.xml
Date Mon, 10 Aug 2009 11:04:15 GMT
The variable properties are considered  invalid reference  in
archetype-metadata.xml  ..
so one way is to include <requiredProperty key="earname"/> in
archetype-metadata.xml  ..
and the ${earname} can be  referenced in properties  file (usually under
src/main/resources) in the project ..
http://maven.apache.org/guides/getting-started/index.html#How_do_I_filter_resource_files
has some egs for including reference in properties file .

Thanks
Saritha SV

On Thu, Aug 6, 2009 at 3:56 PM, Xenofon Papadopoulos <xpapad@gmail.com>wrote:

> I have already seen the file. However I understood "enable not to ask" as
> an
> option, whose behavior would be something like:
>
> Define value for context-root [default-value]:
>
> I guess 'enable not to ask' means 'enforce not to ask' :)
>
> Also what about the substitution? Is it impossible to have access to the
> default properties (${artifactId} etc) or previous defined properties in
> subsequent <defaultValue> ?
>
>
> On Thu, Aug 6, 2009 at 12:04 PM, Saritha SV <saritha.maven@gmail.com>
> wrote:
>
> > Please see configurations used in archetype-metadata.xml in :
> >
> >
> http://maven.apache.org/plugins/maven-archetype-plugin/specification/archetype-metadata.html
> >
> > When  additional properties are defined that must be valued before the
> file
> > generation. The additional properties can be provided with default
> values,
> > which enable not to ask the user for there values.
> >
> > So here the value for context-root will not be asked since a default
> value
> > is provided ..
> >
> > Thanks
> > Saritha SV
> >
> >
> >
> > On Thu, Aug 6, 2009 at 12:06 PM, Xenofon Papadopoulos <xpapad@gmail.com
> > >wrote:
> >
> > > Hello, I'm using trying to create an archetype, and I want to use some
> > > properties. However <defaultValue> doesn't reference the included
> > property
> > > if it's already define, as I thought would be the norm. Here's an
> > example:
> > >
> > > <?xml version="1.0" encoding="UTF-8"?>
> > > <archetype-descriptor name="basic">
> > >  <fileSets>
> > >        [...]
> > >  </fileSets>
> > >
> > >  <requiredProperties>
> > >    <requiredProperty key="earname"/>
> > >    <requiredProperty key="context-root">
> > >      <defaultValue>${earname}</defaultValue>
> > >    </requiredProperty>
> > >  </requiredProperties>
> > > </archetype-descriptor>
> > >
> > > When I generate this project, I am asked for earname, but never for
> > > context-root, and inside my project files ${context-root} will explode
> to
> > > the ${earname} literal.
> > > Any ideas?
> > >
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message