Re: [appengine-java] Re: Referencing projects

2010-01-21 Thread Ikai L (Google)
The .NET approach is different than the Java approach. It's unnecessary to
break this project up. I personally do not think you gain anything with this
approach other than additional complexity.

That being said, Eclipse is infinitely flexible. You can probably set it up
so that on a build, it creates a JAR file and places it in WEB-INF/lib.

On Thu, Jan 21, 2010 at 12:18 PM, Maurits
mvanbeuse...@themobilebrand.comwrote:

 Hi Ikai (and others),

 Thank you very much for your reply, I appreciate it.

 Although I am not yet satisfied (sorry ;) ). The thing is I am not
 just learning Java, I got the language covered, I am a seasoned C#
 programmer and have some experience with Java already. Now I am trying
 to build a serious application and would like split up the project
 into several projects (as I would do in .NET). The thing is that I
 have all the code ready and it works as long as I manually copy the
 JAR files into the WEB-INF/lib folder. I will go check out the link
 you supplied, but if you or any one else can provide some more insight
 I would really appreciate it.

 Thanks Maurits


 On Jan 21, 8:29 pm, Ikai L (Google) ika...@google.com wrote:
  Hi there!
 
  If you're learning Java, it's probably overkill to create 4 different
  projects, even for different layers of the application. It's probably
 enough
  to simply create different packages and sort through them that way.
 
  For development, you can get away with putting the JAR files in your Java
  classpath. Another thing you can do is to use a popular Java build tool,
  Ant, to do this manually. It's a great opportunity to learn Ant! Here are
  the bits related to App Engine:
 
  http://code.google.com/appengine/docs/java/tools/ant.html
 
  http://code.google.com/appengine/docs/java/tools/ant.htmlThat being
 said,
  I don't think it's necessary to break things up into four projects. It's
  easy - almost trivial - to do so later down the line if your packages are
  set up right.
 
  On Thu, Jan 21, 2010 at 1:42 AM, Maurits 
 mvanbeuse...@themobilebrand.comwrote:
 
 
 
 
 
   Hi all,
 
   I am an experienced .NET developer but new to JAVA and Eclipse. I am
   currently experimenting with JAVA and the GAE with plans to start
   making more use of the GAE since I really like what is offered (Google
   keep up the good work ;)).
 
   However I am running into a problem, I would like to build an
   application using multiple layers (currently a Presentation layer,
   Service layer, Business layer and a Data layer). My presentation layer
   is a GAE project created using the Eclipse plug-in, the other layers
   are all normal JAVA projects I created in the same workspace (so I
   have 4 separate projects). Now I managed to get everything compile
   correctly by referencing all projects with each other using the Java
   Build Path - Projects dialog window.
 
   However when I run the application I run into the problem that the
   Presentation layer cannot find the classed from my Service layer
   project. I figured out that I need to manually copy the output classes
   from the Service (and others) layer into the WEB-INF/lib folder to get
   it working (preferably packed into a JAR file).
 
   My question is, can this be somehow automated? I read some information
   about using an ANT script to do so, but since I am a bit spoiled with
   Visual Studio (who does this automatically when I make the reference)
   I have no clue on how to start, I don't even know how to automatically
   pack the class files from the Service, Business and Data layers into a
   JAR file.
 
   Is there someone who can get me started?
 
   Many thanks,
 
   Maurits
 
   --
   You received this message because you are subscribed to the Google
 Groups
   Google App Engine for Java group.
   To post to this group, send email to
   google-appengine-j...@googlegroups.com.
   To unsubscribe from this group, send email to
   google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.comgoogle-appengine-java%2B
 unsubscr...@googlegroups.com
   .
   For more options, visit this group at
  http://groups.google.com/group/google-appengine-java?hl=en.
 
  --
  Ikai Lan
  Developer Programs Engineer, Google App Engine

 --
 You received this message because you are subscribed to the Google Groups
 Google App Engine for Java group.
 To post to this group, send email to
 google-appengine-j...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-appengine-java?hl=en.






