You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Serge Huber <sh...@jahia.com> on 2004/08/12 16:58:03 UTC

Codeczar Maven Tomcat Plugin improvements suggestions

Hi all,

First of all thanks to the guys at codeczar for their plugin. It's really 
helpful.

I've recently started using the tomcat:jspc goal and I've had a few 
problems. First of all it fails if I don't declare a maven.war.src 
directory explicitely in my project.properties. This might be due to the 
final version of the WAR plugin that I'm using with Maven 1.0 final.

Also, the JSP are translated into Java source code, but there is no target 
to compile the source code which I find a shame.

Last but not least the
@maven.tomcat.generated@
to be inserted in the web.xml file is not very elegant because if we don't 
execute the merge, we will end up with an invalid web.xml file. I suggest 
to use something like this :

<!-- ${maven.tomcat.generated} -->

I have very limited knowledge of Jelly so I'm not sure how I can help do 
all these changes. I am showing below some goals that do implement all the 
stuff I've talked about, but they are not integrated with the Tomcat 
plugin. The following code has been tested with Tomcat 5.0.18 only.

Regards,
   Serge Huber.

project.xml (extract & the same as the Tomcat plugin) :
-------------------------------------------------------
<!-- Dependencies required for JSP precompilation -->
     <dependency>
       <groupId>tomcat</groupId>
       <artifactId>catalina-ant</artifactId>
       <version>5.0.18</version>
       <properties>
         <classloader>root</classloader>
       </properties>
     </dependency>
     <dependency>
       <groupId>tomcat</groupId>
       <artifactId>jasper-compiler</artifactId>
       <version>5.0.18</version>
     </dependency>
     <dependency>
       <groupId>tomcat</groupId>
       <artifactId>jasper-runtime</artifactId>
       <version>5.0.18</version>
     </dependency>
     <dependency>
       <groupId>commons-logging</groupId>
       <artifactId>commons-logging</artifactId>
       <version>1.0.3</version>
     </dependency>
     <!--dependency>
       <groupId>commons-collections</groupId>
       <artifactId>commons-collections</artifactId>
       <version>3.0</version>
       <properties>
         <classloader>root</classloader>
       </properties>
     </dependency-->
     <dependency>
       <groupId>commons-el</groupId>
       <artifactId>commons-el</artifactId>
       <version>1.0</version>
       <properties>
         <classloader>root</classloader>
       </properties>
     </dependency>
     <!--dependency>
       <groupId>commons-daemon</groupId>
       <artifactId>commons-daemon</artifactId>
       <version>SNAPSHOT</version>
       <properties>
         <classloader>root</classloader>
       </properties>
     </dependency>
     <dependency>
       <groupId>xerces</groupId>
       <artifactId>xerces</artifactId>
       <version>2.4.0</version>
       <properties>
         <classloader>root</classloader>
       </properties>
     </dependency>
     <dependency>
       <groupId>xerces</groupId>
       <artifactId>xercesImpl</artifactId>
       <version>2.6.2</version>
       <properties>
         <classloader>root</classloader>
       </properties>
     </dependency>
     <dependency>
       <groupId>xerces</groupId>
       <artifactId>xmlParserAPIs</artifactId>
       <version>2.2.1</version>
       <properties>
         <classloader>root</classloader>
       </properties>
     </dependency-->
     <dependency>
       <groupId>servletapi</groupId>
       <artifactId>servlet-api</artifactId>
       <version>2.4-20040521</version>
       <!--properties>
         <classloader>root</classloader>
       </properties-->
       <type>jar</type>
     </dependency>
     <dependency>
       <groupId>jspapi</groupId>
       <artifactId>jsp-api</artifactId>
       <version>2.0-20040521</version>
       <!-- don't understand why I need root but throws class not found 
otherwise -->
       <properties>
         <classloader>root</classloader>
       </properties>
       <type>jar</type>
     </dependency>


     <!--dependency>
       <groupId>ant</groupId>
       <artifactId>ant</artifactId>
       <version>1.6.1</version>
       <properties>
         <classloader>root</classloader>
       </properties>
     </dependency-->

project.properties :
--------------------
# Set to true if you want JSP precompilation to happen after war:webapp goal
precompile.jsp=true

maven.xml :
-----------
<project default="war"
          xmlns:j="jelly:core"
          xmlns:define="jelly:define"
          xmlns:util="jelly:util"
          xmlns:jasper="jasper"
          xmlns:ant="jelly:ant">

   <!-- ================================================================ -->
   <!-- Deploy to Catalina and Expand                                    -->
   <!-- ================================================================ -->
   <define:taglib uri="jasper">
     <define:jellybean
       name="JspC"
       className="org.apache.jasper.JspC"
       method="execute"
       />
   </define:taglib>

   <preGoal name="war:webapp">
     <j:set var="precompileJsp" value="${precompile.jsp}"/>
     <j:if test="${precompileJsp == 'true'}">
       <attainGoal name="precompile-jsp"/>
     </j:if>
   </preGoal>

   <postGoal name="war:webapp">
     <j:set var="precompileJsp" value="${precompile.jsp}"/>
     <j:if test="${precompileJsp == 'true'}">
       <j:set var="target" 
value="${pom.getPluginContext('maven-war-plugin').getVariable('maven.war.webapp.dir')}"/>
       <util:available file="${maven.build.dir}/web-fragment.xml">
         <util:loadText var="fragment" 
file="${maven.build.dir}/web-fragment.xml"/>
         <ant:replace file="${target}/WEB-INF/web.xml" token="&lt;!-- 
${maven.tomcat.generated} --&gt;" value="${fragment}"/>
       </util:available>
     </j:if>

   </postGoal>

   <goal name="precompile-jsp" description="Precompile all JSPs into java 
classes, and then into classes" prereqs="war:load,java:compile">
     <j:set var="warSource" 
