Skip to content

Commit

Permalink
preparing release to version 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
danielkocot committed Mar 15, 2021
1 parent 1699720 commit 1554755
Show file tree
Hide file tree
Showing 27 changed files with 276 additions and 105 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Maven Build

on: [push]

jobs:
build:
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v2

- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11

- name: Build with Maven
run: mvn -B install --no-transfer-progress --file pom.xml
56 changes: 56 additions & 0 deletions .github/workflows/release-to-maven-central.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: release-to-maven-central
on:
workflow_dispatch:
inputs:
releaseversion:
description: 'Release version'
required: true
default: '2.0.0'
jobs:
publish:
runs-on: ubuntu-latest
steps:
- run: echo "Will start a Maven Central upload with version ${{ github.event.inputs.releaseversion }}"

- uses: actions/checkout@v2

- name: Set up settings.xml for Maven Central Repository
uses: actions/setup-java@v1
with:
java-version: 11
server-id: oss.sonatype.org
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE

- name: Set projects Maven version to GitHub Action GUI set version
run: mvn versions:set "-DnewVersion=${{ github.event.inputs.releaseversion }}" --no-transfer-progress

- name: Publish package
run: mvn --batch-mode clean deploy --no-transfer-progress -P central-deploy -DskipTests=true
env:
MAVEN_USERNAME: ${{ secrets.OSS_SONATYPE_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSS_SONATYPE_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

- name: Generate changelog
id: changelog
uses: metcalfc/changelog-generator@v0.4.4
with:
myToken: ${{ secrets.GITHUB_TOKEN }}

- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.inputs.releaseversion }}
release_name: ${{ github.event.inputs.releaseversion }}
body: |
Grab the new version from Maven central https://repo1.maven.org/maven2/de/codecentric/reedelk/module-rabbitmq/${{ github.event.inputs.releaseversion }}/
### Things that changed in this release
${{ steps.changelog.outputs.changelog }}
draft: false
prerelease: false
105 changes: 102 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,27 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.reedelk</groupId>
<groupId>de.codecentric.reedelk</groupId>
<artifactId>module-parent</artifactId>
<version>1.0.6</version>
<version>2.0.0</version>
</parent>

<packaging>bundle</packaging>
<version>1.0.6</version>
<version>2.0.0</version>
<artifactId>module-rabbitmq</artifactId>

<properties>
<maven.compiler.release>8</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<rabbitmq.version>5.8.0</rabbitmq.version>
<jacoco.version>0.8.2</jacoco.version>
<!-- Maven Central Release tools -->
<versions-maven-plugin.version>2.8.1</versions-maven-plugin.version>
<maven-deploy-plugin.version>3.0.0-M1</maven-deploy-plugin.version>
<maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
<maven-source-plugin.version>3.2.1</maven-source-plugin.version>
<maven-javadoc-plugin.version>3.2.0</maven-javadoc-plugin.version>
<nexus-staging-maven-plugin.version>1.6.8</nexus-staging-maven-plugin.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -73,4 +80,96 @@
</plugin>
</plugins>
</build>
<profiles>
<!-- plugins needed to deploy to Maven Central -->
<profile>
<id>central-deploy</id>
<build>
<plugins>
<plugin>
<artifactId>maven-gpg-plugin</artifactId>
<version>${maven-gpg-plugin.version}</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
<configuration>
<!-- This is necessary for gpg to not try to use the pinentry programs -->
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>${versions-maven-plugin.version}</version>
<configuration>
<generateBackupPoms>false</generateBackupPoms>
</configuration>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>${maven-deploy-plugin.version}</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>${maven-source-plugin.version}</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.version}</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>${nexus-staging-maven-plugin.version}</version>
<extensions>true</extensions>
<configuration>
<serverId>oss.sonatype.org</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<description>${project.version}</description>
</configuration>
<executions>
<execution>
<id>deploy-to-sonatype</id>
<phase>deploy</phase>
<goals>
<goal>deploy</goal>
<goal>release</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
8 changes: 0 additions & 8 deletions src/main/java/com/reedelk/rabbitmq/ModuleDefinition.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package de.codecentric.reedelk.rabbitmq;

import de.codecentric.reedelk.runtime.api.annotation.Module;

