Postingan

Menampilkan postingan dengan label Maven

How to fix invalid target release: 1.7, 1.8, 1.9, or 1.10 Error in Maven Build

Gambar
If you are building your Java project using Maven, maybe in Eclipse or from the command prompt by running mvn install and your build is failing with an error like "invalid target release: 1.7" or "invalid target release: 1.8" then you have come to the right place. In this article, I'll show you the reason why this error occurs and how you can deal with these errors even with higher Java version like Java 9, 10 installed on your machine, or maybe with Java 11 in the coming month. The root cause of the problem is that you have specified a higher Java version in your pom.xml file for Maven compiler plugin then what Maven knows in your system, and that's why it's saying invalid target release. A simple solution to this problem is either reduce your target version in pom.xml or install a new Java version if you want to build your project in higher version But, the key to solving this problem is knowing that Maven picks the Java version from the JAVA_HOME...

Maven - 10 Things Java developer should know

Gambar
likeThe Apache Maven is an essential tool for Java developers. It makes their life easy by allowing them to create a Java project faster by using a standard directory structure. It also helps them to download project dependency automatically. Not only that, but Maven also downloads transitive dependencies that relieve Java developers from the big headache of keep check of different versions of dependent libraries. For example, if your application is dependent on the Spring framework, but Spring is dependent on Log4j then you also need to download the correct version of Log4j JAR files for theSpring MVC framework, Maven does this automatically for you. Maven also allows you to build projects, upload artifacts to the central or local Nexus repository, and deploy the release in your various test environments automatically. In short,   good knowledge of Maven is a must for any professional Java developers. In this article, I'll share some practical tips and facts about the Maven tool w...

Maven JAR Artifiact Dependency Search Not Working in Eclipse - Solved

Gambar
Recently I face an strange issue while using Maven in Eclipse via M2Eclipse plugin. I have created a Maven Java project in Eclipse and subsequently tried to add Spring framework as dependency, to my surprise, nothing was happening. Eclipse was not able to search dependency in Maven central repository . I was surprised because I have never faced this issue while I was using M2Eclipse plugin from long time. After some trial and error, I realized that this is my brand new workspace and I am running with Eclipse Luna, newest version of Eclipse which I had just downloaded couple days of back. My first hunch was that Eclipse might not able to connect to Internet, and to verify that I tried connecting Eclipse market place, and boom it was working fine. Then I quickly checked Maven settings in Eclipse and found that the option which is required to download and build the index was not turned on. The check box was unchecked there. To give you some background about how Eclipse search dependency o...

Top 5 courses to Learn Maven for Java Developers - Best of Lot

Gambar
The Apache Maven or commonly known as just "Maven," is an essential tool for Java Programmers. It allows you to build your project, manage dependencies, generate documentation and lot more. I can vouch for Maven's usefulness because I have come from the pre-Maven world of Software development, where you need to manage all the JAR files required by your project. It may seem easy to you that just download the JAR file but it's not so easy in practice.  For example, you added a new library in your project say Spring framework which also needs log4j but you thought log4j is already there so you didn't do anything, only to realize that your application is not starting anymore and throwing long and convoluted errors. This can happen because of version mismatch like Spring needed a higher version of log4j than available in your project. This is just a tiny bit of example, which shows how manually managing dependencies can create nightmares. Maven took away all those pain...