Is there a simple way to remove unused dependencies from a maven pom.xml?

The Maven Dependency Plugin will help, especially the dependency:analyze goal: dependency:analyze analyzes the dependencies of this project and determines which are: used and declared; used and undeclared; unused and declared. Another thing that might help to do some cleanup is the Dependency Convergence report from the Maven Project Info Reports Plugin.

“webxml attribute is required” error in Maven

It would be helpful if you can provide a code snippet of your maven-war-plugin. Looks like the web.xml is at right place, still you can try and give the location explicitly <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <configuration> <webXml>src\main\webapp\WEB-INF\web.xml</webXml> </configuration> </plugin>

Maven command to determine which settings.xml file Maven is using

Start maven with -X option (debug) and examine the beginning of the output. There should be something like this: … [INFO] Error stacktraces are turned on. [DEBUG] Reading global settings from c:\….\apache-maven-3.0.3\conf\settings.xml [DEBUG] Reading user settings from c:\….\.m2\settings.xml [DEBUG] Using local repository at C:\….\repository … (Original directory names are removed by me)

Maven skip tests

As you noted, -Dmaven.test.skip=true skips compiling the tests. More to the point, it skips building the test artifacts. A common practice for large projects is to have testing utilities and base classes shared among modules in the same project. This is accomplished by having a module require a test-jar of a previously built module: <dependency> … Read more

What is the maven-shade-plugin used for, and why would you want to relocate Java packages?

Uber JAR, in short, is a JAR containing everything. Normally in Maven, we rely on dependency management. An artifact contains only the classes/resources of itself. Maven will be responsible to find out all artifacts (JARs etc) that the project depending on when the project is built. An uber-jar is something that takes all dependencies, and … Read more

Maven in Eclipse: step by step installation [closed]

(Edit 2016-10-12: Many Eclipse downloads from https://eclipse.org/downloads/eclipse-packages/ have M2Eclipse included already. As of Neon both the Java and the Java EE packages do – look for “Maven support”) Way 1: Maven Eclipse plugin installation step by step: Open Eclipse IDE Click Help -> Install New Software… Click Add button at top right corner At pop … Read more

What is an uber jar?

Über is the German word for above or over (it’s actually cognate with the English over). Hence, in this context, an uber-jar is an “over-jar”, one level up from a simple JAR (a), defined as one that contains both your package and all its dependencies in one single JAR file. The name can be thought … Read more

Cannot change version of project facet Dynamic Web Module to 3.0?

Another way is to edit the project facet configuration file itself: org.eclipse.wst.common.project.facet.core.xml Change the dynamic web module version in this line to 3.0 – <installed facet=”jst.web” version=”2.5″/> And then: Right-click on the project (in the Project Explorer panel). Select Maven » Update Project (or press Alt+F5) You’ll find this file in the .settings directory within … Read more

How do I load a file from resource folder?

Try the next: ClassLoader classloader = Thread.currentThread().getContextClassLoader(); InputStream is = classloader.getResourceAsStream(“test.csv”); If the above doesn’t work, various projects have been added the following class: ClassLoaderUtil1 (code here).2 Here are some examples of how that class is used: src\main\java\com\company\test\YourCallingClass.java src\main\java\com\opensymphony\xwork2\util\ClassLoaderUtil.java src\main\resources\test.csv // java.net.URL URL url = ClassLoaderUtil.getResource(“test.csv”, YourCallingClass.class); Path path = Paths.get(url.toURI()); List<String> lines = Files.readAllLines(path, … Read more

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