Solved

Maven Hibernate MySQL related example

Posted on 2014-01-17
2
460 Views
Last Modified: 2014-01-28
Hi,

I was going through below link
http://www.developer.am/documentation/hibernate/?page=maven_hibernate_mysql

I am not clear on stp 1 and step 2


1. Generate project structure with Maven
In command prompt, Issue the “mvn archetype:generate” command, choose project #15 to create a quick start Maven’s java project, then fill in your project’s information – groupId , artifactId and pakage

E:workspace>mvn archetype:generate
[INFO] Scanning for projects...
...
Choose a number:  
(1/2/3....) 15: : 15
...
Define value for groupId: : com.developer.ammon
Define value for artifactId: : HibernateExample
Define value for version:  1.0-SNAPSHOT: :
Define value for package:  com.developer.ammon: : com.developer.ammon
[INFO] OldArchetype created in dir: E:workspaceHibernateExample
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------

2. Convert to Eclipse project

Issue the “mvn eclipse:eclipse” to convert the newly generated project to Eclipse’s style project
- See more at: http://www.developer.am/documentation/hibernate/?page=maven_hibernate_mysql#sthash.PgqTQdTZ.dpuf

why we need these steps.

please advise
Any links resources ideas highly appreciated. Thanks in advance
0
Comment
Question by:gudii9
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 6

Accepted Solution

by:
Mahesh Bhutkar earned 500 total points
ID: 39793557
The example you are referring uses Maven.
It is automation tool used to build the project. It manages jar file & it's dependencies which we placed inside lib folder of the project. It manages compatible versions. You can see the versions showing inside step1 for different different jars. This will simplify your project setup. You don't have to hunt & download the required dependency.

The above two steps you mention is a part of Maven Project setup for development.

Otherwise you have to create the project inside the eclipse & resolve all required dependency jars manually.
0
 
LVL 7

Author Comment

by:gudii9
ID: 39797785
I wonder what is

choose project #15

Can it be random number.

When I go to folde C:\gptest from the command prompt and gave command mvn archetype:generate

I got as below 16 not 15. I wonder why i have not got project 15 but instead  got project 16. what it means

>>Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): 16: 16

How and where do i begin to start crerating this. I do not need eclispe right for these steps?

When I did first step it created HibernateExample with below 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>com.developer.ammon</groupId>
  <artifactId>HibernateExample</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>jar</packaging>

  <name>HibernateExample</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 wonder why it has only junit jar entry and not any other entries. I also do not see Project ID 16 which i selectedm earlier in pom.xml. I wonder why?



Is there is any other detailed step by step link with screenshots on this. Please advise
0

Featured Post

Tutorials alone can't teach real engineering

So we built better training tools.

-Hands-on Labs
-Instructor Mentoring
-Scenario-Based Tests
-Dedicated Cloud Servers

All at your fingertips. What are you waiting for?

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question