Skip to content

fix(java): release package with name algoliasearch-client-java #498

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ plugins {
id 'com.github.johnrengelman.shadow' version '7.0.0'
}

description = 'algoliasearch-client-java-2'
java.sourceCompatibility = JavaVersion.VERSION_1_8

repositories {
mavenCentral()
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
POM_ARTIFACT_ID=algoliasearch-client-java
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldn't it be algoliasearch-core if we have multiple package under this repository later?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's not planned for now, I'm not sure what the correct package should be called but it won't be algoliasearch-core for now

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally it should be the exact same as today, to avoid losing version history etc. but during this experimental phase it can be whatever indeed.

What do you think of adding the experimental like we did for JS? So it's a bit of warning and less confusing to users

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SNAPSHOT is the same as experimental for user, they cannot see it and have to add a special repository by hand to be able to use it. It's like another package.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah oki make sense then!

Empty file modified clients/algoliasearch-client-java-2/gradlew
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion clients/algoliasearch-client-java-2/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
rootProject.name = "algoliasearch-client-java-2"
rootProject.name = "algoliasearch-client-java"

include(":algoliasearch-core")
2 changes: 2 additions & 0 deletions config/generation.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ module.exports = {

// Java
'!clients/algoliasearch-client-java-2/*.gradle',
'!clients/algoliasearch-client-java-2/gradlew',
'!clients/algoliasearch-client-java-2/.gitignore',
'!clients/algoliasearch-client-java-2/gradle/wrapper/**',
'!clients/algoliasearch-client-java-2/algoliasearch-core/build.gradle',
'!clients/algoliasearch-client-java-2/algoliasearch-core/gradle.properties',
'!clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/exceptions/**',
'!clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/utils/**',

Expand Down
24 changes: 8 additions & 16 deletions config/openapitools.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,111 +135,103 @@
},
"java-search": {
"output": "#{cwd}/clients/algoliasearch-client-java-2",
"artifactId": "algoliasearch-client-java-2",
"groupId": "com.algolia",
"apiPackage": "com.algolia.api",
"invokerPackage": "com.algolia",
"modelPackage": "com.algolia.model.search",
"library": "okhttp-gson",
"gitRepoId": "algoliasearch-client-java-2",
"additionalProperties": {
"packageName": "algoliasearch-client-java-2"
"packageName": "algoliasearch-client-java"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's called algoliasearch in maven in the current version, does it changes something for us to change this name? I don't know how package managers work for Java

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah algoliasearch-core exists too

this will break the version bump, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

packageName is only used for js, I should remove it here but it changes lots of scripts

}
},
"java-recommend": {
"output": "#{cwd}/clients/algoliasearch-client-java-2",
"artifactId": "algoliasearch-client-java-2",
"groupId": "com.algolia",
"apiPackage": "com.algolia.api",
"invokerPackage": "com.algolia",
"modelPackage": "com.algolia.model.recommend",
"library": "okhttp-gson",
"gitRepoId": "algoliasearch-client-java-2",
"additionalProperties": {
"packageName": "algoliasearch-client-java-2"
"packageName": "algoliasearch-client-java"
}
},
"java-personalization": {
"output": "#{cwd}/clients/algoliasearch-client-java-2",
"artifactId": "algoliasearch-client-java-2",
"groupId": "com.algolia",
"apiPackage": "com.algolia.api",
"invokerPackage": "com.algolia",
"modelPackage": "com.algolia.model.personalization",
"library": "okhttp-gson",
"gitRepoId": "algoliasearch-client-java-2",
"additionalProperties": {
"packageName": "algoliasearch-client-java-2",
"packageName": "algoliasearch-client-java",
"hasRegionalHost": true
}
},
"java-analytics": {
"output": "#{cwd}/clients/algoliasearch-client-java-2",
"artifactId": "algoliasearch-client-java-2",
"groupId": "com.algolia",
"apiPackage": "com.algolia.api",
"invokerPackage": "com.algolia",
"modelPackage": "com.algolia.model.analytics",
"library": "okhttp-gson",
"gitRepoId": "algoliasearch-client-java-2",
"additionalProperties": {
"packageName": "algoliasearch-client-java-2",
"packageName": "algoliasearch-client-java",
"hasRegionalHost": true
}
},
"java-insights": {
"output": "#{cwd}/clients/algoliasearch-client-java-2",
"artifactId": "algoliasearch-client-java-2",
"groupId": "com.algolia",
"apiPackage": "com.algolia.api",
"invokerPackage": "com.algolia",
"modelPackage": "com.algolia.model.insights",
"library": "okhttp-gson",
"gitRepoId": "algoliasearch-client-java-2",
"additionalProperties": {
"packageName": "algoliasearch-client-java-2",
"packageName": "algoliasearch-client-java",
"hasRegionalHost": true
}
},
"java-abtesting": {
"output": "#{cwd}/clients/algoliasearch-client-java-2",
"artifactId": "algoliasearch-client-java-2",
"groupId": "com.algolia",
"apiPackage": "com.algolia.api",
"invokerPackage": "com.algolia",
"modelPackage": "com.algolia.model.abtesting",
"library": "okhttp-gson",
"gitRepoId": "algoliasearch-client-java-2",
"additionalProperties": {
"packageName": "algoliasearch-client-java-2",
"packageName": "algoliasearch-client-java",
"hasRegionalHost": true
}
},
"java-query-suggestions": {
"output": "#{cwd}/clients/algoliasearch-client-java-2",
"artifactId": "algoliasearch-client-java-2",
"groupId": "com.algolia",
"apiPackage": "com.algolia.api",
"invokerPackage": "com.algolia",
"modelPackage": "com.algolia.model.querySuggestions",
"library": "okhttp-gson",
"gitRepoId": "algoliasearch-client-java-2",
"additionalProperties": {
"packageName": "algoliasearch-client-java-2",
"packageName": "algoliasearch-client-java",
"hasRegionalHost": true
}
},
"java-predict": {
"output": "#{cwd}/clients/algoliasearch-client-java-2",
"artifactId": "algoliasearch-client-java-2",
"groupId": "com.algolia",
"apiPackage": "com.algolia.api",
"invokerPackage": "com.algolia",
"modelPackage": "com.algolia.model.predict",
"library": "okhttp-gson",
"gitRepoId": "algoliasearch-client-java-2",
"additionalProperties": {
"packageName": "algoliasearch-client-java-2"
"packageName": "algoliasearch-client-java"
}
},
"php-search": {
Expand Down
2 changes: 1 addition & 1 deletion playground/java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repositories {

dependencies {
implementation 'io.github.cdimascio:dotenv-java:2.2.2'
implementation 'com.algolia:algoliasearch-core:0.0.1-SNAPSHOT'
implementation 'com.algolia:algoliasearch-client-java:0.0.1-SNAPSHOT'
}

group = 'com.algolia'
Expand Down
6 changes: 5 additions & 1 deletion playground/java/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
rootProject.name = 'java-playground'

includeBuild '../../clients/algoliasearch-client-java-2'
includeBuild('../../clients/algoliasearch-client-java-2') {
dependencySubstitution {
substitute module('com.algolia:algoliasearch-client-java') using project(':algoliasearch-core')
}
}
2 changes: 1 addition & 1 deletion tests/output/java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ repositories {
}

dependencies {
testImplementation 'com.algolia:algoliasearch-core:0.0.1-SNAPSHOT'
testImplementation 'com.algolia:algoliasearch-client-java:0.0.1-SNAPSHOT'
testImplementation 'org.junit.jupiter:junit-jupiter:5.8.2'
testImplementation 'org.skyscreamer:jsonassert:1.5.0'
testImplementation 'com.google.code.gson:gson:2.8.9'
Expand Down
6 changes: 5 additions & 1 deletion tests/output/java/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
rootProject.name = 'java-tests'

includeBuild '../../../clients/algoliasearch-client-java-2'
includeBuild('../../../clients/algoliasearch-client-java-2') {
dependencySubstitution {
substitute module('com.algolia:algoliasearch-client-java') using project(':algoliasearch-core')
}
}
6 changes: 3 additions & 3 deletions website/docs/api-clients/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ $res = $client->getUserTokenProfile('<YOUR_TOKEN>');

<TabItem value="java">

To get started, add the [algoliasearch-core](https://oss.sonatype.org/content/repositories/snapshots/com/algolia/algoliasearch-core/0.0.1-SNAPSHOT/) dependency to your project, either with [Maven](https://maven.apache.org/):
To get started, add the [algoliasearch-client-java](https://oss.sonatype.org/content/repositories/snapshots/com/algolia/algoliasearch-client-java/0.0.1-SNAPSHOT/) dependency to your project, either with [Maven](https://maven.apache.org/):
```xml
<repositories>
<repository>
Expand All @@ -174,7 +174,7 @@ To get started, add the [algoliasearch-core](https://oss.sonatype.org/content/re

<dependency>
<groupId>com.algolia</groupId>
<artifactId>algoliasearch-core</artifactId>
<artifactId>algoliasearch-client-java</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
```
Expand All @@ -186,7 +186,7 @@ repositories() {
}

dependencies {
testImplementation 'com.algolia:algoliasearch-core:0.0.1-SNAPSHOT'
testImplementation 'com.algolia:algoliasearch-client-java:0.0.1-SNAPSHOT'
}
```

Expand Down
4 changes: 2 additions & 2 deletions website/docs/automation/release-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Each language repository should have their own release process, and should run o

### Java

Java is released to [sonatype](https://oss.sonatype.org/) before being sent to [Maven](https://search.maven.org/artifact/com.algolia/algoliasearch-core) central repository, the `jar` need to be signed before publishing, and then verified on sonatype by using `closeAndRelease` target on Gradle.
Java is released to [sonatype](https://oss.sonatype.org/) before being sent to [Maven](https://search.maven.org/artifact/com.algolia/algoliasearch-client-java) central repository, the `jar` need to be signed before publishing, and then verified on sonatype by using `closeAndRelease` target on Gradle.
All of this is handled in the [release action](https://github.com/algolia/algoliasearch-client-java-2/tree/next/.github/workflows/release.yml), executed on the [Java repository](https://github.com/algolia/algoliasearch-client-java-2).
If you want to release manually, you need to copy some secrets to either:

Expand Down Expand Up @@ -76,7 +76,7 @@ repositories {
}

dependencies {
implementation 'com.algolia:algoliasearch-core:0.0.1-SNAPSHOT'
implementation 'com.algolia:algoliasearch-client-java:0.0.1-SNAPSHOT'
}
```

Expand Down