-- 
Ikai Lan
Developer Programs Engineer, Google App Engine
-- 

You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group.

To post to this group, send email to google-appengine-j...@googlegroups.com.

To unsubscribe from this group, 

[appengine-java] Re: Referencing projects

2010-01-21 Thread Maurits
Hi Ikai,

Thanks again for the reply.

The thing is that I want the Service layer to be a facade library
which (potentially) can be used in several projects. I assumed it
would be useful to compile it into a separate JAR file so it can
easily be reused and I don't have to extract the packages first. That
is the reason I wanted to separate stuff into different projects, does
that make sense or am I thinking  completely wrong here.

--
Maurits

On Jan 21, 9:34 pm, Ikai L (Google) ika...@google.com wrote:
 The .NET approach is different than the Java approach. It's unnecessary to
 break this project up. I personally do not think you gain anything with this
 approach other than additional complexity.

 That being said, Eclipse is infinitely flexible. You can probably set it up
 so that on a build, it creates a JAR file and places it in WEB-INF/lib.

 On Thu, Jan 21, 2010 at 12:18 PM, Maurits
 mvanbeuse...@themobilebrand.comwrote:





  Hi Ikai (and others),

  Thank you very much for your reply, I appreciate it.

  Although I am not yet satisfied (sorry ;) ). The thing is I am not
  just learning Java, I got the language covered, I am a seasoned C#
  programmer and have some experience with Java already. Now I am trying
  to build a serious application and would like split up the project
  into several projects (as I would do in .NET). The thing is that I
  have all the code ready and it works as long as I manually copy the
  JAR files into the WEB-INF/lib folder. I will go check out the link
  you supplied, but if you or any one else can provide some more insight
  I would really appreciate it.

  Thanks Maurits

  On Jan 21, 8:29 pm, Ikai L (Google) ika...@google.com wrote:
   Hi there!

   If you're learning Java, it's probably overkill to create 4 different
   projects, even for different layers of the application. It's probably
  enough
   to simply create different packages and sort through them that way.

   For development, you can get away with putting the JAR files in your Java
   classpath. Another thing you can do is to use a popular Java build tool,
   Ant, to do this manually. It's a great opportunity to learn Ant! Here are
   the bits related to App Engine:

  http://code.google.com/appengine/docs/java/tools/ant.html

   http://code.google.com/appengine/docs/java/tools/ant.htmlThat being
  said,
   I don't think it's necessary to break things up into four projects. It's
   easy - almost trivial - to do so later down the line if your packages are
   set up right.

   On Thu, Jan 21, 2010 at 1:42 AM, Maurits 
  mvanbeuse...@themobilebrand.comwrote:

Hi all,

I am an experienced .NET developer but new to JAVA and Eclipse. I am
currently experimenting with JAVA and the GAE with plans to start
making more use of the GAE since I really like what is offered (Google
keep up the good work ;)).

However I am running into a problem, I would like to build an
application using multiple layers (currently a Presentation layer,
Service layer, Business layer and a Data layer). My presentation layer
is a GAE project created using the Eclipse plug-in, the other layers
are all normal JAVA projects I created in the same workspace (so I
have 4 separate projects). Now I managed to get everything compile
correctly by referencing all projects with each other using the Java
Build Path - Projects dialog window.

However when I run the application I run into the problem that the
Presentation layer cannot find the classed from my Service layer
project. I figured out that I need to manually copy the output classes
from the Service (and others) layer into the WEB-INF/lib folder to get
it working (preferably packed into a JAR file).

My question is, can this be somehow automated? I read some information
about using an ANT script to do so, but since I am a bit spoiled with
Visual Studio (who does this automatically when I make the reference)
I have no clue on how to start, I don't even know how to automatically
pack the class files from the Service, Business and Data layers into a
JAR file.

Is there someone who can get me started?

Many thanks,

Maurits

