Velocity
  1. Velocity
  2. VELOCITY-554

Velocity sources and javadocs missing in the maven repository

    Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.5
    • Fix Version/s: 1.7
    • Component/s: Build
    • Labels:
      None

      Description

      It is really annoying when popular projects like Apache Velocity do not provide their sources and javadocs to the Maven repository.

      1. VELOCITY-554_download.patch
        10 kB
        Adrian Tarau
      2. VELOCITY-554-2.patch
        11 kB
        Adrian Tarau
      3. VELOCITY-554-3.patch
        1 kB
        Adrian Tarau

        Issue Links

          Activity

          Hide
          Nathan Bubna added a comment -

          this would technically be a new feature. does anyone have an idea how to do this, keeping in mind that Ant is used for releases?

          Show
          Nathan Bubna added a comment - this would technically be a new feature. does anyone have an idea how to do this, keeping in mind that Ant is used for releases?
          Hide
          Adrian Tarau added a comment -

          We should use Maven for everything else not involving building, testing and releasing (since this is still a concern that Maven is not stable enough to release the project) Velocity : javadoc, sources, site, reports.

          http://velocity.apache.org/engine/devel/ looks like it is generated by Maven it it says "Powered by Velocity", is it Maven or Velocity?

          Show
          Adrian Tarau added a comment - We should use Maven for everything else not involving building, testing and releasing (since this is still a concern that Maven is not stable enough to release the project) Velocity : javadoc, sources, site, reports. http://velocity.apache.org/engine/devel/ looks like it is generated by Maven it it says "Powered by Velocity", is it Maven or Velocity?
          Hide
          Nathan Bubna added a comment -

          Well, that's Henning's concern. Mine is that i can bend Ant to my will with ease. Maven and i haven't gotten along that well historically.

          Anyway, yes, the site is generated by Maven, which uses Velocity to do it. So, it's both. But the site is not distributed in that form. Putting sources and javadocs in the Maven repository is distributing and thus would be part of the release process, which is still Ant-driven. If there are Maven Ant tasks that can do this, that would be best.

          Show
          Nathan Bubna added a comment - Well, that's Henning's concern. Mine is that i can bend Ant to my will with ease. Maven and i haven't gotten along that well historically. Anyway, yes, the site is generated by Maven, which uses Velocity to do it. So, it's both. But the site is not distributed in that form. Putting sources and javadocs in the Maven repository is distributing and thus would be part of the release process, which is still Ant-driven. If there are Maven Ant tasks that can do this, that would be best.
          Hide
          Adrian Tarau added a comment -

          I'll have a look

          Show
          Adrian Tarau added a comment - I'll have a look
          Hide
          Adrian Tarau added a comment -

          Ant 1.7 I presume?

          Show
          Adrian Tarau added a comment - Ant 1.7 I presume?
          Hide
          Nathan Bubna added a comment -

          yes, 1.7 is great.

          Show
          Nathan Bubna added a comment - yes, 1.7 is great.
          Hide
          Adrian Tarau added a comment -

          Nathan,

          Which version do you prefer?

          • deploy maven-ant-tasks-2.0.9.jar in $ {ANT}

            /lib

          • download Maven Ant tasks(during the regular jars download, ~ 1Mbytes)

          I would say the second version, it is more "user friendly". Anyway as soon as I will add xmlns:artifact="antlib:org.apache.maven.artifact.ant" and use the artifact namespace you must have maven-ant-tasks-2.0.9.jar in Ant's classpath otherwise every task which uses that namespace will fail.

          BUILD FAILED
          X:\Work\javaprojects\velocity\engine\trunk\build\build.xml:146: Problem: failed
          to create task or type antlib:org.apache.maven.artifact.ant:dependencies
          Cause: The name is undefined.
          Action: Check the spelling.
          Action: Check that any custom tasks/types have been declared.
          Action: Check that any <presetdef>/<macrodef> declarations have taken place.
          No types or tasks have been defined in this namespace yet

          This appears to be an antlib declaration.
          Action: Check that the implementing library exists in one of:
          -X:\Work\javatools\ant-1.7.1\bin\..\lib
          -C:\Users\ady\.ant\lib
          -a directory added on the command line with the -lib argument

          I presume you don't have access to the file system that represents http://people.apache.org/repo/m2-ibiblio-rsync-repository/ so I will use SCP to deploy the artifacts.

          Show
          Adrian Tarau added a comment - Nathan, Which version do you prefer? deploy maven-ant-tasks-2.0.9.jar in $ {ANT} /lib download Maven Ant tasks(during the regular jars download, ~ 1Mbytes) I would say the second version, it is more "user friendly". Anyway as soon as I will add xmlns:artifact="antlib:org.apache.maven.artifact.ant" and use the artifact namespace you must have maven-ant-tasks-2.0.9.jar in Ant's classpath otherwise every task which uses that namespace will fail. BUILD FAILED X:\Work\javaprojects\velocity\engine\trunk\build\build.xml:146: Problem: failed to create task or type antlib:org.apache.maven.artifact.ant:dependencies Cause: The name is undefined. Action: Check the spelling. Action: Check that any custom tasks/types have been declared. Action: Check that any <presetdef>/<macrodef> declarations have taken place. No types or tasks have been defined in this namespace yet This appears to be an antlib declaration. Action: Check that the implementing library exists in one of: -X:\Work\javatools\ant-1.7.1\bin\..\lib -C:\Users\ady\.ant\lib -a directory added on the command line with the -lib argument I presume you don't have access to the file system that represents http://people.apache.org/repo/m2-ibiblio-rsync-repository/ so I will use SCP to deploy the artifacts.
          Hide
          Adrian Tarau added a comment -

          I've changed download.xml to add support for Maven Ant tasks and I have a few comments:

          1. First of all current download process uses only download.jarname & download.jarversion to build the path in a Maven1 repository. It worked because groupId was the same as artifactId, but it is not right. I've changed, every download task needs groupdId, artifactId and version. Also added m1 in the download task names to differentiate them from the M2 download tasks.
          2. I had do add additional tasks to download jars from Maven 2 repository. I just copied and modified the http-download(now http-m1-download).
          3. Since Ant doesn't have build in something for string manipulation, a hierarchical groupId for M2 must be converted to a path.
          instead of
          <property name="download.groupId" value="org.apache.maven" />
          you must put
          <property name="download.groupId" value="org/apache/maven" />
          If this workaround is fine with you, we can let it like this if not we can use : http://ant-contrib.sourceforge.net/tasks/tasks/propertyregex.html

          Please let me know if the current changes are fine with you.

          Show
          Adrian Tarau added a comment - I've changed download.xml to add support for Maven Ant tasks and I have a few comments: 1. First of all current download process uses only download.jarname & download.jarversion to build the path in a Maven1 repository. It worked because groupId was the same as artifactId, but it is not right. I've changed, every download task needs groupdId, artifactId and version. Also added m1 in the download task names to differentiate them from the M2 download tasks. 2. I had do add additional tasks to download jars from Maven 2 repository. I just copied and modified the http-download(now http-m1-download). 3. Since Ant doesn't have build in something for string manipulation, a hierarchical groupId for M2 must be converted to a path. instead of <property name="download.groupId" value="org.apache.maven" /> you must put <property name="download.groupId" value="org/apache/maven" /> If this workaround is fine with you, we can let it like this if not we can use : http://ant-contrib.sourceforge.net/tasks/tasks/propertyregex.html Please let me know if the current changes are fine with you.
          Hide
          Nathan Bubna added a comment -

          That's a great patch, Adrian. I've committed it.

          Show
          Nathan Bubna added a comment - That's a great patch, Adrian. I've committed it.
          Hide
          Adrian Tarau added a comment -

          Nathan,

          Based on Maven rules, aditional artifacts like sources, javadoc or a jar which includes dependencies must be in format name-version-classifier.extension. where classifier can be any string.

          velocity-dep-1.6-beta2.jar cannot be installed in this format, velocity-1.6-beta2-dep.jar must be used.

          Is this a problem? I don't think there is any escape from this.

          Show
          Adrian Tarau added a comment - Nathan, Based on Maven rules, aditional artifacts like sources, javadoc or a jar which includes dependencies must be in format name-version-classifier.extension. where classifier can be any string. velocity-dep-1.6-beta2.jar cannot be installed in this format, velocity-1.6-beta2-dep.jar must be used. Is this a problem? I don't think there is any escape from this.
          Hide
          Adrian Tarau added a comment -

          Attached is the second patch which should close this issue and VELOCITY-466.

          As I already mentioned, velocity-dep-1.6-beta2.jar is now velocity-1.6-beta2-dep.jar all over the place(I thought is not a good idea to have velocity-1.6-beta2-dep.jar in Maven repositories and velocity-dep-1.6-beta2.jar in Velocity distribution archives).

          Right now there are two tasks maven-install and maven-deploy which depends on release but a different integration can be made, depending on how a release will be performed now.

          Also, digital signatures ca be deployed to, just add(of course files must be signed after release and before deploy) :

          <attach file="$

          {build.dir}

          /$

          {project}

          -$

          {version}

          .jar.asc" type="jar" classifier="jar.asc"/> for every asc file.

          If "maven.remote.repository" property exists a custom repository will be used(and not the one from Maven POM). Repository id is velocity.custom.repository and the following entry must be added in $USER/.m2/settings.xml to provide authentication information for this repository.

          <settings xmlns="http://maven.apache.org/POM/4.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
          http://maven.apache.org/xsd/settings-1.0.0.xsd">
          <servers>

          ...

          <server>
          <id>velocity.custom.repository</id>
          <username>XXXX</username>
          <password>YYYYY</password>
          <privateKey>$

          {user.home}

          /.ssh/id_dsa</privateKey>
          <passphrase>ZZZZZZ</passphrase>
          <filePermissions>664</filePermissions>
          <directoryPermissions>775</directoryPermissions>
          <configuration></configuration>
          </server>

          ....
          </servers>
          </settings>

          You can have a look at velocity-1.6-beta2 artifacts in my repository. Did several tests with my IDE and Maven and all artifacts(jar, source & javadoc) worked as it should.

          Show
          Adrian Tarau added a comment - Attached is the second patch which should close this issue and VELOCITY-466 . As I already mentioned, velocity-dep-1.6-beta2.jar is now velocity-1.6-beta2-dep.jar all over the place(I thought is not a good idea to have velocity-1.6-beta2-dep.jar in Maven repositories and velocity-dep-1.6-beta2.jar in Velocity distribution archives). Right now there are two tasks maven-install and maven-deploy which depends on release but a different integration can be made, depending on how a release will be performed now. Also, digital signatures ca be deployed to, just add(of course files must be signed after release and before deploy) : <attach file="$ {build.dir} /$ {project} -$ {version} .jar.asc" type="jar" classifier="jar.asc"/> for every asc file. If "maven.remote.repository" property exists a custom repository will be used(and not the one from Maven POM). Repository id is velocity.custom.repository and the following entry must be added in $USER/.m2/settings.xml to provide authentication information for this repository. <settings xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd "> <servers> ... <server> <id>velocity.custom.repository</id> <username>XXXX</username> <password>YYYYY</password> <privateKey>$ {user.home} /.ssh/id_dsa</privateKey> <passphrase>ZZZZZZ</passphrase> <filePermissions>664</filePermissions> <directoryPermissions>775</directoryPermissions> <configuration></configuration> </server> .... </servers> </settings> You can have a look at velocity-1.6-beta2 artifacts in my repository. Did several tests with my IDE and Maven and all artifacts(jar, source & javadoc) worked as it should.
          Hide
          Adrian Tarau added a comment -

          ... and the repository : http://repo.adrian.tarau.org

          Show
          Adrian Tarau added a comment - ... and the repository : http://repo.adrian.tarau.org
          Hide
          Nathan Bubna added a comment -

          Thanks, Adrian. This is great. I did tweak a few tiny things and restored the "pom" task, since i'm not ready to wholly rely on the new tasks for the 1.6 release.

          Show
          Nathan Bubna added a comment - Thanks, Adrian. This is great. I did tweak a few tiny things and restored the "pom" task, since i'm not ready to wholly rely on the new tasks for the 1.6 release.
          Hide
          Adrian Tarau added a comment -

          Nathan,

          A few things:

          1. in maven-prepare

          <artifact:install-provider artifactId="wagon-ssh" version="1.0-beta-2"/>

          sould be

          <artifact:install-provider artifactId="wagon-ssh" version="$

          {wagon-ssh.version}"/>

          2. in maven-deploy-apache-repository

          <artifact:install-provider artifactId="wagon-ssh" version="${wagon-ssh.version}

          "/> is not need it since is already called in maven-prepare

          Show
          Adrian Tarau added a comment - Nathan, A few things: 1. in maven-prepare <artifact:install-provider artifactId="wagon-ssh" version="1.0-beta-2"/> sould be <artifact:install-provider artifactId="wagon-ssh" version="$ {wagon-ssh.version}"/> 2. in maven-deploy-apache-repository <artifact:install-provider artifactId="wagon-ssh" version="${wagon-ssh.version} "/> is not need it since is already called in maven-prepare
          Hide
          Nathan Bubna added a comment -

          Ah, thanks! I just missed the wagon-ssh version in maven-prepare. The one in maven-deploy-apache-repository was put there by the patch you sent. I'll remove it.

          Show
          Nathan Bubna added a comment - Ah, thanks! I just missed the wagon-ssh version in maven-prepare. The one in maven-deploy-apache-repository was put there by the patch you sent. I'll remove it.
          Hide
          Adrian Tarau added a comment -

          Yes, I forgot to remove it after splitting maven-deploy in two targets.

          Show
          Adrian Tarau added a comment - Yes, I forgot to remove it after splitting maven-deploy in two targets.
          Hide
          Henning Schmiedehausen added a comment -

          So now we have -m1-downloads and -m2-downloads, but this is actually not what I meant. I meant bundling the maven-wagon tasks with Velocity to use them to download the jars (and use things like mirrors etc.)

          Show
          Henning Schmiedehausen added a comment - So now we have -m1-downloads and -m2-downloads, but this is actually not what I meant. I meant bundling the maven-wagon tasks with Velocity to use them to download the jars (and use things like mirrors etc.)
          Hide
          Adrian Tarau added a comment - - edited

          I just noticed a small problem with 1.6.X release. If you are looking at http://repo2.maven.org/maven2/org/apache/velocity/velocity/1.6.1/ Velocity sources jar is with "src" and not with "sources". I just made a quick test (ant clean maven-deploy-custom-repository) with my repository and everything looks fine(http://repo.adrian.tarau.org/org/apache/velocity/velocity/1.7-dev), jars, javadocs and sources were deployed without problems.

          Did you copy manually all artifacts(files) or did you used "maven-deploy-custom-repository" or "maven-deploy-apache-repository"? I cannot test "maven-deploy-apache-repository" (since I do not have access to this repository) but except forcing a new repository location (with <remoteRepository id="velocity.custom.repository" url="$

          {maven.remote.repository}

          "/> ) "maven-deploy-custom-repository" is the same as "maven-deploy-apache-repository".

          Show
          Adrian Tarau added a comment - - edited I just noticed a small problem with 1.6.X release. If you are looking at http://repo2.maven.org/maven2/org/apache/velocity/velocity/1.6.1/ Velocity sources jar is with "src" and not with "sources". I just made a quick test (ant clean maven-deploy-custom-repository) with my repository and everything looks fine( http://repo.adrian.tarau.org/org/apache/velocity/velocity/1.7-dev ), jars, javadocs and sources were deployed without problems. Did you copy manually all artifacts(files) or did you used "maven-deploy-custom-repository" or "maven-deploy-apache-repository"? I cannot test "maven-deploy-apache-repository" (since I do not have access to this repository) but except forcing a new repository location (with <remoteRepository id="velocity.custom.repository" url="$ {maven.remote.repository} "/> ) "maven-deploy-custom-repository" is the same as "maven-deploy-apache-repository".
          Hide
          Adrian Tarau added a comment - - edited

          Some maven related tasks didn't have depends="maven-prepare,release"

          Show
          Adrian Tarau added a comment - - edited Some maven related tasks didn't have depends="maven-prepare,release"
          Hide
          Nathan Bubna added a comment -

          Our current build/release instructions are for manual copying, so that's what i did for 1.6.1. Wouldn't it work to just have ant name the file "sources" instead of "src"?

          Show
          Nathan Bubna added a comment - Our current build/release instructions are for manual copying, so that's what i did for 1.6.1. Wouldn't it work to just have ant name the file "sources" instead of "src"?
          Hide
          Adrian Tarau added a comment -

          It would, but I didn't want to change that. Or we could just create a task which will copy all the maven artifacts in a separate folder(with one change : src->sources).

          Show
          Adrian Tarau added a comment - It would, but I didn't want to change that. Or we could just create a task which will copy all the maven artifacts in a separate folder(with one change : src->sources).
          Hide
          Nathan Bubna added a comment -

          Ok, i changed the jar name. I didn't make the specific maven deploy tasks depend on release, since release is a heavy target and would generally have already be run. Also, the generic maven-deploy task depends on it already.

          Show
          Nathan Bubna added a comment - Ok, i changed the jar name. I didn't make the specific maven deploy tasks depend on release, since release is a heavy target and would generally have already be run. Also, the generic maven-deploy task depends on it already.
          Hide
          Adrian Tarau added a comment -

          Velocity sources in main Maven repository(http://repo1.maven.org/maven2/org/apache/velocity/velocity/1.6.2/) are still with src instead of sources.

          velocity-1.6.2-src.jar 18-Mar-2009 21:07 493620
          velocity-1.6.2-src.jar.asc 18-Mar-2009 21:07 197
          velocity-1.6.2-src.jar.md5 18-Mar-2009 21:07 56
          velocity-1.6.2-src.jar.sha1

          Show
          Adrian Tarau added a comment - Velocity sources in main Maven repository( http://repo1.maven.org/maven2/org/apache/velocity/velocity/1.6.2/ ) are still with src instead of sources. velocity-1.6.2-src.jar 18-Mar-2009 21:07 493620 velocity-1.6.2-src.jar.asc 18-Mar-2009 21:07 197 velocity-1.6.2-src.jar.md5 18-Mar-2009 21:07 56 velocity-1.6.2-src.jar.sha1
          Hide
          Nathan Bubna added a comment -

          Appears fixed in 1.6.x, 1.7 and 2.x

          Show
          Nathan Bubna added a comment - Appears fixed in 1.6.x, 1.7 and 2.x

            People

            • Assignee:
              Nathan Bubna
              Reporter:
              Aliaksandr Radzivanovich
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development