Java Code Examples for org.apache.maven.model.Build

The following examples show how to use org.apache.maven.model.Build. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: jkube   Source File: MavenUtilTest.java    License: Eclipse Public License 2.0 6 votes vote down vote up
private MavenProject getMavenProject() {
    MavenProject mavenProject = new MavenProject();
    mavenProject.setName("testProject");
    mavenProject.setGroupId("org.eclipse.jkube");
    mavenProject.setArtifactId("test-project");
    mavenProject.setVersion("0.1.0");
    mavenProject.setDescription("test description");
    Build build = new Build();
    build.setOutputDirectory("./target");
    build.setDirectory(".");
    mavenProject.setBuild(build);
    DistributionManagement distributionManagement = new DistributionManagement();
    Site site = new Site();
    site.setUrl("https://www.eclipse.org/jkube/");
    distributionManagement.setSite(site);
    mavenProject.setDistributionManagement(distributionManagement);
    return mavenProject;
}
 
Example 2
Source Project: vertx-maven-plugin   Source File: InitializeMojoTest.java    License: Apache License 2.0 6 votes vote down vote up
private InitializeMojo createMojoInstance() throws PlexusContainerException {
    InitializeMojo mojo = new InitializeMojo();
    mojo.project = new MavenProject();
    mojo.repositorySystem = new DefaultRepositorySystem();
    mojo.repositorySystemSession = new DefaultRepositorySystemSession();
    mojo.buildPluginManager = new DefaultBuildPluginManager();
    mojo.container = new DefaultPlexusContainer(new DefaultContainerConfiguration());
    mojo.mavenSession = new MavenSession(mojo.container, mojo.repositorySystemSession, new DefaultMavenExecutionRequest(),
        new DefaultMavenExecutionResult());

    mojo.lifecycleExecutor = new DefaultLifecycleExecutor();
    mojo.scmManager = new DefaultScmManager();
    mojo.remoteRepositories = Collections.emptyList();
    mojo.projectBuildDir = OUT.getAbsolutePath();

    Build build = new Build();
    build.setOutputDirectory(OUT.getAbsolutePath());
    mojo.project.setBuild(build);

    return mojo;
}
 
Example 3
Source Project: netbeans   Source File: CosChecker.java    License: Apache License 2.0 6 votes vote down vote up
private static File getCoSFile(MavenProject mp, boolean test) {
    if (mp == null) {
        return null;
    }
    Build build = mp.getBuild();
    if (build == null) {
        return null;
    }
    String path = test ? build.getTestOutputDirectory() : build.getOutputDirectory();
    if (path == null) {
        return null;
    }
    File fl = new File(path);
    fl = FileUtil.normalizeFile(fl);
    return  new File(fl, NB_COS);
}
 
Example 4
Source Project: netbeans   Source File: DeploymentHelper.java    License: Apache License 2.0 6 votes vote down vote up
private static boolean touchCoSTimeStamp(RunConfig rc, long stamp) {
    if (rc.getProject() == null) {
        return false;
    }
    Build build = rc.getMavenProject().getBuild();
    if (build == null || build.getOutputDirectory() == null) {
        return false;
    }
    File fl = new File(build.getOutputDirectory());
    fl = FileUtil.normalizeFile(fl);
    if (!fl.exists()) {
        //the project was not built
        return false;
    }
    File check = new File(fl, NB_COS);
    if (!check.exists()) {
        try {
            return check.createNewFile();
        } catch (IOException ex) {
            return false;
        }
    }
    return check.setLastModified(stamp);
}
 
Example 5
private Multimap<ArtifactCoordinates, ArtifactCoordinates> getSnapshotsFromManagement(MavenProject project,
    PomPropertyResolver propertyResolver) {
  this.log.debug("\t\tChecking managed plugins");
  Multimap<ArtifactCoordinates, ArtifactCoordinates> result = HashMultimap.create();
  Build build = project.getBuild();
  if (build != null) {
    PluginManagement pluginManagement = build.getPluginManagement();
    if (pluginManagement != null) {
      for (Plugin plugin : pluginManagement.getPlugins()) {
        Collection<Dependency> snapshots = Collections2.filter(plugin.getDependencies(),
            new IsSnapshotDependency(propertyResolver));
        if (!snapshots.isEmpty()) {
          result.putAll(PluginToCoordinates.INSTANCE.apply(plugin),
              Collections2.transform(snapshots, DependencyToCoordinates.INSTANCE));
        }
      }
    }
  }
  return result;
}
 
