Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Maven Hibernate MySQL related example

Posted on 2014-01-17
2
Medium Priority
?
476 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 2000 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

688 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