本文整理汇总了Java中org.gradle.api.artifacts.UnknownConfigurationException类的典型用法代码示例。如果您正苦于以下问题:Java UnknownConfigurationException类的具体用法?Java UnknownConfigurationException怎么用?Java UnknownConfigurationException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UnknownConfigurationException类属于org.gradle.api.artifacts包,在下文中一共展示了UnknownConfigurationException类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createXdepsDependencyConfiguration
import org.gradle.api.artifacts.UnknownConfigurationException; //导入依赖的package包/类
public static void createXdepsDependencyConfiguration(Project project) {
Configuration xdeps;
try {
xdeps = project.getConfigurations().getByName("xdeps");
} catch (UnknownConfigurationException e) {
xdeps = project.getConfigurations().create("xdeps");
}
// https://docs.gradle.org/current/userguide/dependency_management.html#sub:dynamic_versions_and_changing_modules
xdeps.getResolutionStrategy().cacheChangingModulesFor(0, TimeUnit.SECONDS);
}
开发者ID:ctco,项目名称:gradle-mobile-plugin,代码行数:11,代码来源:MobilePluginUtil.java
示例2: createNotFoundException
import org.gradle.api.artifacts.UnknownConfigurationException; //导入依赖的package包/类
@Override
protected UnknownDomainObjectException createNotFoundException(String name) {
return new UnknownConfigurationException(String.format("Configuration with name '%s' not found.", name));
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:5,代码来源:DefaultConfigurationContainer.java
示例3: fixConfig
import org.gradle.api.artifacts.UnknownConfigurationException; //导入依赖的package包/类
private void fixConfig() {
final Project project = getProject();
// defaults
if (classpath == null) {
try {
classpath.add(project.getConfigurations().getByName(TomEEEmbeddedExtension.ALIAS).fileCollection());
} catch (final UnknownConfigurationException uce) {
classpath = project.getConfigurations().getByName(TomEEEmbeddedExtension.NAME);
}
}
if (docBase == null) {
docBase = new File(project.getProjectDir(), "src/main/webapp");
}
if (workDir == null) {
workDir = new File(project.getBuildDir(), "tomee-embedded/work");
}
if (dir == null) {
dir = new File(project.getBuildDir(), "tomee-embedded/run").getAbsolutePath();
}
if (modules == null || modules.isEmpty()) {
final File main = new File(project.getBuildDir(), "classes/main");
if (main.isDirectory()) {
modules = new ArrayList<>(singletonList(main));
}
}
// extension override
for (final String name : asList(TomEEEmbeddedExtension.NAME, TomEEEmbeddedExtension.ALIAS)) {
final TomEEEmbeddedExtension extension = TomEEEmbeddedExtension.class.cast(project.getExtensions().findByName(name));
if (extension != null) {
for (final Field f : TomEEEmbeddedTask.class.getDeclaredFields()) {
if (f.isAnnotationPresent(Input.class)) {
try {
final Field extField = TomEEEmbeddedExtension.class.getDeclaredField(f.getName());
if (!extField.isAccessible()) {
extField.setAccessible(true);
}
final Object val = extField.get(extension);
if (val != null) {
if (!f.isAccessible()) {
f.setAccessible(true);
}
f.set(this, val);
}
} catch (final IllegalAccessException | NoSuchFieldException e) {
getLogger().warn("No field " + f.getName() + " in " + extension, e);
}
}
}
}
}
}
开发者ID:apache,项目名称:tomee,代码行数:55,代码来源:TomEEEmbeddedTask.java
示例4: getByName
import org.gradle.api.artifacts.UnknownConfigurationException; //导入依赖的package包/类
ConfigurationInternal getByName(String name) throws UnknownConfigurationException;
开发者ID:lxxlxx888,项目名称:Reer,代码行数:2,代码来源:ConfigurationContainerInternal.java
注:本文中的org.gradle.api.artifacts.UnknownConfigurationException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论