value="${pom.getPluginContext('maven-war-plugin').getVariable('maven.war.src')}"/>
     <ant:mkdir dir="${maven.build.dir}/jspc"/>
     <ant:mkdir dir="${maven.build.dir}/jspc-processed"/>
     <ant:mkdir dir="${maven.build.dir}/jspc-classes"/>

     <j:set var="jspOutDir" value="${maven.build.dir}/jspc"/>
     <j:set var="jspClassesOutDir" value="${maven.build.dest}"/>
     <ant:path id="jspc.classpath">
       <echo message="Java home=${java.home}" />
       <ant:pathelement location="${java.home}/../lib/tools.jar"/>
       <ant:fileset dir="${tomcat.home}/bin">
         <ant:include name="*.jar"/>
       </ant:fileset>
       <ant:fileset dir="${tomcat.home}/server/lib">
         <ant:include name="*.jar"/>
       </ant:fileset>
       <ant:fileset dir="${tomcat.home}/common/lib">
         <ant:include name="*.jar"/>
       </ant:fileset>
       <ant:path refid="maven.dependency.classpath"/>
       <ant:pathelement path="${maven.build.dest}"/>
     </ant:path>
     <jasper:JspC
       webXmlFragment="${maven.build.dir}/web-fragment.xml"
       package="${pom.package}.jsp.${maven.war.final.name}"
       outputDir="${jspOutDir}"
       srcdir="${warSource}"
       uriroot="${warSource}"
       uribase="/${pom.artifactId}"
       verbose="2"/>
     <ant:javac
       srcdir="${jspOutDir}"
       destdir="${jspClassesOutDir}"
       debug="${maven.compile.debug}"
       deprecation="${maven.compile.deprecation}"
       optimize="${maven.compile.optimize}"
       classpathref="jspc.classpath"/>
   </goal>



- -- --- -----=[ shuber2 at jahia dot com ]=---- --- -- -
www.jahia.org : A collaborative source CMS and Portal Server 



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


Re: Codeczar Maven Tomcat Plugin improvements suggestions

Posted by Serge Huber <sh...@jahia.com>.
Hi Nathan,

I realized that my suggestion for the fragment replacement wasn't good, as 
I used a jelly expression.

So instead of :

<!-- ${maven.tomcat.generated} -->

we should use something like :

<!-- [maven.tomcat.generated] -->

or anything else that doesn't include ${} format.

Also if I can help with the Tomcat plugin I'd be interested, provided I 
have the time and knowledge. Let me know.

Regards,
   Serge Huber.

