You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dmitriy Kuznetsov <he...@yandex.ru> on 2008/06/19 20:28:59 UTC

Struts2 annotation based TLD generation using Ant

Struts2 TLD files are generated by maven. I will not use maven on current
project, so how to run the same task from Ant?

Probably, the following part of pom.xml allows maven to do it:

            <plugin>
                <groupId>org.apache.myfaces.tobago</groupId>
                <artifactId>maven-apt-plugin</artifactId>
                <version>1.0.15</version>
                <configuration>
                    
uri=/struts-tags,tlibVersion=2.2.3,jspVersion=2.0,shortName=s,displayName="Struts
Tags",
                   
outFile=${basedir}/target/classes/META-INF/struts-tags.tld,
                    description="To make it easier to access dynamic data;
                    the Apache Struts framework includes a library of custom
tags.
                    The tags interact with the framework's validation and
internationalization features;
                    to ensure that input is correct and output is localized.
                    The Struts Tags can be used with JSP FreeMarker or
Velocity.",
                    outTemplatesDir=${basedir}/src/site/resources/tags
                     
                    <resourceTargetPath>target</resourceTargetPath>
                    <fork>false</fork>
                    <force>true</force>
                    <nocompile>true</nocompile>
                    <showWarnings>true</showWarnings>
                   
