Skip to content

Commit 516560d

Browse files
committed
add tar-build configuration
1 parent 59e09a7 commit 516560d

File tree

2 files changed

+45
-61
lines changed

2 files changed

+45
-61
lines changed

pom.xml

Lines changed: 14 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -125,76 +125,29 @@
125125

126126
<profiles>
127127
<profile>
128-
<id>rpm-build</id>
129-
<properties>
130-
<USER_NAME>epai</USER_NAME>
131-
<GROUP_NAME>epai</GROUP_NAME>
132-
<APP_HOME>/home/epai/apps</APP_HOME>
133-
</properties>
128+
<id>tar-build</id>
134129
<build>
135130
<plugins>
136131
<plugin>
137-
<groupId>org.codehaus.mojo</groupId>
138-
<artifactId>rpm-maven-plugin</artifactId>
139-
<version>2.1.5</version>
140-
<extensions>true</extensions>
132+
<artifactId> maven-assembly-plugin </artifactId>
133+
<configuration>
134+
<descriptors>
135+
<!-- 描述文件路径 -->
136+
<descriptor>assembly.xml</descriptor>
137+
</descriptors>
138+
</configuration>
141139
<executions>
142140
<execution>
141+
<!--名字任意 -->
142+
<id>make-assembly</id>
143+
<!-- 绑定到package生命周期阶段上 -->
144+
<phase>package</phase>
143145
<goals>
144-
<goal>attached-rpm</goal>
146+
<!-- 只运行一次 -->
147+
<goal>single</goal>
145148
</goals>
146-
<phase>verify</phase>
147149
</execution>
148150
</executions>
149-
<configuration>
150-
<group>DH</group>
151-
<summary>DH</summary>
152-
<vendor>DH</vendor>
153-
<packager>DH</packager>
154-
<needarch>noarch</needarch>
155-
<name>ether-contract-processor</name>
156-
<prefixes>
157-
<prefix>${APP_HOME}</prefix>
158-
</prefixes>
159-
<mappings>
160-
<mapping>
161-
<directory>${APP_HOME}/${project.artifactId}</directory>
162-
<filemode>755</filemode>
163-
<username>${USER_NAME}</username>
164-
<groupname>${GROUP_NAME}</groupname>
165-
</mapping>
166-
<mapping>
167-
<directory>${APP_HOME}/${project.artifactId}/lib</directory>
168-
<filemode>755</filemode>
169-
<username>${USER_NAME}</username>
170-
<groupname>${GROUP_NAME}</groupname>
171-
<sources>
172-
<source>
173-
<location>${basedir}/target/${project.artifactId}-${project.version}.jar
174-
</location>
175-
</source>
176-
</sources>
177-
</mapping>
178-
<mapping>
179-
<directory>${APP_HOME}/${project.artifactId}/bin</directory>
180-
<filemode>755</filemode>
181-
<username>${USER_NAME}</username>
182-
<groupname>${GROUP_NAME}</groupname>
183-
<sources>
184-
<source>
185-
<location>src/main/resources/bin
186-
</location>
187-
</source>
188-
</sources>
189-
</mapping>
190-
<mapping>
191-
<directory>${APP_HOME}/${project.artifactId}/logs</directory>
192-
<filemode>755</filemode>
193-
<username>${USER_NAME}</username>
194-
<groupname>${GROUP_NAME}</groupname>
195-
</mapping>
196-
</mappings>
197-
</configuration>
198151
</plugin>
199152
</plugins>
200153
</build>

src/main/resources/assembly.xml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<assembly
2+
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
5+
<id>release</id>
6+
<formats>
7+
<format>tar.gz</format>
8+
</formats>
9+
<includeBaseDirectory>false</includeBaseDirectory>
10+
<dependencySets>
11+
<dependencySet>
12+
<unpack>false</unpack>
13+
<scope>runtime</scope>
14+
<outputDirectory>AlarmReport/lib</outputDirectory>
15+
<useProjectArtifact>false</useProjectArtifact>
16+
</dependencySet>
17+
</dependencySets>
18+
<fileSets>
19+
<fileSet>
20+
<directory>target/classes</directory>
21+
<outputDirectory>AlarmReport</outputDirectory>
22+
</fileSet>
23+
</fileSets>
24+
<files>
25+
<file>
26+
<source>startup.sh</source>
27+
<outputDirectory>AlarmReport/bin</outputDirectory>
28+
<filtered>true</filtered>
29+
</file>
30+
</files>
31+
</assembly>

0 commit comments

Comments
 (0)