At 00:09 13.09.2004, you wrote:
>thanks Serge,
>
>your suggestions are all good.  I was sure the plugin compiled the 
>generated java sources too - I'll check.  I've collected a number of other 
>suggestions for improvements to the plugin.  I hope to have an improved 
>version available some time in the next few weeks.
>
>cheers
>Nathan
>
>Serge Huber wrote:
>
>>Hi all,
>>First of all thanks to the guys at codeczar for their plugin. It's really 
>>helpful.
>>I've recently started using the tomcat:jspc goal and I've had a few 
>>problems. First of all it fails if I don't declare a maven.war.src 
>>directory explicitely in my project.properties. This might be due to the 
>>final version of the WAR plugin that I'm using with Maven 1.0 final.
>>Also, the JSP are translated into Java source code, but there is no 
>>target to compile the source code which I find a shame.
>>Last but not least the
>>@maven.tomcat.generated@
>>to be inserted in the web.xml file is not very elegant because if we 
>>don't execute the merge, we will end up with an invalid web.xml file. I 
>>suggest to use something like this :
>><!-- ${maven.tomcat.generated} -->
>>I have very limited knowledge of Jelly so I'm not sure how I can help do 
>>all these changes. I am showing below some goals that do implement all 
>>the stuff I've talked about, but they are not integrated with the Tomcat 
>>plugin. The following code has been tested with Tomcat 5.0.18 only.
>>Regards,
>>   Serge Huber.
>>project.xml (extract & the same as the Tomcat plugin) :
>>-------------------------------------------------------
>><!-- Dependencies required for JSP precompilation -->
>>     <dependency>
>>       <groupId>tomcat</groupId>
>>       <artifactId>catalina-ant</artifactId>
>>       <version>5.0.18</version>
>>       <properties>
>>         <classloader>root</classloader>
>>       </properties>
>>     </dependency>
>>     <dependency>
>>       <groupId>tomcat</groupId>
>>       <artifactId>jasper-compiler</artifactId>
>>       <version>5.0.18</version>
>>     </dependency>
>>     <dependency>
>>       <groupId>tomcat</groupId>
>>       <artifactId>jasper-runtime</artifactId>
>>       <version>5.0.18</version>
>>     </dependency>
>>     <dependency>
>>       <groupId>commons-logging</groupId>
>>       <artifactId>commons-logging</artifactId>
>>       <version>1.0.3</version>
>>     </dependency>
>>     <!--dependency>
>>       <groupId>commons-collections</groupId>
>>       <artifactId>commons-collections</artifactId>
>>       <version>3.0</version>
>>       <properties>
>>         <classloader>root</classloader>
>>       </properties>
>>     </dependency-->
>>     <dependency>
>>       <groupId>commons-el</groupId>
>>       <artifactId>commons-el</artifactId>
>>       <version>1.0</version>
>>       <properties>
>>         <classloader>root</classloader>
>>       </properties>
>>     </dependency>
>>     <!--dependency>
>>       <groupId>commons-daemon</groupId>
>>       <artifactId>commons-daemon</artifactId>
>>       <version>SNAPSHOT</version>
>>       <properties>
>>         <classloader>root</classloader>
>>       </properties>
>>     </dependency>
>>     <dependency>
>>       <groupId>xerces</groupId>
>>       <artifactId>xerces</artifactId>
>>       <version>2.4.0</version>
>>       <properties>
>>         <classloader>root</classloader>
>>       </properties>
>>     </dependency>
>>     <dependency>
>>       <groupId>xerces</groupId>
>>       <artifactId>xercesImpl</artifactId>
>>       <version>2.6.2</version>
>>       <properties>
>>         <classloader>root</classloader>
>>       </properties>
>>     </dependency>
>>     <dependency>
>>       <groupId>xerces</groupId>
>>       <artifactId>xmlParserAPIs</artifactId>
>>       <version>2.2.1</version>
>>       <properties>
>>         <classloader>root</classloader>
>>       </properties>
>>     </dependency-->
>>     <dependency>
>>       <groupId>servletapi</groupId>
>>       <artifactId>servlet-api</artifactId>
>>       <version>2.4-20040521</version>
>>       <!--properties>
>>         <classloader>root</classloader>
>>       </properties-->
>>       <type>jar</type>
>>     </dependency>
>>     <dependency>
>>       <groupId>jspapi</groupId>
>>       <artifactId>jsp-api</artifactId>
>>       <version>2.0-20040521</version>
>>       <!-- don't understand why I need root but throws class not found 
>> otherwise -->
>>       <properties>
>>         <classloader>root</classloader>
>>       </properties>
>>       <type>jar</type>
>>     </dependency>
>>
>>     <!--dependency>
>>       <groupId>ant</groupId>
>>       <artifactId>ant</artifactId>
>>       <version>1.6.1</version>
>>       <properties>
>>         <classloader>root</classloader>
>>       </properties>
>>     </dependency-->
>>project.properties :
>>--------------------
>># Set to true if you want JSP precompilation to happen after war:webapp goal
>>precompile.jsp=true
>>maven.xml :
>>-----------
>><project default="war"
>>          xmlns:j="jelly:core"
>>          xmlns:define="jelly:define"
>>          xmlns:util="jelly:util"
>>          xmlns:jasper="jasper"
>>          xmlns:ant="jelly:ant">
>>   <!-- ================================================================ -->
>>   <!-- Deploy to Catalina and Expand                                    -->
>>   <!-- ================================================================ -->
>>   <define:taglib uri="jasper">
>>     <define:jellybean
>>       name="JspC"
>>       className="org.apache.jasper.JspC"
>>       method="execute"
>>       />
>>   </define:taglib>
>>   <preGoal name="war:webapp">
>>     <j:set var="precompileJsp" value="${precompile.jsp}"/>
>>     <j:if test="${precompileJsp == 'true'}">
>>       <attainGoal name="precompile-jsp"/>
>>     </j:if>
>>   </preGoal>
>>   <postGoal name="war:webapp">
>>     <j:set var="precompileJsp" value="${precompile.jsp}"/>
>>     <j:if test="${precompileJsp == 'true'}">
>>       <j:set var="target" 
>> value="${pom.getPluginContext('maven-war-plugin').getVariable('maven.war.webapp.dir')}"/> 
>>
>>       <util:available file="${maven.build.dir}/web-fragment.xml">
>>         <util:loadText var="fragment" 
>> file="${maven.build.dir}/web-fragment.xml"/>
>>         <ant:replace file="${target}/WEB-INF/web.xml" token="&lt;!-- 
>> ${maven.tomcat.generated} --&gt;" value="${fragment}"/>
>>       </util:available>
>>     </j:if>
>>   </postGoal>
>>   <goal name="precompile-jsp" description="Precompile all JSPs into java 
>> classes, and then into classes" prereqs="war:load,java:compile">
>>     <j:set var="warSource" 
>> value="${pom.getPluginContext('maven-war-plugin').getVariable('maven.war.src')}"/> 
>>
>>     <ant:mkdir dir="${maven.build.dir}/jspc"/>
>>     <ant:mkdir dir="${maven.build.dir}/jspc-processed"/>
>>     <ant:mkdir dir="${maven.build.dir}/jspc-classes"/>
>>     <j:set var="jspOutDir" value="${maven.build.dir}/jspc"/>
>>     <j:set var="jspClassesOutDir" value="${maven.build.dest}"/>
>>     <ant:path id="jspc.classpath">
>>       <echo message="Java home=${java.home}" />
>>       <ant:pathelement location="${java.home}/../lib/tools.jar"/>
>>       <ant:fileset dir="${tomcat.home}/bin">
>>         <ant:include name="*.jar"/>
>>       </ant:fileset>
>>       <ant:fileset dir="${tomcat.home}/server/lib">
>>         <ant:include name="*.jar"/>
>>       </ant:fileset>
>>       <ant:fileset dir="${tomcat.home}/common/lib">
>>         <ant:include name="*.jar"/>
>>       </ant:fileset>
>>       <ant:path refid="maven.dependency.classpath"/>
>>       <ant:pathelement path="${maven.build.dest}"/>
>>     </ant:path>
>>     <jasper:JspC
>>       webXmlFragment="${maven.build.dir}/web-fragment.xml"
>>       package="${pom.package}.jsp.${maven.war.final.name}"
>>       outputDir="${jspOutDir}"
>>       srcdir="${warSource}"
>>       uriroot="${warSource}"
>>       uribase="/${pom.artifactId}"
>>       verbose="2"/>
>>     <ant:javac
>>       srcdir="${jspOutDir}"
>>       destdir="${jspClassesOutDir}"
>>       debug="${maven.compile.debug}"
>>       deprecation="${maven.compile.deprecation}"
>>       optimize="${maven.compile.optimize}"
>>       classpathref="jspc.classpath"/>
>>   </goal>
>>
>>- -- --- -----=[ shuber2 at jahia dot com ]=---- --- -- -
>>www.jahia.org : A collaborative source CMS and Portal Server
>>
>>---------------------------------------------------------------------
>>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