@Module("RabbitMQ Module")
public class ModuleDefinition {
}

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.reedelk.rabbitmq.component;
package de.codecentric.reedelk.rabbitmq.component;

import com.reedelk.runtime.api.annotation.*;
import com.reedelk.runtime.api.component.Implementor;
import de.codecentric.reedelk.runtime.api.annotation.*;
import de.codecentric.reedelk.runtime.api.component.Implementor;
import org.osgi.service.component.annotations.Component;

import static java.util.Optional.ofNullable;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
package com.reedelk.rabbitmq.component;
package de.codecentric.reedelk.rabbitmq.component;

import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import com.reedelk.rabbitmq.internal.*;
import com.reedelk.rabbitmq.internal.attribute.RabbitMQConsumerAttributes;
import com.reedelk.rabbitmq.internal.exception.RabbitMQConsumerException;
import com.reedelk.runtime.api.annotation.*;
import com.reedelk.runtime.api.component.AbstractInbound;
import com.reedelk.runtime.api.message.content.MimeType;
import de.codecentric.reedelk.rabbitmq.internal.*;
import de.codecentric.reedelk.rabbitmq.internal.attribute.RabbitMQConsumerAttributes;
import de.codecentric.reedelk.rabbitmq.internal.exception.RabbitMQConsumerException;
import de.codecentric.reedelk.runtime.api.annotation.*;
import de.codecentric.reedelk.runtime.api.component.AbstractInbound;
import de.codecentric.reedelk.runtime.api.message.content.MimeType;
import org.osgi.service.component.annotations.Component;

import java.io.IOException;

import static com.reedelk.rabbitmq.internal.commons.Messages.RabbitMQConsumer.CONSUME_ERROR;
import static com.reedelk.runtime.api.commons.ComponentPrecondition.Configuration.requireNotBlank;
import static de.codecentric.reedelk.rabbitmq.internal.commons.Messages.RabbitMQConsumer.CONSUME_ERROR;
import static de.codecentric.reedelk.runtime.api.commons.ComponentPrecondition.Configuration.requireNotBlank;
import static java.util.Optional.of;
import static java.util.Optional.ofNullable;
import static org.osgi.service.component.annotations.ServiceScope.PROTOTYPE;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.reedelk.rabbitmq.component;
package de.codecentric.reedelk.rabbitmq.component;

import com.reedelk.runtime.api.annotation.*;
import com.reedelk.runtime.api.component.Implementor;
import de.codecentric.reedelk.runtime.api.annotation.*;
import de.codecentric.reedelk.runtime.api.component.Implementor;
import org.osgi.service.component.annotations.Component;

import static java.util.Optional.ofNullable;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
package com.reedelk.rabbitmq.component;
package de.codecentric.reedelk.rabbitmq.component;

import com.rabbitmq.client.AMQP;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import com.reedelk.rabbitmq.internal.ChannelUtils;
import com.reedelk.rabbitmq.internal.ConnectionFactoryProvider;
import com.reedelk.rabbitmq.internal.exception.RabbitMQProducerException;
import com.reedelk.runtime.api.annotation.*;
import com.reedelk.runtime.api.commons.StringUtils;
import com.reedelk.runtime.api.component.ProcessorSync;
import com.reedelk.runtime.api.converter.ConverterService;
import com.reedelk.runtime.api.flow.FlowContext;
import com.reedelk.runtime.api.message.Message;
import com.reedelk.runtime.api.script.ScriptEngineService;
import com.reedelk.runtime.api.script.dynamicvalue.DynamicString;
import de.codecentric.reedelk.rabbitmq.internal.ChannelUtils;
import de.codecentric.reedelk.rabbitmq.internal.ConnectionFactoryProvider;
import de.codecentric.reedelk.rabbitmq.internal.exception.RabbitMQProducerException;
import de.codecentric.reedelk.runtime.api.annotation.*;
import de.codecentric.reedelk.runtime.api.commons.StringUtils;
import de.codecentric.reedelk.runtime.api.component.ProcessorSync;
import de.codecentric.reedelk.runtime.api.converter.ConverterService;
import de.codecentric.reedelk.runtime.api.flow.FlowContext;
import de.codecentric.reedelk.runtime.api.message.Message;
import de.codecentric.reedelk.runtime.api.script.ScriptEngineService;
import de.codecentric.reedelk.runtime.api.script.dynamicvalue.DynamicString;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;