Example 6
private Multimap<ArtifactCoordinates, ArtifactCoordinates> getSnapshots(MavenProject project,
    PomPropertyResolver propertyResolver) {
  this.log.debug("\t\tChecking direct plugin references");
  Multimap<ArtifactCoordinates, ArtifactCoordinates> result = HashMultimap.create();
  Build build = project.getBuild();
  if (build != null) {
    for (Plugin plugin : build.getPlugins()) {
      Collection<Dependency> snapshots = Collections2.filter(plugin.getDependencies(),
          new IsSnapshotDependency(propertyResolver));
      if (!snapshots.isEmpty()) {
        result.putAll(PluginToCoordinates.INSTANCE.apply(plugin),
            Collections2.transform(snapshots, DependencyToCoordinates.INSTANCE));
      }
    }
  }
  return result;
}
 
Example 7
private void addBuildPlugin(Model model, boolean updatePomOption) {
    logger.debug(model.getArtifactId() + " temporary add build plugin");

    Plugin plugin = asPlugin();

    PluginExecution execution = new PluginExecution();
    execution.setId(GOAL);
    execution.getGoals().add(GOAL);
    plugin.getExecutions().add(execution);

    if (model.getBuild() == null) {
        model.setBuild(new Build());
    }
    model.getBuild().getPlugins().add(plugin);

    // set plugin properties
    model.getProperties().setProperty(propertyKeyPrefix + propertyKeyUpdatePom, Boolean.toString(updatePomOption));
}
 
Example 8
/**
 * Finds the ancestor project which defines the rule.
 *
 * @param project to inspect
 * @return the defining ancestor project.
 */
final MavenProject findDefiningParent( final MavenProject project )
{
    final Xpp3Dom invokingRule = createInvokingRuleDom();
    MavenProject parent = project;
    while ( parent != null )
    {
        final Model model = parent.getOriginalModel();
        final Build build = model.getBuild();
        if ( build != null )
        {
            final List<Xpp3Dom> rules = getRuleConfigurations( build );
            if ( isDefiningProject( rules, invokingRule ) )
            {
                break;
            }
        }
        parent = parent.getParent();
    }
    return parent;
}
 
Example 9
/**
 * Returns the rule configurations from the <tt>pluginManagement</tt> as well
 * as the <tt>plugins</tt> section.
 *
 * @param build the build to inspect.
 * @return configuration of the rules, may be an empty list.
 */
final List<Xpp3Dom> getRuleConfigurations( final Build build )
{
    @SuppressWarnings( "unchecked" )
    final Map<String, Plugin> plugins = build.getPluginsAsMap();
    final List<Xpp3Dom> ruleConfigurationsForPlugins = getRuleConfigurations( plugins );
    final PluginManagement pluginManagement = build.getPluginManagement();
    if ( pluginManagement != null )
    {
        @SuppressWarnings( "unchecked" )
        final Map<String, Plugin> pluginsFromManagementAsMap = pluginManagement.getPluginsAsMap();
        List<Xpp3Dom> ruleConfigurationsFromManagement = getRuleConfigurations( pluginsFromManagementAsMap );
        ruleConfigurationsForPlugins.addAll( ruleConfigurationsFromManagement );
    }
    return ruleConfigurationsForPlugins;
}
 
Example 10
/**
 * Test of execute method, of class RequirePropertyDiverges.
 */
@Test
public void testExecuteInParentWithConfigurationInPluginManagement() throws EnforcerRuleException
{
    RequirePropertyDiverges mockInstance = createMockRule();
    final MavenProject project = createMavenProject( "company", "company-parent-pom" );
    final Build build = new Build();
    // create pluginManagement
    final Plugin pluginInManagement = newPlugin( "org.apache.maven.plugins", "maven-enforcer-plugin", "1.0");
    final Xpp3Dom configuration = createPluginConfiguration();
    pluginInManagement.setConfiguration( configuration );
    final PluginManagement pluginManagement = new PluginManagement();
    pluginManagement.addPlugin( pluginInManagement );
    build.setPluginManagement( pluginManagement );
    // create plugins
    final Plugin pluginInPlugins = newPlugin( "org.apache.maven.plugins", "maven-enforcer-plugin", "1.0");
    build.addPlugin( pluginInPlugins );
    // add build
    project.getOriginalModel().setBuild( build );
    //project.getOriginalModel().setBuild( build );
    setUpHelper( project, "parentValue" );
    mockInstance.execute( helper );
}
 