- -- --- -----=[ shuber2 at jahia dot com ]=---- --- -- -
www.jahia.org : A collaborative source CMS and Portal Server 



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


Re: MavenException

Posted by Brett Porter <br...@gmail.com>.
Looks like it is trying to load a plugin as a project instead of as a
plugin. I don't know how it happened, but it should be corrected if
you rm -rf /home/maven/.maven/cache. Check that there isn't any
additional bad files in ~/.maven/plugins or $MAVEN_HOME/plugins too.

Cheers,
brett

On Mon, 16 Aug 2004 07:30:10 -0700 (PDT), jeff mutonho
<ej...@yahoo.com> wrote:
> Hi guys
> 
> I've installed Maven on a Redhat 8.0 box and correctly setup the environment varibles.I created a test project and manage to build it successfully.I'm having problems running the command
> 
> maven -g
> 
> to get a full description of all the Maven goals available.Maven is throwing the following exception:
> 
> org.apache.maven.MavenException: Error parsing project.xml '/home/maven/.maven/cache/plugin-parent/project.xml'
>         at org.apache.maven.MavenUtils.getNonJellyProject(MavenUtils.java:208)
>         at org.apache.maven.MavenUtils.getNonJellyProject(MavenUtils.java:232)
>         at org.apache.maven.MavenUtils.getProject(MavenUtils.java:144)
>         at org.apache.maven.MavenUtils.getProject(MavenUtils.java:123)
>         at org.apache.maven.MavenSession.initializeRootProject(MavenSession.java:235)
>         at org.apache.maven.MavenSession.initialize(MavenSession.java:175)
>         at org.apache.maven.cli.App.doMain(App.java:473)
>         at org.apache.maven.cli.App.main(App.java:1215)
>         at java.lang.reflect.Method.invoke(Native Method)
>         at com.werken.forehead.Forehead.run(Forehead.java:551)
>         at com.werken.forehead.Forehead.main(Forehead.java:581)
> You have encountered an unknown error running Maven. Please help us to correct
> this problem by following these simple steps:
> 
> I don't understand why it's looking for '/home/maven/.maven/cache/plugin-parent/project.xml'  because the directory "plugin-parent" does not even exist.
> 
> maven -g works fine on the other XP box with a similat Maven installation , even though there's no "plugin-parent" under the ".maven" folder.
> 
> Any ideas?
> 
> jeff mutonho
> 
> 
> ---------------------------------
> Do you Yahoo!?
> Yahoo! Mail - 50x more storage than other providers!

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


Re: Checking projects out of CVS

Posted by jeff mutonho <ej...@yahoo.com>.
Thanks
It turn out that if I just execute the command "maven" and not "maven scm:checkout-project"  , all the modules declared in maven.xml are checked out.
 
jeff mutonho

Brett Porter <br...@gmail.com> wrote:
you need to use property="maven.scm.cvs.module" value="..." />

On Mon, 16 Aug 2004 23:05:27 -0700 (PDT), jeff mutonho
wrote:
> Hi guys
> 
> I checked a project(Project1) without problems from CVS using the following rules in my maven.xml file:
> 
> 

> 

> Project1
> 
> Project2
> 
> 

> 
> >                includes="*/project.xml"
>                goals="mycontacts-dist"
>                banner="Building Project"
>                ignoreFailures="false"/-->
> 
> 

> 
> I have commented out the rule to checkout Project1 , but not Project2 and my maven.xml file looks as shown below:
> 
> 

> 

> Project1
> 
> Project2
> 
> 

> 
> >                includes="*/project.xml"
>                goals="mycontacts-dist"
>                banner="Building Project"
>                ignoreFailures="false"/-->
> 
> 

> 
> When I run "maven scm:checkout-project" , Maven is still checking out Project1 instead of Project2.What am I missing here?
> 
> jeff mutonho
> 
> 
> ---------------------------------
> Do you Yahoo!?
> New and Improved Yahoo! Mail - 100MB free storage!

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


		
---------------------------------
Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!

Re: Checking projects out of CVS

Posted by Brett Porter <br...@gmail.com>.
you need to use <maven:set plugin="maven-scm-plugin"
property="maven.scm.cvs.module" value="..." />

On Mon, 16 Aug 2004 23:05:27 -0700 (PDT), jeff mutonho
<ej...@yahoo.com> wrote:
> Hi guys
> 
> I checked a project(Project1) without problems from CVS using the following rules in my maven.xml file:
> 
> <project default="mycontacts:build-all" xmlns:j="jelly:core" xmlns:m="jelly:maven">
>   <preGoal name="mycontacts:build-all">
>     <j:set var="maven.scm.cvs.module">Project1</j:set>
>     <attainGoal name="scm:cvs-checkout-project"/>
>     <j:set var="maven.scm.cvs.module">Project2</j:set>
>     <attainGoal name="scm:cvs-checkout-project"/>
>   </preGoal>
>   <goal name="mycontacts:build-all">
>     <!--m:reactor basedir="${basedir}"
>                includes="*/project.xml"
>                goals="mycontacts-dist"
>                banner="Building Project"
>                ignoreFailures="false"/-->
>   </goal>
> </project>
> 
> I have commented out the rule to checkout Project1 , but not Project2 and my maven.xml file looks as shown below:
> 
> <project default="mycontacts:build-all" xmlns:j="jelly:core" xmlns:m="jelly:maven">
>   <preGoal name="mycontacts:build-all">
>     <!--j:set var="maven.scm.cvs.module">Project1</j:set-->
>     <!--attainGoal name="scm:cvs-checkout-project"/-->
>     <j:set var="maven.scm.cvs.module">Project2</j:set>
>     <attainGoal name="scm:cvs-checkout-project"/>
>   </preGoal>
>   <goal name="mycontacts:build-all">
>     <!--m:reactor basedir="${basedir}"
>                includes="*/project.xml"
>                goals="mycontacts-dist"
>                banner="Building Project"
>                ignoreFailures="false"/-->
>   </goal>
> </project>
> 
> When I run  "maven scm:checkout-project"  , Maven is still checking out Project1 instead of Project2.What am I missing here?
> 
> jeff mutonho
> 
> 
> ---------------------------------
> Do you Yahoo!?
> New and Improved Yahoo! Mail - 100MB free storage!

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


