I have added two jar files to my internal repository and created its corresponding folder directory as shown below in image. but it is showing compile time error in my pom.xml where i have added the dependency for both the jars, saying "Missing artifact common:common-jar:jar:1.0" and "Missing artifact mediator:mediator-jar:jar:1.0"
look at my pom.xml below
<properties>
<jdk.version>1.7</jdk.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- Maven plugin & MOJO versions -->
<version.maven-compiler-plugin>3.1</version.maven-compiler-plugin>
</properties>
<repositories>
<repository>
<id>in-project</id>
<name>In Project Repo</name>
<url>file://${basedir}/libs</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>common</groupId>
<artifactId>common-jar</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>mediator</groupId>
<artifactId>mediator-jar</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
please suggest what to do.
I think there is some problem identifying value for ${basedir} but i have also tried ${project.basedir} as well, it is also not working.
The problem lies in your url tag. Instead of <url>file://${basedir}/libs</url> try removing the double slash before ${basedir}: <url>file:${basedir}/libs</url>
You have a nice guide here if you want to check it.
First : Never use <scope>system</scope>
Follow the Example:
Project folder - C:\UX\X5SCX\GIT_STORE\SRC\FACTOR\fwk\broker\lib
<repositories>
<repository>
<id>local-repo</id>
<url>file://${basedir}/lib</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>ews</groupId>
<artifactId>ews-java-api</artifactId>
<version>2.0</version>
</dependency>
</dependencies>
Related
I am trying to add a dependency to my pom.xml and facing an issue: IntelliJ error
Cannot resolve jfugue:jfugue:5.0.9
The dependency I like to add is this one below from https://mvnrepository.com/artifact/jfugue/jfugue/5.0.9
<!-- https://mvnrepository.com/artifact/jfugue/jfugue -->
<dependency>
<groupId>jfugue</groupId>
<artifactId>jfugue</artifactId>
<version>5.0.9</version>
</dependency>
I have no problems adding other dependencies just by adding the xml-snippet from maven into my pom and refresh or reload all maven projects. For example I have this dependency in the same pom which is working fine:
<!-- https://mvnrepository.com/artifact/org.jsoup/jsoup -->
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.14.3</version>
</dependency>
However, there is a note under the snippet which one can copy-paste, https://mvnrepository.com/artifact/jfugue/jfugue/5.0.9
Note: this artifact is located at SingGroup repository (https://maven.sing-group.org/repository/maven/)
What do I need to add to the pom so that I can use that dependency in my Project and get rid of the error?
Cannot resolve jfugue:jfugue:5.0.9
Thanks in advance.
You can add the repository to your settings.xml Maven Guide
<profiles>
<profile>
<id>multi-repo</id>
<repositories>
<repository>
<id>MavenCentral</id>
<url>https://repo.maven.apache.org/maven2/</url>
</repository>
<repository>
<id>MavenSing</id>
<url>https://maven.sing-group.org/repository/maven//</url>
</repository>
</repositories>
</profile>
</profiles>
This Lib is no longer on the Maven repo. I get same result when adding the dependency to my project's POM file. You can get the JAR file from this URL and then include it into your project's class path:
http://www.jfugue.org/download.html
I need to include a third party jar to my pom.xml (using Maven 3.2.5 on a Linux environment).
If the jar file is available on the same machine that runs the build I can just declare the dependency in this way:
<dependencies>
<dependency>
<groupId>Foo</groupId>
<artifactId>Foo</artifactId>
<version>Foo-1.0</version>
<scope>system</scope>
<systemPath>/myspace/javalibs/foo-1.0.jar</systemPath>
</dependency>
</dependencies>
But what if the jar is on a different server such as
<repositories>
<repository>
<id>myrepo</id>
<url>http://192.168.0.14/download/java/thirdparty_repo</url>
</repository>
</repositories>
In what element should I specify the name of the jar file?
Remove
<scope>system</scope>
<systemPath>/myspace/javalibs/foo-1.0.jar</systemPath>
from pom and Maven will find the jar in http://192.168.0.14/download/java/maven_repo automatically
I'm using maven on eclipse. I want to use Lwjgl and a few other libraries but Maven wont install them. It says they are missing. Here is what it says when I look at the errors:
ArtifactDescriptorException: Failed to read artifact descriptor for slick:slick:jar:274: ArtifactResolutionException: Failure to transfer slick:slick:pom:274 from http://slick.cokeandcode.com/mavenrepo was cached in the local repository, resolution will not be reattempted until the update interval of slick has elapsed or updates are forced. Original error: Could not transfer artifact slick:slick:pom:274 from/to slick (http://slick.cokeandcode.com/mavenrepo): null to http://slick.cokeandcode.com/mavenrepo/slick/slick/274/slick-274.pom pom.xml /TheLabyrinth
Missing artifact java3d:vecmath:jar:1.3.1 pom.xml /TheLabyrinth
Missing artifact junit:junit:jar:4.10 pom.xml /TheLabyrinth
Missing artifact net.java.jinput:jinput-platform:jar:natives-linux:2.0.5 pom.xml /TheLabyrinth line 1 Maven Dependency Problem
Missing artifact net.java.jinput:jinput-platform:jar:natives-osx:2.0.5 pom.xml /TheLabyrinth
Missing artifact net.java.jinput:jinput-platform:jar:natives-windows:2.0.5 pom.xml /TheLabyrinth
Missing artifact net.java.jinput:jinput:jar:2.0.5 pom.xml /TheLabyrinth
Missing artifact net.java.jutils:jutils:jar:1.0.0 pom.xml /TheLabyrinth
Missing artifact org.hamcrest:hamcrest-core:jar:1.1 pom.xml /TheLabyrinth
Missing artifact org.lwjgl.lwjgl:lwjgl_util_applet:jar:2.8.4 pom.xml /TheLabyrinth
Missing artifact org.lwjgl.lwjgl:lwjgl_util:jar:2.8.4 pom.xml /TheLabyrinth
Missing artifact org.lwjgl.lwjgl:lwjgl-platform:jar:natives-linux:2.8.4 pom.xml /TheLabyrinth
Missing artifact org.lwjgl.lwjgl:lwjgl-platform:jar:natives-osx:2.8.4 pom.xml /TheLabyrinth
Missing artifact org.lwjgl.lwjgl:lwjgl-platform:jar:natives-windows:2.8.4 pom.xml /TheLabyrinth
Missing artifact org.lwjgl.lwjgl:lwjgl:jar:2.8.4 pom.xml /TheLabyrinth
The container 'Maven Dependencies' references non existing library 'C:\Users\Wyatt\.m2\repository\java3d\vecmath\1.3.1\vecmath-1.3.1.jar' TheLabyrinth
The project cannot be built until build path errors are resolved TheLabyrinth
So as you can see it doesn't seem to be working very good. But looking at the errors it seems to be something wrong with my pom.xml so here's a copy of that:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.awsp8.labyrinth</groupId>
<artifactId>TheLabyrinth</artifactId>
<version>1.0.0</version>
<name>The Labyrinth</name>
<description>You are stuck in a room, no way out... Or so you think.</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<natives.version>0.0.6</natives.version>
<lwjgl.version>2.8.2</lwjgl.version>
<slick.version>274</slick.version>
<junit.version>4.10</junit.version>
</properties>
<repositories>
<repository>
<id>mavenNatives</id>
<name>Maven Natives Repository</name>
<url>http://mavennatives.googlecode.com/svn/repo</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>slick</id>
<name>slick</name>
<url>http://slick.cokeandcode.com/mavenrepo</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.lwjgl.lwjgl</groupId>
<artifactId>lwjgl</artifactId>
<version>2.8.4</version>
</dependency>
<dependency>
<groupId>org.lwjgl.lwjgl</groupId>
<artifactId>lwjgl_util</artifactId>
<version>2.8.4</version>
</dependency>
<dependency>
<groupId>org.lwjgl.lwjgl</groupId>
<artifactId>lwjgl_util_applet</artifactId>
<version>2.8.4</version>
</dependency>
<dependency>
<groupId>slick</groupId>
<artifactId>slick</artifactId>
<version>${slick.version}</version>
</dependency>
<dependency>
<groupId>java3d</groupId>
<artifactId>vecmath</artifactId>
<version>1.3.1</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<plugin>
<groupId>com.googlecode.mavennatives</groupId>
<artifactId>maven-nativedependencies-plugin</artifactId>
<version>0.0.5</version>
<executions>
<execution>
<id>unpacknatives</id>
<phase>generate-resources</phase>
<goals>
<goal>copy</goal>
</goals>
</execution>
</executions>
</plugin>
</project>
Am I doing something wrong? Thanks in advance.
I am going through this guide:
https://spring.io/guides/gs/rest-service/
I use Maven for building, so I've fetched the pom.xml linked in the official Spring guide:
https://github.com/spring-guides/gs-rest-service/blob/master/initial/pom.xml
<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework</groupId>
<artifactId>gs-rest-service</artifactId>
<version>0.1.0</version>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.0.1.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
</dependencies>
<properties>
<start-class>hello.Application</start-class>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-build</artifactId>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snapshots</id>
<url>http://repo.spring.io/libs-snapshot</url>
<snapshots><enabled>true</enabled></snapshots>
</repository>
<repository>
<id>spring-repo</id>
<name>Spring Repository</name>
<url>http://repo.spring.io/release</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<url>http://repo.spring.io/libs-snapshot</url>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</project>
I get the following error when running mvn install
[ERROR] Error resolving version for plugin
org.springframework.boot:spring-boot-maven-build' from the
repositories [local (C:\Users\Laszlo_Szucs.m2\repository),
spring-snapshots (repo.spring.io/libs-snapshot), central
repo.maven.apache.org/maven2)]: Plugin not found in any plugin
repository -> [Help 1]
How do I know which version to provide in the pom.xml for this?
Check whether http://repo.spring.io/libs-snapshot is in pom.xml. If not, Add http://repo.spring.io/libs-snapshot to maven repository.
<repository>
<id>spring-repo</id>
<name>Spring Repository</name>
<url>http://repo.spring.io/release</url>
</repository>
And upgrade the maven to 3.0.5 above.
In my case, removing the ~/.m2/repository/org/springframework/boot folder and then cleaning the project resolved the issue. After this issue, I also faced another issue in which STS complained that my maven project was not updated. However, right clicking on the issues in the Markers area and selecting Quick Fix popped up a window which prompted me to update the maven projects. Selecting the projects and clicking the update button in this window resolved the issue.
I specified d goals as "spring-boot:run" (without quote) it works for me
procedure: right click on myproject>run as >run configurations >click on mavenbuild>goals(specify goal name)>run
I am trying to add the dependency of Gephi in POM.xml file (in Eclipse). Here is the POM file:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>ch.unifr</groupId>
<artifactId>facebook</artifactId>
<version>1.0</version>
<packaging>war</packaging>
<name>Facebook Example</name>
<repositories>
<repository>
<id>gephi-snapshots</id>
<name>Gephi Snapshots</name>
<url>http://nexus.gephi.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>gephi-releases</id>
<name>Gephi Releases</name>
<url>http://nexus.gephi.org/nexus/content/repositories/releases/</url>
</repository>
</repositories>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<gephi.maven.requiredVersion>3.0.4</gephi.maven.requiredVersion>
<netbeans.run.params.ide/>
<netbeans.run.params>${netbeans.run.params.ide}</netbeans.run.params>
<!-- Netbeans Platfrom version -->
<netbeans.version>RELEASE721</netbeans.version>
<!-- Gephi version -->
<gephi.version>0.9-SNAPSHOT</gephi.version>
<!-- Java compilation settings -->
<gephi.javac.source>1.6</gephi.javac.source>
<gephi.javac.target>1.6</gephi.javac.target>
<gephi.javac.xlint>-Xlint:all</gephi.javac.xlint>
<gephi.javac.debug>true</gephi.javac.debug>
<gephi.javac.optimize>true</gephi.javac.optimize>
<gephi.javac.showDeprecation>true</gephi.javac.showDeprecation>
<gephi.javac.showWarnings>true</gephi.javac.showWarnings>
<gephi.javac.fork>true</gephi.javac.fork>
<!-- Testing settings -->
<gephi.junit.version>4.7</gephi.junit.version>
<gephi.test.maxMemory>768M</gephi.test.maxMemory>
<gephi.test.reportsDirectory>${project.build.directory}/surefire-reports/plain</gephi.test.reportsDirectory>
<gephi.test.failureIgnore>${testFailureIgnore}</gephi.test.failureIgnore>
<!-- Repository URLs -->
<gephi.release.repository.id>gephi-nexus</gephi.release.repository.id>
<gephi.snapshot.repository.id>gephi-nexus</gephi.snapshot.repository.id>
<gephi.release.repository.url>http://nexus.gephi.org/nexus/content/repositories/releases</gephi.release.repository.url>
<gephi.snapshot.repository.url>http://nexus.gephi.org/nexus/content/repositories/snapshots</gephi.snapshot.repository.url>
<!-- SCM -->
<gephi.scm>git</gephi.scm>
<!--==== Plugin Versions ==================================================================================-->
<gephi.maven-assembly-plugin.version>2.4</gephi.maven-assembly-plugin.version>
<gephi.maven-clean-plugin.version>2.5</gephi.maven-clean-plugin.version>
<gephi.maven-compiler-plugin.version>3.0</gephi.maven-compiler-plugin.version>
<gephi.maven-dependency-plugin.version>2.6</gephi.maven-dependency-plugin.version>
<gephi.maven-deploy-plugin.version>2.7</gephi.maven-deploy-plugin.version>
<gephi.maven-gpg-plugin.version>1.4</gephi.maven-gpg-plugin.version>
<gephi.maven-install-plugin.version>2.4</gephi.maven-install-plugin.version>
<gephi.maven-jar-plugin.version>2.4</gephi.maven-jar-plugin.version>
<gephi.maven-jarsigner-plugin.version>1.2</gephi.maven-jarsigner-plugin.version>
<gephi.maven-javadoc-plugin.version>2.9</gephi.maven-javadoc-plugin.version>
<gephi.maven-license-plugin.version>1.9.0</gephi.maven-license-plugin.version>
<gephi.maven-release-plugin.version>2.3.2</gephi.maven-release-plugin.version>
<gephi.maven-resources-plugin.version>2.6</gephi.maven-resources-plugin.version>
<gephi.maven-source-plugin.version>2.2.1</gephi.maven-source-plugin.version>
<gephi.maven-surefire-plugin.version>2.13</gephi.maven-surefire-plugin.version>
<gephi.build-helper-maven-plugin.version>1.7</gephi.build-helper-maven-plugin.version>
<gephi.wagon-maven-plugin.version>1.0-beta-4</gephi.wagon-maven-plugin.version>
</properties>
<dependencies>
<dependency>
<groupId>com.restfb</groupId>
<artifactId>restfb</artifactId>
<version>1.6.12</version>
</dependency>
<dependency>
<groupId>com.google.code.facebookapi</groupId>
<artifactId>facebook-java-api</artifactId>
<version>3.0.2</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.0-beta9</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.0-beta9</version>
</dependency>
<dependency>
<groupId>org.openrdf.sesame</groupId>
<artifactId>sesame-model</artifactId>
<version>2.7.7</version>
</dependency>
<dependency>
<groupId>org.gephi</groupId>
<artifactId>gephi-toolkit</artifactId>
<version>0.9-SNAPSHOT</version>
<dependency>
</project>
As you may notice, the dependency is for Gephi. This is part of the error message as below:
Multiple annotations found at this line:
- Missing artifact org.netbeans.api:org-netbeans-modules-queries:jar:RELEASE721
- Missing artifact commons-codec:commons-codec:jar:1.6
- Missing artifact org.apache.xmlgraphics:batik-util:jar:1.7
- Missing artifact gnu.trove:trove:jar:2.1.0
- Missing artifact javax.activation:activation:jar:1.1
- Missing artifact org.netbeans.api:org-openide-modules:jar:RELEASE721
Could anyone help me how to solve this problem? I do not know why POM does not accept the Gephi dependency however I have already added some other dependencies such as openrdf and restfb. I also added the Gephi repository as shown in the POM file. Your help is very much appreciated.
Looking at the documentation page, it looks like you'll need to add their repository to your POM, as well:
<project>
...
<repositories>
<repository>
<id>gephi-snapshots</id>
<name>Gephi Snapshots</name>
<url>http://nexus.gephi.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>gephi-releases</id>
<name>Gephi Releases</name>
<url>http://nexus.gephi.org/nexus/content/repositories/releases/</url>
</repository>
...
</repositories>
...
</project>