You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Lachlan Deck <la...@gmail.com> on 2009/04/22 10:25:23 UTC
going mad :-) testing archetype
just need a sanity check here :-)
I'm trying to test some updates to an archetype. So I've edited a
particular file, for example, such as the following:
$ emacs my-archetype/src/main/resources/archetype-resources/src/main/
resources/Properties
I've cleaned my local repo of the artifacts in the same groupId and
then re-installed it:
$ mvn -o clean install
But then when I generate a project from the archetype the adjustments
I've made don't appear.
$ cd ~/
$ mkdir test && cd test
$ mvn -o archetype:generate -DarchetypeCatalog=local
<...>
Choose archetype:
1: local -> my-archetype (Yada yada)
<...>
Choose a number: (1/2/3/4): 1
Define value for groupId: : my.grouping
Define value for artifactId: : myapp
Define value for version: 1.0-SNAPSHOT: :
Define value for package: my.grouping: :
Confirm properties configuration:
<...>
Y: :
[INFO]
------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 37 seconds
[INFO] Finished at: Wed Apr 22 17:57:04 EST 2009
[INFO] Final Memory: 8M/15M
[INFO]
------------------------------------------------------------------------
$
$ less myapp/src/main/resources/Properties --> still doesn't contain
the text I've added :-/
So digging deeper:
$ cp ~/.m2/repository/my/groupId/my-archetype/2.0.18-SNAPSHOT/my-
archetype-2.0.18-SNAPSHOT.jar .
$ mv my-archetype-2.0.18-SNAPSHOT.jar my-archetype-2.0.18-SNAPSHOT.zip
$ unzip my-archetype-2.0.18-SNAPSHOT.zip
$ less archetype-resources/src/main/resources/Properties --> looks good!
There's gotta be something obvious I'm missing ... any clues? Is there
some cache I've overlooked? :-)
Thanks.
Is maven caching the old versions (that I've deleted) somewhere else?
How do I ensure that I'm testing what I've installed?
Thanks.
with regards,
--
Lachlan Deck
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: going mad :-) testing archetype
Posted by Raphaël Piéroni <ra...@gmail.com>.
Hi,
The filtering of the files in the archetype plugin is done using Velocity.
This means that ech filtered file is a Velocity template.
# is a comment char in velocity.
If your file has no filtering to be done on it (don't use properties asked
by the plugin), consider putting it in a non-filtered fileset in your
archetype-metadata.
Another option could be to create your archetype from a sample project, see
what is automatically done then hack the created archetype where the
automatic creation don't fit your needs.
Regards,
Raphaël
2009/4/22 Lachlan Deck <la...@gmail.com>
> On 22/04/2009, at 7:15 PM, Nick Stolwijk wrote:
>
> Could you try it with the debug option (-X). Maybe that shows what jar
>> file gets extracted.
>>
>
> I just identified the problem. In a properties file I had the following in
> the archetype:
>
> ##########################
> # Some section heading
> ##########################
> some.java.property = foo
>
> And in the generated project the '##################' were getting
> stripped.
>
> Not sure why. Is this documented somewhere?
> (These were the only lines I'd added. By adding a bogus java property I see
> that the file is certainly being used.)
>
>
> with regards,
> --
>
> Lachlan Deck
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
Re: going mad :-) testing archetype
Posted by Lachlan Deck <la...@gmail.com>.
On 22/04/2009, at 7:15 PM, Nick Stolwijk wrote:
> Could you try it with the debug option (-X). Maybe that shows what jar
> file gets extracted.
I just identified the problem. In a properties file I had the
following in the archetype:
##########################
# Some section heading
##########################
some.java.property = foo
And in the generated project the '##################' were getting
stripped.
Not sure why. Is this documented somewhere?
(These were the only lines I'd added. By adding a bogus java property
I see that the file is certainly being used.)
with regards,
--
Lachlan Deck
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: going mad :-) testing archetype
Posted by Nick Stolwijk <ni...@gmail.com>.
Could you try it with the debug option (-X). Maybe that shows what jar
file gets extracted.
Hth,
Nick Stolwijk
~Java Developer~
Iprofs BV.
Claus Sluterweg 125
2012 WS Haarlem
www.iprofs.nl
On Wed, Apr 22, 2009 at 10:45 AM, Lachlan Deck <la...@gmail.com> wrote:
> On 22/04/2009, at 6:27 PM, Nick Stolwijk wrote:
>
>> Are there any other version of your archetype in
>> ~/.m2/repository/my/groupId/my-archetype?
>
> No. I deleted the dir prior to installing.
>
>> With regards,
>>
>> Nick Stolwijk
>> ~Java Developer~
>>
>> Iprofs BV.
>> Claus Sluterweg 125
>> 2012 WS Haarlem
>> www.iprofs.nl
>>
>>
>>
>> On Wed, Apr 22, 2009 at 10:25 AM, Lachlan Deck <la...@gmail.com>
>> wrote:
>>>
>>> ~/.m2/repository/my/groupId/my-archetype
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>
> with regards,
> --
>
> Lachlan Deck
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: going mad :-) testing archetype
Posted by Lachlan Deck <la...@gmail.com>.
On 22/04/2009, at 6:27 PM, Nick Stolwijk wrote:
> Are there any other version of your archetype in
> ~/.m2/repository/my/groupId/my-archetype?
No. I deleted the dir prior to installing.
> With regards,
>
> Nick Stolwijk
> ~Java Developer~
>
> Iprofs BV.
> Claus Sluterweg 125
> 2012 WS Haarlem
> www.iprofs.nl
>
>
>
> On Wed, Apr 22, 2009 at 10:25 AM, Lachlan Deck
> <la...@gmail.com> wrote:
>> ~/.m2/repository/my/groupId/my-archetype
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
with regards,
--
Lachlan Deck
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: going mad :-) testing archetype
Posted by Nick Stolwijk <ni...@gmail.com>.
Are there any other version of your archetype in
~/.m2/repository/my/groupId/my-archetype?
With regards,
Nick Stolwijk
~Java Developer~
Iprofs BV.
Claus Sluterweg 125
2012 WS Haarlem
www.iprofs.nl
On Wed, Apr 22, 2009 at 10:25 AM, Lachlan Deck <la...@gmail.com> wrote:
> ~/.m2/repository/my/groupId/my-archetype
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: going mad :-) testing archetype
Posted by Lachlan Deck <la...@gmail.com>.
On 22/04/2009, at 6:35 PM, William Ghelfi wrote:
> On Wed, Apr 22, 2009 at 10:25 AM, Lachlan Deck
> <la...@gmail.com> wrote:
>> $ cd ~/
>> $ mkdir test && cd test
>> $ mvn -o archetype:generate -DarchetypeCatalog=local
>> <...>
>> Choose archetype:
>> 1: local -> my-archetype (Yada yada)
>> <...>
>> Choose a number: (1/2/3/4): 1
>> Define value for groupId: : my.grouping
>> Define value for artifactId: : myapp
>> Define value for version: 1.0-SNAPSHOT: :
>> Define value for package: my.grouping: :
>> Confirm properties configuration:
>> <...>
>> Y: :
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] BUILD SUCCESSFUL
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Total time: 37 seconds
>> [INFO] Finished at: Wed Apr 22 17:57:04 EST 2009
>> [INFO] Final Memory: 8M/15M
>> [INFO]
>> ------------------------------------------------------------------------
>> $
>> $ less myapp/src/main/resources/Properties --> still doesn't
>> contain the
>> text I've added :-/
>
> Sorry for the question...
Not at all...
> Did you remember to create a new app using
> the new archetype, and then checked the new app?
That's what the output above shows. i.e., me creating a new app after
having installed the archetype.
Quite strange.
with regards,
--
Lachlan Deck
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: going mad :-) testing archetype
Posted by William Ghelfi <w....@agiletec.it>.
On Wed, Apr 22, 2009 at 10:25 AM, Lachlan Deck <la...@gmail.com> wrote:
> $ cd ~/
> $ mkdir test && cd test
> $ mvn -o archetype:generate -DarchetypeCatalog=local
> <...>
> Choose archetype:
> 1: local -> my-archetype (Yada yada)
> <...>
> Choose a number: (1/2/3/4): 1
> Define value for groupId: : my.grouping
> Define value for artifactId: : myapp
> Define value for version: 1.0-SNAPSHOT: :
> Define value for package: my.grouping: :
> Confirm properties configuration:
> <...>
> Y: :
> [INFO]
> ------------------------------------------------------------------------
> [INFO] BUILD SUCCESSFUL
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 37 seconds
> [INFO] Finished at: Wed Apr 22 17:57:04 EST 2009
> [INFO] Final Memory: 8M/15M
> [INFO]
> ------------------------------------------------------------------------
> $
> $ less myapp/src/main/resources/Properties --> still doesn't contain the
> text I've added :-/
>
Sorry for the question... Did you remember to create a new app using
the new archetype, and then checked the new app?
William
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org