簡體   English   中英

Maven:構建失敗

[英]Maven: Build failure

我花了3天時間尋找這些錯誤背后的原因,我需要使用特定的框架EclipseLink將這3個表實體映射到PostgreSQL,當然這三個實體之間存在關系:

package com.sagemcom.tn.entities;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author G557437
 */
@Entity
@Table(name = "GROUPE", catalog = "", schema = "SYNCPKTME")
@NamedQueries({
    @NamedQuery(name = "Groupe.findAll", query = "SELECT g FROM Groupe g")})
public class Groupe implements Serializable {
    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "IDGROUPE")
    private BigDecimal idgroupe;
    @Size(max = 45)
    @Column(name = "NOMGROUPE")
    private String nomgroupe;
    @Size(max = 45)
    @Column(name = "LIBELLE")
    private String libelle;
    @Size(max = 10)
    @Column(name = "CREE_PAR")
    private String creePar;
    @Column(name = "DATE_CREATION")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dateCreation;
    @Size(max = 45)
    @Column(name = "MAJ_PAR")
    private String majPar;
    @Column(name = "DATE_MAJ")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dateMaj;
    @OneToMany(mappedBy = "idgroupe")
    private List<PersonneGroupe> personneGroupeList;

    public Groupe() {
    }

    public Groupe(BigDecimal idgroupe) {
        this.idgroupe = idgroupe;
    }

    public BigDecimal getIdgroupe() {
        return idgroupe;
    }

    public void setIdgroupe(BigDecimal idgroupe) {
        this.idgroupe = idgroupe;
    }

    public String getNomgroupe() {
        return nomgroupe;
    }

    public void setNomgroupe(String nomgroupe) {
        this.nomgroupe = nomgroupe;
    }

    public String getLibelle() {
        return libelle;
    }

    public void setLibelle(String libelle) {
        this.libelle = libelle;
    }

    public String getCreePar() {
        return creePar;
    }

    public void setCreePar(String creePar) {
        this.creePar = creePar;
    }

    public Date getDateCreation() {
        return dateCreation;
    }

    public void setDateCreation(Date dateCreation) {
        this.dateCreation = dateCreation;
    }

    public String getMajPar() {
        return majPar;
    }

    public void setMajPar(String majPar) {
        this.majPar = majPar;
    }

    public Date getDateMaj() {
        return dateMaj;
    }

    public void setDateMaj(Date dateMaj) {
        this.dateMaj = dateMaj;
    }

    public List<PersonneGroupe> getPersonneGroupeList() {
        return personneGroupeList;
    }

    public void setPersonneGroupeList(List<PersonneGroupe> personneGroupeList) {
        this.personneGroupeList = personneGroupeList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idgroupe != null ? idgroupe.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Groupe)) {
            return false;
        }
        Groupe other = (Groupe) object;
        if ((this.idgroupe == null && other.idgroupe != null) || (this.idgroupe != null && !this.idgroupe.equals(other.idgroupe))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.sagemcom.tn.entities.lot1.Groupe[ idgroupe=" + idgroupe + " ]";
    }

}

package com.sagemcom.tn.entities;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author G557437
 */