Example 11
/**
 * Test of execute method, of class RequirePropertyDiverges.
 */
@Test
public void testExecuteInParentWithConfigurationInExecution() throws EnforcerRuleException
{
    RequirePropertyDiverges mockInstance = createMockRule();
    final MavenProject project = createMavenProject( "company", "company-parent-pom" );
    final Build build = new Build();
    build.setPluginManagement( new PluginManagement() );
    final Plugin plugin = newPlugin( "org.apache.maven.plugins", "maven-enforcer-plugin", "1.0" );
    final Xpp3Dom configuration = createPluginConfiguration();
    PluginExecution pluginExecution = new PluginExecution();
    pluginExecution.setConfiguration( configuration );
    plugin.addExecution( pluginExecution );
    build.addPlugin( plugin );
    project.getOriginalModel().setBuild( build );
    setUpHelper(project, "parentValue");
    mockInstance.execute( helper );
}
 
Example 12
private DirectoryResource getTargetDirectory(Project project)
{
   MavenFacet mavenFacet = project.getFacet(MavenFacet.class);
   Build build = mavenFacet.getModel().getBuild();
   String targetFolderName;
   if (build != null && build.getOutputDirectory() != null)
   {
      targetFolderName = mavenFacet.resolveProperties(build.getOutputDirectory());
   }
   else
   {
      targetFolderName = "target" + File.separator + "classes";
   }
   DirectoryResource projectRoot = project.getRoot().reify(DirectoryResource.class);
   return projectRoot.getChildDirectory(targetFolderName);
}
 
Example 13
private static Set<Dependency> extractPluginDependenciesFromPluginsInPluginManagement( Build build )
{
    Set<Dependency> result = new TreeSet<>( new DependencyComparator() );
    if ( build.getPluginManagement() != null )
    {
        for ( Plugin plugin : build.getPluginManagement().getPlugins() )
        {
            if ( plugin.getDependencies() != null && !plugin.getDependencies().isEmpty() )
            {
                for ( Dependency pluginDependency : plugin.getDependencies() )
                {
                    result.add( pluginDependency );
                }
            }
        }
    }
    return result;
}
 
Example 14
@Test
public void mustNotThrowExceptionWhenDirectoryDoesntExist() throws Exception {
    File mainDir = null;
    try {
        // create a folder and delete it right away
        mainDir = Files.createTempDirectory(getClass().getSimpleName()).toFile();
        File fakeFolder = new File(mainDir, "DOESNOTEXIST");
        
        // mock
        Mockito.when(mavenProject.getCompileClasspathElements()).thenReturn(Collections.emptyList());
        Build build = Mockito.mock(Build.class);
        Mockito.when(mavenProject.getBuild()).thenReturn(build);
        Mockito.when(build.getOutputDirectory()).thenReturn(fakeFolder.getAbsolutePath());
        
        // execute plugin
        fixture.execute();
    } finally {
        if (mainDir != null) {
            FileUtils.deleteDirectory(mainDir);
        }
    }
}
 
Example 15
@Test
public void mustNotThrowExceptionWhenDirectoryDoesntExist() throws Exception {
    File testDir = null;
    try {
        // create a folder and delete it right away
        testDir = Files.createTempDirectory(getClass().getSimpleName()).toFile();
        File fakeFolder = new File(testDir, "DOESNOTEXIST");
        
        // mock
        Mockito.when(mavenProject.getTestClasspathElements()).thenReturn(Collections.emptyList());
        Build build = Mockito.mock(Build.class);
        Mockito.when(mavenProject.getBuild()).thenReturn(build);
        Mockito.when(build.getTestOutputDirectory()).thenReturn(fakeFolder.getAbsolutePath());
        
        // execute plugin
        fixture.execute();
    } finally {
        if (testDir != null) {
            FileUtils.deleteDirectory(testDir);
        }
    }
}
 
