Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using workspace projects with AppEngine

I'm trying to use a library project with my Google AppEngine project as a project on build path.

Is there a way to get that included in the AppEngine project without having to copy the entire source or make a jar ?

I only use a small portion of the library so it seems like overkill to copy the whole jar and a lot of work to find the dependencies within the source to get only the parts I'm using.

like image 957
Saad Farooq Avatar asked May 14 '26 05:05

Saad Farooq


2 Answers

I added an ant project builder that copies the class files from the dependent project. The ant file resides in the gae project and copies the class files from the referenced project. Here's the ant:

<?xml version="1.0" encoding="UTF-8"?>
<project name="CommonsCopy" default="copy" basedir=".">
    <target name="copy">
        <copy todir="war/WEB-INF/classes">
            <fileset dir="../Commons/bin" includes="**/*.class">
            </fileset>
        </copy>
    </target>
</project>

I named it 'CommonsCopyBuilder.xml' as it copies code from a commons project.

This will copy the files to the appropriate location just before running the project.

like image 153
AlikElzin-kilaka Avatar answered May 17 '26 11:05

AlikElzin-kilaka


You are not going to like this answer, but No.

In order to include the library as a dependency in the project once deployed the required library must be found in your WEB-INF/lib directory as a jar. This is going to require you to you to create a jar based on the library you want to use. The other option is to do just as you said pull the dependent source into your project and use it from there.

During development you can make the library project a dependency of your app engine project by doing the following:

Under Project->Properties->Java Build Path->Projects Tab
select the "Add.." button to add a subproject to your build.

Note: This will not address the the running in a production environment.

like image 34
Chris Johnson Avatar answered May 17 '26 12:05

Chris Johnson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!