Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: Access to m4 snapshot via maven?

  1. #1
    Join Date
    Oct 2008
    Posts
    5

    Default Access to m4 snapshot via maven?

    Hi,

    is there a way to access the m4 snapshot via maven? I've tried various combinations such as 1.0.0.m4-SNAPSHOT, 1.0.0-SNAPSHOT, 1.0-SNAPSHOT and the like in my pom.xml with no success. 1.0.0.m3 works fine (as far as maven's concerned in any case).

    I have added the Spring S3 maven repository to the list.

    Thanks,

    M.

  2. #2
    Join Date
    Apr 2007
    Posts
    307

    Default

    Hi M.,

    This is documented http://springframework.org/javaconfig, specifically http://springframework.org/node/740.

    The snapshot version is actually labeled 1.0.0.BUILD-SNAPSHOT. That will probably resolve your issue.
    Chris Beams
    Spring Framework committer, VMware
    http://github.com/cbeams

  3. #3
    Join Date
    Oct 2008
    Posts
    5

    Default

    Hi,

    thank you for your reply. I don't know how I managed to miss that given that I was looking at that very page to configure m3.

    Thanks again.

  4. #4

    Default

    Chris, this used to work for m3 but with m4 the artifactIds have changed and now projects that refer to the non-namespaced spring dependencies break all over the place. Apparently this is because the pom is autogenerated by ivy and uses the OSGi bundle names as artifactIds, not the logical name. Is this a bug in the pom generation or intentional? This split between namespaced and non-namespaced artifacts makes them effectively useless for maven.

    Thanks for any insights.
    -h

  5. #5
    Join Date
    Apr 2007
    Posts
    307

    Default

    Holger,

    Just so we're on the same page, are you using the very latest instructions for Maven, per the M4 documentation?

    http://static.springframework.org/sp...ne-build-maven

    If so, and you're still experiencing the problem, please spell out your scenario in a bit more depth and I'll look into it. Ideally, if you can provide a simple Maven project that demonstrates the problem, I'll be able to address it very quickly. Feel free to create a new JIRA issue and attach such a project.
    Chris Beams
    Spring Framework committer, VMware
    http://github.com/cbeams

  6. #6

    Default

    Thanks for the reply -

    Quote Originally Posted by Chris Beams View Post
    Holger,
    Just so we're on the same page, are you using the very latest instructions for Maven, per the M4 documentation?
    Yes, precisely. Tried to update from m3 to m4, had to add the new repositories etc. to my pom and then noticed that it also tried to get the namespaced dependencies of spring-beans/core/etc. even though I already had them defined in the pom, but by the traditional artifactId.

    You can simply look at the deployed M4 pom and see in its dependencies that it refers to e.g. org.springframework.beans, not spring-beans. Essentially this creates a new hierarchy and leads to all sorts of inconsistencies with transitive dependencies, since maven matches by groupId/artifactId.

    If all Spring dependencies are now supposed to be in the namespaced form (to accommodate the SS OSGi repo), then it might be best not to publish the non-namespaced version at all or only redirections (sort of like http redirect but for pom artifacts). This would need to be done across the entire Spring ecosystem, not just javaconfig - and it would affect every other project that uses Spring, including customers. For obvious reasons the existing groupId/artifactId names would cause the least chaos.

    I hope that explained the problem better.

    thanks!
    Holger

  7. #7
    Join Date
    Oct 2008
    Posts
    5

    Default

    I can confirm that this issue does indeed exist. Basically, all the spring jars (those that are also used by javaconfig) are duplicated, appearing once as i.e. spring-core-2.5.6 and a second time as org.springframework.core-2.5.6.

    The problem occurs if you declare spring as a dependency in pom using the traditional group id of org.springframework and articact id of spring-core, and then also include javaconfig (either M4 or BUILD_SNAPSHOT) as described in the documentation, which then as its own dependency pulls in the org.springframework.core-2.5.6 etc. stuff, essentially duplicating them.

  8. #8
    Join Date
    Apr 2007
    Posts
    307

    Default

    Wherever possible, the best plan is to always fetch dependencies out of the SpringSource repository. artifactIds, etc are always internally consistent within. I realize this can be a bit of a pain at first. I've directed our build team to take a look at this thread and add any additional comments.

    Can this issue be solved for both of you by updating your poms to retrieve everything from our repository? If so, is that an acceptable solution? If not, please detail why (either way it's useful feedback for us).

    Thanks,

    - C
    Chris Beams
    Spring Framework committer, VMware
    http://github.com/cbeams

  9. #9
    Join Date
    Oct 2008
    Posts
    5

    Default

    I guess reconfiguring my poms to use the Spring Enterprise Repositories and their naming scheme did work for me, though it took me several hours to figure out what I should use as the new artifact and group ids (it doesn't seem the mapping from the old to the new naming system is one-to-one in all cases, or even consistent. For example, what used to be spring-webmvc is now split up into org.springframework.web and org.springframework.web.servlet at the least).

    I suspect this is exactly what some people might be trying to avoid and why this duplication thing might be a problem for them.

    Other than that, looks like javaconfig m4 is working great. I just dropped my last bootstrap xml config file in favor of the @AnnotationDrivenConfig and @ComponentScan annotations. Great work guys!

  10. #10
    Join Date
    Apr 2007
    Posts
    307

    Default

    Glad to hear you're liking what you see in M4.

    Regarding the time it took to figure out the artifactIds - were you using http://springsource.com/repository to search for them?
    Chris Beams
    Spring Framework committer, VMware
    http://github.com/cbeams

Tags for this Thread

Posting Permissions

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