Android项目编译错误,在编译时排除文件
我必须使用MAVEN构建Android项目。因为我使用的是MAVEN编译器插件3.1,并且希望在编译时排除一些文件和包(编译器不应该读取那些被排除的文件和包)Android项目编译错误,在编译时排除文件,android,maven,Android,Maven,我必须使用MAVEN构建Android项目。因为我使用的是MAVEN编译器插件3.1,并且希望在编译时排除一些文件和包(编译器不应该读取那些被排除的文件和包) <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.1<
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<excludes>
<exclude>**/myapp/activity/**</exclude>
<exclude>**/myapp/**</exclude>
<exclude>**/myapp/services/**</exclude>
</excludes>
</configuration>
</plugin>
在排除的文件中,我使用了ISO-8859-1符号,在这一行上编译器抛出错误,即“编码UTF-8的不可映射字符”。
请帮助我,这是我的代码:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<excludes>
<exclude>**/myapp/activity/*</exclude>
<exclude>**/myapp/*</exclude>
<exclude>**/myapp/services/*</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<excludes>
<exclude>**/myapp/activity/**</exclude>
<exclude>**/myapp/**</exclude>
<exclude>**/myapp/services/**</exclude>
</excludes>
</configuration>
</plugin>
org.apache.maven.plugins
maven编译器插件
3.1
1.6
1.6
**/myapp/活动/*
**/myapp/*
**/myapp/服务/*
谢谢您的回复。我在pom.xml中做了更改,我的问题得到了解决。我在排除文件方面做了更改。这是我的正确代码:-
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<excludes>
<exclude>**/myapp/activity/**</exclude>
<exclude>**/myapp/**</exclude>
<exclude>**/myapp/services/**</exclude>
</excludes>
</configuration>
</plugin>
org.apache.maven.plugins
maven编译器插件
3.1
1.6
1.6
**/myapp/活动/**
**/myapp/**
**/myapp/服务/**
谢谢您的回复。我在pom.xml中做了更改,我的问题得到了解决。我在排除文件方面做了更改。这是我的正确代码:-
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<excludes>
<exclude>**/myapp/activity/**</exclude>
<exclude>**/myapp/**</exclude>
<exclude>**/myapp/services/**</exclude>
</excludes>
</configuration>
</plugin>
org.apache.maven.plugins
maven编译器插件
3.1
1.6
1.6
**/myapp/活动/**
**/myapp/**
**/myapp/服务/**
更改相应文件的编码…或相应地配置整个项目…排除绝对不是一个好主意,因为这看起来需要将这些内容分开…更改相应文件的编码…或相应地配置整个项目…排除绝对不是一个好主意,因为看起来你需要把这些东西分开。。