Discussion:
[tycho-user] Newb question
V. Mark Lehky
2014-03-07 23:37:03 UTC
Permalink
Hello all.

I have an eclipse-plugin project that builds successfully using ant. I
would like to move this project to Maven (plus do a little cleanup of
the existing code); some Internet link pointed me towards Tycho.
I have gone through the EclipseCon Tycho Tutorial, and that seems to
be working fine for me. There is, however, one thing that is not clear
to me: dependencies to other projects.

My entire project consists of three Eclipse projects:
1. "executor.jar"
2. "server.jar"
3. and the plugin

I have a parent pom.xml which lists the above three modules as:
1. packaging = jar
2. packaging = jar
3. packaging = eclipse-plugin
I defined all the Tycho specific stuff in the plugin pom, not the parent pom.

Both the server.jar and my plugin depends on the "executor.jar" plus
one other jar from a Maven repo. In the server.jar defining the
dependencies in the pom is really easy, and that builds just fine.

How do I do this in the plugin?
Igor Fedorenko
2014-03-07 23:56:09 UTC
Permalink
Tycho does not like pure Maven dependencies, it very much prefers OSGi
bundles and Eclipse artifacts from P2 repositories. This applies to both
projects that you build ("executor.jar" and "server.jar", in you case)
and artifacts available from remote Maven repositories. You need to
convert you pure-Maven projects and dependencies to OSGi bundles and
make them available from a P2 repository before you'll be able to use
them from eclipse-plugin projects.

Usually I setup a separate project for my non-P2 stuff and use
maven-bundle-plugin to generate OSGi metadata for me, then use
pomDependencies=consider trick explain in [1] to make the "OSGi-ified"
artifacts visible to the Tycho build. You can see how this is setup in
m2e build, for example [2] (the pure-maven stuff is in m2e-maven-runtime
subdirectory).

[1] http://wiki.eclipse.org/Tycho/How_Tos/Dependency_on_pom-first_artifacts
[2] http://git.eclipse.org/c/m2e/m2e-core.git/



--
Regards,
Igor
Post by V. Mark Lehky
Hello all.
I have an eclipse-plugin project that builds successfully using ant. I
would like to move this project to Maven (plus do a little cleanup of
the existing code); some Internet link pointed me towards Tycho.
I have gone through the EclipseCon Tycho Tutorial, and that seems to
be working fine for me. There is, however, one thing that is not clear
to me: dependencies to other projects.
1. "executor.jar"
2. "server.jar"
3. and the plugin
1. packaging = jar
2. packaging = jar
3. packaging = eclipse-plugin
I defined all the Tycho specific stuff in the plugin pom, not the parent pom.
Both the server.jar and my plugin depends on the "executor.jar" plus
one other jar from a Maven repo. In the server.jar defining the
dependencies in the pom is really easy, and that builds just fine.
How do I do this in the plugin?
V. Mark Lehky
2014-03-08 01:08:08 UTC
Permalink
I kinda suspected the answer was going to be something like the below.
Sounds like I still got a ways to go. Will let you know how I manage,
probably on Monday.

