Skip to content

Commit

Permalink
Changes required by the WildFly Maven Plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
jfdenise authored and spyrkob committed Jan 20, 2023
1 parent 0ee4414 commit a3003f8
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ public BlocklistCoordinate(String groupId, String artifactId, String version) {
public BlocklistCoordinate(URL url) {
super(url);
}

public BlocklistCoordinate() {
super(BlocklistCoordinate.CLASSIFIER, BlocklistCoordinate.EXTENSION);
}

@JsonCreator
public static BlocklistCoordinate create(@JsonProperty(value = "maven") MavenCoordinate coord,
Expand Down
14 changes: 11 additions & 3 deletions core/src/main/java/org/wildfly/channel/Channel.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import java.util.List;

import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_EMPTY;
import java.util.ArrayList;
import static java.util.Collections.emptyList;

public class Channel {
Expand Down Expand Up @@ -38,14 +39,14 @@ public class Channel {
* This is an optional field.
*/
private Vendor vendor;
private List<Repository> repositories;
private List<Repository> repositories = new ArrayList<>();
private BlocklistCoordinate blocklistCoordinate;
private ChannelManifestCoordinate manifestCoordinate;
private NoStreamStrategy noStreamStrategy;
private NoStreamStrategy noStreamStrategy = NoStreamStrategy.ORIGINAL;

// no-arg constructor for maven plugins
public Channel() {

schemaVersion = ChannelMapper.CURRENT_SCHEMA_VERSION;
}

/**
Expand Down Expand Up @@ -94,30 +95,37 @@ public String getSchemaVersion() {
return schemaVersion;
}

@JsonInclude(JsonInclude.Include.NON_NULL)
public String getName() {
return name;
}

@JsonInclude(JsonInclude.Include.NON_NULL)
public String getDescription() {
return description;
}

@JsonInclude(JsonInclude.Include.NON_NULL)
public Vendor getVendor() {
return vendor;
}

@JsonInclude(JsonInclude.Include.NON_EMPTY)
public List<Repository> getRepositories() {
return repositories;
}

@JsonInclude(JsonInclude.Include.NON_NULL)
public BlocklistCoordinate getBlocklistCoordinate() {
return blocklistCoordinate;
}

@JsonInclude(JsonInclude.Include.NON_NULL)
public ChannelManifestCoordinate getManifestCoordinate() {
return manifestCoordinate;
}

@JsonInclude(JsonInclude.Include.NON_NULL)
public NoStreamStrategy getNoStreamStrategy() {
return noStreamStrategy;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ public ChannelManifestCoordinate(URL url) {
super(url);
}

public ChannelManifestCoordinate() {
super(ChannelManifest.CLASSIFIER, ChannelManifest.EXTENSION);
}

@JsonCreator
public static ChannelManifestCoordinate create(@JsonProperty(value = "url") String url, @JsonProperty(value = "maven") MavenCoordinate gav) throws MalformedURLException {
if (gav != null) {
Expand Down
8 changes: 8 additions & 0 deletions core/src/main/java/org/wildfly/channel/Repository.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,18 @@ public Repository(@JsonProperty(value = "id", required = true) String id, @JsonP
this.url = url;
}

public Repository() {

}

public String getId() {
return id;
}

public void setUrl(String url) {
this.url = url;
}

public String getUrl() {
return url;
}
Expand Down
7 changes: 5 additions & 2 deletions core/src/main/java/org/wildfly/channel/Vendor.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ public class Vendor {
/**
* Name of the vendor.
*/
private final String name;
private String name;

/**
* Support level provided by the vendor.
*/
private final Support support;
private Support support;

/**
* Vendor resource
Expand All @@ -46,6 +46,9 @@ public Vendor(@JsonProperty(value = "name", required = true) String name, @JsonP
this.support = support;
}

public Vendor() {
}

public String getName() {
return name;
}
Expand Down

0 comments on commit a3003f8

Please sign in to comment.