Pular para o conteúdo principal

Postagens

Mostrando postagens com o rótulo maven

Debugging error "Could not import XML from stream: invalid LOC header (bad signature)" when building a Thorntail application

Tl;DR: Check if there's corrupted JARs in your maven repository When building a Thorntail 2.2.0.Final application I faced the error  Could not import XML from stream: invalid LOC header (bad signature) when trying to build the JAR using mvn clean install . I could not find what is wrong, I just downloaded the application using Thorntail generator but I was not able to run it, so frustrating. When I used the -X flag I could see the error stack trace. The part that was causing the error was: Caused by: java.util.zip.ZipException: invalid LOC header (bad signature)     at java.util.zip.ZipFile.read (Native Method)     at java.util.zip.ZipFile.access$1400 (ZipFile.java:60) (...)     at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse (DocumentBuilderImpl.java:339)     at javax.xml.parsers.DocumentBuilder.parse (DocumentBuilder.java:121)     at org.jboss.shrinkwrap.descriptor.spi.node.dom.XmlDom...

A minimal Java 8 project using Maven

To use Java 8 with Maven is easy. Maven already supports it and it's good for JavaFX developers that a Java 8 is a JavaFX 8 application already! To make easy the creation of new projects using JavaFX 8, I created an archetype for JavaFX applications. It will be useful for me, so it might be useful for someone else as well. Using Maven with JavaFX 8 Having Maven 3.x and a Java 8 newest build, you are able to create JavaFX 8 applications using Maven! I created a "Hello World" application to serve as a starting point for new applications. The pom.xml is on github and the directories structure is as follow: Building and Running from Maven Make sure you export JAVA_HOME to the root path of your Java 8 installation. In my case, before running Maven I used the followin command (in Ubuntu 12.04): $  export JAVA_HOME=/opt/java/jdk1.8.0/  After this you should be able to build your project: $ mvn clean project Notice that in the root direc...