Discussion:
Problem with Resolving Sources Artifacts
(too old to reply)
Timo Rohrberg
2011-10-14 12:38:08 UTC
Permalink
Hello everybody,

this is a more general form of my original question and problem
description (http://dev.eclipse.org/mhonarc/lists/tycho-user/msg01026.html).
The latter is obsolete now.

I am successfully building binary and sources artifacts for a bundle
which wraps third party libraries. Both, the normal and the sources
artifact, are correctly deployed to my local Maven repository. I then
build two feature projects with Tycho, one including the plugin from
the binary artifact, and the other including it from the sources
artifact. Building the first one works, but when trying to build the
second one, Tycho obviously cannot resolve the sources artifact
correctly and thus stops with a "Missing requirement" exception. The
com.example.logging.source plugin referred to by the feature.xml
cannot be found. My idea was to explicitely set the "sources"
classifier when declaring the pom-Dependency in the feature project.
But unfortunately this also doesn't help.

Do you have any idea? Thank you for any hints, advices, etc.

Regards
Timo
Igor Fedorenko
2011-10-14 14:05:12 UTC
Permalink
Sources jar has to have specific OSGi bundle manifest and has to be
added as feature maven dependency. I am not sure it is possible to
create sources jar with custom manifest, but I am not 100% sure about that.

--
Regards,
Igor
Post by Timo Rohrberg
Hello everybody,
this is a more general form of my original question and problem
description (http://dev.eclipse.org/mhonarc/lists/tycho-user/msg01026.html).
The latter is obsolete now.
I am successfully building binary and sources artifacts for a bundle
which wraps third party libraries. Both, the normal and the sources
artifact, are correctly deployed to my local Maven repository. I then
build two feature projects with Tycho, one including the plugin from
the binary artifact, and the other including it from the sources
artifact. Building the first one works, but when trying to build the
second one, Tycho obviously cannot resolve the sources artifact
correctly and thus stops with a "Missing requirement" exception. The
com.example.logging.source plugin referred to by the feature.xml
cannot be found. My idea was to explicitely set the "sources"
classifier when declaring the pom-Dependency in the feature project.
But unfortunately this also doesn't help.
Do you have any idea? Thank you for any hints, advices, etc.
Regards
Timo
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
Timo Rohrberg
2011-10-14 14:18:20 UTC
Permalink
Hello Igor,

thank you for your answer. Unfortunately, I did not completely
understand what you wanted to tell me. If you run "mvn install" on my
sample com.example.logging project, the resulting
"com.example.logging-1.6.1-SNAPSHOT-sources.jar" does have an OSGi
bundle manifest. In fact that's exactly the benefit of using the
tycho-source-plugin instead of packing the jar manually via the
maven-jar-plugin plugin. The manifest correctly identifies the bundle
as source bundle to the com.example.logging bundle contained in the
"com.example.logging-1.6.1-SNAPSHOT.jar" which itself is provided with
an OSGi bundle manifest.

What exactly do you mean by "has to be added as feature maven dependency"?

In the com.example.logging.feature project, I declared the dependency
to the "com.example.logging-1.6.1-SNAPSHOT.jar" as follows:

<dependencies>
<dependency>
<groupId>example</groupId>
<artifactId>com.example.logging</artifactId>
<version>1.6.1-SNAPSHOT</version>
</dependency>
</dependencies>

I can then list the com.example.logging plugin in the feature.xml and
Tycho builds the feature correctly.

In contrary, with the com.example.logging.source.feature project this
does not work, since Tycho obviously does not correctly resolve the
dependency to the "com.example.logging-1.6.1-SNAPSHOT-sources.jar" in
which the com.example.logging.source plugin is to be found.

Of course my sample setup is a bit special as I am wrapping
third-party libraries in OSGi bundles. But the use case of resolving
binary and source bundles built with Tycho is a common one, I guess.
How would I work with such binary and source bundles if Tycho could
not resolve them?

Any hints, comments, suggestions, ...?

Thank you very much for all your help so far.

Regards
Timo
Post by Igor Fedorenko
Sources jar has to have specific OSGi bundle manifest and has to be
added as feature maven dependency. I am not sure it is possible to
create sources jar with custom manifest, but I am not 100% sure about that.
--
Regards,
Igor
Post by Timo Rohrberg
Hello everybody,
this is a more general form of my original question and problem
description
(http://dev.eclipse.org/mhonarc/lists/tycho-user/msg01026.html).
The latter is obsolete now.
I am successfully building binary and sources artifacts for a bundle
which wraps third party libraries. Both, the normal and the sources
artifact, are correctly deployed to my local Maven repository. I then
build two feature projects with Tycho, one including the plugin from
the binary artifact, and the other including it from the sources
artifact. Building the first one works, but when trying to build the
second one, Tycho obviously cannot resolve the sources artifact
correctly and thus stops with a "Missing requirement" exception. The
com.example.logging.source plugin referred to by the feature.xml
cannot be found. My idea was to explicitely set the "sources"
classifier when declaring the pom-Dependency in the feature project.
But unfortunately this also doesn't help.
Do you have any idea? Thank you for any hints, advices, etc.
Regards
Timo
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
Igor Fedorenko
2011-10-14 14:29:46 UTC
Permalink
see inline

--
Regards,
Igor
Post by Timo Rohrberg
Hello Igor,
thank you for your answer. Unfortunately, I did not completely
understand what you wanted to tell me. If you run "mvn install" on my
sample com.example.logging project, the resulting
"com.example.logging-1.6.1-SNAPSHOT-sources.jar" does have an OSGi
bundle manifest. In fact that's exactly the benefit of using the
tycho-source-plugin instead of packing the jar manually via the
maven-jar-plugin plugin. The manifest correctly identifies the bundle
as source bundle to the com.example.logging bundle contained in the
"com.example.logging-1.6.1-SNAPSHOT.jar" which itself is provided with
an OSGi bundle manifest.
I did not notice the attachment and I assumed you used
maven-source-plugin to produce sources jar.
Post by Timo Rohrberg
What exactly do you mean by "has to be added as feature maven dependency"?
In the com.example.logging.feature project, I declared the dependency
<dependencies>
<dependency>
<groupId>example</groupId>
<artifactId>com.example.logging</artifactId>
<version>1.6.1-SNAPSHOT</version>
</dependency>
</dependencies>
I can then list the com.example.logging plugin in the feature.xml and
Tycho builds the feature correctly.
In contrary, with the com.example.logging.source.feature project this
does not work, since Tycho obviously does not correctly resolve the
dependency to the "com.example.logging-1.6.1-SNAPSHOT-sources.jar" in
which the com.example.logging.source plugin is to be found.
The <dependency/> element above defines dependency on the main artifact,
for sources jar you also need to have

<dependency>
<groupId>example</groupId>
<artifactId>com.example.logging</artifactId>
<version>1.6.1-SNAPSHOT</version>
<classifier>sources</classifier>
</dependency>
Post by Timo Rohrberg
Of course my sample setup is a bit special as I am wrapping
third-party libraries in OSGi bundles. But the use case of resolving
binary and source bundles built with Tycho is a common one, I guess.
How would I work with such binary and source bundles if Tycho could
not resolve them?
Any hints, comments, suggestions, ...?
Thank you very much for all your help so far.
Regards
Timo
Post by Igor Fedorenko
Sources jar has to have specific OSGi bundle manifest and has to be
added as feature maven dependency. I am not sure it is possible to
create sources jar with custom manifest, but I am not 100% sure about that.
--
Regards,
Igor
Post by Timo Rohrberg
Hello everybody,
this is a more general form of my original question and problem
description
(http://dev.eclipse.org/mhonarc/lists/tycho-user/msg01026.html).
The latter is obsolete now.
I am successfully building binary and sources artifacts for a bundle
which wraps third party libraries. Both, the normal and the sources
artifact, are correctly deployed to my local Maven repository. I then
build two feature projects with Tycho, one including the plugin from
the binary artifact, and the other including it from the sources
artifact. Building the first one works, but when trying to build the
second one, Tycho obviously cannot resolve the sources artifact
correctly and thus stops with a "Missing requirement" exception. The
com.example.logging.source plugin referred to by the feature.xml
cannot be found. My idea was to explicitely set the "sources"
classifier when declaring the pom-Dependency in the feature project.
But unfortunately this also doesn't help.
Do you have any idea? Thank you for any hints, advices, etc.
Regards
Timo
Timo Rohrberg
2011-10-17 06:27:53 UTC
Permalink
Hello Igor,

thank you again for your hint. Unfortunately, it did not help. In
fact, I already tried to include the dependency declaration with
classifier "sources". I just do not get it, why Tycho cannot find the
artifact which is clearly marked by the "sources" classifier.

I attached the adapted version of my setup for you to cross-check.
Do you have any other hints how to solve the issue?

Regards
Timo
Post by Igor Fedorenko
see inline
--
Regards,
Igor
Post by Timo Rohrberg
Hello Igor,
thank you for your answer. Unfortunately, I did not completely
understand what you wanted to tell me. If you run "mvn install" on my
sample com.example.logging project, the resulting
"com.example.logging-1.6.1-SNAPSHOT-sources.jar" does have an OSGi
bundle manifest. In fact that's exactly the benefit of using the
tycho-source-plugin instead of packing the jar manually via the
maven-jar-plugin plugin. The manifest correctly identifies the bundle
as source bundle to the com.example.logging bundle contained in the
"com.example.logging-1.6.1-SNAPSHOT.jar" which itself is provided with
an OSGi bundle manifest.
I did not notice the attachment and I assumed you used maven-source-plugin
to produce sources jar.
Post by Timo Rohrberg
What exactly do you mean by "has to be added as feature maven dependency"?
In the com.example.logging.feature project, I declared the dependency
<dependencies>
  <dependency>
    <groupId>example</groupId>
    <artifactId>com.example.logging</artifactId>
    <version>1.6.1-SNAPSHOT</version>
  </dependency>
</dependencies>
I can then list the com.example.logging plugin in the feature.xml and
Tycho builds the feature correctly.
In contrary, with the com.example.logging.source.feature project this
does not work, since Tycho obviously does not correctly resolve the
dependency to the "com.example.logging-1.6.1-SNAPSHOT-sources.jar" in
which the com.example.logging.source plugin is to be found.
The <dependency/> element above defines dependency on the main artifact,
for sources jar you also need to have
 <dependency>
   <groupId>example</groupId>
   <artifactId>com.example.logging</artifactId>
   <version>1.6.1-SNAPSHOT</version>
   <classifier>sources</classifier>
 </dependency>
Post by Timo Rohrberg
Of course my sample setup is a bit special as I am wrapping
third-party libraries in OSGi bundles. But the use case of resolving
binary and source bundles built with Tycho is a common one, I guess.
How would I work with such binary and source bundles if Tycho could
not resolve them?
Any hints, comments, suggestions, ...?
Thank you very much for all your help so far.
Regards
Timo
Post by Igor Fedorenko
Sources jar has to have specific OSGi bundle manifest and has to be
added as feature maven dependency. I am not sure it is possible to
create sources jar with custom manifest, but I am not 100% sure about that.
--
Regards,
Igor
Post by Timo Rohrberg
Hello everybody,
this is a more general form of my original question and problem
description
(http://dev.eclipse.org/mhonarc/lists/tycho-user/msg01026.html).
The latter is obsolete now.
I am successfully building binary and sources artifacts for a bundle
which wraps third party libraries. Both, the normal and the sources
artifact, are correctly deployed to my local Maven repository. I then
build two feature projects with Tycho, one including the plugin from
the binary artifact, and the other including it from the sources
artifact. Building the first one works, but when trying to build the
second one, Tycho obviously cannot resolve the sources artifact
correctly and thus stops with a "Missing requirement" exception. The
com.example.logging.source plugin referred to by the feature.xml
cannot be found. My idea was to explicitely set the "sources"
classifier when declaring the pom-Dependency in the feature project.
But unfortunately this also doesn't help.
Do you have any idea? Thank you for any hints, advices, etc.
Regards
Timo
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
Igor Fedorenko
2011-10-17 13:58:30 UTC
Permalink
Please open a bug report, apparently Tycho does not properly install p2
metadata for sources bundle.

--
Regards,
Igor
Post by Timo Rohrberg
Hello Igor,
thank you again for your hint. Unfortunately, it did not help. In
fact, I already tried to include the dependency declaration with
classifier "sources". I just do not get it, why Tycho cannot find the
artifact which is clearly marked by the "sources" classifier.
I attached the adapted version of my setup for you to cross-check.
Do you have any other hints how to solve the issue?
Regards
Timo
Post by Igor Fedorenko
see inline
--
Regards,
Igor
Post by Timo Rohrberg
Hello Igor,
thank you for your answer. Unfortunately, I did not completely
understand what you wanted to tell me. If you run "mvn install" on my
sample com.example.logging project, the resulting
"com.example.logging-1.6.1-SNAPSHOT-sources.jar" does have an OSGi
bundle manifest. In fact that's exactly the benefit of using the
tycho-source-plugin instead of packing the jar manually via the
maven-jar-plugin plugin. The manifest correctly identifies the bundle
as source bundle to the com.example.logging bundle contained in the
"com.example.logging-1.6.1-SNAPSHOT.jar" which itself is provided with
an OSGi bundle manifest.
I did not notice the attachment and I assumed you used maven-source-plugin
to produce sources jar.
Post by Timo Rohrberg
What exactly do you mean by "has to be added as feature maven dependency"?
In the com.example.logging.feature project, I declared the dependency
<dependencies>
<dependency>
<groupId>example</groupId>
<artifactId>com.example.logging</artifactId>
<version>1.6.1-SNAPSHOT</version>
</dependency>
</dependencies>
I can then list the com.example.logging plugin in the feature.xml and
Tycho builds the feature correctly.
In contrary, with the com.example.logging.source.feature project this
does not work, since Tycho obviously does not correctly resolve the
dependency to the "com.example.logging-1.6.1-SNAPSHOT-sources.jar" in
which the com.example.logging.source plugin is to be found.
The<dependency/> element above defines dependency on the main artifact,
for sources jar you also need to have
<dependency>
<groupId>example</groupId>
<artifactId>com.example.logging</artifactId>
<version>1.6.1-SNAPSHOT</version>
<classifier>sources</classifier>
</dependency>
Post by Timo Rohrberg
Of course my sample setup is a bit special as I am wrapping
third-party libraries in OSGi bundles. But the use case of resolving
binary and source bundles built with Tycho is a common one, I guess.
How would I work with such binary and source bundles if Tycho could
not resolve them?
Any hints, comments, suggestions, ...?
Thank you very much for all your help so far.
Regards
Timo
Post by Igor Fedorenko
Sources jar has to have specific OSGi bundle manifest and has to be
added as feature maven dependency. I am not sure it is possible to
create sources jar with custom manifest, but I am not 100% sure about that.
--
Regards,
Igor
Post by Timo Rohrberg
Hello everybody,
this is a more general form of my original question and problem
description
(http://dev.eclipse.org/mhonarc/lists/tycho-user/msg01026.html).
The latter is obsolete now.
I am successfully building binary and sources artifacts for a bundle
which wraps third party libraries. Both, the normal and the sources
artifact, are correctly deployed to my local Maven repository. I then
build two feature projects with Tycho, one including the plugin from
the binary artifact, and the other including it from the sources
artifact. Building the first one works, but when trying to build the
second one, Tycho obviously cannot resolve the sources artifact
correctly and thus stops with a "Missing requirement" exception. The
com.example.logging.source plugin referred to by the feature.xml
cannot be found. My idea was to explicitely set the "sources"
classifier when declaring the pom-Dependency in the feature project.
But unfortunately this also doesn't help.
Do you have any idea? Thank you for any hints, advices, etc.
Regards
Timo
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
Timo Rohrberg
2011-10-17 14:41:18 UTC
Permalink
This was also my idea. I opened a bugreport
(https://bugs.eclipse.org/bugs/show_bug.cgi?id=361149) and hope for a
quick solution :-).

Regards
Timo
Post by Igor Fedorenko
Please open a bug report, apparently Tycho does not properly install p2
metadata for sources bundle.
--
Regards,
Igor
Post by Timo Rohrberg
Hello Igor,
thank you again for your hint. Unfortunately, it did not help. In
fact, I already tried to include the dependency declaration with
classifier "sources". I just do not get it, why Tycho cannot find the
artifact which is clearly marked by the "sources" classifier.
I attached the adapted version of my setup for you to cross-check.
Do you have any other hints how to solve the issue?
Regards
Timo
Post by Igor Fedorenko
see inline
--
Regards,
Igor
Post by Timo Rohrberg
Hello Igor,
thank you for your answer. Unfortunately, I did not completely
understand what you wanted to tell me. If you run "mvn install" on my
sample com.example.logging project, the resulting
"com.example.logging-1.6.1-SNAPSHOT-sources.jar" does have an OSGi
bundle manifest. In fact that's exactly the benefit of using the
tycho-source-plugin instead of packing the jar manually via the
maven-jar-plugin plugin. The manifest correctly identifies the bundle
as source bundle to the com.example.logging bundle contained in the
"com.example.logging-1.6.1-SNAPSHOT.jar" which itself is provided with
an OSGi bundle manifest.
I did not notice the attachment and I assumed you used
maven-source-plugin
to produce sources jar.
Post by Timo Rohrberg
What exactly do you mean by "has to be added as feature maven dependency"?
In the com.example.logging.feature project, I declared the dependency
<dependencies>
  <dependency>
    <groupId>example</groupId>
    <artifactId>com.example.logging</artifactId>
    <version>1.6.1-SNAPSHOT</version>
  </dependency>
</dependencies>
I can then list the com.example.logging plugin in the feature.xml and
Tycho builds the feature correctly.
In contrary, with the com.example.logging.source.feature project this
does not work, since Tycho obviously does not correctly resolve the
dependency to the "com.example.logging-1.6.1-SNAPSHOT-sources.jar" in
which the com.example.logging.source plugin is to be found.
The<dependency/>  element above defines dependency on the main artifact,
for sources jar you also need to have
 <dependency>
   <groupId>example</groupId>
   <artifactId>com.example.logging</artifactId>
   <version>1.6.1-SNAPSHOT</version>
   <classifier>sources</classifier>
 </dependency>
Post by Timo Rohrberg
Of course my sample setup is a bit special as I am wrapping
third-party libraries in OSGi bundles. But the use case of resolving
binary and source bundles built with Tycho is a common one, I guess.
How would I work with such binary and source bundles if Tycho could
not resolve them?
Any hints, comments, suggestions, ...?
Thank you very much for all your help so far.
Regards
Timo
Post by Igor Fedorenko
Sources jar has to have specific OSGi bundle manifest and has to be
added as feature maven dependency. I am not sure it is possible to
create sources jar with custom manifest, but I am not 100% sure about that.
--
Regards,
Igor
Post by Timo Rohrberg
Hello everybody,
this is a more general form of my original question and problem
description
(http://dev.eclipse.org/mhonarc/lists/tycho-user/msg01026.html).
The latter is obsolete now.
I am successfully building binary and sources artifacts for a bundle
which wraps third party libraries. Both, the normal and the sources
artifact, are correctly deployed to my local Maven repository. I then
build two feature projects with Tycho, one including the plugin from
the binary artifact, and the other including it from the sources
artifact. Building the first one works, but when trying to build the
second one, Tycho obviously cannot resolve the sources artifact
correctly and thus stops with a "Missing requirement" exception. The
com.example.logging.source plugin referred to by the feature.xml
cannot be found. My idea was to explicitely set the "sources"
classifier when declaring the pom-Dependency in the feature project.
But unfortunately this also doesn't help.
Do you have any idea? Thank you for any hints, advices, etc.
Regards
Timo
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
Continue reading on narkive:
Loading...