Skip to content
Merged
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
105 changes: 105 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,111 @@ To install the updated project files, build the Maven project:
mvn install
```

## Building from Source (Manual Build)

If you want to build the library from source and share it with someone without publishing to Maven, follow these steps:

### Prerequisites

- Java 11 or higher
- [Apache Maven](https://maven.apache.org/install.html) 3.6+

### Step 1: Clone the Repository

```bash
git clone https://github.com/coveo/push-api-client.java.git
cd push-api-client.java
```

### Step 2: Build the JAR

```bash
mvn clean package -DskipTests
```

This will generate the following files in the `target/` directory:

- `push-api-client.java-<version>.jar` — The compiled library
- `push-api-client.java-<version>-sources.jar` — Source code (for IDE integration)

### Step 3: Install to Local Maven Repository (Optional)

If you want to use the library in another local Maven project:

```bash
mvn clean install -DskipTests
```

This installs the JAR to your local `~/.m2/repository`, making it available to other projects on your machine.

### Step 4: Share the JAR

To share the built JAR with someone else:

1. **Send the JAR file**: Share the `target/push-api-client.java-<version>.jar` file directly.

2. **Recipient adds JAR to their project**:

**Option A — Install to their local Maven repository:**

```bash
mvn install:install-file \
-Dfile=push-api-client.java-<version>.jar \
-DgroupId=com.coveo \
-DartifactId=push-api-client.java \
-Dversion=<version> \
-Dpackaging=jar
```

Then add the dependency to their `pom.xml`:

```xml
<dependency>
<groupId>com.coveo</groupId>
<artifactId>push-api-client.java</artifactId>
<version><version></version>
</dependency>
```

**Option B — Use system scope (not recommended for production):**

```xml
<dependency>
<groupId>com.coveo</groupId>
<artifactId>push-api-client.java</artifactId>
<version><version></version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/push-api-client.java-<version>.jar</systemPath>
</dependency>
```

**Option C — For Gradle projects:**

Place the JAR in a `libs/` folder and add:

```groovy
dependencies {
implementation files('libs/push-api-client.java-<version>.jar')
}
```

### Running Tests

To run the test suite:

```bash
mvn test
```

### Validating Code Format

Before contributing, ensure your code follows the project's formatting rules:

```bash
mvn spotless:check # Check formatting
mvn spotless:apply # Auto-fix formatting issues
```

## Usage

> See more examples in the `./samples` folder.
Expand Down