import java.io.IOException;
import java.util.UUID;

import static com.reedelk.rabbitmq.internal.commons.Messages.RabbitMQProducer.CREATE_CHANNEL_ERROR;
import static com.reedelk.rabbitmq.internal.commons.Messages.RabbitMQProducer.PUBLISH_MESSAGE_ERROR;
import static com.reedelk.runtime.api.commons.ComponentPrecondition.Configuration.requireNotBlank;
import static com.reedelk.runtime.api.commons.ComponentPrecondition.Configuration.requireTrue;
import static de.codecentric.reedelk.rabbitmq.internal.commons.Messages.RabbitMQProducer.CREATE_CHANNEL_ERROR;
import static de.codecentric.reedelk.rabbitmq.internal.commons.Messages.RabbitMQProducer.PUBLISH_MESSAGE_ERROR;
import static de.codecentric.reedelk.runtime.api.commons.ComponentPrecondition.Configuration.requireNotBlank;
import static de.codecentric.reedelk.runtime.api.commons.ComponentPrecondition.Configuration.requireTrue;
import static java.util.Optional.of;
import static java.util.Optional.ofNullable;
import static org.osgi.service.component.annotations.ServiceScope.PROTOTYPE;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.reedelk.rabbitmq.component;
package de.codecentric.reedelk.rabbitmq.component;

import com.reedelk.runtime.api.annotation.DefaultValue;
import com.reedelk.runtime.api.annotation.Description;
import com.reedelk.runtime.api.annotation.Property;
import com.reedelk.runtime.api.annotation.When;
import com.reedelk.runtime.api.component.Implementor;
import de.codecentric.reedelk.runtime.api.annotation.DefaultValue;
import de.codecentric.reedelk.runtime.api.annotation.Description;
import de.codecentric.reedelk.runtime.api.annotation.Property;
import de.codecentric.reedelk.runtime.api.annotation.When;
import de.codecentric.reedelk.runtime.api.component.Implementor;
import org.osgi.service.component.annotations.Component;

import static java.util.Optional.ofNullable;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.reedelk.rabbitmq.internal;
package de.codecentric.reedelk.rabbitmq.internal;

import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
package com.reedelk.rabbitmq.internal;
package de.codecentric.reedelk.rabbitmq.internal;

import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;
import com.reedelk.rabbitmq.component.ConnectionConfiguration;
import com.reedelk.runtime.api.exception.PlatformException;
import de.codecentric.reedelk.rabbitmq.component.ConnectionConfiguration;
import de.codecentric.reedelk.runtime.api.exception.PlatformException;

import java.io.IOException;
import java.net.URISyntaxException;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.util.concurrent.TimeoutException;

import static com.reedelk.rabbitmq.component.ConnectionConfiguration.*;

public class ConnectionFactoryProvider {

public static Connection from(String uri) {
Expand All @@ -32,12 +30,12 @@ public static Connection from(String uri) {
public static Connection from(ConnectionConfiguration configuration) {
ConnectionFactory factory = new ConnectionFactory();
try {
factory.setUsername(userName(configuration));
factory.setPassword(password(configuration));
factory.setVirtualHost(virtualHost(configuration));
factory.setHost(hostName(configuration));
factory.setPort(port(configuration));
factory.setAutomaticRecoveryEnabled(isAutomaticRecovery(configuration));
factory.setUsername(ConnectionConfiguration.userName(configuration));
factory.setPassword(ConnectionConfiguration.password(configuration));
factory.setVirtualHost(ConnectionConfiguration.virtualHost(configuration));
factory.setHost(ConnectionConfiguration.hostName(configuration));
factory.setPort(ConnectionConfiguration.port(configuration));
factory.setAutomaticRecoveryEnabled(ConnectionConfiguration.isAutomaticRecovery(configuration));
return factory.newConnection();
} catch (IOException | TimeoutException e) {
throw new PlatformException(e);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.reedelk.rabbitmq.internal;
package de.codecentric.reedelk.rabbitmq.internal;

import com.rabbitmq.client.CancelCallback;

Expand Down
Loading

0 comments on commit 1554755

Please sign in to comment.