1

I am new to maven and jersey and try to put a dependency of jersey into my pom.xml.

Regarding

http://search.maven.org/#artifactdetails%7Corg.glassfish.jersey%7Cproject%7C2.27%7Cpom

the dependency should be

<dependency>
  <groupId>org.glassfish.jersey</groupId>
  <artifactId>project</artifactId>
  <version>2.27</version>
</dependency>

But if I put that in the pom, then I get an error.

[ERROR] Failed to execute goal on project mytest: Could not resolve dependencies for project mytest:mytest:jar:1.0-SNAPSHOT: Could not find artifact org.glassfish.jersey:project:jar:2.27 in central (https://repo.maven.apache.org/maven2) -> [Help 1]

I created the project completely new.

mvn archetype:generate -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false -DgroupId=mytest -DartifactId=mytest

Thats my pom.

<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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>mytest</groupId>
  <artifactId>mytest</artifactId>
  <packaging>jar</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>mytest</name>
  <url>http://maven.apache.org</url>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>

    <dependency>
     <groupId>org.glassfish.jersey</groupId>
     <artifactId>project</artifactId>
     <version>2.27</version>
    </dependency>

  </dependencies>
</project>

Whats the problem?? Thanks for help!

chris01
  • 10,921
  • 9
  • 54
  • 93
  • 1
    Just use [this command](https://stackoverflow.com/a/50973184/2587435) to create a New Jersey project. And then examine what is generated. You'll see what you're doing wrong – Paul Samsotha Jun 22 '18 at 19:05

0 Answers0