문제

I want to start a new Drop-Wizard project. There is a maven archetype specified in the DW github (here) . But i don't know how to import it into my Intellij Idea's add Archtype option. Being specific, which link i have to provide in the Repository field. Any help would be appreciated.

도움이 되었습니까?

해결책

Since the dropwizard archetypes are not available in maven central repository you have to:

  • Clone the dropwizard github forked project by niktelford:
    $ git clone git@github.com:nicktelford/dropwizard.git
  • Checkout the feature branch:
    $ git checkout feature/maven-archetypes
  • Move to dropwizard-archetypes module folder:
    $ cd dropwizard/dropwizard-archetypes
  • Install the dropwizard archetypes to your local repository:
    $ mvn install (The archetype samples are then added to local repository under $LOCAL_REPO/io/dropwizard/archetypes/)
  • Make the dropwizard-create script executable:
    $ cd target/classes
    $ chmod +x dropwizard-create
  • Create your project sample:
    $ ./dropwizard-create com.sample sample

Here you have your project generated then you can import it into Intellij IDEA as a maven project.

다른 팁

Currently, to create a Dropwizard project from Maven archetype using IntelliJ IDEA one should select File>New>Project from menu. Then, in the dialog it is necessary to select Maven on the left-hand side, check Create from archetype at the top and press the Add Archetype button.

New project IDEA

After that in a dialog that appears

Dropwizard Archetype

one should enter:

  • GroupId:io.dropwizard.archetypes
  • ArtifactId:java-simple
  • Version:0.8.2

The information about the latest Dropwizard version can be obtained here.

After the aforementioned actions are completed, the desired archetype appears in the list. IDEA archetype list

Then one should press Next an fill the project's artifact and group ids and press Next. For this particular archetype it is necessary that a property called name should be added which is later used to produce names of application and configuration classes.

Add name property

After pressing Next and Finish, one can see a newly created project.

Dropwizard project

Alternatively, one could create a project using a Command Line Interface as described here, and then import the project into IDEA.

Update: Added a youtube video.

I discovered that the dropwizard-archetypes are only available in the feature branch feature/maven-archetypes, so you have to substitute the following for steps 2-3 above:

$ cd dropwizard
$ mvn checkout feature/dropwizard-archetypes
$ mvn -Dfindbugs.skip=true -Dmaven.javadoc.skip=true install

(findbugs and javadoc tend to run into trouble of various kinds on some modules).

Then of course step 4 becomes

$ cd dropwizard-archetypes/target/classes
$ chmod +x dropwizard-create

Unfortunately I can't seem to get the resulting executable to run under 64-bit Windows 7.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top