mvn compile step will download
modules from the net.
These notes are based on Tristan King's work, see his July 21, 2008 ptolemy-hackers post: updates on ptII maven and actor.io work.
http://maven.apache.org/download.html
$PTII environment variable.
cd /path/to/working/directory/ svn co svn://source.eecs.berkeley.edu/chess/ptII/trunk ptII export PTII=/path/to/working/directory/ptII
rm -r $PTII/vendors
bash-3.2$ cd $PTII
bash-3.2$ echo $PTII
/Users/cxh/ptII
bash-3.2$ pwd
/Users/cxh/ptII
If the current working directory is a symbolic link to the actual
directory where $PTII is located, then be sure to change
either $PTII or the current working directory so they
both match.
Run make maven in $PTII.
cd $PTII make maven
export MAVEN_OPTS="-Xms512m -Xmx512m -XX:PermSize=48m"
./configure --without-eclipse
FIXME: $PTII/pom.xml needs to be extended
to include support for Eclipse, see below
mvn install:install-file -DgroupId=jython -DartifactId=jython \ -Dversion=svn -Dpackaging=jar -Dfile=$PTII/vendors/jython/jython.jar mvn install:install-file -DgroupId=javajoystick -DartifactId=joystick \ -Dversion=0.7 -Dpackaging=jar -Dfile=$PTII/vendors/misc/joystick/Joystick.jar mvn install:install-file -DgroupId=jxta -DartifactId=jxta -Dversion=1.0 \ -Dpackaging=jar -Dfile=$PTII/vendors/sun/jxta/jxta.jar mvn install:install-file -DgroupId=jxta -DartifactId=jxtasecurity -Dversion=1.0 \ -Dpackaging=jar -Dfile=$PTII/vendors/sun/jxta/jxtasecurity.jar mvn install:install-file -DgroupId=soot -DartifactId=sootclasses -Dversion=ptII \ -Dpackaging=jar -Dfile=$PTII/lib/sootclasses.jar mvn install:install-file -DgroupId=mapss -DartifactId=mapss -Dversion=ptII \ -Dpackaging=jar -Dfile=$PTII/lib/mapss.jar mvn install:install-file -DgroupId=caltrop -DartifactId=ptCal -Dversion=ptII \ -Dpackaging=jar -Dfile=$PTII/lib/ptCal.jar mvn install:install-file -DgroupId=chic -DartifactId=chic -Dversion=ptII \ -Dpackaging=jar -Dfile=$PTII/lib/chic.jar mvn install:install-file -DgroupId=jacl -DartifactId=jacl -Dversion=ptII \ -Dpackaging=jar -Dfile=$PTII/lib/ptjacl.jar
cd /path/to/ptII-maven/ mvn compile mvn exec:execNote that
mvn exec:exec requires net access. To run
offline, run: mvn -o exec:exec
run-vergil.sh would look like:
#!/bin/bash java -classpath $PTII/target/ptII-7.1.devel-SNAPSHOT.jar:~/.m2/repository/caltrop/ptCal/unknown/ptCal-unknown.jar:~/.m2/repository/net/jini/jini-core/2.1/jini-core-2.1.jar:~/.m2/repository/antlr/antlr/2.7.6/antlr-2.7.6.jar:~/.m2/repository/javax/jms/jms/1.1/jms-1.1.jar:~/.m2/repository/jdom/jdom/1.0/jdom-1.0.jar:/usr/lib/jvm/java-1.5.0-sun-1.5.0.15/jre/../lib/tools.jar:~/.m2/repository/chic/chic/unknown/chic-unknown.jar:~/.m2/repository/jxta/jxtasecurity/1.0/jxtasecurity-1.0.jar:~/.m2/repository/jxta/jxta/1.0/jxta-1.0.jar:~/.m2/repository/log4j/log4j/1.2.15/log4j-1.2.15.jar:~/.m2/repository/javax/activation/activation/1.1/activation-1.1.jar:~/.m2/repository/net/jini/jini-ext/2.1/jini-ext-2.1.jar:~/.m2/repository/jython/jython/svn/jython-svn.jar:~/.m2/repository/java3d/j3d-core/1.3.1/j3d-core-1.3.1.jar:~/.m2/repository/jacl/jacl/ptII/jacl-ptII.jar:~/.m2/repository/colt/colt/1.0.3/colt-1.0.3.jar:~/.m2/repository/org/beanshell/bsh/2.0b4/bsh-2.0b4.jar:~/.m2/repository/javajoystick/joystick/0.7/joystick-0.7.jar:~/.m2/repository/mapss/mapss/unknown/mapss-unknown.jar:~/.m2/repository/javax/mail/mail/1.4/mail-1.4.jar:~/.m2/repository/com/sun/jmx/jmxri/1.2.1/jmxri-1.2.1.jar:~/.m2/repository/java3d/vecmath/1.3.1/vecmath-1.3.1.jar:~/.m2/repository/javax/media/jai_core/1.1.2_01/jai_core-1.1.2_01.jar:~/.m2/repository/soot/sootclasses/ptII/sootclasses-ptII.jar:~/.m2/repository/com/sun/jdmk/jmxtools/1.2.1/jmxtools-1.2.1.jar ptolemy.vergil.VergilApplication
# run these two steps only once cd /path/to/ptII-maven/ mvn package # then /path/to/run-vergil.shNote that the version numbers are hardwired into the path, which is why this file is not checked in. Another issue is that this command build a jar file, which slows down the build/test cycle.
[INFO] artifact org.apache.maven.plugins:maven-resources-plugin: checking for updates from central [WARNING] repository metadata for: 'artifact org.apache.maven.plugins:maven-resources-plugin' could not be retrieved from repository: central due to an error: Error transferring file [INFO] Repository 'central' will be blacklisted
mvn
compile is run.
~/.m2/repository/org/apache/maven/plugins/maven-resources-plugin
or just remove all of ~/.m2.
Missing:
----------
1) antlr:antlr:jar:2.9.9
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=antlr -DartifactId=antlr \
-Dversion=2.9.9 -Dpackaging=jar -Dfile=/path/to/file
Path to dependency:
1) edu.berkeley.eecs.ptolemy:ptII:jar:7.1.devel-SNAPSHOT
2) antlr:antlr:jar:2.9.9
mvn install:install-file -DgroupId=antlr -DartifactId=antlr -Dversion=svn -Dpackaging=jar -Dfile=$PTII/ptolemy/actor/ptalon/antlr/antlr.jar
Then rerun mvn compile
pom.xml and change the antlr version
number from 2.9.9 to 2.7.7
[INFO] The grammar '/Users/cxh/Documents/workspace/ptII/src/main/antlr/ptolemy/actor/ptalon/parser.g' doesnt exist.
cd $PTII mkdir -p src/main/antlr/ptolemy/actor/ptalon cp $PTII/ptolemy/actor/ptalon/*.g src/main/antlr/ptolemy/actor/ptalonHowever, it turned out that none of the files were being copied because
$PTII was a symbolic link. See below.
Exception in thread "main" java.lang.NoClassDefFoundError: ptolemy/vergil/VergilApplicationIt turns out that the java files were not copied to the right location.
$PTII/target/ptII-7.1.devel-SNAPSHOT.jar only
contained the antlr classes. The problem was that the toplevel directory where make maven was run was a symbolic link to the actual $PTII directory. The fix was to make sure that in $PTII, $PTII==pwd:
bash-3.2$ cd $PTII bash-3.2$ echo $PTII /Users/cxh/ptII bash-3.2$ pwd /Users/cxh/ptIIand then to run
make maven mvn compile
/Users/cxh/Documents/workspace/ptII/src/main/java/ptolemy/moml/jxta/JXTALibrary.java:[44,27] package net.jxta.credential does not exist
$PTII/pom.xml and uncomment the jxta section
/Users/cxh/Documents/workspace/ptII/src/main/java/ptolemy/backtrack/eclipse/ast/transform/PackageRule.java:[36,32] package org.eclipse.jdt.core.dom does not exist
mvn -Declipse.workspace=/Applications/eclipse eclipse:add-maven-repo mvn -DeclipseDir=/Applications/eclipse eclipse:to-mavenconfigure. However, our workaround is to just not copy the Eclipse plugin files to
$PTII/src by
running ./configure --without-eclipse.
make maven copy the .java files? This means
that we have yet another copy of the code and that changes to the
master .java files are not propagated?
$PTII/pom.xml file lists dev.archer.edu.au
as the repository, this should probably be changed.
run-vergil.sh? That
file has version numbers hard coded in.