Skip to content

Commit 746595d

Browse files
author
zhanggaosheng
committed
修改打包
1 parent 9cf7c1c commit 746595d

File tree

3 files changed

+220
-12
lines changed

3 files changed

+220
-12
lines changed

pom.xml

+217-4
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,18 @@
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<modelVersion>4.0.0</modelVersion>
66

7+
<name>escloud-java-sdk</name>
78
<groupId>com.codeages</groupId>
89
<artifactId>escloud-java-sdk</artifactId>
9-
<version>1.0-SNAPSHOT</version>
10+
<version>1.0-RELEASES</version>
11+
<description>java SDK for escloud</description>
1012

1113
<properties>
12-
<maven.compiler.source>1.8</maven.compiler.source>
13-
<maven.compiler.target>1.8</maven.compiler.target>
14+
<java.version>11</java.version>
15+
<compiler.encoding>UTF-8</compiler.encoding>
16+
<org.projectlombok.version>1.18.10</org.projectlombok.version>
17+
<org.mapstruct.version>1.3.1.Final</org.mapstruct.version>
1418
<java-jwt>3.9.0</java-jwt>
15-
<slf4j>1.7.5</slf4j>
1619
<junit>4.12</junit>
1720
<org.apache.httpcomponents.httpasyncclient>4.0.2</org.apache.httpcomponents.httpasyncclient>
1821
<org.apache.httpcomponents.httpclient>4.4.1</org.apache.httpcomponents.httpclient>
@@ -93,4 +96,214 @@
9396

9497
</dependencies>
9598

