如何在Netbeans项目中使用Dropwizard? [英] How to use Dropwizard in Netbeans project?

查看:91
本文介绍了如何在Netbeans项目中使用Dropwizard?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Dropwizard建议将Maven用于新服务,并且据说Netbeans 7.4具有强大的Maven支持.

因此,我创建了一个新的Netbeans项目:"New Project ...">"POM Project",然后添加了Dropwizard依赖项:

<dependencies>
    <dependency>
        <groupId>com.yammer.dropwizard</groupId>
        <artifactId>dropwizard-core</artifactId>
        <version>0.6.2</version>
    </dependency>
</dependencies>

到pom.xml,然后呢? Netbeans表示该项目已中断,因为该依赖项不存在.但这是因为Netbeans尚未下载它们.但这不是自动的吗?

如何在Netbeans 7.4中创建一个新的Dropwizard项目?

解决方案

汤姆

自您提出问题以来,发生了很多变化.项目中有一个Maven原型,可用于在Netbeans中创建Dropwizard.

要在NetBeans中从Maven原型创建项目,应选择文件">新建项目"(或按Ctrl + Shift + N),然后在类别"中选择"Maven",在项目"中选择来自原型的项目",如下所示. /p>

然后按下一步.之后,在出现的屏幕中,应该在搜索"输入行中键入Dropwizard.简单的Java是Dropwizard的一部分.

按下下一步"按钮后,可以选择项目名称,版本,artefactId等.

在撰写本文时,有必要输入name属性,这是Maven name元素的内容,并且可以在IDE中显示此名称.但是对于这个特定的原型名称,不应包含空格,因为两个生成的类的名称均基于此属性.否则,您会得到一个错误.

按Finish,就可以在NetBeans中启动Dropwizard项目了.只是不要忘记指示项目的属性"中的NetBeans向它传递一个服务器"参数,如下所示.

更新:添加了 youtube视频.

Dropwizard recommends using Maven for new services, and supposedly Netbeans 7.4 has great Maven support.

So, I created a new Netbeans project: "New Project..." > "POM Project", and then added the Dropwizard dependency:

<dependencies>
    <dependency>
        <groupId>com.yammer.dropwizard</groupId>
        <artifactId>dropwizard-core</artifactId>
        <version>0.6.2</version>
    </dependency>
</dependencies>

to pom.xml, and then what? Netbeans says the project is broken, because the dependencies don't exist. But that is because Netbeans hasn't downloaded them. But it isn't that supposed to be automatic?

How do you create a new Dropwizard project in Netbeans 7.4?

解决方案

Tom

a lot has changed since you asked your question. There is a Maven archetype that is a part of the project, which could be used to create a Dropwizard in Netbeans.

To create a project from Maven archetype in NetBeans one should choose File>New Project (or press Ctrl+Shift+N) and then in Categories select "Maven" and in Projects select "project from Archetype" as shown below.

Then press next. After that in the screen that appears one should key in Dropwizard in the Search input line. The java-simple is a part of Dropwizard.

After pressing Next button one can select project name, version, artefactId, etc.

At the time of writing it was necessary that one should enter the name attribute, which is the contents of Maven name element and this name can be displayed in an IDE. But for this particular archetype name should not contain spaces as the names of the two generated classes are based on this attribute. Otherwise you'll get an error.

Press Finish and you are ready to launch your Dropwizard project in NetBeans. Just don't forget to instruct NetBeans in Properties of your project to pass it a "server" argument as shown below.

Update: Added a youtube video.

这篇关于如何在Netbeans项目中使用Dropwizard?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