maven-compiler-plugin

IllegalAccessError when using a public method reference of a package-private class through a public subclass from another package

╄→尐↘猪︶ㄣ 提交于 2019-11-29 01:14:40
Yesterday I faced an interesting issue after deploying my Java 8 webapp on Tomcat 8. Rather than how to solve this issue I'm more interested in understanding why that happens. But let's start from the beginning. I have two classes defined as follows: Foo.java package package1; abstract class Foo { public String getFoo() { return "foo"; } } Bar.java package package1; public class Bar extends Foo { public String getBar() { return "bar"; } } As you can see, they are in the same package and, ultimately, end up in the same jar, let's call it commons.jar . This jar is a dependency of my webapp (i.e.

What does “Required filename-based automodules detected.” warning mean?

风格不统一 提交于 2019-11-28 21:34:52
In my multi-module project, I created module-info.java only for few modules. And during compilation with maven-compiler-plugin:3.7.0 I'm getting next warning: [WARNING] * Required filename-based automodules detected. Please don't publish this project to a public artifact repository! * What does it mean? Is that because I have only a few modules with module-info.java and not the whole project? Automatic module recap An explicit module (i.e. one with a module-info.java ) can only access code of modules that it requires (ignoring implied readability for a moment). That's great if all dependencies

Maven compiler recompile all files instead modified

霸气de小男生 提交于 2019-11-28 17:37:26
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-15 files. However, I have more than one thousand source files and it takes a lot of time. Does the Maven

Maven build Compilation error : Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project Maven

穿精又带淫゛_ 提交于 2019-11-27 19:24:51
I have a maven project forked and cloned from a git repo onto my eclipse. It is build on Java 8. The first thing i do is perform a mvn clean install But I get following failure message: [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building Maven 0.0.1-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ Maven --- [INFO] Deleting /Users/vshukla/git/Prism/target [INFO] [INFO] --- maven-resources-plugin:2.6:resources

IllegalAccessError when using a public method reference of a package-private class through a public subclass from another package

坚强是说给别人听的谎言 提交于 2019-11-27 15:44:38
问题 Yesterday I faced an interesting issue after deploying my Java 8 webapp on Tomcat 8. Rather than how to solve this issue I'm more interested in understanding why that happens. But let's start from the beginning. I have two classes defined as follows: Foo.java package package1; abstract class Foo { public String getFoo() { return "foo"; } } Bar.java package package1; public class Bar extends Foo { public String getBar() { return "bar"; } } As you can see, they are in the same package and,

What does “Required filename-based automodules detected.” warning mean?

ぃ、小莉子 提交于 2019-11-27 14:07:22
问题 In my multi-module project, I created module-info.java only for few modules. And during compilation with maven-compiler-plugin:3.7.0 I'm getting next warning: [WARNING] * Required filename-based automodules detected. Please don't publish this project to a public artifact repository! * What does it mean? Is that because I have only a few modules with module-info.java and not the whole project? 回答1: Automatic module recap An explicit module (i.e. one with a module-info.java ) can only access

Maven Out of Memory Build Failure

拥有回忆 提交于 2019-11-27 10:43:03
As of today, my maven compile fails. [INFO] [ERROR] Unexpected [INFO] java.lang.OutOfMemoryError: Java heap space [INFO] at java.util.Arrays.copyOfRange(Arrays.java:2694) [INFO] at java.lang.String.<init>(String.java:203) [INFO] at java.lang.String.substring(String.java:1877) [ERROR] Out of memory; to increase the amount of memory, use the -Xmx flag at startup (java -Xmx128M ...) As of yesterday I had successfully run a maven compile. As of today, I just bumped up my heap to 3 GB . Also, I only changed 2-3 minor lines of code, so I don't understand this 'out of memory' error. vagrant@dev:

What is the default annotation processors discovery process?

我的未来我决定 提交于 2019-11-27 07:53:10
The documentation of Maven Compiler plugin mentions the following : annotationProcessors: Names of annotation processors to run. Only applies to JDK 1.6+ If not set, the default annotation processors discovery process applies. What is the default annotation processors discovery process here? Is there any other way to set up annotation processors than this configuration tag? I've found that the Getting Started with the Annotation Processing Tool (apt) documentation mentions a default discovery procedure , but it works with factory classes not processors and unfortunately it uses the tools.jar

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile)

廉价感情. 提交于 2019-11-26 23:46:30
I am using Maven 3.0.5 and Spring Tool Source 3.2 with Maven plugin installed. When I try to do 'Run As---> Maven install', I am getting the following error : [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building Spring Social Twitter4J Sample 1.0.0 [INFO] ------------------------------------------------------------------------ [WARNING] The POM for org.apache.maven.plugins:maven-compiler-plugin:jar:2.3.2 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details

--add-modules only on compilation [duplicate]

倖福魔咒の 提交于 2019-11-26 22:32:54
This question already has an answer here: How to express dependency in maven on java ee features for transition to Java 9? 4 answers I'm building my project with maven and java-9 . I've added in my pom.xml file: <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>${maven-compiler-plugin.version}</version> <configuration> <source>${java.version}</source> <target>${java.version}</target> <compilerArgs> <arg>--add-modules</arg> <arg>java.xml.bind</arg> </compilerArgs> </configuration> </plugin> But still, to run the application I have to run it like this: java -jar --add-modules java