Skip to content

Commit c64a766

Browse files
ptzieglerHannesWell
authored andcommitted
Delete the profile of nested target files on reload.
Otherwise Eclipse will use the old, (potentially outdated) profiles to resolve their artifacts. If one or more artifacts are not contained in the old profile, resolving the file fails until the metadata folder is cleared. Resolves issue #90
1 parent 6c6d51f commit c64a766

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/TargetReferenceBundleContainer.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2021 Christoph Läubrich and others.
2+
* Copyright (c) 2021, 2022 Christoph Läubrich and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -10,6 +10,7 @@
1010
*
1111
* Contributors:
1212
* Christoph Läubrich - initial API and implementation
13+
* Patrick Ziegler - issue #90: Unable to load p2 dependencies from nested target files
1314
*******************************************************************************/
1415
package org.eclipse.pde.internal.core.target;
1516

@@ -24,6 +25,7 @@
2425
import org.eclipse.pde.core.target.ITargetDefinition;
2526
import org.eclipse.pde.core.target.TargetBundle;
2627
import org.eclipse.pde.core.target.TargetFeature;
28+
import org.eclipse.pde.internal.core.PDECore;
2729

2830
public class TargetReferenceBundleContainer extends AbstractBundleContainer {
2931

@@ -100,6 +102,13 @@ public Optional<ITargetDefinition> targetDefinition() {
100102
}
101103

102104
public void reload() {
105+
if (targetDefinition != null) {
106+
try {
107+
P2TargetUtils.deleteProfile(targetDefinition.getHandle());
108+
} catch (CoreException e) {
109+
PDECore.log(e);
110+
}
111+
}
103112
targetDefinition = null;
104113
}
105114

0 commit comments

Comments
 (0)