Announcement Announcement Module
Collapse
No announcement yet.
Maven don't download all the libraries for this simple web project... Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Maven don't download all the libraries for this simple web project...

    Hello,
    I am following this case study about Spring + Hibernate + Maven: http://viralpatel.net/blogs/spring3-...lipse-example/

    I have some problem to deploy on TomCat the example project of this tuotiral, that you can download here: http://viralpatel-net-tutorials.goog...rnateMaven.zip

    I am using STS 3.1 and its embedded Maven 3.0.4 version.

    I have do the following operations:

    1) I have downloaded the project on my hard disk and I have unzip the Spring3HibernateMaven project

    2) I have copy Spring3HibernateMavenProject inside my STS Workspace

    3) In STS I have import the project using: File ---> Import ---> Import existing project into workspace and selecting Spring3HibernateMaven folder from my Workspace directory

    At this time STS show me a pop up that say me this message: "The following legacy Maven Projects have been found. Do you want them to be automatically upgraded to new version of M2E (Maven Eclipse Integration)?" and in the pop up is selected my Spring3HibernateMaven project. So I click on YES butto to upgrade my Spring3HibernateMaven project to the new version of M2E

    4) Now I have my Spring3HibernateMaven project inside STS and Maven begin to dowload some libraries inside .m2 directory on my system

    5) When Maven end the dowload libraries process I can see a red exlamation mark on the Spring3HibernateMaven project icon in my Package Exloprer view.

    6) I do: right click on my project ---> Properties ---> Java Build Path ---> Libraries

    and now I have 2 errors:

    FIRST PROBLEM:
    This Project use JRE 1.5 that is unbound because on my system I am using the last 1.7 version, so I remove this library and I add the "Java 7 oracle" JDK and this firs problem I think that it is solved

    SECOND PROBLEM:
    In the Libraries section of my Java Buil Path I have also the voice named Mavem Dependencies (that contain the libraries dowloaded by Maven). The icon of this voice is marked with a red cross.

    If I click on this voice to see all the dependencies dowloaded by Maven I can see that only 2 librarie are marked with a red cross (I think that Maven have not dowloaded these 2 libraries). These libraries are: spring-jdbc-3.0.2-RELEASE.jar and hibernate-entitymanager-3.3-2ga.jar

    Why not?

    This is the pom.xml content:
    Code:
    <?xml version="1.0" encoding="UTF-8"?><project>
      <modelVersion>4.0.0</modelVersion>
      <groupId>Spring3HibernateMaven</groupId>
      <artifactId>Spring3HibernateMaven</artifactId>
      <packaging>war</packaging>
      <version>0.0.1-SNAPSHOT</version>
      <description></description>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
              <source>1.5</source>
              <target>1.5</target>
            </configuration>
          </plugin>
          <plugin>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.0</version>
          </plugin>
        </plugins>
      </build>
      <dependencies>
        <dependency>
          <groupId>javax.servlet</groupId>
          <artifactId>servlet-api</artifactId>
          <version>2.5</version>
        </dependency>
        <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-beans</artifactId>
          <version>${org.springframework.version}</version>
        </dependency>
        <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-jdbc</artifactId>
          <version>${org.springframework.version}</version>
        </dependency>
        <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-web</artifactId>
          <version>${org.springframework.version}</version>
        </dependency>
        <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-webmvc</artifactId>
          <version>${org.springframework.version}</version>
        </dependency>
        <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-orm</artifactId>
          <version>${org.springframework.version}</version>
        </dependency>
        <dependency>
          <groupId>org.hibernate</groupId>
          <artifactId>hibernate-entitymanager</artifactId>
          <version>3.3.2.ga</version>
        </dependency>
        <!-- dependency>
          <groupId>org.slf4j</groupId>
          <artifactId>slf4j-log4j12</artifactId>
          <version>1.4.2</version>
        </dependency -->
        <dependency>
          <groupId>taglibs</groupId>
          <artifactId>standard</artifactId>
          <version>1.1.2</version>
        </dependency>
        <dependency>
          <groupId>javax.servlet</groupId>
          <artifactId>jstl</artifactId>
          <version>1.1.2</version>
        </dependency>
        <dependency>
          <groupId>mysql</groupId>
          <artifactId>mysql-connector-java</artifactId>
          <version>5.1.10</version>
        </dependency>
        <dependency>
          <groupId>commons-dbcp</groupId>
          <artifactId>commons-dbcp</artifactId>
          <version>20030825.184428</version>
        </dependency>
        <dependency>
          <groupId>commons-pool</groupId>
          <artifactId>commons-pool</artifactId>
          <version>20030825.183949</version>
        </dependency>
      </dependencies>
      <properties>
        <org.springframework.version>3.0.2.RELEASE</org.springframework.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
      </properties>
    </project>
    Moreover STS give me an other error in this pom.xml file, at line 17...for this piece of code:

    Code:
          <plugin>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.0</version>
          </plugin>
    and say me that: maven-war-plugin prior to 2.0.1 is not supported by m2e-wtp. Use maven-war-plugin version 2.0.1 or later

    And here I do not do how think and how do abbout it...

    If I try to do Run as ---> Maven Install on my project it give me the following error message:

    [ERROR] Failed to execute goal on project Spring3HibernateMaven: Could not resolve dependencies for project Spring3HibernateMaven:Spring3HibernateMaven:war:0. 0.1-SNAPSHOT: The following artifacts could not be resolved: org.springframework:spring-jdbc:jar:3.0.2.RELEASE, org.hibernate:hibernate-entitymanager:jar:3.3.2.ga: Could not transfer artifact org.springframework:spring-jdbc:jar:3.0.2.RELEASE from/to central (http://repo.maven.apache.org/maven2): No response received after 60000 -> [Help 1]

    and yes...I think that it is a confirmation that Maven can't download spring-jdbc-3.0.2-RELEASE.jar and hibernate-entitymanager-3.3-2ga.jar

    mmm...someone can help me? it is very important for my study solve this problem and run this project

    Thanks and best regards
    Andrea
Working...
X