Remove beans - v2.0.0 (#14)
* remove beans.xml * remove java ee dependency and javax annotations * Bump dependencies * Version set to 2.0.0 This is a breaking change to any library that depended upon the Java EE annotation to instantiate these classes. They will now need to instantiate them themselves.
This commit is contained in:
parent
8dab6e2c08
commit
7d3af91b8c
6 changed files with 9 additions and 41 deletions
15
pom.xml
15
pom.xml
|
@ -12,19 +12,17 @@
|
|||
</parent>
|
||||
|
||||
<artifactId>kemitix-trello</artifactId>
|
||||
<version>1.1.0</version>
|
||||
<version>2.0.0</version>
|
||||
|
||||
<properties>
|
||||
<tiles-maven-plugin.version>2.18</tiles-maven-plugin.version>
|
||||
<kemitix-tiles.version>2.10.0</kemitix-tiles.version>
|
||||
|
||||
<trello-java-wrapper.version>0.14</trello-java-wrapper.version>
|
||||
<lombok.version>1.18.16</lombok.version>
|
||||
<camel-api.version>3.6.0</camel-api.version>
|
||||
<junit.version>5.6.1</junit.version>
|
||||
<lombok.version>1.18.22</lombok.version>
|
||||
<camel-api.version>3.12.0</camel-api.version>
|
||||
<junit.version>5.8.2</junit.version>
|
||||
<assertj.version>3.18.1</assertj.version>
|
||||
<jakarta.enterprise.cdi-api.version>2.0.2
|
||||
</jakarta.enterprise.cdi-api.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
@ -44,11 +42,6 @@
|
|||
<artifactId>camel-api</artifactId>
|
||||
<version>${camel-api.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>jakarta.enterprise</groupId>
|
||||
<artifactId>jakarta.enterprise.cdi-api</artifactId>
|
||||
<version>${jakarta.enterprise.cdi-api.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
package net.kemitix.trello;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.annotation.PreDestroy;
|
||||
import javax.enterprise.context.ApplicationScoped;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
|
@ -11,7 +8,6 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
@ApplicationScoped
|
||||
public class AttachmentDirectoryImpl implements AttachmentDirectory {
|
||||
|
||||
private static final Logger LOG =
|
||||
|
@ -22,7 +18,6 @@ public class AttachmentDirectoryImpl implements AttachmentDirectory {
|
|||
private Path dir;
|
||||
private List<File> toDelete = new ArrayList<>();
|
||||
|
||||
@PostConstruct
|
||||
public void init() throws IOException {
|
||||
dir = Files.createTempDirectory("attachments");
|
||||
LOG.info("Attachments directory: " + dir);
|
||||
|
@ -38,7 +33,6 @@ public class AttachmentDirectoryImpl implements AttachmentDirectory {
|
|||
return file;
|
||||
}
|
||||
|
||||
@PreDestroy
|
||||
public void deleteFiles() {
|
||||
toDelete.stream()
|
||||
.peek(file -> LOG.info("Deleting: " + file))
|
||||
|
|
|
@ -2,16 +2,12 @@ package net.kemitix.trello;
|
|||
|
||||
import org.apache.camel.Header;
|
||||
|
||||
import javax.enterprise.context.ApplicationScoped;
|
||||
import javax.inject.Inject;
|
||||
import java.util.Objects;
|
||||
|
||||
@ApplicationScoped
|
||||
public class LoadCard {
|
||||
|
||||
private final TrelloBoard trelloBoard;
|
||||
|
||||
@Inject
|
||||
public LoadCard(TrelloBoard trelloBoard) {
|
||||
this.trelloBoard = trelloBoard;
|
||||
}
|
||||
|
|
|
@ -6,9 +6,6 @@ import com.julienvey.trello.domain.*;
|
|||
import com.julienvey.trello.domain.Attachment;
|
||||
import lombok.extern.java.Log;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.enterprise.context.ApplicationScoped;
|
||||
import javax.inject.Inject;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
@ -16,7 +13,6 @@ import java.util.stream.Stream;
|
|||
import static net.kemitix.trello.ListUtils.map;
|
||||
|
||||
@Log
|
||||
@ApplicationScoped
|
||||
public class TrelloBoard {
|
||||
|
||||
private final Trello trello;
|
||||
|
@ -24,7 +20,6 @@ public class TrelloBoard {
|
|||
|
||||
private List<TList> lists;
|
||||
|
||||
@Inject
|
||||
public TrelloBoard(
|
||||
Trello trello,
|
||||
TrelloConfig trelloConfig
|
||||
|
@ -33,8 +28,7 @@ public class TrelloBoard {
|
|||
this.trelloConfig = trelloConfig;
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
void init () {
|
||||
public void init () {
|
||||
lists = board().fetchLists();
|
||||
}
|
||||
|
||||
|
|
|
@ -5,21 +5,14 @@ import com.julienvey.trello.TrelloHttpClient;
|
|||
import com.julienvey.trello.domain.Member;
|
||||
import com.julienvey.trello.impl.http.JDKTrelloHttpClient;
|
||||
|
||||
import javax.enterprise.context.ApplicationScoped;
|
||||
import javax.enterprise.inject.Produces;
|
||||
|
||||
@ApplicationScoped
|
||||
public class TrelloProducers {
|
||||
|
||||
@Produces
|
||||
@ApplicationScoped
|
||||
TrelloHttpClient trelloHttpClient() {
|
||||
public TrelloHttpClient trelloHttpClient() {
|
||||
return new JDKTrelloHttpClient();
|
||||
}
|
||||
|
||||
@Produces
|
||||
@ApplicationScoped
|
||||
TrelloClient trello(
|
||||
public TrelloClient trello(
|
||||
TrelloConfig config,
|
||||
TrelloHttpClient httpClient
|
||||
) {
|
||||
|
@ -29,9 +22,7 @@ public class TrelloProducers {
|
|||
httpClient);
|
||||
}
|
||||
|
||||
@Produces
|
||||
@ApplicationScoped
|
||||
Member member(Trello trello, TrelloConfig trelloConfig) {
|
||||
public Member member(Trello trello, TrelloConfig trelloConfig) {
|
||||
return trello.getMemberInformation(trelloConfig.getUserName());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue