Tutorial‎ > ‎Tutorials‎ > ‎

Building Logic Tutorial - Spring Data Log

Objectives

  1. Run existing samples
  2. Under STS (as opposed to http://blog.springsource.org/2011/02/10/getting-started-with-spring-data-jpa/)
STS (Version: 2.9.1.RELEASE - Build Id: 201203221000) is configured as follows:


Install Spring Data

Downloaded 1.0.2
No - examples are 1.0.3
But there is no installer for that - loaded them 1x1 from ??

Download Samples

Found blog: http://blog.springsource.org/2011/02/10/getting-started-with-spring-data-jpa/

Found examples: https://github.com/SpringSource/spring-data-jpa-examples



Maven fails

Attempt to Import Existing Maven Project > Spring Data Examples), fails ("no marketplace entries found to handle maven-apt-plugin"):



Try to proceed and resolve later results in this:


The details of the selected line:

Failure to transfer org.apache.maven.plugins:maven-jar-plugin:pom:2.3.1 from http://repo.springsource.org/plugins-release was cached in the local repository, resolution will not be reattempted until the update interval of repository.plugin.springsource.release has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.plugins:maven-jar-plugin:pom:2.3.1 from/to repository.plugin.springsource.release (http://repo.springsource.org/plugins-release): Access denied to http://repo.springsource.org/plugins-release/org/apache/maven/plugins/maven-jar-plugin/2.3.1/maven-jar-plugin-2.3.1.pom. Error code 401, Unauthorized

Not resolved by Peter's post (#34) at http://stackoverflow.com/questions/7160006/m2e-and-having-maven-generated-source-folders-as-eclipse-source-folders (Problems view > Quick Fix > Update Project Configuration)

First try

Google => need Maven helper http://code.google.com/p/google-web-toolkit/wiki/WorkingWithMaven#POM_changes_needed_for_Eclipse_Indigo

  But indigo version fails - 
  
  So find from http://download.jboss.org/jbosstools/updates/indigo

Which failed with
Cannot complete the install because one or more required items could not be found.
  Software being installed: m2e connector for build-helper-maven-plugin 0.15.0.201109290002 (org.sonatype.m2e.buildhelper.feature.feature.group 0.15.0.201109290002)
  Missing requirement: m2e connector for build-helper-maven-plugin 0.15.0.201109290002 (org.sonatype.m2e.buildhelper 0.15.0.201109290002) requires 'bundle org.eclipse.m2e.jdt [1.1.0,1.2.0)' but it could not be found
  Cannot satisfy dependency:
    From: m2e connector for build-helper-maven-plugin 0.15.0.201109290002 (org.sonatype.m2e.buildhelper.feature.feature.group 0.15.0.201109290002)
    To: org.sonatype.m2e.buildhelper [0.15.0.201109290002]

Then, per ??, install extension from m2eclipse-wtp updates - http://download.jboss.org/jbosstools/updates/m2eclipse-wtp/ and you get:

Your original request has been modified.
  "m2e connector for build-helper-maven-plugin" is already installed, so an update will be performed instead.
  "m2e connector for mavenarchiver pom properties" will be ignored because it is already installed.
Cannot complete the install because one or more required items could not be found.
  Software being installed: m2e connector for build-helper-maven-plugin 0.15.0.201109290002 (org.sonatype.m2e.buildhelper.feature.feature.group 0.15.0.201109290002)
  Missing requirement: m2e connector for build-helper-maven-plugin 0.15.0.201109290002 (org.sonatype.m2e.buildhelper 0.15.0.201109290002) requires 'bundle org.eclipse.m2e.jdt [1.1.0,1.2.0)' but it could not be found
  Cannot satisfy dependency:
    From: m2e connector for build-helper-maven-plugin 0.15.0.201109290002 (org.sonatype.m2e.buildhelper.feature.feature.group 0.15.0.201109290002)
    To: org.sonatype.m2e.buildhelper [0.15.0.201109290002]

Second try

Referring to http://stackoverflow.com/questions/6352208/how-to-solve-plugin-execution-not-covered-by-lifecycle-configuration-for-sprin

See no hope there.


Third Try

Tried search for apt from Indigo - got a bunch of OSI stuff, tried it, ... same "no apt" error trying to import the sample.  How do people get this to work!

Fourth try

Referring to https://github.com/ilx/m2e-querydsl/issues/1, download and install https://github.com/ilx/m2e-querydsl/downloads - no software found.


That's because the most obvious link was the source - you really want to download the installable site: https://github.com/downloads/ilx/m2e-querydsl/org.maven.ide.querydsl.feature-0.0.2-site.zip

At this point, the samples import (!), but fail to compile as shown below:


The details of the selected error are:

Failure to transfer org.apache.maven.plugins:maven-jar-plugin:pom:2.3.1 from http://repo.springsource.org/plugins-release was cached in the local repository, resolution will not be reattempted until the update interval of repository.plugin.springsource.release has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.plugins:maven-jar-plugin:pom:2.3.1 from/to repository.plugin.springsource.release (http://repo.springsource.org/plugins-release): Access denied to http://repo.springsource.org/plugins-release/org/apache/maven/plugins/maven-jar-plugin/2.3.1/maven-jar-plugin-2.3.1.pom. Error code 401, Unauthorized

Fifth Try - solved

My goodness.  Following https://jira.springsource.org/browse/ROO-3104, the magic incantation is to add this to the parent project pom:

<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.1</version>
</dependency>

This took over a day to track down.

Revert to bare projects - v 1.3

Sadly, need to get on with things.  Of course, these are not STS projects... sigh.

Compile errors using spring-data-commons-core-1.3.0.RELEASE:



Revert to Bare Project - v 1.2


Get this:



Revert to Bare Project - v1.2 with older sample for github tag

Get this:


Manually add required jars - Basic Sample works

Realized that Spring Data is >1 jar, so acquire all jar dependencies manually (guessing at versions):



BasicFactorySetup - Type Resolver Error


Google search reveals http://forum.springsource.org/showthread.php?120969-Spring-Data-JPA-Error

But the 1.0 fails due to dependencies I cannot figure out:

The type org.springframework.data.repository.core.support.RepositoryFactorySupport cannot be resolved. It is indirectly referenced from required .class files


So, stuck here: don't know how to resolve maven / STS issues, and don't know how to determine jar version dependencies.


Comments