Skip to content

Commit 202d447

Browse files
authored
Merge pull request #51 from asaasdev/release
Merge release para master_base
2 parents fcb5877 + 51c0a42 commit 202d447

6 files changed

Lines changed: 54 additions & 48 deletions

File tree

‎Dockerfile-build‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ ARG nexusPass
88

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

‎mavensettings.xml‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,6 @@
3535
<!-- 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
3636
to a remote server. | -->
3737
<servers>
38-
<server>
39-
<!-- usuário para download de artefatos -->
40-
<id>down.nexus.prod.baseerp.com.br</id>
41-
<username>${user}</username>
42-
<password>${password}</password>
43-
</server>
4438
<server>
4539
<!-- usuário para upload de artefatos -->
4640
<id>up.nexus.prod.baseerp.com.br</id>

‎pom-base.xml‎

Lines changed: 4 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<groupId>br.com.swconsultoria</groupId>
55
<artifactId>java-nfe</artifactId>
6-
<version>4.1.1-${versao}-SNAPSHOT</version>
6+
<version>4.1.1-EVENTOGENERICOA3-${versao}-SNAPSHOT</version>
77
<name>Java_NFe</name>
88
<description>Api java para consumo do webService de nota fiscal eletronica</description>
99
<url>https://github.com/Samuel-Oliveira/Java_NFe</url>
@@ -233,15 +233,9 @@
233233
</configuration>
234234
</plugin>
235235
<plugin>
236-
<groupId>org.sonatype.plugins</groupId>
237-
<artifactId>nexus-staging-maven-plugin</artifactId>
238-
<version>1.6.13</version>
239-
<extensions>true</extensions>
240-
<configuration>
241-
<serverId>sonatype-nexus</serverId>
242-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
243-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
244-
</configuration>
236+
<groupId>org.apache.maven.plugins</groupId>
237+
<artifactId>maven-deploy-plugin</artifactId>
238+
<version>3.1.2</version>
245239
</plugin>
246240
<plugin>
247241
<groupId>org.apache.maven.plugins</groupId>
@@ -252,35 +246,6 @@
252246
<localCheckout>true</localCheckout>
253247
</configuration>
254248
</plugin>
255-
<plugin>
256-
<groupId>org.apache.maven.plugins</groupId>
257-
<artifactId>maven-source-plugin</artifactId>
258-
<version>${maven-source-plugin.version}</version>
259-
<executions>
260-
<execution>
261-
<id>attach-sources</id>
262-
<goals>
263-
<goal>jar</goal>
264-
</goals>
265-
</execution>
266-
</executions>
267-
</plugin>
268-
<plugin>
269-
<groupId>org.apache.maven.plugins</groupId>
270-
<artifactId>maven-javadoc-plugin</artifactId>
271-
<version>${maven-javadoc-plugin.version}</version>
272-
<executions>
273-
<execution>
274-
<id>attach-javadocs</id>
275-
<goals>
276-
<goal>jar</goal>
277-
</goals>
278-
</execution>
279-
</executions>
280-
<configuration>
281-
<failOnError>false</failOnError>
282-
</configuration>
283-
</plugin>
284249
<plugin>
285250
<artifactId>maven-surefire-plugin</artifactId>
286251
<version>${maven-surefire-plugin.version}</version>

