Hi all,
I am trying to convince my group here to start using Maven instead of
Ant. I am preparing a demonstration for them and in the process, I am
trying to create my own archetype. I've done it before but this time I
am stuck at something which I've no idea how to solve.
I want the project directory structure to be
- bin
-- file1
-- file2.sh
-- file3.sh
- src
-- main
-- java
-- file.java
+ site
+ test
So I've all that setup in archetype-resources folder and here is my
archetype.xml within META-INF directory
<archetype>
<!-- this id tag should be same as the artifactId in the archetype
pom.xml-->
<id>archetype_id</id>
<sources>
<source>src/main/java/App.java</source>
</sources>
<testSources>
<source>src/test/java/AppTest.java</source>
</testSources>
<resources>
<resource>bin/file1</resource>
<resource>bin/file2.sh</resource>
<resource>bin/file3.sh</resource>
</resources>
</archetype>
The amount of problems I am encountering with something simple as this,
I've a feeling that this resources folder is supposed to do something
other then what I am trying to do.
Q1- How do I include the bin folder where I want it?
Main problem I am encountering is I haven't been able to figure out how
to include the entire directory and its files without specifying each
file the way I've shown above and ** doesn't work and neither does
specifying a directory and include tag
ANOTHER weird problem is that when Maven encounters that file2.sh, it
for some reason tries to open it and parse it because I get an exception
like this.... Parser Eception:
archetype-resources/bin/file2.sh:org.apache.velocity.runtime.parser.Pars
eException: Encountered .....
Q2- Why is Maven trying to parse my shell script?
I would appreciate any help you can provide, if I am unable to prove to
my group how useful Maven is (this is the only snag left), I am afraid
we'll keep using ANT