--
You received this message because you are subscribed to the Google
  Groups
Google App Engine for Java group.
To post to this group, send email to
google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to
google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2B
 unsubscr...@googlegroups.comgoogle-appengine-java%2B
  unsubscr...@googlegroups.com
.
For more options, visit this group at
   http://groups.google.com/group/google-appengine-java?hl=en.

   --
   Ikai Lan
   Developer Programs Engineer, Google App Engine

  --
  You received this message because you are subscribed to the Google Groups
  Google App Engine for Java group.
  To post to this group, send email to
  

[appengine-java] Re: Referencing projects

2010-01-21 Thread Jake
Hi Maurits,

I've achieved what you're looking for, but it wasn't easy.  If anyone
has a better solution, I'm all ears.

First of all, to do it manually, you can Right-click any project in
Eclipse and Export it to a JAR file - which can then be saved in your
GAE lib/ folder.  But, this has to be done each time you make a
change.

I'm currently using Maven in Eclipse to manage and build my projects
(this copies those external JAR files each time) and then the maven-
antrun-plugin to call the GAE command line scripts that run/upload my
project.  Now that it's set up, it is a single click to run/upload,
despite being dependent on several other Eclipse Projects and 3rd
Party plugins.

This website was the most helpful in setting that up:
http://twelves.blogspot.com/2009/04/google-appengine-maven-pom.html

Most notably, I did not use the maven-gae-plugin that is mentioned
frequently around the interwebs - I was never able to get it working
properly.

I've pasted the applicable bits of my Maven POM file below - that
might be helpful.  This is all based on MacOS commands, but I believe
Windows is similar.  If you choose not to use Maven, the applicable
ANT bits will still be helpful.

Good Luck!

Jake


project xmlns=http://maven.apache.org/POM/4.0.0; xmlns:xsi=http://
www.w3.org/2001/XMLSchema-instance
  xsi:schemaLocation=http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd;
groupIdorg.example/groupId
artifactIdproject/artifactId
packagingwar/packaging

properties
gae.sdk.location/Applications/eclipse/plugins/
com.google.appengine.eclipse.sdkbundle.1.3.0_1.3.0.v200912141120/
appengine-java-sdk-1.3.0/gae.sdk.location
/properties

repositories
repository
idMVNSearch/id
nameMVNSearch/name
urlhttp://www.mvnsearch.org/maven2/url
/repository
repository
idDataNucleus/id
urlhttp://www.datanucleus.org/downloads/maven2//url
/repository
/repositories

dependencies
dependency
groupIdcom.google.appengine/groupId
artifactIdappengine-api-1.0-labs/artifactId
version1.3.0/version
/dependency
dependency
groupIdcom.google.appengine.orm/groupId
artifactIddatanucleus-appengine/artifactId
version1.0.4.1/version
exclusions
exclusion

artifactIddatanucleus-core/artifactId
groupIdorg.datanucleus/groupId
/exclusion
/exclusions
/dependency
dependency
groupIdorg.datanucleus/groupId
artifactIddatanucleus-core/artifactId
version1.1.6/version
/dependency
dependency
groupIdorg.datanucleus/groupId
artifactIddatanucleus-jpa/artifactId
version1.1.5/version
/dependency
dependency
groupIdorg.example/groupId
artifactIdotherproject/artifactId
version0.0.1-SNAPSHOT/version
/dependency
/dependencies

build
finalName${project.artifactId}/finalName
resources
resource
filteringfalse/filtering
directorysrc/main/resources/directory
/resource
resource
filteringfalse/filtering
directorysrc/main/java/directory
includes
include**/include
/includes
excludes
exclude**/*.java/exclude
/excludes
/resource
resource
directorysrc/main/webapp//directory
includes
include**/*.xml/include
/includes
/resource
/resources
plugins
plugin
groupIdorg.apache.maven.plugins/groupId
artifactIdmaven-war-plugin/artifactId
configuration


[appengine-java] Re: Referencing projects

