Skip to content

Commit a9ba3e4

Browse files
committed
Deploy war and jar at the same time
1 parent ecc8fa8 commit a9ba3e4

File tree

2 files changed

+61
-1
lines changed

2 files changed

+61
-1
lines changed

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@ target
55
.project
66
.classpath
77
.settings
8-
bin
8+
bin
9+
src/main/webapp/WEB-INF/classes
10+
src/main/webapp/WEB-INF/lib

pom.xml

+58
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,22 @@
3636
<target>7</target>
3737
</configuration>
3838
</plugin>
39+
<plugin>
40+
<groupId>org.apache.maven.plugins</groupId>
41+
<artifactId>maven-war-plugin</artifactId>
42+
<executions>
43+
<execution>
44+
<phase>package</phase>
45+
<configuration>
46+
<attachClasses>true</attachClasses>
47+
<webXml>${basedir}/src/main/webapp/WEB-INF/web.xml</webXml>
48+
</configuration>
49+
<goals>
50+
<goal>inplace</goal>
51+
</goals>
52+
</execution>
53+
</executions>
54+
</plugin>
3955
<plugin>
4056
<groupId>org.apache.maven.plugins</groupId>
4157
<artifactId>maven-jar-plugin</artifactId>
@@ -59,6 +75,48 @@
5975
</archive>
6076
</configuration>
6177
</plugin>
78+
<plugin>
79+
<groupId>org.apache.maven.plugins</groupId>
80+
<artifactId>maven-install-plugin</artifactId>
81+
<executions>
82+
<execution>
83+
<id>Add-2-local-repository</id>
84+
<phase>package</phase>
85+
<configuration>
86+
<packaging>jar</packaging>
87+
<groupId>test</groupId>
88+
<artifactId>demo-junit</artifactId>
89+
<version>1.0.1-20170422</version>
90+
<file>${project.build.directory}/${artifactId}-${version}.jar</file>
91+
</configuration>
92+
<goals>
93+
<goal>install-file</goal>
94+
</goals>
95+
</execution>
96+
</executions>
97+
</plugin>
98+
<plugin>
99+
<groupId>org.codehaus.mojo</groupId>
100+
<artifactId>build-helper-maven-plugin</artifactId>
101+
<version>1.7</version>
102+
<executions>
103+
<execution>
104+
<id>attach-artifacts</id>
105+
<phase>package</phase>
106+
<goals>
107+
<goal>attach-artifact</goal>
108+
</goals>
109+
<configuration>
110+
<artifacts>
111+
<artifact>
112+
<file>${project.build.directory}/${artifactId}-${version}.jar</file>
113+
<type>jar</type>
114+
</artifact>
115+
</artifacts>
116+
</configuration>
117+
</execution>
118+
</executions>
119+
</plugin>
62120
</plugins>
63121
</build>
64122

0 commit comments

Comments
 (0)