1. 程式人生 > >maven手動新增resource配置檔案

maven手動新增resource配置檔案

      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <executions>
          <execution>
            <id>copy-resources</id>
            <phase>process-resources</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${basedir}/target/classes</outputDirectory>
              <resources>
                <resource>
                  <directory>src/main/resources</directory>
                  <includes>
                    <include>jdbc.properties</include>
                  </includes>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>

maven相關

maven生命週期

maven內建變數

參考http://blog.csdn.net/caihaijiang/article/details/6664910
  • ${basedir} 專案根目錄
  • ${project.build.directory} 構建目錄,預設為target
  • ${project.build.outputDirectory} 構建過程輸出目錄,預設為target/classes
  • ${project.build.finalName} 產出物名稱,預設為${project.artifactId}-${project.version}
  • ${project.packaging} 打包型別,預設為jar
  • ${project.xxx} 當前pom檔案的任意節點的內容

後記