Hi Jeff
While debuggin we found out that the cause of the problem lies in the
org.eclipse.pde.internal.core.PluginModelManager
class in the initializeTable() method.
private
synchronized
void initializeTable() {
if (fEntries
!= null)
return;
// Cannot assign to fEntries here - will create a race condition with isInitialized()
Map entries = Collections.synchronizedMap(new
TreeMap());
// Create a state that contains all bundles from the target and workspace
// If a workspace bundle has the same symbolic name as a target bundle,
// the target counterpart is subsequently removed from the state.
fState =
new PDEState(fWorkspaceManager.getPluginPaths(),
fExternalManager.getPluginPaths(),
true,
true,
new NullProgressMonitor());
// initialize the enabled/disabled state of target models
// based on whether the bundle is checked/unchecked on the Target Platform
// preference page.
fExternalManager.initializeModels(fState.getTargetModels());
// add target models to the master table
boolean statechanged = addToTable(entries,
fExternalManager.getAllModels());
…
The entries table is initialized only with two bundles (org.eclipse.jdt.debug and org.eclipse.pde.build). We expect it to contain all in the pom.xml dependencies.
We also noticed that the PluginModelManager delegates the plugin path search to the
org.eclipse.pde.internal.core.ExternalModelManager.getPluginPaths() method.
public URL[] getPluginPaths() {
PDEPreferencesManager pref = PDECore.getDefault().getPreferencesManager();
boolean addPool =
false;
String baseLocation = pref.getString(ICoreConstants.PLATFORM_PATH);
URL[] base =
null;
if (P2TargetUtils.BUNDLE_POOL.isPrefixOf(new
Path(baseLocation))) {
// if the base platform path is part of the bundle pool, use the bundle pool
// preference info to restore bundles selectively
addPool =
true;
base =
new URL[0];
}
else {
base = PluginPathFinder.getPluginPaths(baseLocation);
}
…
The value of the baseLocation variable is tychos’ work directory ‘target/work/’. Only the two plugins mentioned before (org.eclipse.jdt.debug and org.eclipse.pde.build)
are found in the ‘plugins’ subdirectory. None of the other dependencies are located there. In fact they lie in the local maven repository (outside the work directory)
Is there is a possibility in the pom.xml to define explicitly the value of the baseLocation ?
I hope this helps to understand the problem better
Thanks
Malu
Von: tycho-user-bounces@xxxxxxxxxxx [mailto:tycho-user-bounces@xxxxxxxxxxx]
Im Auftrag von Jeff MAURY
Gesendet: Donnerstag, 23. Mai 2013 09:43
An: Tycho user list
Betreff: Re: [tycho-user] PluginRegistry Problem with Tycho-Surefire
I don't see something special except the "some text output follows...": where does it come from ?
If you can send us the extract of the code that fails ?
Jeff
On Thu, May 23, 2013 at 7:35 AM, Martha-Lucia Cadavid <martha-lucia.cadavid@xxxxxxxxxxxxx> wrote:
Thanks in advance
Malu
Can you send us the eclipse log file to see if something strange has happened ?
Regards
Jeff
Hi Jeff,
Thank you for the fast reply!
J
This was a good hint and I tried to configure the start levels as follows:
…
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<configuration>
<useUIHarness>false</useUIHarness>
<useUIThread>true</useUIThread>
<bundleStartLevel>
<bundle>
<id>org.eclipse.core.runtime</id>
<level>4</level>
<autoStart>true</autoStart>
</bundle>
…
Unfortunately this did not change anything.
Any more ideas are very appreciated.
Thanks
Malu
Maybe a problem of a start level ?
Jeff
On Wed, May 22, 2013 at 6:45 PM, Martha-Lucia Cadavid <martha-lucia.cadavid@xxxxxxxxxxxxx> wrote:
Hi
We are trying to access the pde plugin registry in a tycho-surefire test as follows:
IPluginModelBase model = PluginRegistry.findModel(mybundle);
However, the plugin registry seems not to contain our bundles. In the osgi registry all our bundles are available:
Bundle[] bundles =
MyPlugin.getDefault().getBundle().getBundleContext().getBundles();
The pom.xml looks as follows:
…
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<configuration>
<useUIHarness>false</useUIHarness>
<useUIThread>true</useUIThread>
<dependencies>
<dependency>
<type>eclipse-feature</type>
<artifactId>my.feature</artifactId>
<version>0.0.0</version>
…
The my.feature contains all necessary dependencies. The plugin tests run without problems in the eclipse ide as eclipse plugin tests, using the same target platform as defined in my.feature
In the target/work/configuration/config.ini file all plugins of my.feature are listed in osgi.bundles.
#Wed May 22 18:16:03 CEST 2013
osgi.bundles=reference\:file\:D\:/WS/mv3repo/p2/osgi/…
osgi.bundlefile.limit=100
osgi.bundles.defaultStartLevel=4
osgi.configuration.cascaded=false
Any ideas?
Malu
*****************************************************
This e-mail may contain confidential material. It is intended only for the person or entity which it is addressed to. In case you should not be supposed to get this e-mail we ask you to delete it without taking notice of its content. Any views or opinions expressed
in this e-mail are those of the sender and do not necessarily coincide with those of The Swiss Raiffeisen Group. Therefore this e-mail does not represent a binding agreement nor an offer to deal. E-Mail transmission can be insecure and can contain errors.
Information could be intercepted, corrupted, lost, destroyed, incomplete or may contain viruses. Neither The Swiss Raiffeisen Group nor the sender can accept any liability for any kind of damage as the result of viruses or transmission errors.
****************************************************
_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/tycho-user
--
Jeff MAURY
Fehler! Es wurde kein Dateiname angegeben.
*****************************************************
This e-mail may contain confidential material. It is intended only for the person or entity which it is addressed to. In case you should not be supposed to get this e-mail we ask
you to delete it without taking notice of its content. Any views or opinions expressed in this e-mail are those of the sender and do not necessarily coincide with those of The Swiss Raiffeisen Group. Therefore this e-mail does not represent a binding agreement
nor an offer to deal. E-Mail transmission can be insecure and can contain errors. Information could be intercepted, corrupted, lost, destroyed, incomplete or may contain viruses. Neither The Swiss Raiffeisen Group nor the sender can accept any liability for
any kind of damage as the result of viruses or transmission errors.
****************************************************
*****************************************************
This e-mail may contain confidential material. It is intended only for the person or entity which it is addressed to. In case you should not be supposed to get this e-mail we ask you to delete it without taking notice of its content. Any views or opinions expressed
in this e-mail are those of the sender and do not necessarily coincide with those of The Swiss Raiffeisen Group. Therefore this e-mail does not represent a binding agreement nor an offer to deal. E-Mail transmission can be insecure and can contain errors.
Information could be intercepted, corrupted, lost, destroyed, incomplete or may contain viruses. Neither The Swiss Raiffeisen Group nor the sender can accept any liability for any kind of damage as the result of viruses or transmission errors.
****************************************************
_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/tycho-user
--
Jeff MAURY
"Legacy code" often differs from its suggested alternative by actually working and scaling.
- Bjarne Stroustrup
http://www.jeffmaury.com
http://riadiscuss.jeffmaury.com
http://www.twitter.com/jeffmaury