Example 16
@Test
public void test() throws Exception {
    final File file = new File(getClass().getResource("/yang").getFile());
    final File excludedYang = new File(getClass().getResource("/yang/excluded-file.yang").getFile());
    final String path = file.getPath();
    final CodeGeneratorArg codeGeneratorArg = new CodeGeneratorArg(GeneratorMock.class.getName(),
            "target/YangToSourcesProcessorTest-outputBaseDir");
    final List<CodeGeneratorArg> codeGenerators = ImmutableList.of(codeGeneratorArg);
    final MavenProject mvnProject = Mockito.mock(MavenProject.class);
    final Build build = new Build();
    Mockito.when(mvnProject.getBuild()).thenReturn(build);
    final boolean dependencies = true;
    final YangToSourcesProcessor proc = new YangToSourcesProcessor(file, ImmutableList.of(excludedYang),
        codeGenerators, mvnProject, dependencies, YangProvider.getInstance());
    Assert.assertNotNull(proc);
    proc.execute();
}
 
Example 17
Source Project: docker-maven-plugin   Source File: DockerAssemblyManager.java    License: Apache License 2.0 6 votes vote down vote up
private File ensureThatArtifactFileIsSet(MavenProject project) {
    Artifact artifact = project.getArtifact();
    if (artifact == null) {
        return null;
    }
    File oldFile = artifact.getFile();
    if (oldFile != null) {
        return oldFile;
    }
    Build build = project.getBuild();
    if (build == null) {
        return null;
    }
    String finalName = build.getFinalName();
    String target = build.getDirectory();
    if (finalName == null || target == null) {
        return null;
    }
    File artifactFile = new File(target, finalName + "." + project.getPackaging());
    if (artifactFile.exists() && artifactFile.isFile()) {
        setArtifactFile(project, artifactFile);
    }
    return null;
}
 
Example 18
Source Project: pitest   Source File: BasePitMojoTest.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void setUp() throws Exception {
  super.setUp();
  MockitoAnnotations.initMocks(this);
  this.classPath = new ArrayList<>(FCollection.map(
      ClassPath.getClassPathElementsAsFiles(), fileToString()));
  when(this.project.getTestClasspathElements()).thenReturn(this.classPath);
  when(this.project.getPackaging()).thenReturn("jar");
  
  final Build build = new Build();
  build.setOutputDirectory("");
  
  when(this.project.getBuild()).thenReturn(build);
  
  when(this.plugins.findToolClasspathPlugins()).thenReturn(
      Collections.emptyList());
  when(this.plugins.findClientClasspathPlugins()).thenReturn(
      Collections.emptyList());
}
 
Example 19
@Test
public void projectUnchangedWhenModeIsNone()
    throws Exception
{
    final Plugin plugin = new Plugin();
    plugin.setGroupId( MAVEN_PLUGIN_GROUPID );
    plugin.setArtifactId( MAVEN_DEPLOY_ARTIFACTID );
    plugin.setConfiguration( simpleSkipConfig( true ) );

    final Build build = new Build();
    build.addPlugin( plugin );

    final Model model = new Model();
    model.setModelVersion( "4.0.0" );
    model.setGroupId( "org.foo" );
    model.setArtifactId( "bar" );
    model.setVersion( "1" );

    model.setBuild( build );

    applyTest( none, model, null );
}
 
Example 20
@Test
public void projectDeploySkipTurnedOffWhenModeIsOff()
    throws Exception
{
    final Plugin plugin = new Plugin();
    plugin.setGroupId( MAVEN_PLUGIN_GROUPID );
    plugin.setArtifactId( MAVEN_DEPLOY_ARTIFACTID );
    plugin.setConfiguration( simpleSkipConfig( true ) );

    final Build build = new Build();
    build.addPlugin( plugin );

    final Model model = new Model();
    model.setModelVersion( "4.0.0" );
    model.setGroupId( "org.foo" );
    model.setArtifactId( "bar" );
    model.setVersion( "1" );

    model.setBuild( build );

    applyTest( off, model, model );
    assertSkip( model, null );
}
 
Example 21
Source Project: deadcode4j   Source File: A_ModuleGenerator.java    License: Apache License 2.0 6 votes vote down vote up
private MavenProject givenMavenProject(String projectId) {
    MavenProject mavenProject = new MavenProject();
    mavenProject.setGroupId("de.is24.junit");
    mavenProject.setArtifactId(projectId);
    mavenProject.setVersion("42");
    mavenProject.getProperties().setProperty("project.build.sourceEncoding", "UTF-8");
    ArtifactStub projectArtifact = new ArtifactStub();
    projectArtifact.setGroupId("de.is24.junit");
    projectArtifact.setArtifactId(projectId);
    projectArtifact.setVersion("42");
    mavenProject.setArtifact(projectArtifact);
    Build build = new Build();
    build.setOutputDirectory(tempFileRule.getTempFile().getParent());
    mavenProject.setBuild(build);
    return mavenProject;
}
 
