You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Moritz Petersen <mo...@mac.com> on 2003/07/27 12:52:16 UTC
Problem with beta-10 and java:jar-resources again
This was discussed before, but the solution did not fit my problem.
The resources are not copied to the target/classes directory.
When I run maven -X java:jar-resources, I notice, that
-----------%<-------------
[DEBUG] Adding reference: maven.jar.resources.set -> patternSet{
includes: [] excludes: [] }
----------->%-------------
there are no includes, but my project.xml has some defined:
-----------%<-------------
<build>
<sourceDirectory>src/java</sourceDirectory>
<unitTestSourceDirectory>src/test/java</unitTestSourceDirectory>
<resources>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
</resources>
</build>
----------->%-------------
and the src/java directory contains the files
log4j.properties
application.xml
Can anyone tell me, why this doesn't work and what I have to do to make
it work? Thank you,
-Mo.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Problem with beta-10 and java:jar-resources again
Posted by Incze Lajos <in...@mail.matav.hu>.
> <resources>
> <directory>...</directory>
> <includes>
> <include>
> ...
> </include>
> </includes>
> </resources>
>
> (the <resource> element is missing).
>
> That was the problem.
Allways consult the project definition xsd file at $MAVEN_HOME. It is
(more) update (OK, mostly) than th docs.
incze
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Problem with beta-10 and java:jar-resources again
Posted by Moritz Petersen <mo...@mac.com>.
Hi Michael,
Am Sonntag, 27.07.03, um 13:10 Uhr (Europe/Berlin) schrieb Michal
Maczka:
> 1. Don't keep your resources in src/java
Why not? It's what Eclipse expects and automatically puts into the
classpath...
> 2. Do something like:
Ah! That's the problem. The documentation is not correct. The
<resources> tag is described at (at least) two pages:
http://maven.apache.org/start/integrate.html
describes
<resources>
<includes>
<include>
...
</include>
</includes>
</resources>
(the <resource> (singular) and <directory> element is missing)
and
http://maven.apache.org/reference/project-descriptor.html#resources
describes
<resources>
<directory>...</directory>
<includes>
<include>
...
</include>
</includes>
</resources>
(the <resource> element is missing).
That was the problem.
>
> <!-- J A R R E S O U R C E S -->
> <!-- Resources that are packaged up inside the JAR file -->
> <resources>
> <resource>
> <directory>${basedir}/src/resources/messages</directory>
> <targetPath>com/xxx/yyy</targetPath>
> <includes>
> <include>Messages*.properties</include>
> </includes>
> </resource>
>
> <resource>
> <directory>${basedir}/src/resources/logging</directory>
> <includes>
> <include>log4j.properties</include>
> </includes>
> </resource>
> </resources>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
RE: Problem with beta-10 and java:jar-resources again
Posted by Michal Maczka <mm...@interia.pl>.
> -----Original Message-----
> From: Moritz Petersen [mailto:moritzpetersen@mac.com]
> Sent: Sunday, July 27, 2003 12:52 PM
> To: users@maven.apache.org
> Subject: Problem with beta-10 and java:jar-resources again
>
>
> This was discussed before, but the solution did not fit my problem.
>
> The resources are not copied to the target/classes directory.
>
> When I run maven -X java:jar-resources, I notice, that
>
> -----------%<-------------
>
> [DEBUG] Adding reference: maven.jar.resources.set -> patternSet{
> includes: [] excludes: [] }
>
> ----------->%-------------
>
> there are no includes, but my project.xml has some defined:
>
> -----------%<-------------
>
> <build>
> <sourceDirectory>src/java</sourceDirectory>
> <unitTestSourceDirectory>src/test/java</unitTestSourceDirectory>
> <resources>
> <includes>
> <include>**/*.properties</include>
> <include>**/*.xml</include>
> </includes>
> </resources>
> </build>
>
> ----------->%-------------
>
> and the src/java directory contains the files
>
> log4j.properties
> application.xml
>
> Can anyone tell me, why this doesn't work and what I have to do to make
> it work? Thank you,
>
>
> -Mo.
>
1. Don't keep your resources in src/java
2. Do something like:
<!-- J A R R E S O U R C E S -->
<!-- Resources that are packaged up inside the JAR file -->
<resources>
<resource>
<directory>${basedir}/src/resources/messages</directory>
<targetPath>com/xxx/yyy</targetPath>
<includes>
<include>Messages*.properties</include>
</includes>
</resource>
<resource>
<directory>${basedir}/src/resources/logging</directory>
<includes>
<include>log4j.properties</include>
</includes>
</resource>
</resources>
Michal
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org