Skip to content

Commit b7afdd6

Browse files
committed
Modularize project
1 parent 9e4d841 commit b7afdd6

2 files changed

Lines changed: 87 additions & 1 deletion

File tree

‎pom.xml‎

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</parent>
1111

1212
<artifactId>scripting-jython</artifactId>
13-
<version>1.0.2-SNAPSHOT</version>
13+
<version>2.0.0-SNAPSHOT</version>
1414

1515
<name>SciJava Scripting: Jython</name>
1616
<description>JSR-223-compliant Jython scripting language plugin.</description>
@@ -54,6 +54,11 @@
5454
<url>https://imagej.net/people/hinerm</url>
5555
<properties><id>hinerm</id></properties>
5656
</contributor>
57+
<contributor>
58+
<name>Gabriel Selzer</name>
59+
<url>https://imagej.net/people/gselzer</url>
60+
<properties><id>gselzer</id></properties>
61+
</contributor>
5762
</contributors>
5863

5964
<mailingLists>
@@ -84,6 +89,7 @@
8489
<properties>
8590
<scijava.jvm.version>8</scijava.jvm.version>
8691
<package-name>org.scijava.plugins.scripting.jython</package-name>
92+
<surefire.useModulePath>false</surefire.useModulePath>
8793

8894
<!-- TEMP: Remove once pom-scijava manages scijava-common 2.101.0. -->
8995
<scijava-common.version>2.101.0</scijava-common.version>
@@ -135,4 +141,39 @@
135141
</dependency>
136142
</dependencies>
137143

144+
<build>
145+
<plugins>
146+
<!--
147+
NB: Tests run on the classpath since we use scijava-common's tests JAR.
148+
That JAR shares the org.scijava module name with scijava-common itself, so
149+
it cannot be resolved on the module path.
150+
-->
151+
<plugin>
152+
<groupId>org.apache.maven.plugins</groupId>
153+
<artifactId>maven-compiler-plugin</artifactId>
154+
<configuration>
155+
<!--
156+
NB: In module mode, javac does not discover annotation processors
157+
on the module path, so the @Plugin indexer must be declared here.
158+
-->
159+
<annotationProcessorPaths>
160+
<path>
161+
<groupId>org.scijava</groupId>
162+
<artifactId>scijava-common</artifactId>
163+
<version>${scijava-common.version}</version>
164+
</path>
165+
</annotationProcessorPaths>
166+
</configuration>
167+
<executions>
168+
<execution>
169+
<id>default-testCompile</id>
170+
<configuration>
171+
<useModulePath>false</useModulePath>
172+
</configuration>
173+
</execution>
174+
</executions>
175+
</plugin>
176+
</plugins>
177+
</build>
178+
138179
</project>

‎src/main/java/module-info.java‎

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
* #%L
3+
* JSR-223-compliant Jython scripting language plugin.
4+
* %%
5+
* Copyright (C) 2008 - 2026 SciJava developers.
6+
* %%
7+
* Redistribution and use in source and binary forms, with or without
8+
* modification, are permitted provided that the following conditions are met:
9+
*
10+
* 1. Redistributions of source code must retain the above copyright notice,
11+
* this list of conditions and the following disclaimer.
12+
* 2. Redistributions in binary form must reproduce the above copyright notice,
13+
* this list of conditions and the following disclaimer in the documentation
14+
* and/or other materials provided with the distribution.
15+
*
16+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19+
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
20+
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26+
* POSSIBILITY OF SUCH DAMAGE.
27+
* #L%
28+
*/
29+
30+
module org.scijava.plugins.scripting.jython {
31+
exports org.scijava.plugins.scripting.jython;
32+
exports org.scijava.plugins.scripting.jython.completion;
33+
34+
// NB: SciJava instantiates @Plugin classes reflectively.
35+
opens org.scijava.plugins.scripting.jython to org.scijava;
36+
opens org.scijava.plugins.scripting.jython.completion to org.scijava;
37+
38+
requires transitive java.scripting;
39+
requires transitive org.scijava;
40+
requires transitive org.scijava.lsp;
41+
requires org.python.jython2;
42+
43+
provides javax.script.ScriptEngineFactory with
44+
org.scijava.plugins.scripting.jython.JythonScriptLanguage;
45+
}

0 commit comments

Comments
 (0)