本文整理汇总了Java中org.codehaus.plexus.context.ContextException类的典型用法代码示例。如果您正苦于以下问题:Java ContextException类的具体用法?Java ContextException怎么用?Java ContextException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ContextException类属于org.codehaus.plexus.context包,在下文中一共展示了ContextException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getProfileActivators
import org.codehaus.plexus.context.ContextException; //导入依赖的package包/类
private static ProfileActivator[] getProfileActivators(File basedir) throws RemoteException {
SystemPropertyProfileActivator sysPropertyActivator = new SystemPropertyProfileActivator();
DefaultContext context = new DefaultContext();
context.put("SystemProperties", MavenServerUtil.collectSystemProperties());
try {
sysPropertyActivator.contextualize(context);
}
catch (ContextException e) {
Maven2ServerGlobals.getLogger().error(e);
return new ProfileActivator[0];
}
return new ProfileActivator[]{new MyFileProfileActivator(basedir),
sysPropertyActivator,
new JdkPrefixProfileActivator(),
new OperatingSystemProfileActivator()};
}
示例2: getProfileActivators
import org.codehaus.plexus.context.ContextException; //导入依赖的package包/类
private static ProfileActivator[] getProfileActivators(File basedir) throws RemoteException {
SystemPropertyProfileActivator sysPropertyActivator = new SystemPropertyProfileActivator();
DefaultContext context = new DefaultContext();
context.put("SystemProperties", collectSystemProperties());
try {
sysPropertyActivator.contextualize(context);
} catch (ContextException e) {
MavenServerContext.getLogger().error(e);
return new ProfileActivator[0];
}
return new ProfileActivator[] {
new MavenFileProfileActivator(basedir),
sysPropertyActivator,
new JdkPrefixProfileActivator(),
new OperatingSystemProfileActivator()
};
}
示例3: getProfileActivators
import org.codehaus.plexus.context.ContextException; //导入依赖的package包/类
private static ProfileActivator[] getProfileActivators(File basedir) throws RemoteException {
SystemPropertyProfileActivator sysPropertyActivator = new SystemPropertyProfileActivator();
DefaultContext context = new DefaultContext();
context.put("SystemProperties", MavenServerUtil.collectSystemProperties());
try {
sysPropertyActivator.contextualize(context);
}
catch (ContextException e) {
Maven3ServerGlobals.getLogger().error(e);
return new ProfileActivator[0];
}
return new ProfileActivator[]{new MyFileProfileActivator(basedir),
sysPropertyActivator,
new JdkPrefixProfileActivator(),
new OperatingSystemProfileActivator()};
}
示例4: getProfileActivators
import org.codehaus.plexus.context.ContextException; //导入依赖的package包/类
private static ProfileActivator[] getProfileActivators(File basedir) throws RemoteException {
SystemPropertyProfileActivator sysPropertyActivator = new SystemPropertyProfileActivator();
DefaultContext context = new DefaultContext();
context.put("SystemProperties", MavenServerUtil.collectSystemProperties());
try {
sysPropertyActivator.contextualize(context);
}
catch (ContextException e) {
Maven3ServerGlobals.getLogger().error(e);
return new ProfileActivator[0];
}
return new ProfileActivator[]{new MyFileProfileActivator(basedir), sysPropertyActivator, new JdkPrefixProfileActivator(),
new OperatingSystemProfileActivator()};
}
示例5: analyze
import org.codehaus.plexus.context.ContextException; //导入依赖的package包/类
/**
* Analyze the project.
* @param env The environment
* @return The result of analysis
*/
private static ProjectDependencyAnalysis analyze(
final MavenEnvironment env) {
try {
return ((ProjectDependencyAnalyzer)
((PlexusContainer)
env.context().get(PlexusConstants.PLEXUS_KEY)
).lookup(ProjectDependencyAnalyzer.ROLE, "default")
).analyze(env.project());
} catch (final ContextException | ComponentLookupException
| ProjectDependencyAnalyzerException ex) {
throw new IllegalStateException(ex);
}
}
示例6: get
import org.codehaus.plexus.context.ContextException; //导入依赖的package包/类
/**
* Gets the list of watchers from the given Plexus context.
*
* @param context the Plexus context
* @return the list of watcher, empty if none. Modifying the resulting list, updates the stored list.
*/
static synchronized List<Watcher> get(Context context) {
List<Watcher> watchers;
if (context.contains(WATCHERS_KEY)) {
try {
watchers = (List<Watcher>) context.get(WATCHERS_KEY);
} catch (ContextException e) {
throw new IllegalStateException("Cannot extract the watcher from the context", e);
}
} else {
watchers = new ArrayList<>();
context.put(WATCHERS_KEY, watchers);
}
return watchers;
}
示例7: contextualize
import org.codehaus.plexus.context.ContextException; //导入依赖的package包/类
public void contextualize( Context context )
throws ContextException
{
plexusContainer = (PlexusContainer) context.get( PlexusConstants.PLEXUS_KEY );
}
示例8: contextualize
import org.codehaus.plexus.context.ContextException; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
public void contextualize( Context context )
throws ContextException
{
container = (PlexusContainer) context.get( PlexusConstants.PLEXUS_KEY );
}
示例9: contextualize
import org.codehaus.plexus.context.ContextException; //导入依赖的package包/类
public void contextualize(Context context) throws ContextException {
plexusContainer = (PlexusContainer) context.get(PlexusConstants.PLEXUS_KEY);
}
示例10: contextualize
import org.codehaus.plexus.context.ContextException; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
public void contextualize( final Context context )
throws ContextException
{
container = (PlexusContainer) context.get( PlexusConstants.PLEXUS_KEY );
}
示例11: contextualize
import org.codehaus.plexus.context.ContextException; //导入依赖的package包/类
@Override
public void contextualize(final Context context) throws ContextException
{
this.container = (PlexusContainer) context.get(PlexusConstants.PLEXUS_KEY);
}
示例12: contextualize
import org.codehaus.plexus.context.ContextException; //导入依赖的package包/类
@Override
public void contextualize(Context context) throws ContextException {
container = (PlexusContainer) context.get(PlexusConstants.PLEXUS_KEY);
}
示例13: contextualize
import org.codehaus.plexus.context.ContextException; //导入依赖的package包/类
@Override
public void contextualize(Context context) throws ContextException {
container = (PlexusContainer) context.get( PlexusConstants.PLEXUS_KEY );
}
示例14: contextualize
import org.codehaus.plexus.context.ContextException; //导入依赖的package包/类
public void contextualize( Context context )
throws ContextException
{
this.container = (PlexusContainer) context.get( PlexusConstants.PLEXUS_KEY );
}
示例15: contextualize
import org.codehaus.plexus.context.ContextException; //导入依赖的package包/类
public void contextualize( Context context )
throws ContextException
{
this.container = (PlexusContainer) context.get( PlexusConstants.PLEXUS_KEY );
}