UPDATE: Re: Checking projects out of CVS

Posted by jeff mutonho <ej...@yahoo.com>.
I did a search for all the files under /home/maven , that contain the string "Project1" and realized there's this file  /home/maven/.maven/cache/maven-scm-plugin-1.4/plugin.properties , part of which contains the line
 
# CVS module to check out, required
maven.scm.cvs.module=Project1
 
Does that mean this file overrides any rules in the maven.xml file?How then do I check out more than one module from CVS?
 
jeff mutonho

jeff mutonho <ej...@yahoo.com> wrote:
Hi guys

I checked a project(Project1) without problems from CVS using the following rules in my maven.xml file:





Project1

Project2




               includes="*/project.xml"
               goals="mycontacts-dist"
               banner="Building Project"
               ignoreFailures="false"/-->




I have commented out the rule to checkout Project1 , but not Project2 and my maven.xml file looks as shown below:





Project1

Project2




               includes="*/project.xml"
               goals="mycontacts-dist"
               banner="Building Project"
               ignoreFailures="false"/-->




When I run "maven scm:checkout-project" , Maven is still checking out Project1 instead of Project2.What am I missing here?

jeff mutonho



---------------------------------
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
		
---------------------------------
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.

Checking projects out of CVS

Posted by jeff mutonho <ej...@yahoo.com>.
Hi guys
 
I checked a project(Project1) without problems from CVS using the following rules in my maven.xml file:
 
<project default="mycontacts:build-all" xmlns:j="jelly:core" xmlns:m="jelly:maven">
  <preGoal name="mycontacts:build-all">
    <j:set var="maven.scm.cvs.module">Project1</j:set>
    <attainGoal name="scm:cvs-checkout-project"/>
    <j:set var="maven.scm.cvs.module">Project2</j:set>
    <attainGoal name="scm:cvs-checkout-project"/>
  </preGoal>
  <goal name="mycontacts:build-all">
    <!--m:reactor basedir="${basedir}"
               includes="*/project.xml"
               goals="mycontacts-dist"
               banner="Building Project"
               ignoreFailures="false"/-->
  </goal>
</project>
 
I have commented out the rule to checkout Project1 , but not Project2 and my maven.xml file looks as shown below:
 
<project default="mycontacts:build-all" xmlns:j="jelly:core" xmlns:m="jelly:maven">
  <preGoal name="mycontacts:build-all">
    <!--j:set var="maven.scm.cvs.module">Project1</j:set-->
    <!--attainGoal name="scm:cvs-checkout-project"/-->
    <j:set var="maven.scm.cvs.module">Project2</j:set>
    <attainGoal name="scm:cvs-checkout-project"/>
  </preGoal>
  <goal name="mycontacts:build-all">
    <!--m:reactor basedir="${basedir}"
               includes="*/project.xml"
               goals="mycontacts-dist"
               banner="Building Project"
               ignoreFailures="false"/-->
  </goal>
</project>
 
When I run  "maven scm:checkout-project"  , Maven is still checking out Project1 instead of Project2.What am I missing here?
 
jeff mutonho
 

		
---------------------------------
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!

MavenException

Posted by jeff mutonho <ej...@yahoo.com>.
Hi guys
 
I've installed Maven on a Redhat 8.0 box and correctly setup the environment varibles.I created a test project and manage to build it successfully.I'm having problems running the command
 
maven -g 
 
to get a full description of all the Maven goals available.Maven is throwing the following exception:
 
org.apache.maven.MavenException: Error parsing project.xml '/home/maven/.maven/cache/plugin-parent/project.xml'
        at org.apache.maven.MavenUtils.getNonJellyProject(MavenUtils.java:208)
        at org.apache.maven.MavenUtils.getNonJellyProject(MavenUtils.java:232)
        at org.apache.maven.MavenUtils.getProject(MavenUtils.java:144)
        at org.apache.maven.MavenUtils.getProject(MavenUtils.java:123)
        at org.apache.maven.MavenSession.initializeRootProject(MavenSession.java:235)
        at org.apache.maven.MavenSession.initialize(MavenSession.java:175)
        at org.apache.maven.cli.App.doMain(App.java:473)
        at org.apache.maven.cli.App.main(App.java:1215)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.werken.forehead.Forehead.run(Forehead.java:551)
        at com.werken.forehead.Forehead.main(Forehead.java:581)
You have encountered an unknown error running Maven. Please help us to correct
this problem by following these simple steps:
 
I don't understand why it's looking for '/home/maven/.maven/cache/plugin-parent/project.xml'  because the directory "plugin-parent" does not even exist.
 
maven -g works fine on the other XP box with a similat Maven installation , even though there's no "plugin-parent" under the ".maven" folder.
 
Any ideas?
 
jeff mutonho



		
---------------------------------
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!

Re: Codeczar Maven Tomcat Plugin improvements suggestions

Posted by Nathan Coast <na...@codeczar.com>.
thanks Serge,

your suggestions are all good.  I was sure the plugin compiled the 
generated java sources too - I'll check.  I've collected a number of 
other suggestions for improvements to the plugin.  I hope to have an 
improved version available some time in the next few weeks.

cheers
Nathan

Serge Huber wrote:

