Compiling and integrating python

Use the jython-compile-maven-plugin. It allows you to deploy a standalone project that includes jython with libraries.

For demonstration of this plugin, see the demo project and its source code. It shows how to

  • launch a python console -- look at AbstractInitJython and InitJython on how to launch a python/jython console, how to execute python code snippets, and how to run a python script.

  • include python libraries -- the plugin also downloads and bundles python libraries (using easy_install) in the package phase, and adds them to the jar. The resulting jar can have all the libraries of the project, all pom dependencies and all the python libraries requested. The demo project shows this with the "nose" python library (see the pom file).

Testing python / jython code

The python-test-maven-plugin allows you to run your python tests alongside the normal junit tests. The demo project (look at the source at source code) shows the use of standard python unit tests (with nose) and BDD (behaviour testing) with the lettuce-clone freshen.


The sourceforge umbrella project is http://mavenjython.sourceforge.net/

Unlike maven-jython-plugin, they don't use the outdated jythonc compiler.

Answer from j13r on Stack Overflow
🌐
Maven Repository
mvnrepository.com › artifact › org.python › jython
Maven Repository: org.python » jython
August 20, 2024 - Jython is an implementation of the high-level, dynamic, object-oriented language Python written in 100% Pure Java, and seamlessly integrated with the Java platform. It thus allows you to run Python on any Java platform. ... aar android apache api arm assets build build-system bundle client ...
🌐
Maven Repository
mvnrepository.com › artifact › org.python › jython › 2.7.0
Maven Repository: org.python » jython » 2.7.0
Jython is an implementation of the high-level, dynamic, object-oriented language Python written in 100% Pure Java, and seamlessly integrated with the Java platform. It thus allows you to run Python on any Java platform. ... aar amazon android apache api arm assets build build-system bundle ...
🌐
Maven Central
central.sonatype.com › artifact › org.python › jython-standalone
org.python:jython-standalone - Maven Central - Sonatype
<dependency> <groupId>org.pyth... <name>Jython</name> <description> Jython is an implementation of the high-level, dynamic, object-oriented language Python written in 100% Pure Java, and seamlessly integrated with the Java platform....
🌐
Maven Central Repository
search.maven.org › org.python › jython-standalone › 2.7.2
Maven Central Repository Search
<dependency> <groupId>org.pyth....jython.org/</url> <description> Jython is an implementation of the high-level, dynamic, object-oriented language Python written in 100% Pure Java, and seamlessly integrated with the Java platform....
🌐
SourceForge
mavenjython.sourceforge.net › compile
Maven Jython packaging - Introduction
September 4, 2011 - Maven Jython packaging · Maven-Jython Home · Introduction · Goals · Usage · FAQ · Example/Demo project · Javadoc · Code Repository · License · Allows your project to integrate jython/python scripting including python libraries (installed using easy_install).
🌐
SourceForge
mavenjython.sourceforge.net
maven-jython - Maven tools for Jython/Python integration and testing
This is a collection of projects relating to integrating jython/python into maven projects.
🌐
Jython
jython.org › download.html
Downloads | Jython
As the Jython Standalone JAR. Download this to run Jython without installing, or as a JAR on the class path of a Java application.
🌐
SourceForge
mavenjython.sourceforge.net › compile › usage.html
Maven Jython packaging - Usage
September 4, 2011 - Write a Jython initialization class to call the python interpreter or to make a python console. Look at the demo project for inspiration. ... Maven will package jython with the jar once you use jar-with-dependencies. Jython will find the libraries in Lib/. Jython will find your code (if you ...
Find elsewhere
🌐
Jython
jython.org › news.html
News | Jython
A new full release is now available for Jython 2.7.4 at Maven Central. It is tested against Java 8 and Java 11.
🌐
Maven Central
central.sonatype.com › artifact › org.python › jython-slim
jython-slim - org.python - Maven Central - Sonatype
<dependency> <groupId>org.python</groupId> <artifactId>jython-slim</artifactId> <version>2.7.4</version> </dependency> ... <?xml version="1.0" encoding="UTF-8"?> <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <!-- This module was also published with a richer model, Gradle metadata, --> <!-- which should be used instead.
🌐
Maven Central Repository
search.maven.org › org.python › jython-standalone › 2.7.4
Maven Central: org.python:jython-standalone:2.7.3
<dependency> <groupId>org.pyth... <name>Jython</name> <description> Jython is an implementation of the high-level, dynamic, object-oriented language Python written in 100% Pure Java, and seamlessly integrated with the Java platform....
🌐
Maven Repository
mvnrepository.com › artifact › org.python › jython-standalone
Maven Repository: org.python » jython-standalone
August 20, 2024 - Jython is an implementation of the high-level, dynamic, object-oriented language Python written in 100% Pure Java, and seamlessly integrated with the Java platform. It thus allows you to run Python on any Java platform. ... aar android apache api arm assets build build-system bundle client ...
🌐
Maven Central
central.sonatype.com › artifact › org.python › jython
org.python:jython - Maven Central - Sonatype
<dependency> <groupId>org.pyth... <name>Jython</name> <description> Jython is an implementation of the high-level, dynamic, object-oriented language Python written in 100% Pure Java, and seamlessly integrated with the Java platform....
🌐
Maven Central
repo1.maven.org › maven2 › org › python › jython-standalone › 2.7.2
Central Repository: org/python/jython-standalone/2.7.2
../ jython-standalone-2.7.2-javadoc.jar 2020-03-21 17:57 3647328 jython-standalone-2.7.2-javadoc.jar.asc 2020-03-21 17:57 499 jython-standalone-2.7.2-javadoc.jar.asc.md5 2020-03-21 17:57 32 jython-standalone-2.7.2-javadoc.jar.asc.sha1 2020-03-21 17:57 40 jython-standalone-2.7.2-javadoc.jar.md5 2020-03-21 17:57 32 jython-standalone-2.7.2-javadoc.jar.sha1 2020-03-21 17:57 40 jython-standalone-2.7.2-sources.jar 2020-03-21 17:57 17684887 jython-standalone-2.7.2-sources.jar.asc 2020-03-21 17:57 499 jython-standalone-2.7.2-sources.jar.asc.md5 2020-03-21 17:57 32 jython-standalone-2.7.2-sources.jar.a
🌐
GitHub
github.com › jython › jython
GitHub - jython/jython: Python for the Java Platform · GitHub
We have a Gradle build that results in a family of JARs and a POM. This is intended to provide the Jython core in a form that Gradle and Maven users can consume as a dependency.
Starred by 1.5K users
Forked by 228 users
Languages   Python 66.9% | Java 32.4% | GAP 0.3% | HTML 0.3% | PLSQL 0.1% | Shell 0.0%
🌐
Maven Central
repo1.maven.org › maven2 › org › python › jython-standalone › 2.7.1
Central Repository: org/python/jython-standalone/2.7.1
../ jython-standalone-2.7.1-javadoc.jar 2017-06-30 19:08 3619252 jython-standalone-2.7.1-javadoc.jar.asc 2017-06-30 19:08 473 jython-standalone-2.7.1-javadoc.jar.asc.md5 2017-06-30 19:08 32 jython-standalone-2.7.1-javadoc.jar.asc.sha1 2017-06-30 19:08 40 jython-standalone-2.7.1-javadoc.jar.md5 2017-06-30 19:08 32 jython-standalone-2.7.1-javadoc.jar.sha1 2017-06-30 19:08 40 jython-standalone-2.7.1-sources.jar 2017-06-30 19:08 15811061 jython-standalone-2.7.1-sources.jar.asc 2017-06-30 19:08 473 jython-standalone-2.7.1-sources.jar.asc.md5 2017-06-30 19:08 32 jython-standalone-2.7.1-sources.jar.a
🌐
Maven Central
repo1.maven.org › maven2 › org › python › jython-standalone › 2.7.4
Central Repository: org/python/jython-standalone/2.7.4
2024-08-18 19:43 128 jython-standalone-2.7.4-sources.jar.md5 2024-08-18 19:43 32 jython-standalone-2.7.4-sources.jar.sha1 2024-08-18 19:43 40 jython-standalone-2.7.4-sources.jar.sha256 2024-08-18 19:43 64 jython-standalone-2.7.4-sources.jar.sha512 2024-08-18 19:43 128 jython-standalone-2.7.4.jar 2024-08-18 19:43 50453449 jython-standalone-2.7.4.jar.asc 2024-08-18 19:43 499 jython-standalone-2.7.4.jar.asc.md5 2024-08-18 19:43 32 jython-standalone-2.7.4.jar.asc.sha1 2024-08-18 19:43 40 jython-standalone-2.7.4.jar.asc.sha256 2024-08-18 19:43 64 jython-standalone-2.7.4.jar.asc.sha512 2024-08-18 19
🌐
Maven Repository
mvnrepository.com › artifact › jython
Maven Repository: jython
Relocated → org.python » jython · Central · Atlassian External · Atlassian · WSO2 Releases · WSO2 Public · Hortonworks · KtorEAP · Mulesoft · JCenter · Sonatype · 🌐 · DNS Gurus · Free DNS Tools & Analysis · aar android apache api arm assets build build-system bundle client clojure cloud config cran data database eclipse example extension framework github gradle groovy io ios javascript jvm kotlin library logging maven mobile module npm osgi persistence plugin resources rlang sdk server service spring sql starter testing tools ui web webapp ·
🌐
Readthedocs
jython-devguide.readthedocs.io › en › latest › release_jy.html
23. How To Release Jython — Jython Developer's Guide
When the build finishes, a JAR that is potentially fit to publish, and its subsidiary artifacts (source, javadoc, checksums), will have been created in ./build2/stagingRepo/org/python/jython-slim/2.7.4. It can also be “published” to your local Maven cache (usually ~/.m2/repository with ...