Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aether-users] Aether ant tasks status

Hello Benjamin,

thank you for taking the time to answer my questions and clarifying a few stuffs.

So I checked out maven and its modules from the ASF git repo. I eventually was able to build the 3.1-SNAPSHOT and install it locally.

In the Aether Ant Task project, I only changed the properties of the pom.xml to switch them to:
    <mavenVersion>3.1-SNAPSHOT</mavenVersion>
    <aetherVersion>0.9.0.M2</aetherVersion>

Afterwards, I just had to performmvn clean package on the project and I got a packaged jar (aether-ant-tasks-0.9.0-SNAPSHOT-uber.jar). I eventually made a simple test on a dummy ant project to resolve my problematic dependencies and indeed everything worked out smoothly (I only had to make a few changes to the previous m-a-t dependencies task because a-a-t has a slightly different syntax and way of working, but it was a no-brainer).

So now, if I want, I could deploy the jar file to our repository (and then use it my Maven build) but I am bit reluctant to do that because I feel this is a bit clumsy. I don't really like to rely on unpublished (and untagged, so therefore, something pretty much untraceable) jar's (both Maven 3.1-SNAPSHOT and Aether Ant Tasks 0.9.0-SNAPSHOT). Would any incident happen with that jar, I pretty much expect that no one would want/be able to help me out.

As an alternative, and for now I believe it is the cleanest approach I can get, I switched my m-a-t dependencies task to the m-a-t mvn task and a generated (ont-the-fly) pom.xml file with a configuration of the dependency plugin. Using the Maven3 installation for the mavenhome, I get the exact same result as with the aether ant task, but to my opinon it is much cleaner than using snapshot jars.

Ant code was

<artifact:dependencies filesetId="maven.artifact" addArtifactFileSetRefs="true"> <localrepository id="local" path="${settings.localRepository}"/> <dependency groupId="${maven.group.id}" artifactId="${maven.artifact.id}" version="${project.version}" type="${maven.type}" classifier="${maven.classifier}" />
        </artifact:dependencies>
        <copy todir="${artifact.dir}">
<fileset refid="${maven.group.id}:${maven.artifact.id}:${maven.type}:${maven.classifier}" />
            <mapper type="flatten" />
        </copy>
<unzip src="${artifact.dir}/${maven.artifact.name}" dest="${dist.dir}" />

which became:

<copy file="pom.xml.tpl" tofile="${flexobuild.work.dir}/pom.xml" filtering="true" overwrite="true">
            <filterset>
                <filtersfile file="${build.properties}" />
            </filterset>
        </copy>
<artifact:mvn mavenhome="${maven.home}" pom="${flexobuild.work.dir}/pom.xml"> <localrepository id="local" path="${settings.localRepository}"/>
            <arg value="-B"/>
            <arg value="dependency:unpack"/>
        </artifact:mvn>
and the pom.xml template file:

<project>
  <modelVersion>4.0.0</modelVersion>
  <groupId>dummy</groupId>
<artifactId>dummy-@xxxxxxxxxxxxxxxxx@</artifactId>
  <version>@project.version@</version>
  <build>
    <plugins>
      <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
        <version>2.7</version>
        <configuration>
        <artifactItems>
            <artifactItem>
<groupId>@maven.group.id@</groupId>
<artifactId>@maven.artifact.id@</artifactId>
<version>@project.version@</version>
<classifier>@maven.classifier@</classifier>
              <type>@maven.type@</type>
              <overWrite>true</overWrite>
            </artifactItem>
          </artifactItems>
<outputDirectory>@dist.dir@</outputDirectory>
<overWriteReleases>true</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>

(the build properties file is generated with<echoproperties destfile="${build.properties}" />)

So, for now, I will continue to use m-a-t, but eventually we will switch to a-a-t whenever it gets published.

I don't think I can be of much help here (unless you tell me otherwise). Thanks for all the feedback.

Cheers,

Guillaume

Le 18/03/2013 22:49, Benjamin Bentmann a écrit :
Guillaume Polet wrote:

(I understood that m-a-t and Aether Ant Tasks do not use the
same artifact resolution mechanisms and Aether is the one used by
Maven3, let me know is my assumptions are incorrect).

Your understanding is correct.

Anyway, I would have liked to know what is the current status of the
Aether Ant Tasks since I don't see much activity on the project and I am
currently unable to find any published version of a binary version of
those (a jar file). Is this foreseen in the future?

The Aether Ant Tasks depend on the maven-aether-provider from the Apache Maven project to work with Maven repositories. There is no release of this component yet which builds upon Eclipse Aether and can be employed for the Aether Ant Tasks. That said, the relevant changes have recently been pushed to a branch [0] from which you could build the missing component yourself.

Should I still
consider using Aether Ant Tasks or will the m-a-t eventually switch to
aether for artifact resolution mechanisms?

For the future of the Maven Ant Tasks, you should really reach out to the Maven mailing lists. http://jira.codehaus.org/browse/MANTTASKS-232 is probably the issue you want to reference.

If needed, I can fork Aether Ant Task (for the time being) and publish
it to our own repository (or can I make it to central directly?). I can
spend a few hours on this but I can't commit to regular work on the
project.

Once you have a local build of the maven-aether-provider from the branch I mentioned above, I think there were only a couple lines in the aether-ant codebase that needed adjustment to account for some refactoring. Last I remember, the existing code worked fine, so I think it shouldn't take you more than an hour to assemble the tasks locally and try them.

I can give a helping hand if you run into issues though I likely have to postpone more involved work to the weekends.


Benjamin


[0] https://git-wip-us.apache.org/repos/asf?p=maven.git;a=shortlog;h=refs/heads/eclipse-aether
_______________________________________________
aether-users mailing list
aether-users@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/aether-users



Back to the top