Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maven 2 support (POMs) [SPR-1484] #6183

Closed
spring-projects-issues opened this issue Nov 19, 2005 · 75 comments
Closed

Maven 2 support (POMs) [SPR-1484] #6183

spring-projects-issues opened this issue Nov 19, 2005 · 75 comments
Labels
has: votes-jira Issues migrated from JIRA with more than 10 votes at the time of import type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Nov 19, 2005

Aleksander Blomskøld opened SPR-1484 and commented

Maven 2 POMs with dependencies is missing for Spring. It's a lot of extra job for maven 2 users to find out which dependencies Spring needs, and to have to include them manually.


Attachments:

Issue Links:

121 votes, 60 watchers

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Nov 20, 2005

Aleksander Blomskøld commented

Doh! Just found that the poms I was looking for were at http://www.ibiblio.org/maven2/org/springframework/ and not http://www.ibiblio.org/maven2/springframework/. Anyway, poms for 1.2.6 seems to be missng..

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Jun 15, 2006

Andreas Schildbach commented

This issue is still present for the 2.0 milestones. Those are also missing the sources (and javadocs).

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Jun 19, 2006

Carlos Sanchez commented

Lastest poms i've working with

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Jun 20, 2006

Wesslan commented

Does someone have POM's for 2.0-RC1 (sp I don't have to make them myself ;) yet?

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Jun 21, 2006

Andreas Schildbach commented

And sources, and javadocs?

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Jun 21, 2006

Wesslan commented

Sources and JavaDocs are included in the "official" (IE not snapshots) releases but maybe you already knew that. :)

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Jun 21, 2006

Andreas Schildbach commented

I'm afraid this is not true. See for example Spring 1.2.8

http://www.ibiblio.org/maven2/org/springframework/spring-beans/1.2.8/

This also only contains the jars.

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Jun 28, 2006

Wesslan commented

You're certainly right Andreas, my mistake.
On the other hand, should releases in Ibiblio (or some other Maven-repo) contain sources and docs? I should vote no to that. :-)
If I want sources and/or docs for a project, I'd go to their site and get it. :-)
Cheers

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Jun 28, 2006

Andreas Schildbach commented

I vote for yes, at least the sources (JavaDocs are debatable, as they can be generated from the sources on the fly).

The reason is that you can do "mvn -DdownloadSources=true eclipse:eclipse" in your project, and the sources of all dependencies (and transitive dependencies) are automatically downloaded and attached to the binary jars. This is extremely convenient and can save hours of work.

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Jun 28, 2006

Arik Kfir commented

Actually they should contain sources+javadocs, as the maven IDE plugins know to fetch them automatically and create the appropriate IDE project files with links to the downloaded sources/javadocs. This is very useful for maven users, as all you need to do is run "mvn idea" and violla! -> you have a working IDEA project file with spring libraries defined, and linked to the spring binaries....

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Jun 28, 2006

Wesslan commented

You convinced me guys. :-)

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Jul 5, 2006

Nicolas Peeters commented

Does anybody know when this is going to be available on ibiblio (or any other mirror)?

Thanks!

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Jul 5, 2006

Colin Sampaleanu commented

I've checked in the last set of POMs from Carlos.

I've done a bit of tweaking to get spring-beans building including tests, but at this point there are still issues as early as spring-aop, since there is a cyclical dependency between aop and context at the test class level.

This will probably only be resolved by moving that code to be tested as part of context. That's not incredibly lean now, but would be even less clean when/if the build is actually properly split up with different projects and source trees.

Colin

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Jul 5, 2006

Carlos Sanchez commented

I worked around that issues excluding them in the module they are and including them in a higher level one.
eg. that aop test can be excluded in spring-aop and included in spring-context

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Jul 6, 2006

Colin Sampaleanu commented

In this case I've talked to Mark F. and he'll just redo that test to not use the context (it can use an XmlBeanFactory). For sure though for some pieces of code it will just be easier to do some tests as part of another module than what they are theoretically in by area of functionality.

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Aug 8, 2006

Matthew T. Adams commented

What's the latest status of this issue? I noticed that as of today, things still aren't quite up to snuff on ibiblio.org -- no POMs for 2.0-rc2, 2.0-rc1, or 2.0-m5. I'm assuming the official groupId is org.springframework now -- is that not correct?

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Aug 8, 2006

