Results 1 to 4 of 4

Thread: Troubleshooting (maven) repositories.

  1. #1
    Join Date
    May 2007
    Location
    Brisbane, Australia
    Posts
    97

    Default Troubleshooting (maven) repositories.

    I'm having a little trouble understanding how DM server looks for artefacts in repositories.

    Now, first, the problem:

    I deploy a bundle, I get this error:
    Code:
    [2009-07-27 09:59:14.182] http-8080-2              <SPDE0018E> Unable to install application from location 'file:/Users/haikal/Applications/springsource-dm-server-2.0.0.M3/work/com.springsource.kernel/upload/icalproxy-api-0.1.1-SNAPSHOT.jar'. Could not satisfy constraints for bundle 'icalproxy.api' at version '0.1.1.SNAPSHOT'. Cannot resolve: au.edu.qut.qutvirtual.icalproxy.api
        Resolver report:
            Missing constraint: <Import-Package: javax.validation.constraints; version="1.0.0"> in bundle <icalproxy.api_0.1.1.SNAPSHOT>
    Okay, fine, I think. I'll just point DM Server towards my maven repo, which contains the /com.springsource.javax.validation-1.0.0.CR1.jar.

    So I add this repo to my config/repository.properties:
    Code:
    maven-repository.type=external
    maven-repository.searchPattern="${user.home}/.m2/repository/**"
    and add it to the chain, and restart dm server with -clean.

    Still get the same error when I try to redeploy my bundle.

    I manually deploy that validation jar from the web console, and then deploy my bundle, and it works.

    Any idea why DM Server is not picking up the dependency from my m2 repo?

  2. #2
    Join Date
    May 2007
    Location
    Brisbane, Australia
    Posts
    97

    Default

    Possibly a regression (I am on a mac...) of https://issuetracker.springsource.com/browse/DMS-963. I'll try installing greenpages and see what happens..

  3. #3
    Join Date
    Oct 2008
    Posts
    493

    Default

    DMS-963 fixed a problem where a path like repository/**/*.jar would work fine, whereas a path like repository/**/* would not.

    In your configuration, you have the pattern specified as:

    Code:
    maven-repository.searchPattern="${user.home}/.m2/repository/**"
    The intention is to honour Ant's pattern semantics. I've just read http://ant.apache.org/manual/dirtasks.html and it states that "For example: /test/** matches all files/directories under /test/, such as /test/x.java, or /test/foo/bar/xyz.html, but not /xyz.xml.". In short, your configuration should work, although it will mean the dm Server looks at every file in your Maven repository, which will be rather inefficient.

    Can you please try with the pattern configured as:

    Code:
    maven-repository.searchPattern="${user.home}/.m2/repository/**/*"
    or

    Code:
    maven-repository.searchPattern="${user.home}/.m2/repository/**/*.jar"
    I believe that this should give you the behaviour that you're looking for and, in the case of the latter pattern, will do so without having to look at every file within your repository.

    I've opened DMS-1245 to bring the repository's behaviour into line with Ant's.
    Andy Wilkinson
    SpringSource

  4. #4
    Join Date
    May 2007
    Location
    Brisbane, Australia
    Posts
    97

    Default

    Yup, the latter way does seem to do the trick, thanks.

    This brings up another issue, though: Pointing a whole repo (Mine's fresh, and only about 60Megs atm) seems to ballon the server start up time.

    It seems that a loopback'ed hosted repositories are the way to go if you want to make your m2 repo available to deployed artefacts. Maybe this would worth spelling out in bigger letters in the manual?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •