Mozzan
Mozzan

Reputation: 283

Why I get cannot be resolved with maven project

I am building a Dropwizard project. (start with:https://dropwizard.github.io/dropwizard/getting-started.html)

I create a project in eclipse, but don't understand why I get "cannot be resolved".

This is errors: enter image description here

This is pom.xml

<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>foo.bar.app</groupId>
  <artifactId>mvn-test</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>jar</packaging>

  <name>mvn-test</name>
  <url>http://maven.apache.org</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <dropwizard.version>INSERT VERSION HERE</dropwizard.version>
  </properties>


  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>io.dropwizard</groupId>
        <artifactId>dropwizard-core</artifactId>
        <version>${dropwizard.version}</version>
    </dependency>
  </dependencies>
</project>

Any one can help? I don't know how to import the package, i really have no idea with maven dependency. Thanks.

Upvotes: 0

Views: 658

Answers (2)

dogankadriye
dogankadriye

Reputation: 538

You have to define ${dropwizard.version} tag between in pom.xml like this :

<properties>
    <dropwizard.version>0.7.0</dropwizard.version>
</properties>

Upvotes: 2

Narmer
Narmer

Reputation: 1454

You have to insert your specific dropwizard.version:

<dropwizard.version>**INSERT VERSION HERE**</dropwizard.version>

so it can be used in your pom:

<version>${dropwizard.version}</version>

Upvotes: 1

Related Questions