Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Dockerfile-build
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ ARG nexusPass

WORKDIR /app
COPY . /app
RUN find /root/.m2/repository -name "*.lastUpdated" -delete 2>/dev/null || true
RUN mvn deploy -f pom-base.xml -s mavensettings.xml -Duser=$nexusUser -Dpassword=$nexusPass -Dversao=$nameSpace $DskipTests

6 changes: 0 additions & 6 deletions mavensettings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,6 @@
<!-- servers | This is a list of authentication profiles, keyed by the server-id used within the system. | Authentication profiles can be used whenever maven must make a connection
to a remote server. | -->
<servers>
<server>
<!-- usuário para download de artefatos -->
<id>down.nexus.prod.baseerp.com.br</id>
<username>${user}</username>
<password>${password}</password>
</server>
<server>
<!-- usuário para upload de artefatos -->
<id>up.nexus.prod.baseerp.com.br</id>
Expand Down
43 changes: 4 additions & 39 deletions pom-base.xml
Comment thread
danielrbrdan marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<groupId>br.com.swconsultoria</groupId>
<artifactId>java-nfe</artifactId>
<version>4.1.1-${versao}-SNAPSHOT</version>
<version>4.1.1-EVENTOGENERICOA3-${versao}-SNAPSHOT</version>
<name>Java_NFe</name>
<description>Api java para consumo do webService de nota fiscal eletronica</description>
<url>https://github.com/Samuel-Oliveira/Java_NFe</url>
Expand Down Expand Up @@ -233,15 +233,9 @@
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.13</version>
<extensions>true</extensions>
<configuration>
<serverId>sonatype-nexus</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.1.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand All @@ -252,35 +246,6 @@
<localCheckout>true</localCheckout>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>${maven-source-plugin.version}</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.version}</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<failOnError>false</failOnError>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>br.com.swconsultoria</groupId>
<artifactId>java-nfe</artifactId>
<version>4.1.1</version>
<version>4.1.1-EVENTOGENERICOA3</version>
<name>Java_NFe</name>
<description>Api java para consumo do webService de nota fiscal eletronica</description>
<url>https://github.com/Samuel-Oliveira/Java_NFe</url>
Expand Down
37 changes: 37 additions & 0 deletions src/main/java/br/com/swconsultoria/nfe/EventoGenericoA3.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package br.com.swconsultoria.nfe;

import javax.xml.bind.JAXBException;
import br.com.swconsultoria.nfe.dom.ConfiguracoesNfe;
import br.com.swconsultoria.nfe.dom.enuns.DocumentoEnum;
import br.com.swconsultoria.nfe.dom.enuns.ServicosEnum;
import br.com.swconsultoria.nfe.exception.NfeException;
import br.com.swconsultoria.nfe.schemas_eventos.TEnvEventoGenerico;
import br.com.swconsultoria.nfe.schemas_eventos.TProcEventoGenerico;
import br.com.swconsultoria.nfe.schemas_eventos.TRetEnvEventoGenerico;
import br.com.swconsultoria.nfe.schemas_eventos.TRetEventoGenerico;
import br.com.swconsultoria.nfe.util.ConstantesUtil;
import br.com.swconsultoria.nfe.util.XmlNfeUtil;

class EventoGenericoA3 {

private EventoGenericoA3() {}

static TRetEnvEventoGenerico eventoGenericoA3(ConfiguracoesNfe config, boolean valida, String xmlAssinado)
throws NfeException {
String xmlRetorno = EventosA3.enviarEvento(config, xmlAssinado, ServicosEnum.EVENTO_GENERICO, valida, DocumentoEnum.NFE);
return XmlNfeUtil.xmlToObject(xmlRetorno, TRetEnvEventoGenerico.class);
}

static String criaProcEventoGenericoA3(ConfiguracoesNfe config, String xmlAssinado, TRetEventoGenerico retorno)
throws NfeException {
try {
TProcEventoGenerico procEvento = new TProcEventoGenerico();
procEvento.setVersao(ConstantesUtil.VERSAO.EVENTO_GENERICO);
procEvento.setEvento(XmlNfeUtil.xmlToObject(xmlAssinado, TEnvEventoGenerico.class).getEvento().get(0));
procEvento.setRetEvento(retorno);
return XmlNfeUtil.objectToXml(procEvento, config.getEncode());
} catch (JAXBException e) {
throw new NfeException(e.getMessage(), e);
}
}
}
13 changes: 11 additions & 2 deletions src/main/java/br/com/swconsultoria/nfe/NfeA3.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import br.com.swconsultoria.nfe.exception.NfeException;
import br.com.swconsultoria.nfe.schemas_eventos.TEnvEventoCancelamento;
import br.com.swconsultoria.nfe.schemas_eventos.TRetEnvEventoCancelamento;
import br.com.swconsultoria.nfe.schemas_eventos.TRetEnvEventoGenerico;
import br.com.swconsultoria.nfe.schemas_eventos.TRetEventoGenerico;
import br.com.swconsultoria.nfe.schemas.RetDistDFeInt;
import br.com.swconsultoria.nfe.schemas.TEnviNFe;
import br.com.swconsultoria.nfe.schemas.TRetEnviNFe;
Expand All @@ -25,11 +27,11 @@ public static String montaXmlA3(ConfiguracoesNfe config, TEnviNFe enviNFe) throw
public static TEnviNFe montaNfeA3(ConfiguracoesNfe config, String xmlAssinado, boolean valida) throws NfeException {
return EnviarA3.montaNfeA3(ConfiguracoesUtil.iniciaConfiguracoes(config), xmlAssinado, valida);
}

public static TRetEnviNFe enviarNfeA3(ConfiguracoesNfe config, TEnviNFe enviNFe, DocumentoEnum tipoDocumento) throws NfeException {
return Enviar.enviaNfe(ConfiguracoesUtil.iniciaConfiguracoes(config), enviNFe, tipoDocumento);
}

public static String montaXmleventoCancelamento(ConfiguracoesNfe config, TEnvEventoCancelamento enviEvento) throws NfeException {
return CancelarA3.montaXmleventoCancelamento(ConfiguracoesUtil.iniciaConfiguracoes(config), enviEvento);
}
Expand Down Expand Up @@ -81,4 +83,11 @@ public static String manifestacaoMontaXmlA3(ConfiguracoesNfe config,
return ManifestacaoDestinatarioA3.montarXML(ConfiguracoesUtil.iniciaConfiguracoes(config), evento);
}

public static TRetEnvEventoGenerico eventoGenericoA3(ConfiguracoesNfe config, boolean valida, String xmlAssinado) throws NfeException {
return EventoGenericoA3.eventoGenericoA3(ConfiguracoesUtil.iniciaConfiguracoes(config), valida, xmlAssinado);
}

public static String criaProcEventoGenericoA3(ConfiguracoesNfe config, String xmlAssinado, TRetEventoGenerico retorno) throws NfeException {
return EventoGenericoA3.criaProcEventoGenericoA3(ConfiguracoesUtil.iniciaConfiguracoes(config), xmlAssinado, retorno);
}
}
Loading