本文整理匯總了Java中org.apache.maven.artifact.DependencyResolutionRequiredException.getMessage方法的典型用法代碼示例。如果您正苦於以下問題:Java DependencyResolutionRequiredException.getMessage方法的具體用法?Java DependencyResolutionRequiredException.getMessage怎麽用?Java DependencyResolutionRequiredException.getMessage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.maven.artifact.DependencyResolutionRequiredException
的用法示例。
在下文中一共展示了DependencyResolutionRequiredException.getMessage方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getUrlClassLoader
import org.apache.maven.artifact.DependencyResolutionRequiredException; //導入方法依賴的package包/類
public static URLClassLoader getUrlClassLoader(MavenProject project) throws MojoFailureException {
try {
// collect compile classpath classes
final List<File> files = new ArrayList<>();
files.addAll(project.getCompileClasspathElements().stream().map(File::new).collect(toList()));
// collect project dependencies
files.addAll(project.getDependencyArtifacts().stream()
.map(a -> DependencyUtils.resolve(a, project))
.filter(Objects::nonNull)
.collect(toList()));
final List<URL> urls = files.stream()
.filter(f -> f != null && f.exists())
.map(new FileToUrl())
.collect(toList());
return new URLClassLoader(urls.toArray(new URL[urls.size()]), currentThread().getContextClassLoader());
} catch (DependencyResolutionRequiredException e) {
throw new MojoFailureException(e.getMessage(), e);
}
}
示例2: getClassPathFiles
import org.apache.maven.artifact.DependencyResolutionRequiredException; //導入方法依賴的package包/類
private File[] getClassPathFiles()
{
final List<File> files = new ArrayList<>();
List<?> classpathElements;
try
{
classpathElements = project.getTestClasspathElements();
}
catch (DependencyResolutionRequiredException e)
{
throw new RuntimeException(e.getMessage(), e);
}
for (final Object o : classpathElements)
{
if (o != null)
{
final File file = new File(o.toString());
if (file.canRead())
{
files.add(file);
}
}
}
return files.toArray(new File[files.size()]);
}
示例3: getClassPathFiles
import org.apache.maven.artifact.DependencyResolutionRequiredException; //導入方法依賴的package包/類
private File[] getClassPathFiles()
{
final Set<File> files = new TreeSet<>(getCurrentClassPath());
List<?> classpathElements;
try
{
classpathElements = project.getTestClasspathElements();
}
catch (DependencyResolutionRequiredException e)
{
throw new RuntimeException(e.getMessage(), e);
}
for (final Object o : classpathElements)
{
if (o != null)
{
final File file = new File(o.toString());
if (file.canRead())
{
files.add(file);
}
}
}
return files.toArray(new File[files.size()]);
}