jar
How I run maven project in cmd line
You can run mavan spring-boot project using the following command mvn spring-boot:run
SLF4J NoSuchMethodError on LocationAwareLogger
The javadocs for NoSuchMethodError say, Normally, this error is caught by the compiler; this error can only occur at run time if the definition of a class has incompatibly changed. So this is probably being caused by incompatible versions of slf4j being loaded. Rather than looking at your classpath and guessing where classes are loaded, … Read more
Maven: JAR will be empty – no content was marked for inclusion
I hope you have good reason not to follow the standard directory layout, otherwise consider to rearrange the folders: it will make your life a lot easier (as well as for your co-workers). My guess is that nothing has been compiled. In that case: removing the configuration of the maven-compiler-plugin should be enough.
how to step into code from jars (non JDK) using IntelliJ?
You can attach source code to the library configuration. In the Project Structure dialog where you define which JARs make up which libraries, there is an “Attach Sources…” button that allows you to specify one or more source JARs, ZIPs or directories.
Java command line with external .jar
Concatenate each jar file argument to cp with: ; on Windows : on Linux or Mac e.g. java -cp <path>\TOOLS.jar;.;<path>\jar2.jar;<path>\jar3.jar HelloWorld on newer JVMs (6+, I think) you can also use the * to append all JARs in a directory e.g. java -cp .;<path>\*; HelloWorld To go a step further and create a single packaged … Read more
Run JUnit Tests contained in dependency jar using Maven Surefire
There is a way of running a test in maven from another jar. from maven-surefire-plugin version 2.15 you can tell maven to scan your test jars for tests and run them. You don’t need to extract the tests jar. Just add a dependency to your test jar and: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <dependenciesToScan> <dependency>test.jar.group:test.jar.artifact.id</dependency> </dependenciesToScan> … Read more
Run exe which is packaged inside jar file
This will extract the .exe to a local file on the local disk. The file will be deleted when the Java program exists. import java.io.Closeable; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.URI; import java.net.URISyntaxException; import java.net.URL; import java.security.CodeSource; import java.security.ProtectionDomain; import java.util.zip.ZipEntry; import java.util.zip.ZipException; import java.util.zip.ZipFile; public class … Read more
Refresh an Eclipse project with Ant
Try this: <eclipse.refreshLocal resource=”project_name/folder_name” depth=”infinite” /> There are option details at the Eclipse help system. Important: you have to choose “Run in the same JRE as workspace” at the Ant run configuration.