Carlos Sanchez commented

right, official groupId is org.springframework

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Aug 15, 2006

Jacob Robertson commented

My team is currently on spring 1.2.5, and we would like to migrate to 1.2.8, but if this issue isn't resolved we may just go up to 1.2.7

P.S has anyone noticed this issue has been spammed by a sex-bot?

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Aug 16, 2006

David J. M. Karlsen commented

Still a problem, even for the 2.x series. Don't think they'll ever fix it - it's been an outstanding issue for quite some time now... :-(

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Aug 16, 2006

Julien Dubois commented

Yes David, one can wonder if this will ever be fixed. I've made some pom.xml at the begining of the 2.x series :

http://jira.codehaus.org/browse/MEV-339

http://jira.codehaus.org/browse/MEV-358

http://jira.codehaus.org/browse/MEV-379

http://jira.codehaus.org/browse/MEV-407

http://jira.codehaus.org/browse/MEV-408

I've been (quite frankly) fed up with this. The easiest way to get Spring working with Maven 2 is to use the "org.springframework:spring" dependency :

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring</artifactId>
<version>2.0-rc2</version>
<scope>compile</scope>
</dependency>

This jars includes all the other Spring jars, excepted the "org.springframework:spring-mock" jar.

You'll get an error telling you the pom.xml is missing, and you (obviously) won't be able to get any transitive dependency. Welcome back to Maven 1 :-)

But it'll work OK!

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Aug 21, 2006

Oliver Siegmar commented

Does this prerelease (spring-maven.tgz) work for rc3? I currently have to use the m4 poms from ibiblio and get more and more problems due to bugs in that version (as well as many others out there, I guess). Couldn't someone put this on ibiblio? An imperfect rc3-version is better than those aged m4 poms!

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Aug 24, 2006

Jared Bunting commented

Is anyone working on poms for 1.2.8? If not, I'm attaching what I managed to put together. I basically used the zip uploaded here for 1.2.7:
http://jira.codehaus.org/browse/MEV-363
which is linked to here:
http://opensource.atlassian.com/projects/spring/browse/SPR-1810

I changed all spring version references from 1.2.7 to 1.2.8. As far as other dependencies, I couldn't find a list of the changes, but I compared the 1.2.7 and 1.2.8 "with-dependencies" packages and the only difference I found was an upgrade to the quartz library from 1.5.1 to 1.5.2.

Carlos, can you upload these to the repository (after any required verification of course.) Also, I'm not sure if maven is still using the subversion repository at https://svn.codehaus.org/maven/repository/org/springframework/ for this, but if so, I'm noticing that 1.2.7 doesn't appear to be there, even though they exist on ibiblio.

Any issues, or questions, etc, let me know.

Thanks,
Jared

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Aug 24, 2006

Jared Bunting commented

Attaching proposed updated poms for 1.2.8.

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Aug 27, 2006

Brian Topping commented

Is it too early to commit to a "fix version" on this issue? It would be wonderful if it were a part of the 2.0 release! But any expectation would be helpful for planning :-)

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Aug 28, 2006

Matthew T. Adams commented

I second the sentiment for this to be part of the 2.0 release. It would be even nicer if the latest 1.2.x release process could also include POMs!

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Aug 30, 2006

Tim Meighen commented

Can someone please comment on when this will be done? We are stuck on 2.0-m5 and want to move to 2.0-rc3 to take advantage of bean scopes. If this isn't going to be fixed soon, I'll have to find some sort of workaround (probably manually install in our local repo). Thanks!

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Sep 1, 2006

Jared Bunting commented

Is there something else that needs to be done to get poms actually uploaded to ibiblio? If there is something else, please let me know, I'll be happy to do it. A quick comment on whether or not these poms will be uploaded, or if there is something I can do to help speed up the process, would be much appreciated.

Thanks.

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Sep 1, 2006

Carlos Sanchez commented

The 1.2.8 poms have been uploaded, will be in ibiblio in some hours. Thanks.

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Sep 1, 2006

Jared Bunting commented

Awesome! Thanks Carlos!

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Sep 1, 2006

Andreas Schildbach commented

