-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixup Director Mojo when used as a plugin in pom.xml
(cherry picked from commit 2f81c3b)
- Loading branch information
Showing
3 changed files
with
47 additions
and
9 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
tycho-core/src/main/java/org/eclipse/tycho/p2tools/TychoDirectorApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2023 Christoph Läubrich and others. | ||
* This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License 2.0 | ||
* which accompanies this distribution, and is available at | ||
* https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Christoph Läubrich - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.tycho.p2tools; | ||
|
||
import org.eclipse.equinox.internal.p2.director.app.DirectorApplication; | ||
import org.eclipse.equinox.p2.core.IProvisioningAgent; | ||
import org.eclipse.equinox.p2.core.IProvisioningAgentProvider; | ||
import org.eclipse.equinox.p2.repository.artifact.IArtifactRepositoryManager; | ||
|
||
/** | ||
* Enhances the P2 {@link DirectorApplication} by injecting the agent provider from plexus context, | ||
* additionally to that ensures that the extension classloader is used to load this class as it is | ||
* part of tycho-core module. | ||
*/ | ||
public class TychoDirectorApplication extends DirectorApplication { | ||
|
||
public TychoDirectorApplication(IProvisioningAgentProvider agentProvider, IProvisioningAgent agent) { | ||
//TODO should be able to control agent creation see https://github.com/eclipse-equinox/p2/pull/398 | ||
//Until now we need to fetch a service to trigger loading of the internal osgi framework... | ||
agent.getService(IArtifactRepositoryManager.class); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters