Felix
  1. Felix
  2. FELIX-247

Add ant goal to maven-bundle-plugin which creates a build.xml and MANIFEST.MF with bundle headers

    Details

      Description

      Modify maven-bundle-plugin so that runing

      mvn org.apache.felix:maven-bundle-plugin:ant

      creates the build.xml and MANIFEST.MF files for the current source code. This allows a working bundle to be created from a source distribution using ant (without using maven).

      The goal of this issue is not to allow development using ant but to provide a way of distributing source code that uses ant to build a working bundle. Any changes to the source code that affect the bundle headers would not be updated in the manifest, since the manifest file is created at the same time as the build file and is not changed by any ant task.

        Activity

        Hide
        Stuart McCulloch added a comment -

        Fix has now been released in the 1.4.0 bundleplugin, so closing this issue.

        Show
        Stuart McCulloch added a comment - Fix has now been released in the 1.4.0 bundleplugin, so closing this issue.
        Hide
        Stuart McCulloch added a comment -

        It's been a while, but you can now create a custom Ant build script that will rebuild the bundle using:

        mvn ant:ant bundle:ant

        ant clean package

        because this uses BND to rebuild the bundle, changes to the source code will now affect the manifest.

        To try it out, use the latest 1.3.0-SNAPSHOT (build-stamp 1.3.0-20080219.095008-3)

        Show
        Stuart McCulloch added a comment - It's been a while, but you can now create a custom Ant build script that will rebuild the bundle using: mvn ant:ant bundle:ant ant clean package because this uses BND to rebuild the bundle, changes to the source code will now affect the manifest. To try it out, use the latest 1.3.0-SNAPSHOT (build-stamp 1.3.0-20080219.095008-3)
        Hide
        Stuart McCulloch added a comment -

        Target after the 1.1.0 release of the bundleplugin.

        Show
        Stuart McCulloch added a comment - Target after the 1.1.0 release of the bundleplugin.
        Hide
        Stuart McCulloch added a comment -

        Revisiting this issue, should the bundleplugin change the ant build script to add a static manifest or should it change the packaging target to use the BND ant task, with instructions collected from the maven project and saved to a local file?

        Show
        Stuart McCulloch added a comment - Revisiting this issue, should the bundleplugin change the ant build script to add a static manifest or should it change the packaging target to use the BND ant task, with instructions collected from the maven project and saved to a local file?
        Hide
        Stuart McCulloch added a comment -

        also the bundle goal now writes the manifest to a customizable location (manifestLocation) like the manifest goal - see FELIX-376

        Show
        Stuart McCulloch added a comment - also the bundle goal now writes the manifest to a customizable location (manifestLocation) like the manifest goal - see FELIX-376
        Hide
        Stuart McCulloch added a comment -

        FYI, the new ant plugin was finally released a week ago and is now available on the central repo

        Show
        Stuart McCulloch added a comment - FYI, the new ant plugin was finally released a week ago and is now available on the central repo
        Hide
        Carlos Sanchez added a comment -
        Show
        Carlos Sanchez added a comment - the release of the ant plugin is being voted http://www.nabble.com/-VOTE--Release-maven-ant-plugin-2.0-tf3576676s177.html
        Hide
        Tim Moloney added a comment -

        Okay, I understand the confusion.

        The patch is a slightly modified copy of the currently released ant file. I did this since it is more self-contained and convenient. People who want to use this patch can just apply it to Felix rather than having to download and build the latest version of the ant plugin. Hopefully, the next release version of the ant plugin will allow us to set a property so we don't have to do this ugly kludge.

        As was stated in the email thread, I'm not in a hurry. This issue can be left open until we can implement it properly with the (hopefully) next release of the ant plugin. I'm perfectly okay with that.

        Show
        Tim Moloney added a comment - Okay, I understand the confusion. The patch is a slightly modified copy of the currently released ant file. I did this since it is more self-contained and convenient. People who want to use this patch can just apply it to Felix rather than having to download and build the latest version of the ant plugin. Hopefully, the next release version of the ant plugin will allow us to set a property so we don't have to do this ugly kludge. As was stated in the email thread, I'm not in a hurry. This issue can be left open until we can implement it properly with the (hopefully) next release of the ant plugin. I'm perfectly okay with that.
        Hide
        Carlos Sanchez added a comment -

        ok, i got it. I was confused by the patch that seems to be copied from an old version of the plugin and all the static methods that prevent extension

        Show
        Carlos Sanchez added a comment - ok, i got it. I was confused by the patch that seems to be copied from an old version of the plugin and all the static methods that prevent extension
        Hide
        Tim Moloney added a comment -

        I made the assumption that what was in the trunk of the ant plugin repository would be in the next release of the ant plugin.

        Perhaps I'm misunderstanding the code but line 564 of http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ant-plugin/src/main/java/org/apache/maven/plugin/ant/AntBuildWriterUtil.java appears to allow customizing the manifest attribute in the jar task.

        Show
        Tim Moloney added a comment - I made the assumption that what was in the trunk of the ant plugin repository would be in the next release of the ant plugin. Perhaps I'm misunderstanding the code but line 564 of http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-ant-plugin/src/main/java/org/apache/maven/plugin/ant/AntBuildWriterUtil.java appears to allow customizing the manifest attribute in the jar task.
        Show
        Carlos Sanchez added a comment - http://jira.codehaus.org/browse/MANT-29
        Hide
        Carlos Sanchez added a comment -

        I'm looking at the ant plugin sources and i don't see anything that indicates it's going to be fixed in next releases, and I haven't found any jira in http://jira.codehaus.org/browse/MANT

        If you can provide a patch against the current sources we can make a release really soon, for what I see it'll require refactoring to remove too many static methods

        Show
        Carlos Sanchez added a comment - I'm looking at the ant plugin sources and i don't see anything that indicates it's going to be fixed in next releases, and I haven't found any jira in http://jira.codehaus.org/browse/MANT If you can provide a patch against the current sources we can make a release really soon, for what I see it'll require refactoring to remove too many static methods
        Show
        Tim Moloney added a comment - Yes, but ... http://www.mail-archive.com/felix-dev@incubator.apache.org/msg04672.html
        Hide
        Carlos Sanchez added a comment -

        this sounds like repeating a lot of what the Ant plugin already does
        http://maven.apache.org/plugins/maven-ant-plugin/

        Show
        Carlos Sanchez added a comment - this sounds like repeating a lot of what the Ant plugin already does http://maven.apache.org/plugins/maven-ant-plugin/
        Hide
        Tim Moloney added a comment -

        One change required to build.xml is to point the maven.repo.local property at a directory that has all the dependency jars. Simply change the value attribute in the following line to the name of the appropriate directory.

        <property name="maven.repo.local" value="$

        {user.home}

        /.m2/repository"/>

        Show
        Tim Moloney added a comment - One change required to build.xml is to point the maven.repo.local property at a directory that has all the dependency jars. Simply change the value attribute in the following line to the name of the appropriate directory. <property name="maven.repo.local" value="$ {user.home} /.m2/repository"/>
        Hide
        Tim Moloney added a comment -

        This issue is a step towards implementing the capability discussed in this mail thread.

        http://www.mail-archive.com/felix-dev@incubator.apache.org/msg02728.html

        Show
        Tim Moloney added a comment - This issue is a step towards implementing the capability discussed in this mail thread. http://www.mail-archive.com/felix-dev@incubator.apache.org/msg02728.html
        Hide
        Tim Moloney added a comment -

        This patch adds the ant goal as specified.

        Although it appears to be a big patch, functionally it is very simple.

        This patch

        • moves most of the functionality in BundlePlugin.java to BundleProperties.java so it call be accessed by mulitple MOJOs
        • moves the remaining functionality in BundlePlugin.java to PackageMojo.java for consistent naming
        • adds AntMojo.java to create the build.xml and MANIFEST.MF files
        • adds a slightly modified AntBuildWriter.java from maven-ant-plugin since it currently isn't extensible.
        Show
        Tim Moloney added a comment - This patch adds the ant goal as specified. Although it appears to be a big patch, functionally it is very simple. This patch moves most of the functionality in BundlePlugin.java to BundleProperties.java so it call be accessed by mulitple MOJOs moves the remaining functionality in BundlePlugin.java to PackageMojo.java for consistent naming adds AntMojo.java to create the build.xml and MANIFEST.MF files adds a slightly modified AntBuildWriter.java from maven-ant-plugin since it currently isn't extensible.

          People

          • Assignee:
            Stuart McCulloch
            Reporter:
            Tim Moloney
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development