Jip is the jython equivalent of pip to python. It will resolve dependencies and download jars for your jython environment.
jip itself is distributed under the license of GNU General Public License, Version 3.
jip is required to run within virtualenv, which is a best practice for python/jython developers to created a standalone, portable environment.
Create virtualenv with jython:
virtualenv -p /usr/local/bin/jython jython-env
Activate the shell environment:
cd jython-dev
source bin/activate
Download and install jip with pip:
pip install jip
jip will resolve dependencies and download jars from maven repositories. You can install a Java package just like what you do python with pip:
jip install <groupId>:<artifactId>:<version>
Take spring as example:
jip install org.springframework:spring-core:3.0.5.RELEASE
jip allows you to define dependencies in a maven pom file, which is more maintainable than typing install command one by one:
jip resolve pom.xml
You can use update command to find and download a new deployed snapshot:
jip update info.sunng.bason:bason-annotation:0.1-SNAPSHOT
Another script jython-all
is shipped with jip. To run jython with Java
packages included in path, just use jython-all
instead of jython
jip clean
will remove everything you downloaded, be careful to use it.
You can configure custom maven repository with a dot file, jip will search configurations in the following order:
$VIRTUAL_ENV/.jip
, your virtual environment home$HOME/.jip
, your home
Here is an example:
[repos:jboss]
uri=http://repository.jboss.org/maven2/
type=remote
[repos:local]
uri=/home/sun/.m2/repository/
type=local
[repos:central]
uri=http://repo1.maven.org/maven2/
type=remote
Be careful that the .jip file will overwrite default settings, so you must include default local and central repository explicitly. jip will skip repositories once it finds package matches the maven coordinator.