I currently develop in Eclipse against the AppEngine development
environment. To produce the installer image, I then:
mvn clean
mvn install
copy the aggregate-mysql\target\aggregate-mysql-1.0.war into the
bitrock-installer directory
cd bitrock-installer
mvn clean
mvn install
Then open the Bitrock installer, open the build.xml definition file,
update the version, and build the various installers.
It appears that you can now use Maven within Eclipse (fixes below). So you
can build the MySQL build and run it within Eclipse. Note that the
maven-based builds split the source compilation so that the server source
files are compiled into a jar by the aggregate-src project. The UI files
are then separately compiled and placed into the war file by the individual
projects (e.g., aggregate-mysql). So if you do develop using these
maven-based projects within eclipse, you need to be sure that the
aggregate-src-latest.jar is being properly rebuilt (by the aggregate-src
project). I doubt on-the-fly editing will work like it does in the
eclipse-aggregate-gae project (and note that the maven-based gae build is
aggregate-gae, which mirrors the structures of aggregate-mysql and
aggregate-postgres).
Ah yes, I forgot about the JVM settings...
For Eclipse, you will want to edit the eclipse.ini file. This is in the
eclipse folder (where eclipse.exe is). When you run as a Web Applicaiton,
it starts 2 copies of all the code (one for the foreground web server, one
for the background server), and runs out of Perm space (code space).
I don't know what is required (the key values are definitely the
"XXMaxPermSize 512m" and the -Xmx1024m). I have:
-startup
plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.100.v20110502
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
512M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
512m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms100m
-Xmx1024m
Additional Eclipse configuration for Maven. On the Window / Preferences
page:
Java / Installed JREs:
Add the JDK path. (needed only for Maven-based builds)
Java / Installed JREs / Execution Environments:
Choose JavaSE-1.6, check the checkbox beside the JDK. (needed only for
Maven-based builds).
====> You will need to exit and restart Eclipse.
SYNC with the repository -- I have checked in new .classpath and .project
files for aggregate-mysql and aggregate-src (the project containing the
source files).
You will want the odk-mysql-it-settings, aggregate-src, aggregate-mysql
projects in your workspace.
With these changes, you can now "Run As -> maven install" to build the
aggregate-mysql project from within Eclipse (this will pop open Firefox and
run two trivial automated tests). Once that build is OK, you can then
Export WAR and it will export the same WAR structure as in the production
install.
The odk-mysql-it-settings-latest.jar is equivalent to the
ODKAggregate-settings.jar of the installer BUT has a login backdoor for the
testing -- the security.properties has:
security.server.superUserUsername=aggregate
Which allows the automated tests to log in with username aggregate,
password aggregate. You will want to either remove that jar and add in the
ODKAggregate-settings.jar produced from the standard install, or tweak the
build environment to alter the settings (which would break the automated
tests), or remember to change that user's password to something other than
'aggregate' in your production environment.
Mitch
Because of the Eclipse/Maven/GWT/AppEngine playing-well difficulties, I
now do development in Eclipse with the eclipse-aggregate-gae project
running as a GWT/AppEngine Web Application
On Tue, May 1, 2012 at 7:24 AM, Christopher Robert <chrislrobert@gmail.com wrote:
Hi Mitch,
Thanks for the quick and helpful reply. Your hints got me to the point
where I'm basically alive, but my build environment is still a bit less
than fully functional.
First, on the "mvn install", I always run out of memory on the gae
(BigTable) database unit test -- and then it skips everything from there.
Luckily, this is after the mysql build and test, but still I wonder if
there's an easy fix? I've included the relevant portion of the Maven output
after my signature below.
Second, after doing the mvn install I add the aggregate-mysql project to
Eclipse, as suggested by CONFIGURE.txt. If I try to build, I get a slew of
different errors. Some representative ones are below:
Maven error (1 of 1):
Plugin execution not covered by lifecycle configuration:
org.codehaus.mojo:build-helper-maven-plugin:1.7:add-source (execution:
add-java-source, phase: generate-sources) pom.xml /aggregate-mysql line 44 Maven
Project Build Lifecycle Mapping Problem
XML error (1 of 6):
cvc-complex-type.2.4.a: Invalid content was found starting with element
'url-pattern'. One of '{"http://java.sun.com/xml/ns/javaee":web-resource-name}'
is expected. web.xml
/aggregate-mysql/target/emma-it/aggregate-mysql-1.0/WEB-INF line 18 XML
Problem
JSP error (1 of 70 or so)
cal cannot be resolved to a type cal1.jsp
/aggregate-mysql/target/tomcat6x/apache-tomcat-6.0.35/apache-tomcat-6.0.35/webapps/examples/jsp/cal line
52 JSP Problem
HTML warnings (roughly 7,000)
My solution to these was to disable the Maven, Javascript Validator, and
Validator Builders for the project. Once I did that, I could build with
only warnings. Was that the correct approach?
However, if I build and export a WAR, the WAR isn't as complete as the WAR
output by the Maven build. In particular, it fails to include the
"aggregate-src-latest.jar" in WEB-INF/lib. In fact, the Eclipse-exported
WAR doesn't seem to actually include the Aggregate classes anywhere, unless
they're hidden some place that I haven't noticed. (Actually, it's not that
it's less complete, but rather than the Eclipse-generated WAR exports
different libraries. The WEB-INF/lib output by Maven includes 77 files,
including aggregate-src-latest.jar; the WEB-INF/lib output by Eclipse
includes 87 files, not including aggregate-src-latest.jar.)
This suggests to me that I might use Eclipse to develop and compile, but
that if I want to run/test I should hop into the command window to rebuild
with Maven. Is that what you guys do?
Thanks again, and sorry for the follow-up questions,
Chris
Maven build error (clip from end of output):
May 1, 2012 2:48:02 PM
org.opendatakit.common.persistence.engine.DatastoreAccessMetrics logUsage
INFO: opendatakit.MY_QRT_TABLE,0,0,0,0,0
May 1, 2012 2:48:02 PM
org.opendatakit.common.persistence.engine.DatastoreAccessMetrics logUsage
INFO:
opendatakit.__MY_NAMESPACE__ATTB_5FF06C41_F50B_4420_8B75_F2B2470BC98F,0,0,0,0,0
May 1, 2012 2:48:03 PM
org.opendatakit.common.persistence.engine.DatastoreAccessMetrics logUsage
INFO: opendatakit._MY_NAMESPACE