Hi,

as far as i know you can generate the MANIFEST file from that...?? Not 100%sure about this [1] cause I never used it myself..

Furthermore if you create an appropriate target platform and create a p2 repo from it (using tycho, upload to Nexus for example) this can be used to be integrated in your build in Eclipse (using tycho) which than will solve it also inside Eclipse...


Kind regards
Karl Heinz

[1]: https://wiki.eclipse.org/Tycho/How_Tos/Dependency_on_pom-first_artifacts

On 21/03/17 22:42, Justin Georgeson wrote:
POM-first dependencies in Tycho is just for resolution of plugin jars from 
Maven repo (when they're not available in a P2 software site). It doesn't 
handle writing your MANIFEST file to reflect those POM-first dependencies, so 
you have to declare them in both files in that case.

-----Original Message-----
From: Karl Heinz Marbaise [mailto:khmarba...@gmx.de]
Sent: Tuesday, March 21, 2017 3:34 PM
To: Maven Users List <users@maven.apache.org>
Subject: [EXTERNAL] Re: Getting maven to create a bundle manifest incrementally 
in eclipse

External Sender: Use caution with links/attachments.



Hi Bill,

On 21/03/17 16:01, Bill Mair wrote:
Hi,

I'm attempting to switch to maven to create my packages but I have hit
a snag that I can't find a solution for.

Up until now, I have been controlling the dependencies of my ant build
process with the contents of "META-INF/MANIFEST.MF". Maven works the
other way around and generates that based on what I have actually
used, which I think is fantastic.

You can use Maven Tycho which gives you back the switch of requirement.
In Tycho you can either work MANIFEST first or POM first setup...

https://urldefense.proofpoint.com/v2/url?u=https-3A__eclipse.org_tycho_&d=DwICaQ&c=PskvixtEUDK7wuWU-tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&m=Afq0-NWD7K5pqCrTDV4FppklgbeyRakFBIPqJoSP43Y&s=bGPk9-NRTEIkBgx-D3uOAMwB-b2itE0bf0pzjbKlZs0&e=


And of course if your working on OSGi it makes sense to control the 
dependencies via MANIFEST via Eclipse which can handle that very good 
(dependencies, tree etc., target platforms etc.).




I already have the git hash being included by buildnumber-maven-plugin
(which required the additional pluginManagement section to work
correctly in eclipse).

Than you are using an old version cause 3.0.0 already includes this mapping for 
m2e...



My problem is that this is only generated when I build the bundle and
not during incremental saves.

The reason is simply cause you changed the side which means pom first..which I 
would say is not a good idea in OSGi and Eclipse...


Kind regards
Karl Heinz Marbaise


What do I have to change in this pom.xml to make eclipse, m2e, maven
and the maven-bundle-plugin play nicely together?

--
Bill Mair

pom.xml
------------
<project 
xmlns="https://urldefense.proofpoint.com/v2/url?u=http-3A__maven.apache.org_POM_4.0.0&d=DwICaQ&c=PskvixtEUDK7wuWU-tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&m=Afq0-NWD7K5pqCrTDV4FppklgbeyRakFBIPqJoSP43Y&s=Kd-TDhLw1iVBaAqGOI6edW5kxuY1JW2ncBCQDTakR0Y&e=
 "
xmlns:xsi="https://urldefense.proofpoint.com/v2/url?u=http-3A__www.w3.org_2001_XMLSchema-2Dinstance&d=DwICaQ&c=PskvixtEUDK7wuWU-tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&m=Afq0-NWD7K5pqCrTDV4FppklgbeyRakFBIPqJoSP43Y&s=UiQcEFOTpLzlDZ2bGKUP0roZmZ-lekq-ckzXz77Yxhk&e=
 "

xsi:schemaLocation="https://urldefense.proofpoint.com/v2/url?u=http-3A
__maven.apache.org_POM_4.0.0&d=DwICaQ&c=PskvixtEUDK7wuWU-tIg6oKuGYBRbr
MXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&m=Afq0-NWD
7K5pqCrTDV4FppklgbeyRakFBIPqJoSP43Y&s=Kd-TDhLw1iVBaAqGOI6edW5kxuY1JW2n
cBCQDTakR0Y&e=
https://urldefense.proofpoint.com/v2/url?u=http-3A__maven.apache.org_x
sd_maven-2D4.0.0.xsd&d=DwICaQ&c=PskvixtEUDK7wuWU-tIg6oKuGYBRbrMXk2FZvF
0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&m=Afq0-NWD7K5pqCrT
DV4FppklgbeyRakFBIPqJoSP43Y&s=w_BXwgMpPrHERwc7gqdgadG__EXBDlY4TbMX5iap
Kqw&e= ">

    <properties>
        
<https://urldefense.proofpoint.com/v2/url?u=http-3A__bundle.symbolicName&d=DwICaQ&c=PskvixtEUDK7wuWU-tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&m=Afq0-NWD7K5pqCrTDV4FppklgbeyRakFBIPqJoSP43Y&s=TaSov7e93VtOFSW-wbSkimpcFZzq0fn2hX35RitVOPU&e=
 >test.iface</bundle.symbolicName>
        
<https://urldefense.proofpoint.com/v2/url?u=http-3A__bundle.namespace&d=DwICaQ&c=PskvixtEUDK7wuWU-tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&m=Afq0-NWD7K5pqCrTDV4FppklgbeyRakFBIPqJoSP43Y&s=HMZ22MdATe7QYvAwINbNz14S1EiFEDYPPTUuMKtgw5M&e=
 >test.iface</bundle.namespace>
        
<https://urldefense.proofpoint.com/v2/url?u=http-3A__project.build.sourceEncoding&d=DwICaQ&c=PskvixtEUDK7wuWU-tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&m=Afq0-NWD7K5pqCrTDV4FppklgbeyRakFBIPqJoSP43Y&s=vDUOZN2NLvmaNvEKU56117LjFqTzysiSg8ADE9Upe5s&e=
 >UTF-8</project.build.sourceEncoding>

<https://urldefense.proofpoint.com/v2/url?u=http-3A__maven.build.timestamp.format&d=DwICaQ&c=PskvixtEUDK7wuWU-tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&m=Afq0-NWD7K5pqCrTDV4FppklgbeyRakFBIPqJoSP43Y&s=a67ve_TjcESh76Y_up2Fue47aDtDNGDjCI7HyHsuK84&e=
 >yyyy/MM/dd HH:mm:ss z</maven.build.timestamp.format>
    </properties>

    <modelVersion>4.0.0</modelVersion>
    <groupId>test</groupId>
    <artifactId>test.iface</artifactId>
    <version>1.0.1</version>

    <scm>
        <connection>scm:git:file://.</connection>
        <developerConnection>scm:git:file://.</developerConnection>
        <url>scm:git:file://.</url>
        <tag>HEAD</tag>
    </scm>

    <dependencies>
        <!-- eclipse virgo - equinox OSGi version -->
         <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.core</artifactId>
            <version>5.0.0</version>
            <scope>provided</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.compendium</artifactId>
            <version>4.3.0</version>
            <scope>provided</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>javax.jws</groupId>
            <artifactId>jsr181-api</artifactId>
            <version>1.0-MR1</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>compile</scope>
            <optional>true</optional>
        </dependency>
    </dependencies>

    <packaging>bundle</packaging>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>3.0.1</version>
                <extensions>true</extensions>
                <configuration>
                    <manifestLocation>META-INF</manifestLocation>
                    <instructions>

<Bundle-SymbolicName>${bundle.symbolicName}</Bundle-SymbolicName>

<Bundle-Version>${project.version}</Bundle-Version>

<Bundle-Vendor>${https://urldefense.proofpoint.com/v2/url?u=http-3A__project.organization.name&d=DwICaQ&c=PskvixtEUDK7wuWU-tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&m=Afq0-NWD7K5pqCrTDV4FppklgbeyRakFBIPqJoSP43Y&s=87NhXgu2s6w58G9NSUsrhABywCDx4VlX3KNjjMyy5Y4&e=
 }</Bundle-Vendor>
                        <Bundle-Copyright>Copyright (C)
${https://urldefense.proofpoint.com/v2/url?u=http-3A__project.organiza
tion.name&d=DwICaQ&c=PskvixtEUDK7wuWU-tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLx
YM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&m=Afq0-NWD7K5pqCrTDV4Fppklgbe
yRakFBIPqJoSP43Y&s=87NhXgu2s6w58G9NSUsrhABywCDx4VlX3KNjjMyy5Y4&e=
}</Bundle-Copyright>


<Implementation-Build-Time>${maven.build.timestamp}</Implementation-Bu
ild-Time>

<Implementation-Build>${buildNumber}</Implementation-Build>

                        <!-- assume public classes are in the top
package, and private classes are under ".internal" -->


<Export-Package>!${bundle.namespace}.internal.*,${bundle.namespace}.*;
version="${project.version}"</Export-Package>

                        <!--

<Private-Package>${bundle.namespace}.*</Private-Package>

<Bundle-Activator>${bundle.namespace}.Activator</Bundle-Activator>

<Private-Package>${bundle.namespace}.internal.*</Private-Package>

<Bundle-Activator>${bundle.namespace}.internal.ExampleActivator</Bundl
e-Activator>

<Fragment-Host>https://urldefense.proofpoint.com/v2/url?u=http-3A__org
.fragment.host&d=DwICaQ&c=PskvixtEUDK7wuWU-tIg6oKuGYBRbrMXk2FZvF0UfTo&
r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEmBCjCmEiTk&m=Afq0-NWD7K5pqCrTDV4Fpp
klgbeyRakFBIPqJoSP43Y&s=oc5ia3gl4WdLyg6hvW8Q3cSNnFRcGWvBSH44Bt_Y-o4&e=
;bundle-version="1.0.0"</Fragment-Host>

<Service-Component>OSGI-INF/configuration.xml</Service-Component>

<Service-Component>OSGI-INF/*.xml</Service-Component>
                        -->
                    </instructions>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>buildnumber-maven-plugin</artifactId>
                <version>1.4</version>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>create</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <doCheck>false</doCheck>
                    <doUpdate>false</doUpdate>
                </configuration>
            </plugin>
              <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.10.4</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.0.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.6.1</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-dependencies</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>

<groupId>org.codehaus.mojo</groupId>

<artifactId>buildnumber-maven-plugin</artifactId>
                                        <versionRange>[1.0,)</versionRange>
                                        <goals>
                                            <goal>create</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <execute>

<runOnIncremental>true</runOnIncremental>
                                        </execute>
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
</project>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to