snowdrop / istio-java-api

A Java API to generate Istio descriptors, inspired by Fabric8's kubernetes-model.
Apache License 2.0
112 stars 33 forks source link

🐛 Unable to build #18

Closed geoand closed 6 years ago

geoand commented 6 years ago

OS: Ubuntu 16.04

Steps followed:

Outcome:

[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /home/gandrian/gowork/src/istio-java-api/istio-model/target/generated-sources/me/snowdrop/istio/api/model/TimeStamp.java:[38,8] duplicate class: me.snowdrop.istio.api.model.TimeStamp

Contents of /home/gandrian/gowork/src/istio-java-api/istio-model/target/generated-sources/me/snowdrop/istio/api/model/TimeStamp.java:

package me.snowdrop.istio.api.model;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import javax.validation.Valid;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import io.fabric8.kubernetes.api.model.Doneable;
import io.sundr.builder.annotations.Buildable;
import io.sundr.builder.annotations.Inline;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 * 
 * 
 */
@JsonInclude(JsonInclude.Include.NON_EMPTY)
@JsonPropertyOrder({
    "apiVersion",
    "kind",
    "metadata",
    "value"
})
@JsonDeserialize(using = com.fasterxml.jackson.databind.JsonDeserializer.None.class)
@ToString
@EqualsAndHashCode
@Buildable(editableEnabled = false, validationEnabled = true, generateBuilderPackage = true, builderPackage = "io.fabric8.kubernetes.api.builder", inline = @Inline(type = Doneable.class, prefix = "Doneable", value = "done"))
public class TimeStamp implements Serializable
{

    /**
     * 
     * 
     */
    @JsonProperty("value")
    @JsonPropertyDescription("")
    @Valid
    private Timestamp value;
    @JsonIgnore
    @Valid
    private Map<String, Object> additionalProperties = new HashMap<String, Object>();
    private final static long serialVersionUID = 5557293445908817843L;

    /**
     * No args constructor for use in serialization
     * 
     */
    public TimeStamp() {
    }

    /**
     * 
     * @param value
     */
    public TimeStamp(Timestamp value) {
        super();
        this.value = value;
    }

    /**
     * 
     * 
     */
    @JsonProperty("value")
    public Timestamp getValue() {
        return value;
    }

    /**
     * 
     * 
     */
    @JsonProperty("value")
    public void setValue(Timestamp value) {
        this.value = value;
    }

    @JsonAnyGetter
    public Map<String, Object> getAdditionalProperties() {
        return this.additionalProperties;
    }

    @JsonAnySetter
    public void setAdditionalProperty(String name, Object value) {
        this.additionalProperties.put(name, value);
    }

}
geoand commented 6 years ago

The issue seems to go away if

<delete file="${basedir}/target/generated-sources/me/snowdrop/istio/api/model/Timestamp.java" verbose="true" />

is replaced by

<delete file="${basedir}/target/generated-sources/me/snowdrop/istio/api/model/TimeStamp.java" verbose="true" />

in istio-model/pom.xml

metacosm commented 6 years ago

The main issue here is that the source code is not in the proper hierarchy but there seems to still be an issue with Timestamp vs TimeStamp that shows up on Linux. This doesn't show up on my system because macOS is case-insensitive but case-preserving (at least, I think that's the root of the problem). So I do need to investigate some more.

geoand commented 6 years ago

Sounds good :)