-
Notifications
You must be signed in to change notification settings - Fork 194
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
- Loading branch information
Showing
4 changed files
with
49 additions
and
10 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
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