Skip to content

Commit c2f8afd

Browse files
Merge pull request #87 from contentstack/next
Utils SDK Updated
2 parents 93705b9 + b65ae3e commit c2f8afd

21 files changed

+278
-307
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Publishing to GitHub Packages
2+
#on: [ push ] # Trigger the workflow when a push (commit) event occurs
3+
on:
4+
release:
5+
types: [ created ]
6+
jobs:
7+
publish-github:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v3
11+
- name: Set up Java for publishing to GitHub Packages
12+
uses: actions/setup-java@v3
13+
with:
14+
java-version: '11'
15+
distribution: 'adopt'
16+
server-id: github
17+
- name: Publish to GitHub Packages
18+
run: mvn --batch-mode deploy
19+
env:
20+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/maven-publish.yml

-37
This file was deleted.

.github/workflows/sast-scan.yml

-11
This file was deleted.

.github/workflows/secrets-scan.yml

-11
This file was deleted.

CHANGELOG.md

+13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# CHANGELOG
22

3+
## v1.12.2
4+
5+
### Date: 08-AUG-2023
6+
7+
- Updated Utils SDK to v1.2.3
8+
9+
## v1.12.1
10+
11+
### Date: 07-Jun-2023
12+
13+
- Added Support For Nested Assets
14+
- General Code Improvement
15+
316
## v1.12.0
417

518
### Date: 25-APR-2023

pom.xml

+67-22
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<modelVersion>4.0.0</modelVersion>
66
<groupId>com.contentstack.sdk</groupId>
77
<artifactId>java</artifactId>
8-
<version>1.12.1-SNAPSHOT</version>
8+
<version>1.12.2</version>
99
<packaging>jar</packaging>
1010
<name>contentstack-java</name>
1111
<description>Java SDK for Contentstack Content Delivery API</description>
@@ -22,7 +22,6 @@
2222
<dotenv-source.version>3.0.0</dotenv-source.version>
2323
<rxjava-source.version>3.1.6</rxjava-source.version>
2424
<retrofit-source.version>2.9.0</retrofit-source.version>
25-
<converter-gson-source.version>2.9.0</converter-gson-source.version>
2625
<loggin.version>4.11.0</loggin.version>
2726
<jococo-plugin.version>0.8.5</jococo-plugin.version>
2827
<lombok-source.version>1.18.28</lombok-source.version>
@@ -37,7 +36,7 @@
3736
<json-version>20230227</json-version>
3837
<jacoco-maven-plugin-version>0.8.7</jacoco-maven-plugin-version>
3938
<maven-release-plugin-version>2.5.3</maven-release-plugin-version>
40-
<contentstack-utils-version>1.2.2</contentstack-utils-version>
39+
<contentstack-utils-version>1.2.3</contentstack-utils-version>
4140
</properties>
4241

4342
<parent>
@@ -87,14 +86,25 @@
8786
</developers>
8887

8988
<distributionManagement>
89+
90+
<!-- Maven Snapshot Repository -->
9091
<snapshotRepository>
9192
<id>ossrh</id>
9293
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
9394
</snapshotRepository>
95+
96+
<!--GitHub Packages-->
97+
<!-- <repository>-->
98+
<!-- <id>github</id>-->
99+
<!-- <url>https://maven.pkg.github.com/contentstack/contentstack-java</url>-->
100+
<!-- </repository>-->
101+
102+
<!-- Maven Release Repository-->
94103
<repository>
95104
<id>ossrh</id>
96105
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
97106
</repository>
107+
98108
</distributionManagement>
99109

100110

@@ -105,36 +115,41 @@
105115
<version>${contentstack-utils-version}</version>
106116
<scope>compile</scope>
107117
</dependency>
118+
108119
<dependency>
109120
<groupId>org.json</groupId>
110121
<artifactId>json</artifactId>
111122
<version>${json-version}</version>
112123
<scope>compile</scope>
113124
</dependency>
125+
114126
<dependency>
115127
<groupId>io.github.cdimascio</groupId>
116128
<artifactId>dotenv-java</artifactId>
117129
<version>${dotenv-source.version}</version>
118-
<scope>runtime</scope>
130+
<!-- <scope>runtime</scope>-->
119131
</dependency>
132+
120133
<dependency>
121134
<groupId>io.reactivex.rxjava3</groupId>
122135
<artifactId>rxjava</artifactId>
123136
<version>${rxjava-source.version}</version>
124137
<scope>compile</scope>
125138
</dependency>
139+
126140
<dependency>
127141
<groupId>com.squareup.retrofit2</groupId>
128142
<artifactId>retrofit</artifactId>
129143
<version>${retrofit-source.version}</version>
130144
<scope>compile</scope>
131145
</dependency>
146+
<!-- https://mvnrepository.com/artifact/com.squareup.retrofit2/converter-gson -->
132147
<dependency>
133148
<groupId>com.squareup.retrofit2</groupId>
134149
<artifactId>converter-gson</artifactId>
135-
<version>${converter-gson-source.version}</version>
136-
<scope>compile</scope>
150+
<version>${retrofit-source.version}</version>
137151
</dependency>
152+
138153
<dependency>
139154
<groupId>com.squareup.okhttp3</groupId>
140155
<artifactId>logging-interceptor</artifactId>
@@ -171,6 +186,36 @@
171186
</dependencies>
172187

173188

