JAVA-18148 Create a new java-nashorn project from the existing langua… (#14268)
* JAVA-18148 Create a new java-nashorn project from the existing language-interop * JAVA-18148 Cleanup the project to contain just the python related language interop --------- Co-authored-by: timis1 <noreplay@yahoo.com>
This commit is contained in:
parent
86932cba3d
commit
68f6c19109
|
@ -0,0 +1,7 @@
|
|||
## Language Interop
|
||||
|
||||
This module contains articles about Java interop with other language integrations.
|
||||
|
||||
### Relevant Articles:
|
||||
|
||||
- [Introduction to Nashorn](http://www.baeldung.com/java-nashorn)
|
|
@ -0,0 +1,30 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>java-nashorn</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<name>java-nashorn</name>
|
||||
|
||||
<parent>
|
||||
<groupId>com.baeldung</groupId>
|
||||
<artifactId>parent-modules</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<build>
|
||||
<finalName>java-nashorn</finalName>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>src/test/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
</build>
|
||||
|
||||
</project>
|
|
@ -0,0 +1,34 @@
|
|||
package com.baeldung.language.interop.python;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.script.ScriptEngineFactory;
|
||||
import javax.script.ScriptEngineManager;
|
||||
|
||||
public class ScriptEngineManagerUtils {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(ScriptEngineManagerUtils.class);
|
||||
|
||||
private ScriptEngineManagerUtils() {
|
||||
}
|
||||
|
||||
public static void listEngines() {
|
||||
ScriptEngineManager manager = new ScriptEngineManager();
|
||||
List<ScriptEngineFactory> engines = manager.getEngineFactories();
|
||||
|
||||
for (ScriptEngineFactory engine : engines) {
|
||||
LOGGER.info("Engine name: {}", engine.getEngineName());
|
||||
LOGGER.info("Version: {}", engine.getEngineVersion());
|
||||
LOGGER.info("Language: {}", engine.getLanguageName());
|
||||
|
||||
LOGGER.info("Short Names:");
|
||||
for (String names : engine.getNames()) {
|
||||
LOGGER.info(names);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
|
||||
</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<root level="INFO">
|
||||
<appender-ref ref="STDOUT" />
|
||||
</root>
|
||||
</configuration>
|
|
@ -5,4 +5,3 @@ This module contains articles about Java interop with other language integration
|
|||
### Relevant Articles:
|
||||
|
||||
- [How to Call Python From Java](https://www.baeldung.com/java-working-with-python)
|
||||
- [Introduction to Nashorn](http://www.baeldung.com/java-nashorn)
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
</build>
|
||||
|
||||
<properties>
|
||||
<jython.version>2.7.2</jython.version>
|
||||
<jython.version>2.7.3b1</jython.version>
|
||||
<commons-exec.version>1.3</commons-exec.version>
|
||||
</properties>
|
||||
|
||||
|
|
6
pom.xml
6
pom.xml
|
@ -356,7 +356,6 @@
|
|||
<!-- <module>guest</module> --> <!-- not to be built as its for guest articles -->
|
||||
|
||||
<!-- <module>lagom</module> --> <!-- Not a maven project -->
|
||||
<module>language-interop</module>
|
||||
|
||||
<module>libraries-jdk8</module>
|
||||
|
||||
|
@ -370,6 +369,7 @@
|
|||
<module>persistence-modules/java-cassandra</module> <!-- JAVA-21464 cassandra-unit library doesn't support to run with jdk9 and above -->
|
||||
<module>persistence-modules/spring-data-cassandra-reactive</module> <!--JAVA-21844-->
|
||||
<module>persistence-modules/spring-data-neo4j</module>
|
||||
<module>java-nashorn</module>
|
||||
</modules>
|
||||
|
||||
</profile>
|
||||
|
@ -534,7 +534,6 @@
|
|||
<!-- <module>guest</module> --> <!-- not to be built as its for guest articles -->
|
||||
|
||||
<!-- <module>lagom</module> --> <!-- Not a maven project -->
|
||||
<module>language-interop</module>
|
||||
|
||||
<module>libraries-jdk8</module>
|
||||
|
||||
|
@ -547,6 +546,7 @@
|
|||
<module>persistence-modules/java-cassandra</module> <!-- JAVA-21464 cassandra-unit library doesn't support to run with jdk9 and above -->
|
||||
<module>persistence-modules/spring-data-cassandra-reactive</module> <!--JAVA-21844-->
|
||||
<module>persistence-modules/spring-data-neo4j</module>
|
||||
<module>java-nashorn</module>
|
||||
</modules>
|
||||
|
||||
</profile>
|
||||
|
@ -937,6 +937,7 @@
|
|||
<module>xml</module>
|
||||
<module>xml-2</module>
|
||||
<module>image-processing</module>
|
||||
<module>language-interop</module>
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
|
@ -1204,6 +1205,7 @@
|
|||
<module>xml</module>
|
||||
<module>xml-2</module>
|
||||
<module>image-processing</module>
|
||||
<module>language-interop</module>
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
|
|
Loading…
Reference in New Issue