How to force maven update?

mvn clean install -U -U means force update of snapshot dependencies. Release dependencies will be updated this way if they have never been previously successfully downloaded. ref: https://stackoverflow.com/a/29020990/32453

Differences between dependencyManagement and dependencies in Maven

I’m fashionably late to this question, but I think it’s worth a clearer response than the accepted one (which is correct, but doesn’t emphasize the actual important part, which you need to deduce yourself). In the parent POM, the main difference between the <dependencies> and <dependencyManagement> is this: Artifacts specified in the <dependencies> section will … Read more

Building a fat jar using maven

Note: If you are a spring-boot application, read the end of answer Add following plugin to your pom.xml The latest version can be found at … <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-assembly-plugin</artifactId> <version>CHOOSE LATEST VERSION HERE</version> <configuration> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> </configuration> <executions> <execution> <id>assemble-all</id> <phase>package</phase> <goals> <goal>single</goal> </goals> </execution> </executions> </plugin> </plugins> </build> … After configuring … 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

Maven Shade JavaFX runtime components are missing

UPDATE 10/2021 Since JavaFX 16 a warning is displayed when JavaFX doesn’t run on the module path, which is the case of an uber/fat jar: $ java -jar myFatJar-1.0-SNAPSHOT.jar Oct 02, 2021 1:45:21 PM com.sun.javafx.application.PlatformImpl startup WARNING: Unsupported JavaFX configuration: classes were loaded from ‘unnamed module @14c24f4c’ Also, you get a warning from the shade … Read more

How to properly install and configure JSF libraries via Maven?

When you’re facing a “weird” exception suggesting that classes/methods/files/components/tags are absent or different while they are seemingly explicitly included in the web application such as the ones below, java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/faces/webapp/FacesServlet java.util.MissingResourceException: Can’t find javax.faces.LogStrings bundle com.sun.faces.vendor.WebContainerInjectionProvider cannot be cast to com.sun.faces.spi.InjectionProvider … Read more