You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by qrtt1 <ch...@gmail.com> on 2008/07/31 11:49:47 UTC
how to make archetype resource copy as package structure
Hello, I create an archetype for my project.
there are my archetype.xml
<archetype>
<id>archetype</id>
<sources>
<source>src/main/java/DummyNode.java</source>
</sources>
<testSources>
<source>src/test/java/DummyNodeTest.java</source>
</testSources>
<resources>
<resource>src/main/resources/app-config.xml</resource>
</resources>
</archetype>
My *.java can move to package directory but app-config.xml doesn't
How do I do can make it move to apporiate locations?
--
View this message in context: http://www.nabble.com/how-to-make-archetype-resource-copy-as-package-structure-tp18751132p18751132.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: how to make archetype resource copy as package structure
Posted by qrtt1 <ch...@gmail.com>.
Hi Simone Gianni-2:
I found something interesting that meta-data is needless.
Using archetype:generate will work well, the resources is packaged to
directory automatically.
C:\temp>tree orz
列出資料夾 PATH
磁碟區序列號碼為 08A8-9415
C:\TEMP\ORZ
└─src
├─main
│ ├─java
│ │ └─orz
│ └─resources
│ └─orz
└─test
└─java
└─orz
PS. `orz' is my groupId
--
View this message in context: http://www.nabble.com/how-to-make-archetype-resource-copy-as-package-structure-tp18751132p18757053.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: how to make archetype resource copy as package structure
Posted by Simone Gianni <si...@apache.org>.
Hi,
I was struggling with the same problem just a few minutes ago, and seems
like there is a solution.
Instead of using the archetype.xml file to manage your resources, you
can create a file name "archetype-metadata.xml", where you have more
fine-graned managing of the archetype structure, for example, for your
problem :
<?xml version="1.0" encoding="UTF-8"?>
<*archetype*-descriptor name="basic">
<fileSets>
<fileSet filtered="true" *packaged*="true">
<directory>src/main/java</directory>
<includes>
<include>**/*.java</include>
</includes>
</fileSet>
<fileSet filtered="true" *packaged*="true">
<directory>src/test/java</directory>
<includes>
<include>**/*.java</include>
</includes>
</fileSet>
<fileSet filtered="true" *packaged*="true">
<directory>src/main/*resources*</directory>
<includes>
<include>**/app-config.xml</include>
</includes>
</fileSet>
</fileSets>
</*archetype*-descriptor>
As you can see, the packaged="true" attribute makes Maven put that files
inside the package. I'm trying to make it work right now, not yet
successfully :(. Anyway, it is documented here :
http://maven.apache.org/plugins/maven-archetype-plugin/specification/archetype-metadata.html
Simone
qrtt1 wrote:
> Hello, I create an archetype for my project.
> there are my archetype.xml
>
> <archetype>
> <id>archetype</id>
> <sources>
> <source>src/main/java/DummyNode.java</source>
> </sources>
> <testSources>
> <source>src/test/java/DummyNodeTest.java</source>
> </testSources>
> <resources>
> <resource>src/main/resources/app-config.xml</resource>
> </resources>
> </archetype>
>
> My *.java can move to package directory but app-config.xml doesn't
> How do I do can make it move to apporiate locations?
>
>
--
Simone Gianni
http://www.simonegianni.it/
CEO Semeru s.r.l.
Apache Committer
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org