Skip to content

Commit 643f9cd

Browse files
Merge pull request #11 from asaasdev/BASE-2453-Atualizar-java_nfe-para-a-versão-v4.00.18---13/05/2022---Schemas-PL.009i
BASE-2453 Atualizar java nfe para a versão v4.00.18 13/05/2022 schemas pl.009i
2 parents dfc6706 + 8d6ce21 commit 643f9cd

File tree

11 files changed

+415
-112
lines changed

11 files changed

+415
-112
lines changed

Dockerfile-build

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
ARG mavenImage
2+
ARG mavenImageVersion
3+
FROM ${mavenImage}:${mavenImageVersion} as builder
4+
ARG nameSpace
5+
ARG DskipTests
6+
ARG nexusUser
7+
ARG nexusPass
8+
9+
WORKDIR /app
10+
COPY . /app
11+
RUN mvn deploy -f pom-base.xml -s mavensettings.xml -Duser=$nexusUser -Dpassword=$nexusPass -Dversao=$nameSpace $DskipTests
12+

jenkinsfile

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
podTemplate(
2+
name: 'build-services',
3+
namespace: 'jenkins ',
4+
label: 'build-services',
5+
containers:
6+
[containerTemplate(
7+
args: 'cat',
8+
command: '/bin/sh -c',
9+
image: 'baseerp/docker:1.4',
10+
livenessProbe: containerLivenessProbe(execArgs: '',
11+
failureThreshold: 0,
12+
initialDelaySeconds: 0,
13+
periodSeconds: 0,
14+
successThreshold: 0,
15+
timeoutSeconds: 0),
16+
name: 'docker-container',
17+
resourceLimitCpu: '',
18+
resourceLimitMemory: '',
19+
resourceRequestCpu: '',
20+
resourceRequestMemory: '',
21+
ttyEnabled: true,
22+
workingDir: '/home/jenkins/agent')
23+
],
24+
volumes: [hostPathVolume(hostPath: '/var/run/docker.sock', mountPath: '/var/run/docker.sock')],
25+
nodeSelector: 'type=jenkins-worker',
26+
)
27+
{
28+
node('build-services') {
29+
30+
echo '*********************************************************Parametros************************************************************************'
31+
echo '*******************************************************************************************************************************************'
32+
echo "Ambiente: ${Ambiente}"
33+
echo "Branch: ${Branch}"
34+
echo '*******************************************************************************************************************************************'
35+
echo '*******************************************************************************************************************************************'
36+
37+
def gitRepos = ""
38+
def namespace = "${Ambiente}"
39+
def executarTestes = "${Testes}"
40+
def imagem_build = "baseerp/services-build"
41+
def versao = "1.0.${currentBuild.number}"
42+
def git_branch = ""
43+
def DskipTests = "-DskipTests"
44+
if (executarTestes.toLowerCase().equals("sim")) {
45+
DskipTests = ""
46+
}
47+
48+
stage('Checkout') {
49+
echo '*********************************************************Checkout************************************************************************'
50+
gitRepos = checkout scm
51+
git_branch = gitRepos.GIT_BRANCH
52+
versao = versao + '-' + namespace
53+
echo 'Repositório :' + gitRepos.toString()
54+
echo 'Branch :' + git_branch.toString()
55+
}
56+
57+
stage('Package') {
58+
container('docker-container') {
59+
echo '*********************************************************Package************************************************************************'
60+
withCredentials([usernamePassword(credentialsId: 'dockerhub', passwordVariable: 'DOCKER_HUB_PASSWORD', usernameVariable: 'DOCKER_HUB_USER')]) {
61+
withCredentials([usernamePassword(credentialsId: 'nexus', passwordVariable: 'NEXUS_PASSWORD', usernameVariable: 'NEXUS_USER')]) {
62+
def mavenImage = "baseerp/maven-services"
63+
def mavenImageVersion = "1.3"
64+
sh label: '', script: "docker login -u ${DOCKER_HUB_USER} -p ${DOCKER_HUB_PASSWORD}"
65+
sh label: '', script: "docker build -f Dockerfile-build -t ${imagem_build}:${versao} . --build-arg mavenImage=${mavenImage} --build-arg mavenImageVersion=${mavenImageVersion} --build-arg nameSpace=${namespace} --build-arg DskipTests=${DskipTests} --build-arg nexusUser=${NEXUS_USER} --build-arg nexusPass=${NEXUS_PASSWORD} --network=host"
66+
sh label: '', script: "docker rmi ${imagem_build}:${versao} --force"
67+
}
68+
}
69+
}
70+
}
71+
72+
}
73+
}