> 
> Hi all,
> 
> First of all thanks to the guys at codeczar for their plugin. It's 
> really helpful.
> 
> I've recently started using the tomcat:jspc goal and I've had a few 
> problems. First of all it fails if I don't declare a maven.war.src 
> directory explicitely in my project.properties. This might be due to the 
> final version of the WAR plugin that I'm using with Maven 1.0 final.
> 
> Also, the JSP are translated into Java source code, but there is no 
> target to compile the source code which I find a shame.
> 
> Last but not least the
> @maven.tomcat.generated@
> to be inserted in the web.xml file is not very elegant because if we 
> don't execute the merge, we will end up with an invalid web.xml file. I 
> suggest to use something like this :
> 
> <!-- ${maven.tomcat.generated} -->
> 
> I have very limited knowledge of Jelly so I'm not sure how I can help do 
> all these changes. I am showing below some goals that do implement all 
> the stuff I've talked about, but they are not integrated with the Tomcat 
> plugin. The following code has been tested with Tomcat 5.0.18 only.
> 
> Regards,
>   Serge Huber.
> 
> project.xml (extract & the same as the Tomcat plugin) :
> -------------------------------------------------------
> <!-- Dependencies required for JSP precompilation -->
>     <dependency>
>       <groupId>tomcat</groupId>
>       <artifactId>catalina-ant</artifactId>
>       <version>5.0.18</version>
>       <properties>
>         <classloader>root</classloader>
>       </properties>
>     </dependency>
>     <dependency>
>       <groupId>tomcat</groupId>
>       <artifactId>jasper-compiler</artifactId>
>       <version>5.0.18</version>
>     </dependency>
>     <dependency>
>       <groupId>tomcat</groupId>
>       <artifactId>jasper-runtime</artifactId>
>       <version>5.0.18</version>
>     </dependency>
>     <dependency>
>       <groupId>commons-logging</groupId>
>       <artifactId>commons-logging</artifactId>
>       <version>1.0.3</version>
>     </dependency>
>     <!--dependency>
>       <groupId>commons-collections</groupId>
>       <artifactId>commons-collections</artifactId>
>       <version>3.0</version>
>       <properties>
>         <classloader>root</classloader>
>       </properties>
>     </dependency-->
>     <dependency>
>       <groupId>commons-el</groupId>
>       <artifactId>commons-el</artifactId>
>       <version>1.0</version>
>       <properties>
>         <classloader>root</classloader>
>       </properties>
>     </dependency>
>     <!--dependency>
>       <groupId>commons-daemon</groupId>
>       <artifactId>commons-daemon</artifactId>
>       <version>SNAPSHOT</version>
>       <properties>
>         <classloader>root</classloader>
>       </properties>
>     </dependency>
>     <dependency>
>       <groupId>xerces</groupId>
>       <artifactId>xerces</artifactId>
>       <version>2.4.0</version>
>       <properties>
>         <classloader>root</classloader>
>       </properties>
>     </dependency>
>     <dependency>
>       <groupId>xerces</groupId>
>       <artifactId>xercesImpl</artifactId>
>       <version>2.6.2</version>
>       <properties>
>         <classloader>root</classloader>
>       </properties>
>     </dependency>
>     <dependency>
>       <groupId>xerces</groupId>
>       <artifactId>xmlParserAPIs</artifactId>
>       <version>2.2.1</version>
>       <properties>
>         <classloader>root</classloader>
>       </properties>
>     </dependency-->
>     <dependency>
>       <groupId>servletapi</groupId>
>       <artifactId>servlet-api</artifactId>
>       <version>2.4-20040521</version>
>       <!--properties>
>         <classloader>root</classloader>
>       </properties-->
>       <type>jar</type>
>     </dependency>
>     <dependency>
>       <groupId>jspapi</groupId>
>       <artifactId>jsp-api</artifactId>
>       <version>2.0-20040521</version>
>       <!-- don't understand why I need root but throws class not found 
> otherwise -->
>       <properties>
>         <classloader>root</classloader>
>       </properties>
>       <type>jar</type>
>     </dependency>
> 
> 
>     <!--dependency>
>       <groupId>ant</groupId>
>       <artifactId>ant</artifactId>
>       <version>1.6.1</version>
>       <properties>
>         <classloader>root</classloader>
>       </properties>
>     </dependency-->
> 
> project.properties :
> --------------------
> # Set to true if you want JSP precompilation to happen after war:webapp 
> goal
> precompile.jsp=true
> 
> maven.xml :
> -----------
> <project default="war"
>          xmlns:j="jelly:core"
>          xmlns:define="jelly:define"
>          xmlns:util="jelly:util"
>          xmlns:jasper="jasper"
>          xmlns:ant="jelly:ant">
> 
>   <!-- ================================================================ -->
>   <!-- Deploy to Catalina and Expand                                    -->
>   <!-- ================================================================ -->
>   <define:taglib uri="jasper">
>     <define:jellybean
>       name="JspC"
>       className="org.apache.jasper.JspC"
>       method="execute"
>       />
>   </define:taglib>
> 
>   <preGoal name="war:webapp">
>     <j:set var="precompileJsp" value="${precompile.jsp}"/>
>     <j:if test="${precompileJsp == 'true'}">
>       <attainGoal name="precompile-jsp"/>
>     </j:if>
>   </preGoal>
> 
>   <postGoal name="war:webapp">
>     <j:set var="precompileJsp" value="${precompile.jsp}"/>
>     <j:if test="${precompileJsp == 'true'}">
>       <j:set var="target" 
> value="${pom.getPluginContext('maven-war-plugin').getVariable('maven.war.webapp.dir')}"/> 
> 
>       <util:available file="${maven.build.dir}/web-fragment.xml">
>         <util:loadText var="fragment" 
> file="${maven.build.dir}/web-fragment.xml"/>
>         <ant:replace file="${target}/WEB-INF/web.xml" token="&lt;!-- 
> ${maven.tomcat.generated} --&gt;" value="${fragment}"/>
>       </util:available>
>     </j:if>
> 
>   </postGoal>
> 
>   <goal name="precompile-jsp" description="Precompile all JSPs into java 
> classes, and then into classes" prereqs="war:load,java:compile">
>     <j:set var="warSource" 
> value="${pom.getPluginContext('maven-war-plugin').getVariable('maven.war.src')}"/> 
> 
>     <ant:mkdir dir="${maven.build.dir}/jspc"/>
>     <ant:mkdir dir="${maven.build.dir}/jspc-processed"/>
>     <ant:mkdir dir="${maven.build.dir}/jspc-classes"/>
> 
>     <j:set var="jspOutDir" value="${maven.build.dir}/jspc"/>
>     <j:set var="jspClassesOutDir" value="${maven.build.dest}"/>
>     <ant:path id="jspc.classpath">
>       <echo message="Java home=${java.home}" />
>       <ant:pathelement location="${java.home}/../lib/tools.jar"/>
>       <ant:fileset dir="${tomcat.home}/bin">
>         <ant:include name="*.jar"/>
>       </ant:fileset>
>       <ant:fileset dir="${tomcat.home}/server/lib">
>         <ant:include name="*.jar"/>
>       </ant:fileset>
>       <ant:fileset dir="${tomcat.home}/common/lib">
>         <ant:include name="*.jar"/>
>       </ant:fileset>
>       <ant:path refid="maven.dependency.classpath"/>
>       <ant:pathelement path="${maven.build.dest}"/>
>     </ant:path>
>     <jasper:JspC
>       webXmlFragment="${maven.build.dir}/web-fragment.xml"
>       package="${pom.package}.jsp.${maven.war.final.name}"
>       outputDir="${jspOutDir}"
>       srcdir="${warSource}"
>       uriroot="${warSource}"
>       uribase="/${pom.artifactId}"
>       verbose="2"/>
>     <ant:javac
>       srcdir="${jspOutDir}"
>       destdir="${jspClassesOutDir}"
>       debug="${maven.compile.debug}"
>       deprecation="${maven.compile.deprecation}"
>       optimize="${maven.compile.optimize}"
>       classpathref="jspc.classpath"/>
>   </goal>
> 
> 
> 
> - -- --- -----=[ shuber2 at jahia dot com ]=---- --- -- -
> www.jahia.org : A collaborative source CMS and Portal Server
> 
> 
> ---------------------------------------------------------------------
> 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: Codeczar Maven Tomcat Plugin improvements suggestions