Example 22
Source Project: netbeans   Source File: ActionToGoalUtils.java    License: Apache License 2.0 5 votes vote down vote up
public static boolean isActionEnable(String action, NbMavenProjectImpl project, Lookup lookup) {
   
    PackagingProvider packProv = new PackagingProvider(project);
    M2ConfigProvider configs = project.getLookup().lookup(M2ConfigProvider.class);
    M2Configuration activeConfiguration = configs.getActiveConfiguration();        
    if(isActionEnable(activeConfiguration, action, project, packProv, lookup)) {
        return true;
    }
    //check fallback default config as well..
    if(isActionEnable(configs.getDefaultConfig(), action, project, packProv, lookup)) {
        return true;
    }
    if (ActionProvider.COMMAND_BUILD.equals(action) ||
            ActionProvider.COMMAND_REBUILD.equals(action)) {
        Build bld = project.getOriginalMavenProject().getBuild();
        if (bld != null) {
            String goal = bld.getDefaultGoal();
            if (goal != null && goal.trim().length() > 0) {
                return true;
            }
        }
    }
    
    for (MavenActionsProvider add : actionProviders(project)) {
        if(isActionEnable(add, action, project, packProv, lookup)) {
            return true;
        }
    }
    return false;
}
 
Example 23
Source Project: smart-testing   Source File: SurefireReportStorage.java    License: Apache License 2.0 5 votes vote down vote up
static void copySurefireReports(Model model) {
    Build build = model.getBuild();
    if (build != null && build.getDirectory() != null) {
        File targetDir = new File(build.getDirectory());
        if (targetDir.exists() && targetDir.isDirectory()) {
            File[] surefireReports =
                targetDir.listFiles(file -> file.isDirectory() && SUREFIRE_REPORTS_DIR_NAME.equals(file.getName()));
            if (surefireReports.length > 0) {
                copyReportsDirectory(model, surefireReports[0]);
            }
        }
    }
}
 
Example 24
Source Project: smart-testing   Source File: SurefireReportStorageTest.java    License: Apache License 2.0 5 votes vote down vote up
@Before
public void prepareMocks() throws IOException {
    surefireReportsDir = folder.newFolder(SUREFIRE_REPORTS_DIR_NAME);
    projectDir = folder.newFolder();

    project = mock(Model.class);
    when(project.getProjectDirectory()).thenReturn(projectDir);

    Build build = mock(Build.class);
    when(project.getBuild()).thenReturn(build);
    when(build.getDirectory()).thenReturn(surefireReportsDir.getParent());
}
 
Example 25
Source Project: smart-testing   Source File: SkipInstallationCheckerTest.java    License: Apache License 2.0 5 votes vote down vote up
private MavenSession setUpMavenSession(List<String> goals, String defaultGoal) {
    Build build = Mockito.mock(Build.class);
    Mockito.when(build.getDefaultGoal()).thenReturn(defaultGoal);

    MavenProject topLevelProject = Mockito.mock(MavenProject.class);
    Mockito.when(topLevelProject.getBuild()).thenReturn(build);

    MavenSession mavenSession = Mockito.mock(MavenSession.class);
    Mockito.when(mavenSession.getGoals()).thenReturn(goals);
    Mockito.when(mavenSession.getTopLevelProject()).thenReturn(topLevelProject);

    return mavenSession;
}
 
Example 26
Source Project: smart-testing   Source File: CustomProvidersTest.java    License: Apache License 2.0 5 votes vote down vote up
private Plugin prepareModelWithPluginDep(Model model, Dependency junit5Dep) {
    Build build = prepareBuildWithSurefirePlugin("2.19.1");
    Mockito.when(model.getBuild()).thenReturn(build);

    Mockito.when(model.getProjectDirectory()).thenReturn(tmpFolder);
    Plugin plugin = build.getPlugins().get(0);
    plugin.addDependency(junit5Dep);
    return plugin;
}
 
