Skip to content

Commit

Permalink
Add maven-publish plugin (#392)
Browse files Browse the repository at this point in the history
  • Loading branch information
chia7712 authored Jun 5, 2022
1 parent 10011ae commit 4923d28
Show file tree
Hide file tree
Showing 230 changed files with 717 additions and 724 deletions.
19 changes: 19 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ plugins {
// Apply the application plugin to add support for building a CLI application in Java.
id 'application'
id 'com.github.johnrengelman.shadow' version '7.1.0'
id 'maven-publish'
}

repositories {
Expand Down Expand Up @@ -66,3 +67,21 @@ tasks.named('test') {
minHeapSize = "512m"
maxHeapSize = "2048m"
}

publishing {
publications {
mavenJava(MavenPublication) {
groupId = 'org.astraea'
from components.java
}
}
repositories {
maven {
url = "https://maven.pkg.github.com/skiptests/astraea"
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
package org.astraea;
package org.astraea.app;

import com.beust.jcommander.ParameterException;
import java.lang.reflect.InvocationTargetException;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import org.astraea.admin.ReplicaCollie;
import org.astraea.admin.ReplicaSyncingMonitor;
import org.astraea.admin.TopicExplorer;
import org.astraea.automation.Automation;
import org.astraea.cost.topic.PartitionScore;
import org.astraea.metrics.MetricExplorer;
import org.astraea.performance.Performance;
import org.astraea.web.WebService;
import org.astraea.app.admin.ReplicaCollie;
import org.astraea.app.admin.ReplicaSyncingMonitor;
import org.astraea.app.admin.TopicExplorer;
import org.astraea.app.automation.Automation;
import org.astraea.app.cost.topic.PartitionScore;
import org.astraea.app.metrics.MetricExplorer;
import org.astraea.app.performance.Performance;
import org.astraea.app.web.WebService;

public class App {
private static final Map<String, Class<?>> MAIN_CLASSES =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.astraea.admin;
package org.astraea.app.admin;

import java.io.Closeable;
import java.util.Collection;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.astraea.admin;
package org.astraea.app.admin;

import java.util.ArrayList;
import java.util.Collection;
Expand Down Expand Up @@ -33,7 +33,7 @@
import org.apache.kafka.common.quota.ClientQuotaEntity;
import org.apache.kafka.common.quota.ClientQuotaFilter;
import org.apache.kafka.common.quota.ClientQuotaFilterComponent;
import org.astraea.common.Utils;
import org.astraea.app.common.Utils;

public class Builder {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.astraea.admin;
package org.astraea.app.admin;

import java.util.Locale;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.astraea.admin;
package org.astraea.app.admin;

import java.util.Collection;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.astraea.admin;
package org.astraea.app.admin;

import java.util.List;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.astraea.admin;
package org.astraea.app.admin;

import java.util.Objects;
import java.util.Optional;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.astraea.admin;
package org.astraea.app.admin;

public final class Offset {
private final long earliest;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.astraea.admin;
package org.astraea.app.admin;

import java.util.Objects;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.astraea.admin;
package org.astraea.app.admin;

import java.util.Arrays;
import java.util.Collection;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.astraea.admin;
package org.astraea.app.admin;

/**
* Kafka quota APIs are too incomprehensible to use, so we re-design quota APIs to builder pattern.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.astraea.admin;
package org.astraea.app.admin;

import java.util.Objects;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.astraea.admin;
package org.astraea.app.admin;

import com.beust.jcommander.Parameter;
import java.io.IOException;
Expand All @@ -10,9 +10,9 @@
import java.util.Set;
import java.util.TreeMap;
import java.util.stream.Collectors;
import org.astraea.argument.BooleanField;
import org.astraea.argument.IntegerSetField;
import org.astraea.argument.StringSetField;
import org.astraea.app.argument.BooleanField;
import org.astraea.app.argument.IntegerSetField;
import org.astraea.app.argument.StringSetField;

public class ReplicaCollie {
static final String UNKNOWN = "unknown";
Expand Down Expand Up @@ -287,7 +287,7 @@ static Map<TopicPartition, MigratorInfo> execute(Admin admin, Argument args) {
}

public static void main(String[] args) throws IOException {
var argument = org.astraea.argument.Argument.parse(new Argument(), args);
var argument = org.astraea.app.argument.Argument.parse(new Argument(), args);

try (var admin = Admin.of(argument.bootstrapServers())) {
execute(admin, argument)
Expand All @@ -309,7 +309,7 @@ public static void main(String[] args) throws IOException {
}
}

static class Argument extends org.astraea.argument.Argument {
static class Argument extends org.astraea.app.argument.Argument {
@Parameter(
names = {"--topics"},
description = "Those topics' partitions will get reassigned. Empty means all topics",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.astraea.admin;
package org.astraea.app.admin;

import java.util.List;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.astraea.admin;
package org.astraea.app.admin;

import com.beust.jcommander.Parameter;
import java.time.Duration;
Expand All @@ -16,17 +16,17 @@
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.apache.kafka.common.TopicPartitionReplica;
import org.astraea.argument.DurationField;
import org.astraea.argument.NonEmptyStringField;
import org.astraea.common.DataRate;
import org.astraea.common.DataSize;
import org.astraea.common.DataUnit;
import org.astraea.common.Utils;
import org.astraea.app.argument.DurationField;
import org.astraea.app.argument.NonEmptyStringField;
import org.astraea.app.common.DataRate;
import org.astraea.app.common.DataSize;
import org.astraea.app.common.DataUnit;
import org.astraea.app.common.Utils;

public class ReplicaSyncingMonitor {

public static void main(String[] args) {
Argument argument = org.astraea.argument.Argument.parse(new Argument(), args);
Argument argument = org.astraea.app.argument.Argument.parse(new Argument(), args);
try (Admin topicAdmin = Admin.of(argument.bootstrapServers())) {
execute(topicAdmin, argument);
}
Expand Down Expand Up @@ -297,7 +297,7 @@ static String replicaDescriptor(Replica replica) {
.collect(Collectors.joining(", ", "[", "]"));
}

static class Argument extends org.astraea.argument.Argument {
static class Argument extends org.astraea.app.argument.Argument {

@Parameter(
names = {"--topics"},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.astraea.admin;
package org.astraea.app.admin;

import java.time.Duration;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.astraea.admin;
package org.astraea.app.admin;

import com.beust.jcommander.Parameter;
import java.io.IOException;
Expand All @@ -17,10 +17,10 @@
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import java.util.stream.Stream;
import org.astraea.argument.NonEmptyStringField;
import org.astraea.argument.StringSetField;
import org.astraea.common.DataSize;
import org.astraea.common.DataUnit;
import org.astraea.app.argument.NonEmptyStringField;
import org.astraea.app.argument.StringSetField;
import org.astraea.app.common.DataSize;
import org.astraea.app.common.DataUnit;

public class TopicExplorer {

Expand Down Expand Up @@ -109,7 +109,7 @@ static Result execute(Admin admin, Set<String> topics) {
}

public static void main(String[] args) throws IOException {
var argument = org.astraea.argument.Argument.parse(new Argument(), args);
var argument = org.astraea.app.argument.Argument.parse(new Argument(), args);
try (var admin = Admin.of(argument.bootstrapServers())) {
var result = execute(admin, argument.topics.isEmpty() ? admin.topicNames() : argument.topics);
TreeOutput.print(result, System.out);
Expand Down Expand Up @@ -446,7 +446,7 @@ static String descriptor(Replica replica) {
}
}

static class Argument extends org.astraea.argument.Argument {
static class Argument extends org.astraea.app.argument.Argument {
@Parameter(
names = {"--topics"},
description = "the topics to show all offset-related information. Empty means all topics",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.astraea.admin;
package org.astraea.app.admin;

import java.util.Objects;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.astraea.argument;
package org.astraea.app.argument;

import com.beust.jcommander.JCommander;
import com.beust.jcommander.Parameter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.astraea.argument;
package org.astraea.app.argument;

import com.beust.jcommander.ParameterException;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package org.astraea.argument;
package org.astraea.app.argument;

import com.beust.jcommander.ParameterException;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.apache.kafka.common.record.CompressionType;
import org.astraea.admin.Compression;
import org.astraea.app.admin.Compression;

public class CompressionField extends Field<Compression> {
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.astraea.argument;
package org.astraea.app.argument;

import com.beust.jcommander.ParameterException;
import java.time.Duration;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.astraea.argument;
package org.astraea.app.argument;

import com.beust.jcommander.IParameterValidator;
import com.beust.jcommander.IStringConverter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.astraea.argument;
package org.astraea.app.argument;

import java.util.Set;
import java.util.stream.Collectors;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.astraea.argument;
package org.astraea.app.argument;

public class NonEmptyStringField extends Field<String> {
@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.astraea.argument;
package org.astraea.app.argument;

public class NonNegativeDoubleField extends NonNegativeNumberField<Double> {
@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.astraea.argument;
package org.astraea.app.argument;

public class NonNegativeIntegerField extends NonNegativeNumberField<Integer> {
@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.astraea.argument;
package org.astraea.app.argument;

public class NonNegativeLongField extends NonNegativeNumberField<Long> {
@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.astraea.argument;
package org.astraea.app.argument;

import com.beust.jcommander.ParameterException;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.astraea.argument;
package org.astraea.app.argument;

public class NonNegativeShortField extends NonNegativeNumberField<Short> {
@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.astraea.argument;
package org.astraea.app.argument;

import java.nio.file.FileSystems;
import java.nio.file.Path;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.astraea.argument;
package org.astraea.app.argument;

public class PositiveDoubleField extends PositiveNumberField<Double> {
@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.astraea.argument;
package org.astraea.app.argument;

public class PositiveIntegerField extends PositiveNumberField<Integer> {
@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.astraea.argument;
package org.astraea.app.argument;

public class PositiveLongField extends PositiveNumberField<Long> {
@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.astraea.argument;
package org.astraea.app.argument;

import com.beust.jcommander.ParameterException;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.astraea.argument;
package org.astraea.app.argument;

public class PositiveShortField extends PositiveNumberField<Short> {
@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.astraea.argument;
package org.astraea.app.argument;

import com.beust.jcommander.ParameterException;
import java.util.Set;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.astraea.argument;
package org.astraea.app.argument;

import com.beust.jcommander.ParameterException;
import java.util.Arrays;
Expand Down
Loading

0 comments on commit 4923d28

Please sign in to comment.