Thank You.
Post by Igor Fedorenko
Tycho does not like pure Maven dependencies, it very much prefers OSGi
bundles and Eclipse artifacts from P2 repositories. This applies to both
projects that you build ("executor.jar" and "server.jar", in you case)
and artifacts available from remote Maven repositories. You need to
convert you pure-Maven projects and dependencies to OSGi bundles and
make them available from a P2 repository before you'll be able to use
them from eclipse-plugin projects.
Usually I setup a separate project for my non-P2 stuff and use
maven-bundle-plugin to generate OSGi metadata for me, then use
pomDependencies=consider trick explain in [1] to make the "OSGi-ified"
artifacts visible to the Tycho build. You can see how this is setup in
m2e build, for example [2] (the pure-maven stuff is in m2e-maven-runtime
subdirectory).
[1] http://wiki.eclipse.org/Tycho/How_Tos/Dependency_on_pom-first_artifacts
[2] http://git.eclipse.org/c/m2e/m2e-core.git/
--
Regards,
Igor
Post by V. Mark Lehky
Hello all.
I have an eclipse-plugin project that builds successfully using ant. I
would like to move this project to Maven (plus do a little cleanup of
the existing code); some Internet link pointed me towards Tycho.
I have gone through the EclipseCon Tycho Tutorial, and that seems to
be working fine for me. There is, however, one thing that is not clear
to me: dependencies to other projects.
1. "executor.jar"
2. "server.jar"
3. and the plugin
1. packaging = jar
2. packaging = jar
3. packaging = eclipse-plugin
I defined all the Tycho specific stuff in the plugin pom, not the parent pom.
Both the server.jar and my plugin depends on the "executor.jar" plus
one other jar from a Maven repo. In the server.jar defining the
dependencies in the pom is really easy, and that builds just fine.
How do I do this in the plugin?
V. Mark Lehky
2014-03-10 18:35:01 UTC
Permalink
So I finally had a chance to try all this stuff out. Still have too
many questions. :(

I downloaded the demo from that HowTo. My first Q: what are the result
of this build? Where does it go? How can I check that I configured
everything right?
The second problem: I am doing everything in Eclipse (Kepler). The mvn
build from CLI passes just as the demo says it should. However,
Eclipse build fails. I tried to clean the project, but still no go.
For the build02, Eclipse is complaining "Missing artifact
tycho.demo.itp02:pomfirst-bundle:jar:1.0.0-SNAPSHOT" (same for the
second jar). But I can see both of them in the correct target
directory. Is this expected?

TIA, ML.
Post by Igor Fedorenko
Tycho does not like pure Maven dependencies, it very much prefers OSGi
bundles and Eclipse artifacts from P2 repositories. This applies to both
projects that you build ("executor.jar" and "server.jar", in you case)
and artifacts available from remote Maven repositories. You need to
convert you pure-Maven projects and dependencies to OSGi bundles and
make them available from a P2 repository before you'll be able to use
them from eclipse-plugin projects.
Usually I setup a separate project for my non-P2 stuff and use
maven-bundle-plugin to generate OSGi metadata for me, then use
pomDependencies=consider trick explain in [1] to make the "OSGi-ified"
artifacts visible to the Tycho build. You can see how this is setup in
m2e build, for example [2] (the pure-maven stuff is in m2e-maven-runtime
subdirectory).
[1] http://wiki.eclipse.org/Tycho/How_Tos/Dependency_on_pom-first_artifacts
[2] http://git.eclipse.org/c/m2e/m2e-core.git/
--
Regards,
Igor
Post by V. Mark Lehky
Hello all.
I have an eclipse-plugin project that builds successfully using ant. I
would like to move this project to Maven (plus do a little cleanup of
the existing code); some Internet link pointed me towards Tycho.
I have gone through the EclipseCon Tycho Tutorial, and that seems to
be working fine for me. There is, however, one thing that is not clear
to me: dependencies to other projects.
1. "executor.jar"
2. "server.jar"
3. and the plugin
1. packaging = jar
2. packaging = jar
3. packaging = eclipse-plugin
I defined all the Tycho specific stuff in the plugin pom, not the parent pom.
Both the server.jar and my plugin depends on the "executor.jar" plus
one other jar from a Maven repo. In the server.jar defining the
dependencies in the pom is really easy, and that builds just fine.
How do I do this in the plugin?
V. Mark Lehky
2014-03-10 18:46:54 UTC
Permalink
Figured out my Eclipse build problem: I must have opened the projects
wrong or something. I recreated the dependencies in the pom and it
works fine now. The demo works fine!

BTW: Tried it in the new tycho version 0.20.0, works like a charm! For
the tycho stuff, can I define the version using something like this:
http://docs.codehaus.org/display/MAVEN/Dependency+Mediation+and+Conflict+Resolution#DependencyMediationandConflictResolution-DependencyVersionRanges
? When I tried it with: tycho-version=[0.19.0,) I get the error:
"Several versions of tycho plugins are configured [0.20.0, [0.19.0,)]"