Example 27
Source Project: smart-testing   Source File: ModelUtil.java    License: Apache License 2.0 5 votes vote down vote up
static Build prepareBuildWithSurefirePlugin(String version) {
    Plugin surefirePlugin = new Plugin();
    surefirePlugin.setArtifactId(ApplicablePlugins.SUREFIRE.getArtifactId());
    surefirePlugin.setVersion(version);

    Build build = new Build();
    build.addPlugin(surefirePlugin);

    return build;
}
 
Example 28
Source Project: scava   Source File: BuildManager.java    License: Eclipse Public License 2.0 5 votes vote down vote up
private void rewritePOM(File pomFile) throws BuildException {
	try (Reader reader = new FileReader(pomFile)) {
		MavenXpp3Reader pomReader = new MavenXpp3Reader();
		
		Model model = pomReader.read(reader);
		reader.close();
		
		model.addRepository(createRepo("maven_central", "http://repo.maven.apache.org/maven2/", "default"));
		
		for (String id: eclipseRepos.keySet()) {
			model.addRepository(createRepo(id, eclipseRepos.get(id), "p2"));
		}
		
		Build modelBuild = model.getBuild();
		if (modelBuild == null) {
			model.setBuild(new Build());
		}
		
		model.getBuild().addPlugin(createPlugin("org.eclipse.tycho", "tycho-maven-plugin", "0.21.0", true));
		model.getBuild().addPlugin(createPlugin("org.eclipse.tycho", "target-platform-configuration", "0.21.0", false));
		model.getBuild().addPlugin(createPlugin("org.apache.maven.plugins", "maven-dependency-plugin", "2.8", false));
		
		MavenXpp3Writer pomWriter = new MavenXpp3Writer();
		pomWriter.write(new FileWriter(pomFile), model);
	} 
	catch (Exception e) {
		throw new BuildException("POM rewriting (to add plugin dependencies, cause) failed unexpectedly", e);
	}
}
 
Example 29
Source Project: vertx-maven-plugin   Source File: PackageMojoTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void testOutputFileNameComputation() {
    MavenProject project =  new MavenProject();
    Build build = new Build();
    project.setBuild(build);
    project.setArtifactId("some-artifact-id");
    project.setVersion("1.0-SNAPSHOT");
    build.setFinalName("some-artifact-id-1.0-SNAPSHOT-GA");

    // finale name set
    String fn = PackageMojo.computeOutputName(project, null);
    assertThat(fn).isEqualTo("some-artifact-id-1.0-SNAPSHOT-GA.jar");

    // final name set with .jar
    build.setFinalName("some-artifact-id-1.0-SNAPSHOT-GA2.jar");
    fn = PackageMojo.computeOutputName(project, null);
    assertThat(fn).isEqualTo("some-artifact-id-1.0-SNAPSHOT-GA2.jar");

    // same as 1 with classifier
    build.setFinalName("some-artifact-id-1.0-SNAPSHOT-GA");
    fn = PackageMojo.computeOutputName(project, "fat");
    assertThat(fn).isEqualTo("some-artifact-id-1.0-SNAPSHOT-GA-fat.jar");

    // same as 2 with classifier
    build.setFinalName("some-artifact-id-1.0-SNAPSHOT-GA2.jar");
    fn = PackageMojo.computeOutputName(project, "fat");
    assertThat(fn).isEqualTo("some-artifact-id-1.0-SNAPSHOT-GA2-fat.jar");

    // no final name
    build.setFinalName(null);
    fn = PackageMojo.computeOutputName(project, "");
    assertThat(fn).isEqualTo("some-artifact-id-1.0-SNAPSHOT.jar");

    // no final name with classifier
    build.setFinalName(null);
    fn = PackageMojo.computeOutputName(project, "fat");
    assertThat(fn).isEqualTo("some-artifact-id-1.0-SNAPSHOT-fat.jar");
}
 
Example 30
private Set<ArtifactCoordinates> getSnapshotsFromManagement(MavenProject project,
    PomPropertyResolver propertyResolver) {
  this.log.debug("\t\tChecking managed plugins");
  Build build = project.getBuild();
  if (build != null) {
    PluginManagement pluginManagement = build.getPluginManagement();
    if (pluginManagement != null) {
      Collection<Plugin> snapshots = Collections2.filter(pluginManagement.getPlugins(),
          new IsSnapshotPlugin(propertyResolver));
      return Sets.newHashSet(Collections2.transform(snapshots, PluginToCoordinates.INSTANCE));
    }
  }
  return Collections.emptySet();
}