<factory>org.apache.struts.annotations.taglib.apt.TLDAnnotationProcessorFactory</factory>
                    <target>1.5</target>
                    <includes>
                        <include>**/*.java</include>
                    </includes>
                </configuration>
                <executions>
                    <execution>
                        <phase>compile</phase>
                        <goals>
                            <goal>execute</goal>
                        </goals>
                </execution>
                </executions>
            </plugin>

I googled for a solution, or at least, docs, for a couple of days, but found
nothing.
-- 
View this message in context: http://www.nabble.com/Struts2-annotation-based-TLD-generation-using-Ant-tp18015219p18015219.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts2 annotation based TLD generation using Ant

Posted by Dmitriy Kuznetsov <he...@yandex.ru>.

Musachy Barroso wrote:
> 
> Get it from here:
> 
> http://repo1.maven.org/maven2/org/apache/struts/struts-annotations/
> 
> musachy
> 

I've managed to do it with following target:

	<target name="generate-taglib" depends="compile-project">
		<apt classpathref="struts-plugin.classpath" 
            factorypathref="struts-plugin.classpath"
            srcdir="src"
            compile="false"
            destdir="dest/apt"
            fork="true"
            preprocessdir="bin"
            verbose="false"
            source="1.5"
           
factory="org.apache.struts.annotations.taglib.apt.TLDAnnotationProcessorFactory">

			<compilerarg value="-AtlibVersion=0.0"/>
			<compilerarg value="-AjspVersion=2.0"/>
			<compilerarg value="-AshortName=ext"/>
			<compilerarg value="-Auri=/ext-tags"/>
			<compilerarg value="-Adescription='Description is set in build.xml'"/>
			<compilerarg value="-AdisplayName='Aleri Ext Tags'"/>
			<compilerarg value="-AoutTemplatesDir=${basedir}/doc"/>
			<compilerarg value="-AoutFile=${basedir}/bin/META-INF/ext-tags.tld"/>

			<!-- Apt Debug options -->
			<!--
            <compilerarg value="-print"/>
            <compilerarg value="-XListAnnotationTypes"/> 
            <compilerarg value="-XListDeclarations"/>
            <compilerarg value="-XPrintAptRounds"/>
            <compilerarg value="-XPrintFactoryInfo"/>
            -->
		</apt>
	</target>

following folders should exist in ${basedir}:
- src (with source code)
- bin (with already compiled sources)
- bin/META-INF
- doc
- dest/apt

${struts-plugin.classpath} should contain struts-annotations-1.0.X.jar

apt.exe must be available under %JDK_HOME%/bin that runs ant or in %PATH%
(if not, causes trouble "Error running apt.exe compiler", e.g. if build is
started under Eclipse, which is started by JRE, not JDK).
-- 
View this message in context: http://www.nabble.com/Struts2-annotation-based-TLD-generation-using-Ant-tp18015219p18033588.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts2 annotation based TLD generation using Ant

Posted by Musachy Barroso <mu...@gmail.com>.
Get it from here:

http://repo1.maven.org/maven2/org/apache/struts/struts-annotations/

musachy

On Thu, Jun 19, 2008 at 2:56 PM, Dmitriy Kuznetsov
<he...@yandex.ru> wrote:
>
>
>
> Musachy Barroso wrote:
>>
>> The Ant Apt task  would be a way:
>> http://ant.apache.org/manual/CoreTasks/apt.html
>>
>> musachy
>>
>>
>
> Thanks. Could you please explain some details:
>
> 1. I found source code of TLDAnnotationProcessorFactory and some related
> classes at
> https://issues.apache.org/struts/secure/attachment/13234/WW-1392.zip
> Is it good enough to generate TLDs? Or, maybe, you know where to get some
> "official" or "stable" or, maybe, latest available variant?
>
> 2. Are there any things i would better know before i start - like external
> dependencies, java versions and so on?
>
> Best regards,
> Dmitriy.
> --
> View this message in context: http://www.nabble.com/Struts2-annotation-based-TLD-generation-using-Ant-tp18015219p18015742.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts2 annotation based TLD generation using Ant

Posted by Dmitriy Kuznetsov <he...@yandex.ru>.


Musachy Barroso wrote:
> 
> The Ant Apt task  would be a way:
> http://ant.apache.org/manual/CoreTasks/apt.html
> 
> musachy
> 
> 

Thanks. Could you please explain some details:

1. I found source code of TLDAnnotationProcessorFactory and some related
classes at
https://issues.apache.org/struts/secure/attachment/13234/WW-1392.zip
Is it good enough to generate TLDs? Or, maybe, you know where to get some
"official" or "stable" or, maybe, latest available variant?

2. Are there any things i would better know before i start - like external
dependencies, java versions and so on?

Best regards,
Dmitriy.
-- 
View this message in context: http://www.nabble.com/Struts2-annotation-based-TLD-generation-using-Ant-tp18015219p18015742.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts2 annotation based TLD generation using Ant

Posted by Musachy Barroso <mu...@gmail.com>.
The Ant Apt task  would be a way:
http://ant.apache.org/manual/CoreTasks/apt.html

musachy

On Thu, Jun 19, 2008 at 2:28 PM, Dmitriy Kuznetsov
<he...@yandex.ru> wrote:
>
> Struts2 TLD files are generated by maven. I will not use maven on current
> project, so how to run the same task from Ant?
>
> Probably, the following part of pom.xml allows maven to do it:
>
>            <plugin>
>                <groupId>org.apache.myfaces.tobago</groupId>
>                <artifactId>maven-apt-plugin</artifactId>
>                <version>1.0.15</version>
>                <configuration>
>
> uri=/struts-tags,tlibVersion=2.2.3,jspVersion=2.0,shortName=s,displayName="Struts
> Tags",
>
> outFile=${basedir}/target/classes/META-INF/struts-tags.tld,
>                    description="To make it easier to access dynamic data;
>                    the Apache Struts framework includes a library of custom
> tags.
>                    The tags interact with the framework's validation and
> internationalization features;
>                    to ensure that input is correct and output is localized.
>                    The Struts Tags can be used with JSP FreeMarker or
> Velocity.",
>                    outTemplatesDir=${basedir}/src/site/resources/tags
>
>                    <resourceTargetPath>target</resourceTargetPath>
>                    <fork>false</fork>
>                    <force>true</force>
>                    <nocompile>true</nocompile>
>                    <showWarnings>true</showWarnings>
>
> <factory>org.apache.struts.annotations.taglib.apt.TLDAnnotationProcessorFactory</factory>
>                    <target>1.5</target>
>                    <includes>
>                        <include>**/*.java</include>
>                    </includes>
>                </configuration>
>                <executions>
>                    <execution>
>                        <phase>compile</phase>
>                        <goals>
>                            <goal>execute</goal>
>                        </goals>
>                </execution>
>                </executions>
>            </plugin>
>
> I googled for a solution, or at least, docs, for a couple of days, but found
> nothing.
> --
> View this message in context: http://www.nabble.com/Struts2-annotation-based-TLD-generation-using-Ant-tp18015219p18015219.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org