ML.
Post by V. Mark Lehky
So I finally had a chance to try all this stuff out. Still have too
many questions. :(
I downloaded the demo from that HowTo. My first Q: what are the result
of this build? Where does it go? How can I check that I configured
everything right?
The second problem: I am doing everything in Eclipse (Kepler). The mvn
build from CLI passes just as the demo says it should. However,
Eclipse build fails. I tried to clean the project, but still no go.
For the build02, Eclipse is complaining "Missing artifact
tycho.demo.itp02:pomfirst-bundle:jar:1.0.0-SNAPSHOT" (same for the
second jar). But I can see both of them in the correct target
directory. Is this expected?
TIA, ML.
Post by Igor Fedorenko
Tycho does not like pure Maven dependencies, it very much prefers OSGi
bundles and Eclipse artifacts from P2 repositories. This applies to both
projects that you build ("executor.jar" and "server.jar", in you case)
and artifacts available from remote Maven repositories. You need to
convert you pure-Maven projects and dependencies to OSGi bundles and
make them available from a P2 repository before you'll be able to use
them from eclipse-plugin projects.
Usually I setup a separate project for my non-P2 stuff and use
maven-bundle-plugin to generate OSGi metadata for me, then use
pomDependencies=consider trick explain in [1] to make the "OSGi-ified"
artifacts visible to the Tycho build. You can see how this is setup in
m2e build, for example [2] (the pure-maven stuff is in m2e-maven-runtime
subdirectory).
[1] http://wiki.eclipse.org/Tycho/How_Tos/Dependency_on_pom-first_artifacts
[2] http://git.eclipse.org/c/m2e/m2e-core.git/
--
Regards,
Igor
Post by V. Mark Lehky
Hello all.
I have an eclipse-plugin project that builds successfully using ant. I
would like to move this project to Maven (plus do a little cleanup of
the existing code); some Internet link pointed me towards Tycho.
I have gone through the EclipseCon Tycho Tutorial, and that seems to
be working fine for me. There is, however, one thing that is not clear
to me: dependencies to other projects.
1. "executor.jar"
2. "server.jar"
3. and the plugin
1. packaging = jar
2. packaging = jar
3. packaging = eclipse-plugin
I defined all the Tycho specific stuff in the plugin pom, not the parent pom.
Both the server.jar and my plugin depends on the "executor.jar" plus
one other jar from a Maven repo. In the server.jar defining the
dependencies in the pom is really easy, and that builds just fine.
How do I do this in the plugin?
V. Mark Lehky
2014-03-10 20:51:41 UTC
Permalink
Is it possible that the demo has a bug?
In file <http://git.eclipse.org/c/tycho/org.eclipse.tycho-demo.git/tree/itp02/build01/pomfirst-thirdparty/pom.xml>,
line 36, is there a dollar-sign missing?

