2

I'm following the JEE7 first cup directions for EJB:

Before you can create applications based on the archetypes, you must first install the archetypes and supporting projects to your local Maven repository.

In NetBeans IDE select File, then Open Project, navigate to tut-install/, 
select example, deselect the Open Required Projects check box, and click
Open Project.

Right-click the firstcup project in the Projects pane and select Build.

Only I don't see tut-install, and this seems to be the only reference to tut-install...

While I have, I think, installed maven, I don't see dukes-age:

Create the Project in NetBeans IDE 
    From the File menu, select New Project.
    Under Categories, select Maven.
    Under Projects, select Project from Archetype.
    Click Next.
    In the Search field, enter dukes-age.
    In the Known Archetypes field, select dukes-age-archetype.
    Click Next.
    In the Project Name field, enter dukes-age.
    In the Package field, enter firstcup.dukesage.resource.
    Click Finish.

When browsing archetypes, I see:

enter image description here

why doesn't the dukes-age project show up?

Thufir
  • 8,216
  • 28
  • 125
  • 273
  • perhaps it's possible to add a pom file? http://stackoverflow.com/a/18475191/262852 see also https://java.net/projects/firstcup/sources/svn/content/trunk/example/archetypes/dukes-age-archetype/pom.xml?rev=215 for what I think is the pom. – Thufir Aug 04 '14 at 04:52

5 Answers5

3

Here is what I figured. Throwing it here as additional info.

The archtypes are not available in the glassfish install that comes packaged with Netbeans 8.0.1. I downloaded Java EE SDK update 1 from http://www.oracle.com/technetwork/java/javaee/downloads/index.html.

Once the downloaded .zip is extracted, the java_ee_sdk-7u1\glassfish4\docs\firstcup\example folder contains the archtypes.

Mahesh
  • 31
  • 3
1
  1. Click Open Project
  2. Go to %YOUR_GLASSFISH_FOLDER%\docs\firstcup
  3. Open examples

Note that Java EE SDK comes with Glassfish and NetBeans comes with Glassfish. You need the Glassfish from Java EE SDK.

  1. Right-click the firstcup project in the Projects pane and select Build.

Now you can create an application based on dukes-age archetype - just follow the instructions in clause 3.2.2.2 of tutorial. In my case it took maybe 10 minutes after step 5 until dukes-age-archetype has appeared in Known Archetypes, so you'll need to be patient.

infranoise
  • 277
  • 4
  • 18
  • hmm, I downloaded and installed the Oracle Java EE SDK and then Netbeans, but this archetype doesn't seem listed. I'll have to double check that the Oracle Java EE SDK is installed and configured correctly (Ubuntu). The EE SDK has this archetype? – Thufir Aug 09 '14 at 19:48
  • 1
    `dukes-age` archetype appears in the list after you have opened and built `%YOUR_GLASSFISH_FOLDER%\docs\firstcup\examples` project. Tutorial refers to `tut-install` directory, but it doesn't exist, so you shall use `%YOUR_GLASSFISH_FOLDER%\docs\firstcup\examples` instead. – infranoise Aug 11 '14 at 10:44
1

it's available here:

https://java.net/downloads/glassfish-samples/

although it also seems to ship with glassfish itself.

Thufir
  • 8,216
  • 28
  • 125
  • 273
  • 1
    glassfish-samples is not the same as firstcup. The project for firstcup is here: https://java.net/projects/firstcup/ – Ian Evans Sep 04 '14 at 19:28
1

Once you open the first cup project in NetBeans from javee7 sdk, you should edit the pom.xml with:

<groupId>org.glassfish.javaeetutorial.firstcup</groupId>
  <artifactId>dukes-age-archetype</artifactId>
  <packaging>maven-archetype</packaging>

Then build the dukes-age-archetype project to get listed in the known types.

MJH
  • 2,301
  • 7
  • 18
  • 20
1

A bit old topic.

Not sure is it a bug or not but building First Cup project/module from intellij doesn't create any maven archetype for me. I followed following steps to get the maven dukes-age archetype.

  1. Install IntelliJ Maven Archetype Catalog plugin https://plugins.jetbrains.com/plugin/7965-maven-archetype-catalogs

  2. Run mvn clean install from First Cup root. It will create archetype-catalog.xml in maven repository root directory

  3. Add the xml path to Maven Archetype Catalog. File -> Settings -> Build execution, Deployment -> Build tools -> Maven Archetype Catalog

Now org.glassfish.docs:* archetype should appear

enter image description here