Package org.apache.maven.artifact.handler

Examples of org.apache.maven.artifact.handler.DefaultArtifactHandler


    @Override
    public Set<Artifact> getDependencyArtifacts()
    {
        Artifact artifact =
            new DefaultArtifact( "junit", "junit", VersionRange.createFromVersion( "3.8.1" ), Artifact.SCOPE_TEST,
                                 "jar", null, new DefaultArtifactHandler( "jar" ), false );
        return Collections.singleton( artifact );
    }
View Full Code Here


        return file;
    }

    public ArtifactHandler getArtifactHandler()
    {
        return new DefaultArtifactHandler()
        {
            public String getExtension()
            {
                return "jar";
            }
View Full Code Here

        FeatureMetaDataExporter featureMetaDataExporter = new FeatureMetaDataExporter(baos);
       
        BundleRef bundle = new BundleRef("mvn:org.apache.example/example/1.0.0", 10);
        Artifact bundleArtifact = new DefaultArtifact("org.apache.example", "example", "1.0.0",
                                                      null, "jar", null,
                                                      new DefaultArtifactHandler());
        bundle.setArtifact(bundleArtifact);

        ArtifactRef configFile = new ArtifactRef("mvn:org.apache.example/example/1.0.0/cfg");
        Artifact configFileArtifact = new DefaultArtifact("org.apache.example", "example", "1.0.0",
                                                          null, "xml", "exampleconfig",
                                                          new DefaultArtifactHandler());
        configFile.setArtifact(configFileArtifact);

        Feature feature = new Feature("example");
        feature.addBundle(bundle);
        feature.addConfigFile(configFile);
View Full Code Here

    }

    private Artifact createArtifact( String groupId, String artifactId, String type, String version, String scope )
    {
        VersionRange versionRange = VersionRange.createFromVersion( version );
        ArtifactHandler handler = new DefaultArtifactHandler();

        return new DefaultArtifact( groupId, artifactId, versionRange, scope, type, null, handler );
    }
View Full Code Here

    }

    public static ArtifactHandler newHandler( Artifact artifact )
    {
        String type = artifact.getProperty( ArtifactProperties.TYPE, artifact.getExtension() );
        DefaultArtifactHandler handler = new DefaultArtifactHandler( type );
        handler.setExtension( artifact.getExtension() );
        handler.setLanguage( artifact.getProperty( ArtifactProperties.LANGUAGE, null ) );
        handler.setAddedToClasspath( Boolean.parseBoolean( artifact.getProperty( ArtifactProperties.CONSTITUTES_BUILD_PATH,
                                                                                 "" ) ) );
        handler.setIncludesDependencies( Boolean.parseBoolean( artifact.getProperty( ArtifactProperties.INCLUDES_DEPENDENCIES,
                                                                                     "" ) ) );
        return handler;
    }
View Full Code Here

    }

    private Artifact createArtifact( String groupId, String artifactId, String type, String version, String scope )
    {
        VersionRange versionRange = VersionRange.createFromVersion( version );
        ArtifactHandler handler = new DefaultArtifactHandler();

        return new DefaultArtifact( groupId, artifactId, versionRange, scope, type, null, handler );
    }
View Full Code Here

        {
            handler = artifactHandlers.get( type );

            if ( handler == null )
            {
                handler = new DefaultArtifactHandler( type );
            }
        }

        return handler;
    }
View Full Code Here

    private static Artifact createMockArtifact( final String groupId, final String artifactId,
                                                final String versionRange, final String scope, final String type,
                                                final String classifier )
    {
        ArtifactHandler artifactHandler = new DefaultArtifactHandler();

        VersionRange version = VersionRange.createFromVersion( versionRange );
        return new DefaultArtifact( groupId, artifactId, version, scope, type, classifier, artifactHandler );
    }
View Full Code Here

        ArtifactRepository localRepository =
            new DefaultArtifactRepository( "local", url, new DefaultRepositoryLayout() );

        ArtifactFactory artifactFactory = new DefaultArtifactFactory();

        DefaultArtifactHandler javaSourceArtifactHandler = new DefaultArtifactHandler( "java-source" );
        setVariableValueToObject( javaSourceArtifactHandler, "extension", "jar" );

        DefaultArtifactHandler javadocArtifactHandler = new DefaultArtifactHandler( "javadoc" );
        setVariableValueToObject( javadocArtifactHandler, "extension", "jar" );

        Map artifactHandlers = new HashMap();
        artifactHandlers.put( "java-source", javaSourceArtifactHandler );
        artifactHandlers.put( "javadoc", javadocArtifactHandler );
View Full Code Here

   
    //Fetch "org.inframesh.boot-jar"
    if(bootable) {
      VersionRange range = null;
      range = VersionRange.createFromVersion("1.0.0");
      Artifact bootJarArtifact = new DefaultArtifact("org.inframesh", "boot-jar", range, null, "jar", null, new DefaultArtifactHandler());
      String bootjarPath = localRepository.getBasedir() + File.separator + localRepository.pathOf(bootJarArtifact) + ".jar";
      try {
        JarUtil.decompress(bootjarPath, classesDirectory, "org.*");
      } catch (IOException e1) {
        e1.printStackTrace();
View Full Code Here

TOP

Related Classes of org.apache.maven.artifact.handler.DefaultArtifactHandler

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.