Добавил плагин для загрузки в мавенцентрал и провел небольшой рефакторинг

This commit is contained in:
upagge 2020-04-28 03:56:40 +03:00
parent 7af6c39b03
commit d3c29c4275
No known key found for this signature in database
GPG Key ID: 15CD012E46F6BA34
8 changed files with 107 additions and 3 deletions

100
pom.xml
View File

@ -8,6 +8,18 @@
<artifactId>autoresponder</artifactId>
<version>1.8-RELEASE</version>
<packaging>jar</packaging>
<name>Abstract Autoresponder</name>
<description>Abstract implementation for processing text requests.</description>
<url>https://github.com/uPagge/autoresponder</url>
<licenses>
<license>
<name>BSD License</name>
<url>https://github.com/uPagge/autoresponder/blob/master/LICENSE</url>
<distribution>repo</distribution>
</license>
</licenses>
<build>
<plugins>
<plugin>
@ -22,9 +34,17 @@
</plugins>
</build>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
<properties>
<slf4j.ver>1.7.26</slf4j.ver>
<junit.ver>4.12</junit.ver>
<lombok.ver>1.18.6</lombok.ver>
</properties>
<dependencies>
@ -43,10 +63,88 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.6</version>
<version>${lombok.ver}</version>
</dependency>
</dependencies>
<scm>
<connection>scm:git:https://github.com/uPagge/autoresponder.git</connection>
<url>https://github.com/uPagge/autoresponder</url>
<developerConnection>scm:git:https://github.com/uPagge/autoresponder.git</developerConnection>
</scm>
<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.7</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.7</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<developers>
<developer>
<id>uPagge</id>

View File

@ -52,4 +52,5 @@ public abstract class Unit<U extends Unit> {
this.priority = Optional.ofNullable(priority).orElse(10);
this.nextUnits = nextUnits;
}
}

View File

@ -1,6 +1,7 @@
package org.sadtech.autoresponder.repository;
import lombok.NonNull;
import org.sadtech.autoresponder.entity.Unit;
import org.sadtech.autoresponder.entity.UnitPointer;
import java.util.Collection;
@ -23,7 +24,7 @@ public interface UnitPointerRepository {
/**
* @param entityId Идентификатор пользователя
* @return Объект с последним обработанным {@link org.sadtech.autoresponder.entity.Unit} для пользователя
* @return Объект с последним обработанным {@link Unit} для пользователя
*/
Optional<UnitPointer> findByEntityId(@NonNull Long entityId);

View File

@ -42,4 +42,5 @@ public class UnitPointerRepositoryMap implements UnitPointerRepository {
public Optional<UnitPointer> findByEntityId(@NonNull Long entityId) {
return Optional.ofNullable(unitPointerMap.get(entityId));
}
}

View File

@ -27,5 +27,4 @@ public interface UnitPointerService {
void edit(@NonNull Long entityId, Unit unit);
}

View File

@ -37,4 +37,5 @@ public class UnitPointerServiceImpl implements UnitPointerService {
public boolean check(@NonNull Long entityId) {
return unitPointerRepository.findByEntityId(entityId).isPresent();
}
}

View File

@ -13,5 +13,7 @@ import java.lang.annotation.Target;
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.SOURCE)
public @interface Description {
String value() default "";
}

View File

@ -12,4 +12,5 @@ final class Message {
private Message() {
throw new IllegalStateException(UTILITY_CLASS);
}
}