Eclipse 中的 Jersey Maven 快速入门原型 [英] Jersey Maven quickstart archetype in Eclipse

查看:24
本文介绍了Eclipse 中的 Jersey Maven 快速入门原型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在 maven 的帮助下正常创建 Jersey,但我总是像在 scrennshoot 中一样获得这种结构,并且没有像往常一样出错?!它看起来不像泽西岛通常的布局.

我正在使用这个:

org.glassfish.jersey.archetypes球衣-快速入门-webapp2.16

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>org.test</groupId><artifactId>serverSide</artifactId><version>0.0.1-SNAPSHOT</version><包装>罐</包装><name>serverSide</name><url>http://maven.apache.org</url><属性><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding></属性><依赖项><依赖><groupId>junit</groupId><artifactId>junit</artifactId><version>3.8.1</version><范围>测试</范围></依赖></依赖项></项目>

解决方案

我非常怀疑您是否正确地创建了原型项目.您所展示的是 org.apache.maven.archetypes 的产品:maven-archetype-quickstart

这是如何在 Eclipse 中创建 Jersey 原型的快速演练

  1. 转到文件其他

  2. 在对话框中,选择Maven文件Maven Project,然后Next

  3. 在下一个对话框中保留所有默认值,然后点击Next

  4. 在下一个对话框中,我们将选择 Maven 原型.在搜索框中,输入 jersey-quickstart-webapp.所有原型都需要一些时间来加载.您可以在 IDE 的右下角看到它们仍在加载的进度.这应该不会超过 5 秒.如果您没有看到任何搜索结果,那么您可能没有安装原型.请参阅

  5. I am trying to create Jersey normally with the aid of maven but I am always getting this structure as in the scrennshoot and without error as normally?! It does not look as Jersey commonly layout.

    I am using this one:

    org.glassfish.jersey.archetypes
    jersey-quickstart-webapp
    2.16
    

    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>org.test</groupId>
      <artifactId>serverSide</artifactId>
      <version>0.0.1-SNAPSHOT</version>
      <packaging>jar</packaging>
    
      <name>serverSide</name>
      <url>http://maven.apache.org</url>
    
      <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
      </properties>
    
      <dependencies>
        <dependency>
          <groupId>junit</groupId>
          <artifactId>junit</artifactId>
          <version>3.8.1</version>
          <scope>test</scope>
        </dependency>
      </dependencies>
    </project>
    

    解决方案

    I highly doubt you are creating the archetype project correctly. What you are showing is a product of the org.apache.maven.archetypes : maven-archetype-quickstart

    Here's a quick walk-through of how to create the Jersey archetype in Eclipse

    1. Go to FileNewOther

    2. In the dialog, select the Maven file the Maven Project, then Next

    3. In the next dialog keep all the defaults, and hit Next

    4. In this next dialog we will select the Maven archetype. In the search box, type jersey-quickstart-webapp. All the archetypes takes a few moments to load. You can see the progress at the bottom right of the IDE is they are still loading. This shouldn't take more than maybe 5 seconds. If you are not seeing any results come up from the search, then it's likely you don't have the archetypes installed. See this Stackoverflow answer for how you can get the archetypes.

      Once the archetypes load, and you see the jersey-quickstart-webapp in the results list, uncheck "Show the last version of Archetype only". So once you have unchecked that, you should see more version available. Scroll down to the org.glassfish.jersey.archetypes and select the version 2.16 (or whatever the latest version is, if you choose). Then hit Next

    5. In the next dialog, enter the groupId, artifactId, and package, then hit Finish

    6. You should now see a project with the following structure. There will be an error in the project because of you jsp page. We have no use for it here, so you can delete it if you want. This should get rid of the error.


    See Also:

    这篇关于Eclipse 中的 Jersey Maven 快速入门原型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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