Snippets tagged “maven”
29 snippets use this tag.
- Can I add jars to Maven 2 build classpath without installing them?Java
Yes, you can add jars to the Maven build classpath without installing them.
- Create a Maven project in Eclipse complains "Could not resolve archetype"Java
There could be several reasons why you are getting the error "Could not resolve archetype" when trying to create a Maven project in Eclipse.
- Getting java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory exceptionJava
The java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory exception is thrown when a Java application is unable to find the LogFactory class from the Apache Commons Logging library.
- How can I create an executable/runnable JAR with dependencies using Maven?Java
To create an executable JAR with dependencies using Maven, you can use the maven-assembly-plugin. This plugin allows you to package your project and its dependencies into a single JAR file.
- How can I solve "java.lang.NoClassDefFoundError"?Java
java.lang.NoClassDefFoundError is an error that occurs when the Java Virtual Machine (JVM) can't find a required class definition at runtime. This can happen for a variety of reasons, including:
- How do I connect to a SQL Server 2008 database using JDBC?Java
To connect to a SQL Server database using JDBC, you will need to use the JDBC driver for SQL Server.
- How do I import the javax.servlet / jakarta.servlet API in my Eclipse project?Java
To import the javax.servlet or jakarta.servlet API in an Eclipse project, follow these steps:
- How do I resolve ClassNotFoundException?Java
A ClassNotFoundException occurs when the Java virtual machine (JVM) is unable to find a class that has been referenced in your code. This can happen for a number of reasons, including:
- How do I tell Maven to use the latest version of a dependency?Java
To tell Maven to use the latest version of a dependency, you can use the [RELEASE] or [LATEST] version range in the <version> element of the dependency in your pom.xml file.
- How to add local jar files to a Maven project?Java
To add a local JAR file to a Maven project, you can use the maven-install-plugin. Here's how you can do it:
- How to connect to Oracle using Service Name instead of SIDJava
To connect to an Oracle database using a service name instead of a SID (System Identifier), you can use the thin driver and specify the connection URL in the following format:
- How to convert jsonString to JSONObject in JavaJava
To convert a JSON string to a JSONObject in Java, you can use the JSONObject constructor that takes a String as an argument, like this:
- How to parse JSON in JavaJava
To parse a JSON string in Java, you can use the org.json library. This library provides a simple and easy-to-use interface for parsing and manipulating JSON data in Java.
- How to read json file into java with simple JSON libraryJava
To read a JSON file into Java using the Simple JSON library, you can use the JSONObject class and the JSONArray class.
- How to resolve java.lang.NoClassDefFoundError: javax/xml/bind/JAXBExceptionJava
The java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException error occurs when the Java class javax.xml.bind.JAXBException is not found on the classpath. This class is part of the Java Architecture for XML Binding (JAXB) API, which is used for parsing
- How to set specific Java version to Maven?Java
To set a specific Java version for Maven, you can specify the maven.compiler.source and maven.compiler.target properties in the pom.xml file.
- Import Maven dependencies in IntelliJ IDEAJava
To import Maven dependencies in IntelliJ IDEA, you can follow these steps:
- Including dependencies in a jar with MavenJava
To include dependencies in a JAR file with Maven, you can use the maven-assembly-plugin to create an assembly that includes all the dependencies of your project.
- IntelliJ inspection gives "Cannot resolve symbol" but still compiles codeJava
There are a few possible reasons why IntelliJ might show a "Cannot resolve symbol" error while still being able to compile your code.
- Java 11 package javax.xml.bind does not existJava
If you are seeing the error "package javax.xml.bind does not exist" in your Java 11 project, it means that the Java XML Bind (JAXB) API is not included in the classpath.
- Maven package/install without test (skip tests)Java
To package/install a Maven project without running the tests, you can use the maven-install-plugin and specify the skipTests property as true.
- Maven plugins can not be found in IntelliJJava
There are several possible reasons why Maven plugins might not be found in IntelliJ:
- No Persistence provider for EntityManager namedJava
If you are seeing the error "No Persistence provider for EntityManager named [persistence-unit-name]" in your Java application, it means that the persistence provider (e.g.
- Parsing JSON Object in JavaJava
To parse a JSON object in Java, you can use the org.json library.
- Run a single test method with mavenJava
To run a single test method with Maven, you can use the surefire:test goal and specify the fully-qualified name of the test class and the method name using the test and method properties, respectively.
- Spring Boot - Cannot determine embedded database driver class for database type NONEJava
If you are seeing the error "Cannot determine embedded database driver class for database type NONE" in a Spring Boot application, it means that the application is trying to auto-configure an embedded database, but it is unable to determine which database
- The import javax.servlet can't be resolvedJava
If you are getting the error "The import javax.servlet can't be resolved", it means that the javax.servlet package is not available on the classpath.
- The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build PathJava
This error typically occurs when you are trying to use the HttpServlet class in a Java project, but the necessary libraries are not included in the project's classpath. To fix this error, you need to add the servlet-api.jar library to your project's class
- What exactly is a Maven Snapshot and why do we need it?Java
A Maven snapshot is a version of a Maven artifact that is under active development and has not been released yet.