Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6936733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:16:18+00:00 2026-05-27T12:16:18+00:00

I have a build.xml that work fine, until I start using boilerplate generation and

  • 0

I have a build.xml that work fine, until I start using boilerplate generation and create a Generator.

Everything works fine in Dev Mode, but, I was unable to generate a war for my application.

I think that is because the gen classes are going to /apt_generated, not /src, and my ant compiles /src, I just don’t have any idea about generators.

I’m just trying to make it work, but I can’t.

Can someone help me?

My build.xml is just like this:

<property name="version" value="1.0.0-SNAPSHOT"/>
    <property name="gwt.module.name" value="com.test.Test"/>
    <property name="server.resources.name" value="server_resources"/>
    <property name="jar.name" value="test${version}.jar"/>
    <property name="war.name" value="test${version}.war"/>
    <property name="src.dir" location="src"/>
    <property name="server.resources.dir" location="war/${server.resources.name}"/>
    <property name="build.dir" location="build"/>    
    <property name="build.server.resources.dir" location="war/WEB-INF/classes/server_resources"/>        
    <property name="lib.dir" location="war/WEB-INF/lib"/>
    <property name="gwt.client.dir" location="com/test/client"/>

    <path id="project.classpath">        
        <fileset dir="${lib.dir}">
            <include name="**/*.jar"/>
        </fileset>
    </path>  

    <target name="prepare">
        <mkdir dir="${build.dir}"/>
    </target>

    <target name="clean">
        <delete dir="${build.dir}"/>
    </target>  

    <!-- Compile the java source code using javac -->
    <target name="compile" depends="prepare">        
        <javac srcdir="${src.dir}" destdir="${build.dir}">
            <classpath refid="project.classpath"/>
        </javac>        
    </target>       
    <!-- Invoke the GWT compiler to create the Javascript for us -->
   <target name="gwt-compile" depends="compile">
        <java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler">
            <classpath>
                <!-- src dir is added to ensure the module.xml file(s) are on the classpath -->
                <pathelement location="${src.dir}"/>                
                <pathelement location="${build.dir}"/>
                <path refid="project.classpath"/>
            </classpath>
            <jvmarg value="-Xmx512M"/>
            <arg value="${gwt.module.name}"/>
         </java>
     </target>
    <!-- Package the compiled Java source into a JAR file -->
    <target name="jar" depends="compile">        
        <jar jarfile="${lib.dir}/${jar.name}" basedir="${build.dir}/">
            <!-- Don't wrap any of the client only code into the JAR -->
            <exclude name="${gwt.client.dir}/**/*.class"/>
        </jar>    
    </target>
    <!-- Copy the static server resources into the required 
    directory ready for packaging -->    
    <target name="copy-resources">
        <copy todir="${build.server.resources.dir}" preservelastmodified="true">
            <fileset dir="${server.resources.dir}"/>            
        </copy>
    </target>    
    <!-- Package the JAR file, Javascript, static resources 
    and external libraries into a WAR file -->
    <target name="war" depends="gwt-compile, jar, copy-resources">
        <war basedir="war" destfile="${war.name}" webxml="war/WEB-INF/web.xml">
            <exclude name="WEB-INF/**" />
            <exclude name="${server.resources.name}/**"/>
            <webinf dir="war/WEB-INF/">
                <include name="classes/${server.resources.name}/**" />
                <include name="**/*.jar" />
                <!-- <exclude name="**/gwt-dev.jar" /> -->
                <exclude name="**/gwt-user.jar" />
            </webinf>
        </war>
    </target>    

</project>

The errors:

[javac] D:\CARLOS\workspaces\Test\Test\src\com\test\server\actionhandlers\autenticar\RecuperarSenhaActionHandler.java:50: cannot find symbol
[javac] symbol  : class RecuperarSenhaAction
[javac] location: class com.test.server.actionhandlers.autenticar.RecuperarSenhaActionHandler
[javac]     public void undo(RecuperarSenhaAction arg0, RecuperarSenhaResult arg1, ExecutionContext arg2) throws ActionException

[javac] D:\CARLOS\workspaces\Test\Test\src\com\test\server\i18n\EnumMessageGenerator.java:84: cannot find symbol
[javac] symbol  : class SourceWriter
[javac] location: class com.test.server.i18n.EnumMessageGenerator
[javac]             SourceWriter sw = composer.createSourceWriter(context, printWriter);
[javac]             ^
[javac] 15 errors

EDIT.

I modify my build.xml, now, I have one more property, <property name="apt_generated.dir" location="apt_generated" />, and my compile target turns in into this:

<target name="compile" depends="prepare">
        <javac destdir="${build.dir}">
            <src location="${src.dir}" />
            <src location="${apt_generated.dir}" />
            <classpath refid="project.classpath" />
        </javac>
    </target>

That “solve” the issue with apt_generated (I think), but I still can’t build it because the errors with SourceWriter and javax.validation classes.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T12:16:19+00:00Added an answer on May 27, 2026 at 12:16 pm

    Generated classes need to be compiled too. As i don’t see any code generation in your example I just assumed the following values.

     <target name="compile" depends="prepare">    
            <-- compile generated classes-->
            <javac srcdir="${apt_generated.dir}" destdir="${build.generated.dir}">
                <classpath refid="project.classpath"/>
            </javac>    
    
            <-- compile sources -->   
            <javac srcdir="${src.dir}" destdir="${build.dir}">
                <classpath location="${build.generated.dir}"/>
                <classpath refid="project.classpath"/>
            </javac>        
        </target>  
    

    As stated in your comment the generated classes depend on the sources and vice versa, so you need to:

    • EITHER split your project, so that all common dependencies are in another project
    • OR compile everything together

    The second could be accomplished like:

     <target name="compile" depends="prepare">    
         <javac destdir="${build.dir}">
            <src location="${src.dir}" />
            <src location="${apt_generated.dir}" />
            <classpath refid="project.classpath" />
         </javac>   
     </target>  
    

    If anything else misses make sure that:

    • the appropriate lib is included in project.classpath (if you are not sure which jar you are missing you can try http://www.findjar.com
    • all sources are on either of one src dir
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an object that can build itself from an XML string, and write
Do you have some predefined set of targets which all build.xml files you create
I have build C# program that work with RAPI (communication to PPC or WinCE)
Let's say I have a file-system that looks a little something like this: C:\stuff\build.xml
I have the following defined in a file called build-dependencies.xml <?xml version=1.0 encoding=UTF-8?> <project
I have build a webapplication using ASP.NET MVC and JQuery. On my local machine
I have a build script and as part of that script it copies a
I am trying to build a C++ app to access a XML resource. Using
I am converting ant to maven2. In build.xml, I have: <target name=clean> <delete file=${dir.dist}/${api.jarfile}
I have an existing XML schema that contains a type that I would like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.