What about the sources? 1.2.7 contained sources, 1.2.8 not.

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Oct 4, 2006

Jim Moore commented

Is there some reason the standard "source" plugin wouldn't work?

<plugin>
  <artifactId>maven-source-plugin</artifactId>
  <executions>
    <execution>
      <phase>package</phase>
      <goals>
        <goal>jar</goal>
      </goals>
    </execution>
  </executions>
</plugin>

That way it's also automaticly added to the list of things to deploy when copying out to the server.

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Oct 4, 2006

Johannes Brodwall commented

It would be nice to have the POMs be a little less aggressive with their dependencies. Especially:

Spring-Mock should have optional dependencies on pretty much everything (using it for just AbstractTransactionalSpringContextTests should not require spring-webmvc, which requires struts (!), which requires the world).

Spring-Webmvc should not require Struts (?!)

Spring-Hibernate should use a release version of Hibernate. Or even better: How about a version range?

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Oct 4, 2006

nebhale commented

The reason that the source plugin isn't going to work for us (right now) is that we don't actually build with Maven. We craft these POMs by hand to ensure such high quality. Wait, that last part wasn't quite right. We do create the POMs by hand, and we don't build with Maven directly. That may or may not change in the future, but as of right now we build with ant.

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Oct 4, 2006

nebhale commented

Johannes, you're dead on about the mock jar. It was my mistake with the Spring dependencies. They should have all been optional (I got all the rest of them correct though). I can't remember the details about why the Struts jar was required, but I think I had a reason. We'll try to get that cleaned up for the next release in a couple of weeks as well as the mocks and that'll remove the struts dependency. It didn't seem like many people tested the 2.0-rc4 POMs while they were up, so keep checking and let me know if there are any more issues that come up. Thanks for the input.

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Oct 4, 2006

Matt Raible commented

Ben - first of all, thanks for taking the time to do this. Secondly, can't the spring-mock.pom be fixed for the 2.0 release? There's nothing set in stone that says the POMs can only be uploaded once. They get modified all the time to remove invalid dependencies and such.

Thanks,

Matt

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Oct 4, 2006

Colin Sampaleanu commented

Matt, are you sure? There are lots of broken POMs up there, and stuff like commons-logging 1.1 which has a comment in there saying they know it's broken, but they won't fix it because it might break stuff that depends on it. And I just saw a comment from Carlos saying that stuff only gets put on there once, so it needs to be right the first time...

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Oct 4, 2006

Michael Pilquist commented

Another note about aggressive dependencies -- Jakarta Commons Logging 1.1 has non-optional dependencies on the Avalon Framework, servlet API, logkit, and log4j. There is a JIRA issue for this problem at http://jira.codehaus.org/browse/MEV-392.

In lieu of the JCL POM getting fixed, it may be worth adding exclusions for each of these dependencies to the JCL dependency. Otherwise, Spring users are forced to either add the exclusions to each Spring dependency or depend directly on JCL and add the exclusions to it.

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Oct 4, 2006

Andreas Schildbach commented

Regarding updating POMs: As far as I know, on a non-snapshot dependency, Maven regularly checks for the POM but will never again download the artifact itself (.jar), unless you delete it from the local repo.

Ergo: Feel free to update the POM, but get the JAR right on the first time!

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Oct 4, 2006

Matt Raible commented