Posted by Carlos Sanchez <ap...@carlos.cousas.net>.
Hi,

The maven project at apache.org doesn't mantain the Tomcat Plugin, please
contact with the authors if nobody answers you in this list.

Regards

Carlos Sanchez
A Coruña, Spain

Oness Project
http://oness.sourceforge.net
 

> -----Original Message-----
> From: Serge Huber [mailto:shuber2@jahia.com] 
> Sent: Thursday, August 12, 2004 4:58 PM
> To: users@maven.apache.org
> Subject: Codeczar Maven Tomcat Plugin improvements suggestions
> 
> 
> Hi all,
> 
> First of all thanks to the guys at codeczar for their plugin. 
> It's really helpful.
> 
> I've recently started using the tomcat:jspc goal and I've had 
> a few problems. First of all it fails if I don't declare a 
> maven.war.src directory explicitely in my project.properties. 
> This might be due to the final version of the WAR plugin that 
> I'm using with Maven 1.0 final.
> 
> Also, the JSP are translated into Java source code, but there 
> is no target to compile the source code which I find a shame.
> 
> Last but not least the
> @maven.tomcat.generated@
> to be inserted in the web.xml file is not very elegant 
> because if we don't execute the merge, we will end up with an 
> invalid web.xml file. I suggest to use something like this :
> 
> <!-- ${maven.tomcat.generated} -->
> 
> I have very limited knowledge of Jelly so I'm not sure how I 
> can help do all these changes. I am showing below some goals 
> that do implement all the stuff I've talked about, but they 
> are not integrated with the Tomcat plugin. The following code 
> has been tested with Tomcat 5.0.18 only.
> 
> Regards,
>    Serge Huber.
> 
> project.xml (extract & the same as the Tomcat plugin) :
> -------------------------------------------------------
> <!-- Dependencies required for JSP precompilation -->
>      <dependency>
>        <groupId>tomcat</groupId>
>        <artifactId>catalina-ant</artifactId>
>        <version>5.0.18</version>
>        <properties>
>          <classloader>root</classloader>
>        </properties>
>      </dependency>
>      <dependency>
>        <groupId>tomcat</groupId>
>        <artifactId>jasper-compiler</artifactId>
>        <version>5.0.18</version>
>      </dependency>
>      <dependency>
>        <groupId>tomcat</groupId>
>        <artifactId>jasper-runtime</artifactId>
>        <version>5.0.18</version>
>      </dependency>
>      <dependency>
>        <groupId>commons-logging</groupId>
>        <artifactId>commons-logging</artifactId>
>        <version>1.0.3</version>
>      </dependency>
>      <!--dependency>
>        <groupId>commons-collections</groupId>
>        <artifactId>commons-collections</artifactId>
>        <version>3.0</version>
>        <properties>
>          <classloader>root</classloader>
>        </properties>
>      </dependency-->
>      <dependency>
>        <groupId>commons-el</groupId>
>        <artifactId>commons-el</artifactId>
>        <version>1.0</version>
>        <properties>
>          <classloader>root</classloader>
>        </properties>
>      </dependency>
>      <!--dependency>
>        <groupId>commons-daemon</groupId>
>        <artifactId>commons-daemon</artifactId>
>        <version>SNAPSHOT</version>
>        <properties>
>          <classloader>root</classloader>
>        </properties>
>      </dependency>
>      <dependency>
>        <groupId>xerces</groupId>
>        <artifactId>xerces</artifactId>
>        <version>2.4.0</version>
>        <properties>
>          <classloader>root</classloader>
>        </properties>
>      </dependency>
>      <dependency>
>        <groupId>xerces</groupId>
>        <artifactId>xercesImpl</artifactId>
>        <version>2.6.2</version>
>        <properties>
>          <classloader>root</classloader>
>        </properties>
>      </dependency>
>      <dependency>
>        <groupId>xerces</groupId>
>        <artifactId>xmlParserAPIs</artifactId>
>        <version>2.2.1</version>
>        <properties>
>          <classloader>root</classloader>
>        </properties>
>      </dependency-->
>      <dependency>
>        <groupId>servletapi</groupId>
>        <artifactId>servlet-api</artifactId>
>        <version>2.4-20040521</version>
>        <!--properties>
>          <classloader>root</classloader>
>        </properties-->
>        <type>jar</type>
>      </dependency>
>      <dependency>
>        <groupId>jspapi</groupId>
>        <artifactId>jsp-api</artifactId>
>        <version>2.0-20040521</version>
>        <!-- don't understand why I need root but throws class 
> not found otherwise -->
>        <properties>
>          <classloader>root</classloader>
>        </properties>
>        <type>jar</type>
>      </dependency>
> 
> 
>      <!--dependency>
>        <groupId>ant</groupId>
>        <artifactId>ant</artifactId>
>        <version>1.6.1</version>
>        <properties>
>          <classloader>root</classloader>
>        </properties>
>      </dependency-->
> 
> project.properties :
> --------------------
> # Set to true if you want JSP precompilation to happen after 
> war:webapp goal
> precompile.jsp=true
> 
> maven.xml :
> -----------
> <project default="war"
>           xmlns:j="jelly:core"
>           xmlns:define="jelly:define"
>           xmlns:util="jelly:util"
>           xmlns:jasper="jasper"
>           xmlns:ant="jelly:ant">
> 
>    <!-- 
> ================================================================ -->
>    <!-- Deploy to Catalina and Expand                         
>            -->
>    <!-- 
> ================================================================ -->
>    <define:taglib uri="jasper">
>      <define:jellybean
>        name="JspC"
>        className="org.apache.jasper.JspC"
>        method="execute"
>        />
>    </define:taglib>
> 
>    <preGoal name="war:webapp">
>      <j:set var="precompileJsp" value="${precompile.jsp}"/>
>      <j:if test="${precompileJsp == 'true'}">
>        <attainGoal name="precompile-jsp"/>
>      </j:if>
>    </preGoal>
> 
>    <postGoal name="war:webapp">
>      <j:set var="precompileJsp" value="${precompile.jsp}"/>
>      <j:if test="${precompileJsp == 'true'}">
>        <j:set var="target" 
> value="${pom.getPluginContext('maven-war-plugin').getVariable(
> 'maven.war.webapp.dir')}"/>
>        <util:available file="${maven.build.dir}/web-fragment.xml">
>          <util:loadText var="fragment" 
> file="${maven.build.dir}/web-fragment.xml"/>
>          <ant:replace file="${target}/WEB-INF/web.xml" token="&lt;!-- 
> ${maven.tomcat.generated} --&gt;" value="${fragment}"/>
>        </util:available>
>      </j:if>
> 
>    </postGoal>
> 
>    <goal name="precompile-jsp" description="Precompile all 
> JSPs into java 
> classes, and then into classes" prereqs="war:load,java:compile">
>      <j:set var="warSource" 
> value="${pom.getPluginContext('maven-war-plugin').getVariable(
> 'maven.war.src')}"/>
>      <ant:mkdir dir="${maven.build.dir}/jspc"/>
>      <ant:mkdir dir="${maven.build.dir}/jspc-processed"/>
>      <ant:mkdir dir="${maven.build.dir}/jspc-classes"/>
> 
>      <j:set var="jspOutDir" value="${maven.build.dir}/jspc"/>
>      <j:set var="jspClassesOutDir" value="${maven.build.dest}"/>
>      <ant:path id="jspc.classpath">
>        <echo message="Java home=${java.home}" />
>        <ant:pathelement location="${java.home}/../lib/tools.jar"/>
>        <ant:fileset dir="${tomcat.home}/bin">
>          <ant:include name="*.jar"/>
>        </ant:fileset>
>        <ant:fileset dir="${tomcat.home}/server/lib">
>          <ant:include name="*.jar"/>
>        </ant:fileset>
>        <ant:fileset dir="${tomcat.home}/common/lib">
>          <ant:include name="*.jar"/>
>        </ant:fileset>
>        <ant:path refid="maven.dependency.classpath"/>
>        <ant:pathelement path="${maven.build.dest}"/>
>      </ant:path>
>      <jasper:JspC
>        webXmlFragment="${maven.build.dir}/web-fragment.xml"
>        package="${pom.package}.jsp.${maven.war.final.name}"
>        outputDir="${jspOutDir}"
>        srcdir="${warSource}"
>        uriroot="${warSource}"
>        uribase="/${pom.artifactId}"
>        verbose="2"/>
>      <ant:javac
>        srcdir="${jspOutDir}"
>        destdir="${jspClassesOutDir}"
>        debug="${maven.compile.debug}"
>        deprecation="${maven.compile.deprecation}"
>        optimize="${maven.compile.optimize}"
>        classpathref="jspc.classpath"/>
>    </goal>
> 
> 
> 
> - -- --- -----=[ shuber2 at jahia dot com ]=---- --- -- -
> www.jahia.org : A collaborative source CMS and Portal Server 
> 
> 
> 
> ---------------------------------------------------------------------
> 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