ML.
Post by V. Mark Lehky
Figured out my Eclipse build problem: I must have opened the projects
wrong or something. I recreated the dependencies in the pom and it
works fine now. The demo works fine!
BTW: Tried it in the new tycho version 0.20.0, works like a charm! For
http://docs.codehaus.org/display/MAVEN/Dependency+Mediation+and+Conflict+Resolution#DependencyMediationandConflictResolution-DependencyVersionRanges
"Several versions of tycho plugins are configured [0.20.0, [0.19.0,)]"
ML.
Post by V. Mark Lehky
So I finally had a chance to try all this stuff out. Still have too
many questions. :(
I downloaded the demo from that HowTo. My first Q: what are the result
of this build? Where does it go? How can I check that I configured
everything right?
The second problem: I am doing everything in Eclipse (Kepler). The mvn
build from CLI passes just as the demo says it should. However,
Eclipse build fails. I tried to clean the project, but still no go.
For the build02, Eclipse is complaining "Missing artifact
tycho.demo.itp02:pomfirst-bundle:jar:1.0.0-SNAPSHOT" (same for the
second jar). But I can see both of them in the correct target
directory. Is this expected?
TIA, ML.
Post by Igor Fedorenko
Tycho does not like pure Maven dependencies, it very much prefers OSGi
bundles and Eclipse artifacts from P2 repositories. This applies to both
projects that you build ("executor.jar" and "server.jar", in you case)
and artifacts available from remote Maven repositories. You need to
convert you pure-Maven projects and dependencies to OSGi bundles and
make them available from a P2 repository before you'll be able to use
them from eclipse-plugin projects.
Usually I setup a separate project for my non-P2 stuff and use
maven-bundle-plugin to generate OSGi metadata for me, then use
pomDependencies=consider trick explain in [1] to make the "OSGi-ified"
artifacts visible to the Tycho build. You can see how this is setup in
m2e build, for example [2] (the pure-maven stuff is in m2e-maven-runtime
subdirectory).
[1] http://wiki.eclipse.org/Tycho/How_Tos/Dependency_on_pom-first_artifacts
[2] http://git.eclipse.org/c/m2e/m2e-core.git/
--
Regards,
Igor
Post by V. Mark Lehky
Hello all.
I have an eclipse-plugin project that builds successfully using ant. I
would like to move this project to Maven (plus do a little cleanup of
the existing code); some Internet link pointed me towards Tycho.
I have gone through the EclipseCon Tycho Tutorial, and that seems to
be working fine for me. There is, however, one thing that is not clear
to me: dependencies to other projects.
1. "executor.jar"
2. "server.jar"
3. and the plugin
1. packaging = jar
2. packaging = jar
3. packaging = eclipse-plugin
I defined all the Tycho specific stuff in the plugin pom, not the parent pom.
Both the server.jar and my plugin depends on the "executor.jar" plus
one other jar from a Maven repo. In the server.jar defining the
dependencies in the pom is really easy, and that builds just fine.
How do I do this in the plugin?
Igor Fedorenko
2014-03-10 21:02:28 UTC
Permalink
No, this is the right syntax, see Embedding dependencies in

http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html