@Entity
@Table(name = "PERSONNE", schema = "SYNCPKTME")
public class Personne implements Serializable {
    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "IDPERSONNE")
    private BigDecimal idpersonne;
    @Size(max = 10)
    @Column(name = "MATRICULE")
    private String matricule;
    @Size(max = 45)
    @Column(name = "NOM")
    private String nom;
    @Size(max = 45)
    @Column(name = "PRENOM")
    private String prenom;
    @Size(max = 45)
    @Column(name = "UTILISATEUR")
    private String utilisateur;
    @Size(max = 10)
    @Column(name = "CREE_PAR")
    private String creePar;
    @Column(name = "DATE_CREATION")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dateCreation;
    @Size(max = 45)
    @Column(name = "MAJ_PAR")
    private String majPar;
    @Column(name = "DATE_MAJ")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dateMaj;
    @OneToMany(mappedBy = "idpersonne")
    private List<PersonneGroupe> personneGroupeList;

    public Personne() {
    }

    public Personne(BigDecimal idpersonne) {
        this.idpersonne = idpersonne;
    }

    public BigDecimal getIdpersonne() {
        return idpersonne;
    }

    public void setIdpersonne(BigDecimal idpersonne) {
        this.idpersonne = idpersonne;
    }

    public String getMatricule() {
        return matricule;
    }

    public void setMatricule(String matricule) {
        this.matricule = matricule;
    }

    public String getNom() {
        return nom;
    }

    public void setNom(String nom) {
        this.nom = nom;
    }

    public String getPrenom() {
        return prenom;
    }

    public void setPrenom(String prenom) {
        this.prenom = prenom;
    }

    public String getUtilisateur() {
        return utilisateur;
    }

    public void setUtilisateur(String utilisateur) {
        this.utilisateur = utilisateur;
    }

    public String getCreePar() {
        return creePar;
    }

    public void setCreePar(String creePar) {
        this.creePar = creePar;
    }

    public Date getDateCreation() {
        return dateCreation;
    }

    public void setDateCreation(Date dateCreation) {
        this.dateCreation = dateCreation;
    }

    public String getMajPar() {
        return majPar;
    }

    public void setMajPar(String majPar) {
        this.majPar = majPar;
    }

    public Date getDateMaj() {
        return dateMaj;
    }

    public void setDateMaj(Date dateMaj) {
        this.dateMaj = dateMaj;
    }

    public List<PersonneGroupe> getPersonneGroupeList() {
        return personneGroupeList;
    }

    public void setPersonneGroupeList(List<PersonneGroupe> personneGroupeList) {
        this.personneGroupeList = personneGroupeList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idpersonne != null ? idpersonne.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Personne)) {
            return false;
        }
        Personne other = (Personne) object;
        if ((this.idpersonne == null && other.idpersonne != null) || (this.idpersonne != null && !this.idpersonne.equals(other.idpersonne))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.sagemcom.tn.entities.lot1.Personne[ idpersonne=" + idpersonne + " ]";
    }

}

PersonGroup

package com.sagemcom.tn.entities;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author G557437
 */
@Entity
@Table(name = "PERSONNE_GROUPE", schema = "SYNCPKTME")
@NamedQueries({
    @NamedQuery(name = "PersonneGroupe.findAll", query = "SELECT p FROM PersonneGroupe p")})
public class PersonneGroupe implements Serializable {
    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "IDPERSONNEGROUPE")
    private BigDecimal idpersonnegroupe;
    @Size(max = 255)
    @Column(name = "CREE_PAR")
    private String creePar;
    @Column(name = "DATE_CREATION")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dateCreation;
    @Column(name = "DATE_MAJ")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dateMaj;
    @Size(max = 255)
    @Column(name = "MAJ_PAR")
    private String majPar;
    @Size(max = 255)
    @Column(name = "UTILISATEUR")
    private String utilisateur;
    @JoinColumn(name = "IDPERSONNE", referencedColumnName = "IDPERSONNE")
    @ManyToOne
    private Personne idpersonne;
    @JoinColumn(name = "IDGROUPE", referencedColumnName = "IDGROUPE")
    @ManyToOne
    private Groupe idgroupe;

    public PersonneGroupe() {
    }

    public PersonneGroupe(BigDecimal idpersonnegroupe) {
        this.idpersonnegroupe = idpersonnegroupe;
    }

    public BigDecimal getIdpersonnegroupe() {
        return idpersonnegroupe;
    }

    public void setIdpersonnegroupe(BigDecimal idpersonnegroupe) {
        this.idpersonnegroupe = idpersonnegroupe;
    }

    public String getCreePar() {
        return creePar;
    }

    public void setCreePar(String creePar) {
        this.creePar = creePar;
    }

    public Date getDateCreation() {
        return dateCreation;
    }

    public void setDateCreation(Date dateCreation) {
        this.dateCreation = dateCreation;
    }

    public Date getDateMaj() {
        return dateMaj;
    }

    public void setDateMaj(Date dateMaj) {
        this.dateMaj = dateMaj;
    }

    public String getMajPar() {
        return majPar;
    }

    public void setMajPar(String majPar) {
        this.majPar = majPar;
    }

    public String getUtilisateur() {
        return utilisateur;
    }

    public void setUtilisateur(String utilisateur) {
        this.utilisateur = utilisateur;
    }

    public Personne getIdpersonne() {
        return idpersonne;
    }

    public void setIdpersonne(Personne idpersonne) {
        this.idpersonne = idpersonne;
    }

    public Groupe getIdgroupe() {
        return idgroupe;
    }

    public void setIdgroupe(Groupe idgroupe) {
        this.idgroupe = idgroupe;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idpersonnegroupe != null ? idpersonnegroupe.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PersonneGroupe)) {
            return false;
        }
        PersonneGroupe other = (PersonneGroupe) object;
        if ((this.idpersonnegroupe == null && other.idpersonnegroupe != null) || (this.idpersonnegroupe != null && !this.idpersonnegroupe.equals(other.idpersonnegroupe))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.sagemcom.tn.entities.lot1.PersonneGroupe[ idpersonnegroupe=" + idpersonnegroupe + " ]";
    }

}

