Skip to content

Commit a2aba04

Browse files
committed
3.0.0
1 parent 72e62cb commit a2aba04

File tree

13 files changed

+156
-23
lines changed

13 files changed

+156
-23
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@
1717

1818
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
1919
hs_err_pid*
20+
**/pom.xml.versionsBackup

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
# 拓展工具,office文档处理,动态脚本等
2+
3+
[![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)

hsweb-expands-compress/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>hsweb-expands</artifactId>
77
<groupId>org.hswebframework</groupId>
8-
<version>3.0.0-SNAPSHOT</version>
8+
<version>3.0.0</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

hsweb-expands-office/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>hsweb-expands</artifactId>
77
<groupId>org.hswebframework</groupId>
8-
<version>3.0.0-SNAPSHOT</version>
8+
<version>3.0.0</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

hsweb-expands-request/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>hsweb-expands</artifactId>
77
<groupId>org.hswebframework</groupId>
8-
<version>3.0.0-SNAPSHOT</version>
8+
<version>3.0.0</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

hsweb-expands-request/src/test/java/org/hswebframework/expands/request/http/simple/SimpleRequestBuilderTest.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ public void testEmail() throws Exception {
9696

9797
@Test
9898
public void testWebService() throws Exception {
99-
WebServiceRequest request = builder.webService().wsdl("http://192.168.2.150:9003/webservices/dataCollection?wsdl");
99+
WebServiceRequest request = builder.webService()
100+
.wsdl("/home/zhouhao/云文档/项目/apsp/接口文档/WSDL/查询密码验证.wsdl");
100101
System.out.println(request.interfaces());
101102
System.out.println(request.services());
102103
for (String s : request.interfaces()) {

hsweb-expands-script/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>hsweb-expands</artifactId>
77
<groupId>org.hswebframework</groupId>
8-
<version>3.0.0-SNAPSHOT</version>
8+
<version>3.0.0</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

hsweb-expands-script/src/main/java/org/hswebframework/expands/script/engine/common/CommonScriptEngine.java

+9-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public boolean compile(String id, String code) throws Exception {
7979

8080
@Override
8181
public void addListener(ScriptListener scriptListener) {
82-
if (scriptListeners != null) {
82+
if (scriptListeners == null) {
8383
scriptListeners = new LinkedList<>();
8484
}
8585
scriptListeners.add(scriptListener);
@@ -139,4 +139,12 @@ public CompiledScript getScript() {
139139
return script;
140140
}
141141
}
142+
143+
public Bindings getUtilBindings() {
144+
return utilBindings;
145+
}
146+
147+
public void setUtilBindings(Bindings utilBindings) {
148+
this.utilBindings = utilBindings;
149+
}
142150
}

hsweb-expands-script/src/test/java/org/hswebframework/expands/script/engine/DynamicScriptEngineTest.java

+24-7
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
package org.hswebframework.expands.script.engine;
22

3+
import org.hswebframework.expands.script.engine.common.CommonScriptEngine;
34
import org.junit.Assert;
45
import org.junit.Test;
56
import org.slf4j.LoggerFactory;
67

7-
import java.util.Collections;
8-
import java.util.Date;
9-
import java.util.HashMap;
10-
import java.util.Map;
8+
import javax.script.AbstractScriptEngine;
9+
import javax.script.Bindings;
10+
import javax.script.SimpleBindings;
11+
import java.util.*;
1112

1213
public class DynamicScriptEngineTest {
1314

1415
@Test
1516
public void testJava() throws Exception {
1617
DynamicScriptEngine engine = DynamicScriptEngineFactory.getEngine("java");
1718
engine.compile("111", "package test.myTest;" +
18-
"\npublic class Test implements org.hsweb.expands.script.engine.java.Executor{\n" +
19+
"\npublic class Test implements org.hswebframework.expands.script.engine.java.Executor{\n" +
1920
" public Object execute(java.util.Map<String, Object> param){" +
2021
" param.put(\"test\",\"测试\");" +
2122
" return param;" +
@@ -65,11 +66,27 @@ public void testOgnl() throws Exception {
6566

6667
@Test
6768
public void testJavascript() throws Exception {
68-
DynamicScriptEngine engine = DynamicScriptEngineFactory.getEngine("js");
69+
DynamicScriptEngine engine = DynamicScriptEngineFactory.getEngine("groovy");
70+
Bindings bindings = ((CommonScriptEngine) engine).getUtilBindings();
71+
((CommonScriptEngine) engine).setUtilBindings(new SimpleBindings(bindings) {
72+
@Override
73+
public Object get(Object key) {
74+
return super.get(key);
75+
}
76+
77+
@Override
78+
public boolean containsKey(Object key) {
79+
return super.containsKey(key);
80+
}
6981

82+
@Override
83+
public Set<Entry<String, Object>> entrySet() {
84+
return super.entrySet();
85+
}
86+
});
7087
engine.addGlobalVariable(Collections.singletonMap("logger", LoggerFactory.getLogger("org.hsweb.script.javascript")));
7188

72-
engine.compile("test", "logger.info('test')");
89+
engine.compile("test", "logger.error('test')");
7390
engine.execute("test").getIfSuccess();
7491
}
7592

hsweb-expands-security/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>hsweb-expands</artifactId>
77
<groupId>org.hswebframework</groupId>
8-
<version>3.0.0-SNAPSHOT</version>
8+
<version>3.0.0</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

hsweb-expands-shell/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>hsweb-expands</artifactId>
77
<groupId>org.hswebframework</groupId>
8-
<version>3.0.0-SNAPSHOT</version>
8+
<version>3.0.0</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

hsweb-expands-template/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>hsweb-expands</artifactId>
77
<groupId>org.hswebframework</groupId>
8-
<version>3.0.0-SNAPSHOT</version>
8+
<version>3.0.0</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

pom.xml

+111-7
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<groupId>org.hswebframework</groupId>
88
<artifactId>hsweb-expands</artifactId>
99
<packaging>pom</packaging>
10-
<version>3.0.0-SNAPSHOT</version>
10+
<version>3.0.0</version>
1111
<modules>
1212
<module>hsweb-expands-script</module>
1313
<module>hsweb-expands-office</module>
@@ -17,6 +17,38 @@
1717
<module>hsweb-expands-template</module>
1818
<module>hsweb-expands-security</module>
1919
</modules>
20+
21+
22+
<name>${project.groupId}:${project.artifactId}</name>
23+
<url>http://www.hswebframework.org</url>
24+
<description>hsweb拓展工具集</description>
25+
26+
<licenses>
27+
<license>
28+
<name>The Apache License, Version 2.0</name>
29+
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
30+
</license>
31+
</licenses>
32+
33+
<developers>
34+
<developer>
35+
<name>zhouhao</name>
36+
<email>[email protected]</email>
37+
<roles>
38+
<role>Owner</role>
39+
</roles>
40+
<timezone>+8</timezone>
41+
<url>https://github.com/zhou-hao</url>
42+
</developer>
43+
</developers>
44+
45+
<scm>
46+
<connection>scm:git:https://github.com/hs-web/hsweb-expands.git</connection>
47+
<developerConnection>scm:git:https://github.com/hs-web/hsweb-expands.git</developerConnection>
48+
<url>https://github.com/hs-web/hsweb-expands</url>
49+
<tag>${project.version}</tag>
50+
</scm>
51+
2052
<properties>
2153
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2254
<project.build.locales>zh_CN</project.build.locales>
@@ -27,8 +59,68 @@
2759
<slf4j.version>1.7.21</slf4j.version>
2860
<logback.version>1.1.7</logback.version>
2961

30-
<hsweb.utils.version>3.0.0-SNAPSHOT</hsweb.utils.version>
62+
<hsweb.utils.version>3.0.0</hsweb.utils.version>
3163
</properties>
64+
<profiles>
65+
<profile>
66+
<id>release</id>
67+
<build>
68+
<plugins>
69+
<plugin>
70+
<groupId>org.sonatype.plugins</groupId>
71+
<artifactId>nexus-staging-maven-plugin</artifactId>
72+
<version>1.6.3</version>
73+
<extensions>true</extensions>
74+
<configuration>
75+
<serverId>sonatype-releases</serverId>
76+
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
77+
<autoReleaseAfterClose>true</autoReleaseAfterClose>
78+
</configuration>
79+
</plugin>
80+
<plugin>
81+
<groupId>org.apache.maven.plugins</groupId>
82+
<artifactId>maven-release-plugin</artifactId>
83+
<configuration>
84+
<autoVersionSubmodules>true</autoVersionSubmodules>
85+
<useReleaseProfile>false</useReleaseProfile>
86+
<releaseProfiles>release</releaseProfiles>
87+
<goals>deploy</goals>
88+
</configuration>
89+
</plugin>
90+
<plugin>
91+
<groupId>org.apache.maven.plugins</groupId>
92+
<artifactId>maven-gpg-plugin</artifactId>
93+
<version>1.5</version>
94+
<executions>
95+
<execution>
96+
<id>sign-artifacts</id>
97+
<phase>verify</phase>
98+
<goals>
99+
<goal>sign</goal>
100+
</goals>
101+
</execution>
102+
</executions>
103+
</plugin>
104+
<plugin>
105+
<groupId>org.apache.maven.plugins</groupId>
106+
<artifactId>maven-javadoc-plugin</artifactId>
107+
<version>2.9.1</version>
108+
<configuration>
109+
<additionalparam>-Xdoclint:none</additionalparam>
110+
</configuration>
111+
<executions>
112+
<execution>
113+
<id>attach-javadocs</id>
114+
<goals>
115+
<goal>jar</goal>
116+
</goals>
117+
</execution>
118+
</executions>
119+
</plugin>
120+
</plugins>
121+
</build>
122+
</profile>
123+
</profiles>
32124

33125
<build>
34126
<plugins>
@@ -172,16 +264,28 @@
172264
</snapshots>
173265
</repository>
174266
</repositories>
267+
<!--<distributionManagement>-->
268+
<!--<repository>-->
269+
<!--<id>releases</id>-->
270+
<!--<name>Nexus Release Repository</name>-->
271+
<!--<url>http://nexus.hsweb.me/content/repositories/releases/</url>-->
272+
<!--</repository>-->
273+
<!--<snapshotRepository>-->
274+
<!--<id>snapshots</id>-->
275+
<!--<name>Nexus Snapshot Repository</name>-->
276+
<!--<url>http://nexus.hsweb.me/content/repositories/snapshots/</url>-->
277+
<!--</snapshotRepository>-->
278+
<!--</distributionManagement>-->
175279
<distributionManagement>
176280
<repository>
177-
<id>releases</id>
178-
<name>Nexus Release Repository</name>
179-
<url>http://nexus.hsweb.me/content/repositories/releases/</url>
281+
<id>sonatype-releases</id>
282+
<name>sonatype repository</name>
283+
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
180284
</repository>
181285
<snapshotRepository>
182-
<id>snapshots</id>
286+
<id>sonatype-snapshots</id>
183287
<name>Nexus Snapshot Repository</name>
184-
<url>http://nexus.hsweb.me/content/repositories/snapshots/</url>
288+
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
185289
</snapshotRepository>
186290
</distributionManagement>
187291
</project>

0 commit comments

Comments
 (0)