Solved

Maven Hibernate MySQL related example

Posted on 2014-01-17
2
447 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
2 Comments
 
LVL 6

Accepted Solution

by:
Mahesh Bhutkar earned 500 total points
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

744 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now