1
I am starting the process of automating the builds of our application, and in the project there are some classes with compilation error.
Despite some build errors, the application is working fine. I will have to do a task force, to remove the build errors but the project is very large and I would like to do this only in the future.
At the moment I would like Maven to create JAR even if there are compilation errors.
I made a change in mine pom.xml
so that the build doesn’t fail, even if there are build errors:
...
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<failOnError>false</failOnError>
</configuration>
</plugin>
</plugins>
</build>
...
however, when executing maven package
An empty JAR is created, with no class.
How to make Maven create JAR with classes that could be compiled even if there are other classes with build errors?
mvc clean package - P release -U?
– f.fujihara
Why do you want to delete classes with build error? Anyway it doesn’t have why you have one. jar with missing class, there are dependencies between classes and many other factors. If you get this, where will you use a file like this ? Please explain your context a little better to help better. Att
– Josh
You want to ride a jar missing classes and expect it to work, like this? Your question doesn’t seem to make sense, please explain better where you’re going with this.
– Math
I would just like the JAR to be created, even if it contains classes with a build error. Despite some build errors, the application is working fine. I will have to do a task force, to remove the build errors but the project is very large and I would like to do it further forward.
– mRc
Apesar de alguns erros de compilação, a aplicação está funcionando bem(...)
Be afraid, be very afraid of what the future holds for you and your task force when they have to maintain the code base.– Oralista de Sistemas
@Joshua Duardo changed the question
– mRc
@Renan The project is legacy, we are starting to automate the build, which before was done directly by the eclipse. We will remove the build errors, but the current priority is to automate the JAR the way it is. One step at a time.
– mRc
Dude, either the app has error or not ! is simple like this, put . jar / . War / . To run with any compilation error is crazy. Even if it is syntax error not checked in xml. First fix and merge the "bugs" of the legacy project, then think about automating the build. Or check =).
– Josh