过滤资产文件-android

过滤资产文件-android,android,maven,Android,Maven,我正在尝试筛选项目的资产目录中的属性文件。这样我就不必在我的应用程序的dev、SIT和prod版本之间不断更改值。我使用maven&intellijidea(最终)使用不同的概要文件,但目前我只是尝试让构建过程选择过滤的资产目录(如果可能的话) 我已将这些资源行添加到我的POM中: <resource> <filtering>true</filtering> <directory>assets</directory>

我正在尝试筛选项目的资产目录中的属性文件。这样我就不必在我的应用程序的dev、SIT和prod版本之间不断更改值。我使用maven&intellijidea(最终)使用不同的概要文件,但目前我只是尝试让构建过程选择过滤的资产目录(如果可能的话)

我已将这些资源行添加到我的POM中:

<resource>
    <filtering>true</filtering>
    <directory>assets</directory>
    <includes>
        <include>**/*.properties</include>
    </includes>
    <targetPath>
        ../assets
    </targetPath>
</resource>

<resource>
    <filtering>false</filtering>
    <directory>assets</directory>
    <excludes>
       <exclude>**/*.properties</exclude>
    </excludes>
    <targetPath>
       ../assets
    </targetPath>
</resource>

真的
资产
**/*.物业
../资产
假的
资产
**/*.物业
../资产
有什么方法可以让构建过程查看筛选的资产目录吗?

试试以下方法:

<build>
  <resources>
    <resource>
      <directory>${project.basedir}/assets</directory>
      <filtering>true</filtering>
      <targetPath>${project.build.directory}/filtered-assets</targetPath>
      <includes>
        <include>**/*.properties</include>
      </includes>
    </resource>
  </resources>
  <plugins>
    <plugin>
      <artifactId>maven-resources-plugin</artifactId>
      <executions>
        <execution>
          <phase>initialize</phase>
          <goals>
            <goal>resources</goal>
          </goals>
        </execution>
      </executions>
    </plugin>
    <plugin>
      <groupId>com.jayway.maven.plugins.android.generation2</groupId>
      <artifactId>maven-android-plugin</artifactId>
      <extensions>true</extensions>
      <configuration>
        <sdk>
          <platform>7</platform>
        </sdk>
        <undeployBeforeDeploy>true</undeployBeforeDeploy>
        <resourceDirectory>${project.build.directory}/filtered-assets</resourceDirectory>
      </configuration>
    </plugin>
  </plugins>
</build>

${project.basedir}/assets
真的
${project.build.directory}/已筛选资产
**/*.物业