Linked Questions
11 questions linked to/from Maven: excluding java files in compilation
21 votes
1 answer
34k views
maven-compiler-plugin exclude
I have a following problem. I would like to exclude some .java files (**/jsfunit/*.java) during the test-compile phase and on the other side I would like to include them during the compile phase (id i ...
12 votes
7 answers
31k views
Ignoring Compilation errors - Java
I have around 1500 files to compile, in which 15-20 files have compilation errors. These files are not under my control, so I could not do any modification/update/delete. So, i have two questions here....
7 votes
1 answer
13k views
Spring Boot Maven Plugin: Exclude properties file from final jar
We have a Spring Boot application, and in it we have both an application.properties and a application-dev.properties. The application properties file just has some across the board default values, and ...
7 votes
2 answers
9k views
Is it possible to exclude (or include) classes or resources on a per profile basis in Maven?
I have two maven profiles P1 and P2 and what I want to do is that depending on the profile I use to build my project, certain resources should be excluded. For example <profiles> <...
5 votes
3 answers
6k views
How to resolve this conflicting of two beans with same name in maven project?
Suppose i have a Maven Project A and Project B, and project B i am adding it as as a jar in Project A when i try to run Project A it gives me the error "bean name "xyz" conflicts with existing, non-...
1 vote
1 answer
896 views
How to prevent scala-maven-plugin from compiling Java sources?
There is a mixed (Java + Scala) Maven project. Only a small part is written in Scala and it does not depend on Java code. Java code depends on compilation results of the Scala part. I'm looking for a ...
0 votes
1 answer
1k views
How to exclude some *.java files from the Maven build?
I expect to find help here regarding the problem of excluding some files from the Maven build. The essence of the problem I have a package in my Java application that needs to be almost completely ...
0 votes
0 answers
537 views
how can I tell intellj not to compile certain files?
I got a bunch of java files that I don't want to be compiled as part of the module. Is there a way to tell intellij to ignore them?
0 votes
0 answers
295 views
How to ignore some java file when maven install
I am new to maven.Now in my maven project,there are some java files like helloworldMock.java(they all end with 'Mock.java') I don't when to use them when I run mvn installsome time. How I can do?
0 votes
1 answer
201 views
cannot find symbol on file already excluded
I don't understand why I am getting 'Cannot find symbol' error on files that have been excluded from the build path. All references to any of the classes or methods of excluded classes have been ...
0 votes
0 answers
32 views
Exclude unnecessary classes from executable JARs compiled from monorepo with Maven
I have a monorepo that has multiple executable classes and their shared dependencies. I can create JARs with dependencies so that they can easily be deployed and executed. However, all of the ...