web.xml not copied to war/WEB-INF

1,300 views
Skip to first unread message

vetal

unread,
Jul 21, 2009, 10:23:25 AM7/21/09
to Codehaus Mojo gwt-maven-plugin Users
Hello, all!
I need help with problem!
I create simple GWT application, configure web.xml for it then try mvn
gwt:run i get this error
"Module declares 1 <servlet> declaration(s), but a valid 'web.xml' was
not found at '/home/vetal/tmp/HelloGWT2/war/WEB-INF/web.xml' . So how
i can copy web. xml to the war/WEB-INF.

Thanks,
vetal

Agustín Gañán

unread,
Jul 21, 2009, 10:34:59 AM7/21/09
to codehaus-mojo-gwt-...@googlegroups.com
It seems a problem in your pom.xml config (output directory...).
post your pom.xml (or a piece of it, :-D) and check de docs[1]

[1] http://mojo.codehaus.org/gwt-maven-plugin/1.1-SNAPSHOT/run-mojo.html

Regards,

Agus


2009/7/21 vetal <vitaly....@gmail.com>:

Vitaly Parfonov

unread,
Jul 21, 2009, 10:44:21 AM7/21/09
to codehaus-mojo-gwt-...@googlegroups.com
Thanks, advice for your reply :) !

This my pom.xml

 <build>
    <outputDirectory>war/WEB-INF/classes</outputDirectory>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>gwt-maven-plugin</artifactId>
        <version>1.1</version>
        <configuration>
                <module>org.test.gwt.Application</module>
                <runTarget>org.test.gwt.Application/Application.html</runTarget>
                <logLevel>INFO</logLevel>
                <webXml>${basedir}/war/WEB-INF/web.xml</webXml>
                <hostedWebapp>${basedir}/war</hostedWebapp>
         </configuration>
      </plugin>
      <!--^
          If you want to use the target/web.xml file mergewebxml produces,^
          tell the war plugin to use it.^
          Also, exclude what you want from the final artifact here.^
          -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                    <warSourceExcludes>.gwt-tmp/**</warSourceExcludes>
                </configuration>
            </plugin>

^
      <plugin>^
          <groupId>org.apache.maven.plugins</groupId>^
          <artifactId>maven-compiler-plugin</artifactId>^
          <version>2.0.2</version>^
          <configuration>^
            <source>${maven.compiler.source}</source>^
            <target>${maven.compiler.target}</target>^
          </configuration>^
      </plugin>^
    </plugins>^
  </build>^


May be you can told me thats wrong on it!

2009/7/21 Agustín Gañán <agu...@gmail.com>



--
Best regards,
Vitaly

Agustín Gañán

unread,
Jul 21, 2009, 11:02:09 AM7/21/09
to codehaus-mojo-gwt-...@googlegroups.com
I'm not sure but I think you're missing the "webappDirectory" param. Try this:


<logLevel>INFO</logLevel>
<webXml>${basedir}/war/WEB-INF/web.xml</webXml>
<webappDirectory>${basedir}/war</webappDirectory>
<hostedWebapp>${basedir}/war</hostedWebapp>

This param is used in the compile goal.

Hope this helps,

Agus


2009/7/21 Vitaly Parfonov <vitaly....@gmail.com>:

Vitaly Parfonov

unread,
Jul 21, 2009, 11:12:22 AM7/21/09
to codehaus-mojo-gwt-...@googlegroups.com
Thanks, a lot! But it's not help! :(((

2009/7/21 Agustín Gañán <agu...@gmail.com>



--
Best regards,
Vitaly

Vitaly Parfonov

unread,
Jul 21, 2009, 12:03:06 PM7/21/09
to codehaus-mojo-gwt-...@googlegroups.com
Any idea, please!
--
Best regards,
Vitaly

Agustín Gañán

unread,
Jul 21, 2009, 12:17:56 PM7/21/09
to codehaus-mojo-gwt-...@googlegroups.com
With the "webappDirectory" the error is the same?
If you look in the output directory, what do you find? Your web.xml or another one?
Can you build a valid war and deploy it in a server (jetty, tomcat, ...)?

2009/7/21 Vitaly Parfonov <vitaly....@gmail.com>

Vitaly Parfonov

unread,
Jul 21, 2009, 2:53:28 PM7/21/09
to codehaus-mojo-gwt-...@googlegroups.com


2009/7/21 Agustín Gañán <agu...@gmail.com>

With the "webappDirectory" the error is the same?

Yes, i still don't see  web.xm in war/WEB-INF

If you look in the output directory, what do you find?
It's content of war dir:
war\WEB-INF\classes
war\WEB-INF\lib
war\WEB-INF\classes\org
war\WEB-INF\classes\org\test
war\WEB-INF\classes\org\test\gwt
war\WEB-INF\classes\org\test\gwt\client
war\WEB-INF\classes\org\test\gwt\client\Application.class
war\WEB-INF\lib\gwt-servlet-1.6.4.jar
war\WEB-INF\lib\gwt-user-1.6.4.jar
war\WEB-INF\lib\junit-4.4.jar

 
Your web.xml or another one?
I don't have web.xml.
 

Can you build a valid war and deploy it in a server (jetty, tomcat, ...)?
Yes when i do mvn clean install i get valid working war.

Thanks again for your help :)
 



--
Best regards,
Vitaly

Agustín Gañán

unread,
Jul 22, 2009, 4:48:01 AM7/22/09
to codehaus-mojo-gwt-...@googlegroups.com
Try adding the webXml param to the maven-war-plugin[1]

[1] http://maven.apache.org/plugins/maven-war-plugin/war-mojo.html#webXml

Regards


2009/7/21 Vitaly Parfonov <vitaly....@gmail.com>

Vitaly Parfonov

unread,
Jul 22, 2009, 4:56:00 AM7/22/09
to codehaus-mojo-gwt-...@googlegroups.com
Hi, again!  I already fix it with maven-resources-plugin i copy web.xml myself.

Anyway, thanks for your help.

2009/7/22 Agustín Gañán <agu...@gmail.com>



--
Best regards,
Vitaly
Reply all
Reply to author
Forward
0 new messages