當前位置: 首頁>>代碼示例>>Java>>正文


Java DependencyResolutionRequiredException.getMessage方法代碼示例

本文整理匯總了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);
    }
}
 
開發者ID:lesfurets,項目名稱:dOOv,代碼行數:23,代碼來源:ClassLoaderUtils.java

示例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()]);
}
 
開發者ID:ethlo,項目名稱:eclipselink-maven-plugin,代碼行數:27,代碼來源:EclipselinkStaticWeaveMojo.java

示例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()]);
}
 
開發者ID:ethlo,項目名稱:eclipselink-maven-plugin,代碼行數:28,代碼來源:EclipselinkModelGenMojo.java


注:本文中的org.apache.maven.artifact.DependencyResolutionRequiredException.getMessage方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。