Colin - I'm certain. I've submitted many bugs against invalid POMs (http://jira.codehaus.org/browse/MEV) and had them fixed. Andreas is correct though - end users will need to "rm -r ~/.m2/repository/org/springframework/spring-mock/2.0/spring-mock-2.0.pom" in order to get the updated POM.

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Oct 4, 2006

Stephen Duncan Jr commented

Matt: that is no longer the case. Updates to POMs that have made it into the repository are not allowed. See: http://www.nabble.com/Repository-Policy-tf2306302.html

The current policy is that a new version must be made for a new POM.

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Oct 4, 2006

Matt Raible commented

That sucks they changed the policy. I guess I'll go with the following until the next version:

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-mock</artifactId>
<version>${spring.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-jpa</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
</exclusion>
</exclusions>
</dependency>

Too bad it's not possible to do wildcards:

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-mock</artifactId>
    <version>${spring.version}</version>
    <scope>test</scope>
    <exclusions>
        <exclusion>
            <groupId>org.springframework</groupId>
            <artifactId>spring-*</artifactId>
        </exclusion>
    </exclusions>
</dependency>

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Oct 4, 2006

Oliver Siegmar commented

What about making the commons-logging dependency optional? I prefer using slf4j (simple logging facade for java) and its "commons-logging-bridge".

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Oct 4, 2006

Carlos Sanchez commented

No pom updates. You don't republish a jar changing it, right? you don't know how many people already has it or how many mirrors.

re: commons-logging vs. slf4j and related issues, Spring guys are providing the poms they "use" which means they use commons-logging and for they it's not optional. If you want to use another implementation, cool, exclude commons-logging and and yours.
Same for versions of dependencies, if they have tested hibernate x and you want to use hibernate y, just add it to your pom, they are providing you the "official" version they have used to build/test the release.
Don't expect them to provide all possible combinations of dependencies.

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Oct 4, 2006

Sébastien Cesbron commented

I am using spring-remoting to do remoting but to configure it I need DispatcherServlet. This class is in spring-webmvc but spring-remoting does not depends on spring-webmvc. Althought I don't want to depend on spring-webmvc because it also depends on struts that I don't need and I also don't need mvc framework.
Would it be possible to add DispatcherServlet inside spring-web instead of spring-webmvc ?

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Oct 5, 2006

Juergen Hoeller commented

Note that spring-webmvc does not depend on Struts itself; only spring-struts does. spring-webmvc just happens to include Tiles support, which in turn happens to be shipped as part of Struts. spring-webmvc essentially includes Spring's DispatcherServlet plus supporting classes (like for specific view technologies), just like spring-portlet includes Spring's DispatcherPortlet plus supporting classes. As a consequence, spring-webmvc has a lot of optional dependencies, which you can happily ignore unless you want to use the respective third-party technology.

Note that Spring's notion of web MVC is much more general than that of other frameworks. Spring builds on a generic dispatching infrastructure there, with HTML pages essentially being a specific use case only: The infrastructure itself is generic enough to handle for example the generation of binary reports as well as the generation of protocol responses. The latter is what happens in case of HTTP-based remoting: It's simply Spring's dispatching infrastructure used to expose HTTP request handlers that happen to process a specific remoting protocol.

Hence, I would argue that it is perfectly fine if you include spring-webmvc in your application, even if just for handling remoting protocols. Think about it as HTTP request dispatching infrastructure, which you use for processing a specific form of HTTP request. This is an intended use case that comes without any disadvantages, other than having a few further classes on the classpath.

That said, there is actually an alternative in Spring 2.0: You can use Spring's HttpRequestHandlerServlet; check out its javadoc. Since all of Spring's remoting protocol handlers are HttpRequestHandlers, you can simply define them in your main application context and export them through corresponding HttpRequestHandlerServlet definitions (with the servlet-name matching the target bean name) in your web.xml. This is another way of exposing an HTTP request handler, as alternative to using the DispatcherServlet. HttpRequestHandlerServlet is in spring-web, not in spring-webmvc, so has less dependencies.

Juergen

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Oct 8, 2006

Johannes Brodwall commented

Ben, thanks for the responses and for the good work so far. While waiting for official Spring 2.0 source jars, I built my own. I am not certain that they all are correct (I used jar.exe instead of the source-plugin), but if you'd like them as a stop-gap measure, you can get the full set of source jars from my web site at: http://brodwall.com/johannes/dist/maven-src.zip

I think the lesson learned from Matt is that it is better to have too many things be optional (in the beginning) than too few. As a maven user, I accept adding more dependencies much better than having to exclude them.

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Nov 1, 2006

Dave Brondsema commented

The spring-portlet dependency on spring-webmvc should be optional.

Could "subreleases" (or whatever you want to call them) be made that only modify the pom files? E.g. spring-portlet-2.0-r1.pom

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Mar 8, 2007

nebhale commented

POMs and jars uploaded for Spring 1.2.9. Please create new issues for any further POM related issues. Take note that at this time there is no plan to create javadoc and source jars for each spring module. That effort will be worked in the 2.0.x branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has: votes-jira Issues migrated from JIRA with more than 10 votes at the time of import type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant