An open API service indexing awesome lists of open source software.

https://github.com/manusa/gradle-api-maven-plugin

Add any Gradle distribution as a dependency to your Maven project
https://github.com/manusa/gradle-api-maven-plugin

Last synced: 6 months ago
JSON representation

Add any Gradle distribution as a dependency to your Maven project

Awesome Lists containing this project

README

          

# Gradle API Maven Plugin

Maven plugin that registers a Maven extension that will automatically add all Gradle dependencies for a given version to your Project.

This is especially useful since Gradle no longer publishes its artifacts to Maven Central.

## Usage

Add a _fake_ dependency to your project with the version of Gradle you want to use.

```xml


org.gradle
gradle-all
${version.gradle}
test

```

Add the plugin with the `extensions` option enabled.

```xml



com.marcnuri.plugins
gradle-api-maven-plugin
0.0.6
true

```

> [!IMPORTANT]
> Please make sure to provide the `true` option for the plugin.

> [!NOTE]
> It's likely that you'll also need to add a dependency for `org.codehaus.groovy:groovy-all` to your project.

With these settings, you should now be able to import and make use of the Gradle API types.

## Frequently Asked Questions (FAQ)

### How to use behind an HTTPS proxy with authentication?

You can configure the proxy by passing the following properties to the Maven build:

```shell
mvn -Dhttps.proxyHost=proxy.example.com -Dhttps.proxyPort=8080 -Dhttps.proxyUser=proxyuser -Dhttps.proxyPassword=proxypass
```

In addition, you can also leverage the `settings.xml` file to configure the proxy as you would do for Maven:

```xml



example-proxy
true
https
proxy.example.com
8080
proxyuser
proxypass
localhost|*.example.com

```

## Developing

### Integration test

There are integration tests to verify that the plugin works as expected.
The tests rely on the Maven Invoker Plugin to run a Maven build with the plugin applied.

You can use the tests to debug the project in your IDE.
Start the project compilation with the following command:
```shell
mvn -Pit-debug verify
```
Then, configure your IDE to perform a remote debug connection to port `8000`.

### Release Process

#### Release to Maven Central

To release a new version automatically:

```shell
make release V=X.Y.Z VS=X.Y
```
- `V`: New version to release.
- `VS`: New SNAPSHOT version for Maven.

To release a new version manually:

1. Update the version in the `pom.xml` file.
```shell
mvn versions:set -DnewVersion=X.Y.Z -DgenerateBackupPoms=false
```
2. Commit and tag the release with the `pom.xml` version.
```shell
git add .
git commit -m "[RELEASE] vX.Y.Z released"
git tag vX.Y.Z
git push origin vX.Y.Z
```
3. Update the version in the `pom.xml` file to the next snapshot version.
```shell
mvn versions:set -DnewVersion=X.Y-SNAPSHOT -DgenerateBackupPoms=false
```
4. Commit the changes with the following message:
```shell
git add .
git commit -m "[RELEASE] v0.0.6 released, prepare for next development iteration"
git push origin master
```

#### Create GitHub Release

Once the release is published to Maven Central, create a new [GitHub release](https://github.com/manusa/gradle-api-maven-plugin/releases/new) for the released tag.

### License Headers

Whenever a new file is created, the license header must be added. To add the license header to all files:

```shell
make license
```