diff --git a/.gitignore b/.gitignore index b5bfffa..15fea70 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml hs_err_pid* +**/pom.xml.versionsBackup diff --git a/README.md b/README.md index 70d296f..8acac0b 100644 --- a/README.md +++ b/README.md @@ -1 +1,3 @@ # 拓展工具,office文档处理,动态脚本等 + +[![Maven Central](https://img.shields.io/maven-central/v/org.hswebframework/hsweb-expands.svg?style=plastic)](http://search.maven.org/#search%7Cga%7C1%7Chsweb-expands) diff --git a/hsweb-expands-compress/pom.xml b/hsweb-expands-compress/pom.xml index 8a14c90..7ffee68 100644 --- a/hsweb-expands-compress/pom.xml +++ b/hsweb-expands-compress/pom.xml @@ -5,7 +5,7 @@ hsweb-expands org.hswebframework - 3.0.0-SNAPSHOT + 3.0.0 4.0.0 diff --git a/hsweb-expands-office/pom.xml b/hsweb-expands-office/pom.xml index bd10660..70d695f 100644 --- a/hsweb-expands-office/pom.xml +++ b/hsweb-expands-office/pom.xml @@ -5,7 +5,7 @@ hsweb-expands org.hswebframework - 3.0.0-SNAPSHOT + 3.0.0 4.0.0 diff --git a/hsweb-expands-request/pom.xml b/hsweb-expands-request/pom.xml index cf5e721..84d992f 100644 --- a/hsweb-expands-request/pom.xml +++ b/hsweb-expands-request/pom.xml @@ -5,7 +5,7 @@ hsweb-expands org.hswebframework - 3.0.0-SNAPSHOT + 3.0.0 4.0.0 diff --git a/hsweb-expands-request/src/test/java/org/hswebframework/expands/request/http/simple/SimpleRequestBuilderTest.java b/hsweb-expands-request/src/test/java/org/hswebframework/expands/request/http/simple/SimpleRequestBuilderTest.java index 65b6044..5068939 100644 --- a/hsweb-expands-request/src/test/java/org/hswebframework/expands/request/http/simple/SimpleRequestBuilderTest.java +++ b/hsweb-expands-request/src/test/java/org/hswebframework/expands/request/http/simple/SimpleRequestBuilderTest.java @@ -96,7 +96,8 @@ public void testEmail() throws Exception { @Test public void testWebService() throws Exception { - WebServiceRequest request = builder.webService().wsdl("http://192.168.2.150:9003/webservices/dataCollection?wsdl"); + WebServiceRequest request = builder.webService() + .wsdl("/home/zhouhao/云文档/项目/apsp/接口文档/WSDL/查询密码验证.wsdl"); System.out.println(request.interfaces()); System.out.println(request.services()); for (String s : request.interfaces()) { diff --git a/hsweb-expands-script/pom.xml b/hsweb-expands-script/pom.xml index 87f8ea4..a555fbd 100644 --- a/hsweb-expands-script/pom.xml +++ b/hsweb-expands-script/pom.xml @@ -5,7 +5,7 @@ hsweb-expands org.hswebframework - 3.0.0-SNAPSHOT + 3.0.0 4.0.0 diff --git a/hsweb-expands-script/src/main/java/org/hswebframework/expands/script/engine/common/CommonScriptEngine.java b/hsweb-expands-script/src/main/java/org/hswebframework/expands/script/engine/common/CommonScriptEngine.java index a3b8edb..d5ddc1c 100644 --- a/hsweb-expands-script/src/main/java/org/hswebframework/expands/script/engine/common/CommonScriptEngine.java +++ b/hsweb-expands-script/src/main/java/org/hswebframework/expands/script/engine/common/CommonScriptEngine.java @@ -79,7 +79,7 @@ public boolean compile(String id, String code) throws Exception { @Override public void addListener(ScriptListener scriptListener) { - if (scriptListeners != null) { + if (scriptListeners == null) { scriptListeners = new LinkedList<>(); } scriptListeners.add(scriptListener); @@ -139,4 +139,12 @@ public CompiledScript getScript() { return script; } } + + public Bindings getUtilBindings() { + return utilBindings; + } + + public void setUtilBindings(Bindings utilBindings) { + this.utilBindings = utilBindings; + } } diff --git a/hsweb-expands-script/src/test/java/org/hswebframework/expands/script/engine/DynamicScriptEngineTest.java b/hsweb-expands-script/src/test/java/org/hswebframework/expands/script/engine/DynamicScriptEngineTest.java index 83a2c82..3928020 100644 --- a/hsweb-expands-script/src/test/java/org/hswebframework/expands/script/engine/DynamicScriptEngineTest.java +++ b/hsweb-expands-script/src/test/java/org/hswebframework/expands/script/engine/DynamicScriptEngineTest.java @@ -1,13 +1,14 @@ package org.hswebframework.expands.script.engine; +import org.hswebframework.expands.script.engine.common.CommonScriptEngine; import org.junit.Assert; import org.junit.Test; import org.slf4j.LoggerFactory; -import java.util.Collections; -import java.util.Date; -import java.util.HashMap; -import java.util.Map; +import javax.script.AbstractScriptEngine; +import javax.script.Bindings; +import javax.script.SimpleBindings; +import java.util.*; public class DynamicScriptEngineTest { @@ -15,7 +16,7 @@ public class DynamicScriptEngineTest { public void testJava() throws Exception { DynamicScriptEngine engine = DynamicScriptEngineFactory.getEngine("java"); engine.compile("111", "package test.myTest;" + - "\npublic class Test implements org.hsweb.expands.script.engine.java.Executor{\n" + + "\npublic class Test implements org.hswebframework.expands.script.engine.java.Executor{\n" + " public Object execute(java.util.Map param){" + " param.put(\"test\",\"测试\");" + " return param;" + @@ -65,11 +66,27 @@ public void testOgnl() throws Exception { @Test public void testJavascript() throws Exception { - DynamicScriptEngine engine = DynamicScriptEngineFactory.getEngine("js"); + DynamicScriptEngine engine = DynamicScriptEngineFactory.getEngine("groovy"); + Bindings bindings = ((CommonScriptEngine) engine).getUtilBindings(); + ((CommonScriptEngine) engine).setUtilBindings(new SimpleBindings(bindings) { + @Override + public Object get(Object key) { + return super.get(key); + } + + @Override + public boolean containsKey(Object key) { + return super.containsKey(key); + } + @Override + public Set> entrySet() { + return super.entrySet(); + } + }); engine.addGlobalVariable(Collections.singletonMap("logger", LoggerFactory.getLogger("org.hsweb.script.javascript"))); - engine.compile("test", "logger.info('test')"); + engine.compile("test", "logger.error('test')"); engine.execute("test").getIfSuccess(); } diff --git a/hsweb-expands-security/pom.xml b/hsweb-expands-security/pom.xml index 9bb575b..0ea3aa8 100644 --- a/hsweb-expands-security/pom.xml +++ b/hsweb-expands-security/pom.xml @@ -5,7 +5,7 @@ hsweb-expands org.hswebframework - 3.0.0-SNAPSHOT + 3.0.0 4.0.0 diff --git a/hsweb-expands-shell/pom.xml b/hsweb-expands-shell/pom.xml index cc96fbf..fab01f2 100644 --- a/hsweb-expands-shell/pom.xml +++ b/hsweb-expands-shell/pom.xml @@ -5,7 +5,7 @@ hsweb-expands org.hswebframework - 3.0.0-SNAPSHOT + 3.0.0 4.0.0 diff --git a/hsweb-expands-template/pom.xml b/hsweb-expands-template/pom.xml index 89b61dd..28cdf30 100644 --- a/hsweb-expands-template/pom.xml +++ b/hsweb-expands-template/pom.xml @@ -5,7 +5,7 @@ hsweb-expands org.hswebframework - 3.0.0-SNAPSHOT + 3.0.0 4.0.0 diff --git a/pom.xml b/pom.xml index 1281afa..c04c98a 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ org.hswebframework hsweb-expands pom - 3.0.0-SNAPSHOT + 3.0.0 hsweb-expands-script hsweb-expands-office @@ -17,6 +17,38 @@ hsweb-expands-template hsweb-expands-security + + + ${project.groupId}:${project.artifactId} + http://www.hswebframework.org + hsweb拓展工具集 + + + + The Apache License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + + + + + + zhouhao + i@hsweb.me + + Owner + + +8 + https://github.com/zhou-hao + + + + + scm:git:https://github.com/hs-web/hsweb-expands.git + scm:git:https://github.com/hs-web/hsweb-expands.git + https://github.com/hs-web/hsweb-expands + ${project.version} + + UTF-8 zh_CN @@ -27,8 +59,68 @@ 1.7.21 1.1.7 - 3.0.0-SNAPSHOT + 3.0.0 + + + release + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.3 + true + + sonatype-releases + https://oss.sonatype.org/ + true + + + + org.apache.maven.plugins + maven-release-plugin + + true + false + release + deploy + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.9.1 + + -Xdoclint:none + + + + attach-javadocs + + jar + + + + + + + + @@ -172,16 +264,28 @@ + + + + + + + + + + + + - releases - Nexus Release Repository - http://nexus.hsweb.me/content/repositories/releases/ + sonatype-releases + sonatype repository + https://oss.sonatype.org/service/local/staging/deploy/maven2 - snapshots + sonatype-snapshots Nexus Snapshot Repository - http://nexus.hsweb.me/content/repositories/snapshots/ + https://oss.sonatype.org/content/repositories/snapshots \ No newline at end of file