6 Replies Latest reply on Feb 28, 2008 4:07 PM by pgier

    source in localRepository

    starksm64

      One box where I don't have the jboss maven2 repo checked out into the settings.xml localRepository location, does not have any source artifacts. How do I get these included when maven pulls down content?

        • 1. Re: source in localRepository
          pgier

          The eclipse IDE plugin (http://m2eclipse.codehaus.org/) has an option to automatically download the sources for project dependencies.
          Or if you want to do it from the command line, you can use the dependency plugin

          mvn dependency:sources



          • 2. Re: source in localRepository
            wolfc

            Shouldn't maven do this by default when dependencies are resolved?

            Now I end up with:

            -rw-r--r-- 1 carlo carlo 326543 Oct 12 19:06 jbossxb-2.0.0-SNAPSHOT-sources.jar
            -rw-r--r-- 1 carlo carlo 439274 Oct 22 09:21 jbossxb-2.0.0-SNAPSHOT.jar

            Which are out of sync.

            • 3. Re: source in localRepository
              pgier

              The different timestamps are just when they were created locally, so I don't think they are out of sync as far as content. If you want to make the timestamps match, you could first do

              mvn dependency:purge-local-repository

              That should clear out your project dependencies from the local repo, and then you can download them again with the correct timestamps.

              I'm not sure why maven doesn't download sources by default when they are available. Maybe because it would slow down the initial build a little bit if you just want to build and don't care about the sources.


              • 4. Re: source in localRepository
                wolfc

                I know they're out of sync, because a new snapshot was uploaded. :-)
                The timestamps are just another indicator.

                I vote for enabling download of source by default in parent pom.

                • 5. Re: source in localRepository
                  starksm64

                  Can I enable this by default in my local settings.xml?

                  • 6. Re: source in localRepository
                    pgier

                    There isn't any way to do it from settings.xml. You can use

                    mvn dependency:sources

                    Other than that I think you would have to modify the pom to have it done automatically.