mavensettings.xml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,14 @@
3838
<server>
3939
<!-- usuário para download de artefatos -->
4040
<id>down.nexus.baseerp.com.br</id>
41+
<username>${user}</username>
42+
<password>${password}</password>
4143
</server>
4244
<server>
4345
<!-- usuário para upload de artefatos -->
4446
<id>up.nexus.baseerp.com.br</id>
47+
<username>${user}</username>
48+
<password>${password}</password>
4549
</server>
4650

4751
<!-- server | Specifies the authentication information to use when connecting to a particular server, identified by | a unique name within the system (referred to by the 'id'
@@ -63,12 +67,12 @@
6367
<mirror>
6468
<id>down.nexus.baseerp.com.br</id>
6569
<mirrorOf>*</mirrorOf>
66-
<url>https://nexuskube.baseerp.com.br/repository/maven-public/</url>
70+
<url>https://nexus.baseerp.com.br/repository/maven-public/</url>
6771
</mirror>
6872
<mirror>
6973
<id>up.nexus.baseerp.com.br</id>
7074
<mirrorOf>*</mirrorOf>
71-
<url>https://nexuskube.baseerp.com.br/</url>
75+
<url>https://nexus.baseerp.com.br/</url>
7276
</mirror>
7377
</mirrors>
7478

@@ -129,7 +133,7 @@
129133
<repositories>
130134
<repository>
131135
<id>down.nexus.baseerp.com.br</id>
132-
<url>https://nexuskube.baseerp.com.br</url>
136+
<url>https://nexus.baseerp.com.br</url>
133137
<releases>
134138
<enabled>true</enabled>
135139
</releases>
@@ -144,7 +148,7 @@
144148
<repositories>
145149
<repository>
146150
<id>up.nexus.baseerp.com.br</id>
147-
<url>https://nexuskube.baseerp.com.br</url>
151+
<url>https://nexus.baseerp.com.br</url>
148152
<releases>
149153
<enabled>true</enabled>
150154
</releases>

pom-base.xml

Lines changed: 214 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,214 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<groupId>br.com.swconsultoria</groupId>
5+
<artifactId>java-nfe</artifactId>
6+
<version>4.00.18-${versao}-SNAPSHOT</version>
7+
<name>Java_NFe</name>
8+
<description>Api java para consumo do webService de nota fiscal eletronica</description>
9+
<url>https://github.com/Samuel-Oliveira/Java_NFe</url>
10+
11+
<licenses>
12+
<license>
13+
<name>MIT License</name>
14+
<url>http://www.opensource.org/licenses/mit-license.php</url>
15+
<distribution>repo</distribution>
16+
</license>
17+
</licenses>
18+
19+
<scm>
20+
<url>[email protected]:Samuel-Oliveira/Java_NFe.git</url>
21+
<connection>scm:git:[email protected]:Samuel-Oliveira/Java_NFe.git</connection>
22+
<developerConnection>scm:git:[email protected]:Samuel-Oliveira/Java_NFe.git</developerConnection>
23+
<tag>java-nfe</tag>
24+
</scm>
25+
26+
<properties>
27+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
28+
<maven.javadoc.failOnError>false</maven.javadoc.failOnError>
29+
<maven.compiler.source>1.8</maven.compiler.source>
30+
<maven.compiler.target>1.8</maven.compiler.target>
31+
<java.version>1.8</java.version>
32+
</properties>
33+
34+
<!-- Environment Settings -->
35+
<distributionManagement>
36+
<repository>
37+
<id>up.nexus.baseerp.com.br</id>
38+
<name>up.nexus.baseerp.com.br</name>
39+
<url>https://nexus.baseerp.com.br/repository/baseerp.snapshot/</url>
40+
</repository>
41+
</distributionManagement>
42+
43+
<developers>
44+
<developer>
45+
<id>Samuel-Oliveira</id>
46+
<name>Samuel Borges de Oliveira</name>
47+
<url>https://github.com/Samuel-Oliveira</url>
48+
</developer>
49+
</developers>
50+
51+
<dependencies>
52+
<!-- Certificado Utils -->
53+
<dependency>
54+
<groupId>br.com.swconsultoria</groupId>
55+
<artifactId>java_certificado</artifactId>
56+
<version>2.8-${versao}-SNAPSHOT</version>
57+
</dependency>
58+
<!-- Ini4J -->
59+
<dependency>
60+
<groupId>org.ini4j</groupId>
61+
<artifactId>ini4j</artifactId>
62+
<version>0.5.4</version>
63+
</dependency>
64+
65+
<dependency>
66+
<groupId>org.apache.httpcomponents</groupId>
67+
<artifactId>httpcore</artifactId>
68+
<version>4.4.6</version>
69+
</dependency>
70+
71+
<!--Java 11-->
72+
<dependency>
73+
<groupId>com.sun.xml.bind</groupId>
74+
<artifactId>jaxb-impl</artifactId>
75+
<version>2.3.1</version>
76+
</dependency>
77+
<dependency>
78+
<groupId>com.sun.xml.bind</groupId>
79+
<artifactId>jaxb-xjc</artifactId>
80+
<version>2.3.1</version>
81+
</dependency>
82+
<dependency>
83+
<groupId>com.sun.xml.bind</groupId>
84+
<artifactId>jaxb-core</artifactId>
85+
<version>2.3.0.1</version>
86+
</dependency>
87+
88+
<dependency>
89+
<groupId>org.apache.axis2</groupId>
90+
<artifactId>axis2-kernel</artifactId>
91+
<version>1.7.5</version>
92+
<exclusions>
93+
<exclusion>
94+
<artifactId>servlet-api</artifactId>
95+
<groupId>javax.servlet</groupId>
96+
</exclusion>
97+
<exclusion>
98+
<artifactId>commons-fileupload</artifactId>
99+
<groupId>commons-fileupload</groupId>
100+
</exclusion>
101+
</exclusions>
102+
</dependency>
103+
104+
<dependency>
105+
<groupId>org.apache.axis2</groupId>
106+
<artifactId>axis2-adb</artifactId>
107+
<version>1.7.5</version>
108+
</dependency>
109+
110+
<dependency>
111+
<groupId>org.apache.axis2</groupId>
112+
<artifactId>axis2-jaxws</artifactId>
113+
<version>1.7.5</version>
114+
</dependency>
115+
116+
<dependency>
117+
<groupId>org.apache.axis2</groupId>
118+
<artifactId>axis2-transport-http</artifactId>
119+
<version>1.7.5</version>
120+
</dependency>
121+
122+
<dependency>
123+
<groupId>org.apache.axis2</groupId>
124+
<artifactId>axis2-transport-local</artifactId>
125+
<version>1.7.5</version>
126+
</dependency>
127+
128+
<dependency>
129+
<groupId>org.apache.ws.commons.axiom</groupId>
130+
<artifactId>axiom-api</artifactId>
131+
<version>1.2.20</version>
132+
</dependency>
133+
<dependency>
134+
<groupId>org.jmockit</groupId>
135+
<artifactId>jmockit</artifactId>
136+
<version>1.46</version>
137+
<scope>test</scope>
138+
</dependency>
139+
<dependency>
140+
<groupId>org.junit.jupiter</groupId>
141+
<artifactId>junit-jupiter</artifactId>
142+
<version>5.4.0</version>
143+
<scope>test</scope>
144+
</dependency>
145+
<dependency>
146+
<groupId>org.projectlombok</groupId>
147+
<artifactId>lombok</artifactId>
148+
<version>1.18.22</version>
149+
<scope>provided</scope>
150+
</dependency>
151+
152+
</dependencies>
153+
154+
<build>
155+
<plugins>
156+
<plugin>
157+
<groupId>org.apache.maven.plugins</groupId>
158+
<artifactId>maven-compiler-plugin</artifactId>
159+
<version>3.8.0</version>
160+
<configuration>
161+
<source>1.8</source>
162+
<target>1.8</target>
163+
</configuration>
164+
</plugin>
165+
<plugin>
166+
<groupId>org.sonatype.plugins</groupId>
167+
<artifactId>nexus-staging-maven-plugin</artifactId>
168+
<version>1.6.8</version>
169+
<extensions>true</extensions>
170+
<configuration>
171+
<serverId>sonatype-nexus</serverId>
172+
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
173+
<autoReleaseAfterClose>true</autoReleaseAfterClose>
174+
</configuration>
175+
</plugin>
176+
<plugin>
177+
<groupId>org.apache.maven.plugins</groupId>
178+
<artifactId>maven-release-plugin</artifactId>
179+
<version>2.5.3</version>
180+
<configuration>
181+
<pushChanges>false</pushChanges>
182+
<localCheckout>true</localCheckout>
183+
</configuration>
184+
</plugin>
185+
<plugin>
186+
<groupId>org.apache.maven.plugins</groupId>
187+
<artifactId>maven-assembly-plugin</artifactId>
188+
<version>2.4</version>
189+
<configuration>
190+
<descriptorRefs>
191+
<descriptorRef>jar-with-dependencies</descriptorRef>
192+
</descriptorRefs>
193+
</configuration>
194+
<executions>
195+
<execution>
196+
<phase>none</phase>
197+
<goals>
198+
<goal>single</goal>
199+
</goals>
200+
</execution>
201+
</executions>
202+
</plugin>
203+
<plugin>
204+
<artifactId>maven-surefire-plugin</artifactId>
205+
<version>2.22.2</version>
206+
<configuration>
207+
<argLine>
208+
-javaagent:src/test/resources/agent.jar
209+
</argLine>
210+
</configuration>
211+
</plugin>
212+
</plugins>
213+
</build>
214+
</project>

0 commit comments

Comments
 (0)