2010-01-21 Thread Maurits
Hi Jake,

Thank you very much for your reply, this is exactly what I was looking
for. And since I am also using on MacOS it should be really easy to
setup with the information you gave ;).

Cheers, Maurits



On Jan 21, 8:03 pm, Jake jbrooko...@cast.org wrote:
 Hi Maurits,

 I've achieved what you're looking for, but it wasn't easy.  If anyone
 has a better solution, I'm all ears.

 First of all, to do it manually, you can Right-click any project in
 Eclipse and Export it to a JAR file - which can then be saved in your
 GAE lib/ folder.  But, this has to be done each time you make a
 change.

 I'm currently using Maven in Eclipse to manage and build my projects
 (this copies those external JAR files each time) and then the maven-
 antrun-plugin to call the GAE command line scripts that run/upload my
 project.  Now that it's set up, it is a single click to run/upload,
 despite being dependent on several other Eclipse Projects and 3rd
 Party plugins.

 This website was the most helpful in setting that 
 up:http://twelves.blogspot.com/2009/04/google-appengine-maven-pom.html

 Most notably, I did not use the maven-gae-plugin that is mentioned
 frequently around the interwebs - I was never able to get it working
 properly.

 I've pasted the applicable bits of my Maven POM file below - that
 might be helpful.  This is all based on MacOS commands, but I believe
 Windows is similar.  If you choose not to use Maven, the applicable
 ANT bits will still be helpful.

 Good Luck!

 Jake

 project xmlns=http://maven.apache.org/POM/4.0.0; 
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
   
 xsi:schemaLocation=http://maven.apache.org/POM/4.0.0http://maven.apache.org/maven-v4_0_0.xsd;
         groupIdorg.example/groupId
         artifactIdproject/artifactId
         packagingwar/packaging

         properties
                 gae.sdk.location/Applications/eclipse/plugins/
 com.google.appengine.eclipse.sdkbundle.1.3.0_1.3.0.v200912141120/
 appengine-java-sdk-1.3.0/gae.sdk.location
         /properties

         repositories
                 repository
                         idMVNSearch/id
                         nameMVNSearch/name
                         urlhttp://www.mvnsearch.org/maven2/url
                 /repository
                 repository
                         idDataNucleus/id
                         
 urlhttp://www.datanucleus.org/downloads/maven2//url
                 /repository
         /repositories

         dependencies
                 dependency
                         groupIdcom.google.appengine/groupId
                         artifactIdappengine-api-1.0-labs/artifactId
                         version1.3.0/version
                 /dependency
                 dependency
                         groupIdcom.google.appengine.orm/groupId
                         artifactIddatanucleus-appengine/artifactId
                         version1.0.4.1/version
                         exclusions
                                 exclusion
                                         
 artifactIddatanucleus-core/artifactId
                                         groupIdorg.datanucleus/groupId
                                 /exclusion
                         /exclusions
                 /dependency
                 dependency
                         groupIdorg.datanucleus/groupId
                         artifactIddatanucleus-core/artifactId
                         version1.1.6/version
                 /dependency
                 dependency
                         groupIdorg.datanucleus/groupId
                         artifactIddatanucleus-jpa/artifactId
                         version1.1.5/version
                 /dependency
                 dependency
                         groupIdorg.example/groupId
                         artifactIdotherproject/artifactId
                         version0.0.1-SNAPSHOT/version
                 /dependency
         /dependencies

         build
                 finalName${project.artifactId}/finalName
                 resources
                         resource
                                 filteringfalse/filtering
                                 directorysrc/main/resources/directory
                         /resource
                         resource
                                 filteringfalse/filtering
                                 directorysrc/main/java/directory
                                 includes
                                         include**/include
                                 /includes
                                 excludes
                                         exclude**/*.java/exclude
                                 /excludes
                         /resource
                         resource
                                 directorysrc/main/webapp//directory
                                 includes
                                         include**/*.xml/include
                                 /includes