zoukankan      html  css  js  c++  java
  • 自定义jar包,将配置文件不打进jar包的结构设置

    <build>
          <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>org.apache.maven.plugins</groupId>
                                        <artifactId>maven-dependency-plugin</artifactId>
                                        <versionRange>[2.0,)</versionRange>
                                        <goals>
                                            <goal>copy-dependencies</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore />
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
          <plugins>
              <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-jar-plugin</artifactId>
                  <version>2.4</version>
                  <executions>
                      <execution>
                          <phase>package</phase>
                          <goals>
                              <goal>jar</goal>
                          </goals>
                      </execution>
                  </executions>
                  <configuration>
                      <archive>
                          <manifest>
                              <addClasspath>true</addClasspath>
                              <classpathPrefix>lib/</classpathPrefix>
                              <mainClass>gftchina.sds.Main</mainClass>
                          </manifest>
                          <manifestEntries>
                              <Class-Path>.</Class-Path>
                          </manifestEntries>
                      </archive>
                      <excludes>
                          <exclude>logback.xml</exclude>
                          <exclude>config/**</exclude>
                          <exclude>data/**</exclude>
                      </excludes>
                  </configuration>
              </plugin>
              <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-resources-plugin</artifactId>
                  <version>2.5</version>
                  <executions>
                      <execution>
                          <id>copy-resources</id>
                          <phase>package</phase>
                          <goals>
                              <goal>copy-resources</goal>
                          </goals>
                          <configuration>
                              <encoding>UTF-8</encoding>
                              <outputDirectory>${project.build.directory}/dist</outputDirectory>
                              <resources>
                                  <resource>
                                      <directory>src/main/resources/</directory>
                                      <includes>
                                          <include>logback.xml</include>
                                          <include>config/*</include>
                                          <include>data/*</include>
                                      </includes>
                                      <filtering>true</filtering>
                                  </resource>
                              </resources>
                          </configuration>
                      </execution>                  
                  </executions>
              </plugin>
              <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-dependency-plugin</artifactId>
                  <version>2.1</version>
                  <executions>
                      <execution>
                          <id>copy-dependencies</id>
                          <phase>package</phase>
                          <goals>
                              <goal>copy-dependencies</goal>
                          </goals>
                      </execution>
                  </executions>
                  <configuration>
                      <outputDirectory>${project.build.directory}/dist/lib</outputDirectory>
                      <overWriteReleases>false</overWriteReleases>
                      <overWriteSnapshots>false</overWriteSnapshots>
                      <overWriteIfNewer>true</overWriteIfNewer>
                      <excludeArtifactIds>junit</excludeArtifactIds>
                  </configuration>
              </plugin>
          </plugins>
      </build>
  • 相关阅读:
    折叠Collapse插件
    data按钮
    Web设计中打开新页面或页面跳转的方法 js跳转页面
    HTML文本框
    常用端口
    node.js(八) 有趣的东西才开始哦
    node.js(七) 子进程 child_process模块
    node.js(六) UTIL模块
    node.js(五)字符串转换
    SSL证书切换
  • 原文地址:https://www.cnblogs.com/alphaqiu/p/2614655.html
Copyright © 2011-2022 走看看