You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by sarmahdi <sa...@hotmail.com> on 2012/03/05 08:53:42 UTC

webappsource location in POM

Hi all,

I am trying to change from the default maven locations of my sources and
targets.

By looking at the Effective POM in the eclipse (because of the maven plugin)
I was able to know these tags in POM> Build

<sourceDirectory>C:\RSA75Workspace\workspace\Corpweb\src</sourceDirectory>
   
<scriptSourceDirectory>C:\RSA75Workspace\workspace\Corpweb\src\main\scripts</scriptSourceDirectory>
   
<testSourceDirectory>C:\RSA75Workspace\workspace\Corpweb\src\test\java</testSourceDirectory>
   
<outputDirectory>C:\RSA75Workspace\workspace\Corpweb\target\build\classes</outputDirectory>
   
<testOutputDirectory>C:\RSA75Workspace\workspace\Corpweb\target\test-classes</testOutputDirectory>
    <resources>
      <resource>
       
<directory>C:\RSA75Workspace\workspace\Corpweb\src\main\resources</directory>
      </resource>
    </resources>
    <testResources>
      <testResource>
       
<directory>C:\RSA75Workspace\workspace\Corpweb\src\test\resources</directory>
      </testResource>
    </testResources>
    <directory>C:\RSA75Workspace\workspace\Corpweb\target</directory>
    <finalName>CorpWeb-0.0.1-SNAPSHOT</finalName>
    

Now I changed the directory of my where the java source files are located so
as to ask maven to compile them from there and i changed the target location
(added a build folder in between target and classes) and it is working fine.
the only problem is the webapp folder with my JSPS. 

Is there a tag in the POM where I can tell my maven that my JSPS are located
here. 

Why i ask that cos when i make a war it just creates a WEB-INF folder and
places the libs and classes folder in there but adds no JSPs cos my JSPs are
still in a different location (I am trying to work with the default Eclipse
folder structure of how it places the src and classes and jsps). So my
WebContent is in 

c:\workspace\ProjectName\WebContent\*.jsp
and my config xmls are in the 
c:\workspace\ProjectName\WebContent\WEB-INF\*.xml

I tried looking into the Build tag through IDE but i found only the ones
above but nothing to specify webapp. thats the only location which is not
specified in the parent POM. 

I would really appreciate if any one can guide me to the information where i
can get it. 

(While i was writing this post i saw this in my POM for the war plugin )

<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.2</version>
                <configuration>
                    
                    <packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes>
                    <archive>
                        <manifest>
                            <addClasspath>true</addClasspath>
                            <classpathPrefix>lib/</classpathPrefix>
                        </manifest>
                    </archive> 
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                    <webappDirectory>WHAT DO I PUT IN HERE</webappDirectory>

                </configuration>
            </plugin>

Is the path to webapp relative and will that work. How can I place a
relative path to workspace can any body help me with that and I will try it
and see. Will post my results. 

Thanks.









--
View this message in context: http://maven.40175.n5.nabble.com/webappsource-location-in-POM-tp5536805p5536805.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: webappsource location in POM

Posted by sarmahdi <sa...@hotmail.com>.
yep I was looking for that info and already changed it but thanks for the tip
cos it took me a bit of googling to get to this 
http://docs.codehaus.org/display/MAVENUSER/MavenPropertiesGuide site 

it has all the variables maven can understand.

Thanks again.

Syed...

--
View this message in context: http://maven.40175.n5.nabble.com/webappsource-location-in-POM-tp5536805p5541057.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: webappsource location in POM

Posted by Robert Scholte <ap...@sourcegrounds.com>.
Hi,

Two suggestions:
- remove the executions-section, since you've already configured it in the  
(global-)plugin configuration
- don't use absolute paths. Now it is bound to your system. Either use
   <webappDirectory>WebContent<webappDirectory> or  
<webappDirectory>${basedir}/WebContent<webappDirectory>

-Robert

Op Mon, 05 Mar 2012 12:00:45 +0100 schreef sarmahdi <sa...@hotmail.com>:

> I added the location in the war plugin :D
>
> <plugins>
>       <plugin>
>         <artifactId>maven-war-plugin</artifactId>
>         <version>2.2</version>
>         <executions>
>           <execution>
>             <id>default-war</id>
>             <phase>package</phase>
>             <goals>
>               <goal>war</goal>
>             </goals>
>             <configuration>
>               <packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes>  
> // to
> exclude libs normally u dont need that
>               <archive>
>                 <manifest>
>                   <addClasspath>true</addClasspath>
>                   <classpathPrefix>lib/</classpathPrefix>
>                 </manifest>
>               </archive>
>               <failOnMissingWebXml>false</failOnMissingWebXml>
> <webappDirectory>C:\RSA75Workspace\workspace\Corpweb\WebContent</webappDirectory>
>             </configuration>
>           </execution>
>         </executions>
>         <configuration>
>           <packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes>// to
> exclude libs normally u dont need that
>           <archive>
>             <manifest>
>               <addClasspath>true</addClasspath>
>               <classpathPrefix>lib/</classpathPrefix>
>             </manifest>
>           </archive>
>           <failOnMissingWebXml>false</failOnMissingWebXml>
>          *
> <webappDirectory>C:\RSA75Workspace\workspace\Corpweb\WebContent</webappDirectory>*
>         </configuration>
>       </plugin>
>
> --
> View this message in context:  
> http://maven.40175.n5.nabble.com/webappsource-location-in-POM-tp5536805p5537186.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

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: webappsource location in POM

Posted by sarmahdi <sa...@hotmail.com>.
I added the location in the war plugin :D

<plugins>
      <plugin>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.2</version>
        <executions>
          <execution>
            <id>default-war</id>
            <phase>package</phase>
            <goals>
              <goal>war</goal>
            </goals>
            <configuration>
              <packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes> // to
exclude libs normally u dont need that
              <archive>
                <manifest>
                  <addClasspath>true</addClasspath>
                  <classpathPrefix>lib/</classpathPrefix>
                </manifest>
              </archive>
              <failOnMissingWebXml>false</failOnMissingWebXml>
             
<webappDirectory>C:\RSA75Workspace\workspace\Corpweb\WebContent</webappDirectory>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes>// to
exclude libs normally u dont need that
          <archive>
            <manifest>
              <addClasspath>true</addClasspath>
              <classpathPrefix>lib/</classpathPrefix>
            </manifest>
          </archive>
          <failOnMissingWebXml>false</failOnMissingWebXml>
         *
<webappDirectory>C:\RSA75Workspace\workspace\Corpweb\WebContent</webappDirectory>*
        </configuration>
      </plugin>

--
View this message in context: http://maven.40175.n5.nabble.com/webappsource-location-in-POM-tp5536805p5537186.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