這是pom.xml文件:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>synchroProject</groupId>
  <artifactId>synchroProject</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>war</packaging>
  <build>
    <sourceDirectory>src</sourceDirectory>
    <resources>
      <resource>
        <directory>src</directory>
        <excludes>
          <exclude>**/*.java</exclude>
        </excludes>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <groupId>org.apache.maven.plugins</groupId>
        <version>3.7.0</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
      <plugin>  
                <groupId>org.apache.maven.plugins</groupId>  
                <artifactId>maven-compiler-plugin</artifactId>  
                <configuration>  
                    <source>1.8</source>  
                    <target>1.8</target>  
                </configuration>  
            </plugin>  

    </plugins>
  </build>
   <dependencies>
     <dependency>
    <groupId>javax.persistence</groupId>
    <artifactId>persistence-api</artifactId>
    <version>1.0.2</version>
</dependency>
  </dependencies>
</project>

在構建項目時我得到了這個:

[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for synchroProject:synchroProject:war:0.0.1-SNAPSHOT
[WARNING] 'build.plugins.plugin.(groupId:artifactId)' must be unique but found duplicate declaration of plugin org.apache.maven.plugins:maven-compiler-plugin @ line 27, column 15
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ synchroProject ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 3 source files to C:\Users\anonyme\eclipse-workspace\synchroProject\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /C:/Users/anonyme/eclipse-workspace/synchroProject/src/com/sagemcom/tn/entities/Personne.java:[15,36] package javax.validation.constraints does not exist
[ERROR] /C:/Users/anonyme/eclipse-workspace/synchroProject/src/com/sagemcom/tn/entities/Personne.java:[16,36] package javax.validation.constraints does not exist
[ERROR] /C:/Users/anonyme/eclipse-workspace/synchroProject/src/com/sagemcom/tn/entities/PersonneGroupe.java:[21,36] package javax.validation.constraints does not exist
[ERROR] /C:/Users/anonyme/eclipse-workspace/synchroProject/src/com/sagemcom/tn/entities/PersonneGroupe.java:[22,36] package javax.validation.constraints does not exist
[ERROR] /C:/Users/anonyme/eclipse-workspace/synchroProject/src/com/sagemcom/tn/entities/Groupe.java:[21,36] package javax.validation.constraints does not exist
[ERROR] /C:/Users/anonyme/eclipse-workspace/synchroProject/src/com/sagemcom/tn/entities/Groupe.java:[22,36] package javax.validation.constraints does not exist
[ERROR] /C:/Users/anonyme/eclipse-workspace/synchroProject/src/com/sagemcom/tn/entities/Personne.java:[29,6] cannot find symbol
  symbol:   class NotNull
  location: class com.sagemcom.tn.entities.Personne
[ERROR] /C:/Users/anonyme/eclipse-workspace/synchroProject/src/com/sagemcom/tn/entities/Personne.java:[32,6] cannot find symbol
  symbol:   class Size
  location: class com.sagemcom.tn.entities.Personne
[ERROR] /C:/Users/anonyme/eclipse-workspace/synchroProject/src/com/sagemcom/tn/entities/Personne.java:[35,6] cannot find symbol
  symbol:   class Size
  location: class com.sagemcom.tn.entities.Personne
[ERROR] /C:/Users/anonyme/eclipse-workspace/synchroProject/src/com/sagemcom/tn/entities/Personne.java:[50,6] cannot find symbol
  symbol:   class Size
  location: class com.sagemcom.tn.entities.Personne
[ERROR] /C:/Users/anonyme/eclipse-workspace/synchroProject/src/com/sagemcom/tn/entities/PersonneGroupe.java:[37,6] cannot find symbol
  symbol:   class NotNull
  location: class com.sagemcom.tn.entities.PersonneGroupe
[ERROR] /C:/Users/anonyme/eclipse-workspace/synchroProject/src/com/sagemcom/tn/entities/PersonneGroupe.java:[40,6] cannot find symbol
  symbol:   class Size
  location: class com.sagemcom.tn.entities.PersonneGroupe
[ERROR] /C:/Users/anonyme/eclipse-workspace/synchroProject/src/com/sagemcom/tn/entities/PersonneGroupe.java:[49,6] cannot find symbol
  symbol:   class Size
  location: class com.sagemcom.tn.entities.PersonneGroupe
[ERROR] /C:/Users/anonyme/eclipse-workspace/synchroProject/src/com/sagemcom/tn/entities/PersonneGroupe.java:[52,6] cannot find symbol
  symbol:   class Size
  location: class com.sagemcom.tn.entities.PersonneGroupe
[ERROR] /C:/Users/anonyme/eclipse-workspace/synchroProject/src/com/sagemcom/tn/entities/Groupe.java:[37,6] cannot find symbol
  symbol:   class NotNull
  location: class com.sagemcom.tn.entities.Groupe
[ERROR] /C:/Users/anonyme/eclipse-workspace/synchroProject/src/com/sagemcom/tn/entities/Groupe.java:[40,6] cannot find symbol
  symbol:   class Size
  location: class com.sagemcom.tn.entities.Groupe
[ERROR] /C:/Users/anonyme/eclipse-workspace/synchroProject/src/com/sagemcom/tn/entities/Groupe.java:[43,6] cannot find symbol
  symbol:   class Size
  location: class com.sagemcom.tn.entities.Groupe
[ERROR] /C:/Users/anonyme/eclipse-workspace/synchroProject/src/com/sagemcom/tn/entities/Groupe.java:[46,6] cannot find symbol
  symbol:   class Size
  location: class com.sagemcom.tn.entities.Groupe
[ERROR] /C:/Users/anonyme/eclipse-workspace/synchroProject/src/com/sagemcom/tn/entities/Groupe.java:[52,6] cannot find symbol
  symbol:   class Size
  location: class com.sagemcom.tn.entities.Groupe
[INFO] 22 errors 
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.259 s
[INFO] Finished at: 2017-11-26T23:23:30+01:00
[INFO] Final Memory: 14M/211M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project synchroProject: Compilation failure: Compilation failure:
[ERROR] /C:/Users/anonyme/eclipse-workspace/synchroProject/src/com/sagemcom/tn/entities/Personne.java:[15,36] package javax.validation.constraints does not exist
[ERROR] /C:/Users/anonyme/eclipse-workspace/synchroProject/src/com/sagemcom/tn/entities/Personne.java:[16,36] package javax.validation.constraints does not exist
[ERROR] /C:/Users/anonyme/eclipse-workspace/synchroProject/src/com/sagemcom/tn/entities/PersonneGroupe.java:[21,36] package javax.validation.constraints does not exist
[ERROR] /C:/Users/anonyme/eclipse-workspace/synchroProject/src/com/sagemcom/tn/entities/PersonneGroupe.java:[22,36] package javax.validation.constraints does not exist
[ERROR] /C:/Users/anonyme/eclipse-workspace/synchroProject/src/com/sagemcom/tn/entities/Groupe.java:[21,36] package javax.validation.constraints does not exist
[ERROR] /C:/Users/anonyme/eclipse-workspace/synchroProject/src/com/sagemcom/tn/entities/Groupe.java:[22,36] package javax.validation.constraints does not exist
[ERROR] /C:/Users/anonyme/eclipse-workspace/synchroProject/src/com/sagemcom/tn/entities/Personne.java:[29,6] cannot find symbol
[ERROR] symbol:   class NotNull
[ERROR] location: class com.sagemcom.tn.entities.Personne
[ERROR] /C:/Users/anonyme/eclipse-workspace/synchroProject/src/com/sagemcom/tn/entities/Personne.java:[32,6] cannot find symbol
[ERROR] symbol:   class Size
[ERROR] location: class com.sagemcom.tn.entities.Personne
[ERROR] /C:/Users/anonyme/eclipse-workspace/synchroProject/src/com/sagemcom/tn/entities/Personne.java:[35,6] cannot find symbol
[ERROR] symbol:   class Size
[ERROR] location: class com.sagemcom.tn.entities.Personne
[ERROR] /C:/Users/anonyme/eclipse-workspace/synchroProject/src/com/sagemcom/tn/entities/Personne.java:[38,6] cannot find symbol
[ERROR] symbol:   class Size
[ERROR] location: class com.sagemcom.tn.entities.Personne
[ERROR] /C:/Users/anonyme/eclipse-workspace/synchroProject/src/com/sagemcom/tn/entities/Personne.java:[41,6] cannot find symbol
[ERROR] symbol:   class Size
[ERROR] location: class com.sagemcom.tn.entities.Personne
[ERROR] /C:/Users/anonyme/eclipse-workspace/synchroProject/src/com/sagemcom/tn/entities/Personne.java:[44,6] cannot find symbol
[ERROR] symbol:   class Size
[ERROR] location: class com.sagemcom.tn.entities.Personne
[ERROR] /C:/Users/anonyme/eclipse-workspace/synchroProject/src/com/sagemcom/tn/entities/Personne.java:[50,6] cannot find symbol
[ERROR] symbol:   class Size
[ERROR] location: class com.sagemcom.tn.entities.Personne
[ERROR] /C:/Users/anonyme/eclipse-workspace/synchroProject/src/com/sagemcom/tn/entities/PersonneGroupe.java:[37,6] cannot find symbol
[ERROR] symbol:   class NotNull
[ERROR] location: class com.sagemcom.tn.entities.PersonneGroupe
[ERROR] /C:/Users/anonyme/eclipse-workspace/synchroProject/src/com/sagemcom/tn/entities/PersonneGroupe.java:[40,6] cannot find symbol
[ERROR] symbol:   class Size
[ERROR] location: class com.sagemcom.tn.entities.PersonneGroupe
[ERROR] /C:/Users/anonyme/eclipse-workspace/synchroProject/src/com/sagemcom/tn/entities/PersonneGroupe.java:[49,6] cannot find symbol
[ERROR] symbol:   class Size
[ERROR] location: class com.sagemcom.tn.entities.PersonneGroupe
[ERROR] /C:/Users/anonyme/eclipse-workspace/synchroProject/src/com/sagemcom/tn/entities/PersonneGroupe.java:[52,6] cannot find symbol
[ERROR] symbol:   class Size
[ERROR] location: class com.sagemcom.tn.entities.PersonneGroupe
[ERROR] /C:/Users/anonyme/eclipse-workspace/synchroProject/src/com/sagemcom/tn/entities/Groupe.java:[37,6] cannot find symbol
[ERROR] symbol:   class NotNull
[ERROR] location: class com.sagemcom.tn.entities.Groupe
[ERROR] /C:/Users/anonyme/eclipse-workspace/synchroProject/src/com/sagemcom/tn/entities/Groupe.java:[40,6] cannot find symbol
[ERROR] symbol:   class Size
[ERROR] location: class com.sagemcom.tn.entities.Groupe
[ERROR] /C:/Users/anonyme/eclipse-workspace/synchroProject/src/com/sagemcom/tn/entities/Groupe.java:[43,6] cannot find symbol
[ERROR] symbol:   class Size
[ERROR] location: class com.sagemcom.tn.entities.Groupe
[ERROR] /C:/Users/anonyme/eclipse-workspace/synchroProject/src/com/sagemcom/tn/entities/Groupe.java:[46,6] cannot find symbol
[ERROR] symbol:   class Size
[ERROR] location: class com.sagemcom.tn.entities.Groupe
[ERROR] /C:/Users/anonyme/eclipse-workspace/synchroProject/src/com/sagemcom/tn/entities/Groupe.java:[52,6] cannot find symbol
[ERROR] symbol:   class Size
[ERROR] location: class com.sagemcom.tn.entities.Groupe
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project synchroProject: Compilation failure
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.compiler.CompilationFailureException: Compilation failure
    at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:1161)
    at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:168)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
    ... 20 more
[ERROR] 
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

javax.persistence:persistence-api:1.0.22007年7月24日

我將使用javax.persistence:javax.persistence-api:2.2 ,而不是2017年8月21日

順便說一下,你為什么要在POM中兩次聲明maven-compiler-plugin 這導致了警告:

[WARNING] 'build.plugins.plugin.(groupId:artifactId)' must be unique but found duplicate declaration of plugin org.apache.maven.plugins:maven-compiler-plugin @ line 27, column 15

這也不好:

[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, ie build is platform dependent!

我在IDE中將編碼更改為UTF-8並使用POM屬性

  <properties>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
  </properties>

這樣你可以完全放棄這些maven-compiler-plugin聲明,因為編譯器使用所有這些屬性:compilesite:site默認情況下。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM