Refine search
@SuppressWarnings("unchecked") public List<URL> build() throws MalformedURLException { List<URL> cp = new ArrayList<>(); cp.addAll(resources(project.getResources())); cp.add(new File(project.getBuild().getOutputDirectory()).toURI().toURL()); cp.addAll(jars(project.getArtifacts())); return cp; }
public List getSystemClasspathElements() throws DependencyResolutionRequiredException { List list = new ArrayList( getArtifacts().size() ); list.add( getBuild().getOutputDirectory() ); for ( Iterator i = getArtifacts().iterator(); i.hasNext(); ) { Artifact a = (Artifact) i.next(); if ( a.getArtifactHandler().isAddedToClasspath() ) { // TODO: let the scope handler deal with this if ( Artifact.SCOPE_SYSTEM.equals( a.getScope() ) ) { addArtifactPath( a, list ); } } } return list; }
@SuppressWarnings("unchecked") protected final ClassLoader getClassLoader() throws MojoExecutionException, DependencyResolutionRequiredException { final MavenProject project = project(); final List<String> classpathElements = new ArrayList<>(); classpathElements.addAll(project.getCompileClasspathElements()); classpathElements.addAll(project.getRuntimeClasspathElements()); classpathElements.add(project.getBuild().getOutputDirectory()); final List<URL> projectClasspathList = new ArrayList<>(); for (final String element : classpathElements) { try { projectClasspathList.add(new File(element).toURI().toURL()); } catch (final MalformedURLException ex) { throw new MojoExecutionException( element + " is an invalid classpath element", ex ); } } return new URLClassLoader( projectClasspathList.toArray(new URL[projectClasspathList.size()]), Thread.currentThread().getContextClassLoader() ); }
public List getRuntimeClasspathElements() throws DependencyResolutionRequiredException { List list = new ArrayList( getArtifacts().size() + 1 ); list.add( getBuild().getOutputDirectory() ); for ( Iterator i = getArtifacts().iterator(); i.hasNext(); ) { Artifact a = (Artifact) i.next(); if ( a.getArtifactHandler().isAddedToClasspath() ) { // TODO: let the scope handler deal with this if ( Artifact.SCOPE_COMPILE.equals( a.getScope() ) || Artifact.SCOPE_RUNTIME.equals( a.getScope() ) ) { File file = a.getFile(); if ( file == null ) { throw new DependencyResolutionRequiredException( a ); } list.add( file.getPath() ); } } } return list; }
public List getTestClasspathElements() throws DependencyResolutionRequiredException { List list = new ArrayList( getArtifacts().size() + 1 ); list.add( getBuild().getTestOutputDirectory() ); list.add( getBuild().getOutputDirectory() ); for ( Iterator i = getArtifacts().iterator(); i.hasNext(); ) { Artifact a = (Artifact) i.next(); if ( a.getArtifactHandler().isAddedToClasspath() ) { // TODO: let the scope handler deal with this // NOTE: [jc] scope == 'test' is the widest possible scope, so we don't really need to perform // this check... // if ( Artifact.SCOPE_TEST.equals( a.getScope() ) || Artifact.SCOPE_COMPILE.equals( a.getScope() ) || // Artifact.SCOPE_RUNTIME.equals( a.getScope() ) ) // { // } File file = a.getFile(); if ( file == null ) { throw new DependencyResolutionRequiredException( a ); } list.add( file.getPath() ); } } return list; }
public List getCompileClasspathElements() throws DependencyResolutionRequiredException { List list = new ArrayList( getArtifacts().size() ); list.add( getBuild().getOutputDirectory() ); for ( Iterator i = getArtifacts().iterator(); i.hasNext(); ) { Artifact a = (Artifact) i.next(); if ( a.getArtifactHandler().isAddedToClasspath() ) { // TODO: let the scope handler deal with this if ( Artifact.SCOPE_COMPILE.equals( a.getScope() ) || Artifact.SCOPE_PROVIDED.equals( a.getScope() ) || Artifact.SCOPE_SYSTEM.equals( a.getScope() ) ) { addArtifactPath( a, list ); } } } return list; }
@Deprecated public List<String> getSystemClasspathElements() throws DependencyResolutionRequiredException { List<String> list = new ArrayList<>( getArtifacts().size() ); String d = getBuild().getOutputDirectory(); if ( d != null ) { list.add( d ); } for ( Artifact a : getArtifacts() ) { if ( a.getArtifactHandler().isAddedToClasspath() ) { // TODO let the scope handler deal with this if ( Artifact.SCOPE_SYSTEM.equals( a.getScope() ) ) { addArtifactPath( a, list ); } } } return list; }
public List<String> getTestClasspathElements() throws DependencyResolutionRequiredException { List<String> list = new ArrayList<>( getArtifacts().size() + 2 ); String d = getBuild().getTestOutputDirectory(); if ( d != null ) { list.add( d ); } d = getBuild().getOutputDirectory(); if ( d != null ) { list.add( d ); } for ( Artifact a : getArtifacts() ) { if ( a.getArtifactHandler().isAddedToClasspath() ) { addArtifactPath( a, list ); } } return list; }
public List<String> getRuntimeClasspathElements() throws DependencyResolutionRequiredException { List<String> list = new ArrayList<>( getArtifacts().size() + 1 ); String d = getBuild().getOutputDirectory(); if ( d != null ) { list.add( d ); } for ( Artifact a : getArtifacts() ) { if ( a.getArtifactHandler().isAddedToClasspath() // TODO let the scope handler deal with this && ( Artifact.SCOPE_COMPILE.equals( a.getScope() ) || Artifact.SCOPE_RUNTIME.equals( a.getScope() ) ) ) { addArtifactPath( a, list ); } } return list; }
public List<String> getCompileClasspathElements() throws DependencyResolutionRequiredException { List<String> list = new ArrayList<>( getArtifacts().size() + 1 ); String d = getBuild().getOutputDirectory(); if ( d != null ) { list.add( d ); } for ( Artifact a : getArtifacts() ) { if ( a.getArtifactHandler().isAddedToClasspath() ) { // TODO let the scope handler deal with this if ( Artifact.SCOPE_COMPILE.equals( a.getScope() ) || Artifact.SCOPE_PROVIDED.equals( a.getScope() ) || Artifact.SCOPE_SYSTEM.equals( a.getScope() ) ) { addArtifactPath( a, list ); } } } return list; }
@Override public void execute() throws MojoExecutionException, MojoFailureException { if (mainClass == null) { throw new MojoExecutionException("main class not configured"); } try (URLClassLoader loader = new Classpath(mavenProject).toClassLoader()) { Path srcdir = new File(mavenProject.getBuild().getSourceDirectory()).toPath(); Path bindir = new File(mavenProject.getBuild().getOutputDirectory()).toPath(); getLog().debug("Using classloader " + loader); getLog().debug(" source: " + srcdir); getLog().debug(" bin: " + bindir); Path output = new ApiParser(srcdir) .with(loader) .export(bindir, mainClass); getLog().info("API file: " + output); } catch (Exception x) { throw new MojoFailureException("ApiTool resulted in exception: ", x); } } }
v.length() == 0 || v.endsWith(separator) ? v + s : v + separator + s); properties.setProperty("platform.artifacts", project.getBuild().getOutputDirectory()); for (Artifact a : plugin.getArtifacts()) { String s = a.getFile().getCanonicalPath();
getLog().debug( "Adding dex input : " + project.getBuild().getOutputDirectory() ); for ( Artifact artifact : filterArtifacts( getTransitiveDependencyArtifacts(), skipDependencies, artifactTypeSet.getIncludes(), artifactTypeSet.getExcludes(), artifactSet.getIncludes(),
return new File( project.getBuild().getTestOutputDirectory() ); if ( project.hasLifecyclePhase( "compile" ) && COMPILE_PHASE_TYPES.contains( type ) ) return new File( project.getBuild().getOutputDirectory() );
Build build = project.getBuild(); if ( !objectEquals( oBuild.getOutputDirectory(), build.getOutputDirectory() ) )
throws ModelInterpolationException Build changedBuild = project.getBuild(); Build dynamicBuild = project.getDynamicBuild(); Build originalInterpolatedBuild = project.getOriginalInterpolatedBuild(); debugMessages ) ); dynamicBuild.setOutputDirectory( restoreString( dynamicBuild.getOutputDirectory(), originalInterpolatedBuild.getOutputDirectory(), changedBuild.getOutputDirectory(), project, config,
public void execute() throws MojoExecutionException, MojoFailureException { String targetDirectory = project.getBuild().getOutputDirectory(); String htm = GitInfo.genHtml(); try { FileOutputStream fout = new FileOutputStream(targetDirectory + System.getProperty("file.separator") + "git_info.html"); fout.write(htm.getBytes()); } catch (Exception e) { throw new ExecException(e); } } }
private Collection<String> findOccupiedPackages() { String outputDirName = this.mojo.getProject().getBuild() .getOutputDirectory(); File outputDir = new File(outputDirName); return findOccupiedPackagesIn(outputDir); }
private void createArtifactJar(Set<Artifact> artifacts) throws Exception { List<PluginDescriptor> pluginDescriptors = getPluginDescriptors(artifacts); validateConfigForDuplicates(); for (PluginConfig pluginConfig : pluginConfigs) { validateConfigItem(pluginDescriptors, pluginConfig); } String pluginsJson = transform(pluginDescriptors); File metaInfDir = new File(project.getBuild().getOutputDirectory(), "META-INF"); File file = new File(metaInfDir, "glowroot.plugins.json"); if (!metaInfDir.exists() && !metaInfDir.mkdirs()) { throw new IOException("Could not create directory: " + metaInfDir.getAbsolutePath()); } Files.write(pluginsJson, file, UTF_8); }
private String getBuildClasspath() { StringBuilder sb = new StringBuilder(); sb.append(project.getBuild().getOutputDirectory()); sb.append(File.pathSeparator); project.getBuild().getOutputDirectory())) {