This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Maven: add a dependency to a jar by relative path
I need import a .jar file using only a buildpath in a java maven project without creating a dependency. Can this be done?
You mean that your jar is used only to compile but is not a transitive dependency?
<dependency>
<groupId>foo</groupId>
<artifactId>bar</artifactId>
<version>1.0</version>
<scope>provided</scope>
</dependency>
provided:
This scope is only available on the compilation and test classpath, and is not transitive.
See more on dependency scopes
Related
This question already has answers here:
JasperReports Maven broken?
(6 answers)
Grails - Jasper plugin dependency download error
(5 answers)
Closed 1 year ago.
I'm using Jasper Reports in my project and everything working fine. but when i execute mvn install this message showing for me.
The POM for org.olap4j:olap4j:jar:0.9.7.309-JS-3 is missing, no
dependency information available
Please not this error related with the below dependency
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>6.0.0</version>
</dependency>
This question already has an answer here:
Maven package issue locally?
(1 answer)
Closed 2 years ago.
I run mvn clean package -U
And i get this error message below?
Could not resolve dependencies for project DD2480-Group-15:gs-maven:jar:0.1.0: Could not find artifact com.fasterxml.jackson.core:jackson-databind:jar:3.6 in java.net2 (http://download.java.net/maven/2)
And i have this dependcies in my pom.xml file?
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.11.1</version>
</dependency>
Is jackson deprecreated or?
I have just checked this out.
I removed that dependency from local repo and used maven to refresh the dependencies. It came without any problem. It is not the dependency the problem but the remote repo that you try to get it from.
The repository at http://download.java.net/maven/2 is deprecated, and has been replaced with https://maven.java.net/content/groups/public/
To replace your remote repository
A) If you use your downloaded version of maven then
you must find where your maven folder in your laptop exists. Then under conf/settings.xml you can configure your settings.xml
Then under mirror tag you can configure your remote repository
How to configure mirrors in maven
B) If you use a bundled version of INTELIJ for Maven then check this image of how you can configure your remote repositories
This question already has answers here:
"cannot find symbol" error in maven
(5 answers)
Closed 4 years ago.
I am trying to package a SpringBoot project of mine to use as a library in another. I had it working somewhat but not I can't get my library classes to resolve at all.
I don't get any errors to do with the dependency in my POM file. I simply can't get to my library in my code.
I am building my package then installing it in my local Maven repo with mvn install:install-file -Dfile=myPackage.jar When I navigate to my local repo, the package is there and the pom file looks right. I bring it in to my project with
<dependency>
<groupId>com.mygroup</groupId>
<artifactId>mylib</artifactId>
<version>0.0.1</version>
</dependency>
which all matches the POM for the package in the maven repo. I update the project configuration and no issues are found in my project POM. But com.mygroup.mylib is simply not found.
It seems that Maven is finding the dependency but for some reason the classes can't be found within it.
What are some ways to get more information about where the disconnect is?
I am using spring boot 2.0.0 and VSCode 1.20.1.
Run maven command for logs to find out actual issue.
mvn clean install -X
This question already has answers here:
How can I create an executable/runnable JAR with dependencies using Maven?
(33 answers)
Closed 5 years ago.
I have a Maven project with certain set of dependencies. One of the dependencies is:
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>4.5.0</version>
</dependency>
As long as I work in Eclipse, all is good. But when I package and try to use the resulting jar file(from command line if that matters), I get this error message:
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/jna/NativeLibrary
while this class is definitely accessible in IDE.
My guess is that Maven is not packaging project's dependencies by default but in that case why don't I get more error messages complaining about more classes that were not found?
Maven will only create a jar for your project/component. This does not include the external jars (dependencies). If you want/need to include the contents of the dependencies in your jar, you should create a fat jar or uber jar. For an uber jar, you may use shade plugin.
This question already has answers here:
How to add local jar files to a Maven project?
(35 answers)
Closed 6 years ago.
I have 50 jars that I need to add to a Maven project as dependencies. They are not in the public repository, I cannot install a local repository and I'd like to know a quick solution to add them in my pom.xml.
I know that to add a local dependency you could write
<dependency>
<groupId>sample</groupId>
<artifactId>com.sample</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/yourJar.jar</systemPath>
</dependency>
but this is simply a real long task with several Jars. Is there an easy way to do it?
The solutions suggested in How to add local jar files in maven project? are specific for a single or few Jars but not the case when you many of them.
Add those jars to your local maven repository and then add their dependency to your POM. See this link: MKYong: How to include custom library into maven local repository?