189+
<profiles>
190+
<profile>
191+
<id>release-sign-artifacts</id>
192+
<activation>
193+
<property>
194+
<name>performRelease</name>
195+
<value>true</value>
196+
</property>
197+
</activation>
198+
<build>
199+
<plugins>
200+
<plugin>
201+
<groupId>org.apache.maven.plugins</groupId>
202+
<artifactId>maven-gpg-plugin</artifactId>
203+
<version>${maven-gpg-plugin.version}</version>
204+
<executions>
205+
<execution>
206+
<id>sign-artifacts</id>
207+
<phase>verify</phase>
208+
<goals>
209+
<goal>sign</goal>
210+
</goals>
211+
</execution>
212+
</executions>
213+
</plugin>
214+
</plugins>
215+
</build>
216+
</profile>
217+
</profiles>
218+
174219
<build>
175220
<plugins>
176221
<!--
@@ -233,20 +278,20 @@
233278
<artifactId>maven-enforcer-plugin</artifactId>
234279
<version>3.0.0-M2</version>
235280
</plugin>
236-
<plugin>
237-
<groupId>org.apache.maven.plugins</groupId>
238-
<artifactId>maven-gpg-plugin</artifactId>
239-
<version>1.5</version>
240-
<executions>
241-
<execution>
242-
<id>sign-artifacts</id>
243-
<phase>verify</phase>
244-
<goals>
245-
<goal>sign</goal>
246-
</goals>
247-
</execution>
248-
</executions>
249-
</plugin>
281+
<!-- <plugin>-->
282+
<!-- <groupId>org.apache.maven.plugins</groupId>-->
283+
<!-- <artifactId>maven-gpg-plugin</artifactId>-->
284+
<!-- <version>1.6</version>-->
285+
<!-- <executions>-->
286+
<!-- <execution>-->
287+
<!-- <id>sign-artifacts</id>-->
288+
<!-- <phase>verify</phase>-->
289+
<!-- <goals>-->
290+
<!-- <goal>sign</goal>-->
291+
<!-- </goals>-->
292+
<!-- </execution>-->
293+
<!-- </executions>-->
294+
<!-- </plugin>-->
250295
<plugin>
251296
<groupId>org.apache.maven.plugins</groupId>
252297
<artifactId>maven-compiler-plugin</artifactId>
@@ -268,8 +313,8 @@
268313
<version>${nexus-staging-maven-plugin.version}</version>
269314
<extensions>true</extensions>
270315
<configuration>
271-
<serverId>ossrh</serverId>
272-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
316+
<serverId>github</serverId>
317+
<nexusUrl>https://maven.pkg.github.com/contentstack/contentstack-java</nexusUrl>
273318
<autoReleaseAfterClose>true</autoReleaseAfterClose>
274319
</configuration>
275320
</plugin>

src/main/java/com/contentstack/sdk/Asset.java

+25-32
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ protected void setStackInstance(@NotNull Stack stack) {
5757
/**
5858
* Configure asset.
5959
*
60-
* @param jsonObject
61-
* the json object
60+
* @param jsonObject the json object
6261
* @return the asset
6362
*/
6463
public Asset configure(JSONObject jsonObject) {
@@ -77,19 +76,17 @@ public Asset configure(JSONObject jsonObject) {
7776
/**
7877
* Sets header.
7978
*
80-
* @param headerKey
81-
* the header key
82-
* @param headerValue
83-
* the header value
84-
*
85-
* <br>
86-
* <br>
87-
* <b>Example :</b><br>
88-
* <p>
89-
* <code>
90-
* Stack stack = Contentstack.stack("apiKey", "deliveryToken", "environment"); Asset asset =
91-
* stack.asset(asset_uid); asset.setHeader();
92-
* </code>
79+
* @param headerKey the header key
80+
* @param headerValue the header value
81+
*
82+
* <br>
83+
* <br>
84+
* <b>Example :</b><br>
85+
* <p>
86+
* <code>
87+
* Stack stack = Contentstack.stack("apiKey", "deliveryToken", "environment"); Asset asset =
88+
* stack.asset(asset_uid); asset.setHeader();
89+
* </code>
9390
*/
9491
public void setHeader(@NotNull String headerKey, @NotNull String headerValue) {
9592
headers.put(headerKey, headerValue);
@@ -98,17 +95,16 @@ public void setHeader(@NotNull String headerKey, @NotNull String headerValue) {
9895
/**
9996
* Remove header.
10097
*
101-
* @param headerKey
102-
* the header key
103-
*
104-
* <br>
105-
* <br>
106-
* <b>Example :</b>
107-
* <p>
108-
* <code>
109-
* Stack stack = Contentstack.stack("apiKey", "deliveryToken", "environment"); Asset asset =
110-
* stack.asset(asset_uid); asset.removeHeader();
111-
* <code>
98+
* @param headerKey the header key
99+
*
100+
* <br>
101+
* <br>
102+
* <b>Example :</b>
103+
* <p>
104+
* <code>
105+
* Stack stack = Contentstack.stack("apiKey", "deliveryToken", "environment"); Asset asset =
106+
* stack.asset(asset_uid); asset.removeHeader();
107+
* <code>
112108
*/
113109
public void removeHeader(@NotNull String headerKey) {
114110
headers.remove(headerKey);
@@ -457,10 +453,8 @@ public Asset includeDimension() {
457453
/**
458454
* Add param asset.
459455
*
460-
* @param paramKey
461-
* the param key
462-
* @param paramValue
463-
* the param value
456+
* @param paramKey the param key
457+
* @param paramValue the param value
464458
* @return the asset
465459
*
466460
* <br>
@@ -538,8 +532,7 @@ public Asset includeMetadata() {
538532
/**
539533
* Fetch.
540534
*
541-
* @param callback
542-
* the callback
535+
* @param callback the callback
543536
*/
544537
public void fetch(FetchResultCallback callback) {
545538
urlQueries.put(ENVIRONMENT, this.headers.get(ENVIRONMENT));

0 commit comments

Comments
 (0)