‎pom.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>br.com.swconsultoria</groupId>
66
<artifactId>java-nfe</artifactId>
7-
<version>4.1.1</version>
7+
<version>4.1.1-EVENTOGENERICOA3</version>
88
<name>Java_NFe</name>
99
<description>Api java para consumo do webService de nota fiscal eletronica</description>
1010
<url>https://github.com/Samuel-Oliveira/Java_NFe</url>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
package br.com.swconsultoria.nfe;
2+
3+
import javax.xml.bind.JAXBException;
4+
import br.com.swconsultoria.nfe.dom.ConfiguracoesNfe;
5+
import br.com.swconsultoria.nfe.dom.enuns.DocumentoEnum;
6+
import br.com.swconsultoria.nfe.dom.enuns.ServicosEnum;
7+
import br.com.swconsultoria.nfe.exception.NfeException;
8+
import br.com.swconsultoria.nfe.schemas_eventos.TEnvEventoGenerico;
9+
import br.com.swconsultoria.nfe.schemas_eventos.TProcEventoGenerico;
10+
import br.com.swconsultoria.nfe.schemas_eventos.TRetEnvEventoGenerico;
11+
import br.com.swconsultoria.nfe.schemas_eventos.TRetEventoGenerico;
12+
import br.com.swconsultoria.nfe.util.ConstantesUtil;
13+
import br.com.swconsultoria.nfe.util.XmlNfeUtil;
14+
15+
class EventoGenericoA3 {
16+
17+
private EventoGenericoA3() {}
18+
19+
static TRetEnvEventoGenerico eventoGenericoA3(ConfiguracoesNfe config, boolean valida, String xmlAssinado)
20+
throws NfeException {
21+
String xmlRetorno = EventosA3.enviarEvento(config, xmlAssinado, ServicosEnum.EVENTO_GENERICO, valida, DocumentoEnum.NFE);
22+
return XmlNfeUtil.xmlToObject(xmlRetorno, TRetEnvEventoGenerico.class);
23+
}
24+
25+
static String criaProcEventoGenericoA3(ConfiguracoesNfe config, String xmlAssinado, TRetEventoGenerico retorno)
26+
throws NfeException {
27+
try {
28+
TProcEventoGenerico procEvento = new TProcEventoGenerico();
29+
procEvento.setVersao(ConstantesUtil.VERSAO.EVENTO_GENERICO);
30+
procEvento.setEvento(XmlNfeUtil.xmlToObject(xmlAssinado, TEnvEventoGenerico.class).getEvento().get(0));
31+
procEvento.setRetEvento(retorno);
32+
return XmlNfeUtil.objectToXml(procEvento, config.getEncode());
33+
} catch (JAXBException e) {
34+
throw new NfeException(e.getMessage(), e);
35+
}
36+
}
37+
}

‎src/main/java/br/com/swconsultoria/nfe/NfeA3.java‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
import br.com.swconsultoria.nfe.exception.NfeException;
99
import br.com.swconsultoria.nfe.schemas_eventos.TEnvEventoCancelamento;
1010
import br.com.swconsultoria.nfe.schemas_eventos.TRetEnvEventoCancelamento;
11+
import br.com.swconsultoria.nfe.schemas_eventos.TRetEnvEventoGenerico;
12+
import br.com.swconsultoria.nfe.schemas_eventos.TRetEventoGenerico;
1113
import br.com.swconsultoria.nfe.schemas.RetDistDFeInt;
1214
import br.com.swconsultoria.nfe.schemas.TEnviNFe;
1315
import br.com.swconsultoria.nfe.schemas.TRetEnviNFe;
@@ -25,11 +27,11 @@ public static String montaXmlA3(ConfiguracoesNfe config, TEnviNFe enviNFe) throw
2527
public static TEnviNFe montaNfeA3(ConfiguracoesNfe config, String xmlAssinado, boolean valida) throws NfeException {
2628
return EnviarA3.montaNfeA3(ConfiguracoesUtil.iniciaConfiguracoes(config), xmlAssinado, valida);
2729
}
28-
30+
2931
public static TRetEnviNFe enviarNfeA3(ConfiguracoesNfe config, TEnviNFe enviNFe, DocumentoEnum tipoDocumento) throws NfeException {
3032
return Enviar.enviaNfe(ConfiguracoesUtil.iniciaConfiguracoes(config), enviNFe, tipoDocumento);
3133
}
32-
34+
3335
public static String montaXmleventoCancelamento(ConfiguracoesNfe config, TEnvEventoCancelamento enviEvento) throws NfeException {
3436
return CancelarA3.montaXmleventoCancelamento(ConfiguracoesUtil.iniciaConfiguracoes(config), enviEvento);
3537
}
@@ -81,4 +83,11 @@ public static String manifestacaoMontaXmlA3(ConfiguracoesNfe config,
8183
return ManifestacaoDestinatarioA3.montarXML(ConfiguracoesUtil.iniciaConfiguracoes(config), evento);
8284
}
8385

86+
public static TRetEnvEventoGenerico eventoGenericoA3(ConfiguracoesNfe config, boolean valida, String xmlAssinado) throws NfeException {
87+
return EventoGenericoA3.eventoGenericoA3(ConfiguracoesUtil.iniciaConfiguracoes(config), valida, xmlAssinado);
88+
}
89+
90+
public static String criaProcEventoGenericoA3(ConfiguracoesNfe config, String xmlAssinado, TRetEventoGenerico retorno) throws NfeException {
91+
return EventoGenericoA3.criaProcEventoGenericoA3(ConfiguracoesUtil.iniciaConfiguracoes(config), xmlAssinado, retorno);
92+
}
8493
}

0 commit comments

Comments
 (0)