--
Regards,
Igor
Post by V. Mark Lehky
Is it possible that the demo has a bug?
In file <http://git.eclipse.org/c/tycho/org.eclipse.tycho-demo.git/tree/itp02/build01/pomfirst-thirdparty/pom.xml>,
line 36, is there a dollar-sign missing?
ML.
Post by V. Mark Lehky
Figured out my Eclipse build problem: I must have opened the projects
wrong or something. I recreated the dependencies in the pom and it
works fine now. The demo works fine!
BTW: Tried it in the new tycho version 0.20.0, works like a charm! For
http://docs.codehaus.org/display/MAVEN/Dependency+Mediation+and+Conflict+Resolution#DependencyMediationandConflictResolution-DependencyVersionRanges
"Several versions of tycho plugins are configured [0.20.0, [0.19.0,)]"
ML.
Post by V. Mark Lehky
So I finally had a chance to try all this stuff out. Still have too
many questions. :(
I downloaded the demo from that HowTo. My first Q: what are the result
of this build? Where does it go? How can I check that I configured
everything right?
The second problem: I am doing everything in Eclipse (Kepler). The mvn
build from CLI passes just as the demo says it should. However,
Eclipse build fails. I tried to clean the project, but still no go.
For the build02, Eclipse is complaining "Missing artifact
tycho.demo.itp02:pomfirst-bundle:jar:1.0.0-SNAPSHOT" (same for the
second jar). But I can see both of them in the correct target
directory. Is this expected?
TIA, ML.
Post by Igor Fedorenko
Tycho does not like pure Maven dependencies, it very much prefers OSGi
bundles and Eclipse artifacts from P2 repositories. This applies to both
projects that you build ("executor.jar" and "server.jar", in you case)
and artifacts available from remote Maven repositories. You need to
convert you pure-Maven projects and dependencies to OSGi bundles and
make them available from a P2 repository before you'll be able to use
them from eclipse-plugin projects.
Usually I setup a separate project for my non-P2 stuff and use
maven-bundle-plugin to generate OSGi metadata for me, then use
pomDependencies=consider trick explain in [1] to make the "OSGi-ified"
artifacts visible to the Tycho build. You can see how this is setup in
m2e build, for example [2] (the pure-maven stuff is in m2e-maven-runtime
subdirectory).
[1] http://wiki.eclipse.org/Tycho/How_Tos/Dependency_on_pom-first_artifacts
[2] http://git.eclipse.org/c/m2e/m2e-core.git/
--
Regards,
Igor
Post by V. Mark Lehky
Hello all.
I have an eclipse-plugin project that builds successfully using ant. I
would like to move this project to Maven (plus do a little cleanup of
the existing code); some Internet link pointed me towards Tycho.
I have gone through the EclipseCon Tycho Tutorial, and that seems to
be working fine for me. There is, however, one thing that is not clear
to me: dependencies to other projects.
1. "executor.jar"
2. "server.jar"
3. and the plugin
1. packaging = jar
2. packaging = jar
3. packaging = eclipse-plugin
I defined all the Tycho specific stuff in the plugin pom, not the parent pom.
Both the server.jar and my plugin depends on the "executor.jar" plus
one other jar from a Maven repo. In the server.jar defining the
dependencies in the pom is really easy, and that builds just fine.
How do I do this in the plugin?
V. Mark Lehky
2014-03-11 16:12:26 UTC
Permalink
I am still struggling through this. :(
Once I build and install into my local repo my two jars, can I then
treat them as a 3rdparty library, when it comes to generateing the
OSGi bundle manifest using the maven-bundle-plugin? In other words:
can I have just _one_ Maven project that would be able to do both the
pomfirst-bundle and the pomfirst-thirdparty from the build01 in the
demo?
TIA.
Post by Igor Fedorenko
Tycho does not like pure Maven dependencies, it very much prefers OSGi
bundles and Eclipse artifacts from P2 repositories. This applies to both
projects that you build ("executor.jar" and "server.jar", in you case)
and artifacts available from remote Maven repositories. You need to
convert you pure-Maven projects and dependencies to OSGi bundles and
make them available from a P2 repository before you'll be able to use
them from eclipse-plugin projects.
Usually I setup a separate project for my non-P2 stuff and use
maven-bundle-plugin to generate OSGi metadata for me, then use
pomDependencies=consider trick explain in [1] to make the "OSGi-ified"
artifacts visible to the Tycho build. You can see how this is setup in
m2e build, for example [2] (the pure-maven stuff is in m2e-maven-runtime
subdirectory).
[1] http://wiki.eclipse.org/Tycho/How_Tos/Dependency_on_pom-first_artifacts
[2] http://git.eclipse.org/c/m2e/m2e-core.git/
--
Regards,
Igor
Post by V. Mark Lehky
Hello all.
I have an eclipse-plugin project that builds successfully using ant. I
would like to move this project to Maven (plus do a little cleanup of
the existing code); some Internet link pointed me towards Tycho.
I have gone through the EclipseCon Tycho Tutorial, and that seems to
be working fine for me. There is, however, one thing that is not clear
to me: dependencies to other projects.
1. "executor.jar"
2. "server.jar"
3. and the plugin
1. packaging = jar
2. packaging = jar
3. packaging = eclipse-plugin
I defined all the Tycho specific stuff in the plugin pom, not the parent pom.
Both the server.jar and my plugin depends on the "executor.jar" plus
one other jar from a Maven repo. In the server.jar defining the
dependencies in the pom is really easy, and that builds just fine.
How do I do this in the plugin?
Igor Fedorenko
2014-03-11 16:30:40 UTC
Permalink
As explained in [1] you have to build pom-first and manifest-first
projects separately

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

--
Regards,
Igor
Post by V. Mark Lehky
I am still struggling through this. :(
Once I build and install into my local repo my two jars, can I then
treat them as a 3rdparty library, when it comes to generateing the
can I have just _one_ Maven project that would be able to do both the
pomfirst-bundle and the pomfirst-thirdparty from the build01 in the
demo?
TIA.
Post by Igor Fedorenko
Tycho does not like pure Maven dependencies, it very much prefers OSGi
bundles and Eclipse artifacts from P2 repositories. This applies to both
projects that you build ("executor.jar" and "server.jar", in you case)
and artifacts available from remote Maven repositories. You need to
convert you pure-Maven projects and dependencies to OSGi bundles and
make them available from a P2 repository before you'll be able to use
them from eclipse-plugin projects.
Usually I setup a separate project for my non-P2 stuff and use
maven-bundle-plugin to generate OSGi metadata for me, then use
pomDependencies=consider trick explain in [1] to make the "OSGi-ified"
artifacts visible to the Tycho build. You can see how this is setup in
m2e build, for example [2] (the pure-maven stuff is in m2e-maven-runtime
subdirectory).
[1] http://wiki.eclipse.org/Tycho/How_Tos/Dependency_on_pom-first_artifacts
[2] http://git.eclipse.org/c/m2e/m2e-core.git/
--
Regards,
Igor
Post by V. Mark Lehky
Hello all.
I have an eclipse-plugin project that builds successfully using ant. I
would like to move this project to Maven (plus do a little cleanup of
the existing code); some Internet link pointed me towards Tycho.
I have gone through the EclipseCon Tycho Tutorial, and that seems to
be working fine for me. There is, however, one thing that is not clear
to me: dependencies to other projects.
1. "executor.jar"
2. "server.jar"
3. and the plugin
1. packaging = jar
2. packaging = jar
3. packaging = eclipse-plugin
I defined all the Tycho specific stuff in the plugin pom, not the parent pom.
Both the server.jar and my plugin depends on the "executor.jar" plus
one other jar from a Maven repo. In the server.jar defining the
dependencies in the pom is really easy, and that builds just fine.
How do I do this in the plugin?
V. Mark Lehky
2014-03-11 16:51:53 UTC
Permalink
But in the build01 demo, there are two pomfirst projects:
pomfirst-bundle and pomfirst-thirdparty. Can those be combine into one
project?
Igor Fedorenko
2014-03-11 16:54:09 UTC
Permalink
Yes
Post by V. Mark Lehky
pomfirst-bundle and pomfirst-thirdparty. Can those be combine into one
project?
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
V. Mark Lehky
2014-03-11 19:22:14 UTC
Permalink
Still no good. I am trying to do things one small step at a time now.
I followed the demo build01/pomfirst-bundle to package up my generated
jar. The build created a nice META-INF/MANIFEST.MF as expected. So
that looks good, I assume.
Now for my eclipse-plugin, I followed the
build02/tycho.demo.itp02.bundle. I took the entire Export-Package
block from the generated MANIFEST.MF above, and pasted that into the
Import-Package block of this MANIFEST.MF. When I build everything I
get the error: "Cannot resolve project dependencies" from my
eclipse-plugin. It is looking for the first package in the
Import-Package list.
What did I miss?
TIA. ML.
Post by Igor Fedorenko
Tycho does not like pure Maven dependencies, it very much prefers OSGi
bundles and Eclipse artifacts from P2 repositories. This applies to both
projects that you build ("executor.jar" and "server.jar", in you case)
and artifacts available from remote Maven repositories. You need to
convert you pure-Maven projects and dependencies to OSGi bundles and
make them available from a P2 repository before you'll be able to use
them from eclipse-plugin projects.
Usually I setup a separate project for my non-P2 stuff and use
maven-bundle-plugin to generate OSGi metadata for me, then use
pomDependencies=consider trick explain in [1] to make the "OSGi-ified"
artifacts visible to the Tycho build. You can see how this is setup in
m2e build, for example [2] (the pure-maven stuff is in m2e-maven-runtime
subdirectory).
[1] http://wiki.eclipse.org/Tycho/How_Tos/Dependency_on_pom-first_artifacts
[2] http://git.eclipse.org/c/m2e/m2e-core.git/
--
Regards,
Igor
Post by V. Mark Lehky
Hello all.
I have an eclipse-plugin project that builds successfully using ant. I
would like to move this project to Maven (plus do a little cleanup of
the existing code); some Internet link pointed me towards Tycho.
I have gone through the EclipseCon Tycho Tutorial, and that seems to
be working fine for me. There is, however, one thing that is not clear
to me: dependencies to other projects.
1. "executor.jar"
2. "server.jar"
3. and the plugin
1. packaging = jar
2. packaging = jar
3. packaging = eclipse-plugin
I defined all the Tycho specific stuff in the plugin pom, not the parent pom.
Both the server.jar and my plugin depends on the "executor.jar" plus
one other jar from a Maven repo. In the server.jar defining the
dependencies in the pom is really easy, and that builds just fine.
How do I do this in the plugin?
Loading...