Solved

Maven Hibernate MySQL related example

Posted on 2014-01-17
2
451 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
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Non-recursive backtracking, using a stack 1 103
eclipse argument 14 53
Java DateChooser? 3 29
javap not working 8 39
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 …
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

861 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

22 Experts available now in Live!

Get 1:1 Help Now