[重要]更新pom的package问题

This commit is contained in:
jy.hu 2014-11-10 13:26:29 +08:00
parent ff436b6f03
commit ef39c25f66
11 changed files with 78 additions and 39 deletions

25
pom.xml
View File

@ -73,6 +73,31 @@
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.5</version>
<executions>
<execution>
<id>default-jar</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classesDirectory>target/classes</classesDirectory>
<excludes>
<exclude>*.properties</exclude>
<exclude>*.xml</exclude>
<exclude>*.txt</exclude>
</excludes>
<archive>
<addMavenDescriptor>false</addMavenDescriptor>
</archive>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>

View File

@ -103,10 +103,5 @@
<artifactId>commons-codec</artifactId>
<version>${commons.codec.version}</version>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>${jsoup.version}</version>
</dependency>
</dependencies>
</project>

View File

@ -33,8 +33,6 @@ import org.apache.http.impl.conn.PoolingClientConnectionManager;
import org.apache.http.params.CoreConnectionPNames;
import org.apache.http.params.CoreProtocolPNames;
import org.apache.http.util.EntityUtils;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import com.alibaba.fastjson.JSONException;
import com.foxinmy.weixin4j.exception.WeixinException;
@ -198,8 +196,7 @@ public class HttpRequest {
if (contentType.getValue().contains(
ContentType.TEXT_HTML.getMimeType())) {
response.setText(new String(data, "gbk"));
Document doc = Jsoup.parse(response.getAsString());
throw new WeixinException(doc.body().text());
throw new WeixinException(response.getAsString());
} else if (contentType.getValue().contains(
ContentType.APPLICATION_JSON.getMimeType())) {
checkJson(response);

View File

@ -19,6 +19,29 @@
</modules>
<build>
<finalName>weixin4j-mp</finalName>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<descriptors>
<descriptor>src/main/assembly.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
<dependencies>
<dependency>

View File

@ -39,7 +39,7 @@ weixin.properties说明
| token_path | 使用FileTokenHolder时token保存的物理路径 |
| qr_path | 调用二维码接口时保存二维码图片的物理路径 |
| media_path | 调用媒体接口时保存媒体文件的物理路径 |
| bill_path | 调用支付(`V3`)下载对账单接口保存excel文件的物理路径 |
| bill_path | 调用下载对账单接口保存excel文件的物理路径 |
| ca_file | 调用某些接口(支付相关)强制需要auth的ca授权文件 |
示例(properties中换行用右斜杆\\)
@ -48,12 +48,13 @@ weixin.properties说明
> "token":"开放者的token 非必须","openId":"公众号的openid 非必须",
> "mchId":"V3.x版本下的微信商户号",
> "partnerId":"财付通的商户号","partnerKey":"财付通商户权限密钥Key",
> "version":"针对微信支付的版本号(2,3),如果不填则按照mchId非空与否来判断",
> "paySignKey":"微信支付中调用API的密钥"} <br/>
> token_path=/tmp/weixin/token <br/>
> qr_path=/tmp/weixin/qr <br/>
> media_path=/tmp/weixin/media <br/>
> bill_path=/tmp/weixin/bill <br/>
> ca_file=/tmp/weixin/xxxxx.p12 <br/>
> ca_file=/tmp/weixin/xxxxx.p12|xxxx.pfx <br/>
2.实例化一个`WeixinProxy`对象,调用API,需要强调的是如果只传入appid,appsecret两个参数将无法调用支付相关接口

View File

@ -42,5 +42,10 @@
<artifactId>poi-ooxml-schemas</artifactId>
<version>${poi.version}</version>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>${jsoup.version}</version>
</dependency>
</dependencies>
</project>

View File

@ -3,6 +3,7 @@
account={"appId":"wx4ab8f8de58159a57","appSecret":"1d4eb0f4bf556aaed539f30ed05ca795",\
"token":"\u5f00\u653e\u8005\u7684token \u975e\u5fc5\u987b","openId":"\u516c\u4f17\u53f7\u7684openid \u975e\u5fc5\u987b",\
"mchId":"V3.x\u7248\u672c\u4e0b\u7684\u5fae\u4fe1\u5546\u6237\u53f7",\
"version":3,\
"partnerId":"\u8d22\u4ed8\u901a\u7684\u5546\u6237\u53f7","partnerKey":"\u8d22\u4ed8\u901a\u5546\u6237\u6743\u9650\u5bc6\u94a5Key",\
"paySignKey":"\u5fae\u4fe1\u652f\u4ed8\u4e2d\u8c03\u7528API\u7684\u5bc6\u94a5"}
@ -15,4 +16,4 @@ media_path=/tmp/weixin/media
# \u5bf9\u8d26\u5355\u4fdd\u5b58\u8def\u5f84
bill_path=/tmp/weixin/bill
# ca\u8bc1\u4e66\u5b58\u653e\u7684\u5b8c\u6574\u8def\u5f84
ca_file=/Users/jy/Downloads/1221928801.pfx
ca_file=/tmp/weixin/xxxxxx.p12

View File

@ -21,7 +21,7 @@ weixin4j-mp-server
| token_path | 使用FileTokenHolder时token保存的物理路径 |
| qr_path | 调用二维码接口时保存二维码图片的物理路径 |
| media_path | 调用媒体接口时保存媒体文件的物理路径 |
| bill_path | 调用支付(`V3`)下载对账单接口保存excel文件的物理路径 |
| bill_path | 调用下载对账单接口保存excel文件的物理路径 |
| ca_file | 调用某些接口(支付相关)强制需要auth的ca授权文件 |
示例(properties中换行用右斜杆\\)
@ -30,12 +30,13 @@ weixin4j-mp-server
> "token":"开放者的token 非必须","openId":"公众号的openid 非必须",
> "mchId":"V3.x版本下的微信商户号",
> "partnerId":"财付通的商户号","partnerKey":"财付通商户权限密钥Key",
> "version":"针对微信支付的版本号(目前可能为2,3),如果不填则按照mchId非空与否来做判断",
> "paySignKey":"微信支付中调用API的密钥"} <br/>
> token_path=/tmp/weixin/token <br/>
> qr_path=/tmp/weixin/qr <br/>
> media_path=/tmp/weixin/media <br/>
> bill_path=/tmp/weixin/bill <br/>
> ca_file=/tmp/weixin/xxxxx.p12 <br/>
> ca_file=/tmp/weixin/xxxxx.p12|xxxxx.pfx <br/>
2.mvn package,得到一个zip的压缩包,解压到启动目录(见`src/main/startup.sh/APP_HOME`)

