You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by jiangshachina <ji...@gmail.com> on 2006/11/07 05:18:53 UTC
Why don't Overriding the default destination directory of a web
resource?
Hello,
I want to add some resource files into sub-directory of WAR/WEB-INF,
I'm using following scripts,
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.0.1</version>
<configuration>
<webappDirectory>src/webapp</webappDirectory>
<webResources>
<resource>
<directory>src/config/app</directory>
<targetPath>WEB-INF/app</targetPath>
</resource>
</webResources>
</configuration>
</plugin>
</plugins>
</build>
But the plugin doesn't comply with my mind.
a cup of Java, cheers!
Sha Jiang
--
View this message in context: http://www.nabble.com/Why-don%27t-Overriding-the-default-destination-directory-of-a-web-resource--tf2586714s177.html#a7212374
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: Why don't Overriding the default destination directory of a web
resource?
Posted by jiangshachina <ji...@gmail.com>.
> then run "mvn package", the files under directory src/config will be copied
into WAR root.
> src/config isn't standard directory, why Maven can recognize it?
> Maven see the directory as what?
The problem disappeared, but I still don't find accurate reason of the
problem.
May be relative to Eclipse, because I used "mvn eclipse:eclipse" to create
Eclipse project.
Maybe I didn't clean the content of the project firstly.
Maybe... I don't know.
What only I can make sure is I set some things wrong..
a cup of Java, cheers!
Sha Jiang
jiangshachina wrote:
>
> Another,
> I'm using customized directory layout.
> <build>
> <finalName>webapp</finalName>
> <directory>target</directory>
>
> <sourceDirectory>src/java</sourceDirectory>
> <outputDirectory>target/classes</outputDirectory>
> <resources>
> <resource>
> <directory>src/resources</directory>
> </resource>
> </resources>
>
> <testSourceDirectory>src/test/java</testSourceDirectory>
> <testOutputDirectory>target/test-classes</testOutputDirectory>
> <testResources>
> <testResource>
> <directory>src/test/resources</directory>
> </testResource>
> </testResources>
>
> <plugins>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-war-plugin</artifactId>
> <version>2.0.1</version>
> <configuration>
> <webappDirectory>src/webapp</webappDirectory>
> </configuration>
> </plugin>
> </plugins>
> </build>
> then run "mvn package", the files under directory src/config will be
> copied into WAR root.
> src/config isn't standard directory, why Maven can recognize it?
> Maven see the directory as what?
>
> a cup of Java, cheers!
> Sha Jiang
>
>
> jiangshachina wrote:
>>
>> Oh,
>> I just found that webResources/resource may don't work at 2.0.1, it's 2.1
>> feature.
>> please see,
>> http://www.nabble.com/Re%3A-incorrect-war-file-structure-p5717762s177.html
>>
>> Then how can I achieve the goal without maven-war-plugin 2.1-SNAPSHOT?
>>
>> a cup of Java, cheers!
>> Sha Jiang
>>
>>
>> jiangshachina wrote:
>>>
>>> Hello,
>>> I want to add some resource files into sub-directory of WAR/WEB-INF,
>>> I'm using following scripts,
>>> <build>
>>> <plugins>
>>> <plugin>
>>> <groupId>org.apache.maven.plugins</groupId>
>>> <artifactId>maven-war-plugin</artifactId>
>>> <version>2.0.1</version>
>>> <configuration>
>>> <webappDirectory>src/webapp</webappDirectory>
>>> <webResources>
>>> <resource>
>>> <directory>src/config/app</directory>
>>> <targetPath>WEB-INF/app</targetPath>
>>> </resource>
>>> </webResources>
>>> </configuration>
>>> </plugin>
>>> </plugins>
>>> </build>
>>> But the plugin doesn't comply with my mind.
>>>
>>> a cup of Java, cheers!
>>> Sha Jiang
>>>
>>
>>
>
>
--
View this message in context: http://www.nabble.com/Why-don%27t-Overriding-the-default-destination-directory-of-a-web-resource--tf2586714s177.html#a7234813
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: Why don't Overriding the default destination directory of a web
resource?
Posted by jiangshachina <ji...@gmail.com>.
Another,
I'm using customized directory layout.
<build>
<finalName>webapp</finalName>
<directory>target</directory>
<sourceDirectory>src/java</sourceDirectory>
<outputDirectory>target/classes</outputDirectory>
<resources>
<resource>
<directory>src/resources</directory>
</resource>
</resources>
<testSourceDirectory>src/test/java</testSourceDirectory>
<testOutputDirectory>target/test-classes</testOutputDirectory>
<testResources>
<testResource>
<directory>src/test/resources</directory>
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.0.1</version>
<configuration>
<webappDirectory>src/webapp</webappDirectory>
</configuration>
</plugin>
</plugins>
</build>
then run "mvn package", the files under directory src/config will be copied
into WAR root.
src/config isn't standard directory, why Maven can recognize it?
Maven see the directory as what?
a cup of Java, cheers!
Sha Jiang
jiangshachina wrote:
>
> Oh,
> I just found that webResources/resource may don't work at 2.0.1, it's 2.1
> feature.
> please see,
> http://www.nabble.com/Re%3A-incorrect-war-file-structure-p5717762s177.html
>
> Then how can I achieve the goal without maven-war-plugin 2.1-SNAPSHOT?
>
> a cup of Java, cheers!
> Sha Jiang
>
>
> jiangshachina wrote:
>>
>> Hello,
>> I want to add some resource files into sub-directory of WAR/WEB-INF,
>> I'm using following scripts,
>> <build>
>> <plugins>
>> <plugin>
>> <groupId>org.apache.maven.plugins</groupId>
>> <artifactId>maven-war-plugin</artifactId>
>> <version>2.0.1</version>
>> <configuration>
>> <webappDirectory>src/webapp</webappDirectory>
>> <webResources>
>> <resource>
>> <directory>src/config/app</directory>
>> <targetPath>WEB-INF/app</targetPath>
>> </resource>
>> </webResources>
>> </configuration>
>> </plugin>
>> </plugins>
>> </build>
>> But the plugin doesn't comply with my mind.
>>
>> a cup of Java, cheers!
>> Sha Jiang
>>
>
>
--
View this message in context: http://www.nabble.com/Why-don%27t-Overriding-the-default-destination-directory-of-a-web-resource--tf2586714s177.html#a7212593
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: Why don't Overriding the default destination directory of a web
resource?
Posted by jiangshachina <ji...@gmail.com>.
Oh,
I just found that webResources/resource may don't work at 2.0.1, it's 2.1
feature.
please see,
http://www.nabble.com/Re%3A-incorrect-war-file-structure-p5717762s177.html
Then how can I achieve the goal without maven-war-plugin 2.1-SNAPSHOT?
a cup of Java, cheers!
Sha Jiang
jiangshachina wrote:
>
> Hello,
> I want to add some resource files into sub-directory of WAR/WEB-INF,
> I'm using following scripts,
> <build>
> <plugins>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-war-plugin</artifactId>
> <version>2.0.1</version>
> <configuration>
> <webappDirectory>src/webapp</webappDirectory>
> <webResources>
> <resource>
> <directory>src/config/app</directory>
> <targetPath>WEB-INF/app</targetPath>
> </resource>
> </webResources>
> </configuration>
> </plugin>
> </plugins>
> </build>
> But the plugin doesn't comply with my mind.
>
> a cup of Java, cheers!
> Sha Jiang
>
--
View this message in context: http://www.nabble.com/Why-don%27t-Overriding-the-default-destination-directory-of-a-web-resource--tf2586714s177.html#a7212451
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: Why don't Overriding the default destination directory of a web
resource?
Posted by jiangshachina <ji...@gmail.com>.
Hi Max,
You pointed out the very point :D
But I think requirements are various.
Regardless of the "strange" requirement, we shall view the problem as a
trouble a user encountered.
And I think the trouble is very strange.
Although finally the trouble due to myself(but Maven, I'm sure of that), I
wish other friends can help me.
That helps Maven and other friends, too.
Thanks!
a cup of Java, cheers!
Sha Jiang
Max Cooper wrote:
>
> Why don't you just put the files in src/webapp/WEB-INF/app, instead of
> src/config/app? That would solve your problem, with a minimum of fuss.
>
> -Max
>
> On Mon, 2006-11-06 at 20:18 -0800, jiangshachina wrote:
>> Hello,
>> I want to add some resource files into sub-directory of WAR/WEB-INF,
>> I'm using following scripts,
>> <build>
>> <plugins>
>> <plugin>
>> <groupId>org.apache.maven.plugins</groupId>
>> <artifactId>maven-war-plugin</artifactId>
>> <version>2.0.1</version>
>> <configuration>
>> <webappDirectory>src/webapp</webappDirectory>
>> <webResources>
>> <resource>
>> <directory>src/config/app</directory>
>> <targetPath>WEB-INF/app</targetPath>
>> </resource>
>> </webResources>
>> </configuration>
>> </plugin>
>> </plugins>
>> </build>
>> But the plugin doesn't comply with my mind.
>>
>> a cup of Java, cheers!
>> Sha Jiang
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
>
--
View this message in context: http://www.nabble.com/Why-don%27t-Overriding-the-default-destination-directory-of-a-web-resource--tf2586714s177.html#a7213693
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: Why don't Overriding the default destination directory of a
web resource?
Posted by Max Cooper <ma...@maxcooper.com>.
Why don't you just put the files in src/webapp/WEB-INF/app, instead of
src/config/app? That would solve your problem, with a minimum of fuss.
-Max
On Mon, 2006-11-06 at 20:18 -0800, jiangshachina wrote:
> Hello,
> I want to add some resource files into sub-directory of WAR/WEB-INF,
> I'm using following scripts,
> <build>
> <plugins>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-war-plugin</artifactId>
> <version>2.0.1</version>
> <configuration>
> <webappDirectory>src/webapp</webappDirectory>
> <webResources>
> <resource>
> <directory>src/config/app</directory>
> <targetPath>WEB-INF/app</targetPath>
> </resource>
> </webResources>
> </configuration>
> </plugin>
> </plugins>
> </build>
> But the plugin doesn't comply with my mind.
>
> a cup of Java, cheers!
> Sha Jiang
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Why don't Overriding the default destination directory of a web
resource?
Posted by jiangshachina <ji...@gmail.com>.
Or I have to use Ant scripts with maven-ant-plugin?
That's not my want :(
a cup of Java, cheers!
Sha Jiang
jiangshachina wrote:
>
> Hello,
> I have tried maven-assembly-plugin, but it seems that the plugin cannot
> help me.
> maven-assembly-plugin would create a new product(specified by format
> parameter).
>
> How can I achieve the goal, however the requirement is "strang"?
> src
> |--myresource
> |--resource
> |--resource.txt
> webapp
> |--WEB-INF
> |--lib
> |--classes
> |--web.xml
>
> The following is my want,
> WAR
> |--WEB-INF
> |--lib
> |--classes
> |--resource
> |--resource.txt
> |--web.xml
>
> Thanks!
>
> a cup of Java, cheers!
> Sha Jiang
>
>
> jiangshachina wrote:
>>
>> Hello,
>> I want to add some resource files into sub-directory of WAR/WEB-INF,
>> I'm using following scripts,
>> <build>
>> <plugins>
>> <plugin>
>> <groupId>org.apache.maven.plugins</groupId>
>> <artifactId>maven-war-plugin</artifactId>
>> <version>2.0.1</version>
>> <configuration>
>> <webappDirectory>src/webapp</webappDirectory>
>> <webResources>
>> <resource>
>> <directory>src/config/app</directory>
>> <targetPath>WEB-INF/app</targetPath>
>> </resource>
>> </webResources>
>> </configuration>
>> </plugin>
>> </plugins>
>> </build>
>> But the plugin doesn't comply with my mind.
>>
>> a cup of Java, cheers!
>> Sha Jiang
>>
>
>
--
View this message in context: http://www.nabble.com/Why-don%27t-Overriding-the-default-destination-directory-of-a-web-resource--tf2586714s177.html#a7250915
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: Why don't Overriding the default destination directory of a web
resource?
Posted by jiangshachina <ji...@gmail.com>.
Hello,
I have tried maven-assembly-plugin, but it seems that the plugin cannot help
me.
maven-assembly-plugin would create a new product(specified by format
parameter).
How can I achieve the goal, however the requirement is "strang"?
src
|--myresource
|--resource
|--resource.txt
webapp
|--WEB-INF
|--lib
|--classes
|--web.xml
The following is my want,
WAR
|--WEB-INF
|--lib
|--classes
|--resource
|--resource.txt
|--web.xml
Thanks!
a cup of Java, cheers!
Sha Jiang
jiangshachina wrote:
>
> Hello,
> I want to add some resource files into sub-directory of WAR/WEB-INF,
> I'm using following scripts,
> <build>
> <plugins>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-war-plugin</artifactId>
> <version>2.0.1</version>
> <configuration>
> <webappDirectory>src/webapp</webappDirectory>
> <webResources>
> <resource>
> <directory>src/config/app</directory>
> <targetPath>WEB-INF/app</targetPath>
> </resource>
> </webResources>
> </configuration>
> </plugin>
> </plugins>
> </build>
> But the plugin doesn't comply with my mind.
>
> a cup of Java, cheers!
> Sha Jiang
>
--
View this message in context: http://www.nabble.com/Why-don%27t-Overriding-the-default-destination-directory-of-a-web-resource--tf2586714s177.html#a7235853
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