maven-compiler-plugin

How to set -XX:PermSize=64m in maven-compiler-plugin?

我的未来我决定 提交于 2019-12-18 09:00:09
问题 I faild in setting the permsize or maxpermsize with the maven-compiler-plugin (v3.2). I tried it like this: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <meminitial>1024m</meminitial> <maxmem>2024m</maxmem> <compilerArgument>-XX:PermSize=128m</compilerArgument> </configuration> </plugin> Which results in an error Caused by: org.codehaus.plexus.compiler.CompilerException: invalid flag: -XX:MaxPermSize=256m -XX:PermSize=128m

Maven compiler recompile all files instead modified

两盒软妹~` 提交于 2019-12-17 17:41:41
问题 Even if I only change one of my classes, Maven always recompiles all of them. I use this plugin configuration: <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.1</version> <configuration> <staleMillis>1</slateMillis> <useIncrementalCompilation>true</useIncrementalCompilation> </configuration> </plugin> </plugins> This happens with mvn compile , mvn package and mvn install . Of course this is not a problem if you have 10

Error when using javac: “javac: invalid flag: -s”

妖精的绣舞 提交于 2019-12-12 10:43:45
问题 I am trying to specify another version of JDK in maven-compiler-plugin . When -target and -source parameters are set to 1.5, everything is ok. But when i try to use 1.6 JDK, maven reports an error. Has anyone faced this problem? Error: Failure executing javac, but could not parse the error: javac: invalid flag: -s Usage: javac where possible options include: -g Generate all debugging info -g:none Generate no debugging info Thanks. 回答1: If you use 1.6 flag your JAVA_HOME should point to JDK 1

Getting “Expecting a stackmap frame at branch target” when running Maven integration testing

倖福魔咒の 提交于 2019-12-12 10:37:45
问题 I’m using Maven 3.2.3 with this version of Java davea$ echo $JAVA_HOME /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home When I run mvn clean install I get errors like the below in my integration tests … testFindSampleUsersByCodeAscByDefault(org.mainco.subco.user.service.SampleUserService2IT) Time elapsed: 2.204 sec <<< ERROR! java.lang.VerifyError: Expecting a stackmap frame at branch target 57 Exception Details: Location: org/mainco/subco/user/service/SampleUserServiceImpl

How to make maven-compiler-plugin not hide error source locations

我的梦境 提交于 2019-12-12 10:35:55
问题 Maybe there is a maven-compiler-plugin option for this, but I haven't found it. When javac is run directly and prints an error, after the first line of the message, it shows the affected line of source with a caret on the next line pointing to the error position. It looks like this: com/invariantproperties/udt/sql/RationalUDT.java:324: error: cannot find symbol public static boolean lessThan(RRationalUDT p, double q) { ^ symbol: class RRationalUDT location: class RationalUDT Notice the lines

maven-compiler-plugin fails to compile a file that Eclipse has no problem with [duplicate]

天大地大妈咪最大 提交于 2019-12-11 07:57:54
问题 This question already has answers here : What is the difference between javac and the Eclipse compiler? (4 answers) Java8 Lambdas and Exceptions (4 answers) Closed 11 months ago . Eclipse compiles the following code without any problem, whereas when mvn tries to compile this code, a compilation failure results: try { // Distribution.rep().get(id) returns a java.util.Optional Distribution updated = Distribution.rep().transact(() -> { Distribution distro = Distribution.rep().get(id).orElseThrow

Eclipse maven compiler not supporting compiler-plugin compilerArgs

隐身守侯 提交于 2019-12-11 06:38:52
问题 We have a collection of Java module projects (using JDK11). There is a separate project for our integration tests. This project needs to be able to access the main application project to run its tests, but we don't want to add an export to the main application module because it's only needed when we're running our tests. The solution has been to add the export using compilerArgs in our integration test project: <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId

Generated code not taken into account in maven compile process

安稳与你 提交于 2019-12-10 20:14:08
问题 I have a maven project generating a new class from an annotation processor during a compile process. The class is successfully generated in /target/generated-sources/annotations/ , but it is not compiled into the .jar . Why? <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.2</version> <configuration> <source>${project.build.source}</source> <target>${project.build.target}</target> <encoding>${project.build.sourceEncoding}<

Maven 3: How to exclude generated sources from Xlint check?

孤街醉人 提交于 2019-12-10 16:46:12
问题 We only allow java source code without Xlint errors. However, when sources are generated by third party tools, this is not practical. Examples of generated sources in our use-case are: JFlex, JavaCC, JAXB and annotation processors. So the question is: how to exclude the generated sources from the Xlint checks? (see current configuration below) <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>3.5.1</version> <configuration combine.self="override"> <source>${java.version}<

compile tests using maven-compiler and jdk9-ea+148

醉酒当歌 提交于 2019-12-10 07:06:13
问题 I have problem with building my application using maven-compile-plugin:3.6.0 at jdk9-ea+148. I am trying to make jdk9 module. Module-info and other classes are getting compiled without problem, but when it comes to default-testCompile it just crashes. When my module-info.java is removed, the it is compiled without problems. Basically this is the exception I am getting: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.0:testCompile (default-testCompile) on project bar: