Get source JARs from Maven repository

Maven Micro-Tip: Get sources and Javadocs When you’re using Maven in an IDE you often find the need for your IDE to resolve source code and Javadocs for your library dependencies. There’s an easy way to accomplish that goal. mvn dependency:sources mvn dependency:resolve -Dclassifier=javadoc The first command will attempt to download source code for each … Read more

How to configure encoding in Maven?

OK, I have found the problem. I use some reporting plugins. In the documentation of the failsafe-maven-plugin I found, that the <encoding> configuration – of course – uses ${project.reporting.outputEncoding} by default. So I added the property as a child element of the project element and everything is fine now: <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> </properties> See also … Read more

Maven does not find JUnit tests to run

By default Maven uses the following naming conventions when looking for tests to run: Test* *Test *Tests (has been added in Maven Surefire Plugin 2.20) *TestCase If your test class doesn’t follow these conventions you should rename it or configure Maven Surefire Plugin to use another pattern for test classes.

No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

On your Eclipse IDE, go into Window > Preferences > Java > Installed JREs > and check your installed JREs. You should have an entry with a JDK there. Select the Execution Env as show below. Click OK Then Right-Click on your Project -> Maven -> Update Project Additionally, you may have to change Maven … Read more

IntelliJ inspection gives “Cannot resolve symbol” but still compiles code

First of all you should try File | Invalidate Caches and if it doesn’t help, delete IDEA system directory. Then re-import the Maven project and see if it helps. In some weird cases compiled classes may report wrong info and confuse IDEA. Verify that the classes from this jar report correct names using javap.

When maven says “resolution will not be reattempted until the update interval of MyRepo has elapsed”, where is that interval specified?

I used to solve this issue by deleting the corresponding failed to download artifact directory in my local repo. Next time I run the maven command the artifact download is triggered again. Therefore I’d say it’s a client side setting. Nexus side (server repo side), this issue is solved configuring a scheduled task. Client side, … Read more

Dealing with “Xerces hell” in Java/Maven?

There are 2.11.0 JARs (and source JARs!) of Xerces in Maven Central since 20th February 2013! See Xerces in Maven Central. I wonder why they haven’t resolved https://issues.apache.org/jira/browse/XERCESJ-1454… I’ve used: <dependency> <groupId>xerces</groupId> <artifactId>xercesImpl</artifactId> <version>2.11.0</version> </dependency> and all dependencies have resolved fine – even proper xml-apis-1.4.01! And what’s most important (and what wasn’t obvious in the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)