Refine search
private File localFile(final String... paths) { File result = mavenProject.getBasedir(); for (String path : paths) { result = new File(result, path); } return result; }
private static File prepareAbsolutePath(MojoParameters params, String directory, String path) { File file = new File(path); if (file.isAbsolute()) { return file; } return new File(new File(params.getProject().getBasedir(), directory), path); }
private Set<File> refbasedir(final MavenProject project, final Set<Artifact> references) { Set<File> cp = new LinkedHashSet<>(); for (Artifact reference : references) { File basedir = project.getParent().getBasedir(); cp.add(new File(basedir, reference.getArtifactId())); } return cp; }
public UnpackedLibHelper( ArtifactResolverHelper artifactResolverHelper, MavenProject project, Logger log, File unpackedLibsFolder ) { this.artifactResolverHelper = artifactResolverHelper; if ( unpackedLibsFolder != null ) { // if absolute then use it. // if relative then make it relative to the basedir of the project. this.unpackedLibsDirectory = unpackedLibsFolder.isAbsolute() ? unpackedLibsFolder : new File( project.getBasedir(), unpackedLibsFolder.getPath() ); } else { // If not specified then default to target/unpacked-libs final File targetFolder = new File( project.getBuild().getDirectory() ); this.unpackedLibsDirectory = new File( targetFolder, "unpacked-libs" ); } this.log = log; }
private void addPath( List<String> paths, String path ) { if ( path != null ) { path = path.trim(); if ( path.length() > 0 ) { File file = new File( path ); if ( file.isAbsolute() ) { path = file.getAbsolutePath(); } else { path = new File( getBasedir(), path ).getAbsolutePath(); } if ( !paths.contains( path ) ) { paths.add( path ); } } } }
File selectedProject = new File( new File( reactorDirectory, selector ).toURI().normalize() ); return selectedProject.equals( project.getBasedir() );
private static MavenProject findProject( String projectName, Map projectMap, MavenProject topLevelProject ) throws MissingProjectException { MavenProject project = (MavenProject) projectMap.get( projectName ); if ( project != null ) return project; // in that case, it must be a file path File baseDir; if ( topLevelProject == null ) { baseDir = new File( System.getProperty( "user.dir" ) ); } else { baseDir = topLevelProject.getBasedir(); // or should this be .getFile().getParentFile() ? } File projectDir = new File( baseDir, projectName ); if ( !projectDir.exists() ) { throw new MissingProjectException( "Couldn't find specified project dir: " + projectDir.getAbsolutePath() ); } if ( !projectDir.isDirectory() ) { throw new MissingProjectException( "Couldn't find specified project dir (not a directory): " + projectDir.getAbsolutePath() ); } for ( Iterator i = projectMap.values().iterator(); i.hasNext(); ) { project = (MavenProject) i.next(); if ( projectDir.equals( project.getFile().getParentFile() ) ) return project; } throw new MissingProjectException( "Couldn't find specified project in module list: " + projectDir.getAbsolutePath() ); }
@SuppressWarnings("unchecked") private static Watcher setupCompiler(final MavenProject project, final String compiler, final List<String> srcExtensions, final Consumer<String> task) throws MojoFailureException { File eclipseClasspath = new File(project.getBasedir(), ".classpath"); if ("off".equalsIgnoreCase(compiler) || eclipseClasspath.exists()) { return null; resources.add(0, new File(project.getBuild().getSourceDirectory())); List<Path> paths = resources.stream() .filter(File::exists)
private String initImageConfiguration(Date buildTimeStamp) { // Resolve images resolvedImages = ConfigHelper.resolveImages( log, images, // Unresolved images new ConfigHelper.Resolver() { @Override public List<ImageConfiguration> resolve(ImageConfiguration image) { return imageConfigResolver.resolve(image, project, session); } }, filter, // A filter which image to process this); // customizer (can be overwritten by a subclass) // Check for simple Dockerfile mode File topDockerfile = new File(project.getBasedir(),"Dockerfile"); if (topDockerfile.exists()) { if (resolvedImages.isEmpty()) { resolvedImages.add(createSimpleDockerfileConfig(topDockerfile)); } else if (resolvedImages.size() == 1 && resolvedImages.get(0).getBuildConfiguration() == null) { resolvedImages.set(0, addSimpleDockerfileConfig(resolvedImages.get(0), topDockerfile)); } } // Initialize configuration and detect minimal API version return ConfigHelper.initAndValidate(resolvedImages, apiVersion, new ImageNameFormatter(project, buildTimeStamp), log); }
ClassLoader assetLoader = AssetClassLoader.classLoader(loader, mavenProject.getBasedir()); AssetCompiler compiler = new AssetCompiler(assetLoader, assetConf); dist.append("assets.pipeline.dev = {}\n"); dist.append("assets.pipeline.").append(env).append(" = {}\n"); File distFile = new File(output, "assets." + env + ".conf"); try (FileWriter writer = new FileWriter(distFile)) { writer.write(dist.toString());
File targetDirectory = new File( genDirectoryAidl, new File( relativeAidlFileName ).getParent() ); targetDirectory.mkdirs(); executor.setLogger( this.getLog() ); executor.setCaptureStdOut( true ); executor.executeCommand( getAndroidSdk().getAidlPath(), commands, project.getBasedir(), false );
File proguardFile = new File( unpackedLibFolder, "proguard.txt" ); if ( proguardFile.exists() ) proguardCommands.add( proguardDir + File.separator + "usage.txt" ); File mapFile = new File( proguardDir, "mapping.txt" ); try File tempConfigFile = new File ( proguardDir , "temp_config.cfg" ); executor.executeCommand( javaExecutable, commands, project.getBasedir(), false );
project.getBasedir() ); for ( String architecture : ndkArchitectures ) final File ndkLibsDirectory = new File( ndkOutputDirectory, architecture ); addSharedLibraries( zipArchiver, ndkLibsDirectory, architecture );
project.getBasedir() ); for ( String architecture : ndkArchitectures ) final File ndkLibsDirectory = new File( ndkOutputDirectory, architecture ); addSharedLibraries( jarArchiver, ndkLibsDirectory, architecture );
appcp.add(new File(buildOutputDirectory)); if (!"pom".equals(artifact.getType())) { appcp.add(new File(artifact.getFile().getAbsolutePath())); watchDirs.add(mavenProject.getBasedir()); watchDirs.addAll(refbasedir); if (this.watchDirs != null) { this.watchDirs.forEach(f -> watchDirs.add(new File(f))); ? new RunForkedApp(mavenProject.getBasedir(), debug, vmArgs, classpath, mId, mainClass, appcp, includes, excludes, watchDirStr) : new RunApp(mId, mainClass, appcp, includes, excludes, watchDirs); cmd.setWorkdir(mavenProject.getBasedir()); getLog().debug("cmd: " + cmd.debug());
for (MavenProject mod : getReactorProjects()) { try { File mpp = new File(project.getBasedir(), m); mpp = mpp.getCanonicalFile(); if (mpp.compareTo(mod.getBasedir()) == 0 && descendants.add(mod) && getLog().isDebugEnabled()) { getLog().debug(String.format("Descendant module %s added", mod.getName())); for (String mod : dec.getModules()) { try { File mpp = new File(dec.getBasedir(), mod); mpp = mpp.getCanonicalFile(); if (mpp.compareTo(p.getBasedir()) == 0) { addedDescendants.add(p);
getLog().info(String.format(infoLogTemplate, displayName)); final File pom = new File(prj.getBasedir(), "pom.xml"); final Dependency d; if (pom.isFile()) {
private boolean buildConfigured(BuildImageConfiguration config, ValueProvider valueProvider, MavenProject project) { if (isStringValueNull(valueProvider, config, FROM, () -> config.getFrom())) { return true; } if (valueProvider.getMap(FROM_EXT, config == null ? null : config.getFromExt()) != null) { return true; } if (isStringValueNull(valueProvider, config, DOCKER_FILE, () -> config.getDockerFileRaw() )) { return true; } if (isStringValueNull(valueProvider, config, DOCKER_ARCHIVE, () -> config.getDockerArchiveRaw())) { return true; } if (isStringValueNull(valueProvider, config, DOCKER_FILE_DIR, () -> config.getDockerFileDirRaw())) { return true; } // Simple Dockerfile mode return new File(project.getBasedir(),"Dockerfile").exists(); }
String pluginFilePath = new File( project.getBasedir(), plugin ).getAbsolutePath(); pluginParameters.add( "-plugin " + pluginFilePath ); String programFileName = new File( project.getBasedir(), program.getFilename() ).getAbsolutePath(); parameters.add( programFileName ); String testName = programFileName;
final FileSet webappSet = new FileSet(); try { resourcesSet.setDirectory(new File(project.getBasedir(), "src/main/resources").getCanonicalPath()); filtersSet.setDirectory(new File(project.getBasedir(), "src/main/filters").getCanonicalPath()); webappSet.setDirectory(new File(project.getBasedir(), "src/main/webapp").getCanonicalPath()); } catch (IOException ex) { if (exCol == null) { } else { try { fsCopy.setDirectory(new File(project.getBasedir(), copyFrom.getDirectory()).getCanonicalPath()); } catch (IOException ex) { if (exCol == null) {