99+
<licenses>
100+
<license>
101+
<name>The Apache Software License, Version 2.0</name>
102+
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
103+
<distribution></distribution>
104+
</license>
105+
</licenses>
106+
107+
<developers>
108+
<developer>
109+
<name>codeages</name>
110+
<email>[email protected]</email>
111+
<organization>codeages</organization>
112+
<url>https://github.com/spring-skeleton</url>
113+
</developer>
114+
</developers>
115+
116+
117+
<scm>
118+
<url>https://github.com/codeages/escloud-java-sdk</url>
119+
<connection>https://github.com/codeages/escloud-java-sdk.git</connection>
120+
<developerConnection>scm:git:https://github.com/codeages/escloud-java-sdk.git</developerConnection>
121+
<tag>${project.version}</tag>
122+
</scm>
123+
124+
<!--发布到maven仓库-->
125+
<distributionManagement>
126+
<repository>
127+
<id>ossrh</id>
128+
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
129+
</repository>
130+
<snapshotRepository>
131+
<id>ossrh</id>
132+
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
133+
</snapshotRepository>
134+
</distributionManagement>
135+
136+
<build>
137+
<pluginManagement>
138+
<plugins>
139+
<plugin>
140+
<groupId>org.apache.maven.plugins</groupId>
141+
<artifactId>maven-compiler-plugin</artifactId>
142+
<version>3.8.1</version>
143+
<configuration>
144+
<source>${java.version}</source>
145+
<target>${java.version}</target>
146+
<encoding>${compiler.encoding}</encoding>
147+
<annotationProcessorPaths>
148+
<path>
149+
<groupId>org.projectlombok</groupId>
150+
<artifactId>lombok</artifactId>
151+
<version>${org.projectlombok.version}</version>
152+
</path>
153+
<path>
154+
<groupId>org.mapstruct</groupId>
155+
<artifactId>mapstruct-processor</artifactId>
156+
<version>${org.mapstruct.version}</version>
157+
</path>
158+
</annotationProcessorPaths>
159+
<compilerArgs>
160+
<compilerArg>
161+
-Amapstruct.suppressGeneratorTimestamp=true
162+
</compilerArg>
163+
<compilerArg>
164+
-Amapstruct.suppressGeneratorVersionInfoComment=true
165+
</compilerArg>
166+
</compilerArgs>
167+
</configuration>
168+
</plugin>
169+
<plugin>
170+
<groupId>org.apache.maven.plugins</groupId>
171+
<artifactId>maven-jar-plugin</artifactId>
172+
<version>3.2.0</version>
173+
<configuration>
174+
<excludes>
175+
<exclude>/application-*.properties</exclude>
176+
</excludes>
177+
<archive>
178+
<manifest>
179+
<addClasspath>true</addClasspath>
180+
<classpathPrefix>lib/</classpathPrefix>
181+
<mainClass>${start-class}</mainClass>
182+
<useUniqueVersions>false</useUniqueVersions>
183+
</manifest>
184+
<manifestEntries>
185+
<Class-Path>./config/</Class-Path>
186+
</manifestEntries>
187+
</archive>
188+
</configuration>
189+
</plugin>
190+
<plugin>
191+
<groupId>org.apache.maven.plugins</groupId>
192+
<artifactId>maven-dependency-plugin</artifactId>
193+
<version>3.1.1</version>
194+
<executions>
195+
<execution>
196+
<id>copy</id>
197+
<phase>package</phase>
198+
<goals>
199+
<goal>copy-dependencies</goal>
200+
</goals>
201+
<configuration>
202+
<outputDirectory>
203+
./target/lib
204+
</outputDirectory>
205+
<includeScope>runtime</includeScope>
206+
</configuration>
207+
</execution>
208+
</executions>
209+
</plugin>
210+
<plugin>
211+
<groupId>org.apache.maven.plugins</groupId>
212+
<artifactId>maven-source-plugin</artifactId>
213+
<version>2.2.1</version>
214+
<executions>
215+
<execution>
216+
<phase>package</phase>
217+
<goals>
218+
<goal>jar-no-fork</goal>
219+
</goals>
220+
</execution>
221+
</executions>
222+
</plugin>
223+
<plugin>
224+
<groupId>org.apache.maven.plugins</groupId>
225+
<artifactId>maven-javadoc-plugin</artifactId>
226+
<version>3.2.0</version>
227+
<configuration>
228+
<encoding>${compiler.encoding}</encoding>
229+
<charset>${compiler.encoding}</charset>
230+
<docencoding>${compiler.encoding}</docencoding>
231+
</configuration>
232+
<executions>
233+
<execution>
234+
<id>attach-javadocs</id>
235+
<phase>package</phase>
236+
<goals>
237+
<goal>jar</goal>
238+
</goals>
239+
</execution>
240+
</executions>
241+
</plugin>
242+
<plugin>
243+
<groupId>org.apache.maven.plugins</groupId>
244+
<artifactId>maven-surefire-plugin</artifactId>
245+
<version>2.12.4</version>
246+
<configuration>
247+
<includes>
248+
<include>**/*Test.java</include>
249+
</includes>
250+
<excludes>
251+
<exclude>**/BaseTest.java</exclude>
252+
</excludes>
253+
</configuration>
254+
</plugin>
255+
<plugin>
256+
<groupId>org.apache.maven.plugins</groupId>
257+
<artifactId>maven-antrun-plugin</artifactId>
258+
<version>1.8</version>
259+
<executions>
260+
<execution>
261+
<id>package</id>
262+
<phase>package</phase>
263+
<goals>
264+
<goal>run</goal>
265+
</goals>
266+
<configuration>
267+
<tasks>
268+
<copy todir="${project.build.directory}/${project.name}/lib" overwrite="true">
269+
<fileset dir="${project.build.directory}/lib">
270+
<include name="*.jar"/>
271+
</fileset>
272+
</copy>
273+
<copy tofile="${project.build.directory}/${project.name}/${project.name}.jar"
274+
file="${project.build.directory}/${project.name}.jar" overwrite="true"/>
275+
<mkdir dir="${project.build.directory}/${project.name}/config"/>
276+
<copy todir="${project.build.directory}/${project.name}/config" overwrite="true">
277+
<fileset dir="src/main/resources">
278+
<include name="application-*.properties"/>
279+
</fileset>
280+
</copy>
281+
</tasks>
282+
</configuration>
283+
</execution>
284+
</executions>
285+
</plugin>
286+
<plugin>
287+
<groupId>org.apache.maven.plugins</groupId>
288+
<artifactId>maven-gpg-plugin</artifactId>
289+
<version>1.6</version>
290+
<executions>
291+
<execution>
292+
<id>sign-artifacts</id>
293+
<phase>verify</phase>
294+
<goals>
295+
<goal>sign</goal>
296+
</goals>
297+
</execution>
298+
</executions>
299+
</plugin>
300+
</plugins>
301+
</pluginManagement>
302+
<plugins>
303+
<plugin>
304+
<groupId>org.apache.maven.plugins</groupId>
305+
<artifactId>maven-gpg-plugin</artifactId>
306+
</plugin>
307+
</plugins>
308+
</build>
96309
</project>

src/main/java/com/codeages/escloud/service/BaseService.java

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
11
package com.codeages.escloud.service;
22

3-
import com.codeages.escloud.httpClient.Client;
43
import com.codeages.escloud.Auth;
4+
import com.codeages.escloud.httpClient.Client;
55
import org.json.JSONException;
6-
import org.slf4j.Logger;
7-
import org.slf4j.LoggerFactory;
86

97
import java.io.UnsupportedEncodingException;
108
import java.net.URISyntaxException;
119
import java.util.Map;
1210

1311
public class BaseService {
1412

15-
private static Logger logger = LoggerFactory.getLogger(BaseService.class);
16-
1713
protected Auth auth;
1814

1915
private Client client;

src/test/java/test/codeages/escloud/ResourceTest.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import org.junit.Test;
1313
import org.mockito.Mockito;
1414

15-
import java.io.File;
1615
import java.io.IOException;
1716
import java.io.UnsupportedEncodingException;
1817
import java.net.URISyntaxException;
@@ -174,8 +173,8 @@ public void finishUploadTest() throws UnsupportedEncodingException, URISyntaxExc
174173

175174
@Test
176175
public void UploadTest() throws URISyntaxException, IOException {
177-
File file = new File("/var/www/edusoho.mp4");
178-
this.resourceService.upload(file, "111112323333");
176+
// File file = new File("/var/www/edusoho.mp4");
177+
// this.resourceService.upload(file, "111112323333");
179178
}
180179

181180
protected Map mockResource() {

0 commit comments

Comments
 (0)