10月17
百度了几百篇文章都没有真正的将独立打包的过程写清楚。我写在这里只是为了自己以后可以查看。
1.需要在相应的项目的目录src目录下增加一下目录和文件
a.src/main/asse
2.修改pom.xml
在project配置里增加
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4.1</version>
<configuration>
<descriptor>src/main/assembly/assembly.xml</descriptor>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
3.为了能够启动spring容器,还需要增加以下依赖
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>dubbo-container-spring</artifactId>
<version>${project.parent.version}</version>
</dependency>
注意
1:需要自行建立bin目录 ,用于存放启动的各类脚本
2:conf目录下建立配置文件,可以将dubbo.properties的文件存放在该目录下,
3:assembly下 assembly.xml文件配置一下内容
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<assembly>
<id>assembly</id>
<formats>
<format>tar.gz</format>
</formats>
<includeBaseDirectory>true</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>src/main/assembly/bin</directory>
<outputDirectory>bin</outputDirectory>
<fileMode>0755</fileMode>
</fileSet>
<fileSet>
<directory>src/main/assembly/conf</directory>
<outputDirectory>conf</outputDirectory>
<fileMode>0644</fileMode>
</fileSet>
</fileSets>
<dependencySets>
<dependencySet>
<outputDirectory>lib</outputDirectory>
</dependencySet>
</dependencySets>
</assembly>
4.运行mvn install
来源:Heck's Blog
地址:https://www.heckjj.com/post/479/
转载时须以链接形式注明作者和原始出处及本声明,否则将追究法律责任,谢谢配合!
1.需要在相应的项目的目录src目录下增加一下目录和文件
a.src/main/asse
2.修改pom.xml
在project配置里增加
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4.1</version>
<configuration>
<descriptor>src/main/assembly/assembly.xml</descriptor>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
3.为了能够启动spring容器,还需要增加以下依赖
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>dubbo-container-spring</artifactId>
<version>${project.parent.version}</version>
</dependency>
注意
1:需要自行建立bin目录 ,用于存放启动的各类脚本
2:conf目录下建立配置文件,可以将dubbo.properties的文件存放在该目录下,
3:assembly下 assembly.xml文件配置一下内容
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<assembly>
<id>assembly</id>
<formats>
<format>tar.gz</format>
</formats>
<includeBaseDirectory>true</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>src/main/assembly/bin</directory>
<outputDirectory>bin</outputDirectory>
<fileMode>0755</fileMode>
</fileSet>
<fileSet>
<directory>src/main/assembly/conf</directory>
<outputDirectory>conf</outputDirectory>
<fileMode>0644</fileMode>
</fileSet>
</fileSets>
<dependencySets>
<dependencySet>
<outputDirectory>lib</outputDirectory>
</dependencySet>
</dependencySets>
</assembly>
4.运行mvn install
来源:Heck's Blog
地址:https://www.heckjj.com/post/479/
转载时须以链接形式注明作者和原始出处及本声明,否则将追究法律责任,谢谢配合!
Redis主从服务器配置
SpringBoot项目



