Package org.apache.maven.model

Examples of org.apache.maven.model.Build


        // - if we're deploying within a phase then deploy has to be set, otherwise
        //   its not needed (we know we're not deploying in a phase when the artifactFile is null).
        if (this.deploy != null && this.deploy.equals(Boolean.TRUE.toString()) || artifactFile == null)
        {
            final Build build = this.project.getBuild();
            if (EXPLODED.equalsIgnoreCase(this.deploy))
            {
                artifactFile = new File(
                        build.getDirectory(),
                        build.getFinalName());
            }
            else if (artifactFile == null)
            {
                artifactFile = new File(
                        build.getDirectory(),
                        build.getFinalName() + '.' + this.getPackaging());
            }
            if (artifactFile.exists())
            {
                final File deployFile = this.getDeployFile();
                final File deployDirectory = new File(this.deployLocation);
View Full Code Here


            // - remove the parent
            final Parent parent = model.getParent();
            final List dependencies = new ArrayList(model.getDependencies());
            final String groupId = model.getGroupId();
            final Artifact artifact = this.project.getArtifact();
            final Build build = this.project.getBuild();
            final List developers = new ArrayList(model.getDevelopers());
            final List contributors = new ArrayList(model.getContributors());
            model.setGroupId(this.getBootstrapGroupId(artifact));
            model.setParent(null);
            model.setBuild(null);
View Full Code Here

     * @return the list of extra source directories.
     */
    private List getExtraSourceDirectories(final MavenProject project)
    {
        final List sourceDirectories = new ArrayList();
        final Build build = project.getBuild();
        if (build != null)
        {
            final PluginManagement pluginManagement = build.getPluginManagement();
            if (pluginManagement != null && !pluginManagement.getPlugins().isEmpty())
            {
                Plugin multiSourcePlugin = null;
                for (final Iterator iterator = pluginManagement.getPlugins().iterator(); iterator.hasNext();)
                {
View Full Code Here

                            "");
                    final String repositoryDirectoryPath =
                        artifactPath.substring(
                            0,
                            artifactPath.indexOf(artifactFileName));
                    final Build build = project.getBuild();
                    final File workDirectory = new File(build.getDirectory());
                    final File distributionDirectory =
                        new File(new File(
                                directory,
                                this.artifactDirectory), repositoryDirectoryPath);
                    if (workDirectory.exists())
                    {
                        final String finalName = build.getFinalName();
                        final String[] names = workDirectory.list();
                        if (names != null)
                        {
                            final int numberOfArtifacts = names.length;
                            for (int ctr = 0; ctr < numberOfArtifacts; ctr++)
View Full Code Here

        Map<String, String> managedVersions = new HashMap<String, String>();

        for ( int i = lineage.size() - 1; i >= 0; i-- )
        {
            Model model = lineage.get( i ).getModel();
            Build build = model.getBuild();
            if ( build != null )
            {
                for ( Plugin plugin : build.getPlugins() )
                {
                    String key = plugin.getKey();
                    if ( versions.get( key ) == null )
                    {
                        versions.put( key, plugin.getVersion() );
                        plugins.put( key, plugin );
                    }
                }
                PluginManagement mngt = build.getPluginManagement();
                if ( mngt != null )
                {
                    for ( Plugin plugin : mngt.getPlugins() )
                    {
                        String key = plugin.getKey();
View Full Code Here

            if ( profile.getBuild() != null )
            {
                if ( model.getBuild() == null )
                {
                    model.setBuild( new Build() );
                }
                merger.mergeBuildBase( model.getBuild(), profile.getBuild() );
            }
        }
    }
View Full Code Here

    {
        Model model = new Model();
        model.setGroupId( groupId );
        model.setArtifactId( artifactId );
        model.setVersion( version );
        model.setBuild( new Build() );
        return new MavenProject( model );
    }
View Full Code Here

    public void testShouldNotFailWhenPluginDepReferencesCurrentProject()
        throws CycleDetectedException, DuplicateProjectException
    {
        MavenProject project = createProject( "group", "artifact", "1.0" );

        Build build = project.getModel().getBuild();

        Plugin plugin = createPlugin( "other.group", "other-artifact", "1.0" );

        Dependency dep = createDependency( "group", "artifact", "1.0" );

        plugin.addDependency( dep );

        build.addPlugin( plugin );

        new ProjectSorter( Collections.singletonList( project ) );
    }
View Full Code Here

    public void testShouldNotFailWhenManagedPluginDepReferencesCurrentProject()
        throws CycleDetectedException, DuplicateProjectException
    {
        MavenProject project = createProject( "group", "artifact", "1.0" );

        Build build = project.getModel().getBuild();

        PluginManagement pMgmt = new PluginManagement();

        Plugin plugin = createPlugin( "other.group", "other-artifact", "1.0" );

        Dependency dep = createDependency( "group", "artifact", "1.0" );

        plugin.addDependency( dep );

        pMgmt.addPlugin( plugin );

        build.setPluginManagement( pMgmt );

        new ProjectSorter( Collections.singletonList( project ) );
    }
View Full Code Here

    public void testShouldNotFailWhenProjectReferencesNonExistentProject()
        throws CycleDetectedException, DuplicateProjectException
    {
        MavenProject project = createProject( "group", "artifact", "1.0" );

        Build build = project.getModel().getBuild();

        Extension extension = createExtension( "other.group", "other-artifact", "1.0" );

        build.addExtension( extension );

        new ProjectSorter( Collections.singletonList( project ) );
    }
View Full Code Here

TOP

Related Classes of org.apache.maven.model.Build

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.