maven-compiler-plugin

possible bug in Maven + plexus + eclipse compiler on case sensitive packages?

我是研究僧i 提交于 2020-01-16 03:26:09
问题 I encounter a very strange problem with Maven and Eclipse compiler. While in Eclipse+m2eclipse, I have no problem compiling a small project (archetype quick start) with the following single class. package test.test; import com.Ostermiller.util.CSVParser; public class TestCaseSensitive { CSVParser csvParser; } Ostermiller utils is added to pom.xml. Eclipse Kepler compiles the project. Next, mvn compile works out-of-the-box. Now the issue, I switch to compiler 3.1 and asks for Eclipse compiler

How to configure Lombok with maven-compiler-plugin?

倾然丶 夕夏残阳落幕 提交于 2020-01-12 07:22:51
问题 I have a root module and submodule in maven in the project. I am trying to use Lombok. I have added <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>1.16.12</version> <scope>provided</scope> </dependency> to root pom.xml. In submodule I have a class with Lombok annotations. When I am trying to build the project I get a lot of cannot find symbol where I am trying to call getters and setters. I have tried to use lombok-maven-plugin with same version (1

Maven compiler plugin configured with Java 7 but still compiles Java 8 code

久未见 提交于 2020-01-03 16:46:17
问题 In my project, we are going to use Java 7 for maven-compiler-plugin and we assume that after Maven compile, all the code which is using Java 8 should not compile successfully. However, in my case, there is a file using Arrays.stream(T[] array) which can be used from Java 8 and it still compiles successfully. Below is some of the pom.xml file which configure the Java version. Would you please have a look and give me any idea why my files can still compile successfully although I configure it

Maven compiler plugin configured with Java 7 but still compiles Java 8 code

最后都变了- 提交于 2020-01-03 16:46:03
问题 In my project, we are going to use Java 7 for maven-compiler-plugin and we assume that after Maven compile, all the code which is using Java 8 should not compile successfully. However, in my case, there is a file using Arrays.stream(T[] array) which can be used from Java 8 and it still compiles successfully. Below is some of the pom.xml file which configure the Java version. Would you please have a look and give me any idea why my files can still compile successfully although I configure it

Excluding package with maven-compiler-plugin works for one package but doesn't work for another

本小妞迷上赌 提交于 2020-01-03 11:34:10
问题 My project has the following package structure: src/ com.my.app.school.course -Course.java ... com.my.app.school.course.free -CourseFree.java I use Maven to build the project, in my pom.xml, I defined maven-compiler-plugin to test excluding a package with all its java classes. I first tried following way to exclude package com.my.app.school.course.free : <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.2<

How can I handle split packages in automatic modules?

允我心安 提交于 2020-01-01 09:01:32
问题 I am currently testing to migrate an existing application to Jigsaw Modules. One of my modules uses ElasticSearch along with its Groovy Plugin. org.elasticsearch:elasticsearch org.elasticsearch.module:lang-groovy Unfortunately, they share a split package, so mvn install gives me: x reads package org.elasticsearch.script.groovy from both lang.groovy and elasticsearch once for each required module in the descriptor, where x is the name of each module. I assume that a newer elasticsearch version

How do I pass javac multiple command-line arguments, some of which include colon, without breaking Maven release plugin?

人盡茶涼 提交于 2019-12-30 09:44:24
问题 I want to make my Maven build fail when I forget to declare serialVersionUIDs in a Serializable class. With javac , that's easy: $ javac -Xlint:serial -Werror Source.java Directly translating that to Maven doesn't work: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>2.5.1</version> <configuration> <compilerArgument>-Xlint:serial -Werror</compilerArgument> </configuration> </plugin> The compilerArgument is quoted, so javac receives

Java 11 Eclipse finds automatic module, Maven does not

大兔子大兔子 提交于 2019-12-25 02:59:07
问题 I'm attempting to upgrade a 15 year old Maven multimodule project to Java 11, and the module system that was introduced in Java 9. Since the project is built using Maven, all dependencies are pretty clear. First I want to do this using the automatic module names, in order not to also introduce upgraded artifacts (if not absolutely required). Eclipse is pretty helpful in this process, autocompleting the automatic module names in the module-info.java. For example: requires dom4j; But if I

maven-compiler-plugin 3.6.0 doesn't compile generated sources from annotations

混江龙づ霸主 提交于 2019-12-24 20:05:07
问题 We just upgraded our JBoss from 6.1.0 to Wildfly 10.1, and made a variety of associated upgrades to modules and artifact versions and so on. In one module this caused our cobertura compiles to fail with a compiler error. I found IllegalStateException in Hibernate metamodel generation with maven and upgraded to maven-compiler-plugin 3.6.0 (from 3.1). This seemed to resolve my problem, but only on a local basis. I can compile the module for cobertura, but it turns out to cause a new problem.

How to permanently exclude one test class in a Maven build

白昼怎懂夜的黑 提交于 2019-12-24 08:46:39
问题 I'm trying to exclude a single test from my maven build (I don't want the test to be compiled or executed). The following doesn't work: <project ...> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <excludes> <exclude>**/MyTest.java</exclude> </excludes> </configuration> </plugin> </plugins> </build> </project> What is the correct way to achieve my goal? I know that I can use the command-line option -Dmaven