View File

@ -13,28 +13,13 @@
<url>https://github.com/foxinmy/weixin4j/tree/master/weixin4j-mp/weixin4j-server</url>
<description>微信公众号服务</description>
<build>
<finalName>weixin4j-mp-server</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2.1</version>
<configuration>
<descriptors>
<descriptor>src/main/assembly.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<finalName>weixin4j-mp-server</finalName>
</build>
<dependencies>
<dependency>

View File

@ -1,4 +1,7 @@
<assembly>
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>bin</id>
<formats>
<format>zip</format>
@ -10,6 +13,12 @@
</dependencySet>
</dependencySets>
<fileSets>
<fileSet>
<directory>com.foxinmy.weixin4j.mp</directory>
<includes>
<include>**/*.md</include>
</includes>
</fileSet>
<fileSet>
<directory>src/main</directory>
<outputDirectory>/</outputDirectory>
@ -19,12 +28,8 @@
</includes>
</fileSet>
<fileSet>
<directory>target/classes</directory>
<directory>src/main/resources</directory>
<outputDirectory>/conf</outputDirectory>
<includes>
<include>*.properties</include>
<include>*.xml</include>
</includes>
</fileSet>
</fileSets>
</assembly>

View File

@ -2,6 +2,7 @@
account={"appId":"wx4ab8f8de58159a57","appSecret":"1d4eb0f4bf556aaed539f30ed05ca795",\
"token":"\u5f00\u653e\u8005\u7684token \u975e\u5fc5\u987b","openId":"\u516c\u4f17\u53f7\u7684openid \u975e\u5fc5\u987b",\
"mchId":"V3.x\u7248\u672c\u4e0b\u7684\u5fae\u4fe1\u5546\u6237\u53f7",\
"version":3,\
"partnerId":"\u8d22\u4ed8\u901a\u7684\u5546\u6237\u53f7","partnerKey":"\u8d22\u4ed8\u901a\u5546\u6237\u6743\u9650\u5bc6\u94a5Key",\
"paySignKey":"\u5fae\u4fe1\u652f\u4ed8\u4e2d\u8c03\u7528API\u7684\u5bc6\u94a5"}